Fresh pull from upstream (might have missed some non-free things).
authorRISCi_ATOM <bob@bobcall.me>
Fri, 23 Mar 2018 18:42:31 +0000 (14:42 -0400)
committerRISCi_ATOM <bob@bobcall.me>
Fri, 23 Mar 2018 18:42:31 +0000 (14:42 -0400)
1998 files changed:
admin/debootstrap/Makefile
admin/debootstrap/patches/100-busybox_fix.patch [deleted file]
admin/htop/Makefile
admin/htop/patches/100-fix-libtool-version-check.patch [deleted file]
admin/ipmitool/Makefile [new file with mode: 0644]
admin/monit/Makefile
admin/monit/patches/001-fix-default-piddir.patch
admin/muninlite/Makefile
admin/netdata/Makefile
admin/netdata/files/netdata.conf
admin/netdata/patches/001-disable_external_plugins_by_default.patch
admin/openwisp-config/Makefile
admin/sudo/Makefile
admin/syslog-ng/Makefile
admin/syslog-ng/files/syslog-ng.conf
admin/syslog-ng/files/syslog-ng.init
admin/syslog-ng/patches/100-use-1.0.2k-threadids.patch [new file with mode: 0644]
admin/zabbix/Makefile
admin/zabbix/files/mac80211
admin/zabbix/patches/110-reproducible-builds.patch [new file with mode: 0644]
alpha_notes [new file with mode: 0644]
devel/autoconf/Makefile
devel/automake/Makefile [new file with mode: 0644]
devel/diffutils/Makefile
devel/gcc/Makefile
devel/libtool-bin/Makefile
devel/lpc21isp/Makefile
devel/lpc21isp/patches/100-fix-reproducible-builds.patch [new file with mode: 0644]
devel/lttng-modules/Makefile
devel/lttng-tools/Makefile
devel/m4/Makefile
devel/make/Makefile
devel/patch/Makefile
devel/pkg-config/Makefile
ipv6/aiccu/Makefile [deleted file]
ipv6/aiccu/files/aiccu.hotplug [deleted file]
ipv6/aiccu/files/aiccu.sh [deleted file]
ipv6/aiccu/patches/100-cross_compile.patch [deleted file]
ipv6/aiccu/patches/200-add_dn_skipname.patch [deleted file]
ipv6/aiccu/patches/300-resolver-uclibc.patch [deleted file]
ipv6/aiccu/patches/400-musl-compat.patch [deleted file]
ipv6/aiccu/patches/500-gnutls_3.4.patch [deleted file]
ipv6/tayga/Makefile
kernel/mtd-rw/Makefile
lang/chardet/Makefile [deleted file]
lang/django-appconf/Makefile [deleted file]
lang/django-compressor/Makefile [deleted file]
lang/django-constance/Makefile [deleted file]
lang/django-jsonfield/Makefile [deleted file]
lang/django-picklefield/Makefile [deleted file]
lang/django-postoffice/Makefile [deleted file]
lang/django-restframework/Makefile [deleted file]
lang/django-statici18n/Makefile [deleted file]
lang/django/Makefile [deleted file]
lang/dkjson/Makefile
lang/erlang/Makefile
lang/et_xmlfile/Makefile [deleted file]
lang/flup/Makefile [deleted file]
lang/gunicorn/Makefile [deleted file]
lang/jamvm/Makefile
lang/jdcal/Makefile [deleted file]
lang/json4lua/Makefile
lang/ldbus/Makefile [new file with mode: 0644]
lang/lpeg/Makefile
lang/lua-cjson/Makefile
lang/lua-copas/Makefile
lang/lua-coxpcall/Makefile
lang/lua-lsqlite3/Makefile
lang/lua-lzlib/Makefile
lang/lua-md5/Makefile
lang/lua-mobdebug/Makefile
lang/lua-mosquitto/Makefile [new file with mode: 0644]
lang/lua-openssl/Makefile
lang/lua-penlight/Makefile
lang/lua-rings/Makefile
lang/lua-rs232/Makefile
lang/lua-rs232/patches/100-remove-build-timestamps.patch [new file with mode: 0644]
lang/lua-sha2/Makefile
lang/lua-wsapi/Makefile
lang/lua-xavante/Makefile
lang/luabitop/Makefile
lang/luaexpat/Makefile
lang/luafilesystem/Makefile
lang/luai2c/Makefile [changed mode: 0755->0644]
lang/luajit/Makefile [new file with mode: 0644]
lang/luajit/patches/010-lua-path.patch [new file with mode: 0644]
lang/lualanes/Makefile
lang/luaposix/Makefile
lang/luarocks/Makefile
lang/luasec/Makefile
lang/luasoap/Makefile
lang/luasocket/Makefile
lang/luasocket/patches/0301-Fix-mpc85xx-build.patch [new file with mode: 0644]
lang/luasql/Makefile
lang/luv/Config.in [new file with mode: 0644]
lang/luv/Makefile [new file with mode: 0644]
lang/lzmq/Makefile
lang/micropython-lib/Makefile [deleted file]
lang/micropython/Makefile [deleted file]
lang/micropython/patches/000-Makefile-no-errors [deleted file]
lang/node-arduino-firmata/Makefile
lang/node-cylon/Makefile
lang/node-cylon/patches/0001-serialport.patch
lang/node-hid/Makefile
lang/node-serialport/Makefile
lang/node/Makefile
lang/node/patches/001-hardfloat.patch
lang/node/patches/002-addr_info.patch
lang/node/patches/003-path.patch
lang/node/patches/004-node_crypto-remove-std.patch [new file with mode: 0644]
lang/openpyxl/Makefile [deleted file]
lang/perl-authen-sasl-xs/Makefile [new file with mode: 0644]
lang/perl-authen-sasl-xs/patches/100-remove-devel-checklib-checks.patch [new file with mode: 0644]
lang/perl-authen-sasl/Makefile [new file with mode: 0644]
lang/perl-cgi/Makefile
lang/perl-compress-bzip2/Makefile
lang/perl-dbi/Makefile
lang/perl-device-serialport/Makefile
lang/perl-device-usb/Makefile
lang/perl-encode-locale/Makefile
lang/perl-file-listing/Makefile
lang/perl-file-sharedir-install/Makefile
lang/perl-html-form/Makefile
lang/perl-html-parser/Makefile
lang/perl-html-tagset/Makefile
lang/perl-html-tree/Makefile
lang/perl-http-cookies/Makefile
lang/perl-http-daemon/Makefile
lang/perl-http-date/Makefile
lang/perl-http-message/Makefile
lang/perl-http-negotiate/Makefile
lang/perl-http-server-simple/Makefile
lang/perl-inline-c/Makefile
lang/perl-inline/Makefile
lang/perl-io-html/Makefile
lang/perl-lockfile-simple/Makefile
lang/perl-lwp-mediatypes/Makefile
lang/perl-net-http/Makefile
lang/perl-net-telnet/Makefile
lang/perl-parse-recdescent/Makefile
lang/perl-sub-uplevel/Makefile
lang/perl-test-harness/Makefile
lang/perl-test-warn/Makefile
lang/perl-text-csv_xs/Makefile [new file with mode: 0644]
lang/perl-uri/Makefile
lang/perl-www-curl/Makefile
lang/perl-www-mechanize/Makefile
lang/perl-www-robotrules/Makefile
lang/perl-www/Makefile
lang/perl-xml-parser/Makefile
lang/perl/Makefile
lang/perl/files/aarch64.config [new file with mode: 0644]
lang/perl/files/arm.config
lang/perl/files/armeb.config
lang/perl/files/base.config
lang/perl/files/i486.config
lang/perl/files/mips.config
lang/perl/files/mips64.config
lang/perl/files/mipsel.config
lang/perl/files/powerpc.config
lang/perl/files/version.config
lang/perl/files/x86_64.config
lang/perl/patches/020-host-libc-dir-moved-debian+derivatives.patch [deleted file]
lang/perl/patches/110-always_use_miniperl.patch
lang/perl/patches/120-remove-build-timestamp.patch [new file with mode: 0644]
lang/perl/patches/310-recompile-hack.patch [deleted file]
lang/perl/patches/320-copy-pod-hack.patch [new file with mode: 0644]
lang/perl/patches/700-tie_fetch_count_t-handle_missing_crypt.patch [deleted file]
lang/perl/patches/900-CVE-2015-8607.patch [deleted file]
lang/perl/patches/900-use-rm-force.patch [new file with mode: 0644]
lang/perl/patches/901-CVE-2016-2381.patch [deleted file]
lang/perl/patches/910-miniperl-needs-inc-dot.patch [new file with mode: 0644]
lang/perl/perlmod.mk
lang/php7-pecl-dio/Makefile
lang/php7-pecl-http/Makefile
lang/php7-pecl-http/patches.old/100_config9-m4.patch [deleted file]
lang/php7-pecl-http/patches/200-string_or_null_register.patch [new file with mode: 0644]
lang/php7-pecl-libevent/Makefile
lang/php7-pecl-propro/Makefile
lang/php7-pecl-raphf/Makefile
lang/php7/Makefile
lang/php7/patches/0013-Add-support-for-use-of-the-system-timezone-database.patch
lang/php7/patches/0041-Add-patch-to-remove-build-timestamps-from-generated-.patch
lang/php7/patches/0050-remove-build-timestamps.patch [new file with mode: 0644]
lang/php7/patches/1003-Fix-dl-cross-compiling-issue.patch
lang/php7/patches/1004-disable-phar-command.patch
lang/php7/patches/1005-fix-asm-constraints-in-aarch64-multiply-macro.patch [deleted file]
lang/php7/patches/1006-multiline-syslog.patch [new file with mode: 0644]
lang/php7/patches/1008-acinclude-valgrind.patch [new file with mode: 0644]
lang/php7/patches/1010-pcrelib-NativeMIPS.patch [new file with mode: 0644]
lang/php7/patches/1012-php_iconv_string-null-out-pointer.patch [new file with mode: 0644]
lang/pillow/Makefile [deleted file]
lang/pillow/patches/010-fix-paths.patch [deleted file]
lang/python-attrs/Makefile [deleted file]
lang/python-cffi/Makefile [deleted file]
lang/python-crcmod/Makefile [deleted file]
lang/python-crypto/Makefile [deleted file]
lang/python-crypto/patches/001-no-host-paths.patch [deleted file]
lang/python-crypto/patches/002-fix-endianness-detect.patch [deleted file]
lang/python-cryptography/Makefile [deleted file]
lang/python-dateutil/Makefile [deleted file]
lang/python-dns/Makefile [deleted file]
lang/python-egenix-mx-base/Makefile [deleted file]
lang/python-enum34/Makefile [deleted file]
lang/python-enum34/patches/001-omit-docs.patch [deleted file]
lang/python-gmpy2/Makefile [deleted file]
lang/python-idna/Makefile [deleted file]
lang/python-ipaddress/Makefile [deleted file]
lang/python-ldap/Makefile [deleted file]
lang/python-ldap/patches/010-setup_cfg.patch [deleted file]
lang/python-mysql/Makefile [deleted file]
lang/python-mysql/patches/010-threadsafe.patch [deleted file]
lang/python-packages/Makefile [deleted file]
lang/python-packages/README.md [deleted file]
lang/python-parsley/Makefile [deleted file]
lang/python-parsley/patches/001-omit-tests.patch [deleted file]
lang/python-pcapy/Makefile [deleted file]
lang/python-pip/Makefile [deleted file]
lang/python-pip/files/pip.conf [deleted file]
lang/python-ply/Makefile [deleted file]
lang/python-psycopg2/Makefile [deleted file]
lang/python-pyasn1-modules/Makefile [deleted file]
lang/python-pyasn1/Makefile [deleted file]
lang/python-pycparser/Makefile [deleted file]
lang/python-pycparser/patches/001-use-external-ply.patch [deleted file]
lang/python-pyopenssl/Makefile [deleted file]
lang/python-pyptlib/Makefile [deleted file]
lang/python-pyserial/Makefile [deleted file]
lang/python-service-identity/Makefile [deleted file]
lang/python-setuptools/Makefile [deleted file]
lang/python-setuptools/patches/0001-remove-windows-support.patch [deleted file]
lang/python-setuptools/patches/0002-fix-pyvenv-environment-get.patch [deleted file]
lang/python-six/Makefile [deleted file]
lang/python-txsocksx/Makefile [deleted file]
lang/python-txsocksx/patches/001-omit-tests.patch [deleted file]
lang/python-txsocksx/patches/002-do-not-use-vcversioner.patch [deleted file]
lang/python-urllib3/Makefile [deleted file]
lang/python-yaml/Makefile [deleted file]
lang/python/Flask/Makefile [new file with mode: 0644]
lang/python/Jinja2/Makefile [new file with mode: 0644]
lang/python/Makefile [deleted file]
lang/python/MarkupSafe/Makefile [new file with mode: 0644]
lang/python/Werkzeug/Makefile [new file with mode: 0644]
lang/python/chardet/Makefile [new file with mode: 0644]
lang/python/click/Makefile [new file with mode: 0644]
lang/python/django-appconf/Makefile [new file with mode: 0644]
lang/python/django-compressor/Makefile [new file with mode: 0644]
lang/python/django-constance/Makefile [new file with mode: 0644]
lang/python/django-jsonfield/Makefile [new file with mode: 0644]
lang/python/django-picklefield/Makefile [new file with mode: 0644]
lang/python/django-postoffice/Makefile [new file with mode: 0644]
lang/python/django-restframework/Makefile [new file with mode: 0644]
lang/python/django-statici18n/Makefile [new file with mode: 0644]
lang/python/django/Makefile [new file with mode: 0644]
lang/python/et_xmlfile/Makefile [new file with mode: 0644]
lang/python/files/config.site [deleted file]
lang/python/files/python-host.mk [deleted file]
lang/python/files/python-package-codecs.mk [deleted file]
lang/python/files/python-package-compiler.mk [deleted file]
lang/python/files/python-package-ctypes.mk [deleted file]
lang/python/files/python-package-db.mk [deleted file]
lang/python/files/python-package-decimal.mk [deleted file]
lang/python/files/python-package-dev.mk [deleted file]
lang/python/files/python-package-distutils.mk [deleted file]
lang/python/files/python-package-email.mk [deleted file]
lang/python/files/python-package-gdbm.mk [deleted file]
lang/python/files/python-package-lib2to3.mk [deleted file]
lang/python/files/python-package-logging.mk [deleted file]
lang/python/files/python-package-multiprocessing.mk [deleted file]
lang/python/files/python-package-ncurses.mk [deleted file]
lang/python/files/python-package-openssl.mk [deleted file]
lang/python/files/python-package-pydoc.mk [deleted file]
lang/python/files/python-package-sqlite3.mk [deleted file]
lang/python/files/python-package-unittest.mk [deleted file]
lang/python/files/python-package-xml.mk [deleted file]
lang/python/files/python-package.mk [deleted file]
lang/python/files/python-version.mk [deleted file]
lang/python/flup/Makefile [new file with mode: 0644]
lang/python/gunicorn/Makefile [new file with mode: 0644]
lang/python/itsdangerous/Makefile [new file with mode: 0644]
lang/python/jdcal/Makefile [new file with mode: 0644]
lang/python/micropython-lib/Makefile [new file with mode: 0644]
lang/python/micropython/Makefile [new file with mode: 0644]
lang/python/micropython/patches/000-Makefile-no-errors [new file with mode: 0644]
lang/python/micropython/patches/001-all-unix [new file with mode: 0644]
lang/python/openpyxl/Makefile [new file with mode: 0644]
lang/python/patches/001-enable-zlib.patch [deleted file]
lang/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch [deleted file]
lang/python/patches/003-do-not-compile-tests-at-build.patch [deleted file]
lang/python/patches/004-do-not-write-bytes-codes.patch [deleted file]
lang/python/patches/006-remove-debian-multiarch-support.patch [deleted file]
lang/python/patches/007-distutils-do-not-adjust-path.patch [deleted file]
lang/python/patches/008-distutils-use-python-sysroot.patch [deleted file]
lang/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch [deleted file]
lang/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch [deleted file]
lang/python/patches/011-remove-setupterm-definition.patch [deleted file]
lang/python/pillow/Makefile [new file with mode: 0644]
lang/python/pillow/patches/010-fix-paths.patch [new file with mode: 0644]
lang/python/pyodbc/Makefile [new file with mode: 0644]
lang/python/pyodbc/patches/100-connection-assume-SQL_C_WCHAR-is-native-endian.patch [new file with mode: 0644]
lang/python/python-asn1crypto/Makefile [new file with mode: 0644]
lang/python/python-attrs/Makefile [new file with mode: 0644]
lang/python/python-automat/Makefile [new file with mode: 0644]
lang/python/python-automat/patches/001-do-not-use-setuptools-scm-m2r.patch [new file with mode: 0644]
lang/python/python-automat/patches/002-omit-visualize.patch [new file with mode: 0644]
lang/python/python-automat/patches/003-omit-tests.patch [new file with mode: 0644]
lang/python/python-cffi/Makefile [new file with mode: 0644]
lang/python/python-constantly/Makefile [new file with mode: 0644]
lang/python/python-crcmod/Makefile [new file with mode: 0644]
lang/python/python-crypto/Makefile [new file with mode: 0644]
lang/python/python-crypto/patches/001-no-host-paths.patch [new file with mode: 0644]
lang/python/python-crypto/patches/002-fix-endianness-detect.patch [new file with mode: 0644]
lang/python/python-crypto/patches/003-omit-tests.patch [new file with mode: 0644]
lang/python/python-cryptography/Makefile [new file with mode: 0644]
lang/python/python-cryptography/patches/001-disable-setup-requirements.patch [new file with mode: 0644]
lang/python/python-cryptography/patches/002-remove-undefined-dtls-methods.patch [new file with mode: 0644]
lang/python/python-curl/Makefile [new file with mode: 0644]
lang/python/python-dateutil/Makefile [new file with mode: 0644]
lang/python/python-dns/Makefile [new file with mode: 0644]
lang/python/python-dpkt/Makefile [new file with mode: 0644]
lang/python/python-egenix-mx-base/Makefile [new file with mode: 0644]
lang/python/python-enum34/Makefile [new file with mode: 0644]
lang/python/python-enum34/patches/001-omit-docs.patch [new file with mode: 0644]
lang/python/python-evdev/Makefile [new file with mode: 0644]
lang/python/python-gmpy2/Makefile [new file with mode: 0644]
lang/python/python-gnupg/Makefile [new file with mode: 0644]
lang/python/python-host.mk [new file with mode: 0644]
lang/python/python-hyperlink/Makefile [new file with mode: 0644]
lang/python/python-hyperlink/patches/001-omit-tests.patch [new file with mode: 0644]
lang/python/python-idna/Makefile [new file with mode: 0644]
lang/python/python-incremental/Makefile [new file with mode: 0644]
lang/python/python-incremental/patches/001-omit-tests.patch [new file with mode: 0644]
lang/python/python-ipaddress/Makefile [new file with mode: 0644]
lang/python/python-ldap/Makefile [new file with mode: 0644]
lang/python/python-ldap/patches/010-setup_cfg.patch [new file with mode: 0644]
lang/python/python-lxml/Makefile [new file with mode: 0644]
lang/python/python-mysql/Makefile [new file with mode: 0644]
lang/python/python-mysql/patches/010-threadsafe.patch [new file with mode: 0644]
lang/python/python-package-install.sh [new file with mode: 0644]
lang/python/python-package.mk [new file with mode: 0644]
lang/python/python-packages/Makefile [new file with mode: 0644]
lang/python/python-packages/README.md [new file with mode: 0644]
lang/python/python-parsley/Makefile [new file with mode: 0644]
lang/python/python-parsley/patches/001-py3-read-utf8.patch [new file with mode: 0644]
lang/python/python-parsley/patches/002-omit-tests.patch [new file with mode: 0644]
lang/python/python-pcapy/Makefile [new file with mode: 0644]
lang/python/python-pip-conf/Makefile [new file with mode: 0644]
lang/python/python-pip-conf/files/pip.conf [new file with mode: 0644]
lang/python/python-ply/Makefile [new file with mode: 0644]
lang/python/python-psycopg2/Makefile [new file with mode: 0644]
lang/python/python-pyasn1-modules/Makefile [new file with mode: 0644]
lang/python/python-pyasn1/Makefile [new file with mode: 0644]
lang/python/python-pycparser/Makefile [new file with mode: 0644]
lang/python/python-pycparser/patches/001-use-external-ply.patch [new file with mode: 0644]
lang/python/python-pyopenssl/Makefile [new file with mode: 0644]
lang/python/python-pyptlib/Makefile [new file with mode: 0644]
lang/python/python-pyserial/Makefile [new file with mode: 0644]
lang/python/python-service-identity/Makefile [new file with mode: 0644]
lang/python/python-six/Makefile [new file with mode: 0644]
lang/python/python-txsocksx/Makefile [new file with mode: 0644]
lang/python/python-txsocksx/patches/001-omit-tests.patch [new file with mode: 0644]
lang/python/python-txsocksx/patches/002-do-not-use-vcversioner.patch [new file with mode: 0644]
lang/python/python-urllib3/Makefile [new file with mode: 0644]
lang/python/python-version.mk [new file with mode: 0644]
lang/python/python-yaml/Makefile [new file with mode: 0644]
lang/python/python-zope-interface/Makefile [new file with mode: 0644]
lang/python/python/Config-python-light.in [new file with mode: 0644]
lang/python/python/Makefile [new file with mode: 0644]
lang/python/python/files/config.site [new file with mode: 0644]
lang/python/python/files/python-package-codecs.mk [new file with mode: 0644]
lang/python/python/files/python-package-compiler.mk [new file with mode: 0644]
lang/python/python/files/python-package-ctypes.mk [new file with mode: 0644]
lang/python/python/files/python-package-db.mk [new file with mode: 0644]
lang/python/python/files/python-package-decimal.mk [new file with mode: 0644]
lang/python/python/files/python-package-dev.mk [new file with mode: 0644]
lang/python/python/files/python-package-distutils.mk [new file with mode: 0644]
lang/python/python/files/python-package-email.mk [new file with mode: 0644]
lang/python/python/files/python-package-gdbm.mk [new file with mode: 0644]
lang/python/python/files/python-package-lib2to3.mk [new file with mode: 0644]
lang/python/python/files/python-package-logging.mk [new file with mode: 0644]
lang/python/python/files/python-package-multiprocessing.mk [new file with mode: 0644]
lang/python/python/files/python-package-ncurses.mk [new file with mode: 0644]
lang/python/python/files/python-package-openssl.mk [new file with mode: 0644]
lang/python/python/files/python-package-pip.mk [new file with mode: 0644]
lang/python/python/files/python-package-pydoc.mk [new file with mode: 0644]
lang/python/python/files/python-package-setuptools.mk [new file with mode: 0644]
lang/python/python/files/python-package-sqlite3.mk [new file with mode: 0644]
lang/python/python/files/python-package-unittest.mk [new file with mode: 0644]
lang/python/python/files/python-package-xml.mk [new file with mode: 0644]
lang/python/python/patches/001-enable-zlib.patch [new file with mode: 0644]
lang/python/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch [new file with mode: 0644]
lang/python/python/patches/003-do-not-compile-tests-at-build.patch [new file with mode: 0644]
lang/python/python/patches/004-do-not-write-bytes-codes.patch [new file with mode: 0644]
lang/python/python/patches/005-fix-bluetooth-support.patch [new file with mode: 0644]
lang/python/python/patches/006-remove-multi-arch-and-local-paths.patch [new file with mode: 0644]
lang/python/python/patches/007-distutils-do-not-adjust-path.patch [new file with mode: 0644]
lang/python/python/patches/008-distutils-use-python-sysroot.patch [new file with mode: 0644]
lang/python/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch [new file with mode: 0644]
lang/python/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch [new file with mode: 0644]
lang/python/python/patches/011-remove-setupterm-definition.patch [new file with mode: 0644]
lang/python/python/patches/012-add-support-source-date-epoch-pyc.patch [new file with mode: 0644]
lang/python/python/patches/013-getbuildinfo-date-time-source-date-epoch.patch [new file with mode: 0644]
lang/python/python3-bottle/Makefile [new file with mode: 0644]
lang/python/python3-host.mk [new file with mode: 0644]
lang/python/python3-package.mk [new file with mode: 0644]
lang/python/python3-version.mk [new file with mode: 0644]
lang/python/python3/Config-python3-light.in [new file with mode: 0644]
lang/python/python3/Makefile [new file with mode: 0644]
lang/python/python3/files/config.site [new file with mode: 0644]
lang/python/python3/files/python3-package-asyncio.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-cgi.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-codecs.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-ctypes.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-dbm.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-decimal.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-dev.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-distutils.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-email.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-gdbm.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-lib2to3.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-logging.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-lzma.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-multiprocessing.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-ncurses.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-openssl.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-pip.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-pydoc.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-setuptools.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-sqlite3.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-unittest.mk [new file with mode: 0644]
lang/python/python3/files/python3-package-xml.mk [new file with mode: 0644]
lang/python/python3/patches/001-enable-zlib.patch [new file with mode: 0644]
lang/python/python3/patches/003-do-not-run-distutils-tests.patch [new file with mode: 0644]
lang/python/python3/patches/004-do-not-write-bytes-codes.patch [new file with mode: 0644]
lang/python/python3/patches/006-remove-multi-arch-and-local-paths.patch [new file with mode: 0644]
lang/python/python3/patches/007-distutils-do-not-adjust-path.patch [new file with mode: 0644]
lang/python/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch [new file with mode: 0644]
lang/python/python3/patches/012-add-support-source-date-epoch-pyc.patch [new file with mode: 0644]
lang/python/python3/patches/013-getbuildinfo-date-time-source-date-epoch.patch [new file with mode: 0644]
lang/python/python3/patches/014-remove-platform-so-suffix.patch [new file with mode: 0644]
lang/python/python3/patches/015-abort-on-failed-modules.patch [new file with mode: 0644]
lang/python/python3/patches/016-adjust-config-paths.patch [new file with mode: 0644]
lang/python/pytz/Makefile [new file with mode: 0644]
lang/python/rcssmin/Makefile [new file with mode: 0644]
lang/python/simplejson/Makefile [new file with mode: 0644]
lang/python/twisted/Makefile [new file with mode: 0644]
lang/python/twisted/patches/001-omit-tkconch-patch [new file with mode: 0644]
lang/python/twisted/patches/002-omit-tests.patch [new file with mode: 0644]
lang/python3-bottle/Makefile [deleted file]
lang/python3-pip/Makefile [deleted file]
lang/python3-pip/patches/0001-remove-self-version-checking.patch [deleted file]
lang/python3-setuptools/Makefile [deleted file]
lang/python3-setuptools/patches/0001-remove-windows-support.patch [deleted file]
lang/python3-setuptools/patches/0002-fix-pyvenv-environment-get.patch [deleted file]
lang/python3/Makefile [deleted file]
lang/python3/files/config.site [deleted file]
lang/python3/files/python3-host.mk [deleted file]
lang/python3/files/python3-package-asyncio.mk [deleted file]
lang/python3/files/python3-package-codecs.mk [deleted file]
lang/python3/files/python3-package-ctypes.mk [deleted file]
lang/python3/files/python3-package-dbm.mk [deleted file]
lang/python3/files/python3-package-decimal.mk [deleted file]
lang/python3/files/python3-package-dev.mk [deleted file]
lang/python3/files/python3-package-distutils.mk [deleted file]
lang/python3/files/python3-package-email.mk [deleted file]
lang/python3/files/python3-package-gdbm.mk [deleted file]
lang/python3/files/python3-package-lib2to3.mk [deleted file]
lang/python3/files/python3-package-logging.mk [deleted file]
lang/python3/files/python3-package-lzma.mk [deleted file]
lang/python3/files/python3-package-multiprocessing.mk [deleted file]
lang/python3/files/python3-package-ncurses.mk [deleted file]
lang/python3/files/python3-package-openssl.mk [deleted file]
lang/python3/files/python3-package-pydoc.mk [deleted file]
lang/python3/files/python3-package-sqlite3.mk [deleted file]
lang/python3/files/python3-package-unittest.mk [deleted file]
lang/python3/files/python3-package-xml.mk [deleted file]
lang/python3/files/python3-package.mk [deleted file]
lang/python3/files/python3-version.mk [deleted file]
lang/python3/patches/001-enable-zlib.patch [deleted file]
lang/python3/patches/002-do-not-add-include-dirs-when-cross-compiling.patch [deleted file]
lang/python3/patches/003-do-not-run-distutils-tests.patch [deleted file]
lang/python3/patches/004-do-not-write-bytes-codes.patch [deleted file]
lang/python3/patches/005-fix-libffi-x86-64-configure.patch [deleted file]
lang/python3/patches/006-remove-debian-multiarch-support.patch [deleted file]
lang/python3/patches/007-distutils-do-not-adjust-path.patch [deleted file]
lang/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch [deleted file]
lang/python3/patches/011-do-not-prefer-ncursesw.patch [deleted file]
lang/python3/patches/011-fix-ncursesw-definition-colisions.patch [deleted file]
lang/python3/patches/012-disable-wcsftime-detection.patch [deleted file]
lang/python3/patches/014-remove-platform-so-suffix.patch [deleted file]
lang/python3/patches/015-abort-on-failed-modules.patch [deleted file]
lang/python3/patches/016-adjust-config-paths.patch [deleted file]
lang/pytz/Makefile [deleted file]
lang/rcssmin/Makefile [deleted file]
lang/ruby/Makefile
lang/ruby/ruby_find_pkgsdeps
lang/ruby/ruby_missingfiles
lang/simplejson/Makefile [deleted file]
lang/tcl/Makefile
lang/twisted/Makefile [deleted file]
lang/twisted/patches/001-fix-zsh-completion.patch [deleted file]
lang/twisted/patches/002-omit-tests.patch [deleted file]
lang/uuid/Makefile
lang/vala/Makefile
lang/zope-interface/Makefile [deleted file]
libs/alsa-lib/Makefile
libs/alsa-lib/patches/001-link_fix.patch [deleted file]
libs/alsa-lib/patches/005-fix_include_file_redirect_warnings.patch [deleted file]
libs/alsa-lib/patches/100-link_fix.patch [new file with mode: 0644]
libs/apr-util/Makefile
libs/apr/Makefile
libs/avahi/Makefile
libs/avro/Makefile
libs/boost/Makefile
libs/boost/patches/01_fiber_fix.patch [deleted file]
libs/c-ares/Makefile
libs/check/Makefile
libs/classpath/Makefile
libs/confuse/Makefile
libs/cyrus-sasl/Makefile
libs/db47/Makefile
libs/dmx_usb_module/Makefile
libs/dmx_usb_module/patches/002-fix-build-4.14.patch [new file with mode: 0644]
libs/dtc/Makefile
libs/dtndht/Makefile
libs/elektra/Makefile
libs/eventlog/Makefile
libs/expat/Makefile
libs/faad2/Config.in [deleted file]
libs/faad2/Makefile
libs/fcgi/Makefile
libs/fftw3/Makefile
libs/file/Makefile
libs/flac/Makefile
libs/flac/patches/001-no-docs-and-examples.patch
libs/flac/patches/002-no-utility.patch
libs/flac/patches/005-gcc_debug_options.patch
libs/flac/patches/020-fix-musl-sigemptyset-x86.patch [deleted file]
libs/freetype/Makefile
libs/gdbm/Makefile
libs/getdns/Config.in [new file with mode: 0644]
libs/getdns/Makefile [new file with mode: 0644]
libs/giflib/Makefile
libs/glib2/Makefile
libs/glib2/patches/001-automake-compat.patch
libs/glib2/patches/002-gdate-Suppress-string-format-literal-warning.patch [deleted file]
libs/glpk/Makefile
libs/gnutls/Makefile
libs/gperf/Makefile
libs/gperf/patches/100-include_own_first.patch [new file with mode: 0644]
libs/hidapi/Makefile
libs/hiredis/Makefile
libs/hiredis/patches/001-lvalue_fix.patch [new file with mode: 0644]
libs/ibrcommon/Makefile
libs/ibrdtn/Makefile
libs/icu/Makefile
libs/icu/patches/000-dont-cpy-files-from-topdirs.patch
libs/icu/patches/001-disable-strtod_l.patch [deleted file]
libs/icu/patches/002-Disable-LDFLAGSICUDT-for-Linux.patch [new file with mode: 0644]
libs/icu/patches/CVE-2017-7867_CVE-2017-7868.patch [deleted file]
libs/intltool/Makefile
libs/jansson/Makefile
libs/ldns/Makefile
libs/libaio/Makefile
libs/libantlr3c/Makefile
libs/libao/Makefile
libs/libarchive/Makefile
libs/libartnet/Makefile
libs/libaudiofile/Makefile
libs/libaudiofile/patches/010-gcc6-fix-left-shift-negative-number.patch [new file with mode: 0644]
libs/libaudiofile/patches/020-remove-tests-examples-docs.patch [new file with mode: 0644]
libs/libaudiofile/patches/030-CVE-2015-7747.patch [new file with mode: 0644]
libs/libaudiofile/patches/110-Always-check-the-number-of-coefficients.patch [new file with mode: 0644]
libs/libaudiofile/patches/120-clamp-index-values-to-fix-index-overflow-in-IMA.cpp.patch [new file with mode: 0644]
libs/libaudiofile/patches/130-Check-for-multiplication-overflow-in-sfconvert.patch [new file with mode: 0644]
libs/libaudiofile/patches/140-Actually-fail-when-error-occurs-in-parseFormat.patch [new file with mode: 0644]
libs/libaudiofile/patches/150-Check-for-multiplication-overflow-in-MSADPCM-decodeS.patch [new file with mode: 0644]
libs/libaudiofile/patches/160-Fix-signature-of-multiplyCheckOverflow.patch [new file with mode: 0644]
libs/libaudiofile/patches/170-Check-for-division-by-zero-in-BlockCodec.patch [new file with mode: 0644]
libs/libavl/Makefile
libs/libcanfestival/Makefile
libs/libcanfestival/patches/004-override-cflags.patch [new file with mode: 0644]
libs/libcap/Makefile
libs/libcap/patches/200-change-hardcoded-shell-to-sh.patch [new file with mode: 0644]
libs/libcoap/Makefile
libs/libdaemon/Makefile
libs/libdaq/Makefile
libs/libdbi-drivers/Makefile
libs/libdbi-drivers/patches/100-remove-date-to-fix-reproducible-builds.patch [new file with mode: 0644]
libs/libdbi/Makefile
libs/libdmapsharing/Makefile [new file with mode: 0644]
libs/libdmapsharing/patches/001-disable_pixbuf.patch [new file with mode: 0644]
libs/libdmapsharing/patches/002-disable_tests.patch [new file with mode: 0644]
libs/libdnet/Makefile
libs/libdouble-conversion/Makefile
libs/libdrm/Makefile
libs/libedit/Makefile
libs/libesmtp/Makefile
libs/libestr/Makefile
libs/libev/Makefile
libs/libevdev/Makefile
libs/libevent/Makefile [deleted file]
libs/libevhtp/Makefile [new file with mode: 0644]
libs/libevhtp/patches/010-strcmp-endianness-fix.patch [new file with mode: 0644]
libs/libexif/Makefile
libs/libextractor/Makefile
libs/libextractor/patches/001-backport-support-for-giflib-5-1.patch [deleted file]
libs/libextractor/patches/002-ffmpeg2.9_api_backport.patch [deleted file]
libs/libfastjson/Makefile
libs/libffi/Makefile
libs/libftdi/Makefile
libs/libftdi1/Makefile
libs/libgcrypt/Makefile
libs/libgcrypt/patches/002-Add-configure-option-enable-build-timestamp.patch [new file with mode: 0644]
libs/libgd/Makefile
libs/libgd/patches/101-gdlib-config.patch
libs/libgd/patches/102-gdlib-pc-in.patch [new file with mode: 0644]
libs/libgd/patches/200-uclibc-ceill.patch
libs/libgee/Makefile
libs/libgee/patches/libgee-0.18.0-no-introspection.patch
libs/libglog/Makefile [new file with mode: 0644]
libs/libgpg-error/Makefile
libs/libgphoto2/Makefile [new file with mode: 0644]
libs/libgphoto2/patches/001-automake-compat.patch [new file with mode: 0644]
libs/libgphoto2/patches/002-no-docs-examples-test-translations.patch [new file with mode: 0644]
libs/libgpiod/Makefile [new file with mode: 0644]
libs/libhttp-parser/Makefile
libs/libical/Makefile
libs/libid3tag/Makefile
libs/libidn/Makefile
libs/libiio/Makefile [new file with mode: 0644]
libs/libiio/files/iiod.init [new file with mode: 0644]
libs/libimobiledevice/Makefile
libs/libinput/Makefile
libs/libinput/patches/001-no-locale.patch
libs/libinput/patches/002-static_assert.patch
libs/libjpeg/Makefile
libs/liblo/Makefile
libs/liblz4/Makefile
libs/libmad/Makefile
libs/libmcrypt/Makefile
libs/libmicrohttpd/Makefile
libs/libmms/Makefile
libs/libmms/patches/010-remove_glib_from_pkgconfig.patch [new file with mode: 0644]
libs/libmodbus/Makefile
libs/libmpdclient/Makefile
libs/libmpeg2/Makefile
libs/libmraa/Makefile [new file with mode: 0644]
libs/libmraa/patches/0001-base.patch [new file with mode: 0644]
libs/libmraa/patches/0002-add-mips-support.patch [new file with mode: 0644]
libs/libmraa/patches/0003-uart.patch [new file with mode: 0644]
libs/libmraa/patches/0004-fixes.patch [new file with mode: 0644]
libs/libnatpmp/Makefile
libs/libndpi/Makefile [new file with mode: 0644]
libs/libnet-1.2.x/Makefile
libs/libnetconf2/Makefile [new file with mode: 0644]
libs/libnetfilter-acct/Makefile
libs/libnopoll/Makefile
libs/libnopoll/patches/001-param_h_rename.patch [new file with mode: 0644]
libs/libogg/Makefile
libs/liboil/Makefile
libs/liboping/Makefile
libs/libowfat/Makefile
libs/libowfat/patches/001-fixbuild.patch
libs/libp11/Makefile
libs/libp11/patches/001-fix-install.patch
libs/libpam/Makefile
libs/libplist/Makefile
libs/libpng/Makefile
libs/libpng/patches/101-old-libtool.patch [new file with mode: 0644]
libs/libradcli/Makefile
libs/libredblack/Makefile [new file with mode: 0644]
libs/libsamplerate/Makefile
libs/libsearpc/Makefile
libs/libseccomp/Makefile
libs/libshout/Makefile
libs/libsigc++/Makefile
libs/libsndfile/Makefile
libs/libsoc/Makefile [new file with mode: 0644]
libs/libsodium/Makefile
libs/libsoup/Makefile [new file with mode: 0644]
libs/libsoxr/Makefile
libs/libsoxr/patches/010-Remove_automatic_avutil_inclusion.patch [new file with mode: 0644]
libs/libssh/Makefile [new file with mode: 0644]
libs/libssh/patches/001-compile.patch [new file with mode: 0644]
libs/libssh/patches/002-disable-libssp.patch [new file with mode: 0644]
libs/libssh2/Config.in [new file with mode: 0644]
libs/libssh2/Makefile
libs/libssh2/patches/01-fix-acinclude-m4.patch [new file with mode: 0644]
libs/libstrophe/Makefile
libs/libtalloc/Makefile
libs/libtasn1/Makefile
libs/libtheora/Makefile
libs/libtins/Makefile [new file with mode: 0644]
libs/libtirpc/Makefile [new file with mode: 0644]
libs/libtirpc/patches/01-Disable-parts-of-TIRPC-requiring-NIS-support.patch [new file with mode: 0644]
libs/libtirpc/patches/02-replace-__bzero-with-memset-API.patch [new file with mode: 0644]
libs/libtirpc/patches/03-uClibc-without-RPC-support-and-musl-does-not-install-rpcent.h.patch [new file with mode: 0644]
libs/libtirpc/patches/04-export_key_secretkey_is_set.patch [new file with mode: 0644]
libs/libtirpc/patches/05-Disable-DES-authentification-support.patch [new file with mode: 0644]
libs/libtirpc/patches/06-include-stdint.h-for-uintptr_t.patch [new file with mode: 0644]
libs/libtorrent/Makefile
libs/libudev-fbsd/Makefile [new file with mode: 0644]
libs/libudev-fbsd/patches/001-fix-unused.patch [new file with mode: 0644]
libs/libudev-fbsd/patches/002-replace-nitems.patch [new file with mode: 0644]
libs/libudev-fbsd/patches/003-add-pkg-config-description.patch [new file with mode: 0644]
libs/libudev-fbsd/patches/005-extern-c.patch [new file with mode: 0644]
libs/libudev-fbsd/patches/100-add-stub-udev_device_get_driver.patch [new file with mode: 0644]
libs/libudev-fbsd/patches/101-add-stub-udev_device_new_from_subsystem_sysname.patch [new file with mode: 0644]
libs/libudev-fbsd/patches/102-add-stub-udev_enumerate_add_nomatch_sysattr.patch [new file with mode: 0644]
libs/libuecc/Makefile
libs/libugpio/Makefile
libs/libuhttpd/Makefile [new file with mode: 0755]
libs/libunistring/Makefile
libs/libupm/Makefile [new file with mode: 0644]
libs/libupm/patches/001-version.patch [new file with mode: 0644]
libs/libupm/patches/002-at42qt1070-id.patch [new file with mode: 0644]
libs/libupm/patches/003-lsm303-args.patch [new file with mode: 0644]
libs/libupnp/Makefile
libs/libupnpp/Makefile
libs/liburcu/Makefile
libs/libusbmuxd/Makefile
libs/libuv/Makefile
libs/libuvc/Makefile
libs/libuwsc/Makefile [new file with mode: 0755]
libs/libv4l/Makefile
libs/libvorbis/Makefile
libs/libvorbis/patches/100-CVE-2017-14632-CVE-2017-14633.patch [new file with mode: 0644]
libs/libvorbisidec/Makefile
libs/libvpx/Makefile
libs/libwebsockets/Makefile [new file with mode: 0644]
libs/libwebsockets/patches/001-CMakeLists-build-reproducible-by-default.patch [new file with mode: 0644]
libs/libx264/Makefile
libs/libxerces-c/Makefile
libs/libxerces-c/patches/0001-fix-configure-cross-compiling.patch [new file with mode: 0644]
libs/libxml2/Makefile
libs/libxslt/Makefile
libs/libyaml-cpp/Makefile [new file with mode: 0644]
libs/libyang/Makefile [new file with mode: 0644]
libs/libzdb/Makefile
libs/loudmouth/Makefile [new file with mode: 0644]
libs/loudmouth/patches/001-allow-disable-libidn.patch [new file with mode: 0644]
libs/loudmouth/patches/900-disable-docs-examples-tests.patch [new file with mode: 0644]
libs/lttng-ust/Makefile
libs/mtdev/Makefile
libs/musl-fts/Makefile [new file with mode: 0644]
libs/mxml/Makefile
libs/nacl/Makefile
libs/neon/Makefile
libs/opencv/Makefile [new file with mode: 0644]
libs/opencv/README.md [new file with mode: 0644]
libs/openldap/Makefile
libs/openldap/patches/110-reproducible-builds.patch [new file with mode: 0644]
libs/opus/Makefile
libs/p11-kit/Makefile
libs/pcre/Makefile
libs/pcre/patches/001-CVE-2017-7186 [deleted file]
libs/pcre2/Makefile [new file with mode: 0644]
libs/pixman/Makefile [new file with mode: 0644]
libs/pixman/patches/0004-pixman-fix-detection-of-mips-dspr2.patch [new file with mode: 0644]
libs/pixman/patches/0005-pixman-arm-neon-assembler-fix.patch [new file with mode: 0644]
libs/poco/Makefile
libs/postgresql/Makefile
libs/postgresql/files/postgresql.sh
libs/postgresql/patches/001-configure_fixes.patch
libs/postgresql/patches/050-build-contrib.patch [new file with mode: 0644]
libs/postgresql/patches/800-busybox-default-pager.patch
libs/postgresql/patches/900-pg_ctl-setuid.patch
libs/protobuf-c/Makefile
libs/protobuf/Makefile
libs/protobuf/patches/001-mipseb-compile.patch [deleted file]
libs/protobuf/patches/003-mips2andHigher-compile.patch [deleted file]
libs/psqlodbc/Makefile [new file with mode: 0644]
libs/pthsem/Makefile
libs/pthsem/patches/003-linux4x-fix.patch [new file with mode: 0644]
libs/qrencode/Makefile
libs/qrencode/patches/001-add-inline-svg.patch [new file with mode: 0644]
libs/qrencode/patches/001-disable-png.patch [deleted file]
libs/quasselc/Makefile
libs/rxtx/Makefile [changed mode: 0755->0644]
libs/sbc/Makefile
libs/speex/Makefile
libs/speexdsp/Makefile [new file with mode: 0644]
libs/sqlite3/Config.in [new file with mode: 0644]
libs/sqlite3/Makefile
libs/tcp_wrappers/Makefile
libs/tdb/Makefile
libs/tdb/files/tdb.cache.txt [new file with mode: 0644]
libs/tdb/patches/001-printf-fix.patch [deleted file]
libs/tiff/Makefile
libs/tiff/patches/001-autoconf-compat.patch
libs/tiff/patches/002-CVE-2015-8665_and_CVE-2015-8683.patch [deleted file]
libs/tiff/patches/003-fix_potential_out-of-bound_writes_in_decode_functions.patch [deleted file]
libs/tiff/patches/004-fix_potential_out-of-bound_write_in_NeXTDecode.patch [deleted file]
libs/tiff/patches/005-fix-ftell-macro.patch
libs/tiff/patches/019-CVE-2017-18013.patch [new file with mode: 0644]
libs/tiff/patches/020-CVE-2017-9935.patch [new file with mode: 0644]
libs/tinycdb/Makefile
libs/udns/Makefile [new file with mode: 0644]
libs/udns/patches/0001-use-autotools.patch [new file with mode: 0644]
libs/unixodbc/Makefile
libs/unixodbc/files/odbc.init [new file with mode: 0644]
libs/unixodbc/patches/100-cross-compile-odbc-config.patch [new file with mode: 0644]
libs/uw-imap/Makefile [new file with mode: 0644]
libs/uw-imap/patches/001-fix_Makefiles_and_shlib.patch [new file with mode: 0644]
libs/uw-imap/patches/002-imap-2004a-doc.patch [new file with mode: 0644]
libs/uw-imap/patches/003-imap-2007e-overflow.patch [new file with mode: 0644]
libs/uw-imap/patches/005-imap-2007e-authmd5.patch [new file with mode: 0644]
libs/uw-imap/patches/006-imap-2007f-format-security.patch [new file with mode: 0644]
libs/uw-imap/patches/007-imap-2007e-poll.patch [new file with mode: 0644]
libs/vips/Makefile
libs/vips/patches/001-no_cpp.patch [deleted file]
libs/vips/patches/001-no_introspection.patch [new file with mode: 0644]
libs/xmlrpc-c/Makefile
libs/yajl/Makefile
libs/yaml/Makefile
libs/zmq/Makefile
mail/alpine/Makefile
mail/bogofilter/Makefile
mail/clamsmtp/Makefile [new file with mode: 0644]
mail/clamsmtp/files/clamsmtpd.init [new file with mode: 0644]
mail/dovecot/Makefile
mail/emailrelay/Makefile
mail/emailrelay/files/emailrelay.auth
mail/emailrelay/files/emailrelay.config [new file with mode: 0644]
mail/emailrelay/files/emailrelay.init
mail/fdm/Makefile
mail/fdm/patches/003-base64-fix.patch [new file with mode: 0644]
mail/greyfix/Makefile [new file with mode: 0644]
mail/greyfix/patches/100-ignore_cross_compile_test.patch [new file with mode: 0644]
mail/mailman/Makefile
mail/mailsend/Makefile
mail/msmtp-scripts/Makefile
mail/msmtp/Makefile
mail/mutt/Makefile
mail/mutt/patches/0001-no-po-and-docs.patch [deleted file]
mail/mutt/patches/0001-no-po.patch [new file with mode: 0644]
mail/mutt/patches/100-CVE-2014-9116.patch [deleted file]
mail/nail/Makefile [new file with mode: 0644]
mail/nail/patches/100-handle-openssl-without-sslv2-sslv3.patch [new file with mode: 0644]
mail/opendkim/Makefile [new file with mode: 0644]
mail/opendkim/files/opendkim-genkey [new file with mode: 0644]
mail/opendkim/files/opendkim.conf.simple [new file with mode: 0644]
mail/opendkim/files/opendkim.init [new file with mode: 0755]
mail/pigeonhole/Makefile [new file with mode: 0644]
mail/postfix/Makefile
mail/postfix/files/main.cf.default [deleted file]
mail/postfix/files/postfix.init
mail/postfix/patches/100-fsstat.patch
mail/postfix/patches/110-glibc-defs.patch [new file with mode: 0644]
mail/postfix/patches/200-manpages.patch
mail/postfix/patches/300-bdb_hash_segfault.patch
mail/postfix/patches/400-cdb.patch
mail/postfix/patches/500-crosscompile.patch
mail/postfix/patches/501-include_stdio.patch [new file with mode: 0644]
mail/postfix/patches/600-nopostconf.patch
mail/postfix/patches/900_less_overlayfs_rewrites.patch [new file with mode: 0644]
mail/sendmail/Makefile [new file with mode: 0644]
mail/sendmail/files/OpenWrt [new file with mode: 0644]
mail/sendmail/files/lm_getver.c [new file with mode: 0644]
mail/sendmail/files/sharedlibrary.m4 [new file with mode: 0644]
mail/sendmail/files/site.OpenWrt.m4 [new file with mode: 0644]
mail/sendmail/patches/010-enable-nonroot-install.patch [new file with mode: 0644]
mail/sendmail/patches/011-libmilter-so-version.patch [new file with mode: 0644]
mail/sendmail/patches/100-misc-os-musl-fixes.patch [new file with mode: 0644]
mail/sendmail/patches/101-fix-format-security.patch [new file with mode: 0644]
mail/sendmail/patches/102-pthreads-stack-size.patch [new file with mode: 0644]
mail/sendmail/patches/103-create-install-dirs.patch [new file with mode: 0644]
mail/ssmtp/Makefile
multimedia/crtmpserver/Makefile
multimedia/ffmpeg/Config.in
multimedia/ffmpeg/Makefile
multimedia/fswebcam/Makefile
multimedia/gphoto2/Makefile [new file with mode: 0644]
multimedia/gphoto2/patches/001-automake-compat.patch [new file with mode: 0644]
multimedia/gphoto2/patches/002-no-docs-test.patch [new file with mode: 0644]
multimedia/grilo-plugins/Makefile [new file with mode: 0644]
multimedia/grilo-plugins/patches/001-grilo-plugins-0.3.5-no-itstool-xmllint.patch [new file with mode: 0644]
multimedia/grilo/Makefile [new file with mode: 0644]
multimedia/grilo/files/grilo-0.3.vapi [new file with mode: 0644]
multimedia/grilo/files/grilo-net-0.3.vapi [new file with mode: 0644]
multimedia/gst1-libav/Config.in
multimedia/gst1-libav/Makefile
multimedia/gst1-plugins-bad/Makefile
multimedia/gst1-plugins-bad/patches/001-no-translations.patch
multimedia/gst1-plugins-bad/patches/002-no-tests.patch
multimedia/gst1-plugins-base/Makefile
multimedia/gst1-plugins-base/patches/001-no-translations.patch
multimedia/gst1-plugins-base/patches/002-no-tests.patch
multimedia/gst1-plugins-base/patches/003-no-docs.patch
multimedia/gst1-plugins-good/Makefile [new file with mode: 0644]
multimedia/gst1-plugins-good/patches/001-no-translations.patch [new file with mode: 0644]
multimedia/gst1-plugins-good/patches/002-no-tests.patch [new file with mode: 0644]
multimedia/gst1-plugins-good/patches/003-no-docs.patch [new file with mode: 0644]
multimedia/gst1-plugins-ugly/Makefile
multimedia/gst1-plugins-ugly/patches/001-no-translations.patch
multimedia/gst1-plugins-ugly/patches/002-no-tests.patch
multimedia/gst1-plugins-ugly/patches/003-no-docs.patch
multimedia/gstreamer1/Makefile
multimedia/gstreamer1/patches/001-no-translations.patch
multimedia/gstreamer1/patches/002-no-tests.patch
multimedia/gstreamer1/patches/003-no-docs.patch
multimedia/icecast/Makefile
multimedia/ices/Makefile
multimedia/lcdgrilo/Makefile [new file with mode: 0644]
multimedia/lcdgrilo/files/lcdgrilo.init [new file with mode: 0644]
multimedia/minidlna/Makefile
multimedia/minidlna/files/minidlna.config
multimedia/minidlna/files/minidlna.init
multimedia/minidlna/patches/002-dont-build-po-files.patch [new file with mode: 0644]
multimedia/minidlna/patches/010-libav-fix.patch [deleted file]
multimedia/mjpg-streamer/Makefile
multimedia/mjpg-streamer/files/mjpg-streamer.init
multimedia/mjpg-streamer/patches/035-remove_build_date-time.patch [new file with mode: 0644]
multimedia/motion/Makefile
multimedia/oggfwd/Makefile
multimedia/tvheadend/Makefile
multimedia/v4l2rtspserver/Makefile [new file with mode: 0644]
multimedia/v4l2rtspserver/files/config.openwrt [new file with mode: 0644]
multimedia/v4l2rtspserver/files/v4l2rtspserver.config [new file with mode: 0644]
multimedia/v4l2rtspserver/files/v4l2rtspserver.init [new file with mode: 0644]
multimedia/xupnpd/Makefile
multimedia/youtube-dl/Makefile
net/acme/Makefile
net/acme/files/acme-cbi.lua
net/acme/files/acme.config
net/acme/files/run.sh
net/adblock/Makefile
net/adblock/files/README.md
net/adblock/files/adblock.conf
net/adblock/files/adblock.init
net/adblock/files/adblock.notify [new file with mode: 0644]
net/adblock/files/adblock.sh
net/addrwatch/Makefile
net/addrwatch/files/addrwatch.init
net/aggregate/Makefile
net/aircrack-ng/Makefile
net/announce/Makefile
net/apache/Config.in [new file with mode: 0644]
net/apache/Makefile
net/apache/patches/010-reproducible-builds.patch [new file with mode: 0644]
net/apcupsd/Makefile
net/apinger/Makefile
net/aria2/Config.in
net/aria2/Makefile
net/aria2/files/aria2.conf
net/aria2/files/aria2.init
net/ariang/Makefile [new file with mode: 0644]
net/arp-scan/Makefile
net/atftp/Makefile
net/autossh/Makefile
net/bcp38/Makefile
net/bcp38/files/run.sh
net/beanstalkd/Makefile [new file with mode: 0644]
net/beanstalkd/files/beanstalkd.init [new file with mode: 0644]
net/beanstalkd/patches/900-makefile.patch [new file with mode: 0644]
net/beanstalkd/patches/901-fix-headers.patch [new file with mode: 0644]
net/beanstalkd/patches/902-replace-posix_fallocate.patch [new file with mode: 0644]
net/bind/Config.in
net/bind/Makefile
net/bind/patches/001-no-tests.patch
net/bind/patches/002-autoconf-ar-fix.patch
net/bitlbee/Makefile [new file with mode: 0644]
net/bmon/Makefile
net/bridge-utils/Makefile
net/bwm-ng/Makefile
net/bwm-ng/patches/001-Use-static-inline-instead-of-inline.patch [new file with mode: 0644]
net/cgi-io/Makefile
net/cgi-io/src/CMakeLists.txt
net/cgi-io/src/main.c
net/chaosvpn/Makefile
net/chrony/Makefile
net/chrony/files/chrony.conf
net/chrony/patches/001-freebind_uclibc.patch
net/cifs-utils/Makefile
net/cifs-utils/patches/001-fix-musl-build.patch [deleted file]
net/cjdns/Makefile [deleted file]
net/cjdns/files/cjdns.defaults [deleted file]
net/cjdns/files/cjdns.init [deleted file]
net/cjdns/files/cjdrouteconf [deleted file]
net/cjdns/lua/cjdns/admin.lua [deleted file]
net/cjdns/lua/cjdns/common.lua [deleted file]
net/cjdns/lua/cjdns/init.lua [deleted file]
net/cjdns/lua/cjdns/uci.lua [deleted file]
net/cjdns/lua/cjdns/udp.lua [deleted file]
net/clamav/Makefile [new file with mode: 0644]
net/clamav/files/bytecode.cvd [new file with mode: 0644]
net/clamav/files/clamav.config [new file with mode: 0644]
net/clamav/files/clamav.init [new file with mode: 0644]
net/clamav/files/freshclam.config [new file with mode: 0644]
net/clamav/files/freshclam.init [new file with mode: 0644]
net/clamav/patches/001-compile.patch [new file with mode: 0644]
net/conserver/Makefile [new file with mode: 0644]
net/conserver/files/conserver.cf [new file with mode: 0644]
net/conserver/files/conserver.init [new file with mode: 0644]
net/conserver/files/console.cf [new file with mode: 0644]
net/conserver/patches/001-remove-strip.patch [new file with mode: 0644]
net/coova-chilli/Config.in
net/coova-chilli/Makefile
net/cshark/Makefile
net/daemonlogger/Makefile
net/danish/Makefile [new file with mode: 0644]
net/dansguardian/Makefile [deleted file]
net/dansguardian/files/dansguardian.config [deleted file]
net/dansguardian/files/dansguardian.init [deleted file]
net/dansguardian/files/dansguardianf1.conf [deleted file]
net/dansguardian/patches/001-compile.patch [deleted file]
net/darkstat/Makefile
net/davfs2/Makefile
net/davfs2/patches/300-have_iconv_h.patch [new file with mode: 0644]
net/ddns-scripts/Makefile
net/ddns-scripts/files/dynamic_dns_functions.sh
net/ddns-scripts/files/dynamic_dns_lucihelper.sh
net/ddns-scripts/files/dynamic_dns_updater.sh
net/ddns-scripts/files/services
net/ddns-scripts/files/services_ipv6
net/ddns-scripts/files/update_cloudflare_com_v4.sh
net/ddns-scripts/files/update_godaddy_com_v1.sh
net/ddns-scripts/files/update_route53_v1.sh [new file with mode: 0644]
net/dhcp-forwarder/Makefile
net/dhcpcd/Makefile
net/dhcpcd/patches/001-fix-musl.patch [deleted file]
net/dmapd/Makefile [new file with mode: 0644]
net/dmapd/files/dmapd.init [new file with mode: 0644]
net/dmapd/patches/001-dmapd_conf.patch [new file with mode: 0644]
net/dmapd/patches/002-make_unit_test_optionnal.patch [new file with mode: 0644]
net/dnscrypt-proxy/Config.in [new file with mode: 0755]
net/dnscrypt-proxy/Makefile
net/dnscrypt-proxy/files/dnscrypt-proxy.config
net/dnscrypt-proxy/files/dnscrypt-proxy.init
net/dnscrypt-proxy/files/dnscrypt-resolvers.csv
net/dynapoint/Makefile
net/dynapoint/src/dynapoint.lua
net/e2guardian/Makefile
net/esniper/Makefile
net/etherwake/Makefile
net/ethtool/Config.in [deleted file]
net/ethtool/Makefile [deleted file]
net/fakeidentd/Makefile
net/fastd/Makefile
net/fossil/Makefile
net/fping/Makefile [new file with mode: 0644]
net/freeradius3/Makefile
net/freeradius3/patches/001-fix-cert-expiry.patch [new file with mode: 0644]
net/freeradius3/patches/002-disable-session-cache-CVE-2017-9148.patch [new file with mode: 0644]
net/fwknop/Makefile
net/fwknop/files/fwknopd
net/fwknop/files/fwknopd.init
net/git/Makefile
net/git/patches/100-configure_for_crosscompiling.patch [new file with mode: 0644]
net/git/patches/200-disable_fasthash.patch [deleted file]
net/git/patches/200-imapsend_without_curl.patch [new file with mode: 0644]
net/git/patches/300-configure_for_crosscompiling [deleted file]
net/git/patches/400-imapsend_without_curl.patch [deleted file]
net/gitolite/Makefile
net/gnunet/Makefile
net/gnunet/files/gnunet.init
net/gnurl/Makefile
net/gnurl/patches/200-no_docs_tests.patch [deleted file]
net/haproxy/Makefile
net/haproxy/patches/0001-BUG-MEDIUM-ssl-Dont-always-treat-SSL_ERROR_SYSCALL-as-unrecovarable.patch [new file with mode: 0644]
net/haproxy/patches/0002-BUG-MEDIUM-ssl-Shutdown-the-connection-for-reading-on-SSL_ERROR_SYSCALL.patch [new file with mode: 0644]
net/haproxy/patches/0003-BUG-MEDIUM-http-Switch-the-HTTP-response-in-tunnel-mode-as-earlier-as-possible.patch [new file with mode: 0644]
net/haproxy/patches/0004-BUG-MEDIUM-ssl-sample-ssl_bc_-fetch-keywords-are-broken.patch [new file with mode: 0644]
net/horst/Makefile [new file with mode: 0644]
net/horst/horst.config [new file with mode: 0644]
net/horst/horst.init [new file with mode: 0755]
net/horst/patches/0001-reproducible-builds.patch [new file with mode: 0644]
net/htpdate/Makefile
net/htpdate/files/htpdate.conf [new file with mode: 0644]
net/htpdate/files/htpdate.default [deleted file]
net/htpdate/files/htpdate.init
net/htpdate/patches/101-daemon-run-in-foreground.patch [new file with mode: 0644]
net/httping/Makefile [new file with mode: 0644]
net/httping/patches/001-no_strip.patch [new file with mode: 0644]
net/httping/patches/002-fix_compile_warnings.patch [new file with mode: 0644]
net/httping/patches/003-fix_response_time.patch [new file with mode: 0644]
net/httping/patches/004-minimize.patch [new file with mode: 0644]
net/https-dns-proxy/Makefile
net/https-dns-proxy/files/https_dns_proxy.config
net/https-dns-proxy/files/https_dns_proxy.init
net/i2pd/Makefile [new file with mode: 0644]
net/i2pd/files/i2pd.init [new file with mode: 0755]
net/ibrdtn-tools/Makefile
net/ibrdtnd/Makefile
net/ifstat/Makefile [new file with mode: 0644]
net/inadyn/Makefile [new file with mode: 0644]
net/iodine/Makefile
net/iodine/patches/101-musl-workaround-incomplete-nameser-h.patch [new file with mode: 0644]
net/iotivity/Makefile
net/ipsec-tools/Makefile
net/ipsec-tools/files/functions.sh
net/ipsec-tools/files/racoon
net/ipsec-tools/files/racoon.init
net/ipsec-tools/patches/010-CVE-2016-10396.patch [new file with mode: 0644]
net/iptraf-ng/Makefile
net/irssi/Makefile
net/isc-dhcp/Makefile
net/isc-dhcp/files/dhcpd.conf [deleted file]
net/isc-dhcp/files/dhcpd.defaults [new file with mode: 0644]
net/isc-dhcp/files/dhcpd.init
net/isc-dhcp/patches/000-compile.patch
net/isc-dhcp/patches/510-bind-CC.patch
net/jool/Makefile
net/kadnode/Config.in [new file with mode: 0644]
net/kadnode/Makefile [new file with mode: 0644]
net/kadnode/files/kadnode.config [new file with mode: 0755]
net/kadnode/files/kadnode.init [new file with mode: 0755]
net/kadnode/files/kadnode.postinst [new file with mode: 0644]
net/keepalived/Makefile
net/keepalived/files/hotplug-user [new file with mode: 0644]
net/keepalived/files/keepalived.config
net/keepalived/files/keepalived.init
net/keepalived/files/keepalived.user [new file with mode: 0644]
net/keepalived/patches/101-0001-vrrp-update-struct-msghdr.patch [deleted file]
net/keepalived/patches/101-0002-Reinstate-initialisation-of-msghdr-fields.patch [deleted file]
net/kismet/Makefile
net/knot/Makefile
net/knot/files/runtests.sh
net/knot/patches/02_knot.conf.patch
net/knot/patches/03_contrib_files.patch [deleted file]
net/knot/patches/04_cookies_big_endian.patch [deleted file]
net/knxd/Makefile
net/knxd/files/knxd.config
net/knxd/files/knxd.ini [new file with mode: 0644]
net/knxd/files/knxd.init
net/knxd/patches/0099-openwrt.patch
net/kplex/Makefile
net/krb5/Makefile
net/l7-protocols/Makefile [deleted file]
net/l7-protocols/patches/100-testing_crosscompile.patch [deleted file]
net/l7-protocols/patches/101-testing-timeit.patch [deleted file]
net/l7-protocols/patches/102-testing-doallspeeds.patch [deleted file]
net/lcdringer/Makefile
net/lftp/Makefile
net/lighttpd/Makefile [new file with mode: 0644]
net/lighttpd/files/lighttpd.conf [new file with mode: 0644]
net/lighttpd/files/lighttpd.init [new file with mode: 0644]
net/linknx/Makefile
net/linuxptp/Makefile
net/linuxptp/patches/002-netdb_fix.patch [new file with mode: 0644]
net/lispmob/Makefile
net/lksctp-tools/Makefile
net/luci-app-bcp38/Makefile [deleted file]
net/luci-app-bcp38/files/bcp38-cbi.lua [deleted file]
net/luci-app-bcp38/files/bcp38-controller.lua [deleted file]
net/luci-app-bcp38/files/uci-defaults-bcp38 [deleted file]
net/luci-app-cjdns/Makefile [deleted file]
net/luci-app-cjdns/luasrc/controller/cjdns.lua [deleted file]
net/luci-app-cjdns/luasrc/model/cbi/cjdns/cjdrouteconf.lua [deleted file]
net/luci-app-cjdns/luasrc/model/cbi/cjdns/iptunnel.lua [deleted file]
net/luci-app-cjdns/luasrc/model/cbi/cjdns/overview.lua [deleted file]
net/luci-app-cjdns/luasrc/model/cbi/cjdns/peering.lua [deleted file]
net/luci-app-cjdns/luasrc/model/cbi/cjdns/settings.lua [deleted file]
net/luci-app-cjdns/luasrc/view/admin_status/index/cjdns.htm [deleted file]
net/luci-app-cjdns/luasrc/view/cjdns/status.htm [deleted file]
net/luci-app-cjdns/luasrc/view/cjdns/value.htm [deleted file]
net/luci-app-clamav/Makefile [deleted file]
net/luci-app-clamav/files/controller/clamav-controller.lua [deleted file]
net/luci-app-clamav/files/model/cbi/clamav-cbi.lua [deleted file]
net/luci-app-e2guardian/Makefile [deleted file]
net/luci-app-e2guardian/files/e2guardian-cbi.lua [deleted file]
net/luci-app-e2guardian/files/e2guardian-controller.lua [deleted file]
net/luci-app-squid/Makefile [deleted file]
net/luci-app-squid/files/squid-cbi.lua [deleted file]
net/luci-app-squid/files/squid-controller.lua [deleted file]
net/mac-telnet/Makefile
net/mdnsresponder/Makefile
net/mdnsresponder/patches/100-linux_fixes.patch
net/mdnsresponder/patches/120-reproducible-builds.patch [new file with mode: 0644]
net/memcached/Makefile
net/mii-tool/Makefile
net/mii-tool/patches/001-mii-tool-4.9-compatibility.patch [new file with mode: 0644]
net/mikrotik-btest/Makefile [new file with mode: 0644]
net/mini_snmpd/Makefile
net/mini_snmpd/files/mini_snmpd.init
net/miniupnpc/Makefile
net/miniupnpc/patches/100-no_minixml_test.patch
net/miniupnpc/patches/200-miniupnpc_desc.patch
net/miniupnpd/Makefile [deleted file]
net/miniupnpd/files/firewall.include [deleted file]
net/miniupnpd/files/miniupnpd.defaults [deleted file]
net/miniupnpd/files/miniupnpd.hotplug [deleted file]
net/miniupnpd/files/miniupnpd.init [deleted file]
net/miniupnpd/files/upnpd.config [deleted file]
net/miniupnpd/patches/101-no-ssl-uuid.patch [deleted file]
net/miniupnpd/patches/102-ipv6-ext-port.patch [deleted file]
net/miniupnpd/patches/103-no-ipv6-autodetection.patch [deleted file]
net/miniupnpd/patches/104-always-libuuid.patch [deleted file]
net/mosquitto/Config.in [new file with mode: 0644]
net/mosquitto/Makefile [new file with mode: 0644]
net/mosquitto/files/etc/config/mosquitto [new file with mode: 0644]
net/mosquitto/files/etc/init.d/mosquitto [new file with mode: 0755]
net/mosquitto/patches/100-remove-build-timestamps.patch [new file with mode: 0644]
net/mtr/Makefile
net/mwan3-luci/Makefile [deleted file]
net/mwan3-luci/files/etc/hotplug.d/iface/16-mwancustombak [deleted file]
net/mwan3-luci/files/etc/uci-defaults/mwan-luci [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_hotplugscript.lua [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_mwanconfig.lua [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_networkconfig.lua [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_wirelessconfig.lua [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/interface.lua [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/interfaceconfig.lua [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/member.lua [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/memberconfig.lua [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/policy.lua [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/policyconfig.lua [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/rule.lua [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/ruleconfig.lua [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/view/admin_status/index/mwan.htm [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_diagnostics.htm [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_hotplugscript.htm [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_mwanconfig.htm [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_networkconfig.htm [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_troubleshooting.htm [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_wirelessconfig.htm [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/config_css.htm [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/openwrt_overview_status.htm [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/overview_detailed.htm [deleted file]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/overview_interface.htm [deleted file]
net/mwan3/Makefile
net/mwan3/files/etc/hotplug.d/iface/14-mwan3 [new file with mode: 0644]
net/mwan3/files/etc/hotplug.d/iface/15-mwan3
net/mwan3/files/etc/hotplug.d/iface/16-mwan3-user
net/mwan3/files/etc/init.d/mwan3 [new file with mode: 0755]
net/mwan3/files/etc/mwan3.user
net/mwan3/files/lib/mwan3/common.sh [new file with mode: 0644]
net/mwan3/files/lib/mwan3/mwan3.sh
net/mwan3/files/usr/libexec/rpcd/mwan3
net/mwan3/files/usr/sbin/mwan3
net/mwan3/files/usr/sbin/mwan3track
net/nbd/Makefile
net/nbd/patches/100-make-gnutls-test-optional.patch [new file with mode: 0644]
net/nbd/patches/101-fix-build-without-gnutls.patch [new file with mode: 0644]
net/ncp/Makefile
net/net-snmp/Makefile
net/net-snmp/files/snmpd.conf
net/net-snmp/files/snmpd.init
net/net-snmp/files/snmptrapd.init [new file with mode: 0644]
net/netatalk/Makefile
net/netcat/Makefile
net/netdiscover/Makefile
net/netopeer2/Config_keystored.in [new file with mode: 0644]
net/netopeer2/Makefile [new file with mode: 0644]
net/netopeer2/files/netopeer2-keystored-keygen.default [new file with mode: 0644]
net/netopeer2/files/netopeer2-keystored.default [new file with mode: 0644]
net/netopeer2/files/netopeer2-server.default [new file with mode: 0644]
net/netopeer2/files/netopeer2-server.init [new file with mode: 0644]
net/netopeer2/files/stock_config.xml [new file with mode: 0644]
net/netopeer2/patches/001-remove-sysrepoctl-commands-from-cmake [new file with mode: 0644]
net/netopeer2/patches/002-fix-for-cmake-build [new file with mode: 0644]
net/netperf/Makefile
net/nfs-kernel-server/Makefile
net/nfs-kernel-server/patches/101-musl-getservbyport.patch
net/nfs-kernel-server/patches/102-limits.patch [new file with mode: 0644]
net/nginx/Config.in
net/nginx/Makefile
net/nginx/patches/102-sizeof_test_fix.patch
net/ngircd/Makefile
net/nlbwmon/Makefile [new file with mode: 0644]
net/nlbwmon/files/nlbwmon.config [new file with mode: 0644]
net/nlbwmon/files/nlbwmon.init [new file with mode: 0755]
net/nmap/Makefile
net/nmap/patches/001-fix-missing-includes.patch [deleted file]
net/noddos/Makefile [new file with mode: 0644]
net/nsd/Makefile
net/ntpclient/Makefile
net/ntpd/Makefile
net/ntpd/README.md [new file with mode: 0644]
net/ntpd/files/ntp.conf [deleted file]
net/ntpd/files/ntpd.hotplug
net/ntpd/files/ntpd.hotplug-helper
net/ntpd/files/ntpd.init
net/ntripcaster/Makefile
net/ntripclient/Makefile
net/ntripserver/Makefile
net/nut/Config.in
net/nut/Makefile
net/nut/files/add_nut_httpd_conf [new file with mode: 0644]
net/nut/files/nut-cgi.init [new file with mode: 0755]
net/nut/files/nut-monitor.init
net/nut/files/nut-sched.default [new file with mode: 0644]
net/nut/files/nut-sendmail-notify [new file with mode: 0755]
net/nut/files/nut-sendmail-notify.default [new file with mode: 0644]
net/nut/files/nut-server.init
net/nut/files/nut_cgi [new file with mode: 0644]
net/nut/files/nut_monitor [new file with mode: 0644]
net/nut/files/nut_server [new file with mode: 0644]
net/obfsproxy/Makefile
net/ocserv/Makefile
net/ocserv/files/ocserv.conf.template
net/ocserv/files/ocserv.init [changed mode: 0644->0755]
net/ola/Makefile [new file with mode: 0644]
net/ola/files/olad.init [new file with mode: 0644]
net/ola/patches/001-Eliminate-protobuf-AddDescriptors-call.patch [new file with mode: 0644]
net/ola/patches/002-remove-visibility-inlines-hidden-flag.patch [new file with mode: 0644]
net/openconnect/Config.in [new file with mode: 0644]
net/openconnect/Makefile [new file with mode: 0644]
net/openconnect/README [new file with mode: 0644]
net/openconnect/files/openconnect-wrapper [new file with mode: 0755]
net/openconnect/files/openconnect.sh [new file with mode: 0755]
net/openconnect/files/openconnect.upgrade [new file with mode: 0644]
net/openconnect/patches/0001-Fix-compilation-with-libp11-version-0.4.7.patch [new file with mode: 0644]
net/opennhrp/Makefile
net/openssh/Makefile
net/openssh/files/sshd.init
net/openssh/patches/100-dscp-qos.patch [new file with mode: 0644]
net/openssh/patches/130-implicit_memset_decl_fix.patch [deleted file]
net/openssh/patches/140-pam_uclibc_pthreads_fix.patch [deleted file]
net/openssh/patches/200-dscp-qos.patch [deleted file]
net/opentracker/Makefile
net/openvswitch/Makefile
net/openvswitch/files/etc/init.d/openvswitch.init
net/openvswitch/patches/0001-musl-compatibility.patch [new file with mode: 0644]
net/openvswitch/patches/0001-netdev-linux-Use-unsigned-int-for-ifi_flags.patch [deleted file]
net/openvswitch/patches/0002-netdev-linux-Let-interface-flag-survive-internal-por.patch [deleted file]
net/openvswitch/patches/0004-musl-compatibility.patch [deleted file]
net/openvswitch/patches/0008-add-back-old-gfp-this-node-define.patch [deleted file]
net/openvswitch/patches/0009-fix-test-ovn.patch [deleted file]
net/openvswitch/patches/0010-lib-ovs-thread-Ensure-that-thread-stacks-are-always-.patch [deleted file]
net/openvswitch/patches/0011-kernel-4-4-support.patch [deleted file]
net/openvswitch/patches/0100-netdev-linux-Use-unsigned-int-for-ifi_flags.patch [new file with mode: 0644]
net/openvswitch/patches/0101-netdev-linux-Let-interface-flag-survive-internal-por.patch [new file with mode: 0644]
net/openvswitch/patches/0102-python-separate-host-target-python-for-cross-compile.patch [new file with mode: 0644]
net/openvswitch/patches/0103-ovs-ctl-fix-setting-hostname.patch [new file with mode: 0644]
net/openvswitch/patches/0104-ovs-lib-fix-install_dir.patch [new file with mode: 0644]
net/p910nd/Makefile
net/pagekitec/Makefile [new file with mode: 0644]
net/pagekitec/files/etc/config/pagekitec [new file with mode: 0644]
net/pagekitec/files/etc/init.d/pagekitec [new file with mode: 0755]
net/pingcheck/Makefile
net/pixiewps/Makefile [new file with mode: 0644]
net/polipo/Makefile
net/port-mirroring/Makefile
net/portmap/Makefile
net/pptpd/Makefile
net/privoxy/Makefile
net/prosody/Makefile
net/quassel-irssi/Makefile
net/radicale/Makefile
net/radsecproxy/Makefile
net/reaver/Makefile
net/reaver/patches/0001-wpscrack-big-endian-fixes.patch [deleted file]
net/reaver/patches/0002-Use-the-current-directory-for-storing-and-loading-se.patch [deleted file]
net/reaver/patches/0003-wash-wpsmon-use-less-useless-spaces-in-output-to-fit.patch [deleted file]
net/reaver/patches/0004-Fixed-probe-request-bug-in-wash.patch [deleted file]
net/reaver/patches/0100-Include-sys-types.h-for-definition-of-u_char.patch [deleted file]
net/reaver/patches/0101-pcap-use-65536-as-snaplen.patch [deleted file]
net/redsocks/Makefile
net/remserial/Makefile
net/rp-pppoe/Makefile
net/rp-pppoe/files/pppoe-relay.init
net/rp-pppoe/files/pppoe-server.init
net/rp-pppoe/patches/100-configure.patch
net/rp-pppoe/patches/110-Makefile.patch
net/rp-pppoe/patches/120-use-linux-ether-not-netinet.patch
net/rp-pppoe/patches/130-static-lib-fix.patch [new file with mode: 0644]
net/rsync/Config.in
net/rsync/Makefile
net/rsyslog/Makefile
net/rtorrent/Makefile
net/scapy/Makefile
net/seafile-ccnet/Makefile
net/seafile-seahub/Makefile
net/seafile-seahub/patches/020-Makefile-fixes.patch
net/seafile-server/Config.in [new file with mode: 0644]
net/seafile-server/Makefile [new file with mode: 0644]
net/seafile-server/files/seafile.conf [new file with mode: 0644]
net/seafile-server/files/seafile.init [new file with mode: 0755]
net/seafile-server/files/seahub.init [new file with mode: 0755]
net/seafile-server/patches/020-script-patches.patch [new file with mode: 0644]
net/seafile-server/patches/030-pidfiles-in-same-directory.patch [new file with mode: 0644]
net/seafile-server/patches/040-seafile-admin.patch [new file with mode: 0644]
net/seafile-server/patches/050-libseafile-makefile-fixes.patch [new file with mode: 0644]
net/seafile-server/patches/060-timestamps-as-int64.patch [new file with mode: 0644]
net/seafile-server/patches/070-fuse-mount.patch [new file with mode: 0644]
net/ser2net/Makefile
net/ser2net/files/ser2net.conf [new file with mode: 0644]
net/ser2net/files/ser2net.config [new file with mode: 0644]
net/ser2net/files/ser2net.init [new file with mode: 0644]
net/shadowsocks-client/Makefile
net/shadowsocks-libev/Makefile
net/shadowsocks-libev/README.md [new file with mode: 0644]
net/shadowsocks-libev/files/firewall.include [deleted file]
net/shadowsocks-libev/files/firewall.ss-rules [new file with mode: 0644]
net/shadowsocks-libev/files/shadowsocks-libev.config
net/shadowsocks-libev/files/shadowsocks-libev.init
net/shadowsocks-libev/files/ss-rules [changed mode: 0644->0755]
net/shadowsocks-libev/files/ss-rules.defaults [new file with mode: 0755]
net/shorewall-core/Makefile [new file with mode: 0644]
net/shorewall-core/patches/110-lib.common.patch [new file with mode: 0644]
net/shorewall-lite/Makefile [new file with mode: 0644]
net/shorewall-lite/files/hostname [new file with mode: 0644]
net/shorewall-lite/files/hotplug_iface [new file with mode: 0644]
net/shorewall-lite/files/shorewall-lite.init [new file with mode: 0644]
net/shorewall-lite/files/vardir [new file with mode: 0644]
net/shorewall-lite/patches/010-install_cp.patch [new file with mode: 0644]
net/shorewall-lite/patches/020-set-PATH.patch [new file with mode: 0644]
net/shorewall-lite/patches/120-logfile.patch [new file with mode: 0644]
net/shorewall/Makefile [new file with mode: 0644]
net/shorewall/files/hostname [new file with mode: 0644]
net/shorewall/files/hotplug_iface [new file with mode: 0644]
net/shorewall/files/shorewall.init [new file with mode: 0644]
net/shorewall/files/vardir [new file with mode: 0644]
net/shorewall/patches/120-logfile.patch [new file with mode: 0644]
net/shorewall/patches/130-set-path.patch [new file with mode: 0644]
net/shorewall6-lite/Makefile [new file with mode: 0644]
net/shorewall6-lite/files/hostname [new file with mode: 0644]
net/shorewall6-lite/files/hotplug_iface [new file with mode: 0644]
net/shorewall6-lite/files/shorewall6-lite.init [new file with mode: 0644]
net/shorewall6-lite/files/vardir [new file with mode: 0644]
net/shorewall6-lite/patches/010-install_cp.patch [new file with mode: 0644]
net/shorewall6-lite/patches/020-set-PATH.patch [new file with mode: 0644]
net/shorewall6-lite/patches/120-logfile.patch [new file with mode: 0644]
net/shorewall6/Makefile [new file with mode: 0644]
net/shorewall6/files/hostname [new file with mode: 0644]
net/shorewall6/files/hotplug_iface [new file with mode: 0644]
net/shorewall6/files/shorewall6.init [new file with mode: 0644]
net/shorewall6/files/vardir [new file with mode: 0644]
net/shorewall6/patches/120-logfile.patch [new file with mode: 0644]
net/shorewall6/patches/130-set-path.patch [new file with mode: 0644]
net/siit/Makefile
net/siit/src/siit.c
net/simple-adblock/Makefile [new file with mode: 0644]
net/simple-adblock/files/README.md [new file with mode: 0644]
net/simple-adblock/files/simple-adblock.conf [new file with mode: 0644]
net/simple-adblock/files/simple-adblock.init [new file with mode: 0644]
net/sipgrep/Makefile [deleted file]
net/smartsnmpd/Makefile
net/sngrep/Makefile [deleted file]
net/snort/Makefile
net/socat/Makefile
net/socat/patches/110-drop_egd_sslv3_support.patch [deleted file]
net/softethervpn/Makefile
net/softethervpn/patches/105-nossl3.patch
net/softflowd/Makefile
net/spawn-fcgi/Makefile
net/sqm-scripts/Makefile
net/squid/Makefile
net/squid/files/squid.config
net/squid/files/squid.init
net/squid/patches/001-cross_compile.patch
net/squid/patches/100-mime.patch [deleted file]
net/sshfs/Makefile
net/sslh/Makefile
net/sslh/files/sslh.config
net/sslh/files/sslh.init
net/sslh/patches/001-no_sslh_select.patch
net/sslh/patches/002-configfile-fix.patch [new file with mode: 0644]
net/sslh/patches/002-no_regex_probes.patch [deleted file]
net/sstp-client/Makefile
net/strongswan/Makefile
net/strongswan/files/ipsec.init
net/strongswan/patches/101-musl-fixes.patch
net/strongswan/patches/203-uci.patch
net/strongswan/patches/210-sleep.patch
net/strongswan/patches/305-minimal_dh_plugin.patch
net/stubby/Makefile [new file with mode: 0644]
net/stubby/files/README.md [new file with mode: 0644]
net/stubby/files/stubby.init [new file with mode: 0644]
net/stubby/files/stubby.yml [new file with mode: 0644]
net/stunnel/Makefile
net/stunnel/files/stunnel.init
net/stunnel/files/stunnel.uci [new file with mode: 0644]
net/subversion/Makefile
net/sysrepo/Config_libsysrepo.in [new file with mode: 0644]
net/sysrepo/Makefile [new file with mode: 0644]
net/sysrepo/files/libsysrepo.default [new file with mode: 0644]
net/sysrepo/files/sysrepo.init [new file with mode: 0644]
net/sysrepo/patches/001-protobuf-remove-protoc-command-from-cmake-file [new file with mode: 0644]
net/sysrepo/patches/002-remove-buildtime-module-install [new file with mode: 0644]
net/sysrepo/patches/003-missing-time-header [new file with mode: 0644]
net/sysrepo/patches/004-disable-sysrepod-autostart [new file with mode: 0644]
net/sysrepo/patches/005-fix-struct-ucred-define [new file with mode: 0644]
net/tcpproxy/Makefile
net/tcpproxy/patches/100-remove-build-timestamps-build-hostname.patch [new file with mode: 0644]
net/tcpreplay/Makefile
net/tgt/Makefile
net/tinc/Makefile
net/tinyproxy/Makefile
net/tor/Makefile
net/tor/patches/001-torrc.patch
net/transmission/Makefile
net/transmission/files/transmission.config
net/transmission/files/transmission.init
net/transmission/files/transmission.sysctl [new file with mode: 0644]
net/transmission/patches/010-add-mbedtls-support.patch [new file with mode: 0644]
net/transmission/patches/020-fix-external-miniupnpc.patch [new file with mode: 0644]
net/transmission/patches/020-use-internal-miniupnp.patch [deleted file]
net/transmission/patches/030-fix-musl-build.patch [deleted file]
net/transmission/patches/030-fix-port-test.patch [new file with mode: 0644]
net/transmission/patches/040-fix-for-mbedtls.patch [deleted file]
net/transmission/patches/040-https-portcheck.patch [new file with mode: 0644]
net/transmission/patches/050-fix-safari.patch [new file with mode: 0644]
net/transmission/patches/050-mask-as-release.patch [deleted file]
net/travelmate/Makefile
net/travelmate/files/README.md
net/travelmate/files/travelmate.conf
net/travelmate/files/travelmate.init
net/travelmate/files/travelmate.sh
net/u2pnpd/Makefile
net/uanytun/Makefile
net/uanytun/patches/100-reproducible-builds.patch [new file with mode: 0644]
net/udpxy/Makefile
net/ulogd/Makefile
net/ulogd/patches/101-ulogd-use-strncpy-instead-of-memcpy.patch [new file with mode: 0644]
net/umurmur/Makefile
net/unbound/Makefile
net/unbound/files/README.md
net/unbound/files/defaults.sh [new file with mode: 0644]
net/unbound/files/dnsmasq.sh
net/unbound/files/odhcpd.awk
net/unbound/files/odhcpd.sh
net/unbound/files/rootzone.sh
net/unbound/files/unbound.init
net/unbound/files/unbound.sh
net/unbound/files/unbound.uci
net/unbound/files/unbound_ext.conf
net/unbound/files/unbound_srv.conf
net/unbound/patches/001-conf.patch
net/usbip/Makefile
net/vallumd/Makefile [new file with mode: 0644]
net/vallumd/files/vallumd.conf [new file with mode: 0644]
net/vallumd/files/vallumd.init [new file with mode: 0644]
net/vncrepeater/Makefile
net/vnstat/Makefile
net/vnstat/patches/001-conf.patch [deleted file]
net/vnstat/patches/002-no_install_strip.patch [deleted file]
net/vnstat/patches/003-no_install_uname.patch [deleted file]
net/vnstat/patches/100-musl-compat.patch [deleted file]
net/vnstat/patches/990-adjust-configuration-defaults.patch [new file with mode: 0644]
net/vpnbypass/Makefile [new file with mode: 0644]
net/vpnbypass/files/README.md [new file with mode: 0644]
net/vpnbypass/files/vpnbypass.conf [new file with mode: 0644]
net/vpnbypass/files/vpnbypass.hotplug [new file with mode: 0644]
net/vpnbypass/files/vpnbypass.init [new file with mode: 0644]
net/vpnc/Makefile
net/vpnc/files/vpnc.sh
net/vsftpd/Makefile
net/wakeonlan/Makefile [new file with mode: 0644]
net/wavemon/Makefile
net/wavemon/patches/musl-fix.patch [deleted file]
net/webui-aria2/Makefile
net/webui-aria2/patches/001-simplify-flag-icon-css.patch [new file with mode: 0644]
net/wget/Makefile
net/wifidog-ng/Makefile [new file with mode: 0644]
net/wifidog-ng/files/wifidog-ng.config [new file with mode: 0644]
net/wifidog-ng/files/wifidog-ng.crt [new file with mode: 0644]
net/wifidog-ng/files/wifidog-ng.init [new file with mode: 0755]
net/wifidog-ng/files/wifidog-ng.key [new file with mode: 0644]
net/wifidog/Makefile
net/wifischedule/Makefile
net/wireguard/Makefile [deleted file]
net/wireguard/files/wireguard.sh [deleted file]
net/wshaper/Makefile [deleted file]
net/wshaper/files/wshaper.config [deleted file]
net/wshaper/files/wshaper.htb [deleted file]
net/wshaper/files/wshaper.iface [deleted file]
net/wshaper/files/wshaper.init [deleted file]
net/xinetd/Makefile
net/xl2tpd/Makefile
net/xl2tpd/README [deleted file]
net/xl2tpd/README.md [new file with mode: 0644]
net/xl2tpd/files/l2tp.sh
net/xl2tpd/files/options.xl2tpd
net/xl2tpd/patches/100-makefile_opt_flags.patch [deleted file]
net/xl2tpd/patches/110-makefile_dont_build_pfc.patch [deleted file]
net/xl2tpd/patches/120-no-bsd-signal-in-musl.patch [deleted file]
net/xl2tpd/patches/200-xl2tpd-control-fix-xl2tpd-hanged-up-in-fopen.patch [deleted file]
net/xtables-addons/Makefile [new file with mode: 0644]
net/xtables-addons/patches/002-fix-kernel-version-detection.patch [new file with mode: 0644]
net/xtables-addons/patches/100-add-rtsp-conntrack.patch [new file with mode: 0644]
net/xtables-addons/patches/200-add-lua-packetscript.patch [new file with mode: 0644]
net/xtables-addons/patches/201-fix-lua-packetscript.patch [new file with mode: 0644]
net/xtables-addons/patches/300-geoip-endian-detection.patch [new file with mode: 0644]
net/yaaw/Makefile
net/zerotier/Config.in
net/zerotier/Makefile
net/zerotier/files/zerotier.config
net/zerotier/files/zerotier.init
net/zerotier/patches/0001-Fix-for-running-under-MUSL-libc-e.g.-Alpine-Linux.patch [deleted file]
net/zerotier/patches/0001-use-external-libminiupnpc-and-libnatpmp.patch [new file with mode: 0644]
net/zerotier/patches/0002-fix-build.patch [deleted file]
net/zerotier/patches/0002-pin-target-to-linux.patch [new file with mode: 0644]
net/zerotier/patches/0003-gcc48.patch [new file with mode: 0644]
net/zerotier/patches/0003-workaround_to_avoid_seg_faults.patch [deleted file]
net/zerotier/patches/0004-Revert-Do-not-serve-controller-requests-until-init-i.patch [new file with mode: 0644]
net/zerotier/patches/0005-use-external-miniupnpc-and-natpmp.patch [deleted file]
net/znc/Makefile
net/znc/patches/100-move_rootcheck_after_config.patch
net/znc/patches/103-Csocket-Add-some-ifdef-feature-checks.patch [deleted file]
net/znc/patches/104-disable-empty-modules-check.patch
sound/alsa-utils/Makefile
sound/espeak/Makefile
sound/fdk-aac/Config.in [new file with mode: 0644]
sound/fdk-aac/Makefile [new file with mode: 0644]
sound/forked-daapd/Makefile
sound/forked-daapd/patches/010-include_pregen.patch [deleted file]
sound/forked-daapd/patches/010-use_a_wrapper_for_dmap_find_field.patch [new file with mode: 0644]
sound/lame/Config.in [new file with mode: 0644]
sound/lame/Makefile
sound/lame/patches/001-automake-compat.patch [deleted file]
sound/madplay/Makefile
sound/mocp/Makefile
sound/mpc/Makefile
sound/mpd/Makefile
sound/mpd/patches/210-support_raw_pcm_streams.patch
sound/mpd/patches/220-handle_slow_server_stream_startup.patch
sound/mpg123/Makefile
sound/opus-tools/Makefile [new file with mode: 0644]
sound/pianod/Makefile
sound/portaudio/Makefile
sound/pulseaudio/Makefile
sound/shairplay/Makefile
sound/shairport-sync/Makefile
sound/shairport-sync/files/shairport-sync.config
sound/shairport-sync/files/shairport-sync.init
sound/shairport-sync/patches/100-replace_polarssl_with_mbedtls.patch [deleted file]
sound/shairport/Makefile [deleted file]
sound/shairport/files/shairport.config [deleted file]
sound/shairport/files/shairport.init [deleted file]
sound/shairport/patches/001-disable_pulseaudio.patch [deleted file]
sound/shine/Makefile
sound/sox/Makefile
sound/sox/patches/020-reproducible-builds.patch [new file with mode: 0644]
sound/squeezelite/Makefile
sound/squeezelite/files/squeezelite.init
sound/squeezelite/patches/020-no_libmad.patch [new file with mode: 0644]
sound/squeezelite/patches/020-no_mpg123.patch [deleted file]
sound/svox/Makefile
sound/upmpdcli/Makefile
utils/acl/Makefile
utils/acpica-unix/Makefile [new file with mode: 0644]
utils/acpid/Makefile
utils/ap51-flash/Makefile
utils/at/Makefile
utils/attendedsysupgrade-common/Makefile [new file with mode: 0644]
utils/attendedsysupgrade-common/files/attendedsysupgrade.defaults [new file with mode: 0644]
utils/attr/Makefile
utils/auc/Makefile [new file with mode: 0644]
utils/auc/src/CMakeLists.txt [new file with mode: 0644]
utils/auc/src/auc.c [new file with mode: 0644]
utils/avrdude/Makefile
utils/avrdude/patches/020-no-cpp-timestamps.patch [new file with mode: 0644]
utils/bandwidthd/Makefile
utils/bash/Makefile
utils/bash/patches/001-compile-fix.patch
utils/bash/patches/002-force-internal-readline.patch
utils/bash/patches/101-upstream-bash43-001.patch [deleted file]
utils/bash/patches/101-upstream-bash44-001.patch [new file with mode: 0644]
utils/bash/patches/102-upstream-bash43-002.patch [deleted file]
utils/bash/patches/102-upstream-bash44-002.patch [new file with mode: 0644]
utils/bash/patches/103-upstream-bash43-003.patch [deleted file]
utils/bash/patches/103-upstream-bash44-003.patch [new file with mode: 0644]
utils/bash/patches/104-upstream-bash43-004.patch [deleted file]
utils/bash/patches/104-upstream-bash44-004.patch [new file with mode: 0644]
utils/bash/patches/105-upstream-bash43-005.patch [deleted file]
utils/bash/patches/105-upstream-bash44-005.patch [new file with mode: 0644]
utils/bash/patches/106-upstream-bash43-006.patch [deleted file]
utils/bash/patches/106-upstream-bash44-006.patch [new file with mode: 0644]
utils/bash/patches/107-upstream-bash43-007.patch [deleted file]
utils/bash/patches/107-upstream-bash44-007.patch [new file with mode: 0644]
utils/bash/patches/108-upstream-bash43-008.patch [deleted file]
utils/bash/patches/108-upstream-bash44-008.patch [new file with mode: 0644]
utils/bash/patches/109-upstream-bash43-009.patch [deleted file]
utils/bash/patches/109-upstream-bash44-009.patch [new file with mode: 0644]
utils/bash/patches/110-upstream-bash43-010.patch [deleted file]
utils/bash/patches/110-upstream-bash44-010.patch [new file with mode: 0644]
utils/bash/patches/111-upstream-bash43-011.patch [deleted file]
utils/bash/patches/111-upstream-bash44-011.patch [new file with mode: 0644]
utils/bash/patches/112-upstream-bash43-012.patch [deleted file]
utils/bash/patches/112-upstream-bash44-012.patch [new file with mode: 0644]
utils/bash/patches/113-upstream-bash43-013.patch [deleted file]
utils/bash/patches/114-upstream-bash43-014.patch [deleted file]
utils/bash/patches/115-upstream-bash43-015.patch [deleted file]
utils/bash/patches/116-upstream-bash43-016.patch [deleted file]
utils/bash/patches/117-upstream-bash43-017.patch [deleted file]
utils/bash/patches/118-upstream-bash43-018.patch [deleted file]
utils/bash/patches/119-upstream-bash43-019.patch [deleted file]
utils/bash/patches/120-upstream-bash43-020.patch [deleted file]
utils/bash/patches/121-upstream-bash43-021.patch [deleted file]
utils/bash/patches/122-upstream-bash43-022.patch [deleted file]
utils/bash/patches/123-upstream-bash43-023.patch [deleted file]
utils/bash/patches/124-upstream-bash43-024.patch [deleted file]
utils/bash/patches/125-upstream-bash43-025.patch [deleted file]
utils/bash/patches/126-upstream-bash43-026.patch [deleted file]
utils/bash/patches/127-upstream-bash43-027.patch [deleted file]
utils/bash/patches/128-upstream-bash43-028.patch [deleted file]
utils/bash/patches/129-upstream-bash43-029.patch [deleted file]
utils/bash/patches/130-upstream-bash43-030.patch [deleted file]
utils/bash/patches/131-upstream-bash43-031.patch [deleted file]
utils/bash/patches/132-upstream-bash43-032.patch [deleted file]
utils/bash/patches/133-upstream-bash43-033.patch [deleted file]
utils/bash/patches/134-upstream-bash43-034.patch [deleted file]
utils/bash/patches/135-upstream-bash43-035.patch [deleted file]
utils/bash/patches/136-upstream-bash43-036.patch [deleted file]
utils/bash/patches/137-upstream-bash43-037.patch [deleted file]
utils/bash/patches/138-upstream-bash43-038.patch [deleted file]
utils/bash/patches/139-upstream-bash43-039.patch [deleted file]
utils/bash/patches/140-upstream-bash43-040.patch [deleted file]
utils/bash/patches/141-upstream-bash43-041.patch [deleted file]
utils/bash/patches/142-upstream-bash43-042.patch [deleted file]
utils/bc/Makefile
utils/beep/Makefile [new file with mode: 0644]
utils/bluelog/Makefile
utils/bluez/Makefile
utils/bluez/files/audio.conf [new file with mode: 0644]
utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch
utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch
utils/bluez/patches/200-uart-speed.patch [deleted file]
utils/bluez/patches/201-readline.patch
utils/bonnie++/Makefile
utils/btrfs-progs/Makefile
utils/btrfs-progs/patches/0001-use-pthread_join-instead-of-pthread_tryjoin_np.patch [deleted file]
utils/canutils/Makefile
utils/ccid/Makefile
utils/ccrypt/Makefile
utils/cmdpad/Makefile
utils/collectd/Makefile
utils/collectd/patches/003-remove-werror.patch [deleted file]
utils/collectd/patches/050-backport-modbus-little-endian.patch [new file with mode: 0644]
utils/collectd/patches/050-upstream-fix-for-network-plugin-ddos.patch [deleted file]
utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch
utils/collectd/patches/140-fix-fqdnlookup.patch
utils/collectd/patches/200-fix-git-describe-error.patch [deleted file]
utils/collectd/patches/300-delay-first-read-cycle.patch
utils/collectd/patches/400-fix-olsrd-get-all.patch
utils/collectd/patches/600-fix-libmodbus-detection.patch
utils/collectd/patches/700-disable-sys-capability-check.patch [new file with mode: 0644]
utils/collectd/patches/900-add-iwinfo-plugin.patch
utils/collectd/patches/920-fix-ping-droprate.patch
utils/coreutils/Makefile
utils/crconf/Makefile [new file with mode: 0644]
utils/crelay/Makefile
utils/cryptodev-linux/Makefile
utils/cryptodev-linux/files/cryptodev.modules [deleted file]
utils/cryptsetup/Makefile
utils/dbus/Makefile
utils/dfu-programmer/Makefile
utils/dfu-util/Makefile [new file with mode: 0644]
utils/digitemp/Makefile [new file with mode: 0644]
utils/digitemp/patches/0001_add_missing_includes.patch [new file with mode: 0644]
utils/dmidecode/Makefile
utils/domoticz/Makefile [new file with mode: 0644]
utils/domoticz/files/domoticz.config [new file with mode: 0644]
utils/domoticz/files/domoticz.hotplug [new file with mode: 0644]
utils/domoticz/files/domoticz.init [new file with mode: 0644]
utils/domoticz/patches/900_fix-build.patch [new file with mode: 0644]
utils/domoticz/patches/901_no-udev.patch [new file with mode: 0644]
utils/domoticz/patches/902_disable-libusb.patch [new file with mode: 0644]
utils/domoticz/patches/903_fhs.patch [new file with mode: 0644]
utils/dosfstools/Makefile
utils/dosfstools/patches/0001-mkfs-Default-to-64-32-heads-sectors-for-targets-smal.patch [deleted file]
utils/dosfstools/patches/0002-Switch-to-AC_CHECK_LIB-for-iconv-library-linking.patch
utils/dump1090/Makefile
utils/dump1090/files/dump1090.default
utils/dvtm/Makefile
utils/ecdsautils/Makefile
utils/eudev/Config.in [deleted file]
utils/eudev/Makefile [deleted file]
utils/eudev/patches/0001-mtd_probe-uses-stdint_h.patch [deleted file]
utils/evtest/Makefile
utils/f2fs-tools/Makefile [deleted file]
utils/f2fs-tools/patches/001-compile.patch [deleted file]
utils/f2fs-tools/patches/010-include-byteswap-h.patch [deleted file]
utils/f2fs-tools/patches/020-sload.f2fs-allow-to-build-without-libselinux.patch [deleted file]
utils/findutils/Makefile
utils/flashrom/Makefile
utils/flashrom/patches/0001-fix_internal_bitbang.patch
utils/flashrom/patches/0002-fix-io-h-include.patch
utils/flent-tools/Makefile
utils/fontconfig/Makefile
utils/gammu/Makefile
utils/gawk/Makefile [new file with mode: 0644]
utils/gkermit/Makefile
utils/gnupg/Makefile
utils/gpsd/Makefile
utils/gpsd/files/gpsd.init
utils/gptfdisk/Makefile [deleted file]
utils/grep/Makefile
utils/gzip/Makefile
utils/hamlib/Makefile [new file with mode: 0644]
utils/haserl/Makefile
utils/haveged/Makefile
utils/hd-idle/Makefile
utils/hdparm/Makefile
utils/hub-ctrl/Makefile
utils/i2c-tools/Makefile
utils/joe/Makefile
utils/jq/Makefile [new file with mode: 0644]
utils/jq/patches/001-stack-exhaustion.patch [new file with mode: 0644]
utils/jq/patches/002-heap-buffer-overflow.patch [new file with mode: 0644]
utils/klish/Makefile
utils/kmod/Makefile
utils/lcd4linux/Makefile
utils/lcdproc/Makefile [new file with mode: 0644]
utils/lcdproc/files/LCDd [new file with mode: 0755]
utils/lcdproc/files/lcdexec [new file with mode: 0755]
utils/lcdproc/files/lcdproc [new file with mode: 0755]
utils/lcdproc/files/lcdvc [new file with mode: 0755]
utils/lcdproc/patches/100-remove-build-timestamp.patch [new file with mode: 0644]
utils/less/Makefile
utils/lm-sensors/Makefile
utils/lm-sensors/files/lm-sensors.init [new file with mode: 0644]
utils/logrotate/Makefile
utils/lrzsz/Makefile
utils/lsof/Makefile
utils/lsof/patches/005-reproducable-build.patch [new file with mode: 0644]
utils/luci-app-lxc/Makefile [deleted file]
utils/luci-app-lxc/files/controller/lxc.lua [deleted file]
utils/luci-app-lxc/files/lxc.config [deleted file]
utils/luci-app-lxc/files/model/cbi/lxc.lua [deleted file]
utils/luci-app-lxc/files/view/lxc.htm [deleted file]
utils/luci-app-lxc/files/www/luci-static/resources/cbi/green.gif [deleted file]
utils/luci-app-lxc/files/www/luci-static/resources/cbi/purple.gif [deleted file]
utils/luci-app-lxc/files/www/luci-static/resources/cbi/red.gif [deleted file]
utils/lvm2/Makefile
utils/lvm2/patches/000-compile.patch
utils/lvm2/patches/002-const-stdio.patch
utils/lxc/Config.in
utils/lxc/Makefile
utils/lxc/files/lxc-unprivileged.defaults [new file with mode: 0644]
utils/lxc/patches/002-compile.patch [new file with mode: 0644]
utils/lxc/patches/003-compile.patch [new file with mode: 0644]
utils/lxc/patches/010-compile.patch
utils/lxc/patches/015-getline.patch
utils/lxc/patches/020-lxc-checkconfig.patch
utils/lxc/patches/025-remove-unsupported-option.patch
utils/lxc/patches/030-lxc-download.patch [deleted file]
utils/lxc/patches/035-fix-undefined-lfd.patch [deleted file]
utils/macchanger/Makefile
utils/mbtools/Makefile
utils/mc/Makefile
utils/mc/patches/010-subshell.patch
utils/minicom/Makefile
utils/minicom/patches/110-reproducible-builds.patch [new file with mode: 0644]
utils/mksh/Makefile
utils/mksh/patches/100-dot_mkshrc
utils/mktorrent/Makefile
utils/mmc-utils/Makefile
utils/moreutils/Makefile [new file with mode: 0644]
utils/moreutils/patches/001_disable-manuals.patch [new file with mode: 0644]
utils/moreutils/patches/002_no-install-strip.patch [new file with mode: 0644]
utils/mpack/Makefile
utils/mpack/patches/001-use-stdlib.patch [new file with mode: 0644]
utils/mt-st/Makefile
utils/mysql/Makefile
utils/nano/Makefile
utils/ncdu/Makefile
utils/netwhere/Makefile [new file with mode: 0644]
utils/ntfs-3g/Makefile
utils/ntfs-3g/patches/001-fuseint-fix-path-mounted-on-musl.patch
utils/oath-toolkit/Makefile
utils/open-plc-utils/Makefile
utils/open-plc-utils/patches/100-remove-build-timestamp.patch [new file with mode: 0644]
utils/openobex/Makefile
utils/openocd/Makefile
utils/opensc/Makefile
utils/openzwave/Makefile [new file with mode: 0644]
utils/openzwave/patches/001-unix-fix-compilation-against-musl-libc-1127.patch [new file with mode: 0644]
utils/openzwave/patches/900_fix-build.patch [new file with mode: 0644]
utils/openzwave/patches/901_no-hidcontroller.patch [new file with mode: 0644]
utils/openzwave/patches/902_no-udev.patch [new file with mode: 0644]
utils/openzwave/patches/903-no-examples.patch [new file with mode: 0644]
utils/openzwave/patches/904-fix-lib-include-path.patch [new file with mode: 0644]
utils/opus-tools/Makefile [deleted file]
utils/owfs/Makefile
utils/pciutils/Makefile
utils/pciutils/patches/104-resolv.patch
utils/pciutils/patches/105-fix-host.patch
utils/pcmciautils/Makefile [new file with mode: 0644]
utils/pcmciautils/files/etc/hotplug.d/pcmcia/pcmcia.agent [new file with mode: 0644]
utils/pcmciautils/files/etc/hotplug.d/pcmcia_socket/pcmcia_socket.agent [new file with mode: 0644]
utils/pcmciautils/files/etc/init.d/pcmcia [new file with mode: 0755]
utils/pcmciautils/files/etc/init.d/pcmcia_socket [new file with mode: 0755]
utils/pcmciautils/patches/001-switch_unsigned.patch [new file with mode: 0644]
utils/pcmciautils/patches/002-disable_yywrap.patch [new file with mode: 0644]
utils/pcsc-lite/Makefile
utils/pcsc-tools/Makefile [new file with mode: 0644]
utils/pcsc-tools/patches/001-disable-atr.patch [new file with mode: 0644]
utils/picocom/Makefile
utils/pps-tools/Makefile
utils/procps-ng/Makefile
utils/progress/Makefile [new file with mode: 0644]
utils/progress/patches/001_set-ncurses-lib.patch [new file with mode: 0644]
utils/prometheus-node-exporter-lua/Makefile [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/etc/config/prometheus-node-exporter-lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/etc/init.d/prometheus-node-exporter-lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/usr/bin/prometheus-node-exporter-lua [new file with mode: 0755]
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/bmx6.lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/bmx7.lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/cpu.lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/filefd.lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/loadavg.lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/meminfo.lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/nat_traffic.lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/netdev.lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/netstat.lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/time.lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/uname.lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/wifi.lua [new file with mode: 0644]
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/wifi_stations.lua [new file with mode: 0644]
utils/pv/Makefile
utils/qemu/Makefile
utils/qemu/patches/0001-allow-disable-fortify-source.patch [deleted file]
utils/qemu/patches/0001-configure-allow-disable-fortify_source.patch [new file with mode: 0644]
utils/qemu/patches/0002-disas-fix-compilation-failure-when-isnan-is-a-macro.patch [new file with mode: 0644]
utils/qemu/patches/0002-setting-language-type-for-_asm-files.patch [deleted file]
utils/qemu/patches/0003-disable-avx2_opt-with-musl.patch [deleted file]
utils/qemu/patches/0003-pc-bios-fix-compilation-when-AS-is-actually-gcc-driv.patch [new file with mode: 0644]
utils/qemu/patches/0004-pixman-fix-detection-of-mips-dspr2.patch [deleted file]
utils/qemu/patches/0005-pixman-arm-neon-assembler-fix.patch [deleted file]
utils/qemu/patches/0006-libvixl-cxx-macro-isnan.patch [deleted file]
utils/relayctl/Makefile
utils/rng-tools/Makefile
utils/rng-tools/patches/100-message-no-newline.patch [new file with mode: 0644]
utils/rpcd-mod-lxc/Makefile
utils/rpcd-mod-lxc/files/lxc.c
utils/rrdtool1/Makefile
utils/rtklib/Makefile
utils/rtl-ais/Makefile
utils/rtl-sdr/Makefile
utils/rtl_433/Makefile [new file with mode: 0644]
utils/rtty/Makefile [new file with mode: 0755]
utils/rtty/files/rtty.config [new file with mode: 0644]
utils/rtty/files/rtty.init [new file with mode: 0644]
utils/sane-backends/Makefile
utils/sane-backends/patches/002-remove-uneeded.patch
utils/sane-backends/patches/020-fix_pieusb.patch [deleted file]
utils/sane-backends/patches/030-musl.patch [deleted file]
utils/sane-backends/patches/031-fix_uclibc.patch
utils/sane-backends/patches/050-remove_linked_libs_for_unused_preload.patch
utils/screen/Makefile
utils/screen/patches/100-cross_compile_fix.patch
utils/screen/patches/110-do_not_add_srcdir_to_include_path.patch
utils/serialconsole/Makefile
utils/setserial/Makefile [new file with mode: 0644]
utils/shadow/Makefile
utils/shadow/patches/003-Check-size-of-uid_t-and-gid_t-using-AC_CHECK_SIZEOF.patch [new file with mode: 0644]
utils/shadow/patches/003-fix-disabling-subids.patch [deleted file]
utils/shadow/patches/004-fix-su-controoling-term.patch
utils/sispmctl/Makefile
utils/slide-switch/Makefile
utils/smartmontools/Makefile
utils/smartmontools/patches/001-musl-compat-realpath.patch [new file with mode: 0644]
utils/smstools3/Makefile
utils/smstools3/files/smstools3.conf
utils/smstools3/files/smstools3.init
utils/smstools3/patches/001-smsd.patch [deleted file]
utils/smstools3/patches/002-Makefile.patch
utils/smstools3/patches/003-bash-ash.patch [new file with mode: 0644]
utils/smstools3/patches/004-modem-processes.patch [new file with mode: 0644]
utils/spi-tools/Makefile
utils/squashfs-tools/Makefile
utils/squashfs-tools/patches/0001-squashfs-tools-fix-fnmatch.h-compatibility-with-musl.patch [deleted file]
utils/squashfs-tools/patches/0002-pseudo.c-add-explicit-stat.h-include.patch [deleted file]
utils/squashfs-tools/patches/0004-vla-to-malloc.patch [new file with mode: 0644]
utils/stm32flash/Makefile
utils/stoken/Makefile
utils/stress/Makefile
utils/sumo/Makefile
utils/swig/Makefile
utils/sysstat/Makefile
utils/sysstat/patches/110-remove-sccsid.patch [new file with mode: 0644]
utils/tar/Makefile
utils/tar/patches/001-CVE-2016-6321.patch [deleted file]
utils/taskwarrior/Makefile
utils/tcsh/Makefile
utils/tcsh/patches/001-sysmalloc.patch [new file with mode: 0644]
utils/tio/Makefile [new file with mode: 0644]
utils/tmux/Makefile
utils/tmux/patches/100-b64_ntop-conflict.patch [deleted file]
utils/tracertools/Makefile
utils/tree/Makefile [new file with mode: 0644]
utils/triggerhappy/Makefile
utils/ttyd/Makefile [new file with mode: 0644]
utils/uledd/Makefile [new file with mode: 0644]
utils/uledd/files/uledd.init [new file with mode: 0644]
utils/unzip/Makefile
utils/unzip/patches/010-remove-build-date.patch [new file with mode: 0644]
utils/usbmuxd/Makefile
utils/uvcdynctrl/Makefile
utils/vim/Makefile
utils/vim/patches/001-compile.patch [deleted file]
utils/vim/patches/001-support-defining-compilation-date-in-SOURCE_DATE_EPOCH.patch [new file with mode: 0644]
utils/watchcat/Makefile
utils/watchcat/files/initd_watchcat
utils/xz/Makefile
utils/yara/Config.in [new file with mode: 0644]
utils/yara/Makefile [new file with mode: 0644]
utils/yunbridge/Makefile
utils/zile/Makefile
utils/zip/Makefile
utils/zip/patches/010-remove-build-date.patch [new file with mode: 0644]
utils/zoneinfo/Makefile
utils/zsh/Makefile

index 72d2c5bef7c1865882a14ffef1a18d72efac580e..f16cab3fda46b3a5ae67bf8babeca0e90994bbcc 100644 (file)
@@ -9,13 +9,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=debootstrap
-PKG_VERSION:=1.0.87
+PKG_VERSION:=1.0.92
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 
 PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap
-PKG_MD5SUM:=784f5754f3287ae80715d9100a4ed04e7895be5f7b81b7b2295d335dd69d79fb
+PKG_HASH:=fa58c00529912d2cc187aa5434962376bd5ec00d3e7e9693f505a27b8848fdcf
 PKG_LICENSE:=Unique
 PKG_LICENSE_FILES:=debian/copyright
 
diff --git a/admin/debootstrap/patches/100-busybox_fix.patch b/admin/debootstrap/patches/100-busybox_fix.patch
deleted file mode 100644 (file)
index 5e8db05..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/usr/share/debootstrap/functions
-+++ b/usr/share/debootstrap/functions
-@@ -859,8 +859,6 @@ choose_extractor () {
-       if [ -n "$EXTRACTOR_OVERRIDE" ]; then
-               extractor="$EXTRACTOR_OVERRIDE"
--      elif type dpkg-deb >/dev/null 2>&1; then
--              extractor="dpkg-deb"
-       else
-               extractor="ar"
-       fi
index 010f36dbf4358241a8e86a322f22170e8b532666..980752dbae0bf69e3a0bdfe365168ac1a69c1923 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=htop
-PKG_VERSION:=2.0.2
+PKG_VERSION:=2.1.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://hisham.hm/htop/releases/$(PKG_VERSION)/
-PKG_MD5SUM:=7d354d904bad591a931ad57e99fea84a
+PKG_HASH:=3260be990d26e25b6b49fc9d96dbc935ad46e61083c0b7f6df413e513bf80748
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/admin/htop/patches/100-fix-libtool-version-check.patch b/admin/htop/patches/100-fix-libtool-version-check.patch
deleted file mode 100644 (file)
index c786213..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -2,7 +2,7 @@
- # Process this file with autoconf to produce a configure script.
- AC_PREREQ(2.65)
--LT_PREREQ([2.4.2])
-+LT_PREREQ([2.4.0])
- AC_INIT([htop],[2.0.2],[hisham@gobolinux.org])
- SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
diff --git a/admin/ipmitool/Makefile b/admin/ipmitool/Makefile
new file mode 100644 (file)
index 0000000..6c7ead7
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2017 Alexander Couzens <lynxis@fe80.eu>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ipmitool
+PKG_VERSION:=1.8.18
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
+PKG_HASH:=0c1ba3b1555edefb7c32ae8cd6a3e04322056bc087918f07189eeedfc8b81e01
+PKG_LICENSE:=BSD-3-clause
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ipmitool
+  SECTION:=admin
+  CATEGORY:=Administration
+  DEPENDS:=+libopenssl +libncurses +libreadline
+  TITLE:=Command-line interface to IPMI-enabled devices
+  URL:=http://sourceforge.net/projects/ipmitool/
+  MAINTAINER:=Alexander Couzens <lynxis@fe80.eu>
+endef
+
+define Package/ipmitool/Default/description
+       Command-line interface to IPMI-enabled devices
+endef
+
+define Package/ipmitool/install
+       $(INSTALL_DIR) $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ipmievd $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ipmitool $(1)/usr/sbin/
+endef
+
+define Package/ipmitool/conffiles
+endef
+
+CONFIGURE_ARGS += \
+       --enable-intf-lan \
+       --enable-intf-lanplus \
+       --enable-intf-serial \
+       --enable-intf-free \
+       --enable-intf-open \
+       --enable-intf-imb \
+       --enable-ipmishell
+
+$(eval $(call BuildPackage,ipmitool))
index 4f8c14a29e4ffd7865ac11ab8b58138fd035d4a1..3c6bf6352f31a94a53e2adf14b06fc07963cddc4 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=monit
-PKG_VERSION:=5.18
+PKG_VERSION:=5.24.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://mmonit.com/monit/dist
-PKG_MD5SUM:=a1bfac0fbb83439435f8616200d2364d
+PKG_HASH:=754d1f0e165e5a26d4639a6a83f44ccf839e381f2622e0946d5302fa1f2d2414
+PKG_SOURCE_URL:=https://mmonit.com/monit/dist
 
 PKG_LICENSE:=AGPL-3.0
 PKG_LICENSE_FILES:=COPYING
@@ -26,9 +26,9 @@ include $(INCLUDE_DIR)/package.mk
 define Package/monit/Default
   SECTION:=admin
   CATEGORY:=Administration
-  DEPENDS:= +libpthread
+  DEPENDS:= +libpthread +zlib
   TITLE:=System services monitoring utility
-  URL:=http://mmonit.com/monit/
+  URL:=https://mmonit.com/monit/
   MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
 endef
 
index 7af871f0deb4492e927c697caf1c5b2f9aee00ac..6382f6f40af7fcf0359d3e88c9e08425c622cfdc 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -13849,14 +13849,7 @@ fi
+@@ -13852,14 +13852,7 @@ fi
  # Find the right directory to put the root-mode PID file in
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking pid file location" >&5
  $as_echo_n "checking pid file location... " >&6; }
index ef7e11d8d5c94cc65c41b43aaf869b81e9122dc8..022da01881a7cf80df807cf0731b33725eaf6185 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=8
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=a8cc86f0cc536a6c22dc298f4ed55339
+PKG_HASH:=736482dd6d6849d014d975b1f5794f20dda6e123dbba2d8c2f169c8e787e6f7e
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=LICENSE
 
index 022ef8b9ac9ec14e5ec8787c52f1b30c8446b103..08f2bda536b08034cbb497b0d355ad21ef4e70d7 100644 (file)
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=netdata
-PKG_VERSION:=1.4.0
-PKG_RELEASE:=3
-PKG_MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
+PKG_VERSION:=1.9.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://firehol.org/download/netdata/releases/v$(PKG_VERSION)
-PKG_SOURCE_VERSION:=3028b87ee19e8550df6b9decc49733d595e0bd6e
+PKG_SOURCE_URL:=https://github.com/firehol/netdata/releases/download/v$(PKG_VERSION)
+PKG_HASH:=2358f2239e2d62da82af9f8b9ec8e6b1d37ac6cb009a15cf4c1d2cc2638a87e7
 
 PKG_INSTALL:=1
 PKG_FIXUP:=autoreconf
@@ -26,9 +26,9 @@ include $(INCLUDE_DIR)/package.mk
 define Package/netdata
   SECTION:=admin
   CATEGORY:=Administration
-  DEPENDS:=+zlib +libuuid
+  DEPENDS:=+zlib +libuuid +libmnl
   TITLE:=Real-time performance monitoring tool
-  URL:=http://netdata.firehol.org/
+  URL:=https://my-netdata.io/
 endef
 
 define Package/netdata/description
@@ -36,6 +36,12 @@ define Package/netdata/description
   monitoring for Linux systems, applications and SNMP devices over the web.
 endef
 
+TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
+TARGET_CFLAGS += -ffunction-sections -fdata-sections -O3
+TARGET_LDFLAGS += -Wl,--gc-sections
+
+CONFIGURE_ARGS += --with-zlib --with-math --disable-x86-sse --disable-lto
+
 define Package/netdata/conffiles
 /etc/netdata/
 endef
@@ -46,18 +52,15 @@ define Package/netdata/install
        $(CP) ./files/netdata.conf $(1)/etc/netdata
        mkdir -p $(1)/usr/share/netdata
        $(CP) $(PKG_INSTALL_DIR)/usr/share/netdata $(1)/usr/share
-       rm $(1)/usr/share/netdata/web/images/animated.gif
+       rm -rf $(1)/usr/share/netdata/web/images
        rm -rf $(1)/usr/share/netdata/web/old
        rm $(1)/usr/share/netdata/web/demo*html
        rm $(1)/usr/share/netdata/web/fonts/*.svg
        rm $(1)/usr/share/netdata/web/fonts/*.ttf
        rm $(1)/usr/share/netdata/web/fonts/*.woff
-       rm $(1)/usr/share/netdata/web/fonts/*.otf
        mkdir -p $(1)/usr/lib/netdata
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/netdata $(1)/usr/lib
        rm $(1)/usr/lib/netdata/python.d/python-modules-installer.sh
-       rm -rf $(1)/usr/lib/netdata/python.d/python_modules/pyyaml2
-       rm -rf $(1)/usr/lib/netdata/python.d/python_modules/pyyaml3
        chmod 4755 $(1)/usr/lib/netdata/plugins.d/apps.plugin
        mkdir -p $(1)/etc/init.d
        $(INSTALL_BIN) ./files/netdata.init $(1)/etc/init.d/netdata
index 8c5c56b8a226607cf6bd87ff43b0db8686e57333..13418b55e5ed8d1f98371155afccf479deb03b61 100644 (file)
-### NetData Configuration
-
-### Notes about plugins
-###
-### charts.d    - REQUIRES Bash, enable here and edit charts.d.conf
-### apps        - none atm
-### node.d      - REQUIRES node.js
-### tc          - QoS stats (if wanted)
-### cgcroups    - No support in OpenWRT/LEDE by default
-### health      - Disabled by default
-### KSM         - No support in OpenWRT/LEDE by default
-### python.d    - REQUIRES python and PyYAML, edit python.d.conf to enable
+# netdata configuration
+#
+# You can download the latest version of this file, using:
+#
+#  wget -O /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
+# or
+#  curl -o /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
+#
+# You can uncomment and change any of the options below.
+# The value shown in the commented settings, is the default value.
+#
+# Notes about plugins
+#
+# tc          - QoS stats (if wanted)
+# cgcroups    - No support in OpenWRT/LEDE by default
+# charts.d    - REQUIRES bash, enable here and edit charts.d.conf
+# node.d      - REQUIRES node.js
+# python.d    - REQUIRES python and PyYAML, edit python.d.conf to enable
+# apps        - none atm
+# health      - Disabled by default
+# KSM         - No support in OpenWRT/LEDE by default
+
+# global netdata configuration
 
 [global]
-       run as user = nobody
-       web files owner = root
-       web files group = root
-       update every = 2
-       history = 1800
-       access log = none
+       # glibc malloc arena max for plugins = 1
+       # glibc malloc arena max for netdata = 1
+       # config directory = /etc/netdata
+       # plugins directory = /usr/libexec/netdata/plugins.d
+       # web files directory = /usr/share/netdata/web
+       # cache directory = /var/cache/netdata
+       # lib directory = /var/lib/netdata
+       # log directory = /var/log/netdata
+       # host access prefix = 
+       # home directory = /var/cache/netdata
+       # debug flags = 0x00000000
+       memory deduplication (ksm) = no
        debug log = syslog
        error log = syslog
+       access log = none
+       # errors flood protection period = 1200
+       # errors to trigger flood protection = 200
        memory mode = ram
+       # hostname = LEDE
+       # history = 3600
+       # update every = 1
+       update every = 2
+       # pthread stack size = 8388608
+       run as user = nobody
+
+[web]
+       web files owner = root
+       web files group = root
+       # default port = 19999
+       # bind to = *
 
 [plugins]
-       charts.d = no
-       apps = no
-       node.d = no
+       # PATH environment variable = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
        tc = no
+       # idlejitter = yes
+       # proc = yes
+       # diskspace = yes
        cgroups = no
+       # checks = no
+       # plugins directory = /usr/libexec/netdata/plugins.d
+       enable running new plugins = no
+       # check for new plugins every = 60
+       charts.d = no
+       # plugins directory = /usr/libexec/netdata/plugins.d
+       node.d = no
+       python.d = no
+       apps = no
+       fping = no
+
+[registry]
+       # enabled = no
+       # registry db directory = /var/lib/netdata/registry
+       # netdata unique id file = /var/lib/netdata/registry/netdata.public.unique.id
+       # registry db file = /var/lib/netdata/registry/registry.db
+       # registry log file = /var/lib/netdata/registry/registry-log.db
+       # registry save db every new entries = 1000000
+       # registry expire idle persons days = 365
+       # registry domain = 
+       # registry to announce = https://registry.my-netdata.io
+       # registry hostname = LEDE
+       # verify browser cookies support = yes
+       # max URL length = 1024
+       # max URL name length = 50
 
 [health]
        enabled = no
+       # health db directory = /var/lib/netdata/health
+       # health db file = /var/lib/netdata/health/health-log.db
+       # health configuration directory = /etc/netdata/health.d
+       # script to execute on alarm = /usr/libexec/netdata/plugins.d/alarm-notify.sh
+       # in memory max health log entries = 1000
+       # run at least every seconds = 10
+       # rotate log every lines = 2000
+
+[backend]
+       # enabled = no
+       # data source = average
+       # type = graphite
+       # destination = localhost
+       # prefix = netdata
+       # hostname = LEDE
+       # update every = 10
+       # buffer on failures = 10
+       # timeout ms = 20000
+
+# per plugin configuration
+
+[plugin:fping]
+       # update every = 1
+       # command options = 
 
 [plugin:proc]
-       /proc/net/softnet_stat = no
-       /proc/net/snmp = no
+       # netdata server resources = yes
+       # /proc/stat = yes
+       # /proc/uptime = yes
+       # /proc/loadavg = yes
+       # /proc/sys/kernel/random/entropy_avail = yes
+       # /proc/interrupts = yes
+       # /proc/softirqs = yes
+       # /proc/vmstat = yes
+       # /proc/meminfo = yes
        /sys/kernel/mm/ksm = no
+       /sys/devices/system/edac/mc = no
+       /sys/devices/system/node = no
+       # /proc/net/dev = yes
        /proc/net/netstat = no
-       /proc/net/ip_vs_stats = no
+       /proc/net/snmp = no
+       /proc/net/snmp6 = no
+       /proc/net/softnet_stat = no
+       /proc/net/ip_vs/stats = no
+       # /proc/net/stat/conntrack = yes
        /proc/net/stat/synproxy = no
+       # /proc/diskstats = yes
        /proc/net/rpc/nfsd = no
        /proc/net/rpc/nfs = no
+       # ipc = yes
+       /proc/spl/kstat/zfs/arcstats = no
+
+[plugin:proc:/proc/stat]
+       # cpu utilization = yes
+       # per cpu core utilization = yes
+       # cpu interrupts = yes
+       # context switches = yes
+       # processes started = yes
+       # processes running = yes
+       # filename to monitor = /proc/stat
+
+[plugin:proc:/proc/interrupts]
+       # interrupts per core = yes
+       # filename to monitor = /proc/interrupts
+
+[plugin:proc:/proc/softirqs]
+       # interrupts per core = yes
+       # filename to monitor = /proc/softirqs
+
+[plugin:proc:/proc/net/dev]
+       # enable new interfaces detected at runtime = auto
+       # bandwidth for all interfaces = auto
+       # packets for all interfaces = auto
+       # errors for all interfaces = auto
+       # drops for all interfaces = auto
+       # fifo for all interfaces = auto
+       # compressed packets for all interfaces = auto
+       # frames, collisions, carrier counters for all interfaces = auto
+       # disable by default interfaces matching = lo fireqos* *-ifb
+       # filename to monitor = /proc/net/dev 
+
+[plugin:proc:/proc/net/dev:eth0]
+       # enabled = yes
+       # bandwidth = auto
+       # packets = auto
+       # errors = auto
+       # drops = auto
+       # fifo = auto
+       # compressed = auto
+       # events = auto
+
+[plugin:proc:/proc/diskstats]
+       # enable new disks detected at runtime = yes
+       # performance metrics for physical disks = auto
+       # performance metrics for virtual disks = auto
+       # performance metrics for partitions = no
+       # bandwidth for all disks = auto
+       # operations for all disks = auto
+       # merged operations for all disks = auto
+       # i/o time for all disks = auto
+       # queued operations for all disks = auto
+       # utilization percentage for all disks = auto
+       # backlog for all disks = auto
+       # filename to monitor = /proc/diskstats
+       # path to get block device infos = /sys/dev/block/%lu:%lu/%s
+       # path to get h/w sector size = /sys/block/%s/queue/hw_sector_size
+       # path to get h/w sector size for partitions = /sys/dev/block/%lu:%lu/subsystem/%s/../queue/hw_sector_size
+       # performance metrics for disks with major 8 = yes
+
+[plugin:proc:/proc/diskstats:sda]
+       # enable = yes
+       # enable performance metrics = yes
+       # bandwidth = auto
+       # operations = auto
+       # merged operations = auto
+       # i/o time = auto
+       # queued operations = auto
+       # utilization percentage = auto
+       # backlog = auto
+
+[plugin:proc:/proc/net/rpc/nfsd]
+       # filename to monitor = /proc/net/rpc/nfsd
+       # read cache = yes
+       # file handles = yes
+       # I/O = yes
+       # threads = yes
+       # read ahead = yes
+       # network = yes
+       # rpc = yes
+       # NFS v2 procedures = yes
+       # NFS v3 procedures = yes
+       # NFS v4 procedures = yes
+       # NFS v4 operations = yes
+
+[plugin:proc:/proc/net/rpc/nfs]
+       # filename to monitor = /proc/net/rpc/nfs
+       # network = yes
+       # rpc = yes
+       # NFS v2 procedures = yes
+       # NFS v3 procedures = yes
+       # NFS v4 procedures = yes
index cf9dc83ec5b40d61b1b60b36a0c995996d76fa66..629789247e9ee87062368f8cfa0c2a060a8e0122 100644 (file)
@@ -1,5 +1,3 @@
-diff --git a/conf.d/charts.d.conf b/conf.d/charts.d.conf
-index acb2a6f..8111859 100644
 --- a/conf.d/charts.d.conf
 +++ b/conf.d/charts.d.conf
 @@ -30,7 +30,7 @@
@@ -11,8 +9,6 @@ index acb2a6f..8111859 100644
  
  # BY DEFAULT ENABLED MODULES
  # ap=yes
-diff --git a/conf.d/python.d.conf b/conf.d/python.d.conf
-index 940bd91..78e2f0a 100644
 --- a/conf.d/python.d.conf
 +++ b/conf.d/python.d.conf
 @@ -7,7 +7,7 @@
index ed539b02ea81005b917067fa0f1664f9cec2799b..c2237e321cf8ab4eef83b0f725f2c88175bb12a1 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openwisp-config
 PKG_VERSION:=0.4.5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_PROTO:=git
@@ -34,8 +34,6 @@ endef
 Package/openwisp-config-openssl=$(call Package/openwisp-config/default,openssl,OpenSSL,+ca-certificates +libopenssl)
 Package/openwisp-config-mbedtls=$(call Package/openwisp-config/default,mbedtls,mbedTLS,+ca-certificates +libmbedtls)
 Package/openwisp-config-cyassl=$(call Package/openwisp-config/default,cyassl,CyaSSL,+ca-certificates +libcyassl)
-# deprecated on recent versions of OpenWRT (>= Designated Driver) and LEDE (>= 17.01)
-Package/openwisp-config-polarssl=$(call Package/openwisp-config/default,polarssl,PolarSSL,+ca-certificates +libpolarssl)
 Package/openwisp-config-nossl=$(call Package/openwisp-config/default,nossl,No SSL)
 
 define Build/Compile
@@ -54,9 +52,6 @@ endif
 ifeq ($(BUILD_VARIANT),cyassl)
 CONFIG_OPENWISP_UCI:=ssl
 endif
-ifeq ($(BUILD_VARIANT),polarssl)
-CONFIG_OPENWISP_UCI:=ssl
-endif
 ifeq ($(BUILD_VARIANT),nossl)
 CONFIG_OPENWISP_UCI:=nossl
 endif
@@ -115,5 +110,4 @@ endef
 $(eval $(call BuildPackage,openwisp-config-openssl))
 $(eval $(call BuildPackage,openwisp-config-mbedtls))
 $(eval $(call BuildPackage,openwisp-config-cyassl))
-$(eval $(call BuildPackage,openwisp-config-polarssl))
 $(eval $(call BuildPackage,openwisp-config-nossl))
index e9090eea407115326eb3a7416a302fc5626362ee..16779a7b1b5f42128560c7c68f093e861a755035 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2015 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sudo
-PKG_VERSION:=1.8.14p3
+PKG_VERSION:=1.8.21p2
 PKG_RELEASE:=1
 PKG_LICENSE:=ISC
 PKG_LICENSE_FILES:=doc/LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.sudo.ws/dist
-PKG_MD5SUM:=93dbd1e47c136179ff1b01494c1c0e75
+PKG_HASH:=74c5746cd33a814e2431c39faf0d76f7f8a697379bd073862e3b156cf0d76368
 
 PKG_INSTALL:=1
 
index 0486164ef34a189b8659c986f716a89eb2db424b..e294ff5771d5823930ee1ea9a1181576f05540f8 100644 (file)
@@ -1,14 +1,14 @@
 include  $(TOPDIR)/rules.mk
 
 PKG_NAME:=syslog-ng
-PKG_VERSION:=3.8.1
+PKG_VERSION:=3.9.1
 PKG_RELEASE:=3
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/balabit/syslog-ng/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
-PKG_MD5SUM:=acf14563cf5ce435db8db35486ce66af
+PKG_HASH:=5678856a550ae790618fabde9d1447f932ce7a9080d55dca8fc5df1202c70a17
 
 PKG_INSTALL:=1
 
@@ -30,7 +30,8 @@ define Package/syslog-ng/description
 endef
 
 define Package/syslog-ng/conffiles
-  /etc/syslog-ng.conf
+/etc/syslog-ng.conf
+/etc/syslog-ng.d/
 endef
 
 define Build/Configure
@@ -41,7 +42,7 @@ endef
 CONFIGURE_ARGS += \
   $(call autoconf_bool,CONFIG_IPV6,ipv6) \
          --disable-dependency-tracking \
-         --disable-ampq \
+         --disable-amqp \
          --disable-tcp-wrapper \
          --disable-glibtest \
          --disable-mongodb \
@@ -68,8 +69,8 @@ define Package/syslog-ng/install
                install-moduleLTLIBRARIES DESTDIR="$(1)"
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/syslog-ng.init $(1)/etc/init.d/syslog-ng
-       $(INSTALL_DIR) $(1)/etc
        $(INSTALL_DATA) ./files/syslog-ng.conf $(1)/etc
+       $(INSTALL_DIR) $(1)/etc/syslog-ng.d/
        $(call libtool_remove_files,$(1))
 endef
 
index 6786bc3269406497f68493001045a89fad114c55..cae24a8484eab6963a509ba16591be4452eeaeb8 100644 (file)
@@ -1,4 +1,4 @@
-@version:3.8
+@version:3.9
 
 options {
        chain_hostnames(no);
@@ -14,7 +14,7 @@ options {
 
 source src {
        internal();
-       unix-stream("/dev/log");
+       unix-dgram("/dev/log");
 };
 
 source net {
@@ -35,3 +35,7 @@ log {
         source(kernel);
        destination(messages);
 };
+
+# put any customization files in this directory
+@include "/etc/syslog-ng.d/"
+
index cecb3f9047937e9ee886a0e3405422d88625769f..bb03de67229613753f5b8f78607a35a83813a163 100644 (file)
@@ -2,18 +2,30 @@
 # Copyright (C) 2006-2016 OpenWrt.org
 
 START=20
+PROG=/usr/sbin/syslog-ng
+PROG2=/usr/sbin/syslog-ng-ctl
 
 SERVICE_USE_PID=1
+SERVICE_PID_FILE=/var/run/syslog-ng.pid
+
+config_file=/etc/syslog-ng.conf
 
 start() {
-       [ -f /etc/syslog-ng.conf ] || return 1
-       service_start /usr/sbin/syslog-ng
+       [ -f $config_file ] || return 1
+
+       if ! $PROG -s 2>/dev/null ; then
+               echo "Couldn't parse $(basename $config_file)" >&2
+               exit 1
+       fi
+
+       service_start $PROG --process-mode background \
+               -p $SERVICE_PID_FILE
 }
 
 stop() {
-       service_stop /usr/sbin/syslog-ng
+       service_stop $PROG
 }
 
 reload() {
-       service_reload /usr/sbin/syslog-ng
+       $PROG2 reload
 }
diff --git a/admin/syslog-ng/patches/100-use-1.0.2k-threadids.patch b/admin/syslog-ng/patches/100-use-1.0.2k-threadids.patch
new file mode 100644 (file)
index 0000000..17c005a
--- /dev/null
@@ -0,0 +1,35 @@
+--- a/lib/crypto.c     2016-12-21 07:57:44.000000000 -0700
++++ b/lib/crypto.c     2017-03-24 13:19:34.188259018 -0600
+@@ -51,11 +51,20 @@
+     }
+ }
++#if OPENSSL_VERSION_NUMBER < 0x10000000
+ static unsigned long
+ ssl_thread_id(void)
+ {
+   return (unsigned long) get_thread_id();
+ }
++
++#else
++static void
++ssl_thread_id2(CRYPTO_THREADID *id)
++{
++  CRYPTO_THREADID_set_numeric(id, get_thread_id());
++}
++#endif
+ static void
+ crypto_init_threading(void)
+@@ -68,7 +76,11 @@
+     {
+       g_static_mutex_init(&ssl_locks[i]);
+     }
++#if OPENSSL_VERSION_NUMBER < 0x10000000
+   CRYPTO_set_id_callback(ssl_thread_id);
++#else
++  CRYPTO_THREADID_set_callback(ssl_thread_id2);
++#endif
+   CRYPTO_set_locking_callback(ssl_locking_callback);
+ }
index f66c237d074fa48ee653f7dd6cc72fb61c8d4bf5..af5044e0818b1ee1fc90ee68129dd61bbcadc810 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zabbix
-PKG_VERSION:=3.0.3
-PKG_RELEASE:=1
+PKG_VERSION:=3.2.7
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=3ea0c299bd69bc728177128740f0476bc1a2c1de438330df5bbd8f5fc6090712
 PKG_SOURCE_URL:=@SF/zabbix
-PKG_MD5SUM:=7c45d37000e67d75042695344c9937e0
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index afa50aeba5e9d2ecd594fa1ba023b250a0e62107..a567f85ce2864f8f0684263ba44594136cda5129 100644 (file)
@@ -15,13 +15,15 @@ UserParameter=mac80211.ACKFailureCount[*],zabbix_helper_mac80211 $1 dot11ACKFail
 UserParameter=mac80211.FCSErrorCount[*],zabbix_helper_mac80211 $1 dot11FCSErrorCount
 UserParameter=mac80211.RTSFailureCount[*],zabbix_helper_mac80211 $1 dot11RTSFailureCount
 UserParameter=mac80211.RTSSuccessCount[*],zabbix_helper_mac80211 $1 dot11RTSSuccessCount
-UserParameter=mac80211.FailedCount[*],zabbix_helper_mac80211 $1 failed_count
-UserParameter=mac80211.FrameDuplicateCount[*],zabbix_helper_mac80211 $1 frame_duplicate_count
-UserParameter=mac80211.MulticastReceivedFrameCount[*],zabbix_helper_mac80211 $1 multicast_received_frame_count
-UserParameter=mac80211.MulticastTransmittedFrameCount[*],zabbix_helper_mac80211 $1 multicast_transmitted_frame_count
-UserParameter=mac80211.MultipleRetryCount[*],zabbix_helper_mac80211 $1 multiple_retry_count
-UserParameter=mac80211.ReceivedFragmentCount[*],zabbix_helper_mac80211 $1 received_fragment_count
-UserParameter=mac80211.RetryCount[*],zabbix_helper_mac80211 $1 retry_count
-UserParameter=mac80211.TransmittedFragmentCount[*],zabbix_helper_mac80211 $1 transmitted_fragment_count
-UserParameter=mac80211.TransmittedFrameCount[*],zabbix_helper_mac80211 $1 transmitted_frame_count
+
+# hidden behind MAC80211_DEBUG_COUNTERS
+UserParameter=mac80211.FailedCount[*],zabbix_helper_mac80211 $1 dot11FailedCount
+UserParameter=mac80211.FrameDuplicateCount[*],zabbix_helper_mac80211 $1 dot11FrameDuplicateCount
+UserParameter=mac80211.MulticastReceivedFrameCount[*],zabbix_helper_mac80211 $1 dot11MulticastReceivedFrameCount
+UserParameter=mac80211.MulticastTransmittedFrameCount[*],zabbix_helper_mac80211 $1 dot11MulticastTransmittedFrameCount
+UserParameter=mac80211.MultipleRetryCount[*],zabbix_helper_mac80211 $1 dot11MultipleRetryCount
+UserParameter=mac80211.ReceivedFragmentCount[*],zabbix_helper_mac80211 $1 dot11ReceivedFragmentCount
+UserParameter=mac80211.RetryCount[*],zabbix_helper_mac80211 $1 dot11RetryCount
+UserParameter=mac80211.TransmittedFragmentCount[*],zabbix_helper_mac80211 $1 dot11TransmittedFragmentCount
+UserParameter=mac80211.TransmittedFrameCount[*],zabbix_helper_mac80211 $1 dot11TransmittedFrameCount
 
diff --git a/admin/zabbix/patches/110-reproducible-builds.patch b/admin/zabbix/patches/110-reproducible-builds.patch
new file mode 100644 (file)
index 0000000..f7d03fa
--- /dev/null
@@ -0,0 +1,13 @@
+Index: zabbix-3.2.7/src/libs/zbxcommon/str.c
+===================================================================
+--- zabbix-3.2.7.orig/src/libs/zbxcommon/str.c
++++ zabbix-3.2.7/src/libs/zbxcommon/str.c
+@@ -51,7 +51,7 @@ static const char    help_message_footer[]
+ void  version(void)
+ {
+       printf("%s (Zabbix) %s\n", title_message, ZABBIX_VERSION);
+-      printf("Revision %s %s, compilation time: %s %s\n\n", ZABBIX_REVISION, ZABBIX_REVDATE, __DATE__, __TIME__);
++      printf("Revision %s %s\n\n", ZABBIX_REVISION, ZABBIX_REVDATE);
+       puts(copyright_message);
+ }
diff --git a/alpha_notes b/alpha_notes
new file mode 100644 (file)
index 0000000..5ff2823
--- /dev/null
@@ -0,0 +1,6 @@
+Upstream checkout @ 655b02a54fda5e7407f3f18c99085427aeae50ff
+
+This was a quick pull from upstream for a demo. This branch might contain
+non-free programs or other programs that don't meet project standards. If you
+find such programs, please file a bug report against this or the librecmc 
+source repository.
index 598654d13bdf71be896f54d0c7f97d45c9592625..48d71b7dacad3bb094e0b80ab87a88a9d4fe9f28 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=@GNU/autoconf
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=50f97f4159805e374639a73e2636f22e
+PKG_HASH:=64ebcec9f8ac5b2487125a86a7760d2591ac9e1d3dbd59489633f9de62a57684
 PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
 PKG_LICENSE:=GPL-3.0+
 
diff --git a/devel/automake/Makefile b/devel/automake/Makefile
new file mode 100644 (file)
index 0000000..87a69b1
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=automake
+PKG_VERSION:=1.15
+PKG_RELEASE:=4
+
+PKG_SOURCE_URL:=@GNU/automake
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_HASH:=9908c75aabd49d13661d6dcb1bc382252d22cc77bf733a2d55e87f2aa2db8636
+PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
+PKG_LICENSE:=GPL-3.0+
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/automake
+  SECTION:=devel
+  CATEGORY:=Development
+  TITLE:=automake
+  URL:=https://www.gnu.org/software/automake/
+  DEPENDS:=+autoconf +perlbase-thread +perlbase-attributes
+endef
+
+define Package/automake/description
+  Automake is a tool for automatically generating Makefile.in files compliant
+  with the GNU Coding Standards.
+endef
+
+FIX_PATHS = $(SED) '1c \#!/usr/bin/perl' -e 's| /[^ ]*/bin/perl| /usr/bin/perl|g'
+
+define Package/automake/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/automake-$(PKG_VERSION) \
+         $(1)/usr/bin/automake-$(PKG_VERSION)
+       $(LN) automake-$(PKG_VERSION) $(1)/usr/bin/automake
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aclocal-$(PKG_VERSION) \
+         $(1)/usr/bin/aclocal-$(PKG_VERSION)
+       $(LN) aclocal-$(PKG_VERSION) $(1)/usr/bin/aclocal
+       $(FIX_PATHS) $(1)/usr/bin/automake-$(PKG_VERSION)
+       $(FIX_PATHS) $(1)/usr/bin/aclocal-$(PKG_VERSION)
+       $(INSTALL_DIR) $(1)/usr/share/automake-$(PKG_VERSION)
+
+       for dir in \
+         automake-$(PKG_VERSION) automake-$(PKG_VERSION)/Automake \
+         automake-$(PKG_VERSION)/am aclocal \
+         aclocal-$(PKG_VERSION) aclocal-$(PKG_VERSION)/internal \
+       ; do \
+               $(INSTALL_DIR) $(1)/usr/share/$$$$dir; \
+               for file in $$$$(cd $(PKG_INSTALL_DIR) && \
+                 find usr/share/$$$$dir -maxdepth 1 -type f); do \
+                       $(INSTALL_DATA) $$(PKG_INSTALL_DIR)/$$$$file \
+                       $(1)/$$$$file; \
+               done; \
+       done
+endef
+
+$(eval $(call BuildPackage,automake))
index fb00a42d8df1ed9d659a4e205838643c5fb13c93..643eaf9a1f026b7e666b479e94413b34373f2254 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=diffutils
-PKG_VERSION:=3.3
-PKG_RELEASE:=2
+PKG_VERSION:=3.6
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/diffutils
-PKG_MD5SUM:=99180208ec2a82ce71f55b0d7389f1b3
+PKG_HASH:=d621e8bdd4b573918c8145f7ae61817d1be9deb4c8d2328a65cea8e11d783bd6
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
 PKG_LICENSE:=GPL-3.0
 
index b23b7abe9ef6ec739461f077f4c909a359fb9f3c..9d6a46f46a5c22e759563deddeb9b342728138dc 100644 (file)
@@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gcc
 PKG_VERSION:=5.4.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
-PKG_MD5SUM:=4c626ac2a83ef30dfb9260e6f59c2b30
+PKG_HASH:=608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_INSTALL:=1
 PKG_FIXUP:=libtool
@@ -31,6 +31,11 @@ RSTRIP:= \
        STRIP_KMOD="$(STRIP) --strip-debug" \
        $(SCRIPT_DIR)/rstrip.sh
 
+ifneq ($(CONFIG_SOFT_FLOAT),y)
+       ifeq ($(CONFIG_arm),y)
+               ARM_FLOAT_OPTION:= --with-float=hard
+       endif
+endif
 
 define Package/gcc
   SECTION:=devel
@@ -49,7 +54,7 @@ GMPSRC=gmp-4.3.2
 define Download/gmp
   URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
   FILE:=$(GMPSRC).tar.bz2
-  MD5SUM:=dd60683d7057917e34630b4a787932e8
+  HASH:=936162c0312886c21581002b79932829aa048cfaf9937c6265aeaa14f1cd1775
 endef
 $(eval $(call Download,gmp))
 
@@ -58,7 +63,7 @@ MPCSRC=mpc-0.8.1
 define Download/mpc
   URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
   FILE:=$(MPCSRC).tar.gz
-  MD5SUM:=5b34aa804d514cc295414a963aedb6bf
+  HASH:=e664603757251fd8a352848276497a4c79b7f8b21fd8aedd5cc0598a38fee3e4
 endef
 $(eval $(call Download,mpc))
 
@@ -67,7 +72,7 @@ MPFRSRC=mpfr-2.4.2
 define Download/mpfr
   URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
   FILE:=$(MPFRSRC).tar.bz2
-  MD5SUM:=89e59fe665e2b3ad44a6789f40b059a0
+  HASH:=c7e75a08a8d49d2082e4caee1591a05d11b9d5627514e678f02d66a124bcf2ba
 endef
 $(eval $(call Download,mpfr))
 
@@ -120,6 +125,7 @@ define Build/Configure
                        --prefix=/usr \
                        --libexecdir=/usr/lib \
                        --with-local-prefix=/usr \
+                       $(ARM_FLOAT_OPTION) \
                        $(SOFT_FLOAT_CONFIG_OPTION) \
                        $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
        );
index a10303eb2d76ec341220f840c3247d4e6fdb3386..efcee5c66e6cd96acaf420652c11c8716c349211 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/libtool
-PKG_MD5SUM:=1bfb9b923f2c1339b4d2ce1807064aa5
+PKG_HASH:=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
 PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
 PKG_LICENSE:=GPL-2.0+
 PKG_BUILD_DIR = $(BUILD_DIR)/libtool-bin/$(PKG_NAME)-$(PKG_VERSION)
index 292b7a43980141078795c4c286ee6c3b8c782695..daaf05ff4b59f28b12fdc82c677bfdb599bfe910 100644 (file)
@@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lpc21isp
 PKG_VERSION:=197
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 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_HASH:=9f7d80382e4b70bfa4200233466f29f73a36fea7dc604e32f05b9aa69ef591dc
 PKG_CAT:=zcat
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/devel/lpc21isp/patches/100-fix-reproducible-builds.patch b/devel/lpc21isp/patches/100-fix-reproducible-builds.patch
new file mode 100644 (file)
index 0000000..ad07995
--- /dev/null
@@ -0,0 +1,13 @@
+Index: lpc21isp_197/lpc21isp.c
+===================================================================
+--- lpc21isp_197.orig/lpc21isp.c       2017-12-03 06:01:05.854070061 +0100
++++ lpc21isp_197/lpc21isp.c    2017-12-03 06:01:23.326431659 +0100
+@@ -1549,7 +1549,7 @@
+         DebugPrintf(2, "\n"
+                        "Portable command line ISP\n"
+                        "for NXP LPC family and Analog Devices ADUC 70xx\n"
+-                       "Version " VERSION_STR " compiled for " COMPILED_FOR ": " __DATE__ ", " __TIME__ "\n"
++                       "Version " VERSION_STR " compiled for " COMPILED_FOR "\n"
+                        "Copyright (c) by Martin Maurer, 2003-2013, Email: Martin.Maurer@clibb.de\n"
+                        "Portions Copyright (c) by Aeolus Development 2004, www.aeolusdevelopment.com\n"
+                        "\n");
index 99510a003917cf794068aad5bdafdbea6152ec63..c1380865cf5dcc33047ebbc326e95e71bbbcb37a 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://lttng.org/files/$(PKG_NAME)/
-PKG_MD5SUM:=ccfb50ad922cdaf54a809e2d9de23da4
+PKG_HASH:=0112d0646437163a0065022e5a788d049b690ec3fa99494c4ab6f61ced2a46af
 
 PKG_LICENSE:=LGPL-2.1 GPL-2.0 MIT
 PKG_LICENSE_FILES:=LICENSE
index e52c529f6cedde6c4fd4ea26b683c3ed8ca93af3..dfce72c8491240ff6547e1b73601653ce04efc0d 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://lttng.org/files/$(PKG_NAME)/
-PKG_MD5SUM:=0478f60395f9564b4a19f45ce7b7f3df
+PKG_HASH:=128166445126d76da7d9f42a56dec12716732a1ed697a6cfdf40c9e135384f32
 
 PKG_LICENSE:=LGPL-2.1 GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index 19c8c17e4194373c5aa2880d31e988185b74bd02..1a42f4b171710840097973ed676d274f31596cff 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=m4
-PKG_VERSION:=1.4.17
-PKG_RELEASE:=2
+PKG_VERSION:=1.4.18
+PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=@GNU/m4
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=12a3c829301a4fd6586a57d3fcf196dc
+PKG_HASH:=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
 PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
 PKG_LICENSE:=GPL-3.0+
 
index 2a1ba49682a6328d9a837ff8df70ef9a994b52c4..a2692d42cf56431dddff524f0ef78ae6caf2aeeb 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=@GNU/make
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=15b012617e7c44c0ed482721629577ac
+PKG_HASH:=d6e262bf3601b42d2b1e4ef8310029e1dcf20083c5446b4b7aa67081fdffc589
 PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
 PKG_LICENSE:=GPL-3.0+
 
index d705a30a1ed608c186e062cab1e234f8e3e7fb2c..f08ae8a3c09897fc690e71c6a868a5e7b0f9e3c1 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=patch
-PKG_VERSION:=2.7.5
+PKG_VERSION:=2.7.6
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/patch
-PKG_MD5SUM:=e3da7940431633fb65a01b91d3b7a27a
+PKG_HASH:=ac610bda97abe0d9f6b7c963255a11dcb196c25e337c61f94e4778d632f1d8fd
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
 
index 7fa007622739f4fd9a1839be43030470103b5339..26ef737c2ebe1435f681edfae4159b0c4c9fc4ea 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://pkgconfig.freedesktop.org/releases/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=f739a28cae4e0ca291f82d1d41ef107d
+PKG_HASH:=beb43c9e064555469bd4390dcfd8030b1536e0aa103f08d7abf7ae8cac0cb001
 PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
 PKG_LICENSE:=GPL-2+
 
diff --git a/ipv6/aiccu/Makefile b/ipv6/aiccu/Makefile
deleted file mode 100644 (file)
index 4b81e10..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# Copyright (C) 2006-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:=aiccu
-PKG_VERSION:=20070115
-PKG_RELEASE:=16
-
-PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.sixxs.net/archive/sixxs/aiccu/unix
-PKG_MD5SUM:=c9bcc83644ed788e22a7c3f3d4021350
-PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILES:=doc/LICENSE
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/aiccu/Default
-  TITLE:=SixXS IPv6 Connectivity Client ($(1))
-  SECTION:=net
-  CATEGORY:=Network
-  VARIANT:=$(2)
-  DEPENDS:=+libpthread +ip +kmod-sit +kmod-tun $(3)
-  URL:=http://www.sixxs.net/tools/aiccu/
-  MAINTAINER:=Ondrej Caletka <ondrej@caletka.cz>
-endef
-
-Package/aiccu=$(call Package/aiccu/Default,without GNUTLS support,default)
-Package/aiccu-gnutls=$(call Package/aiccu/Default,with GNUTLS support,gnutls,+libgnutls)
-
-define Build/Configure
-       $(SED) "s,strip,/bin/true," $(PKG_BUILD_DIR)/unix-console/Makefile
-endef
-
-ifeq ($(BUILD_VARIANT),gnutls)
-CONFIG_AICCU_GNUTLS:=y
-endif
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               CC="$(TARGET_CC)" OS_NAME="Linux" OS_VERSION="$(LINUX_VERSION)" \
-               EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
-               EXTRA_LDFLAGS="$(TARGET_LDFLAGS) -pthread" \
-               $(if $(CONFIG_AICCU_GNUTLS),HAVE_GNUTLS=1) \
-               DEBUG=0
-endef
-
-define Package/aiccu/conffiles
-/etc/config/aiccu
-endef
-
-Package/aiccu-gnutls/conffiles=$(call Package/aiccu/conffiles)
-
-define Package/aiccu/install
-       $(INSTALL_DIR) $(1)/usr/sbin $(1)/lib/netifd/proto $(1)/etc/hotplug.d/ntp
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/unix-console/$(PKG_NAME) $(1)/usr/sbin/
-       $(INSTALL_BIN) ./files/aiccu.sh $(1)/lib/netifd/proto/aiccu.sh
-       $(INSTALL_DATA) ./files/aiccu.hotplug $(1)/etc/hotplug.d/ntp/10-aiccu
-endef
-
-Package/aiccu-gnutls/install=$(call Package/aiccu/install,$(1))
-
-$(eval $(call BuildPackage,aiccu))
-$(eval $(call BuildPackage,aiccu-gnutls))
diff --git a/ipv6/aiccu/files/aiccu.hotplug b/ipv6/aiccu/files/aiccu.hotplug
deleted file mode 100644 (file)
index b521371..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-NTPSTRATUMFILE="/var/run/aiccu_ntp_stratum"
-echo $stratum > "$NTPSTRATUMFILE"
diff --git a/ipv6/aiccu/files/aiccu.sh b/ipv6/aiccu/files/aiccu.sh
deleted file mode 100755 (executable)
index 584574b..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/bin/sh
-# aiccu.sh - AICCU proto
-# Copyright (c) 2014 OpenWrt.org
-
-[ -n "$INCLUDE_ONLY" ] || {
-       . /lib/functions.sh
-       . /lib/functions/network.sh
-       . ../netifd-proto.sh
-       init_proto "$@"
-}
-
-proto_aiccu_setup() {
-       local cfg="$1"
-       local iface="$2"
-       local link="aiccu-$cfg"
-
-       local username password protocol server ip6prefix tunnelid requiretls defaultroute nat heartbeat verbose sourcerouting ip6addr ntpsynctimeout
-       json_get_vars username password protocol server ip6prefix tunnelid requiretls defaultroute nat heartbeat verbose sourcerouting ip6addr ntpsynctimeout
-
-       [ -z "$username" -o -z "$password" ] && {
-               proto_notify_error "$cfg" "MISSING_USERNAME_OR_PASSWORD"
-               proto_block_restart "$cfg"
-               return
-       }
-
-       ( proto_add_host_dependency "$cfg" 0.0.0.0 )
-
-       CFGFILE="/var/etc/${link}.conf"
-       PIDFILE="/var/run/${link}.pid"
-       NTPSTRATUMFILE="/var/run/aiccu_ntp_stratum"
-       mkdir -p /var/run /var/etc
-
-       echo "username $username" > "$CFGFILE"
-       echo "password $password" >> "$CFGFILE"
-       echo "ipv6_interface $link" >> "$CFGFILE"
-       [ -n "$server" ] && echo "server $server" >> "$CFGFILE"
-       [ -n "$protocol" ] && echo "protocol $protocol" >> "$CFGFILE"
-       [ -n "$tunnelid" ] && echo "tunnel_id $tunnelid" >> "$CFGFILE"
-       [ "$requiretls" == 1 ] && echo "requiretls true" >> "$CFGFILE"
-       [ "$nat" == 1 ] && echo "behindnat true" >> "$CFGFILE"
-       [ "$heartbeat" == 1 ] && echo "makebeats true" >> "$CFGFILE"
-       [ "$verbose" == 1 ] && echo "verbose true" >> "$CFGFILE"
-       echo "defaultroute false" >> "$CFGFILE"
-       echo "daemonize true" >> "$CFGFILE"
-       echo "pidfile $PIDFILE" >> "$CFGFILE"
-
-       # By default, wait at most 90 seconds for NTP sync
-       [ -z "$ntpsynctimeout" ] && ntpsynctimeout=90
-       for i in $(seq 1 $ntpsynctimeout); do
-               [ -f "$NTPSTRATUMFILE" ] && \
-               [ "$(cat $NTPSTRATUMFILE)" -lt 16 ] && \
-               echo "NTP synced, stratum $(cat $NTPSTRATUMFILE)" && break
-               [ "$(( $i % 10 ))" -eq 0 ] && echo "Waiting ${i} secs for NTP sync..."
-               sleep 1
-       done
-
-       aiccu start "$CFGFILE"
-
-       [ "$?" -ne 0 ] && {
-               proto_notify_error "$cfg" "AICCU_FAILED_SEE_LOG"
-               proto_block_restart "$cfg"
-               return
-       }
-
-       proto_init_update "$link" 1
-
-       local source=""
-       [ "$sourcerouting" != "0" ] && source="::/128"
-       [ "$defaultroute" != "0" ] && proto_add_ipv6_route "::" 0 "" "" "" "$source"
-
-       [ -n "$ip6addr" ] && {
-               local local6="${ip6addr%%/*}"
-               local mask6="${ip6addr##*/}"
-               [[ "$local6" = "$mask6" ]] && mask6=
-               proto_add_ipv6_address "$local6" "$mask6"
-               [ "$defaultroute" != "0" -a "$sourcerouting" != "0" ] && proto_add_ipv6_route "::" 0 "" "" "" "$local6/$mask6"
-       }
-
-       [ -n "$ip6prefix" ] && {
-               proto_add_ipv6_prefix "$ip6prefix"
-               [ "$defaultroute" != "0" -a "$sourcerouting" != "0" ] && proto_add_ipv6_route "::" 0 "" "" "" "$ip6prefix"
-       }
-
-       proto_send_update "$cfg"
-
-}
-
-proto_aiccu_teardown() {
-       local cfg="$1"
-       local link="aiccu-$cfg"
-       CFGFILE="/var/etc/${link}.conf"
-       PIDFILE="/var/run/${link}.pid"
-       [ -f "$CFGFILE" -a -f "$PIDFILE" ] && {
-               local pid="$(cat "$PIDFILE")"
-               [ -d /proc/$pid -a $(cat /proc/$pid/comm) = "aiccu" ] && \
-               aiccu stop "$CFGFILE"
-       }
-}
-
-proto_aiccu_init_config() {
-       no_device=1
-       available=1
-       proto_config_add_string "username"
-       proto_config_add_string "password"
-       proto_config_add_string "protocol"
-       proto_config_add_string "server"
-       proto_config_add_string "ip6addr:ip6addr"
-       proto_config_add_string "ip6prefix:ip6addr"
-       proto_config_add_string "tunnelid"
-       proto_config_add_boolean "requiretls"
-       proto_config_add_boolean "defaultroute"
-       proto_config_add_boolean "sourcerouting"
-       proto_config_add_boolean "nat"
-       proto_config_add_boolean "heartbeat"
-       proto_config_add_boolean "verbose"
-       proto_config_add_int "ntpsynctimeout"
-}
-
-[ -n "$INCLUDE_ONLY" ] || {
-       add_protocol aiccu
-}
diff --git a/ipv6/aiccu/patches/100-cross_compile.patch b/ipv6/aiccu/patches/100-cross_compile.patch
deleted file mode 100644 (file)
index 6ef8ad5..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
---- a/unix-console/Makefile
-+++ b/unix-console/Makefile
-@@ -25,7 +25,8 @@ CWARNS += -W -Wall -Wshadow -Wpointer-ar
- # CWARNS += -Wpacked
- #CFLAGS       += $(CWARNS) -D_GNU_SOURCE -D_DEBUG -g3 -O0
--CFLAGS        += $(CWARNS) -D_GNU_SOURCE
-+CFLAGS        += $(CWARNS) $(EXTRA_CFLAGS) -D_GNU_SOURCE
-+LDFLAGS += $(EXTRA_LDFLAGS)
- CC      = @gcc
- RM      = rm
-@@ -40,25 +41,25 @@ CFLAGS     += -D AICCU_CONSOLE
- # GnuTLS Support ?
- # Used by TIC to secure that communication
- # Currently defaultly builds only on Linux, but other platforms might easily also support it
--ifeq ($(shell uname | grep -c "Linux"),1)
-+ifneq ($(HAVE_GNUTLS),)
- CFLAGS        += -D AICCU_GNUTLS
- LDFLAGS += -lgnutls
- endif
- # Linux
--ifeq ($(shell uname | grep -c "Linux"),1)
-+ifeq ($(OS_NAME),Linux)
- CFLAGS  += -D_LINUX -D HAS_IFHEAD -D AICCU_TYPE="\"linux\""
- SRCS  += ../common/aiccu_linux.c
- OBJS  += ../common/aiccu_linux.o
--LDFLAGS       += -lpthread -lresolv
-+LDFLAGS       += -pthread -lresolv
- endif
- # FreeBSD
--ifeq ($(shell uname | grep -c "FreeBSD"),1)
-+ifeq ($(OS_NAME),FreeBSD)
- CFLAGS        += -D_FREEBSD
- # FreeBSD 4.x
--ifeq ($(shell uname -r | cut -c 1),4)
-+ifeq ($(shell echo $(OS_VERSION) | cut -c 1),4)
- CFLAGS        += -D AICCU_TYPE="\"freebsd4\""
- SRCS  += ../common/aiccu_freebsd4.c
- OBJS  += ../common/aiccu_freebsd4.o
-@@ -71,7 +72,7 @@ endif
- endif
- # DragonFlyBSD
--ifeq ($(shell uname | grep -c "DragonFly"),1)
-+ifeq ($(OS_NAME),DragonFly)
- CFLAGS        += -D_DFBSD -D NEED_IFHEAD -D AICCU_TYPE="\"dragonfly\""
- SRCS  += ../common/aiccu_freebsd4.c
- OBJS  += ../common/aiccu_freebsd4.o
-@@ -79,7 +80,7 @@ CFLAGS       += -pthread
- endif
- # NetBSD
--ifeq ($(shell uname | grep -c "NetBSD"),1)
-+ifeq ($(OS_NAME),NetBSD)
- CFLAGS        += -D_NETBSD -D AICCU_TYPE="\"kame\""
- # Check if net/if_tun.h has TUNSIFHEAD and enable support for it
-@@ -97,10 +98,10 @@ CFLAGS     += -pthread -D_NETBSD_SOURCE
- endif
- # OpenBSD
--ifeq ($(shell uname | grep -c "OpenBSD"),1)
-+ifeq ($(OS_NAME),OpenBSD)
- CFLAGS        += -D_OPENBSD -D HAS_IFHEAD
- # 2.7-2.9
--ifeq ($(shell uname -r | cut -c 1),2)
-+ifeq ($(shell echo $(OS_VERSION) | cut -c 1),2)
- CFLAGS        += -D AICCU_TYPE="\"openbsd2\""
- SRCS  += ../common/aiccu_openbsd2.c
- OBJS  += ../common/aiccu_openbsd2.o
-@@ -114,7 +115,7 @@ CFLAGS     += -pthread
- endif
- # Darwin
--ifeq ($(shell uname | grep -c "Darwin"),1)
-+ifeq ($(OS_NAME),Darwin)
- CFLAGS        += -D_DARWIN -D NEED_IFHEAD -D AICCU_TYPE="\"darwin\""
- SRCS  += ../common/aiccu_darwin.c
- OBJS  += ../common/aiccu_darwin.o
-@@ -122,7 +123,7 @@ LDFLAGS    += -lresolv
- endif
- # SunOS / Solaris
--ifeq ($(shell uname | grep -c "SunOS"),1)
-+ifeq ($(OS_NAME),SunOS)
- CFLAGS        += -D_SUNOS -D AICCU_TYPE="\"sunos\""
- SRCS  += ../common/aiccu_sunos.c
- OBJS  += ../common/aiccu_sunos.o
-@@ -130,7 +131,7 @@ LDFLAGS    += -lsocket -lnsl -lresolv
- endif
- # AIX
--ifeq ($(shell uname | grep -c "AIX"),1)
-+ifeq ($(OS_NAME),AIX)
- CC    = @/usr/vac/bin/xlc_r
- CFLAGS        = -qthreaded -q64 -qlanglvl=stdc99 -bmaxdata:0xD0000000 -D_64BIT -g -qdbxextra -qfullpath -qheapdebug -qformat=all -qcheck=all
- CFLAGS        += -D AICCU_CONSOLE
diff --git a/ipv6/aiccu/patches/200-add_dn_skipname.patch b/ipv6/aiccu/patches/200-add_dn_skipname.patch
deleted file mode 100644 (file)
index 3ce1e92..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
---- /dev/null
-+++ b/common/dn_skipname.c
-@@ -0,0 +1,51 @@
-+#include <errno.h>
-+#include <resolv.h>
-+
-+/* Ripped from glibc 2.4 sources. */
-+
-+/*
-+ * ns_name_skip(ptrptr, eom)
-+ *      Advance *ptrptr to skip over the compressed name it points at.
-+ * return:
-+ *      0 on success, -1 (with errno set) on failure.
-+ */
-+int ns_name_skip(const u_char **ptrptr, const u_char *eom)
-+{
-+      const u_char *cp;
-+      u_int n;
-+
-+      cp = *ptrptr;
-+      while (cp < eom && (n = *cp++) != 0)
-+      {
-+              /* Check for indirection. */
-+              switch (n & NS_CMPRSFLGS) {
-+              case 0:                 /* normal case, n == len */
-+                      cp += n;
-+                      continue;
-+              case NS_CMPRSFLGS:      /* indirection */
-+                      cp++;
-+                      break;
-+              default:                /* illegal type */
-+                      errno = EMSGSIZE;
-+                      return (-1);
-+              }
-+              break;
-+      }
-+      if (cp > eom)
-+      {
-+              errno = EMSGSIZE;
-+              return (-1);
-+      }
-+      *ptrptr = cp;
-+      return (0);
-+}
-+
-+int dn_skipname(const u_char *ptr, const u_char *eom)
-+{
-+      const u_char *saveptr = ptr;
-+
-+      if(ns_name_skip(&ptr, eom) == -1)
-+              return (-1);
-+      return (ptr - saveptr);
-+}
-+
---- a/unix-console/Makefile
-+++ b/unix-console/Makefile
-@@ -10,9 +10,9 @@
- #  $Date: 2007-01-15 11:04:27 $
- # **********************************************************/
--SRCS  = main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c
-+SRCS  = main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c ../common/dn_skipname.c
- INCS  = ../common/tun.h ../common/aiccu.h ../common/hash_md5.h ../common/hash_sha1.h ../common/common.h ../common/heartbeat.h ../common/tic.h ../common/ayiya.h ../common/resolver.h
--OBJS  = main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o
-+OBJS  = main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o ../common/dn_skipname.o
- # New features not fully implemented and thus disabled for now
- #CFLAGS       += -D NEWSTUFF_TSP -D NEWSTUFF_TEEPEE
diff --git a/ipv6/aiccu/patches/300-resolver-uclibc.patch b/ipv6/aiccu/patches/300-resolver-uclibc.patch
deleted file mode 100644 (file)
index b88ef5c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/common/resolver.c
-+++ b/common/resolver.c
-@@ -26,7 +26,7 @@
- int getrrs(const char *label, int rrtype, void gotrec(unsigned int num, int type, const char *record))
- {
--#ifdef _LINUX
-+#if defined(_LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__)
-       struct __res_state      res;
- #endif
-       unsigned char           answer[8192];
-@@ -38,7 +38,7 @@ int getrrs(const char *label, int rrtype
-       uint16_t                type = 0, class = 0;
-       uint32_t                ttl = 0;
--#ifdef _LINUX
-+#if defined(_LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__)
-       memset(&res, 0, sizeof(res));
-       res.options = RES_DEBUG;
-       res_ninit(&res);
-@@ -47,7 +47,7 @@ int getrrs(const char *label, int rrtype
- #endif
-       memset(answer, 0, sizeof(answer));
--#ifdef _LINUX
-+#if defined(_LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__)
-       ret = res_nquery(&res, label, C_IN, rrtype, answer, sizeof(answer));
- #else
-       ret = res_query(label, C_IN, rrtype, answer, sizeof(answer));
diff --git a/ipv6/aiccu/patches/400-musl-compat.patch b/ipv6/aiccu/patches/400-musl-compat.patch
deleted file mode 100644 (file)
index b6e0c32..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
---- a/common/common.h
-+++ b/common/common.h
-@@ -50,6 +50,7 @@
- #include <signal.h>
- #include <sys/types.h>
- #include <sys/stat.h>
-+#include <sys/uio.h>
- #include <fcntl.h>
- #if defined(_SUNOS) || defined(_AIX) || defined(_DARWIN)
-@@ -91,7 +92,9 @@
-       #include <sys/select.h>
-       #include <net/if.h>
-+#if defined(__GLIBC__) || defined(__UCLIBC__)
-       #include <netinet/if_ether.h>
-+#endif
- #ifdef linux
-       #include <netpacket/packet.h>
-       #include <linux/if_tun.h>
---- a/common/dn_skipname.c
-+++ b/common/dn_skipname.c
-@@ -1,6 +1,8 @@
- #include <errno.h>
- #include <resolv.h>
-+#include <sys/types.h>
-+
- /* Ripped from glibc 2.4 sources. */
- /*
diff --git a/ipv6/aiccu/patches/500-gnutls_3.4.patch b/ipv6/aiccu/patches/500-gnutls_3.4.patch
deleted file mode 100644 (file)
index a314784..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---- aiccu/common/common.c
-+++ aiccu/common/common.c
-@@ -271,8 +271,6 @@
- TLSSOCKET sock_alloc(void)
- {
- #ifdef AICCU_GNUTLS
--      /* Allow connections to servers that have OpenPGP keys as well */
--      const int       cert_type_priority[3] = { GNUTLS_CRT_X509, GNUTLS_CRT_OPENPGP, 0 };
-       int             ret;
- #endif /* AICCU_GNUTLS*/
-@@ -300,7 +298,8 @@
-       gnutls_set_default_priority(sock->session);
-       /* XXX: Return value is not documented in GNUTLS documentation! */
--      gnutls_certificate_type_set_priority(sock->session, cert_type_priority);
-+      /* Allow connections to servers that have OpenPGP keys as well */
-+      gnutls_priority_set_direct(sock->session, "NORMAL:+CTYPE-OPENPGP", NULL);
-       /* XXX: Return value is not documented in GNUTLS documentation! */
-       /* Configure the x509 credentials for the current session */
-
index d68a271d279e7a5b01cf86c6d3d5f4052795562f..a3decdfe05a3afc3fcd58c1315ffd9d06e96825f 100644 (file)
@@ -8,7 +8,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=tayga-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.litech.org/tayga/
-PKG_MD5SUM:=7a7b24165ce008df772f398d86fa280e
+PKG_HASH:=2b1f7927a9d2dcff9095aff3c271924b052ccfd2faca9588b277431a44f0009c
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
index 7385df9b0e929d2f28d8d06d8300b8af70f67a5c..bcf60926f38129c76a4358f4a0a9a9ca8d4e8181 100644 (file)
@@ -13,12 +13,13 @@ PKG_VERSION:=git-20160214
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=c44db17c3e05079116a1704f277642c9ce6f5ca4fa380c60f7e6d44509dc16be
 PKG_SOURCE_URL:=https://github.com/jclehner/mtd-rw.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=7e8562067d6a366c8cbaa8084396c33b7e12986b
 
-PKG_MAINTAINER=Joseph C. Lehner <joseph.c.lehner@gmail.com>
+PKG_MAINTAINER:=Joseph C. Lehner <joseph.c.lehner@gmail.com>
 PKG_LICENSE=GPL-2.0
 PKG_LICENSE_FILES=LICENSE
 
diff --git a/lang/chardet/Makefile b/lang/chardet/Makefile
deleted file mode 100644 (file)
index 6343b4e..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=chardet
-PKG_VERSION:=2.3.0
-PKG_RELEASE:=1
-PKG_LICENSE:=LGPL-2.1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pypi.python.org/packages/source/c/chardet/
-PKG_MD5SUM:=25274d664ccb5130adae08047416e1a8
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/chardet
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=Universal encoding detector for Python 2 and 3
-  URL:=https://github.com/chardet/chardet
-  DEPENDS:=+python
-endef
-
-define Package/chardet/description
-  Universal encoding detector for Python 2 and 3
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/chardet/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chardetect \
-           $(1)/usr/bin
-       # fix python exec path in scripts
-       sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/bin/chardetect
-endef
-
-$(eval $(call BuildPackage,chardet))
diff --git a/lang/django-appconf/Makefile b/lang/django-appconf/Makefile
deleted file mode 100644 (file)
index c06fa6a..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=django-appconf
-PKG_VERSION:=1.0.2
-PKG_RELEASE:=1
-PKG_LICENSE:=BSD-3-Clause
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/34/b9/d07195652ab494b026f7cb0341dd6e5f2e6e39be177abe05e2cec8bd46e4/
-PKG_MD5SUM:=cc11511a47088bc56531df67cd5d6261
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/django-appconf
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=A helper class for handling configuration defaults of packaged apps gracefully.
-  URL:=http://django-appconf.readthedocs.org/
-  DEPENDS:=+python +django
-endef
-
-define Package/django-appconf/description
-  A helper class for handling configuration defaults of packaged apps gracefully.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/django-appconf/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,django-appconf))
diff --git a/lang/django-compressor/Makefile b/lang/django-compressor/Makefile
deleted file mode 100644 (file)
index 414e342..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=django-compressor
-PKG_VERSION:=2.1
-PKG_RELEASE:=1
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=django_compressor-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/23/46/2c7d582255969ad5259937f5f9e14aec1f3349d0fc0651129330918d1c6d/
-PKG_BUILD_DIR:=$(BUILD_DIR)/django_compressor-$(PKG_VERSION)/
-PKG_MD5SUM:=21ecfe4e8615eae64f7068a5599df9af
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/django-compressor
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=Compresses linked and inline JavaScript or CSS into single cached files.
-  URL:=http://django-compressor.readthedocs.org/
-  DEPENDS:=+python +django
-endef
-
-define Package/django-compressor/description
-  Compresses linked and inline JavaScript or CSS into single cached files.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/django-compressor/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,django-compressor))
diff --git a/lang/django-constance/Makefile b/lang/django-constance/Makefile
deleted file mode 100644 (file)
index 11dd2e2..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=django-constance
-PKG_VERSION:=1.2
-PKG_RELEASE:=1
-PKG_LICENSE:=BSD-3-Clause
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/0a/ff/1c1caae2b7be9c26f2aee0703236998e22cf5557fa56726347b5afa149d1/
-PKG_MD5SUM:=f9f8e527df50b0a1533149d9be0b814b
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/django-constance
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=Django live settings with pluggable backends, including Redis.
-  URL:=https://github.com/jazzband/django-constance
-  DEPENDS:=+python +django
-endef
-
-define Package/django-constance/description
-  Django live settings with pluggable backends, including Redis.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/django-constance/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,django-constance))
diff --git a/lang/django-jsonfield/Makefile b/lang/django-jsonfield/Makefile
deleted file mode 100644 (file)
index 40a9ff7..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=django-jsonfield
-PKG_VERSION:=1.0.1
-PKG_RELEASE:=1
-PKG_LICENSE:=BSD-3-Clause
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/e4/b2/a079f0a2218e0eb7892edbf404e0bbfbb281a6bbf06966b775f5142ed159/
-PKG_MD5SUM:=2e5e737a3f93f3b5d7ae6026b1340167
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/django-jsonfield
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=JSONField for django models
-  URL:=https://github.com/bradjasper/django-jsonfield
-  DEPENDS:=+python +django
-endef
-
-define Package/django-jsonfield/description
-  JSONField for django models
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/django-jsonfield/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,django-jsonfield))
diff --git a/lang/django-picklefield/Makefile b/lang/django-picklefield/Makefile
deleted file mode 100644 (file)
index 0747796..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=django-picklefield
-PKG_VERSION:=0.3.2
-PKG_RELEASE:=1
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pypi.python.org/packages/source/d/django-picklefield/
-PKG_MD5SUM:=b2c17ca9e03704ce33890e6aefc7b2e5
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/django-picklefield
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=Pickled object field for Django
-  URL:=http://github.com/gintas/django-picklefield/
-  DEPENDS:=+python +django
-endef
-
-define Package/django-picklefield/description
-  Pickled object field for Django
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/django-picklefield/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,django-picklefield))
diff --git a/lang/django-postoffice/Makefile b/lang/django-postoffice/Makefile
deleted file mode 100644 (file)
index 18dce36..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=django-postoffice
-PKG_VERSION:=2.0.8
-PKG_RELEASE:=1
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=django-post_office-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/52/25/cc0cfe923f183d7c19b162cac3bf8430ddaed7bad28202b8f93a97d248a4/
-PKG_BUILD_DIR:=$(BUILD_DIR)/django-post_office-$(PKG_VERSION)/
-PKG_MD5SUM:=437bf62cef06381d346ae2bc087c0e3c
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/django-postoffice
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=A Django app to monitor and send mail asynchronously, complete with template support.
-  URL:=https://github.com/ui/django-postoffice
-  DEPENDS:=+python +django +django-jsonfield
-endef
-
-define Package/django-postoffice/description
-  A Django app to monitor and send mail asynchronously, complete with template support.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/django-postoffice/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,django-postoffice))
diff --git a/lang/django-restframework/Makefile b/lang/django-restframework/Makefile
deleted file mode 100644 (file)
index 5ae6956..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=django-restframework
-PKG_VERSION:=3.3.3
-PKG_RELEASE:=1
-PKG_LICENSE:=BSD-3-Clause
-
-PKG_SOURCE:=djangorestframework-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pypi.python.org/packages/source/d/djangorestframework/
-PKG_BUILD_DIR:=$(BUILD_DIR)/djangorestframework-$(PKG_VERSION)
-PKG_MD5SUM:=6f5ee9646e7fa87dad4385d3c7e7678d
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/django-restframework
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=Web APIs for Django, made easy.
-  URL:=http://www.django-rest-framework.org/
-  DEPENDS:=+python +django
-endef
-
-define Package/django-restframework/description
-  Web APIs for Django, made easy.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/django-restframework/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,django-restframework))
diff --git a/lang/django-statici18n/Makefile b/lang/django-statici18n/Makefile
deleted file mode 100644 (file)
index 5d94774..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=django-statici18n
-PKG_VERSION:=1.2.1
-PKG_RELEASE:=1
-PKG_LICENSE:=BSD-3-Clause
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/72/76/6ee13019e1691bff6b759136068ee77fcc2982b700135caa134030937b28/
-PKG_MD5SUM:=67cac19909dd3272ae1fc73ad8d1dca3
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/django-statici18n
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=A Django app that provides helper for generating JavaScript catalog to static files.
-  URL:=http://django-statici18n.readthedocs.org/
-  DEPENDS:=+python +django
-endef
-
-define Package/django-statici18n/description
-  A Django app that provides helper for generating JavaScript catalog to static files.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/django-statici18n/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,django-statici18n))
diff --git a/lang/django/Makefile b/lang/django/Makefile
deleted file mode 100644 (file)
index c932cc1..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=django
-PKG_VERSION:=1.8.12
-PKG_RELEASE=1
-PKG_LICENSE:=BSD-3-Clause
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/django/django.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=c168aeba175dbb92c615460a360cb1ea978de5d3
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/django
-    SUBMENU:=Python
-    SECTION:=lang
-    CATEGORY:=Languages
-    TITLE:=The web framework for perfectionists with deadlines.
-    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-    URL:=https://www.djangoproject.com/
-    DEPENDS:=+python
-endef
-
-define Package/django/description
-    The web framework for perfectionists with deadlines.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/django-admin.py \
-           $(1)/usr/bin
-endef
-
-define Package/django/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/django-admin.py \
-           $(1)/usr/bin
-       # fix python exec path
-       sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/bin/django-admin.py
-endef
-
-$(eval $(call BuildPackage,django))
index efb0012d07f473530658042d498e012a3af96dc7..0901bc06f4db2851b68d2efe90f1ae7010c3c9c6 100644 (file)
@@ -16,6 +16,7 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=e72ba0c9f5d8b8746fc306f6189a819dbb5cd0be
 PKG_LICENSE:=MIT
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_MIRROR_HASH:=e80673611e25ce63a95ea0f7a9c407868903fd78536d6c80f1763f2cf9488030
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 
index 3a86aa5120bf97414bc476139dd5efaee7c24e93..ed569aa7b634b00cc44708f4691e03bf0ca9eaef 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=3
 PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= http://www.erlang.org/download/ \
        http://erlang.mirror.su.se/
-PKG_MD5SUM:=346dd0136bf1cc28cebc140e505206bb
+PKG_HASH:=3c28820c981b30c50df8ac2a4a238e5813454fa3ed2ad530bc7948a282846474
 
 PKG_LICENSE:=ErlPL-1.1
 PKG_LICENSE_FILES:=EPLICENCE
diff --git a/lang/et_xmlfile/Makefile b/lang/et_xmlfile/Makefile
deleted file mode 100644 (file)
index f0c0139..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=et_xmlfile
-PKG_VERSION:=1.0.1
-PKG_RELEASE:=1
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pypi.python.org/packages/source/e/et_xmlfile/
-PKG_MD5SUM:=f47940fd9d556375420b2e276476cfaf
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/et_xmlfile
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=An implementation of lxml.xmlfile for the standard library
-  URL:=https://bitbucket.org/openpyxl/et_xmlfile
-  DEPENDS:=+python
-endef
-
-define Package/et_xmlfile/description
-  An implementation of lxml.xmlfile for the standard library
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/et_xmlfile/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,et_xmlfile))
diff --git a/lang/flup/Makefile b/lang/flup/Makefile
deleted file mode 100644 (file)
index b0514f4..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=flup
-PKG_VERSION:=1.0.2
-PKG_RELEASE:=1
-PKG_LICENSE:=BSD-3-Clause
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pypi.python.org/packages/source/f/flup/
-PKG_MD5SUM:=24dad7edc5ada31dddd49456ee8d5254
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/flup
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=Random assortment of WSGI servers
-  URL:=http://www.saddi.com/software/flup/
-  DEPENDS:=+python
-endef
-
-define Package/flup/description
-  Random assortment of WSGI servers
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/flup/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,flup))
diff --git a/lang/gunicorn/Makefile b/lang/gunicorn/Makefile
deleted file mode 100644 (file)
index efdf9f4..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gunicorn
-PKG_VERSION:=19.6.0
-PKG_RELEASE=1
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/84/ce/7ea5396efad1cef682bbc4068e72a0276341d9d9d0f501da609fab9fcb80/
-PKG_MD5SUM:=338e5e8a83ea0f0625f768dba4597530
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/gunicorn
-    SUBMENU:=Python
-    SECTION:=lang
-    CATEGORY:=Languages
-    TITLE:=WSGI HTTP Server for UNIX
-    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-    URL:=http://gunicorn.org/
-    DEPENDS:=+python +python-setuptools
-endef
-
-define Package/gunicorn/description
-    WSGI HTTP Server for UNIX
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/gunicorn/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gunicorn* \
-           $(1)/usr/bin
-       # fix python exec path in scripts
-       $(SED) 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/bin/gunicorn*
-endef
-
-$(eval $(call BuildPackage,gunicorn))
index 996dfa0ef5ce943f83ae2bfee4c751cd5d7d0ce9..58a7e69fe9570bad0238247b59fd57b5b9bd40f7 100644 (file)
@@ -15,7 +15,7 @@ PKG_MAINTAINER:=Dana H. Myers <k6jq@comcast.net>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=a6e3321ef4b3cfb4afc20bd75452e11e
+PKG_HASH:=76428e96df0ae9dd964c7a7c74c1e9a837e2f312c39e9a357fa8178f7eff80da
 
 PKG_USE_MIPS16:=0
 
diff --git a/lang/jdcal/Makefile b/lang/jdcal/Makefile
deleted file mode 100644 (file)
index 34d3970..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=jdcal
-PKG_VERSION:=1.2
-PKG_RELEASE:=1
-PKG_LICENSE:=BSD-3-Clause
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pypi.python.org/packages/source/j/jdcal/
-PKG_MD5SUM:=ab8d5ba300fd1eb01514f363d19b1eb9
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/jdcal
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=Julian dates from proleptic Gregorian and Julian calendars.
-  URL:=http://github.com/phn/jdcal
-  DEPENDS:=+python
-endef
-
-define Package/jdcal/description
-  Julian dates from proleptic Gregorian and Julian calendars.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/jdcal/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,jdcal))
index 0e0c9c540b39aded82b70991b557902784cf8277..2e84fce5e92054afa0976e35e617dd05c68275f8 100644 (file)
@@ -12,6 +12,7 @@ PKG_VERSION:=0.9.53
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=61a9631784aa5d7dd8adfdfa149f0a45deaa4bf80b117e89722702c612afa081
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/amrhassan/json4lua.git
diff --git a/lang/ldbus/Makefile b/lang/ldbus/Makefile
new file mode 100644 (file)
index 0000000..4c2d2d8
--- /dev/null
@@ -0,0 +1,63 @@
+#
+# Copyright (C) 2006-2017 OpenWrt.org
+#
+# This is free software, licensed under the GPL 2 license.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ldbus
+PKG_RELEASE:=1
+PKG_MIRROR_HASH:=0e39a80e126a77a937226e49ae0246e1fd4600a03dee6bdee5ac822963a234e1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=f4a1464e915a2313c80fb40c5c40b0bee7583677
+PKG_SOURCE_DATE:=2017-10-03
+PKG_SOURCE_URL=https://github.com/daurnimator/ldbus
+PKG_MAINTAINER:=Enrico Mioso <mrkiko.rs@gmail.com>
+PKG_LICENSE:=MIT
+
+PKG_FLAGS := nonshared
+
+PKG_BUILD_DEPENDS:=luarocks/host
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ldbus
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=ldbus Lua DBus bindings
+  DEPENDS:=+dbus +lua
+endef
+
+define Package/ldbus/description
+  This package contains "ldbus": LUA bindings to interact with the DBUS
+  message bus system, and services connected to it.
+  See https://github.com/daurnimator/ldbus
+  for details.
+endef
+
+TARGET_CFLAGS += \
+       -I$(STAGING_DIR)/usr/include
+
+MAKE_FLAGS += \
+       FPIC="$(FPIC)" \
+       CFLAGS="$(TARGET_CFLAGS)" \
+       LDFLAGS="$(TARGET_LDFLAGS)"
+
+define Package/ldbus/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ldbus.so $(1)/usr/lib/lua
+endef
+
+define Build/Compile
+  cd $(PKG_BUILD_DIR) && \
+  luarocks make --pack-binary-rock ldbus-scm-0.rockspec \
+    DBUS_INCDIR=$(STAGING_DIR)/usr/include/dbus-1.0/ \
+    DBUS_ARCH_INCDIR=$(STAGING_DIR)/usr/lib/dbus-1.0/include \
+    DBUS_LIBDIR=$(STAGING_DIR)/usr/lib \
+    CC="$(TARGET_CC)" LD="$(TARGET_CC)"
+endef
+
+$(eval $(call BuildPackage,ldbus))
index ee8a4ef1fedd0ff77962ff3a802305b57a2d276c..03f8c7656ad73cbe8fd6fa5beb94007b06a5551f 100644 (file)
@@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lpeg
 PKG_VERSION:=0.12.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.inf.puc-rio.br/~roberto/lpeg/
-PKG_MD5SUM:=fabb614eb46e370d4f6b8fd82d17ca7e
+PKG_HASH:=6aad270b91d1b1c6fd75f68e162329a04a644e50e917d55f46cc8384b7120004
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
@@ -38,7 +38,8 @@ define Build/Configure
 endef
 
 # add make variable overrides here
-MAKE_FLAGS +=
+MAKE_FLAGS += \
+       COPT="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -O2"
 
 define Package/lpeg/install
        $(INSTALL_DIR) $(1)/usr/lib/lua
index 7cdb350f41cdcd226426f61389d8ac32415b78a6..aea91a535ea9fff4779b5b7516e3f5c6d9f6b2ff 100644 (file)
@@ -16,7 +16,7 @@ PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.kyne.com.au/~mark/software/download/
-PKG_MD5SUM:=24f270663e9f6ca8ba2a02cef19f7963
+PKG_HASH:=51bc69cd55931e0cba2ceae39e9efa2483f4292da3a88a1ed470eda829f6c778
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 HOST_BUILD_DEPENDS:=lua/host
index 4f073e21f61fdbe3baffd3cb25ed6f61c355e255..314850ec01d54c2c1b44d1cfbafe4c40b9d77f40 100644 (file)
@@ -14,6 +14,7 @@ PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=a47a8b5f6c1cf0d9fff4770a28bf7a3efdd8f37415dde8e02528f3e63f8a7899
 PKG_SOURCE_URL:=https://github.com/keplerproject/copas.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=f39a80add9f7c010ac979297652bbaaea0360a27
index 6ca3ff8487185c040569f9314539b60a2cea77ca..95d92acaa8c05195945acc12151de3ad5d47fc82 100644 (file)
@@ -14,6 +14,7 @@ PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=2a99faec759aeb858eca3691a40609dd2710255497011e5754c4a2282232154b
 PKG_SOURCE_URL:=https://github.com/keplerproject/coxpcall.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=979257892884816c97391dfd7b0a7b30dcc8f479
index 473e215bea52889b71571e5c917a7002db25dc96..02f4069e25aaf2c69735f75e78c272d8de30dd8f 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=http://lua.sqlite.org/index.cgi/zip/lsqlite3_fsl09w.zip
-PKG_MD5SUM:=8e16ef4fda82eb73295bf2f1050d14f1
+PKG_HASH:=b857df8b66d01a803378cc86e56b787958beffdc8b851ad304f4ce8c7f0e9dbb
 
 PKG_LICENSE:=MIT
 PKG_MAINTAINER:=Oskari Rauta <oskari.rauta@gmail.com>
index e4094f5b32b0484b4de8831971033249637cbfc3..bf84a51107b76486fc69b7df3dc7653d0707a46b 100644 (file)
@@ -14,6 +14,7 @@ PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=b6ef5e3f04b7f2137b39931a175ee802489a2486e70537770919bcccca10e723
 PKG_SOURCE_URL:=https://github.com/LuaDist/lzlib.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=79329a07d8f79c19eadd7ea2752b4c4e1574b015
index 36e0d9db9ca57cf04b2ff68f786aa1b0dc53e39d..4e4cae0540b0ba1bbcc3df9d560f62e77eb7e373 100644 (file)
@@ -14,6 +14,7 @@ PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=89a186d9e8bb43a6d45207eeba2883600854ea05befda55b38f7ac215b0d5615
 PKG_SOURCE_URL:=https://github.com/keplerproject/md5.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=024b65738b4434860777fc43d7cacaefea29ec60
index 3d11539d9d6c66e8c7d5a9423a343380e6ba489a..59b6c0e20a956c5192b882bbd208a22ac1a4d05a 100644 (file)
@@ -14,6 +14,7 @@ PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=947876d6b8e234a21d1e918523d66546282011718f2260d5e1f10ebf60c851cb
 PKG_SOURCE_URL:=https://github.com/pkulchenko/MobDebug.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=9a03aa59696647ba3b7f9ae2f29a9f28532a4feb
diff --git a/lang/lua-mosquitto/Makefile b/lang/lua-mosquitto/Makefile
new file mode 100644 (file)
index 0000000..4fbb9dc
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2013-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-mosquitto
+PKG_VERSION:=0.3
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=104a143131812a507e74f9debde45614d006b6ea6c3b0265b83060b14b9d3a34
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/flukso/lua-mosquitto.git
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-mosquitto
+    SUBMENU:=Lua
+    SECTION:=lang
+    CATEGORY:=Languages
+    TITLE:=Lua-mosquitto
+    DEPENDS:=+libmosquitto +lua
+    MAINTAINER:=Karl Palsson <karlp@etactica.com>
+endef
+
+define Package/lua-mosquitto/description
+       Lua bindings to libmosquitto
+endef
+
+define Package/lua-mosquitto/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/mosquitto.so $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-mosquitto))
index 6f46e7a0884cf77e6132f1e1929012b0abbc7088..fc0629cf3f0719f967e84c79f6ffb85b03048f51 100644 (file)
@@ -14,6 +14,7 @@ PKG_MAINTAINER:=Amnon Paz <pazamnon@gmail.com>
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=33de8fa469f66bbf6df09c4ba4e3386c0613cc061f5adff0928d532af6905773
 PKG_SOURCE_URL:=https://github.com/zhaozg/lua-openssl.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=1b950e6ff8617205cda1a1b612637ef21b9daf96
@@ -21,7 +22,7 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/$(PKG_NAME)
+define Package/lua-openssl
   SUBMENU:=Lua
   SECTION:=lang
   CATEGORY:=Languages
@@ -34,9 +35,9 @@ define Package/lua-openssl/description
     A free, MIT-licensed OpenSSL binding for Lua.
 endef
 
-define Package/$(PKG_NAME)/install
+define Package/lua-openssl/install
        $(INSTALL_DIR) $(1)/usr/lib/lua
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/openssl.so $(1)/usr/lib/lua/
 endef
 
-$(eval $(call BuildPackage,$(PKG_NAME)))
+$(eval $(call BuildPackage,lua-openssl))
index 5c1b72a2a049da77efe5b8c366e41f147a7b6273..f7196946edfe024b767fbd24d8301a71c8e7223a 100644 (file)
@@ -8,28 +8,31 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lua-penlight
-PKG_VERSION:=1.3.2
-PKG_RELEASE:=2
-PKG_BUILD_DIR:=$(BUILD_DIR)/Penlight-$(PKG_VERSION)
-PKG_SOURCE:=$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/stevedonovan/Penlight/archive/
-PKG_MD5SUM:=0315a39834bb6fab07741ec04ede1bf4
+PKG_VERSION:=1.5.4
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/stevedonovan/Penlight
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=cd9f25981b12022b66180a3b8df46840be1b3e2a857b8d9909b2d5601be0ead4
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE.md
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/$(PKG_NAME)
+define Package/lua-penlight
   SUBMENU:=Lua
   SECTION:=lang
   CATEGORY:=Languages
   TITLE:=Penlight
   URL:=http://stevedonovan.github.io/Penlight/api/manual/01-introduction.md.html
   DEPENDS:=+luafilesystem
-  MAINTAINER:= Karl Palsson <karlp@remake.is>
+  MAINTAINER:=Karl Palsson <karlp@etactica.com>
 endef
 
-define Package/$(PKG_NAME)/description
+define Package/lua-penlight/description
   It is often said of Lua that it does not include batteries.
   Penlight is the batteries.
 endef
@@ -38,9 +41,9 @@ define Build/Compile
        echo "Nothing to compile, pure lua package"
 endef
 
-define Package/$(PKG_NAME)/install
+define Package/lua-penlight/install
        $(INSTALL_DIR) $(1)/usr/lib/lua
        $(CP) $(PKG_BUILD_DIR)/lua/pl $(1)/usr/lib/lua
 endef
 
-$(eval $(call BuildPackage,$(PKG_NAME)))
+$(eval $(call BuildPackage,lua-penlight))
index 7b2e270f78761fbc5bd3bd68437472b20d7ea353..53fe67b2ac6c820da0d68bca99e88937ab960305 100644 (file)
@@ -14,6 +14,7 @@ PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=7026ce5898d37a4175b7afad693d59ff1fff1a84adafcabfafd065956a03616c
 PKG_SOURCE_URL:=https://github.com/keplerproject/rings.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=2b8a900f8b9dbde304859a3ac9d437795c3fdde3
index 7ef5ac7e3802445916d5da8e5f02ce0b0a9e1203..492d8cc83f2e66a216df5113f694bb0d0f8d3ce4 100644 (file)
@@ -9,11 +9,12 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lua-rs232
 PKG_VERSION:=1.0.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=fb2f6453537e10beb2cd99d30eb1b4259ab75452992ca8a65d621186cf320960
 PKG_SOURCE_URL:=https://github.com/srdgame/librs232.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=a9d463181e7f7034fe6a55bc38e845fb04fa93ba
diff --git a/lang/lua-rs232/patches/100-remove-build-timestamps.patch b/lang/lua-rs232/patches/100-remove-build-timestamps.patch
new file mode 100644 (file)
index 0000000..fe59e2c
--- /dev/null
@@ -0,0 +1,22 @@
+Index: lua-rs232-1.0.3/bindings/lua/luars232.c
+===================================================================
+--- lua-rs232-1.0.3.orig/bindings/lua/luars232.c       2014-06-05 09:48:23.000000000 +0200
++++ lua-rs232-1.0.3/bindings/lua/luars232.c    2017-12-03 13:03:51.008917783 +0100
+@@ -31,7 +31,6 @@
+ #include "librs232/rs232.h"
+-#define MODULE_TIMESTAMP __DATE__ " " __TIME__
+ #define MODULE_NAMESPACE "luars232"
+ #define MODULE_VERSION "1.0.3"
+ #define MODULE_BUILD "$Id: luars232.c 15 2011-02-23 09:02:20Z sp $"
+@@ -483,9 +482,6 @@
+       lua_pushstring(L, MODULE_BUILD);
+       lua_setfield(L, -2, "_BUILD");
+-      lua_pushstring(L, MODULE_TIMESTAMP);
+-      lua_setfield(L, -2, "_TIMESTAMP");
+-
+       lua_pushstring(L, MODULE_COPYRIGHT);
+       lua_setfield(L, -2, "_COPYRIGHT");
index 321d6de85a35d40ebe62116aef24226bd40f9caa..e76a5a20b25fc68468c4dafef1e59dc3dc85e244 100644 (file)
@@ -12,6 +12,7 @@ PKG_VERSION:=0.2.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=79e65bd7cb1b8ef64e125c9e57f40b7d38678599587c1894ce57838814403945
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/lgierth/lua-sha2.git
 PKG_SOURCE_PROTO:=git
index 51175967d297cff8ef3a7e3f2a314c1d8d9d14c7..5e1e6c9d99f2bcedd6e148c0756101f12a9881c5 100644 (file)
@@ -14,6 +14,7 @@ PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=0e52ca377c135c8db1f824841e1a36c1ef7e4b4a594a5b70a2f402586901ca1f
 PKG_SOURCE_URL:=https://github.com/keplerproject/wsapi.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=eed8338401196cc155e59280adbe58d78933ead0
index 71ed8bd999dd94445d95c3e5db8b341aae5328dd..73be566a81c26a5c96b00ed7b72f5fc842bf02e4 100644 (file)
@@ -14,6 +14,7 @@ PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=0ab254d4bb8ce9556ad8fc2a1b4aef739ec3bb3e1f343400b20435e2ab8e686f
 PKG_SOURCE_URL:=https://github.com/keplerproject/xavante.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=9825b905133e14d37a4c179f2d02367ab93f1ef6
index 6153c8d67ee11a37890cb028d0d1ac1fa807302f..20f2c391a443bad846ab6399b03947ccb8bffe5b 100644 (file)
@@ -16,7 +16,7 @@ _BASENAME:=LuaBitOp
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_SOURCE:=$(_BASENAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://bitop.luajit.org/download/
-PKG_MD5SUM:=d0c1080fe0c844e8477279668e2d0d06
+PKG_HASH:=1207c9293dcd52eb9dca6538d1b87352bd510f4e760938f5048433f7f272ce99
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(_BASENAME)-$(PKG_VERSION)
 PKG_LICENSE:=MIT
 
index eae164f2befd80b1ff04b7144e6fbcca3ee0cb4c..f4ebef8e416e49b20eb6215644011f76bb61ef5d 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://matthewwild.co.uk/projects/luaexpat
-PKG_MD5SUM:=3c20b5795e7107f847f8da844fbfe2da
+PKG_HASH:=d060397960d87b2c89cf490f330508b7def1a0677bdc120531c571609fc57dc3
 
 include $(INCLUDE_DIR)/package.mk
 
index 13abef6a6b4e7d21ff0754b16cccd557925646d4..55bb95e341bd4a718e0ece2c8ffd8e029d182561 100644 (file)
@@ -12,6 +12,7 @@ PKG_VERSION:=1.6.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=b366bce608e6f18f1b3cb32c6eb6a78d78d17c3598a0d54c493601f9aadefdd8
 PKG_SOURCE_URL:=https://github.com/keplerproject/luafilesystem.git
 PKG_SOURCE_VERSION:=2fd989cd6c777583be1c93616018c55b2cbb1bcf
 PKG_SOURCE_PROTO:=git
old mode 100755 (executable)
new mode 100644 (file)
index 5022b49..08525d9
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2016 OpenWrt.org
+# Copyright (C) 2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,16 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=luai2c
-PKG_VERSION:=1.0.0
-PKG_RELEASE:=3
+PKG_VERSION:=1.1.2
+PKG_RELEASE:=4
 PKG_MAINTAINER:=Frank Edelhaeuser <mrpace2@gmail.com>
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=1c25062e95064cda4866243ff6797ef597dd57260da559ca68129aa7a72a9cda
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/mrpace2/i2c-lua.git
+PKG_SOURCE_URL:=https://github.com/mrpace2/lua-i2c.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=$(PKG_VERSION)
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -26,7 +27,7 @@ define Package/luai2c
        SECTION:=lang
        CATEGORY:=Languages
        TITLE:=Lua I2C binding
-       URL:=https://github.com/mrpace2/i2c-lua/
+       URL:=https://github.com/mrpace2/lua-i2c/
        DEPENDS:=+liblua +kmod-i2c-core
        MAINTAINER:=Frank Edelhaeuser <mrpace2@gmail.com>
 endef
diff --git a/lang/luajit/Makefile b/lang/luajit/Makefile
new file mode 100644 (file)
index 0000000..e5dfa95
--- /dev/null
@@ -0,0 +1,92 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luajit
+PKG_VERSION:=2017-01-17-71ff7ef
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Morteza Milani <milani@pichak.co>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYRIGHT
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/LuaJIT/LuaJIT.git
+PKG_SOURCE_VERSION:=71ff7ef8a7e0592dedb3527d4aacc68bf04af0bd
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=543994d0822515d9b7dc7cbaa7737c48258403d56a3b30e729267421265d4618
+PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+define Package/luajit
+ SUBMENU:=Lua
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=LuaJIT
+ URL:=http://www.luajit.org
+ DEPENDS:=@(i386||x86_64||arm||armeb||powerpc||mips||mipsel)
+endef
+
+define Package/luajit/description
+ LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. *** Requires GCC Multilib on host system to build! ***
+endef
+
+TARGET_CFLAGS += $(FPIC) -std=gnu99
+HOST_CFLAGS += $(FPIC) -std=gnu99
+
+ifeq ($(HOST_ARCH),x86_64)
+  ifeq ($(CONFIG_x86_64),)
+    HOST_BITS := -m32
+  endif
+endif
+
+define Build/Compile
+       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               HOST_CC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_BITS)" \
+               CROSS="$(TARGET_CROSS)" \
+               DPREFIX=$(PKG_INSTALL_DIR)/usr \
+               PREFIX=/usr \
+               TARGET_CFLAGS="$(TARGET_CFLAGS)"
+       rm -rf $(PKG_INSTALL_DIR)
+       mkdir -p $(PKG_INSTALL_DIR)
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DPREFIX=$(PKG_INSTALL_DIR)/usr \
+               PREFIX=/usr \
+               install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/luajit-2.1
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/luajit-2.1/*.h $(1)/usr/include/luajit-2.1
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/luajit.pc $(1)/usr/lib/pkgconfig/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-2.1.0-beta2 $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)
+endef
+
+define Package/luajit/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-2.1.0-beta2 $(1)/usr/bin/$(PKG_NAME)
+endef
+
+define Host/Compile
+       $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
+               DPREFIX=$(STAGING_DIR_HOSTPKG) \
+               TARGET_CFLAGS="$(HOST_CFLAGS)" \
+               TARGET_LDFLAGS="$(HOST_LDFLAGS)"
+endef
+
+define Host/Install
+       $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
+               DPREFIX=$(STAGING_DIR_HOSTPKG) \
+               install
+       $(CP) $(STAGING_DIR_HOSTPKG)/bin/luajit-2.1.0-beta2 $(STAGING_DIR_HOSTPKG)/bin/$(PKG_NAME)
+endef
+
+$(eval $(call HostBuild,luajit))
+$(eval $(call BuildPackage,luajit))
diff --git a/lang/luajit/patches/010-lua-path.patch b/lang/luajit/patches/010-lua-path.patch
new file mode 100644 (file)
index 0000000..63df9a1
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/src/luaconf.h
++++ b/src/luaconf.h
+@@ -35,8 +35,8 @@
+ #ifndef LUA_LMULTILIB
+ #define LUA_LMULTILIB "lib"
+ #endif
+-#define LUA_LROOT     "/usr/local"
+-#define LUA_LUADIR    "/lua/5.1/"
++#define LUA_LROOT     "/usr"
++#define LUA_LUADIR    "/lua/"
+ #define LUA_LJDIR     "/luajit-2.1.0-beta2/"
+
+ #ifdef LUA_ROOT
index 749709d99a8671695e350eacd1294fd212517dbc..ca4573b4b54e5edfe072c0ba7a369fd95c1af60c 100644 (file)
@@ -13,6 +13,7 @@ PKG_VERSION:=3.9.4
 PKG_RELEASE=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_MIRROR_HASH:=e9b053e627edaf7ef229af176177bf2bd0edd31b69690ba7c1e6be41041ffd07
 PKG_SOURCE_URL:=https://github.com/LuaLanes/lanes.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=$(PKG_REV)
@@ -21,7 +22,7 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 
-PKG_BUILD_DEPENDS:=lua/host luac/host
+PKG_BUILD_DEPENDS:=lua/host
 
 include $(INCLUDE_DIR)/package.mk
 
index 9bf362865cf46374906116a52a650f4ebc0fde73..92ff86d0e5528951428e152bdfe0301ee910f92d 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=5
 
 PKG_SOURCE:=release-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/luaposix/luaposix/archive/
-PKG_MD5SUM:=aa68b5c07ab1ecea81bb466c81e88056
+PKG_HASH:=4fb34dfea67f4cf3194cdecc6614c9aea67edc3c4093d34137669ea869c358e1
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-release-$(PKG_VERSION)
 PKG_REMOVE_FILES:=aclocal.m4
 PKG_FIXUP:=autoreconf
@@ -21,6 +21,8 @@ PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
 
+PKG_BUILD_DEPENDS:=lua/host
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/luaposix
@@ -30,7 +32,6 @@ define Package/luaposix
   TITLE:=luaposix
   URL:=http://luaforge.net/projects/luaposix/
   DEPENDS:=+lua +librt
-  PKG_BUILD_DEPENDS:=+lua/host
 endef
 
 define Package/luaposix/description
@@ -43,6 +44,9 @@ CONFIGURE_VARS += ac_cv_path_LDOC="true"
 TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC) -std=gnu99
 ifeq ($(CONFIG_USE_MUSL),y)
   TARGET_CFLAGS += -D_POSIX_PRIORITY_SCHEDULING
+  # Musl doesn't do all of XOPEN_REALTIME, but it does for luaposix.
+  # see https://github.com/luaposix/luaposix/issues/295
+  TARGET_CFLAGS += -D_XOPEN_REALTIME=1
 endif
 
 ifneq ($(CONFIG_USE_GLIBC),)
index 73dbde722bcab4a7d2d41c0eb42805248f79148f..3428ef8381860951fe21e096261d9fee5a6ae1b4 100644 (file)
@@ -12,6 +12,7 @@ PKG_VERSION:=2.2.2
 PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=e4cf874c9bce34a5accd41daaf51a3213763b8b6f7f658ca4d13a70a7ddb1c0c
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/keplerproject/luarocks.git
@@ -19,9 +20,12 @@ PKG_SOURCE_VERSION:=v$(PKG_VERSION)
 
 PKG_MAINTAINER:=Amr Hassan <amr.hassan@gmail.com>
 PKG_INSTALL=1
-PKG_BUILD_DEPENDS:=lua/host luac/host
+PKG_BUILD_DEPENDS:=lua/host
+HOST_BUILD_DEPENDS:=$(PKG_BUILD_DEPENDS)
 PKG_LICENSE=GPL
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
 
+include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
 
 define Package/luarocks
@@ -43,6 +47,11 @@ CONFIGURE_ARGS = \
     --sysconfdir=/etc \
     --with-lua=$(STAGING_DIR_HOSTPKG)
 
+HOST_CONFIGURE_ARGS= \
+    --prefix=$(STAGING_DIR_HOSTPKG) \
+    --sysconfdir=$(STAGING_DIR_HOSTPKG)/etc \
+    --with-lua=$(STAGING_DIR_HOSTPKG)
+
 CONFIGURE_VARS = \
        LUAROCKS_UNAME_S="Linux" \
        LUAROCKS_UNAME_M="$(ARCH)"
@@ -51,6 +60,10 @@ define Build/Compile
        $(call Build/Compile/Default,build)
 endef
 
+define Host/Compile
+  $(call Host/Compile/Default,build)
+endef
+
 define Package/luarocks/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-5.1 $(1)/usr/bin/luarocks
@@ -59,4 +72,10 @@ define Package/luarocks/install
        $(CP) $(PKG_INSTALL_DIR)/etc $(1)/etc
 endef
 
+define Host/Install
+  $(MAKE) -C $(HOST_BUILD_DIR) install
+endef
+
 $(eval $(call BuildPackage,luarocks))
+
+$(eval $(call HostBuild))
index b2bde5762a5be41e6b9b83f22bde957487c3932e..4bf05acc9f4557fff40a8de90f47438879ef197c 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/brunoos/luasec/archive/
-PKG_MD5SUM:=14e1aef6d2aae96bbf98afc6b6634af2
+PKG_HASH:=cef3a35c18beb8a54d9c8ce6260a4cabbd9a386de8711320d084daffad0aed5d
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION)
 
 MAINTAINER:=W. Michael Petullo <mike@flyn.org>
index 6ebf03b715d0511ccc049a09b0bfb752a96cc64e..de88fcf98f47f00a24b4eeef068b9ad964c99806 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=https://github.com/tomasguisasola/luasoap.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=af1e100281cee4b972df10121e37e51d53367a98
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_MIRROR_MD5SUM:=
+PKG_MIRROR_HASH:=839317e9a12c0723cf15eb5cea8d249e3f666a077585018fb8757aa1fb47d4e8
 
 PKG_MAINTAINER:=Liu Peng <pengliu@credosemi.com>
 PKG_LICENSE:=MIT
index 5e7c98300fd3988c15d5291312e846ea5b3ac055..ba8ca2a6ee64100ece395785a06ee1421688e4ab 100644 (file)
@@ -10,9 +10,10 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=luasocket
 PKG_SOURCE_VERSION:=6d5e40c324c84d9c1453ae88e0ad5bdd0a631448
 PKG_VERSION:=3.0-rc1-20130909
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MIRROR_HASH:=d2fa075d8bd026c41e0eb1a634ac2ad8115dee8abb070720e8e91fab51f86ee4
 PKG_SOURCE_URL:=https://github.com/diegonehab/luasocket.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
diff --git a/lang/luasocket/patches/0301-Fix-mpc85xx-build.patch b/lang/luasocket/patches/0301-Fix-mpc85xx-build.patch
new file mode 100644 (file)
index 0000000..c3bf949
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/src/makefile
++++ b/src/makefile
+@@ -345,18 +345,18 @@ none:
+ all: $(SOCKET_SO) $(MIME_SO)
+ $(SOCKET_SO): $(SOCKET_OBJS)
+-      $(LD) $(SOCKET_OBJS) $(LDFLAGS)$@
++      $(CC) $(SOCKET_OBJS) $(LDFLAGS)$@
+ $(MIME_SO): $(MIME_OBJS)
+-      $(LD) $(MIME_OBJS) $(LDFLAGS)$@
++      $(CC) $(MIME_OBJS) $(LDFLAGS)$@
+ all-unix: all $(UNIX_SO) $(SERIAL_SO)
+ $(UNIX_SO): $(UNIX_OBJS)
+-      $(LD) $(UNIX_OBJS) $(LDFLAGS)$@
++      $(CC) $(UNIX_OBJS) $(LDFLAGS)$@
+ $(SERIAL_SO): $(SERIAL_OBJS)
+-      $(LD) $(SERIAL_OBJS) $(LDFLAGS)$@
++      $(CC) $(SERIAL_OBJS) $(LDFLAGS)$@
+ install: 
+       $(INSTALL_DIR) $(INSTALL_TOP_LDIR)
index 135ebff64917c32db53e94097fc132ec350418ab..3f904f8c36813b63d1cf5bf8cda8487ffdf84be7 100644 (file)
@@ -12,6 +12,7 @@ PKG_VERSION:=2.3.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=b6251065656bf3e066d90d492dd06eec2c2cc76ab4b94187ce3ed9620d41f741
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/keplerproject/luasql.git
diff --git a/lang/luv/Config.in b/lang/luv/Config.in
new file mode 100644 (file)
index 0000000..076473f
--- /dev/null
@@ -0,0 +1,11 @@
+menu "Configuration"
+       depends on PACKAGE_luv
+
+config LUV_USE_LUAJIT_ENGINE
+       bool "Use luajit engine"
+       select PACKAGE_luajit
+       help
+               If selected, luv will be compiled against luajit. If not selected, luv will use Lua as engine.
+       default n
+
+endmenu
diff --git a/lang/luv/Makefile b/lang/luv/Makefile
new file mode 100644 (file)
index 0000000..a0057f1
--- /dev/null
@@ -0,0 +1,61 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luv
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/luvit/luv.git
+PKG_SOURCE_VERSION:=1.9.1-1
+PKG_SOURCE_DATE:=2016-12-16
+
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/luv
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Luv
+  URL:=https://github.com/luvit/luv
+  MAINTAINER:=Morteza Milani <milani@pichak.co>
+  DEPENDS:=+libuv +!LUV_USE_LUAJIT_ENGINE:lua
+endef
+
+define Package/luv/description
+  Bare libuv bindings for lua
+endef
+
+define Package/luv/config
+       source "$(SOURCE)/Config.in"
+endef
+
+CMAKE_OPTIONS += -DLUA_BUILD_TYPE=System
+CMAKE_OPTIONS += -DWITH_SHARED_LIBUV=ON
+CMAKE_OPTIONS += -DBUILD_MODULE=OFF
+CMAKE_OPTIONS += -DBUILD_SHARED_LIBS=ON
+
+ifeq ($(CONFIG_LUV_USE_LUAJIT_ENGINE),y)
+       CMAKE_OPTIONS += -DWITH_LUA_ENGINE=Luajit
+else
+       CMAKE_OPTIONS += -DWITH_LUA_ENGINE=Lua
+endif
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/luv
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/luv/*.h $(1)/usr/include/luv
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
+endef
+
+define Package/luv/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libluv.so.1.9.1 $(1)/usr/lib/lua/luv.so
+endef
+
+
+$(eval $(call BuildPackage,luv))
index b17b945d3d35187c264ada5062676d66b659f788..8ac4453a27e5840e804b3785484f4c7625c59e24 100644 (file)
@@ -15,7 +15,7 @@ PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/zeromq/lzmq/tar.gz/v$(PKG_VERSION)?
-PKG_MD5SUM:=c4e51a60a5a26987bdce59e45d674a9e
+PKG_HASH:=51ec00117b0570db82b1eba7b62e95d7e98c880a028584b195a98b433dd8edd1
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
diff --git a/lang/micropython-lib/Makefile b/lang/micropython-lib/Makefile
deleted file mode 100644 (file)
index 2f3fc61..0000000
+++ /dev/null
@@ -1,55 +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:=micropython-lib
-PKG_VERSION=1.8.6-$(PKG_SOURCE_VERSION)
-PKG_RELEASE:=1
-
-PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
-PKG_LICENSE:=MIT, PSFL
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/micropython/micropython-lib.git
-PKG_SOURCE_VERSION:=f81e979c56dddb771ad36ec381b7f2c6cd12111f
-
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
-PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/micropython-lib
-    SUBMENU:=Python
-    SECTION:=lang
-    CATEGORY:=Languages
-    TITLE:=micropython-lib
-    URL:=https://github.com/micropython/micropython-lib
-    DEPENDS:=+micropython
-endef
-
-define Package/micropython-lib/description
-    This package contains micropython-lib, a project to develop a non-monolothic
-    standard library for Micro Python. Note that this is a work in progress and
-    several libraries may be missing, incomplete or buggy.
-endef
-
-MAKE_FLAGS:=\
-       -C $(PKG_BUILD_DIR) \
-       PREFIX=$(PKG_BUILD_DIR)/_install_tmp \
-       install
-
-define Package/micropython-lib/install
-       $(INSTALL_DIR) $(1)/usr/lib/micropython
-       $(CP) $(PKG_BUILD_DIR)/_install_tmp/* $(1)/usr/lib/micropython
-endef
-
-$(eval $(call BuildPackage,micropython-lib))
-
diff --git a/lang/micropython/Makefile b/lang/micropython/Makefile
deleted file mode 100644 (file)
index 7ee5882..0000000
+++ /dev/null
@@ -1,57 +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:=micropython
-PKG_VERSION=1.8.6-$(PKG_SOURCE_VERSION)
-PKG_RELEASE:=1
-
-PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/micropython/micropython.git
-PKG_SOURCE_VERSION:=5a1d63fc14dae788f705403a43c2d8639b7dd9cd
-
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/micropython
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Micro Python
-  URL:=http://micropython.org
-  DEPENDS:=+libffi
-endef
-
-define Package/micropython/description
- This package contains Micro Python, a lean and fast implementation of the Python 3.4 programming language
- that is optimised to run on a microcontroller (and low power computers).
-endef
-
-
-MAKE_FLAGS += -C $(PKG_BUILD_DIR)/unix 
-
-define Build/Compile
-       $(call Build/Compile/Default,axtls) 
-       $(call Build/Compile/Default) 
-
-endef
-
-define Package/micropython/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/unix/micropython $(1)/usr/bin/micropython
-endef
-
-$(eval $(call BuildPackage,micropython))
diff --git a/lang/micropython/patches/000-Makefile-no-errors b/lang/micropython/patches/000-Makefile-no-errors
deleted file mode 100644 (file)
index 765f3e7..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: micropython-1.5-20161117-e81a5353cb794b8d6c57317488e5db6a1c524755/unix/Makefile
-===================================================================
---- micropython-1.5-20161117-e81a5353cb794b8d6c57317488e5db6a1c524755.orig/unix/Makefile       2016-11-17 02:43:13.000000000 +0100
-+++ micropython-1.5-20161117-e81a5353cb794b8d6c57317488e5db6a1c524755/unix/Makefile    2016-11-17 16:49:02.937809018 +0100
-@@ -21,7 +21,7 @@
- INC += -I$(BUILD)
- # compiler settings
--CWARN = -Wall -Werror
-+CWARN = -Wall
- CWARN += -Wpointer-arith -Wuninitialized
- CFLAGS = $(INC) $(CWARN) -ansi -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT) $(CFLAGS_EXTRA)
index f4de0c0c4dbd52913f9421ea451cf6283c50dfb5..d8ce58861c179e8e586a6c498f9f43946f225c95 100644 (file)
@@ -9,17 +9,18 @@ include $(TOPDIR)/rules.mk
 
 PKG_NPM_NAME:=arduino-firmata
 PKG_NAME:=node-$(PKG_NPM_NAME)
-PKG_VERSION:=0.3.3
-PKG_RELEASE:=5
+PKG_VERSION:=0.3.4
+PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/shokai/node-arduino-firmata.git
-PKG_SOURCE_VERSION:=16e76007edf218d72df590adbd711ac6b7432845
+PKG_SOURCE_VERSION:=v0.3.4
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+#PKG_MIRROR_HASH:=b7a498ccf70e466503e72d38ae5b474e91416b6c9842fd167dff249357b0dc37
 
 PKG_BUILD_DEPENDS:=node/host
-PKG_NODE_VERSION:=4.4.5
+PKG_NODE_VERSION:=8.10.0
 
 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
 PKG_LICENSE:=MIT
@@ -28,13 +29,12 @@ PKG_LICENSE_FILES:=LICENSE.txt
 include $(INCLUDE_DIR)/package.mk
 
 define Package/node-arduino-firmata
-  DEPENDS:=+node
   SUBMENU:=Node.js
   SECTION:=lang
   CATEGORY:=Languages
-  DEPENDS:=+node +node-serialport
   TITLE:=Node.js package to access serial ports for reading and writing
   URL:=https://www.npmjs.org/package/serialport
+  DEPENDS:=+node +node-npm +node-serialport
 endef
 
 define Package/node-arduino-firmata/description
@@ -59,8 +59,8 @@ endef
 
 define Package/node-arduino-firmata/install
        mkdir -p $(1)/usr/lib/node
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/* $(1)/usr/lib/node
-       rm -rf $(1)/usr/lib/node/arduino-firmata/node_modules/serialport/ 
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/ $(1)/usr/lib/node
+       rm -rf $(1)/usr/lib/node/arduino-firmata/node_modules/serialport/
        $(CP) ./files/* $(1)/
 endef
 
index 13833a3552c3e6221e821dcc2b0680fc34f5b425..97916088199c571748616d8b01cb496abeb3759c 100644 (file)
@@ -9,17 +9,18 @@ include $(TOPDIR)/rules.mk
 
 PKG_NPM_NAME:=cylon
 PKG_NAME:=node-$(PKG_NPM_NAME)
-PKG_VERSION:=0.22.0
-PKG_RELEASE:=5
+PKG_VERSION:=0.24.0
+PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/hybridgroup/cylon-firmata.git
-PKG_SOURCE_VERSION:=0c37da77e48b3e2cc3a8d566822a17689de91b40
+PKG_SOURCE_VERSION:=a930f8446f23ec2cb28aadeff54b79ab7704e3a0
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=dceb75539d32f402db0a5f68f2c7e2b52e5547a5ac2dec875d34fd3cc95cce00
 
 PKG_BUILD_DEPENDS:=node/host
-PKG_NODE_VERSION:=4.4.5
+PKG_NODE_VERSION:=8.10.0
 
 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
 PKG_LICENSE:=Apache-2.0
@@ -28,12 +29,12 @@ PKG_LICENSE_FILES:=LICENSE
 include $(INCLUDE_DIR)/package.mk
 
 define Package/node-cylon/default
-  DEPENDS:=+node $(2)
   SUBMENU:=Node.js
   SECTION:=lang
   CATEGORY:=Languages
   TITLE:=CylonJS - $(1)
   URL:=https://www.npmjs.org/package/cylon
+  DEPENDS:=+node +node-npm $(2)
 endef
 
 define Package/node-cylon
index 08d579c11a1ac5039ea649a97ccb597452176744..0e7803e21332173ef8ca65e984cdcdd492fdc8fd 100644 (file)
@@ -1,12 +1,13 @@
-Index: node-cylon-0.22.0/package.json
-===================================================================
---- node-cylon-0.22.0.orig/package.json        2015-10-20 20:32:48.000000000 +0200
-+++ node-cylon-0.22.0/package.json     2015-10-21 10:42:20.616109122 +0200
-@@ -38,7 +38,6 @@
+--- a/package.json
++++ b/package.json
+@@ -41,7 +41,8 @@
    },
  
    "dependencies": {
--    "firmata":    ">= 0.3.2",
-     "cylon":      "1.1.0",
-     "cylon-gpio": "0.26.0",
-     "cylon-i2c":  "0.22.0"
+-    "firmata":    ">= 0.8.0",
+-    "cylon":      "^1.3.0"
++    "cylon":      "^1.3.0",
++    "cylon-gpio": "0.30.1",
++    "cylon-i2c":  "0.26.1"
+   }
+ }
index b8a5b7ab9ddab29468779497cfd706184d7bc963..afcda10279dba318d34436397196860c0cf437fb 100644 (file)
@@ -9,17 +9,18 @@ include $(TOPDIR)/rules.mk
 
 PKG_NPM_NAME:=hid
 PKG_NAME:=node-$(PKG_NPM_NAME)
-PKG_VERSION:=0.5.1
-PKG_RELEASE:=5
+PKG_VERSION:=0.7.2
+PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/node-hid/node-hid.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=35d830b7810c87d32484d0a346621568c4849441
+PKG_SOURCE_VERSION:=v0.7.2
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=ede801a26a23290ab76d64ab636c3c3e2788030bb830af7006d37444c2a7b2c4
 
-PKG_BUILD_DEPENDS:=node/host
-PKG_NODE_VERSION:=4.4.5
+PKG_BUILD_DEPENDS:=node/host libudev-fbsd
+PKG_NODE_VERSION:=8.10.0
 
 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
 PKG_LICENSE:=Custom
@@ -28,13 +29,12 @@ PKG_LICENSE_FILES:=
 include $(INCLUDE_DIR)/package.mk
 
 define Package/node-hid
-  DEPENDS:=+node
   SUBMENU:=Node.js
   SECTION:=lang
   CATEGORY:=Languages
-  DEPENDS:=+libusb-1.0 +hidapi +libstdcpp
   TITLE:=Node.js package to access HID devices
   URL:=https://github.com/node-hid/node-hid
+  DEPENDS:=+node +node-npm +libusb-1.0 +hidapi +libstdcpp
 endef
 
 define Package/node-hid/description
@@ -58,7 +58,7 @@ endef
 
 define Package/node-hid/install
        mkdir -p $(1)/usr/lib/node/node-hid/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/* $(1)/usr/lib/node/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/ $(1)/usr/lib/node/
 endef
 
 $(eval $(call BuildPackage,node-hid))
index 3109404921e796cf203a0725f4210b656cf7b1e4..1fec2e47c45fead6551d3aafd654e9a27fc03a64 100644 (file)
@@ -9,15 +9,15 @@ include $(TOPDIR)/rules.mk
 
 PKG_NPM_NAME:=serialport
 PKG_NAME:=node-$(PKG_NPM_NAME)
-PKG_VERSION:=3.0.0
-PKG_RELEASE:=3
+PKG_VERSION:=6.1.1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=http://registry.npmjs.org/$(PKG_NPM_NAME)/-/
-PKG_MD5SUM:=ea20a17746dd64e72d5f6f2019d9e28d
+PKG_HASH:=b58c326d217fb0af1639e4ea834d9fca4be16934c486499e2ddac6e52b8dd560
 
 PKG_BUILD_DEPENDS:=node/host
-PKG_NODE_VERSION:=4.4.5
+PKG_NODE_VERSION:=8.10.0
 
 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
 PKG_LICENSE:=Custom
@@ -26,12 +26,12 @@ PKG_LICENSE_FILES:=LICENSE
 include $(INCLUDE_DIR)/package.mk
 
 define Package/node-serialport
-  DEPENDS:=+node
   SUBMENU:=Node.js
   SECTION:=lang
   CATEGORY:=Languages
   TITLE:=Node.js package to access serial ports for reading and writing
   URL:=https://www.npmjs.org/package/serialport
+  DEPENDS:=+node +node-npm
 endef
 
 define Package/node-serialport/description
index 3a1a2f3eb836181da40cbda8a65f4ff0da2eb0d1..79f1023003a2b17c2ce167cb434dc8e7d96e772e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,23 +8,24 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=node
-PKG_VERSION:=v4.4.5
+PKG_VERSION:=v8.10.0
 PKG_RELEASE:=1
-
 PKG_SOURCE:=node-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION}
-PKG_MD5SUM:=376140907bbe362f36065a30af04f020
+PKG_HASH:=b72d4e71618d6bcbd039b487b51fa7543631a4ac3331d7caf69bdf55b5b2901a
 
 HOST_BUILD_DEPENDS:=python/host
 PKG_BUILD_DEPENDS:=python/host
+
 PKG_INSTALL:=1
 PKG_USE_MIPS16:=0
 
 HOST_BUILD_PARALLEL:=1
 PKG_BUILD_PARALLEL:=1
 
-PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
-PKG_LICENSE:=
+PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>, Adrian Panella <ianchi74@outlook.com>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
@@ -35,7 +36,7 @@ define Package/node
   SUBMENU:=Node.js
   TITLE:=Node.js is a platform built on Chrome's JavaScript runtime
   URL:=http://nodejs.org/
-  DEPENDS:=+libpthread +librt +libstdcpp +libopenssl +zlib
+  DEPENDS:=@(HAS_FPU||KERNEL_MIPS_FPU_EMULATOR) +libstdcpp +libopenssl +zlib +USE_UCLIBC:libpthread +USE_UCLIBC:librt +NODEJS_ICU:icu
 endef
 
 define Package/node/description
@@ -44,27 +45,82 @@ define Package/node/description
    package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
 endef
 
-CPU:=$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH))))
+define Package/node-npm
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Node.js
+  TITLE:=NPM stands for Node Package Manager
+  URL:=http://npmjs.com/
+  DEPENDS:=+node
+endef
+
+define Package/node-npm/description
+       NPM is the package manager for NodeJS
+endef
+
+define Package/node/config
+       menu "Module Selection"
+
+       config NODEJS_ICU
+               bool "enable i18n features"
+               default n
+
+       endmenu
+endef
+
+NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
 
-MAKE_VARS += \
-       DESTCPU=$(CPU)
+MAKE_VARS+= \
+       DESTCPU=$(NODEJS_CPU)
 
-CONFIGURE_ARGS= \
-       --dest-cpu=$(CPU) \
+CONFIGURE_ARGS:= \
+       --dest-cpu=$(NODEJS_CPU) \
        --dest-os=linux \
        --without-snapshot \
        --shared-zlib \
        --shared-openssl \
        --prefix=/usr
 
-ifneq ($(findstring arm,$(ARCH)),)
+ifneq ($(findstring arm,$(NODEJS_CPU)),)
+ifeq ($(CONFIG_SOFT_FLOAT),y)
+CONFIGURE_ARGS+= --with-arm-float-abi=softfp
+else
+
+CONFIGURE_ARGS+= --with-arm-float-abi=hard
+
+ifneq ($(findstring vfp,$(CONFIG_CPU_TYPE)),)
+ARM_FPU=vfp
+endif
+
+ifneq ($(findstring vfpv3,$(CONFIG_CPU_TYPE)),)
+ARM_FPU=vfpv3
+endif
+
+ifneq ($(findstring vfpv3-d16,$(CONFIG_CPU_TYPE)),)
+ARM_FPU=vfpv3-d16
+endif
+
+ifneq ($(findstring neon,$(CONFIG_CPU_TYPE)),)
+ARM_FPU=neon
+endif
+
+CONFIGURE_ARGS+= --with-arm-fpu=$(ARM_FPU)
+endif
+endif
+
+ifneq ($(findstring mips,$(NODEJS_CPU)),)
+ifeq ($(CONFIG_SOFT_FLOAT),y)
 CONFIGURE_ARGS+= \
-       $(if $(CONFIG_SOFT_FLOAT),--with-arm-float-abi=soft,--with-arm-float-abi=hard)
+       --with-mips-float-abi=soft
+endif
 endif
 
-ifneq ($(findstring mips,$(ARCH)),)
+ifeq ($(CONFIG_NODEJS_ICU),y)
+CONFIGURE_ARGS+= \
+       --with-intl=system-icu
+else
 CONFIGURE_ARGS+= \
-       $(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft,--with-mips-float-abi=hard)
+       --with-intl=none
 endif
 
 HOST_CONFIGURE_VARS:=
@@ -72,6 +128,7 @@ HOST_CONFIGURE_VARS:=
 HOST_CONFIGURE_ARGS:= \
        --dest-os=linux \
        --without-snapshot \
+       --shared-zlib \
        --prefix=$(STAGING_DIR_HOSTPKG)
 
 HOST_CONFIGURE_CMD:=python ./configure
@@ -82,13 +139,20 @@ define Build/InstallDev
 endef
 
 define Package/node/install
+       mkdir -p $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/node $(1)/usr/bin/
+endef
+
+define Package/node-npm/install
        mkdir -p $(1)/usr/bin $(1)/usr/lib/node_modules/npm/{bin,lib,node_modules}
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/{node,npm} $(1)/usr/bin/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE,cli.js} $(1)/usr/lib/node_modules/npm
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/{npm,npx} $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE} $(1)/usr/lib/node_modules/npm
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/lib/node_modules/npm/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npx-cli.js $(1)/usr/lib/node_modules/npm/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/node_modules/* $(1)/usr/lib/node_modules/npm/node_modules/
 endef
 
 $(eval $(call HostBuild))
 $(eval $(call BuildPackage,node))
+$(eval $(call BuildPackage,node-npm))
index 1bb24930f39e5972df72e49371994bc2debe78f6..1a573cb5d65e9dd25cdb5f21eb49a9df61675463 100644 (file)
@@ -1,8 +1,6 @@
-diff --git a/deps/v8/src/base/cpu.cc b/deps/v8/src/base/cpu.cc
-index 4f58720..1f3071e 100644
 --- a/deps/v8/src/base/cpu.cc
 +++ b/deps/v8/src/base/cpu.cc
-@@ -143,6 +143,7 @@ int __detect_fp64_mode(void) {
+@@ -144,6 +144,7 @@
        ".set push\n\t"
        ".set noreorder\n\t"
        ".set oddspreg\n\t"
index 0aa02dac231eee5ed15aff9710aa0d40990b3a60..3e4e583afc28bb99bfa6642a3006a760ad39f617 100644 (file)
@@ -1,6 +1,6 @@
 --- a/deps/uv/src/unix/getaddrinfo.c
 +++ b/deps/uv/src/unix/getaddrinfo.c
-@@ -99,6 +99,7 @@ static void uv__getaddrinfo_work(struct
+@@ -100,6 +100,7 @@
    int err;
  
    req = container_of(w, uv_getaddrinfo_t, work_req);
index 01a71c6a31a76987a2eae706912f58b6d08344d8..d9f0eb7a565a98a9e83cfcfc9075150cb57592b5 100644 (file)
@@ -1,12 +1,12 @@
 --- a/lib/module.js
 +++ b/lib/module.js
-@@ -453,7 +453,8 @@ Module._initPaths = function() {
-     homeDir = process.env.HOME;
+@@ -714,7 +714,8 @@
+   } else {
+     prefixDir = path.resolve(process.execPath, '..', '..');
    }
--  var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node')];
-+  var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node'),
-+    path.resolve(process.execPath, '..', '..', 'lib', 'node_modules')];
+-  var paths = [path.resolve(prefixDir, 'lib', 'node')];
++  var paths = [path.resolve(prefixDir, 'lib', 'node'),
++               path.resolve(prefixDir, 'lib', 'node_modules')];
  
    if (homeDir) {
      paths.unshift(path.resolve(homeDir, '.node_libraries'));
diff --git a/lang/node/patches/004-node_crypto-remove-std.patch b/lang/node/patches/004-node_crypto-remove-std.patch
new file mode 100644 (file)
index 0000000..fc14c02
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/src/node_crypto.cc b/src/node_crypto.cc
+index 972b1e4..7c0f65a 100644
+--- a/src/node_crypto.cc
++++ b/src/node_crypto.cc
+@@ -5623,7 +5623,7 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) {
+   }
+   raw_keylen = args[3]->NumberValue();
+-  if (raw_keylen < 0.0 || std::isnan(raw_keylen) || std::isinf(raw_keylen) ||
++  if (raw_keylen < 0.0 || isnan(raw_keylen) || isinf(raw_keylen) ||
+       raw_keylen > INT_MAX) {
+     type_error = "Bad key length";
+     goto err;
diff --git a/lang/openpyxl/Makefile b/lang/openpyxl/Makefile
deleted file mode 100644 (file)
index 6656d56..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=openpyxl
-PKG_VERSION:=2.4.0
-PKG_RELEASE:=1
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/7e/75/9bb309f80e4f75d139ecc55e9edf65c5844336b5a84966a609267255f961/
-PKG_MD5SUM:=e3376d1fce0681fd0b4047ab89218af4
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/openpyxl
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=A Python library to read/write Excel 2010 xlsx/xlsm files
-  URL:=https://openpyxl.readthedocs.org/
-  DEPENDS:=+python +django
-endef
-
-define Package/openpyxl/description
-  A Python library to read/write Excel 2010 xlsx/xlsm files
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/openpyxl/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,openpyxl))
diff --git a/lang/perl-authen-sasl-xs/Makefile b/lang/perl-authen-sasl-xs/Makefile
new file mode 100644 (file)
index 0000000..e7e0083
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2017 Philip Prindeville <philipp@redfish-solutions.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-authen-sasl-xs
+PKG_VERSION:=1.00
+PKG_RELEASE:=1
+
+PKG_SOURCE_NAME:=Authen-SASL-XS
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GB/GBARR/
+PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=1b0eaa0e7ac3a45857147d837e3d34c80c6eca1d9fdcb826a213c2a105454234
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Philip Prindeville <philipp@redfish-solutions.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-authen-sasl-xs
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Authen::XS hooks into libsasl.
+  URL:=http://search.cpan.org/dist/$(PKG_SOURCE_NAME)/
+  # DEPENDS:=perl +perl-authen-sasl +libsasl2 +perl-devel-checklib/host
+  DEPENDS:=perl +perl-authen-sasl +libsasl2
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-authen-sasl-xs/install
+       $(call perlmod/Install,$(1),Authen)
+endef
+
+
+$(eval $(call BuildPackage,perl-authen-sasl-xs))
diff --git a/lang/perl-authen-sasl-xs/patches/100-remove-devel-checklib-checks.patch b/lang/perl-authen-sasl-xs/patches/100-remove-devel-checklib-checks.patch
new file mode 100644 (file)
index 0000000..b4efa9e
--- /dev/null
@@ -0,0 +1,49 @@
+--- a/Makefile.PL      2009-09-22 16:22:09.000000000 -0600
++++ b/Makefile.PL      2018-01-01 18:54:13.023366252 -0700
+@@ -1,7 +1,6 @@
+ # Do yourself a favour, and don't edit this file, see README for build instructions
+ use ExtUtils::MakeMaker;
+-use Devel::CheckLib;
+ my @inc_search = qw(/opt/local/include /usr/local/include);
+ my @lib_search = qw(/opt/local/lib64 /usr/local/lib64 /opt/local/lib /usr/local/lib);
+@@ -12,15 +12,7 @@ unless (exists $args{INC} or exists $arg
+   my @incpath = grep {-d} @inc_search;
+   my @libpath = grep {-d} @lib_search;
+-  my $have_sasl2 = eval {
+-    assert_lib(
+-      lib     => "sasl2",
+-      header  => "sasl/sasl.h",
+-      libpath => \@libpath,
+-      incpath => \@incpath
+-    );
+-    1;
+-  };
++  my $have_sasl2 = 1;
+   if ($have_sasl2) {
+     $mmopt{DEFINE} = "-DSASL2" unless $use_sasl2;
+@@ -28,13 +27,6 @@ unless (exists $args{INC} or exists $arg
+   }
+   else {
+     exit(0) if $use_sasl2;
+-    @incpath = grep {-d} map { ("$_/sasl", $_) } @inc_search;
+-    check_lib_or_exit(
+-      lib     => "sasl",
+-      header  => "sasl.h",
+-      libpath => \@libpath,
+-      incpath => \@incpath
+-    );
+   }
+   $mmopt{INC}  = join " ", map {"-I$_"} @incpath;
+@@ -58,7 +50,6 @@ WriteMakefile(
+           repository => 'http://github.com/gbarr/perl-authen-sasl-xs',
+         },
+         build_requires => {
+-          'Devel::CheckLib' => 0,
+         },
+       }
+       )
diff --git a/lang/perl-authen-sasl/Makefile b/lang/perl-authen-sasl/Makefile
new file mode 100644 (file)
index 0000000..434ec08
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2017 Philip Prindeville <philipp@redfish-solutions.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-authen-sasl
+PKG_VERSION:=2.16
+PKG_RELEASE:=1
+
+PKG_SOURCE_NAME:=Authen-SASL
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GB/GBARR/
+PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=6614fa7518f094f853741b63c73f3627168c5d3aca89b1d02b1016dc32854e09
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Philip Prindeville <philipp@redfish-solutions.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-authen-sasl
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Generic network authentication protocol framework.
+  URL:=http://search.cpan.org/dist/$(PKG_SOURCE_NAME)/
+  DEPENDS:=perl +perlbase-digest
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-authen-sasl/install
+       $(call perlmod/Install,$(1),Authen)
+endef
+
+
+$(eval $(call BuildPackage,perl-authen-sasl))
index eaca4253c4762051afb50174ec941f55376cd9a2..54dee23ea857216422a48a83a2a399b80b284e99 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-cgi
-PKG_VERSION:=4.35
-PKG_RELEASE:=2
+PKG_VERSION:=4.38
+PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/L/LE/LEEJO
 PKG_SOURCE:=CGI-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=15e63942c02354426b25f056f2a4467c
+PKG_HASH:=8c58f4a529bb92a914b22b7e64c5e31185c9854a4070a6dfad44fe5cc248e7d4
 
 PKG_LICENSE:=GPL Artistic-2.0
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>, \
index 28766464ca210b2a39be81a4d370f9166e6c0231..1d9342d03dc87716af7958d207afda9448a98d9f 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/R/RU/RURBAN/
 PKG_SOURCE:=Compress-Bzip2-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=d5ef04d1e51fe45743b3044abad967d2
+PKG_HASH:=7956ac627fb373fae6effede3d21b3157122800224491b124afdd7bb426c8c3f
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 3c594d123f4278b186c2e50b7352b93cd4e0a8b8..eef2b3454528212908fc68af48ea9e0f69b7aef5 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/T/TI/TIMB/
 PKG_SOURCE:=DBI-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=4ad15a9c2cc9b68e3fe1f5cadf9cdb30
+PKG_HASH:=250712f385864818abfba409420d16d9ee61f1cc73ac85159d054a5ee86d1450
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 2069bed96f9cda2cc13ce4cc3a07b3efa4c59376..97b46e8509017bbc4666be4bd2af9b804bb53d78 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/C/CO/COOK/
 PKG_SOURCE:=Device-SerialPort-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=82c698151f934eb28c65d1838cee7d9e
+PKG_HASH:=d392567cb39b4ea606c0e0acafd8ed72320311b995336ece5fcefcf9b150e9d7
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Paul Oranje <por@xs4all.nl>
index 0a2c737c770a1a2ea9c88d29723c46ca21a34520..754ed074585733e3ea539f96879ddf5be37bdb7a 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GW/GWADEJ/
 PKG_SOURCE:=Device-USB-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=aa91bee777f7ed7a18225a84f8795344
+PKG_HASH:=fac2eb4f9e8db08b46d734ba8a2076598f974c274a91b248613fcecd7c9fc175
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 54071dcef0882be5affa464f95d582c7fc6d4f7e..48eafa81fbc0e965e73303ad32a470aeda4f1546 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
 PKG_SOURCE:=Encode-Locale-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=fcfdb8e4ee34bcf62aed429b4a23db27
+PKG_HASH:=176fa02771f542a4efb1dbc2a4c928e8f4391bf4078473bd6040d8f11adb0ec1
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 19a69389d676052502744a89f2ae77d819d5ea17..2725cedb623aaec944014c63734377b83c5ca06a 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
 PKG_SOURCE:=File-Listing-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=83f636b477741f3a014585bb9cc079a6
+PKG_HASH:=1e0050fcd6789a2179ec0db282bf1e90fb92be35d1171588bd9c47d52d959cf5
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index d107d705424daa89b42f9698fbc7d248b0a25884..f37d41afba1f215a802438e50273f09d2bd6a52d 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GW/GWYN
 PKG_SOURCE:=File-ShareDir-Install-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=37fb7fa72ce7184516dd022aba62f524
+PKG_HASH:=708af71dec4dfb5a8cf9a5e863b566714c3f65f0a76722302de5a07ee202e6f7
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index d412a1fea8994f3c38271569f6d7cf15fb49404a..022c3b7c1e7d9d4017fbce9af54f51c0ea338859 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
 PKG_SOURCE:=HTML-Form-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=fa6c2680207ed4fef5ea2ef09c210614
+PKG_HASH:=68c01d94f005d5ca9c4d55ad2a1bf3a8d034a5fc6db187d91a4c42f3fdc9fc36
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index e9772171b8b82b08b0e34ee8c8361b2a8d373ce7..c769ccc9bd7df344ed78528d520bd796bd4d284f 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS/
 PKG_SOURCE:=HTML-Parser-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=eb7505e5f626913350df9dd4a03d54a8
+PKG_HASH:=ec28c7e1d9e67c45eca197077f7cdc41ead1bb4c538c7f02a3296a4bb92f608b
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 4bcd10c714d9ac0c467927bcea4cf3afed4640b5..01410585ad31a8ed38bf31c1b17a7c6d2f43cc71 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/P/PE/PETDANCE/
 PKG_SOURCE:=HTML-Tagset-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=d2bfa18fe1904df7f683e96611e87437
+PKG_HASH:=adb17dac9e36cd011f5243881c9739417fd102fce760f8de4e9be4c7131108e2
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index d1b4ac9ac4eeab2f07c2395525e5fed36cd3c168..20839e62ce389488cb8988ab7b787f87db2cc4bc 100644 (file)
@@ -10,11 +10,10 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=perl-html-tree
 PKG_VERSION:=3.23
 PKG_RELEASE:=4
-PKG_MD5SUM:=6352f50be402301f79b580dd235d7762
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/P/PE/PETEK/
 PKG_SOURCE:=HTML-Tree-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=6352f50be402301f79b580dd235d7762
+PKG_HASH:=f5175acf262f3710dce899796ea3e353049939400b100706d03df2f08803c8de
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 329767a6973581776d02979dd6b41ecdd667a873..712cfbd21694addad9ba6533c2acc9132d08597d 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
 PKG_SOURCE:=HTTP-Cookies-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=ecfd0eeb88512033352c2f13c9580f03
+PKG_HASH:=f5d3ade383ce6389d80cb0d0356b643af80435bb036afd8edce335215ec5eb20
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 178573d99f0d22312c7cff4f21f83a93b1488b48..ed9d292541c23ede8c3fd36248a759a9a59fb398 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
 PKG_SOURCE:=HTTP-Daemon-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=ed0ae02d25d7f1e89456d4d69732adc2
+PKG_HASH:=43fd867742701a3f9fcc7bd59838ab72c6490c0ebaf66901068ec6997514adc2
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index bf0bd405378d96318fbe7a592b87bc2edab2077a..4801ac1f297d3d9d057a6207b1d250dabcb09fb4 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
 PKG_SOURCE:=HTTP-Date-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=52b7a0d5982d61be1edb217751d7daba
+PKG_HASH:=e8b9941da0f9f0c9c01068401a5e81341f0e3707d1c754f8e11f42a7e629e333
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 2b90e2add65d940fd6b41f51367863d731c3daca..c6a2469d38c3383c262b0d63ba9f6977e6658b6a 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER
 PKG_SOURCE:=HTTP-Message-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=4ed7add10daea3ab30abfeab6d03872f
+PKG_HASH:=e7b368077ae6a188d99920411d8f52a8e5acfb39574d4f5c24f46fd22533d81b
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index a72893a97f105fc57023777cd9e985ef7cd17713..6503e394659ae5c6fae4985da82a42ebb07fccce 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
 PKG_SOURCE:=HTTP-Negotiate-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=1236195250e264d7436e7bb02031671b
+PKG_HASH:=1c729c1ea63100e878405cda7d66f9adfd3ed4f1d6cacaca0ee9152df728e016
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 9a41da61603c0257405856ff325c76b3accb80b4..aab1dfd6a722c4596973072de87160df947f25b1 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/B/BP/BPS
 PKG_SOURCE:=HTTP-Server-Simple-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=ef736daddc7a32a29207fa4ed5f5d62e
+PKG_HASH:=b9dc5c9f12c16ca39a96f0ede1e27a18a5594274ff8f583000788a7fca136dfb
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 52826d20a18a4f9a50aeba659262529b5e7a0b9b..bc5913da718d7ed2d0dc1f2944eef3dc8437533a 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-inline-c
-PKG_VERSION:=0.76
+PKG_VERSION:=0.78
 PKG_RELEASE:=1
 
-PKG_SOURCE_URL:=http://www.cpan.org/authors/id/I/IN/INGY
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/T/TI/TINITA
 PKG_SOURCE:=Inline-C-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=c0fbfdd058075c9271a1384c822c9a87
+PKG_HASH:=9a7804d85c01a386073d2176582b0262b6374c5c0341049da3ef84c6f53efbc7
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
@@ -33,7 +33,7 @@ define Package/perl-inline-c
   CATEGORY:=Languages
   TITLE:=C Language Support for Inline
   URL:=http://search.cpan.org/dist/Inline-C/
-  DEPENDS:=perl +perl-inline +perl-parse-recdescent +perlbase-config +perlbase-cwd +perlbase-data +perlbase-essential +perlbase-extutils +perlbase-file +perlbase-if
+  DEPENDS:=perl +perl-inline +perl-parse-recdescent +perlbase-config +perlbase-cwd +perlbase-data +perlbase-essential +perlbase-file +perlbase-if
 endef
 
 define Host/Configure
index a1207057a2ac6cc404fbe190c0535a1a937f2a13..c6de5b32552be7907b11ec6e8b8e79973648accd 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/I/IN/INGY
 PKG_SOURCE:=Inline-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=510bbac46e727bcaf240b7feac2646c9
+PKG_HASH:=7e2bd984b1ebd43e336b937896463f2c6cb682c956cbd2c311a464363d2ccef6
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 9390c3601b7d3c07c8069193923604f0718f4102..1e280d84c187846e985f21ae40083b67d2d1c57f 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/C/CJ/CJM
 PKG_SOURCE:=IO-HTML-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=3f8958718844dc96b9f6946f21d70d22
+PKG_HASH:=ea78d2d743794adc028bc9589538eb867174b4e165d7d8b5f63486e6b828e7e0
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index b81e678d1dadd272d28315e1f1632a6fe19abc69..1bd5aca19bd913f046e02f7d6092c8830b33274b 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/S/SC/SCHWIGON/lockfile-simple/
 PKG_SOURCE:=LockFile-Simple-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=4421283b4f32549e5299963734170044
+PKG_HASH:=45c77896b2a5a0a45f6202a6f813f437ff8b283f84a1c60d0c4f3730802af3a2
 
 PKG_LICENSE:=GPL-2.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 69854316dc8e53046ec3874acca9be89f683f215..375b3a4e802d2eaa3233cc86339377f7c7a84343 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
 PKG_SOURCE:=LWP-MediaTypes-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=8c5f25fb64b974d22aff424476ba13c9
+PKG_HASH:=18790b0cc5f0a51468495c3847b16738f785a2d460403595001e0b932e5db676
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 058ac16c66afcceab62f811bb0d20c4b6cd8562e..8bd32e7d0ccbf38cd5a612ce72cc80602852ec1d 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER
 PKG_SOURCE:=Net-HTTP-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=3d84d17f64c7316d69e7eb7b4e292b9a
+PKG_HASH:=52762b939d84806908ba544581c5708375f7938c3c0e496c128ca3fbc425e58d
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index c915064997790befba05c8197908a5325d79c418..d3b4cfa37acca43f3d9156a9e2090f7aa6372718 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/J/JR/JROGERS/
 PKG_SOURCE:=Net-Telnet-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=d2514080116c1b0fa5f96295c84538e3
+PKG_HASH:=e64d567a4e16295ecba949368e7a6b8b5ae2a16b3ad682121d9b007dc5d2a37a
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index bbeff7b799e7c29da770dfa27e9d7be7d90a6bc6..d7dff8dbaa7d91a7384b60a0efa8f8b92dbf1bbe 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/J/JT/JTBRAUN
 PKG_SOURCE:=Parse-RecDescent-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=98f582240556a4a92e5d57e480f9d39d
+PKG_HASH:=226590d3850cd1678deb0190d5207b3477fb9070a8ca6f18d8999daf44485930
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 266bce4a842e227bac2ce4f82792d6f0c52f1661..f078f77ed68f88cbc69ab3a164aa09b85b5bf358 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/D/DA/DAGOLDEN
 PKG_SOURCE:=Sub-Uplevel-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=5d0752dbfa94d0c91b25a264f47f5675
+PKG_HASH:=2dcca582a7ea5bada576eb27c4be1d1b064fb22175bdbd6d696c45d083560505
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 0c14e85927f6424d7b8bd623cc960866407722c6..36a00545e06c7bb4843e27a2dd69e0eb4030eb94 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/L/LE/LEONT/
 PKG_SOURCE:=Test-Harness-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=4c8d9c77e8e06ca96c7383c05c8f3616
+PKG_HASH:=e7566f13b041d028b56f184b77ec2545ec6f0bb5a0f8f5368f7e4a08b496b63e
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 995e1bafc37cd05220fc624404b7424a19c522b4..94409e1f824b0b71dd843a6c0c416d9557757a0d 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/C/CH/CHORNY
 PKG_SOURCE:=Test-Warn-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=8306b998a96d2cc69266b5248d550472
+PKG_HASH:=8197555b94189d919349a03f7058f83861f145af9bee59f505bfe47562144e41
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
diff --git a/lang/perl-text-csv_xs/Makefile b/lang/perl-text-csv_xs/Makefile
new file mode 100644 (file)
index 0000000..1fb54d1
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2017 Philip Prindeville, Redfish Solutions, LLC
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-text-csv_xs
+PKG_VERSION:=1.34
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/H/HM/HMBRAND/
+PKG_SOURCE:=Text-CSV_XS-$(PKG_VERSION).tgz
+PKG_HASH:=ea3aa6fe50e8ef9c07f4304ace98fca413c9c6cf60d84efc32c314b902e8a134
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Philip Prindeville <philipp@redfish-solutions.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Text-CSV_XS-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-text-csv_xs
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Text comma-separated values manipulation routines
+  URL:=http://search.cpan.org/dist/Text-CSV_XS/
+  DEPENDS:=perl +perlbase-essential +perlbase-config +perlbase-io +perlbase-dynaloader
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-text-csv_xs/install
+        $(call perlmod/Install,$(1),Text Text/CSV_XS.pm auto/Text/CSV_XS)
+endef
+
+
+$(eval $(call BuildPackage,perl-text-csv_xs))
index 18667fcdb3387adf1be9cf3e9c034811310ddf70..3f043e4ffbe596c0a4c991dc16048441d721d412 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-uri
-PKG_VERSION:=1.71
+PKG_VERSION:=1.72
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
 PKG_SOURCE:=URI-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=247c3da29a794f72730e01aa5a715daf
+PKG_HASH:=35f14431d4b300de4be1163b0b5332de2d7fbda4f05ff1ed198a8e9330d40a32
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 1e424cbb07b05d11fec589eb39f7c3c7a3bc047d..9a7ad5fa5ddf3857247bb8d4476adaffe0de15a6 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=4
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/S/SZ/SZBALINT/
 PKG_SOURCE:=WWW-Curl-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=997ac81cd6b03b30b36f7cd930474845
+PKG_HASH:=52ffab110e32348d775f241c973eb56f96b08eedbc110d77d257cdb0a24ab7ba
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_LICENSE_FILES:=LICENSE
index 93d6be21b5bcd3388efa28b2a13082f43b429fbd..a193a6b90a00054b9e220343d93b852b16f1af20 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=WWW-Mechanize-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
-PKG_MD5SUM:=9a4b9c8827f519908ef0a0d2b8ae96fa
+PKG_HASH:=5310051feb66c6ef9f7a4c070c66ec6092932129fc9cd18bba009ce999b7930b
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index c28b8c274d044ed790632fe313aa48f47ac77a87..ccbb7fa67cfb1b6ba8c788c50965d2991da3b01a 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
 PKG_SOURCE:=WWW-RobotRules-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=b7186e8b8b3701e70c22abf430742403
+PKG_HASH:=46b502e7a288d559429891eeb5d979461dd3ecc6a5c491ead85d165b6e03a51e
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 86bf15bea6a1f310c9a55f3de15ae21e65af62c5..563e51c895488693edffd49d51f4305b9aae8221 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
 PKG_SOURCE:=libwww-perl-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=6888c9d8728cd6f3ea3c9754461c9f94
+PKG_HASH:=6f349d45c21b1ec0501c4437dfcb70570940e6c3d5bff783bd91d4cddead8322
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 57977c19b881a30d696018785f68b33e7d79ea7f..3a6ebcae8bea15f6a5377ea7c74f771f6f7580ed 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/T/TO/TODDR/
 PKG_SOURCE:=XML-Parser-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=af4813fe3952362451201ced6fbce379
+PKG_HASH:=1ae9d07ee9c35326b3d9aad56eae71a6730a73a116b9fe9e8a4758b7cc033216
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index d3cb081dac245972529998a37e07719cbe1b78b0..b6111aad4e8e64452953274c01f3072fbe31410b 100644 (file)
@@ -8,19 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl
-PKG_VERSION:=5.22.1
-PKG_RELEASE:=4
-
-PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
-               http://www.cpan.org/src/5.0 \
-               ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \
-               http://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \
-               ftp://ftp.gmd.de/mirrors/CPAN/src/5.0 \
-               http://ftp5.gwdg.de/pub/languages/perl/CPAN/src/ \
-               ftp://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0 \
-               http://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=19295bbb775a3c36123161b9bf4892f1
+PKG_VERSION:=5.26.1
+PKG_RELEASE:=3
+
+PKG_SOURCE_URL:=\
+               https://cpan.metacpan.org/src/5.0 \
+               https://cpan.uib.no/src/5.0 \
+               https://mirrors.rit.edu/CPAN/src/5.0 \
+               https://mirror.transip.net/CPAN/src/5.0 \
+               https://mirrors.sonic.net/cpan/src/5.0 \
+               https://www.cpan.org/src/5.0
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_HASH:=fe8208133e73e47afc3251c08d2c21c5a60160165a8ab8b669c43a420e4ec680
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_LICENSE_FILES:=Copying Artistic README
@@ -97,7 +96,7 @@ define Build/Configure
                                        -Dowrt:gccversion=$(CONFIG_GCC_VERSION) \
                                        -Dowrt:target_cross='$(TARGET_CROSS)' \
                                        -Dowrt:cflags='$(TARGET_CFLAGS_PERL) $(TARGET_CPPFLAGS_PERL)' \
-                                       -Dowrt:ldflags='-rdynamic $(TARGET_LDFLAGS)' \
+                                       -Dowrt:ldflags='$(TARGET_LDFLAGS)' \
                                        -Dowrt:libc=$(subst uClibc,uclibc,$(CONFIG_LIBC)) \
                                        -Dowrt:ipv6=$(if $($(CONFIG_IPV6)),define,undef) \
                                        -Dowrt:threads=$(if $(CONFIG_PERL_THREADS),yes,no) \
diff --git a/lang/perl/files/aarch64.config b/lang/perl/files/aarch64.config
new file mode 100644 (file)
index 0000000..cf3cfcb
--- /dev/null
@@ -0,0 +1,20 @@
+owrt:arch=aarch64
+owrt:bits=64
+owrt:endian=little
+
+ccsymbols=''
+cppccsymbols=''
+cppsymbols='__ELF__=1 _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE=1 _LP64=1 _STDC_PREDEF_H= _XOPEN_SOURCE=700 __AARCH64EL__=1 __AARCH64_CMODEL_SMALL__=1 __ARM_64BIT_STATE=1 __ARM_ARCH=8 __ARM_ARCH_8A=1 __ARM_ARCH_ISA_A64=1 __ARM_ARCH_PROFILE=65 __ARM_FEATURE_CLZ=1 __ARM_FEATURE_FMA=1 __ARM_FEATURE_IDIV=1 __ARM_FEATURE_NUMERIC_MAXMIN=1 __ARM_FEATURE_UNALIGNED=1 __ARM_FP=12 __ARM_NEON=1 __ARM_NEON_FP=12 __ARM_PCS_AAPCS64=1 __ARM_SIZEOF_MINIMAL_ENUM=4 __ARM_SIZEOF_WCHAR_T=4 __ATOMIC_ACQUIRE=2 __ATOMIC_ACQ_REL=4 __ATOMIC_CONSUME=1 __ATOMIC_RELAXED=0 __ATOMIC_RELEASE=3 __ATOMIC_SEQ_CST=5 __BIGGEST_ALIGNMENT__=16 __BYTE_ORDER__=1234 __CHAR16_TYPE__=short\ unsigned\ int __CHAR32_TYPE__=unsigned\ int __CHAR_BIT__=8 __CHAR_UNSIGNED__=1 __DBL_DECIMAL_DIG__=17 __DBL_DENORM_MIN__=((double)4.94065645841246544176568792868221372e-324L) __DBL_DIG__=15 __DBL_EPSILON__=((double)2.22044604925031308084726333618164062e-16L) __DBL_HAS_DENORM__=1 __DBL_HAS_INFINITY__=1 __DBL_HAS_QUIET_NAN__=1 __DBL_MANT_DIG__=53 __DBL_MAX_10_EXP__=308 __DBL_MAX_EXP__=1024 __DBL_MAX__=((double)1.79769313486231570814527423731704357e+308L) __DBL_MIN_10_EXP__=(-307) __DBL_MIN_EXP__=(-1021) __DBL_MIN__=((double)2.22507385850720138309023271733240406e-308L) __DEC128_EPSILON__=1E-33DL __DEC128_MANT_DIG__=34 __DEC128_MAX_EXP__=6145 __DEC128_MAX__=9.999999999999999999999999999999999E6144DL __DEC128_MIN_EXP__=(-6142) __DEC128_MIN__=1E-6143DL __DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL __DEC32_EPSILON__=1E-6DF __DEC32_MANT_DIG__=7 __DEC32_MAX_EXP__=97 __DEC32_MAX__=9.999999E96DF __DEC32_MIN_EXP__=(-94) __DEC32_MIN__=1E-95DF __DEC32_SUBNORMAL_MIN__=0.000001E-95DF __DEC64_EPSILON__=1E-15DD __DEC64_MANT_DIG__=16 __DEC64_MAX_EXP__=385 __DEC64_MAX__=9.999999999999999E384DD __DEC64_MIN_EXP__=(-382) __DEC64_MIN__=1E-383DD __DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD __DECIMAL_DIG__=36 __DEC_EVAL_METHOD__=2 __ELF__=1 __FINITE_MATH_ONLY__=0 __FLOAT_WORD_ORDER__=1234 __FLT_DECIMAL_DIG__=9 __FLT_DENORM_MIN__=1.40129846432481707092372958328991613e-45F __FLT_DIG__=6 __FLT_EPSILON__=1.19209289550781250000000000000000000e-7F __FLT_EVAL_METHOD__=0 __FLT_HAS_DENORM__=1 __FLT_HAS_INFINITY__=1 __FLT_HAS_QUIET_NAN__=1 __FLT_MANT_DIG__=24 __FLT_MAX_10_EXP__=38 __FLT_MAX_EXP__=128 __FLT_MAX__=3.40282346638528859811704183484516925e+38F __FLT_MIN_10_EXP__=(-37) __FLT_MIN_EXP__=(-125) __FLT_MIN__=1.17549435082228750796873653722224568e-38F __FLT_RADIX__=2 __FP_FAST_FMA=1 __FP_FAST_FMAF=1 __GCC_ATOMIC_BOOL_LOCK_FREE=2 __GCC_ATOMIC_CHAR16_T_LOCK_FREE=2 __GCC_ATOMIC_CHAR32_T_LOCK_FREE=2 __GCC_ATOMIC_CHAR_LOCK_FREE=2 __GCC_ATOMIC_INT_LOCK_FREE=2 __GCC_ATOMIC_LLONG_LOCK_FREE=2 __GCC_ATOMIC_LONG_LOCK_FREE=2 __GCC_ATOMIC_POINTER_LOCK_FREE=2 __GCC_ATOMIC_SHORT_LOCK_FREE=2 __GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1 __GCC_ATOMIC_WCHAR_T_LOCK_FREE=2 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8=1 __GCC_IEC_559=2 __GCC_IEC_559_COMPLEX=2 __GNUC_MINOR__=4 __GNUC_PATCHLEVEL__=0 __GNUC_STDC_INLINE__=1 __GNUC__=5 __INT16_C=__INT16_C __INT16_MAX__=0x7fff __INT16_TYPE__=short\ int __INT32_C=__INT32_C __INT32_MAX__=0x7fffffff __INT32_TYPE__=int __INT64_C=__INT64_C __INT64_MAX__=0x7fffffffffffffffL __INT64_TYPE__=long\ int __INT8_C=__INT8_C __INT8_MAX__=0x7f __INT8_TYPE__=signed\ char __INTMAX_C=__INTMAX_C __INTMAX_MAX__=0x7fffffffffffffffL __INTMAX_TYPE__=long\ int __INTPTR_MAX__=0x7fffffffffffffffL __INTPTR_TYPE__=long\ int __INT_FAST16_MAX__=0x7fffffff __INT_FAST16_TYPE__=int __INT_FAST32_MAX__=0x7fffffff __INT_FAST32_TYPE__=int __INT_FAST64_MAX__=0x7fffffffffffffffL __INT_FAST64_TYPE__=long\ int __INT_FAST8_MAX__=0x7f __INT_FAST8_TYPE__=signed\ char __INT_LEAST16_MAX__=0x7fff __INT_LEAST16_TYPE__=short\ int __INT_LEAST32_MAX__=0x7fffffff __INT_LEAST32_TYPE__=int __INT_LEAST64_MAX__=0x7fffffffffffffffL __INT_LEAST64_TYPE__=long\ int __INT_LEAST8_MAX__=0x7f __INT_LEAST8_TYPE__=signed\ char __INT_MAX__=0x7fffffff __LDBL_DENORM_MIN__=6.47517511943802511092443895822764655e-4966L __LDBL_DIG__=33 __LDBL_EPSILON__=1.92592994438723585305597794258492732e-34L __LDBL_HAS_DENORM__=1 __LDBL_HAS_INFINITY__=1 __LDBL_HAS_QUIET_NAN__=1 __LDBL_MANT_DIG__=113 __LDBL_MAX_10_EXP__=4932 __LDBL_MAX_EXP__=16384 __LDBL_MAX__=1.18973149535723176508575932662800702e+4932L __LDBL_MIN_10_EXP__=(-4931) __LDBL_MIN_EXP__=(-16381) __LDBL_MIN__=3.36210314311209350626267781732175260e-4932L __LONG_LONG_MAX__=0x7fffffffffffffffLL __LONG_MAX__=0x7fffffffffffffffL __LP64__=1 __ORDER_BIG_ENDIAN__=4321 __ORDER_LITTLE_ENDIAN__=1234 __ORDER_PDP_ENDIAN__=3412 __PRAGMA_REDEFINE_EXTNAME=1 __PTRDIFF_MAX__=0x7fffffffffffffffL __PTRDIFF_TYPE__=long\ int __REGISTER_PREFIX__= __SCHAR_MAX__=0x7f __SHRT_MAX__=0x7fff __SIG_ATOMIC_MAX__=0x7fffffff __SIG_ATOMIC_MIN__=(-0x7fffffff\ -\ 1) __SIG_ATOMIC_TYPE__=int __SIZEOF_DOUBLE__=8 __SIZEOF_FLOAT__=4 __SIZEOF_INT128__=16 __SIZEOF_INT__=4 __SIZEOF_LONG_DOUBLE__=16 __SIZEOF_LONG_LONG__=8 __SIZEOF_LONG__=8 __SIZEOF_POINTER__=8 __SIZEOF_PTRDIFF_T__=8 __SIZEOF_SHORT__=2 __SIZEOF_SIZE_T__=8 __SIZEOF_WCHAR_T__=4 __SIZEOF_WINT_T__=4 __SIZE_MAX__=0xffffffffffffffffUL __SIZE_TYPE__=long\ unsigned\ int __STDC_HOSTED__=1 __STDC_IEC_559__=1 __STDC_ISO_10646__=201206L __STDC_UTF_16__=1 __STDC_UTF_32__=1 __STDC__=1 __UINT16_C=__UINT16_C __UINT16_MAX__=0xffff __UINT16_TYPE__=short\ unsigned\ int __UINT32_C=__UINT32_C __UINT32_MAX__=0xffffffffU __UINT32_TYPE__=unsigned\ int __UINT64_C=__UINT64_C __UINT64_MAX__=0xffffffffffffffffUL __UINT64_TYPE__=long\ unsigned\ int __UINT8_C=__UINT8_C __UINT8_MAX__=0xff __UINT8_TYPE__=unsigned\ char __UINTMAX_C=__UINTMAX_C __UINTMAX_MAX__=0xffffffffffffffffUL __UINTMAX_TYPE__=long\ unsigned\ int __UINTPTR_MAX__=0xffffffffffffffffUL __UINTPTR_TYPE__=long\ unsigned\ int __UINT_FAST16_MAX__=0xffffffffU __UINT_FAST16_TYPE__=unsigned\ int __UINT_FAST32_MAX__=0xffffffffU __UINT_FAST32_TYPE__=unsigned\ int __UINT_FAST64_MAX__=0xffffffffffffffffUL __UINT_FAST64_TYPE__=long\ unsigned\ int __UINT_FAST8_MAX__=0xff __UINT_FAST8_TYPE__=unsigned\ char __UINT_LEAST16_MAX__=0xffff __UINT_LEAST16_TYPE__=short\ unsigned\ int __UINT_LEAST32_MAX__=0xffffffffU __UINT_LEAST32_TYPE__=unsigned\ int __UINT_LEAST64_MAX__=0xffffffffffffffffUL __UINT_LEAST64_TYPE__=long\ unsigned\ int __UINT_LEAST8_MAX__=0xff __UINT_LEAST8_TYPE__=unsigned\ char __USER_LABEL_PREFIX__= __WCHAR_MAX__=0xffffffffU __WCHAR_MIN__=0U __WCHAR_TYPE__=unsigned\ int __WINT_MAX__=0xffffffffU __WINT_MIN__=0U __WINT_TYPE__=unsigned\ int __aarch64__=1 __linux=1 __linux__=1 __unix=1 __unix__=1 linux=1 unix=1'
+d_casti32='define'
+d_double_style_ieee='define'
+d_modflproto='define'
+doublekind='3'
+fpossize='16'
+longdblkind='1'
+need_va_copy='undef'
+quadkind='2'
+
+owrt:sig_count='64'
+owrt:sigs='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS'
+owrt:sig_name_extra='IOT CLD POLL UNUSED'
+owrt:sig_num_extra='6 17 29 31'
index 75fe25460c7e2f971775ea6241d3cc718fade86c..0f94d4ee2565635165c76f4fe17536dc8b10e06b 100644 (file)
@@ -6,6 +6,7 @@ ccsymbols='__ARM_ARCH_3__=1'
 cppccsymbols=''
 cppsymbols='__ELF__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 linux=1 __linux=1 __linux__=1 unix=1 __unix=1 __unix__=1'
 d_casti32='define'
+d_double_style_ieee='define'
 d_modflproto='undef'
 doublekind='3'
 fpossize='20'
index 081300c9429a88befc8bc684535f420dff01d10c..d23a7d010b2fd89d4f29def3a5f5832ea6e8f810 100644 (file)
@@ -6,6 +6,7 @@ ccsymbols='__ARM_ARCH_3__=1'
 cppccsymbols=''
 cppsymbols='__ELF__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 linux=1 __linux=1 __linux__=1 unix=1 __unix=1 __unix__=1'
 d_casti32='define'
+d_double_style_ieee='define'
 d_modflproto='undef'
 doublekind='4'
 fpossize='20'
index edc3bd40a11665f5f81667f66680713315d38acf..7bcfc859c44ed543991e863d605768f73da5b6eb 100644 (file)
@@ -133,8 +133,17 @@ d_dlerror='define'
 d_dlopen='define'
 d_dlsymun='undef'
 d_dosuid='undef'
+d_double_has_inf='define'
+d_double_has_nan='define'
+d_double_has_negative_zero='define'
+d_double_has_subnormals='define'
+d_double_style_cray='undef'
+d_double_style_ibm='undef'
+d_double_style_ieee='define'
+d_double_style_vax='undef'
 d_drand48proto='define'
 d_dup2='define'
+d_duplocale='define'
 d_eaccess='undef'
 d_endgrent='define'
 d_endgrent_r='undef'
@@ -162,6 +171,7 @@ d_fcntl='define'
 d_fcntl_can_lock='define'
 d_fd_macros='define'
 d_fd_set='define'
+d_fdclose='undef'
 d_fdim='define'
 d_fgetpos='define'
 d_finite='define'
@@ -182,6 +192,7 @@ d_fpclassify='define'
 d_fpclassl='undef'
 d_fpgetround='undef'
 d_fpos64_t='undef'
+d_freelocale='define'
 d_frexpl='undef'
 d_fs_data_s='undef'
 d_fseeko='define'
@@ -192,6 +203,7 @@ d_fsync='define'
 d_ftello='define'
 d_ftime='undef'
 d_futimes='undef'
+d_gai_strerror='define'
 d_gdbm_ndbm_h_uses_prototypes='undef'
 d_gdbmndbm_h_uses_prototypes='undef'
 d_getaddrinfo='define'
@@ -280,6 +292,11 @@ d_lockf='define'
 d_log1p='define'
 d_log2='define'
 d_logb='define'
+d_long_double_style_ieee='undef'
+d_long_double_style_ieee_doubledouble='undef'
+d_long_double_style_ieee_extended='undef'
+d_long_double_style_ieee_std='undef'
+d_long_double_style_vax='undef'
 d_longdbl='define'
 d_longlong='define'
 d_lrint='define'
@@ -297,6 +314,7 @@ d_mbtowc='define'
 d_memchr='define'
 d_memcmp='define'
 d_memcpy='define'
+d_memmem='define'
 d_memmove='define'
 d_memset='define'
 d_mkdir='define'
@@ -329,6 +347,7 @@ d_nanosleep='define'
 d_ndbm='undef'
 d_ndbm_h_uses_prototypes='undef'
 d_nearbyint='define'
+d_newlocale='define'
 d_nextafter='define'
 d_nice='define'
 d_nl_langinfo='define'
@@ -360,6 +379,7 @@ d_pwpasswd='define'
 d_pwquota='undef'
 d_qgcvt='undef'
 d_quad='define'
+d_querylocale='undef'
 d_re_comp='undef'
 d_readdir='define'
 d_readlink='define'
@@ -431,6 +451,14 @@ d_shmctl='define'
 d_shmdt='define'
 d_shmget='define'
 d_sigaction='define'
+d_siginfo_si_addr='define'
+d_siginfo_si_band='define'
+d_siginfo_si_errno='define'
+d_siginfo_si_fd='define'
+d_siginfo_si_pid='define'
+d_siginfo_si_status='define'
+d_siginfo_si_uid='define'
+d_siginfo_si_value='define'
 d_signbit='undef'
 d_sigprocmask='define'
 d_sigsetjmp='define'
@@ -465,6 +493,7 @@ d_strcoll='define'
 d_strctcpy='define'
 d_strerrm='strerror(e)'
 d_strerror='define'
+d_strerror_l='define'
 d_strftime='define'
 d_strlcat='define'
 d_strlcpy='define'
@@ -505,6 +534,7 @@ d_uname='define'
 d_union_semun='undef'
 d_unordered='undef'
 d_unsetenv='define'
+d_uselocale='define'
 d_usleep='define'
 d_usleepproto='define'
 d_ustat='define'
@@ -533,6 +563,7 @@ db_prefixtype='size_t'
 db_version_major=''
 db_version_minor=''
 db_version_patch=''
+default_inc_excludes_dot='define'
 defvoidused='15'
 direntrytype='struct dirent'
 dlext='so'
@@ -685,6 +716,7 @@ i_values='define'
 i_varargs='undef'
 i_varhdr='stdarg.h'
 i_vfork='undef'
+i_xlocale='undef'
 ignore_versioned_solibs='y'
 inc_version_list=' '
 inc_version_list_init='0'
@@ -992,9 +1024,9 @@ full_ar="${owrt:target_cross}ar"
 cppflags="$owrt:cflags"
 ccflags="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $owrt:cflags"
 ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
-ccdlflags="-fPIC -Wl,-rpath,$owrt:perllibpath/CORE"
+ccdlflags="-fPIC -rdynamic -Wl,-rpath,$owrt:perllibpath/CORE"
 cccdlflags='-fPIC'
-ldflags=''
+ldflags="$owrt:ldflags"
 ldflags_uselargefiles=''
 lddlflags="-shared $owrt:ldflags"
 
index b44c64e2c70c2a0e21fae4d3175f7f240d794c90..1ed70395663cd512ce0b3879621366d95b912aa4 100644 (file)
@@ -6,6 +6,9 @@ ccsymbols=''
 cppccsymbols=''
 cppsymbols='__ELF__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 i386=1 __i386=1 __i386__=1 linux=1 __linux=1 __linux__=1 unix=1 __unix=1 __unix__=1'
 d_casti32='undef'
+d_double_style_ieee='define'
+d_long_double_style_ieee='define'
+d_long_double_style_ieee_extended='define'
 d_modflproto='define'
 doublekind='3'
 fpossize='20'
index 05e807b30fc44f2a908ffed2a799194205ddd051..0ed9eb1c45aa1dc5a6be2d10adc009776156bac0 100644 (file)
@@ -6,6 +6,7 @@ ccsymbols=''
 cppccsymbols=''
 cppsymbols='__ELF__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 LANGUAGE_C=1 _LANGUAGE_C=1 __LANGUAGE_C=1 __LANGUAGE_C__=1 _LARGEFILE_SOURCE=1 MIPSEL=1 _MIPSEL=1 __MIPSEL=1 __MIPSEL__=1 _MIPS_FPSET=16 _MIPS_ISA=_MIPS_ISA_MIPS1 _MIPS_SIM=1 _MIPS_SZINT=32 _MIPS_SZLONG=32 _MIPS_SZPTR=32 __PIC__=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 R3000=1 _R3000=1 __R3000=1 __R3000__=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 linux=1 __linux=1 __linux__=1 mips=1 _mips=1 __mips=1 __mips__=1 __pic__=1 unix=1 __unix=1 __unix__=1'
 d_casti32='define'
+d_double_style_ieee='define'
 d_modflproto='undef'
 doublekind='4'
 fpossize='24'
index 89875f7d2358604feb0d994dc5c310d045456484..470cb4e37494480ef2654a58d68e16be353c7735 100644 (file)
@@ -6,6 +6,8 @@ ccsymbols=''
 cppccsymbols=''
 cppsymbols=''
 d_casti32='define'
+d_double_style_ieee='define'
+d_long_double_style_ieee_doubledouble='define'
 d_modflproto='undef'
 doublekind='4'
 fpossize='24'
index d209a0de28a71ffb4575c8bef08ac4f39e6d34dd..3c5dada77b063eae8951b65a0b8f48b504b5aba9 100644 (file)
@@ -6,6 +6,7 @@ ccsymbols=''
 cppccsymbols=''
 cppsymbols='__ELF__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 LANGUAGE_C=1 _LANGUAGE_C=1 __LANGUAGE_C=1 __LANGUAGE_C__=1 _LARGEFILE_SOURCE=1 MIPSEL=1 _MIPSEL=1 __MIPSEL=1 __MIPSEL__=1 _MIPS_FPSET=16 _MIPS_ISA=_MIPS_ISA_MIPS1 _MIPS_SIM=1 _MIPS_SZINT=32 _MIPS_SZLONG=32 _MIPS_SZPTR=32 __PIC__=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 R3000=1 _R3000=1 __R3000=1 __R3000__=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 linux=1 __linux=1 __linux__=1 mips=1 _mips=1 __mips=1 __mips__=1 __pic__=1 unix=1 __unix=1 __unix__=1'
 d_casti32='define'
+d_double_style_ieee='define'
 d_modflproto='undef'
 doublekind='3'
 fpossize='24'
index 33af767fc5512c49000a77c9c6d8f1a1ad39fec2..287ce6c6364d0fb02f89d579e0794e0009f77f20 100644 (file)
@@ -6,6 +6,7 @@ ccsymbols='__gnu_linux__=1 __linux=1 __linux__=1 __unix=1 __unix__=1 system=linu
 cppccsymbols='linux=1 unix=1'
 cppsymbols='_BIG_ENDIAN=1 __BIG_ENDIAN__=1 __ELF__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 __linux=1 __linux__=1 __unix=1 __unix__=1'
 d_casti32='undef'
+d_double_style_ieee='define'
 d_modflproto='undef'
 doublekind='4'
 fpossize='24'
index 98cd2a585ef4357ccd3630c57db56e7552af18ba..c8ebd4c649ea1a928b06288b255fd5cd05ce6d50 100644 (file)
@@ -1,11 +1,11 @@
 # Set the version here
 PERL_REVISION=5
-PERL_VERSION=22
+PERL_VERSION=26
 PERL_SUBVERSION=1
 
 # (api_revison, api_version, api_subversion) = (revision, version, 0) usually
 PERL_API_REVISION=5
-PERL_API_VERSION=22
+PERL_API_VERSION=26
 PERL_API_SUBVERSION=0
 
 known_extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize Win32 Win32API/File Win32CORE XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash'
index a9cb58157370609c1fc0f5071f2d009a262b9825..ac16efc466e8f034e528494dd4705bfcad5be62f 100644 (file)
@@ -6,6 +6,9 @@ ccsymbols=''
 cppccsymbols=''
 cppsymbols='__ELF__=1 _LP64=1 __FLT_EVAL_METHOD__=0 __FXSR__=1 __GCC_ATOMIC_LLONG_LOCK_FREE=2 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8=1 __INT64_MAX__=9223372036854775807L __INT64_TYPE__=long\ int __INTMAX_MAX__=9223372036854775807L __INTMAX_TYPE__=long\ int __INTPTR_MAX__=9223372036854775807L __INTPTR_TYPE__=long\ int __INT_FAST16_MAX__=9223372036854775807L __INT_FAST16_TYPE__=long\ int __INT_FAST32_MAX__=9223372036854775807L __INT_FAST32_TYPE__=long\ int __INT_FAST64_MAX__=9223372036854775807L __INT_FAST64_TYPE__=long\ int __INT_LEAST64_MAX__=9223372036854775807L __INT_LEAST64_TYPE__=long\ int __LONG_MAX__=9223372036854775807L __LP64__=1 __MMX__=1 __PTRDIFF_MAX__=9223372036854775807L __PTRDIFF_TYPE__=long\ int __SIZEOF_INT128__=16 __SIZEOF_LONG_DOUBLE__=16 __SIZEOF_LONG__=8 __SIZEOF_POINTER__=8 __SIZEOF_PTRDIFF_T__=8 __SIZEOF_SIZE_T__=8 __SIZE_MAX__=18446744073709551615UL __SIZE_TYPE__=long\ unsigned\ int __SSE2_MATH__=1 __SSE2__=1 __SSE_MATH__=1 __SSE__=1 __UINT64_MAX__=18446744073709551615UL __UINT64_TYPE__=long\ unsigned\ int __UINTMAX_MAX__=18446744073709551615UL __UINTMAX_TYPE__=long\ unsigned\ int __UINTPTR_MAX__=18446744073709551615UL __UINTPTR_TYPE__=long\ unsigned\ int __UINT_FAST16_MAX__=18446744073709551615UL __UINT_FAST16_TYPE__=long\ unsigned\ int __UINT_FAST32_MAX__=18446744073709551615UL __UINT_FAST32_TYPE__=long\ unsigned\ int __UINT_FAST64_MAX__=18446744073709551615UL __UINT_FAST64_TYPE__=long\ unsigned\ int __UINT_LEAST64_MAX__=18446744073709551615UL __UINT_LEAST64_TYPE__=long\ unsigned\ int __WCHAR_MAX__=2147483647 __WCHAR_MIN__=(-2147483647\ -\ 1) __WCHAR_TYPE__=int __amd64=1 __amd64__=1 __code_model_small__=1 __k8=1 __k8__=1 __x86_64=1 __x86_64__=1 _FILE_OFFSET_BITS=64 __GLIBC__=2 __GLIBC_MINOR__=2 __GNUC__=3 __GNUC_MINOR__=4 __GNU_LIBRARY__=6 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=199506L _POSIX_SOURCE=1 __STDC__=1 __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_SVID=1 linux=1 __linux=1 __linux__=1 unix=1 __unix=1 __unix__=1'
 d_casti32='undef'
+d_double_style_ieee='define'
+d_long_double_style_ieee='define'
+d_long_double_style_ieee_extended='define'
 d_modflproto='define'
 doublekind='3'
 fpossize='16'
diff --git a/lang/perl/patches/020-host-libc-dir-moved-debian+derivatives.patch b/lang/perl/patches/020-host-libc-dir-moved-debian+derivatives.patch
deleted file mode 100644 (file)
index 956466d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
---- a/hints/linux.sh
-+++ b/hints/linux.sh
-@@ -221,6 +221,24 @@ case "$libc" in
-     ;;
- esac
-+# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries
-+# (such as -lm) in /lib or /usr/lib.  So we have to ask gcc to tell us
-+# where to look.  We don't want gcc's own libraries, however, so we
-+# filter those out.
-+# This could be conditional on Unbuntu, but other distributions may
-+# follow suit, and this scheme seems to work even on rather old gcc's.
-+# This unconditionally uses gcc because even if the user is using another
-+# compiler, we still need to find the math library and friends, and I don't
-+# know how other compilers will cope with that situation.
-+# Still, as an escape hatch, allow Configure command line overrides to
-+# plibpth to bypass this check.
-+case "$plibpth" in
-+'') plibpth=`gcc -print-search-dirs | grep libraries |
-+      cut -f2- -d= | tr ':' $trnl | grep -v 'gcc'`
-+    plibpth="$plibpth"  # Collapse all entries on one line
-+    ;;
-+esac
-+
- # Are we using ELF?  Thanks to Kenneth Albanowski <kjahds@kjahds.com>
- # for this test.
- cat >try.c <<'EOM'
index 9f9f812197d35467f2f32a9c18ea4bde6a8c48b4..147c2d38faa5d471266332760f63154fbe0d1328 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Makefile.SH
 +++ b/Makefile.SH
-@@ -316,22 +316,11 @@ MANIFEST_SRT = MANIFEST.srt
+@@ -334,22 +334,11 @@ MANIFEST_SRT = MANIFEST.srt
  
  !GROK!THIS!
  
@@ -17,8 +17,8 @@
 +$spitshell >>$Makefile <<!GROK!THIS!
  # Macros to invoke a copy of our fully operational perl during the build.
  PERL_EXE = perl\$(EXE_EXT)
--RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT) -Ilib
-+RUN_PERL = \$(LDLIBPTH) \$(RUN) ./miniperl\$(EXE_EXT) -Ilib
+-RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT) -Ilib -I.
++RUN_PERL = \$(LDLIBPTH) \$(RUN) ./miniperl\$(EXE_EXT) -Ilib -I.
  !GROK!THIS!
 -      ;;
 -esac
diff --git a/lang/perl/patches/120-remove-build-timestamp.patch b/lang/perl/patches/120-remove-build-timestamp.patch
new file mode 100644 (file)
index 0000000..d20345e
--- /dev/null
@@ -0,0 +1,21 @@
+Index: perl-5.26.1/perl.c
+===================================================================
+--- perl-5.26.1.orig/perl.c
++++ perl-5.26.1/perl.c
+@@ -1870,16 +1870,6 @@ S_Internals_V(pTHX_ CV *cv)
+     PUSHs(Perl_newSVpvn_flags(aTHX_ non_bincompat_options,
+                             sizeof(non_bincompat_options) - 1, SVs_TEMP));
+-#ifndef PERL_BUILD_DATE
+-#  ifdef __DATE__
+-#    ifdef __TIME__
+-#      define PERL_BUILD_DATE __DATE__ " " __TIME__
+-#    else
+-#      define PERL_BUILD_DATE __DATE__
+-#    endif
+-#  endif
+-#endif
+-
+ #ifdef PERL_BUILD_DATE
+     PUSHs(Perl_newSVpvn_flags(aTHX_
+                             STR_WITH_LEN("Compiled at " PERL_BUILD_DATE),
diff --git a/lang/perl/patches/310-recompile-hack.patch b/lang/perl/patches/310-recompile-hack.patch
deleted file mode 100644 (file)
index 05a8e9b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-perl: Work around recompile failures
-
-Apparently, recompiling/relinking fails under some circumstances. This
-patch has been reported to work around that issue.
-
---- a/Makefile.SH
-+++ b/Makefile.SH
-@@ -818,7 +818,7 @@ $(LIBPERL): $& $(obj) $(DYNALOADER) $(LI
-       true)
-               $spitshell >>$Makefile <<'!NO!SUBS!'
-       rm -f $@
--      $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs)
-+      $(CC) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs)
- !NO!SUBS!
-               case "$osname" in
-               aix)
diff --git a/lang/perl/patches/320-copy-pod-hack.patch b/lang/perl/patches/320-copy-pod-hack.patch
new file mode 100644 (file)
index 0000000..9afb8a8
--- /dev/null
@@ -0,0 +1,42 @@
+--- a/cpan/podlators/Makefile.PL
++++ b/cpan/podlators/Makefile.PL
+@@ -18,6 +18,19 @@ use Config;
+ use ExtUtils::MakeMaker;
+ use File::Spec;
++foreach (glob('scripts/pod*.PL')) {
++    # The various pod*.PL extractors change directory. Doing that with relative
++    # paths in @INC breaks. It seems the lesser of two evils to copy (to avoid)
++    # the chdir doing anything, than to attempt to convert lib paths to
++    # absolute, and potentially run into problems with quoting special
++    # characters in the path to our build dir (such as spaces)
++    require File::Copy;
++
++    my $temp = $_;
++    $temp =~ s!scripts/!!;
++    File::Copy::copy($_, $temp) or die "Can't copy $temp to $_: $!";
++}
++
+ # Generate full paths for scripts distributed in the bin directory.  Appends
+ # the .com extension to scripts on VMS, unless they already have the .PL
+ # extension.
+@@ -28,7 +41,7 @@ use File::Spec;
+ #          (Scalar) Space-separated relative paths from top of distribution
+ sub scripts {
+     my (@scripts) = @_;
+-    my @paths = map { File::Spec->catfile('scripts', $_) } @scripts;
++    my @paths = @scripts;
+     if ($^O eq 'VMS') {
+         @paths = map { m{ [.] PL \z }xms ? $_ : $_ . '.com' } @paths;
+     }
+@@ -77,8 +90,8 @@ my %metadata = (
+     # Override the files that generate section 1 man pages.
+     MAN1PODS => {
+-        man1pod('scripts', 'pod2man.PL'),
+-        man1pod('scripts', 'pod2text.PL'),
++        man1pod('.', 'pod2man.PL'),
++        man1pod('.', 'pod2text.PL'),
+         # Perl core uses a separate copy in the top-level pod directory.
+         ($ENV{PERL_CORE} ? () : man1pod('pod', 'perlpodstyle.pod')),
diff --git a/lang/perl/patches/700-tie_fetch_count_t-handle_missing_crypt.patch b/lang/perl/patches/700-tie_fetch_count_t-handle_missing_crypt.patch
deleted file mode 100644 (file)
index f90e5d9..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/t/op/tie_fetch_count.t
-+++ b/t/op/tie_fetch_count.t
-@@ -250,12 +250,17 @@ for ([chdir=>''],[chmod=>'0,'],[chown=>'
-     check_count "$op $args\\\$tied_glob$postargs";
- }
--$dummy  =   crypt $var,0; check_count 'crypt $tied, ...';
--$dummy  =   crypt 0,$var; check_count 'crypt ..., $tied';
--$var = substr(chr 256,0,0);
--$dummy  =   crypt $var,0; check_count 'crypt $tied_utf8, ...';
--$var = substr(chr 256,0,0);
--$dummy  =   crypt 0,$var; check_count 'crypt ..., $tied_utf8';
-+SKIP: {
-+    use Config;
-+    skip "crypt() is unavailable", 4, unless defined $Config{'d_crypt'};
-+
-+    $dummy  =   crypt $var,0; check_count 'crypt $tied, ...';
-+    $dummy  =   crypt 0,$var; check_count 'crypt ..., $tied';
-+    $var = substr(chr 256,0,0);
-+    $dummy  =   crypt $var,0; check_count 'crypt $tied_utf8, ...';
-+    $var = substr(chr 256,0,0);
-+    $dummy  =   crypt 0,$var; check_count 'crypt ..., $tied_utf8';
-+}
- SKIP:
- {
diff --git a/lang/perl/patches/900-CVE-2015-8607.patch b/lang/perl/patches/900-CVE-2015-8607.patch
deleted file mode 100644 (file)
index 5f1c1cb..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-From b6307f728a4f842a54ea96959e386c7daa92ece1 Mon Sep 17 00:00:00 2001
-From: Tony Cook <tony@develop-help.com>
-Date: Tue, 15 Dec 2015 10:56:54 +1100
-Subject: [perl #126862] ensure File::Spec::canonpath() preserves taint
-
-Previously the unix specific XS implementation of canonpath() would
-return an untainted path when supplied a tainted path.
-
-For the empty string case, newSVpvs() already sets taint as needed on
-its result.
----
- dist/PathTools/Cwd.xs    |  1 +
- dist/PathTools/t/taint.t | 19 ++++++++++++++++++-
- 2 files changed, 19 insertions(+), 1 deletion(-)
-
---- a/dist/PathTools/Cwd.xs
-+++ b/dist/PathTools/Cwd.xs
-@@ -535,6 +535,7 @@ THX_unix_canonpath(pTHX_ SV *path)
-     *o = 0;
-     SvPOK_on(retval);
-     SvCUR_set(retval, o - SvPVX(retval));
-+    SvTAINT(retval);
-     return retval;
- }
---- a/dist/PathTools/t/taint.t
-+++ b/dist/PathTools/t/taint.t
-@@ -12,7 +12,7 @@ use Test::More;
- BEGIN {
-     plan(
-         ${^TAINT}
--        ? (tests => 17)
-+        ? (tests => 21)
-         : (skip_all => "A perl without taint support")
-     );
- }
-@@ -34,3 +34,20 @@ foreach my $func (@Functions) {
- # Previous versions of Cwd tainted $^O
- is !tainted($^O), 1, "\$^O should not be tainted";
-+
-+{
-+    # [perl #126862] canonpath() loses taint
-+    my $tainted = substr($ENV{PATH}, 0, 0);
-+    # yes, getcwd()'s result should be tainted, and is tested above
-+    # but be sure
-+    ok tainted(File::Spec->canonpath($tainted . Cwd::getcwd)),
-+        "canonpath() keeps taint on non-empty string";
-+    ok tainted(File::Spec->canonpath($tainted)),
-+        "canonpath() keeps taint on empty string";
-+
-+    (Cwd::getcwd() =~ /^(.*)/);
-+    my $untainted = $1;
-+    ok !tainted($untainted), "make sure our untainted value is untainted";
-+    ok !tainted(File::Spec->canonpath($untainted)),
-+        "canonpath() doesn't add taint to untainted string";
-+}
diff --git a/lang/perl/patches/900-use-rm-force.patch b/lang/perl/patches/900-use-rm-force.patch
new file mode 100644 (file)
index 0000000..da79f7a
--- /dev/null
@@ -0,0 +1,285 @@
+--- a/Makefile.SH      2017-10-17 11:59:52.938763142 -0600
++++ b/Makefile.SH      2017-10-17 12:13:46.202555604 -0600
+@@ -270,6 +270,7 @@ LNS = $lns
+ # NOTE: some systems don't grok "cp -f". XXX Configure test needed?
+ CPS = $cp
+ RMS = rm -f
++RMS_R = rm -rf
+ ranlib = $ranlib
+ # The following are mentioned only to make metaconfig include the
+@@ -731,7 +731,7 @@ bitcount.h: generate_uudmap$(HOST_EXE_EX
+       ./generate_uudmap$(HOST_EXE_EXT) $(generated_headers)
+ generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
+-      -@rm generate_uudmap$(HOST_EXE_EXT)
++      @$(RMS) generate_uudmap$(HOST_EXE_EXT)
+       $(LNS) $(HOST_GENERATE) generate_uudmap$(HOST_EXE_EXT)
+ !NO!SUBS!
+@@ -871,26 +872,26 @@ mydtrace.h: $(DTRACE_H)
+       define)
+               $spitshell >>$Makefile <<'!NO!SUBS!'
+ $(DTRACE_MINI_O): perldtrace.d $(miniperl_objs_nodt)
+-      -rm -rf mpdtrace
++      $(RMS_R) mpdtrace
+       mkdir mpdtrace
+       cp $(miniperl_objs_nodt) mpdtrace/
+       $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MINI_O) $(miniperl_dtrace_objs)
+ $(DTRACE_PERLLIB_O): perldtrace.d $(perllib_objs_nodt)
+-      -rm -rf libpdtrace
++      $(RMS_R) libpdtrace
+       mkdir libpdtrace
+       cp $(perllib_objs_nodt) libpdtrace/
+       $(DTRACE) -G -s perldtrace.d -o $(DTRACE_PERLLIB_O) $(perllib_dtrace_objs)
+ $(DTRACE_MAIN_O): perldtrace.d perlmain$(OBJ_EXT)
+-      -rm -rf maindtrace
++      $(RMS_R) maindtrace
+       mkdir maindtrace
+       cp perlmain$(OBJ_EXT) maindtrace/
+       $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MAIN_O) $(perlmain_dtrace_objs) ||           \
+         ( $(ECHO) "No probes in perlmain$(OBJ_EXT), generating a dummy $(DTRACE_MAIN_O)" && \
+           $(ECHO) >dtrace_main.c &&                                                         \
+           `$(CCCMD)` $(PLDLFLAGS) dtrace_main.c &&                                          \
+-           rm -f dtrace_main.c )
++           $(RMS) dtrace_main.c )
+ !NO!SUBS!
+               ;;
+@@ -901,13 +902,13 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD
+       case "$useshrplib" in
+       true)
+               $spitshell >>$Makefile <<'!NO!SUBS!'
+-      rm -f $@
++      $(RMS) $@
+       $(LD) -o $@ $(SHRPLDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs)
+ !NO!SUBS!
+               case "$osname" in
+               aix)
+                       $spitshell >>$Makefile <<'!NO!SUBS!'
+-      rm -f libperl$(OBJ_EXT)
++      $(RMS) libperl$(OBJ_EXT)
+       mv $@ libperl$(OBJ_EXT)
+       $(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
+ !NO!SUBS!
+@@ -916,7 +917,7 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD
+               ;;
+       *)
+               $spitshell >>$Makefile <<'!NO!SUBS!'
+-      rm -f $(LIBPERL)
++      $(RMS) $(LIBPERL)
+       $(AR) rc $(LIBPERL) $(perllib_objs) $(DYNALOADER)
+       @$(ranlib) $(LIBPERL)
+ !NO!SUBS!
+@@ -949,7 +950,7 @@ $(MINIPERL_EXE): lib/buildcustomize.pl
+       amigaos*)
+               $spitshell >>$Makefile <<'!NO!SUBS!'
+ lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
+-      -@rm -f miniperl.xok
++      @$(RMS) miniperl.xok
+       $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+           $(miniperl_objs) $(libs)
+ #     $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
+@@ -987,7 +988,7 @@ NAMESPACEFLAGS = -force_flat_namespace
+               esac
+               $spitshell >>$Makefile <<'!NO!SUBS!'
+ lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
+-      -@rm -f miniperl.xok
++      @$(RMS) miniperl.xok
+       $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
+           $(miniperl_objs) $(libs)
+       $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
+@@ -998,8 +999,8 @@ lib/buildcustomize.pl: $& $(miniperl_obj
+               if test "X$hostperl" != X; then
+                       $spitshell >>$Makefile <<!GROK!THIS!
+ lib/buildcustomize.pl: \$& \$(miniperl_dep) write_buildcustomize.pl
+-      -@rm -f miniperl.xok
+-      -@rm \$(MINIPERL_EXE)
++      @\$(RMS) miniperl.xok
++      @\$(RMS) \$(MINIPERL_EXE)
+       \$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE)
+       \$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
+       \$(MINIPERL) -f write_buildcustomize.pl 'osname' "$osname"
+@@ -1007,7 +1008,7 @@ lib/buildcustomize.pl: \$& \$(miniperl_d
+               else
+                       $spitshell >>$Makefile <<'!NO!SUBS!'
+ lib/buildcustomize.pl: $& $(miniperl_dep) write_buildcustomize.pl
+-      -@rm -f miniperl.xok
++      @$(RMS) miniperl.xok
+       $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+           $(miniperl_objs) $(libs)
+       $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
+@@ -1020,7 +1021,7 @@ lib/buildcustomize.pl: $& $(miniperl_dep
+       $spitshell >>$Makefile <<'!NO!SUBS!'
+ $(PERL_EXE): $& $(perlmain_dep) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) write_buildcustomize.pl
+-      -@rm -f miniperl.xok
++      @$(RMS) miniperl.xok
+ !NO!SUBS!
+         case $osname in
+@@ -1114,8 +1115,8 @@ pod/perl5261delta.pod: pod/perldelta.pod
+       $(LNS) perldelta.pod pod/perl5261delta.pod
+ extra.pods: $(MINIPERL_EXE)
+-      -@test ! -f extra.pods || rm -f `cat extra.pods`
+-      -@rm -f extra.pods
++      -@test ! -f extra.pods || $(RMS) `cat extra.pods`
++      @$(RMS) extra.pods
+       -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
+           nx=`echo $$x | sed -e "s/README\.//"`; \
+           $(LNS) ../$$x "pod/perl"$$nx".pod" ; \
+@@ -1332,11 +1333,11 @@ realclean:     _realcleaner _mopup
+       @echo "Note that '$(MAKE) realclean' does not delete config.sh or Policy.sh"
+ _clobber:
+-      -@rm -f Cross/run-* Cross/to-* Cross/from-* Cross/mkdir
+-      -rm -rf host
+-      rm -f t/test_state
+-      rm -f config.sh cppstdin Policy.sh extras.lst
+-      rm -f $(MANIFEST_SRT)
++      @$(RMS) Cross/run-* Cross/to-* Cross/from-* Cross/mkdir
++      $(RMS_R) host
++      $(RMS) t/test_state
++      $(RMS) config.sh cppstdin Policy.sh extras.lst
++      $(RMS) $(MANIFEST_SRT)
+ clobber:      _realcleaner _mopup _clobber
+@@ -1344,23 +1345,23 @@ distclean:     clobber
+ # Like distclean but also removes emacs backups and *.orig.
+ veryclean:    _verycleaner _mopup _clobber
+-      -@rm -f Obsolete Wanted
++      $(RMS) Obsolete Wanted
+ # Do not 'make _mopup' directly.
+ _mopup:
+-      rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c perlmini.c generate_uudmap$(EXE_EXT) $(generated_headers)
++      $(RMS) *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c perlmini.c generate_uudmap$(EXE_EXT) $(generated_headers)
+       -rmdir .depending
+-      -@test -f extra.pods && rm -f `cat extra.pods`
+-      -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod
+-      -rm -f perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o pod/roffitall
+-      -rm -f perl.export perl.dll perl.libexp perl.map perl.def
+-      -rm -f *perl.xok
+-      -rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump
+-      -rm -f $(PERL_EXE) $(MINIPERL_EXE) $(LIBPERL) libperl.* microperl
+-      -rm -f config.arch config.over $(DTRACE_H)
++      -@test -f extra.pods && $(RMS) `cat extra.pods`
++      -@test -f vms/README_vms.pod && $(RMS) vms/README_vms.pod
++      $(RMS) perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o pod/roffitall
++      $(RMS) perl.export perl.dll perl.libexp perl.map perl.def
++      $(RMS) *perl.xok
++      $(RMS) cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump
++      $(RMS) $(PERL_EXE) $(MINIPERL_EXE) $(LIBPERL) libperl.* microperl
++      $(RMS) config.arch config.over $(DTRACE_H)
+ _cleaner1:
+-      -cd os2; rm -f Makefile
++      -cd os2; $(RMS) Makefile
+       -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN)
+       -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN)
+       -@if test -f $(MINIPERL_EXE) ; then \
+@@ -1370,31 +1371,31 @@ _cleaner1:
+       else \
+       sh $(CLEAN).sh ; \
+       fi
+-      rm -f realclean.sh veryclean.sh
+-      -rm -f `grep -v ^# mkppport.lst | grep . | sed -e 's/$$/\/ppport.h/'`
++      $(RMS) realclean.sh veryclean.sh
++      $(RMS) `grep -v ^# mkppport.lst | grep . | sed -e 's/$$/\/ppport.h/'`
+ # Dear POSIX, thanks for making the default to xargs to be
+ # run once if nothhing is passed in. It is such a great help.
+ # Some systems do not support "?", so keep these files separate.
+ _cleaner2:
+-      -rm -f core.*perl.*.? t/core.perl.*.? .?*.c
+-      rm -f core *perl.core t/core t/*perl.core core.* t/core.*
+-      rm -f t/$(PERL_EXE) t/rantests
+-      rm -rf t/tmp*
+-      rm -rf $(addedbyconf)
+-      rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old utils/Makefile
+-      rm -f $(private)
+-      rm -rf $(unidatafiles) $(unidatadirs)
+-      rm -rf lib/auto
+-      rm -f lib/.exists lib/*/.exists lib/*/*/.exists
+-      rm -f h2ph.man
+-      rm -rf .config
+-      rm -f preload
+-      rm -f pod2htmd.tmp
+-      rm -rf pod/perlfunc pod/perlipc
++      $(RMS) core.*perl.*.? t/core.perl.*.? .?*.c
++      $(RMS) core *perl.core t/core t/*perl.core core.* t/core.*
++      $(RMS) t/$(PERL_EXE) t/rantests
++      $(RMS_R) t/tmp*
++      $(RMS_R) $(addedbyconf)
++      $(RMS) $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old utils/Makefile
++      $(RMS) $(private)
++      $(RMS_R) $(unidatafiles) $(unidatadirs)
++      $(RMS_R) lib/auto
++      $(RMS) lib/.exists lib/*/.exists lib/*/*/.exists
++      $(RMS) h2ph.man
++      $(RMS_R) .config
++      $(RMS) preload
++      $(RMS) pod2htmd.tmp
++      $(RMS_R) pod/perlfunc pod/perlipc
+       -rmdir ext/B/lib
+-      rm -f so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
++      $(RMS) so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
+       -rmdir lib/version lib/threads lib/inc/ExtUtils lib/inc lib/encoding
+       -rmdir lib/autodie/exception lib/autodie/Scope lib/autodie lib/XS
+       -rmdir lib/Win32API lib/VMS lib/Unicode/Collate/Locale
+@@ -1443,11 +1444,11 @@ _realcleaner:
+ _verycleaner:
+       @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean
+       @$(LDLIBPTH) $(MAKE) _cleaner2
+-      -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig
++      $(RMS) *~ *.orig */*~ */*.orig */*/*~ */*/*.orig
+ .PHONY: lint
+ lint: $(c)
+-      rm -f *.ln
++      $(RMS) *.ln
+       lint $(lintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(c)
+ cscopeflags = -Rb  # Recursive, build-only.
+@@ -1505,7 +1506,7 @@ case "$targethost" in
+ '') $spitshell >>$Makefile <<'!NO!SUBS!'
+ test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
+       $(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods)
+-      cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
++      cd t && ($(RMS) $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
+ !NO!SUBS!
+ ;;
+@@ -1555,7 +1556,7 @@ test_prep test-prep: test_prep_pre \$(MI
+       $to config.sh
+ # --- For lib/diagnostics.t with -Duseshrplib
+       $to \$(PERL_EXE)
+-      cd t && (rm -f \$(PERL_EXE); \$(LNS) ../\$(PERL_EXE) \$(PERL_EXE)) && cd ..
++      cd t && (\$(RMS) \$(PERL_EXE); \$(LNS) ../\$(PERL_EXE) \$(PERL_EXE)) && cd ..
+       $to t/\$(PERL_EXE)
+ !GROK!THIS!
+@@ -1565,7 +1566,7 @@ esac
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
+       $(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
+-      cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
++      cd t && ($(RMS) $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
+ !NO!SUBS!
+ case "$targethost" in
+@@ -1620,7 +1621,7 @@ minitest_prep:
+       @echo "You may see some irrelevant test failures if you have been unable"
+       @echo "to build lib/Config.pm, or the Unicode data files."
+       @echo " "
+-      - cd t && (rm -f $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE))
++      - cd t && ($(RMS) $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE))
+ MINITEST_TESTS = base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t opbasic/*.t op/*.t uni/*.t perf/*.t
diff --git a/lang/perl/patches/901-CVE-2016-2381.patch b/lang/perl/patches/901-CVE-2016-2381.patch
deleted file mode 100644 (file)
index ee5db6c..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-From: Tony Cook <tony@develop-help.com>
-Date: Wed, 27 Jan 2016 00:52:15 +0000 (+1100)
-Subject: remove duplicate environment variables from environ
-X-Git-Url: http://perl5.git.perl.org/perl.git/commitdiff_plain/ae37b791a73a9e78dedb89fb2429d2628cf58076
-
-remove duplicate environment variables from environ
-
-If we see duplicate environment variables while iterating over
-environ[]:
-
-a) make sure we use the same value in %ENV that getenv() returns.
-
-Previously on a duplicate, %ENV would have the last entry for the name
-from environ[], but a typical getenv() would return the first entry.
-
-Rather than assuming all getenv() implementations return the first entry
-explicitly call getenv() to ensure they agree.
-
-b) remove duplicate entries from environ
-
-Previously if there was a duplicate definition for a name in environ[]
-setting that name in %ENV could result in an unsafe value being passed
-to a child process, so ensure environ[] has no duplicates.
-
-CVE-2016-2381
----
-
---- a/perl.c
-+++ b/perl.c
-@@ -4298,23 +4298,70 @@ S_init_postdump_symbols(pTHX_ int argc,
-       }
-       if (env) {
-         char *s, *old_var;
-+          STRLEN nlen;
-         SV *sv;
-+          HV *dups = newHV();
-+
-         for (; *env; env++) {
-           old_var = *env;
-           if (!(s = strchr(old_var,'=')) || s == old_var)
-               continue;
-+            nlen = s - old_var;
- #if defined(MSDOS) && !defined(DJGPP)
-           *s = '\0';
-           (void)strupr(old_var);
-           *s = '=';
- #endif
--          sv = newSVpv(s+1, 0);
--          (void)hv_store(hv, old_var, s - old_var, sv, 0);
-+            if (hv_exists(hv, old_var, nlen)) {
-+                const char *name = savepvn(old_var, nlen);
-+
-+                /* make sure we use the same value as getenv(), otherwise code that
-+                   uses getenv() (like setlocale()) might see a different value to %ENV
-+                 */
-+                sv = newSVpv(PerlEnv_getenv(name), 0);
-+
-+                /* keep a count of the dups of this name so we can de-dup environ later */
-+                if (hv_exists(dups, name, nlen))
-+                    ++SvIVX(*hv_fetch(dups, name, nlen, 0));
-+                else
-+                    (void)hv_store(dups, name, nlen, newSViv(1), 0);
-+
-+                Safefree(name);
-+            }
-+            else {
-+                sv = newSVpv(s+1, 0);
-+            }
-+          (void)hv_store(hv, old_var, nlen, sv, 0);
-           if (env_is_not_environ)
-               mg_set(sv);
-         }
-+          if (HvKEYS(dups)) {
-+              /* environ has some duplicate definitions, remove them */
-+              HE *entry;
-+              hv_iterinit(dups);
-+              while ((entry = hv_iternext_flags(dups, 0))) {
-+                  STRLEN nlen;
-+                  const char *name = HePV(entry, nlen);
-+                  IV count = SvIV(HeVAL(entry));
-+                  IV i;
-+                  SV **valp = hv_fetch(hv, name, nlen, 0);
-+
-+                  assert(valp);
-+
-+                  /* try to remove any duplicate names, depending on the
-+                   * implementation used in my_setenv() the iteration might
-+                   * not be necessary, but let's be safe.
-+                   */
-+                  for (i = 0; i < count; ++i)
-+                      my_setenv(name, 0);
-+
-+                  /* and set it back to the value we set $ENV{name} to */
-+                  my_setenv(name, SvPV_nolen(*valp));
-+              }
-+          }
-+          SvREFCNT_dec_NN(dups);
-       }
- #endif /* USE_ENVIRON_ARRAY */
- #endif /* !PERL_MICRO */
diff --git a/lang/perl/patches/910-miniperl-needs-inc-dot.patch b/lang/perl/patches/910-miniperl-needs-inc-dot.patch
new file mode 100644 (file)
index 0000000..02e447a
--- /dev/null
@@ -0,0 +1,80 @@
+--- a/Makefile.SH      2017-10-15 18:57:08.436234652 -0600
++++ b/Makefile.SH      2017-10-15 19:02:47.587658819 -0600
+@@ -327,7 +327,7 @@ PATH_SEP = $p_
+ # Macros to invoke a copy of miniperl during the build.  Targets which
+ # are built using these macros should depend on \$(MINIPERL_EXE)
+ MINIPERL_EXE = miniperl\$(EXE_EXT)
+-MINIPERL = \$(LDLIBPTH) ./miniperl\$(EXE_EXT) -Ilib
++MINIPERL = \$(LDLIBPTH) ./miniperl\$(EXE_EXT) -Ilib -I.
+ # Macros to invoke sort the MANIFEST during build
+ MANIFEST_SRT = MANIFEST.srt
+@@ -990,7 +990,7 @@ NAMESPACEFLAGS = -force_flat_namespace
+       @$(RMS) miniperl.xok
+       $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
+           $(miniperl_objs) $(libs)
+-      $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
++      $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -I. -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
+       $(MINIPERL) -f write_buildcustomize.pl
+ !NO!SUBS!
+               ;;
+@@ -1001,16 +1001,16 @@ lib/buildcustomize.pl: $& $(miniperl_obj
+       @\$(RMS) miniperl.xok
+       @\$(RMS) \$(MINIPERL_EXE)
+       \$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE)
+-      \$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
++      \$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -I. -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
+       \$(MINIPERL) -f write_buildcustomize.pl 'osname' "$osname"
+ !GROK!THIS!
+               else
+                       $spitshell >>$Makefile <<'!NO!SUBS!'
+ lib/buildcustomize.pl: $& $(miniperl_dep) write_buildcustomize.pl
+       @$(RMS) miniperl.xok
+       $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+           $(miniperl_objs) $(libs)
+-      $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
++      $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -I. -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
+       $(MINIPERL) -f write_buildcustomize.pl
+ !NO!SUBS!
+               fi
+--- a/cpan/Devel-PPPort/PPPort_pm.PL   2017-07-18 16:59:59.000000000 -0600
++++ b/cpan/Devel-PPPort/PPPort_pm.PL   2017-10-15 19:19:27.341543182 -0600
+@@ -15,6 +15,7 @@
+ use strict;
+ $^W = 1;
++push(@INC, '.');
+ require "parts/ppptools.pl";
+ my $INCLUDE = 'parts/inc';
+--- a/cpan/Devel-PPPort/ppport_h.PL    2017-07-18 16:59:59.000000000 -0600
++++ b/cpan/Devel-PPPort/ppport_h.PL    2017-10-15 19:27:16.594178623 -0600
+@@ -14,6 +14,7 @@
+ ################################################################################
+ package Devel::PPPort;
++push(@INC, '.');
+ require "PPPort.pm";
+ rename 'ppport.h', 'ppport.old' if -f 'ppport.h';
+ unlink "ppport.old" if WriteFile("ppport.h") && -f 'ppport.h';
+--- a/cpan/Devel-PPPort/PPPort_xs.PL   2017-07-18 16:59:59.000000000 -0600
++++ b/cpan/Devel-PPPort/PPPort_xs.PL   2017-10-15 19:38:09.296679968 -0600
+@@ -15,6 +15,7 @@
+ use strict;
+ $^W = 1;
++push(@INC, '.');
+ require "parts/ppptools.pl";
+ my %SECTION = (
+--- a/cpan/Unicode-Collate/Makefile.PL 2017-07-18 16:49:51.000000000 -0600
++++ b/cpan/Unicode-Collate/Makefile.PL 2017-10-15 20:19:31.890439791 -0600
+@@ -6,7 +6,7 @@ my $clean = {};
+ if (-f "Collate.xs") {
+     print "Making header files for XS...\n";
+-    do 'mkheader' or die $@ || "mkheader: $!";
++    do './mkheader' or die $@ || "mkheader: $!";
+     $clean = { FILES => 'ucatbl.h' };
+ }
index be566087cdabd896d855c15fcbad410b09aeffed..551d4532b19891aa4aa163ee068bcbeac7ae7af6 100644 (file)
@@ -1,7 +1,7 @@
 # This makefile simplifies perl module builds.
 #
 
-PERL_VERSION:=5.22
+PERL_VERSION:=5.26
 
 # Build environment
 HOST_PERL_PREFIX:=$(STAGING_DIR_HOSTPKG)/usr
@@ -55,9 +55,10 @@ endef
 
 define perlmod/Configure
        (cd $(if $(3),$(3),$(PKG_BUILD_DIR)); \
-       PERL_MM_USE_DEFAULT=1 \
-       $(2) \
-       $(PERL_CMD) -MConfig -e '$$$${tied %Config::Config}{cpprun}="$(GNU_TARGET_NAME)-cpp -E"; do "Makefile.PL"' \
+        (echo -e 'use Config;\n\n$$$${tied %Config::Config}{cpprun}="$(GNU_TARGET_NAME)-cpp -E";\n' ; cat Makefile.PL) | \
+        PERL_MM_USE_DEFAULT=1 \
+        $(2) \
+        $(PERL_CMD) -I. -- - \
                $(1) \
                AR=ar \
                CC=$(GNU_TARGET_NAME)-gcc \
@@ -103,8 +104,8 @@ define perlmod/Configure
                INSTALLVENDORMAN3DIR=" " \
                LINKTYPE=dynamic \
                DESTDIR=$(PKG_INSTALL_DIR) \
-       );
-       sed 's!^PERL_INC = .*!PERL_INC = $(STAGING_DIR)/usr/lib/perl5/$(PERL_VERSION)/CORE/!' -i $(if $(3),$(3),$(PKG_BUILD_DIR))/Makefile
+       )
+       sed -i -e 's!^PERL_INC = .*!PERL_INC = $(STAGING_DIR)/usr/lib/perl5/$(PERL_VERSION)/CORE/!' $(if $(3),$(3),$(PKG_BUILD_DIR))/Makefile
 endef
 
 define perlmod/Compile
index 9c1d52e00ee689d9f60db6815b6529292e05dc51..ae29b2841388f0d322b227019144987fa0419ffc 100644 (file)
@@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk
 PECL_NAME:=dio
 PECL_LONGNAME:=Direct I/O functions
 
-PKG_VERSION:=0.0.9
+PKG_VERSION:=0.1.0
 PKG_RELEASE:=1
-PKG_MD5SUM:=2c80b63fbbbaead856cb468955c14dc328d1262621b0c704b122d902053c8156
+PKG_HASH:=aab985e374604379d99c9c93207f2c2959ff141740d1a648c0fbd07e0e08a73e
 
 PKG_NAME:=php7-pecl-$(PECL_NAME)
 PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
index be9267a742066946f2b63a89de97ddbb82c5e9cc..15d47a891c129fe7f5d054e11704759b3413d726 100644 (file)
@@ -9,8 +9,8 @@ PECL_NAME:=pecl_http
 PECL_LONGNAME:=Extended HTTP Support
 
 PKG_VERSION:=3.1.0
-PKG_RELEASE:=2
-PKG_MD5SUM:=e3de67b156e7d5f6c2e5eb1e2b5f0acceb7004f1260d68c9f8b2c0f9629aabf0
+PKG_RELEASE:=4
+PKG_HASH:=e3de67b156e7d5f6c2e5eb1e2b5f0acceb7004f1260d68c9f8b2c0f9629aabf0
 
 PKG_NAME:=php7-pecl-http
 PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
@@ -53,5 +53,5 @@ CONFIGURE_ARGS+= \
        --with-http-libevent-dir="$(STAGING_DIR)/usr" \
        --with-http-libidn-dir="$(STAGING_DIR)/usr"
 
-$(eval $(call PECLPackage,http,$(PECL_LONGNAME),+icu +libcurl +librt +libevent2 +libidn +php7-mod-iconv +php7-mod-session +php7-pecl-raphf +php7-pecl-propro,30))
+$(eval $(call PECLPackage,http,$(PECL_LONGNAME),+icu +libcurl +librt +libevent2 +libidn +php7-mod-hash +php7-mod-iconv +php7-mod-session +php7-pecl-raphf +php7-pecl-propro,30))
 $(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/lang/php7-pecl-http/patches.old/100_config9-m4.patch b/lang/php7-pecl-http/patches.old/100_config9-m4.patch
deleted file mode 100644 (file)
index 304a1df..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/config9.m4       2016-09-08 21:39:18.000000000 +0200
-+++ b/config9.m4       2016-09-08 21:42:35.066903251 +0200
-@@ -71,18 +71,7 @@
-               extname=$1
-               haveext=$[PHP_]translit($1,a-z_-,A-Z__)
-               AC_MSG_CHECKING([for ext/$extname support])
--              if test -x "$PHP_EXECUTABLE"; then
--                      grepext=`$PHP_EXECUTABLE -m | $EGREP ^$extname\$`
--                      if test "$grepext" = "$extname"; then
--                              [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1
--                              AC_MSG_RESULT([yes])
--                              $2
--                      else
--                              [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=
--                              AC_MSG_RESULT([no])
--                              $3
--                      fi
--              elif test "$haveext" != "no" && test "x$haveext" != "x"; then
-+              if test "$haveext" != "no" && test "x$haveext" != "x"; then
-                       [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1
-                       AC_MSG_RESULT([yes])
-                       $2
diff --git a/lang/php7-pecl-http/patches/200-string_or_null_register.patch b/lang/php7-pecl-http/patches/200-string_or_null_register.patch
new file mode 100644 (file)
index 0000000..f2d37ee
--- /dev/null
@@ -0,0 +1,57 @@
+From ab5b4e3acd2b0379e5d8bc95a8d4f83ce5c91fb7 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Sun, 4 Jun 2017 15:00:33 +0200
+Subject: [PATCH] Handle NULL strings gracefully during constant registration
+
+When libcurl is compiled not using e.g. libz or SSL, then a call to
+curl_version_info could return NULL in the corresponding fields of
+curl_version_info_data.
+
+Passing such NULL pointers down to REGISTER_NS_STRING_CONSTANT results
+in a segfault during php startup, so let's check for this special case
+and register a NULL constant in this case.
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ src/php_http_client_curl.c | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/src/php_http_client_curl.c b/src/php_http_client_curl.c
+index f286324..f07bb8f 100644
+--- a/src/php_http_client_curl.c
++++ b/src/php_http_client_curl.c
+@@ -2429,6 +2429,14 @@ php_http_client_ops_t *php_http_client_curl_get_ops(void)
+       return &php_http_client_curl_ops;
+ }
++#define REGISTER_NS_STRING_OR_NULL_CONSTANT(ns, name, str, flags)                              \
++              do {                                                                           \
++                      if ((str) != NULL) {                                                   \
++                              REGISTER_NS_STRING_CONSTANT(ns, name, str, flags);             \
++                      } else {                                                               \
++                              REGISTER_NS_NULL_CONSTANT(ns, name, flags);                    \
++                      }                                                                      \
++              } while (0)
+ PHP_MINIT_FUNCTION(http_client_curl)
+ {
+@@ -2509,12 +2517,12 @@ PHP_MINIT_FUNCTION(http_client_curl)
+               REGISTER_NS_STRING_CONSTANT("http\\Client\\Curl", "VERSIONS", curl_version(), CONST_CS|CONST_PERSISTENT);
+ #if CURLVERSION_NOW >= 0
+               REGISTER_NS_STRING_CONSTANT("http\\Client\\Curl\\Versions", "CURL", (char *) info->version, CONST_CS|CONST_PERSISTENT);
+-              REGISTER_NS_STRING_CONSTANT("http\\Client\\Curl\\Versions", "SSL", (char *) info->ssl_version, CONST_CS|CONST_PERSISTENT);
+-              REGISTER_NS_STRING_CONSTANT("http\\Client\\Curl\\Versions", "LIBZ", (char *) info->libz_version, CONST_CS|CONST_PERSISTENT);
++              REGISTER_NS_STRING_OR_NULL_CONSTANT("http\\Client\\Curl\\Versions", "SSL", (char *) info->ssl_version, CONST_CS|CONST_PERSISTENT);
++              REGISTER_NS_STRING_OR_NULL_CONSTANT("http\\Client\\Curl\\Versions", "LIBZ", (char *) info->libz_version, CONST_CS|CONST_PERSISTENT);
+ # if CURLVERSION_NOW >= 1
+-              REGISTER_NS_STRING_CONSTANT("http\\Client\\Curl\\Versions", "ARES", (char *) info->ares, CONST_CS|CONST_PERSISTENT);
++              REGISTER_NS_STRING_OR_NULL_CONSTANT("http\\Client\\Curl\\Versions", "ARES", (char *) info->ares, CONST_CS|CONST_PERSISTENT);
+ #  if CURLVERSION_NOW >= 2
+-              REGISTER_NS_STRING_CONSTANT("http\\Client\\Curl\\Versions", "IDN", (char *) info->libidn, CONST_CS|CONST_PERSISTENT);
++              REGISTER_NS_STRING_OR_NULL_CONSTANT("http\\Client\\Curl\\Versions", "IDN", (char *) info->libidn, CONST_CS|CONST_PERSISTENT);
+ #  endif
+ # endif
+ #endif
+-- 
+2.7.4
+
index 272b34a7983fa1a357675a870d2054a5c4047a07..1b34f6687ce094b785e32d088916eff2e9b856c5 100644 (file)
@@ -17,6 +17,7 @@ PKG_SOURCE_URL:=https://github.com/expressif/pecl-event-libevent.git
 PKG_SOURCE_VERSION:=9e72744ce6224beafc7b54ce2a3a990f1c552a5a
 PKG_SOURCE_SUBDIR:=$(PECL_NAME)-$(PKG_SOURCE_VERSION)
 PKG_SOURCE:=$(PECL_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=b81f02ef7f990f4ce3f859e22a85b7430188fc6f1395cd8fba82ef237ba62d8b
 
 PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
 
index 3bfe5356c1fa5b907a90f289ea71d6bf680969a8..0c165bf6c219b9e102d7f57ebeac121981350c23 100644 (file)
@@ -10,7 +10,7 @@ PECL_LONGNAME:=Property proxy
 
 PKG_VERSION:=2.0.1
 PKG_RELEASE:=2
-PKG_MD5SUM:=19f9517210a87e18cc09faed262e1522
+PKG_HASH:=ce136875650e22d28804a41a62a5325fff85318e559626d63c5b8875fb2e4529
 
 PKG_NAME:=php7-pecl-propro
 PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
index 4ce09f9869e8d009467a2d789c8a6be3cc731495..885932314838f68c85b85b0bd4d04acd82370fae 100644 (file)
@@ -10,7 +10,7 @@ PECL_LONGNAME:=Resource and persistent handles factory
 
 PKG_VERSION:=2.0.0
 PKG_RELEASE:=2
-PKG_MD5SUM:=bc465eb5caa9d0f09cced121a8ac2e8e
+PKG_HASH:=95a59ea0dc3fc172805a6acd8327b122dd159b0a85b253826166457a05efa411
 
 PKG_NAME:=php7-pecl-raphf
 PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
index 6cd2bebd2e6e1f776101793d3704fccfc0e0a041..9c260a1766e2db91f7dc021e19ac1e4910373e3d 100644 (file)
@@ -6,7 +6,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=php
-PKG_VERSION:=7.1.1
+PKG_VERSION:=7.2.3
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
@@ -16,8 +16,7 @@ PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.php.net/distributions/
-PKG_MD5SUM:=65eef256f6e7104a05361939f5e23ada
-PKG_HASH:=b3565b0c1441064eba204821608df1ec7367abff881286898d900c2c2a5ffe70
+PKG_HASH:=b3a94f1b562f413c0b96f54bc309706d83b29ac65d9b172bc7ed9fb40a5e651f
 
 PKG_FIXUP:=libtool autoreconf
 PKG_BUILD_PARALLEL:=1
@@ -31,19 +30,19 @@ PHP7_MODULES = \
        ftp \
        gettext gd gmp \
        hash \
-       iconv intl \
+       iconv imap intl \
        json \
        ldap \
-       mbstring mcrypt mysqli \
+       mbstring mysqli \
        opcache openssl \
        pcntl pdo pdo-mysql pdo-pgsql pdo-sqlite pgsql phar \
-       session shmop simplexml soap sockets sqlite3 sysvmsg sysvsem sysvshm \
+       session shmop simplexml snmp soap sockets sqlite3 sysvmsg sysvsem sysvshm \
        tokenizer \
        xml xmlreader xmlwriter zip \
 
 PKG_CONFIG_DEPENDS:= \
        $(patsubst %,CONFIG_PACKAGE_php7-mod-%,$(PHP7_MODULES)) \
-       CONFIG_PHP7_FILTER CONFIG_PHP7_LIBXML CONFIG_PHP7_SYSTEMTZDATA
+       CONFIG_PHP7_FILTER CONFIG_PHP7_LIBXML CONFIG_PHP7_SYSTEMTZDATA CONFIG_PHP7_LIBFREETYPE
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
@@ -66,6 +65,7 @@ define Package/php7/config
        config PHP7_FILTER
                bool "PHP7 Filter support"
                depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
+               default y
 
        config PHP7_LIBXML
                bool "PHP7 LIBXML support"
@@ -133,7 +133,7 @@ endef
 
 define Package/php7-fpm
   $(call Package/php7/Default)
-  DEPENDS+= +php7-cgi
+  DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
   TITLE+= (FPM)
 endef
 
@@ -142,6 +142,16 @@ define Package/php7-fpm/description
   This package contains the FastCGI Process Manager of the PHP7 interpreter.
 endef
 
+define Package/php7-mod-gd/config
+  config PHP7_LIBFREETYPE
+       bool "Enable Freetype 2 support in php7-mod-gd"
+       depends on PACKAGE_php7-mod-gd
+       default y
+endef
+
+# not everything groks --disable-nls
+DISABLE_NLS:=
+
 CONFIGURE_ARGS+= \
        --enable-cli \
        --enable-cgi \
@@ -157,6 +167,7 @@ CONFIGURE_ARGS+= \
        --with-config-file-scan-dir=/etc/php7 \
        --disable-short-tags \
        \
+       --with-pcre-regex="$(STAGING_DIR)/usr" \
        --with-zlib="$(STAGING_DIR)/usr" \
          --with-zlib-dir="$(STAGING_DIR)/usr"
 
@@ -211,16 +222,19 @@ endif
 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gd),)
   CONFIGURE_ARGS+= \
        --with-gd=shared \
-       --without-freetype-dir \
        --with-jpeg-dir="$(STAGING_DIR)/usr" \
        --with-png-dir="$(STAGING_DIR)/usr" \
        --without-xpm-dir \
-       --without-t1lib \
        --enable-gd-native-ttf \
        --disable-gd-jis-conv
 else
   CONFIGURE_ARGS+= --without-gd
 endif
+ifneq ($(CONFIG_PHP7_LIBFREETYPE),)
+  CONFIGURE_ARGS+= --with-freetype-dir="$(STAGING_DIR)"
+else
+  CONFIGURE_ARGS+= --without-freetype-dir
+endif
 
 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gmp),)
   CONFIGURE_ARGS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
@@ -240,8 +254,18 @@ else
   CONFIGURE_ARGS+= --without-iconv
 endif
 
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-imap),)
+  CONFIGURE_ARGS+= \
+               --with-imap=shared,"$(STAGING_DIR)/usr" \
+               --with-imap-kerberos=no \
+               --with-imap-ssl="$(STAGING_DIR)/usr"
+else
+  CONFIGURE_ARGS+= --without-imap
+endif
+
 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-intl),)
   CONFIGURE_ARGS+= --enable-intl=shared
+  TARGET_CXXFLAGS+= -std=c++0x
 else
   CONFIGURE_ARGS+= --disable-intl
 endif
@@ -266,12 +290,6 @@ else
   CONFIGURE_ARGS+= --disable-mbstring
 endif
 
-ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mcrypt),)
-  CONFIGURE_ARGS+= --with-mcrypt=shared,"$(STAGING_DIR)/usr"
-else
-  CONFIGURE_ARGS+= --without-mcrypt
-endif
-
 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mysqli),)
   CONFIGURE_ARGS+= --with-mysqli=shared,"$(STAGING_DIR)/usr/bin/mysql_config"
 else
@@ -284,7 +302,7 @@ else
   CONFIGURE_ARGS+= --disable-opcache
 endif
 
-ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-openssl),)
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-openssl)$(CONFIG_PACKAGE_php7-mod-ftp)$(CONFIG_PACKAGE_php7-mod-imap)$(CONFIG_PACKAGE_php7-mod-snmp),)
   CONFIGURE_ARGS+= \
        --with-openssl=shared,"$(STAGING_DIR)/usr" \
        --with-kerberos=no \
@@ -350,6 +368,12 @@ else
   CONFIGURE_ARGS+= --disable-simplexml
 endif
 
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-snmp),)
+  CONFIGURE_ARGS+= --with-snmp=shared,"$(STAGING_DIR)/usr"
+else
+  CONFIGURE_ARGS+= --without-snmp
+endif
+
 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-soap),)
   CONFIGURE_ARGS+= --enable-soap=shared
 else
@@ -434,20 +458,23 @@ else
   CONFIGURE_ARGS+= --disable-libxml
 endif
 
-#ifneq ($(CONFIG_PHP7_SYSTEMTZDATA),)
-#  CONFIGURE_ARGS+= --with-system-tzdata
-#else
-#  CONFIGURE_ARGS+= --without-system-tzdata
-#endif
+ifneq ($(CONFIG_PHP7_SYSTEMTZDATA),)
+  CONFIGURE_ARGS+= --with-system-tzdata
+else
+  CONFIGURE_ARGS+= --without-system-tzdata
+endif
 
 CONFIGURE_VARS+= \
        ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no) \
        php_cv_cc_rpath="no" \
        iconv_impl_name="gnu_libiconv" \
        ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \
+       ac_cv_u8t_decompose=yes \
+       ac_cv_enable_valgrind_check=no \
 
 define Package/php7/conffiles
 /etc/php.ini
+/etc/php7/
 endef
 
 define Package/php7/install
@@ -491,6 +518,12 @@ define Package/php7-fpm/install
        $(INSTALL_BIN) ./files/php7-fpm.init $(1)/etc/init.d/php7-fpm
 endef
 
+define Package/php7-fpm/conffiles
+/etc/php7-fpm.conf
+/etc/php7-fpm.d/
+/etc/config/php7-fpm
+endef
+
 define Build/Prepare
        $(call Build/Prepare/Default)
        ( cd $(PKG_BUILD_DIR); touch configure.in; ./buildconf --force )
@@ -558,16 +591,16 @@ $(eval $(call BuildModule,dom,DOM,+@PHP7_LIBXML +PACKAGE_php7-mod-dom:libxml2))
 $(eval $(call BuildModule,exif,EXIF))
 $(eval $(call BuildModule,fileinfo,Fileinfo))
 $(eval $(call BuildModule,ftp,FTP,+PACKAGE_php7-mod-ftp:libopenssl))
-$(eval $(call BuildModule,gd,GD graphics,+PACKAGE_php7-mod-gd:libjpeg +PACKAGE_php7-mod-gd:libpng))
+$(eval $(call BuildModule,gd,GD graphics,+PACKAGE_php7-mod-gd:libjpeg +PACKAGE_php7-mod-gd:libpng +PHP7_LIBFREETYPE:libfreetype))
 $(eval $(call BuildModule,gettext,Gettext,+PACKAGE_php7-mod-gettext:libintl-full))
 $(eval $(call BuildModule,gmp,GMP,+PACKAGE_php7-mod-gmp:libgmp))
 $(eval $(call BuildModule,hash,Hash))
 $(eval $(call BuildModule,iconv,iConv,$(ICONV_DEPENDS)))
+$(eval $(call BuildModule,imap,IMAP,+PACKAGE_php7-mod-imap:libopenssl +PACKAGE_libpam:libpam +PACKAGE_php7-mod-imap:uw-imap))
 $(eval $(call BuildModule,intl,Internationalization Functions,+PACKAGE_php7-mod-intl:icu))
 $(eval $(call BuildModule,json,JSON))
 $(eval $(call BuildModule,ldap,LDAP,+PACKAGE_php7-mod-ldap:libopenldap +PACKAGE_php7-mod-ldap:libsasl2))
 $(eval $(call BuildModule,mbstring,MBString))
-$(eval $(call BuildModule,mcrypt,Mcrypt,+PACKAGE_php7-mod-mcrypt:libmcrypt +PACKAGE_php7-mod-mcrypt:libltdl))
 $(eval $(call BuildModule,mysqli,MySQL Improved Extension,+PACKAGE_php7-mod-mysqli:libmysqlclient))
 $(eval $(call BuildModule,opcache,OPcache,,,zend))
 $(eval $(call BuildModule,openssl,OpenSSL,+PACKAGE_php7-mod-openssl:libopenssl))
@@ -581,6 +614,7 @@ $(eval $(call BuildModule,phar,Phar Archives,+php7-mod-hash))
 $(eval $(call BuildModule,session,Session))
 $(eval $(call BuildModule,shmop,Shared Memory))
 $(eval $(call BuildModule,simplexml,SimpleXML,+@PHP7_LIBXML +PACKAGE_php7-mod-simplexml:libxml2))
+$(eval $(call BuildModule,snmp,SNMP,+PACKAGE_php7-mod-snmp:libnetsnmp +PACKAGE_php7-mod-snmp:libopenssl))
 $(eval $(call BuildModule,soap,SOAP,+@PHP7_LIBXML +PACKAGE_php7-mod-soap:libxml2))
 $(eval $(call BuildModule,sockets,Sockets))
 $(eval $(call BuildModule,sqlite3,SQLite3,+PACKAGE_php7-mod-sqlite3:libsqlite3))
index 819ad1e95d4b61b1b18ead5af2d1e415778c2fea..97fd734af9c73fadba7d59513589f5fadf4740c4 100644 (file)
@@ -1,11 +1,11 @@
-From: Joe Orton <jorton@redhat.com>
-Date: Thu, 20 Oct 2016 11:44:14 +0200
-Subject: Add support for use of the system timezone database
+# License: MIT
+# http://opensource.org/licenses/MIT
 
 Add support for use of the system timezone database, rather
 than embedding a copy.  Discussed upstream but was not desired.
 
 History:
+r15: adapt for timelib 2017.05beta7 (in 7.2.0RC1)
 r14: improve check for valid tz file
 r13: adapt for upstream changes to use PHP allocator
 r12: adapt for upstream changes for new zic
@@ -25,18 +25,13 @@ r4: added "System/Localtime" tzname which uses /etc/localtime
 r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
 r2: add filesystem trawl to set up name alias index
 r1: initial revision
----
- ext/date/lib/parse_tz.c | 560 +++++++++++++++++++++++++++++++++++++++++++++++-
- ext/date/lib/timelib.m4 |  13 ++
- 2 files changed, 562 insertions(+), 11 deletions(-)
 
-diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
-index 20d7eea..ed7717e 100644
---- a/ext/date/lib/parse_tz.c
-+++ b/ext/date/lib/parse_tz.c
-@@ -24,6 +24,16 @@
+diff -up ./ext/date/lib/parse_tz.c.systzdata ./ext/date/lib/parse_tz.c
+--- ./ext/date/lib/parse_tz.c.systzdata        2017-08-22 09:40:38.000000000 +0200
++++ ./ext/date/lib/parse_tz.c  2017-08-22 12:16:00.370298079 +0200
+@@ -25,8 +25,21 @@
  #include "timelib.h"
+ #include "timelib_private.h"
  
 +#ifdef HAVE_SYSTEM_TZDATA
 +#include <sys/mman.h>
@@ -46,16 +41,8 @@ index 20d7eea..ed7717e 100644
 +#include <unistd.h>
 +
 +#include "php_scandir.h"
-+#endif
 +
- #include <stdio.h>
- #ifdef HAVE_LOCALE_H
-@@ -36,8 +46,12 @@
- #include <strings.h>
- #endif
-+#ifndef HAVE_SYSTEM_TZDATA
++#else
  #define TIMELIB_SUPPORTS_V2DATA
  #include "timezonedb.h"
 +#endif
@@ -64,7 +51,7 @@ index 20d7eea..ed7717e 100644
  
  #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
  # if defined(__LITTLE_ENDIAN__)
-@@ -59,6 +73,11 @@ static int read_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
+@@ -67,6 +80,11 @@ static int read_php_preamble(const unsig
  {
        uint32_t version;
  
@@ -76,7 +63,7 @@ index 20d7eea..ed7717e 100644
        /* read ID */
        version = (*tzf)[3] - '0';
        *tzf += 4;
-@@ -302,7 +321,429 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
+@@ -374,7 +392,429 @@ void timelib_dump_tzinfo(timelib_tzinfo
        }
  }
  
@@ -507,7 +494,7 @@ index 20d7eea..ed7717e 100644
  {
        int left = 0, right = tzdb->index_size - 1;
  #ifdef HAVE_SETLOCALE
-@@ -341,21 +782,88 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
+@@ -419,9 +859,48 @@ static int seek_to_tz_position(const uns
        return 0;
  }
  
@@ -555,17 +542,8 @@ index 20d7eea..ed7717e 100644
 +#endif
  }
  
- const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count)
- {
-+#ifdef HAVE_SYSTEM_TZDATA
-+      *count = timezonedb_system->index_size;
-+      return timezonedb_system->index;
-+#else
-       *count = sizeof(timezonedb_idx_builtin) / sizeof(*timezonedb_idx_builtin);
-       return timezonedb_idx_builtin;
-+#endif
- }
+ const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(timelib_tzdb *tzdb, int *count)
+@@ -433,7 +912,30 @@ const timelib_tzdb_index_entry *timelib_
  int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb)
  {
        const unsigned char *tzf;
@@ -596,32 +574,27 @@ index 20d7eea..ed7717e 100644
 +      return (inmem_seek_to_tz_position(&tzf, timezone, tzdb));
  }
  
- static void skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
-@@ -380,24 +888,54 @@ static void read_64bit_header(const unsigned char **tzf, timelib_tzinfo *tz)
- timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb)
+ static int skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
+@@ -475,12 +977,14 @@ static timelib_tzinfo* timelib_tzinfo_ct
+ timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb, int *error_code)
  {
        const unsigned char *tzf;
 +      char *memmap = NULL;
 +      size_t maplen;
        timelib_tzinfo *tmp;
        int version;
+       int transitions_result, types_result;
+       unsigned int type; /* TIMELIB_TZINFO_PHP or TIMELIB_TZINFO_ZONEINFO */
  
 -      if (seek_to_tz_position(&tzf, timezone, tzdb)) {
 +      if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) {
                tmp = timelib_tzinfo_ctor(timezone);
  
-               version = read_preamble(&tzf, tmp);
-               read_header(&tzf, tmp);
-               read_transistions(&tzf, tmp);
-               read_types(&tzf, tmp);
--              if (version == 2) {
--                      skip_64bit_preamble(&tzf, tmp);
--                      read_64bit_header(&tzf, tmp);
--                      skip_64bit_transistions(&tzf, tmp);
--                      skip_64bit_types(&tzf, tmp);
--                      skip_posix_string(&tzf, tmp);
--              }
--              read_location(&tzf, tmp);
+               version = read_preamble(&tzf, tmp, &type);
+@@ -503,6 +1007,29 @@ timelib_tzinfo *timelib_parse_tzfile(cha
+                       timelib_tzinfo_dtor(tmp);
+                       return NULL;
+               }
 +
 +#ifdef HAVE_SYSTEM_TZDATA
 +              if (memmap) {
@@ -638,34 +611,30 @@ index 20d7eea..ed7717e 100644
 +                              tmp->bc = 1;
 +                      }
 +                      else {
-+                              strcpy(tmp->location.country_code, "??");
-+                              tmp->bc = 0;
-+                              tmp->location.comments = timelib_strdup("");
++                              set_default_location_and_comments(&tzf, tmp);
 +                      }
 +
 +                      /* Now done with the mmap segment - discard it. */
 +                      munmap(memmap, maplen);
-+              } else
++              } else {
++#endif
+               if (version == 2 || version == 3) {
+                       if (!skip_64bit_preamble(&tzf, tmp)) {
+                               /* 64 bit preamble is not in place */
+@@ -520,6 +1047,9 @@ timelib_tzinfo *timelib_parse_tzfile(cha
+               } else {
+                       set_default_location_and_comments(&tzf, tmp);
+               }
++#ifdef HAVE_SYSTEM_TZDATA
++              }
 +#endif
-+              {
-+                      /* PHP-style - use the embedded info. */
-+                      if (version == 2) {
-+                              skip_64bit_preamble(&tzf, tmp);
-+                              read_64bit_header(&tzf, tmp);
-+                              skip_64bit_transistions(&tzf, tmp);
-+                              skip_64bit_types(&tzf, tmp);
-+                              skip_posix_string(&tzf, tmp);
-+                      }
-+                      read_location(&tzf, tmp);
-+              }
        } else {
+               *error_code = TIMELIB_ERROR_NO_SUCH_TIMEZONE;
                tmp = NULL;
-       }
-diff --git a/ext/date/lib/timelib.m4 b/ext/date/lib/timelib.m4
-index 99bf9fa..4bf7e46 100644
---- a/ext/date/lib/timelib.m4
-+++ b/ext/date/lib/timelib.m4
-@@ -78,3 +78,16 @@ stdlib.h
+diff -up ./ext/date/lib/timelib.m4.systzdata ./ext/date/lib/timelib.m4
+--- ./ext/date/lib/timelib.m4.systzdata        2017-08-22 09:40:38.000000000 +0200
++++ ./ext/date/lib/timelib.m4  2017-08-22 11:32:29.357799927 +0200
+@@ -81,3 +81,16 @@ io.h
  
  dnl Check for strtoll, atoll
  AC_CHECK_FUNCS(strtoll atoll strftime gettimeofday)
index 0a10afa51d876e25e072ca2bf44d0426463bb83e..e05c102b8c3f3fef52966b00dad06704b8e8d190 100644 (file)
@@ -11,11 +11,9 @@ Subject: Add patch to remove build timestamps from generated binaries.
  sapi/phpdbg/phpdbg.c          |  4 +---
  6 files changed, 10 insertions(+), 22 deletions(-)
 
-diff --git a/ext/standard/info.c b/ext/standard/info.c
-index e74d6b4..883fbdf 100644
 --- a/ext/standard/info.c
 +++ b/ext/standard/info.c
-@@ -865,7 +865,6 @@ PHPAPI void php_print_info(int flag)
+@@ -830,7 +830,6 @@ PHPAPI void php_print_info(int flag)
                php_info_print_box_end();
                php_info_print_table_start();
                php_info_print_table_row(2, "System", ZSTR_VAL(php_uname));
@@ -23,12 +21,10 @@ index e74d6b4..883fbdf 100644
  #ifdef COMPILER
                php_info_print_table_row(2, "Compiler", COMPILER);
  #endif
-diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4
-index f286b1a..fba92b8 100644
 --- a/sapi/apache2handler/config.m4
 +++ b/sapi/apache2handler/config.m4
-@@ -59,18 +59,9 @@ if test "$PHP_APXS2" != "no"; then
-   APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
+@@ -67,18 +67,9 @@ if test "$PHP_APXS2" != "no"; then
+   fi
  
    APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
 -  if test -z `$APXS -q SYSCONFDIR`; then
@@ -49,63 +45,55 @@ index f286b1a..fba92b8 100644
  
    case $host_alias in
    *aix*)
-diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
-index 0b6deb1..bb9014a 100644
 --- a/sapi/cgi/cgi_main.c
 +++ b/sapi/cgi/cgi_main.c
-@@ -2342,9 +2342,9 @@ consult the installation file that came with this distribution, or visit \n\
+@@ -2427,9 +2427,9 @@ consult the installation file that came
                                                                SG(request_info).no_headers = 1;
                                                        }
  #if ZEND_DEBUG
--                                                      php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
-+                                                      php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+-                                                      php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2018 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
++                                                      php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2018 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
  #else
--                                                      php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
-+                                                      php_printf("PHP %s (%s)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+-                                                      php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2018 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
++                                                      php_printf("PHP %s (%s)\nCopyright (c) 1997-2018 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
  #endif
                                                        php_request_shutdown((void *) 0);
                                                        fcgi_shutdown();
-diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
-index dc92045..bb28364 100644
 --- a/sapi/cli/php_cli.c
 +++ b/sapi/cli/php_cli.c
-@@ -690,8 +690,8 @@ static int do_cli(int argc, char **argv) /* {{{ */
+@@ -697,8 +697,8 @@ static int do_cli(int argc, char **argv)
                                goto out;
  
                        case 'v': /* show php version & quit */
--                              php_printf("PHP %s (%s) (built: %s %s) ( %s)\nCopyright (c) 1997-2017 The PHP Group\n%s",
+-                              php_printf("PHP %s (%s) (built: %s %s) ( %s)\nCopyright (c) 1997-2018 The PHP Group\n%s",
 -                                      PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__,
-+                              php_printf("PHP %s (%s) ( %s)\nCopyright (c) 1997-2017 The PHP Group\n%s",
++                              php_printf("PHP %s (%s) ( %s)\nCopyright (c) 1997-2018 The PHP Group\n%s",
 +                                      PHP_VERSION, cli_sapi_module.name,
  #if ZTS
                                        "ZTS "
  #else
-diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
-index 6768113..545c52e 100644
 --- a/sapi/fpm/fpm/fpm_main.c
 +++ b/sapi/fpm/fpm/fpm_main.c
-@@ -1756,9 +1756,9 @@ int main(int argc, char *argv[])
+@@ -1755,9 +1755,9 @@ int main(int argc, char *argv[])
                                SG(request_info).no_headers = 1;
  
  #if ZEND_DEBUG
--                              php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__,        __TIME__, get_zend_version());
-+                              php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+-                              php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2018 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__,        __TIME__, get_zend_version());
++                              php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2018 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
  #else
--                              php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__,      get_zend_version());
-+                              php_printf("PHP %s (%s)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+-                              php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2018 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__,      get_zend_version());
++                              php_printf("PHP %s (%s)\nCopyright (c) 1997-2018 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
  #endif
                                php_request_shutdown((void *) 0);
                                fcgi_shutdown();
-diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
-index b47c7c8..ab94bba 100644
 --- a/sapi/phpdbg/phpdbg.c
 +++ b/sapi/phpdbg/phpdbg.c
-@@ -1699,10 +1699,8 @@ phpdbg_main:
+@@ -1697,10 +1697,8 @@ phpdbg_main:
                                phpdbg_do_help_cmd(exec);
                        } else if (show_version) {
                                phpdbg_out(
--                                      "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2017 The PHP Group\n%s",
-+                                      "phpdbg %s\nPHP %s, Copyright (c) 1997-2017 The PHP Group\n%s",
+-                                      "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2018 The PHP Group\n%s",
++                                      "phpdbg %s\nPHP %s, Copyright (c) 1997-2018 The PHP Group\n%s",
                                        PHPDBG_VERSION,
 -                                      __DATE__,
 -                                      __TIME__,
diff --git a/lang/php7/patches/0050-remove-build-timestamps.patch b/lang/php7/patches/0050-remove-build-timestamps.patch
new file mode 100644 (file)
index 0000000..9c7552d
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/ext/opcache/ZendAccelerator.c
++++ b/ext/opcache/ZendAccelerator.c
+@@ -2456,11 +2456,6 @@ static void accel_gen_system_id(void)
+       PHP_MD5Update(&context, PHP_VERSION, sizeof(PHP_VERSION)-1);
+       PHP_MD5Update(&context, ZEND_EXTENSION_BUILD_ID, sizeof(ZEND_EXTENSION_BUILD_ID)-1);
+       PHP_MD5Update(&context, ZEND_BIN_ID, sizeof(ZEND_BIN_ID)-1);
+-      if (strstr(PHP_VERSION, "-dev") != 0) {
+-              /* Development versions may be changed from build to build */
+-              PHP_MD5Update(&context, __DATE__, sizeof(__DATE__)-1);
+-              PHP_MD5Update(&context, __TIME__, sizeof(__TIME__)-1);
+-      }
+       PHP_MD5Final(digest, &context);
+       for (i = 0; i < 16; i++) {
+               c = digest[i] >> 4;
+--- a/sapi/litespeed/lsapi_main.c
++++ b/sapi/litespeed/lsapi_main.c
+@@ -1034,9 +1034,9 @@ static int cli_main( int argc, char * ar
+             case 'v':
+                 if (php_request_startup() != FAILURE) {
+ #if ZEND_DEBUG
+-                    php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2018 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
++                    php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2018 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+ #else
+-                    php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2018 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
++                    php_printf("PHP %s (%s)\nCopyright (c) 1997-2018 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+ #endif
+ #ifdef PHP_OUTPUT_NEWAPI
+                     php_output_end_all();
index 22122ec824506bc41277c426774c6af6157016c4..5359ab99708ea98a07a6aa1a71d0c690dbd455c7 100644 (file)
@@ -1,5 +1,5 @@
---- a/configure.in
-+++ b/configure.in
+--- a/configure.ac
++++ b/configure.ac
 @@ -453,7 +453,10 @@ PHP_CHECK_FUNC(gethostname, nsl)
  PHP_CHECK_FUNC(gethostbyaddr, nsl)
  PHP_CHECK_FUNC(yp_get_default_domain, nsl)
index 19837f53f5db9612e88a3569c24686ee576959f3..e6162cdfbbc8c22021611491ed0604c811c1c4c2 100644 (file)
@@ -9,8 +9,8 @@
  
    PHP_INSTALL_HEADERS([ext/phar], [php_phar.h])
  
---- a/configure.in     2016-09-20 22:26:38.000000000 +0200
-+++ b/configure.in     2016-09-20 22:42:30.380101556 +0200
+--- a/configure.ac     2016-09-20 22:26:38.000000000 +0200
++++ b/configure.ac     2016-09-20 22:42:30.380101556 +0200
 @@ -1448,13 +1448,13 @@
  INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
  CXXFLAGS="$CXXFLAGS $standard_libtool_flag \$(PROF_FLAGS)"
diff --git a/lang/php7/patches/1005-fix-asm-constraints-in-aarch64-multiply-macro.patch b/lang/php7/patches/1005-fix-asm-constraints-in-aarch64-multiply-macro.patch
deleted file mode 100644 (file)
index 0afa951..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-From 6cbb9f4c247c5361b8c165fbb40b4118d5d7c0e5 Mon Sep 17 00:00:00 2001
-From: Andreas Schwab <schwab@linux-m68k.org>
-Date: Mon, 25 Apr 2016 11:59:14 +0200
-Subject: [PATCH] Fix asm constraints in aarch64 multiply macro
-
-All operands must be register operands and the output operands are early
-clobbered.
----
- Zend/zend_multiply.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h
-index dfd21f7..651dd43 100644
---- a/Zend/zend_multiply.h
-+++ b/Zend/zend_multiply.h
-@@ -53,8 +53,8 @@
-       __asm__("mul %0, %2, %3\n"                                                                              \
-               "smulh %1, %2, %3\n"                                                                            \
-               "sub %1, %1, %0, asr #63\n"                                                                     \
--                      : "=X"(__tmpvar), "=X"(usedval)                                                 \
--                      : "X"(a), "X"(b));                                                                              \
-+                      : "=&r"(__tmpvar), "=&r"(usedval)                                               \
-+                      : "r"(a), "r"(b));                                                                              \
-       if (usedval) (dval) = (double) (a) * (double) (b);                              \
-       else (lval) = __tmpvar;                                                                                 \
- } while (0)
--- 
-2.8.0
-
diff --git a/lang/php7/patches/1006-multiline-syslog.patch b/lang/php7/patches/1006-multiline-syslog.patch
new file mode 100644 (file)
index 0000000..1346481
--- /dev/null
@@ -0,0 +1,178 @@
+commit f11d40ef88f640fe4764d2731d3061472aefe556
+Author: Philip Prindeville <philipp@redfish-solutions.com>
+Date:   Wed Aug 9 20:55:25 2017 -0600
+
+    Turn php_syslog() into wrapper for syslog and split lines
+
+diff --git a/Zend/zend_smart_string.h b/Zend/zend_smart_string.h
+index 2282202..12d755e 100644
+--- a/Zend/zend_smart_string.h
++++ b/Zend/zend_smart_string.h
+@@ -136,6 +136,10 @@ static zend_always_inline void smart_string_setl(smart_string *dest, char *src,
+       dest->c = src;
+ }
++static zend_always_inline void smart_string_reset(smart_string *str) {
++      str->len = 0;
++}
++
+ #endif
+ /*
+diff --git a/configure.ac b/configure.ac
+index cb95d86..a63354f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1443,7 +1443,7 @@ PHP_ADD_SOURCES(main, main.c snprintf.c spprintf.c php_sprintf.c \
+        php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
+        strlcat.c explicit_bzero.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
+        network.c php_open_temporary_file.c \
+-       output.c getopt.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
++       output.c getopt.c php_syslog.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
+ PHP_ADD_SOURCES_X(main, fastcgi.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, PHP_FASTCGI_OBJS, no)
+diff --git a/main/php_syslog.c b/main/php_syslog.c
+new file mode 100644
+index 0000000..c351951
+--- /dev/null
++++ b/main/php_syslog.c
+@@ -0,0 +1,81 @@
++/*
++   +----------------------------------------------------------------------+
++   | PHP Version 7                                                        |
++   +----------------------------------------------------------------------+
++   | Copyright (c) 2017 The PHP Group                                |
++   +----------------------------------------------------------------------+
++   | This source file is subject to version 3.01 of the PHP license,      |
++   | that is bundled with this package in the file LICENSE, and is        |
++   | available through the world-wide-web at the following url:           |
++   | http://www.php.net/license/3_01.txt                                  |
++   | If you did not receive a copy of the PHP license and are unable to   |
++   | obtain it through the world-wide-web, please send a note to          |
++   | license@php.net so we can mail you a copy immediately.               |
++   +----------------------------------------------------------------------+
++   | Author: Philip Prindeville <philipp@redfish-solutions.com>           |
++   +----------------------------------------------------------------------+
++*/
++
++/* $Id$ */
++
++#include <stdio.h>
++#include <string.h>
++#include <assert.h>
++#include <stdlib.h>
++#include "php.h"
++#include "php_syslog.h"
++
++#include "zend.h"
++#include "zend_smart_string.h"
++
++/*
++ * The SCO OpenServer 5 Development System (not the UDK)
++ * defines syslog to std_syslog.
++ */
++
++#ifdef HAVE_STD_SYSLOG
++#define syslog std_syslog
++#endif
++
++PHPAPI void php_syslog(int priority, const char *format, ...) /* {{{ */
++{
++      const char *ptr;
++      unsigned char c;
++      smart_string fbuf = {0};
++      smart_string sbuf = {0};
++      va_list args;
++
++      va_start(args, format);
++      zend_printf_to_smart_string(&fbuf, format, args);
++      smart_string_0(&fbuf);
++      va_end(args);
++
++      for (ptr = fbuf.c; ; ++ptr) {
++              c = *ptr;
++              if (c == '\0') {
++                      syslog(priority, "%.*s", (int)sbuf.len, sbuf.c);
++                      break;
++              }
++
++              if (c != '\n')
++                      smart_string_appendc(&sbuf, c);
++              else {
++                      syslog(priority, "%.*s", (int)sbuf.len, sbuf.c);
++                      smart_string_reset(&sbuf);
++              }
++      }
++
++      smart_string_free(&fbuf);
++      smart_string_free(&sbuf);
++}
++
++/* }}} */
++
++/*
++ * Local variables:
++ * tab-width: 4
++ * c-basic-offset: 4
++ * End:
++ * vim600: sw=4 ts=4 fdm=marker
++ * vim<600: sw=4 ts=4
++ */
+diff --git a/main/php_syslog.h b/main/php_syslog.h
+index be68cc4..4c4ca4e 100644
+--- a/main/php_syslog.h
++++ b/main/php_syslog.h
+@@ -21,6 +21,8 @@
+ #ifndef PHP_SYSLOG_H
+ #define PHP_SYSLOG_H
++#include "php.h"
++
+ #ifdef PHP_WIN32
+ #include "win32/syslog.h"
+ #else
+@@ -30,26 +32,12 @@
+ #endif
+ #endif
+-/*
+- * The SCO OpenServer 5 Development System (not the UDK)
+- * defines syslog to std_syslog.
+- */
+-
+-#ifdef syslog
+-
+-#ifdef HAVE_STD_SYSLOG
+-#define php_syslog std_syslog
+-#endif
+-
+-#undef syslog
++BEGIN_EXTERN_C()
++PHPAPI void php_syslog(int, const char *format, ...);
++END_EXTERN_C()
+ #endif
+-#ifndef php_syslog
+-#define php_syslog syslog
+-#endif
+-
+-#endif
+ /*
+  * Local variables:
+  * tab-width: 4
+diff --git a/win32/build/config.w32 b/win32/build/config.w32
+index 6cbb18b..71cf491 100644
+--- a/win32/build/config.w32
++++ b/win32/build/config.w32
+@@ -244,7 +244,8 @@ ADD_FLAG("CFLAGS_BD_ZEND", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
+ ADD_SOURCES("main", "main.c snprintf.c spprintf.c getopt.c fopen_wrappers.c \
+       php_scandir.c php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
+       strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c network.c \
+-      php_open_temporary_file.c output.c internal_functions.c php_sprintf.c");
++      php_open_temporary_file.c output.c internal_functions.c php_sprintf.c \
++      php_syslog.c");
+ ADD_FLAG("CFLAGS_BD_MAIN", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
+ AC_DEFINE('HAVE_STRNLEN', 1);
diff --git a/lang/php7/patches/1008-acinclude-valgrind.patch b/lang/php7/patches/1008-acinclude-valgrind.patch
new file mode 100644 (file)
index 0000000..a3eae9c
--- /dev/null
@@ -0,0 +1,42 @@
+--- a/acinclude.m4     2017-11-28 10:22:53.000000000 +0100
++++ b/acinclude.m4     2017-12-22 16:28:09.361331754 +0100
+@@ -3227,20 +3227,26 @@
+ dnl PHP_CHECK_VALGRIND
+ AC_DEFUN([PHP_CHECK_VALGRIND], [
+-  AC_MSG_CHECKING([for valgrind])
++  AC_CACHE_CHECK(whether to enable the check for valgrind support,ac_cv_enable_valgrind_check,[
++    ac_cv_enable_valgrind_check=yes
++  ])
+-  SEARCH_PATH="/usr/local /usr"
+-  SEARCH_FOR="/include/valgrind/valgrind.h"
+-  for i in $SEARCH_PATH ; do
+-    if test -r $i/$SEARCH_FOR; then
+-      VALGRIND_DIR=$i
+-    fi
+-  done
++  if test "$ac_cv_enable_valgrind_check" = "yes"; then
++    AC_MSG_CHECKING([for valgrind])
++
++    SEARCH_PATH="/usr/local /usr"
++    SEARCH_FOR="/include/valgrind/valgrind.h"
++    for i in $SEARCH_PATH ; do
++      if test -r $i/$SEARCH_FOR; then
++        VALGRIND_DIR=$i
++      fi
++    done
+-  if test -z "$VALGRIND_DIR"; then
+-    AC_MSG_RESULT([not found])
+-  else
+-    AC_MSG_RESULT(found in $VALGRIND_DIR)
+-    AC_DEFINE(HAVE_VALGRIND, 1, [ ])
++    if test -z "$VALGRIND_DIR"; then
++      AC_MSG_RESULT([not found])
++    else
++      AC_MSG_RESULT(found in $VALGRIND_DIR)
++      AC_DEFINE(HAVE_VALGRIND, 1, [ ])
++    fi
+   fi
+ ])
diff --git a/lang/php7/patches/1010-pcrelib-NativeMIPS.patch b/lang/php7/patches/1010-pcrelib-NativeMIPS.patch
new file mode 100644 (file)
index 0000000..7a1ac46
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c  2017-11-28 02:22:57.000000000 -0700
++++ b/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c  2017-12-29 17:35:44.231934114 -0700
+@@ -498,12 +498,13 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_gen
+ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type)
+ {
++      sljit_sw fir = 0;
++
+       switch (feature_type) {
+       case SLJIT_HAS_FPU:
+ #ifdef SLJIT_IS_FPU_AVAILABLE
+               return SLJIT_IS_FPU_AVAILABLE;
+ #elif defined(__GNUC__)
+-              sljit_sw fir;
+               asm ("cfc1 %0, $0" : "=r"(fir));
+               return (fir >> 22) & 0x1;
+ #else
diff --git a/lang/php7/patches/1012-php_iconv_string-null-out-pointer.patch b/lang/php7/patches/1012-php_iconv_string-null-out-pointer.patch
new file mode 100644 (file)
index 0000000..6dfbe51
--- /dev/null
@@ -0,0 +1,69 @@
+commit 31e53f07c26e5ac75ec2c2d99497439323dbdaf7
+Author: Philip Prindeville <philipp@redfish-solutions.com>
+Date:   Wed Jan 24 18:47:19 2018 -0700
+
+    Be consistent in clearing out in php_iconv_string()
+    
+    Also, don't bother checking returned point in error case since it
+    will always be NULL (and not require free()ing, obviously).
+
+diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
+index 35dafd4..4289242 100644
+--- a/ext/iconv/iconv.c
++++ b/ext/iconv/iconv.c
+@@ -559,6 +559,8 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
+       size_t result;
+       zend_string *ret, *out_buffer;
++      *out = NULL;
++
+       /*
+         This is not the right way to get output size...
+         This is not space efficient for large text.
+
+commit 3763c8f1645983b5abc37c60597e1ecc1bf89019
+Author: Philip Prindeville <philipp@redfish-solutions.com>
+Date:   Thu Jan 25 14:18:00 2018 -0700
+
+    Always free out_buf in php_iconv_string()
+
+diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
+index 4289242..807bb14 100644
+--- a/ext/iconv/iconv.c
++++ b/ext/iconv/iconv.c
+@@ -697,6 +697,7 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
+       iconv_close(cd);
+       if (result == (size_t)(-1)) {
++              zend_string_free(out_buf);
+               switch (errno) {
+                       case EINVAL:
+                               retval = PHP_ICONV_ERR_ILLEGAL_CHAR;
+@@ -713,7 +714,6 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
+                       default:
+                               /* other error */
+-                              zend_string_free(out_buf);
+                               return PHP_ICONV_ERR_UNKNOWN;
+               }
+       }
+@@ -986,9 +986,6 @@ static php_iconv_err_t _php_iconv_strpos(size_t *pretval,
+       err = php_iconv_string(ndl, ndl_nbytes, &ndl_buf, GENERIC_SUPERSET_NAME, enc);
+       if (err != PHP_ICONV_ERR_SUCCESS) {
+-              if (ndl_buf != NULL) {
+-                      zend_string_free(ndl_buf);
+-              }
+               return err;
+       }
+@@ -2465,9 +2462,6 @@ PHP_NAMED_FUNCTION(php_if_iconv)
+       if (err == PHP_ICONV_ERR_SUCCESS && out_buffer != NULL) {
+               RETVAL_STR(out_buffer);
+       } else {
+-              if (out_buffer != NULL) {
+-                      zend_string_free(out_buffer);
+-              }
+               RETURN_FALSE;
+       }
+ }
diff --git a/lang/pillow/Makefile b/lang/pillow/Makefile
deleted file mode 100644 (file)
index ee40d6c..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Copyright © 1997-2011 by Secret Labs AB
-# Copyright © 1995-2011 by Fredrik Lundh
-# Copyright © 2016 by Alex Clark and contributors
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=pillow
-PKG_VERSION:=3.3.1
-PKG_RELEASE=1
-PKG_LICENSE:=CUSTOM
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/python-pillow/Pillow.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=aab33141f381d5577cdef9033b7fdff79122a10c
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/pillow
-    SUBMENU:=Python
-    SECTION:=lang
-    CATEGORY:=Languages
-    TITLE:=The friendly PIL fork
-    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-    URL:=https://python-pillow.org/
-    DEPENDS:=+python +libfreetype +libjpeg +zlib +libtiff
-endef
-
-define Package/pillow/description
-    The friendly PIL fork
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/pillow/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) \
-               $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-               $(1)$(PYTHON_PKG_DIR)/
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
-       $(CP) $(PKG_BUILD_DIR)/LICENSE $(1)$(PYTHON_PKG_DIR)/PIL/
-endef
-
-$(eval $(call BuildPackage,pillow))
diff --git a/lang/pillow/patches/010-fix-paths.patch b/lang/pillow/patches/010-fix-paths.patch
deleted file mode 100644 (file)
index a6b86bf..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-diff -rupN pillow-3.3.1.orig/setup.py pillow-3.3.1/setup.py
---- pillow-3.3.1.orig/setup.py 2016-08-22 17:45:05.000000000 +0200
-+++ pillow-3.3.1/setup.py      2016-08-22 18:09:51.947745155 +0200
-@@ -111,12 +111,12 @@ except (ImportError, OSError):
- NAME = 'Pillow'
- PILLOW_VERSION = '3.3.1'
--JPEG_ROOT = None
-+JPEG_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
- JPEG2K_ROOT = None
--ZLIB_ROOT = None
-+ZLIB_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
- IMAGEQUANT_ROOT = None
--TIFF_ROOT = None
--FREETYPE_ROOT = None
-+TIFF_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
-+FREETYPE_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
- LCMS_ROOT = None
-@@ -221,161 +221,6 @@ class pil_build_ext(build_ext):
-             _add_directory(include_dirs, os.path.join(prefix, "include"))
-         #
--        # add platform directories
--
--        if self.disable_platform_guessing:
--            pass
--        
--        elif sys.platform == "cygwin":
--            # pythonX.Y.dll.a is in the /usr/lib/pythonX.Y/config directory
--            _add_directory(library_dirs,
--                           os.path.join("/usr/lib", "python%s" %
--                                        sys.version[:3], "config"))
--
--        elif sys.platform == "darwin":
--            # attempt to make sure we pick freetype2 over other versions
--            _add_directory(include_dirs, "/sw/include/freetype2")
--            _add_directory(include_dirs, "/sw/lib/freetype2/include")
--            # fink installation directories
--            _add_directory(library_dirs, "/sw/lib")
--            _add_directory(include_dirs, "/sw/include")
--            # darwin ports installation directories
--            _add_directory(library_dirs, "/opt/local/lib")
--            _add_directory(include_dirs, "/opt/local/include")
--
--            # if Homebrew is installed, use its lib and include directories
--            try:
--                prefix = subprocess.check_output(['brew', '--prefix']).strip(
--                ).decode('latin1')
--            except:
--                # Homebrew not installed
--                prefix = None
--
--            ft_prefix = None
--
--            if prefix:
--                # add Homebrew's include and lib directories
--                _add_directory(library_dirs, os.path.join(prefix, 'lib'))
--                _add_directory(include_dirs, os.path.join(prefix, 'include'))
--                ft_prefix = os.path.join(prefix, 'opt', 'freetype')
--
--            if ft_prefix and os.path.isdir(ft_prefix):
--                # freetype might not be linked into Homebrew's prefix
--                _add_directory(library_dirs, os.path.join(ft_prefix, 'lib'))
--                _add_directory(include_dirs,
--                               os.path.join(ft_prefix, 'include'))
--            else:
--                # fall back to freetype from XQuartz if
--                # Homebrew's freetype is missing
--                _add_directory(library_dirs, "/usr/X11/lib")
--                _add_directory(include_dirs, "/usr/X11/include")
--
--        elif sys.platform.startswith("linux"):
--            arch_tp = (plat.processor(), plat.architecture()[0])
--            if arch_tp == ("x86_64", "32bit"):
--                # 32-bit build on 64-bit machine.
--                _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
--            else:
--                for platform_ in arch_tp:
--
--                    if not platform_:
--                        continue
--
--                    if platform_ in ["x86_64", "64bit"]:
--                        _add_directory(library_dirs, "/lib64")
--                        _add_directory(library_dirs, "/usr/lib64")
--                        _add_directory(library_dirs,
--                                       "/usr/lib/x86_64-linux-gnu")
--                        break
--                    elif platform_ in ["i386", "i686", "32bit"]:
--                        _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
--                        break
--                    elif platform_ in ["aarch64"]:
--                        _add_directory(library_dirs, "/usr/lib64")
--                        _add_directory(library_dirs,
--                                       "/usr/lib/aarch64-linux-gnu")
--                        break
--                    elif platform_ in ["arm", "armv7l"]:
--                        _add_directory(library_dirs,
--                                       "/usr/lib/arm-linux-gnueabi")
--                        break
--                    elif platform_ in ["ppc64"]:
--                        _add_directory(library_dirs, "/usr/lib64")
--                        _add_directory(library_dirs,
--                                       "/usr/lib/ppc64-linux-gnu")
--                        _add_directory(library_dirs,
--                                       "/usr/lib/powerpc64-linux-gnu")
--                        break
--                    elif platform_ in ["ppc"]:
--                        _add_directory(library_dirs, "/usr/lib/ppc-linux-gnu")
--                        _add_directory(library_dirs,
--                                       "/usr/lib/powerpc-linux-gnu")
--                        break
--                    elif platform_ in ["s390x"]:
--                        _add_directory(library_dirs, "/usr/lib64")
--                        _add_directory(library_dirs,
--                                       "/usr/lib/s390x-linux-gnu")
--                        break
--                    elif platform_ in ["s390"]:
--                        _add_directory(library_dirs, "/usr/lib/s390-linux-gnu")
--                        break
--                else:
--                    raise ValueError(
--                        "Unable to identify Linux platform: `%s`" % platform_)
--
--                # XXX Kludge. Above /\ we brute force support multiarch. Here we
--                # try Barry's more general approach. Afterward, something should
--                # work ;-)
--                self.add_multiarch_paths()
--
--        elif sys.platform.startswith("gnu"):
--            self.add_multiarch_paths()
--
--        elif sys.platform.startswith("freebsd"):
--            _add_directory(library_dirs, "/usr/local/lib")
--            _add_directory(include_dirs, "/usr/local/include")
--
--        elif sys.platform.startswith("netbsd"):
--            _add_directory(library_dirs, "/usr/pkg/lib")
--            _add_directory(include_dirs, "/usr/pkg/include")
--
--        elif sys.platform.startswith("sunos5"):
--            _add_directory(library_dirs, "/opt/local/lib")
--            _add_directory(include_dirs, "/opt/local/include")
--
--        # FIXME: check /opt/stuff directories here?
--
--        # standard locations
--        if not self.disable_platform_guessing:
--            _add_directory(library_dirs, "/usr/local/lib")
--            _add_directory(include_dirs, "/usr/local/include")
--
--            _add_directory(library_dirs, "/usr/lib")
--            _add_directory(include_dirs, "/usr/include")
--            # alpine, at least
--            _add_directory(library_dirs, "/lib")
--
--        # on Windows, look for the OpenJPEG libraries in the location that
--        # the official installer puts them
--        if sys.platform == "win32":
--            program_files = os.environ.get('ProgramFiles', '')
--            best_version = (0, 0)
--            best_path = None
--            for name in os.listdir(program_files):
--                if name.startswith('OpenJPEG '):
--                    version = tuple([int(x) for x in name[9:].strip().split(
--                        '.')])
--                    if version > best_version:
--                        best_version = version
--                        best_path = os.path.join(program_files, name)
--
--            if best_path:
--                _dbg('Adding %s to search list', best_path)
--                _add_directory(library_dirs, os.path.join(best_path, 'lib'))
--                _add_directory(include_dirs,
--                               os.path.join(best_path, 'include'))
--
--        #
-         # insert new dirs *before* default libs, to avoid conflicts
-         # between Python PYD stub libs and real libraries
diff --git a/lang/python-attrs/Makefile b/lang/python-attrs/Makefile
deleted file mode 100644 (file)
index 8720158..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=attrs
-PKG_VERSION:=16.2.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/6b/71/1682316894ed80b362b9102e7a10997136d8dc1213c36a9f0515c451373a
-PKG_MD5SUM:=442b73d049af046ced010671b7bfd0e9
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-attrs
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-attrs
-       URL:=https://attrs.readthedocs.org/
-       DEPENDS:=+python-light
-endef
-
-define Package/python-attrs/description
-attrs is an MIT-licensed Python package with class decorators that ease
-the chores of implementing the most common attribute-related object
-protocols.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
-endef
-
-$(eval $(call PyPackage,python-attrs))
-$(eval $(call BuildPackage,python-attrs))
diff --git a/lang/python-cffi/Makefile b/lang/python-cffi/Makefile
deleted file mode 100644 (file)
index b6d15fd..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=cffi
-PKG_VERSION:=1.8.3
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/0a/f3/686af8873b70028fccf67b15c78fd4e4667a3da995007afc71e786d61b0a
-PKG_MD5SUM:=c8e877fe0426a99d0cf5872cf2f95b27
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-HOST_BUILD_DEPENDS:=libffi/host python/host python-setuptools/host python-pycparser/host
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/host-build.mk
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python-host.mk)
-
-define Package/python-cffi
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-cffi
-       URL:=http://cffi.readthedocs.org/
-       DEPENDS:=+libffi +python-light +python-pycparser
-endef
-
-define Package/python-cffi/description
-Foreign Function Interface for Python calling C code.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
-endef
-
-define Host/Compile
-       $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
-endef
-
-define Host/Install
-endef
-
-$(eval $(call HostBuild))
-
-$(eval $(call PyPackage,python-cffi))
-$(eval $(call BuildPackage,python-cffi))
diff --git a/lang/python-crcmod/Makefile b/lang/python-crcmod/Makefile
deleted file mode 100644 (file)
index 03b9d6a..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=python-crcmod
-PKG_VERSION:=1.7
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Micke Prag <micke.prag@telldus.se>
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=crcmod-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pypi.python.org/packages/source/c/crcmod/
-PKG_MD5SUM:=2d5b92117d958dcead94f9e17f54cd32
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/crcmod-$(PKG_VERSION)
-PKG_BUILD_DEPENDS:=python
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-crcmod
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=python-crcmod
-  URL:=http://crcmod.sourceforge.net/
-  DEPENDS:=+python-light
-endef
-
-define Package/python-crcmod/description
-  The software in this package is a Python module for generating objects that compute the Cyclic Redundancy Check (CRC). There is no attempt in this package to explain how the CRC works. There are a number of resources on the web that give a good explanation of the algorithms. Just do a Google search for "crc calculation" and browse till you find what you need. Another resource can be found in chapter 20 of the book "Numerical Recipes in C" by Press et. al.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="$(PKG_INSTALL_DIR)/usr")
-endef
-
-define Package/python-crcmod/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,python-crcmod))
diff --git a/lang/python-crypto/Makefile b/lang/python-crypto/Makefile
deleted file mode 100644 (file)
index e0a3b7b..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Copyright (C) 2009-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:=pycrypto
-PKG_VERSION:=2.6.1
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/
-PKG_MD5SUM:=55a61a054aa66812daf5161a0d5d7eda
-
-PKG_LICENSE:=Public Domain
-PKG_LICENSE_FILES:=COPYRIGHT
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-crypto
-       SECTION:=lang-python
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-crypto
-       URL:=http://www.pycrypto.org/
-       DEPENDS:=+python +libgmp
-endef
-
-define Package/python-crypto/description
-A collection of both secure hash functions (such as MD5 and SHA),
-and various encryption algorithms (AES, DES, IDEA, RSA, ElGamal, etc.).
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,\
-               install --prefix=/usr --root=$(PKG_INSTALL_DIR),\
-               CONFIG_BIG_ENDIAN="$(CONFIG_BIG_ENDIAN)" \
-       )
-endef
-
-define Package/python-crypto/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/
-       $(CP) \
-               $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-               $(1)$(PYTHON_PKG_DIR)/
-endef
-
-$(eval $(call PyPackage,python-crypto))
-$(eval $(call BuildPackage,python-crypto))
diff --git a/lang/python-crypto/patches/001-no-host-paths.patch b/lang/python-crypto/patches/001-no-host-paths.patch
deleted file mode 100644 (file)
index d481627..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/setup.py
-+++ b/setup.py
-@@ -370,7 +370,7 @@ kw = {'name':"pycrypto",
-       'ext_modules': plat_ext + [
-             # _fastmath (uses GNU mp library)
-             Extension("Crypto.PublicKey._fastmath",
--                      include_dirs=['src/','/usr/include/'],
-+                      include_dirs=['src/'],
-                       libraries=['gmp'],
-                       sources=["src/_fastmath.c"]),
diff --git a/lang/python-crypto/patches/002-fix-endianness-detect.patch b/lang/python-crypto/patches/002-fix-endianness-detect.patch
deleted file mode 100644 (file)
index baed012..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/setup.py
-+++ b/setup.py
-@@ -100,6 +100,10 @@
-         w(kwd.get("end", "\n"))
- def endianness_macro():
-+    if os.environ["CONFIG_BIG_ENDIAN"] == "y":
-+        return ('PCT_BIG_ENDIAN', 1)
-+    else:
-+        return ('PCT_LITTLE_ENDIAN', 1)
-     s = struct.pack("@I", 0x33221100)
-     if s == "\x00\x11\x22\x33".encode():     # little endian
-         return ('PCT_LITTLE_ENDIAN', 1)
diff --git a/lang/python-cryptography/Makefile b/lang/python-cryptography/Makefile
deleted file mode 100644 (file)
index d657089..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=cryptography
-PKG_VERSION:=1.5.1
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/21/e1/37fc14f9d77924e84ba0dcb88eb8352db914583af229287c6c965d66ba0d
-PKG_MD5SUM:=66a3e01f5f436d2413ef47b7e6bb7729
-
-PKG_BUILD_DEPENDS:=python-cffi/host
-
-PKG_LICENSE:=Apache-2.0 BSD-3-Clause
-PKG_LICENSE_FILES:=LICENSE.APACHE LICENSE.BSD
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-cryptography
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-cryptography
-       URL:=https://github.com/pyca/cryptography
-       DEPENDS:=+libopenssl +python +python-cffi +python-enum34 +python-idna +python-ipaddress +python-pyasn1 +python-six +python-setuptools
-endef
-
-define Package/python-cryptography/description
-cryptography is a package which provides cryptographic recipes and
-primitives to Python developers.  Our goal is for it to be your "cryptographic
-standard library". It supports Python 2.6-2.7, Python 3.3+, and PyPy 2.6+.
-endef
-
-define PyPackage/python-cryptography/filespec
-+|$(PYTHON_PKG_DIR)
--|$(PYTHON_PKG_DIR)/cryptography/hazmat/backends/commoncrypto
--|$(PYTHON_PKG_DIR)/cryptography/hazmat/bindings/commoncrypto
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
-endef
-
-$(eval $(call PyPackage,python-cryptography))
-$(eval $(call BuildPackage,python-cryptography))
diff --git a/lang/python-dateutil/Makefile b/lang/python-dateutil/Makefile
deleted file mode 100644 (file)
index c0d25b8..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=python-dateutil
-PKG_VERSION:=2.5.2
-PKG_RELEASE:=2
-PKG_LICENSE:=BSD-2-Clause
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pypi.python.org/packages/source/p/python-dateutil/
-PKG_MD5SUM:=eafe168e8f404bf384514f5116eedbb6
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-dateutil
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=Extensions to the standard Python datetime module
-  URL:=https://dateutil.readthedocs.org/
-  DEPENDS:=+python +python-six
-endef
-
-define Package/python-dateutil/description
-  Extensions to the standard Python datetime module
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/python-dateutil/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,python-dateutil))
diff --git a/lang/python-dns/Makefile b/lang/python-dns/Makefile
deleted file mode 100644 (file)
index b8658d9..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# 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:=python-dns
-PKG_RELEASE:=2
-PKG_VERSION:=1.15.0
-PKG_SOURCE_URL:=http://www.dnspython.org/kits/$(PKG_VERSION)
-PKG_MD5SUM:=63a679089822fb86127867c315286dc5
-PKG_SOURCE:=dnspython-$(PKG_VERSION).tar.gz
-PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
-PKG_LICENSE:=ISC
-PKG_LICENSE_FILES:=LICENSE
-PKG_BUILD_DIR:=$(BUILD_DIR)/dnspython-$(PKG_VERSION)
-
-PKG_BUILD_DEPENDS:=python-setuptools/host
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-dns
-       SECTION:=language-python
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=dnspython
-       URL:=http://www.dnspython.org/
-       DEPENDS:=+python
-endef
-
-define Package/python-dns/description
- dnspython is a DNS toolkit for Python. It supports almost all record types. It can be used for queries, zone transfers, and dynamic updates. It supports TSIG authenticated messages and EDNS0.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,\
-               install --prefix=/usr --root="$(PKG_INSTALL_DIR)" \
-       )
-endef
-
-$(eval $(call PyPackage,python-dns))
-$(eval $(call BuildPackage,python-dns))
diff --git a/lang/python-egenix-mx-base/Makefile b/lang/python-egenix-mx-base/Makefile
deleted file mode 100644 (file)
index 7fd7c82..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=python-egenix-mx-base
-PKG_VERSION:=3.2.8
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Dmitry Trefilov <the-alien@live.ru>
-PKG_LICENSE:=eGenix.com Public License 1.1.0
-PKG_LICENSE_FILES:=LICENSE COPYRIGHT
-
-PKG_SOURCE:=egenix-mx-base-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://downloads.egenix.com/python/
-PKG_MD5SUM:=9d9d3a25f9dc051a15e97f452413423b
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/egenix-mx-base-$(PKG_VERSION)
-PKG_BUILD_DEPENDS:=python
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-egenix-mx-base
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  DEPENDS:=+USE_EGLIBC:librt +USE_UCLIBC:librt +python
-  TITLE:=Egenix mxBase
-  URL:=http://www.egenix.com/products/python/mxBase/
-endef
-
-define Package/python-egenix-mx-base/description
- The eGenix.com mx Base Distribution for Python is a collection
- of professional quality software tools which enhance Python's
- usability in many important areas such as fast text searching,
- date/time processing and high speed data types.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="$(PKG_INSTALL_DIR)/usr")
-endef
-
-define PyPackage/python-egenix-mx-base/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call PyPackage,python-egenix-mx-base))
-$(eval $(call BuildPackage,python-egenix-mx-base))
diff --git a/lang/python-enum34/Makefile b/lang/python-enum34/Makefile
deleted file mode 100644 (file)
index 4191f2a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=enum34
-PKG_VERSION:=1.1.6
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876
-PKG_MD5SUM:=5f13a0841a61f7fc295c514490d120d0
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILES:=enum/LICENSE
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-enum34
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-enum34
-       URL:=https://pypi.python.org/pypi/enum34/
-       DEPENDS:=+python-light
-endef
-
-define Package/python-enum34/description
-enum34 is the new Python stdlib enum module available in Python 3.4
-backported for previous versions of Python from 2.4 to 3.3.
-endef
-
-define PyPackage/python-enum34/filespec
-+|$(PYTHON_PKG_DIR)
--|$(PYTHON_PKG_DIR)/enum/test.py
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-$(eval $(call PyPackage,python-enum34))
-$(eval $(call BuildPackage,python-enum34))
diff --git a/lang/python-enum34/patches/001-omit-docs.patch b/lang/python-enum34/patches/001-omit-docs.patch
deleted file mode 100644 (file)
index cff6c52..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -r f24487b45cd0 setup.py
---- a/setup.py Sun May 15 20:28:23 2016 -0700
-+++ b/setup.py Wed Jul 27 22:49:13 2016 +0800
-@@ -63,15 +63,6 @@
-         version='1.1.6',\r
-         url='https://bitbucket.org/stoneleaf/enum34',\r
-         packages=['enum'],\r
--        package_data={\r
--            'enum' : [\r
--                'LICENSE',\r
--                'README',\r
--                'doc/enum.rst',\r
--                'doc/enum.pdf',\r
--                'test.py',\r
--                ]\r
--            },\r
-         license='BSD License',\r
-         description='Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4',\r
-         long_description=long_desc,\r
diff --git a/lang/python-gmpy2/Makefile b/lang/python-gmpy2/Makefile
deleted file mode 100644 (file)
index 8337825..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gmpy2
-PKG_VERSION:=2.0.8
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
-PKG_SOURCE_URL:=https://pypi.python.org/packages/90/f4/9a2e384b325b69bc5827b9a6510a8fb4a51698c915c06a3f25a86458892a
-PKG_MD5SUM:=56d40bddcf8f22be0a36d60f764f3241
-
-PKG_LICENSE:=LGPL-3.0+
-PKG_LICENSE_FILES:=COPYING.LESSER
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-gmpy2
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-gmpy2
-       URL:=http://code.google.com/p/gmpy/
-       DEPENDS:=+libgmp +python-light
-endef
-
-define Package/python-gmpy2/description
-gmpy2 is a C-coded Python extension module that supports multiple-precision
-arithmetic. gmpy2 is the successor to the original gmpy module. The gmpy module
-only supported the GMP multiple-precision library. gmpy2 adds support for the
-MPFR (correctly rounded real floating-point arithmetic) and MPC (correctly
-rounded complex floating-point arithmetic) libraries. gmpy2 also updates the
-API and naming conventions to be more consistent and support the additional
-functionality.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" --nompfr)
-endef
-
-$(eval $(call PyPackage,python-gmpy2))
-$(eval $(call BuildPackage,python-gmpy2))
diff --git a/lang/python-idna/Makefile b/lang/python-idna/Makefile
deleted file mode 100644 (file)
index d954096..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=idna
-PKG_VERSION:=2.1
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/i/idna
-PKG_MD5SUM:=f6473caa9c5e0cc1ad3fd5d04c3c114b
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILES:=LICENSE.rst
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-idna
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-idna
-       URL:=https://github.com/kjd/idna
-       DEPENDS:=+python-light
-endef
-
-define Package/python-idna/description
-A library to support the Internationalised Domain Names in Applications
-(IDNA) protocol as specified in RFC 5891. This version of the protocol
-is often referred to as "IDNA2008" and can produce different results
-from the earlier standard from 2003.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-$(eval $(call PyPackage,python-idna))
-$(eval $(call BuildPackage,python-idna))
diff --git a/lang/python-ipaddress/Makefile b/lang/python-ipaddress/Makefile
deleted file mode 100644 (file)
index ccc1280..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=ipaddress
-PKG_VERSION:=1.0.17
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/bb/26/3b64955ff73f9e3155079b9ed31812afdfa5333b5c76387454d651ef593a
-PKG_MD5SUM:=8bbf0326719fafb1f453921ef96729fe
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-PKG_LICENSE:=Python-2.0
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-ipaddress
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-ipaddress
-       URL:=https://github.com/phihag/ipaddress
-       DEPENDS:=+python-light
-endef
-
-define Package/python-ipaddress/description
-Python 3.3+'s ipaddress for Python 2.6, 2.7, 3.2.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-$(eval $(call PyPackage,python-ipaddress))
-$(eval $(call BuildPackage,python-ipaddress))
diff --git a/lang/python-ldap/Makefile b/lang/python-ldap/Makefile
deleted file mode 100644 (file)
index 8def134..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=python-ldap
-PKG_VERSION:=2.4.25
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Dmitry Trefilov <the-alien@live.ru>
-PKG_LICENSE:=Python-style
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/$(PKG_NAME)
-PKG_MD5SUM:=21523bf21dbe566e0259030f66f7a487
-
-PKG_BUILD_DEPENDS:=python libopenldap
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-ldap
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  DEPENDS:=+libopenldap +python
-  TITLE:=Python modules for implementing LDAP clients
-  URL:=http://python-ldap.org/
-endef
-
-define Package/python-ldap/description
-  python-ldap provides an object-oriented API to access LDAP directory
-  servers from Python programs. Mainly it wraps the OpenLDAP 2.x libs
-  for that purpose. Additionally the package contains modules for
-  other LDAP-related stuff (e.g. processing LDIF, LDAPURLs, LDAPv3
-  schema, LDAPv3 extended operations and controls, etc.).
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,build_ext \
-               --include-dirs="$(STAGING_DIR)/usr/include:$(STAGING_DIR)/usr/include/sasl" \
-               --library-dirs="$(STAGING_DIR)/usr/lib:$(STAGING_DIR)/usr/lib/sasl2" \
-       build_py \
-       install --prefix="$(PKG_INSTALL_DIR)/usr")
-endef
-
-define PyPackage/python-ldap/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call PyPackage,python-ldap))
-$(eval $(call BuildPackage,python-ldap))
diff --git a/lang/python-ldap/patches/010-setup_cfg.patch b/lang/python-ldap/patches/010-setup_cfg.patch
deleted file mode 100644 (file)
index 372e9d2..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-From: Dmitrij Trefilov <the-alien@live.ru>
-
-Subject: [PATCH] lang: removed hardcoded include and library directories from setup.cfg
-Signed-off-by: Dmitrij Trefilov <the-alien@live.ru>
----
---- a/setup.cfg
-+++ b/setup.cfg
-@@ -1,6 +1,6 @@
- [_ldap]
--library_dirs = /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64
--include_dirs = /usr/include /usr/include/sasl /usr/local/include /usr/local/include/sasl
-+library_dirs = 
-+include_dirs = 
- defines = HAVE_SASL HAVE_TLS HAVE_LIBLDAP_R
- extra_compile_args = 
- extra_objects = 
diff --git a/lang/python-mysql/Makefile b/lang/python-mysql/Makefile
deleted file mode 100644 (file)
index 04ebe5b..0000000
+++ /dev/null
@@ -1,50 +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:=MySQL-python
-PKG_VERSION:=1.2.5
-PKG_RELEASE:=1
-PKG_LICENSE:=GPL-2.0
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/M/MySQL-python/
-PKG_MD5SUM:=654f75b302db6ed8dc5a898c625e030c
-
-PKG_BUILD_DEPENDS:=python python-setuptools libmysqlclient
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-mysql
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=MySQL database adapter for Python
-  URL:=https://pypi.python.org/pypi/MySQL-python
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  DEPENDS:=+python +libmysqlclient
-endef
-
-define Package/python-mysql/description
- MySQLdb is an thread-compatible interface to the popular MySQL database
- server that provides the Python database API.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/python-mysql/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,python-mysql))
diff --git a/lang/python-mysql/patches/010-threadsafe.patch b/lang/python-mysql/patches/010-threadsafe.patch
deleted file mode 100644 (file)
index bcd9af8..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- MySQL-python-1.2.2/site_orig.cfg   2007-08-15 12:58:40.000000000 +0200
-+++ MySQL-python-1.2.2/site.cfg        2007-08-15 12:58:49.000000000 +0200
-@@ -4,7 +4,7 @@
- # static: link against a static library (probably required for embedded)
- embedded = False
--threadsafe = True
-+threadsafe = False
- static = False
- # The path to mysql_config.
diff --git a/lang/python-packages/Makefile b/lang/python-packages/Makefile
deleted file mode 100644 (file)
index 701f0e6..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#
-# Copyright (C) 2016 Yousong Zhou <yszhou4tech@gmail.com>
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=python-packages
-PKG_VERSION:=1.0
-PKG_RELEASE:=1
-
-PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
-
-#
-# NOTE: move the host module installation to Host/Compile when
-# HOST_CONFIG_DEPENDS is supported
-#
-# NOTE: PKG_CONFIG_DEPENDS cannot correctly track changes of string type config
-# options, so you may want to do manual cleanup on config change.
-#
-PKG_CONFIG_DEPENDS:= \
-       CONFIG_PACKAGE_python-packages-list-host \
-       CONFIG_PACKAGE_python-packages-list \
-       CONFIG_PACKAGE_python-packages-list-cleanup \
-       CONFIG_PACKAGE_python-packages-envs \
-       CONFIG_PACKAGE_python-packages-extra-deps \
-       CONFIG_PACKAGE_python-packages-index-url \
-       CONFIG_PACKAGE_python-packages-pip-opts \
-
-PKG_BUILD_DEPENDS:=python python-pip/host
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-host.mk)
-$(call include_mk, python-package.mk)
-
-define Package/python-packages
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=A dummy package for packaging python modules with pip
-  DEPENDS:=@DEVEL +python
-endef
-
-define Package/python-packages/config
-if PACKAGE_python-packages
-config PACKAGE_python-packages-list-host
-       string "List of python packages to install on host"
-config PACKAGE_python-packages-list
-       string "List of python packages to install on target"
-config PACKAGE_python-packages-list-cleanup
-       string "List of python packages to cleanup to avoid clash with existing packages"
-config PACKAGE_python-packages-envs
-       string "Extra environment variables to pass on to pip and its children on target build"
-config PACKAGE_python-packages-extra-deps
-       string "List of deps fulfilled but not tracked by the build system"
-config PACKAGE_python-packages-index-url
-       string "Index URL passed to pip with --index-url"
-config PACKAGE_python-packages-pip-opts
-       string "Additional arguments to pip command line"
-endif
-endef
-
-CONFIG_PACKAGE_python-packages-list-host:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-list-host))
-CONFIG_PACKAGE_python-packages-list:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-list))
-CONFIG_PACKAGE_python-packages-list-cleanup:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-list-cleanup))
-CONFIG_PACKAGE_python-packages-envs:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-envs))
-CONFIG_PACKAGE_python-packages-extra-deps:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-extra-deps))
-CONFIG_PACKAGE_python-packages-pip-opts:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-pip-opts))
-
-HOST_PYTHON_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON_VERSION)
-
-decr=$(word $(1),0 1 2 3 4 5 6 7 8 9 10)
-recur=$(if $(subst 0,,$(2)),$(call recur,$(1),$(call decr,$(2)),$(call $(1)$(2),$(3))),$(3))
-_req2dir1=$(subst >,gt,$(1))
-_req2dir2=$(subst <,lt,$(1))
-_req2dir3=$(subst >=,geq,$(1))
-_req2dir4=$(subst <=,leq,$(1))
-_req2dir5=$(subst ://,:::,$(1))
-_req2dir6=$(subst *,_,$(1))
-_req2dir7=$(subst ?,_,$(1))
-req2dir=$(call recur,_req2dir,7,$(1))
-
-# --ignore-installed, it may happen that host pip will ignore target install if
-#  it was already installed as host module, e.g. cffi deps of cryptograph
-HOST_PYTHON_PIP_INSTALL=$(HOST_PYTHON_PIP) install \
-       --root=$(1) \
-       --prefix=$(2) \
-       --ignore-installed \
-       --no-compile \
-       $(if $(CONFIG_PACKAGE_python-packages-index-url), --index-url $(CONFIG_PACKAGE_python-packages-index-url)) \
-       $(if $(CONFIG_PACKAGE_python-packages-pip-opts), $(CONFIG_PACKAGE_python-packages-pip-opts)) \
-
-HOST_PYTHON_PIP_INSTALL_HOST:=$(call HOST_PYTHON_PIP_INSTALL,$(STAGING_DIR_HOSTPKG),"")
-HOST_PYTHON_PIP_INSTALL_TARGET=$(call HOST_PYTHON_PIP_INSTALL,$(PKG_INSTALL_DIR)/$(call req2dir,$(pkg)),/usr)
-HOST_PYTHON_PIP_INSTALL_CLEANUP:=$(call HOST_PYTHON_PIP_INSTALL,$(PKG_INSTALL_DIR)/_cleanup,/usr)
-
-define Build/Compile
-       $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list-host),
-               $(call Build/Compile/HostPyRunHost,,$(HOST_PYTHON_PIP_INSTALL_HOST) $(pkg))
-       )
-       $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list),
-               $(call Build/Compile/HostPyRunTarget,,$(call HOST_PYTHON_PIP_INSTALL_TARGET,$(pkg)) $(pkg),$(CONFIG_PACKAGE_python-packages-envs))
-       )
-       $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list-cleanup),
-               $(call Build/Compile/HostPyRunTarget,,$(HOST_PYTHON_PIP_INSTALL_CLEANUP) $(pkg),$(CONFIG_PACKAGE_python-packages-envs))
-       )
-endef
-
-define Package/python-packages/install
-       $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list),
-               $(CP) "$(PKG_INSTALL_DIR)/$(call req2dir,$(pkg))"/* $(1)
-       )
-
-       find "$(PKG_INSTALL_DIR)/_cleanup" -mindepth 1 -depth | while read sf; do \
-               tf="$$$${sf#$(PKG_INSTALL_DIR)/_cleanup/}"; \
-               tf="$(1)/$$$$tf"; \
-               if [ -f "$$$$tf" -o -L "$$$$tf" ]; then \
-                       rm -vf "$$$$tf"; \
-               elif [ -d "$$$$tf" ]; then \
-                       rmdir -v -p "$$$$tf" || true; \
-               fi \
-       done
-endef
-
-define Package/python-packages/extra_provides
-       echo $(CONFIG_PACKAGE_python-packages-extra-deps) | tr ' ' '\n'
-endef
-
-$(eval $(call BuildPackage,python-packages))
diff --git a/lang/python-packages/README.md b/lang/python-packages/README.md
deleted file mode 100644 (file)
index 3c09d8e..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-This package allows users to package python modules without creating package
-Makefiles for each individual module and their dependencies.  It provides a
-way making packaging python packages faster and may also facilitate the process
-of developing Makefiles for new python packages
-
-This is a raw DEVEL only package.  Using it may entail a lot of implementation
-details and you may need to resolve target dependencies and package details on
-your own
-
-- Third party python packages may depend on features not included in e.g.
-  python-light
-- Some python modules may require host install of another module to progress,
-  e.g. target cryptography requires host cffi
-- Some python modules have external C library dependencies, e.g. pyOpenSSL
-  requires openssl libs
-- Some packages may have an autoconf configure script whose arguments we
-  cannot control with pip and has to be passed on (hacked) by overriding some
-  environment variables
-
-## How it works
-
-1. Install host modules required for building target modules
-2. Install each target module to separate directories
-3. Install another copy of modules for cleanup purposes to make list of
-   installed files to be removed from target modules installed in step 2
-
-Why should it be so
-
-1. Installing target cryptography requires host installation of cffi module
-2. cryptography requires setuptools and pip will install its own copy with
-   --ignore-installed.  When PACKAGE_python-setuptools is also selected, opkg
-   will complain of data file clashes if it was not removed here.
-
-Pip will handle dependency requirements of python modules, but external
-dependencies like c libraries has to be prepared by the build system.  The
-issue is that there is currently no way to express such dependencies, thus may
-cause build failure, e.g. pycrypto requires the presence of libgmp to build
-successfully.
-
-## Tips
-
-If something goes wrong, we can add additional arguments to pip command
-line to check the detailed build process.  Some useful arguments may be
-
-- -v, for verbose output.  Repeat this option if the current level of
-  verbosity is not enough
-- --no-clean, for preserving pip build dir on build failure
-
-## Examples
-
-tornado (python-only module)
-
-       CONFIG_PACKAGE_python-packages=y
-       CONFIG_PACKAGE_python-packages-list="tornado==4.4.2"
-
-cryptography (requires installation of host modules and cleanup on target modules)
-
-       CONFIG_PACKAGE_python-packages=y
-       CONFIG_PACKAGE_python-packages-list-host="cffi"
-       CONFIG_PACKAGE_python-packages-list="cryptography"
-       CONFIG_PACKAGE_python-packages-list-cleanup="setuptools"
-
-pycrypto 2.7a1 (python module with autoconf configure script; depends on
-libgmp; broken wmmintrin.h).  2.6.1 does not work because of a flaw in
-the setup.py hardcoding host include directory
-
-       CONFIG_PACKAGE_libgmp=y
-       CONFIG_PACKAGE_python-packages=y
-       CONFIG_PACKAGE_python-packages-list="https://github.com/dlitz/pycrypto/archive/v2.7a1.tar.gz"
-       CONFIG_PACKAGE_python-packages-envs="ac_cv_header_wmmintrin_h=no build_alias=$(GNU_HOST_NAME) host_alias=$(GNU_TARGET_NAME) target_alias=$(GNU_TARGET_NAME)"
-       CONFIG_PACKAGE_python-packages-extra-deps="libgmp.so.10"
-
diff --git a/lang/python-parsley/Makefile b/lang/python-parsley/Makefile
deleted file mode 100644 (file)
index 75df427..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=Parsley
-PKG_VERSION:=1.3
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/P/Parsley
-PKG_MD5SUM:=92bc256e5f73810a609dc7874637ad31
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-parsley
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-parsley
-       URL:=http://launchpad.net/parsley
-       DEPENDS:=+python-light
-endef
-
-define Package/python-parsley/description
-Parsing and pattern matching made easy.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
-endef
-
-$(eval $(call PyPackage,python-parsley))
-$(eval $(call BuildPackage,python-parsley))
diff --git a/lang/python-parsley/patches/001-omit-tests.patch b/lang/python-parsley/patches/001-omit-tests.patch
deleted file mode 100644 (file)
index 71bd021..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Nur a/setup.py b/setup.py
---- a/setup.py 2015-09-09 10:45:25.000000000 +0800
-+++ b/setup.py 2015-12-01 17:31:03.143409843 +0800
-@@ -14,7 +14,6 @@
-     author_email="washort42@gmail.com",
-     license="MIT License",
-     long_description=open("README").read(),
--    packages=["ometa", "terml", "ometa._generated", "terml._generated",
--              "ometa.test", "terml.test"],
-+    packages=["ometa", "terml", "ometa._generated", "terml._generated"],
-     py_modules=["parsley"]
- )
diff --git a/lang/python-pcapy/Makefile b/lang/python-pcapy/Makefile
deleted file mode 100644 (file)
index 4164ba8..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=python-pcapy
-PKG_VERSION:=0.10.10
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Andrew McConachie <andrew@depht.com>
-PKG_LICENSE:=Apache-1.1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/CoreSecurity/pcapy.git
-PKG_SOURCE_VERSION:=37179f5b6187ec58d3ba11ef7b24e3c341cbabbb
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-pcapy
-       SECTION:=language-python
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-pcapy
-       URL:=https://www.coresecurity.com/corelabs-research/open-source-tools/pcapy
-       DEPENDS:=+python +libpcap +libstdcpp
-endef
-
-define Package/python-pcapy/description
- Pcapy is a Python extension module that interfaces with the libpcap packet capture library. Pcapy enables python scripts to capture packets on the network. Pcapy is highly effective when used in conjunction with a packet-handling package such as Impacket, which is a collection of Python classes for constructing and dissecting network packets.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,\
-               install --prefix=/usr --root="$(PKG_INSTALL_DIR)" \
-       )
-endef
-
-$(eval $(call PyPackage,python-pcapy))
-$(eval $(call BuildPackage,python-pcapy))
diff --git a/lang/python-pip/Makefile b/lang/python-pip/Makefile
deleted file mode 100644 (file)
index 2099e63..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# 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:=python-pip
-PKG_VERSION:=8.1.2
-PKG_RELEASE:=1
-
-PKG_SOURCE:=pip-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/
-PKG_MD5SUM:=87083c0b9867963b29f7aba3613e8f4a
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/python-pip-$(PKG_VERSION)
-PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
-HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/python-pip-$(PKG_VERSION)
-HOST_UNPACK=$(HOST_TAR) -C $(HOST_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
-PKG_USE_MIPS16:=0
-
-HOST_BUILD_DEPENDS:=python python/host python-setuptools/host
-
-include $(INCLUDE_DIR)/host-build.mk
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python-host.mk)
-
-define Package/python-pip
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Tool for installing Python packages.
-  URL:=https://pip.pypa.io
-  DEPENDS:=+python +python-setuptools +ca-certificates
-  MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
-endef
-
-define Package/python-pip/description
-  A tool for installing and managing Python packages.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,\
-               install --root="$(PKG_INSTALL_DIR)" --prefix="/usr" \
-               --single-version-externally-managed \
-       )
-endef
-
-define PyPackage/python-pip/filespec
-+|$(PYTHON_PKG_DIR)
--|$(PYTHON_PKG_DIR)/pip/_vendor/distlib/*.exe
-endef
-
-define PyPackage/python-pip/install
-       $(INSTALL_DIR) $(1)/usr/bin $(1)/etc
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
-       $(INSTALL_CONF) ./files/pip.conf $(1)/etc/
-endef
-
-define Host/Compile
-       $(call Build/Compile/HostPyMod,,\
-               install --root="$(STAGING_DIR_HOSTPKG)" --prefix="" \
-               --single-version-externally-managed \
-       )
-endef
-
-define Host/Install
-endef
-
-$(eval $(call HostBuild))
-
-$(eval $(call PyPackage,python-pip))
-$(eval $(call BuildPackage,python-pip))
diff --git a/lang/python-pip/files/pip.conf b/lang/python-pip/files/pip.conf
deleted file mode 100644 (file)
index 89339e9..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-[global]
-cache-dir=/tmp/.cache
-log-file=/tmp/pip-log.txt
diff --git a/lang/python-ply/Makefile b/lang/python-ply/Makefile
deleted file mode 100644 (file)
index 0b0e553..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=ply
-PKG_VERSION:=3.9
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.dabeaz.com/ply
-PKG_MD5SUM:=c5c5767376eff902617fd9874f0c76b7
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-HOST_BUILD_DEPENDS:=python/host python-setuptools/host
-
-PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILES:=README.md
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/host-build.mk
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python-host.mk)
-
-define Package/python-ply
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-ply
-       URL:=http://www.dabeaz.com/ply/
-       DEPENDS:=+python-light
-endef
-
-define Package/python-ply/description
-PLY is a 100% Python implementation of the common parsing tools lex
-and yacc.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
-endef
-
-define Host/Compile
-       $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
-endef
-
-define Host/Install
-endef
-
-$(eval $(call HostBuild))
-
-$(eval $(call PyPackage,python-ply))
-$(eval $(call BuildPackage,python-ply))
diff --git a/lang/python-psycopg2/Makefile b/lang/python-psycopg2/Makefile
deleted file mode 100644 (file)
index cf7ada8..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=python-psycopg2
-PKG_VERSION:=2.6.2
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Dmitry Trefilov <the-alien@live.ru>
-PKG_LICENSE:=LGPL-3.0+
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_SOURCE:=psycopg2-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://initd.org/psycopg/tarballs/PSYCOPG-2-6/
-PKG_MD5SUM:=4a392949ba31a378a18ed3e775a4693f
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/psycopg2-$(PKG_VERSION)
-PKG_BUILD_DEPENDS:=python libpq python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-psycopg2
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=PostgreSQL database adapter for Python
-  URL:=http://www.initd.org/
-  DEPENDS:=+python +libpq +python-egenix-mx-base
-endef
-
-define Package/python-psycopg2/description
- Psycopg is the most popular PostgreSQL adapter for the Python programming language
-endef
-
-define Build/Compile
-       # The PATH var is required so that psycopg2's setup.py script finds pg_config
-       $(call Build/Compile/PyMod,., \
-               install --prefix=/usr --root=$(PKG_INSTALL_DIR), \
-               PATH=$(STAGING_DIR)/usr/bin:$(PATH))
-endef
-
-define Package/python-psycopg2/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call PyPackage,python-psycopg2))
-$(eval $(call BuildPackage,python-psycopg2))
diff --git a/lang/python-pyasn1-modules/Makefile b/lang/python-pyasn1-modules/Makefile
deleted file mode 100644 (file)
index bc4142b..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=pyasn1-modules
-PKG_VERSION:=0.0.8
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pyasn1-modules
-PKG_MD5SUM:=178129bc7fbf07215c25230c5f053f81
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-PKG_LICENSE:=BSD-2-Clause
-PKG_LICENSE_FILES:=LICENSE.txt
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-pyasn1-modules
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-pyasn1-modules
-       URL:=http://sourceforge.net/projects/pyasn1/
-       DEPENDS:=+python-light +python-pyasn1
-endef
-
-define Package/python-pyasn1-modules/description
-This is a small but growing collection of ASN.1 data structures
-expressed in Python terms using pyasn1 data model.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
-endef
-
-$(eval $(call PyPackage,python-pyasn1-modules))
-$(eval $(call BuildPackage,python-pyasn1-modules))
diff --git a/lang/python-pyasn1/Makefile b/lang/python-pyasn1/Makefile
deleted file mode 100644 (file)
index 07549db..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=pyasn1
-PKG_VERSION:=0.1.9
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pyasn1
-PKG_MD5SUM:=f00a02a631d4016818659d1cc38d229a
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-PKG_LICENSE:=BSD-2-Clause
-PKG_LICENSE_FILES:=LICENSE.txt
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-pyasn1
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-pyasn1
-       URL:=http://pyasn1.sourceforge.net/
-       DEPENDS:=+python-light
-endef
-
-define Package/python-pyasn1/description
-This is an implementation of ASN.1 types and codecs in Python programming
-language. It has been first written to support particular protocol (SNMP)
-but then generalized to be suitable for a wide range of protocols
-based on ASN.1 specification.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-$(eval $(call PyPackage,python-pyasn1))
-$(eval $(call BuildPackage,python-pyasn1))
diff --git a/lang/python-pycparser/Makefile b/lang/python-pycparser/Makefile
deleted file mode 100644 (file)
index 37e6c84..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=pycparser
-PKG_VERSION:=2.14
-PKG_RELEASE:=3
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pycparser
-PKG_MD5SUM:=a2bc8d28c923b4fe2b2c3b4b51a4f935
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-HOST_BUILD_DEPENDS:=python/host python-setuptools/host python-ply/host
-
-PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/host-build.mk
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python-host.mk)
-
-define Package/python-pycparser
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-pycparser
-       URL:=https://github.com/eliben/pycparser
-       DEPENDS:=+python-light +python-ply
-endef
-
-define Package/python-pycparser/description
-pycparser is a parser for the C language, written in pure Python. It is a
-module designed to be easily integrated into applications that need to parse
-C source code.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
-endef
-
-define Host/Compile
-       $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
-endef
-
-define Host/Install
-endef
-
-$(eval $(call HostBuild))
-
-$(eval $(call PyPackage,python-pycparser))
-$(eval $(call BuildPackage,python-pycparser))
diff --git a/lang/python-pycparser/patches/001-use-external-ply.patch b/lang/python-pycparser/patches/001-use-external-ply.patch
deleted file mode 100644 (file)
index 96b1d03..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-diff --git a/pycparser/c_lexer.py b/pycparser/c_lexer.py
-index cbb9d26..cbd7742 100644
---- a/pycparser/c_lexer.py
-+++ b/pycparser/c_lexer.py
-@@ -9,8 +9,8 @@
- import re
- import sys
--from .ply import lex
--from .ply.lex import TOKEN
-+from ply import lex
-+from ply.lex import TOKEN
- class CLexer(object):
-diff --git a/pycparser/c_parser.py b/pycparser/c_parser.py
-index f4f7453..5c0ca88 100644
---- a/pycparser/c_parser.py
-+++ b/pycparser/c_parser.py
-@@ -8,7 +8,7 @@
- #------------------------------------------------------------------------------
- import re
--from .ply import yacc
-+from ply import yacc
- from . import c_ast
- from .c_lexer import CLexer
-diff --git a/setup.py b/setup.py
-index fdccbb3..036a10b 100644
---- a/setup.py
-+++ b/setup.py
-@@ -49,7 +49,7 @@ setup(
-     classifiers = [
-         'Programming Language :: Python :: 2',
-         'Programming Language :: Python :: 3',],
--    packages=['pycparser', 'pycparser.ply'],
-+    packages=['pycparser'],
-     package_data={'pycparser': ['*.cfg']},
-     cmdclass={'install': install, 'sdist': sdist},
- )
diff --git a/lang/python-pyopenssl/Makefile b/lang/python-pyopenssl/Makefile
deleted file mode 100644 (file)
index 85500ad..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=pyOpenSSL
-PKG_VERSION:=16.1.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/15/1e/79c75db50e57350a7cefb70b110255757e9abd380a50ebdc0cfd853b7450
-PKG_MD5SUM:=d8100b0c333f0eeadaf05914da8792a6
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-PKG_LICENSE:=Apache-2.0
-PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-pyopenssl
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-pyopenssl
-       URL:=https://github.com/pyca/pyopenssl
-       DEPENDS:=+python-light +python-cryptography +python-six
-endef
-
-define Package/python-pyopenssl/description
-Python wrapper module around the OpenSSL library
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
-endef
-
-$(eval $(call PyPackage,python-pyopenssl))
-$(eval $(call BuildPackage,python-pyopenssl))
diff --git a/lang/python-pyptlib/Makefile b/lang/python-pyptlib/Makefile
deleted file mode 100644 (file)
index 8f33246..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=pyptlib
-PKG_VERSION:=0.0.6
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pyptlib
-PKG_MD5SUM:=2fc7b8803777451c1fad3d5e25f1b99c
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-pyptlib
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-pyptlib
-       URL:=https://pypi.python.org/pypi/pyptlib
-       DEPENDS:=+python-light
-endef
-
-define Package/python-pyptlib/description
-A python implementation of the Pluggable Transports for Circumvention
-specification for Tor
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
-endef
-
-$(eval $(call PyPackage,python-pyptlib))
-$(eval $(call BuildPackage,python-pyptlib))
diff --git a/lang/python-pyserial/Makefile b/lang/python-pyserial/Makefile
deleted file mode 100644 (file)
index 03bb533..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=python-pyserial
-PKG_VERSION:=3.1.1
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Micke Prag <micke.prag@telldus.se>
-PKG_LICENSE:=Python-2.0
-
-PKG_SOURCE:=pyserial-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pypi.python.org/packages/3c/d8/a9fa247ca60b02b3bebbd61766b4f321393b57b13c53b18f6f62cf172c08/
-PKG_MD5SUM:=2f72100de3e410b36d575e12e82e9d27
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/pyserial-$(PKG_VERSION)
-PKG_BUILD_DEPENDS:=python
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-pyserial
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=python-pyserial
-  URL:=http://pyserial.sourceforge.net
-  DEPENDS:=+python-light
-endef
-
-define Package/python-pyserial/description
-       serial port python bindings
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root="$(PKG_INSTALL_DIR)")
-endef
-
-define Package/python-pyserial/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,python-pyserial))
diff --git a/lang/python-service-identity/Makefile b/lang/python-service-identity/Makefile
deleted file mode 100644 (file)
index b66927b..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=service_identity
-PKG_VERSION:=16.0.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/s/service_identity
-PKG_MD5SUM:=d52392597b9c44a740abf322bfdb21e6
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-service-identity
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-service-identity
-       URL:=https://github.com/pyca/service_identity
-       DEPENDS:=+python-light +python-attrs +python-pyasn1 +python-pyasn1-modules +python-pyopenssl
-endef
-
-define Package/python-service-identity/description
-service_identity aspires to give you all the tools you need for
-verifying whether a certificate is valid for the intended purposes.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
-endef
-
-$(eval $(call PyPackage,python-service-identity))
-$(eval $(call BuildPackage,python-service-identity))
diff --git a/lang/python-setuptools/Makefile b/lang/python-setuptools/Makefile
deleted file mode 100644 (file)
index 1f31222..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# Copyright (C) 2014-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:=python-setuptools
-PKG_VERSION:=27.2.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=setuptools-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/87/ba/54197971d107bc06f5f3fbdc0d728a7ae0b10cafca46acfddba65a0899d8/
-PKG_MD5SUM:=b39715612fdc0372dbfd7b3fcf5d4fe5
-
-HOST_BUILD_DEPENDS:=python python/host
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
-
-HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
-HOST_UNPACK=$(HOST_TAR) -C $(HOST_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
-
-include $(INCLUDE_DIR)/host-build.mk
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python-host.mk)
-
-define Package/python-setuptools
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Tool for installing Python packages.
-  URL:=https://bitbucket.org/pypa/setuptools
-  DEPENDS:=+python +ca-certificates
-  MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
-endef
-
-define Package/python-setuptools/description
-  Easily download, build, install, upgrade, and uninstall Python packages
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,\
-               install --root="$(PKG_INSTALL_DIR)" --prefix="/usr" \
-               --single-version-externally-managed \
-       )
-endef
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(PYTHON_LIB_DIR)
-       $(CP) \
-               $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-               $(PYTHON_LIB_DIR)
-endef
-
-define PyPackage/python-setuptools/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
-endef
-
-define Host/Compile
-       $(call Build/Compile/HostPyMod,,\
-               install --root="$(STAGING_DIR_HOSTPKG)" --prefix="" \
-               --single-version-externally-managed \
-       )
-endef
-
-define Host/Install
-endef
-
-$(eval $(call HostBuild))
-
-$(eval $(call PyPackage,python-setuptools))
-$(eval $(call BuildPackage,python-setuptools))
-
diff --git a/lang/python-setuptools/patches/0001-remove-windows-support.patch b/lang/python-setuptools/patches/0001-remove-windows-support.patch
deleted file mode 100644 (file)
index 86e5bba..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/setuptools/dist.py b/setuptools/dist.py
-index b004f92..66b9d89 100644
---- a/setuptools/dist.py
-+++ b/setuptools/dist.py
-@@ -17,7 +17,6 @@ from setuptools.extern.six.moves import map
- from pkg_resources.extern import packaging
- from setuptools.depends import Require
--from setuptools import windows_support
- from setuptools.monkey import get_unpatched
- import pkg_resources
-@@ -383,7 +382,6 @@ class Distribution(_Distribution):
-         egg_cache_dir = os.path.join(os.curdir, '.eggs')
-         if not os.path.exists(egg_cache_dir):
-             os.mkdir(egg_cache_dir)
--            windows_support.hide_file(egg_cache_dir)
-             readme_txt_filename = os.path.join(egg_cache_dir, 'README.txt')
-             with open(readme_txt_filename, 'w') as f:
-                 f.write('This directory contains eggs that were downloaded '
diff --git a/lang/python-setuptools/patches/0002-fix-pyvenv-environment-get.patch b/lang/python-setuptools/patches/0002-fix-pyvenv-environment-get.patch
deleted file mode 100644 (file)
index d96ab08..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
-index e8b90c7..8598c44 100755
---- a/setuptools/command/easy_install.py
-+++ b/setuptools/command/easy_install.py
-@@ -1946,6 +1946,8 @@ class CommandSpec(list):
-         Construct a CommandSpec from a parameter to build_scripts, which may
-         be None.
-         """
-+        if os.environ.get('__PYVENV_LAUNCHER__'):
-+            return cls.from_environment()
-         if isinstance(param, cls):
-             return param
-         if isinstance(param, list):
diff --git a/lang/python-six/Makefile b/lang/python-six/Makefile
deleted file mode 100644 (file)
index 9f07049..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=six
-PKG_VERSION:=1.10.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/s/six
-PKG_MD5SUM:=34eed507548117b2ab523ab14b2f8b55
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-six
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-six
-       URL:=https://pypi.python.org/pypi/six
-       DEPENDS:=+python-light
-endef
-
-define Package/python-six/description
-Six is a Python 2 and 3 compatibility library.  It provides utility functions
-for smoothing over the differences between the Python versions with the goal of
-writing Python code that is compatible on both Python versions.  See the
-documentation for more information on what is provided.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-$(eval $(call PyPackage,python-six))
-$(eval $(call BuildPackage,python-six))
diff --git a/lang/python-txsocksx/Makefile b/lang/python-txsocksx/Makefile
deleted file mode 100644 (file)
index d830e6f..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=txsocksx
-PKG_VERSION:=1.15.0.2
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/t/txsocksx
-PKG_MD5SUM:=0266b9ae7b58f7550a49683afebf65ba
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-PKG_LICENSE:=ISC
-PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-txsocksx
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-txsocksx
-       URL:=https://github.com/habnabit/txsocksx
-       DEPENDS:=+python-light +python-parsley +twisted
-endef
-
-define Package/python-txsocksx/description
-txsocksx is SOCKS4/4a and SOCKS5 client endpoints for Twisted 10.1 or
-greater.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,, \
-               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)", \
-               PKG_VERSION="$(PKG_VERSION)" \
-       )
-endef
-
-$(eval $(call PyPackage,python-txsocksx))
-$(eval $(call BuildPackage,python-txsocksx))
diff --git a/lang/python-txsocksx/patches/001-omit-tests.patch b/lang/python-txsocksx/patches/001-omit-tests.patch
deleted file mode 100644 (file)
index dd4acd7..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 7979f89..3873a1e 100644
---- a/setup.py
-+++ b/setup.py
-@@ -35,5 +35,5 @@ setup(
-         'version_module_paths': ['txsocksx/_version.py'],
-     },
-     install_requires=install_requires,
--    packages=['txsocksx', 'txsocksx.test'],
-+    packages=['txsocksx'],
- )
diff --git a/lang/python-txsocksx/patches/002-do-not-use-vcversioner.patch b/lang/python-txsocksx/patches/002-do-not-use-vcversioner.patch
deleted file mode 100644 (file)
index a904db1..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 7979f89..5e1abb3 100644
---- a/setup.py
-+++ b/setup.py
-@@ -1,6 +1,8 @@
- # Copyright (c) Aaron Gallagher <_@habnab.it>
- # See COPYING for details.
-+import os
-+
- from setuptools import setup
-@@ -30,10 +32,11 @@ setup(
-     ],
-     license='ISC',
--    setup_requires=['vcversioner>=1'],
--    vcversioner={
--        'version_module_paths': ['txsocksx/_version.py'],
--    },
-+    #setup_requires=['vcversioner>=1'],
-+    #vcversioner={
-+    #    'version_module_paths': ['txsocksx/_version.py'],
-+    #},
-+    version=os.environ.get('PKG_VERSION'),
-     install_requires=install_requires,
-     packages=['txsocksx', 'txsocksx.test'],
- )
diff --git a/lang/python-urllib3/Makefile b/lang/python-urllib3/Makefile
deleted file mode 100644 (file)
index 5af33c6..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=python-urllib3
-PKG_VERSION:=1.19
-PKG_RELEASE:=1
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=urllib3-$(PKG_VERSION).tar.gz
-PKG_BUILD_DIR:=$(BUILD_DIR)/urllib3-$(PKG_VERSION)/
-PKG_SOURCE_URL:=https://pypi.python.org/packages/08/37/48b443a36af9eda6274f673b70a9140c13e2409edb2ef20b2d8a620efef5/
-PKG_MD5SUM:=4aa7c6c310cd938683e9b1831e110bac
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-urllib3
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=HTTP library with thread-safe connection pooling, file post, and more.
-  URL:=https://urllib3.readthedocs.io/
-  DEPENDS:=+python
-endef
-
-define Package/python-urllib3/description
-  HTTP library with thread-safe connection pooling, file post, and more.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/python-urllib3/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,python-urllib3))
diff --git a/lang/python-yaml/Makefile b/lang/python-yaml/Makefile
deleted file mode 100644 (file)
index 3af2f0e..0000000
+++ /dev/null
@@ -1,43 +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:=PyYAML
-PKG_VERSION:=3.11
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pyyaml.org/download/pyyaml/
-PKG_MD5SUM:=f50e08ef0fe55178479d3a618efe21db
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
-
-PKG_BUILD_DEPENDS:=python
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-yaml
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=YAML parser and emitter for Python
-  URL:=http://pyyaml.org/wiki/PyYAML
-  DEPENDS:=+python +libyaml
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,\
-               --with-libyaml install --prefix="$(PKG_INSTALL_DIR)/usr" \
-       )
-endef
-
-$(eval $(call PyPackage,python-yaml))
-$(eval $(call BuildPackage,python-yaml))
diff --git a/lang/python/Flask/Makefile b/lang/python/Flask/Makefile
new file mode 100644 (file)
index 0000000..5e9dcd5
--- /dev/null
@@ -0,0 +1,43 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=Flask
+PKG_VERSION:=0.12.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/eb/12/1c7bd06fcbd08ba544f25bf2c6612e305a70ea51ca0eda8007344ec3f123/
+PKG_HASH:=49f44461237b69ecd901cc7ce66feea0319b9158743dd27a2899962ab214dac1
+PKG_BUILD_DEPENDS:=python python3
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+
+define Package/python3-flask
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://github.com/pallets/flask/
+  TITLE:=python3-flask
+  DEPENDS:=+python3-asyncio +python3-click +python3-codecs +python3-decimal \
+           +python3-itsdangerous +python3-jinja2 +python3-light +python3-logging \
+           +python3-markupsafe +python3-multiprocessing +python3-werkzeug
+  VARIANT:=python3
+endef
+
+define Package/python3-flask/description
+Flask is a microframework for Python based on Werkzeug, Jinja 2 and good
+intentions. And before you ask: It.s BSD licensed!
+endef
+
+$(eval $(call Py3Package,python3-flask))
+$(eval $(call BuildPackage,python3-flask))
diff --git a/lang/python/Jinja2/Makefile b/lang/python/Jinja2/Makefile
new file mode 100644 (file)
index 0000000..7ef9e0b
--- /dev/null
@@ -0,0 +1,42 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=Jinja2
+PKG_VERSION:=2.9.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/90/61/f820ff0076a2599dd39406dcb858ecb239438c02ce706c8e91131ab9c7f1/
+PKG_HASH:=ddaa01a212cd6d641401cb01b605f4a4d9f37bfc93043d7f760ec70fb99ff9ff
+PKG_BUILD_DEPENDS:=python3
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+
+define Package/python3-jinja2
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://jinja.pocoo.org/
+  TITLE:=python3-jinja2
+  DEPENDS:=+python3-light
+  VARIANT:=python3
+endef
+
+define Package/python3-jinja2/description
+Jinja2 is a full featured template engine for Python. It has full
+unicode support, an optional integrated sandboxed execution
+environment, widely used and BSD licensed.
+endef
+
+$(eval $(call Py3Package,python3-jinja2))
+$(eval $(call BuildPackage,python3-jinja2))
diff --git a/lang/python/Makefile b/lang/python/Makefile
deleted file mode 100644 (file)
index d17b6e1..0000000
+++ /dev/null
@@ -1,264 +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
-
-# 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))
diff --git a/lang/python/MarkupSafe/Makefile b/lang/python/MarkupSafe/Makefile
new file mode 100644 (file)
index 0000000..84cd184
--- /dev/null
@@ -0,0 +1,40 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=MarkupSafe
+PKG_VERSION:=1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/
+PKG_HASH:=a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665
+PKG_BUILD_DEPENDS:=python python3
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+
+define Package/python3-markupsafe
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://github.com/pallets/markupsafe/
+  TITLE:=python3-markupsafe
+  DEPENDS:=+python3-light
+  VARIANT:=python3
+endef
+
+define Package/python3-markupsafe/description
+MarkupSafe implements a XML/HTML/XHTML Markup safe string for Python
+endef
+
+$(eval $(call Py3Package,python3-markupsafe))
+$(eval $(call BuildPackage,python3-markupsafe))
diff --git a/lang/python/Werkzeug/Makefile b/lang/python/Werkzeug/Makefile
new file mode 100644 (file)
index 0000000..0f4a51a
--- /dev/null
@@ -0,0 +1,42 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=Werkzeug
+PKG_VERSION:=0.12.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/56/41/c095a77eb2dd69bf278dd664a97d3416af04e9ba1a00b8c138f772741d31/
+PKG_HASH:=903a7b87b74635244548b30d30db4c8947fe64c5198f58899ddcd3a13c23bb26
+PKG_BUILD_DEPENDS:=python python3
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+
+define Package/python3-werkzeug
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://werkzeug.pocoo.org/
+  TITLE:=python3-werkzeug
+  DEPENDS:=+python3-light +python3-email
+  VARIANT:=python3
+endef
+
+define Package/python3-werkzeug/description
+Werkzeug
+
+The Python WSGI Utility Library
+endef
+
+$(eval $(call Py3Package,python3-werkzeug))
+$(eval $(call BuildPackage,python3-werkzeug))
diff --git a/lang/python/chardet/Makefile b/lang/python/chardet/Makefile
new file mode 100644 (file)
index 0000000..27020c7
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2007-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:=chardet
+PKG_VERSION:=3.0.4
+PKG_RELEASE:=1
+PKG_LICENSE:=LGPL-2.1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/
+PKG_HASH:=84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/chardet
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=Universal encoding detector for Python 2 and 3
+  URL:=https://github.com/chardet/chardet
+  DEPENDS:=+python
+endef
+
+define Package/chardet/description
+  Universal encoding detector for Python 2 and 3
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/chardet/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chardetect \
+           $(1)/usr/bin
+       # fix python exec path in scripts
+       sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/bin/chardetect
+endef
+
+$(eval $(call BuildPackage,chardet))
diff --git a/lang/python/click/Makefile b/lang/python/click/Makefile
new file mode 100644 (file)
index 0000000..0213578
--- /dev/null
@@ -0,0 +1,40 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=click
+PKG_VERSION:=6.7
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/95/d9/c3336b6b5711c3ab9d1d3a80f1a3e2afeb9d8c02a7166462f6cc96570897/
+PKG_HASH:=f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b
+PKG_BUILD_DEPENDS:=python python3
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+
+define Package/python3-click
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://github.com/mitsuhiko/click
+  TITLE:=python3-click
+  DEPENDS:=+python3-light
+  VARIANT:=python3
+endef
+
+define Package/python3-click/description
+A simple wrapper around optparse for powerful command line utilities.
+endef
+
+$(eval $(call Py3Package,python3-click))
+$(eval $(call BuildPackage,python3-click))
diff --git a/lang/python/django-appconf/Makefile b/lang/python/django-appconf/Makefile
new file mode 100644 (file)
index 0000000..874e850
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-appconf
+PKG_VERSION:=1.0.2
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/34/b9/d07195652ab494b026f7cb0341dd6e5f2e6e39be177abe05e2cec8bd46e4/
+PKG_HASH:=6a4d9aea683b4c224d97ab8ee11ad2d29a37072c0c6c509896dd9857466fb261
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/django-appconf
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=A helper class for handling configuration defaults of packaged apps gracefully.
+  URL:=http://django-appconf.readthedocs.org/
+  DEPENDS:=+python +django
+endef
+
+define Package/django-appconf/description
+  A helper class for handling configuration defaults of packaged apps gracefully.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-appconf/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-appconf))
diff --git a/lang/python/django-compressor/Makefile b/lang/python/django-compressor/Makefile
new file mode 100644 (file)
index 0000000..19e0f3e
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-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:=django-compressor
+PKG_VERSION:=2.2
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=django_compressor-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/82/76/1355459f90714517c52f264aa7245b52e59a273ec16e8f8d505fa6c342f8/
+PKG_BUILD_DIR:=$(BUILD_DIR)/django_compressor-$(PKG_VERSION)/
+PKG_HASH:=9616570e5b08e92fa9eadc7a1b1b49639cce07ef392fc27c74230ab08075b30f
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/django-compressor
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=Compresses linked and inline JavaScript or CSS into single cached files.
+  URL:=http://django-compressor.readthedocs.org/
+  DEPENDS:=+python +django
+endef
+
+define Package/django-compressor/description
+  Compresses linked and inline JavaScript or CSS into single cached files.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-compressor/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-compressor))
diff --git a/lang/python/django-constance/Makefile b/lang/python/django-constance/Makefile
new file mode 100644 (file)
index 0000000..359ae8b
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007-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:=django-constance
+PKG_VERSION:=2.0.0
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/8a/37/4fa87dd0e43aa0a66fc419d58e67a9b6da70e1853d646c4b501c1ee7208b/
+PKG_HASH:=6eec9f3ac4e5657b93e64f3379181d1e727088df10dd34f0398cd12119b9f0b0
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/django-constance
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=Django live settings with pluggable backends, including Redis.
+  URL:=https://github.com/jazzband/django-constance
+  DEPENDS:=+python +django
+endef
+
+define Package/django-constance/description
+  Django live settings with pluggable backends, including Redis.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-constance/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-constance))
diff --git a/lang/python/django-jsonfield/Makefile b/lang/python/django-jsonfield/Makefile
new file mode 100644 (file)
index 0000000..d3796d2
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-jsonfield
+PKG_VERSION:=1.0.1
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/e4/b2/a079f0a2218e0eb7892edbf404e0bbfbb281a6bbf06966b775f5142ed159/
+PKG_HASH:=6c0afd5554739365b55d86e285cf966cc3a45682fff963463364ea1f6511ca3e
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/django-jsonfield
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=JSONField for django models
+  URL:=https://github.com/bradjasper/django-jsonfield
+  DEPENDS:=+python +django
+endef
+
+define Package/django-jsonfield/description
+  JSONField for django models
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-jsonfield/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-jsonfield))
diff --git a/lang/python/django-picklefield/Makefile b/lang/python/django-picklefield/Makefile
new file mode 100644 (file)
index 0000000..4566cc6
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007-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:=django-picklefield
+PKG_VERSION:=1.0.0
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/e8/69/232d78ef16cad8dd4c2f871b0f44d87bcde36ed6a90597416e903034600b/
+PKG_HASH:=61e3ba7f6df82d8df9e6be3a8c55ef589eb3bf926c3d25d2b7949b07eae78354
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/django-picklefield
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=Pickled object field for Django
+  URL:=http://github.com/gintas/django-picklefield/
+  DEPENDS:=+python +django
+endef
+
+define Package/django-picklefield/description
+  Pickled object field for Django
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-picklefield/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-picklefield))
diff --git a/lang/python/django-postoffice/Makefile b/lang/python/django-postoffice/Makefile
new file mode 100644 (file)
index 0000000..f3519f4
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-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:=django-postoffice
+PKG_VERSION:=3.0.3
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=django-post_office-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/0f/8c/8c7e1d8998741fd195f7df947c509bc31a03d505aca03488c39e59da11f0/
+PKG_BUILD_DIR:=$(BUILD_DIR)/django-post_office-$(PKG_VERSION)/
+PKG_HASH:=8d691b2e53ba8121d770ce448f05568874cf78a3cf63215918ad49536db5e76a
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/django-postoffice
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=A Django app to monitor and send mail asynchronously, complete with template support.
+  URL:=https://github.com/ui/django-postoffice
+  DEPENDS:=+python +django +django-jsonfield
+endef
+
+define Package/django-postoffice/description
+  A Django app to monitor and send mail asynchronously, complete with template support.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-postoffice/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-postoffice))
diff --git a/lang/python/django-restframework/Makefile b/lang/python/django-restframework/Makefile
new file mode 100644 (file)
index 0000000..fb37b0e
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-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:=django-restframework
+PKG_VERSION:=3.7.1
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=djangorestframework-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/d0/ab/8b991e7d3e26af7cf6327c84b341e60004fc56325d8a4d4019e1474f7456/
+PKG_BUILD_DIR:=$(BUILD_DIR)/djangorestframework-$(PKG_VERSION)
+PKG_HASH:=305b2c6564ca46d3b558ba21110ed717135c467adf1a6dfd192bd85f4bb04d50
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/django-restframework
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=Web APIs for Django, made easy.
+  URL:=http://www.django-rest-framework.org/
+  DEPENDS:=+python +django
+endef
+
+define Package/django-restframework/description
+  Web APIs for Django, made easy.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-restframework/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-restframework))
diff --git a/lang/python/django-statici18n/Makefile b/lang/python/django-statici18n/Makefile
new file mode 100644 (file)
index 0000000..bc24f13
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007-2018 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:=django-statici18n
+PKG_VERSION:=1.6.1
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/0a/24/1bed254529fc492ee5daf4cba18cf188b059866049889ecf1f178f25a2c2/
+PKG_HASH:=47d30939d52bcbbf1cbfe56b786bc2f2ea874266a8315cb027c061f320c4e2f6
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/django-statici18n
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=A Django app that provides helper for generating JavaScript catalog to static files.
+  URL:=http://django-statici18n.readthedocs.org/
+  DEPENDS:=+python +django
+endef
+
+define Package/django-statici18n/description
+  A Django app that provides helper for generating JavaScript catalog to static files.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-statici18n/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-statici18n))
diff --git a/lang/python/django/Makefile b/lang/python/django/Makefile
new file mode 100644 (file)
index 0000000..6d59cdd
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2007-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:=django
+PKG_VERSION:=1.8.18
+PKG_RELEASE=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/django/django.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=2d4bc5a60aa8a076689667c550ded96b87bc463e
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=c82c2cc338ae46ba8572d9960fc98dca932edc43a00f011fed102810a86185ae
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/django
+    SUBMENU:=Python
+    SECTION:=lang
+    CATEGORY:=Languages
+    TITLE:=The web framework for perfectionists with deadlines.
+    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+    URL:=https://www.djangoproject.com/
+    DEPENDS:=+python
+endef
+
+define Package/django/description
+    The web framework for perfectionists with deadlines.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/django-admin.py \
+           $(1)/usr/bin
+endef
+
+define Package/django/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/django-admin.py \
+           $(1)/usr/bin
+       # fix python exec path
+       sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/bin/django-admin.py
+endef
+
+$(eval $(call BuildPackage,django))
diff --git a/lang/python/et_xmlfile/Makefile b/lang/python/et_xmlfile/Makefile
new file mode 100644 (file)
index 0000000..ae70681
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=et_xmlfile
+PKG_VERSION:=1.0.1
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/e/et_xmlfile/
+PKG_HASH:=614d9722d572f6246302c4491846d2c393c199cfa4edc9af593437691683335b
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/et_xmlfile
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=An implementation of lxml.xmlfile for the standard library
+  URL:=https://bitbucket.org/openpyxl/et_xmlfile
+  DEPENDS:=+python
+endef
+
+define Package/et_xmlfile/description
+  An implementation of lxml.xmlfile for the standard library
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/et_xmlfile/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,et_xmlfile))
diff --git a/lang/python/files/config.site b/lang/python/files/config.site
deleted file mode 100644 (file)
index cfa56b8..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#! /bin/sh
-#
-# Copyright (C) 2007-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-ac_cv_file__dev_ptmx=yes
-ac_cv_file__dev_ptc=no
-ac_cv_buggy_getaddrinfo=no
-
diff --git a/lang/python/files/python-host.mk b/lang/python/files/python-host.mk
deleted file mode 100644 (file)
index 6953a09..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-ifneq ($(__python_host_mk_inc),1)
-__python_host_mk_inc=1
-
-# For PYTHON_VERSION
-$(call include_mk, python-version.mk)
-
-HOST_PYTHON_DIR:=$(STAGING_DIR_HOSTPKG)
-HOST_PYTHON_INC_DIR:=$(HOST_PYTHON_DIR)/include/python$(PYTHON_VERSION)
-HOST_PYTHON_LIB_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)
-
-HOST_PYTHON_PKG_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)/site-packages
-
-HOST_PYTHON_BIN:=$(HOST_PYTHON_DIR)/bin/python$(PYTHON_VERSION)
-
-HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(HOST_PYTHON_PKG_DIR)
-
-define HostPython
-       if [ "$(strip $(3))" == "HOST" ]; then \
-               export PYTHONPATH="$(HOST_PYTHONPATH)"; \
-               export PYTHONDONTWRITEBYTECODE=0; \
-       else \
-               export PYTHONPATH="$(PYTHONPATH)"; \
-               export PYTHONDONTWRITEBYTECODE=1; \
-               export _python_sysroot="$(STAGING_DIR)"; \
-               export _python_prefix="/usr"; \
-               export _python_exec_prefix="/usr"; \
-       fi; \
-       export PYTHONOPTIMIZE=""; \
-       $(1) \
-       $(HOST_PYTHON_BIN) $(2);
-endef
-
-# $(1) => commands to execute before running pythons script
-# $(2) => python script and its arguments
-# $(3) => additional variables
-define Build/Compile/HostPyRunHost
-       $(call HostPython, \
-               $(if $(1),$(1);) \
-               CC="$(HOSTCC)" \
-               CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
-               CXX="$(HOSTCXX)" \
-               LD="$(HOSTCC)" \
-               LDSHARED="$(HOSTCC) -shared" \
-               CFLAGS="$(HOST_CFLAGS)" \
-               CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON_INC_DIR)" \
-               LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
-               _PYTHON_HOST_PLATFORM=linux2 \
-               $(3) \
-               , \
-               $(2) \
-               , \
-               HOST \
-       )
-endef
-
-
-# $(1) => build subdir
-# $(2) => additional arguments to setup.py
-# $(3) => additional variables
-define Build/Compile/HostPyMod
-       $(call Build/Compile/HostPyRunHost, \
-               cd $(HOST_BUILD_DIR)/$(strip $(1)), \
-               ./setup.py $(2), \
-               $(3))
-endef
-
-define HostPy/Compile/Default
-       $(call Build/Compile/HostPyMod,,\
-               install --root="$(STAGING_DIR_HOSTPKG)" --prefix="" \
-               --single-version-externally-managed \
-       )
-endef
-
-endif # __python_host_mk_inc
diff --git a/lang/python/files/python-package-codecs.mk b/lang/python/files/python-package-codecs.mk
deleted file mode 100644 (file)
index 7d3c615..0000000
+++ /dev/null
@@ -1,23 +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.
-#
-
-define Package/python-codecs
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) codecs + unicode support
-  DEPENDS:=+python-light
-endef
-
-$(eval $(call PyBasePackage,python-codecs, \
-       /usr/lib/python$(PYTHON_VERSION)/encodings \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_cn.so \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_hk.so \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_iso2022.so \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_jp.so \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_kr.so \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_tw.so \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so \
-))
diff --git a/lang/python/files/python-package-compiler.mk b/lang/python/files/python-package-compiler.mk
deleted file mode 100644 (file)
index c840ce1..0000000
+++ /dev/null
@@ -1,16 +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.
-#
-
-define Package/python-compiler
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) compiler module
-  DEPENDS:=+python-light
-endef
-
-$(eval $(call PyBasePackage,python-compiler, \
-       /usr/lib/python$(PYTHON_VERSION)/compiler \
-))
diff --git a/lang/python/files/python-package-ctypes.mk b/lang/python/files/python-package-ctypes.mk
deleted file mode 100644 (file)
index 5c34b7a..0000000
+++ /dev/null
@@ -1,18 +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.
-#
-
-define Package/python-ctypes
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) ctypes module
-  DEPENDS:=+python-light
-endef
-
-$(eval $(call PyBasePackage,python-ctypes, \
-       /usr/lib/python$(PYTHON_VERSION)/ctypes \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ctypes.so \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ctypes_test.so \
-))
diff --git a/lang/python/files/python-package-db.mk b/lang/python/files/python-package-db.mk
deleted file mode 100644 (file)
index a257820..0000000
+++ /dev/null
@@ -1,18 +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.
-#
-
-define Package/python-db
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) db module
-  DEPENDS:=+python-light +libdb47
-endef
-
-$(eval $(call PyBasePackage,python-db, \
-       /usr/lib/python$(PYTHON_VERSION)/bsddb \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bsddb.so \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/dbm.so \
-))
diff --git a/lang/python/files/python-package-decimal.mk b/lang/python/files/python-package-decimal.mk
deleted file mode 100644 (file)
index 578486d..0000000
+++ /dev/null
@@ -1,16 +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.
-#
-
-define Package/python-decimal
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) decimal module
-  DEPENDS:=+python-light
-endef
-
-$(eval $(call PyBasePackage,python-decimal, \
-       /usr/lib/python$(PYTHON_VERSION)/decimal.py \
-))
diff --git a/lang/python/files/python-package-dev.mk b/lang/python/files/python-package-dev.mk
deleted file mode 100644 (file)
index 647f649..0000000
+++ /dev/null
@@ -1,27 +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.
-#
-
-define Package/python-dev
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) development files
-  DEPENDS:=+python +python-lib2to3
-endef
-
-define PyPackage/python-dev/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/python*config $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib
-endef
-
-$(eval $(call PyBasePackage,python-dev, \
-       /usr/lib/python$(PYTHON_VERSION)/config \
-       /usr/include/python$(PYTHON_VERSION) \
-       /usr/lib/pkgconfig \
-       , \
-       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
-))
-
diff --git a/lang/python/files/python-package-distutils.mk b/lang/python/files/python-package-distutils.mk
deleted file mode 100644 (file)
index a139ddb..0000000
+++ /dev/null
@@ -1,16 +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.
-#
-
-define Package/python-distutils
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) distutils
-  DEPENDS:=+python-light
-endef
-
-$(eval $(call PyBasePackage,python-distutils, \
-       /usr/lib/python$(PYTHON_VERSION)/distutils \
-))
diff --git a/lang/python/files/python-package-email.mk b/lang/python/files/python-package-email.mk
deleted file mode 100644 (file)
index 8c15583..0000000
+++ /dev/null
@@ -1,16 +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.
-#
-
-define Package/python-email
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) email module
-  DEPENDS:=+python-light
-endef
-
-$(eval $(call PyBasePackage,python-email, \
-       /usr/lib/python$(PYTHON_VERSION)/email \
-))
diff --git a/lang/python/files/python-package-gdbm.mk b/lang/python/files/python-package-gdbm.mk
deleted file mode 100644 (file)
index 23c7a29..0000000
+++ /dev/null
@@ -1,16 +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.
-#
-
-define Package/python-gdbm
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) gdbm module
-  DEPENDS:=+python-light +libgdbm
-endef
-
-$(eval $(call PyBasePackage,python-gdbm, \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/gdbm.so \
-))
diff --git a/lang/python/files/python-package-lib2to3.mk b/lang/python/files/python-package-lib2to3.mk
deleted file mode 100644 (file)
index 925cfe2..0000000
+++ /dev/null
@@ -1,18 +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.
-#
-
-define Package/python-lib2to3
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) lib2to3 module
-  DEPENDS:=+python
-endef
-
-$(eval $(call PyBasePackage,python-lib2to3, \
-       /usr/lib/python$(PYTHON_VERSION)/lib2to3 \
-       , \
-       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
-))
diff --git a/lang/python/files/python-package-logging.mk b/lang/python/files/python-package-logging.mk
deleted file mode 100644 (file)
index efef531..0000000
+++ /dev/null
@@ -1,16 +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.
-#
-
-define Package/python-logging
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) logging module
-  DEPENDS:=+python-light
-endef
-
-$(eval $(call PyBasePackage,python-logging, \
-       /usr/lib/python$(PYTHON_VERSION)/logging \
-))
diff --git a/lang/python/files/python-package-multiprocessing.mk b/lang/python/files/python-package-multiprocessing.mk
deleted file mode 100644 (file)
index ccb55f5..0000000
+++ /dev/null
@@ -1,17 +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.
-#
-
-define Package/python-multiprocessing
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) multiprocessing
-  DEPENDS:=+python-light
-endef
-
-$(eval $(call PyBasePackage,python-multiprocessing, \
-       /usr/lib/python$(PYTHON_VERSION)/multiprocessing \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_multiprocessing.so \
-))
diff --git a/lang/python/files/python-package-ncurses.mk b/lang/python/files/python-package-ncurses.mk
deleted file mode 100644 (file)
index d952b50..0000000
+++ /dev/null
@@ -1,18 +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.
-#
-
-define Package/python-ncurses
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) ncurses module
-  DEPENDS:=+python-light +libncurses
-endef
-
-$(eval $(call PyBasePackage,python-ncurses, \
-       /usr/lib/python$(PYTHON_VERSION)/curses \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses.so \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses_panel.so \
-))
diff --git a/lang/python/files/python-package-openssl.mk b/lang/python/files/python-package-openssl.mk
deleted file mode 100644 (file)
index dbf6fe1..0000000
+++ /dev/null
@@ -1,17 +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.
-#
-
-define Package/python-openssl
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) SSL module
-  DEPENDS:=+python-light +libopenssl
-endef
-
-$(eval $(call PyBasePackage,python-openssl, \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_hashlib.so \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ssl.so \
-))
diff --git a/lang/python/files/python-package-pydoc.mk b/lang/python/files/python-package-pydoc.mk
deleted file mode 100644 (file)
index 1e3c385..0000000
+++ /dev/null
@@ -1,18 +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.
-#
-
-define Package/python-pydoc
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) pydoc module
-  DEPENDS:=+python-light
-endef
-
-$(eval $(call PyBasePackage,python-pydoc, \
-       /usr/lib/python$(PYTHON_VERSION)/doctest.py \
-       /usr/lib/python$(PYTHON_VERSION)/pydoc.py \
-       /usr/lib/python$(PYTHON_VERSION)/pydoc_data \
-))
diff --git a/lang/python/files/python-package-sqlite3.mk b/lang/python/files/python-package-sqlite3.mk
deleted file mode 100644 (file)
index 22a6fbc..0000000
+++ /dev/null
@@ -1,17 +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.
-#
-
-define Package/python-sqlite3
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) sqlite3 module
-  DEPENDS:=+python-light +libsqlite3
-endef
-
-$(eval $(call PyBasePackage,python-sqlite3, \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sqlite3.so \
-       /usr/lib/python$(PYTHON_VERSION)/sqlite3 \
-))
diff --git a/lang/python/files/python-package-unittest.mk b/lang/python/files/python-package-unittest.mk
deleted file mode 100644 (file)
index 3c93f51..0000000
+++ /dev/null
@@ -1,16 +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.
-#
-
-define Package/python-unittest
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) unittest module
-  DEPENDS:=+python-light
-endef
-
-$(eval $(call PyBasePackage,python-unittest, \
-       /usr/lib/python$(PYTHON_VERSION)/unittest \
-))
diff --git a/lang/python/files/python-package-xml.mk b/lang/python/files/python-package-xml.mk
deleted file mode 100644 (file)
index 28e734e..0000000
+++ /dev/null
@@ -1,20 +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.
-#
-
-define Package/python-xml
-$(call Package/python/Default)
-  TITLE:=Python $(PYTHON_VERSION) xml libs
-  DEPENDS:=+python-light +libexpat
-endef
-
-$(eval $(call PyBasePackage,python-xml, \
-       /usr/lib/python$(PYTHON_VERSION)/xml \
-       /usr/lib/python$(PYTHON_VERSION)/xmllib.py \
-       /usr/lib/python$(PYTHON_VERSION)/xmlrpclib.py \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_elementtree.so \
-       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/pyexpat.so \
-))
diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk
deleted file mode 100644 (file)
index d0818a6..0000000
+++ /dev/null
@@ -1,138 +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.
-#
-
-$(call include_mk, python-version.mk)
-
-PYTHON_DIR:=$(STAGING_DIR)/usr
-PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin
-PYTHON_INC_DIR:=$(PYTHON_DIR)/include/python$(PYTHON_VERSION)
-PYTHON_LIB_DIR:=$(PYTHON_DIR)/lib/python$(PYTHON_VERSION)
-
-PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
-
-PYTHON:=python$(PYTHON_VERSION)
-
-PYTHONPATH:=$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
-
-# These configure args are needed in detection of path to Python header files
-# using autotools.
-CONFIGURE_ARGS += \
-       _python_sysroot="$(STAGING_DIR)" \
-       _python_prefix="/usr" \
-       _python_exec_prefix="/usr"
-
-PKG_USE_MIPS16:=0
-# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
-# flags are inherited from the Python base package (via sysconfig module)
-ifdef CONFIG_USE_MIPS16
-  TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
-endif
-
-define PyPackage
-
-  # Add default PyPackage filespec none defined
-  ifndef PyPackage/$(1)/filespec
-    define PyPackage/$(1)/filespec
-      +|$(PYTHON_PKG_DIR)
-    endef
-  endif
-
-  ifndef PyPackage/$(1)/install
-    define PyPackage/$(1)/install
-               if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
-                       $(INSTALL_DIR) $$(1)/usr/bin \
-                       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/
-               fi
-    endef
-  endif
-
-  $(call shexport,PyPackage/$(1)/filespec)
-
-  define Package/$(1)/install
-       find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" -o -name "*\.exe" | xargs rm -f
-       @echo "$$$$$$$$$$(call shvar,PyPackage/$(1)/filespec)" | ( \
-               IFS='|'; \
-               while read fop fspec fperm; do \
-                 fop=`echo "$$$$$$$$fop" | tr -d ' \t\n'`; \
-                 if [ "$$$$$$$$fop" = "+" ]; then \
-                       if [ ! -e "$(PKG_INSTALL_DIR)$$$$$$$$fspec" ]; then \
-                         echo "File not found '$(PKG_INSTALL_DIR)$$$$$$$$fspec'"; \
-                         exit 1; \
-                       fi; \
-                       dpath=`dirname "$$$$$$$$fspec"`; \
-                       if [ -n "$$$$$$$$fperm" ]; then \
-                         dperm="-m$$$$$$$$fperm"; \
-                       else \
-                         dperm=`stat -c "%a" $(PKG_INSTALL_DIR)$$$$$$$$dpath`; \
-                       fi; \
-                       mkdir -p $$$$$$$$$dperm $$(1)$$$$$$$$dpath; \
-                       echo "copying: '$$$$$$$$fspec'"; \
-                       cp -fpR $(PKG_INSTALL_DIR)$$$$$$$$fspec $$(1)$$$$$$$$dpath/; \
-                       if [ -n "$$$$$$$$fperm" ]; then \
-                         chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
-                       fi; \
-                 elif [ "$$$$$$$$fop" = "-" ]; then \
-                       echo "removing: '$$$$$$$$fspec'"; \
-                       rm -fR $$(1)$$$$$$$$fspec; \
-                 elif [ "$$$$$$$$fop" = "=" ]; then \
-                       echo "setting permissions: '$$$$$$$$fperm' on '$$$$$$$$fspec'"; \
-                       chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
-                 fi; \
-               done; \
-       )
-       $(call PyPackage/$(1)/install,$$(1))
-  endef
-endef
-
-$(call include_mk, python-host.mk)
-
-# $(1) => commands to execute before running pythons script
-# $(2) => python script and its arguments
-# $(3) => additional variables
-define Build/Compile/HostPyRunTarget
-       $(call HostPython, \
-               $(if $(1),$(1);) \
-               CC="$(TARGET_CC)" \
-               CCSHARED="$(TARGET_CC) $(FPIC)" \
-               CXX="$(TARGET_CXX)" \
-               LD="$(TARGET_CC)" \
-               LDSHARED="$(TARGET_CC) -shared" \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON_INC_DIR)" \
-               LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON_VERSION)" \
-               _PYTHON_HOST_PLATFORM=linux2 \
-               __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON)" \
-               $(3) \
-               , \
-               $(2) \
-       )
-endef
-
-# $(1) => build subdir
-# $(2) => additional arguments to setup.py
-# $(3) => additional variables
-define Build/Compile/PyMod
-       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
-       $(call Build/Compile/HostPyRunTarget, \
-               cd $(PKG_BUILD_DIR)/$(strip $(1)), \
-               ./setup.py $(2), \
-               $(3))
-       find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" -o -name "*\.exe" | xargs rm -f
-endef
-
-define PyBuild/Compile/Default
-       $(call Build/Compile/PyMod,, \
-               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
-               --single-version-externally-managed \
-       )
-endef
-
-ifeq ($(BUILD_VARIANT),python)
-define Build/Compile
-       $(call PyBuild/Compile/Default)
-endef
-endif # python
diff --git a/lang/python/files/python-version.mk b/lang/python/files/python-version.mk
deleted file mode 100644 (file)
index 847eaf5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# 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
-
diff --git a/lang/python/flup/Makefile b/lang/python/flup/Makefile
new file mode 100644 (file)
index 0000000..4a0142f
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=flup
+PKG_VERSION:=1.0.2
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/f/flup/
+PKG_HASH:=4bad317a5fc1ce3d4fe5e9b6d846ec38a8023e16876785d4f88102f2c8097dd9
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/flup
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=Random assortment of WSGI servers
+  URL:=http://www.saddi.com/software/flup/
+  DEPENDS:=+python
+endef
+
+define Package/flup/description
+  Random assortment of WSGI servers
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/flup/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,flup))
diff --git a/lang/python/gunicorn/Makefile b/lang/python/gunicorn/Makefile
new file mode 100644 (file)
index 0000000..4ba2fc6
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2007-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:=gunicorn
+PKG_VERSION:=19.7.1
+PKG_RELEASE=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/30/3a/10bb213cede0cc4d13ac2263316c872a64bf4c819000c8ccd801f1d5f822/
+PKG_HASH:=eee1169f0ca667be05db3351a0960765620dad53f53434262ff8901b68a1b622
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/gunicorn
+    SUBMENU:=Python
+    SECTION:=lang
+    CATEGORY:=Languages
+    TITLE:=WSGI HTTP Server for UNIX
+    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+    URL:=http://gunicorn.org/
+    DEPENDS:=+python +python-setuptools
+endef
+
+define Package/gunicorn/description
+    WSGI HTTP Server for UNIX
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/gunicorn/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gunicorn* \
+           $(1)/usr/bin
+       # fix python exec path in scripts
+       $(SED) 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/bin/gunicorn*
+endef
+
+$(eval $(call BuildPackage,gunicorn))
diff --git a/lang/python/itsdangerous/Makefile b/lang/python/itsdangerous/Makefile
new file mode 100644 (file)
index 0000000..e1e432e
--- /dev/null
@@ -0,0 +1,40 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=itsdangerous
+PKG_VERSION:=0.24
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/dc/b4/a60bcdba945c00f6d608d8975131ab3f25b22f2bcfe1dab221165194b2d4/
+PKG_HASH:=cbb3fcf8d3e33df861709ecaf89d9e6629cff0a217bc2848f1b41cd30d360519
+PKG_BUILD_DEPENDS:=python python3
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+
+define Package/python3-itsdangerous
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://github.com/mitsuhiko/itsdangerous
+  TITLE:=python3-itsdangerous
+  DEPENDS:=+python3-light
+  VARIANT:=python3
+endef
+
+define Package/python3-itsdangerous/description
+Various helpers to pass trusted data to untrusted environments and back.
+endef
+
+$(eval $(call Py3Package,python3-itsdangerous))
+$(eval $(call BuildPackage,python3-itsdangerous))
diff --git a/lang/python/jdcal/Makefile b/lang/python/jdcal/Makefile
new file mode 100644 (file)
index 0000000..2fba8a6
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007-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:=jdcal
+PKG_VERSION:=1.3
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/9b/fa/40beb2aa43a13f740dd5be367a10a03270043787833409c61b79e69f1dfd/
+PKG_HASH:=b760160f8dc8cc51d17875c6b663fafe64be699e10ce34b6a95184b5aa0fdc9e
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/jdcal
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=Julian dates from proleptic Gregorian and Julian calendars.
+  URL:=http://github.com/phn/jdcal
+  DEPENDS:=+python
+endef
+
+define Package/jdcal/description
+  Julian dates from proleptic Gregorian and Julian calendars.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/jdcal/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,jdcal))
diff --git a/lang/python/micropython-lib/Makefile b/lang/python/micropython-lib/Makefile
new file mode 100644 (file)
index 0000000..3f337c9
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# 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:=micropython-lib
+PKG_VERSION=1.9-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_LICENSE:=MIT, PSFL
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/micropython/micropython-lib.git
+PKG_SOURCE_VERSION:=f5fe55aaef1a39d3d56f07040c0ff9f7e841fdf7
+
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
+PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.xz
+PKG_MIRROR_HASH:=76565b5d44d47ccf61562f98dcf166d8103760eed7f3d84f5f7f31610140d780
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/micropython-lib
+    SUBMENU:=Python
+    SECTION:=lang
+    CATEGORY:=Languages
+    TITLE:=micropython-lib
+    URL:=https://github.com/micropython/micropython-lib
+    DEPENDS:=+micropython
+endef
+
+define Package/micropython-lib/description
+    This package contains micropython-lib, a project to develop a non-monolothic
+    standard library for Micro Python. Note that this is a work in progress and
+    several libraries may be missing, incomplete or buggy.
+endef
+
+MAKE_FLAGS:=\
+       PREFIX=$(PKG_BUILD_DIR)/_install_tmp/dist \
+       install
+
+define Package/micropython-lib/install
+       $(INSTALL_DIR) $(1)/usr/lib/micropython
+       $(CP) $(PKG_BUILD_DIR)/_install_tmp/dist/* $(1)/usr/lib/micropython
+endef
+
+$(eval $(call BuildPackage,micropython-lib))
+
diff --git a/lang/python/micropython/Makefile b/lang/python/micropython/Makefile
new file mode 100644 (file)
index 0000000..f6e3f71
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# 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:=micropython
+PKG_VERSION=1.9.2-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/micropython/micropython.git
+PKG_SOURCE_VERSION:=1f78e7a43130acfa4bedf16c1007a1b0f37c75c3
+
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.xz
+PKG_MIRROR_HASH:=18234ffd1e91ac461080b4213399a6a18d4163fe314782b2e6ffbd1bfe48537b
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/micropython
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Micro Python
+  URL:=http://micropython.org
+  DEPENDS:=+libffi
+endef
+
+define Package/micropython/description
+ This package contains Micro Python, a lean and fast implementation of the Python 3.4 programming language
+ that is optimised to run on a microcontroller (and low power computers).
+endef
+
+
+MAKE_FLAGS += -C $(PKG_BUILD_DIR)/unix FROZEN_MPY_DIR= 
+
+define Build/Compile
+       $(call Build/Compile/Default,axtls) 
+       $(call Build/Compile/Default) 
+
+endef
+
+define Package/micropython/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/unix/micropython $(1)/usr/bin/micropython
+endef
+
+$(eval $(call BuildPackage,micropython))
diff --git a/lang/python/micropython/patches/000-Makefile-no-errors b/lang/python/micropython/patches/000-Makefile-no-errors
new file mode 100644 (file)
index 0000000..765f3e7
--- /dev/null
@@ -0,0 +1,13 @@
+Index: micropython-1.5-20161117-e81a5353cb794b8d6c57317488e5db6a1c524755/unix/Makefile
+===================================================================
+--- micropython-1.5-20161117-e81a5353cb794b8d6c57317488e5db6a1c524755.orig/unix/Makefile       2016-11-17 02:43:13.000000000 +0100
++++ micropython-1.5-20161117-e81a5353cb794b8d6c57317488e5db6a1c524755/unix/Makefile    2016-11-17 16:49:02.937809018 +0100
+@@ -21,7 +21,7 @@
+ INC += -I$(BUILD)
+ # compiler settings
+-CWARN = -Wall -Werror
++CWARN = -Wall
+ CWARN += -Wpointer-arith -Wuninitialized
+ CFLAGS = $(INC) $(CWARN) -ansi -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT) $(CFLAGS_EXTRA)
diff --git a/lang/python/micropython/patches/001-all-unix b/lang/python/micropython/patches/001-all-unix
new file mode 100644 (file)
index 0000000..3497aff
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/py/persistentcode.c      2017-09-22 13:26:04.914339465 +0000
++++ b/py/persistentcode.c      2017-09-22 13:26:22.618319621 +0000
+@@ -373,7 +373,7 @@
+
+ // here we define mp_raw_code_save_file depending on the port
+ // TODO abstract this away properly
+
+-#if defined(__i386__) || defined(__x86_64__) || (defined(__arm__) && (defined(__unix__)))
++#if defined(__i386__) || defined(__x86_64__) || defined(__unix__)
+
+ #include <unistd.h>
+
diff --git a/lang/python/openpyxl/Makefile b/lang/python/openpyxl/Makefile
new file mode 100644 (file)
index 0000000..93a3f06
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007-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:=openpyxl
+PKG_VERSION:=2.5.0b1
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/88/3c/34fbe561fc92e6a75f297478b123c2590ca986d9f2d2dbf340d879aa24dd/
+PKG_HASH:=3b42ece7933b46b2128f8d4111c57c80fb5aa46f4d16e7f83281f169e7398ba7
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/openpyxl
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=A Python library to read/write Excel 2010 xlsx/xlsm files
+  URL:=https://openpyxl.readthedocs.org/
+  DEPENDS:=+python +django
+endef
+
+define Package/openpyxl/description
+  A Python library to read/write Excel 2010 xlsx/xlsm files
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/openpyxl/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,openpyxl))
diff --git a/lang/python/patches/001-enable-zlib.patch b/lang/python/patches/001-enable-zlib.patch
deleted file mode 100644 (file)
index 780831e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-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
-
diff --git a/lang/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch b/lang/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch
deleted file mode 100644 (file)
index fb2fe8a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-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
diff --git a/lang/python/patches/003-do-not-compile-tests-at-build.patch b/lang/python/patches/003-do-not-compile-tests-at-build.patch
deleted file mode 100644 (file)
index a6774e1..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-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):
diff --git a/lang/python/patches/004-do-not-write-bytes-codes.patch b/lang/python/patches/004-do-not-write-bytes-codes.patch
deleted file mode 100644 (file)
index f67e7dc..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-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')
diff --git a/lang/python/patches/006-remove-debian-multiarch-support.patch b/lang/python/patches/006-remove-debian-multiarch-support.patch
deleted file mode 100644 (file)
index 01aa924..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 1d1ae72..511aed5 100644
---- a/setup.py
-+++ b/setup.py
-@@ -444,7 +444,8 @@ class PyBuildExt(build_ext):
-             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-         if cross_compiling:
-             self.add_gcc_paths()
--        self.add_multiarch_paths()
-+        else:
-+            self.add_multiarch_paths()
-         # Add paths specified in the environment variables LDFLAGS and
-         # CPPFLAGS for header and library files.
diff --git a/lang/python/patches/007-distutils-do-not-adjust-path.patch b/lang/python/patches/007-distutils-do-not-adjust-path.patch
deleted file mode 100644 (file)
index 49fe926..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/Lib/distutils/command/build_scripts.py
-+++ b/Lib/distutils/command/build_scripts.py
-@@ -89,6 +89,7 @@ class build_scripts (Command):
-                     adjust = 1
-                     post_interp = match.group(1) or ''
-+            adjust = 0
-             if adjust:
-                 log.info("copying and adjusting %s -> %s", script,
-                          self.build_dir)
diff --git a/lang/python/patches/008-distutils-use-python-sysroot.patch b/lang/python/patches/008-distutils-use-python-sysroot.patch
deleted file mode 100644 (file)
index 7cd7487..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-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('.')
diff --git a/lang/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch b/lang/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch
deleted file mode 100644 (file)
index b598097..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-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),
diff --git a/lang/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch b/lang/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
deleted file mode 100644 (file)
index 5a106d4..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-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)
diff --git a/lang/python/patches/011-remove-setupterm-definition.patch b/lang/python/patches/011-remove-setupterm-definition.patch
deleted file mode 100644 (file)
index e55d708..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-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
diff --git a/lang/python/pillow/Makefile b/lang/python/pillow/Makefile
new file mode 100644 (file)
index 0000000..c1618e2
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# Copyright © 1997-2011 by Secret Labs AB
+# Copyright © 1995-2011 by Fredrik Lundh
+# Copyright © 2016 by Alex Clark and contributors
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pillow
+PKG_VERSION:=3.3.1
+PKG_RELEASE=1
+PKG_LICENSE:=CUSTOM
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/python-pillow/Pillow.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=aab33141f381d5577cdef9033b7fdff79122a10c
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=e7c36bcf89614337d9abc4d07780da0b346a745be7a9aa55b398fa427549273c
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/pillow
+    SUBMENU:=Python
+    SECTION:=lang
+    CATEGORY:=Languages
+    TITLE:=The friendly PIL fork
+    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+    URL:=https://python-pillow.org/
+    DEPENDS:=+python +libfreetype +libjpeg +zlib +libtiff
+endef
+
+define Package/pillow/description
+    The friendly PIL fork
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/pillow/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) \
+               $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+               $(1)$(PYTHON_PKG_DIR)/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
+       $(CP) $(PKG_BUILD_DIR)/LICENSE $(1)$(PYTHON_PKG_DIR)/PIL/
+endef
+
+$(eval $(call BuildPackage,pillow))
diff --git a/lang/python/pillow/patches/010-fix-paths.patch b/lang/python/pillow/patches/010-fix-paths.patch
new file mode 100644 (file)
index 0000000..a6b86bf
--- /dev/null
@@ -0,0 +1,182 @@
+diff -rupN pillow-3.3.1.orig/setup.py pillow-3.3.1/setup.py
+--- pillow-3.3.1.orig/setup.py 2016-08-22 17:45:05.000000000 +0200
++++ pillow-3.3.1/setup.py      2016-08-22 18:09:51.947745155 +0200
+@@ -111,12 +111,12 @@ except (ImportError, OSError):
+ NAME = 'Pillow'
+ PILLOW_VERSION = '3.3.1'
+-JPEG_ROOT = None
++JPEG_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
+ JPEG2K_ROOT = None
+-ZLIB_ROOT = None
++ZLIB_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
+ IMAGEQUANT_ROOT = None
+-TIFF_ROOT = None
+-FREETYPE_ROOT = None
++TIFF_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
++FREETYPE_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
+ LCMS_ROOT = None
+@@ -221,161 +221,6 @@ class pil_build_ext(build_ext):
+             _add_directory(include_dirs, os.path.join(prefix, "include"))
+         #
+-        # add platform directories
+-
+-        if self.disable_platform_guessing:
+-            pass
+-        
+-        elif sys.platform == "cygwin":
+-            # pythonX.Y.dll.a is in the /usr/lib/pythonX.Y/config directory
+-            _add_directory(library_dirs,
+-                           os.path.join("/usr/lib", "python%s" %
+-                                        sys.version[:3], "config"))
+-
+-        elif sys.platform == "darwin":
+-            # attempt to make sure we pick freetype2 over other versions
+-            _add_directory(include_dirs, "/sw/include/freetype2")
+-            _add_directory(include_dirs, "/sw/lib/freetype2/include")
+-            # fink installation directories
+-            _add_directory(library_dirs, "/sw/lib")
+-            _add_directory(include_dirs, "/sw/include")
+-            # darwin ports installation directories
+-            _add_directory(library_dirs, "/opt/local/lib")
+-            _add_directory(include_dirs, "/opt/local/include")
+-
+-            # if Homebrew is installed, use its lib and include directories
+-            try:
+-                prefix = subprocess.check_output(['brew', '--prefix']).strip(
+-                ).decode('latin1')
+-            except:
+-                # Homebrew not installed
+-                prefix = None
+-
+-            ft_prefix = None
+-
+-            if prefix:
+-                # add Homebrew's include and lib directories
+-                _add_directory(library_dirs, os.path.join(prefix, 'lib'))
+-                _add_directory(include_dirs, os.path.join(prefix, 'include'))
+-                ft_prefix = os.path.join(prefix, 'opt', 'freetype')
+-
+-            if ft_prefix and os.path.isdir(ft_prefix):
+-                # freetype might not be linked into Homebrew's prefix
+-                _add_directory(library_dirs, os.path.join(ft_prefix, 'lib'))
+-                _add_directory(include_dirs,
+-                               os.path.join(ft_prefix, 'include'))
+-            else:
+-                # fall back to freetype from XQuartz if
+-                # Homebrew's freetype is missing
+-                _add_directory(library_dirs, "/usr/X11/lib")
+-                _add_directory(include_dirs, "/usr/X11/include")
+-
+-        elif sys.platform.startswith("linux"):
+-            arch_tp = (plat.processor(), plat.architecture()[0])
+-            if arch_tp == ("x86_64", "32bit"):
+-                # 32-bit build on 64-bit machine.
+-                _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
+-            else:
+-                for platform_ in arch_tp:
+-
+-                    if not platform_:
+-                        continue
+-
+-                    if platform_ in ["x86_64", "64bit"]:
+-                        _add_directory(library_dirs, "/lib64")
+-                        _add_directory(library_dirs, "/usr/lib64")
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/x86_64-linux-gnu")
+-                        break
+-                    elif platform_ in ["i386", "i686", "32bit"]:
+-                        _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
+-                        break
+-                    elif platform_ in ["aarch64"]:
+-                        _add_directory(library_dirs, "/usr/lib64")
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/aarch64-linux-gnu")
+-                        break
+-                    elif platform_ in ["arm", "armv7l"]:
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/arm-linux-gnueabi")
+-                        break
+-                    elif platform_ in ["ppc64"]:
+-                        _add_directory(library_dirs, "/usr/lib64")
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/ppc64-linux-gnu")
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/powerpc64-linux-gnu")
+-                        break
+-                    elif platform_ in ["ppc"]:
+-                        _add_directory(library_dirs, "/usr/lib/ppc-linux-gnu")
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/powerpc-linux-gnu")
+-                        break
+-                    elif platform_ in ["s390x"]:
+-                        _add_directory(library_dirs, "/usr/lib64")
+-                        _add_directory(library_dirs,
+-                                       "/usr/lib/s390x-linux-gnu")
+-                        break
+-                    elif platform_ in ["s390"]:
+-                        _add_directory(library_dirs, "/usr/lib/s390-linux-gnu")
+-                        break
+-                else:
+-                    raise ValueError(
+-                        "Unable to identify Linux platform: `%s`" % platform_)
+-
+-                # XXX Kludge. Above /\ we brute force support multiarch. Here we
+-                # try Barry's more general approach. Afterward, something should
+-                # work ;-)
+-                self.add_multiarch_paths()
+-
+-        elif sys.platform.startswith("gnu"):
+-            self.add_multiarch_paths()
+-
+-        elif sys.platform.startswith("freebsd"):
+-            _add_directory(library_dirs, "/usr/local/lib")
+-            _add_directory(include_dirs, "/usr/local/include")
+-
+-        elif sys.platform.startswith("netbsd"):
+-            _add_directory(library_dirs, "/usr/pkg/lib")
+-            _add_directory(include_dirs, "/usr/pkg/include")
+-
+-        elif sys.platform.startswith("sunos5"):
+-            _add_directory(library_dirs, "/opt/local/lib")
+-            _add_directory(include_dirs, "/opt/local/include")
+-
+-        # FIXME: check /opt/stuff directories here?
+-
+-        # standard locations
+-        if not self.disable_platform_guessing:
+-            _add_directory(library_dirs, "/usr/local/lib")
+-            _add_directory(include_dirs, "/usr/local/include")
+-
+-            _add_directory(library_dirs, "/usr/lib")
+-            _add_directory(include_dirs, "/usr/include")
+-            # alpine, at least
+-            _add_directory(library_dirs, "/lib")
+-
+-        # on Windows, look for the OpenJPEG libraries in the location that
+-        # the official installer puts them
+-        if sys.platform == "win32":
+-            program_files = os.environ.get('ProgramFiles', '')
+-            best_version = (0, 0)
+-            best_path = None
+-            for name in os.listdir(program_files):
+-                if name.startswith('OpenJPEG '):
+-                    version = tuple([int(x) for x in name[9:].strip().split(
+-                        '.')])
+-                    if version > best_version:
+-                        best_version = version
+-                        best_path = os.path.join(program_files, name)
+-
+-            if best_path:
+-                _dbg('Adding %s to search list', best_path)
+-                _add_directory(library_dirs, os.path.join(best_path, 'lib'))
+-                _add_directory(include_dirs,
+-                               os.path.join(best_path, 'include'))
+-
+-        #
+         # insert new dirs *before* default libs, to avoid conflicts
+         # between Python PYD stub libs and real libraries
diff --git a/lang/python/pyodbc/Makefile b/lang/python/pyodbc/Makefile
new file mode 100644 (file)
index 0000000..aec3e7e
--- /dev/null
@@ -0,0 +1,67 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pyodbc
+PKG_VERSION:=4.0.21
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/0f/04/c5638a4636fb8117fdc45685f489864459d193b1d892b61dce785ddf58f9
+PKG_HASH:=9655f84ca9e5cb2dfffff705601017420c840d55271ba62dd44f05383eff0329
+PKG_BUILD_DEPENDS:=python python3 unixodbc
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE.txt
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+define Package/python-pyodbc/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/mkleehammer/pyodbc
+  DEPENDS:=+unixodbc +libstdcpp
+endef
+
+define Package/python-pyodbc
+$(call Package/python-pyodbc/Default)
+  TITLE:=python-pyodbc
+  DEPENDS+=+PACKAGE_python-pyodbc:python-light \
+           +PACKAGE_python-pyodbc:python-logging \
+           +PACKAGE_python-pyodbc:python-openssl
+  VARIANT:=python
+endef
+
+define Package/python3-pyodbc
+$(call Package/python-pyodbc/Default)
+  TITLE:=python3-pyodbc
+  DEPENDS+=+PACKAGE_python3-pyodbc:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-pyodbc/description
+DB API Module for ODBC
+
+A Python DB API 2 module for ODBC. This project provides an up-to-date,
+convenient interface to ODBC using native data types like datetime and decimal.
+endef
+
+define Package/python3-pyodbc/description
+$(call Package/python-pyodbc/description)
+
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-pyodbc))
+$(eval $(call BuildPackage,python-pyodbc))
+
+$(eval $(call Py3Package,python3-pyodbc))
+$(eval $(call BuildPackage,python3-pyodbc))
diff --git a/lang/python/pyodbc/patches/100-connection-assume-SQL_C_WCHAR-is-native-endian.patch b/lang/python/pyodbc/patches/100-connection-assume-SQL_C_WCHAR-is-native-endian.patch
new file mode 100644 (file)
index 0000000..0819a6d
--- /dev/null
@@ -0,0 +1,59 @@
+--- a/src/connection.cpp
++++ b/src/connection.cpp
+@@ -18,6 +18,14 @@
+ #include "cnxninfo.h"
+ #include "sqlwchar.h"
++#ifdef WORDS_BIGENDIAN
++# define OPTENC_UTF16NE OPTENC_UTF16BE
++# define ENCSTR_UTF16NE "utf-16be"
++#else
++# define OPTENC_UTF16NE OPTENC_UTF16LE
++# define ENCSTR_UTF16NE "utf-16le"
++#endif
++
+ #if PY_MAJOR_VERSION < 3
+ static bool IsStringType(PyObject* t) { return (void*)t == (void*)&PyString_Type; }
+ static bool IsUnicodeType(PyObject* t) { return (void*)t == (void*)&PyUnicode_Type; }
+@@ -90,7 +98,7 @@ static bool Connect(PyObject* pConnectSt
+         // indication that we can handle Unicode.  We are going to use the same unicode ending
+         // as we do for binding parameters.
+-        SQLWChar wchar(pConnectString, SQL_C_WCHAR, encoding, "utf-16le");
++        SQLWChar wchar(pConnectString, SQL_C_WCHAR, encoding, ENCSTR_UTF16NE);
+         if (!wchar)
+             return false;
+@@ -216,24 +224,24 @@ PyObject* Connection_New(PyObject* pConn
+     // single-byte text we don't actually know what the encoding is.  For example, with SQL
+     // Server the encoding is based on the database's collation.  We ask the driver / DB to
+     // convert to SQL_C_WCHAR and use the ODBC default of UTF-16LE.
+-    cnxn->sqlchar_enc.optenc = OPTENC_UTF16LE;
+-    cnxn->sqlchar_enc.name   = _strdup("utf-16le");
++    cnxn->sqlchar_enc.optenc = OPTENC_UTF16NE;
++    cnxn->sqlchar_enc.name   = _strdup(ENCSTR_UTF16NE);
+     cnxn->sqlchar_enc.ctype  = SQL_C_WCHAR;
+-    cnxn->sqlwchar_enc.optenc = OPTENC_UTF16LE;
+-    cnxn->sqlwchar_enc.name   = _strdup("utf-16le");
++    cnxn->sqlwchar_enc.optenc = OPTENC_UTF16NE;
++    cnxn->sqlwchar_enc.name   = _strdup(ENCSTR_UTF16NE);
+     cnxn->sqlwchar_enc.ctype  = SQL_C_WCHAR;
+-    cnxn->metadata_enc.optenc = OPTENC_UTF16LE;
+-    cnxn->metadata_enc.name   = _strdup("utf-16le");
++    cnxn->metadata_enc.optenc = OPTENC_UTF16NE;
++    cnxn->metadata_enc.name   = _strdup(ENCSTR_UTF16NE);
+     cnxn->metadata_enc.ctype  = SQL_C_WCHAR;
+     // Note: I attempted to use UTF-8 here too since it can hold any type, but SQL Server fails
+     // with a data truncation error if we send something encoded in 2 bytes to a column with 1
+     // character.  I don't know if this is a bug in SQL Server's driver or if I'm missing
+     // something, so we'll stay with the default ODBC conversions.
+-    cnxn->unicode_enc.optenc = OPTENC_UTF16LE;
+-    cnxn->unicode_enc.name   = _strdup("utf-16le");
++    cnxn->unicode_enc.optenc = OPTENC_UTF16NE;
++    cnxn->unicode_enc.name   = _strdup(ENCSTR_UTF16NE);
+     cnxn->unicode_enc.ctype  = SQL_C_WCHAR;
+ #if PY_MAJOR_VERSION < 3
diff --git a/lang/python/python-asn1crypto/Makefile b/lang/python/python-asn1crypto/Makefile
new file mode 100644 (file)
index 0000000..73e2f63
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 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:=python-asn1crypto
+PKG_VERSION:=0.23.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=asn1crypto-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/31/53/8bca924b30cb79d6d70dbab6a99e8731d1e4dd3b090b7f3d8412a8d8ffbc
+PKG_HASH:=0874981329cfebb366d6584c3d16e913f2a0eb026c9463efcc4aaf42a9d94d70
+
+PKG_LICENSE:=MIT
+PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-asn1crypto-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-asn1crypto/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/wbond/asn1crypto
+endef
+
+define Package/python-asn1crypto
+$(call Package/python-asn1crypto/Default)
+  TITLE:=python-asn1crypto
+  DEPENDS:=+PACKAGE_python-asn1crypto:python-light
+  VARIANT:=python
+endef
+
+define Package/python3-asn1crypto
+$(call Package/python-asn1crypto/Default)
+  TITLE:=python3-asn1crypto
+  DEPENDS:=+PACKAGE_python3-asn1crypto:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-asn1crypto/description
+Fast ASN.1 parser and serializer with definitions for
+private keys, public keys, certificates, CRL, OCSP,
+CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP
+endef
+
+define Package/python3-asn1crypto/description
+$(call Package/python-asn1crypto/description)
+.
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-asn1crypto))
+$(eval $(call BuildPackage,python-asn1crypto))
+$(eval $(call Py3Package,python3-asn1crypto))
+$(eval $(call BuildPackage,python3-asn1crypto))
diff --git a/lang/python/python-attrs/Makefile b/lang/python/python-attrs/Makefile
new file mode 100644 (file)
index 0000000..8430eee
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# Copyright (C) 2016-2018 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:=python-attrs
+PKG_VERSION:=17.4.0
+PKG_RELEASE:=2
+
+PKG_SOURCE:=attrs-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/8b/0b/a06cfcb69d0cb004fde8bc6f0fd192d96d565d1b8aa2829f0f20adb796e5
+PKG_HASH:=1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-attrs-$(PKG_VERSION)
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-attrs/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://attrs.readthedocs.org/
+endef
+
+define Package/python-attrs
+$(call Package/python-attrs/Default)
+  TITLE:=python-attrs
+  DEPENDS:=+PACKAGE_python-attrs:python-light
+  VARIANT:=python
+endef
+
+define Package/python3-attrs
+$(call Package/python-attrs/Default)
+  TITLE:=python3-attrs
+  DEPENDS:=+PACKAGE_python3-attrs:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-attrs/description
+attrs is an MIT-licensed Python package with class decorators that ease
+the chores of implementing the most common attribute-related object
+protocols.
+endef
+
+define Package/python3-attrs/description
+$(call Package/python-attrs/description)
+.
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-attrs))
+$(eval $(call BuildPackage,python-attrs))
+$(eval $(call BuildPackage,python-attrs-src))
+
+$(eval $(call Py3Package,python3-attrs))
+$(eval $(call BuildPackage,python3-attrs))
+$(eval $(call BuildPackage,python3-attrs-src))
diff --git a/lang/python/python-automat/Makefile b/lang/python/python-automat/Makefile
new file mode 100644 (file)
index 0000000..8ddaad0
--- /dev/null
@@ -0,0 +1,99 @@
+#
+# Copyright (C) 2018 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:=python-automat
+PKG_VERSION:=0.6.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=Automat-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/A/Automat
+PKG_HASH:=3c1fd04ecf08ac87b4dd3feae409542e9bf7827257097b2b6ed5692f69d6f6a8
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-automat-$(PKG_VERSION)
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-automat/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/glyph/Automat
+endef
+
+define Package/python-automat
+$(call Package/python-automat/Default)
+  TITLE:=Concise, idiomatic finite-state automata
+  DEPENDS:= \
+      +PACKAGE_python-automat:python-light \
+      +PACKAGE_python-automat:python-attrs \
+      +PACKAGE_python-automat:python-six
+  VARIANT:=python
+endef
+
+define Package/python3-automat
+$(call Package/python-automat/Default)
+  TITLE:=Concise, idiomatic finite-state automata
+  DEPENDS:= \
+      +PACKAGE_python3-automat:python3-light \
+      +PACKAGE_python3-automat:python3-attrs \
+      +PACKAGE_python3-automat:python3-six
+  VARIANT:=python3
+endef
+
+define Package/python-automat/description
+Automat is a library for concise, idiomatic Python expression of
+finite-state automata (particularly deterministic finite-state
+transducers).
+endef
+
+define Package/python3-automat/description
+$(call Package/python-automat/description)
+.
+(Variant for Python3)
+endef
+
+define PyPackage/python-automat/filespec
++|$(PYTHON_PKG_DIR)
+-|$(PYTHON_PKG_DIR)/automat/_visualize.py
+endef
+
+define Py3Package/python3-automat/filespec
++|$(PYTHON3_PKG_DIR)
+-|$(PYTHON3_PKG_DIR)/automat/_visualize.py
+endef
+
+define PyBuild/Compile
+       $(call Build/Compile/PyMod,, \
+               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)", \
+               PKG_VERSION="$(PKG_VERSION)" \
+       )
+endef
+
+define Py3Build/Compile
+       $(call Build/Compile/Py3Mod,, \
+               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)", \
+               PKG_VERSION="$(PKG_VERSION)" \
+       )
+endef
+
+$(eval $(call PyPackage,python-automat))
+$(eval $(call BuildPackage,python-automat))
+$(eval $(call BuildPackage,python-automat-src))
+
+$(eval $(call Py3Package,python3-automat))
+$(eval $(call BuildPackage,python3-automat))
+$(eval $(call BuildPackage,python3-automat-src))
diff --git a/lang/python/python-automat/patches/001-do-not-use-setuptools-scm-m2r.patch b/lang/python/python-automat/patches/001-do-not-use-setuptools-scm-m2r.patch
new file mode 100644 (file)
index 0000000..46fd241
--- /dev/null
@@ -0,0 +1,30 @@
+--- a/setup.py
++++ b/setup.py
+@@ -2,6 +2,7 @@
+ Setup file for automat
+ """
++import os
+ from setuptools import setup, find_packages
+ try:
+@@ -14,7 +15,7 @@ except(IOError, ImportError):
+ setup(
+     name='Automat',
+-    use_scm_version=True,
++    version=os.getenv('PKG_VERSION'),
+     url='https://github.com/glyph/Automat',
+     description="""
+     Self-service finite-state machines for the programmer on the go.
+@@ -22,10 +23,6 @@ setup(
+     long_description=long_description,
+     packages=find_packages(exclude=[]),
+     package_dir={'automat': 'automat'},
+-    setup_requires=[
+-        'setuptools-scm',
+-        'm2r',
+-    ],
+     install_requires=[
+         "attrs",
+         "six",
diff --git a/lang/python/python-automat/patches/002-omit-visualize.patch b/lang/python/python-automat/patches/002-omit-visualize.patch
new file mode 100644 (file)
index 0000000..bea12d3
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/setup.py
++++ b/setup.py
+@@ -27,15 +27,6 @@ setup(
+         "attrs",
+         "six",
+     ],
+-    extras_require={
+-        "visualize": ["graphviz>0.5.1",
+-                      "Twisted>=16.1.1"],
+-    },
+-    entry_points={
+-        "console_scripts": [
+-            "automat-visualize = automat._visualize:tool"
+-        ],
+-    },
+     author='Glyph',
+     author_email='glyph@twistedmatrix.com',
+     include_package_data=True,
diff --git a/lang/python/python-automat/patches/003-omit-tests.patch b/lang/python/python-automat/patches/003-omit-tests.patch
new file mode 100644 (file)
index 0000000..8742aa3
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/setup.py
++++ b/setup.py
+@@ -21,7 +21,7 @@ setup(
+     Self-service finite-state machines for the programmer on the go.
+     """.strip(),
+     long_description=long_description,
+-    packages=find_packages(exclude=[]),
++    packages=find_packages(exclude=["*._test", "*._test.*"]),
+     package_dir={'automat': 'automat'},
+     install_requires=[
+         "attrs",
+@@ -30,6 +30,7 @@ setup(
+     author='Glyph',
+     author_email='glyph@twistedmatrix.com',
+     include_package_data=True,
++    exclude_package_data={'':['_test/*']},
+     license="MIT",
+     keywords='fsm finite state machine automata',
+ )
diff --git a/lang/python/python-cffi/Makefile b/lang/python/python-cffi/Makefile
new file mode 100644 (file)
index 0000000..5e27adb
--- /dev/null
@@ -0,0 +1,73 @@
+#
+# Copyright (C) 2015-2018 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:=python-cffi
+PKG_VERSION:=1.11.4
+PKG_RELEASE:=1
+
+PKG_SOURCE:=cffi-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/10/f7/3b302ff34045f25065091d40e074479d6893882faef135c96f181a57ed06
+PKG_HASH:=df9083a992b17a28cd4251a3f5c879e0198bb26c9e808c4647e0a18739f1d11d
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-cffi-$(PKG_VERSION)
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_BUILD_DEPENDS:=libffi/host
+
+HOST_PYTHON_PACKAGE_BUILD_DEPENDS:="cffi==$(PKG_VERSION)"
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="cffi==$(PKG_VERSION)"
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-cffi/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://cffi.readthedocs.org/
+  DEPENDS:=+libffi
+endef
+
+define Package/python-cffi
+$(call Package/python-cffi/Default)
+  TITLE:=python-cffi
+  DEPENDS+=+PACKAGE_python-cffi:python-light +PACKAGE_python-cffi:python-pycparser
+  VARIANT:=python
+endef
+
+define Package/python3-cffi
+$(call Package/python-cffi/Default)
+  TITLE:=python3-cffi
+  DEPENDS+=+PACKAGE_python3-cffi:python3-light +PACKAGE_python3-cffi:python3-pycparser
+  VARIANT:=python3
+endef
+
+define Package/python-cffi/description
+Foreign Function Interface for Python calling C code.
+endef
+
+define Package/python3-cffi/description
+$(call Package/python-cffi/description)
+.
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-cffi))
+$(eval $(call BuildPackage,python-cffi))
+$(eval $(call BuildPackage,python-cffi-src))
+
+$(eval $(call Py3Package,python3-cffi))
+$(eval $(call BuildPackage,python3-cffi))
+$(eval $(call BuildPackage,python3-cffi-src))
diff --git a/lang/python/python-constantly/Makefile b/lang/python/python-constantly/Makefile
new file mode 100644 (file)
index 0000000..e1fa855
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# Copyright (C) 2018 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:=python-constantly
+PKG_VERSION:=15.1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=constantly-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/c/constantly
+PKG_HASH:=586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-constantly-$(PKG_VERSION)
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-constantly/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/twisted/constantly
+endef
+
+define Package/python-constantly
+$(call Package/python-constantly/Default)
+  TITLE:=Symbolic constants in Python
+  DEPENDS:=+PACKAGE_python-constantly:python-light
+  VARIANT:=python
+endef
+
+define Package/python3-constantly
+$(call Package/python-constantly/Default)
+  TITLE:=Symbolic constants in Python
+  DEPENDS:=+PACKAGE_python3-constantly:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-constantly/description
+A library that provides symbolic constant support. It includes
+collections and constants with text, numeric, and bit flag values.
+Originally twisted.python.constants from the Twisted project.
+endef
+
+define Package/python3-constantly/description
+$(call Package/python-constantly/description)
+.
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-constantly))
+$(eval $(call BuildPackage,python-constantly))
+$(eval $(call BuildPackage,python-constantly-src))
+
+$(eval $(call Py3Package,python3-constantly))
+$(eval $(call BuildPackage,python3-constantly))
+$(eval $(call BuildPackage,python3-constantly-src))
diff --git a/lang/python/python-crcmod/Makefile b/lang/python/python-crcmod/Makefile
new file mode 100644 (file)
index 0000000..a4873cc
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# 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:=python-crcmod
+PKG_VERSION:=1.7
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Micke Prag <micke.prag@telldus.se>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=crcmod-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/c/crcmod/
+PKG_HASH:=dc7051a0db5f2bd48665a990d3ec1cc305a466a77358ca4492826f41f283601e
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/crcmod-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=python
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/python-crcmod
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=python-crcmod
+  URL:=http://crcmod.sourceforge.net/
+  DEPENDS:=+python-light
+endef
+
+define Package/python-crcmod/description
+  The software in this package is a Python module for generating objects that compute the Cyclic Redundancy Check (CRC). There is no attempt in this package to explain how the CRC works. There are a number of resources on the web that give a good explanation of the algorithms. Just do a Google search for "crc calculation" and browse till you find what you need. Another resource can be found in chapter 20 of the book "Numerical Recipes in C" by Press et. al.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix="$(PKG_INSTALL_DIR)/usr")
+endef
+
+define Package/python-crcmod/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-crcmod))
diff --git a/lang/python/python-crypto/Makefile b/lang/python/python-crypto/Makefile
new file mode 100644 (file)
index 0000000..551fd94
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2009-2015, 2017-2018 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:=python-crypto
+PKG_VERSION:=2.6.1
+PKG_RELEASE:=2
+
+PKG_SOURCE:=pycrypto-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/
+PKG_HASH:=f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-crypto-$(PKG_VERSION)
+
+PKG_LICENSE:=Public Domain
+PKG_LICENSE_FILES:=COPYRIGHT
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-crypto/Default
+  SECTION:=lang-python
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://www.pycrypto.org/
+endef
+
+define Package/python-crypto
+$(call Package/python-crypto/Default)
+  TITLE:=python-crypto
+  DEPENDS:=+libgmp +PACKAGE_python-crypto:python
+  VARIANT:=python
+endef
+
+define Package/python3-crypto
+$(call Package/python-crypto/Default)
+  TITLE:=python3-crypto
+  DEPENDS:=+libgmp +PACKAGE_python3-crypto:python3
+  VARIANT:=python3
+endef
+
+define Package/python-crypto/description
+A collection of both secure hash functions (such as MD5 and SHA),
+and various encryption algorithms (AES, DES, IDEA, RSA, ElGamal, etc.).
+endef
+
+define Package/python3-crypto/description
+$(call Package/python-crypto/description)
+.
+(Variant for Python3)
+endef
+
+define PyBuild/Compile
+       $(call Build/Compile/PyMod,,\
+               install --prefix=/usr --root=$(PKG_INSTALL_DIR),\
+               CONFIG_BIG_ENDIAN="$(CONFIG_BIG_ENDIAN)" \
+       )
+endef
+
+define Py3Build/Compile
+       $(call Build/Compile/Py3Mod,,\
+               install --prefix=/usr --root=$(PKG_INSTALL_DIR),\
+               CONFIG_BIG_ENDIAN="$(CONFIG_BIG_ENDIAN)" \
+       )
+endef
+
+$(eval $(call PyPackage,python-crypto))
+$(eval $(call BuildPackage,python-crypto))
+$(eval $(call BuildPackage,python-crypto-src))
+
+$(eval $(call Py3Package,python3-crypto))
+$(eval $(call BuildPackage,python3-crypto))
+$(eval $(call BuildPackage,python3-crypto-src))
diff --git a/lang/python/python-crypto/patches/001-no-host-paths.patch b/lang/python/python-crypto/patches/001-no-host-paths.patch
new file mode 100644 (file)
index 0000000..d481627
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/setup.py
++++ b/setup.py
+@@ -370,7 +370,7 @@ kw = {'name':"pycrypto",
+       'ext_modules': plat_ext + [
+             # _fastmath (uses GNU mp library)
+             Extension("Crypto.PublicKey._fastmath",
+-                      include_dirs=['src/','/usr/include/'],
++                      include_dirs=['src/'],
+                       libraries=['gmp'],
+                       sources=["src/_fastmath.c"]),
diff --git a/lang/python/python-crypto/patches/002-fix-endianness-detect.patch b/lang/python/python-crypto/patches/002-fix-endianness-detect.patch
new file mode 100644 (file)
index 0000000..38e5a5b
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/setup.py
++++ b/setup.py
+@@ -100,6 +100,10 @@ def PrintErr(*args, **kwd):
+         w(kwd.get("end", "\n"))
+ def endianness_macro():
++    if os.environ["CONFIG_BIG_ENDIAN"] == "y":
++        return ('PCT_BIG_ENDIAN', 1)
++    else:
++        return ('PCT_LITTLE_ENDIAN', 1)
+     s = struct.pack("@I", 0x33221100)
+     if s == "\x00\x11\x22\x33".encode():     # little endian
+         return ('PCT_LITTLE_ENDIAN', 1)
diff --git a/lang/python/python-crypto/patches/003-omit-tests.patch b/lang/python/python-crypto/patches/003-omit-tests.patch
new file mode 100644 (file)
index 0000000..f72bcb0
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/setup.py
++++ b/setup.py
+@@ -357,16 +357,6 @@ kw = {'name':"pycrypto",
+                   "Crypto.Random",
+                   "Crypto.Random.Fortuna",
+                   "Crypto.Random.OSRNG",
+-                  "Crypto.SelfTest",
+-                  "Crypto.SelfTest.Cipher",
+-                  "Crypto.SelfTest.Hash",
+-                  "Crypto.SelfTest.Protocol",
+-                  "Crypto.SelfTest.PublicKey",
+-                  "Crypto.SelfTest.Random",
+-                  "Crypto.SelfTest.Random.Fortuna",
+-                  "Crypto.SelfTest.Random.OSRNG",
+-                  "Crypto.SelfTest.Util",
+-                  "Crypto.SelfTest.Signature",
+                   "Crypto.Protocol",
+                   "Crypto.PublicKey",
+                   "Crypto.Signature"],
diff --git a/lang/python/python-cryptography/Makefile b/lang/python/python-cryptography/Makefile
new file mode 100644 (file)
index 0000000..02e95da
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2015-2018 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:=python-cryptography
+PKG_VERSION:=2.1.4
+PKG_RELEASE:=2
+
+PKG_SOURCE:=cryptography-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/78/c5/7188f15a92413096c93053d5304718e1f6ba88b818357d05d19250ebff85
+PKG_HASH:=e4d967371c5b6b2e67855066471d844c5d52d210c36c28d49a8507b96e2c5291
+
+PKG_LICENSE:=Apache-2.0 BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE.APACHE LICENSE.BSD
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-cryptography-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-cryptography/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/pyca/cryptography
+  DEPENDS:=+libopenssl
+endef
+
+define Package/python-cryptography
+$(call Package/python-cryptography/Default)
+  TITLE:=python-cryptography
+  DEPENDS+= \
+      +PACKAGE_python-cryptography:python \
+      +PACKAGE_python-cryptography:python-cffi \
+      +PACKAGE_python-cryptography:python-enum34 \
+      +PACKAGE_python-cryptography:python-idna \
+      +PACKAGE_python-cryptography:python-ipaddress \
+      +PACKAGE_python-cryptography:python-asn1crypto \
+      +PACKAGE_python-cryptography:python-six
+  VARIANT:=python
+endef
+
+define Package/python3-cryptography
+$(call Package/python-cryptography/Default)
+  TITLE:=python3-cryptography
+  DEPENDS+= \
+      +PACKAGE_python3-cryptography:python3 \
+      +PACKAGE_python3-cryptography:python3-cffi \
+      +PACKAGE_python3-cryptography:python3-idna \
+      +PACKAGE_python3-cryptography:python3-asn1crypto \
+      +PACKAGE_python3-cryptography:python3-six
+  VARIANT:=python3
+endef
+
+define Package/python-cryptography/description
+cryptography is a package which provides cryptographic recipes and
+primitives to Python developers.  Our goal is for it to be your "cryptographic
+standard library". It supports Python 2.6-2.7, Python 3.3+, and PyPy 2.6+.
+endef
+
+define Package/python3-cryptography/description
+$(call Package/python-cryptography/description)
+.
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-cryptography))
+$(eval $(call BuildPackage,python-cryptography))
+$(eval $(call BuildPackage,python-cryptography-src))
+
+$(eval $(call Py3Package,python3-cryptography))
+$(eval $(call BuildPackage,python3-cryptography))
+$(eval $(call BuildPackage,python3-cryptography-src))
diff --git a/lang/python/python-cryptography/patches/001-disable-setup-requirements.patch b/lang/python/python-cryptography/patches/001-disable-setup-requirements.patch
new file mode 100644 (file)
index 0000000..65781af
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/setup.py
++++ b/setup.py
+@@ -235,6 +235,7 @@ class DummyPyTest(test):
+ with open(os.path.join(base_dir, "README.rst")) as f:
+     long_description = f.read()
++setup_requirements=[]
+ setup(
+     name=about["__title__"],
diff --git a/lang/python/python-cryptography/patches/002-remove-undefined-dtls-methods.patch b/lang/python/python-cryptography/patches/002-remove-undefined-dtls-methods.patch
new file mode 100644 (file)
index 0000000..25ad27d
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/src/_cffi_src/openssl/ssl.py
++++ b/src/_cffi_src/openssl/ssl.py
+@@ -597,9 +597,6 @@ static const long TLS_ST_OK = 0;
+ #if defined(OPENSSL_NO_DTLS) || CRYPTOGRAPHY_OPENSSL_LESS_THAN_102
+ static const long Cryptography_HAS_GENERIC_DTLS_METHOD = 0;
+-const SSL_METHOD *(*DTLS_method)(void) = NULL;
+-const SSL_METHOD *(*DTLS_server_method)(void) = NULL;
+-const SSL_METHOD *(*DTLS_client_method)(void) = NULL;
+ #else
+ static const long Cryptography_HAS_GENERIC_DTLS_METHOD = 1;
+ #endif
diff --git a/lang/python/python-curl/Makefile b/lang/python/python-curl/Makefile
new file mode 100644 (file)
index 0000000..12bff8f
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pycurl
+PKG_VERSION:=7.43.0.1
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Waldemar Konik <informatyk74@interia.pl>
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILE=COPYING-LGPL
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://dl.bintray.com/pycurl/pycurl/
+PKG_HASH:=43231bf2bafde923a6d9bb79e2407342a5f3382c1ef0a3b2e491c6a4e50b91aa
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/python-curl
+  CATEGORY:=Languages
+  SECTION:=lang
+  SUBMENU:=Python
+  TITLE:=Python module interface to the cURL library
+  URL:=http://pycurl.io/
+  DEPENDS:=+python +libcurl
+endef
+
+define Package/python-curl/description
+Python module interface to the cURL library.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/python-curl/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+               $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+               $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-curl))
diff --git a/lang/python/python-dateutil/Makefile b/lang/python/python-dateutil/Makefile
new file mode 100644 (file)
index 0000000..421758a
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007-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:=python-dateutil
+PKG_VERSION:=2.6.1
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-2-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/54/bb/f1db86504f7a49e1d9b9301531181b00a1c7325dc85a29160ee3eaa73a54/
+PKG_HASH:=891c38b2a02f5bb1be3e4793866c8df49c7d19baabf9c1bad62547e0b4866aca
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/python-dateutil
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=Extensions to the standard Python datetime module
+  URL:=https://dateutil.readthedocs.org/
+  DEPENDS:=+python +python-six
+endef
+
+define Package/python-dateutil/description
+  Extensions to the standard Python datetime module
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/python-dateutil/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-dateutil))
diff --git a/lang/python/python-dns/Makefile b/lang/python/python-dns/Makefile
new file mode 100644 (file)
index 0000000..545a170
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# 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:=python-dns
+PKG_RELEASE:=2
+PKG_VERSION:=1.15.0
+PKG_SOURCE_URL:=http://www.dnspython.org/kits/$(PKG_VERSION)
+PKG_HASH:=11598ae5735746e63921f8eebdfdee4a2e7d0ba842ebd57ba02682d4aed8244b
+PKG_SOURCE:=dnspython-$(PKG_VERSION).tar.gz
+PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
+PKG_LICENSE:=ISC
+PKG_LICENSE_FILES:=LICENSE
+PKG_BUILD_DIR:=$(BUILD_DIR)/dnspython-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/python-dns
+       SECTION:=language-python
+       CATEGORY:=Languages
+       SUBMENU:=Python
+       TITLE:=dnspython
+       URL:=http://www.dnspython.org/
+       DEPENDS:=+python
+endef
+
+define Package/python-dns/description
+ dnspython is a DNS toolkit for Python. It supports almost all record types. It can be used for queries, zone transfers, and dynamic updates. It supports TSIG authenticated messages and EDNS0.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,\
+               install --prefix=/usr --root="$(PKG_INSTALL_DIR)" \
+       )
+endef
+
+$(eval $(call PyPackage,python-dns))
+$(eval $(call BuildPackage,python-dns))
diff --git a/lang/python/python-dpkt/Makefile b/lang/python/python-dpkt/Makefile
new file mode 100644 (file)
index 0000000..e6b0417
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2017 Andrew McConachie
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-dpkt
+PKG_VERSION:=1.91
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Andrew McConachie <andrew@depht.com>
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/kbandla/dpkt.git
+PKG_SOURCE_VERSION:=6cd0909d613a66033ecdefaca6cc07cfa7d46d6b
+PKG_MIRROR_HASH:=fe8657552b1dbaf8b9eba50168730e200567dc88a06932aa1cf60dc93211d16b
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/python-dpkt
+       SECTION:=language-python
+       CATEGORY:=Languages
+       SUBMENU:=Python
+       TITLE:=python-dpkt
+       URL:=https://dpkt.readthedocs.io/en/latest/
+       DEPENDS:=+python
+endef
+
+define Package/python-dpkt/description
+  dpkt is a python module for fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols
+  https://pypi.python.org/pypi/dpkt
+  https://github.com/kbandla/dpkt
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,\
+               install --prefix=/usr --root="$(PKG_INSTALL_DIR)" \
+       )
+endef
+
+$(eval $(call PyPackage,python-dpkt))
+$(eval $(call BuildPackage,python-dpkt))
diff --git a/lang/python/python-egenix-mx-base/Makefile b/lang/python/python-egenix-mx-base/Makefile
new file mode 100644 (file)
index 0000000..374258c
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# 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:=python-egenix-mx-base
+PKG_VERSION:=3.2.8
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dmitry Trefilov <the-alien@live.ru>
+PKG_LICENSE:=eGenix.com Public License 1.1.0
+PKG_LICENSE_FILES:=LICENSE COPYRIGHT
+
+PKG_SOURCE:=egenix-mx-base-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://downloads.egenix.com/python/
+PKG_HASH:=0da55233e45bc3f88870e62e60a79c2c86bad4098b8128343fd7be877f44a3c0
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/egenix-mx-base-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=python
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/python-egenix-mx-base
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  DEPENDS:=+USE_EGLIBC:librt +USE_UCLIBC:librt +python
+  TITLE:=Egenix mxBase
+  URL:=http://www.egenix.com/products/python/mxBase/
+endef
+
+define Package/python-egenix-mx-base/description
+ The eGenix.com mx Base Distribution for Python is a collection
+ of professional quality software tools which enhance Python's
+ usability in many important areas such as fast text searching,
+ date/time processing and high speed data types.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix="$(PKG_INSTALL_DIR)/usr")
+endef
+
+define PyPackage/python-egenix-mx-base/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call PyPackage,python-egenix-mx-base))
+$(eval $(call BuildPackage,python-egenix-mx-base))
diff --git a/lang/python/python-enum34/Makefile b/lang/python/python-enum34/Makefile
new file mode 100644 (file)
index 0000000..90b54c4
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2015-2018 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:=python-enum34
+PKG_VERSION:=1.1.6
+PKG_RELEASE:=3
+
+PKG_SOURCE:=enum34-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876
+PKG_HASH:=8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-enum34-$(PKG_VERSION)
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=enum/LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-enum34/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://pypi.python.org/pypi/enum34/
+endef
+
+define Package/python-enum34
+$(call Package/python-enum34/Default)
+  TITLE:=python-enum34
+  DEPENDS:=+PACKAGE_python-enum34:python-light
+  VARIANT:=python
+endef
+
+define Package/python-enum34/description
+enum34 is the new Python stdlib enum module available in Python 3.4
+backported for previous versions of Python from 2.4 to 3.3.
+endef
+
+define PyPackage/python-enum34/filespec
++|$(PYTHON_PKG_DIR)
+-|$(PYTHON_PKG_DIR)/enum/test.py
+endef
+
+$(eval $(call PyPackage,python-enum34))
+$(eval $(call BuildPackage,python-enum34))
+$(eval $(call BuildPackage,python-enum34-src))
diff --git a/lang/python/python-enum34/patches/001-omit-docs.patch b/lang/python/python-enum34/patches/001-omit-docs.patch
new file mode 100644 (file)
index 0000000..cff6c52
--- /dev/null
@@ -0,0 +1,19 @@
+diff -r f24487b45cd0 setup.py
+--- a/setup.py Sun May 15 20:28:23 2016 -0700
++++ b/setup.py Wed Jul 27 22:49:13 2016 +0800
+@@ -63,15 +63,6 @@
+         version='1.1.6',\r
+         url='https://bitbucket.org/stoneleaf/enum34',\r
+         packages=['enum'],\r
+-        package_data={\r
+-            'enum' : [\r
+-                'LICENSE',\r
+-                'README',\r
+-                'doc/enum.rst',\r
+-                'doc/enum.pdf',\r
+-                'test.py',\r
+-                ]\r
+-            },\r
+         license='BSD License',\r
+         description='Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4',\r
+         long_description=long_desc,\r
diff --git a/lang/python/python-evdev/Makefile b/lang/python/python-evdev/Makefile
new file mode 100644 (file)
index 0000000..4bdf521
--- /dev/null
@@ -0,0 +1,83 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=python-evdev
+PKG_VERSION:=0.7.0
+PKG_RELEASE:=1
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_MAINTAINER:=Paulo Costa <me@paulo.costa.nom.br>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_SOURCE:=evdev-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/67/15/eac376f3e1fc1960a54439c21459b2582e68340001aff83b4ace9e5bd110
+PKG_HASH:=57edafc469a414f58b51af1bfb9ee2babb9f626dd2df530d71c1176871850aa1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-evdev-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-evdev/Default
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  URL:=https://github.com/gvalkov/python-evdev
+endef
+
+define Package/python-evdev
+$(call Package/python-evdev/Default)
+  TITLE:=python-evdev
+  DEPENDS:= \
+     +PACKAGE_python-evdev:python-light \
+     +PACKAGE_python-evdev:python-ctypes
+  VARIANT:=python
+endef
+
+define Package/python3-evdev
+$(call Package/python-evdev/Default)
+  TITLE:=python3-evdev
+  DEPENDS:= \
+      +PACKAGE_python3-evdev:python3-light \
+      +PACKAGE_python3-evdev:python3-ctypes
+  VARIANT:=python3
+endef
+
+
+define Package/python-evdev/description
+       Bindings to the Linux input handling subsystem
+endef
+
+define Package/python3-evdev/description
+$(call Package/python-evdev/description)
+.
+(Variant for Python3)
+endef
+
+define PyBuild/Compile
+       $(call Build/Compile/PyMod,, build \
+               build_ecodes  --evdev-headers="$(LINUX_DIR)/include/uapi/linux/input.h:$(LINUX_DIR)/include/uapi/linux/input-event-codes.h" \
+               build_ext \
+               install --root="$(PKG_INSTALL_DIR)" --prefix="/usr")
+endef
+
+define Py3Build/Compile
+       $(call Build/Compile/Py3Mod,, build \
+               build_ecodes  --evdev-headers="$(LINUX_DIR)/include/uapi/linux/input.h:$(LINUX_DIR)/include/uapi/linux/input-event-codes.h" \
+               build_ext \
+               install --root="$(PKG_INSTALL_DIR)" --prefix="/usr")
+endef
+
+$(eval $(call PyPackage,python-evdev))
+$(eval $(call BuildPackage,python-evdev))
+$(eval $(call Py3Package,python3-evdev))
+$(eval $(call BuildPackage,python3-evdev))
diff --git a/lang/python/python-gmpy2/Makefile b/lang/python/python-gmpy2/Makefile
new file mode 100644 (file)
index 0000000..9917413
--- /dev/null
@@ -0,0 +1,79 @@
+#
+# Copyright (C) 2015-2018 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:=python-gmpy2
+PKG_VERSION:=2.0.8
+PKG_RELEASE:=2
+
+PKG_SOURCE:=gmpy2-$(PKG_VERSION).zip
+PKG_SOURCE_URL:=https://pypi.python.org/packages/90/f4/9a2e384b325b69bc5827b9a6510a8fb4a51698c915c06a3f25a86458892a
+PKG_HASH:=dd233e3288b90f21b0bb384bcc7a7e73557bb112ccf0032ad52aa614eb373d3f
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-gmpy2-$(PKG_VERSION)
+
+PKG_LICENSE:=LGPL-3.0+
+PKG_LICENSE_FILES:=COPYING.LESSER
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=unzip -q -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE); mv -f $(PKG_BUILD_DIR)/gmpy2-$(PKG_VERSION)/* $(PKG_BUILD_DIR)
+
+define Package/python-gmpy2/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://code.google.com/p/gmpy/
+endef
+
+define Package/python-gmpy2
+$(call Package/python-gmpy2/Default)
+  TITLE:=python-gmpy2
+  DEPENDS:=+libgmp +PACKAGE_python-gmpy2:python-light
+  VARIANT:=python
+endef
+
+define Package/python3-gmpy2
+$(call Package/python-gmpy2/Default)
+  TITLE:=python3-gmpy2
+  DEPENDS:=+libgmp +PACKAGE_python3-gmpy2:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-gmpy2/description
+gmpy2 is a C-coded Python extension module that supports multiple-precision
+arithmetic. gmpy2 is the successor to the original gmpy module. The gmpy module
+only supported the GMP multiple-precision library. gmpy2 adds support for the
+MPFR (correctly rounded real floating-point arithmetic) and MPC (correctly
+rounded complex floating-point arithmetic) libraries. gmpy2 also updates the
+API and naming conventions to be more consistent and support the additional
+functionality.
+endef
+
+define Package/python3-gmpy2/description
+$(call Package/python-gmpy2/description)
+.
+(Variant for Python3)
+endef
+
+define PyBuild/Compile
+       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" --nompfr)
+endef
+
+define Py3Build/Compile
+       $(call Build/Compile/Py3Mod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" --nompfr)
+endef
+
+$(eval $(call PyPackage,python-gmpy2))
+$(eval $(call BuildPackage,python-gmpy2))
+
+$(eval $(call Py3Package,python3-gmpy2))
+$(eval $(call BuildPackage,python3-gmpy2))
diff --git a/lang/python/python-gnupg/Makefile b/lang/python/python-gnupg/Makefile
new file mode 100644 (file)
index 0000000..0c209a7
--- /dev/null
@@ -0,0 +1,83 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-gnupg
+PKG_VERSION:=0.4.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/fc/f1/df6c06da34939f67ea622e0b31dbc5bdb5121b271ab530d151df59974425/
+PKG_HASH:=ef47b02eaf41dee3cf4b02ddf83130827318de9fe3eae89d01a3f05859e20e1a
+
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+define Package/python-gnupg/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/isislovecruft/python-gnupg
+  DEPENDS:=+gnupg
+endef
+
+define Package/python-gnupg
+$(call Package/python-gnupg/Default)
+  TITLE:=python-pyodbc
+  DEPENDS+=+PACKAGE_python-gnupg:python-light
+  VARIANT:=python
+endef
+
+define Package/python3-gnupg
+$(call Package/python-gnupg/Default)
+  TITLE:=python3-gnupg
+  DEPENDS+=+PACKAGE_python3-gnupg:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-gnupg/description
+A Python wrapper for GnuPG
+
+This module allows easy access to GnuPG.s key management, encryption
+and signature functionality from Python programs, by interacting with
+GnuPG through file descriptors. Input arguments are strictly checked
+and sanitised, and therefore this module should be safe to use in
+networked applications requiring direct user input. It is intended for
+use on Windows, MacOS X, BSD, or Linux, with Python 2.6, Python 2.7,
+Python 3.3, Python 3.4, or PyPy.
+endef
+
+define Package/python3-gnupg/description
+$(call Package/python-gnupg/description)
+
+(Variant for Python3)
+endef
+
+define PyBuild/Compile
+       $(call Build/Compile/PyMod,,\
+               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
+       )
+endef
+
+define Py3Build/Compile
+       $(call Build/Compile/Py3Mod,,\
+               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
+       )
+endef
+
+
+$(eval $(call PyPackage,python-gnupg))
+$(eval $(call BuildPackage,python-gnupg))
+
+$(eval $(call Py3Package,python3-gnupg))
+$(eval $(call BuildPackage,python3-gnupg))
diff --git a/lang/python/python-host.mk b/lang/python/python-host.mk
new file mode 100644 (file)
index 0000000..d4dc81f
--- /dev/null
@@ -0,0 +1,97 @@
+#
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# Note: include this after `include $(TOPDIR)/rules.mk in your package Makefile
+#       if `python-package.mk` is included, this will already be included
+
+ifneq ($(__python_host_mk_inc),1)
+__python_host_mk_inc=1
+
+# For PYTHON_VERSION
+python_mk_path:=$(dir $(lastword $(MAKEFILE_LIST)))
+include $(python_mk_path)python-version.mk
+
+HOST_PYTHON_DIR:=$(STAGING_DIR_HOSTPKG)
+HOST_PYTHON_INC_DIR:=$(HOST_PYTHON_DIR)/include/python$(PYTHON_VERSION)
+HOST_PYTHON_LIB_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)
+
+HOST_PYTHON_PKG_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)/site-packages
+
+HOST_PYTHON_BIN:=$(HOST_PYTHON_DIR)/bin/python$(PYTHON_VERSION)
+
+HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(HOST_PYTHON_PKG_DIR)
+
+define HostPython
+       if [ "$(strip $(3))" == "HOST" ]; then \
+               export PYTHONPATH="$(HOST_PYTHONPATH)"; \
+               export PYTHONDONTWRITEBYTECODE=0; \
+       else \
+               export PYTHONPATH="$(PYTHONPATH)"; \
+               export PYTHONDONTWRITEBYTECODE=1; \
+               export _python_sysroot="$(STAGING_DIR)"; \
+               export _python_prefix="/usr"; \
+               export _python_exec_prefix="/usr"; \
+       fi; \
+       export PYTHONOPTIMIZE=""; \
+       $(1) \
+       $(HOST_PYTHON_BIN) $(2);
+endef
+
+define host_python_settings
+       ARCH="$(HOST_ARCH)" \
+       CC="$(HOSTCC)" \
+       CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
+       CXX="$(HOSTCXX)" \
+       LD="$(HOSTCC)" \
+       LDSHARED="$(HOSTCC) -shared" \
+       CFLAGS="$(HOST_CFLAGS)" \
+       CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON_INC_DIR)" \
+       LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
+       _PYTHON_HOST_PLATFORM=linux2
+endef
+
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
+# $(3) => additional variables
+define Build/Compile/HostPyRunHost
+       $(call HostPython, \
+               $(if $(1),$(1);) \
+               $(call host_python_settings) \
+               $(3) \
+               , \
+               $(2) \
+               , \
+               HOST \
+       )
+endef
+
+# Note: I shamelessly copied this from Yousong's logic (from python-packages);
+HOST_PYTHON_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON_VERSION)
+define host_python_pip_install
+       $(call host_python_settings) \
+       $(HOST_PYTHON_PIP) install \
+               --root=$(1) \
+               --prefix=$(2) \
+               --ignore-installed \
+               $(3)
+endef
+
+define host_python_pip_install_host
+$(call host_python_pip_install,$(STAGING_DIR_HOSTPKG),"",$(1))
+endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/HostPyMod
+       $(call Build/Compile/HostPyRunHost, \
+               cd $(HOST_BUILD_DIR)/$(strip $(1)), \
+               ./setup.py $(2), \
+               $(3))
+endef
+
+endif # __python_host_mk_inc
diff --git a/lang/python/python-hyperlink/Makefile b/lang/python/python-hyperlink/Makefile
new file mode 100644 (file)
index 0000000..7f1d241
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# Copyright (C) 2018 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:=python-hyperlink
+PKG_VERSION:=17.3.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=hyperlink-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/h/hyperlink
+PKG_HASH:=bc4ffdbde9bdad204d507bd8f554f16bba82dd356f6130cb16f41422909c33bc
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-hyperlink-$(PKG_VERSION)
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-hyperlink/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/python-hyper/hyperlink
+endef
+
+define Package/python-hyperlink
+$(call Package/python-hyperlink/Default)
+  TITLE:=Pure-Python immutable URLs
+  DEPENDS:=+PACKAGE_python-hyperlink:python-light
+  VARIANT:=python
+endef
+
+define Package/python3-hyperlink
+$(call Package/python-hyperlink/Default)
+  TITLE:=Pure-Python immutable URLs
+  DEPENDS:=+PACKAGE_python3-hyperlink:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-hyperlink/description
+Hyperlink provides a pure-Python implementation of immutable URLs. Based
+on RFC 3986 and 3987, the Hyperlink URL makes working with both URIs and
+IRIs easy.
+endef
+
+define Package/python3-hyperlink/description
+$(call Package/python-hyperlink/description)
+.
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-hyperlink))
+$(eval $(call BuildPackage,python-hyperlink))
+$(eval $(call BuildPackage,python-hyperlink-src))
+
+$(eval $(call Py3Package,python3-hyperlink))
+$(eval $(call BuildPackage,python3-hyperlink))
+$(eval $(call BuildPackage,python3-hyperlink-src))
diff --git a/lang/python/python-hyperlink/patches/001-omit-tests.patch b/lang/python/python-hyperlink/patches/001-omit-tests.patch
new file mode 100644 (file)
index 0000000..cd0c8b8
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/setup.py
++++ b/setup.py
+@@ -24,8 +24,9 @@ setup(name='hyperlink',
+       author=__author__,
+       author_email=__contact__,
+       url=__url__,
+-      packages=['hyperlink', 'hyperlink.test'],
++      packages=['hyperlink'],
+       include_package_data=True,
++      exclude_package_data={'':['test/*']},
+       zip_safe=False,
+       license=__license__,
+       platforms='any',
diff --git a/lang/python/python-idna/Makefile b/lang/python/python-idna/Makefile
new file mode 100644 (file)
index 0000000..47f4b96
--- /dev/null
@@ -0,0 +1,70 @@
+#
+# Copyright (C) 2015-2018 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:=python-idna
+PKG_VERSION:=2.6
+PKG_RELEASE:=2
+
+PKG_SOURCE:=idna-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/f4/bd/0467d62790828c23c47fc1dfa1b1f052b24efdf5290f071c7a91d0d82fd3
+PKG_HASH:=2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE.rst
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-idna-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-idna/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/kjd/idna
+endef
+
+define Package/python-idna
+$(call Package/python-idna/Default)
+  TITLE:=python-idna
+  DEPENDS:=+PACKAGE_python-idna:python-light
+  VARIANT:=python
+endef
+
+define Package/python3-idna
+$(call Package/python-idna/Default)
+  TITLE:=python3-idna
+  DEPENDS:=+PACKAGE_python3-idna:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-idna/description
+A library to support the Internationalised Domain Names in Applications
+(IDNA) protocol as specified in RFC 5891. This version of the protocol
+is often referred to as "IDNA2008" and can produce different results
+from the earlier standard from 2003.
+endef
+
+define Package/python3-idna/description
+$(call Package/python-idna/description)
+.
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-idna))
+$(eval $(call BuildPackage,python-idna))
+$(eval $(call BuildPackage,python-idna-src))
+
+$(eval $(call Py3Package,python3-idna))
+$(eval $(call BuildPackage,python3-idna))
+$(eval $(call BuildPackage,python3-idna-src))
diff --git a/lang/python/python-incremental/Makefile b/lang/python/python-incremental/Makefile
new file mode 100644 (file)
index 0000000..107cfaf
--- /dev/null
@@ -0,0 +1,67 @@
+#
+# Copyright (C) 2018 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:=python-incremental
+PKG_VERSION:=17.5.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=incremental-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/i/incremental
+PKG_HASH:=7b751696aaf36eebfab537e458929e194460051ccad279c72b755a167eebd4b3
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-incremental-$(PKG_VERSION)
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-incremental/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/twisted/incremental
+endef
+
+define Package/python-incremental
+$(call Package/python-incremental/Default)
+  TITLE:=Versions your Python projects
+  DEPENDS:=+PACKAGE_python-incremental:python-light
+  VARIANT:=python
+endef
+
+define Package/python3-incremental
+$(call Package/python-incremental/Default)
+  TITLE:=Versions your Python projects
+  DEPENDS:=+PACKAGE_python3-incremental:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-incremental/description
+Incremental is a small library that versions your Python projects.
+endef
+
+define Package/python3-incremental/description
+$(call Package/python-incremental/description)
+.
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-incremental))
+$(eval $(call BuildPackage,python-incremental))
+$(eval $(call BuildPackage,python-incremental-src))
+
+$(eval $(call Py3Package,python3-incremental))
+$(eval $(call BuildPackage,python3-incremental))
+$(eval $(call BuildPackage,python3-incremental-src))
diff --git a/lang/python/python-incremental/patches/001-omit-tests.patch b/lang/python/python-incremental/patches/001-omit-tests.patch
new file mode 100644 (file)
index 0000000..b2c0496
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/setup.py
++++ b/setup.py
+@@ -32,7 +32,7 @@ setup(
+         "Programming Language :: Python :: 3.5",
+         "Programming Language :: Python :: 3.6",
+     ],
+-    packages=find_packages("src", exclude=("exampleproj",)),
++    packages=find_packages("src", exclude=("exampleproj", "*.tests", "*.tests.*")),
+     package_dir={"": "src"},
+     extras_require={
+         "scripts": [
diff --git a/lang/python/python-ipaddress/Makefile b/lang/python/python-ipaddress/Makefile
new file mode 100644 (file)
index 0000000..3cafd5e
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2015-2018 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:=python-ipaddress
+PKG_VERSION:=1.0.19
+PKG_RELEASE:=2
+
+PKG_SOURCE:=ipaddress-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/f0/ba/860a4a3e283456d6b7e2ab39ce5cf11a3490ee1a363652ac50abf9f0f5df
+PKG_HASH:=200d8686011d470b5e4de207d803445deee427455cd0cb7c982b68cf82524f81
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-ipaddress-$(PKG_VERSION)
+
+PKG_LICENSE:=Python-2.0
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-ipaddress/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/phihag/ipaddress
+endef
+
+define Package/python-ipaddress
+$(call Package/python-ipaddress/Default)
+  TITLE:=python-ipaddress
+  DEPENDS:=+PACKAGE_python-ipaddress:python-light
+  VARIANT:=python
+endef
+
+define Package/python-ipaddress/description
+Python 3.3+'s ipaddress for Python 2.6, 2.7, 3.2.
+endef
+
+$(eval $(call PyPackage,python-ipaddress))
+$(eval $(call BuildPackage,python-ipaddress))
+$(eval $(call BuildPackage,python-ipaddress-src))
diff --git a/lang/python/python-ldap/Makefile b/lang/python/python-ldap/Makefile
new file mode 100644 (file)
index 0000000..a8d983d
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2016-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:=python-ldap
+PKG_VERSION:=2.4.32
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dmitry Trefilov <the-alien@live.ru>
+PKG_LICENSE:=Python-style
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/67/d9/fa0ea70d1792875745116ad62ac8d4bcb07550b15cded591bb57df6a6d9a
+PKG_HASH:=5810f1b5a9ae9255df99fb9c2dcab7352fed325687efda56c0faae1a82c5e3cb
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/python-ldap
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  DEPENDS:=+libopenldap +python
+  TITLE:=Python modules for implementing LDAP clients
+  URL:=http://python-ldap.org/
+endef
+
+define Package/python-ldap/description
+  python-ldap provides an object-oriented API to access LDAP directory
+  servers from Python programs. Mainly it wraps the OpenLDAP 2.x libs
+  for that purpose. Additionally the package contains modules for
+  other LDAP-related stuff (e.g. processing LDIF, LDAPURLs, LDAPv3
+  schema, LDAPv3 extended operations and controls, etc.).
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,build_ext \
+               --include-dirs="$(STAGING_DIR)/usr/include:$(STAGING_DIR)/usr/include/sasl" \
+               --library-dirs="$(STAGING_DIR)/usr/lib:$(STAGING_DIR)/usr/lib/sasl2" \
+       build_py \
+       install --prefix="$(PKG_INSTALL_DIR)/usr")
+endef
+
+define PyPackage/python-ldap/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call PyPackage,python-ldap))
+$(eval $(call BuildPackage,python-ldap))
diff --git a/lang/python/python-ldap/patches/010-setup_cfg.patch b/lang/python/python-ldap/patches/010-setup_cfg.patch
new file mode 100644 (file)
index 0000000..372e9d2
--- /dev/null
@@ -0,0 +1,16 @@
+From: Dmitrij Trefilov <the-alien@live.ru>
+
+Subject: [PATCH] lang: removed hardcoded include and library directories from setup.cfg
+Signed-off-by: Dmitrij Trefilov <the-alien@live.ru>
+---
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -1,6 +1,6 @@
+ [_ldap]
+-library_dirs = /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64
+-include_dirs = /usr/include /usr/include/sasl /usr/local/include /usr/local/include/sasl
++library_dirs = 
++include_dirs = 
+ defines = HAVE_SASL HAVE_TLS HAVE_LIBLDAP_R
+ extra_compile_args = 
+ extra_objects = 
diff --git a/lang/python/python-lxml/Makefile b/lang/python/python-lxml/Makefile
new file mode 100644 (file)
index 0000000..0c543fc
--- /dev/null
@@ -0,0 +1,94 @@
+#
+# Copyright (C) 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:=python-lxml
+PKG_VERSION:=4.1.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=lxml-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://lxml.de/files/
+PKG_HASH:=940caef1ec7c78e0c34b0f6b94fe42d0f2022915ffc78643d28538a5cfd0f40e
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-lxml-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+PKG_LICENSE:=BSD
+PKG_LICENSE_FILES:=LICENSES.txt
+PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+define Package/python-lxml/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://lxml.de
+  DEPENDS:=+libxml2 +libxslt +libexslt
+endef
+
+define Package/python-lxml
+$(call Package/python-lxml/Default)
+  TITLE:=python-lxml
+  DEPENDS+=+PACKAGE_python-lxml:python-light +PACKAGE_python-lxml:python-codecs
+  VARIANT:=python
+endef
+
+define Package/python3-lxml
+$(call Package/python-lxml/Default)
+  TITLE:=python3-lxml
+  DEPENDS+=+PACKAGE_python3-lxml:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-lxml/description
+The lxml XML toolkit is a Pythonic binding
+for the C libraries libxml2 and libxslt.
+endef
+
+define Package/python3-lxml/description
+$(call Package/python-lxml/description)
+.
+(Variant for Python3)
+endef
+
+TARGET_LDFLAGS += -lxml2 -lxslt -lexslt
+
+define PyBuild/Compile
+       $(call Build/Compile/PyMod,, \
+               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
+               --static \
+               --single-version-externally-managed \
+               , \
+               INCLUDE="$(STAGING_DIR)/usr/include/ $(STAGING_DIR)/usr/include/libxml2" \
+               LIBRARY="$(STAGING_DIR)/usr/lib $(STAGING_DIR)/lib" \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               LDFLAGS="$(TARGET_LDFLAGS)" \
+       )
+endef
+
+define Py3Build/Compile
+       $(call Build/Compile/Py3Mod,, \
+               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
+               --static \
+               --single-version-externally-managed \
+               , \
+               INCLUDE="$(STAGING_DIR)/usr/include/ $(STAGING_DIR)/usr/include/libxml2" \
+               LIBRARY="$(STAGING_DIR)/usr/lib $(STAGING_DIR)/lib" \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               LDFLAGS="$(TARGET_LDFLAGS)" \
+       )
+endef
+
+$(eval $(call PyPackage,python-lxml))
+$(eval $(call BuildPackage,python-lxml))
+
+$(eval $(call Py3Package,python3-lxml))
+$(eval $(call BuildPackage,python3-lxml))
diff --git a/lang/python/python-mysql/Makefile b/lang/python/python-mysql/Makefile
new file mode 100644 (file)
index 0000000..f776b74
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=MySQL-python
+PKG_VERSION:=1.2.5
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/M/MySQL-python/
+PKG_HASH:=811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/python-mysql
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=MySQL database adapter for Python
+  URL:=https://pypi.python.org/pypi/MySQL-python
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  DEPENDS:=+python +libmysqlclient
+endef
+
+define Package/python-mysql/description
+ MySQLdb is an thread-compatible interface to the popular MySQL database
+ server that provides the Python database API.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/python-mysql/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-mysql))
diff --git a/lang/python/python-mysql/patches/010-threadsafe.patch b/lang/python/python-mysql/patches/010-threadsafe.patch
new file mode 100644 (file)
index 0000000..bcd9af8
--- /dev/null
@@ -0,0 +1,11 @@
+--- MySQL-python-1.2.2/site_orig.cfg   2007-08-15 12:58:40.000000000 +0200
++++ MySQL-python-1.2.2/site.cfg        2007-08-15 12:58:49.000000000 +0200
+@@ -4,7 +4,7 @@
+ # static: link against a static library (probably required for embedded)
+ embedded = False
+-threadsafe = True
++threadsafe = False
+ static = False
+ # The path to mysql_config.
diff --git a/lang/python/python-package-install.sh b/lang/python/python-package-install.sh
new file mode 100644 (file)
index 0000000..e5f6ec8
--- /dev/null
@@ -0,0 +1,91 @@
+#!/bin/sh
+set -e
+
+[ -z "$SOURCE_DATE_EPOCH" ] || {
+       PYTHONHASHSEED="$SOURCE_DATE_EPOCH"
+       export PYTHONHASHSEED
+}
+
+process_filespec() {
+       local src_dir="$1"
+       local dst_dir="$2"
+       local filespec="$3"
+       echo "$filespec" | (
+       IFS='|'
+       while read fop fspec fperm; do
+               local fop=`echo "$fop" | tr -d ' \t\n'`
+               if [ "$fop" = "+" ]; then
+                       if [ ! -e "${src_dir}${fspec}" ]; then
+                               echo "File not found '${src_dir}${fspec}'"
+                               exit 1
+                       fi
+                       dpath=`dirname "$fspec"`
+                       if [ -z "$fperm" ]; then
+                               dperm=`stat -c "%a" ${src_dir}${dpath}`
+                       fi
+                       mkdir -p -m$dperm ${dst_dir}${dpath}
+                       echo "copying: '$fspec'"
+                       cp -fpR ${src_dir}${fspec} ${dst_dir}${dpath}/
+                       if [ -n "$fperm" ]; then
+                               chmod -R $fperm ${dst_dir}${fspec}
+                       fi
+               elif [ "$fop" = "-" ]; then
+                       echo "removing: '$fspec'"
+                       rm -fR ${dst_dir}${fspec}
+               elif [ "$fop" = "=" ]; then
+                       echo "setting permissions: '$fperm' on '$fspec'"
+                       chmod -R $fperm ${dst_dir}${fspec}
+               fi
+       done
+       )
+}
+
+ver="$1"
+src_dir="$2"
+dst_dir="$3"
+python="$4"
+mode="$5"
+filespec="$6"
+
+process_filespec "$src_dir" "$dst_dir" "$filespec" || {
+       echo "process filespec error-ed"
+       exit 1
+}
+
+if [ "$mode" == "sources" ] ; then
+       # Copy only python source files
+       find $dst_dir -not -type d -not -name "*\.py" | xargs rm -f
+
+       # Delete empty folders (if the case)
+       if [ -d "$dst_dir/usr" ] ; then
+               find $dst_dir/usr -type d | xargs rmdir --ignore-fail-on-non-empty
+               rmdir --ignore-fail-on-non-empty $dst_dir/usr
+       fi
+       exit 0
+fi
+
+legacy=
+[ "$ver" == "3" ] && legacy="-b"
+
+# XXX [So that you won't goof as I did]
+# Note: Yes, I tried to use the -O & -OO flags here.
+#       However the generated byte-codes were not portable.
+#       So, we just stuck to un-optimized byte-codes,
+#       which is still way better/faster than running
+#       Python sources all the time.
+$python -m compileall $legacy -d '/' $dst_dir || {
+       echo "python -m compileall err-ed"
+       exit 1
+}
+
+# Delete source files and pyc [ un-optimized bytecode files ]
+# We may want to make this optimization thing configurable later, but not sure atm
+find $dst_dir -type f -name "*\.py" | xargs rm -f
+
+# Delete empty folders (if the case)
+if [ -d "$dst_dir/usr" ] ; then
+       find $dst_dir/usr -type d | xargs rmdir --ignore-fail-on-non-empty
+       rmdir --ignore-fail-on-non-empty $dst_dir/usr
+fi
+
+exit 0
diff --git a/lang/python/python-package.mk b/lang/python/python-package.mk
new file mode 100644 (file)
index 0000000..66a4929
--- /dev/null
@@ -0,0 +1,139 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# Note: include this after `include $(TOPDIR)/rules.mk in your package Makefile
+
+python_mk_path:=$(dir $(lastword $(MAKEFILE_LIST)))
+include $(python_mk_path)python-host.mk
+
+PYTHON_DIR:=$(STAGING_DIR)/usr
+PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin
+PYTHON_INC_DIR:=$(PYTHON_DIR)/include/python$(PYTHON_VERSION)
+PYTHON_LIB_DIR:=$(PYTHON_DIR)/lib/python$(PYTHON_VERSION)
+
+PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
+
+PYTHON:=python$(PYTHON_VERSION)
+
+PYTHONPATH:=$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
+
+# These configure args are needed in detection of path to Python header files
+# using autotools.
+CONFIGURE_ARGS += \
+       _python_sysroot="$(STAGING_DIR)" \
+       _python_prefix="/usr" \
+       _python_exec_prefix="/usr"
+
+PKG_USE_MIPS16:=0
+# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
+# flags are inherited from the Python base package (via sysconfig module)
+ifdef CONFIG_USE_MIPS16
+  TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
+endif
+
+define PyPackage
+
+  define Package/$(1)-src
+    $(call Package/$(1))
+    DEPENDS:=
+    TITLE+= (sources)
+  endef
+
+  define Package/$(1)-src/description
+    $(call Package/$(1)/description).
+    (Contains the Python sources for this package).
+  endef
+
+  # Add default PyPackage filespec none defined
+  ifndef PyPackage/$(1)/filespec
+    define PyPackage/$(1)/filespec
+      +|$(PYTHON_PKG_DIR)
+    endef
+  endif
+
+  ifndef PyPackage/$(1)/install
+    define PyPackage/$(1)/install
+               if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
+                       $(INSTALL_DIR) $$(1)/usr/bin ; \
+                       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/ ; \
+               fi
+    endef
+  endif
+
+  ifndef Package/$(1)/install
+  $(call shexport,PyPackage/$(1)/filespec)
+
+  define Package/$(1)/install
+       $(call PyPackage/$(1)/install,$$(1))
+       find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
+       $(SHELL) $(python_mk_path)python-package-install.sh "2" \
+               "$(PKG_INSTALL_DIR)" "$$(1)" \
+               "$(HOST_PYTHON_BIN)" "$$(2)" \
+               "$$$$$$$$$$(call shvar,PyPackage/$(1)/filespec)"
+  endef
+
+  define Package/$(1)-src/install
+       $$(call Package/$(1)/install,$$(1),sources)
+  endef
+  endif # Package/$(1)/install
+endef
+
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
+# $(3) => additional variables
+define Build/Compile/HostPyRunTarget
+       $(call HostPython, \
+               $(if $(1),$(1);) \
+               CC="$(TARGET_CC)" \
+               CCSHARED="$(TARGET_CC) $(FPIC)" \
+               CXX="$(TARGET_CXX)" \
+               LD="$(TARGET_CC)" \
+               LDSHARED="$(TARGET_CC) -shared" \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON_INC_DIR)" \
+               LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON_VERSION)" \
+               _PYTHON_HOST_PLATFORM=linux2 \
+               __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON)" \
+               $(3) \
+               , \
+               $(2) \
+       )
+endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/PyMod
+       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
+       $(call Build/Compile/HostPyRunTarget, \
+               cd $(PKG_BUILD_DIR)/$(strip $(1)), \
+               ./setup.py $(2), \
+               $(3))
+       find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
+endef
+
+PYTHON_PKG_SETUP_ARGS:=--single-version-externally-managed
+PYTHON_PKG_SETUP_VARS:=
+
+define PyBuild/Compile/Default
+       $(foreach pkg,$(HOST_PYTHON_PACKAGE_BUILD_DEPENDS),
+               $(call host_python_pip_install_host,$(pkg))
+       )
+       $(call Build/Compile/PyMod,, \
+               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
+               $(PYTHON_PKG_SETUP_ARGS), \
+               $(PYTHON_PKG_SETUP_VARS) \
+       )
+endef
+
+PyBuild/Compile=$(PyBuild/Compile/Default)
+
+ifeq ($(BUILD_VARIANT),python)
+define Build/Compile
+       $(call PyBuild/Compile)
+endef
+endif # python
diff --git a/lang/python/python-packages/Makefile b/lang/python/python-packages/Makefile
new file mode 100644 (file)
index 0000000..cefc2cb
--- /dev/null
@@ -0,0 +1,130 @@
+#
+# Copyright (C) 2016 Yousong Zhou <yszhou4tech@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-packages
+PKG_VERSION:=1.0
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
+
+#
+# NOTE: move the host module installation to Host/Compile when
+# HOST_CONFIG_DEPENDS is supported
+#
+# NOTE: PKG_CONFIG_DEPENDS cannot correctly track changes of string type config
+# options, so you may want to do manual cleanup on config change.
+#
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_PACKAGE_python-packages-list-host \
+       CONFIG_PACKAGE_python-packages-list \
+       CONFIG_PACKAGE_python-packages-list-cleanup \
+       CONFIG_PACKAGE_python-packages-envs \
+       CONFIG_PACKAGE_python-packages-extra-deps \
+       CONFIG_PACKAGE_python-packages-index-url \
+       CONFIG_PACKAGE_python-packages-pip-opts \
+
+PKG_BUILD_DEPENDS:=python python/host
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/python-packages
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=A dummy package for packaging python modules with pip
+  DEPENDS:=@DEVEL +python
+endef
+
+define Package/python-packages/config
+if PACKAGE_python-packages
+config PACKAGE_python-packages-list-host
+       string "List of python packages to install on host"
+config PACKAGE_python-packages-list
+       string "List of python packages to install on target"
+config PACKAGE_python-packages-list-cleanup
+       string "List of python packages to cleanup to avoid clash with existing packages"
+config PACKAGE_python-packages-envs
+       string "Extra environment variables to pass on to pip and its children on target build"
+config PACKAGE_python-packages-extra-deps
+       string "List of deps fulfilled but not tracked by the build system"
+config PACKAGE_python-packages-index-url
+       string "Index URL passed to pip with --index-url"
+config PACKAGE_python-packages-pip-opts
+       string "Additional arguments to pip command line"
+endif
+endef
+
+CONFIG_PACKAGE_python-packages-list-host:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-list-host))
+CONFIG_PACKAGE_python-packages-list:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-list))
+CONFIG_PACKAGE_python-packages-list-cleanup:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-list-cleanup))
+CONFIG_PACKAGE_python-packages-envs:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-envs))
+CONFIG_PACKAGE_python-packages-extra-deps:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-extra-deps))
+CONFIG_PACKAGE_python-packages-pip-opts:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-pip-opts))
+
+HOST_PYTHON_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON_VERSION)
+
+decr=$(word $(1),0 1 2 3 4 5 6 7 8 9 10)
+recur=$(if $(subst 0,,$(2)),$(call recur,$(1),$(call decr,$(2)),$(call $(1)$(2),$(3))),$(3))
+_req2dir1=$(subst >,gt,$(1))
+_req2dir2=$(subst <,lt,$(1))
+_req2dir3=$(subst >=,geq,$(1))
+_req2dir4=$(subst <=,leq,$(1))
+_req2dir5=$(subst ://,:::,$(1))
+_req2dir6=$(subst *,_,$(1))
+_req2dir7=$(subst ?,_,$(1))
+req2dir=$(call recur,_req2dir,7,$(1))
+
+# --ignore-installed, it may happen that host pip will ignore target install if
+#  it was already installed as host module, e.g. cffi deps of cryptograph
+HOST_PYTHON_PIP_INSTALL=$(HOST_PYTHON_PIP) install \
+       --root=$(1) \
+       --prefix=$(2) \
+       --ignore-installed \
+       --no-compile \
+       $(if $(CONFIG_PACKAGE_python-packages-index-url), --index-url $(CONFIG_PACKAGE_python-packages-index-url)) \
+       $(if $(CONFIG_PACKAGE_python-packages-pip-opts), $(CONFIG_PACKAGE_python-packages-pip-opts)) \
+
+HOST_PYTHON_PIP_INSTALL_HOST:=$(call HOST_PYTHON_PIP_INSTALL,$(STAGING_DIR_HOSTPKG),"")
+HOST_PYTHON_PIP_INSTALL_TARGET=$(call HOST_PYTHON_PIP_INSTALL,$(PKG_INSTALL_DIR)/$(call req2dir,$(pkg)),/usr)
+HOST_PYTHON_PIP_INSTALL_CLEANUP:=$(call HOST_PYTHON_PIP_INSTALL,$(PKG_INSTALL_DIR)/_cleanup,/usr)
+
+define Build/Compile
+       $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list-host),
+               $(call Build/Compile/HostPyRunHost,,$(HOST_PYTHON_PIP_INSTALL_HOST) $(pkg))
+       )
+       $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list),
+               $(call Build/Compile/HostPyRunTarget,,$(call HOST_PYTHON_PIP_INSTALL_TARGET,$(pkg)) $(pkg),$(CONFIG_PACKAGE_python-packages-envs))
+       )
+       $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list-cleanup),
+               $(call Build/Compile/HostPyRunTarget,,$(HOST_PYTHON_PIP_INSTALL_CLEANUP) $(pkg),$(CONFIG_PACKAGE_python-packages-envs))
+       )
+endef
+
+define Package/python-packages/install
+       $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list),
+               $(CP) "$(PKG_INSTALL_DIR)/$(call req2dir,$(pkg))"/* $(1)
+       )
+
+       find "$(PKG_INSTALL_DIR)/_cleanup" -mindepth 1 -depth | while read sf; do \
+               tf="$$$${sf#$(PKG_INSTALL_DIR)/_cleanup/}"; \
+               tf="$(1)/$$$$tf"; \
+               if [ -f "$$$$tf" -o -L "$$$$tf" ]; then \
+                       rm -vf "$$$$tf"; \
+               elif [ -d "$$$$tf" ]; then \
+                       rmdir -v -p "$$$$tf" || true; \
+               fi \
+       done
+endef
+
+define Package/python-packages/extra_provides
+       echo $(CONFIG_PACKAGE_python-packages-extra-deps) | tr ' ' '\n'
+endef
+
+$(eval $(call BuildPackage,python-packages))
diff --git a/lang/python/python-packages/README.md b/lang/python/python-packages/README.md
new file mode 100644 (file)
index 0000000..3c09d8e
--- /dev/null
@@ -0,0 +1,72 @@
+This package allows users to package python modules without creating package
+Makefiles for each individual module and their dependencies.  It provides a
+way making packaging python packages faster and may also facilitate the process
+of developing Makefiles for new python packages
+
+This is a raw DEVEL only package.  Using it may entail a lot of implementation
+details and you may need to resolve target dependencies and package details on
+your own
+
+- Third party python packages may depend on features not included in e.g.
+  python-light
+- Some python modules may require host install of another module to progress,
+  e.g. target cryptography requires host cffi
+- Some python modules have external C library dependencies, e.g. pyOpenSSL
+  requires openssl libs
+- Some packages may have an autoconf configure script whose arguments we
+  cannot control with pip and has to be passed on (hacked) by overriding some
+  environment variables
+
+## How it works
+
+1. Install host modules required for building target modules
+2. Install each target module to separate directories
+3. Install another copy of modules for cleanup purposes to make list of
+   installed files to be removed from target modules installed in step 2
+
+Why should it be so
+
+1. Installing target cryptography requires host installation of cffi module
+2. cryptography requires setuptools and pip will install its own copy with
+   --ignore-installed.  When PACKAGE_python-setuptools is also selected, opkg
+   will complain of data file clashes if it was not removed here.
+
+Pip will handle dependency requirements of python modules, but external
+dependencies like c libraries has to be prepared by the build system.  The
+issue is that there is currently no way to express such dependencies, thus may
+cause build failure, e.g. pycrypto requires the presence of libgmp to build
+successfully.
+
+## Tips
+
+If something goes wrong, we can add additional arguments to pip command
+line to check the detailed build process.  Some useful arguments may be
+
+- -v, for verbose output.  Repeat this option if the current level of
+  verbosity is not enough
+- --no-clean, for preserving pip build dir on build failure
+
+## Examples
+
+tornado (python-only module)
+
+       CONFIG_PACKAGE_python-packages=y
+       CONFIG_PACKAGE_python-packages-list="tornado==4.4.2"
+
+cryptography (requires installation of host modules and cleanup on target modules)
+
+       CONFIG_PACKAGE_python-packages=y
+       CONFIG_PACKAGE_python-packages-list-host="cffi"
+       CONFIG_PACKAGE_python-packages-list="cryptography"
+       CONFIG_PACKAGE_python-packages-list-cleanup="setuptools"
+
+pycrypto 2.7a1 (python module with autoconf configure script; depends on
+libgmp; broken wmmintrin.h).  2.6.1 does not work because of a flaw in
+the setup.py hardcoding host include directory
+
+       CONFIG_PACKAGE_libgmp=y
+       CONFIG_PACKAGE_python-packages=y
+       CONFIG_PACKAGE_python-packages-list="https://github.com/dlitz/pycrypto/archive/v2.7a1.tar.gz"
+       CONFIG_PACKAGE_python-packages-envs="ac_cv_header_wmmintrin_h=no build_alias=$(GNU_HOST_NAME) host_alias=$(GNU_TARGET_NAME) target_alias=$(GNU_TARGET_NAME)"
+       CONFIG_PACKAGE_python-packages-extra-deps="libgmp.so.10"
+
diff --git a/lang/python/python-parsley/Makefile b/lang/python/python-parsley/Makefile
new file mode 100644 (file)
index 0000000..53b5095
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# Copyright (C) 2015, 2017-2018 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:=python-parsley
+PKG_VERSION:=1.3
+PKG_RELEASE:=3
+
+PKG_SOURCE:=Parsley-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/P/Parsley
+PKG_HASH:=9444278d47161d5f2be76a767809a3cbe6db4db822f46a4fd7481d4057208d41
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-parsley-$(PKG_VERSION)
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-parsley/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://launchpad.net/parsley
+endef
+
+define Package/python-parsley
+$(call Package/python-parsley/Default)
+  TITLE:=python-parsley
+  DEPENDS:=+PACKAGE_python-parsley:python-light
+  VARIANT:=python
+endef
+
+define Package/python3-parsley
+$(call Package/python-parsley/Default)
+  TITLE:=python3-parsley
+  DEPENDS:=+PACKAGE_python3-parsley:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-parsley/description
+Parsing and pattern matching made easy.
+endef
+
+define Package/python3-parsley/description
+$(call Package/python-parsley/description)
+.
+(Variant for Python3)
+endef
+
+define PyBuild/Compile
+       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
+endef
+
+define Py3Build/Compile
+       $(call Build/Compile/Py3Mod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
+endef
+
+$(eval $(call PyPackage,python-parsley))
+$(eval $(call BuildPackage,python-parsley))
+$(eval $(call BuildPackage,python-parsley-src))
+
+$(eval $(call Py3Package,python3-parsley))
+$(eval $(call BuildPackage,python3-parsley))
+$(eval $(call BuildPackage,python3-parsley-src))
diff --git a/lang/python/python-parsley/patches/001-py3-read-utf8.patch b/lang/python/python-parsley/patches/001-py3-read-utf8.patch
new file mode 100644 (file)
index 0000000..f3e63dc
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/setup.py
++++ b/setup.py
+@@ -4,6 +4,7 @@
+ Setup script for the Parsley distribution.
+ """
++import io
+ from distutils.core import setup
+ setup(
+     name="Parsley",
+@@ -13,7 +14,7 @@ setup(
+     author="Allen Short",
+     author_email="washort42@gmail.com",
+     license="MIT License",
+-    long_description=open("README").read(),
++    long_description=io.open("README", encoding="utf-8").read(),
+     packages=["ometa", "terml", "ometa._generated", "terml._generated",
+               "ometa.test", "terml.test"],
+     py_modules=["parsley"]
diff --git a/lang/python/python-parsley/patches/002-omit-tests.patch b/lang/python/python-parsley/patches/002-omit-tests.patch
new file mode 100644 (file)
index 0000000..4fe43b8
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/setup.py
++++ b/setup.py
+@@ -15,7 +15,6 @@ setup(
+     author_email="washort42@gmail.com",
+     license="MIT License",
+     long_description=io.open("README", encoding="utf-8").read(),
+-    packages=["ometa", "terml", "ometa._generated", "terml._generated",
+-              "ometa.test", "terml.test"],
++    packages=["ometa", "terml", "ometa._generated", "terml._generated"],
+     py_modules=["parsley"]
+ )
diff --git a/lang/python/python-pcapy/Makefile b/lang/python/python-pcapy/Makefile
new file mode 100644 (file)
index 0000000..c1dc932
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# 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:=python-pcapy
+PKG_VERSION:=0.11.1
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Andrew McConachie <andrew@depht.com>
+PKG_LICENSE:=Apache-1.1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=05c8d6978baa3512070ff4c041e5931384e702bbc2ac2c8063760176035958f1
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/CoreSecurity/pcapy.git
+PKG_SOURCE_VERSION:=b91a418374d1636408c435f11799ef725ef70097
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/python-pcapy
+       SECTION:=language-python
+       CATEGORY:=Languages
+       SUBMENU:=Python
+       TITLE:=python-pcapy
+       URL:=https://www.coresecurity.com/corelabs-research/open-source-tools/pcapy
+       DEPENDS:=+python +libpcap +libstdcpp
+endef
+
+define Package/python-pcapy/description
+ Pcapy is a Python extension module that interfaces with the libpcap packet capture library. Pcapy enables python scripts to capture packets on the network. Pcapy is highly effective when used in conjunction with a packet-handling package such as Impacket, which is a collection of Python classes for constructing and dissecting network packets.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,\
+               install --prefix=/usr --root="$(PKG_INSTALL_DIR)" \
+       )
+endef
+
+$(eval $(call PyPackage,python-pcapy))
+$(eval $(call BuildPackage,python-pcapy))
diff --git a/lang/python/python-pip-conf/Makefile b/lang/python/python-pip-conf/Makefile
new file mode 100644 (file)
index 0000000..b8ef7f6
--- /dev/null
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 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:=python-pip-conf
+PKG_VERSION:=0.1
+PKG_RELEASE:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/python-pip-conf
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Configuration file for pip/pip3
+  URL:=https://pip.pypa.io
+  MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
+endef
+
+define Package/python-pip-conf/description
+ Configuration file for pip/pip3
+endef
+
+Build/Compile:=
+
+define Package/python-pip-conf/install
+       $(INSTALL_DIR) $(1)/etc
+       $(CP) ./files/pip.conf $(1)/etc
+endef
+
+$(eval $(call BuildPackage,python-pip-conf))
diff --git a/lang/python/python-pip-conf/files/pip.conf b/lang/python/python-pip-conf/files/pip.conf
new file mode 100644 (file)
index 0000000..89339e9
--- /dev/null
@@ -0,0 +1,3 @@
+[global]
+cache-dir=/tmp/.cache
+log-file=/tmp/pip-log.txt
diff --git a/lang/python/python-ply/Makefile b/lang/python/python-ply/Makefile
new file mode 100644 (file)
index 0000000..6970204
--- /dev/null
@@ -0,0 +1,68 @@
+#
+# Copyright (C) 2015-2018 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:=python-ply
+PKG_VERSION:=3.10
+PKG_RELEASE:=2
+
+PKG_SOURCE:=ply-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.dabeaz.com/ply
+PKG_HASH:=96e94af7dd7031d8d6dd6e2a8e0de593b511c211a86e28a9c9621c275ac8bacb
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-ply-$(PKG_VERSION)
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=README.md
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-ply/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://www.dabeaz.com/ply/
+endef
+
+define Package/python-ply
+$(call Package/python-ply/Default)
+  TITLE:=python-ply
+  DEPENDS:=+PACKAGE_python-ply:python-light
+  VARIANT:=python
+endef
+
+define Package/python3-ply
+$(call Package/python-ply/Default)
+  TITLE:=python3-ply
+  DEPENDS:=+PACKAGE_python3-ply:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-ply/description
+PLY is a 100% Python implementation of the common parsing tools lex
+and yacc.
+endef
+
+define Package/python3-ply/description
+$(call Package/python-ply/description)
+.
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-ply))
+$(eval $(call BuildPackage,python-ply))
+$(eval $(call BuildPackage,python-ply-src))
+
+$(eval $(call Py3Package,python3-ply))
+$(eval $(call BuildPackage,python3-ply))
+$(eval $(call BuildPackage,python3-ply-src))
diff --git a/lang/python/python-psycopg2/Makefile b/lang/python/python-psycopg2/Makefile
new file mode 100644 (file)
index 0000000..4feaf39
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# 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:=python-psycopg2
+PKG_VERSION:=2.6.2
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dmitry Trefilov <the-alien@live.ru>
+PKG_LICENSE:=LGPL-3.0+
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE:=psycopg2-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://initd.org/psycopg/tarballs/PSYCOPG-2-6/
+PKG_HASH:=70490e12ed9c5c818ecd85d185d363335cc8a8cbf7212e3c185431c79ff8c05c
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/psycopg2-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=python/host
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/python-psycopg2
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=PostgreSQL database adapter for Python
+  URL:=http://www.initd.org/
+  DEPENDS:=+python +libpq +python-egenix-mx-base
+endef
+
+define Package/python-psycopg2/description
+ Psycopg is the most popular PostgreSQL adapter for the Python programming language
+endef
+
+define Build/Compile
+       # The PATH var is required so that psycopg2's setup.py script finds pg_config
+       $(call Build/Compile/PyMod,., \
+               install --prefix=/usr --root=$(PKG_INSTALL_DIR), \
+               PATH=$(STAGING_DIR)/usr/bin:$(PATH))
+endef
+
+define Package/python-psycopg2/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call PyPackage,python-psycopg2))
+$(eval $(call BuildPackage,python-psycopg2))
diff --git a/lang/python/python-pyasn1-modules/Makefile b/lang/python/python-pyasn1-modules/Makefile
new file mode 100644 (file)
index 0000000..7ad1e1f
--- /dev/null
@@ -0,0 +1,72 @@
+#
+# Copyright (C) 2015-2018 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:=python-pyasn1-modules
+PKG_VERSION:=0.2.1
+PKG_RELEASE:=2
+
+PKG_SOURCE:=pyasn1-modules-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/ab/76/36ab0e099e6bd27ed95b70c2c86c326d3affa59b9b535c63a2f892ac9f45
+PKG_HASH:=af00ea8f2022b6287dc375b2c70f31ab5af83989fc6fe9eacd4976ce26cd7ccc
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE.txt
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-pyasn1-modules-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-pyasn1-modules/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://sourceforge.net/projects/pyasn1/
+endef
+
+define Package/python-pyasn1-modules
+$(call Package/python-pyasn1-modules/Default)
+  TITLE:=python-pyasn1-modules
+  VARIANT:=python
+  DEPENDS:= \
+      +PACKAGE_python-pyasn1-modules:python-light \
+      +PACKAGE_python-pyasn1-modules:python-pyasn1
+endef
+
+define Package/python3-pyasn1-modules
+$(call Package/python-pyasn1-modules/Default)
+  TITLE:=python3-pyasn1-modules
+  VARIANT:=python3
+  DEPENDS:= \
+      +PACKAGE_python3-pyasn1-modules:python3-light \
+      +PACKAGE_python3-pyasn1-modules:python3-pyasn1
+endef
+
+define Package/python-pyasn1-modules/description
+This is a small but growing collection of ASN.1 data structures
+expressed in Python terms using pyasn1 data model.
+endef
+
+define Package/python3-pyasn1-modules/description
+$(call Package/python-pyasn1-modules/description)
+.
+(Variant for Python3).
+endef
+
+$(eval $(call PyPackage,python-pyasn1-modules))
+$(eval $(call BuildPackage,python-pyasn1-modules))
+$(eval $(call BuildPackage,python-pyasn1-modules-src))
+
+$(eval $(call Py3Package,python3-pyasn1-modules))
+$(eval $(call BuildPackage,python3-pyasn1-modules))
+$(eval $(call BuildPackage,python3-pyasn1-modules-src))
diff --git a/lang/python/python-pyasn1/Makefile b/lang/python/python-pyasn1/Makefile
new file mode 100644 (file)
index 0000000..6129f3d
--- /dev/null
@@ -0,0 +1,70 @@
+#
+# Copyright (C) 2015-2018 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:=python-pyasn1
+PKG_VERSION:=0.4.2
+PKG_RELEASE:=2
+
+PKG_SOURCE:=pyasn1-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/eb/3d/b7d0fdf4a882e26674c68c20f40682491377c4db1439870f5b6f862f76ed
+PKG_HASH:=d258b0a71994f7770599835249cece1caef3c70def868c4915e6e5ca49b67d15
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE.txt
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-pyasn1-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-pyasn1/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=http://pyasn1.sourceforge.net/
+endef
+
+define Package/python-pyasn1
+$(call Package/python-pyasn1/Default)
+  TITLE:=python-pyasn1
+  DEPENDS:=+PACKAGE_python-pyasn1:python-light
+  VARIANT:=python
+endef
+
+define Package/python3-pyasn1
+$(call Package/python-pyasn1/Default)
+  TITLE:=python3-pyasn1
+  DEPENDS:=+PACKAGE_python3-pyasn1:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-pyasn1/description
+This is an implementation of ASN.1 types and codecs in Python programming
+language. It has been first written to support particular protocol (SNMP)
+but then generalized to be suitable for a wide range of protocols
+based on ASN.1 specification.
+endef
+
+define Package/python3-pyasn1/description
+$(call Package/python-pyasn1/description)
+.
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-pyasn1))
+$(eval $(call BuildPackage,python-pyasn1))
+$(eval $(call BuildPackage,python-pyasn1-src))
+
+$(eval $(call Py3Package,python3-pyasn1))
+$(eval $(call BuildPackage,python3-pyasn1))
+$(eval $(call BuildPackage,python3-pyasn1-src))
diff --git a/lang/python/python-pycparser/Makefile b/lang/python/python-pycparser/Makefile
new file mode 100644 (file)
index 0000000..9a8b65c
--- /dev/null
@@ -0,0 +1,72 @@
+#
+# Copyright (C) 2015-2018 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:=python-pycparser
+PKG_VERSION:=2.18
+PKG_RELEASE:=2
+
+PKG_SOURCE:=pycparser-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/8c/2d/aad7f16146f4197a11f8e91fb81df177adcc2073d36a17b1491fd09df6ed
+PKG_HASH:=99a8ca03e29851d96616ad0404b4aad7d9ee16f25c9f9708a11faf2810f7b226
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-pycparser-$(PKG_VERSION)
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+HOST_PYTHON_PACKAGE_BUILD_DEPENDS:="ply==3.10"
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="ply==3.10"
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-pycparser/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/eliben/pycparser
+endef
+
+define Package/python-pycparser
+$(call Package/python-pycparser/Default)
+  TITLE:=python-pycparser
+  DEPENDS:=+PACKAGE_python-pycparser:python-light +PACKAGE_python-pycparser:python-ply
+  VARIANT:=python
+endef
+
+define Package/python3-pycparser
+$(call Package/python-pycparser/Default)
+  TITLE:=python3-pycparser
+  DEPENDS:=+PACKAGE_python3-pycparser:python3-light +PACKAGE_python3-pycparser:python3-ply
+  VARIANT:=python3
+endef
+
+define Package/python-pycparser/description
+pycparser is a parser for the C language, written in pure Python. It is a
+module designed to be easily integrated into applications that need to parse
+C source code.
+endef
+
+define Package/python3-pycparser/description
+$(call Package/python-pycparser/description)
+.
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-pycparser))
+$(eval $(call BuildPackage,python-pycparser))
+$(eval $(call BuildPackage,python-pycparser-src))
+
+$(eval $(call Py3Package,python3-pycparser))
+$(eval $(call BuildPackage,python3-pycparser))
+$(eval $(call BuildPackage,python3-pycparser-src))
diff --git a/lang/python/python-pycparser/patches/001-use-external-ply.patch b/lang/python/python-pycparser/patches/001-use-external-ply.patch
new file mode 100644 (file)
index 0000000..96b1d03
--- /dev/null
@@ -0,0 +1,41 @@
+diff --git a/pycparser/c_lexer.py b/pycparser/c_lexer.py
+index cbb9d26..cbd7742 100644
+--- a/pycparser/c_lexer.py
++++ b/pycparser/c_lexer.py
+@@ -9,8 +9,8 @@
+ import re
+ import sys
+-from .ply import lex
+-from .ply.lex import TOKEN
++from ply import lex
++from ply.lex import TOKEN
+ class CLexer(object):
+diff --git a/pycparser/c_parser.py b/pycparser/c_parser.py
+index f4f7453..5c0ca88 100644
+--- a/pycparser/c_parser.py
++++ b/pycparser/c_parser.py
+@@ -8,7 +8,7 @@
+ #------------------------------------------------------------------------------
+ import re
+-from .ply import yacc
++from ply import yacc
+ from . import c_ast
+ from .c_lexer import CLexer
+diff --git a/setup.py b/setup.py
+index fdccbb3..036a10b 100644
+--- a/setup.py
++++ b/setup.py
+@@ -49,7 +49,7 @@ setup(
+     classifiers = [
+         'Programming Language :: Python :: 2',
+         'Programming Language :: Python :: 3',],
+-    packages=['pycparser', 'pycparser.ply'],
++    packages=['pycparser'],
+     package_data={'pycparser': ['*.cfg']},
+     cmdclass={'install': install, 'sdist': sdist},
+ )
diff --git a/lang/python/python-pyopenssl/Makefile b/lang/python/python-pyopenssl/Makefile
new file mode 100644 (file)
index 0000000..3f8fc90
--- /dev/null
@@ -0,0 +1,73 @@
+#
+# Copyright (C) 2015-2018 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:=python-pyopenssl
+PKG_VERSION:=17.5.0
+PKG_RELEASE:=2
+
+PKG_SOURCE:=pyOpenSSL-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/3b/15/a5d90ab1a41075e8f0fae334f13452549528f82142b3b9d0c9d86ab7178c
+PKG_HASH:=2c10cfba46a52c0b0950118981d61e72c1e5b1aac451ca1bc77de1a679456773
+
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-pyopenssl-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-pyopenssl/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/pyca/pyopenssl
+endef
+
+define Package/python-pyopenssl
+$(call Package/python-pyopenssl/Default)
+  TITLE:=python-pyopenssl
+  VARIANT:=python
+  DEPENDS:= \
+      +PACKAGE_python-pyopenssl:python-light \
+      +PACKAGE_python-pyopenssl:python-cryptography \
+      +PACKAGE_python-pyopenssl:python-six
+endef
+
+define Package/python3-pyopenssl
+$(call Package/python-pyopenssl/Default)
+  TITLE:=python3-pyopenssl
+  VARIANT:=python3
+  DEPENDS:= \
+      +PACKAGE_python3-pyopenssl:python3-light \
+      +PACKAGE_python3-pyopenssl:python3-cryptography \
+      +PACKAGE_python3-pyopenssl:python3-six
+endef
+
+define Package/python-pyopenssl/description
+Python wrapper module around the OpenSSL library
+endef
+
+define Package/python3-pyopenssl/description
+$(call Package/python-pyopenssl/description)
+.
+(Variant for Python3).
+endef
+
+$(eval $(call PyPackage,python-pyopenssl))
+$(eval $(call BuildPackage,python-pyopenssl))
+$(eval $(call BuildPackage,python-pyopenssl-src))
+
+$(eval $(call Py3Package,python3-pyopenssl))
+$(eval $(call BuildPackage,python3-pyopenssl))
+$(eval $(call BuildPackage,python3-pyopenssl-src))
diff --git a/lang/python/python-pyptlib/Makefile b/lang/python/python-pyptlib/Makefile
new file mode 100644 (file)
index 0000000..b003976
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2015, 2017-2018 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:=python-pyptlib
+PKG_VERSION:=0.0.6
+PKG_RELEASE:=2
+
+PKG_SOURCE:=pyptlib-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pyptlib
+PKG_HASH:=b98472e3d9e8f4689d3913ca8f89afa5e6cc5383dcd8686987606166f9dac607
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-pyptlib-$(PKG_VERSION)
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-pyptlib/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://pypi.python.org/pypi/pyptlib
+endef
+
+define Package/python-pyptlib
+$(call Package/python-pyptlib/Default)
+  TITLE:=python-pyptlib
+  DEPENDS:=+PACKAGE_python-pyptlib:python-light
+  VARIANT:=python
+endef
+
+define Package/python-pyptlib/description
+A python implementation of the Pluggable Transports for Circumvention
+specification for Tor
+endef
+
+$(eval $(call PyPackage,python-pyptlib))
+$(eval $(call BuildPackage,python-pyptlib))
+$(eval $(call BuildPackage,python-pyptlib-src))
diff --git a/lang/python/python-pyserial/Makefile b/lang/python/python-pyserial/Makefile
new file mode 100644 (file)
index 0000000..2342b02
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# 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:=python-pyserial
+PKG_VERSION:=3.1.1
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Micke Prag <micke.prag@telldus.se>
+PKG_LICENSE:=Python-2.0
+
+PKG_SOURCE:=pyserial-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/3c/d8/a9fa247ca60b02b3bebbd61766b4f321393b57b13c53b18f6f62cf172c08/
+PKG_HASH:=d657051249ce3cbd0446bcfb2be07a435e1029da4d63f53ed9b4cdde7373364c
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/pyserial-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=python
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/python-pyserial
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=python-pyserial
+  URL:=http://pyserial.sourceforge.net
+  DEPENDS:=+python-light
+endef
+
+define Package/python-pyserial/description
+       serial port python bindings
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root="$(PKG_INSTALL_DIR)")
+endef
+
+define Package/python-pyserial/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-pyserial))
diff --git a/lang/python/python-service-identity/Makefile b/lang/python/python-service-identity/Makefile
new file mode 100644 (file)
index 0000000..552ba3d
--- /dev/null
@@ -0,0 +1,78 @@
+#
+# Copyright (C) 2016-2018 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:=python-service-identity
+PKG_VERSION:=17.0.0
+PKG_RELEASE:=2
+
+PKG_SOURCE:=service_identity-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/de/2a/cab6e30be82c8fcd2339ef618036720eda954cf05daef514e386661c9221
+PKG_HASH:=4001fbb3da19e0df22c47a06d29681a398473af4aa9d745eca525b3b2c2302ab
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-service-identity-$(PKG_VERSION)
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-service-identity/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/pyca/service_identity
+endef
+
+define Package/python-service-identity
+$(call Package/python-service-identity/Default)
+  TITLE:=python-service-identity
+  DEPENDS:= \
+      +PACKAGE_python-service-identity:python-light \
+      +PACKAGE_python-service-identity:python-attrs \
+      +PACKAGE_python-service-identity:python-pyasn1 \
+      +PACKAGE_python-service-identity:python-pyasn1-modules \
+      +PACKAGE_python-service-identity:python-pyopenssl
+  VARIANT:=python
+endef
+
+define Package/python3-service-identity
+$(call Package/python-service-identity/Default)
+  TITLE:=python3-service-identity
+  DEPENDS:= \
+      +PACKAGE_python3-service-identity:python3-light \
+      +PACKAGE_python3-service-identity:python3-attrs \
+      +PACKAGE_python3-service-identity:python3-pyasn1 \
+      +PACKAGE_python3-service-identity:python3-pyasn1-modules \
+      +PACKAGE_python3-service-identity:python3-pyopenssl
+  VARIANT:=python3
+endef
+
+define Package/python-service-identity/description
+service_identity aspires to give you all the tools you need for
+verifying whether a certificate is valid for the intended purposes.
+endef
+
+define Package/python3-service-identity/description
+$(call Package/python-service-identity/description)
+.
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-service-identity))
+$(eval $(call BuildPackage,python-service-identity))
+$(eval $(call BuildPackage,python-service-identity-src))
+
+$(eval $(call Py3Package,python3-service-identity))
+$(eval $(call BuildPackage,python3-service-identity))
+$(eval $(call BuildPackage,python3-service-identity-src))
diff --git a/lang/python/python-six/Makefile b/lang/python/python-six/Makefile
new file mode 100644 (file)
index 0000000..2e7e4fa
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2015, 2017-2018 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:=python-six
+PKG_VERSION:=1.11.0
+PKG_RELEASE:=2
+
+PKG_SOURCE:=six-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/16/d8/bc6316cf98419719bd59c91742194c111b6f2e85abac88e496adefaf7afe
+PKG_HASH:=70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9
+
+HOST_BUILD_DEPENDS:=python/host
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-six-$(PKG_VERSION)
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+HOST_UNPACK:=$(HOST_TAR) -C $(HOST_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-six/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://pypi.python.org/pypi/six
+endef
+
+define Package/python-six
+$(call Package/python-six/Default)
+  TITLE:=python-six
+  DEPENDS:=+PACKAGE_python-six:python-light
+  VARIANT:=python
+endef
+
+define Package/python3-six
+$(call Package/python-six/Default)
+  TITLE:=python3-six
+  DEPENDS:=+PACKAGE_python3-six:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-six/description
+Six is a Python 2 and 3 compatibility library.  It provides utility functions
+for smoothing over the differences between the Python versions with the goal of
+writing Python code that is compatible on both Python versions.  See the
+documentation for more information on what is provided.
+endef
+
+define Package/python3-six/description
+$(call Package/python-six/description)
+.
+(Variant for Python3)
+endef
+
+define Host/Compile
+       $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
+endef
+
+Host/Install:=
+
+$(eval $(call HostBuild))
+
+$(eval $(call PyPackage,python-six))
+$(eval $(call BuildPackage,python-six))
+$(eval $(call BuildPackage,python-six-src))
+
+$(eval $(call Py3Package,python3-six))
+$(eval $(call BuildPackage,python3-six))
+$(eval $(call BuildPackage,python3-six-src))
diff --git a/lang/python/python-txsocksx/Makefile b/lang/python/python-txsocksx/Makefile
new file mode 100644 (file)
index 0000000..e8a7605
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# Copyright (C) 2015, 2017-2018 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:=python-txsocksx
+PKG_VERSION:=1.15.0.2
+PKG_RELEASE:=2
+
+PKG_SOURCE:=txsocksx-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/t/txsocksx
+PKG_HASH:=4f79b5225ce29709bfcee45e6f726e65b70fd6f1399d1898e54303dbd6f8065f
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-txsocksx-$(PKG_VERSION)
+
+PKG_LICENSE:=ISC
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-txsocksx/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/habnabit/txsocksx
+endef
+
+define Package/python-txsocksx
+$(call Package/python-txsocksx/Default)
+  TITLE:=python-txsocksx
+  DEPENDS:= \
+      +PACKAGE_python-txsocksx:python-light \
+      +PACKAGE_python-txsocksx:python-parsley \
+      +PACKAGE_python-txsocksx:twisted
+  VARIANT:=python
+endef
+
+define Package/python-txsocksx/description
+txsocksx is SOCKS4/4a and SOCKS5 client endpoints for Twisted 10.1 or
+greater.
+endef
+
+define PyBuild/Compile
+       $(call Build/Compile/PyMod,, \
+               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)", \
+               PKG_VERSION="$(PKG_VERSION)" \
+       )
+endef
+
+$(eval $(call PyPackage,python-txsocksx))
+$(eval $(call BuildPackage,python-txsocksx))
+$(eval $(call BuildPackage,python-txsocksx-src))
diff --git a/lang/python/python-txsocksx/patches/001-omit-tests.patch b/lang/python/python-txsocksx/patches/001-omit-tests.patch
new file mode 100644 (file)
index 0000000..2bed548
--- /dev/null
@@ -0,0 +1,9 @@
+--- a/setup.py
++++ b/setup.py
+@@ -35,5 +35,5 @@ setup(
+         'version_module_paths': ['txsocksx/_version.py'],
+     },
+     install_requires=install_requires,
+-    packages=['txsocksx', 'txsocksx.test'],
++    packages=['txsocksx'],
+ )
diff --git a/lang/python/python-txsocksx/patches/002-do-not-use-vcversioner.patch b/lang/python/python-txsocksx/patches/002-do-not-use-vcversioner.patch
new file mode 100644 (file)
index 0000000..c7c2cbb
--- /dev/null
@@ -0,0 +1,27 @@
+--- a/setup.py
++++ b/setup.py
+@@ -1,6 +1,8 @@
+ # Copyright (c) Aaron Gallagher <_@habnab.it>
+ # See COPYING for details.
++import os
++
+ from setuptools import setup
+@@ -30,10 +32,11 @@ setup(
+     ],
+     license='ISC',
+-    setup_requires=['vcversioner>=1'],
+-    vcversioner={
+-        'version_module_paths': ['txsocksx/_version.py'],
+-    },
++    #setup_requires=['vcversioner>=1'],
++    #vcversioner={
++    #    'version_module_paths': ['txsocksx/_version.py'],
++    #},
++    version=os.environ.get('PKG_VERSION'),
+     install_requires=install_requires,
+     packages=['txsocksx'],
+ )
diff --git a/lang/python/python-urllib3/Makefile b/lang/python/python-urllib3/Makefile
new file mode 100644 (file)
index 0000000..e014fca
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-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:=python-urllib3
+PKG_VERSION:=1.22
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=urllib3-$(PKG_VERSION).tar.gz
+PKG_BUILD_DIR:=$(BUILD_DIR)/urllib3-$(PKG_VERSION)/
+PKG_SOURCE_URL:=https://pypi.python.org/packages/ee/11/7c59620aceedcc1ef65e156cc5ce5a24ef87be4107c2b74458464e437a5d/
+PKG_HASH:=cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/python-urllib3
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=HTTP library with thread-safe connection pooling, file post, and more.
+  URL:=https://urllib3.readthedocs.io/
+  DEPENDS:=+python
+endef
+
+define Package/python-urllib3/description
+  HTTP library with thread-safe connection pooling, file post, and more.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/python-urllib3/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-urllib3))
diff --git a/lang/python/python-version.mk b/lang/python/python-version.mk
new file mode 100644 (file)
index 0000000..200461d
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# 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:=14
+
+PYTHON_SETUPTOOLS_VERSION:=28.8.0
+PYTHON_PIP_VERSION:=9.0.1
+
diff --git a/lang/python/python-yaml/Makefile b/lang/python/python-yaml/Makefile
new file mode 100644 (file)
index 0000000..7846ce2
--- /dev/null
@@ -0,0 +1,66 @@
+#
+# 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:=PyYAML
+PKG_VERSION:=3.12
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pyyaml.org/download/pyyaml/
+PKG_HASH:=592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+define Package/python-yaml/Default
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  URL:=http://pyyaml.org/wiki/PyYAML
+  DEPENDS:=+libyaml
+endef
+
+define Package/python-yaml
+$(call Package/python-yaml/Default)
+  TITLE:=YAML parser and emitter for Python
+  DEPENDS+=+PACKAGE_python-yaml:python-light +PACKAGE_python-yaml:python-codecs
+  VARIANT:=python
+endef
+
+define Package/python3-yaml
+$(call Package/python-yaml/Default)
+  TITLE:=YAML parser and emitter for Python3
+  DEPENDS+=+PACKAGE_python3-yaml:python3-light
+  VARIANT:=python3
+endef
+
+define PyBuild/Compile
+       $(call Build/Compile/PyMod,,\
+               --with-libyaml install --prefix="$(PKG_INSTALL_DIR)/usr" \
+       )
+endef
+
+define Py3Build/Compile
+       $(call Build/Compile/Py3Mod,,\
+               --with-libyaml install --prefix="$(PKG_INSTALL_DIR)/usr" \
+       )
+endef
+
+$(eval $(call PyPackage,python-yaml))
+$(eval $(call BuildPackage,python-yaml))
+$(eval $(call Py3Package,python3-yaml))
+$(eval $(call BuildPackage,python3-yaml))
diff --git a/lang/python/python-zope-interface/Makefile b/lang/python/python-zope-interface/Makefile
new file mode 100644 (file)
index 0000000..42e248a
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2006-2011, 2015-2018 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:=python-zope-interface
+PKG_VERSION:=4.4.3
+PKG_RELEASE:=2
+
+PKG_SOURCE:=zope.interface-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/bd/d2/25349ed41f9dcff7b3baf87bd88a4c82396cf6e02f1f42bb68657a3132af
+PKG_HASH:=d6d26d5dfbfd60c65152938fcb82f949e8dada37c041f72916fef6621ba5c5ce
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-zope-interface-$(PKG_VERSION)
+
+PKG_LICENSE:=ZPL-2.1
+PKG_LICENSE_FILES:=LICENSE.txt
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+include ../python3-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-zope-interface/Default
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  URL:=https://github.com/zopefoundation/zope.interface
+endef
+
+define Package/python-zope-interface
+$(call Package/python-zope-interface/Default)
+  TITLE:=python-zope-interface
+  DEPENDS:=+PACKAGE_python-zope-interface:python-light
+  VARIANT:=python
+endef
+
+define Package/python3-zope-interface
+$(call Package/python-zope-interface/Default)
+  TITLE:=python3-zope-interface
+  DEPENDS:=+PACKAGE_python3-zope-interface:python3-light
+  VARIANT:=python3
+endef
+
+define Package/python-zope-interface/description
+This package provides an implementation of "object interfaces" for
+Python. Interfaces are a mechanism for labeling objects as conforming to
+a given API or contract. So, this package can be considered as
+implementation of the Design By Contract methodology support in Python.
+endef
+
+define Package/python3-zope-interface/description
+$(call Package/python-zope-interface/description)
+.
+(Variant for Python3)
+endef
+
+define PyPackage/python-zope-interface/filespec
++|$(PYTHON_PKG_DIR)
+-|$(PYTHON_PKG_DIR)/zope/interface/common/tests
+-|$(PYTHON_PKG_DIR)/zope/interface/tests
+endef
+
+define Py3Package/python3-zope-interface/filespec
++|$(PYTHON3_PKG_DIR)
+-|$(PYTHON3_PKG_DIR)/zope/interface/common/tests
+-|$(PYTHON3_PKG_DIR)/zope/interface/tests
+endef
+
+$(eval $(call PyPackage,python-zope-interface))
+$(eval $(call BuildPackage,python-zope-interface))
+$(eval $(call BuildPackage,python-zope-interface-src))
+
+$(eval $(call Py3Package,python3-zope-interface))
+$(eval $(call BuildPackage,python3-zope-interface))
+$(eval $(call BuildPackage,python3-zope-interface-src))
diff --git a/lang/python/python/Config-python-light.in b/lang/python/python/Config-python-light.in
new file mode 100644 (file)
index 0000000..c6c2041
--- /dev/null
@@ -0,0 +1,7 @@
+menu "Configuration"
+
+config PYTHON_BLUETOOTH_SUPPORT
+       bool "Enable Bluetooth support"
+       default n
+
+endmenu
diff --git a/lang/python/python/Makefile b/lang/python/python/Makefile
new file mode 100644 (file)
index 0000000..0948e35
--- /dev/null
@@ -0,0 +1,315 @@
+#
+# 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 ../python-version.mk
+
+PKG_NAME:=python
+PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
+PKG_RELEASE:=10
+
+PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
+PKG_HASH:=71ffb26e09e78650e424929b2b457b9c912ac216576e6bd9e7d204ed03296a66
+
+PKG_LICENSE:=PSF
+PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
+
+# This file provides the necsessary host build variables
+include ../python-host.mk
+
+# For PyPackage
+include ../python-package.mk
+
+PKG_FIXUP:=autoreconf
+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_CONFIG_DEPENDS:= \
+       CONFIG_PACKAGE_python-setuptools CONFIG_PACKAGE_python-pip \
+       CONFIG_PYTHON_BLUETOOTH_SUPPORT
+
+PKG_BUILD_DEPENDS:=python/host
+HOST_BUILD_DEPENDS:=bzip2/host expat/host zlib/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 +PYTHON_BLUETOOTH_SUPPORT:bluez-libs
+endef
+
+define Package/python-light/config
+  source "$(SOURCE)/Config-python-light.in"
+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
+    ifneq ($(2),)
+      $(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file)))
+      -|/usr/lib/python$(PYTHON_VERSION)/*/test
+      -|/usr/lib/python$(PYTHON_VERSION)/*/tests
+    endif
+  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)
+
+DISABLE_BLUETOOTH:= \
+    ac_cv_header_bluetooth_bluetooth_h=no \
+    ac_cv_header_bluetooth_h=no
+
+CONFIGURE_ARGS+= \
+       --sysconfdir=/etc \
+       --enable-shared \
+       --without-cxx-main \
+       --with-threads \
+       --with-system-ffi \
+       --with-ensurepip=no \
+       --without-pymalloc \
+       $(if $(CONFIG_PYTHON_BLUETOOTH_SUPPORT),,$(DISABLE_BLUETOOTH)) \
+       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
+
+ifdef CONFIG_PACKAGE_python-setuptools
+define Build/Compile/python-setuptools
+       $(STAGING_DIR_HOSTPKG)/bin/pip install \
+               --ignore-installed \
+               --root=$(PKG_BUILD_DIR)/install-setuptools --prefix=. \
+               $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-*.whl
+endef
+endif # CONFIG_PACKAGE_python-setuptools
+
+ifdef CONFIG_PACKAGE_python-pip
+define Build/Compile/python-pip
+       $(STAGING_DIR_HOSTPKG)/bin/pip install \
+               --ignore-installed \
+               --root=$(PKG_BUILD_DIR)/install-pip --prefix=. \
+               $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/pip-*.whl
+endef
+endif # CONFIG_PACKAGE_python-pip
+
+define Build/Compile
+       $(call Build/Compile/Default)
+       # Use host pip to install python-setuptools
+       $(call Build/Compile/python-setuptools)
+       $(call Build/Compile/python-pip)
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/ $(1)/usr/lib/pkgconfig
+       $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
+       $(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
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
+       $(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)
+
+ifeq ($(HOST_OS),Linux)
+HOST_LDFLAGS += \
+       -Wl,--no-as-needed -lrt
+endif
+
+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-ensurepip=install \
+       CONFIG_SITE=
+
+define Host/Compile
+       $(call Host/Compile/Default,python Parser/pgen sharedmods)
+endef
+
+define Host/Install
+       $(MAKE) -C $(HOST_BUILD_DIR) install
+       $(INSTALL_DIR) $(HOST_PYTHON_DIR)/bin/
+       $(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 BuildPackage,$(package)-src)) \
+)
+
+$(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))
+
+$(eval $(call BuildPackage,python-base-src))
+$(eval $(call BuildPackage,python-light-src))
diff --git a/lang/python/python/files/config.site b/lang/python/python/files/config.site
new file mode 100644 (file)
index 0000000..cfa56b8
--- /dev/null
@@ -0,0 +1,12 @@
+#! /bin/sh
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+ac_cv_file__dev_ptmx=yes
+ac_cv_file__dev_ptc=no
+ac_cv_buggy_getaddrinfo=no
+
diff --git a/lang/python/python/files/python-package-codecs.mk b/lang/python/python/files/python-package-codecs.mk
new file mode 100644 (file)
index 0000000..7d3c615
--- /dev/null
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-codecs
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) codecs + unicode support
+  DEPENDS:=+python-light
+endef
+
+$(eval $(call PyBasePackage,python-codecs, \
+       /usr/lib/python$(PYTHON_VERSION)/encodings \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_cn.so \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_hk.so \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_iso2022.so \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_jp.so \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_kr.so \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_tw.so \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so \
+))
diff --git a/lang/python/python/files/python-package-compiler.mk b/lang/python/python/files/python-package-compiler.mk
new file mode 100644 (file)
index 0000000..c840ce1
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-compiler
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) compiler module
+  DEPENDS:=+python-light
+endef
+
+$(eval $(call PyBasePackage,python-compiler, \
+       /usr/lib/python$(PYTHON_VERSION)/compiler \
+))
diff --git a/lang/python/python/files/python-package-ctypes.mk b/lang/python/python/files/python-package-ctypes.mk
new file mode 100644 (file)
index 0000000..5c34b7a
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-ctypes
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) ctypes module
+  DEPENDS:=+python-light
+endef
+
+$(eval $(call PyBasePackage,python-ctypes, \
+       /usr/lib/python$(PYTHON_VERSION)/ctypes \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ctypes.so \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ctypes_test.so \
+))
diff --git a/lang/python/python/files/python-package-db.mk b/lang/python/python/files/python-package-db.mk
new file mode 100644 (file)
index 0000000..a257820
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-db
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) db module
+  DEPENDS:=+python-light +libdb47
+endef
+
+$(eval $(call PyBasePackage,python-db, \
+       /usr/lib/python$(PYTHON_VERSION)/bsddb \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bsddb.so \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/dbm.so \
+))
diff --git a/lang/python/python/files/python-package-decimal.mk b/lang/python/python/files/python-package-decimal.mk
new file mode 100644 (file)
index 0000000..578486d
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-decimal
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) decimal module
+  DEPENDS:=+python-light
+endef
+
+$(eval $(call PyBasePackage,python-decimal, \
+       /usr/lib/python$(PYTHON_VERSION)/decimal.py \
+))
diff --git a/lang/python/python/files/python-package-dev.mk b/lang/python/python/files/python-package-dev.mk
new file mode 100644 (file)
index 0000000..7c9e219
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-dev
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) development files
+  DEPENDS:=+python +python-lib2to3
+endef
+
+define PyPackage/python-dev/install
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/python*config $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config/libpython$(PYTHON_VERSION).a $(1)/usr/lib
+endef
+
+$(eval $(call PyBasePackage,python-dev, \
+       /usr/lib/python$(PYTHON_VERSION)/config \
+       /usr/include/python$(PYTHON_VERSION) \
+       /usr/lib/pkgconfig \
+       , \
+       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
+))
+
diff --git a/lang/python/python/files/python-package-distutils.mk b/lang/python/python/files/python-package-distutils.mk
new file mode 100644 (file)
index 0000000..a139ddb
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-distutils
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) distutils
+  DEPENDS:=+python-light
+endef
+
+$(eval $(call PyBasePackage,python-distutils, \
+       /usr/lib/python$(PYTHON_VERSION)/distutils \
+))
diff --git a/lang/python/python/files/python-package-email.mk b/lang/python/python/files/python-package-email.mk
new file mode 100644 (file)
index 0000000..8c15583
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-email
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) email module
+  DEPENDS:=+python-light
+endef
+
+$(eval $(call PyBasePackage,python-email, \
+       /usr/lib/python$(PYTHON_VERSION)/email \
+))
diff --git a/lang/python/python/files/python-package-gdbm.mk b/lang/python/python/files/python-package-gdbm.mk
new file mode 100644 (file)
index 0000000..23c7a29
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-gdbm
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) gdbm module
+  DEPENDS:=+python-light +libgdbm
+endef
+
+$(eval $(call PyBasePackage,python-gdbm, \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/gdbm.so \
+))
diff --git a/lang/python/python/files/python-package-lib2to3.mk b/lang/python/python/files/python-package-lib2to3.mk
new file mode 100644 (file)
index 0000000..925cfe2
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-lib2to3
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) lib2to3 module
+  DEPENDS:=+python
+endef
+
+$(eval $(call PyBasePackage,python-lib2to3, \
+       /usr/lib/python$(PYTHON_VERSION)/lib2to3 \
+       , \
+       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
+))
diff --git a/lang/python/python/files/python-package-logging.mk b/lang/python/python/files/python-package-logging.mk
new file mode 100644 (file)
index 0000000..efef531
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-logging
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) logging module
+  DEPENDS:=+python-light
+endef
+
+$(eval $(call PyBasePackage,python-logging, \
+       /usr/lib/python$(PYTHON_VERSION)/logging \
+))
diff --git a/lang/python/python/files/python-package-multiprocessing.mk b/lang/python/python/files/python-package-multiprocessing.mk
new file mode 100644 (file)
index 0000000..ccb55f5
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-multiprocessing
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) multiprocessing
+  DEPENDS:=+python-light
+endef
+
+$(eval $(call PyBasePackage,python-multiprocessing, \
+       /usr/lib/python$(PYTHON_VERSION)/multiprocessing \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_multiprocessing.so \
+))
diff --git a/lang/python/python/files/python-package-ncurses.mk b/lang/python/python/files/python-package-ncurses.mk
new file mode 100644 (file)
index 0000000..d952b50
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-ncurses
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) ncurses module
+  DEPENDS:=+python-light +libncurses
+endef
+
+$(eval $(call PyBasePackage,python-ncurses, \
+       /usr/lib/python$(PYTHON_VERSION)/curses \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses.so \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses_panel.so \
+))
diff --git a/lang/python/python/files/python-package-openssl.mk b/lang/python/python/files/python-package-openssl.mk
new file mode 100644 (file)
index 0000000..dbf6fe1
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-openssl
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) SSL module
+  DEPENDS:=+python-light +libopenssl
+endef
+
+$(eval $(call PyBasePackage,python-openssl, \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_hashlib.so \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ssl.so \
+))
diff --git a/lang/python/python/files/python-package-pip.mk b/lang/python/python/files/python-package-pip.mk
new file mode 100644 (file)
index 0000000..a3934cc
--- /dev/null
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-pip
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) pip module
+  VERSION:=$(PYTHON_PIP_VERSION)
+  DEPENDS:=+python +python-setuptools +python-pip-conf
+endef
+
+define PyPackage/python-pip/install
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages
+       # Adjust shebang to proper python location on target
+       sed "1s@.*@#\!/usr/bin/python$(PYTHON_VERSION)@" -i $(PKG_BUILD_DIR)/install-pip/bin/*
+       $(CP) $(PKG_BUILD_DIR)/install-pip/bin/* $(1)/usr/bin
+       $(CP) \
+               $(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON_VERSION)/site-packages/pip \
+               $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/
+endef
+
+$(eval $(call PyBasePackage,python-pip, \
+       , \
+       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
+))
diff --git a/lang/python/python/files/python-package-pydoc.mk b/lang/python/python/files/python-package-pydoc.mk
new file mode 100644 (file)
index 0000000..1e3c385
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-pydoc
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) pydoc module
+  DEPENDS:=+python-light
+endef
+
+$(eval $(call PyBasePackage,python-pydoc, \
+       /usr/lib/python$(PYTHON_VERSION)/doctest.py \
+       /usr/lib/python$(PYTHON_VERSION)/pydoc.py \
+       /usr/lib/python$(PYTHON_VERSION)/pydoc_data \
+))
diff --git a/lang/python/python/files/python-package-setuptools.mk b/lang/python/python/files/python-package-setuptools.mk
new file mode 100644 (file)
index 0000000..c35fad8
--- /dev/null
@@ -0,0 +1,30 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-setuptools
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) setuptools module
+  VERSION:=$(PYTHON_SETUPTOOLS_VERSION)
+  DEPENDS:=+python
+endef
+
+define PyPackage/python-setuptools/install
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages
+       # Adjust shebang to proper python location on target
+       sed "1s@.*@#\!/usr/bin/python$(PYTHON_VERSION)@" -i $(PKG_BUILD_DIR)/install-setuptools/bin/*
+       $(CP) $(PKG_BUILD_DIR)/install-setuptools/bin/* $(1)/usr/bin
+       $(CP) \
+               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON_VERSION)/site-packages/pkg_resources \
+               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON_VERSION)/site-packages/setuptools \
+               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON_VERSION)/site-packages/easy_install.py \
+               $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages
+endef
+
+$(eval $(call PyBasePackage,python-setuptools, \
+       , \
+       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
+))
diff --git a/lang/python/python/files/python-package-sqlite3.mk b/lang/python/python/files/python-package-sqlite3.mk
new file mode 100644 (file)
index 0000000..22a6fbc
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-sqlite3
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) sqlite3 module
+  DEPENDS:=+python-light +libsqlite3
+endef
+
+$(eval $(call PyBasePackage,python-sqlite3, \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sqlite3.so \
+       /usr/lib/python$(PYTHON_VERSION)/sqlite3 \
+))
diff --git a/lang/python/python/files/python-package-unittest.mk b/lang/python/python/files/python-package-unittest.mk
new file mode 100644 (file)
index 0000000..3c93f51
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-unittest
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) unittest module
+  DEPENDS:=+python-light
+endef
+
+$(eval $(call PyBasePackage,python-unittest, \
+       /usr/lib/python$(PYTHON_VERSION)/unittest \
+))
diff --git a/lang/python/python/files/python-package-xml.mk b/lang/python/python/files/python-package-xml.mk
new file mode 100644 (file)
index 0000000..28e734e
--- /dev/null
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python-xml
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) xml libs
+  DEPENDS:=+python-light +libexpat
+endef
+
+$(eval $(call PyBasePackage,python-xml, \
+       /usr/lib/python$(PYTHON_VERSION)/xml \
+       /usr/lib/python$(PYTHON_VERSION)/xmllib.py \
+       /usr/lib/python$(PYTHON_VERSION)/xmlrpclib.py \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_elementtree.so \
+       /usr/lib/python$(PYTHON_VERSION)/lib-dynload/pyexpat.so \
+))
diff --git a/lang/python/python/patches/001-enable-zlib.patch b/lang/python/python/patches/001-enable-zlib.patch
new file mode 100644 (file)
index 0000000..e85b53c
--- /dev/null
@@ -0,0 +1,20 @@
+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(-)
+
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -464,7 +464,7 @@ GLHACK=-Dclear=__GLclear
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -lz
+ # Interface to the Expat XML parser
+ #
diff --git a/lang/python/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch b/lang/python/python/patches/002-do-not-add-include-dirs-when-cross-compiling.patch
new file mode 100644 (file)
index 0000000..0099abf
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/setup.py
++++ b/setup.py
+@@ -497,7 +497,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
diff --git a/lang/python/python/patches/003-do-not-compile-tests-at-build.patch b/lang/python/python/patches/003-do-not-compile-tests-at-build.patch
new file mode 100644 (file)
index 0000000..5bd07b1
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1110,6 +1110,7 @@ libinstall:      build_all $(srcdir)/Lib/$(PL
+               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 ; \
+@@ -1136,6 +1137,7 @@ libinstall:      build_all $(srcdir)/Lib/$(PL
+               $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+       -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+               $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
++endif
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):
diff --git a/lang/python/python/patches/004-do-not-write-bytes-codes.patch b/lang/python/python/patches/004-do-not-write-bytes-codes.patch
new file mode 100644 (file)
index 0000000..66c0077
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/Python/pythonrun.c
++++ b/Python/pythonrun.c
+@@ -79,7 +79,7 @@ int Py_InteractiveFlag; /* Needed by Py_
+ int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */
+ int Py_NoSiteFlag; /* Suppress 'import site' */
+ int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
+-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 */
+@@ -185,7 +185,7 @@ Py_InitializeEx(int install_sigs)
+     if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
+         Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
+     if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
+-        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')
diff --git a/lang/python/python/patches/005-fix-bluetooth-support.patch b/lang/python/python/patches/005-fix-bluetooth-support.patch
new file mode 100644 (file)
index 0000000..ccc2936
--- /dev/null
@@ -0,0 +1,61 @@
+diff --git a/configure b/configure
+index 4c0435e..0068a9d 100755
+--- a/configure
++++ b/configure
+@@ -7045,7 +7045,7 @@ sys/param.h sys/poll.h sys/random.h sys/select.h sys/socket.h sys/statvfs.h sys/
+ sys/termio.h sys/time.h \
+ sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
+ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
+-bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h
++linux/tipc.h spawn.h util.h alloca.h
+ do :
+   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+@@ -7267,6 +7267,24 @@ fi
+ fi
++# bluetooth/bluetooth.h has been known to not compile with -std=c99.
++# http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
++SAVE_CFLAGS=$CFLAGS
++CFLAGS="-std=c99 $CFLAGS"
++for ac_header in bluetooth/bluetooth.h
++do :
++  ac_fn_c_check_header_mongrel "$LINENO" "bluetooth/bluetooth.h" "ac_cv_header_bluetooth_bluetooth_h" "$ac_includes_default"
++if test "x$ac_cv_header_bluetooth_bluetooth_h" = xyes; then :
++  cat >>confdefs.h <<_ACEOF
++#define HAVE_BLUETOOTH_BLUETOOTH_H 1
++_ACEOF
++
++fi
++
++done
++
++CFLAGS=$SAVE_CFLAGS
++
+ # On Linux, netlink.h requires asm/types.h
+ for ac_header in linux/netlink.h
+ do :
+diff --git a/configure.ac b/configure.ac
+index 780f275..dceca1c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1702,10 +1702,17 @@ sys/param.h sys/poll.h sys/random.h sys/select.h sys/socket.h sys/statvfs.h sys/
+ sys/termio.h sys/time.h \
+ sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
+ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
+-bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h)
++linux/tipc.h spawn.h util.h alloca.h)
+ AC_HEADER_DIRENT
+ AC_HEADER_MAJOR
++# bluetooth/bluetooth.h has been known to not compile with -std=c99.
++# http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
++SAVE_CFLAGS=$CFLAGS
++CFLAGS="-std=c99 $CFLAGS"
++AC_CHECK_HEADERS(bluetooth/bluetooth.h)
++CFLAGS=$SAVE_CFLAGS
++
+ # On Linux, netlink.h requires asm/types.h
+ AC_CHECK_HEADERS(linux/netlink.h,,,[
+ #ifdef HAVE_ASM_TYPES_H
diff --git a/lang/python/python/patches/006-remove-multi-arch-and-local-paths.patch b/lang/python/python/patches/006-remove-multi-arch-and-local-paths.patch
new file mode 100644 (file)
index 0000000..5d886df
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/setup.py
++++ b/setup.py
+@@ -454,13 +454,8 @@ class PyBuildExt(build_ext):
+             os.unlink(tmpfile)
+     def detect_modules(self):
+-        # Ensure that /usr/local is always used
+-        if not cross_compiling:
+-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+-            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+         if cross_compiling:
+             self.add_gcc_paths()
+-        self.add_multiarch_paths()
+         # Add paths specified in the environment variables LDFLAGS and
+         # CPPFLAGS for header and library files.
diff --git a/lang/python/python/patches/007-distutils-do-not-adjust-path.patch b/lang/python/python/patches/007-distutils-do-not-adjust-path.patch
new file mode 100644 (file)
index 0000000..49fe926
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/Lib/distutils/command/build_scripts.py
++++ b/Lib/distutils/command/build_scripts.py
+@@ -89,6 +89,7 @@ class build_scripts (Command):
+                     adjust = 1
+                     post_interp = match.group(1) or ''
++            adjust = 0
+             if adjust:
+                 log.info("copying and adjusting %s -> %s", script,
+                          self.build_dir)
diff --git a/lang/python/python/patches/008-distutils-use-python-sysroot.patch b/lang/python/python/patches/008-distutils-use-python-sysroot.patch
new file mode 100644 (file)
index 0000000..4aeb7ff
--- /dev/null
@@ -0,0 +1,50 @@
+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>
+
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -19,8 +19,13 @@ import sys
+ 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,
+--- a/Lib/distutils/command/build_ext.py
++++ b/Lib/distutils/command/build_ext.py
+@@ -240,7 +240,10 @@ class build_ext (Command):
+         if (sysconfig.get_config_var('Py_ENABLE_SHARED')):
+             if not sysconfig.python_build:
+                 # building third party extensions
+-                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('.')
diff --git a/lang/python/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch b/lang/python/python/patches/009-do-not-use-dblib_dir-when-cross-compiling.patch
new file mode 100644 (file)
index 0000000..ffc80a4
--- /dev/null
@@ -0,0 +1,32 @@
+--- a/setup.py
++++ b/setup.py
+@@ -1083,6 +1083,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
+@@ -1097,7 +1098,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:
+@@ -1308,10 +1309,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),
diff --git a/lang/python/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch b/lang/python/python/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
new file mode 100644 (file)
index 0000000..c319fd5
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/setup.py
++++ b/setup.py
+@@ -463,8 +463,9 @@ class PyBuildExt(build_ext):
+         # directly since an inconsistently reproducible issue comes up where
+         # the environment variable is not set even though the value were passed
+         # into configure and stored in the Makefile (issue found on OS X 10.3).
++        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)
diff --git a/lang/python/python/patches/011-remove-setupterm-definition.patch b/lang/python/python/patches/011-remove-setupterm-definition.patch
new file mode 100644 (file)
index 0000000..6cad204
--- /dev/null
@@ -0,0 +1,10 @@
+--- 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
diff --git a/lang/python/python/patches/012-add-support-source-date-epoch-pyc.patch b/lang/python/python/patches/012-add-support-source-date-epoch-pyc.patch
new file mode 100644 (file)
index 0000000..6f33bed
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/Lib/py_compile.py
++++ b/Lib/py_compile.py
+@@ -108,6 +108,7 @@ def compile(file, cfile=None, dfile=None, doraise=False):
+             timestamp = long(os.fstat(f.fileno()).st_mtime)
+         except AttributeError:
+             timestamp = long(os.stat(file).st_mtime)
++        timestamp = long(os.getenv('SOURCE_DATE_EPOCH', timestamp))
+         codestring = f.read()
+     try:
+         codeobject = __builtin__.compile(codestring, dfile or file,'exec')
diff --git a/lang/python/python/patches/013-getbuildinfo-date-time-source-date-epoch.patch b/lang/python/python/patches/013-getbuildinfo-date-time-source-date-epoch.patch
new file mode 100644 (file)
index 0000000..de7605d
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -625,6 +625,16 @@ regen-all: regen-opcode-targets regen-gr
+ ############################################################################
+ # Special rules for object files
++DATE_FMT = %b %d %Y
++TIME_FMT = %H:%M:%S
++ifdef SOURCE_DATE_EPOCH
++      BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)"  2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u "+$(DATE_FMT)")
++      BUILD_TIME ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(TIME_FMT)"  2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(TIME_FMT)" 2>/dev/null || date -u "+$(TIME_FMT)")
++else
++      BUILD_DATE ?= $(shell date "+$(DATE_FMT)")
++      BUILD_TIME ?= $(shell date "+$(TIME_FMT)")
++endif
++
+ Modules/getbuildinfo.o: $(PARSER_OBJS) \
+               $(OBJECT_OBJS) \
+               $(PYTHON_OBJS) \
+@@ -633,6 +643,8 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
+               $(MODOBJS) \
+               $(srcdir)/Modules/getbuildinfo.c
+       $(CC) -c $(PY_CFLAGS) \
++            -DDATE="\"$(BUILD_DATE)\"" \
++            -DTIME="\"$(BUILD_TIME)\"" \
+             -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \
+             -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \
+             -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \
diff --git a/lang/python/python3-bottle/Makefile b/lang/python/python3-bottle/Makefile
new file mode 100644 (file)
index 0000000..f35913c
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# 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:=python3-bottle
+PKG_VERSION:=0.12.12
+PKG_RELEASE:=1
+
+PKG_LICENSE:=MIT
+PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
+
+PKG_SOURCE:=bottle-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/f7/dd/8ceaa148eeed5371a83fa1fb5a54b01dfc95000799c649924ece23f9f0e1/
+PKG_HASH:=3d4b6b0e22f67b421c273105b30d9a21fd147eaf0c1576172378ee034fbf5313
+PKG_BUILD_DIR:=$(BUILD_DIR)/bottle-$(PKG_VERSION)
+PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+
+define Package/python3-bottle
+       SECTION:=lang
+       CATEGORY:=Languages
+       SUBMENU:=Python
+       TITLE:=Bottle is a fast, simple and lightweight WSGI micro web-framework for Python
+       URL:=http://bottlepy.org
+       DEPENDS:=+python3
+endef
+
+define Package/python3-bottle/description
+ Bottle is a fast, simple and lightweight WSGI micro web-framework for Python.
+ It is distributed as a single file module and has no dependencies other than the
+ Python Standard Library.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/python3-bottle/install
+       $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
+       $(CP) $(PKG_BUILD_DIR)/bottle.py $(1)$(PYTHON3_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python3-bottle))
diff --git a/lang/python/python3-host.mk b/lang/python/python3-host.mk
new file mode 100644 (file)
index 0000000..2a418d5
--- /dev/null
@@ -0,0 +1,97 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# Note: include this after `include $(TOPDIR)/rules.mk in your package Makefile
+#       if `python3-package.mk` is included, this will already be included
+
+ifneq ($(__python3_host_mk_inc),1)
+__python3_host_mk_inc=1
+
+# For PYTHON3_VERSION
+python3_mk_path:=$(dir $(lastword $(MAKEFILE_LIST)))
+include $(python3_mk_path)python3-version.mk
+
+HOST_PYTHON3_DIR:=$(STAGING_DIR_HOSTPKG)
+HOST_PYTHON3_INC_DIR:=$(HOST_PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
+HOST_PYTHON3_LIB_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
+
+HOST_PYTHON3_PKG_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)/site-packages
+
+HOST_PYTHON3_BIN:=$(HOST_PYTHON3_DIR)/bin/python$(PYTHON3_VERSION)
+
+HOST_PYTHON3PATH:=$(HOST_PYTHON3_LIB_DIR):$(HOST_PYTHON3_PKG_DIR)
+
+define HostPython3
+       if [ "$(strip $(3))" == "HOST" ]; then \
+               export PYTHONPATH="$(HOST_PYTHON3PATH)"; \
+               export PYTHONDONTWRITEBYTECODE=0; \
+       else \
+               export PYTHONPATH="$(PYTHON3PATH)"; \
+               export PYTHONDONTWRITEBYTECODE=1; \
+               export _python_sysroot="$(STAGING_DIR)"; \
+               export _python_prefix="/usr"; \
+               export _python_exec_prefix="/usr"; \
+       fi; \
+       export PYTHONOPTIMIZE=""; \
+       $(1) \
+       $(HOST_PYTHON3_BIN) $(2);
+endef
+
+define host_python3_settings
+       ARCH="$(HOST_ARCH)" \
+       CC="$(HOSTCC)" \
+       CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
+       CXX="$(HOSTCXX)" \
+       LD="$(HOSTCC)" \
+       LDSHARED="$(HOSTCC) -shared" \
+       CFLAGS="$(HOST_CFLAGS)" \
+       CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \
+       LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
+       _PYTHON_HOST_PLATFORM=linux2
+endef
+
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
+# $(3) => additional variables
+define Build/Compile/HostPy3RunHost
+       $(call HostPython3, \
+               $(if $(1),$(1);) \
+               $(call host_python3_settings) \
+               $(3) \
+               , \
+               $(2) \
+               , \
+               HOST \
+       )
+endef
+
+# Note: I shamelessly copied this from Yousong's logic (from python-packages);
+HOST_PYTHON3_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON3_VERSION)
+define host_python3_pip_install
+       $(call host_python3_settings) \
+       $(HOST_PYTHON3_PIP) install \
+               --root=$(1) \
+               --prefix=$(2) \
+               --ignore-installed \
+               $(3)
+endef
+
+define host_python3_pip_install_host
+$(call host_python3_pip_install,$(STAGING_DIR_HOSTPKG),"",$(1))
+endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/HostPy3Mod
+       $(call Build/Compile/HostPy3RunHost, \
+               cd $(HOST_BUILD_DIR)/$(strip $(1)), \
+               ./setup.py $(2), \
+               $(3))
+endef
+
+endif # __python3_host_mk_inc
diff --git a/lang/python/python3-package.mk b/lang/python/python3-package.mk
new file mode 100644 (file)
index 0000000..9e473b5
--- /dev/null
@@ -0,0 +1,138 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# Note: include this after `include $(TOPDIR)/rules.mk in your package Makefile
+python3_mk_path:=$(dir $(lastword $(MAKEFILE_LIST)))
+include $(python3_mk_path)python3-host.mk
+
+PYTHON3_DIR:=$(STAGING_DIR)/usr
+PYTHON3_BIN_DIR:=$(PYTHON3_DIR)/bin
+PYTHON3_INC_DIR:=$(PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
+PYTHON3_LIB_DIR:=$(PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
+
+PYTHON3_PKG_DIR:=/usr/lib/python$(PYTHON3_VERSION)/site-packages
+
+PYTHON3:=python$(PYTHON3_VERSION)
+
+PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
+
+# These configure args are needed in detection of path to Python header files
+# using autotools.
+CONFIGURE_ARGS += \
+       _python_sysroot="$(STAGING_DIR)" \
+       _python_prefix="/usr" \
+       _python_exec_prefix="/usr"
+
+PKG_USE_MIPS16:=0
+# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
+# flags are inherited from the Python base package (via sysconfig module)
+ifdef CONFIG_USE_MIPS16
+  TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
+endif
+
+define Py3Package
+
+  define Package/$(1)-src
+    $(call Package/$(1))
+    DEPENDS:=
+    TITLE+= (sources)
+  endef
+
+  define Package/$(1)-src/description
+    $(call Package/$(1)/description).
+    (Contains the Python3 sources for this package).
+  endef
+
+  # Add default PyPackage filespec none defined
+  ifndef Py3Package/$(1)/filespec
+    define Py3Package/$(1)/filespec
+      +|$(PYTHON3_PKG_DIR)
+    endef
+  endif
+
+  ifndef Py3Package/$(1)/install
+    define Py3Package/$(1)/install
+               if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
+                       $(INSTALL_DIR) $$(1)/usr/bin ; \
+                       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/ ; \
+               fi
+    endef
+  endif
+
+  ifndef Package/$(1)/install
+  $(call shexport,Py3Package/$(1)/filespec)
+
+  define Package/$(1)/install
+       $(call Py3Package/$(1)/install,$$(1))
+       find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
+       $(SHELL) $(python3_mk_path)python-package-install.sh "3" \
+               "$(PKG_INSTALL_DIR)" "$$(1)" \
+               "$(HOST_PYTHON3_BIN)" "$$(2)" \
+               "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)"
+  endef
+
+  define Package/$(1)-src/install
+       $$(call Package/$(1)/install,$$(1),sources)
+  endef
+  endif # Package/$(1)/install
+endef
+
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
+# $(3) => additional variables
+define Build/Compile/HostPy3RunTarget
+       $(call HostPython3, \
+               $(if $(1),$(1);) \
+               CC="$(TARGET_CC)" \
+               CCSHARED="$(TARGET_CC) $(FPIC)" \
+               CXX="$(TARGET_CXX)" \
+               LD="$(TARGET_CC)" \
+               LDSHARED="$(TARGET_CC) -shared" \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \
+               LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \
+               _PYTHON_HOST_PLATFORM=linux2 \
+               __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON3)" \
+               $(3) \
+               , \
+               $(2) \
+       )
+endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/Py3Mod
+       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
+       $(call Build/Compile/HostPy3RunTarget, \
+               cd $(PKG_BUILD_DIR)/$(strip $(1)), \
+               ./setup.py $(2), \
+               $(3))
+       find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
+endef
+
+PYTHON3_PKG_SETUP_ARGS:=--single-version-externally-managed
+PYTHON3_PKG_SETUP_VARS:=
+
+define Py3Build/Compile/Default
+       $(foreach pkg,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS),
+               $(call host_python3_pip_install_host,$(pkg))
+       )
+       $(call Build/Compile/Py3Mod,, \
+               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
+               $(PYTHON3_PKG_SETUP_ARGS), \
+               $(PYTHON3_PKG_SETUP_VARS) \
+       )
+endef
+
+Py3Build/Compile=$(Py3Build/Compile/Default)
+
+ifeq ($(BUILD_VARIANT),python3)
+define Build/Compile
+       $(call Py3Build/Compile)
+endef
+endif # python3
diff --git a/lang/python/python3-version.mk b/lang/python/python3-version.mk
new file mode 100644 (file)
index 0000000..e42eeb8
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# Note: keep in sync with setuptools & pip
+PYTHON3_VERSION_MAJOR:=3
+PYTHON3_VERSION_MINOR:=6
+PYTHON3_VERSION_MICRO:=4
+
+PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
+
+PYTHON3_SETUPTOOLS_VERSION:=28.8.0
+PYTHON3_PIP_VERSION:=9.0.1
+
diff --git a/lang/python/python3/Config-python3-light.in b/lang/python/python3/Config-python3-light.in
new file mode 100644 (file)
index 0000000..eb22262
--- /dev/null
@@ -0,0 +1,7 @@
+menu "Configuration"
+
+config PYTHON3_BLUETOOTH_SUPPORT
+       bool "Enable Bluetooth support"
+       default n
+
+endmenu
diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile
new file mode 100644 (file)
index 0000000..85952c2
--- /dev/null
@@ -0,0 +1,312 @@
+#
+# 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
+
+# The file included below defines PYTHON_VERSION
+include ../python3-version.mk
+
+PYTHON_VERSION:=$(PYTHON3_VERSION)
+PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
+
+PKG_NAME:=python3
+PKG_RELEASE:=5
+PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
+
+PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
+PKG_HASH:=159b932bf56aeaa76fd66e7420522d8c8853d486b8567c459b84fe2ed13bcaba
+
+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 ../python3-host.mk
+
+# For Py3Package
+include ../python3-package.mk
+
+PKG_FIXUP:=autoreconf
+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_CONFIG_DEPENDS:= \
+       CONFIG_PACKAGE_python3-setuptools CONFIG_PACKAGE_python3-pip \
+       CONFIG_PYTHON3_BLUETOOTH_SUPPORT
+
+PKG_BUILD_DEPENDS:=python3/host
+HOST_BUILD_DEPENDS:=bzip2/host expat/host libffi/host zlib/host
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/python3/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/python3/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/python3-base
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON_VERSION) interpreter
+  DEPENDS:=+libpthread +zlib
+endef
+
+define Package/python3-base/description
+  This package contains only the interpreter and the bare minimum
+  for the interpreter to start.
+endef
+
+define Package/python3-light
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON_VERSION) light installation
+  DEPENDS:=+python3-base +libffi +libbz2 +PYTHON3_BLUETOOTH_SUPPORT:bluez-libs
+endef
+
+define Package/python3-light/config
+  source "$(SOURCE)/Config-python3-light.in"
+endef
+
+define Package/python3-light/description
+  This package is essentially the python3-base package plus
+  a few of the rarely used (and big) libraries stripped out
+  into separate packages.
+endef
+
+PYTHON3_LIB_FILES_DEL:=
+PYTHON3_PACKAGES:=
+PYTHON3_SO_SUFFIX:=cpython-$(PYTHON3_VERSION_MAJOR)$(PYTHON3_VERSION_MINOR).so
+PYTHON3_PACKAGES_DEPENDS:=
+define Py3BasePackage
+  PYTHON3_PACKAGES+=$(1)
+  ifeq ($(3),)
+    PYTHON3_PACKAGES_DEPENDS+=$(1)
+  endif
+  PYTHON3_LIB_FILES_DEL+=$(2)
+  define Py3Package/$(1)/filespec
+    ifneq ($(2),)
+      $(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file)))
+      -|/usr/lib/python$(PYTHON_VERSION)/*/test
+      -|/usr/lib/python$(PYTHON_VERSION)/*/tests
+    endif
+  endef
+endef
+
+include ./files/python3-package-*.mk
+
+define Package/python3
+$(call Package/python3/Default)
+  DEPENDS:=+python3-light $(foreach package,$(PYTHON3_PACKAGES_DEPENDS),+$(package))
+endef
+
+define Package/python3/description
+  This package contains the (almost) full Python install.
+  It's python3-light + all other packages.
+endef
+
+MAKE_FLAGS+=\
+       CROSS_COMPILE=yes \
+       LD="$(TARGET_CC)" \
+       PGEN=pgen3
+
+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_PYTHON3_BIN)
+
+DISABLE_BLUETOOTH:= \
+       ac_cv_header_bluetooth_bluetooth_h=no \
+       ac_cv_header_bluetooth_h=no
+
+CONFIGURE_ARGS+= \
+       --sysconfdir=/etc \
+       --enable-shared \
+       --without-cxx-main \
+       --with-threads \
+       --with-system-ffi \
+       --with-ensurepip=no \
+       --without-pymalloc \
+       $(if $(CONFIG_PYTHON3_BLUETOOTH_SUPPORT),,$(DISABLE_BLUETOOTH)) \
+       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
+
+ifdef CONFIG_PACKAGE_python3-setuptools
+define Build/Compile/python3-setuptools
+       $(STAGING_DIR_HOSTPKG)/bin/pip3 install \
+               --ignore-installed \
+               --root=$(PKG_BUILD_DIR)/install-setuptools --prefix=. \
+               $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/setuptools-*.whl
+endef
+endif # CONFIG_PACKAGE_python3-setuptools
+
+ifdef CONFIG_PACKAGE_python3-pip
+define Build/Compile/python3-pip
+       $(STAGING_DIR_HOSTPKG)/bin/pip3 install \
+               --ignore-installed \
+               --root=$(PKG_BUILD_DIR)/install-pip --prefix=. \
+               $(PKG_BUILD_DIR)/Lib/ensurepip/_bundled/pip-*.whl
+endef
+endif # CONFIG_PACKAGE_python3-pip
+
+define Build/Compile
+       $(call Build/Compile/Default)
+       # Use host pip to install python-setuptools
+       $(call Build/Compile/python3-setuptools)
+       $(call Build/Compile/python3-pip)
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
+               $(1)/usr/include/
+       $(CP) \
+               $(HOST_PYTHON3_LIB_DIR) \
+               $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \
+               $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
+               $(1)/usr/lib/python$(PYTHON_VERSION)/
+endef
+
+PYTHON3_BASE_LIB_FILES:= \
+       /usr/lib/python$(PYTHON_VERSION)/encodings \
+       /usr/lib/python$(PYTHON_VERSION)/_collections_abc.py \
+       /usr/lib/python$(PYTHON_VERSION)/_sitebuiltins.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)/codecs.py \
+       /usr/lib/python$(PYTHON_VERSION)/genericpath.py \
+       /usr/lib/python$(PYTHON_VERSION)/io.py \
+       /usr/lib/python$(PYTHON_VERSION)/os.py \
+       /usr/lib/python$(PYTHON_VERSION)/posixpath.py \
+       /usr/lib/python$(PYTHON_VERSION)/site.py \
+       /usr/lib/python$(PYTHON_VERSION)/sysconfig.py \
+       /usr/lib/python$(PYTHON_VERSION)/stat.py
+
+PYTHON3_LIB_FILES_DEL+=$(PYTHON3_BASE_LIB_FILES)
+
+define Py3Package/python3-base/filespec
++|/usr/bin/python$(PYTHON_VERSION)
+$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_BASE_LIB_FILES),+|$(lib_file)))
+endef
+
+define Py3Package/python3-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)/tkinter
+-|/usr/lib/python$(PYTHON_VERSION)/turtledemo
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_test*.so
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline*.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)/_osx_support.py
+$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_LIB_FILES_DEL),-|$(lib_file)))
+endef
+
+define Py3Package/python3-base/install
+       # Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python
+       $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/lib-dynload/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python3
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
+endef
+
+define Py3Package/python3/filespec
+-|$(PYTHON3_PKG_DIR)
+endef
+
+HOST_LDFLAGS += \
+       $$$$(pkg-config --static --libs libcrypto libssl)
+
+ifeq ($(HOST_OS),Linux)
+HOST_LDFLAGS += \
+       -Wl,--no-as-needed -lrt
+endif
+
+HOST_CONFIGURE_ARGS+= \
+       --without-cxx-main \
+       --without-pymalloc \
+       --with-threads \
+       --prefix=$(HOST_PYTHON3_DIR) \
+       --exec-prefix=$(HOST_PYTHON3_DIR) \
+       --with-system-expat=$(STAGING_DIR_HOSTPKG) \
+       --with-ensurepip=install \
+       CONFIG_SITE=
+
+define Host/Compile
+       +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) python Parser/pgen
+       +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) sharedmods
+endef
+
+define Host/Install
+       $(MAKE) -C $(HOST_BUILD_DIR) install
+       $(INSTALL_DIR) $(HOST_PYTHON3_DIR)/bin/
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_PYTHON3_DIR)/bin/pgen3
+endef
+
+$(eval $(call HostBuild))
+
+$(foreach package, $(PYTHON3_PACKAGES),  \
+       $(eval $(call Py3Package,$(package))) \
+       $(eval $(call BuildPackage,$(package))) \
+       $(eval $(call BuildPackage,$(package)-src)) \
+)
+
+$(eval $(call Py3Package,python3-base))
+$(eval $(call Py3Package,python3-light))
+$(eval $(call Py3Package,python3))
+
+$(eval $(call BuildPackage,python3-base))
+$(eval $(call BuildPackage,python3-light))
+$(eval $(call BuildPackage,python3))
+
+$(eval $(call BuildPackage,python3-base-src))
+$(eval $(call BuildPackage,python3-light-src))
diff --git a/lang/python/python3/files/config.site b/lang/python/python3/files/config.site
new file mode 100644 (file)
index 0000000..cfa56b8
--- /dev/null
@@ -0,0 +1,12 @@
+#! /bin/sh
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+ac_cv_file__dev_ptmx=yes
+ac_cv_file__dev_ptc=no
+ac_cv_buggy_getaddrinfo=no
+
diff --git a/lang/python/python3/files/python3-package-asyncio.mk b/lang/python/python3/files/python3-package-asyncio.mk
new file mode 100644 (file)
index 0000000..52eccae
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-asyncio
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) asyncio module
+  DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-asyncio, \
+       /usr/lib/python$(PYTHON3_VERSION)/asyncio \
+))
diff --git a/lang/python/python3/files/python3-package-cgi.mk b/lang/python/python3/files/python3-package-cgi.mk
new file mode 100644 (file)
index 0000000..165800a
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2006-2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-cgi
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) cgi module
+  DEPENDS:=+python3-light +python3-email
+endef
+
+define Package/python3-cgitb
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) cgitb module
+  DEPENDS:=+python3-light +python3-cgi +python3-pydoc
+endef
+
+
+$(eval $(call Py3BasePackage,python3-cgi, \
+       /usr/lib/python$(PYTHON3_VERSION)/cgi.py \
+))
+
+$(eval $(call Py3BasePackage,python3-cgitb, \
+       /usr/lib/python$(PYTHON3_VERSION)/cgitb.py \
+))
diff --git a/lang/python/python3/files/python3-package-codecs.mk b/lang/python/python3/files/python3-package-codecs.mk
new file mode 100644 (file)
index 0000000..f768b02
--- /dev/null
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-codecs
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) codecs + unicode support
+  DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-codecs, \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_cn.$(PYTHON3_SO_SUFFIX) \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_hk.$(PYTHON3_SO_SUFFIX) \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_iso2022.$(PYTHON3_SO_SUFFIX) \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_jp.$(PYTHON3_SO_SUFFIX) \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_kr.$(PYTHON3_SO_SUFFIX) \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_tw.$(PYTHON3_SO_SUFFIX) \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/unicodedata.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-ctypes.mk b/lang/python/python3/files/python3-package-ctypes.mk
new file mode 100644 (file)
index 0000000..f38e011
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-ctypes
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) ctypes module
+  DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-ctypes, \
+       /usr/lib/python$(PYTHON3_VERSION)/ctypes \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ctypes.$(PYTHON3_SO_SUFFIX) \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ctypes_test.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-dbm.mk b/lang/python/python3/files/python3-package-dbm.mk
new file mode 100644 (file)
index 0000000..4099402
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-dbm
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) dbm module
+  DEPENDS:=+python3-light +libdb47
+endef
+
+$(eval $(call Py3BasePackage,python3-dbm, \
+       /usr/lib/python$(PYTHON3_VERSION)/dbm \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_dbm.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-decimal.mk b/lang/python/python3/files/python3-package-decimal.mk
new file mode 100644 (file)
index 0000000..391b6f6
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-decimal
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) decimal module
+  DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-decimal, \
+       /usr/lib/python$(PYTHON3_VERSION)/decimal.py \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_decimal.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-dev.mk b/lang/python/python3/files/python3-package-dev.mk
new file mode 100644 (file)
index 0000000..642bb0b
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-dev
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) development files
+  DEPENDS:=+python3 +python3-lib2to3
+endef
+
+define Py3Package/python3-dev/install
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/python$(PYTHON3_VERSION)-config $(1)/usr/bin
+       $(LN) python$(PYTHON3_VERSION)-config $(1)/usr/bin/python3-config
+       $(LN) python$(PYTHON_VERSION)/config-$(PYTHON_VERSION)/libpython$(PYTHON3_VERSION).a $(1)/usr/lib/
+endef
+
+$(eval $(call Py3BasePackage,python3-dev, \
+    /usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
+    /usr/include/python$(PYTHON_VERSION) \
+    /usr/lib/pkgconfig \
+       , \
+       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
+))
diff --git a/lang/python/python3/files/python3-package-distutils.mk b/lang/python/python3/files/python3-package-distutils.mk
new file mode 100644 (file)
index 0000000..b1f1fb5
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-distutils
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) distutils module
+  DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-distutils, \
+       /usr/lib/python$(PYTHON3_VERSION)/distutils \
+))
diff --git a/lang/python/python3/files/python3-package-email.mk b/lang/python/python3/files/python3-package-email.mk
new file mode 100644 (file)
index 0000000..6cf4407
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-email
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) email module
+  DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-email, \
+       /usr/lib/python$(PYTHON3_VERSION)/email \
+))
diff --git a/lang/python/python3/files/python3-package-gdbm.mk b/lang/python/python3/files/python3-package-gdbm.mk
new file mode 100644 (file)
index 0000000..7f98bad
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-gdbm
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) gdbm module
+  DEPENDS:=+python3-light +libgdbm
+endef
+
+$(eval $(call Py3BasePackage,python3-gdbm, \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_gdbm.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-lib2to3.mk b/lang/python/python3/files/python3-package-lib2to3.mk
new file mode 100644 (file)
index 0000000..ed712b6
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-lib2to3
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) lib2to3 module
+  DEPENDS:=+python3
+endef
+
+$(eval $(call Py3BasePackage,python3-lib2to3, \
+       /usr/lib/python$(PYTHON3_VERSION)/lib2to3 \
+       , \
+       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
+))
diff --git a/lang/python/python3/files/python3-package-logging.mk b/lang/python/python3/files/python3-package-logging.mk
new file mode 100644 (file)
index 0000000..fa3ec0e
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-logging
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) logging module
+  DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-logging, \
+       /usr/lib/python$(PYTHON3_VERSION)/logging \
+))
diff --git a/lang/python/python3/files/python3-package-lzma.mk b/lang/python/python3/files/python3-package-lzma.mk
new file mode 100644 (file)
index 0000000..57b38ec
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-lzma
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) lzma module
+  DEPENDS:=+python3-light +liblzma
+endef
+
+$(eval $(call Py3BasePackage,python3-lzma, \
+       /usr/lib/python$(PYTHON3_VERSION)/lzma.py \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_lzma.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-multiprocessing.mk b/lang/python/python3/files/python3-package-multiprocessing.mk
new file mode 100644 (file)
index 0000000..c797601
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-multiprocessing
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) multiprocessing
+  DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-multiprocessing, \
+       /usr/lib/python$(PYTHON3_VERSION)/multiprocessing \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_multiprocessing.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-ncurses.mk b/lang/python/python3/files/python3-package-ncurses.mk
new file mode 100644 (file)
index 0000000..45649ac
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-ncurses
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) ncurses module
+  DEPENDS:=+python3-light +libncurses
+endef
+
+$(eval $(call Py3BasePackage,python3-ncurses, \
+       /usr/lib/python$(PYTHON3_VERSION)/curses \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_curses.$(PYTHON3_SO_SUFFIX) \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_curses_panel.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-openssl.mk b/lang/python/python3/files/python3-package-openssl.mk
new file mode 100644 (file)
index 0000000..6971993
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-openssl
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) SSL module
+  DEPENDS:=+python3-light +libopenssl
+endef
+
+$(eval $(call Py3BasePackage,python3-openssl, \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_hashlib.$(PYTHON3_SO_SUFFIX) \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ssl.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/files/python3-package-pip.mk b/lang/python/python3/files/python3-package-pip.mk
new file mode 100644 (file)
index 0000000..ff9b5ac
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-pip
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) pip module
+  VERSION:=$(PYTHON3_PIP_VERSION)
+  DEPENDS:=+python3 +python3-setuptools +python-pip-conf
+endef
+
+define Package/python3-pip/install
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
+       # Adjust shebang to proper python location on target
+       sed "1s@.*@#\!/usr/bin/python$(PYTHON3_VERSION)@" -i $(PKG_BUILD_DIR)/install-pip/bin/*
+       $(CP) $(PKG_BUILD_DIR)/install-pip/bin/pip3* $(1)/usr/bin
+       $(CP) \
+               $(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON3_VERSION)/site-packages/pip \
+               $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/
+       find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -name __pycache__ | xargs rm -rf
+endef
+
+$(eval $(call Py3BasePackage,python3-pip, \
+       , \
+       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
+))
diff --git a/lang/python/python3/files/python3-package-pydoc.mk b/lang/python/python3/files/python3-package-pydoc.mk
new file mode 100644 (file)
index 0000000..9ab1a5b
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-pydoc
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) pydoc module
+  DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-pydoc, \
+       /usr/lib/python$(PYTHON3_VERSION)/doctest.py \
+       /usr/lib/python$(PYTHON3_VERSION)/pydoc.py \
+       /usr/lib/python$(PYTHON3_VERSION)/pydoc_data \
+))
diff --git a/lang/python/python3/files/python3-package-setuptools.mk b/lang/python/python3/files/python3-package-setuptools.mk
new file mode 100644 (file)
index 0000000..684d3e6
--- /dev/null
@@ -0,0 +1,32 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-setuptools
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) setuptools module
+  VERSION:=$(PYTHON3_SETUPTOOLS_VERSION)
+  DEPENDS:=+python3
+endef
+
+define Py3Package/python3-setuptools/install
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
+       # Adjust shebang to proper python location on target
+       sed "1s@.*@#\!/usr/bin/python$(PYTHON3_VERSION)@" -i $(PKG_BUILD_DIR)/install-setuptools/bin/*
+       $(CP) $(PKG_BUILD_DIR)/install-setuptools/bin/easy_install-* $(1)/usr/bin
+       $(LN) easy_install-$(PYTHON3_VERSION) $(1)/usr/bin/easy_install-3
+       $(CP) \
+               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages/pkg_resources \
+               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages/setuptools \
+               $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON3_VERSION)/site-packages/easy_install.py \
+               $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
+       find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -name __pycache__ | xargs rm -rf
+endef
+
+$(eval $(call Py3BasePackage,python3-setuptools, \
+       , \
+       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
+))
diff --git a/lang/python/python3/files/python3-package-sqlite3.mk b/lang/python/python3/files/python3-package-sqlite3.mk
new file mode 100644 (file)
index 0000000..665bff2
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-sqlite3
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) sqlite3 module
+  DEPENDS:=+python3-light +libsqlite3
+endef
+
+$(eval $(call Py3BasePackage,python3-sqlite3, \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_sqlite3.$(PYTHON3_SO_SUFFIX) \
+       /usr/lib/python$(PYTHON3_VERSION)/sqlite3 \
+))
diff --git a/lang/python/python3/files/python3-package-unittest.mk b/lang/python/python3/files/python3-package-unittest.mk
new file mode 100644 (file)
index 0000000..d9df86f
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-unittest
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) unittest module
+  DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-unittest, \
+       /usr/lib/python$(PYTHON3_VERSION)/unittest \
+))
diff --git a/lang/python/python3/files/python3-package-xml.mk b/lang/python/python3/files/python3-package-xml.mk
new file mode 100644 (file)
index 0000000..4893fa9
--- /dev/null
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/python3-xml
+$(call Package/python3/Default)
+  TITLE:=Python $(PYTHON3_VERSION) xml libs
+  DEPENDS:=+python3-light
+endef
+
+$(eval $(call Py3BasePackage,python3-xml, \
+       /usr/lib/python$(PYTHON3_VERSION)/xml \
+       /usr/lib/python$(PYTHON3_VERSION)/xmlrpc \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_elementtree.$(PYTHON3_SO_SUFFIX) \
+       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/pyexpat.$(PYTHON3_SO_SUFFIX) \
+))
diff --git a/lang/python/python3/patches/001-enable-zlib.patch b/lang/python/python3/patches/001-enable-zlib.patch
new file mode 100644 (file)
index 0000000..1a2a68e
--- /dev/null
@@ -0,0 +1,20 @@
+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(-)
+
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -363,7 +363,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
+ #
diff --git a/lang/python/python3/patches/003-do-not-run-distutils-tests.patch b/lang/python/python3/patches/003-do-not-run-distutils-tests.patch
new file mode 100644 (file)
index 0000000..5993859
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1341,6 +1341,7 @@ libinstall:      build_all $(srcdir)/Modules/
+       $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
+               $(DESTDIR)$(LIBDEST); \
+       $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
++ifeq (@COMPILE_ALL_TESTS@,yes)
+       if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
+               $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+                       $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+@@ -1376,6 +1377,7 @@ libinstall:      build_all $(srcdir)/Modules/
+               $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+       -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+               $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
++endif
+ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
+       # Substitution happens here, as the completely-expanded BINDIR
diff --git a/lang/python/python3/patches/004-do-not-write-bytes-codes.patch b/lang/python/python3/patches/004-do-not-write-bytes-codes.patch
new file mode 100644 (file)
index 0000000..558ee4a
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/Python/pylifecycle.c
++++ b/Python/pylifecycle.c
+@@ -88,7 +88,7 @@ int Py_BytesWarningFlag; /* Warn on str(
+ int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
+ int Py_FrozenFlag; /* Needed by getpath.c */
+ int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
+-int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.pyc) */
++int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.pyc) */
+ int Py_NoUserSiteDirectory = 0; /* for -s and site.py */
+ int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */
+ int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */
+@@ -329,7 +329,7 @@ _Py_InitializeEx_Private(int install_sig
+     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')
diff --git a/lang/python/python3/patches/006-remove-multi-arch-and-local-paths.patch b/lang/python/python3/patches/006-remove-multi-arch-and-local-paths.patch
new file mode 100644 (file)
index 0000000..cad73ed
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/setup.py
++++ b/setup.py
+@@ -512,16 +512,9 @@ class PyBuildExt(build_ext):
+             return ['m']
+     def detect_modules(self):
+-        # Ensure that /usr/local is always used, but the local build
+-        # directories (i.e. '.' and 'Include') must be first.  See issue
+-        # 10520.
+-        if not cross_compiling:
+-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+-            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+         # only change this for cross builds for 3.3, issues on Mageia
+         if cross_compiling:
+             self.add_gcc_paths()
+-        self.add_multiarch_paths()
+         # Add paths specified in the environment variables LDFLAGS and
+         # CPPFLAGS for header and library files.
diff --git a/lang/python/python3/patches/007-distutils-do-not-adjust-path.patch b/lang/python/python3/patches/007-distutils-do-not-adjust-path.patch
new file mode 100644 (file)
index 0000000..d4680ca
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/Lib/distutils/command/build_scripts.py
++++ b/Lib/distutils/command/build_scripts.py
+@@ -91,6 +91,7 @@ class build_scripts(Command):
+                     adjust = True
+                     post_interp = match.group(1) or b''
++            adjust = 0
+             if adjust:
+                 log.info("copying and adjusting %s -> %s", script,
+                          self.build_dir)
diff --git a/lang/python/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch b/lang/python/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
new file mode 100644 (file)
index 0000000..3211f73
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/setup.py
++++ b/setup.py
+@@ -522,8 +522,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)
diff --git a/lang/python/python3/patches/012-add-support-source-date-epoch-pyc.patch b/lang/python/python3/patches/012-add-support-source-date-epoch-pyc.patch
new file mode 100644 (file)
index 0000000..4c2c2f7
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/Lib/py_compile.py
++++ b/Lib/py_compile.py
+@@ -137,8 +137,9 @@ def compile(file, cfile=None, dfile=None
+     except FileExistsError:
+         pass
+     source_stats = loader.path_stats(file)
++    mtime = int(os.getenv('SOURCE_DATE_EPOCH', source_stats['mtime']))
+     bytecode = importlib._bootstrap_external._code_to_bytecode(
+-            code, source_stats['mtime'], source_stats['size'])
++            code, mtime, source_stats['size'])
+     mode = importlib._bootstrap_external._calc_mode(file)
+     importlib._bootstrap_external._write_atomic(cfile, bytecode, mode)
+     return cfile
diff --git a/lang/python/python3/patches/013-getbuildinfo-date-time-source-date-epoch.patch b/lang/python/python3/patches/013-getbuildinfo-date-time-source-date-epoch.patch
new file mode 100644 (file)
index 0000000..340e302
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -725,6 +725,16 @@ regen-all: regen-opcode regen-opcode-tar
+ ############################################################################
+ # Special rules for object files
++DATE_FMT = %b %d %Y
++TIME_FMT = %H:%M:%S
++ifdef SOURCE_DATE_EPOCH
++      BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)"  2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u "+$(DATE_FMT)")
++      BUILD_TIME ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(TIME_FMT)"  2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(TIME_FMT)" 2>/dev/null || date -u "+$(TIME_FMT)")
++else
++      BUILD_DATE ?= $(shell date "+$(DATE_FMT)")
++      BUILD_TIME ?= $(shell date "+$(TIME_FMT)")
++endif
++
+ Modules/getbuildinfo.o: $(PARSER_OBJS) \
+               $(OBJECT_OBJS) \
+               $(PYTHON_OBJS) \
+@@ -732,6 +742,8 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
+               $(MODOBJS) \
+               $(srcdir)/Modules/getbuildinfo.c
+       $(CC) -c $(PY_CORE_CFLAGS) \
++            -DDATE="\"$(BUILD_DATE)\"" \
++            -DTIME="\"$(BUILD_TIME)\"" \
+             -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \
+             -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \
+             -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \
diff --git a/lang/python/python3/patches/014-remove-platform-so-suffix.patch b/lang/python/python3/patches/014-remove-platform-so-suffix.patch
new file mode 100644 (file)
index 0000000..88fff65
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/configure
++++ b/configure
+@@ -14986,7 +14986,7 @@ $as_echo_n "checking ABIFLAGS... " >&6;
+ $as_echo "$ABIFLAGS" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
+ $as_echo_n "checking SOABI... " >&6; }
+-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
++SOABI='cpython-'`echo $VERSION | tr -d .`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5
+ $as_echo "$SOABI" >&6; }
+--- a/configure.ac
++++ b/configure.ac
+@@ -4639,7 +4639,7 @@ AC_SUBST(SOABI)
+ AC_MSG_CHECKING(ABIFLAGS)
+ AC_MSG_RESULT($ABIFLAGS)
+ AC_MSG_CHECKING(SOABI)
+-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
++SOABI='cpython-'`echo $VERSION | tr -d .`
+ AC_MSG_RESULT($SOABI)
+ AC_SUBST(EXT_SUFFIX)
diff --git a/lang/python/python3/patches/015-abort-on-failed-modules.patch b/lang/python/python3/patches/015-abort-on-failed-modules.patch
new file mode 100644 (file)
index 0000000..09a48af
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/setup.py
++++ b/setup.py
+@@ -333,6 +333,7 @@ class PyBuildExt(build_ext):
+             print("Failed to build these modules:")
+             print_three_column(failed)
+             print()
++            if cross_compiling: sys.exit(1)
+         if self.failed_on_import:
+             failed = self.failed_on_import[:]
diff --git a/lang/python/python3/patches/016-adjust-config-paths.patch b/lang/python/python3/patches/016-adjust-config-paths.patch
new file mode 100644 (file)
index 0000000..0345dd9
--- /dev/null
@@ -0,0 +1,62 @@
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -421,6 +421,7 @@ def _init_posix():
+         platform=sys.platform,
+         multiarch=getattr(sys.implementation, '_multiarch', ''),
+     ))
++    name = '_sysconfigdata'
+     _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
+     build_time_vars = _temp.build_time_vars
+     global _config_vars
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -343,6 +343,7 @@ def get_makefile_filename():
+ def _get_sysconfigdata_name():
++    return '_sysconfigdata'
+     return os.environ.get('_PYTHON_SYSCONFIGDATA_NAME',
+         '_sysconfigdata_{abi}_{platform}_{multiarch}'.format(
+         abi=sys.abiflags,
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1338,7 +1338,7 @@ libinstall:      build_all $(srcdir)/Modules/
+                       esac; \
+               done; \
+       done
+-      $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
++      $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata*.py \
+               $(DESTDIR)$(LIBDEST); \
+       $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
+ ifeq (@COMPILE_ALL_TESTS@,yes)
+@@ -1475,7 +1475,7 @@ sharedinstall: sharedmods
+               --install-scripts=$(BINDIR) \
+               --install-platlib=$(DESTSHARED) \
+               --root=$(DESTDIR)/
+-      -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
++      -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata*.py
+       -rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
+ # Here are a couple of targets for MacOSX again, to install a full
+--- a/configure
++++ b/configure
+@@ -15005,7 +15005,7 @@ LDVERSION='$(VERSION)$(ABIFLAGS)'
+ $as_echo "$LDVERSION" >&6; }
+-if test x$PLATFORM_TRIPLET = x; then
++if true ; then
+   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
+ else
+   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
+--- a/configure.ac
++++ b/configure.ac
+@@ -4656,7 +4656,7 @@ AC_MSG_RESULT($LDVERSION)
+ dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
+ AC_SUBST(PY_ENABLE_SHARED)
+-if test x$PLATFORM_TRIPLET = x; then
++if true ; then
+   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
+ else
+   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
diff --git a/lang/python/pytz/Makefile b/lang/python/pytz/Makefile
new file mode 100644 (file)
index 0000000..464ed78
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007-2018 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:=pytz
+PKG_VERSION:=2018.3
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/1b/50/4cdc62fc0753595fc16c8f722a89740f487c6e5670c644eb8983946777be/
+PKG_HASH:=410bcd1d6409026fbaa65d9ed33bf6dd8b1e94a499e32168acfc7b332e4095c0
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/pytz
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=World timezone definitions, modern and historical
+  URL:=https://sourceforge.net/projects/pytz/
+  DEPENDS:=+python
+endef
+
+define Package/pytz/description
+  World timezone definitions, modern and historical
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/pytz/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,pytz))
diff --git a/lang/python/rcssmin/Makefile b/lang/python/rcssmin/Makefile
new file mode 100644 (file)
index 0000000..804b585
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=rcssmin
+PKG_VERSION:=1.0.6
+PKG_RELEASE=1
+PKG_LICENSE:=Apache-2.0
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/ndparker/rcssmin.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=4764e3bc47ca8d44be3198892e73c51d8a0a9970
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=a52728cc5653bf3c2a2f92954c6001338442a6e589bd364c497ba615c4365211
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/rcssmin
+    SUBMENU:=Python
+    SECTION:=lang
+    CATEGORY:=Languages
+    TITLE:=Fast CSS minifier for Python
+    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+    URL:=http://opensource.perlig.de/rcssmin/
+    DEPENDS:=+python
+endef
+
+define Package/rcssmin/description
+    Fast CSS minifier for Python
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+define Package/rcssmin/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,rcssmin))
diff --git a/lang/python/simplejson/Makefile b/lang/python/simplejson/Makefile
new file mode 100644 (file)
index 0000000..aa4c662
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007-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:=simplejson
+PKG_VERSION:=3.11.1
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/08/48/c97b668d6da7d7bebe7ea1817a6f76394b0ec959cb04214ca833c34359df/
+PKG_HASH:=01a22d49ddd9a168b136f26cac87d9a335660ce07aa5c630b8e3607d6f4325e7
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+define Package/simplejson
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  TITLE:=Simple, fast, extensible JSON encoder/decoder for Python
+  URL:=http://simplejson.readthedocs.org/
+  DEPENDS:=+python
+endef
+
+define Package/simplejson/description
+  Simple, fast, extensible JSON encoder/decoder for Python
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/simplejson/install
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) \
+           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+           $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,simplejson))
diff --git a/lang/python/twisted/Makefile b/lang/python/twisted/Makefile
new file mode 100644 (file)
index 0000000..36c1a77
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# Copyright (C) 2006-2011, 2015-2018 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:=twisted
+PKG_VERSION:=17.9.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=Twisted-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/T/Twisted
+PKG_HASH:=0da1a7e35d5fcae37bc9c7978970b5feb3bc82822155b8654ec63925c05af75c
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-twisted-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=USE_MUSL:librpc
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include ../python-package.mk
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xjf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/twisted/Default
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  URL:=http://twistedmatrix.com/
+endef
+
+define Package/twisted
+$(call Package/twisted/Default)
+  TITLE:=Python networking engine
+  DEPENDS:= \
+      +PACKAGE_twisted:python-light \
+      +PACKAGE_twisted:python-automat \
+      +PACKAGE_twisted:python-constantly \
+      +PACKAGE_twisted:python-incremental \
+      +PACKAGE_twisted:python-hyperlink \
+      +PACKAGE_twisted:python-zope-interface
+  VARIANT:=python
+endef
+
+define Package/twisted/description
+Twisted is a networking engine written in Python, supporting numerous
+protocols. It contains a web server, numerous chat clients, chat servers,
+mail servers, and more.
+endef
+
+define PyPackage/twisted/filespec
++|/usr/bin
++|$(PYTHON_PKG_DIR)
+-|$(PYTHON_PKG_DIR)/twisted/conch/scripts/tkconch.py
+endef
+
+$(eval $(call PyPackage,twisted))
+$(eval $(call BuildPackage,twisted))
+$(eval $(call BuildPackage,twisted-src))
diff --git a/lang/python/twisted/patches/001-omit-tkconch-patch b/lang/python/twisted/patches/001-omit-tkconch-patch
new file mode 100644 (file)
index 0000000..05ad4c8
--- /dev/null
@@ -0,0 +1,22 @@
+diff --git a/src/twisted/python/_setup.py b/src/twisted/python/_setup.py
+index 3b5f69d4b..c69c5d13c 100644
+--- a/src/twisted/python/_setup.py
++++ b/src/twisted/python/_setup.py
+@@ -142,7 +142,6 @@ _CONSOLE_SCRIPTS = [
+     "cftp = twisted.conch.scripts.cftp:run",
+     "conch = twisted.conch.scripts.conch:run",
+     "pyhtmlizer = twisted.scripts.htmlizer:run",
+-    "tkconch = twisted.conch.scripts.tkconch:run",
+     "trial = twisted.scripts.trial:run",
+     "twist = twisted.application.twist._twist:Twist.main",
+     "twistd = twisted.scripts.twistd:run",
+diff --git a/src/twisted/python/twisted-completion.zsh b/src/twisted/python/twisted-completion.zsh
+index 4d97aa5d3..9a8d4d82e 100644
+--- a/src/twisted/python/twisted-completion.zsh
++++ b/src/twisted/python/twisted-completion.zsh
+@@ -1,4 +1,4 @@
+-#compdef twistd trial conch cftp ckeygen pyhtmlizer tkconch
++#compdef twistd trial conch cftp ckeygen pyhtmlizer
+ #
+ # This is the ZSH completion file for Twisted commands. It calls the current
+ # command-line with the special "--_shell-completion" option which is handled
diff --git a/lang/python/twisted/patches/002-omit-tests.patch b/lang/python/twisted/patches/002-omit-tests.patch
new file mode 100644 (file)
index 0000000..4649620
--- /dev/null
@@ -0,0 +1,33 @@
+diff --git a/src/twisted/python/_setup.py b/src/twisted/python/_setup.py
+index 3b5f69d4b..2dca47aa5 100644
+--- a/src/twisted/python/_setup.py
++++ b/src/twisted/python/_setup.py
+@@ -175,11 +175,6 @@ class ConditionalExtension(Extension, object):
+ # The C extensions used for Twisted.
+ _EXTENSIONS = [
+-    ConditionalExtension(
+-        "twisted.test.raiser",
+-        sources=["src/twisted/test/raiser.c"],
+-        condition=lambda _: _isCPython),
+-
+     ConditionalExtension(
+         "twisted.internet.iocpreactor.iocpsupport",
+         sources=[
+@@ -232,7 +227,7 @@ def getSetupArgs(extensions=_EXTENSIONS):
+     requirements.append("hyperlink >= 17.1.1")
+     arguments.update(dict(
+-        packages=find_packages("src"),
++        packages=find_packages("src", exclude=["*.test", "*.test.*"]),
+         use_incremental=True,
+         setup_requires=["incremental >= 16.10.1"],
+         install_requires=requirements,
+@@ -241,6 +236,7 @@ def getSetupArgs(extensions=_EXTENSIONS):
+         },
+         cmdclass=command_classes,
+         include_package_data=True,
++        exclude_package_data={'':['test/*']},
+         zip_safe=False,
+         extras_require=_EXTRAS_REQUIRE,
+         package_dir={"": "src"},
diff --git a/lang/python3-bottle/Makefile b/lang/python3-bottle/Makefile
deleted file mode 100644 (file)
index b69d851..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=python3-bottle
-PKG_VERSION:=0.12.8
-PKG_RELEASE:=1
-
-PKG_LICENSE:=MIT
-PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
-
-PKG_SOURCE:=$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/bottlepy/bottle/archive
-PKG_MD5SUM:=50a6ebada59391e8d01b2bd2ec52f05b
-PKG_BUILD_DIR:=$(BUILD_DIR)/bottle-$(PKG_VERSION)
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python3-package.mk)
-
-define Package/python3-bottle
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=Bottle is a fast, simple and lightweight WSGI micro web-framework for Python
-       URL:=http://bottlepy.org
-       DEPENDS:=+python3
-endef
-
-define Package/python3-bottle/description
- Bottle is a fast, simple and lightweight WSGI micro web-framework for Python.
- It is distributed as a single file module and has no dependencies other than the
- Python Standard Library.
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/python3-bottle/install
-       $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
-       $(CP) $(PKG_BUILD_DIR)/bottle.py $(1)$(PYTHON3_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,python3-bottle))
diff --git a/lang/python3-pip/Makefile b/lang/python3-pip/Makefile
deleted file mode 100644 (file)
index b7680b9..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# Copyright (C) 2014-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=python3-pip
-PKG_VERSION:=8.1.2
-PKG_RELEASE:=1
-
-PKG_SOURCE:=pip-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/
-PKG_MD5SUM:=87083c0b9867963b29f7aba3613e8f4a
-
-PKG_LICENSE:=MIT
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/python3-pip-$(PKG_VERSION)
-PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
-PKG_USE_MIPS16:=0
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python3-package.mk)
-
-define Package/python3-pip
-       SUBMENU:=Python
-       SECTION:=lang
-       CATEGORY:=Languages
-       TITLE:=Tool for installing Python $(PYTHON3_VERSION) packages.
-       URL:=https://pip.pypa.io
-       DEPENDS:=+python3 +python3-dev +python3-lib2to3 +python3-setuptools
-       MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
-endef
-
-define Package/python3-pip/description
-       A tool for installing and managing Python $(PYTHON3_VERSION) packages.
-endef
-
-define Build/Compile
-       $(call Build/Compile/Py3Mod,,\
-               install --root="$(PKG_INSTALL_DIR)" --prefix="/usr" \
-               --single-version-externally-managed \
-       )
-endef
-
-define Py3Package/python3-pip/filespec
-+|$(PYTHON3_PKG_DIR)
--|$(PYTHON3_PKG_DIR)/_vendor/distlib/*.exe
--|$(PYTHON3_PKG_DIR)/utils/outdated.py
-endef
-
-define Py3Package/python3-pip/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/pip$(PYTHON3_VERSION) $(1)/usr/bin
-       $(LN) pip$(PYTHON3_VERSION) $(1)/usr/bin/pip3
-endef
-
-$(eval $(call Py3Package,python3-pip))
-$(eval $(call BuildPackage,python3-pip))
diff --git a/lang/python3-pip/patches/0001-remove-self-version-checking.patch b/lang/python3-pip/patches/0001-remove-self-version-checking.patch
deleted file mode 100644 (file)
index b8c0bb6..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-From 771a1407b15538697a7f38209e40dbbf58828d33 Mon Sep 17 00:00:00 2001
-From: Florian Fieber <florian@florianfieber.de>
-Date: Tue, 9 Jun 2015 15:59:04 +0200
-Subject: [PATCH] Remove self version checking
-
-Signed-off-by: Florian Fieber <florian@florianfieber.de>
----
- pip/basecommand.py | 10 ----------
- pip/cmdoptions.py  | 10 ----------
- 2 files changed, 20 deletions(-)
-
-diff --git a/pip/basecommand.py b/pip/basecommand.py
-index 854d113..c2337a4 100644
---- a/pip/basecommand.py
-+++ b/pip/basecommand.py
-@@ -22,7 +22,6 @@ from pip.status_codes import (
- from pip.utils import get_prog, normalize_path
- from pip.utils.deprecation import RemovedInPip8Warning
- from pip.utils.logging import IndentingFormatter
--from pip.utils.outdated import pip_version_check
- __all__ = ['Command']
-@@ -237,15 +236,6 @@ class Command(object):
-             logger.critical('Exception:', exc_info=True)
-             return UNKNOWN_ERROR
--        finally:
--            # Check if we're using the latest version of pip available
--            if (not options.disable_pip_version_check and not
--                    getattr(options, "no_index", False)):
--                with self._build_session(
--                        options,
--                        retries=0,
--                        timeout=min(5, options.timeout)) as session:
--                    pip_version_check(session)
-         return SUCCESS
-diff --git a/pip/cmdoptions.py b/pip/cmdoptions.py
-index 9a0446a..4fa29d3 100644
---- a/pip/cmdoptions.py
-+++ b/pip/cmdoptions.py
-@@ -514,15 +514,6 @@ no_clean = partial(
-     default=False,
-     help="Don't clean up build directories.")
--disable_pip_version_check = partial(
--    Option,
--    "--disable-pip-version-check",
--    dest="disable_pip_version_check",
--    action="store_true",
--    default=False,
--    help="Don't periodically check PyPI to determine whether a new version "
--         "of pip is available for download. Implied with --no-index.")
--
- # Deprecated, Remove later
- always_unzip = partial(
-     Option,
-@@ -560,7 +551,6 @@ general_group = {
-         client_cert,
-         cache_dir,
-         no_cache,
--        disable_pip_version_check,
-     ]
- }
--- 
-2.6.2
-
diff --git a/lang/python3-setuptools/Makefile b/lang/python3-setuptools/Makefile
deleted file mode 100644 (file)
index b112a3b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# Copyright (C) 2014-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:=python3-setuptools
-PKG_VERSION:=27.2.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=setuptools-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/87/ba/54197971d107bc06f5f3fbdc0d728a7ae0b10cafca46acfddba65a0899d8/
-PKG_MD5SUM:=b39715612fdc0372dbfd7b3fcf5d4fe5
-
-PKG_LICENSE:=PSF
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/python3-setuptools-$(PKG_VERSION)
-PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python3-package.mk)
-
-define Package/python3-setuptools
-       SUBMENU:=Python
-       SECTION:=lang
-       CATEGORY:=Languages
-       TITLE:=Tool for installing Python $(PYTHON3_VERSION) packages.
-       URL:=https://bitbucket.org/pypa/setuptools
-       DEPENDS:=+python3 +python3-dev +python3-lib2to3
-       MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
-endef
-
-define Package/python3-setuptools/description
-       Easily download, build, install, upgrade, and uninstall Python $(PYTHON3_VERSION) packages
-endef
-
-define Build/Compile
-       $(call Build/Compile/Py3Mod,,\
-               install --root="$(PKG_INSTALL_DIR)" --prefix="/usr" \
-               --single-version-externally-managed \
-       )
-endef
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(PYTHON3_LIB_DIR)
-       $(CP) \
-               $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/* \
-               $(PYTHON3_LIB_DIR)
-endef
-
-define Py3Package/python3-setuptools/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/easy_install-$(PYTHON3_VERSION) $(1)/usr/bin/
-       $(LN) easy_install-$(PYTHON3_VERSION) $(1)/usr/bin/easy_install3
-endef
-
-$(eval $(call Py3Package,python3-setuptools))
-$(eval $(call BuildPackage,python3-setuptools))
diff --git a/lang/python3-setuptools/patches/0001-remove-windows-support.patch b/lang/python3-setuptools/patches/0001-remove-windows-support.patch
deleted file mode 100644 (file)
index 86e5bba..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/setuptools/dist.py b/setuptools/dist.py
-index b004f92..66b9d89 100644
---- a/setuptools/dist.py
-+++ b/setuptools/dist.py
-@@ -17,7 +17,6 @@ from setuptools.extern.six.moves import map
- from pkg_resources.extern import packaging
- from setuptools.depends import Require
--from setuptools import windows_support
- from setuptools.monkey import get_unpatched
- import pkg_resources
-@@ -383,7 +382,6 @@ class Distribution(_Distribution):
-         egg_cache_dir = os.path.join(os.curdir, '.eggs')
-         if not os.path.exists(egg_cache_dir):
-             os.mkdir(egg_cache_dir)
--            windows_support.hide_file(egg_cache_dir)
-             readme_txt_filename = os.path.join(egg_cache_dir, 'README.txt')
-             with open(readme_txt_filename, 'w') as f:
-                 f.write('This directory contains eggs that were downloaded '
diff --git a/lang/python3-setuptools/patches/0002-fix-pyvenv-environment-get.patch b/lang/python3-setuptools/patches/0002-fix-pyvenv-environment-get.patch
deleted file mode 100644 (file)
index d96ab08..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
-index e8b90c7..8598c44 100755
---- a/setuptools/command/easy_install.py
-+++ b/setuptools/command/easy_install.py
-@@ -1946,6 +1946,8 @@ class CommandSpec(list):
-         Construct a CommandSpec from a parameter to build_scripts, which may
-         be None.
-         """
-+        if os.environ.get('__PYVENV_LAUNCHER__'):
-+            return cls.from_environment()
-         if isinstance(param, cls):
-             return param
-         if isinstance(param, list):
diff --git a/lang/python3/Makefile b/lang/python3/Makefile
deleted file mode 100644 (file)
index 3a08a93..0000000
+++ /dev/null
@@ -1,272 +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
-
-# The file included below defines PYTHON_VERSION
-include ./files/python3-version.mk
-
-PYTHON_VERSION:=$(PYTHON3_VERSION)
-PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
-
-PKG_NAME:=python3
-PKG_RELEASE:=2
-PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
-
-PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
-PKG_MD5SUM:=82b143ebbf4514d7e05876bed7a6b1f5
-PKG_HASH:=b0c5f904f685e32d9232f7bdcbece9819a892929063b6e385414ad2dd6a23622
-
-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/python3-host.mk
-
-# For Py3Package
-include ./files/python3-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:=python3/host
-HOST_BUILD_DEPENDS:=bzip2/host expat/host libffi/host
-
-include $(INCLUDE_DIR)/host-build.mk
-include $(INCLUDE_DIR)/package.mk
-
-define Package/python3/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/python3/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/python3-base
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON_VERSION) interpreter
-  DEPENDS:=+libpthread +zlib
-endef
-
-define Package/python3-base/description
-  This package contains only the interpreter and the bare minimum
-  for the interpreter to start.
-endef
-
-define Package/python3-light
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON_VERSION) light installation
-  DEPENDS:=+python3-base +libffi +libbz2
-endef
-
-define Package/python3-light/description
-  This package is essentially the python3-base package plus
-  a few of the rarely used (and big) libraries stripped out
-  into separate packages.
-endef
-
-PYTHON3_LIB_FILES_DEL:=
-PYTHON3_PACKAGES:=
-PYTHON3_SO_SUFFIX:=cpython-$(PYTHON3_VERSION_MAJOR)$(PYTHON3_VERSION_MINOR).so
-PYTHON3_PACKAGES_DEPENDS:=
-define Py3BasePackage
-  PYTHON3_PACKAGES+=$(1)
-  ifeq ($(3),)
-    PYTHON3_PACKAGES_DEPENDS+=$(1)
-  endif
-  PYTHON3_LIB_FILES_DEL+=$(2)
-  define Py3Package/$(1)/filespec
-    $(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file)))
-  endef
-endef
-
-include ./files/python3-package-*.mk
-
-define Package/python3
-$(call Package/python3/Default)
-  DEPENDS:=+python3-light $(foreach package,$(PYTHON3_PACKAGES_DEPENDS),+$(package))
-endef
-
-define Package/python3/description
-  This package contains the (almost) full Python install.
-  It's python3-light + all other packages.
-endef
-
-MAKE_FLAGS+=\
-       CROSS_COMPILE=yes \
-       LD="$(TARGET_CC)" \
-       PGEN=pgen3
-
-ifeq ($(ARCH),i386)
-MAKE_FLAGS+=PYTHON_DECIMAL_WITH_MACHINE=ansi32
-endif
-
-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_PYTHON3_BIN)
-
-CONFIGURE_ARGS+= \
-       --sysconfdir=/etc \
-       --enable-shared \
-       --without-cxx-main \
-       --with-threads \
-       --with-system-ffi \
-       --without-pymalloc \
-       --with-ensurepip=no \
-       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/
-       $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
-       $(INSTALL_DATA) \
-               ./files/python3-package.mk \
-               ./files/python3-host.mk \
-               ./files/python3-version.mk \
-               $(STAGING_DIR)/mk/
-       $(CP) \
-               $(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
-               $(1)/usr/include/
-       $(CP) \
-               $(HOST_PYTHON3_LIB_DIR) \
-               $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \
-               $(1)/usr/lib/
-       $(CP) \
-               $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
-               $(1)/usr/lib/python$(PYTHON_VERSION)/
-endef
-
-PYTHON3_BASE_LIB_FILES:= \
-       /usr/lib/python$(PYTHON_VERSION)/encodings \
-       /usr/lib/python$(PYTHON_VERSION)/_collections_abc.py \
-       /usr/lib/python$(PYTHON_VERSION)/_sitebuiltins.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)/codecs.py \
-       /usr/lib/python$(PYTHON_VERSION)/genericpath.py \
-       /usr/lib/python$(PYTHON_VERSION)/io.py \
-       /usr/lib/python$(PYTHON_VERSION)/os.py \
-       /usr/lib/python$(PYTHON_VERSION)/posixpath.py \
-       /usr/lib/python$(PYTHON_VERSION)/site.py \
-       /usr/lib/python$(PYTHON_VERSION)/sysconfig.py \
-       /usr/lib/python$(PYTHON_VERSION)/stat.py
-
-PYTHON3_LIB_FILES_DEL+=$(PYTHON3_BASE_LIB_FILES)
-
-define Py3Package/python3-base/filespec
-+|/usr/bin/python$(PYTHON_VERSION)
-$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_BASE_LIB_FILES),+|$(lib_file)))
-endef
-
-define Py3Package/python3-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)/tkinter
--|/usr/lib/python$(PYTHON_VERSION)/turtledemo
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_test*.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline*.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)/_osx_support.py
-$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_LIB_FILES_DEL),-|$(lib_file)))
-endef
-
-define Py3Package/python3-base/install
-       # Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python
-       $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/lib-dynload/
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python3
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
-endef
-
-define Py3Package/python3/filespec
--|$(PYTHON3_PKG_DIR)
-endef
-
-HOST_CONFIGURE_ARGS+= \
-       --without-cxx-main \
-       --without-pymalloc \
-       --with-threads \
-       --prefix=$(HOST_PYTHON3_DIR) \
-       --exec-prefix=$(HOST_PYTHON3_DIR) \
-       --with-system-expat=$(STAGING_DIR_HOSTPKG) \
-       --with-system-ffi \
-       --with-ensurepip=no \
-       CONFIG_SITE= \
-       CFLAGS="$(HOST_CFLAGS)"
-
-define Host/Compile
-       +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) python Parser/pgen
-       +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) sharedmods
-endef
-
-define Host/Install
-       $(MAKE) -C $(HOST_BUILD_DIR) install
-
-       $(INSTALL_DIR) $(HOST_PYTHON3_DIR)/bin/
-       $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_PYTHON3_DIR)/bin/pgen3
-       $(INSTALL_BIN) $(HOST_BUILD_DIR)/Programs/_freeze_importlib $(HOST_PYTHON3_DIR)/bin/_freeze_importlib
-endef
-
-$(eval $(call HostBuild))
-
-$(foreach package, $(PYTHON3_PACKAGES),  \
-       $(eval $(call Py3Package,$(package))) \
-       $(eval $(call BuildPackage,$(package))) \
-)
-
-$(eval $(call Py3Package,python3-base))
-$(eval $(call Py3Package,python3-light))
-$(eval $(call Py3Package,python3))
-
-$(eval $(call BuildPackage,python3-base))
-$(eval $(call BuildPackage,python3-light))
-$(eval $(call BuildPackage,python3))
diff --git a/lang/python3/files/config.site b/lang/python3/files/config.site
deleted file mode 100644 (file)
index cfa56b8..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#! /bin/sh
-#
-# Copyright (C) 2007-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-ac_cv_file__dev_ptmx=yes
-ac_cv_file__dev_ptc=no
-ac_cv_buggy_getaddrinfo=no
-
diff --git a/lang/python3/files/python3-host.mk b/lang/python3/files/python3-host.mk
deleted file mode 100644 (file)
index 8ff6dd7..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-# Copyright (C) 2017 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-ifneq ($(__python3_host_mk_inc),1)
-__python3_host_mk_inc=1
-
-# For PYTHON3_VERSION
-$(call include_mk, python3-version.mk)
-
-HOST_PYTHON3_DIR:=$(STAGING_DIR_HOSTPKG)
-HOST_PYTHON3_INC_DIR:=$(HOST_PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
-HOST_PYTHON3_LIB_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
-
-HOST_PYTHON3_PKG_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)/site-packages
-
-HOST_PYTHON3_BIN:=$(HOST_PYTHON3_DIR)/bin/python$(PYTHON3_VERSION)
-
-HOST_PYTHON3PATH:=$(HOST_PYTHON3_LIB_DIR):$(HOST_PYTHON3_PKG_DIR)
-
-define HostPython3
-       if [ "$(strip $(3))" == "HOST" ]; then \
-               export PYTHONPATH="$(HOST_PYTHON3PATH)"; \
-               export PYTHONDONTWRITEBYTECODE=0; \
-       else \
-               export PYTHONPATH="$(PYTHON3PATH)"; \
-               export PYTHONDONTWRITEBYTECODE=1; \
-               export _python_sysroot="$(STAGING_DIR)"; \
-               export _python_prefix="/usr"; \
-               export _python_exec_prefix="/usr"; \
-       fi; \
-       export PYTHONOPTIMIZE=""; \
-       $(1) \
-       $(HOST_PYTHON3_BIN) $(2);
-endef
-
-# $(1) => commands to execute before running pythons script
-# $(2) => python script and its arguments
-# $(3) => additional variables
-define Build/Compile/HostPy3RunHost
-       $(call HostPython3, \
-               $(if $(1),$(1);) \
-               CC="$(HOSTCC)" \
-               CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
-               CXX="$(HOSTCXX)" \
-               LD="$(HOSTCC)" \
-               LDSHARED="$(HOSTCC) -shared" \
-               CFLAGS="$(HOST_CFLAGS)" \
-               CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \
-               LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
-               _PYTHON_HOST_PLATFORM=linux2 \
-               $(3) \
-               , \
-               $(2) \
-               , \
-               HOST \
-       )
-endef
-
-
-# $(1) => build subdir
-# $(2) => additional arguments to setup.py
-# $(3) => additional variables
-define Build/Compile/HostPy3Mod
-       $(call Build/Compile/HostPy3RunHost, \
-               cd $(HOST_BUILD_DIR)/$(strip $(1)), \
-               ./setup.py $(2), \
-               $(3))
-endef
-
-define HostPy3/Compile/Default
-       $(call Build/Compile/HostPy3Mod,,\
-               install --root="$(STAGING_DIR_HOSTPKG)" --prefix="" \
-               --single-version-externally-managed \
-       )
-endef
-
-ifeq ($(BUILD_VARIANT),python3)
-define Host/Compile
-       $(call HostPy3/Compile/Default)
-endef
-
-define Host/Install
-endef
-endif # python3
-
-endif # __python3_host_mk_inc
diff --git a/lang/python3/files/python3-package-asyncio.mk b/lang/python3/files/python3-package-asyncio.mk
deleted file mode 100644 (file)
index 52eccae..0000000
+++ /dev/null
@@ -1,16 +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.
-#
-
-define Package/python3-asyncio
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) asyncio module
-  DEPENDS:=+python3-light
-endef
-
-$(eval $(call Py3BasePackage,python3-asyncio, \
-       /usr/lib/python$(PYTHON3_VERSION)/asyncio \
-))
diff --git a/lang/python3/files/python3-package-codecs.mk b/lang/python3/files/python3-package-codecs.mk
deleted file mode 100644 (file)
index f768b02..0000000
+++ /dev/null
@@ -1,22 +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.
-#
-
-define Package/python3-codecs
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) codecs + unicode support
-  DEPENDS:=+python3-light
-endef
-
-$(eval $(call Py3BasePackage,python3-codecs, \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_cn.$(PYTHON3_SO_SUFFIX) \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_hk.$(PYTHON3_SO_SUFFIX) \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_iso2022.$(PYTHON3_SO_SUFFIX) \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_jp.$(PYTHON3_SO_SUFFIX) \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_kr.$(PYTHON3_SO_SUFFIX) \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_tw.$(PYTHON3_SO_SUFFIX) \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/unicodedata.$(PYTHON3_SO_SUFFIX) \
-))
diff --git a/lang/python3/files/python3-package-ctypes.mk b/lang/python3/files/python3-package-ctypes.mk
deleted file mode 100644 (file)
index f38e011..0000000
+++ /dev/null
@@ -1,18 +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.
-#
-
-define Package/python3-ctypes
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) ctypes module
-  DEPENDS:=+python3-light
-endef
-
-$(eval $(call Py3BasePackage,python3-ctypes, \
-       /usr/lib/python$(PYTHON3_VERSION)/ctypes \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ctypes.$(PYTHON3_SO_SUFFIX) \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ctypes_test.$(PYTHON3_SO_SUFFIX) \
-))
diff --git a/lang/python3/files/python3-package-dbm.mk b/lang/python3/files/python3-package-dbm.mk
deleted file mode 100644 (file)
index 4099402..0000000
+++ /dev/null
@@ -1,17 +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.
-#
-
-define Package/python3-dbm
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) dbm module
-  DEPENDS:=+python3-light +libdb47
-endef
-
-$(eval $(call Py3BasePackage,python3-dbm, \
-       /usr/lib/python$(PYTHON3_VERSION)/dbm \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_dbm.$(PYTHON3_SO_SUFFIX) \
-))
diff --git a/lang/python3/files/python3-package-decimal.mk b/lang/python3/files/python3-package-decimal.mk
deleted file mode 100644 (file)
index 391b6f6..0000000
+++ /dev/null
@@ -1,17 +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.
-#
-
-define Package/python3-decimal
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) decimal module
-  DEPENDS:=+python3-light
-endef
-
-$(eval $(call Py3BasePackage,python3-decimal, \
-       /usr/lib/python$(PYTHON3_VERSION)/decimal.py \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_decimal.$(PYTHON3_SO_SUFFIX) \
-))
diff --git a/lang/python3/files/python3-package-dev.mk b/lang/python3/files/python3-package-dev.mk
deleted file mode 100644 (file)
index 19d9592..0000000
+++ /dev/null
@@ -1,27 +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.
-#
-
-define Package/python3-dev
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) development files
-  DEPENDS:=+python3 +python3-lib2to3
-endef
-
-define Py3Package/python3-dev/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/python$(PYTHON3_VERSION)-config $(1)/usr/bin
-       $(LN) python$(PYTHON3_VERSION)-config $(1)/usr/bin/python3-config
-       $(LN) python$(PYTHON_VERSION)/config-$(PYTHON_VERSION)/libpython$(PYTHON3_VERSION).a $(1)/usr/lib/libpython$(PYTHON3_VERSION).a
-endef
-
-$(eval $(call Py3BasePackage,python3-dev, \
-    /usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
-    /usr/include/python$(PYTHON_VERSION) \
-    /usr/lib/pkgconfig \
-       , \
-       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
-))
diff --git a/lang/python3/files/python3-package-distutils.mk b/lang/python3/files/python3-package-distutils.mk
deleted file mode 100644 (file)
index b1f1fb5..0000000
+++ /dev/null
@@ -1,16 +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.
-#
-
-define Package/python3-distutils
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) distutils module
-  DEPENDS:=+python3-light
-endef
-
-$(eval $(call Py3BasePackage,python3-distutils, \
-       /usr/lib/python$(PYTHON3_VERSION)/distutils \
-))
diff --git a/lang/python3/files/python3-package-email.mk b/lang/python3/files/python3-package-email.mk
deleted file mode 100644 (file)
index 6cf4407..0000000
+++ /dev/null
@@ -1,16 +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.
-#
-
-define Package/python3-email
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) email module
-  DEPENDS:=+python3-light
-endef
-
-$(eval $(call Py3BasePackage,python3-email, \
-       /usr/lib/python$(PYTHON3_VERSION)/email \
-))
diff --git a/lang/python3/files/python3-package-gdbm.mk b/lang/python3/files/python3-package-gdbm.mk
deleted file mode 100644 (file)
index 7f98bad..0000000
+++ /dev/null
@@ -1,16 +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.
-#
-
-define Package/python3-gdbm
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) gdbm module
-  DEPENDS:=+python3-light +libgdbm
-endef
-
-$(eval $(call Py3BasePackage,python3-gdbm, \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_gdbm.$(PYTHON3_SO_SUFFIX) \
-))
diff --git a/lang/python3/files/python3-package-lib2to3.mk b/lang/python3/files/python3-package-lib2to3.mk
deleted file mode 100644 (file)
index ed712b6..0000000
+++ /dev/null
@@ -1,18 +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.
-#
-
-define Package/python3-lib2to3
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) lib2to3 module
-  DEPENDS:=+python3
-endef
-
-$(eval $(call Py3BasePackage,python3-lib2to3, \
-       /usr/lib/python$(PYTHON3_VERSION)/lib2to3 \
-       , \
-       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
-))
diff --git a/lang/python3/files/python3-package-logging.mk b/lang/python3/files/python3-package-logging.mk
deleted file mode 100644 (file)
index fa3ec0e..0000000
+++ /dev/null
@@ -1,16 +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.
-#
-
-define Package/python3-logging
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) logging module
-  DEPENDS:=+python3-light
-endef
-
-$(eval $(call Py3BasePackage,python3-logging, \
-       /usr/lib/python$(PYTHON3_VERSION)/logging \
-))
diff --git a/lang/python3/files/python3-package-lzma.mk b/lang/python3/files/python3-package-lzma.mk
deleted file mode 100644 (file)
index 57b38ec..0000000
+++ /dev/null
@@ -1,17 +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.
-#
-
-define Package/python3-lzma
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) lzma module
-  DEPENDS:=+python3-light +liblzma
-endef
-
-$(eval $(call Py3BasePackage,python3-lzma, \
-       /usr/lib/python$(PYTHON3_VERSION)/lzma.py \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_lzma.$(PYTHON3_SO_SUFFIX) \
-))
diff --git a/lang/python3/files/python3-package-multiprocessing.mk b/lang/python3/files/python3-package-multiprocessing.mk
deleted file mode 100644 (file)
index c797601..0000000
+++ /dev/null
@@ -1,17 +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.
-#
-
-define Package/python3-multiprocessing
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) multiprocessing
-  DEPENDS:=+python3-light
-endef
-
-$(eval $(call Py3BasePackage,python3-multiprocessing, \
-       /usr/lib/python$(PYTHON3_VERSION)/multiprocessing \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_multiprocessing.$(PYTHON3_SO_SUFFIX) \
-))
diff --git a/lang/python3/files/python3-package-ncurses.mk b/lang/python3/files/python3-package-ncurses.mk
deleted file mode 100644 (file)
index 45649ac..0000000
+++ /dev/null
@@ -1,18 +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.
-#
-
-define Package/python3-ncurses
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) ncurses module
-  DEPENDS:=+python3-light +libncurses
-endef
-
-$(eval $(call Py3BasePackage,python3-ncurses, \
-       /usr/lib/python$(PYTHON3_VERSION)/curses \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_curses.$(PYTHON3_SO_SUFFIX) \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_curses_panel.$(PYTHON3_SO_SUFFIX) \
-))
diff --git a/lang/python3/files/python3-package-openssl.mk b/lang/python3/files/python3-package-openssl.mk
deleted file mode 100644 (file)
index 6971993..0000000
+++ /dev/null
@@ -1,17 +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.
-#
-
-define Package/python3-openssl
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) SSL module
-  DEPENDS:=+python3-light +libopenssl
-endef
-
-$(eval $(call Py3BasePackage,python3-openssl, \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_hashlib.$(PYTHON3_SO_SUFFIX) \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ssl.$(PYTHON3_SO_SUFFIX) \
-))
diff --git a/lang/python3/files/python3-package-pydoc.mk b/lang/python3/files/python3-package-pydoc.mk
deleted file mode 100644 (file)
index 9ab1a5b..0000000
+++ /dev/null
@@ -1,18 +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.
-#
-
-define Package/python3-pydoc
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) pydoc module
-  DEPENDS:=+python3-light
-endef
-
-$(eval $(call Py3BasePackage,python3-pydoc, \
-       /usr/lib/python$(PYTHON3_VERSION)/doctest.py \
-       /usr/lib/python$(PYTHON3_VERSION)/pydoc.py \
-       /usr/lib/python$(PYTHON3_VERSION)/pydoc_data \
-))
diff --git a/lang/python3/files/python3-package-sqlite3.mk b/lang/python3/files/python3-package-sqlite3.mk
deleted file mode 100644 (file)
index 665bff2..0000000
+++ /dev/null
@@ -1,17 +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.
-#
-
-define Package/python3-sqlite3
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) sqlite3 module
-  DEPENDS:=+python3-light +libsqlite3
-endef
-
-$(eval $(call Py3BasePackage,python3-sqlite3, \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_sqlite3.$(PYTHON3_SO_SUFFIX) \
-       /usr/lib/python$(PYTHON3_VERSION)/sqlite3 \
-))
diff --git a/lang/python3/files/python3-package-unittest.mk b/lang/python3/files/python3-package-unittest.mk
deleted file mode 100644 (file)
index d9df86f..0000000
+++ /dev/null
@@ -1,16 +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.
-#
-
-define Package/python3-unittest
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) unittest module
-  DEPENDS:=+python3-light
-endef
-
-$(eval $(call Py3BasePackage,python3-unittest, \
-       /usr/lib/python$(PYTHON3_VERSION)/unittest \
-))
diff --git a/lang/python3/files/python3-package-xml.mk b/lang/python3/files/python3-package-xml.mk
deleted file mode 100644 (file)
index 4893fa9..0000000
+++ /dev/null
@@ -1,19 +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.
-#
-
-define Package/python3-xml
-$(call Package/python3/Default)
-  TITLE:=Python $(PYTHON3_VERSION) xml libs
-  DEPENDS:=+python3-light
-endef
-
-$(eval $(call Py3BasePackage,python3-xml, \
-       /usr/lib/python$(PYTHON3_VERSION)/xml \
-       /usr/lib/python$(PYTHON3_VERSION)/xmlrpc \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_elementtree.$(PYTHON3_SO_SUFFIX) \
-       /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/pyexpat.$(PYTHON3_SO_SUFFIX) \
-))
diff --git a/lang/python3/files/python3-package.mk b/lang/python3/files/python3-package.mk
deleted file mode 100644 (file)
index f13e737..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-$(call include_mk, python3-version.mk)
-
-PYTHON3_DIR:=$(STAGING_DIR)/usr
-PYTHON3_BIN_DIR:=$(PYTHON3_DIR)/bin
-PYTHON3_INC_DIR:=$(PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
-PYTHON3_LIB_DIR:=$(PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
-
-PYTHON3_PKG_DIR:=/usr/lib/python$(PYTHON3_VERSION)/site-packages
-
-PYTHON3:=python$(PYTHON3_VERSION)
-
-PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
-
-# These configure args are needed in detection of path to Python header files
-# using autotools.
-CONFIGURE_ARGS += \
-       _python_sysroot="$(STAGING_DIR)" \
-       _python_prefix="/usr" \
-       _python_exec_prefix="/usr"
-
-PKG_USE_MIPS16:=0
-# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
-# flags are inherited from the Python base package (via sysconfig module)
-ifdef CONFIG_USE_MIPS16
-  TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
-endif
-
-define Py3Package
-
-  # Add default PyPackage filespec none defined
-  ifndef Py3Package/$(1)/filespec
-    define Py3Package/$(1)/filespec
-      +|$(PYTHON3_PKG_DIR)
-    endef
-  endif
-
-  ifndef Py3Package/$(1)/install
-    define Py3Package/$(1)/install
-               if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
-                       $(INSTALL_DIR) $$(1)/usr/bin \
-                       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/
-               fi
-    endef
-  endif
-
-  $(call shexport,Py3Package/$(1)/filespec)
-
-  define Package/$(1)/install
-       find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" -o -name "*\.exe" | xargs rm -f
-       @echo "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)" | ( \
-               IFS='|'; \
-               while read fop fspec fperm; do \
-                 fop=`echo "$$$$$$$$fop" | tr -d ' \t\n'`; \
-                 if [ "$$$$$$$$fop" = "+" ]; then \
-                       if [ ! -e "$(PKG_INSTALL_DIR)$$$$$$$$fspec" ]; then \
-                         echo "File not found '$(PKG_INSTALL_DIR)$$$$$$$$fspec'"; \
-                         exit 1; \
-                       fi; \
-                       dpath=`dirname "$$$$$$$$fspec"`; \
-                       if [ -n "$$$$$$$$fperm" ]; then \
-                         dperm="-m$$$$$$$$fperm"; \
-                       else \
-                         dperm=`stat -c "%a" $(PKG_INSTALL_DIR)$$$$$$$$dpath`; \
-                       fi; \
-                       mkdir -p $$$$$$$$$dperm $$(1)$$$$$$$$dpath; \
-                       echo "copying: '$$$$$$$$fspec'"; \
-                       cp -fpR $(PKG_INSTALL_DIR)$$$$$$$$fspec $$(1)$$$$$$$$dpath/; \
-                       if [ -n "$$$$$$$$fperm" ]; then \
-                         chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
-                       fi; \
-                 elif [ "$$$$$$$$fop" = "-" ]; then \
-                       echo "removing: '$$$$$$$$fspec'"; \
-                       rm -fR $$(1)$$$$$$$$fspec; \
-                 elif [ "$$$$$$$$fop" = "=" ]; then \
-                       echo "setting permissions: '$$$$$$$$fperm' on '$$$$$$$$fspec'"; \
-                       chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
-                 fi; \
-               done; \
-       )
-       $(call Py3Package/$(1)/install,$$(1))
-  endef
-endef
-
-$(call include_mk, python3-host.mk)
-
-# $(1) => commands to execute before running pythons script
-# $(2) => python script and its arguments
-# $(3) => additional variables
-define Build/Compile/HostPy3RunTarget
-       $(call HostPython3, \
-               $(if $(1),$(1);) \
-               CC="$(TARGET_CC)" \
-               CCSHARED="$(TARGET_CC) $(FPIC)" \
-               CXX="$(TARGET_CXX)" \
-               LD="$(TARGET_CC)" \
-               LDSHARED="$(TARGET_CC) -shared" \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \
-               LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \
-               _PYTHON_HOST_PLATFORM=linux2 \
-               __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON3)" \
-               $(3) \
-               , \
-               $(2) \
-       )
-endef
-
-# $(1) => build subdir
-# $(2) => additional arguments to setup.py
-# $(3) => additional variables
-define Build/Compile/Py3Mod
-       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
-       $(call Build/Compile/HostPy3RunTarget, \
-               cd $(PKG_BUILD_DIR)/$(strip $(1)), \
-               ./setup.py $(2), \
-               $(3))
-       find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" -o -name "*\.exe" | xargs rm -f
-endef
-
-define Py3Build/Compile/Default
-       $(call Build/Compile/Py3Mod,, \
-               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
-               --single-version-externally-managed \
-       )
-endef
-
-ifeq ($(BUILD_VARIANT),python3)
-define Build/Compile
-       $(call Py3Build/Compile/Default)
-endef
-endif # python3
diff --git a/lang/python3/files/python3-version.mk b/lang/python3/files/python3-version.mk
deleted file mode 100644 (file)
index 08a130f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-PYTHON3_VERSION_MAJOR:=3
-PYTHON3_VERSION_MINOR:=6
-PYTHON3_VERSION_MICRO:=0
-
-PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
-
diff --git a/lang/python3/patches/001-enable-zlib.patch b/lang/python3/patches/001-enable-zlib.patch
deleted file mode 100644 (file)
index 780831e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-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
-
diff --git a/lang/python3/patches/002-do-not-add-include-dirs-when-cross-compiling.patch b/lang/python3/patches/002-do-not-add-include-dirs-when-cross-compiling.patch
deleted file mode 100644 (file)
index 44be1c8..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 93f390f..ace1494 100644
---- a/setup.py
-+++ b/setup.py
-@@ -461,7 +461,8 @@ class PyBuildExt(build_ext):
-                         add_dir_to_list(dir_list, directory)
-         if os.path.normpath(sys.base_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
diff --git a/lang/python3/patches/003-do-not-run-distutils-tests.patch b/lang/python3/patches/003-do-not-run-distutils-tests.patch
deleted file mode 100644 (file)
index 77c089f..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index ce2c0aa..b0c8322 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -1256,41 +1256,6 @@ libinstall:     build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
-               done; \
-       done
-       $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
--      if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
--              $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
--                      $(DESTDIR)$(LIBDEST)/distutils/tests ; \
--      fi
--      -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
--              $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
--              -d $(LIBDEST) -f \
--              -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
--              $(DESTDIR)$(LIBDEST)
--      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--              $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
--              -d $(LIBDEST) -f \
--              -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
--              $(DESTDIR)$(LIBDEST)
--      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--              $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
--              -d $(LIBDEST) -f \
--              -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
--              $(DESTDIR)$(LIBDEST)
--      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--              $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
--              -d $(LIBDEST)/site-packages -f \
--              -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
--      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--              $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
--              -d $(LIBDEST)/site-packages -f \
--              -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
--      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--              $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
--              -d $(LIBDEST)/site-packages -f \
--              -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
--      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
--              $(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
- # Create the PLATDIR source directory, if one wasn't distributed..
- $(srcdir)/Lib/$(PLATDIR):
diff --git a/lang/python3/patches/004-do-not-write-bytes-codes.patch b/lang/python3/patches/004-do-not-write-bytes-codes.patch
deleted file mode 100644 (file)
index 1da7b8b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
-index a17adf7..415b3f6 100644
---- a/Python/pylifecycle.c
-+++ b/Python/pylifecycle.c
-@@ -86,7 +86,7 @@ int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
- int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
- int Py_FrozenFlag; /* Needed by getpath.c */
- int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
--int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
-+int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
- int Py_NoUserSiteDirectory = 0; /* for -s and site.py */
- int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */
- int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */
-@@ -309,7 +309,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
-     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')
diff --git a/lang/python3/patches/005-fix-libffi-x86-64-configure.patch b/lang/python3/patches/005-fix-libffi-x86-64-configure.patch
deleted file mode 100644 (file)
index ea062a3..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-diff --git a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure
-index 75f62a7..4d6c9f2 100755
---- a/Modules/_ctypes/libffi/configure
-+++ b/Modules/_ctypes/libffi/configure
-@@ -17257,20 +17257,12 @@ case "$host" in
-       fi
-       ;;
--  i?86-*-* | x86_64-*-*)
--      TARGETDIR=x86
--      if test $ac_cv_sizeof_size_t = 4; then
--        case "$host" in
--          *-gnux32)
--            TARGET=X86_64
--            ;;
--          *)
--            TARGET=X86
--            ;;
--          esac
--      else
--        TARGET=X86_64;
--      fi
-+  i?86-*-*)
-+      TARGET=X86; TARGETDIR=x86
-+      ;;
-+
-+  x86_64-*-*)
-+      TARGET=X86_64; TARGETDIR=x86
-       ;;
-   ia64*-*-*)
diff --git a/lang/python3/patches/006-remove-debian-multiarch-support.patch b/lang/python3/patches/006-remove-debian-multiarch-support.patch
deleted file mode 100644 (file)
index 52d52b9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 7868b7b..9ae0ef2 100644
---- a/setup.py
-+++ b/setup.py
-@@ -444,7 +444,6 @@ 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()
-         # Add paths specified in the environment variables LDFLAGS and
-         # CPPFLAGS for header and library files.
diff --git a/lang/python3/patches/007-distutils-do-not-adjust-path.patch b/lang/python3/patches/007-distutils-do-not-adjust-path.patch
deleted file mode 100644 (file)
index 49fe926..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/Lib/distutils/command/build_scripts.py
-+++ b/Lib/distutils/command/build_scripts.py
-@@ -89,6 +89,7 @@ class build_scripts (Command):
-                     adjust = 1
-                     post_interp = match.group(1) or ''
-+            adjust = 0
-             if adjust:
-                 log.info("copying and adjusting %s -> %s", script,
-                          self.build_dir)
diff --git a/lang/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch b/lang/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch
deleted file mode 100644 (file)
index 5a106d4..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-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)
diff --git a/lang/python3/patches/011-do-not-prefer-ncursesw.patch b/lang/python3/patches/011-do-not-prefer-ncursesw.patch
deleted file mode 100644 (file)
index c023225..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 2779658..b6d3d61 100644
---- a/setup.py
-+++ b/setup.py
-@@ -693,8 +693,8 @@ class PyBuildExt(build_ext):
-         # use the same library for the readline and curses modules.
-         if 'curses' in readline_termcap_library:
-             curses_library = readline_termcap_library
--        elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
--            curses_library = 'ncursesw'
-+        #elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
-+        #    curses_library = 'ncursesw'
-         elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
-             curses_library = 'ncurses'
-         elif self.compiler.find_library_file(lib_dirs, 'curses'):
diff --git a/lang/python3/patches/011-fix-ncursesw-definition-colisions.patch b/lang/python3/patches/011-fix-ncursesw-definition-colisions.patch
deleted file mode 100644 (file)
index 0df72c7..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
-index 3bf2ca7..c156964 100644
---- a/Modules/_cursesmodule.c
-+++ b/Modules/_cursesmodule.c
-@@ -116,7 +116,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
-diff --git a/setup.py b/setup.py
-index af9a414..ee19ecd 100644
---- a/setup.py
-+++ b/setup.py
-@@ -1349,7 +1349,6 @@ class PyBuildExt(build_ext):
-         panel_library = 'panel'
-         if curses_library == 'ncursesw':
-             curses_defines.append(('HAVE_NCURSESW', '1'))
--            curses_includes.append('/usr/include/ncursesw')
-             # Bug 1464056: If _curses.so links with ncursesw,
-             # _curses_panel.so must link with panelw.
-             panel_library = 'panelw'
diff --git a/lang/python3/patches/012-disable-wcsftime-detection.patch b/lang/python3/patches/012-disable-wcsftime-detection.patch
deleted file mode 100644 (file)
index 55a383c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/configure b/configure
-index 274af7e..85bbf0e 100755
---- a/configure
-+++ b/configure
-@@ -10555,7 +10555,7 @@ for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
-  sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \
-  sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
-  truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \
-- wcscoll wcsftime wcsxfrm wmemcmp writev _getpty
-+ wcscoll wcsxfrm wmemcmp writev _getpty
- do :
-   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
- ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/lang/python3/patches/014-remove-platform-so-suffix.patch b/lang/python3/patches/014-remove-platform-so-suffix.patch
deleted file mode 100644 (file)
index cbc32d5..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/configure b/configure
-index e823a08..84c525f 100755
---- a/configure
-+++ b/configure
-@@ -14365,7 +14365,7 @@ $as_echo_n "checking ABIFLAGS... " >&6; }
- $as_echo "$ABIFLAGS" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
- $as_echo_n "checking SOABI... " >&6; }
--SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
-+SOABI='cpython-'`echo $VERSION | tr -d .`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5
- $as_echo "$SOABI" >&6; }
-diff --git a/configure.ac b/configure.ac
-index 56a73df..1855af5 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4314,7 +4314,7 @@ AC_SUBST(SOABI)
- AC_MSG_CHECKING(ABIFLAGS)
- AC_MSG_RESULT($ABIFLAGS)
- AC_MSG_CHECKING(SOABI)
--SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
-+SOABI='cpython-'`echo $VERSION | tr -d .`
- AC_MSG_RESULT($SOABI)
- AC_SUBST(EXT_SUFFIX)
diff --git a/lang/python3/patches/015-abort-on-failed-modules.patch b/lang/python3/patches/015-abort-on-failed-modules.patch
deleted file mode 100644 (file)
index eec488f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/setup.py b/setup.py
-index da67731..928e0de 100644
---- a/setup.py
-+++ b/setup.py
-@@ -293,6 +293,7 @@ class PyBuildExt(build_ext):
-             print("Failed to build these modules:")
-             print_three_column(failed)
-             print()
-+            if cross_compiling: sys.exit(1)
-         if self.failed_on_import:
-             failed = self.failed_on_import[:]
diff --git a/lang/python3/patches/016-adjust-config-paths.patch b/lang/python3/patches/016-adjust-config-paths.patch
deleted file mode 100644 (file)
index fb709b7..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
-index 8bf1a70..c2708c3 100644
---- a/Lib/distutils/sysconfig.py
-+++ b/Lib/distutils/sysconfig.py
-@@ -424,6 +424,7 @@ def _init_posix():
-         platform=sys.platform,
-         multiarch=getattr(sys.implementation, '_multiarch', ''),
-     ))
-+    name = '_sysconfigdata'
-     _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
-     build_time_vars = _temp.build_time_vars
-     global _config_vars
-diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
-index 9314e71..4861261 100644
---- a/Lib/sysconfig.py
-+++ b/Lib/sysconfig.py
-@@ -343,6 +343,7 @@ def get_makefile_filename():
- def _get_sysconfigdata_name():
-+    return '_sysconfigdata'
-     return os.environ.get('_PYTHON_SYSCONFIGDATA_NAME',
-         '_sysconfigdata_{abi}_{platform}_{multiarch}'.format(
-         abi=sys.abiflags,
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index cd7d33d..ad6572f 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -1301,7 +1301,7 @@ libinstall:      build_all $(srcdir)/Modules/xxmodule.c
-                       esac; \
-               done; \
-       done
--      $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
-+      $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata*.py \
-               $(DESTDIR)$(LIBDEST); \
-       $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
-       if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
-@@ -1436,7 +1436,7 @@ sharedinstall: sharedmods
-               --install-scripts=$(BINDIR) \
-               --install-platlib=$(DESTSHARED) \
-               --root=$(DESTDIR)/
--      -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
-+      -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata*.py
-       -rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
- # Here are a couple of targets for MacOSX again, to install a full
-diff --git a/configure b/configure
-index cf95b27..8203fbb 100755
---- a/configure
-+++ b/configure
-@@ -14895,7 +14895,7 @@ LDVERSION='$(VERSION)$(ABIFLAGS)'
- $as_echo "$LDVERSION" >&6; }
--if test x$PLATFORM_TRIPLET = x; then
-+if true ; then
-   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
- else
-   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
-diff --git a/configure.ac b/configure.ac
-index 1d63813..25f25ed 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -4600,7 +4600,7 @@ AC_MSG_RESULT($LDVERSION)
- dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
- AC_SUBST(PY_ENABLE_SHARED)
--if test x$PLATFORM_TRIPLET = x; then
-+if true ; then
-   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
- else
-   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
diff --git a/lang/pytz/Makefile b/lang/pytz/Makefile
deleted file mode 100644 (file)
index 205338d..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=pytz
-PKG_VERSION:=2016.6.1
-PKG_RELEASE:=1
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/5d/8e/6635d8f3f9f48c03bb925fab543383089858271f9cfd1216b83247e8df94/
-PKG_MD5SUM:=b6c28a3b968bc1d8badfb61b93874e03
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/pytz
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=World timezone definitions, modern and historical
-  URL:=https://sourceforge.net/projects/pytz/
-  DEPENDS:=+python
-endef
-
-define Package/pytz/description
-  World timezone definitions, modern and historical
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/pytz/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,pytz))
diff --git a/lang/rcssmin/Makefile b/lang/rcssmin/Makefile
deleted file mode 100644 (file)
index 5722474..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=rcssmin
-PKG_VERSION:=1.0.6
-PKG_RELEASE=1
-PKG_LICENSE:=Apache-2.0
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/ndparker/rcssmin.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=4764e3bc47ca8d44be3198892e73c51d8a0a9970
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/rcssmin
-    SUBMENU:=Python
-    SECTION:=lang
-    CATEGORY:=Languages
-    TITLE:=Fast CSS minifier for Python
-    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-    URL:=http://opensource.perlig.de/rcssmin/
-    DEPENDS:=+python
-endef
-
-define Package/rcssmin/description
-    Fast CSS minifier for Python
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-define Package/rcssmin/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,rcssmin))
index adca82f64d22d2a63606e305d24cec71a3ec4d92..b00aaf1a2abd3bba41c3cbc78e09f182a643a111 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Copyright (C) 2006-2016 OpenWrt.org
-# Copyright (C) 2017 Luiz Angelo Daros de Luca <luizluca@gmail.com>
+# Copyright (C) 2017-2018 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.
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ruby
-PKG_VERSION:=2.4.1
+PKG_VERSION:=2.5.0
 PKG_RELEASE:=1
 
 # First two numbes
 PKG_ABI_VERSION:=$(subst $(space),.,$(wordlist 1, 2, $(subst .,$(space),$(PKG_VERSION))))
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://cache.ruby-lang.org/pub/ruby/$(PKG_ABI_VERSION)/
-PKG_HASH:=4fc8a9992de3e90191de369270ea4b6c1b171b7941743614cc50822ddc1fe654
+PKG_SOURCE_URL:=https://cache.ruby-lang.org/pub/ruby/$(PKG_ABI_VERSION)/
+PKG_HASH:=1da0afed833a0dab94075221a615c14487b05d0c407f991c8080d576d985b49b
 PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
 PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=COPYING
@@ -213,14 +213,20 @@ define Package/ruby-cgi/files
 /usr/lib/ruby/$(PKG_ABI_VERSION)/*/cgi/escape.so
 endef
 
+define Package/ruby-cmath/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/cmath.rb
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/cmath-*.gemspec
+endef
+
 define Package/ruby-csv/files
 /usr/lib/ruby/$(PKG_ABI_VERSION)/csv.rb
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/csv-*.gemspec
 endef
 
-define Package/ruby-datetime/files
-/usr/lib/ruby/$(PKG_ABI_VERSION)/time.rb
+define Package/ruby-date/files
 /usr/lib/ruby/$(PKG_ABI_VERSION)/date.rb
 /usr/lib/ruby/$(PKG_ABI_VERSION)/*/date_core.so
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/date-*.gemspec
 endef
 
 define Package/ruby-dbm/description
@@ -230,6 +236,7 @@ define Package/ruby-dbm/description
 endef
 define Package/ruby-dbm/files
 /usr/lib/ruby/$(PKG_ABI_VERSION)/*/dbm.so
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/dbm-*.gemspec
 endef
 
 define Package/ruby-debuglib/files
@@ -251,6 +258,8 @@ define Package/ruby-did-you-mean/files-excluded
 /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
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/*.txt
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/.travis.yml
 endef
 
 define Package/ruby-digest/description
@@ -302,10 +311,21 @@ define Package/ruby-erb/files
 /usr/lib/ruby/$(PKG_ABI_VERSION)/erb.rb
 endef
 
+define Package/ruby-etc/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/etc.so
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/etc-*.gemspec
+endef
+
+define Package/ruby-fcntl/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/fcntl.so
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/fcntl-*.gemspec
+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
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/fiddle-*.gemspec
 endef
 
 define Package/ruby-filelib/files
@@ -314,15 +334,19 @@ define Package/ruby-filelib/files
 /usr/lib/ruby/$(PKG_ABI_VERSION)/pathname.rb
 /usr/lib/ruby/$(PKG_ABI_VERSION)/*/pathname.so
 /usr/lib/ruby/$(PKG_ABI_VERSION)/find.rb
+endef
+
+define Package/ruby-fileutils/files
 /usr/lib/ruby/$(PKG_ABI_VERSION)/fileutils.rb
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/fileutils-*.gemspec
 endef
 
 define Package/ruby-gdbm/files
 /usr/lib/ruby/$(PKG_ABI_VERSION)/*/gdbm.so
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/gdbm-*.gemspec
 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
@@ -343,12 +367,18 @@ define Package/ruby-gems/install
        $(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-ipaddr/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/ipaddr.rb
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/ipaddr-*.gemspec
+endef
+
 define Package/ruby-irb/files
 /usr/lib/ruby/$(PKG_ABI_VERSION)/irb
 /usr/lib/ruby/$(PKG_ABI_VERSION)/irb.rb
@@ -377,9 +407,6 @@ 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
@@ -404,7 +431,6 @@ define Package/ruby-misc/files
 /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
@@ -412,12 +438,8 @@ define Package/ruby-misc/files
 /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
@@ -447,6 +469,7 @@ 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
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/net-telnet-*/.travis.yml
 endef
 
 define Package/ruby-nkf/files
@@ -479,7 +502,8 @@ define Package/ruby-powerassert/files
 /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
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/power_assert-*/*.rdoc
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/power_assert-*/.travis.yml
 endef
 
 define Package/ruby-prettyprint/files
@@ -519,20 +543,19 @@ 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
+/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
+/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
@@ -564,8 +587,14 @@ define Package/ruby-rss/files
 /usr/lib/ruby/$(PKG_ABI_VERSION)/rss.rb
 endef
 
+define Package/ruby-scanf/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/scanf.rb
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/scanf-*.gemspec
+endef
+
 define Package/ruby-sdbm/files
 /usr/lib/ruby/$(PKG_ABI_VERSION)/*/sdbm.so
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/sdbm-*.gemspec
 endef
 
 define Package/ruby-shell/files
@@ -574,13 +603,22 @@ define Package/ruby-shell/files
 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-stringio/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/stringio.so
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/stringio-*.gemspec
+endef
+
+define Package/ruby-strscan/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/strscan.so
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/strscan-*.gemspec
+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-*
@@ -592,8 +630,11 @@ define Package/ruby-testunit/files-excluded
 /usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/test-unit-*/*.md
 endef
 
+define Package/ruby-time/files
+/usr/lib/ruby/$(PKG_ABI_VERSION)/time.rb
+endef
+
 define Package/ruby-unicodenormalize/files
-/usr/lib/ruby/$(PKG_ABI_VERSION)/unicode_normalize.rb
 /usr/lib/ruby/$(PKG_ABI_VERSION)/unicode_normalize
 endef
 
@@ -605,6 +646,7 @@ endef
 define Package/ruby-webrick/files
 /usr/lib/ruby/$(PKG_ABI_VERSION)/webrick
 /usr/lib/ruby/$(PKG_ABI_VERSION)/webrick.rb
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/webrick-*.gemspec
 endef
 
 define Package/ruby-xmlrpc/files
@@ -612,8 +654,9 @@ define Package/ruby-xmlrpc/files
 /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
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/xmlrpc-*/*.md
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/xmlrpc-*/*.txt
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/xmlrpc-*/.travis.yml
 endef
 
 define Package/ruby-yaml/files
@@ -623,6 +666,7 @@ endef
 
 define Package/ruby-zlib/files
 /usr/lib/ruby/$(PKG_ABI_VERSION)/*/zlib.so
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/zlib-*.gemspec
 endef
 
 RUBY_FILES = $(strip $(call Package/ruby-$(1)/files))
@@ -696,58 +740,67 @@ 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,cgi,CGI support toolkit,+ruby-filelib +ruby-pstore +ruby-stringio))
+$(eval $(call RubyBuildPackage,cmath,Trigonometric and transcendental functions for complex numbers,))
+$(eval $(call RubyBuildPackage,csv,CSV Reading and Writing,+ruby-date +ruby-enc +ruby-misc +ruby-patterns +ruby-stringio))
+$(eval $(call RubyBuildPackage,date,Comparable module for handling dates,))
+$(eval $(call RubyBuildPackage,dbm,Wrapper for the UNIX-style Database Manager Library,+libdb47))
+$(eval $(call RubyBuildPackage,debuglib,debug library,+ruby-misc +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,drb,distributed object system,+ruby-filelib +ruby-ipaddr +ruby-patterns))
 $(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,erb,(embedded interpreter),+ruby-cgi +ruby-strscan))
+$(eval $(call RubyBuildPackage,etc,Access to information typically stored in UNIX /etc directory,))
+$(eval $(call RubyBuildPackage,fcntl,Loads constants defined in the OS fcntl.h C header file,))
+$(eval $(call RubyBuildPackage,fiddle,Libffi wrapper for Ruby,+libffi))
+$(eval $(call RubyBuildPackage,filelib,file utils library,+ruby-fileutils +ruby-misc))
+$(eval $(call RubyBuildPackage,fileutils,File utility methods for copying moving removing etc,+ruby-enc +ruby-etc))
+$(eval $(call RubyBuildPackage,gdbm,Ruby extension for GNU dbm,+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,ipaddr,Set of methods to manipulate an IP address,+ruby-socket))
+$(eval $(call RubyBuildPackage,irb,(interactive shell),+ruby-debuglib +ruby-filelib))
+$(eval $(call RubyBuildPackage,json,JSON Implementation for Ruby,+ruby-date +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,Network Protocols Library,+ruby-time +ruby-digest +ruby-filelib +ruby-socket +ruby-stringio +ruby-strscan +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,openssl,SSL TLS and general purpose cryptography,+ruby-enc +ruby-multithread +ruby-stringio +libopenssl))
+$(eval $(call RubyBuildPackage,optparse,command-line option analysis,+ruby-misc +ruby-time))
 $(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,powerassert,Gem power_assert,+ruby-prettyprint +ruby-ripper))
+$(eval $(call RubyBuildPackage,prettyprint,PrettyPrint library,+ruby-etc))
 $(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,psych,YAML parser and emitter,+ruby-bigdecimal +ruby-date +ruby-enc +ruby-stringio +ruby-strscan +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,rake,Rake (make replacement),+ruby-fileutils +ruby-multithread +ruby-optparse +ruby-patterns +ruby-rbconfig))
 $(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,rdoc,RDoc produces HTML and command-line documentation for Ruby projects,+ruby-debuglib +ruby-did-you-mean +ruby-erb +ruby-json +ruby-racc +ruby-rake +ruby-ripper +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,rexml,XML toolkit,+ruby-enc +ruby-misc +ruby-patterns +ruby-stringio))
 $(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,scanf,Implementation of the C function scanf(3),))
 $(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,stringio,Pseudo `IO` class from/to `String`,))
+$(eval $(call RubyBuildPackage,strscan,Lexical scanning operations on a String,))
 $(eval $(call RubyBuildPackage,testunit,Gem test-unit,+ruby-csv +ruby-erb +ruby-optparse +ruby-powerassert +ruby-rexml +ruby-yaml))
+$(eval $(call RubyBuildPackage,time,Extends Time with additional methods for parsing and converting Times,+ruby-date))
 $(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,uri,library to handle URI,+ruby-enc))
+$(eval $(call RubyBuildPackage,webrick,HTTP 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 RubyBuildPackage,zlib,compression/decompression library interface,+zlib))
 $(eval $(call BuildPackage,ruby-stdlib))
 $(eval $(call HostBuild))
index 15a64088d965254127c9691b98cb179791579657..d9acf37093c09f68b378865c3b804a114f11d7df 100644 (file)
@@ -25,7 +25,9 @@ require_regex_ignore=/^require ([a-zA-Z\$]|["']$|.*\/$)/
 require_ignore=%w{drb/invokemethod16 foo rubygems/defaults/operating_system win32console java Win32API
                   builder/xchar json/pure simplecov win32/sspi rdoc/markdown/literals_1_8 enumerator win32/resolv rbtree
                   nqxml/streamingparser nqxml/treeparser xmlscan/parser xmlscan/scanner xmltreebuilder xml/parser xmlparser xml/encoding-ja xmlencoding-ja
-                  iconv uconv win32ole gettext/po_parser gettext/mo libxml psych.jar psych_jars jar-dependencies thread minitest/proveit}
+                  iconv uconv win32ole gettext/po_parser gettext/mo libxml psych.jar psych_jars jar-dependencies thread minitest/proveit
+               bundler pry
+       }
 
 builtin_enc=[
        Encoding.find("ASCII-8BIT"),
index 25e5810ba3d33d8a3131e1e565c25d12e5420f0d..b76745d25bc5e97b2d9086062d69fcd3a1c7deb0 100644 (file)
@@ -5,21 +5,34 @@
 
 function list_staging_files {
        cd "$1"; find \
-               \( \( -name "root-*" -or -name "packages" -or -name "stamp" -or -name "pkginfo" -or -name "host" \) -prune \) -or -true \
+               \( \( -name "root-*" -or -name "packages" -or -name "stamp" -or -name "pkginfo" -or -name "host" -or -name man \) -prune \) -or -true \
                \( -path "*ruby*" -or -name "erb" -or -name "gem" -or -name "irb" -or -name "rake" -or -name "rdoc" -or -name "ri" -or -name "testrb" \) \
                -not -path "*/usr/include/*" -not -path "*/usr/lib/pkgconfig/*" -not -path "*/usr/lib/lib*.a" \
                -not -path "*/usr/lib/ruby/gems/*/cache/*" \
+               -not -path "*/usr/lib/libruby.so" \
+               -not -name "*test_case.rb" \
+               -not -name "*.rdoc" \
+               -not -name "*.doc" \
+               -not -name "*.md" \
+               -not -name "*.txt" \
+               -not -name "*.travis.yml" \
+               -not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/benchmark/.*" \
+               -not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/evaluation/.*" \
+               -not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/sample/.*" \
+               -not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/test/.*" \
+               -not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/doc/.*" \
+               -not -type d \
                -print | sort
 }
 
 function list_ipkg_files {
        for OPKG; do
-        tar --to-stdout -xzf "$OPKG" ./data.tar.gz | tar tz | sed -e 's%/$%%'
-       done | sort -u
+               tar --to-stdout -xzf "$OPKG" ./data.tar.gz | tar tzv | grep -v ^d | sed -e 's,.* \./,./,;s/ -> .*//'
+       done | sort -u | grep -v ./usr/lib/ruby/ruby...-bin
 }
 
 
-echo "                          Staging                                             Packages"
+echo "                   Installed in Staging                                             Packages"
 
 : ${1:?First arg is staging_dir}
 : ${2:?Second and following args are ruby ipkg packages}
diff --git a/lang/simplejson/Makefile b/lang/simplejson/Makefile
deleted file mode 100644 (file)
index c6d9c2b..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=simplejson
-PKG_VERSION:=3.10.0
-PKG_RELEASE:=1
-PKG_LICENSE:=MIT
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/40/ad/52c1f3a562df3b210e8f165e1aa243a178c454ead65476a39fa3ce1847b6/
-PKG_MD5SUM:=426a9631d22851a7a970b1a677368b15
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/simplejson
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-  TITLE:=Simple, fast, extensible JSON encoder/decoder for Python
-  URL:=http://simplejson.readthedocs.org/
-  DEPENDS:=+python
-endef
-
-define Package/simplejson/description
-  Simple, fast, extensible JSON encoder/decoder for Python
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-endef
-
-define Package/simplejson/install
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) \
-           $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
-           $(1)$(PYTHON_PKG_DIR)
-endef
-
-$(eval $(call BuildPackage,simplejson))
index 743670456a67231897a502f4c719e71b3d9b79d0..e0c0c9e2e964ba04b35a395ae7476b5b0ccd4ac7 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION)-src.tar.gz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=d7cbb91f1ded1919370a30edd1534304
+PKG_HASH:=9e6ed94c981c1d0c5f5fefb8112d06c6bf4d050a7327e95e71d417c416519c8d
 
 PKG_LICENSE:=TCL
 PKG_LICENSE_FILES:=license.terms
diff --git a/lang/twisted/Makefile b/lang/twisted/Makefile
deleted file mode 100644 (file)
index dc92e4d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# Copyright (C) 2006-2011, 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=twisted
-PKG_VERSION:=16.4.1
-PKG_RELEASE:=1
-
-PKG_SOURCE:=Twisted-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://pypi.python.org/packages/6b/23/8dbe86fc83215015e221fbd861a545c6ec5c9e9cd7514af114d1f64084ab \
-               http://twistedmatrix.com/Releases/Twisted/16.4
-PKG_MD5SUM:=c6d09bdd681f538369659111f079c29d
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/Twisted-$(PKG_VERSION)
-PKG_BUILD_DEPENDS:=python python-setuptools USE_MUSL:librpc
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/twisted
-  SUBMENU:=Python
-  SECTION:=lang
-  CATEGORY:=Languages
-  TITLE:=Python networking engine
-  URL:=http://twistedmatrix.com/
-  DEPENDS:=+python-light +zope-interface
-endef
-
-define Package/twisted/description
- Twisted is a networking engine written in Python, supporting numerous
- protocols. It contains a web server, numerous chat clients, chat servers,
- mail servers, and more.
-endef
-
-define PyPackage/twisted/filespec
-+|/usr/bin
--|/usr/bin/tkconch
-+|$(PYTHON_PKG_DIR)
--|$(PYTHON_PKG_DIR)/twisted/conch/scripts/tkconch.py
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,, \
-               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" --no-compile, \
-       )
-endef
-
-$(eval $(call PyPackage,twisted))
-$(eval $(call BuildPackage,twisted))
diff --git a/lang/twisted/patches/001-fix-zsh-completion.patch b/lang/twisted/patches/001-fix-zsh-completion.patch
deleted file mode 100644 (file)
index 6cb85c6..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-diff --git a/twisted/python/twisted-completion.zsh b/twisted/python/twisted-completion.zsh
-index 4d97aa5..9a8d4d8 100644
---- a/twisted/python/twisted-completion.zsh
-+++ b/twisted/python/twisted-completion.zsh
-@@ -1,4 +1,4 @@
--#compdef twistd trial conch cftp ckeygen pyhtmlizer tkconch
-+#compdef twistd trial conch cftp ckeygen pyhtmlizer
- #
- # This is the ZSH completion file for Twisted commands. It calls the current
- # command-line with the special "--_shell-completion" option which is handled
diff --git a/lang/twisted/patches/002-omit-tests.patch b/lang/twisted/patches/002-omit-tests.patch
deleted file mode 100644 (file)
index 8d545bf..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-diff --git a/setup.py b/setup.py
-index e21ef70..a4d9ee8 100755
---- a/setup.py
-+++ b/setup.py
-@@ -55,13 +55,14 @@ def main(args):
-     setup_args = STATIC_PACKAGE_METADATA.copy()
-     setup_args.update(dict(
--        packages=setuptools.find_packages(),
-+        packages=setuptools.find_packages(exclude=["*.test", "*.test.*"]),
-         install_requires=requirements,
-         conditionalExtensions=getExtensions(),
-         entry_points={
-             'console_scripts':  getConsoleScripts()
-         },
-         include_package_data=True,
-+        exclude_package_data={'':['test/*']},
-         zip_safe=False,
-         extras_require=_EXTRAS_REQUIRE,
-     ))
-diff --git a/twisted/python/dist.py b/twisted/python/dist.py
-index dfff9dc..a05b716 100644
---- a/twisted/python/dist.py
-+++ b/twisted/python/dist.py
-@@ -191,11 +191,11 @@ def getExtensions():
-     Get the C extensions used for Twisted.
-     """
-     extensions = [
--        ConditionalExtension(
--            "twisted.test.raiser",
--            ["twisted/test/raiser.c"],
--            condition=lambda _: _isCPython
--        ),
-+        #ConditionalExtension(
-+        #    "twisted.test.raiser",
-+        #    ["twisted/test/raiser.c"],
-+        #    condition=lambda _: _isCPython
-+        #),
-         ConditionalExtension(
-             "twisted.internet.iocpreactor.iocpsupport",
-             ["twisted/internet/iocpreactor/iocpsupport/iocpsupport.c",
index a093e666ca6b6ca8be72e2879776a8531b3c73a6..9d9b4deeff753653d3f95d2685a8c89ce6f33d2e 100644 (file)
@@ -12,6 +12,7 @@ PKG_VERSION:=0.2.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=142b60b266d90db6177eb07919d8b71ac4a3bb17859540d4655c02f395526962
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/Tieske/uuid.git
index f9049eee25e254602b4d9fe8db237008c8df8fa8..6337b40722eb8a292bde6da8e886876f6ebd3ef5 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=vala
-PKG_VERSION:=0.34.2
+PKG_VERSION:=0.34.5
 PKG_RELEASE:=1
 PKG_LICENSE:=LGPL-2.1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNOME/vala/0.34/
-PKG_MD5SUM:=f9b4a0a10b76b56b0b6e914c506a6828
+PKG_HASH:=3fd4ba371778bc87da42827b8d23f1f42b0629759a9a1c40c9683dfb7e73fae5
 
 PKG_BUILD_DEPENDS:=glib2 glib2/host vala/host
 HOST_BUILD_DEPENDS:=glib2/host
diff --git a/lang/zope-interface/Makefile b/lang/zope-interface/Makefile
deleted file mode 100644 (file)
index 34b5e2b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# Copyright (C) 2006-2011, 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=zope.interface
-PKG_VERSION:=4.3.2
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/38/1b/d55c39f2cf442bd9fb2c59760ed058c84b57d25c680819c25f3aff741e1f
-PKG_MD5SUM:=5f7e15a5bcdfa3c6c0e93ffe45caf87c
-
-PKG_BUILD_DEPENDS:=python python-setuptools
-
-PKG_LICENSE:=ZPL-2.1
-PKG_LICENSE_FILES:=LICENSE.txt
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/zope-interface
-  SECTION:=lang
-  CATEGORY:=Languages
-  SUBMENU:=Python
-  TITLE:=Zope interface
-  URL:=https://github.com/zopefoundation/zope.interface
-  DEPENDS:=+python-light
-endef
-
-define Package/zope-interface/description
-This package provides an implementation of "object interfaces" for
-Python. Interfaces are a mechanism for labeling objects as conforming to
-a given API or contract. So, this package can be considered as
-implementation of the Design By Contract methodology support in Python.
-endef
-
-define PyPackage/zope-interface/filespec
-+|$(PYTHON_PKG_DIR)
--|$(PYTHON_PKG_DIR)/zope/interface/common/tests
--|$(PYTHON_PKG_DIR)/zope/interface/tests
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,, \
-               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" --no-compile, \
-       )
-endef
-
-$(eval $(call PyPackage,zope-interface))
-$(eval $(call BuildPackage,zope-interface))
index a97caf008e0cfd1186cf1561be7aaadc2e39fff4..8bdb99c1814171cfb8dee3933942a7dadc989486 100644 (file)
@@ -8,13 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=alsa-lib
-PKG_VERSION:=1.1.0
+PKG_VERSION:=1.1.5
 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
+               http://distfiles.gentoo.org/distfiles/
+
+PKG_HASH:=f4f68ad3c6da36b0b5241ac3c798a7a71e0e97d51f972e9f723b3f20a9650ae6
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
                Peter Wagner <tripolar@gmx.at>
 
diff --git a/libs/alsa-lib/patches/001-link_fix.patch b/libs/alsa-lib/patches/001-link_fix.patch
deleted file mode 100644 (file)
index 001a8bc..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/src/Makefile.in
-+++ b/src/Makefile.in
-@@ -418,7 +418,7 @@ clean-libLTLIBRARIES:
-         rm -f $${locs}; \
-       }
- libasound.la: $(libasound_la_OBJECTS) $(libasound_la_DEPENDENCIES) $(EXTRA_libasound_la_DEPENDENCIES) 
--      $(AM_V_CCLD)$(libasound_la_LINK) -rpath $(libdir) $(libasound_la_OBJECTS) $(libasound_la_LIBADD) $(LIBS)
-+      $(AM_V_CCLD)$(libasound_la_LINK) -rpath $(DESTDIR)$(libdir) $(libasound_la_OBJECTS) $(libasound_la_LIBADD) $(LIBS)
- mostlyclean-compile:
-       -rm -f *.$(OBJEXT)
---- a/src/pcm/scopes/Makefile.in
-+++ b/src/pcm/scopes/Makefile.in
-@@ -348,7 +348,7 @@ clean-pkglibLTLIBRARIES:
-         rm -f $${locs}; \
-       }
- scope-level.la: $(scope_level_la_OBJECTS) $(scope_level_la_DEPENDENCIES) $(EXTRA_scope_level_la_DEPENDENCIES) 
--      $(AM_V_CCLD)$(scope_level_la_LINK) -rpath $(pkglibdir) $(scope_level_la_OBJECTS) $(scope_level_la_LIBADD) $(LIBS)
-+      $(AM_V_CCLD)$(scope_level_la_LINK) -rpath $(DESTDIR)$(pkglibdir) $(scope_level_la_OBJECTS) $(scope_level_la_LIBADD) $(LIBS)
- mostlyclean-compile:
-       -rm -f *.$(OBJEXT)
diff --git a/libs/alsa-lib/patches/005-fix_include_file_redirect_warnings.patch b/libs/alsa-lib/patches/005-fix_include_file_redirect_warnings.patch
deleted file mode 100644 (file)
index fc6c6f5..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
---- a/src/seq/seq.c
-+++ b/src/seq/seq.c
-@@ -777,7 +777,7 @@ void event_filter(snd_seq_t *seq, snd_se
- */
--#include <sys/poll.h>
-+#include <poll.h>
- #include "seq_local.h"
- /****************************************************************************
---- a/aserver/aserver.c
-+++ b/aserver/aserver.c
-@@ -20,7 +20,7 @@
- #include <sys/shm.h>
- #include <sys/socket.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <sys/un.h>
- #include <sys/uio.h>
- #include <stdio.h>
---- a/include/asoundlib-head.h
-+++ b/include/asoundlib-head.h
-@@ -35,6 +35,6 @@
- #include <string.h>
- #include <fcntl.h>
- #include <assert.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <errno.h>
- #include <stdarg.h>
---- a/include/asoundlib.h
-+++ b/include/asoundlib.h
-@@ -35,7 +35,7 @@
- #include <string.h>
- #include <fcntl.h>
- #include <assert.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <errno.h>
- #include <stdarg.h>
- #include <endian.h>
---- a/include/local.h
-+++ b/include/local.h
-@@ -47,7 +47,7 @@
- #error Header defining endianness not defined
- #endif
- #include <stdarg.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <sys/types.h>
- #include <errno.h>
- #include <linux/types.h>
---- a/src/control/control.c
-+++ b/src/control/control.c
-@@ -48,7 +48,7 @@ and IEC958 structure.
- #include <string.h>
- #include <fcntl.h>
- #include <signal.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include "control_local.h"
- /**
---- a/src/control/control_shm.c
-+++ b/src/control/control_shm.c
-@@ -27,7 +27,7 @@
- #include <fcntl.h>
- #include <sys/shm.h>
- #include <sys/socket.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <sys/un.h>
- #include <sys/uio.h>
- #include <sys/mman.h>
---- a/src/pcm/pcm.c
-+++ b/src/pcm/pcm.c
-@@ -634,7 +634,7 @@ playback devices.
- #include <stdarg.h>
- #include <signal.h>
- #include <ctype.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <sys/mman.h>
- #include <limits.h>
- #include "pcm_local.h"
---- a/src/pcm/pcm_direct.c
-+++ b/src/pcm/pcm_direct.c
-@@ -30,7 +30,7 @@
- #include <grp.h>
- #include <sys/ioctl.h>
- #include <sys/mman.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <sys/shm.h>
- #include <sys/sem.h>
- #include <sys/wait.h>
---- a/src/pcm/pcm_mmap.c
-+++ b/src/pcm/pcm_mmap.c
-@@ -21,7 +21,7 @@
- #include <stdio.h>
- #include <malloc.h>
- #include <string.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <sys/mman.h>
- #include <sys/shm.h>
- #include "pcm_local.h"
---- a/src/pcm/pcm_share.c
-+++ b/src/pcm/pcm_share.c
-@@ -34,7 +34,7 @@
- #include <signal.h>
- #include <math.h>
- #include <sys/socket.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <pthread.h>
- #include "pcm_local.h"
---- a/src/pcm/pcm_shm.c
-+++ b/src/pcm/pcm_shm.c
-@@ -36,7 +36,7 @@
- #include <sys/ioctl.h>
- #include <sys/shm.h>
- #include <sys/socket.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <sys/un.h>
- #include <sys/mman.h>
- #include <netinet/in.h>
---- a/src/shmarea.c
-+++ b/src/shmarea.c
-@@ -22,7 +22,7 @@
- #include <malloc.h>
- #include <string.h>
- #include <errno.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <sys/mman.h>
- #include <sys/shm.h>
- #include "list.h"
diff --git a/libs/alsa-lib/patches/100-link_fix.patch b/libs/alsa-lib/patches/100-link_fix.patch
new file mode 100644 (file)
index 0000000..2869dbf
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -421,7 +421,7 @@ clean-libLTLIBRARIES:
+         rm -f $${locs}; \
+       }
+ libasound.la: $(libasound_la_OBJECTS) $(libasound_la_DEPENDENCIES) $(EXTRA_libasound_la_DEPENDENCIES) 
+-      $(AM_V_CCLD)$(libasound_la_LINK) -rpath $(libdir) $(libasound_la_OBJECTS) $(libasound_la_LIBADD) $(LIBS)
++      $(AM_V_CCLD)$(libasound_la_LINK) -rpath $(DESTDIR)$(libdir) $(libasound_la_OBJECTS) $(libasound_la_LIBADD) $(LIBS)
+ mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+--- a/src/pcm/scopes/Makefile.in
++++ b/src/pcm/scopes/Makefile.in
+@@ -348,7 +348,7 @@ clean-pkglibLTLIBRARIES:
+         rm -f $${locs}; \
+       }
+ scope-level.la: $(scope_level_la_OBJECTS) $(scope_level_la_DEPENDENCIES) $(EXTRA_scope_level_la_DEPENDENCIES) 
+-      $(AM_V_CCLD)$(scope_level_la_LINK) -rpath $(pkglibdir) $(scope_level_la_OBJECTS) $(scope_level_la_LIBADD) $(LIBS)
++      $(AM_V_CCLD)$(scope_level_la_LINK) -rpath $(DESTDIR)$(pkglibdir) $(scope_level_la_OBJECTS) $(scope_level_la_LIBADD) $(LIBS)
+ mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
index 97d377c07708485d0368a946fe48ab39b4907919..e9af160d5af8b0156bc8c9888c26fd8cd9ed09b4 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=apr-util
-PKG_VERSION:=1.5.4
-PKG_RELEASE:=2
+PKG_VERSION:=1.6.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@APACHE/apr/
-PKG_MD5SUM:=2202b18f269ad606d70e1864857ed93c
+PKG_HASH:=8474c93fa74b56ac6ca87449abe3e155723d5f534727f3f33283f6631a48ca4c
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=Apache License
 
index 975447ddc5ca3c9fe1cfa19638c5cd18b468817e..9d2c076c801de517355adf5e00d5c8e7feb39796 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=apr
-PKG_VERSION:=1.5.2
-PKG_RELEASE:=2
+PKG_VERSION:=1.6.2
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@APACHE/apr/
-PKG_MD5SUM:=4e9769f3349fe11fc0a5e1b224c236aa
+PKG_HASH:=09109cea377bab0028bba19a92b5b0e89603df9eab05c0f7dbd4dd83d48dcebd
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=Apache License
 
index 71e6d62a76b3064929061d8c889f8d2517f45302..ee327f5588a422b235db31f66ede1cb633a21fe4 100644 (file)
@@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=avahi
 PKG_VERSION:=0.6.32
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/lathiat/avahi/releases/download/v$(PKG_VERSION)
-PKG_MD5SUM:=22b5e705d3eabb31d26f2e1e7b074013
+PKG_HASH:=d54991185d514a0aba54ebeb408d7575b60f5818a772e28fa0e18b98bc1db454
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
-PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm intltool/host libpthread dbus
+PKG_BUILD_DEPENDS:=intltool/host
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=autogen.sh
@@ -243,7 +243,7 @@ define Package/avahi-utils
   $(call Package/avahi/Default)
   SUBMENU:=IP Addresses and Names
   VARIANT:=dbus
-  DEPENDS:=libavahi-client +libgdbm
+  DEPENDS:=+libavahi-client +libgdbm
   TITLE+= (utilities)
 endef
 
@@ -317,8 +317,10 @@ define Build/InstallDev
        $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-* $(1)/usr/lib/
-ifeq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd)-$(BUILD_VARIANT),y-dbus)
+ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
+ifeq ($(BUILD_VARIANT),dbus)
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd* $(1)/usr/lib/
+endif
 endif
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
index 2a3ed5ed9c0721681f3c784b06aee754ed6a060f..d2aa760534b44138496169f302b72f4197136bcf 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=avro-c
-PKG_VERSION:=1.8.1
+PKG_VERSION:=1.8.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@APACHE/avro/avro-$(PKG_VERSION)/c
-PKG_MD5SUM:=b268348536714541e10411823a1b59b0
+PKG_HASH:=4639982b2b8fbd91fc7128fef672207129c959bb7900dd64b077ce4206edf10e
 
 PKG_MAINTAINER:=John Clark <inindev@gmail.com>
 
index 45e9c6282bb6db898051f461b0078784d92f64bb..d9040922d592004c511dbfbab38f8c89c8114787 100644 (file)
@@ -16,15 +16,15 @@ include $(INCLUDE_DIR)/nls.mk
 include $(INCLUDE_DIR)/target.mk 
 
 PKG_NAME:=boost
-PKG_VERSION:=1.63.0
-PKG_SOURCE_VERSION:=1_63_0
+PKG_VERSION:=1.66.0
+PKG_SOURCE_VERSION:=1_66_0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_SOURCE_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://sourceforge.net/projects/boost/files/boost/$(PKG_VERSION)
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_SOURCE_VERSION)
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)_$(PKG_SOURCE_VERSION)
-PKG_MD5SUM:=beae2529f759f6b3bf3f4969a19c2e9d6f0c503edcb2de4a61d1428519fcb3b0
+PKG_HASH:=5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9
 PKG_LICENSE:=Boost Software License <http://www.boost.org/users/license.html>
 PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com>
 
@@ -44,7 +44,7 @@ define Package/boost/Default
 endef
 
 define Package/boost/description
-This package provides the Boost v1.63 libraries.
+This package provides the Boost v1.66.0 libraries.
 Boost is a set of free, peer-reviewed, portable C++ source libraries.
 
 -----------------------------------------------------------------------------
@@ -54,8 +54,8 @@ Boost is a set of free, peer-reviewed, portable C++ source libraries.
 | compile the kernel with Full Language Support.                            |
 | Without these requirerements, the following libs will not be available:   |
 | - Boost.Locale                                                            |
-| - Boost.Coroutine2                                                        |
-| - Boost.Fiber                                                             |
+| - Boost.Coroutine2 (header-only library - requires C++11)                 |
+| - Boost.Fiber (requires C++14)                                            |
 -----------------------------------------------------------------------------
 
 This package provides the following run-time libraries:
@@ -80,15 +80,17 @@ This package provides the following run-time libraries:
  - python3
  - random
  - regex
- - serialization
+ - serialization and wserialization
  - signals
+ - stackstrace
  - system
  - thread
  - timer
+ - type_erasure
  - wave
 
 There are many more header-only libraries supported by Boost.
-See more at http://www.boost.org/doc/libs/1_63_0/
+See more at http://www.boost.org/doc/libs/1_66_0/
 endef
 
 PKG_BUILD_DEPENDS:=boost/host PACKAGE_python:python PACKAGE_python3:python3
@@ -302,10 +304,10 @@ $(eval $(call DefineBoostLibrary,context,chrono system thread,))
 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
 $(eval $(call DefineBoostLibrary,date_time,,))
 #$(eval $(call DefineBoostLibrary,exception,,))
-$(eval $(call DefineBoostLibrary,fiber,coroutine,,))
+$(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,))
 $(eval $(call DefineBoostLibrary,filesystem,system,))
 $(eval $(call DefineBoostLibrary,graph,regex,))
-$(eval $(call DefineBoostLibrary,iostreams,,+zlib))
+$(eval $(call DefineBoostLibrary,iostreams,,+zlib +liblzma +libbz2))
 $(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS),BUILD_NLS))
 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
 $(eval $(call DefineBoostLibrary,math,,))
@@ -316,10 +318,13 @@ $(eval $(call DefineBoostLibrary,python3,,,PACKAGE_python3))
 $(eval $(call DefineBoostLibrary,random,system,))
 $(eval $(call DefineBoostLibrary,regex,,))
 $(eval $(call DefineBoostLibrary,serialization,,))
+$(eval $(call DefineBoostLibrary,wserialization,serialization,))
 $(eval $(call DefineBoostLibrary,signals,,))
+$(eval $(call DefineBoostLibrary,stacktrace,,))
 $(eval $(call DefineBoostLibrary,system,,))
 $(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
 $(eval $(call DefineBoostLibrary,timer,chrono))
+$(eval $(call DefineBoostLibrary,type_erasure,chrono system thread,))
 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
 
 
@@ -333,7 +338,7 @@ TARGET_LDFLAGS += -pthread -lrt
 
 TARGET_CFLAGS += \
        $(if $(CONFIG_PACKAGE_boost-python), -I$(STAGING_DIR)/usr/include/python2.7/) \
-       $(if $(CONFIG_PACKAGE_boost-python3), -I$(STAGING_DIR)/usr/include/python3.5/) \
+       $(if $(CONFIG_PACKAGE_boost-python3), -I$(STAGING_DIR)/usr/include/python3.6/) \
        $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
 
 EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_VERSION_4_8),-std=gnu++11,-std=gnu++14)
@@ -358,11 +363,11 @@ define Build/Compile
        ( cd $(PKG_BUILD_DIR) ; \
                echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS)\" <cxxflags>\"$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > tools/build/src/user-config.jam ; \
                $(if $(CONFIG_PACKAGE_boost-python3), \
-                       echo "using python : 3.5 : $(STAGING_DIR_ROOT)/usr/bin/python3 : $(STAGING_DIR)/usr/include/python3.5/ ;" >> \
+                       echo "using python : 3.6 : : $(STAGING_DIR)/usr/include/python3.6/ : $(STAGING_DIR)/usr/lib/libpython3.6.so ;" >> \
                                tools/build/src/user-config.jam; \
                ) \
                $(if $(CONFIG_PACKAGE_boost-python), \
-                       echo "using python : 2.7 : $(STAGING_DIR_ROOT)/usr/bin/python : $(STAGING_DIR)/usr/include/python2.7/ ;" >> \
+                       echo "using python : 2.7 : : $(STAGING_DIR)/usr/include/python2.7/ : $(STAGING_DIR)/usr/lib/libpython2.7.so ;" >> \
                                tools/build/src/user-config.jam; \
                ) \
                b2 \
@@ -384,20 +389,48 @@ define Build/Compile
                        $(if $(CONFIG_boost-single-thread),threading=single,) \
                        threading=multi \
                        --without-mpi \
-                       $(if $(CONFIG_boost-coroutine2),,--without-coroutine2) \
                        $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
                        $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
                        $(foreach lib,$(BOOST_LIBS), \
                                $(if $(findstring python,$(lib)), \
-                                       $(if $(or $(CONFIG_PACKAGE_boost-python),$(CONFIG_PACKAGE_boost-python3)),,--without-python), \
-                                       $(if $(CONFIG_PACKAGE_boost-$(lib)),,--without-$(lib))) \
+                                       $(if $(CONFIG_PACKAGE_boost-python),python=2.7,--without-python), \
+                                               $(if $(CONFIG_PACKAGE_boost-$(lib)),, \
+                                                       $(if $(findstring $(lib),wserialization),,--without-$(lib)) \
+                                               ) \
+                                       ) \
                        ) \
                        $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
                                boost.locale.iconv=off) \
                        \
                        $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
                                -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
-                       install \
+                       install ;\
+                       $(if $(CONFIG_PACKAGE_boost-python3), \
+                               b2 \
+                                       $(CONFIGURE_ARGS) \
+                                       --ignore-site-config \
+                                       --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
+                                       --disable-long-double \
+                                       $(if $(CONFIG_boost-variant-release), variant=release,) \
+                                       $(if $(CONFIG_boost-variant-debug), variant=debug,) \
+                                       $(if $(CONFIG_boost-variant-profile), variant=profile,) \
+                                       $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
+                                       $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
+                                       $(if $(CONFIG_boost-shared-libs),link=shared,) \
+                                       $(if $(CONFIG_boost-static-libs),link=static,) \
+                                       $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
+                                       $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
+                                       $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
+                                       $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
+                                       $(if $(CONFIG_boost-single-thread),threading=single,) \
+                                       threading=multi \
+                                       $(foreach lib,$(BOOST_LIBS), \
+                                               $(if $(findstring python,$(lib)), \
+                                                       $(if $(CONFIG_PACKAGE_boost-python3),python=3.6,), \
+                                               ) \
+                                       ) \
+                               install ;\
+                       ,) \
        )
 endef
 
@@ -447,7 +480,7 @@ endef
 
 define BuildBoostLibrary
   define Package/boost-$(1)/install
-    $(call Package/boost/Default/install,$$(1),$(1))
+    $(call Package/boost/Default/install,$$(1),$(1)) 
   endef
 
   $$(eval $$(call BuildPackage,boost-$(1)))
diff --git a/libs/boost/patches/01_fiber_fix.patch b/libs/boost/patches/01_fiber_fix.patch
deleted file mode 100644 (file)
index 8989e0b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-Index: boost_1_63_0/libs/fiber/build/Jamfile.v2
-===================================================================
---- boost_1_63_0.orig/libs/fiber/build/Jamfile.v2
-+++ boost_1_63_0/libs/fiber/build/Jamfile.v2
-@@ -44,20 +44,6 @@ lib boost_fiber
-       recursive_timed_mutex.cpp
-       timed_mutex.cpp
-       scheduler.cpp
--    : <link>shared:<library>../../context/build//boost_context
--    [ requires cxx11_auto_declarations
--               cxx11_constexpr
--               cxx11_defaulted_functions
--               cxx11_final
--               cxx11_hdr_mutex
--               cxx11_hdr_tuple
--               cxx11_lambdas
--               cxx11_noexcept
--               cxx11_nullptr
--               cxx11_rvalue_references
--               cxx11_template_aliases
--               cxx11_thread_local
--               cxx11_variadic_templates ]
--    ;
-+    : <link>shared:<library>../../context/build//boost_context ;
- boost-install boost_fiber ;
index ec822f5e0cc4e1e090c4f0c0bc47b83744fc9b9d..a0189968172eb76b9a9e2a94125350b9f53431a3 100644 (file)
@@ -9,13 +9,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=c-ares
-PKG_VERSION:=1.11.0
+PKG_VERSION:=1.14.0
 PKG_RELEASE:=1
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://c-ares.haxx.se/download
-PKG_MD5SUM:=d5c6d522cfc54bb6f215a0b7912d46be
+PKG_SOURCE_URL:=https://c-ares.haxx.se/download
+PKG_HASH:=45d3c1fd29263ceec2afc8ff9cd06d5f8f889636eb4e80ce3cc7f0eaf7aadc6e
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
@@ -30,7 +30,7 @@ define Package/libcares
   CATEGORY:=Libraries
   TITLE:=Library for asyncronous DNS Requests (including name resolves)
   URL:=http://c-ares.haxx.se/
-  MAINTAINER:=Karl Palsson <karlp@remake.is>
+  MAINTAINER:=Karl Palsson <karlp@etactica.com>
 endef
 
 define Package/libcares/description
index eb735ee6df62cba27b8ce0ce2bb17e57722c74fe..2e0429686aeb6d609c46dc50cc1869e089b969e4 100644 (file)
@@ -8,16 +8,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=check
-PKG_VERSION:=0.9.14
-PKG_RELEASE:=2
+PKG_VERSION:=0.12.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/check
-PKG_MD5SUM:=38263d115d784c17aa3b959ce94be8b8
+PKG_SOURCE_URL:=https://github.com/libcheck/check/releases/download/$(PKG_VERSION)
+PKG_HASH:=464201098bee00e90f5c4bdfa94a5d3ead8d641f9025b560a27755a83b824234
 
 PKG_LICENSE:=LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING.LESSER
-PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+PKG_MAINTAINER:=Eduardo Abinader <eduardoabinader@gmail.com>
 
 PKG_INSTALL:=1
 
@@ -27,7 +27,7 @@ define Package/check
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE:=Unit testing framework for C
-  URL:=http://check.sourceforge.net/
+  URL:=https://libcheck.github.io/check/
   DEPENDS:= +libpthread +librt
 endef
 
index 273678e1e71eaaa431f5e48df441fe16f93ffa62..b795ec9d7d9e8b5f5c70e04f0d6cdae2601ca0cf 100644 (file)
@@ -15,7 +15,7 @@ PKG_MAINTAINER:=Dana H. Myers <k6jq@comcast.net>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/classpath
-PKG_MD5SUM:=0ae1571249172acd82488724a3b8acb4
+PKG_HASH:=f929297f8ae9b613a1a167e231566861893260651d913ad9b6c11933895fecc8
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
@@ -46,7 +46,7 @@ endef
 define Download/antlr
   URL:=http://www.antlr.org/download
   FILE:=antlr-3.4-complete.jar
-  MD5SUM:=1b91dea1c7d480b3223f7c8a9aa0e172
+  HASH:=9d3e866b610460664522520f73b81777b5626fb0a282a5952b9800b751550bf7
 endef
 $(eval $(call Download,antlr))
 
index b33bdf601e36ae14f3e21d01898ae69749be84b6..5378d612d1b3e16a35a610d3864907e6c74b0874 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=confuse
-PKG_VERSION:=2.7
+PKG_VERSION:=3.2.1
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SAVANNAH/confuse
-PKG_MD5SUM:=45932fdeeccbb9ef4228f1c1a25e9c8f
-PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/martinh/libconfuse/releases/download/v$(PKG_VERSION)
+PKG_HASH:=23c63272baf2ef4e2cbbafad2cf57de7eb81f006ec347c00b954819824add25e
+PKG_MAINTAINER:=
 PKG_LICENSE:=ISC
 
 PKG_FIXUP:=autoreconf
@@ -25,7 +25,7 @@ define Package/confuse
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE:=libConfuse is a configuration file parser library
-  URL:=http://www.nongnu.org/confuse/
+  URL:=https://github.com/martinh/libconfuse
 endef
 
 define Package/confuse/description
@@ -51,6 +51,7 @@ CONFIGURE_ARGS += \
        --disable-rpath \
        --without-libiconv-prefix \
        --without-libintl-prefix \
+       --disable-examples
 
 MAKE_FLAGS += \
        -C $(PKG_BUILD_DIR)/src \
index dfc21d2ed04007b7d2a7a4e34552e5f9777e617c..7fc174d12b8d55367bc83afd5c7fb108b969f53a 100644 (file)
@@ -15,7 +15,7 @@ PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.cyrusimap.org/cyrus-sasl/
-PKG_MD5SUM:=a7f4e5e559a0e37b3ffc438c9456e425
+PKG_HASH:=8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3
 
 PKG_LICENSE:=BSD-4c BSD
 PKG_LICENSE_FILES:=COPYING cmulocal/COPYING saslauthd/COPYING
index bf0f0b733c07541449497e34828e25b3ce78c4c0..7f642abd95a4322a535f26c5349602ac3271f8bd 100644 (file)
@@ -17,7 +17,7 @@ PKG_RELEASE:=5
 PKG_BUILD_DIR:=$(BUILD_DIR)/db-$(BASE_VERSION).NC
 PKG_SOURCE:=db-$(BASE_VERSION).NC.tar.gz
 PKG_SOURCE_URL:=http://download.oracle.com/berkeley-db/
-PKG_MD5SUM:=073ab7f20d24b3872a51ca762f5090e7
+PKG_HASH:=cd39c711023ff44c01d3c8ff0323eef7318660772b24f287556e6bf676a12535
 
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
 PKG_LICENSE:=Sleepycat
index d9e458fbe7eb0e8976fc66a786f6ce817e3ae346..8f7184067562d7da5e599b857ee1b4939b1391c7 100644 (file)
@@ -10,11 +10,11 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=dmx_usb_module
 PKG_VERSION:=0.1.20130818
-PKG_RELEASE:=0.1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=git://github.com/lowlander/dmx_usb_module.git
+PKG_SOURCE_URL:=https://github.com/lowlander/dmx_usb_module.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=ee99ca7edbd9e093480ad63341ac007394047bde
 PKG_MAINTAINER:=Martijn Zilverschoon <martijn@friedzombie.com>
diff --git a/libs/dmx_usb_module/patches/002-fix-build-4.14.patch b/libs/dmx_usb_module/patches/002-fix-build-4.14.patch
new file mode 100644 (file)
index 0000000..e3ae11e
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/dmx_usb.c
++++ b/dmx_usb.c
+@@ -20,7 +20,7 @@
+ #include <linux/module.h>
+ #include <linux/spinlock.h>
+ #include <linux/completion.h>
+-#include <asm/uaccess.h>
++#include <linux/uaccess.h>
+ #include <linux/usb.h>
+ #include <linux/version.h>
index a2d74a9168a982a9713f92c41a134d7ecce69bd2..1ac33d7c8c0e2aff8637ad0710f698babce54964 100644 (file)
@@ -11,8 +11,8 @@ PKG_NAME:=dtc
 PKG_VERSION:=1.4.2
 PKG_RELEASE:=2
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_HASH:=13456ee9840abbbcb956d0711c580d28524e2ee17840e556e744311f2d8afaac
 PKG_SOURCE_URL:=https://www.kernel.org/pub/software/utils/dtc
-PKG_SOURCE_MD5SUM:=3d5814e31b2046ef51fca8fece998db0
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=GPL
 PKG_INSTALL:=1
index be4385ce50f3cb459dadb6bf4953c7d5f3a49c46..2b79e4904a9c761d1a3047082e5f93138b1e723a 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.ibr.cs.tu-bs.de/projects/ibr-dtn/releases
-PKG_MD5SUM:=37c33910ac7e760aad4db81724aeb4fb
+PKG_HASH:=29749f6c4e1b79e6973dc7436bcc6e0aee86ce27e1786f32a60feab652af8898
 PKG_MAINTAINER:=Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
 PKG_LICENSE:=Apache-2.0
 
index 851c83a72ea94b65b31141a8f13a3b5d42b10c24..f57e02c849aa495e643c9116eb0e87c664a3a78a 100644 (file)
@@ -13,12 +13,12 @@ PKG_MAINTAINER:=Harald Geyer <harald@ccbib.org>
 
 PKG_NAME:=elektra
 PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILES:=doc/COPYING
-PKG_VERSION:=0.8.19
+PKG_LICENSE_FILES:=LICENSE.md
+PKG_VERSION:=0.8.21
 PKG_RELEASE:=1
 
 # Use this for official releasees
-PKG_MD5SUM:=6669e765c834e259fb7570f126b85d7e
+PKG_HASH:=51892570f18d1667d0da4d0908a091e41b41c20db9835765677109a3d150cd26
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://ftp.libelektra.org/ftp/elektra/releases
 
@@ -97,10 +97,11 @@ define Package/libelektra-plugins
 endef
 
 define CONTENT_ELEKTRA_PLUGINS_TEXT
-base64 boolean cachefilter ccode conditionals csvstorage
-enum filecheck glob hexcode hidden hosts iconv keytometa
-line lineendings list mathcheck network null path profile
-shell syslog uname validation
+base64 boolean cachefilter camel ccode conditionals csvstorage
+date directoryvalue enum file filecheck glob hexcode hidden
+hosts iconv ipaddr keytometa line lineendings list mathcheck
+mini network null path profile range shell syslog uname
+validation
 endef
 
 CONTENT_ELEKTRA_PLUGINS = $(strip $(CONTENT_ELEKTRA_PLUGINS_TEXT))
@@ -158,7 +159,7 @@ endef
 define Package/libelektra-curlget
   $(call Package/libelektra/Default)
   TITLE:=Elektra curlget plugin
-  DEPENDS:=+libelektra-core +libcurl
+  DEPENDS:=+libelektra-core +libcurl +libopenssl
 endef
 
 define Package/libelektra-curlget/description
@@ -180,6 +181,21 @@ This package contains support for dbus notification on configuration
 changes.
 endef
 
+define Package/libelektra-xerces
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra xerces based xml plugin
+  DEPENDS:=+libelektra-core +libstdcpp +libxerces-c
+endef
+
+define Package/libelektra-xerces/description
+$(call Package/libelektra/Default-description)
+
+The xerces plugin supplants the xmltool plugin
+and allows us to use XML files not following a specific schemata.
+Attributes are mapped to Elektra's metadata, multiple keys with the
+same names are mapped to arrays.
+endef
+
 define Package/libelektra-xml
   $(call Package/libelektra/Default)
   TITLE:=Elektra xmltool plugin
@@ -204,6 +220,19 @@ $(call Package/libelektra/Default-description)
 This package contains support for storing the key database as json files.
 endef
 
+define Package/libelektra-yamlcpp
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra yaml plugin
+  DEPENDS:=+libelektra-core +libyaml-cpp
+endef
+
+define Package/libelektra-yamlcpp/description
+$(call Package/libelektra/Default-description)
+
+This package contains support for storing the key database as yaml files.
+endef
+
+
 define Package/libelektra-python2
   $(call Package/libelektra/Default)
   TITLE:=Elektra python2 plugin
@@ -247,7 +276,7 @@ define Package/libelektra-extra
 endef
 
 define CONTENT_EXTRA_PLUGINS_TEXT
-blockresolver c constants counter desktop dpkg error
+blockresolver c constants counter desktop dini dpkg error
 fcrypt fstab logchange mozprefs passwd rename required
 simplespeclang timeofday tracer
 endef
@@ -273,7 +302,7 @@ CMAKE_OPTIONS = \
        -DKDB_DEFAULT_RESOLVER=resolver_fm_pb_b \
        -DKDB_DEFAULT_STORAGE=ini \
        -DENABLE_OPTIMIZATIONS=OFF \
-       -DPLUGINS="ALL"
+       -DPLUGINS="ALL;-multifile"
 
 CMAKE_HOST_OPTIONS = \
        -DCMAKE_SKIP_RPATH=FALSE \
@@ -293,6 +322,7 @@ define Package/libelektra-core/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra.so* $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-core.so* $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-ease.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-invoke.so* $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-kdb.so* $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-meta.so* $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-plugin.so* $(1)/usr/lib/
@@ -300,6 +330,7 @@ define Package/libelektra-core/install
        #The next is only supported with glibc, so skip it.
        #$(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektraintercept-* $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-resolver_fm_pb_b.so $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-utility.so* $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-ni.so $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-ini.so $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-sync.so $(1)/usr/lib/
@@ -353,6 +384,11 @@ define Package/libelektra-dbus/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-dbus.so $(1)/usr/lib/
 endef
 
+define Package/libelektra-xerces/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-xerces.so $(1)/usr/lib/
+endef
+
 define Package/libelektra-xml/install
        $(INSTALL_DIR) $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-xmltool.so $(1)/usr/lib/
@@ -363,6 +399,11 @@ define Package/libelektra-yajl/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-yajl.so $(1)/usr/lib/
 endef
 
+define Package/libelektra-yamlcpp/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-yamlcpp.so $(1)/usr/lib/
+endef
+
 define Package/libelektra-python2/install
        $(INSTALL_DIR) $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-python2.so $(1)/usr/lib/
@@ -401,6 +442,8 @@ $(eval $(call BuildPackage,libelektra-cpp))
 $(eval $(call BuildPackage,libelektra-curlget))
 $(eval $(call BuildPackage,libelektra-crypto))
 $(eval $(call BuildPackage,libelektra-dbus))
+$(eval $(call BuildPackage,libelektra-xerces))
+$(eval $(call BuildPackage,libelektra-yamlcpp))
 $(eval $(call BuildPackage,libelektra-xml))
 $(eval $(call BuildPackage,libelektra-yajl))
 $(eval $(call BuildPackage,libelektra-python2))
index d0658ff971e78aa5e534e1fcf62eca2bdd5cdee8..f24ace52633b354eb9a4692ee09749ca43bb6164 100644 (file)
@@ -8,7 +8,7 @@ PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
 PKG_SOURCE_URL:=https://my.balabit.com/downloads/eventlog/0.2/
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=3d6ebda8a161d36cb40d09328f78786b
+PKG_HASH:=494dac8e01dc5ce323df2ad554d94874938dab51aa025987677b2bc6906a9c66
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index 27a8e50d9f02d93a066320314df8c34c7fc0905d..9ac94b26230de9659e2bc6c53bb06b2d3cc329be 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2006-2014 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -8,19 +6,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=expat
-PKG_VERSION:=2.2.0
+PKG_VERSION:=2.2.5
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=2f47841c829facb346eb6e3fab5212e2
 PKG_SOURCE_URL:=@SF/expat
-PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
+PKG_HASH:=d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6
+PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>, \
+               Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
-PKG_REMOVE_FILES:=conftools/libtool.m4
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
@@ -32,7 +30,7 @@ define Package/libexpat
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE:=An XML parsing library
-  URL:=http://expat.sourceforge.net/
+  URL:=https://libexpat.github.io/
 endef
 
 define Package/libexpat/description
diff --git a/libs/faad2/Config.in b/libs/faad2/Config.in
deleted file mode 100644 (file)
index 0033676..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-config FAAD2_ALWAYS_USE_FLOATING_POINT
-       depends on PACKAGE_libfaad2
-       bool "Build FAAD2 to use floating-point math even if using soft floats."
-       default n
-       help
-               By default, libfaad2 will be built to use fixed point rather
-               than floating point math if emulated floating point operations
-               are being used. (See the CONFIG_SOFT_FLOAT option.) Set this
-               option if you would like to use floating point math regardless
-               of whether floating point emulation is in use.
-               
-               For the best real-time decoding ability, leave this option off.
index f6bed3d95af3afcd84f196fba0f5e46d5b8499e9..f2df769c73bce00e519d29ab1795bb679d8bbef1 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2008-2014 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -8,32 +6,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=faad2
-PKG_VERSION:=2.7
-PKG_RELEASE:=3
+PKG_VERSION:=2.8.6
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=@SF/faac
-PKG_MD5SUM:=4c332fa23febc0e4648064685a3d4332
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/faac/faad2-src/$(PKG_NAME)-2.8.0
+PKG_HASH:=654977adbf62eb81f4fca00152aca58ce3b6dd157181b9edd7bed687a7c73f21
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
-PKG_CONFIG_DEPENDS := \
-       CONFIG_SOFT_FLOAT \
-       CONFIG_FAAD2_ALWAYS_USE_FLOATING_POINT
-
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
-TARGET_CFLAGS += $(FPIC)
-
-# Use fixed point math, if we're using soft floats, and the user didn't
-# specifically ask to use floats anyways.
-ifeq ($(CONFIG_SOFT_FLOAT)-$(CONFIG_FAAD2_ALWAYS_USE_FLOATING_POINT),y-)
-TARGET_CFLAGS+= -DFIXED_POINT
-FAAD2_CONFIG_OPTS= --without-fp -nfp
-endif
-
 define Package/faad2/Default
   URL:=http://www.audiocoding.com/faad2.html
   TITLE:=Freeware Advanced Audio Decoder
@@ -63,35 +48,25 @@ $(call Package/faad2/Default)
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE+=library
-  DEPENDS:=@BUILD_PATENTED
   MENU:=1
 endef
 
-define Package/libfaad2/config
-       source "$(SOURCE)/Config.in"
-endef
-
 define Package/libfaad2/description
 $(call Package/faad2/Default/description)
   This package contains the library.
 endef
 
-define Build/Configure
-       # This replacement were do according to many comments on the web because of gcc 3.4.5 version (.6 included).-
-       # which doesn't recognices the -iquote parameter to AM_CFLAGS
-       ($(SED) 's,-iquote $$$$(top_srcdir),-I$$$$(top_srcdir),g' $(PKG_BUILD_DIR)/libfaad/Makefile.am; \
-       $(SED) 's,-iquote $$$$(top_srcdir),-I$$$$(top_srcdir),g' $(PKG_BUILD_DIR)/libfaad/Makefile.in);
-       (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
-               autoreconf -vif \
-       );
-       $(call Build/Configure/Default, \
-               --with-mp4v2 \
-               $(FAAD2_CONFIG_OPTS) \
-               --without-xmms \
-               , \
-               FAAD2_CPPFLAGS="-fno-builtin-cos -fno-builtin-sin -fno-builtin-log" \
-       )
-endef
+TARGET_CFLAGS += $(FPIC)
+CONFIGURE_ARGS+= --without-xmms
+
+ifeq ($(CONFIG_SOFT_FLOAT),y)
+       TARGET_CFLAGS+= -DFIXED_POINT
+       CONFIGURE_ARGS+= -nfp
+endif
+
+ifeq ($(CONFIG_USE_UCLIBC),y)
+       CONFIGURE_VARS+= CPPFLAGS="-fno-builtin-cos -fno-builtin-sin -fno-builtin-log"
+endif
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
index d1d404f8d1ace8a0a00c2bca0293c8e39fab9eb9..afa66dfc01c4dc2945ebc2bdae3b23ee3f1da311 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.fastcgi.com/dist/
-PKG_MD5SUM:=d15060a813b91383a9f3c66faf84867e
+PKG_HASH:=66fc45c6b36a21bf2fbbb68e90f780cc21a9da1fffbae75e76d2b4402d3f05b9
 
 PKG_FIXUP:=libtool-ucxx
 
index e6634da7fb923014556190291dda2b5642bb2b75..492b1165ab5faa1d10ae416bd526f9c7eb9b6ae0 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2015 OpenWrt.org
+# Copyright (C) 2007-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fftw3
-PKG_VERSION:=3.3.6
+PKG_VERSION:=3.3.7
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-2.0+
 
 PKG_SOURCE:=fftw-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.fftw.org
-PKG_MD5SUM:=ccd91b5b12bd0a441e100070ff09a310
+PKG_HASH:=3b609b7feba5230e8f6dd8d245ddbefac324c5a6ae4186947670d9ac2cd25573
 
 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/fftw-$(PKG_VERSION)
 PKG_FIXUP:=autoreconf
@@ -73,10 +73,12 @@ CONFIGURE_ARGS += \
        --enable-threads \
        --enable-type-prefix \
        --disable-debug \
-       --disable-fortran
+       --disable-fortran \
+       --disable-doc
 
 ifeq ($(BUILD_VARIANT), single)
 CONFIGURE_ARGS += \
+       $(if $(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),--enable-neon) \
        --enable-single
 endif
 
index a0117b57b0d10c03d8a0f50fb80c6e3456875c75..e35b98b3894b3524791d330ac571b235e95a29c2 100644 (file)
@@ -9,11 +9,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=file
 PKG_VERSION:=5.25
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/file/
-PKG_MD5SUM:=e6a972d4e10d9e76407a432f4a63cd4c
+PKG_SOURCE_URL:=https://sources.lede-project.org/ \
+       http://pkgs.fedoraproject.org/lookaside/pkgs/file/ \
+       http://download.openpkg.org/components/cache/file/ \
+       ftp://ftp.astron.com/pub/file/
+PKG_HASH:=3735381563f69fb4239470b8c51b876a80425348b8285a7cded8b61d6b890eca
 
 PKG_LICENSE:=BSD-2c
 PKG_LICENSE_FILES:=COPYING
@@ -27,7 +30,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/file/Default
   TITLE:=File type determination
   URL:=ftp://ftp.astron.com/pub/file/
-  MAINTAINER:=Luka Perkov <luka@openwrt.org>
+  MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
 endef
 
 define Package/file
@@ -90,7 +93,7 @@ endef
 
 define Package/libmagic/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
 endef
 
 $(eval $(call BuildPackage,file))
index 01d7d646e3e06b8f272d688d9ae12dd1a373325e..28e9a46218077ff64cd6830630a9f14b1294fe54 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=flac
-PKG_VERSION:=1.3.1
-PKG_RELEASE:=3
+PKG_VERSION:=1.3.2
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://downloads.xiph.org/releases/flac/
-PKG_MD5SUM:=b9922c9a0378c88d3e901b234f852698
+PKG_HASH:=91cfc3ed61dc40f47f050a109b08610667d73477af6ef36dcad31c31a4a8d53f
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_INSTALL:=1
index 72b26310e3d5ee56800c15b2c558be97bba0cc6a..7c34288c3060633625e5775d94c4f334813e10ca 100644 (file)
@@ -4,7 +4,7 @@
  
  ACLOCAL_AMFLAGS = -I m4
  
--SUBDIRS = doc include m4 man src examples test build objs
+-SUBDIRS = doc include m4 man src examples test build objs microbench
 +SUBDIRS = include m4 src build objs
  
  EXTRA_DIST = \
index f74460259caeb6597195aebd755ea6e0c91bcdae..17aaf7392e2c8f88498334bd42e6bd2682392c61 100644 (file)
@@ -2,8 +2,8 @@
 +++ b/src/Makefile.am
 @@ -27,10 +27,7 @@ endif
  SUBDIRS = \
-       share \
        libFLAC \
+       share \
 -      flac \
 -      metaflac \
        $(XMMS_DIRS) \
index 80ffff1a689e00591d5755ce303bb6c738f79bb0..ea7db8e148eaba4a9321038e788c4301e483bd41 100644 (file)
@@ -1,16 +1,15 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -348,11 +348,11 @@ fi
+@@ -386,10 +386,11 @@ fi
  
  if test "x$debug" = xtrue; then
        CPPFLAGS="-DDEBUG $CPPFLAGS"
--      CFLAGS=$(echo "$CFLAGS" | sed 's/-g//')
 -      CFLAGS="-g $CFLAGS"
 +      CFLAGS=$(echo "$CFLAGS" | sed 's/-g[0-9]*//')
 +      CFLAGS="-g3 $CFLAGS"
  else
        CPPFLAGS="-DNDEBUG $CPPFLAGS"
--      CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//;s/-g//')
+-      CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//')
 +      CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//;s/-g[0-9]*//')
        CFLAGS="-O3 -funroll-loops $CFLAGS"
  fi
diff --git a/libs/flac/patches/020-fix-musl-sigemptyset-x86.patch b/libs/flac/patches/020-fix-musl-sigemptyset-x86.patch
deleted file mode 100644 (file)
index 0ee3ce5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/libFLAC/cpu.c
-+++ b/src/libFLAC/cpu.c
-@@ -243,7 +243,7 @@ void FLAC__cpu_info(FLAC__CPUInfo *info)
-               struct sigaction sigill_save;
-               struct sigaction sigill_sse;
-               sigill_sse.sa_sigaction = sigill_handler_sse_os;
--              __sigemptyset(&sigill_sse.sa_mask);
-+              sigemptyset(&sigill_sse.sa_mask);
-               sigill_sse.sa_flags = SA_SIGINFO | SA_RESETHAND; /* SA_RESETHAND just in case our SIGILL return jump breaks, so we don't get stuck in a loop */
-               if(0 == sigaction(SIGILL, &sigill_sse, &sigill_save))
-               {
index da9d45fe9ae0f6d643b83e5813127827e24a8190..1c777a50cbcbc46f93b4be6c48b9dd03fc56c78f 100644 (file)
@@ -8,16 +8,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=freetype
-PKG_VERSION:=2.5.5
-PKG_RELEASE:=2
+PKG_VERSION:=2.9
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/freetype
-PKG_MD5SUM:=2a7a314927011d5030903179cf183be0
+PKG_HASH:=e6ffba3c8cef93f557d1f767d7bc3dee860ac7a3aaff588a521e081bc36f4c8a
 
 PKG_LICENSE:=FTL GPL-2.0 MIT ZLIB
 PKG_LICENSE_FILES:=docs/LICENSE.TXT docs/FTL.TXT docs/GPLv2.TXT src/bdf/README src/pcf/README src/gzip/zlib.h
-PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+PKG_MAINTAINER:=Val Kulkov <val.kulkov@gmail.com>
 
 PKG_FIXUP:=autoreconf
 PKG_LIBTOOL_PATHS:=builds/unix
@@ -30,7 +30,7 @@ define Package/libfreetype
   CATEGORY:=Libraries
   TITLE:=A free, high-quality and portable font engine
   URL:=http://www.freetype.org/
-  DEPENDS:=+zlib +libbz2
+  DEPENDS:=+zlib +libbz2 +libpng
 endef
 
 define Package/libfreetype/description
@@ -47,13 +47,15 @@ CONFIGURE_ARGS += \
        --enable-static \
        --with-bzip2=yes \
        --with-zlib=yes \
-       --with-png=no \
+       --with-png=yes
 
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
 endef
 
 define Build/InstallDev
+       $(INSTALL_DIR) $(1)/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/freetype-config $(1)/bin/
        $(INSTALL_DIR) $(2)/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/freetype-config $(2)/bin/
        $(INSTALL_DIR) $(1)/usr/include
@@ -63,11 +65,6 @@ define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/freetype2.pc $(1)/usr/lib/pkgconfig/
 
-       $(SED) \
-               's,^\(prefix\|exec_prefix\)=.*,\1="$(STAGING_DIR)/usr",; \
-                s,^\(includedir\)=.*,\1="$(STAGING_DIR)/usr/include",; \
-                s,^\(libdir\)=.*,\1="$(STAGING_DIR)/usr/lib",' \
-                $(2)/bin/freetype-config
        $(SED) \
                's,/usr/include,$$$${prefix}/include,g; \
                 s,/usr/lib,$$$${exec_prefix}/lib,g' \
index a8d1926c55331b078680a75a33f06479d404fe7e..dac4d5e8d4222fa8c53d29510cb796d5c7203186 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/gdbm
-PKG_MD5SUM:=72c832680cf0999caedbe5b265c8c1bd
+PKG_HASH:=8d912f44f05d0b15a4a5d96a76f852e905d051bb88022fcdfd98b43be093e3c3
 
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
diff --git a/libs/getdns/Config.in b/libs/getdns/Config.in
new file mode 100644 (file)
index 0000000..c1246a3
--- /dev/null
@@ -0,0 +1,16 @@
+menu "Configuration"
+       depends on PACKAGE_getdns
+
+config GETDNS_ENABLE_STUB_ONLY
+       bool "GETDNS_ENABLE_STUB_ONLY"
+       help
+               getdns can be configured for stub resolution mode only. (Removes libunbound dependency)
+       default y
+       
+config GETDNS_ENABLE_IDN_LIBIDN
+       bool "GETDNS_ENABLE_IDN_LIBIDN"
+       help 
+               getdns can be configured with some IDN Support. (Requires libidn dependency)
+       default n
+
+endmenu
diff --git a/libs/getdns/Makefile b/libs/getdns/Makefile
new file mode 100644 (file)
index 0000000..74027fd
--- /dev/null
@@ -0,0 +1,75 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=getdns
+PKG_VERSION:=1.4.1
+PKG_RELEASE:=1
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=David Mora <iamperson347+public@gmail.com>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://getdnsapi.net/dist/
+PKG_HASH:=245233dc780f615b6ab1472f2b9cdcd957a451a736f3036717d0da466ab1c51e
+
+PKG_FIXUP:=autoreconf
+
+PKG_INSTALL:=1
+
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_GETDNS_ENABLE_STUB_ONLY \
+       CONFIG_GETDNS_ENABLE_IDN_LIBIDN 
+       
+include $(INCLUDE_DIR)/package.mk
+
+define Package/getdns/Default
+       TITLE:=getdns
+       URL:=https://getdnsapi.net/
+endef
+
+define Package/getdns
+       $(call Package/getdns/Default)
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE+= (library)
+       DEPENDS+= +libopenssl +!GETDNS_ENABLE_STUB_ONLY:libunbound +GETDNS_ENABLE_IDN_LIBIDN:libidn
+       MENU:=1
+endef
+
+define Package/getdns/description
+       This package contains the getdns library (libgetdns). 
+       This package also contains the "getdns_query" command line wrapper for getdns exposing the features of this implementation (both in the official API and the additional API functions).
+endef
+
+define Package/getdns/config
+       source "$(SOURCE)/Config.in"
+endef
+
+CONFIGURE_ARGS += \
+               $(if $(CONFIG_GETDNS_ENABLE_STUB_ONLY), --enable-stub-only, ) \
+               $(if $(CONFIG_GETDNS_ENABLE_IDN_LIBIDN), , --without-libidn ) \
+               --without-libidn2 \
+               --with-ssl="$(STAGING_DIR)/usr" \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/getdns/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/getdns/getdns*.h $(1)/usr/include/getdns/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgetdns*.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/getdns*.pc $(1)/usr/lib/pkgconfig/
+endef
+       
+       
+define Package/getdns/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libgetdns.so.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/sbin    
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getdns_query $(1)/usr/sbin/getdns_query
+endef
+
+$(eval $(call BuildPackage,getdns))
index 28fcd69eeba26d47983d6f8efb74235f6f86c9dd..4e0f7759c4cc0c3a66e7d976e6e3434ecdfab95a 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/giflib
-PKG_MD5SUM:=323a9f11ab56c8a2d1715376410ce376
+PKG_HASH:=76c0a084c3b02f9315ff937b8be6096186002fea26f33e2123081ba2be6e2a7c
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
@@ -23,6 +23,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=autogen.sh aclocal.m4
 
+include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
 
 define Package/giflib
@@ -57,4 +58,5 @@ define Package/giflib/install
        $(CP) $(PKG_BUILD_DIR)/lib/.libs/lib*so* $(1)/usr/lib/
 endef
 
+$(eval $(call HostBuild))
 $(eval $(call BuildPackage,giflib))
index dce64f9606da857f0a430fca50c3cd844d44c69f..9ec8c9d3c44794af13aa3acdd012d8cb2e9e4cbd 100644 (file)
@@ -8,17 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=glib2
-PKG_VERSION:=2.50.2
-PKG_RELEASE:=2
+PKG_VERSION:=2.56.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
-PKG_SOURCE_URL:=@GNOME/glib/2.50
-PKG_MD5SUM:=5eeb2bfaf78a07be59585e8b6e80b1d6
+PKG_SOURCE_URL:=@GNOME/glib/2.56
+PKG_HASH:=ecef6e17e97b8d9150d0e8a4b3edee1ac37331213b8a2a87a083deea408a0fc7
 
 PKG_BUILD_PARALLEL:=1
 HOST_BUILD_PARALLEL:=1
-PKG_BUILD_DEPENDS:=glib2/host libpthread zlib libintl libffi
+PKG_BUILD_DEPENDS:=glib2/host gettext
 HOST_BUILD_DEPENDS:=gettext-full/host libiconv/host libffi/host
 PKG_INSTALL:=1
 PKG_USE_MIPS16:=0
index 05c28ca157e74613fa9436e9cf020558251c3f5e..0b510675a42870935e8d7d89725b089f5341f87e 100644 (file)
@@ -1,6 +1,6 @@
 --- a/gtk-doc.make
 +++ b/gtk-doc.make
-@@ -282,7 +282,7 @@ uninstall-local:
+@@ -298,7 +298,7 @@ uninstall-local:
  #
  # Require gtk-doc when making dist
  #
diff --git a/libs/glib2/patches/002-gdate-Suppress-string-format-literal-warning.patch b/libs/glib2/patches/002-gdate-Suppress-string-format-literal-warning.patch
deleted file mode 100644 (file)
index 01769cb..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From 0817af40e8c74c721c30f6ef482b1f53d12044c7 Mon Sep 17 00:00:00 2001
-From: coypu <coypu@sdf.org>
-Date: Mon, 8 Feb 2016 00:06:06 +0200
-Subject: gdate: Suppress string format literal warning
-
-Newer versions of GCC emit an error here, but we know it's safe.
-https://bugzilla.gnome.org/761550
----
- glib/gdate.c | 3 +++
- 1 file changed, 3 insertions(+)
-
---- a/glib/gdate.c
-+++ b/glib/gdate.c
-@@ -2497,7 +2497,10 @@ g_date_strftime (gchar       *s,
-        * recognize whether strftime actually failed or just returned "".
-        */
-       tmpbuf[0] = '\1';
-+      #pragma GCC diagnostic push
-+      #pragma GCC diagnostic ignored "-Wformat-nonliteral"
-       tmplen = strftime (tmpbuf, tmpbufsize, locale_format, &tm);
-+      #pragma GCC diagnostic pop
-       if (tmplen == 0 && tmpbuf[0] != '\0')
-         {
index 0c76435711d621b2bb4ec744368b46746eee9b99..d4531357c1d29366eb98f06de3ce3d2248611aec 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=glpk
-PKG_VERSION:=4.60
+PKG_VERSION:=4.63
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=eda7965907f6919ffc69801646f13c3e
+PKG_HASH:=914d27f1a51c2bf4a51f1bd4a507f875fcca99db7b219380b836a25b29b3e7f6
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
index aba32559efa1c537fbf39acce131ca04bcba85ca..b5bbd157c16f1c717a9ac002df41b56ad120a9e5 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnutls
-PKG_VERSION:=3.5.11
+PKG_VERSION:=3.5.16
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5
-PKG_HASH:=51765cc5579e250da77fbd7871507c517d01b15353cc40af7b67e9ec7b6fe28f
+PKG_SOURCE_URL:=https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5
+PKG_HASH:=0924dec90c37c05f49fec966eba3672dab4d336d879e5c06e06e13325cbfec25
 #PKG_FIXUP:=autoreconf gettext-version
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
 PKG_LICENSE:=LGPLv2.1+
index 4cdd470f37d18e3cc13ab4b059635427595589ea..5035895c48cdc7a3477b0df3367fb02040ad2ed6 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,9 +8,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gperf
-PKG_VERSION:=3.0.4
+PKG_VERSION:=3.1
 PKG_RELEASE:=1
-PKG_MD5SUM:=c1f1db32fb6598d6a93e6e88796a8632
+PKG_HASH:=588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/gperf
diff --git a/libs/gperf/patches/100-include_own_first.patch b/libs/gperf/patches/100-include_own_first.patch
new file mode 100644 (file)
index 0000000..6936f35
--- /dev/null
@@ -0,0 +1,26 @@
+diff --git a/lib/Makefile.in b/lib/Makefile.in
+index 29bbf92..cf2bf3c 100644
+--- a/lib/Makefile.in
++++ b/lib/Makefile.in
+@@ -61,7 +61,7 @@ SHELL = /bin/sh
+ VPATH = $(srcdir)
+ OBJECTS  = getopt.$(OBJEXT) getopt1.$(OBJEXT) getline.$(OBJEXT) hash.$(OBJEXT)
+-CPPFLAGS = @CPPFLAGS@ -I$(srcdir)
++CPPFLAGS = -I$(srcdir) @CPPFLAGS@
+ TARGETLIB = libgp.a
+diff --git a/src/Makefile.in b/src/Makefile.in
+index 6866ffd..bd4df14 100644
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -64,7 +64,7 @@ VPATH = $(srcdir)
+ OBJECTS  = version.$(OBJEXT) positions.$(OBJEXT) options.$(OBJEXT) keyword.$(OBJEXT) keyword-list.$(OBJEXT) \
+            input.$(OBJEXT) bool-array.$(OBJEXT) hash-table.$(OBJEXT) search.$(OBJEXT) output.$(OBJEXT) main.$(OBJEXT)
+ LIBS     = ../lib/libgp.a @GPERF_LIBM@
+-CPPFLAGS = @CPPFLAGS@ -I. -I$(srcdir)/../lib
++CPPFLAGS = -I. -I$(srcdir)/../lib @CPPFLAGS@
+ TARGETPROG = gperf$(EXEEXT)
index e8ef7335941a5236417ff8706aad0a72826c6fab..87249a2968dc3b319599f2b60ab64385f1706059 100644 (file)
@@ -16,6 +16,7 @@ PKG_SOURCE_URL:=https://github.com/signal11/hidapi.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=hidapi-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=95b39035f94c35b0c360ec2e02a01fe25e971490135d7137f163974d4a88471f
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE-bsd.txt
 
index 16d9333bac2187af68806a29450eb127cb57b3f7..1f0aa016bfe5e58a9e264ac4c22cc4f4da990b44 100644 (file)
@@ -16,6 +16,7 @@ PKG_SOURCE_URL:=https://github.com/redis/hiredis.git
 PKG_SOURCE_VERSION:=010756025e8cefd1bc66c6d4ed3b1648ef6f1f95
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=ac774e318215cbfad4b8e493a84b4fe9a03f9882828ea01eac5357f28b5e9cd4
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING
diff --git a/libs/hiredis/patches/001-lvalue_fix.patch b/libs/hiredis/patches/001-lvalue_fix.patch
new file mode 100644 (file)
index 0000000..bf29f50
--- /dev/null
@@ -0,0 +1,13 @@
+Index: hiredis-0.13.3/hiredis.h
+===================================================================
+--- hiredis-0.13.3.orig/hiredis.h
++++ hiredis-0.13.3/hiredis.h
+@@ -98,7 +98,7 @@
+          * then GNU strerror_r returned an internal static buffer and we       \
+          * need to copy the result into our private buffer. */                 \
+         if (err_str != (buf)) {                                                \
+-            buf[(len)] = '\0';                                                 \
++            (buf)[(len)] = '\0';                                               \
+             strncat((buf), err_str, ((len) - 1));                              \
+         }                                                                      \
+     } while (0)
index a37ddf5ec77ff218ce64b50cbe13fdc0635337e8..54fb7a6a52837f6433e9ecbde66b04d84cfdaf0d 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.ibr.cs.tu-bs.de/projects/ibr-dtn/releases
-PKG_MD5SUM:=0104763ede969c470f32244d76c234b8
+PKG_HASH:=9c457c1ebc01e6216524636628c647bef34ab11bd96f0e0788be8749374fdc20
 PKG_MAINTAINER:=Johannes Morgenroth <jm@m-network.de>
 PKG_LICENSE:=Apache-2.0
 
index 45051ad3773f35054ddadd0d0823344b77fc4647..a510c78619919a241455fe3ed4db62659f806c30 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.ibr.cs.tu-bs.de/projects/ibr-dtn/releases
-PKG_MD5SUM:=37208be202f199f1790983ff78b2fa8f
+PKG_HASH:=288b14ccbaefb5e3234065c2778c247797ccb3c7afbb6746bb37dc12c620d360
 PKG_MAINTAINER:=Johannes Morgenroth <jm@m-network.de>
 PKG_LICENSE:=Apache-2.0
 
index ecf261e03f81cf594a64195a52583d8ad79f8ecf..02b0f2e4891852ad37761fac8924154464704937 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=icu4c
-PKG_VERSION:=58.2
-PKG_RELEASE:=2
+PKG_VERSION:=60.2
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-58_2-src.tgz
+PKG_SOURCE:=$(PKG_NAME)-60_2-src.tgz
 PKG_SOURCE_URL:=http://download.icu-project.org/files/$(PKG_NAME)/$(PKG_VERSION)
-PKG_MD5SUM:=fac212b32b7ec7ab007a12dff1f3aea1
+PKG_HASH:=f073ea8f35b926d70bb33e6577508aa642a8b316a803f11be20af384811db418
 
 PKG_LICENSE:=ICU-1.8.1+
 PKG_LICENSE_FILES:=LICENSE
@@ -41,9 +41,13 @@ define Package/icu
 endef
 
 CONFIGURE_CMD:= ./runConfigureICU
-CONFIGURE_VARS:=
 CONFIGURE_ARGS:= \
        Linux/gcc \
+       CC="$(TARGET_CC)" \
+       CXX="$(TARGET_CXX)" \
+       --target=$(GNU_TARGET_NAME) \
+       --host=$(GNU_TARGET_NAME) \
+       --build=$(GNU_HOST_NAME) \
        --disable-debug \
        --enable-release \
        --enable-shared \
@@ -56,7 +60,7 @@ CONFIGURE_ARGS:= \
        --disable-tools \
        --disable-tests \
        --disable-samples \
-       --with-cross-build="$(HOST_BUILD_DIR)" \
+       --with-cross-build="$(STAGING_DIR_HOSTPKG)/share/icu/$(PKG_VERSION)" \
        --prefix=/usr
 
 HOST_CONFIGURE_CMD:= ./runConfigureICU
@@ -72,34 +76,33 @@ HOST_CONFIGURE_ARGS:= \
        --disable-tracing \
        --disable-extras \
        --enable-dyload \
-       --prefix=$(HOST_BUILD_PREFIX)
+       --prefix=$(STAGING_DIR_HOSTPKG)
 
 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/
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_DIR) $(2)/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/icu-config $(1)/usr/bin/
+       $(SED) 's,^\(prefix\|execprefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(1)/usr/bin/icu-config
+       $(LN) $(STAGING_DIR)/usr/bin/icu-config $(2)/bin/
 endef
 
-define Host/install
+define Host/Install
+       $(INSTALL_DIR)  $(STAGING_DIR_HOSTPKG)/share/icu/$(PKG_VERSION)/config
+       $(INSTALL_DIR)  $(STAGING_DIR_HOSTPKG)/share/icu/$(PKG_VERSION)/bin
+       $(INSTALL_DIR)  $(STAGING_DIR_HOSTPKG)/share/icu/$(PKG_VERSION)/lib
+       $(INSTALL_DATA) $(HOST_BUILD_DIR)/config/icucross.* $(STAGING_DIR_HOSTPKG)/share/icu/$(PKG_VERSION)/config/
+       $(INSTALL_BIN)  $(HOST_BUILD_DIR)/bin/icupkg $(STAGING_DIR_HOSTPKG)/share/icu/$(PKG_VERSION)/bin/
+       $(INSTALL_BIN)  $(HOST_BUILD_DIR)/bin/pkgdata $(STAGING_DIR_HOSTPKG)/share/icu/$(PKG_VERSION)/bin/
+       $(CP)           $(HOST_BUILD_DIR)/lib/*.so* $(STAGING_DIR_HOSTPKG)/share/icu/$(PKG_VERSION)/lib/
 endef
 
 define Package/icu/install
-       $(INSTALL_DIR) \
-               $(1)/usr/lib
-
-       $(CP) \
-               $(PKG_INSTALL_DIR)/usr/lib/*.so.* \
-               $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
 endef
 
 $(eval $(call BuildPackage,icu))
index 8b8cb7bc05d1ad702960fd92168eec3b0c4be3bf..cada77ff23eb5c9506f746af82e836926c370d41 100644 (file)
@@ -2,7 +2,7 @@ diff --git a/Makefile.in b/Makefile.in
 index 9db6c52..6aa2273 100644
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -180,7 +180,6 @@ install-icu: $(INSTALLED_BUILT_FILES)
+@@ -186,7 +186,6 @@ install-icu: $(INSTALLED_BUILT_FILES)
        $(INSTALL_SCRIPT) $(top_srcdir)/install-sh $(DESTDIR)$(pkgdatadir)/install-sh
        @$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig
        $(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/
diff --git a/libs/icu/patches/001-disable-strtod_l.patch b/libs/icu/patches/001-disable-strtod_l.patch
deleted file mode 100644 (file)
index b84d14f..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -893,8 +893,8 @@
- AC_CHECK_FUNC(strtod_l)
- if test x$ac_cv_func_strtod_l = xyes
- then
--     CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=1"
--     U_HAVE_STRTOD_L=1
-+     CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=0"
-+     U_HAVE_STRTOD_L=0
- else
-      CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=0"
-      U_HAVE_STRTOD_L=0
---- a/configure
-+++ b/configure
-@@ -7053,8 +7053,8 @@
- if test x$ac_cv_func_strtod_l = xyes
- then
--     CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=1"
--     U_HAVE_STRTOD_L=1
-+     CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=0"
-+     U_HAVE_STRTOD_L=0
- else
-      CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=0"
-      U_HAVE_STRTOD_L=0
diff --git a/libs/icu/patches/002-Disable-LDFLAGSICUDT-for-Linux.patch b/libs/icu/patches/002-Disable-LDFLAGSICUDT-for-Linux.patch
new file mode 100644 (file)
index 0000000..bdab3f9
--- /dev/null
@@ -0,0 +1,28 @@
+From 0c82d6aa02c08e41b13c83b14782bd7024e25d59 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 15 Feb 2014 21:06:42 +0000
+Subject: [PATCH] Disable LDFLAGSICUDT for Linux
+
+Upstream-Status: Inappropriate [ OE Configuration ]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ source/config/mh-linux |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config/mh-linux b/config/mh-linux
+index 366f0cc..2689aab 100644
+--- a/config/mh-linux
++++ b/config/mh-linux
+@@ -23,7 +23,7 @@ LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
+ LD_RPATH_PRE = -Wl,-rpath,
+ ## These are the library specific LDFLAGS
+-LDFLAGSICUDT=-nodefaultlibs -nostdlib
++# LDFLAGSICUDT=-nodefaultlibs -nostdlib
+ ## Compiler switch to embed a library name
+ # The initial tab in the next line is to prevent icu-config from reading it.
+-- 
+1.7.10.4
+
diff --git a/libs/icu/patches/CVE-2017-7867_CVE-2017-7868.patch b/libs/icu/patches/CVE-2017-7867_CVE-2017-7868.patch
deleted file mode 100644 (file)
index accba5f..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-Index: source/test/intltest/utxttest.h
-===================================================================
---- source/test/intltest/utxttest.h    (revision 39670)
-+++ source/test/intltest/utxttest.h    (revision 39671)
-@@ -38,6 +38,7 @@
-     void Ticket10562();
-     void Ticket10983();
-     void Ticket12130();
-+    void Ticket12888();
- private:
-     struct m {                              // Map between native indices & code points.
-Index: source/test/intltest/utxttest.cpp
-===================================================================
---- source/test/intltest/utxttest.cpp  (revision 39670)
-+++ source/test/intltest/utxttest.cpp  (revision 39671)
-@@ -67,6 +67,8 @@
-             if (exec) Ticket10983();  break;
-         case 7: name = "Ticket12130";
-             if (exec) Ticket12130(); break;
-+        case 8: name = "Ticket12888";
-+            if (exec) Ticket12888(); break;
-         default: name = "";          break;
-     }
- }
-@@ -1583,3 +1585,63 @@
-     }
-     utext_close(&ut);
- }
-+
-+// Ticket 12888: bad handling of illegal utf-8 containing many instances of the archaic, now illegal,
-+//               six byte utf-8 forms. Original implementation had an assumption that
-+//               there would be at most three utf-8 bytes per UTF-16 code unit.
-+//               The five and six byte sequences map to a single replacement character.
-+
-+void UTextTest::Ticket12888() {
-+    const char *badString = 
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
-+            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80";
-+
-+    UErrorCode status = U_ZERO_ERROR;
-+    LocalUTextPointer ut(utext_openUTF8(NULL, badString, -1, &status));
-+    TEST_SUCCESS(status);
-+    for (;;) {
-+        UChar32 c = utext_next32(ut.getAlias());
-+        if (c == U_SENTINEL) {
-+            break;
-+        }
-+    }
-+    int32_t endIdx = utext_getNativeIndex(ut.getAlias());
-+    if (endIdx != (int32_t)strlen(badString)) {
-+        errln("%s:%d expected=%d, actual=%d", __FILE__, __LINE__, strlen(badString), endIdx);
-+        return;
-+    }
-+
-+    for (int32_t prevIndex = endIdx; prevIndex>0;) {
-+        UChar32 c = utext_previous32(ut.getAlias());
-+        int32_t currentIndex = utext_getNativeIndex(ut.getAlias());
-+        if (c != 0xfffd) {
-+            errln("%s:%d (expected, actual, index) = (%d, %d, %d)\n",
-+                    __FILE__, __LINE__, 0xfffd, c, currentIndex);
-+            break;
-+        }
-+        if (currentIndex != prevIndex - 6) {
-+            errln("%s:%d: wrong index. Expected, actual = %d, %d",
-+                    __FILE__, __LINE__, prevIndex - 6, currentIndex);
-+            break;
-+        }
-+        prevIndex = currentIndex;
-+    }
-+}
-Index: source/common/utext.cpp
-===================================================================
---- source/common/utext.cpp    (revision 39670)
-+++ source/common/utext.cpp    (revision 39671)
-@@ -847,9 +847,15 @@
- //------------------------------------------------------------------------------
- // Chunk size.
--//     Must be less than 85, because of byte mapping from UChar indexes to native indexes.
--//     Worst case is three native bytes to one UChar.  (Supplemenaries are 4 native bytes
--//     to two UChars.)
-+//     Must be less than 42  (256/6), because of byte mapping from UChar indexes to native indexes.
-+//     Worst case there are six UTF-8 bytes per UChar.
-+//         obsolete 6 byte form fd + 5 trails maps to fffd
-+//         obsolete 5 byte form fc + 4 trails maps to fffd
-+//         non-shortest 4 byte forms maps to fffd
-+//         normal supplementaries map to a pair of utf-16, two utf8 bytes per utf-16 unit
-+//     mapToUChars array size must allow for the worst case, 6.
-+//     This could be brought down to 4, by treating fd and fc as pure illegal,
-+//     rather than obsolete lead bytes. But that is not compatible with the utf-8 access macros.
- //
- enum { UTF8_TEXT_CHUNK_SIZE=32 };
-@@ -889,7 +895,7 @@
-                                                      //  Requires two extra slots,
-                                                      //    one for a supplementary starting in the last normal position,
-                                                      //    and one for an entry for the buffer limit position.
--    uint8_t   mapToUChars[UTF8_TEXT_CHUNK_SIZE*3+6]; // Map native offset from bufNativeStart to
-+    uint8_t   mapToUChars[UTF8_TEXT_CHUNK_SIZE*6+6]; // Map native offset from bufNativeStart to
-                                                      //   correspoding offset in filled part of buf.
-     int32_t   align;
- };
-@@ -1032,6 +1038,7 @@
-             // Requested index is in this buffer.
-             u8b = (UTF8Buf *)ut->p;   // the current buffer
-             mapIndex = ix - u8b->toUCharsMapStart;
-+            U_ASSERT(mapIndex < (int32_t)sizeof(UTF8Buf::mapToUChars));
-             ut->chunkOffset = u8b->mapToUChars[mapIndex] - u8b->bufStartIdx;
-             return TRUE;
-@@ -1298,6 +1305,10 @@
-         // Can only do this if the incoming index is somewhere in the interior of the string.
-         //   If index is at the end, there is no character there to look at.
-         if (ix != ut->b) {
-+            // Note: this function will only move the index back if it is on a trail byte
-+            //       and there is a preceding lead byte and the sequence from the lead 
-+            //       through this trail could be part of a valid UTF-8 sequence
-+            //       Otherwise the index remains unchanged.
-             U8_SET_CP_START(s8, 0, ix);
-         }
-@@ -1311,7 +1322,10 @@
-         UChar   *buf = u8b->buf;
-         uint8_t *mapToNative = u8b->mapToNative;
-         uint8_t *mapToUChars = u8b->mapToUChars;
--        int32_t  toUCharsMapStart = ix - (UTF8_TEXT_CHUNK_SIZE*3 + 1);
-+        int32_t  toUCharsMapStart = ix - sizeof(UTF8Buf::mapToUChars) + 1;
-+        // Note that toUCharsMapStart can be negative. Happens when the remaining
-+        // text from current position to the beginning is less than the buffer size.
-+        // + 1 because mapToUChars must have a slot at the end for the bufNativeLimit entry.
-         int32_t  destIx = UTF8_TEXT_CHUNK_SIZE+2;   // Start in the overflow region
-                                                     //   at end of buffer to leave room
-                                                     //   for a surrogate pair at the
-@@ -1338,6 +1352,7 @@
-             if (c<0x80) {
-                 // Special case ASCII range for speed.
-                 buf[destIx] = (UChar)c;
-+                U_ASSERT(toUCharsMapStart <= srcIx);
-                 mapToUChars[srcIx - toUCharsMapStart] = (uint8_t)destIx;
-                 mapToNative[destIx] = (uint8_t)(srcIx - toUCharsMapStart);
-             } else {
-@@ -1367,6 +1382,7 @@
-                 do {
-                     mapToUChars[sIx-- - toUCharsMapStart] = (uint8_t)destIx;
-                 } while (sIx >= srcIx);
-+                U_ASSERT(toUCharsMapStart <= (srcIx+1));
-                 // Set native indexing limit to be the current position.
-                 //   We are processing a non-ascii, non-native-indexing char now;
-@@ -1541,6 +1557,7 @@
-     U_ASSERT(index>=ut->chunkNativeStart+ut->nativeIndexingLimit);
-     U_ASSERT(index<=ut->chunkNativeLimit);
-     int32_t mapIndex = index - u8b->toUCharsMapStart;
-+    U_ASSERT(mapIndex < (int32_t)sizeof(UTF8Buf::mapToUChars));
-     int32_t offset = u8b->mapToUChars[mapIndex] - u8b->bufStartIdx;
-     U_ASSERT(offset>=0 && offset<=ut->chunkLength);
-     return offset;
index a84ea94772b10ce0ce977f157c66d0e03c22b053..cebae5370ca277bc8ef58a6e69b069edda6c5cd3 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@GNOME/intltool/$(PKG_LIBVER)
-PKG_MD5SUM:=69bc0353323112f42ad4f9cf351bc3e5
+PKG_HASH:=4d1e5f8561f09c958e303d4faa885079a5e173a61d28437d0013ff5efc9e3b64
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_HOST_ONLY:=1
index 3d18d426a6513b38fd84536613f2b76d08eb215c..fdc013fcf828100414a6fd96541692c7fc19a47c 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2011-2014 OpenWrt.org
+# Copyright (C) 2011-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=jansson
-PKG_VERSION:=2.7
+PKG_VERSION:=2.10
 PKG_RELEASE:=1
 PKG_LICENSE:=MIT
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.digip.org/jansson/releases/
-PKG_MD5SUM:=3a106a465bbb77637550b422f5b262ef
+PKG_HASH:=241125a55f739cd713808c4e0089986b8c3da746da8b384952912ad659fa2f5a
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
index 8c6b44dc111e65ca6bdcc35b403c659097655f46..8d78f2cf28a71b511b2d6c4be0959d669a9969c0 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.nlnetlabs.nl/downloads/ldns
-PKG_MD5SUM:=a79423bcc4129e6d59b616b1cae11e5e
+PKG_HASH:=8b88e059452118e8949a2752a55ce59bc71fa5bc414103e17f5b6b06f9bcc8cd
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
index dbcb59f7fe064943d78c5c963e1425cd751508a9..349dcda70bb06095d34c272b8b77744dd33feb62 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/liba/libaio/
-PKG_MD5SUM:=2a35602e43778383e2f4907a4ca39ab8
+PKG_HASH:=e019028e631725729376250e32b473012f7cb68e1f7275bfc1bbcdd0f8745f7e
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
 PKG_LICENSE:=LGPL-2.1
 
index bd1e51e0423608f21fc7ae39ff3173c278ac8952..5c2d7cf68bd1daaf0b631632f29fbede3eb34b7c 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=libantlr3c
 PKG_VERSION:=3.2
 PKG_RELEASE:=1
-PKG_MD5SUM:=674646e1d1bf5c6015435480cead725a
+PKG_HASH:=2ccfb8a8bdd3d6c1d60742ff3a5a954af6d5a8d7f8901c87229fc6fa540ac99a
 
 PKG_SOURCE_URL:=http://www.antlr3.org/download/C
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
index 690af47ab98a87aabcfc2ec286353b1097e909f7..69a7f3974a514dfb9e50776ace7cd51c4a16eec3 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://downloads.xiph.org/releases/ao/
-PKG_MD5SUM:=9f5dd20d7e95fd0dd72df5353829f097
+PKG_HASH:=03ad231ad1f9d64b52474392d63c31197b0bc7bd416e58b1c10a329a5ed89caf
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
index b1a69e206ea760064d36dc4b70964b48a3b81e64..090af68e89c46d720dc5052ca04d71f01c7b0d9a 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libarchive
-PKG_VERSION:=3.2.2
+PKG_VERSION:=3.3.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.libarchive.org/downloads
-PKG_MD5SUM:=691c194ee132d1f0f7a42541f091db811bc2e56f7107e9121be2bc8c04f1060f
+PKG_HASH:=ed2dbd6954792b2c054ccf8ec4b330a54b85904a80cef477a1c74643ddafa0ce
 PKG_MAINTAINER:=Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
 PKG_LICENSE:=BSD-2-Clause
 
@@ -22,7 +22,7 @@ PKG_FIXUP:=autoreconf
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/$(PKG_NAME)/Default
+define Package/libarchive/Default
        SECTION:=libs
        CATEGORY:=Libraries
        DEPENDS:=+zlib +liblzma +libbz2 +libexpat
@@ -30,13 +30,13 @@ define Package/$(PKG_NAME)/Default
        URL:=http://www.libarchive.org/
 endef
 
-define Package/$(PKG_NAME)
-       $(call Package/$(PKG_NAME)/Default)
+define Package/libarchive
+       $(call Package/libarchive/Default)
        DEPENDS += +libopenssl
 endef
 
-define Package/$(PKG_NAME)-noopenssl
-       $(call Package/$(PKG_NAME)/Default)
+define Package/libarchive-noopenssl
+       $(call Package/libarchive/Default)
        TITLE += (without OpenSSL dependency)
        VARIANT:=noopenssl
 endef
@@ -62,10 +62,10 @@ CONFIGURE_ARGS += \
        --enable-bsdtar=shared \
        --disable-acl \
        --disable-xattr \
-       --without-lzo2 \
        --without-nettle \
        --without-xml2 \
        --without-lz4 \
+       --without-cng \
 
 ifeq ($(BUILD_VARIANT),noopenssl)
        CONFIGURE_ARGS += --without-openssl
@@ -90,7 +90,7 @@ define Package/bsdtar/install
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/bsdtar $(1)/usr/bin
 endef
 
-Package/$(PKG_NAME)-noopenssl/install = $(Package/$(PKG_NAME)/install)
+Package/libarchive-noopenssl/install = $(Package/libarchive/install)
 
 $(eval $(call BuildPackage,libarchive))
 $(eval $(call BuildPackage,libarchive-noopenssl))
index c5b003e0211bf14002132e75eddaee15f57d3441..c3a57d568cad9f8e62b47e21c2f4dd901b149eea 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1.1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/OpenLightingProject/libartnet/releases/download/1.1.2
-PKG_MD5SUM:=dcceab3efe3dae4c18fa549dbd198e71
+PKG_HASH:=19cdda434e208a81ddd138377f11046364438e40e34542ae101d6aa3fcaec696
 
 PKG_MAINTAINER:=Martijn Zilverschoon <martijn@friedzombie.com>
 
index b353e6473c67dc2d1249d5b7193062cf5c83ac35..41754463484a5337d2d71e28be00b4e24c19b5a3 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2006-2016 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -9,11 +7,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=audiofile
 PKG_VERSION:=0.3.6
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNOME/$(PKG_NAME)/0.3
-PKG_MD5SUM:=ea2449ad3f201ec590d811db9da6d02ffc5e87a677d06b92ab15363d8cb59782
+PKG_HASH:=ea2449ad3f201ec590d811db9da6d02ffc5e87a677d06b92ab15363d8cb59782
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
@@ -39,8 +37,10 @@ endef
 CONFIGURE_ARGS+= \
        --enable-shared \
        --enable-static \
-       --disable-examples \
-       --with-build-cc="$(HOSTCC)"
+       --disable-docs \
+       --disable-coverage \
+       --disable-examples
+
 
 TARGET_CFLAGS+= $(FPIC)
 
diff --git a/libs/libaudiofile/patches/010-gcc6-fix-left-shift-negative-number.patch b/libs/libaudiofile/patches/010-gcc6-fix-left-shift-negative-number.patch
new file mode 100644 (file)
index 0000000..ebbe700
--- /dev/null
@@ -0,0 +1,18 @@
+Description: Fix FTBFS with GCC 6
+Author: Michael Schwendt <mschwendt@fedoraproject.org>
+Origin: vendor, https://github.com/mpruett/audiofile/pull/27
+Bug-Debian: https://bugs.debian.org/812055
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+
+--- a/libaudiofile/modules/SimpleModule.h
++++ b/libaudiofile/modules/SimpleModule.h
+@@ -123,7 +123,7 @@ struct signConverter
+       typedef typename IntTypes<Format>::UnsignedType UnsignedType;
+       static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
+-      static const int kMinSignedValue = -1 << kScaleBits;
++      static const int kMinSignedValue = 0-(1U<<kScaleBits);
+       struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>
+       {
diff --git a/libs/libaudiofile/patches/020-remove-tests-examples-docs.patch b/libs/libaudiofile/patches/020-remove-tests-examples-docs.patch
new file mode 100644 (file)
index 0000000..dc4a8b9
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -159,12 +159,8 @@ AC_CONFIG_FILES([
+       audiofile.pc
+       audiofile-uninstalled.pc
+       sfcommands/Makefile
+-      test/Makefile
+-      gtest/Makefile
+-      examples/Makefile
+       libaudiofile/Makefile
+       libaudiofile/alac/Makefile
+       libaudiofile/modules/Makefile
+-      docs/Makefile
+       Makefile])
+ AC_OUTPUT
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,6 +1,6 @@
+ ## Process this file with automake to produce Makefile.in
+-SUBDIRS = gtest libaudiofile sfcommands test examples docs
++SUBDIRS = libaudiofile sfcommands
+ EXTRA_DIST = \
+       ACKNOWLEDGEMENTS \
diff --git a/libs/libaudiofile/patches/030-CVE-2015-7747.patch b/libs/libaudiofile/patches/030-CVE-2015-7747.patch
new file mode 100644 (file)
index 0000000..d3d3844
--- /dev/null
@@ -0,0 +1,19 @@
+Description: fix buffer overflow when changing both sample format and
+ number of channels
+Origin: backport, https://github.com/mpruett/audiofile/pull/25
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/audiofile/+bug/1502721
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801102
+
+Index: audiofile-0.3.6/libaudiofile/modules/ModuleState.cpp
+===================================================================
+--- audiofile-0.3.6.orig/libaudiofile/modules/ModuleState.cpp  2015-10-20 08:00:58.036128202 -0400
++++ audiofile-0.3.6/libaudiofile/modules/ModuleState.cpp       2015-10-20 08:00:58.036128202 -0400
+@@ -402,7 +402,7 @@
+               addModule(new Transform(outfc, in.pcm, out.pcm));
+       if (in.channelCount != out.channelCount)
+-              addModule(new ApplyChannelMatrix(infc, isReading,
++              addModule(new ApplyChannelMatrix(outfc, isReading,
+                       in.channelCount, out.channelCount,
+                       in.pcm.minClip, in.pcm.maxClip,
+                       track->channelMatrix));
diff --git a/libs/libaudiofile/patches/110-Always-check-the-number-of-coefficients.patch b/libs/libaudiofile/patches/110-Always-check-the-number-of-coefficients.patch
new file mode 100644 (file)
index 0000000..292fdfe
--- /dev/null
@@ -0,0 +1,34 @@
+From c48e4c6503f7dabd41f11d4c9c7b7f8960e7f2c0 Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 12:51:22 +0100
+Subject: [PATCH] Always check the number of coefficients
+
+When building the library with NDEBUG, asserts are eliminated
+so it's better to always check that the number of coefficients
+is inside the array range.
+
+This fixes the 00191-audiofile-indexoob issue in #41
+---
+ libaudiofile/WAVE.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/libaudiofile/WAVE.cpp b/libaudiofile/WAVE.cpp
+index 0e81cf7..61f9541 100644
+--- a/libaudiofile/WAVE.cpp
++++ b/libaudiofile/WAVE.cpp
+@@ -281,6 +281,12 @@ status WAVEFile::parseFormat(const Tag &id, uint32_t size)
+                       /* numCoefficients should be at least 7. */
+                       assert(numCoefficients >= 7 && numCoefficients <= 255);
++                      if (numCoefficients < 7 || numCoefficients > 255)
++                      {
++                              _af_error(AF_BAD_HEADER,
++                                              "Bad number of coefficients");
++                              return AF_FAIL;
++                      }
+                       m_msadpcmNumCoefficients = numCoefficients;
+-- 
+2.11.0
+
diff --git a/libs/libaudiofile/patches/120-clamp-index-values-to-fix-index-overflow-in-IMA.cpp.patch b/libs/libaudiofile/patches/120-clamp-index-values-to-fix-index-overflow-in-IMA.cpp.patch
new file mode 100644 (file)
index 0000000..83b0e06
--- /dev/null
@@ -0,0 +1,37 @@
+From 25eb00ce913452c2e614548d7df93070bf0d066f Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 18:02:31 +0100
+Subject: [PATCH] clamp index values to fix index overflow in IMA.cpp
+
+This fixes #33
+(also reported at https://bugzilla.opensuse.org/show_bug.cgi?id=1026981
+and https://blogs.gentoo.org/ago/2017/02/20/audiofile-global-buffer-overflow-in-decodesample-ima-cpp/)
+---
+ libaudiofile/modules/IMA.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libaudiofile/modules/IMA.cpp b/libaudiofile/modules/IMA.cpp
+index 7476d44..df4aad6 100644
+--- a/libaudiofile/modules/IMA.cpp
++++ b/libaudiofile/modules/IMA.cpp
+@@ -169,7 +169,7 @@ int IMA::decodeBlockWAVE(const uint8_t *encoded, int16_t *decoded)
+               if (encoded[1] & 0x80)
+                       m_adpcmState[c].previousValue -= 0x10000;
+-              m_adpcmState[c].index = encoded[2];
++              m_adpcmState[c].index = clamp(encoded[2], 0, 88);
+               *decoded++ = m_adpcmState[c].previousValue;
+@@ -210,7 +210,7 @@ int IMA::decodeBlockQT(const uint8_t *encoded, int16_t *decoded)
+                       predictor -= 0x10000;
+               state.previousValue = clamp(predictor, MIN_INT16, MAX_INT16);
+-              state.index = encoded[1] & 0x7f;
++              state.index = clamp(encoded[1] & 0x7f, 0, 88);
+               encoded += 2;
+               for (int n=0; n<m_framesPerPacket; n+=2)
+-- 
+2.11.0
+
diff --git a/libs/libaudiofile/patches/130-Check-for-multiplication-overflow-in-sfconvert.patch b/libs/libaudiofile/patches/130-Check-for-multiplication-overflow-in-sfconvert.patch
new file mode 100644 (file)
index 0000000..46c7457
--- /dev/null
@@ -0,0 +1,70 @@
+From 7d65f89defb092b63bcbc5d98349fb222ca73b3c Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 13:54:52 +0100
+Subject: [PATCH] Check for multiplication overflow in sfconvert
+
+Checks that a multiplication doesn't overflow when
+calculating the buffer size, and if it overflows,
+reduce the buffer size instead of failing.
+
+This fixes the 00192-audiofile-signintoverflow-sfconvert case
+in #41
+---
+ sfcommands/sfconvert.c | 34 ++++++++++++++++++++++++++++++++--
+ 1 file changed, 32 insertions(+), 2 deletions(-)
+
+diff --git a/sfcommands/sfconvert.c b/sfcommands/sfconvert.c
+index 80a1bc4..970a3e4 100644
+--- a/sfcommands/sfconvert.c
++++ b/sfcommands/sfconvert.c
+@@ -45,6 +45,33 @@ void printusage (void);
+ void usageerror (void);
+ bool copyaudiodata (AFfilehandle infile, AFfilehandle outfile, int trackid);
++int firstBitSet(int x)
++{
++        int position=0;
++        while (x!=0)
++        {
++                x>>=1;
++                ++position;
++        }
++        return position;
++}
++
++#ifndef __has_builtin
++#define __has_builtin(x) 0
++#endif
++
++int multiplyCheckOverflow(int a, int b, int *result)
++{
++#if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow))
++      return __builtin_mul_overflow(a, b, result);
++#else
++      if (firstBitSet(a)+firstBitSet(b)>31) // int is signed, so we can't use 32 bits
++              return true;
++      *result = a * b;
++      return false;
++#endif
++}
++
+ int main (int argc, char **argv)
+ {
+       if (argc == 2)
+@@ -323,8 +350,11 @@ bool copyaudiodata (AFfilehandle infile, AFfilehandle outfile, int trackid)
+ {
+       int frameSize = afGetVirtualFrameSize(infile, trackid, 1);
+-      const int kBufferFrameCount = 65536;
+-      void *buffer = malloc(kBufferFrameCount * frameSize);
++      int kBufferFrameCount = 65536;
++      int bufferSize;
++      while (multiplyCheckOverflow(kBufferFrameCount, frameSize, &bufferSize))
++              kBufferFrameCount /= 2;
++      void *buffer = malloc(bufferSize);
+       AFframecount totalFrames = afGetFrameCount(infile, AF_DEFAULT_TRACK);
+       AFframecount totalFramesWritten = 0;
+-- 
+2.11.0
+
diff --git a/libs/libaudiofile/patches/140-Actually-fail-when-error-occurs-in-parseFormat.patch b/libs/libaudiofile/patches/140-Actually-fail-when-error-occurs-in-parseFormat.patch
new file mode 100644 (file)
index 0000000..6bb5731
--- /dev/null
@@ -0,0 +1,35 @@
+From a2e9eab8ea87c4ffc494d839ebb4ea145eb9f2e6 Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 18:59:26 +0100
+Subject: [PATCH] Actually fail when error occurs in parseFormat
+
+When there's an unsupported number of bits per sample or an invalid
+number of samples per block, don't only print an error message using
+the error handler, but actually stop parsing the file.
+
+This fixes #35 (also reported at
+https://bugzilla.opensuse.org/show_bug.cgi?id=1026983 and
+https://blogs.gentoo.org/ago/2017/02/20/audiofile-heap-based-buffer-overflow-in-imadecodeblockwave-ima-cpp/
+)
+---
+ libaudiofile/WAVE.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/libaudiofile/WAVE.cpp
++++ b/libaudiofile/WAVE.cpp
+@@ -332,6 +332,7 @@ status WAVEFile::parseFormat(const Tag &
+                       {
+                               _af_error(AF_BAD_NOT_IMPLEMENTED,
+                                       "IMA ADPCM compression supports only 4 bits per sample");
++                              return AF_FAIL;
+                       }
+                       int bytesPerBlock = (samplesPerBlock + 14) / 8 * 4 * channelCount;
+@@ -339,6 +340,7 @@ status WAVEFile::parseFormat(const Tag &
+                       {
+                               _af_error(AF_BAD_CODEC_CONFIG,
+                                       "Invalid samples per block for IMA ADPCM compression");
++                              return AF_FAIL;
+                       }
+                       track->f.sampleWidth = 16;
diff --git a/libs/libaudiofile/patches/150-Check-for-multiplication-overflow-in-MSADPCM-decodeS.patch b/libs/libaudiofile/patches/150-Check-for-multiplication-overflow-in-MSADPCM-decodeS.patch
new file mode 100644 (file)
index 0000000..84be8b8
--- /dev/null
@@ -0,0 +1,120 @@
+From beacc44eb8cdf6d58717ec1a5103c5141f1b37f9 Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Mon, 6 Mar 2017 13:43:53 +0100
+Subject: [PATCH] Check for multiplication overflow in MSADPCM decodeSample
+
+Check for multiplication overflow (using __builtin_mul_overflow
+if available) in MSADPCM.cpp decodeSample and return an empty
+decoded block if an error occurs.
+
+This fixes the 00193-audiofile-signintoverflow-MSADPCM case of #41
+---
+ libaudiofile/modules/BlockCodec.cpp |  5 ++--
+ libaudiofile/modules/MSADPCM.cpp    | 47 +++++++++++++++++++++++++++++++++----
+ 2 files changed, 46 insertions(+), 6 deletions(-)
+
+diff --git a/libaudiofile/modules/BlockCodec.cpp b/libaudiofile/modules/BlockCodec.cpp
+index 45925e8..4731be1 100644
+--- a/libaudiofile/modules/BlockCodec.cpp
++++ b/libaudiofile/modules/BlockCodec.cpp
+@@ -52,8 +52,9 @@ void BlockCodec::runPull()
+       // Decompress into m_outChunk.
+       for (int i=0; i<blocksRead; i++)
+       {
+-              decodeBlock(static_cast<const uint8_t *>(m_inChunk->buffer) + i * m_bytesPerPacket,
+-                      static_cast<int16_t *>(m_outChunk->buffer) + i * m_framesPerPacket * m_track->f.channelCount);
++              if (decodeBlock(static_cast<const uint8_t *>(m_inChunk->buffer) + i * m_bytesPerPacket,
++                      static_cast<int16_t *>(m_outChunk->buffer) + i * m_framesPerPacket * m_track->f.channelCount)==0)
++                      break;
+               framesRead += m_framesPerPacket;
+       }
+diff --git a/libaudiofile/modules/MSADPCM.cpp b/libaudiofile/modules/MSADPCM.cpp
+index 8ea3c85..ef9c38c 100644
+--- a/libaudiofile/modules/MSADPCM.cpp
++++ b/libaudiofile/modules/MSADPCM.cpp
+@@ -101,24 +101,60 @@ static const int16_t adaptationTable[] =
+       768, 614, 512, 409, 307, 230, 230, 230
+ };
++int firstBitSet(int x)
++{
++        int position=0;
++        while (x!=0)
++        {
++                x>>=1;
++                ++position;
++        }
++        return position;
++}
++
++#ifndef __has_builtin
++#define __has_builtin(x) 0
++#endif
++
++int multiplyCheckOverflow(int a, int b, int *result)
++{
++#if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow))
++      return __builtin_mul_overflow(a, b, result);
++#else
++      if (firstBitSet(a)+firstBitSet(b)>31) // int is signed, so we can't use 32 bits
++              return true;
++      *result = a * b;
++      return false;
++#endif
++}
++
++
+ // Compute a linear PCM value from the given differential coded value.
+ static int16_t decodeSample(ms_adpcm_state &state,
+-      uint8_t code, const int16_t *coefficient)
++      uint8_t code, const int16_t *coefficient, bool *ok=NULL)
+ {
+       int linearSample = (state.sample1 * coefficient[0] +
+               state.sample2 * coefficient[1]) >> 8;
++      int delta;
+       linearSample += ((code & 0x08) ? (code - 0x10) : code) * state.delta;
+       linearSample = clamp(linearSample, MIN_INT16, MAX_INT16);
+-      int delta = (state.delta * adaptationTable[code]) >> 8;
++      if (multiplyCheckOverflow(state.delta, adaptationTable[code], &delta))
++      {
++                if (ok) *ok=false;
++              _af_error(AF_BAD_COMPRESSION, "Error decoding sample");
++              return 0;
++      }
++      delta >>= 8;
+       if (delta < 16)
+               delta = 16;
+       state.delta = delta;
+       state.sample2 = state.sample1;
+       state.sample1 = linearSample;
++      if (ok) *ok=true;
+       return static_cast<int16_t>(linearSample);
+ }
+@@ -212,13 +248,16 @@ int MSADPCM::decodeBlock(const uint8_t *encoded, int16_t *decoded)
+       {
+               uint8_t code;
+               int16_t newSample;
++              bool ok;
+               code = *encoded >> 4;
+-              newSample = decodeSample(*state[0], code, coefficient[0]);
++              newSample = decodeSample(*state[0], code, coefficient[0], &ok);
++              if (!ok) return 0;
+               *decoded++ = newSample;
+               code = *encoded & 0x0f;
+-              newSample = decodeSample(*state[1], code, coefficient[1]);
++              newSample = decodeSample(*state[1], code, coefficient[1], &ok);
++              if (!ok) return 0;
+               *decoded++ = newSample;
+               encoded++;
+-- 
+2.11.0
+
diff --git a/libs/libaudiofile/patches/160-Fix-signature-of-multiplyCheckOverflow.patch b/libs/libaudiofile/patches/160-Fix-signature-of-multiplyCheckOverflow.patch
new file mode 100644 (file)
index 0000000..d667ba8
--- /dev/null
@@ -0,0 +1,40 @@
+From ce536d707b8e2a26baca77320398c45238224ca7 Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Fri, 10 Mar 2017 15:40:02 +0100
+Subject: [PATCH] Fix signature of multiplyCheckOverflow. It returns a bool,
+ not an int
+
+---
+ libaudiofile/modules/MSADPCM.cpp | 2 +-
+ sfcommands/sfconvert.c           | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libaudiofile/modules/MSADPCM.cpp b/libaudiofile/modules/MSADPCM.cpp
+index ef9c38c..d8c9553 100644
+--- a/libaudiofile/modules/MSADPCM.cpp
++++ b/libaudiofile/modules/MSADPCM.cpp
+@@ -116,7 +116,7 @@ int firstBitSet(int x)
+ #define __has_builtin(x) 0
+ #endif
+-int multiplyCheckOverflow(int a, int b, int *result)
++bool multiplyCheckOverflow(int a, int b, int *result)
+ {
+ #if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow))
+       return __builtin_mul_overflow(a, b, result);
+diff --git a/sfcommands/sfconvert.c b/sfcommands/sfconvert.c
+index 970a3e4..367f7a5 100644
+--- a/sfcommands/sfconvert.c
++++ b/sfcommands/sfconvert.c
+@@ -60,7 +60,7 @@ int firstBitSet(int x)
+ #define __has_builtin(x) 0
+ #endif
+-int multiplyCheckOverflow(int a, int b, int *result)
++bool multiplyCheckOverflow(int a, int b, int *result)
+ {
+ #if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow))
+       return __builtin_mul_overflow(a, b, result);
+-- 
+2.11.0
+
diff --git a/libs/libaudiofile/patches/170-Check-for-division-by-zero-in-BlockCodec.patch b/libs/libaudiofile/patches/170-Check-for-division-by-zero-in-BlockCodec.patch
new file mode 100644 (file)
index 0000000..e001133
--- /dev/null
@@ -0,0 +1,21 @@
+From: Antonio Larrosa <larrosa@kde.org>
+Date: Thu, 9 Mar 2017 10:21:18 +0100
+Subject: Check for division by zero in BlockCodec::runPull
+
+---
+ libaudiofile/modules/BlockCodec.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libaudiofile/modules/BlockCodec.cpp b/libaudiofile/modules/BlockCodec.cpp
+index 4731be1..eb2fb4d 100644
+--- a/libaudiofile/modules/BlockCodec.cpp
++++ b/libaudiofile/modules/BlockCodec.cpp
+@@ -47,7 +47,7 @@ void BlockCodec::runPull()
+       // Read the compressed data.
+       ssize_t bytesRead = read(m_inChunk->buffer, m_bytesPerPacket * blockCount);
+-      int blocksRead = bytesRead >= 0 ? bytesRead / m_bytesPerPacket : 0;
++      int blocksRead = (bytesRead >= 0 && m_bytesPerPacket > 0) ? bytesRead / m_bytesPerPacket : 0;
+       // Decompress into m_outChunk.
+       for (int i=0; i<blocksRead; i++)
index 0ff2385ac1710ee0cc3d3406e33a17afe034794c..3d7325f20cd8a40259888f4d03731597b28d3e94 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=libavl
 PKG_VERSION:=0.3.5
 PKG_RELEASE:=1
-PKG_MD5SUM:=882c68ea7f71876ca110f3b84d7ab12d
+PKG_HASH:=4497b9e22cdd61ae2fa893b9d5fd6213dc306726d7c4be08c29e173622dca8a0
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/liba/libavl
index 9758ef32c08f74260d4ee225fa2922ff8180a208..29594699b4d328ae3276f9716c7b444b1650d39b 100644 (file)
@@ -8,20 +8,22 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libcanfestival
-PKG_RELEASE:=3
+PKG_RELEASE:=6
 
-PKG_SOURCE_PROTO:=hg
-PKG_SOURCE_URL:=http://dev.automforge.net/CanFestival-3
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)
 PKG_SOURCE_VERSION:=8bfe0ac00cdb
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://dev.automforge.net/CanFestival-3/archive/$(PKG_SOURCE_VERSION).tar.bz2?_dummyfilename=
+PKG_SOURCE:=CanFestival-3-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_HASH:=0bee7aaef266fc579922ca159b7acbe9cdc9a936ac1f30402814844b007f7185
+PKG_SOURCE_SUBDIR:=CanFestival-3-$(PKG_SOURCE_VERSION)
 
 PKG_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
+
 PKG_LICENSE:=LGPL-2.1+
 PKG_LICENSE_FILES:=LICENCE
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 
+TAR_OPTIONS+= -m
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
diff --git a/libs/libcanfestival/patches/004-override-cflags.patch b/libs/libcanfestival/patches/004-override-cflags.patch
new file mode 100644 (file)
index 0000000..8dfb396
--- /dev/null
@@ -0,0 +1,44 @@
+--- a/drivers/can_socket/Makefile.in
++++ b/drivers/can_socket/Makefile.in
+@@ -23,7 +23,7 @@
+ CC = SUB_CC
+ OPT_CFLAGS = -O2
+-CFLAGS = SUB_OPT_CFLAGS
++CFLAGS ?= SUB_OPT_CFLAGS
+ PROG_CFLAGS = SUB_PROG_CFLAGS
+ PREFIX = SUB_PREFIX
+ TARGET = SUB_TARGET
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -101,7 +101,7 @@ uninstall:
+       rm -rf $(DESTDIR)$(PREFIX)/include/canfestival
+ else
+-CFLAGS = SUB_OPT_CFLAGS
++CFLAGS ?= SUB_OPT_CFLAGS
+ ifeq ($(TARGET),none)
+ canfestival: libcanfestival.o
+--- a/drivers/unix/Makefile.in
++++ b/drivers/unix/Makefile.in
+@@ -85,7 +85,7 @@ install:
+ else
+-CFLAGS = SUB_OPT_CFLAGS
++CFLAGS ?= SUB_OPT_CFLAGS
+ driver: libcanfestival_$(TARGET).a
+--- a/drivers/timers_unix/Makefile.in
++++ b/drivers/timers_unix/Makefile.in
+@@ -23,7 +23,7 @@
+ CC = SUB_CC
+ OPT_CFLAGS = -O2
+-CFLAGS = SUB_OPT_CFLAGS
++CFLAGS ?= SUB_OPT_CFLAGS
+ PROG_CFLAGS = SUB_PROG_CFLAGS
+ OS_NAME = SUB_OS_NAME
+ ARCH_NAME = SUB_ARCH_NAME
index 50b31e0c74b4d44055d58829b48cae7f02b345d2..444ba1d95db02b7c8936b674972429caefbdc1b3 100644 (file)
@@ -8,13 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libcap
-PKG_VERSION:=2.24
-PKG_RELEASE:=1
+PKG_VERSION:=2.25
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2
-PKG_MD5SUM:=d43ab9f680435a7fff35b4ace8d45b80
-PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
+PKG_HASH:=693c8ac51e983ee678205571ef272439d83afe62dd8e424ea14ad9790bc35162
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=License
+PKG_MAINTAINER:=Paul Wassi <p.wassi@gmx.at>
 
 PKG_INSTALL:=1
 
@@ -28,19 +30,41 @@ define Package/libcap
   URL:=http://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/
 endef
 
+define Package/libcap/config
+  if PACKAGE_libcap
+
+  config PACKAGE_libcap-bin
+    bool "install libcap executables"
+    help
+      Install capsh, getcap, getpcaps, setcap into the target image.
+    default n
+
+  config PACKAGE_libcap-bin-capsh-shell
+    string "capsh shell"
+    depends on PACKAGE_libcap-bin
+    help
+      Set the capsh shell.
+    default "/bin/sh"
+
+  endif
+endef
+
 MAKE_FLAGS += \
-    CFLAGS="$(TARGET_CFLAGS)" \
     BUILD_CC="$(CC)" \
     BUILD_CFLAGS="$(FPIC) -I$(PKG_BUILD_DIR)/libcap/include" \
     CFLAGS="$(TARGET_CFLAGS)" \
-    LD="$(TARGET_CC)" \
-    LDFLAGS="$(TARGET_LDFLAGS) -shared" \
+    LD="$(TARGET_CC) -Wl,-x -shared" \
+    LDFLAGS="$(TARGET_LDFLAGS)" \
     INDENT="| true" \
     PAM_CAP="no" \
-    LIBATTR="no" \
+    RAISE_SETFCAP="no" \
     DYNAMIC="yes" \
     lib="lib"
 
+ifneq ($(CONFIG_PACKAGE_libcap-bin-capsh-shell),)
+TARGET_CFLAGS += -DSHELL='\"$(CONFIG_PACKAGE_libcap-bin-capsh-shell)\"'
+endif
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include/sys
        $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
@@ -51,6 +75,13 @@ endef
 define Package/libcap/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/lib/libcap.so* $(1)/usr/lib/
+ifneq ($(CONFIG_PACKAGE_libcap-bin),)
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP) $(PKG_INSTALL_DIR)/sbin/capsh     $(1)/usr/sbin/
+       $(CP) $(PKG_INSTALL_DIR)/sbin/getcap    $(1)/usr/sbin/
+       $(CP) $(PKG_INSTALL_DIR)/sbin/getpcaps  $(1)/usr/sbin/
+       $(CP) $(PKG_INSTALL_DIR)/sbin/setcap    $(1)/usr/sbin/
+endif
 endef
 
 $(eval $(call BuildPackage,libcap))
diff --git a/libs/libcap/patches/200-change-hardcoded-shell-to-sh.patch b/libs/libcap/patches/200-change-hardcoded-shell-to-sh.patch
new file mode 100644 (file)
index 0000000..c2156ad
--- /dev/null
@@ -0,0 +1,34 @@
+--- a/progs/capsh.c
++++ b/progs/capsh.c
+@@ -24,6 +24,9 @@
+ #include <sys/wait.h>
+ #include <sys/prctl.h>
++#ifndef SHELL
++#define SHELL "/bin/sh"
++#endif
+ #define MAX_GROUPS       100   /* max number of supplementary groups for user */
+ static const cap_value_t raise_setpcap[1] = { CAP_SETPCAP };
+@@ -557,10 +560,10 @@ int main(int argc, char *argv[], char *envp[])
+           }
+           printf("\n");
+       } else if ((!strcmp("--", argv[i])) || (!strcmp("==", argv[i]))) {
+-          argv[i] = strdup(argv[i][0] == '-' ? "/bin/bash" : argv[0]);
++          argv[i] = strdup(argv[i][0] == '-' ? SHELL : argv[0]);
+           argv[argc] = NULL;
+           execve(argv[i], argv+i, envp);
+-          fprintf(stderr, "execve /bin/bash failed!\n");
++          fprintf(stderr, "execve " SHELL " failed!\n");
+           exit(1);
+       } else {
+       usage:
+@@ -582,7 +585,7 @@ int main(int argc, char *argv[], char *envp[])
+                  "  --killit=<n>   send signal(n) to child\n"
+                  "  --forkfor=<n>  fork and make child sleep for <n> sec\n"
+                  "  ==             re-exec(capsh) with args as for --\n"
+-                 "  --             remaing arguments are for /bin/bash\n"
++                 "  --             remaing arguments are for " SHELL "\n"
+                  "                 (without -- [%s] will simply exit(0))\n",
+                  argv[0], argv[0]);
index fb220a9ee13aa492b16ab835443266e8dd51c8a5..4f49adccf01346f64369d4521a1e4aaefd157924 100644 (file)
@@ -8,13 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libcoap
-PKG_RELEASE:=3
+PKG_VERSION:=v4.1.2
+PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/obgm/libcoap
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)
-PKG_SOURCE_VERSION:=2da31de732c0e51a9bc9e1d4aea21e25da89cf87
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_SOURCE_VERSION:=fa5248603049ddf95cc84608aad569120763bf2b
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=0ab4bc9569a78904743cc3074fd1c0fc9c78c85fd510fef5145dd872523619e6
 
 PKG_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
 PKG_LICENSE:=GPL-2.0+ BSD-2-Clause
@@ -38,10 +40,32 @@ define Package/libcoap/description
   Constrained Application Protocol (RFC 7252) library
 endef
 
+define Package/coap-client
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libcoap
+  TITLE:=CoAP (RFC 7252) client tool
+endef
+
+define Package/coap-client/description
+  Constrained Application Protocol (RFC7252) client tool
+endef
+
+define Package/coap-server
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+libcoap
+  TITLE:=CoAP (RFC 7252) server programs
+endef
+
+define Package/coap-server/description
+  Constrained Application Protocol (RFC 7252) server and resource directory server
+endef
+
 TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
-       --disable-examples \
+       --enable-examples \
        --disable-documentation
 
 ifeq ($(CONFIG_BIG_ENDIAN),y)
@@ -61,4 +85,17 @@ define Package/libcoap/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcoap-1.so* $(1)/usr/lib/
 endef
 
+define Package/coap-client/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/coap-client $(1)/usr/bin/
+endef
+
+define Package/coap-server/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/coap-server $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/coap-rd $(1)/usr/bin/
+endef
+
 $(eval $(call BuildPackage,libcoap))
+$(eval $(call BuildPackage,coap-client))
+$(eval $(call BuildPackage,coap-server))
index 958a37d2a4b93ad6a2a3a3c8e1e6b655599180cf..ff284a7f745191ec7809a56f3280fb90d301ea97 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://0pointer.de/lennart/projects/libdaemon/
-PKG_MD5SUM:=509dc27107c21bcd9fbf2f95f5669563
+PKG_HASH:=fd23eb5f6f986dcc7e708307355ba3289abe03cc381fc47a80bca4a50aa6b834
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_FIXUP:=autoreconf
index 3b269f137a0ac76a06d8dc801313211242836566..65a35d46ead0418901d05cc12bbd15377533189e 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=2
 PKG_SOURCE_URL:=https://www.snort.org/downloads/snort/ \
        @SF/snort
 PKG_SOURCE:=daq-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=65e51d72e9d5d8b397e192e4e5857eff
+PKG_HASH:=a294aa3d01cd8902bf842d320e7f2c043af9ead95d0e7198c3b71a0dbc9d253c
 PKG_BUILD_DIR:=$(BUILD_DIR)/daq-$(PKG_VERSION)
 
 PKG_LICENSE:=GPL-2.0
index e5a2da7f3175f51ab3e6bb7c33c694d7aee226de..1dc57a909041368056fc07d45c9d4245c4306c2e 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libdbi-drivers
 PKG_VERSION:=0.9.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/libdbi-drivers
-PKG_MD5SUM:=9f47b960e225eede2cdeaabf7d22f59f
+PKG_HASH:=43d2eacd573a4faff296fa925dd97fbf2aedbf1ae35c6263478210c61004c854
 
 PKG_LICENSE:=LGPL-2.1
 PKG_LICENSE_FILES:=COPYING
diff --git a/libs/libdbi-drivers/patches/100-remove-date-to-fix-reproducible-builds.patch b/libs/libdbi-drivers/patches/100-remove-date-to-fix-reproducible-builds.patch
new file mode 100644 (file)
index 0000000..a106c20
--- /dev/null
@@ -0,0 +1,140 @@
+Index: libdbi-drivers-0.9.0/drivers/db2/dbd_db2.c
+===================================================================
+--- libdbi-drivers-0.9.0.orig/drivers/db2/dbd_db2.c    2013-01-09 22:30:19.000000000 +0100
++++ libdbi-drivers-0.9.0/drivers/db2/dbd_db2.c 2017-12-02 00:28:50.354329791 +0100
+@@ -57,8 +57,7 @@
+   "IBM DB2 database support (using DB2 Call Level Interface)",
+   "João Henrique F. Freitas <joaohf@users.sourceforge.net>",
+   "http://libdbi-drivers.sourceforge.net",
+-  "dbd_db2 v" VERSION,
+-  __DATE__
++  "dbd_db2 v" VERSION
+ };
+ static const char *custom_functions[] = {NULL}; // TODO
+Index: libdbi-drivers-0.9.0/drivers/firebird/dbd_firebird.c
+===================================================================
+--- libdbi-drivers-0.9.0.orig/drivers/firebird/dbd_firebird.c  2013-01-09 22:20:07.000000000 +0100
++++ libdbi-drivers-0.9.0/drivers/firebird/dbd_firebird.c       2017-12-02 00:28:47.418270022 +0100
+@@ -67,8 +67,7 @@
+       "Firebird/Interbase database support",
+       "Christian M. Stamgren <cms@cention.se>",
+       "http://libdbi-drivers.sourceforge.net",
+-      "dbd_firebird v" VERSION,
+-      __DATE__
++      "dbd_firebird v" VERSION
+ };
+Index: libdbi-drivers-0.9.0/drivers/freetds/dbd_freetds.c
+===================================================================
+--- libdbi-drivers-0.9.0.orig/drivers/freetds/dbd_freetds.c    2013-01-09 22:21:11.000000000 +0100
++++ libdbi-drivers-0.9.0/drivers/freetds/dbd_freetds.c 2017-12-02 00:29:05.482637950 +0100
+@@ -63,8 +63,7 @@
+     "MS SQL and Sybase databases support (using libct)",
+     "Vadym Kononenko <konan_v@users.sourceforge.net>",
+     "http://libdbi.sourceforge.net",
+-    "dbd_freetds v" VERSION,
+-    __DATE__
++    "dbd_freetds v" VERSION
+ };
+ static const char APP_NAME[] = "libdbi-freetds-driver";
+Index: libdbi-drivers-0.9.0/drivers/ingres/dbd_ingres.c
+===================================================================
+--- libdbi-drivers-0.9.0.orig/drivers/ingres/dbd_ingres.c      2013-01-09 22:30:19.000000000 +0100
++++ libdbi-drivers-0.9.0/drivers/ingres/dbd_ingres.c   2017-12-02 00:29:02.370574535 +0100
+@@ -44,8 +44,7 @@
+       "Ingres database support",
+       "Toby Thain <qu1j0t3@sourceforge.net>",
+       "http://libdbi-drivers.sourceforge.net",
+-      "dbd_ingres v" VERSION,
+-      __DATE__
++      "dbd_ingres v" VERSION
+ };
+ static const char *custom_functions[] = {NULL};
+Index: libdbi-drivers-0.9.0/drivers/msql/dbd_msql.c
+===================================================================
+--- libdbi-drivers-0.9.0.orig/drivers/msql/dbd_msql.c  2013-01-09 22:26:20.000000000 +0100
++++ libdbi-drivers-0.9.0/drivers/msql/dbd_msql.c       2017-12-02 00:29:09.034710349 +0100
+@@ -57,8 +57,7 @@
+       "Mini SQL (mSQL) database support",
+       "Christian M. Stamgren <christian@centiongroup.com>",
+       "libdbi-drivers.sourceforge.net", 
+-      "dbd_msql v" VERSION,
+-      __DATE__
++      "dbd_msql v" VERSION
+ };
+ static const char *custom_functions[] = {NULL}; 
+Index: libdbi-drivers-0.9.0/drivers/mysql/dbd_mysql.c
+===================================================================
+--- libdbi-drivers-0.9.0.orig/drivers/mysql/dbd_mysql.c        2013-02-28 00:16:20.000000000 +0100
++++ libdbi-drivers-0.9.0/drivers/mysql/dbd_mysql.c     2017-12-02 00:28:42.438168678 +0100
+@@ -59,8 +59,7 @@
+       "MySQL database support (using libmysqlclient)",
+       "Mark M. Tobenkin <mark@brentwoodradio.com>",
+       "http://libdbi-drivers.sourceforge.net",
+-      "dbd_mysql v" VERSION,
+-      __DATE__
++      "dbd_mysql v" VERSION
+ };
+ static const char *custom_functions[] = MYSQL_CUSTOM_FUNCTIONS;
+Index: libdbi-drivers-0.9.0/drivers/oracle/dbd_oracle.c
+===================================================================
+--- libdbi-drivers-0.9.0.orig/drivers/oracle/dbd_oracle.c      2013-01-09 22:27:16.000000000 +0100
++++ libdbi-drivers-0.9.0/drivers/oracle/dbd_oracle.c   2017-12-02 00:28:55.958443910 +0100
+@@ -54,8 +54,7 @@
+       "Oracle database support (using Oracle Call Interface)",
+       "Ashish Ranjan <ashishwave@yahoo.com>", 
+       "http://libdbi-drivers.sourceforge.net",
+-      "dbd_Oracle v" VERSION,
+-      __DATE__
++      "dbd_Oracle v" VERSION
+ };
+ static const char *custom_functions[] = {NULL}; 
+Index: libdbi-drivers-0.9.0/drivers/pgsql/dbd_pgsql.c
+===================================================================
+--- libdbi-drivers-0.9.0.orig/drivers/pgsql/dbd_pgsql.c        2017-12-02 00:28:08.737484155 +0100
++++ libdbi-drivers-0.9.0/drivers/pgsql/dbd_pgsql.c     2017-12-02 00:28:53.386391528 +0100
+@@ -61,8 +61,7 @@
+       "PostgreSQL database support (using libpq)",
+       "David A. Parker <david@neongoat.com>",
+       "http://libdbi-drivers.sourceforge.net",
+-      "dbd_pgsql v" VERSION,
+-      __DATE__
++      "dbd_pgsql v" VERSION
+ };
+ static const char *custom_functions[] = PGSQL_CUSTOM_FUNCTIONS;
+Index: libdbi-drivers-0.9.0/drivers/sqlite/dbd_sqlite.c
+===================================================================
+--- libdbi-drivers-0.9.0.orig/drivers/sqlite/dbd_sqlite.c      2013-01-09 22:30:20.000000000 +0100
++++ libdbi-drivers-0.9.0/drivers/sqlite/dbd_sqlite.c   2017-12-02 00:28:59.370513412 +0100
+@@ -65,8 +65,7 @@
+   "SQLite database support (using libsqlite)",
+   "Markus Hoenicka <mhoenicka@users.sourceforge.net>",
+   "http://libdbi-drivers.sourceforge.net",
+-  "dbd_sqlite v" VERSION,
+-  __DATE__
++  "dbd_sqlite v" VERSION
+ };
+ static const char *custom_functions[] = SQLITE_CUSTOM_FUNCTIONS;
+Index: libdbi-drivers-0.9.0/drivers/sqlite3/dbd_sqlite3.c
+===================================================================
+--- libdbi-drivers-0.9.0.orig/drivers/sqlite3/dbd_sqlite3.c    2013-01-23 00:29:13.000000000 +0100
++++ libdbi-drivers-0.9.0/drivers/sqlite3/dbd_sqlite3.c 2017-12-02 00:29:11.706764820 +0100
+@@ -65,8 +65,7 @@
+   "SQLite3 database support (using libsqlite3)",
+   "Markus Hoenicka <mhoenicka@users.sourceforge.net>",
+   "http://libdbi-drivers.sourceforge.net",
+-  "dbd_sqlite3 v" VERSION,
+-  __DATE__
++  "dbd_sqlite3 v" VERSION
+ };
+ static const char *custom_functions[] = SQLITE3_CUSTOM_FUNCTIONS;
index a1079fea462dc8afba134844ec058aa0a00b3b08..0c3f242d9af2ccbff98dae599b90e1696825e336 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/libdbi
-PKG_MD5SUM:=05e2ceeac4bc85fbe40de8b4b22d9ab3
+PKG_HASH:=dafb6cdca524c628df832b6dd0bf8fabceb103248edb21762c02d3068fca4503
 
 PKG_LICENSE:=LGPL-2.1
 PKG_LICENSE_FILES:=COPYING
diff --git a/libs/libdmapsharing/Makefile b/libs/libdmapsharing/Makefile
new file mode 100644 (file)
index 0000000..3c61d3d
--- /dev/null
@@ -0,0 +1,73 @@
+#
+# Copyright (C) 2009-2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# This Makefile is a skeleton
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libdmapsharing
+PKG_VERSION:=2.9.39
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_LICENSE:=LGPLv2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=libdmapsharing-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.flyn.org/projects/libdmapsharing/
+PKG_HASH:=a90dc0681ae81700e46efc539f70edb6edd936b782a9a695434bea660a43a5ef
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+TARGET_LDFLAGS+= \
+       -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
+define Package/libdmapsharing
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libsoup +mdnsresponder +gstreamer1 +gst1-plugins-base +libgst1app
+  TITLE:=libdmapsharing
+  URL:=http://www.flyn.org/projects/libdmapsharing/
+endef
+
+define Package/libdmapsharing/decription
+  Libdmapsharing is a DMAP library implementation in C
+endef
+
+CONFIGURE_ARGS += \
+       --disable-check \
+       --disable-gtk-doc \
+       --disable-introspection
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/libdmapsharing-3.0/ \
+               $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+               $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libdmapsharing/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+               $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libdmapsharing))
diff --git a/libs/libdmapsharing/patches/001-disable_pixbuf.patch b/libs/libdmapsharing/patches/001-disable_pixbuf.patch
new file mode 100644 (file)
index 0000000..fcc8453
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -117,18 +117,7 @@ dnl make GOBJECT_CFLAGS and GOBJECT_LIBS
+ AC_SUBST(GOBJECT_CFLAGS)
+ AC_SUBST(GOBJECT_LIBS)
+-dnl Check for gdk-pixbuf, needed for DACP Now Playing Artwork
+-PKG_CHECK_MODULES(GDKPIXBUF, gdk-pixbuf-2.0,
+-  HAVE_GDKPIXBUF=yes,
+-  HAVE_GDKPIXBUF=no)
+-
+-if test x"$HAVE_GDKPIXBUF" = "xyes"; then
+-  AC_DEFINE(HAVE_GDKPIXBUF, 1, [Define if gdk-pixbuf support is enabled])
+-else
+-  AC_WARN(Gdk-pixbuf library not present, Now Playing artwork might be affected.)
+-fi
+-
+-AM_CONDITIONAL(USE_GDKPIXBUF, test x"$HAVE_GDKPIXBUF" = "xyes")
++HAVE_GDKPIXBUF=no
+ AC_SUBST(GDKPIXBUF_CFLAGS)
+ AC_SUBST(GDKPIXBUF_LIBS)
diff --git a/libs/libdmapsharing/patches/002-disable_tests.patch b/libs/libdmapsharing/patches/002-disable_tests.patch
new file mode 100644 (file)
index 0000000..bafc52f
--- /dev/null
@@ -0,0 +1,8 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = libdmapsharing vala tests doc
++SUBDIRS = libdmapsharing vala doc
+ DIST_SUBDIRS = $(SUBDIRS) m4 media
+ # pcfiles = libdmapsharing-@LIBDMAPSHARING_MAJORMINOR@.pc
index b0980cefd3d581724b458598e3a5ac626e1099f6..d492083891e91de0895a5bd64e9102cb387c266c 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/dugsong/libdnet/archive
-PKG_MD5SUM:=d2f1b72eac2a1070959667e9e61dcf20
+PKG_HASH:=b6360659c93fa2e3cde9e0a1fc9c07bc4111f3448c5de856e095eb98315dd424
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index 9072268a413858949510d18b7e10207146a644bc..5a061f91f33bdec6df4de58520bb37cd513eaecf 100644 (file)
@@ -14,9 +14,9 @@ PKG_RELEASE:=1
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=0d25506a2e7fb52928963313343e0237e890059e
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=7466f634421f3136174cbc2b00635788509a3312894de28367f31d891fd401ad
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/google/double-conversion.git
-PKG_MD5SUM:=8dd6ac234054f9a6fe7f62ef1c9b5c20
 PKG_LICENSE_FILES:=COPYING LICENSE
 
 include $(INCLUDE_DIR)/package.mk
index 009935b86c539c94029498dc0c0d30237d5f32d2..e0da214fce5f5d92cc4dc5be8dffc6e27ed7bd94 100644 (file)
@@ -11,7 +11,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://dri.freedesktop.org/libdrm
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=920957cfe25a80efb02be9bd90bf3c1e
+PKG_HASH:=b17d4b39ed97ca0e4cffa0db06ff609e617bac94646ec38e8e0579d530540e7b
 
 PKG_INSTALL:=1
 
index 4d014c7fb87e8bdae825c6218843187178bd0b1d..b27435a253f5d51c7ae04bfc7c7f1cbdfd609c24 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+# Copyright (C) 2016-2018 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libedit
-PKG_VERSION:=20160618-3.1
+PKG_VERSION:=20170329-3.1
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
@@ -16,7 +16,7 @@ PKG_LICENSE:=BSD-3-Clause
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://thrysoee.dk/editline/
-PKG_MD5SUM:=b6e60f326a3fce91bea1a6fe4700af58
+PKG_HASH:=91f2d90fbd2a048ff6dad7131d9a39e690fd8a8fd982a353f1333dd4017dd4be
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL:=1
@@ -44,6 +44,9 @@ define Build/InstallDev
        
        $(INSTALL_DIR)                                          $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libedit.{a,so*}        $(1)/usr/lib/
+
+       $(INSTALL_DIR)                                          $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libedit.pc   $(1)/usr/lib/pkgconfig
 endef
 
 define Package/libedit/install
index 256d96399ccc30e1202c63a7b29db0539aac8ef0..a9cc4dd5a87484b6ca3bd707e476cadb3a5f5fde 100644 (file)
@@ -20,6 +20,7 @@ PKG_SOURCE_URL:=https://github.com/tru7/libesmtp.git
 PKG_SOURCE_VERSION=10e9a6df9f76da610941addf71b9a3cbf94f2e9f
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=6f703766be05cc0cd861790ee041d1c2910b6d6e7bb8805ed739839c7801bfcc
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
index e3b4d6bf030828386b46b1f821430621b9d85813..35af1e28b7d86cc811927d42556b3bef2644b75f 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=http://libestr.adiscon.com/files/download/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=f4c9165a23587e77f7efe65d676d5e8e
+PKG_HASH:=bd655e126e750edd18544b88eb1568d200a424a0c23f665eb14bbece07ac703c
 
 PKG_MAINTAINER:=Dov Murik <dmurik@us.ibm.com>
 PKG_LICENSE:=LGPL-2.1+
index 24b04643698e4018358f5e9f3d891b9b06333e9e..cf9e111d188e4eee856f82ef84a686c3e39b81b0 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://dist.schmorp.de/libev/Attic/
-PKG_MD5SUM:=bf0007e37240103d3c2be80ca9bee3f9
+PKG_HASH:=736079e8ac543c74d59af73f9c52737b3bfec9601f020bf25a87a4f4d0f01bd6
 PKG_LICENSE:=BSD-2-Clause
 PKG_MAINTAINER:=Karl Palsson <karlp@tweak.net.au>
 
index dd8cef51422f405c700f1121ef2e2f161e72c4f9..c0847a6fbcd03f451af618862240cdc807086e3f 100644 (file)
@@ -1,6 +1,3 @@
-#
-# Copyright (C) 2007-2015 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -8,12 +5,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libevdev
-PKG_VERSION:=1.4.6
+PKG_VERSION:=1.5.6
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.freedesktop.org/software/libevdev/
-PKG_MD5SUM:=9b3f25bd8fb0f8efa4944d34668dddc0
+PKG_HASH:=ecec7e9d66b1d3692f10b3b20aa97fb25e874a784c5552a7b1698091fef5a688
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
diff --git a/libs/libevent/Makefile b/libs/libevent/Makefile
deleted file mode 100644 (file)
index 3dea702..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# Copyright (C) 2006-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:=libevent
-PKG_VERSION:=1.4.15
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-release-$(PKG_VERSION)-stable
-PKG_SOURCE:=release-$(PKG_VERSION)-stable.tar.gz
-PKG_SOURCE_URL:=https://github.com/libevent/libevent/archive/
-PKG_MD5SUM:=6dce6fe39f133c09ffe63de895805f7f
-PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/libevent
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=Event notification library (legacy)
-  DEPENDS:=+librt
-  URL:=http://www.libevent.org
-endef
-
-define Package/libevent/description
-       The libevent API provides a mechanism to execute a callback function
-       when a specific event occurs on a file descriptor or after a timeout
-       has been reached. Furthermore, libevent also support callbacks due
-       to signals or regular timeouts.
-
-       libevent is meant to replace the event loop found in event driven
-       network servers. An application just needs to call event_dispatch()
-       and then add or remove events dynamically without having to change
-       the event loop.
-endef
-
-TARGET_CFLAGS += $(FPIC)
-
-CONFIGURE_ARGS += \
-       --enable-shared \
-       --enable-static \
-
-MAKE_FLAGS += \
-       CFLAGS="$(TARGET_CFLAGS)" \
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/include/libevent
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/libevent/
-       $(INSTALL_DIR) $(1)/usr/lib/libevent
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so} $(1)/usr/lib/libevent/
-endef
-
-define Package/libevent/install
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,libevent))
diff --git a/libs/libevhtp/Makefile b/libs/libevhtp/Makefile
new file mode 100644 (file)
index 0000000..09e8222
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# NOTE: please DO NOT update this package without the maintainer's consent.
+# See https://github.com/haiwen/seafile/issues/1119
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libevhtp
+PKG_VERSION:=1.1.6
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://chromium.googlesource.com/external/github.com/ellzey/libevhtp
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=91071e2f20749cd469b87ac2ef1c158dc2a6806f
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=c9c4415539e78ac9021a8507cd16b9101564dd03286bc84428cc1ee11f0df1fd
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libevhtp
+    SECTION:=libs
+    CATEGORY:=Libraries
+    TITLE:=A more flexible replacement for libevent's httpd API
+    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+    URL:=https://github.com/ellzey/libevhtp
+    DEPENDS:=+libevent2 +libevent2-openssl +libevent2-pthreads +libopenssl +libpthread
+endef
+
+define Package/libevhtp/description
+   Libevhtp was created as a replacement API for Libevent's current HTTP API.
+   The reality of libevent's http interface is that it was created as a JIT server,
+   meaning the developer never thought of it being used for creating a full-fledged HTTP service.
+endef
+
+include $(INCLUDE_DIR)/cmake.mk
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/{include,lib}
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libevhtp))
diff --git a/libs/libevhtp/patches/010-strcmp-endianness-fix.patch b/libs/libevhtp/patches/010-strcmp-endianness-fix.patch
new file mode 100644 (file)
index 0000000..072b76b
--- /dev/null
@@ -0,0 +1,49 @@
+diff -rupN libevhtp-1.2.9.orig/htparse/htparse.c libevhtp-1.2.9/htparse/htparse.c
+--- libevhtp-1.2.9.orig/htparse/htparse.c      2014-03-23 12:50:50.000000000 +0100
++++ libevhtp-1.2.9/htparse/htparse.c   2014-12-09 01:12:22.242001241 +0100
+@@ -197,6 +197,7 @@ static const char * method_strmap[] = {
+ #define _MIN_READ(a, b) ((a) < (b) ? (a) : (b))
++#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ #define _str3_cmp(m, c0, c1, c2, c3) \
+     *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0)
+@@ -226,6 +227,37 @@ static const char * method_strmap[] = {
+     *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0)        \
+     && ((uint32_t *)m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4) \
+     && m[8] == c8
++#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
++#define _str3_cmp(m, c0, c1, c2, c3) \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)
++
++#define _str3Ocmp(m, c0, c1, c2, c3) \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)
++
++#define _str4cmp(m, c0, c1, c2, c3) \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)
++
++#define _str5cmp(m, c0, c1, c2, c3, c4)                          \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
++    && m[4] == c4
++
++#define _str6cmp(m, c0, c1, c2, c3, c4, c5)                      \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
++    && (((uint32_t *)m)[1] & 0xffff0000) == ((c4 << 24) | c5 << 16)
++
++#define _str7_cmp(m, c0, c1, c2, c3, c4, c5, c6, c7)             \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
++    && ((uint32_t *)m)[1] == ((c4 << 24) | (c5 << 16) | (c6 << 8) | c7)
++
++#define _str8cmp(m, c0, c1, c2, c3, c4, c5, c6, c7)              \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
++    && ((uint32_t *)m)[1] == ((c4 << 24) | (c5 << 16) | (c6 << 8) | c7)
++
++#define _str9cmp(m, c0, c1, c2, c3, c4, c5, c6, c7, c8)                 \
++    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)        \
++    && ((uint32_t *)m)[1] == ((c4 << 24) | (c5 << 16) | (c6 << 8) | c7) \
++    && m[8] == c8
++#endif
+ #define __HTPARSE_GENHOOK(__n)                                                    \
+     static inline int hook_ ## __n ## _run(htparser * p, htparse_hooks * hooks) { \
index 05883047b18d301e4d7fcd8e7ea6d1a5ca9458b9..badfc350f52ce8c7489ae77cdc1d76d37f4e1e25 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/libexif
-PKG_MD5SUM:=27339b89850f28c8f1c237f233e05b27
+PKG_HASH:=16cdaeb62eb3e6dfab2435f7d7bccd2f37438d21c5218ec4e58efa9157d4d41a
 
 PKG_LICENSE:=LGPL-2.1
 PKG_LICENSE_FILES:=COPYING
index 914dd562ee9fc078a48e8dc074377d31ffb2e408..5bb2baac5c3528833647cbeae448aa3abf9108d6 100644 (file)
@@ -6,16 +6,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libextractor
-PKG_VERSION:=1.3
-PKG_RELEASE:=4
+PKG_VERSION:=1.6
+PKG_RELEASE:=1
 
 # ToDo:
 # - package missing optional dependencies: libexiv2, gsf, librpm, smf, tidy
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=35b8913dbebafe583a2781bf71509c48
-PKG_HASH:=868ad64c9a056d6b923d451d746935bffb1ddf5d89c3eb4f67d786001a3f7b7f
+PKG_HASH:=26d4adca2e381d2a0c8b3037ec85e094ac5d40485623794466cfc176f5bbf69d
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/libs/libextractor/patches/001-backport-support-for-giflib-5-1.patch b/libs/libextractor/patches/001-backport-support-for-giflib-5-1.patch
deleted file mode 100644 (file)
index 7b7a2df..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/src/plugins/gif_extractor.c
-+++ b/src/plugins/gif_extractor.c
-@@ -78,7 +78,11 @@ EXTRACTOR_gif_extract_method (struct EXT
-   if (gif_file == NULL || gif_error != 0)
-   {
-     if (gif_file != NULL)
-+#if GIFLIB_MAJOR < 5 || GIFLIB_MINOR < 1
-       EGifCloseFile (gif_file);
-+#else
-+      EGifCloseFile (gif_file, NULL);
-+#endif
-     return; /* not a GIF */
-   }
- #endif
-@@ -133,7 +137,11 @@ EXTRACTOR_gif_extract_method (struct EXT
-              DGifGetExtensionNext(gif_file, &ext)) &&
-             (NULL != ext) ) ; /* keep going */
-     }
-+#if defined (GIF_LIB_VERSION) || GIFLIB_MAJOR < 5 || GIFLIB_MINOR < 1
-   DGifCloseFile (gif_file);
-+#else
-+  DGifCloseFile (gif_file, NULL);
-+#endif
- }
- /* end of gif_extractor.c */
diff --git a/libs/libextractor/patches/002-ffmpeg2.9_api_backport.patch b/libs/libextractor/patches/002-ffmpeg2.9_api_backport.patch
deleted file mode 100644 (file)
index f875729..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
---- a/src/plugins/thumbnailffmpeg_extractor.c
-+++ b/src/plugins/thumbnailffmpeg_extractor.c
-@@ -59,6 +59,20 @@
- #include <ffmpeg/swscale.h>
- #endif
-+#if USE_JPEG
-+#ifdef PIX_FMT_YUVJ420P
-+#define PIX_OUTPUT_FORMAT PIX_FMT_YUVJ420P
-+#else
-+#define PIX_OUTPUT_FORMAT AV_PIX_FMT_YUVJ420P
-+#endif
-+#else
-+#ifdef PIX_FMT_RGB24
-+#define PIX_OUTPUT_FORMAT PIX_FMT_RGB24
-+#else
-+#define PIX_OUTPUT_FORMAT AV_PIX_FMT_RGB24
-+#endif
-+#endif
-+
- /**
-  * Set to 1 to enable debug output.
-  */ 
-@@ -153,7 +167,7 @@
- static size_t 
- create_thumbnail (int src_width, int src_height, 
-                 int src_stride[],
--                enum PixelFormat src_pixfmt, 
-+                enum AVPixelFormat src_pixfmt, 
-                 const uint8_t * const src_data[],
-                 int dst_width, int dst_height,
-                 uint8_t **output_data, 
-@@ -189,7 +203,8 @@
-   if (NULL == 
-       (scaler_ctx =
-        sws_getContext (src_width, src_height, src_pixfmt,
--                     dst_width, dst_height, PIX_FMT_RGB24, 
-+                     dst_width, dst_height,
-+                     PIX_OUTPUT_FORMAT, 
-                      SWS_BILINEAR, NULL, NULL, NULL)))
-     {
- #if DEBUG
-@@ -199,7 +214,12 @@
-       return 0;
-     }
--  if (NULL == (dst_frame = avcodec_alloc_frame ()))
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+  dst_frame = av_frame_alloc ();
-+#else
-+  dst_frame = avcodec_alloc_frame();
-+#endif
-+  if (NULL == dst_frame)
-     {
- #if DEBUG
-       fprintf (stderr,
-@@ -209,18 +229,24 @@
-       return 0;
-     }
-   if (NULL == (dst_buffer =
--             av_malloc (avpicture_get_size (PIX_FMT_RGB24, dst_width, dst_height))))
-+             av_malloc (avpicture_get_size (PIX_OUTPUT_FORMAT,
-+                                              dst_width, dst_height))))
-     {
- #if DEBUG
-       fprintf (stderr,
-                "Failed to allocate the destination image buffer\n");
- #endif
--      av_free (dst_frame);
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+      av_frame_free (&dst_frame);
-+#else
-+      avcodec_free_frame (&dst_frame);
-+#endif
-       sws_freeContext (scaler_ctx);
-       return 0;
-     }
-   avpicture_fill ((AVPicture *) dst_frame, dst_buffer,
--                  PIX_FMT_RGB24, dst_width, dst_height);
-+                  PIX_OUTPUT_FORMAT,
-+                  dst_width, dst_height);
-   sws_scale (scaler_ctx,
-              src_data, 
-              src_stride,
-@@ -236,7 +262,11 @@
-                "Failed to allocate the encoder output buffer\n");
- #endif
-       av_free (dst_buffer);
--      av_free (dst_frame);
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+      av_frame_free (&dst_frame);
-+#else
-+      avcodec_free_frame (&dst_frame);
-+#endif
-       sws_freeContext (scaler_ctx);
-       return 0;
-     }
-@@ -249,13 +279,17 @@
- #endif
-       av_free (encoder_output_buffer);
-       av_free (dst_buffer);
--      av_free (dst_frame);
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+      av_frame_free (&dst_frame);
-+#else
-+      avcodec_free_frame (&dst_frame);
-+#endif
-       sws_freeContext (scaler_ctx);
-       return 0;
-     }
-   encoder_codec_ctx->width = dst_width;
-   encoder_codec_ctx->height = dst_height;
--  encoder_codec_ctx->pix_fmt = PIX_FMT_RGB24;
-+  encoder_codec_ctx->pix_fmt = PIX_OUTPUT_FORMAT;
-   opts = NULL;
-   if (avcodec_open2 (encoder_codec_ctx, encoder_codec, &opts) < 0)
-     {
-@@ -263,10 +297,14 @@
-       fprintf (stderr,
-                "Failed to open the encoder\n");
- #endif
--      av_free (encoder_codec_ctx);
-+      avcodec_free_context (&encoder_codec_ctx);
-       av_free (encoder_output_buffer);
-       av_free (dst_buffer);
--      av_free (dst_frame);
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+      av_frame_free (&dst_frame);
-+#else
-+      avcodec_free_frame (&dst_frame);
-+#endif
-       sws_freeContext  (scaler_ctx);
-       return 0;
-     }
-@@ -295,9 +333,13 @@
- cleanup:
-   av_dict_free (&opts);
-   avcodec_close (encoder_codec_ctx);
--  av_free (encoder_codec_ctx);
-+  avcodec_free_context (&encoder_codec_ctx);
-   av_free (dst_buffer);
--  av_free (dst_frame);
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+  av_frame_free (&dst_frame);
-+#else
-+  avcodec_free_frame (&dst_frame);
-+#endif
-   sws_freeContext (scaler_ctx);
-   *output_data = encoder_output_buffer;
-@@ -406,18 +448,23 @@
-       fprintf (stderr,
-              "Failed to open image codec\n");
- #endif
--      av_free (codec_ctx);
-+      avcodec_free_context (&codec_ctx);
-       return;
-     }
-   av_dict_free (&opts);
--  if (NULL == (frame = avcodec_alloc_frame ()))
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+  frame = av_frame_alloc ();
-+#else
-+  frame = avcodec_alloc_frame();
-+#endif
-+  if (NULL == frame)
-     {
- #if DEBUG
-       fprintf (stderr,
-                "Failed to allocate frame\n");
- #endif
-       avcodec_close (codec_ctx);
--      av_free (codec_ctx);
-+      avcodec_free_context (&codec_ctx);
-       return;
-     }
-@@ -441,9 +488,13 @@
-       fprintf (stderr,
-              "Failed to decode a complete frame\n");
- #endif
--      av_free (frame);
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+      av_frame_free (&frame);
-+#else
-+      avcodec_free_frame (&frame);
-+#endif
-       avcodec_close (codec_ctx);
--      av_free (codec_ctx);
-+      avcodec_free_context (&codec_ctx);
-       return;
-     }
-   calculate_thumbnail_dimensions (codec_ctx->width, codec_ctx->height,
-@@ -467,9 +518,13 @@
-               err);
-       av_free (encoded_thumbnail);
-     }
--  av_free (frame);
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+  av_frame_free (&frame);
-+#else
-+  avcodec_free_frame (&frame);
-+#endif
-   avcodec_close (codec_ctx);
--  av_free (codec_ctx);
-+  avcodec_free_context (&codec_ctx);
- }
-@@ -563,7 +618,12 @@
-       return;
-     }
--  if (NULL == (frame = avcodec_alloc_frame ()))
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+  frame = av_frame_alloc ();
-+#else
-+  frame = avcodec_alloc_frame();
-+#endif
-+  if (NULL == frame)
-     {
- #if DEBUG
-       fprintf (stderr,
-@@ -616,7 +676,11 @@
-       fprintf (stderr,
-              "Failed to decode a complete frame\n");
- #endif
--      av_free (frame);
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+      av_frame_free (&frame);
-+#else
-+      avcodec_free_frame (&frame);
-+#endif
-       avcodec_close (codec_ctx);
-       avformat_close_input (&format_ctx);
-       av_free (io_ctx);
-@@ -643,7 +707,11 @@
-               err);
-       av_free (encoded_thumbnail);
-     }
--  av_free (frame);
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+  av_frame_free (&frame);
-+#else
-+  avcodec_free_frame (&frame);
-+#endif
-   avcodec_close (codec_ctx);
-   avformat_close_input (&format_ctx);
-   av_free (io_ctx);
---- a/src/plugins/previewopus_extractor.c
-+++ b/src/plugins/previewopus_extractor.c
-@@ -296,7 +296,12 @@
- /** Initialize one audio frame for reading from the input file */
- static int init_input_frame(AVFrame **frame)
- {
--    if (!(*frame = avcodec_alloc_frame())) {
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+    *frame = av_frame_alloc ();
-+#else
-+    *frame = avcodec_alloc_frame();
-+#endif
-+    if (NULL == *frame) {
-  #if DEBUG
-         fprintf(stderr, "Could not allocate input frame\n");
- #endif
-@@ -655,7 +660,11 @@
-         av_freep(&converted_input_samples[0]);
-         free(converted_input_samples);
-     }
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+    av_frame_free (&input_frame);
-+#else
-     avcodec_free_frame(&input_frame);
-+#endif
-     return ret;
- }
-@@ -671,7 +680,12 @@
-     int error;
-     /** Create a new frame to store the audio samples. */
--    if (!(*frame = avcodec_alloc_frame())) {
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+    *frame = av_frame_alloc ();
-+#else
-+    *frame = avcodec_alloc_frame();
-+#endif
-+    if (NULL == *frame) {
-         #if DEBUG
-               fprintf(stderr, "Could not allocate output frame\n");
-               #endif
-@@ -702,7 +716,11 @@
-         #if DEBUG
-               fprintf(stderr, "Could allocate output frame samples (error '%s')\n", get_error_text(error));
-               #endif
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+        av_frame_free (frame);
-+#else
-         avcodec_free_frame(frame);
-+#endif
-         return error;
-     }
-@@ -783,17 +801,29 @@
-         #if DEBUG
-               fprintf(stderr, "Could not read data from FIFO\n");
-               #endif
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+        av_frame_free (&output_frame);
-+#else
-         avcodec_free_frame(&output_frame);
-+#endif
-         return AVERROR_EXIT;
-     }
-     /** Encode one frame worth of audio samples. */
-     if (encode_audio_frame(output_frame, output_format_context,
-                            output_codec_context, &data_written)) {
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+        av_frame_free (&output_frame);
-+#else
-         avcodec_free_frame(&output_frame);
-+#endif
-         return AVERROR_EXIT;
-     }
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+    av_frame_free (&output_frame);
-+#else
-     avcodec_free_frame(&output_frame);
-+#endif
-     return 0;
- }
- /** Write the trailer of the output file container. */
-@@ -907,7 +937,12 @@
-       return;
-     }
--  if (NULL == (frame = avcodec_alloc_frame ()))
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
-+  frame = av_frame_alloc ();
-+#else
-+  frame = avcodec_alloc_frame();
-+#endif
-+  if (NULL == frame)
-     {
- #if DEBUG
-       fprintf (stderr,
index 384a417eee4892d6b4b31c1d1b177f2e78a1329a..e8974e02adb99af336e208b26f47d7e14f6ba7d4 100644 (file)
@@ -12,6 +12,7 @@ PKG_VERSION:=0.99.2
 PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=66676a4c8de8c5399dfe1cfd064d140afca58e3d8187bae0a3dccdf83165d9d1
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/rsyslog/libfastjson.git
index a967d6acaf89d23c12a156cf277d3724b623b394..be1763c93dc29ed7620209e58364d394d9db6b03 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libffi
 PKG_VERSION:=3.2.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://sourceware.org/pub/libffi/
-PKG_MD5SUM:=83b89587607e3eb65c70d361f13bab43
+PKG_HASH:=d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE
@@ -78,5 +78,15 @@ define Package/libffi/install
                $(1)/usr/lib/
 endef
 
+define Host/Install
+       $(call Host/Install/Default)
+       # Adjust host libffi headers ; the default rule does
+       # not seem to install them to the proper include folder
+       $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/include
+       $(CP) \
+               $(STAGING_DIR_HOSTPKG)/lib/libffi-$(PKG_VERSION)/include/*.h \
+               $(STAGING_DIR_HOSTPKG)/include
+endef
+
 $(eval $(call HostBuild))
 $(eval $(call BuildPackage,libffi))
index 6f6235c43efca1a72cb6d4e6bde2b805f817270f..ba9b09a4531eb5cf30bc55038ffdba619502334d 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.intra2net.com/en/developer/libftdi/download/
-PKG_MD5SUM:=355d4474e3faa81b485d6a604b06951f
+PKG_HASH:=3176d5b5986438f33f5208e690a8bfe90941be501cc0a72118ce3d338d4b838e
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=LGPL-2.0
index cf2ba17ae8c25fc310a4669b0ef0cd39fc70e301..35c3bf006145760947cb8eedf48c6d04b0c9daad 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2014-2016 OpenWrt.org
+# Copyright (C) 2014-2017 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:=libftdi1
-PKG_VERSION:=1.3
+PKG_VERSION:=1.4
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.intra2net.com/en/developer/libftdi/download/
-PKG_MD5SUM:=156cdf40cece9f8a3ce1582db59a502a
+PKG_HASH:=ec36fb49080f834690c24008328a5ef42d3cf584ef4060f3a35aa4681cb31b74
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=LGPL-2.0
index 46a954662b0868eba2ab6624cc6b2b9173f4dc67..6f52546f482e0f94d41ae5a214a06abe4851a167 100644 (file)
@@ -9,13 +9,15 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libgcrypt
 PKG_VERSION:=1.6.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=ftp://ftp.gnupg.org/gcrypt/libgcrypt
-PKG_MD5SUM:=944cf6595021d0c33478148a315b335b
+PKG_SOURCE_URL:=https://www.gnupg.org/ftp/gcrypt/libgcrypt/
+PKG_HASH:=f9461b4619bb78b273a88d468915750d418e89a3ea3b641bab0563a9af4b04d0
+PKG_LICENSE:=LGPL-2.1+ GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
 
-PKG_FIXUP:=patch-libtool
+PKG_FIXUP:=autoreconf patch-libtool
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 
diff --git a/libs/libgcrypt/patches/002-Add-configure-option-enable-build-timestamp.patch b/libs/libgcrypt/patches/002-Add-configure-option-enable-build-timestamp.patch
new file mode 100644 (file)
index 0000000..49c3991
--- /dev/null
@@ -0,0 +1,43 @@
+From a785cc3db0c4e8eb8ebbf784b833a40d2c42ec3e Mon Sep 17 00:00:00 2001
+From: Werner Koch <wk@gnupg.org>
+Date: Tue, 25 Aug 2015 21:11:05 +0200
+Subject: [PATCH] Add configure option --enable-build-timestamp.
+
+* configure.ac (BUILD_TIMESTAMP): Set to "<none>" by default.
+--
+
+This is based on
+libgpg-error commit d620005fd1a655d591fccb44639e22ea445e4554
+but changed to be disabled by default.  Check there for some
+background.
+
+Signed-off-by: Werner Koch <wk@gnupg.org>
+---
+ configure.ac | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 48e217947287..2acfa3630cac 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2272,7 +2272,16 @@ changequote([,])dnl
+ BUILD_FILEVERSION="${BUILD_FILEVERSION}mym4_revision_dec"
+ AC_SUBST(BUILD_FILEVERSION)
+-BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
++AC_ARG_ENABLE([build-timestamp],
++  AC_HELP_STRING([--enable-build-timestamp],
++                 [set an explicit build timestamp for reproducibility.
++                  (default is the current time in ISO-8601 format)]),
++     [if test "$enableval" = "yes"; then
++        BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
++      else
++        BUILD_TIMESTAMP="$enableval"
++      fi],
++     [BUILD_TIMESTAMP="<none>"])
+ AC_SUBST(BUILD_TIMESTAMP)
+ AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
+                    [The time this package was configured for a build])
+-- 
+2.15.1
+
index 3749982641bf7e200f2c550321d4af09eea83085..8d4fc08a594ed99e72c0b3b66891e0dbeb2c5c2b 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libgd
-PKG_VERSION:=2.1.1
+PKG_VERSION:=2.2.5
 PKG_RELEASE:=1
 
-PKG_SOURCE:=gd-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/libgd/libgd/archive
-PKG_MD5SUM:=e91a1a99903e460e7ba00a794e72cc1e
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/$(PKG_NAME)/$(PKG_NAME)/releases/download/gd-$(PKG_VERSION)/
+PKG_HASH:=8c302ccbf467faec732f0741a859eef4ecae22fea2d2ab87467be940842bde51
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 PKG_LICENSE:=MIT
 
@@ -21,16 +21,16 @@ PKG_FIXUP:=autoreconf
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
-PKG_BUILD_DIR:=$(BUILD_DIR)/libgd-gd-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
 define Package/libgd
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+libjpeg +libpng
+  DEPENDS:=+libjpeg +libpng +LIBGD_TIFF:libtiff +LIBGD_FREETYPE:libfreetype
   TITLE:=The GD graphics library
   URL:=http://www.libgd.org/
+  MENU:=1
 endef
 
 define Package/libgd/description
@@ -38,6 +38,23 @@ define Package/libgd/description
   programmers. GD creates PNG, JPEG and GIF images, among other formats.
 endef
 
+define Package/libgd/config
+       if PACKAGE_libgd
+               config LIBGD_TIFF
+                       bool "TIFF image support"
+                       default n
+                       help
+                               Enable TIFF image support through libtiff
+       endif
+       if PACKAGE_libgd
+               config LIBGD_FREETYPE
+                       bool "Freetype 2.x library support"
+                       default n
+                       help
+                               Enable Freetype 2.x font engine support through libfreetype
+       endif
+endef
+
 TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
@@ -46,15 +63,27 @@ CONFIGURE_ARGS += \
        --disable-rpath \
        --without-x \
        --without-fontconfig \
-       --without-freetype \
        --with-jpeg=$(STAGING_DIR)/usr \
        --with-png=$(STAGING_DIR)/usr \
-       --with-vpx=no \
-       --without-xpm \
-       --without-iconv
+       --without-xpm
+
+ifdef CONFIG_LIBGD_TIFF
+       CONFIGURE_ARGS+= \
+               --with-tiff=$(STAGING_DIR)/usr
+else
+       CONFIGURE_ARGS+= \
+               --without-tiff
+endif
+
+ifdef CONFIG_LIBGD_FREETYPE
+       CONFIGURE_ARGS+= \
+               --with-freetype=$(STAGING_DIR)/usr
+else
+       CONFIGURE_ARGS+= \
+               --without-freetype
+endif
 
 CONFIGURE_VARS += \
-       LIBPNG12_CONFIG="$(STAGING_DIR_HOSTPKG)/bin/libpng12-config" \
        ac_cv_header_iconv_h=no
 
 define Build/InstallDev
@@ -65,7 +94,7 @@ define Build/InstallDev
                $(1)/usr/bin/gdlib-config
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/entities.h $(1)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/gd{,_io,cache,fontg,fontl,fontmb,fonts,fontt,fx}.h \
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/gd{,_color_map,_errors,_io,cache,fontg,fontl,fontmb,fonts,fontt,fx,pp}.h \
                $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgd.{a,la,so*} $(1)/usr/lib/
index e51502cacf255c963025eaf01cb92335c826e0fc..b0d82b7279d2c915ed0a884f1ffb659b5de24f95 100644 (file)
@@ -1,6 +1,6 @@
 --- a/config/gdlib-config.in
 +++ b/config/gdlib-config.in
-@@ -71,7 +71,7 @@ while test $# -gt 0; do
+@@ -74,7 +74,7 @@ while test $# -gt 0; do
        echo @LDFLAGS@
        ;;
      --libs)
@@ -9,7 +9,7 @@
        ;;
      --cflags|--includes)
        echo -I@includedir@
-@@ -84,7 +84,7 @@ while test $# -gt 0; do
+@@ -87,7 +87,7 @@ while test $# -gt 0; do
        echo "includedir: $includedir"
        echo "cflags:     -I@includedir@"
        echo "ldflags:    @LDFLAGS@"
diff --git a/libs/libgd/patches/102-gdlib-pc-in.patch b/libs/libgd/patches/102-gdlib-pc-in.patch
new file mode 100644 (file)
index 0000000..79baeb3
--- /dev/null
@@ -0,0 +1,9 @@
+--- a/config/gdlib.pc.in
++++ b/config/gdlib.pc.in
+@@ -7,5 +7,5 @@ Name: gd
+ Description: GD graphics library
+ Version: @VERSION@
+ Cflags: -I${includedir}
+-Libs.private: @LIBS@ @LIBICONV@
++Libs.private: @LIBS@ 
+ Libs: -L${libdir} -lgd
index 8d2aa123334d7e751667b007a3a534e3b2db1429..1b4fc8e31de8c1d2061f9eb6359dec64b8048d77 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/gd_bmp.c
 +++ b/src/gd_bmp.c
-@@ -21,6 +21,7 @@
+@@ -28,6 +28,7 @@
  #include <math.h>
  #include <string.h>
  #include <stdlib.h>
@@ -8,7 +8,7 @@
  #include "gd.h"
  #include "gdhelpers.h"
  #include "bmp.h"
-@@ -42,6 +43,13 @@ static int bmp_read_rle(gdImagePtr im, g
+@@ -49,6 +50,13 @@ static int bmp_read_rle(gdImagePtr im, g
  
  #define BMP_DEBUG(s)
  
index 27b353c16679c9517dc9839ff01456efcd6969f9..645bf307a31363dae7a86bebd0b87745f635a553 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libgee
-PKG_VERSION:=0.18.0
+PKG_VERSION:=0.20.0
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
@@ -17,8 +17,8 @@ PKG_LICENSE:=LGPL-2.1
 PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=@GNOME/libgee/0.18/
-PKG_MD5SUM:=29ea6125e653d7e60b49a9a9544abc96
+PKG_SOURCE_URL:=@GNOME/libgee/0.20/
+PKG_HASH:=21308ba3ed77646dda2e724c0e8d5a2f8d101fb05e078975a532d7887223c2bb
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index caa6e16e6c620a7454967ed40dad5bd9b4780025..fd30e4507afbf1c73c06055d144414b0002b5efd 100644 (file)
@@ -1,10 +1,11 @@
-diff -u --recursive libgee-0.18.0-vanilla/configure.ac libgee-0.18.0/configure.ac
---- libgee-0.18.0-vanilla/configure.ac 2015-03-23 23:24:39.000000000 -0400
-+++ libgee-0.18.0/configure.ac 2015-10-18 07:25:39.474698663 -0400
-@@ -64,10 +64,6 @@
+diff -u --recursive libgee-0.20.0-vanilla/configure.ac libgee-0.20.0/configure.ac
+--- libgee-0.20.0-vanilla/configure.ac 2018-01-07 20:42:52.827537620 -0500
++++ libgee-0.20.0/configure.ac 2018-01-07 20:43:25.128645499 -0500
+@@ -65,11 +65,6 @@
                enable_consistency_check=$enableval, enable_consistency_check=no)
  AS_IF([test "x$enable_consistency_check" != xno], [VALA_ADD_VALAFLAGS(-D CONSISTENCY_CHECKS)])
  
+-AX_REQUIRE_DEFINED([GOBJECT_INTROSPECTION_CHECK])
 -GOBJECT_INTROSPECTION_CHECK([0.9.0])
 -
 -VALA_CHECK([0.25.1])
@@ -12,9 +13,9 @@ diff -u --recursive libgee-0.18.0-vanilla/configure.ac libgee-0.18.0/configure.a
  AC_OUTPUT([Makefile
             gee-0.8.pc
             benchmark/Makefile
-diff -u --recursive libgee-0.18.0-vanilla/gee/Makefile.am libgee-0.18.0/gee/Makefile.am
---- libgee-0.18.0-vanilla/gee/Makefile.am      2015-03-16 11:23:57.000000000 -0400
-+++ libgee-0.18.0/gee/Makefile.am      2015-10-18 10:41:49.759314756 -0400
+diff -u --recursive libgee-0.20.0-vanilla/gee/Makefile.am libgee-0.20.0/gee/Makefile.am
+--- libgee-0.20.0-vanilla/gee/Makefile.am      2018-01-07 20:42:52.829537627 -0500
++++ libgee-0.20.0/gee/Makefile.am      2018-01-07 20:43:48.332722990 -0500
 @@ -146,29 +146,6 @@
        gee-0.8.vapi \
        $(NULL)
@@ -45,10 +46,10 @@ diff -u --recursive libgee-0.18.0-vanilla/gee/Makefile.am libgee-0.18.0/gee/Make
  MOSTLYCLEANFILES = \
        $(libgee_0_8_la_VALASOURCES:.vala=.c) \
        libgee_0_8_la_vala.stamp \
-diff -u --recursive libgee-0.18.0-vanilla/gee/Makefile.in libgee-0.18.0/gee/Makefile.in
---- libgee-0.18.0-vanilla/gee/Makefile.in      2015-03-23 23:25:03.000000000 -0400
-+++ libgee-0.18.0/gee/Makefile.in      2015-10-18 11:02:34.888709559 -0400
-@@ -285,14 +285,6 @@
+diff -u --recursive libgee-0.20.0-vanilla/gee/Makefile.in libgee-0.20.0/gee/Makefile.in
+--- libgee-0.20.0-vanilla/gee/Makefile.in      2018-01-07 20:42:52.830537630 -0500
++++ libgee-0.20.0/gee/Makefile.in      2018-01-07 20:44:18.433823516 -0500
+@@ -297,14 +297,6 @@
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
  INSTALL_SCRIPT = @INSTALL_SCRIPT@
  INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
@@ -63,7 +64,7 @@ diff -u --recursive libgee-0.18.0-vanilla/gee/Makefile.in libgee-0.18.0/gee/Make
  LCOV = @LCOV@
  LD = @LD@
  LDFLAGS = @LDFLAGS@
-@@ -531,25 +523,6 @@
+@@ -544,25 +536,6 @@
        gee-0.8.vapi \
        $(NULL)
  
@@ -89,7 +90,7 @@ diff -u --recursive libgee-0.18.0-vanilla/gee/Makefile.in libgee-0.18.0/gee/Make
  MOSTLYCLEANFILES = \
        $(libgee_0_8_la_VALASOURCES:.vala=.c) \
        libgee_0_8_la_vala.stamp \
-@@ -1607,9 +1580,6 @@
+@@ -1621,9 +1594,6 @@
  
  $(libgee_0_8_la_VALASOURCES:.vala=.c): libgee_0_8_la_vala.stamp
  gee-0.8.vapi gee-internals-0.8.vapi gee.h gee-internals.h: libgee_0_8_la_vala.stamp
diff --git a/libs/libglog/Makefile b/libs/libglog/Makefile
new file mode 100644 (file)
index 0000000..2ab3263
--- /dev/null
@@ -0,0 +1,52 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=glog
+PKG_RELEASE:=1
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/google/glog.git
+PKG_SOURCE_VERSION:=v0.3.5
+PKG_MIRROR_HASH:=4677fba927e2d9cdcbc518c34c88465260d506d88072ea16217a8171310b9a1c
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_LICENSE_FILE:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/glog
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=C++ implementation of the Google logging module
+  DEPENDS:= +libstdcpp +libpthread
+  URL:=https://github.com/google/glog
+  MAINTAINER:=Amir Sabbaghi <amir@pichak.co>
+endef
+
+define Package/glog/description
+  This repository contains a C++ implementation of the Google logging
+  module.  Documentation for the implementation is in doc/.
+endef
+
+TARGET_CXXFLAGS+=-std=c++11
+TARGET_LDFLAGS+=-lpthread
+
+define Build/Configure
+       $(call Build/Configure/Default,)
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/glog
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/glog/*.h $(1)/usr/include/glog
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libglog.{a,so*} $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libglog.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/glog/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libglog.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,glog))
index 27e5e0954ec07e6da4753ca190a8f0ac6d772ca8..6e93effeb5953b697546faec371c94b0ad7c8c93 100644 (file)
@@ -13,7 +13,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.gnupg.org/gcrypt/libgpg-error
-PKG_MD5SUM:=8f0eb41a344d19ac2aa9bd101dfb9ce6
+PKG_HASH:=cafc9ed6a87c53a35175d5a1220a96ca386696eef2fa059cc0306211f246e55f
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
diff --git a/libs/libgphoto2/Makefile b/libs/libgphoto2/Makefile
new file mode 100644 (file)
index 0000000..b5af7f1
--- /dev/null
@@ -0,0 +1,884 @@
+#
+# Copyright (C) 2006-2012 OpenWrt.org
+# Copyright (C) 2017      Leonardo Medici
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libgphoto2
+PKG_VERSION:=2.5.16
+PKG_RELEASE:=1
+PORT_VERSION:=0.12.0
+PKG_MAINTAINER:=Leonardo Medici <leonardo_medici@me.com>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/gphoto
+PKG_HASH:=e757416d1623e01a9d0d294b2e790162e434c0964f50d3b7ff1a3424b62a2906
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_LIBTOOL_PATHS:=. libgphoto2_port
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/libgphoto2/Default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=http://www.gphoto.org/
+endef
+
+define Package/libgphoto2
+  $(call Package/libgphoto2/Default)
+  DEPENDS:=+libpthread +libltdl +libusb-compat +libusb-1.0 $(ICONV_DEPENDS)
+  TITLE:=The basic library of the gphoto2 program, version $(PKG_VERSION).
+  MENU:=1
+endef
+
+define Package/libgphoto2-port
+  $(call Package/libgphoto2/Default)
+  DEPENDS:=libgphoto2 +libusb-1.0 +libusb-compat
+  TITLE:=Gphoto2 drivers for connect cameras
+endef
+
+define Package/libgphoto2-drivers-adc65
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for adc65 cameras
+endef
+
+define Package/libgphoto2-drivers-agfa_cl20
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for agfa_cl20 cameras
+endef
+
+define Package/libgphoto2-drivers-aox
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for aox cameras
+endef
+
+define Package/libgphoto2-drivers-ax203
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for ax203 cameras
+endef
+
+define Package/libgphoto2-drivers-barbie
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for barbie cameras
+endef
+
+define Package/libgphoto2-drivers-canon
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for canon cameras
+endef
+
+define Package/libgphoto2-drivers-casio_qv
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for casio_qv cameras
+endef
+
+define Package/libgphoto2-drivers-clicksmart310
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for clicksmart310 cameras
+endef
+
+define Package/libgphoto2-drivers-digigr8
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for digigr8 cameras
+endef
+
+define Package/libgphoto2-drivers-digita
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for digita cameras
+endef
+
+define Package/libgphoto2-drivers-dimera3500
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for dimera3500 cameras
+endef
+
+define Package/libgphoto2-drivers-directory
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for directory cameras
+endef
+
+define Package/libgphoto2-drivers-enigma13
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for enigma13 cameras
+endef
+
+define Package/libgphoto2-drivers-fuji
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for fuji cameras
+endef
+
+define Package/libgphoto2-drivers-gsmart300
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for gsmart300 cameras
+endef
+
+define Package/libgphoto2-drivers-hp215
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for hp215 cameras
+endef
+
+define Package/libgphoto2-drivers-iclick
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for iclick cameras
+endef
+
+define Package/libgphoto2-drivers-jamcam
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for jamcam cameras
+endef
+
+define Package/libgphoto2-drivers-jd11
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for jd11 cameras
+endef
+
+define Package/libgphoto2-drivers-jl2005a
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for jl2005a cameras
+endef
+
+define Package/libgphoto2-drivers-jl2005c
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for jl2005c cameras
+endef
+
+define Package/libgphoto2-drivers-kodak_dc120
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for kodak_dc120 cameras
+endef
+
+define Package/libgphoto2-drivers-kodak_dc210
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for kodak_dc210 cameras
+endef
+
+define Package/libgphoto2-drivers-kodak_dc240
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for kodak_dc240 cameras
+endef
+
+define Package/libgphoto2-drivers-kodak_dc3200
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for kodak_dc3200 cameras
+endef
+
+define Package/libgphoto2-drivers-kodak_ez200
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for kodak_ez200 cameras
+endef
+
+define Package/libgphoto2-drivers-konica
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for konica cameras
+endef
+
+define Package/libgphoto2-drivers-konica_qm150
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for konica_qm150 cameras
+endef
+
+define Package/libgphoto2-drivers-largan
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for largan cameras
+endef
+
+define Package/libgphoto2-drivers-lg_gsm
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for lg_gsm cameras
+endef
+
+define Package/libgphoto2-drivers-mars
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for mars cameras
+endef
+
+define Package/libgphoto2-drivers-dimagev
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for dimagev cameras
+endef
+
+define Package/libgphoto2-drivers-mustek
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for mustek cameras
+endef
+
+define Package/libgphoto2-drivers-panasonic_coolshot
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for panasonic_coolshot cameras
+endef
+
+define Package/libgphoto2-drivers-panasonic_l859
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for panasonic_l859 cameras
+endef
+
+define Package/libgphoto2-drivers-panasonic_dc1000
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for panasonic_dc1000 cameras
+endef
+
+define Package/libgphoto2-drivers-panasonic_dc1580
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for panasonic_dc1580 cameras
+endef
+
+define Package/libgphoto2-drivers-pccam300
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for pccam300 cameras
+endef
+
+define Package/libgphoto2-drivers-pccam600
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for pccam600 cameras
+endef
+
+define Package/libgphoto2-drivers-pentax
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for pentax cameras
+endef
+
+define Package/libgphoto2-drivers-polaroid_pdc320
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for polaroid_pdc320 cameras
+endef
+
+define Package/libgphoto2-drivers-polaroid_pdc640
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for polaroid_pdc640 cameras
+endef
+
+define Package/libgphoto2-drivers-polaroid_pdc700
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for polaroid_pdc700 cameras
+endef
+
+define Package/libgphoto2-drivers-ptp2
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for ptp2 cameras
+endef
+
+define Package/libgphoto2-drivers-ricoh
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for ricoh cameras
+endef
+
+define Package/libgphoto2-drivers-ricoh_g3
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for ricoh_g3 cameras
+endef
+
+define Package/libgphoto2-drivers-samsung
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for samsung cameras
+endef
+
+define Package/libgphoto2-drivers-sierra
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for sierra cameras
+endef
+
+define Package/libgphoto2-drivers-sipix_blink2
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for sipix_blink2 cameras
+endef
+
+define Package/libgphoto2-drivers-sipix_web2
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for sipix_web2 cameras
+endef
+
+define Package/libgphoto2-drivers-smal
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for smal cameras
+endef
+
+define Package/libgphoto2-drivers-sonix
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for sonix cameras
+endef
+
+define Package/libgphoto2-drivers-sony_dscf1
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for sony_dscf1 cameras
+endef
+
+define Package/libgphoto2-drivers-sony_dscf55
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for sony_dscf55 cameras
+endef
+
+define Package/libgphoto2-drivers-soundvision
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for soundvision cameras
+endef
+
+define Package/libgphoto2-drivers-spca50x
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for spca50x cameras
+endef
+
+define Package/libgphoto2-drivers-sq905
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for sq905 cameras
+endef
+
+define Package/libgphoto2-drivers-st2205
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for st2205 cameras
+endef
+
+define Package/libgphoto2-drivers-stv0674
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for stv0674 cameras
+endef
+
+define Package/libgphoto2-drivers-stv0680
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for stv0680 cameras
+endef
+
+define Package/libgphoto2-drivers-sx330z
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for sx330z cameras
+endef
+
+define Package/libgphoto2-drivers-topfield
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for topfield cameras
+endef
+
+define Package/libgphoto2-drivers-toshiba_pdrm11
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for toshiba_pdrm11 cameras
+endef
+
+define Package/libgphoto2-drivers-tp6801
+       $(call Package/libgphoto2/Default)
+       DEPENDS:=+libgphoto2-port
+       TITLE:=Gphoto2 drivers for tp6801 cameras
+endef
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --disable-rpath \
+       --with-camlibs="all" \
+       --with-gdlib=no \
+       --with-libexif=no \
+       --with-libusb=no \
+       --with-libusb-1.0=auto \
+       --with-libxml-2.0=no \
+       --without-included-ltdl \
+       --without-jpeg \
+       --without-libiconv-prefix \
+       --without-libintl-prefix \
+
+CONFIGURE_VARS += \
+       CPPFLAGS="$$$$CPPFLAGS $(ICONV_CFLAGS)" \
+       LDFLAGS="$$$$LDFLAGS $(ICONV_LDFLAGS)" \
+       LIBUSB_CFLAGS="$$$$CPPFLAGS" \
+       LIBUSB_LIBS="$$$$LDFLAGS -lusb" \
+       LIBS="-lltdl" \
+
+#      LIBEXIF_CFLAGS="$$$$CPPFLAGS" \
+#      LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \
+
+# If OpenWrt is using the iconv stub, we disable iconv support
+# in libgphoto2 entirely since the stub lacks some essential
+# conversions like UCS-2 to UTF-8 which will let certain drivers
+# fail with "Failed to create iconv converter" .
+ifneq ($(ICONV_FULL),1)
+  CONFIGURE_VARS += am_cv_func_iconv=no am_cv_lib_iconv=no
+endif
+
+MAKE_FLAGS += \
+       LIBLTDL="" \
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gphoto2{,-port}-config $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/gphoto2 $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgphoto2.pc $(1)/usr/lib/pkgconfig/
+       $(SED) 's,-I$$$${prefix}/include/gphoto2,,g' $(1)/usr/bin/gphoto2{,-port}-config
+       $(SED) 's,-I$$$${prefix}/include,,g' $(1)/usr/bin/gphoto2{,-port}-config
+       # remove annoying recursive symlink
+       rm -f $(1)/usr/include/gphoto2/gphoto2
+endef
+
+define Package/libgphoto2/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.so.* $(1)/usr/lib/
+       ln -s $(1)/usr/lib/libgphoto2_port.so.12 $(1)/usr/lib/libgphoto2_port.so.10
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/print-camera-list $(1)/usr/lib/libgphoto2/print-camera-list
+endef
+
+define Package/libgphoto2-port/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2_port/$(PORT_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2_port/$(PORT_VERSION)/*.so $(1)/usr/lib/libgphoto2_port/$(PORT_VERSION)
+endef
+
+define Package/libgphoto2-drivers-adc65/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/adc65.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-agfa_cl20/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/agfa_cl20.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-aox/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/aox.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-ax203/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/ax203.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-barbie/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/barbie.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-canon/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/canon.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-casio_qv/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/casio_qv.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-clicksmart310/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/clicksmart310.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-digigr8/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/digigr8.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-digita/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/digita.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-dimera3500/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/dimera3500.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-directory/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/directory.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-enigma13/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/enigma13.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-fuji/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/fuji.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-gsmart300/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/gsmart300.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-hp215/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/hp215.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-iclick/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/iclick.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-jamcam/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/jamcam.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-jd11/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/jd11.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-jl2005a/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/jl2005a.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-jl2005c/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/jl2005c.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-kodak_dc120/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/kodak_dc120.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-kodak_dc210/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/kodak_dc210.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-kodak_dc240/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/kodak_dc240.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-kodak_dc3200/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/kodak_dc3200.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-kodak_ez200/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/kodak_ez200.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-konica/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/konica.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-konica_qm150/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/konica_qm150.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-largan/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/largan.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-lg_gsm/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/lg_gsm.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-mars/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/mars.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-dimagev/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/dimagev.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-mustek/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/mustek.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-panasonic_coolshot/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/panasonic_coolshot.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-panasonic_l859/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/panasonic_l859.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-panasonic_dc1000/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/panasonic_dc1000.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-panasonic_dc1580/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/panasonic_dc1580.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-pccam300/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/pccam300.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-pccam600/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/pccam600.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-pentax/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/pentax.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-polaroid_pdc320/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/polaroid_pdc320.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-polaroid_pdc640/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/polaroid_pdc640.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-polaroid_pdc700/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/polaroid_pdc700.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-ptp2/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/ptp2.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-ricoh/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/ricoh.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-ricoh_g3/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/ricoh_g3.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-samsung/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/samsung.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-sierra/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/sierra.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-sipix_blink2/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/sipix_blink2.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-sipix_web2/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/sipix_web2.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-smal/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/smal.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-sonix/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/sonix.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-sony_dscf1/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/sony_dscf1.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-sony_dscf55/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/sony_dscf55.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-soundvision/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/soundvision.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-spca50x/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/spca50x.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-sq905/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/sq905.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-st2205/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/st2205.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-stv0674/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/stv0674.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-stv0680/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/stv0680.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-sx330z/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/sx330z.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-topfield/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/topfield.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-toshiba_pdrm11/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/toshiba_pdrm11.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+define Package/libgphoto2-drivers-tp6801/install
+       $(INSTALL_DIR) $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2/$(PKG_VERSION)/tp6801.so $(1)/usr/lib/libgphoto2/$(PKG_VERSION)
+endef
+
+$(eval $(call BuildPackage,libgphoto2))
+$(eval $(call BuildPackage,libgphoto2-port))
+$(eval $(call BuildPackage,libgphoto2-drivers-adc65))
+$(eval $(call BuildPackage,libgphoto2-drivers-agfa_cl20))
+$(eval $(call BuildPackage,libgphoto2-drivers-aox))
+$(eval $(call BuildPackage,libgphoto2-drivers-ax203))
+$(eval $(call BuildPackage,libgphoto2-drivers-barbie))
+$(eval $(call BuildPackage,libgphoto2-drivers-canon))
+$(eval $(call BuildPackage,libgphoto2-drivers-casio_qv))
+$(eval $(call BuildPackage,libgphoto2-drivers-clicksmart310))
+$(eval $(call BuildPackage,libgphoto2-drivers-digigr8))
+$(eval $(call BuildPackage,libgphoto2-drivers-digita))
+$(eval $(call BuildPackage,libgphoto2-drivers-dimera3500))
+$(eval $(call BuildPackage,libgphoto2-drivers-directory))
+$(eval $(call BuildPackage,libgphoto2-drivers-enigma13))
+$(eval $(call BuildPackage,libgphoto2-drivers-fuji))
+$(eval $(call BuildPackage,libgphoto2-drivers-gsmart300))
+$(eval $(call BuildPackage,libgphoto2-drivers-hp215))
+$(eval $(call BuildPackage,libgphoto2-drivers-iclick))
+$(eval $(call BuildPackage,libgphoto2-drivers-jamcam))
+$(eval $(call BuildPackage,libgphoto2-drivers-jd11))
+$(eval $(call BuildPackage,libgphoto2-drivers-jl2005a))
+$(eval $(call BuildPackage,libgphoto2-drivers-jl2005c))
+$(eval $(call BuildPackage,libgphoto2-drivers-kodak_dc120))
+$(eval $(call BuildPackage,libgphoto2-drivers-kodak_dc210))
+$(eval $(call BuildPackage,libgphoto2-drivers-kodak_dc240))
+$(eval $(call BuildPackage,libgphoto2-drivers-kodak_dc3200))
+$(eval $(call BuildPackage,libgphoto2-drivers-kodak_ez200))
+$(eval $(call BuildPackage,libgphoto2-drivers-konica))
+$(eval $(call BuildPackage,libgphoto2-drivers-konica_qm150))
+$(eval $(call BuildPackage,libgphoto2-drivers-largan))
+$(eval $(call BuildPackage,libgphoto2-drivers-lg_gsm))
+$(eval $(call BuildPackage,libgphoto2-drivers-mars))
+$(eval $(call BuildPackage,libgphoto2-drivers-dimagev))
+$(eval $(call BuildPackage,libgphoto2-drivers-mustek))
+$(eval $(call BuildPackage,libgphoto2-drivers-panasonic_coolshot))
+$(eval $(call BuildPackage,libgphoto2-drivers-panasonic_l859))
+$(eval $(call BuildPackage,libgphoto2-drivers-panasonic_dc1000))
+$(eval $(call BuildPackage,libgphoto2-drivers-panasonic_dc1580))
+$(eval $(call BuildPackage,libgphoto2-drivers-pccam300))
+$(eval $(call BuildPackage,libgphoto2-drivers-pccam600))
+$(eval $(call BuildPackage,libgphoto2-drivers-pentax))
+$(eval $(call BuildPackage,libgphoto2-drivers-polaroid_pdc320))
+$(eval $(call BuildPackage,libgphoto2-drivers-polaroid_pdc640))
+$(eval $(call BuildPackage,libgphoto2-drivers-polaroid_pdc700))
+$(eval $(call BuildPackage,libgphoto2-drivers-ptp2))
+$(eval $(call BuildPackage,libgphoto2-drivers-ricoh))
+$(eval $(call BuildPackage,libgphoto2-drivers-ricoh_g3))
+$(eval $(call BuildPackage,libgphoto2-drivers-samsung))
+$(eval $(call BuildPackage,libgphoto2-drivers-sierra))
+$(eval $(call BuildPackage,libgphoto2-drivers-sipix_blink2))
+$(eval $(call BuildPackage,libgphoto2-drivers-sipix_web2))
+$(eval $(call BuildPackage,libgphoto2-drivers-smal))
+$(eval $(call BuildPackage,libgphoto2-drivers-sonix))
+$(eval $(call BuildPackage,libgphoto2-drivers-sony_dscf1))
+$(eval $(call BuildPackage,libgphoto2-drivers-sony_dscf55))
+$(eval $(call BuildPackage,libgphoto2-drivers-soundvision))
+$(eval $(call BuildPackage,libgphoto2-drivers-spca50x))
+$(eval $(call BuildPackage,libgphoto2-drivers-sq905))
+$(eval $(call BuildPackage,libgphoto2-drivers-st2205))
+$(eval $(call BuildPackage,libgphoto2-drivers-stv0674))
+$(eval $(call BuildPackage,libgphoto2-drivers-stv0680))
+$(eval $(call BuildPackage,libgphoto2-drivers-sx330z))
+$(eval $(call BuildPackage,libgphoto2-drivers-topfield))
+$(eval $(call BuildPackage,libgphoto2-drivers-toshiba_pdrm11))
+$(eval $(call BuildPackage,libgphoto2-drivers-tp6801))
diff --git a/libs/libgphoto2/patches/001-automake-compat.patch b/libs/libgphoto2/patches/001-automake-compat.patch
new file mode 100644 (file)
index 0000000..fa70b54
--- /dev/null
@@ -0,0 +1,23 @@
+Index: libgphoto2-2.5.16/configure.ac
+===================================================================
+--- libgphoto2-2.5.16.orig/configure.ac
++++ libgphoto2-2.5.16/configure.ac
+@@ -209,7 +209,6 @@ ALL_LINGUAS="cs da de es eu fr hu it ja
+ GP_GETTEXT_HACK([${PACKAGE}-${LIBGPHOTO2_CURRENT_MIN}],[The gPhoto Team],[${MAIL_GPHOTO_TRANSLATION}])
+ AM_GNU_GETTEXT_VERSION([0.14.1])
+ AM_GNU_GETTEXT([external])
+-AM_PO_SUBDIRS()
+ AM_ICONV()
+ GP_GETTEXT_FLAGS()
+
+Index: libgphoto2-2.5.16/libgphoto2_port/configure.ac
+===================================================================
+--- libgphoto2-2.5.16.orig/libgphoto2_port/configure.ac
++++ libgphoto2-2.5.16/libgphoto2_port/configure.ac
+@@ -124,7 +124,6 @@ GP_GETTEXT_HACK([${PACKAGE}-${LIBGPHOTO2
+ ALL_LINGUAS="cs da de es eu fi fr it ja nl pl pt_BR ru sk sr sv uk vi zh_CN zh_TW"
+ AM_GNU_GETTEXT_VERSION([0.14.1])
+ AM_GNU_GETTEXT([external])
+-AM_PO_SUBDIRS()
+ AM_ICONV()
+ GP_GETTEXT_FLAGS()
diff --git a/libs/libgphoto2/patches/002-no-docs-examples-test-translations.patch b/libs/libgphoto2/patches/002-no-docs-examples-test-translations.patch
new file mode 100644 (file)
index 0000000..2bb0e0c
--- /dev/null
@@ -0,0 +1,95 @@
+Index: libgphoto2-2.5.16/Makefile.am
+===================================================================
+--- libgphoto2-2.5.16.orig/Makefile.am
++++ libgphoto2-2.5.16/Makefile.am
+@@ -8,7 +8,7 @@ bin_SCRIPTS = gphoto2-config
+ EXTRA_DIST = HACKING MAINTAINERS TESTERS installcheck.mk
+
+ # Note: @subdirs@ lists all the directories from AC_CONFIG_SUBDIRS()
+-SUBDIRS = @subdirs@ libgphoto2 camlibs tests examples po packaging doc gphoto-m4
++SUBDIRS = @subdirs@ libgphoto2 camlibs packaging gphoto-m4
+
+ EXTRA_DIST    += libgphoto2.pc.in
+ pkgconfig_DATA = libgphoto2.pc
+Index: libgphoto2-2.5.16/Makefile.in
+===================================================================
+--- libgphoto2-2.5.16.orig/Makefile.in
++++ libgphoto2-2.5.16/Makefile.in
+@@ -482,7 +482,7 @@ EXTRA_DIST = HACKING MAINTAINERS TESTERS
+       INSTALL README.in README README.packaging
+
+ # Note: @subdirs@ lists all the directories from AC_CONFIG_SUBDIRS()
+-SUBDIRS = @subdirs@ libgphoto2 camlibs tests examples po packaging doc gphoto-m4
++SUBDIRS = @subdirs@ libgphoto2 camlibs packaging gphoto-m4
+ pkgconfig_DATA = libgphoto2.pc
+ noinst_DATA = libgphoto2-uninstalled.pc
+ doc_DATA = AUTHORS COPYING NEWS ABOUT-NLS ChangeLog README \
+Index: libgphoto2-2.5.16/configure.ac
+===================================================================
+--- libgphoto2-2.5.16.orig/configure.ac
++++ libgphoto2-2.5.16/configure.ac
+@@ -635,20 +635,11 @@ gphoto-m4/Makefile
+ libgphoto2/Makefile
+ libgphoto2.pc
+ libgphoto2-uninstalled.pc
+-examples/Makefile
+-tests/Makefile
+-tests/ddb/Makefile
+-tests/ddb/check-ddb.sh
+ packaging/Makefile
+ packaging/linux-hotplug/Makefile
+ packaging/generic/Makefile
+ packaging/rpm/Makefile
+ packaging/rpm/package.spec
+-po/Makefile.in
+-doc/Makefile
+-doc/Doxyfile
+-doc/Doxyfile-internals
+-doc/api/Makefile
+ ],[
+ dnl This relies on this code being called for each of the above files
+ dnl with ac_file set to the filename.
+Index: libgphoto2-2.5.16/libgphoto2_port/Makefile.am
+===================================================================
+--- libgphoto2-2.5.16.orig/libgphoto2_port/Makefile.am
++++ libgphoto2-2.5.16/libgphoto2_port/Makefile.am
+@@ -25,7 +25,7 @@ udevscript_PROGRAMS =
+ bin_SCRIPTS = gphoto2-port-config
+
+ # The . stands for the current dir, i.e. the iolibs to build.
+-SUBDIRS = po libgphoto2_port test . doc gphoto-m4
++SUBDIRS = libgphoto2_port . gphoto-m4
+
+
+ ########################################################################
+Index: libgphoto2-2.5.16/libgphoto2_port/Makefile.in
+===================================================================
+--- libgphoto2-2.5.16.orig/libgphoto2_port/Makefile.in
++++ libgphoto2-2.5.16/libgphoto2_port/Makefile.in
+@@ -574,7 +574,7 @@ EXTRA_LTLIBRARIES = disk.la ptpip.la ser
+ bin_SCRIPTS = gphoto2-port-config
+
+ # The . stands for the current dir, i.e. the iolibs to build.
+-SUBDIRS = po libgphoto2_port test . doc gphoto-m4
++SUBDIRS = libgphoto2_port . gphoto-m4
+
+ ########################################################################
+ # All iolibs are defined as EXTRA_LTLIBRARIES. This requires that
+Index: libgphoto2-2.5.16/libgphoto2_port/configure.ac
+===================================================================
+--- libgphoto2-2.5.16.orig/libgphoto2_port/configure.ac
++++ libgphoto2-2.5.16/libgphoto2_port/configure.ac
+@@ -512,13 +512,10 @@ AC_SUBST([AM_LDFLAGS])
+ # ---------------------------------------------------------------------------
+ AC_CONFIG_FILES([
+ Makefile
+-po/Makefile.in
+ libgphoto2_port/Makefile
+ libgphoto2_port.pc
+ libgphoto2_port-uninstalled.pc
+ gphoto2-port-config
+-test/Makefile
+-doc/Makefile
+ gphoto-m4/Makefile
+ ])
+ AC_OUTPUT
diff --git a/libs/libgpiod/Makefile b/libs/libgpiod/Makefile
new file mode 100644 (file)
index 0000000..fff1fe5
--- /dev/null
@@ -0,0 +1,79 @@
+#
+# Copyright (C) 2018 Michael Heimpold <mhei@heimpold.de>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libgpiod
+PKG_VERSION:=1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@KERNEL/software/libs/libgpiod/
+PKG_HASH:=34c76b3730b9d4a1159bcb14000f78b1e890251b8a3823b794fa930654eabdd0
+
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+ifneq ($(CONFIG_PACKAGE_gpiod-tools),)
+CONFIGURE_ARGS += --enable-tools
+endif
+
+define Package/libgpiod
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
+  TITLE:=Library for interacting with Linux's GPIO character device
+  DEPENDS:=@GPIO_SUPPORT
+endef
+
+define Package/libgpiod/description
+  C library for interacting with the linux GPIO character device
+  (gpiod stands for GPIO device).
+endef
+
+define Package/gpiod-tools
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Tools for interacting with GPIO pins
+  DEPENDS:=+libgpiod
+endef
+
+define Package/gpiod-tools/description
+  Tools for interacting with the linux GPIO character device
+  (gpiod stands for GPIO device).
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/gpiod.h $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.{so*,a} $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgpiod.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libgpiod/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.so* $(1)/usr/lib/
+endef
+
+define Package/gpiod-tools/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libgpiod))
+$(eval $(call BuildPackage,gpiod-tools))
index fe28b4cab263f9bd4afb757e050ead2148c4c6e7..94cf8a1d16d339e5d3a98831a2cf09fbe9577ad0 100644 (file)
@@ -8,17 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libhttp-parser
-PKG_VERSION:=2.3.0
+PKG_VERSION:=2.8.0
 PKG_RELEASE=1
 PKG_MAINTAINER:=Ramanathan Sivagurunathan <ramzthecoder@gmail.com>
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE-MIT
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=83acea397da4cdb9192c27abbd53a9eb8e5a9e1bcea2873b499f7ccc0d68f518
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=git://github.com/joyent/http-parser.git
+PKG_SOURCE_URL:=git://github.com/nodejs/http-parser.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=56f7ad0e2e5a80f79d214015c91e1f17d11d109f
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
 
 
 include $(INCLUDE_DIR)/package.mk
@@ -27,7 +28,7 @@ define Package/libhttp-parser
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE:=A library to parse http request and response
-  URL:=https://github.com/joyent/http-parser
+  URL:=https://github.com/nodejs/http-parser
 endef
 
 define Package/libhttp-parser/description
@@ -48,13 +49,17 @@ define Build/InstallDev
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/http_parser.h $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/libhttp_parser.so.* $(1)/usr/lib/
-       ( cd $(1)/usr/lib ; ln -s libhttp_parser.so.* libhttp_parser.so )
+       (       cd $(1)/usr/lib ; \
+               ln -s libhttp_parser.so.$(PKG_VERSION) libhttp_parser.so ; \
+               ln -s libhttp_parser.so.$(PKG_VERSION) libhttp_parser.so.2.8 )
 endef
 
 define Package/libhttp-parser/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_BUILD_DIR)/libhttp_parser.so.* $(1)/usr/lib/
-       ( cd $(1)/usr/lib ; ln -s libhttp_parser.so.* libhttp_parser.so )
+       (       cd $(1)/usr/lib ; \
+               ln -s libhttp_parser.so.$(PKG_VERSION) libhttp_parser.so ; \
+               ln -s libhttp_parser.so.$(PKG_VERSION) libhttp_parser.so.2.8 )
 endef
 
 $(eval $(call BuildPackage,libhttp-parser))
index 4af4c859773bec33eb3c9734354239d35dbeadf7..2d47f75a54094f9dac36bb931a1ac1b8621969f1 100644 (file)
@@ -12,8 +12,8 @@ PKG_VERSION:=1.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=7c39b3448e4927a2de2775d853f52b3aaeb42400970a3db0b01a78987e6ec0b7
 PKG_SOURCE_URL:=@SF/freeassociation
-PKG_MD5SUM:=
 
 PKG_LICENSE:=LGPL-2.1 MPL-1.0
 PKG_LICENSE_FILES:=COPYING
index 127bc17d7eafed6fb36f96c8d5c6b8d5492cd074..9c104965569a450c2b6034b6fa87f6b6c44a31f8 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/mad
-PKG_MD5SUM:=e5808ad997ba32c498803822078748c3
+PKG_HASH:=63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=GPL-2
index 2d20216269886c0f3ba8728ccae0b1f68d396ec5..3b9b9a5cfc60bd15728fea59fb8e12794cd33dbc 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/libidn
-PKG_MD5SUM:=a9aa7e003665de9c82bd3f9fc6ccf308
+PKG_HASH:=44a7aab635bb721ceef6beecc4d49dfd19478325e1b47f3196f7d2acc4930e19
 
 PKG_LICENSE:=GPL-2.0+ GPL-3.0+ LGPL-2.1+ LGPL-3.0+ Apache-2.0
 PKG_LICENSE_FILES:=COPYING COPYINGv2 COPYINGv3 COPYING.LESSERv2 COPYING.LESSERv3 java/LICENSE-2.0.txt
diff --git a/libs/libiio/Makefile b/libs/libiio/Makefile
new file mode 100644 (file)
index 0000000..2c0048c
--- /dev/null
@@ -0,0 +1,152 @@
+#
+# Copyright (C) 2017-2018 Michael Heimpold <mhei@heimpold.de>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libiio
+PKG_VERSION:=0.14
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/analogdevicesinc/libiio/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=12063db7a9366aa00bfd789db30afaddb29686bc29b3ce1e5d4adfe1c3b42527
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING.txt
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+CMAKE_INSTALL:=1
+
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_IPV6 \
+       CONFIG_LIBIIO_LOCAL_BACKEND \
+       CONFIG_LIBIIO_NETWORK_BACKEND \
+       CONFIG_LIBIIO_USB_BACKEND \
+       CONFIG_LIBIIO_XML_BACKEND
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+CMAKE_OPTIONS += -DWITH_DOC=OFF
+CMAKE_OPTIONS += -DENABLE_IPV6=$(if $(CONFIG_IPV6),ON,OFF)
+CMAKE_OPTIONS += -DENABLE_AIO=OFF
+CMAKE_OPTIONS += -DWITH_LOCAL_BACKEND=$(if $(CONFIG_LIBIIO_LOCAL_BACKEND),ON,OFF)
+CMAKE_OPTIONS += -DWITH_LOCAL_CONFIG=OFF
+CMAKE_OPTIONS += -DWITH_NETWORK_BACKEND=$(if $(CONFIG_LIBIIO_NETWORK_BACKEND),ON,OFF)
+# serial backend requires libserial which is not packaged yet
+CMAKE_OPTIONS += -DWITH_SERIAL_BACKEND=OFF
+CMAKE_OPTIONS += -DWITH_USB_BACKEND=$(if $(CONFIG_LIBIIO_USB_BACKEND),ON,OFF)
+CMAKE_OPTIONS += -DWITH_XML_BACKEND=$(if $(CONFIG_LIBIIO_XML_BACKEND),ON,OFF)
+
+define Package/libiio
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Library for interfacing with Linux IIO devices
+  URL:=https://github.com/analogdevicesinc/libiio
+  DEPENDS:=\
+           +LIBIIO_USB_BACKEND:libusb-1.0 \
+           +LIBIIO_NETWORK_BACKEND:libavahi-client \
+           +LIBIIO_XML_BACKEND:libxml2
+  MENU:=1
+endef
+
+define Package/libiio/config
+config LIBIIO_LOCAL_BACKEND
+       bool "Enable local backend"
+       depends on PACKAGE_libiio
+       default y
+
+config LIBIIO_NETWORK_BACKEND
+       bool "Enable network backend"
+       depends on PACKAGE_libiio
+       select LIBIIO_XML_BACKEND
+       default n
+
+config LIBIIO_USB_BACKEND
+       bool "Enable USB backend"
+       depends on PACKAGE_libiio
+       select LIBIIO_XML_BACKEND
+       default n
+
+config LIBIIO_XML_BACKEND
+       bool "Enable XML backend"
+       depends on PACKAGE_libiio
+       default n
+endef
+
+define Package/libiio/description
+  libiio is used to interface to the Linux Industrial Input/Output (IIO) Subsystem.
+  The Linux IIO subsystem is intended to provide support for devices that in some
+  sense are analog to digital or digital to analog converters (ADCs, DACs). This
+  includes, but is not limited to ADCs, Accelerometers, Gyros, IMUs, Capacitance
+  to Digital Converters (CDCs), Pressure Sensors, Color, Light and Proximity Sensors,
+  Temperature Sensors, Magnetometers, DACs, DDS (Direct Digital Synthesis),
+  PLLs (Phase Locked Loops), Variable/Programmable Gain Amplifiers (VGA, PGA),
+  and RF transceivers. You can use libiio natively on an embedded Linux
+  target (local mode), or use libiio to communicate remotely to that same target
+  from a host Linux, Windows or MAC over USB or Ethernet or Serial.
+endef
+
+define Package/iiod
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Linux IIO daemon
+  URL:=https://github.com/analogdevicesinc/libiio
+  DEPENDS:=+libiio
+endef
+
+define Package/iiod/description
+  Daemon to access IIO devices via network.
+endef
+
+define Package/iio-utils
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Linux IIO tools
+  URL:=https://github.com/analogdevicesinc/libiio
+  DEPENDS:=+libiio
+endef
+
+define Package/iio-utils/description
+  Command line tools for IIO devices.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/iio.h $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiio.so* $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libiio.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libiio/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libiio.so* $(1)/usr/lib/
+endef
+
+define Package/iiod/install
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/iiod.init $(1)/etc/init.d/iiod
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/iiod $(1)/usr/sbin/
+endef
+
+define Package/iio-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libiio))
+$(eval $(call BuildPackage,iiod))
+$(eval $(call BuildPackage,iio-utils))
diff --git a/libs/libiio/files/iiod.init b/libs/libiio/files/iiod.init
new file mode 100644 (file)
index 0000000..1ac62f3
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh /etc/rc.common
+
+START=90
+USE_PROCD=1
+PROG=/usr/sbin/iiod
+
+start_service() {
+       procd_open_instance
+       procd_set_param command $PROG
+       procd_set_param respawn
+       procd_close_instance
+}
index a7ac5d56b7e91ba490d0bf5081ba1ed3db2cc672..b0d49838e8532ea9412b5f5cb278bf5b47b6ea77 100644 (file)
@@ -20,13 +20,14 @@ PKG_SOURCE_URL:=https://github.com/libimobiledevice/libimobiledevice.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=13bf235cac2201747de11652cf14fe2714ca0718
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=4e8892b27f20216f86d69b36ad2229fca87cdf0a10f8d3e145d01841a492562a
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/libimobiledevice/Default
   TITLE:=A library that talks to Apple devices.
index 988488bb415a1c054193ae0c951ce31d7453d11b..a90d13c575045dd8bad8aa146b3e22deb7123902 100644 (file)
@@ -1,6 +1,3 @@
-#
-# Copyright (C) 2007-2015 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -8,12 +5,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libinput
-PKG_VERSION:=1.3.1
+PKG_VERSION:=1.7.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.freedesktop.org/software/libinput/
-PKG_MD5SUM:=458fc483f7227d3c4c330f4abd6dfa77
+PKG_HASH:=096d612d2711f0caa2de544976ff3729e6233511ab373808644cc2dd5affcb1d
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
@@ -33,7 +30,7 @@ define Package/libinput
   CATEGORY:=Libraries
   TITLE:=a library to handle input devices
   URL:=http://freedesktop.org/wiki/Software/libinput/
-  DEPENDS:=+libevdev +mtdev +libudev
+  DEPENDS:=+libevdev +mtdev +libudev-fbsd
 endef
 
 define Package/libinput/description
index 8f5c5a1cacf33716f8f9df2b6b9704eba67f4ae7..adf9abeb80cfa129ed38b7dbf766dbb5a3c3608f 100644 (file)
@@ -1,22 +1,38 @@
 --- a/src/libinput-util.c
 +++ b/src/libinput-util.c
-@@ -216,18 +216,10 @@ parse_mouse_wheel_click_angle_property(c
- double
- parse_trackpoint_accel_property(const char *prop)
+@@ -31,7 +31,6 @@
+ #include "config.h"
+ #include <ctype.h>
+-#include <locale.h>
+ #include <stdarg.h>
+ #include <stdbool.h>
+ #include <stdio.h>
+--- a/src/libinput-util.h
++++ b/src/libinput-util.h
+@@ -30,7 +30,6 @@
+ #include <assert.h>
+ #include <errno.h>
+ #include <limits.h>
+-#include <locale.h>
+ #include <math.h>
+ #include <stdarg.h>
+ #include <stdbool.h>
+@@ -448,16 +447,8 @@ safe_atod(const char *str, double *val)
  {
+       char *endptr;
+       double v;
 -      locale_t c_locale;
-       double accel;
-       char *endp;
  
 -      /* Create a "C" locale to force strtod to use '.' as separator */
 -      c_locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0);
 -      if (c_locale == (locale_t)0)
--              return 0.0;
--
--      accel = strtod_l(prop, &endp, c_locale);
+-              return false;
 -
+-      errno = 0;
+-      v = strtod_l(str, &endptr, c_locale);
 -      freelocale(c_locale);
-+      accel = strtod(prop, &endp);
-       if (*endp != '\0')
-               return 0.0;
++      v = strtod(str, &endptr);
+       if (errno > 0)
+               return false;
+       if (str == endptr)
index e5aaee26faa5e0a49c03d953d350129fb4fbc8dc..e5b12448eb044e9f89a965098c4899c2e46caba0 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/evdev-tablet.c
 +++ b/src/evdev-tablet.c
-@@ -1155,9 +1155,11 @@ static void
+@@ -1204,9 +1204,11 @@ static void
  tablet_mark_all_axes_changed(struct tablet_dispatch *tablet,
                             struct libinput_tablet_tool *tool)
  {
index c88bca0300b835d747b935a332c67ecdb9e3ee7c..4c73d4c108467a7e096cacf488618f5c15c81ec4 100644 (file)
@@ -13,14 +13,14 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)src.v$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.ijg.org/files
-PKG_MD5SUM:=3353992aecaee1805ef4109aadd433e7
+PKG_HASH:=3a753ea48d917945dd54a2d97de388aa06ca2eb1066cbfdc6652036349fe05a7
 
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 PKG_LICENSE:=IJG
 PKG_LICENSE_FILES:=README
 
 PKG_BUILD_PARALLEL:=1
-PKG_BUILD_DEPENDS:=libltdl
+PKG_BUILD_DEPENDS:=libtool
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
index bffca5a6aafc0c305823f7ffdfea2de603df1c9a..95a083932778aab3e66cbe62c9e47b3172c95ce1 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/liblo
-PKG_MD5SUM:=e2a4391a08b49bb316c03e2034e06fa2
+PKG_HASH:=da94a9b67b93625354dd89ff7fe31e5297fc9400b6eaf7378c82ee1caf7db909
 
 PKG_LICENSE:=LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING
index 6e520679057576b9f246cfdc5df78ecd09fb0858..9112a1bc606c41d7182272edf9e822cade1676e5 100644 (file)
@@ -8,18 +8,20 @@
 include $(TOPDIR)/rules.mk
 
 # Although liblz4 exports a major.minor.patch version, it isn't always
-# incremented for new releases, so use the release tag instead.
+# incremented for new releases. Check the NEWS file and instead use a
+# release tag when appropriate. (eg: PKG_VERSION:=r131)
 PKG_NAME:=liblz4
-PKG_VERSION:=r131
+PKG_VERSION:=v1.7.5
 PKG_RELEASE:=1
 
 PKG_LICENSE:=BSD-2-Clause
 PKG_MAINTAINER:=Darik Horn <dajhorn@vanadac.com>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=afb362b970816e06dac4997d26dd7d2cdb83168510228d174d25b1044b271e18
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=https://github.com/Cyan4973/lz4.git
+PKG_SOURCE_URL:=https://github.com/lz4/lz4.git
 PKG_SOURCE_VERSION:=$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
index e5289ce7f11a3db070add7d7cb9e3fc0cd8ec930..4ae75256edc0b3c020c3a4afcd1315c1f11dc1aa 100644 (file)
@@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libmad
 PKG_VERSION:=0.15.1b
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/mad \
        ftp://ftp.mars.org/pub/mpeg/
-PKG_MD5SUM:=1be543bc30c56fb6bea1d7bf6a64e66c
+PKG_HASH:=bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=GPLv2
@@ -42,7 +42,6 @@ define Package/libmad
   CATEGORY:=Libraries
   TITLE:=An high-quality MPEG audio decoding library
   URL:=http://www.underbit.com/products/mad/
-  DEPENDS:=@BUILD_PATENTED
 endef
 
 define Package/libmad/description
index f7f3827d4feb31c081ab8510e0cd76600b785e23..b18f8735c0b33fbfb2e7a7b99a7fcf496b217248 100644 (file)
@@ -18,7 +18,7 @@ PKG_LICENSE_FILES:=COPYING.LIB
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/mcrypt
-PKG_MD5SUM:=c4f491dd411a09e9de3b8702ea6f73eb
+PKG_HASH:=bf2f1671f44af88e66477db0982d5ecb5116a5c767b0a0d68acb34499d41b793
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index 8b39084a3063c437f3c81dbe7c87a72702abcdbf..78ad1ce6a9540b5326255ad01e5788d4c0c04475 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libmicrohttpd
-PKG_VERSION:=0.9.52
+PKG_VERSION:=0.9.59
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/libmicrohttpd
-PKG_MD5SUM:=54797f6e763d417627f89f60e4ae0a431dab0523f92f83def23ea02d0defafea
+PKG_HASH:=9b9ccd7d0b11b0e179f1f58dc2caa3e0c62c8609e1e1dc7dcaadf941b67d923c
 
 PKG_MAINTAINER:=Alexander Couzens <lynxis@fe80.eu>
 
index 239c64f73714cf9623f81fbe91448782d72aee5f..fa24a5c731f8bf52bc1ad6d4d9ee1477a1d10957 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2010-2014 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -9,11 +7,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libmms
 PKG_VERSION:=0.6.4
-PKG_RELEASE:=2
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/libmms
-PKG_MD5SUM:=d6b665b335a6360e000976e770da7691
+PKG_HASH:=3c05e05aebcbfcc044d9e8c2d4646cd8359be39a3f0ba8ce4e72a9094bee704f
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=LGPLv2.1
@@ -23,15 +21,12 @@ PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
 
 define Package/libmms
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+glib2
   TITLE:=MMS stream protocol library
   URL:=http://libmms.sourceforge.net
-  DEPENDS:=$(ICONV_DEPENDS)
 endef
 
 define Package/libmms/description
@@ -42,7 +37,6 @@ define Package/libmms/description
 endef
 
 TARGET_CFLAGS += $(FPIC)
-TARGET_LDFLAGS += $(if $(ICONV_FULL),-liconv)
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
diff --git a/libs/libmms/patches/010-remove_glib_from_pkgconfig.patch b/libs/libmms/patches/010-remove_glib_from_pkgconfig.patch
new file mode 100644 (file)
index 0000000..a551cc6
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/pkgconfig/libmms.pc.in
++++ b/pkgconfig/libmms.pc.in
+@@ -5,7 +5,6 @@ includedir=@includedir@/
+ Name: libmms
+ Description: Library implementing the MMS protocol 
+-Requires: glib-2.0
+ Version: @VERSION@
+ Libs: -L${libdir} -lmms -lm
+ Cflags: -I${includedir}
index 4f9bab2e2ac8cc52a09eec4537f92fb1011e51db..e35e4d53e2dfb4276273be179d57ce1bced8a331 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://libmodbus.org/releases
-PKG_MD5SUM:=b1a8fd3a40d2db4de51fb0cbcb201806
+PKG_HASH:=c8c862b0e9a7ba699a49bc98f62bdffdfafd53a5716c0e162696b4bf108d3637
 
 PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
 
index 06661145f9c616bb443cc94d390f4fdd511ae99d..e698a12902aff44098b084563e2f8e167aa6ae33 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2011-2014 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -8,12 +6,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libmpdclient
-PKG_VERSION:=2.10
+PKG_VERSION:=2.11
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_HASH:=15fe693893c0d7ea3f4c35c4016fbd0332836164178b20983eec9b470846baf6
 PKG_SOURCE_URL:=http://www.musicpd.org/download/libmpdclient/2/
-PGK_MD5SUM:=00606c630b905aa6196330373b366c29
+PGK_HASH:=15fe693893c0d7ea3f4c35c4016fbd0332836164178b20983eec9b470846baf6
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=BSD-3-Clause
index 9d3c0522353ed33d20861f4199613c1f67b60674..a0c1c447dc67de96887a41b3cb9a394e985555ee 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=libmpeg2-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://libmpeg2.sourceforge.net/files/
-PKG_MD5SUM:=0f92c7454e58379b4a5a378485bbd8ef
+PKG_HASH:=dee22e893cb5fc2b2b6ebd60b88478ab8556cb3b93f9a0d7ce8f3b61851871d4
 
 PKG_INSTALL:=1
 
diff --git a/libs/libmraa/Makefile b/libs/libmraa/Makefile
new file mode 100644 (file)
index 0000000..6d980b2
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libmraa
+PKG_VERSION:=0.8.0
+
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/intel-iot-devkit/mraa.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=70600dece4138b0c0dbaff42f57828f1559cd840
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=9cbda58e7c7790db3d62cee62f399975effcdc2d9688d3d6bb2b4a86748faff9
+PKG_BUILD_DEPENDS:=node python/host swig/host node/host
+CMAKE_INSTALL:=1
+
+PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
+PKG_LICENSE:=LGPL-2.1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+CMAKE_OPTIONS=-DBUILDARCH=$(CONFIG_ARCH) \
+       -DENABLEEXAMPLES=0 \
+       -DNODE_EXECUTABLE=$(STAGING_DIR_HOSTPKG)/bin/node \
+       -DSWIG_DIR=$(STAGING_DIR_HOSTPKG)/bin
+
+TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/node
+
+define Package/libmraa
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+python +libstdcpp
+  TITLE:=Intel IoT lowlevel IO library
+endef
+
+define Package/libmraa/install
+       $(INSTALL_DIR) $(1)/usr/lib/{node/mraa,python2.7/site-packages} $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libmraa.so* $(1)/usr/lib/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/node_modules/mraa/* $(1)/usr/lib/node/mraa/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/* $(1)/usr/lib/python2.7/site-packages/
+#      $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mraa/examples/python/blink-io8.py $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libmraa))
diff --git a/libs/libmraa/patches/0001-base.patch b/libs/libmraa/patches/0001-base.patch
new file mode 100644 (file)
index 0000000..5094389
--- /dev/null
@@ -0,0 +1,118 @@
+From 6fecad819376442d057bdd35a0909cfac9df02f5 Mon Sep 17 00:00:00 2001
+From: John Crispin <blogic@openwrt.org>
+Date: Thu, 23 Jul 2015 12:18:39 +0200
+Subject: [PATCH 1/4] base
+
+---
+ CMakeLists.txt          |   10 ++++------
+ api/mraa/types.h        |    1 +
+ include/mraa_internal.h |    7 +++++++
+ src/CMakeLists.txt      |    5 +++++
+ src/i2c/i2c.c           |    2 +-
+ src/mraa.c              |    3 +++
+ src/uart/uart.c         |    1 +
+ 7 files changed, 22 insertions(+), 7 deletions(-)
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -14,12 +14,7 @@
+ set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
+ # Make a version file containing the current version from git.
+-include (GetGitRevisionDescription)
+-git_describe (VERSION "--tags")
+-if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_HEAD-HASH-NOTFOUND")
+-  message (WARNING " - Install git to compile a production libmraa!")
+-  set (VERSION "v0.8.0-dirty")
+-endif ()
++set (VERSION "v0.8.0")
+ message (INFO " - libmraa Version ${VERSION}")
+@@ -84,8 +79,10 @@
+   set (X86PLAT ON)
+ elseif (DETECTED_ARCH MATCHES "arm.*")
+   set (ARMPLAT ON)
++elseif (DETECTED_ARCH MATCHES "mips")
++  set (MIPSPLAT ON)
+ else ()
+-  message(FATAL_ERROR "Only x86 and arm platforms currently supported")
++  message(FATAL_ERROR "Only x86, arm and mips platforms currently supported")
+ endif()
+ if (BUILDSWIGPYTHON)
+--- a/api/mraa/types.h
++++ b/api/mraa/types.h
+@@ -46,6 +46,7 @@
+     MRAA_BEAGLEBONE = 6,            /**< The different BeagleBone Black Modes B/C */
+     MRAA_BANANA = 7,                /**< Allwinner A20 based Banana Pi and Banana Pro */
+     MRAA_INTEL_NUC5 = 8,            /**< The Intel 5th generations Broadwell NUCs */
++    MRAA_MTK_LINKIT = 9,            /**< Mediatek MT7688 based Linkit (Air) */
+     // USB platform extenders start at 256
+     MRAA_FTDI_FT4222 = 256,         /**< FTDI FT4222 USB to i2c bridge */
+--- a/include/mraa_internal.h
++++ b/include/mraa_internal.h
+@@ -66,6 +66,13 @@
+ mraa_platform_t mraa_usb_platform_extender(mraa_board_t* board);
+ /**
++ * runtime detect running arm platforms
++ *
++ * @return mraa_platform_t of the init'ed platform
++ */
++mraa_platform_t mraa_mips_platform();
++
++/**
+  * helper function to check if file exists
+  *
+  * @param filename to check
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -71,6 +71,11 @@
+   add_subdirectory(usb)
+ endif ()
++if (MIPSPLAT)
++  add_subdirectory(mips)
++  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMIPSPLAT=1")
++endif()
++
+ set (mraa_LIB_SRCS
+   ${mraa_LIB_PLAT_SRCS_NOAUTO}
+ # autogenerated version file
+--- a/src/i2c/i2c.c
++++ b/src/i2c/i2c.c
+@@ -31,9 +31,9 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <fcntl.h>
++#include <errno.h>
+ #include <inttypes.h>
+ #include <sys/types.h>
+-#include <sys/errno.h>
+ #include <sys/ioctl.h>
+ #include "linux/i2c-dev.h"
+--- a/src/mraa.c
++++ b/src/mraa.c
+@@ -111,6 +111,9 @@
+ #elif defined(ARMPLAT)
+     // Use runtime ARM platform detection
+     platform_type = mraa_arm_platform();
++#elif MIPSPLAT
++    // Use runtime ARM platform detection
++    platform_type = mraa_mips_platform();
+ #else
+ #error mraa_ARCH NOTHING
+ #endif
+--- a/src/uart/uart.c
++++ b/src/uart/uart.c
+@@ -26,6 +26,7 @@
+ #include <stdlib.h>
+ #include <sys/stat.h>
++#include <sys/time.h>
+ #include <unistd.h>
+ #include <string.h>
+ #include <termios.h>
diff --git a/libs/libmraa/patches/0002-add-mips-support.patch b/libs/libmraa/patches/0002-add-mips-support.patch
new file mode 100644 (file)
index 0000000..1936624
--- /dev/null
@@ -0,0 +1,483 @@
+From 2c67c6f51ce5bab18c79f4304ccf42716f59f13c Mon Sep 17 00:00:00 2001
+From: John Crispin <blogic@openwrt.org>
+Date: Thu, 23 Jul 2015 13:21:25 +0200
+Subject: [PATCH 2/4] add mips support
+
+Signed-off-by: John Crispin <blogic@openwrt.org>
+---
+ include/mips/mediatek.h |   39 ++++++
+ src/mips/CMakeLists.txt |    6 +
+ src/mips/mediatek.c     |  349 +++++++++++++++++++++++++++++++++++++++++++++++
+ src/mips/mips.c         |   60 ++++++++
+ 4 files changed, 454 insertions(+)
+ create mode 100644 include/mips/mediatek.h
+ create mode 100644 src/mips/CMakeLists.txt
+ create mode 100644 src/mips/mediatek.c
+ create mode 100644 src/mips/mips.c
+
+--- /dev/null
++++ b/include/mips/mediatek.h
+@@ -0,0 +1,39 @@
++/*
++ * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
++ * Author: Michael Ring <mail@michael-ring.org>
++ * Copyright (c) 2014 Intel Corporation.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files (the
++ * "Software"), to deal in the Software without restriction, including
++ * without limitation the rights to use, copy, modify, merge, publish,
++ * distribute, sublicense, and/or sell copies of the Software, and to
++ * permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ */
++
++#pragma once
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#include "mraa_internal.h"
++
++mraa_board_t *
++        mraa_mtk_linkit();
++
++#ifdef __cplusplus
++}
++#endif
+--- /dev/null
++++ b/src/mips/CMakeLists.txt
+@@ -0,0 +1,6 @@
++message (INFO " - Adding MIPS platforms")
++set (mraa_LIB_PLAT_SRCS_NOAUTO ${mraa_LIB_SRCS_NOAUTO}
++  ${PROJECT_SOURCE_DIR}/src/mips/mips.c
++  ${PROJECT_SOURCE_DIR}/src/mips/mediatek.c
++  PARENT_SCOPE
++)
+--- /dev/null
++++ b/src/mips/mediatek.c
+@@ -0,0 +1,349 @@
++/*
++ * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
++ * Author: Michael Ring <mail@michael-ring.org>
++ * Copyright (c) 2014 Intel Corporation.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files (the
++ * "Software"), to deal in the Software without restriction, including
++ * without limitation the rights to use, copy, modify, merge, publish,
++ * distribute, sublicense, and/or sell copies of the Software, and to
++ * permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ */
++
++#include <stdio.h>
++#include <stdint.h>
++#include <stdlib.h>
++#include <string.h>
++#include <sys/mman.h>
++#include <mraa/common.h>
++
++#include "mraa_internal.h"
++
++#include "common.h"
++
++#define PLATFORM_MEDIATEK_LINKIT      1
++#define PLATFORM_MEDIATEK_LINKIT_AIR  2
++#define MMAP_PATH                     "/dev/mem"
++#define MT7628_GPIO_BASE              0x100
++#define MT7628_BLOCK_SIZE             (4 * 1024)
++#define MT7628_GPIO_CTRL              0x00
++#define MT7628_GPIO_DATA              0x20
++#define MT7628_GPIO_SET                       0x30
++#define MT7628_GPIO_CLEAR             0x40
++
++#define MAX_SIZE 64
++
++// MMAP
++static uint8_t* mmap_reg = NULL;
++static int mmap_fd = 0;
++static int mmap_size;
++static unsigned int mmap_count = 0;
++static int platform_detected = 0;
++
++mraa_result_t
++mraa_mtk_linkit_mmap_write(mraa_gpio_context dev, int value)
++{
++    volatile uint32_t* addr;
++    if (value) {
++        *(volatile uint32_t*) (mmap_reg + MT7628_GPIO_SET + (dev->pin / 32) * 4) =
++        (uint32_t)(1 << (dev->pin % 32));
++    } else {
++        *(volatile uint32_t*) (mmap_reg + MT7628_GPIO_CLEAR + (dev->pin / 32) * 4) =
++        (uint32_t)(1 << (dev->pin % 32));
++    }
++    return MRAA_SUCCESS;
++}
++
++static mraa_result_t
++mraa_mtk_linkit_mmap_unsetup()
++{
++    if (mmap_reg == NULL) {
++        syslog(LOG_ERR, "linkit mmap: null register can't unsetup");
++        return MRAA_ERROR_INVALID_RESOURCE;
++    }
++    munmap(mmap_reg, mmap_size);
++    mmap_reg = NULL;
++    if (close(mmap_fd) != 0) {
++        return MRAA_ERROR_INVALID_RESOURCE;
++    }
++    return MRAA_SUCCESS;
++}
++
++int
++mraa_mtk_linkit_mmap_read(mraa_gpio_context dev)
++{
++    uint32_t value = *(volatile uint32_t*) (mmap_reg + MT7628_GPIO_DATA + (dev->pin / 32) * 4);
++    if (value & (uint32_t)(1 << (dev->pin % 32))) {
++        return 1;
++    }
++    return 0;
++}
++
++mraa_result_t
++mraa_mtk_linkit_mmap_setup(mraa_gpio_context dev, mraa_boolean_t en)
++{
++    if (dev == NULL) {
++        syslog(LOG_ERR, "linkit mmap: context not valid");
++        return MRAA_ERROR_INVALID_HANDLE;
++    }
++
++    if (en == 0) {
++        if (dev->mmap_write == NULL && dev->mmap_read == NULL) {
++            syslog(LOG_ERR, "linkit mmap: can't disable disabled mmap gpio");
++            return MRAA_ERROR_INVALID_PARAMETER;
++        }
++        dev->mmap_write = NULL;
++        dev->mmap_read = NULL;
++        mmap_count--;
++        if (mmap_count == 0) {
++            return mraa_mtk_linkit_mmap_unsetup();
++        }
++        return MRAA_SUCCESS;
++    }
++
++    if (dev->mmap_write != NULL && dev->mmap_read != NULL) {
++        syslog(LOG_ERR, "linkit mmap: can't enable enabled mmap gpio");
++        return MRAA_ERROR_INVALID_PARAMETER;
++    }
++
++    // Might need to make some elements of this thread safe.
++    // For example only allow one thread to enter the following block
++    // to prevent mmap'ing twice.
++    if (mmap_reg == NULL) {
++        if ((mmap_fd = open(MMAP_PATH, O_RDWR)) < 0) {
++            syslog(LOG_ERR, "linkit map: unable to open resource0 file");
++            return MRAA_ERROR_INVALID_HANDLE;
++        }
++
++        mmap_reg = (uint8_t*) mmap(NULL, MT7628_BLOCK_SIZE, PROT_READ | PROT_WRITE,
++                                       MAP_FILE | MAP_SHARED, mmap_fd, MT7628_GPIO_BASE);
++        if (mmap_reg == MAP_FAILED) {
++            syslog(LOG_ERR, "linkit mmap: failed to mmap");
++            mmap_reg = NULL;
++            close(mmap_fd);
++            return MRAA_ERROR_NO_RESOURCES;
++        }
++    }
++    dev->mmap_write = &mraa_mtk_linkit_mmap_write;
++    dev->mmap_read = &mraa_mtk_linkit_mmap_read;
++    mmap_count++;
++
++    return MRAA_SUCCESS;
++}
++
++mraa_board_t*
++mraa_mtk_linkit()
++{
++    mraa_board_t* b = (mraa_board_t*) malloc(sizeof(mraa_board_t));
++    if (b == NULL) {
++        return NULL;
++    }
++
++    b->platform_name = "LINKIT";
++    platform_detected = PLATFORM_MEDIATEK_LINKIT;
++    b->phy_pin_count = 31;
++
++    b->aio_count = 0;
++    b->adc_raw = 0;
++    b->adc_supported = 0;
++    b->pwm_default_period = 500;
++    b->pwm_max_period = 2147483;
++    b->pwm_min_period = 1;
++
++    b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t) * b->phy_pin_count);
++
++    advance_func->gpio_mmap_setup = &mraa_mtk_linkit_mmap_setup;
++
++    strncpy(b->pins[0].name, "P0", MRAA_PIN_NAME_SIZE);
++    b->pins[0].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[1].name, "P1", MRAA_PIN_NAME_SIZE);
++    b->pins[1].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[2].name, "P2", MRAA_PIN_NAME_SIZE);
++    b->pins[2].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[3].name, "P3", MRAA_PIN_NAME_SIZE);
++    b->pins[3].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[4].name, "P4", MRAA_PIN_NAME_SIZE);
++    b->pins[4].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[5].name, "P5", MRAA_PIN_NAME_SIZE);
++    b->pins[5].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[6].name, "P6", MRAA_PIN_NAME_SIZE);
++    b->pins[6].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[7].name, "P7", MRAA_PIN_NAME_SIZE);
++    b->pins[7].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[8].name, "P8", MRAA_PIN_NAME_SIZE);
++    b->pins[8].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[8].gpio.pinmap = 21;
++    b->pins[8].uart.parent_id = 2;
++    b->pins[8].uart.mux_total = 0;
++
++    strncpy(b->pins[9].name, "P9", MRAA_PIN_NAME_SIZE);
++    b->pins[9].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[9].gpio.pinmap = 20;
++    b->pins[9].uart.parent_id = 2;
++    b->pins[9].uart.mux_total = 0;
++
++    strncpy(b->pins[10].name, "P10", MRAA_PIN_NAME_SIZE);
++    b->pins[10].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[10].gpio.pinmap = 2;
++
++    strncpy(b->pins[11].name, "P11", MRAA_PIN_NAME_SIZE);
++    b->pins[11].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[11].gpio.pinmap = 3;
++
++    strncpy(b->pins[12].name, "P12", MRAA_PIN_NAME_SIZE);
++    b->pins[12].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[12].gpio.pinmap = 0;
++
++    strncpy(b->pins[13].name, "P13", MRAA_PIN_NAME_SIZE);
++    b->pins[13].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[13].gpio.pinmap = 1;
++
++    strncpy(b->pins[14].name, "P14", MRAA_PIN_NAME_SIZE);
++    b->pins[14].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++
++    strncpy(b->pins[15].name, "P15", MRAA_PIN_NAME_SIZE);
++    b->pins[15].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[15].gpio.pinmap = 44;
++
++    strncpy(b->pins[16].name, "P16", MRAA_PIN_NAME_SIZE);
++    b->pins[16].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[16].gpio.pinmap = 46;
++    b->pins[16].uart.parent_id = 1;
++    b->pins[16].uart.mux_total = 0;
++
++    strncpy(b->pins[17].name, "P17", MRAA_PIN_NAME_SIZE);
++    b->pins[17].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[17].gpio.pinmap = 45;
++    b->pins[17].uart.parent_id = 1;
++    b->pins[17].uart.mux_total = 0;
++
++    strncpy(b->pins[18].name, "P18", MRAA_PIN_NAME_SIZE);
++    b->pins[18].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[18].gpio.pinmap = 13;
++    b->pins[18].uart.parent_id = 1;
++    b->pins[18].uart.mux_total = 0;
++
++    strncpy(b->pins[19].name, "P19", MRAA_PIN_NAME_SIZE);
++    b->pins[19].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[19].gpio.pinmap = 12;
++    b->pins[19].uart.parent_id = 0;
++    b->pins[19].uart.mux_total = 0;
++
++    strncpy(b->pins[20].name, "P20", MRAA_PIN_NAME_SIZE);
++    b->pins[20].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
++    b->pins[20].gpio.pinmap = 5;
++    b->pins[20].i2c.pinmap = 0;
++    b->pins[20].i2c.mux_total = 0;
++
++    strncpy(b->pins[21].name, "P21", MRAA_PIN_NAME_SIZE);
++    b->pins[21].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
++    b->pins[21].gpio.pinmap = 4;
++    b->pins[21].i2c.pinmap = 0;
++    b->pins[21].i2c.mux_total = 0;
++
++    strncpy(b->pins[22].name, "P22", MRAA_PIN_NAME_SIZE);
++    b->pins[22].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
++    b->pins[22].gpio.pinmap = 8;
++    b->pins[22].spi.pinmap = 0;
++    b->pins[22].spi.mux_total = 0;
++
++    strncpy(b->pins[23].name, "P23", MRAA_PIN_NAME_SIZE);
++    b->pins[23].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
++    b->pins[23].gpio.pinmap = 9;
++    b->pins[23].spi.pinmap = 0;
++    b->pins[23].spi.mux_total = 0;
++
++    strncpy(b->pins[24].name, "P24", MRAA_PIN_NAME_SIZE);
++    b->pins[24].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
++    b->pins[24].gpio.pinmap = 7;
++    b->pins[24].spi.pinmap = 0;
++    b->pins[24].spi.mux_total = 0;
++
++    strncpy(b->pins[25].name, "P25", MRAA_PIN_NAME_SIZE);
++    b->pins[25].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
++    b->pins[25].gpio.pinmap = 6;
++    b->pins[25].spi.pinmap = 0;
++    b->pins[25].spi.mux_total = 0;
++
++    strncpy(b->pins[26].name, "P26", MRAA_PIN_NAME_SIZE);
++    b->pins[26].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
++    b->pins[26].gpio.pinmap = 18;
++
++    strncpy(b->pins[27].name, "P27", MRAA_PIN_NAME_SIZE);
++    b->pins[27].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
++    b->pins[27].gpio.pinmap = 19;
++
++    strncpy(b->pins[28].name, "P28", MRAA_PIN_NAME_SIZE);
++    b->pins[28].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[28].gpio.pinmap = 16;
++
++    strncpy(b->pins[29].name, "P29", MRAA_PIN_NAME_SIZE);
++    b->pins[29].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[29].gpio.pinmap = 17;
++
++    strncpy(b->pins[30].name, "P30", MRAA_PIN_NAME_SIZE);
++    b->pins[30].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[30].gpio.pinmap = 14;
++
++    strncpy(b->pins[31].name, "P31", MRAA_PIN_NAME_SIZE);
++    b->pins[31].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[31].gpio.pinmap = 15;
++
++    // BUS DEFINITIONS
++    b->i2c_bus_count = 1;
++    b->def_i2c_bus = 0;
++        b->i2c_bus[0].bus_id = 0;
++    b->i2c_bus[0].sda = 20;
++    b->i2c_bus[0].scl = 21;
++
++    b->spi_bus_count = 1;
++    b->def_spi_bus = 0;
++    b->spi_bus[0].bus_id = 0;
++    b->spi_bus[0].slave_s = 0;
++    b->spi_bus[0].cs = 25;
++    b->spi_bus[0].mosi = 22;
++    b->spi_bus[0].miso = 23;
++    b->spi_bus[0].sclk = 21;
++
++    b->uart_dev_count = 3;
++    b->def_uart_dev = 0;
++    b->uart_dev[0].rx = 18;
++    b->uart_dev[0].tx = 19;
++
++    b->uart_dev[1].rx = 16;
++    b->uart_dev[1].tx = 17;
++
++    b->uart_dev[2].rx = 9;
++    b->uart_dev[2].tx = 8;
++
++    b->gpio_count = 0;
++    int i;
++    for (i = 0; i < b->phy_pin_count; i++) {
++        if (b->pins[i].capabilites.gpio) {
++            b->gpio_count++;
++        }
++    }
++
++    return b;
++}
+--- /dev/null
++++ b/src/mips/mips.c
+@@ -0,0 +1,60 @@
++/*
++ * Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
++ * Author: Michael Ring <mail@michael-ring.org>
++ * Copyright (c) 2014 Intel Corporation.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files (the
++ * "Software"), to deal in the Software without restriction, including
++ * without limitation the rights to use, copy, modify, merge, publish,
++ * distribute, sublicense, and/or sell copies of the Software, and to
++ * permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ */
++
++#include <stdlib.h>
++#include <string.h>
++
++#include "mraa_internal.h"
++#include "mips/mediatek.h"
++
++mraa_platform_t
++mraa_mips_platform()
++{
++    mraa_platform_t platform_type = MRAA_UNKNOWN_PLATFORM;
++    size_t len = 100;
++    char* line = malloc(len);
++    FILE* fh = fopen("/proc/cpuinfo", "r");
++    if (fh != NULL) {
++        while (getline(&line, &len, fh) != -1) {
++            if (strncmp(line, "machine", 7) == 0) {
++                if (strstr(line, "MediaTek LinkIt Smart 7688")) {
++                    platform_type = MRAA_MTK_LINKIT;
++                }
++            }
++        }
++        fclose(fh);
++    }
++    free(line);
++
++    switch (platform_type) {
++        case MRAA_MTK_LINKIT:
++            plat = mraa_mtk_linkit();
++            break;
++        default:
++            plat = NULL;
++            syslog(LOG_ERR, "Unknown Platform, currently not supported by MRAA");
++    }
++    return platform_type;
++}
diff --git a/libs/libmraa/patches/0003-uart.patch b/libs/libmraa/patches/0003-uart.patch
new file mode 100644 (file)
index 0000000..647abc5
--- /dev/null
@@ -0,0 +1,26 @@
+From 9540f9b93704e8e80ab2048954ca88d8e6eddf86 Mon Sep 17 00:00:00 2001
+From: John Crispin <blogic@openwrt.org>
+Date: Thu, 23 Jul 2015 16:43:42 +0200
+Subject: [PATCH 3/4] uart
+
+---
+ src/uart/uart.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/uart/uart.c b/src/uart/uart.c
+index 3ef55a4..5102f81 100644
+--- a/src/uart/uart.c
++++ b/src/uart/uart.c
+@@ -34,6 +34,9 @@
+ #include "uart.h"
+ #include "mraa_internal.h"
++#ifndef CMSPAR
++#define CMSPAR          010000000000
++#endif
+ // This function takes an unsigned int and converts it to a B* speed_t
+ // that can be used with linux/posix termios
+ static speed_t
+-- 
+1.7.10.4
+
diff --git a/libs/libmraa/patches/0004-fixes.patch b/libs/libmraa/patches/0004-fixes.patch
new file mode 100644 (file)
index 0000000..40e5930
--- /dev/null
@@ -0,0 +1,666 @@
+From 3c34e5f87a741ec2fc7809fc8c169a832275d32c Mon Sep 17 00:00:00 2001
+From: John Crispin <blogic@openwrt.org>
+Date: Thu, 23 Jul 2015 18:19:32 +0200
+Subject: [PATCH 4/4] fixes
+
+---
+ src/mips/mediatek.c |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/src/mips/mediatek.c
++++ b/src/mips/mediatek.c
+@@ -37,12 +37,12 @@
+ #define PLATFORM_MEDIATEK_LINKIT      1
+ #define PLATFORM_MEDIATEK_LINKIT_AIR  2
+ #define MMAP_PATH                     "/dev/mem"
+-#define MT7628_GPIO_BASE              0x100
+-#define MT7628_BLOCK_SIZE             (4 * 1024)
+-#define MT7628_GPIO_CTRL              0x00
+-#define MT7628_GPIO_DATA              0x20
+-#define MT7628_GPIO_SET                       0x30
+-#define MT7628_GPIO_CLEAR             0x40
++#define MT7628_GPIOMODE_BASE          0x10000000
++#define MT7628_BLOCK_SIZE             0x1000
++#define MT7628_GPIO_CTRL              0x600
++#define MT7628_GPIO_DATA              0x620
++#define MT7628_GPIO_SET                       0x630
++#define MT7628_GPIO_CLEAR             0x640
+ #define MAX_SIZE 64
+@@ -50,6 +50,9 @@
+ static uint8_t* mmap_reg = NULL;
+ static int mmap_fd = 0;
+ static int mmap_size;
++static uint8_t* gpio_mmap_reg = NULL;
++static int gpio_mmap_fd = 0;
++static int gpio_mmap_size;
+ static unsigned int mmap_count = 0;
+ static int platform_detected = 0;
+@@ -129,9 +132,10 @@
+         }
+         mmap_reg = (uint8_t*) mmap(NULL, MT7628_BLOCK_SIZE, PROT_READ | PROT_WRITE,
+-                                       MAP_FILE | MAP_SHARED, mmap_fd, MT7628_GPIO_BASE);
++                                       MAP_FILE | MAP_SHARED, mmap_fd, 0x10000000);
+         if (mmap_reg == MAP_FAILED) {
+-            syslog(LOG_ERR, "linkit mmap: failed to mmap");
++            perror("foo");
++          syslog(LOG_ERR, "linkit mmap: failed to mmap");
+             mmap_reg = NULL;
+             close(mmap_fd);
+             return MRAA_ERROR_NO_RESOURCES;
+@@ -144,201 +148,442 @@
+     return MRAA_SUCCESS;
+ }
++static int mmap_gpiomode(void)
++{
++    if ((gpio_mmap_fd = open(MMAP_PATH, O_RDWR)) < 0) {
++        syslog(LOG_ERR, "linkit map: unable to open resource0 file");
++        return MRAA_ERROR_INVALID_HANDLE;
++    }
++
++    gpio_mmap_reg = (uint8_t*) mmap(NULL, MT7628_BLOCK_SIZE, PROT_READ | PROT_WRITE,
++                                   MAP_FILE | MAP_SHARED, gpio_mmap_fd, MT7628_GPIOMODE_BASE);
++    if (gpio_mmap_reg == MAP_FAILED) {
++        syslog(LOG_ERR, "linkit gpio_mmap: failed to mmap");
++        gpio_mmap_reg = NULL;
++        close(gpio_mmap_fd);
++        return MRAA_ERROR_NO_RESOURCES;
++    }
++    return 0;
++}
++
++static void set_gpiomode(unsigned int mask, unsigned int shift, unsigned int val)
++{
++    unsigned int reg;
++    unsigned int offset = 0x60;
++
++    if (shift >= 32) {
++              shift -= 32;
++              offset += 4;
++    }
++
++    reg = *(volatile uint32_t*) (gpio_mmap_reg + offset);
++
++    reg &= ~(mask << shift);
++    reg |= (val << shift);
++    *(volatile uint32_t*) (gpio_mmap_reg + offset) = reg;
++}
++
++enum {
++      MUX_GPIO = 0,
++      MUX_SPI_S,
++      MUX_SPI_CS1,
++      MUX_I2S,
++      MUX_UART0,
++      MUX_I2C,
++      MUX_UART1,
++      MUX_UART2,
++      MUX_PWM0,
++      MUX_PWM1,
++      MUX_EPHY,
++      MUX_WLED,
++      __MUX_MAX,
++};
++
++static unsigned char gpio_mux_groups[64];
++static struct pinmux {
++      char *name;
++      char *func[4];
++      unsigned int shift;
++      unsigned int mask;
++} mt7688_mux[] = {
++      {
++              .name = "refclk",
++              .func = { "refclk", "gpio", NULL, NULL },
++              .shift = 18,
++              .mask = 0x1,
++      }, {
++              .name = "spi_s",
++              .func = { "spi_s", "gpio", "utif", "pwm" },
++              .shift = 2,
++              .mask = 0x3,
++      }, {
++              .name = "spi_cs1",
++              .func = { "spi_cs1", "gpio", NULL, "refclk" },
++              .shift = 4,
++              .mask = 0x3,
++      }, {
++              .name = "i2s",
++              .func = { "i2s", "gpio", "pcm", NULL },
++              .shift = 6,
++              .mask = 0x3,
++      }, {
++              .name = "uart0",
++              .func = { "uart", "gpio", NULL, NULL },
++              .shift = 8,
++              .mask = 0x3,
++      }, {
++              .name = "i2c",
++              .func = { "i2c", "gpio", NULL, NULL },
++              .shift = 20,
++              .mask = 0x3,
++      }, {
++              .name = "uart1",
++              .func = { "uart", "gpio", NULL, NULL },
++              .shift = 24,
++              .mask = 0x3,
++      }, {
++              .name = "uart2",
++              .func = { "uart", "gpio", "pwm", NULL },
++              .shift = 26,
++              .mask = 0x3,
++      }, {
++              .name = "pwm0",
++              .func = { "pwm", "gpio", NULL, NULL },
++              .shift = 28,
++              .mask = 0x3,
++      }, {
++              .name = "pwm1",
++              .func = { "pwm", "gpio", NULL, NULL },
++              .shift = 30,
++              .mask = 0x3,
++      }, {
++              .name = "ephy",
++              .func = { "ephy", "gpio", NULL, NULL },
++              .shift = 34,
++              .mask = 0x3,
++      }, {
++              .name = "wled",
++              .func = { "wled", "gpio", NULL, NULL },
++              .shift = 32,
++              .mask = 0x3,
++      },
++};
++
++mraa_result_t gpio_init_pre(int pin)
++{
++      struct pinmux *m = &mt7688_mux[gpio_mux_groups[pin]];
++
++      set_gpiomode(m->mask, m->shift, 1);
++
++      return 0;
++}
++
++static void gpiomode_set(unsigned int id, char *name)
++{
++      int i;
++
++      if (id >= __MUX_MAX)
++              return;
++
++      for (i = 0; i < 4; i++) {
++              if (!mt7688_mux[id].func[i] || strcmp(mt7688_mux[id].func[i], name))
++                      continue;
++              set_gpiomode(mt7688_mux[id].mask, mt7688_mux[id].shift, i);
++              syslog(0, "mraa: set pinmux %s -> %s\n", mt7688_mux[id].name, name);
++              return;
++      }
++}
++
++mraa_result_t i2c_init_pre(unsigned int bus)
++{
++      gpiomode_set(MUX_I2C, "i2c");
++      return 0;
++}
++
++mraa_result_t
++pwm_init_post(mraa_pwm_context pwm)
++{
++      switch(pwm->pin) {
++      case 0:
++              gpiomode_set(MUX_PWM0, "pwm");
++              break;
++      case 1:
++              gpiomode_set(MUX_PWM1, "pwm");
++              break;
++      case 2:
++      case 3:
++              gpiomode_set(MUX_UART2, "pwm");
++              break;
++      }
++      return 0;
++}
++
++mraa_result_t spi_init_pre(int bus)
++{
++      gpiomode_set(MUX_SPI_CS1, "spi_cs1");
++      return 0;
++}
++
++mraa_result_t uart_init_pre(int index)
++{
++      switch(index) {
++      case 0:
++              gpiomode_set(MUX_UART0, "uart");
++              break;
++      case 1:
++              gpiomode_set(MUX_UART1, "uart");
++              break;
++      case 2:
++              gpiomode_set(MUX_UART2, "uart");
++              break;
++      }
++      return 0;
++}
++
++mraa_result_t
++i2c_freq(mraa_i2c_context dev, mraa_i2c_mode_t mode)
++{
++    switch (mode) {
++        case MRAA_I2C_STD:
++            break;
++        default:
++            syslog(LOG_ERR, "Invalid i2c frequency");
++            break;
++    }
++    return MRAA_SUCCESS;
++}
++
++
+ mraa_board_t*
+ mraa_mtk_linkit()
+ {
++    int i;
++
++    if (mmap_gpiomode())
++          return NULL;
++
+     mraa_board_t* b = (mraa_board_t*) malloc(sizeof(mraa_board_t));
+     if (b == NULL) {
+         return NULL;
+     }
+-    b->platform_name = "LINKIT";
++    memset(b, 0, sizeof(mraa_board_t));
++
++    b->platform_name = "LinkIt Smart 7688";
+     platform_detected = PLATFORM_MEDIATEK_LINKIT;
+-    b->phy_pin_count = 31;
++    b->phy_pin_count = 64;
+     b->aio_count = 0;
+     b->adc_raw = 0;
+     b->adc_supported = 0;
+     b->pwm_default_period = 500;
+-    b->pwm_max_period = 2147483;
++    b->pwm_max_period = 1000000;
+     b->pwm_min_period = 1;
+-    b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t) * b->phy_pin_count);
+-
+-    advance_func->gpio_mmap_setup = &mraa_mtk_linkit_mmap_setup;
+-
+-    strncpy(b->pins[0].name, "P0", MRAA_PIN_NAME_SIZE);
+-    b->pins[0].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[1].name, "P1", MRAA_PIN_NAME_SIZE);
+-    b->pins[1].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[2].name, "P2", MRAA_PIN_NAME_SIZE);
+-    b->pins[2].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[3].name, "P3", MRAA_PIN_NAME_SIZE);
+-    b->pins[3].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[4].name, "P4", MRAA_PIN_NAME_SIZE);
+-    b->pins[4].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[5].name, "P5", MRAA_PIN_NAME_SIZE);
+-    b->pins[5].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[6].name, "P6", MRAA_PIN_NAME_SIZE);
+-    b->pins[6].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[7].name, "P7", MRAA_PIN_NAME_SIZE);
+-    b->pins[7].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
+-
+-    strncpy(b->pins[8].name, "P8", MRAA_PIN_NAME_SIZE);
+-    b->pins[8].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
+-    b->pins[8].gpio.pinmap = 21;
+-    b->pins[8].uart.parent_id = 2;
+-    b->pins[8].uart.mux_total = 0;
++    b->adv_func = (mraa_adv_func_t*) calloc(1, sizeof(mraa_adv_func_t));
++    if (b->adv_func == NULL) {
++        return NULL;
++    }
+-    strncpy(b->pins[9].name, "P9", MRAA_PIN_NAME_SIZE);
+-    b->pins[9].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
+-    b->pins[9].gpio.pinmap = 20;
+-    b->pins[9].uart.parent_id = 2;
+-    b->pins[9].uart.mux_total = 0;
++    b->adv_func->i2c_init_pre = i2c_init_pre;
++    b->adv_func->pwm_init_post = pwm_init_post;
++    b->adv_func->spi_init_pre = spi_init_pre;
++    b->adv_func->uart_init_pre = uart_init_pre;
++    b->adv_func->gpio_init_pre = gpio_init_pre;
++    b->adv_func->i2c_set_frequency_replace = &i2c_freq;
+-    strncpy(b->pins[10].name, "P10", MRAA_PIN_NAME_SIZE);
+-    b->pins[10].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[10].gpio.pinmap = 2;
++    b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t) * b->phy_pin_count);
+-    strncpy(b->pins[11].name, "P11", MRAA_PIN_NAME_SIZE);
+-    b->pins[11].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[11].gpio.pinmap = 3;
++    memset(b->pins, 0, sizeof(mraa_pininfo_t) * b->phy_pin_count);
++    memset(gpio_mux_groups, -1, sizeof(gpio_mux_groups));
+-    strncpy(b->pins[12].name, "P12", MRAA_PIN_NAME_SIZE);
+-    b->pins[12].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[12].gpio.pinmap = 0;
++    b->adv_func->gpio_mmap_setup = &mraa_mtk_linkit_mmap_setup;
+-    strncpy(b->pins[13].name, "P13", MRAA_PIN_NAME_SIZE);
+-    b->pins[13].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[13].gpio.pinmap = 1;
++    for (i = 0; i < b->phy_pin_count; i++) {
++        snprintf(b->pins[i].name, MRAA_PIN_NAME_SIZE, "GPIO%d", i);
++        b->pins[i].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++    }
+-    strncpy(b->pins[14].name, "P14", MRAA_PIN_NAME_SIZE);
+-    b->pins[14].capabilites = (mraa_pincapabilities_t){ 0, 0, 0, 0, 0, 0, 0, 0 };
++    strncpy(b->pins[43].name, "GPIO43", MRAA_PIN_NAME_SIZE);
++    b->pins[43].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[43].gpio.pinmap = 43;
++    gpio_mux_groups[43] = MUX_EPHY;
++
++    strncpy(b->pins[20].name, "GPIO20", MRAA_PIN_NAME_SIZE);
++    b->pins[20].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 1 };
++    b->pins[20].gpio.pinmap = 20;
++    b->pins[20].uart.parent_id = 2;
++    b->pins[20].uart.mux_total = 0;
++    b->pins[20].pwm.parent_id = 0;
++    b->pins[20].pwm.pinmap = 2;
++    gpio_mux_groups[20] = MUX_UART2;
++
++    strncpy(b->pins[21].name, "GPIO21", MRAA_PIN_NAME_SIZE);
++    b->pins[21].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 1 };
++    b->pins[21].gpio.pinmap = 21;
++    b->pins[21].uart.parent_id = 2;
++    b->pins[21].uart.mux_total = 0;
++    b->pins[21].pwm.parent_id = 0;
++    b->pins[21].pwm.pinmap = 3;
++    gpio_mux_groups[21] = MUX_UART2;
++
++    strncpy(b->pins[2].name, "GPIO2", MRAA_PIN_NAME_SIZE);
++    b->pins[2].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[2].gpio.pinmap = 2;
++    gpio_mux_groups[2] = MUX_I2S;
++
++    strncpy(b->pins[3].name, "GPIO3", MRAA_PIN_NAME_SIZE);
++    b->pins[3].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[3].gpio.pinmap = 3;
++    gpio_mux_groups[3] = MUX_I2S;
++
++    strncpy(b->pins[0].name, "GPIO0", MRAA_PIN_NAME_SIZE);
++    b->pins[0].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[0].gpio.pinmap = 0;
++    gpio_mux_groups[0] = MUX_I2S;
++
++    strncpy(b->pins[1].name, "GPIO1", MRAA_PIN_NAME_SIZE);
++    b->pins[1].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[1].gpio.pinmap = 1;
++    gpio_mux_groups[1] = MUX_I2S;
++
++    strncpy(b->pins[37].name, "GPIO37", MRAA_PIN_NAME_SIZE);
++    b->pins[37].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[37].gpio.pinmap = 37;
++    gpio_mux_groups[37] = MUX_GPIO;
++
++    strncpy(b->pins[44].name, "GPIO44", MRAA_PIN_NAME_SIZE);
++    b->pins[44].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[44].gpio.pinmap = 44;
++    gpio_mux_groups[44] = MUX_WLED;
++
++    strncpy(b->pins[46].name, "GPIO46", MRAA_PIN_NAME_SIZE);
++    b->pins[46].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[46].gpio.pinmap = 46;
++    b->pins[46].uart.parent_id = 1;
++    b->pins[46].uart.mux_total = 0;
++    gpio_mux_groups[46] = MUX_UART1;
++
++    strncpy(b->pins[45].name, "GPIO45", MRAA_PIN_NAME_SIZE);
++    b->pins[45].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[45].gpio.pinmap = 45;
++    b->pins[45].uart.parent_id = 1;
++    b->pins[45].uart.mux_total = 0;
++    gpio_mux_groups[45] = MUX_UART1;
++
++    strncpy(b->pins[13].name, "GPIO13", MRAA_PIN_NAME_SIZE);
++    b->pins[13].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[13].gpio.pinmap = 13;
++    b->pins[13].uart.parent_id = 1;
++    b->pins[13].uart.mux_total = 0;
++    gpio_mux_groups[13] = MUX_UART0;
++
++    strncpy(b->pins[12].name, "GPIO12", MRAA_PIN_NAME_SIZE);
++    b->pins[12].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
++    b->pins[12].gpio.pinmap = 12;
++    b->pins[12].uart.parent_id = 0;
++    b->pins[12].uart.mux_total = 0;
++    gpio_mux_groups[12] = MUX_UART0;
++
++    strncpy(b->pins[5].name, "GPIO5", MRAA_PIN_NAME_SIZE);
++    b->pins[5].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
++    b->pins[5].gpio.pinmap = 5;
++    b->pins[5].i2c.pinmap = 0;
++    b->pins[5].i2c.mux_total = 0;
++    gpio_mux_groups[5] = MUX_I2C;
++
++    strncpy(b->pins[4].name, "GPIO4", MRAA_PIN_NAME_SIZE);
++    b->pins[4].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
++    b->pins[4].gpio.pinmap = 4;
++    b->pins[4].i2c.pinmap = 0;
++    b->pins[4].i2c.mux_total = 0;
++    gpio_mux_groups[4] = MUX_I2C;
++
++    strncpy(b->pins[6].name, "GPIO6", MRAA_PIN_NAME_SIZE);
++    b->pins[6].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
++    b->pins[6].gpio.pinmap = 6;
++    b->pins[6].spi.pinmap = 0;
++    b->pins[6].spi.mux_total = 0;
++    gpio_mux_groups[6] = MUX_SPI_CS1;
++
++    strncpy(b->pins[7].name, "GPIO7", MRAA_PIN_NAME_SIZE);
++    b->pins[7].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 1, 0, 0, 0 };
++    b->pins[7].spi.pinmap = 0;
++    b->pins[7].spi.mux_total = 0;
++
++    strncpy(b->pins[8].name, "GPIO8", MRAA_PIN_NAME_SIZE);
++    b->pins[8].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 1, 0, 0, 0 };
++    b->pins[8].spi.pinmap = 0;
++    b->pins[8].spi.mux_total = 0;
++
++    strncpy(b->pins[9].name, "GPIO9", MRAA_PIN_NAME_SIZE);
++    b->pins[9].capabilites = (mraa_pincapabilities_t){ 1, 0, 0, 0, 1, 0, 0, 0 };
++    b->pins[9].spi.pinmap = 0;
++    b->pins[9].spi.mux_total = 0;
++
++    strncpy(b->pins[18].name, "GPIO18", MRAA_PIN_NAME_SIZE);
++    b->pins[18].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
++    b->pins[18].gpio.pinmap = 18;
++    b->pins[18].pwm.parent_id = 0;
++    b->pins[18].pwm.pinmap = 0;
++    gpio_mux_groups[18] = MUX_PWM0;
++
++    strncpy(b->pins[19].name, "GPIO19", MRAA_PIN_NAME_SIZE);
++    b->pins[19].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
++    b->pins[19].gpio.pinmap = 19;
++    b->pins[19].pwm.parent_id = 0;
++    b->pins[19].pwm.pinmap = 1;
++    gpio_mux_groups[19] = MUX_PWM1;
++
++    strncpy(b->pins[16].name, "GPIO16", MRAA_PIN_NAME_SIZE);
++    b->pins[16].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[16].gpio.pinmap = 16;
++    gpio_mux_groups[16] = MUX_SPI_S;
++
++    strncpy(b->pins[17].name, "GPIO17", MRAA_PIN_NAME_SIZE);
++    b->pins[17].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[17].gpio.pinmap = 17;
++    gpio_mux_groups[17] = MUX_SPI_S;
++
++    strncpy(b->pins[14].name, "GPIO14", MRAA_PIN_NAME_SIZE);
++    b->pins[14].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
++    b->pins[14].gpio.pinmap = 14;
++    gpio_mux_groups[14] = MUX_SPI_S;
+-    strncpy(b->pins[15].name, "P15", MRAA_PIN_NAME_SIZE);
++    strncpy(b->pins[15].name, "GPIO15", MRAA_PIN_NAME_SIZE);
+     b->pins[15].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[15].gpio.pinmap = 44;
+-
+-    strncpy(b->pins[16].name, "P16", MRAA_PIN_NAME_SIZE);
+-    b->pins[16].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
+-    b->pins[16].gpio.pinmap = 46;
+-    b->pins[16].uart.parent_id = 1;
+-    b->pins[16].uart.mux_total = 0;
+-
+-    strncpy(b->pins[17].name, "P17", MRAA_PIN_NAME_SIZE);
+-    b->pins[17].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
+-    b->pins[17].gpio.pinmap = 45;
+-    b->pins[17].uart.parent_id = 1;
+-    b->pins[17].uart.mux_total = 0;
+-
+-    strncpy(b->pins[18].name, "P18", MRAA_PIN_NAME_SIZE);
+-    b->pins[18].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
+-    b->pins[18].gpio.pinmap = 13;
+-    b->pins[18].uart.parent_id = 1;
+-    b->pins[18].uart.mux_total = 0;
+-
+-    strncpy(b->pins[19].name, "P19", MRAA_PIN_NAME_SIZE);
+-    b->pins[19].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
+-    b->pins[19].gpio.pinmap = 12;
+-    b->pins[19].uart.parent_id = 0;
+-    b->pins[19].uart.mux_total = 0;
+-
+-    strncpy(b->pins[20].name, "P20", MRAA_PIN_NAME_SIZE);
+-    b->pins[20].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
+-    b->pins[20].gpio.pinmap = 5;
+-    b->pins[20].i2c.pinmap = 0;
+-    b->pins[20].i2c.mux_total = 0;
+-
+-    strncpy(b->pins[21].name, "P21", MRAA_PIN_NAME_SIZE);
+-    b->pins[21].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 1, 0, 0 };
+-    b->pins[21].gpio.pinmap = 4;
+-    b->pins[21].i2c.pinmap = 0;
+-    b->pins[21].i2c.mux_total = 0;
+-
+-    strncpy(b->pins[22].name, "P22", MRAA_PIN_NAME_SIZE);
+-    b->pins[22].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
+-    b->pins[22].gpio.pinmap = 8;
+-    b->pins[22].spi.pinmap = 0;
+-    b->pins[22].spi.mux_total = 0;
+-
+-    strncpy(b->pins[23].name, "P23", MRAA_PIN_NAME_SIZE);
+-    b->pins[23].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
+-    b->pins[23].gpio.pinmap = 9;
+-    b->pins[23].spi.pinmap = 0;
+-    b->pins[23].spi.mux_total = 0;
+-
+-    strncpy(b->pins[24].name, "P24", MRAA_PIN_NAME_SIZE);
+-    b->pins[24].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
+-    b->pins[24].gpio.pinmap = 7;
+-    b->pins[24].spi.pinmap = 0;
+-    b->pins[24].spi.mux_total = 0;
+-
+-    strncpy(b->pins[25].name, "P25", MRAA_PIN_NAME_SIZE);
+-    b->pins[25].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 1, 0, 0, 0 };
+-    b->pins[25].gpio.pinmap = 6;
+-    b->pins[25].spi.pinmap = 0;
+-    b->pins[25].spi.mux_total = 0;
+-
+-    strncpy(b->pins[26].name, "P26", MRAA_PIN_NAME_SIZE);
+-    b->pins[26].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
+-    b->pins[26].gpio.pinmap = 18;
+-
+-    strncpy(b->pins[27].name, "P27", MRAA_PIN_NAME_SIZE);
+-    b->pins[27].capabilites = (mraa_pincapabilities_t){ 1, 1, 1, 0, 0, 0, 0, 0 };
+-    b->pins[27].gpio.pinmap = 19;
+-
+-    strncpy(b->pins[28].name, "P28", MRAA_PIN_NAME_SIZE);
+-    b->pins[28].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[28].gpio.pinmap = 16;
+-
+-    strncpy(b->pins[29].name, "P29", MRAA_PIN_NAME_SIZE);
+-    b->pins[29].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[29].gpio.pinmap = 17;
+-
+-    strncpy(b->pins[30].name, "P30", MRAA_PIN_NAME_SIZE);
+-    b->pins[30].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[30].gpio.pinmap = 14;
+-
+-    strncpy(b->pins[31].name, "P31", MRAA_PIN_NAME_SIZE);
+-    b->pins[31].capabilites = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
+-    b->pins[31].gpio.pinmap = 15;
++    b->pins[15].gpio.pinmap = 15;
++    gpio_mux_groups[15] = MUX_SPI_S;
+     // BUS DEFINITIONS
+     b->i2c_bus_count = 1;
+     b->def_i2c_bus = 0;
+-        b->i2c_bus[0].bus_id = 0;
+-    b->i2c_bus[0].sda = 20;
+-    b->i2c_bus[0].scl = 21;
++    b->i2c_bus[0].bus_id = 0;
++    b->i2c_bus[0].sda = 5;
++    b->i2c_bus[0].scl = 4;
+     b->spi_bus_count = 1;
+     b->def_spi_bus = 0;
+-    b->spi_bus[0].bus_id = 0;
+-    b->spi_bus[0].slave_s = 0;
+-    b->spi_bus[0].cs = 25;
+-    b->spi_bus[0].mosi = 22;
+-    b->spi_bus[0].miso = 23;
+-    b->spi_bus[0].sclk = 21;
++    b->spi_bus[0].bus_id = 32766;
++    b->spi_bus[0].slave_s = 1;
++    b->spi_bus[0].cs = 6;
++    b->spi_bus[0].mosi = 8;
++    b->spi_bus[0].miso = 9;
++    b->spi_bus[0].sclk = 7;
+     b->uart_dev_count = 3;
+     b->def_uart_dev = 0;
+-    b->uart_dev[0].rx = 18;
+-    b->uart_dev[0].tx = 19;
+-
+-    b->uart_dev[1].rx = 16;
+-    b->uart_dev[1].tx = 17;
+-
+-    b->uart_dev[2].rx = 9;
+-    b->uart_dev[2].tx = 8;
++    b->uart_dev[0].rx = 13;
++    b->uart_dev[0].tx = 12;
++    b->uart_dev[0].device_path = "/dev/ttyS0";
++    b->uart_dev[1].rx = 46;
++    b->uart_dev[1].tx = 45;
++    b->uart_dev[1].device_path = "/dev/ttyS1";
++    b->uart_dev[2].rx = 21;
++    b->uart_dev[2].tx = 20;
++    b->uart_dev[2].device_path = "/dev/ttyS2";
+     b->gpio_count = 0;
+-    int i;
+     for (i = 0; i < b->phy_pin_count; i++) {
+         if (b->pins[i].capabilites.gpio) {
+             b->gpio_count++;
+--- a/src/gpio/gpio.c
++++ b/src/gpio/gpio.c
+@@ -113,6 +113,8 @@
+         close(export);
+     }
++    mraa_gpio_use_mmaped(dev, 1);
++
+ init_internal_cleanup:
+     if (status != MRAA_SUCCESS) {
+         if (dev != NULL)
index f90d9bc8f418c98d11437afaf0070c59091a3487..b7b52b4a60a98fbaaa4077a2009a689267328550 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libnatpmp
-PKG_VERSION:=20140401
+PKG_VERSION:=20150609
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://miniupnp.free.fr/files
-PKG_MD5SUM:=7c9a7c76e200ead4e6447fe4b105f676
+PKG_SOURCE_URL:=https://miniupnp.tuxfamily.org/files
+PKG_HASH:=e1aa9c4c4219bc06943d6b2130f664daee213fb262fcb94dd355815b8f4536b0
 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
 PKG_LICENSE:=BSD-3c
 PKG_LICENSE_FILES:=LICENSE
diff --git a/libs/libndpi/Makefile b/libs/libndpi/Makefile
new file mode 100644 (file)
index 0000000..e66ddba
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# Copyright (C) 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:=libndpi
+PKG_VERSION:=2.2
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Banglang Huang <banglang.huang@foxmail.com>
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/ntop/nDPI.git
+PKG_SOURCE_VERSION:=56dcf659de5de5385406068704a89c6a39e34041
+
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=425f48e21295d4b522d0190181bd5943ae0664c20a3aa47f3c62611dd4c7b93f
+PKG_LICENSE:=LGPLv3
+
+PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libndpi
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Library for deep-packet inspection
+  URL:=https://github.com/ntop/nDPI
+  DEPENDS:=+libpcap +libjson-c
+endef
+
+define Package/libndpi/description
+  nDPI is an open source LGPLv3 library for deep-packet inspection. 
+  Based on OpenDPI it includes ntop extensions.
+endef
+
+define Build/Configure
+       ( cd $(PKG_BUILD_DIR); ./autogen.sh )
+       $(call Build/Configure/Default)
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/libndpi-$(PKG_VERSION).0/libndpi \
+               $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libndpi.so* \
+               $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libndpi.pc \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libndpi/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libndpi.so* \
+               $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/bin/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/bin/ndpiReader \
+               $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libndpi))
index 84591f01d8da6027896993200a5de61d2c1e8c67..b9391bb4396135d3ce126a09d193f395fed7e2b9 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libnet
 PKG_VERSION:=1.2-rc3
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://sourceforge.net/projects/libnet-dev/files/
-PKG_MD5SUM:=f051e6e5bdecddb90f77c701c2ca1804
+PKG_HASH:=72c380785ad44183005e654b47cc12485ee0228d7fa6b0a87109ff7614be4a63
 PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
 PKG_LICENSE:=GPL-2.0
 
@@ -53,14 +53,14 @@ endef
 
 
 define Build/InstallDev
-       $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/libnet-1.2.x/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/libnet.h $(STAGING_DIR)/usr/lib/libnet-1.2.x/include
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libnet.h $(STAGING_DIR)/usr/include
 
-       $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/libnet-1.2.x/include/libnet
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/libnet/libnet-*.h $(STAGING_DIR)/usr/lib/libnet-1.2.x/include/libnet
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/include/libnet
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libnet/libnet-*.h $(STAGING_DIR)/usr/include/libnet
 
-       $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/libnet-1.2.x/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.{a,la,so*} $(STAGING_DIR)/usr/lib/libnet-1.2.x/lib
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.{a,la,so*} $(STAGING_DIR)/usr/lib
 endef
 
 define Package/libnet-1.2.x/install
diff --git a/libs/libnetconf2/Makefile b/libs/libnetconf2/Makefile
new file mode 100644 (file)
index 0000000..96b59c0
--- /dev/null
@@ -0,0 +1,77 @@
+#
+# Copyright (C) 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:=libnetconf2
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
+
+PKG_VERSION:=0.10.17
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=bd93b091d6e4414283c6c764dc451aee61e09997
+PKG_MIRROR_HASH:=499847be79d202cb0c933aad8133a38ebca7099344a1194404e488aa4d10ff08
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/cesnet/libnetconf2/
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
+
+PKG_BUILD_ROOT:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+CMAKE_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libnetconf2
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=NETCONF library
+  URL:=$(PKG_SOURCE_URL)
+  DEPENDS:= +libyang +libssh +libopenssl
+endef
+
+define Package/libnetconf2/description
+ libnetconf2 is the NETCONF library in C intended for building NETCONF clients and servers.
+
+ libnetconf2 provides basic functions to connect NETCONF client and server to each other via
+ SSH, to send and receive NETCONF messages. NETCONF datastore implementation is not included.
+endef
+
+CMAKE_OPTIONS += \
+       -DCMAKE_INSTALL_PREFIX:PATH=/usr \
+       -DCMAKE_BUILD_TYPE:STRING=Release
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/libnetconf2
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libnetconf2/*.h $(1)/usr/include/libnetconf2/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libnetconf2.so* $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/include/libnetconf2
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/include/libnetconf2/* $(1)/usr/include/libnetconf2/
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnetconf2.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libnetconf2/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetconf2.so* $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/share/libnetconf2
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libnetconf2/*.yin $(1)/usr/share/libnetconf2/
+endef
+
+$(eval $(call BuildPackage,libnetconf2))
index 892660716270d6064ace4e28c91722eb423dceeb..cd261d958b924c97251cbeb75ce41a1ff7a2e3e1 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:= \
        http://www.netfilter.org/projects/libnetfilter_acct/files/ \
        ftp://ftp.netfilter.org/pub/libnetfilter_acct/ \
        http://mirrors.evolva.ro/netfilter.org/libnetfilter_acct/
-PKG_MD5SUM:=2118d9514c079839ebd9cb3144ad2ad7
+PKG_HASH:=0128f19c3419fbd84f7e6d46b13a33ef7bda9b9f5e493bc5ae1882d087514b71
 
 PKG_LICENSE:=LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING
index fe964055d1358174005be135d13f610130205aee..8f5f5840c8041aec07e7d2833706761feac4aab6 100644 (file)
@@ -9,13 +9,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nopoll
 PKG_VERSION:=0.4.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/ASPLes/nopoll.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=60a81fbd199551ac5dd017b9a44fb46e8530680b
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=ce67b91ea54dda6678321e05a3e584648032a31323409a76df5dd60e7bfd17de
 
 PKG_MAINTAINER:=John Clark <inindev@gmail.com>
 
@@ -40,6 +41,8 @@ define Package/libnopoll/description
   This package contains the noPoll C WebSocket library.
 endef
 
+TARGET_LDFLAGS += -lcrypto -lpthread
+
 CONFIGURE_ARGS += \
        --enable-nopoll-log=no \
        --enable-nopoll-doc=no
diff --git a/libs/libnopoll/patches/001-param_h_rename.patch b/libs/libnopoll/patches/001-param_h_rename.patch
new file mode 100644 (file)
index 0000000..2eb0340
--- /dev/null
@@ -0,0 +1,66 @@
+From 675ac7b4b64d398de8a61e9c713383b8c0d9071f Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli@gmail.com>
+Date: Tue, 20 Jun 2017 20:06:36 -0700
+Subject: [PATCH] nopoll: * [fix] Avoid clashes with isset() from sys/param.h
+
+---
+ src/nopoll_io.c      | 4 ++--
+ src/nopoll_loop.c    | 4 ++--
+ src/nopoll_private.h | 4 ++--
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/nopoll_io.c b/src/nopoll_io.c
+index 036aa2c1c685..b3e48c2385d0 100644
+--- a/src/nopoll_io.c
++++ b/src/nopoll_io.c
+@@ -204,8 +204,8 @@ noPollIoEngine * nopoll_io_get_engine (noPollCtx * ctx, noPollIoEngineType engin
+       engine->destroy = nopoll_io_wait_select_destroy;
+       engine->clear   = nopoll_io_wait_select_clear;
+       engine->wait    = nopoll_io_wait_select_wait;
+-      engine->addto   = nopoll_io_wait_select_add_to;
+-      engine->isset   = nopoll_io_wait_select_is_set;
++      engine->add_to  = nopoll_io_wait_select_add_to;
++      engine->is_set  = nopoll_io_wait_select_is_set;
+       /* call to create the object */
+       engine->ctx       = ctx;
+diff --git a/src/nopoll_loop.c b/src/nopoll_loop.c
+index f58b8133b79a..60112f8dbf58 100644
+--- a/src/nopoll_loop.c
++++ b/src/nopoll_loop.c
+@@ -64,7 +64,7 @@ nopoll_bool nopoll_loop_register (noPollCtx * ctx, noPollConn * conn, noPollPtr
+       /* register the connection socket */
+       /* nopoll_log (ctx, NOPOLL_LEVEL_DEBUG, "Adding socket id: %d", conn->session);*/
+-      if (! ctx->io_engine->addto (conn->session, ctx, conn, ctx->io_engine->io_object)) {
++      if (! ctx->io_engine->add_to (conn->session, ctx, conn, ctx->io_engine->io_object)) {
+               /* remove this connection from registry */
+               nopoll_ctx_unregister_conn (ctx, conn);
+@@ -109,7 +109,7 @@ nopoll_bool nopoll_loop_process (noPollCtx * ctx, noPollConn * conn, noPollPtr u
+       int        * conn_changed = (int *) user_data;
+       /* check if the connection have something to notify */
+-      if (ctx->io_engine->isset (ctx, conn->session, ctx->io_engine->io_object)) {
++      if (ctx->io_engine->is_set (ctx, conn->session, ctx->io_engine->io_object)) {
+               /* call to notify action according to role */
+               switch (conn->role) {
+diff --git a/src/nopoll_private.h b/src/nopoll_private.h
+index 82fd27bb7fba..cd895d1e3ffd 100644
+--- a/src/nopoll_private.h
++++ b/src/nopoll_private.h
+@@ -340,8 +340,8 @@ struct _noPollIoEngine {
+       noPollIoMechDestroy    destroy;
+       noPollIoMechClear      clear;
+       noPollIoMechWait       wait;
+-      noPollIoMechAddTo      addto;
+-      noPollIoMechIsSet      isset;
++      noPollIoMechAddTo      add_to;
++      noPollIoMechIsSet      is_set;
+ };
+ struct _noPollMsg {
+-- 
+2.11.0
+
index e5be95220402dac565954e04763f247c82398b96..0d55d8e04895e3051dda0ef5af6bc02ea7369ba0 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://downloads.xiph.org/releases/ogg/
-PKG_MD5SUM:=5c3a34309d8b98640827e5d0991a4015
+PKG_HASH:=3f687ccdd5ac8b52d76328fbbfebc70c459a40ea891dbf3dccb74a210826e79b
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=BSD-3-Clause
index 8850c74fdaf7701fdb96c43ce84054e99648cebc..ba2cf87fe2da2885d3631187934f1825b864cac4 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://liboil.freedesktop.org/download/
-PKG_MD5SUM:=47dc734f82faeb2964d97771cfd2e701
+PKG_HASH:=105f02079b0b50034c759db34b473ecb5704ffa20a5486b60a8b7698128bfc69
 
 PKG_LICENSE:=FREE
 PKG_LICENSE_FILES:=COPYING
index ffed96d54f61c646970b5cc0f494a6725051e640..4524494c0bfa1d378c55cb79ac5dc171b9b52ae3 100644 (file)
@@ -15,7 +15,7 @@ PKG_LICENSE:=LGPL-2.1+
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://noping.cc/files
-PKG_MD5SUM:=9c9f65bfd297d7e7092c7f219c31f66a
+PKG_HASH:=44bb1d88b56b88fda5533edb3aa005c69b3cd396f20453a157d7e31e536f3530
 
 PKG_FIXUP:=autoreconf
 
index 01bd25a1f697c11a4da6a7967492d7bd1fb71413..99eba1c2554e45f0c9b56595474ff67775e5980f 100644 (file)
@@ -1,26 +1,24 @@
-#
-# 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
 
-LOWFAT_VERSION=0.30
-
 PKG_NAME:=libowfat
-PKG_VERSION:=$(LOWFAT_VERSION)
+PKG_VERSION:=0.31
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.fefe.de/libowfat
-PKG_MD5SUM:=f0119532ea834ce9e80afe49d7d85512
+PKG_HASH:=d1e4ac1cfccbb7dc51d77d96398e6302d229ba7538158826c84cb4254c7e8a12
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
+PKG_BUILD_DEPENDS += libowfat/host
+
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
 
 # set to 1 to enable debugging
 DEBUG=
@@ -39,7 +37,13 @@ TARGET_CFLAGS += $(FPIC)
 LOWFAT_MAKEOPTS = $(TARGET_CONFIGURE_OPTS) \
        CFLAGS="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include" \
        DEBUG="$(DEBUG)" \
-       VERSION="$(LOWFAT_VERSION)" \
+       VERSION="$(PKG_VERSION)" \
+       OS="Linux"
+
+LOWFAT_HOST_MAKEOPTS = $(HOST_CONFIGURE_OPTS) \
+       CFLAGS="$(HOST_CFLAGS) -I$(HOST_BUILD_DIR) -I$(STAGING_DIR_HOSTPKG)/include" \
+       DEBUG="$(DEBUG)" \
+       VERSION="$(PKG_VERSION)" \
        OS="Linux"
 
 # work around a nasty gcc bug
@@ -51,6 +55,15 @@ define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) $(LOWFAT_MAKEOPTS)
 endef
 
+define Host/Compile
+       $(MAKE) -C $(HOST_BUILD_DIR) $(LOWFAT_HOST_MAKEOPTS) ent
+endef
+
+define Host/Install
+       $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
+       $(CP) $(HOST_BUILD_DIR)/ent $(STAGING_DIR_HOSTPKG)/bin/libowfat-ent
+endef
+
 define Build/InstallDev
        mkdir -p $(1)/usr/include/libowfat
        $(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libowfat
@@ -58,4 +71,5 @@ define Build/InstallDev
        $(CP) $(PKG_BUILD_DIR)/*.a $(1)/usr/lib
 endef
 
+$(eval $(call HostBuild))
 $(eval $(call BuildPackage,libowfat))
index a21fcd0ee2cdc5719aa18780a9d3d8728e822741..5f4f06df35513cf99d8e2003c57f8ee6d046a116 100644 (file)
@@ -1,6 +1,6 @@
 --- a/GNUmakefile
 +++ b/GNUmakefile
-@@ -278,6 +278,8 @@ socket_accept4.o socket_accept6.o socket
+@@ -343,6 +343,8 @@ socket_accept4.o socket_accept6.o socket
  socket_local6.o socket_recv4.o socket_recv6.o socket_remote4.o \
  socket_remote6.o: havesl.h
  
@@ -9,3 +9,11 @@
  dns_nd6.o fmt_xlong.o scan_xlong.o fmt_ip6_flat.o $(TEXTCODE_OBJS): haveinline.h
  
  iob_send.o scan_ip6if.o: havealloca.h
+@@ -372,6 +374,6 @@ update:
+       dl -n http://www.w3.org/TR/html5/entities.json
+ entities.h: entities.json ent
+-      ./ent
++      libowfat-ent
+ scan_html.o: entities.h
index c477d2b1ad50de1e6c4e99134e32bc381c7b87bf..448521260a37a802175093873ab317063e335b4f 100644 (file)
@@ -8,9 +8,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libp11
-PKG_VERSION:=0.4.1
-PKG_RELEASE:=2
-PKG_MD5SUM:=70489f6dbe0b7fd72aab010c25016fa047723f67ea50ce9ae73bc8d38181b673
+PKG_VERSION:=0.4.7
+PKG_RELEASE:=1
+PKG_HASH:=32e486d4279e09174b63eb263bc840016ebfa80b0b154390c0539b211aec0452
 
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=LGPL-2.1+
@@ -42,7 +42,7 @@ CONFIGURE_ARGS += --with-enginesdir=/usr/lib/engines
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/libp11.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libp11.{a,so} $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libp11.so* $(1)/usr/lib/
index eb9b7741f4ee13932608621ebc958cad9ec1bcb5..9766b804555033b683cc99902eb5511424db2e09 100644 (file)
@@ -1,25 +1,22 @@
-Index: libp11-0.4.1/src/Makefile.am
-===================================================================
---- libp11-0.4.1.orig/src/Makefile.am
-+++ libp11-0.4.1/src/Makefile.am
-@@ -36,12 +36,6 @@ pkcs11_la_LIBADD = $(libp11_la_OBJECTS)
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -47,13 +47,6 @@ pkcs11_la_LIBADD = $(libp11_la_OBJECTS)
  pkcs11_la_LDFLAGS = $(AM_LDFLAGS) -module -shared -shrext $(SHARED_EXT) \
        -avoid-version -export-symbols "$(srcdir)/pkcs11.exports"
  
 -# OpenSSL older than 1.1.0 expected libpkcs11.so instead of pkcs11.so
 -check-local: $(LTLIBRARIES)
 -      cd .libs && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
+-
 -install-exec-hook:
--      cd '$(DESTDIR)$(enginesdir)' && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
+-      cd '$(DESTDIR)$(enginesexecdir)' && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
 -
  if WIN32
  # def file required for MS users to build library
  mylibdir=$(libdir)
-Index: libp11-0.4.1/src/Makefile.in
-===================================================================
---- libp11-0.4.1.orig/src/Makefile.in
-+++ libp11-0.4.1/src/Makefile.in
-@@ -839,7 +839,7 @@ distdir: $(DISTFILES)
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -844,7 +844,7 @@ distdir: $(DISTFILES)
          fi; \
        done
  check-am: all-am
@@ -28,42 +25,30 @@ Index: libp11-0.4.1/src/Makefile.in
  check: check-am
  all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) config.h
  installdirs:
-@@ -910,7 +910,7 @@ install-dvi-am:
+@@ -915,7 +915,7 @@ install-dvi-am:
  
- install-exec-am: install-libLTLIBRARIES
+ install-exec-am: install-enginesexecLTLIBRARIES install-libLTLIBRARIES
        @$(NORMAL_INSTALL)
 -      $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 +      $(MAKE) $(AM_MAKEFLAGS)
  install-html: install-html-am
  
  install-html-am:
-@@ -955,7 +955,7 @@ uninstall-am: uninstall-enginesLTLIBRARI
+@@ -960,7 +960,7 @@ uninstall-am: uninstall-enginesexecLTLIB
  
  .MAKE: all check-am install-am install-exec-am install-strip
  
 -.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \
 +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
-       clean-enginesLTLIBRARIES clean-generic clean-libLTLIBRARIES \
-       clean-libtool cscopelist-am ctags ctags-am distclean \
-       distclean-compile distclean-generic distclean-hdr \
-@@ -963,7 +963,7 @@ uninstall-am: uninstall-enginesLTLIBRARI
-       html-am info info-am install install-am install-data \
-       install-data-am install-dvi install-dvi-am \
-       install-enginesLTLIBRARIES install-exec install-exec-am \
+       clean-enginesexecLTLIBRARIES clean-generic \
+       clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
+       ctags-am distclean distclean-compile distclean-generic \
+@@ -968,7 +968,7 @@ uninstall-am: uninstall-enginesexecLTLIB
+       dvi-am html html-am info info-am install install-am \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-enginesexecLTLIBRARIES install-exec install-exec-am \
 -      install-exec-hook install-html install-html-am \
 +      install-html install-html-am \
        install-includeHEADERS install-info install-info-am \
        install-libLTLIBRARIES install-man install-mylibDATA \
        install-pdf install-pdf-am install-pkgconfigDATA install-ps \
-@@ -979,11 +979,6 @@ uninstall-am: uninstall-enginesLTLIBRARI
-       $(srcdir)/config.h.in $(srcdir)/config.h.in~
--# OpenSSL older than 1.1.0 expected libpkcs11.so instead of pkcs11.so
--check-local: $(LTLIBRARIES)
--      cd .libs && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
--install-exec-hook:
--      cd '$(DESTDIR)$(enginesdir)' && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
- @WIN32_TRUE@.libs/@WIN_LIBPREFIX@p11-@LIBP11_LT_OLDEST@.dll.def:      libp11.la
- .rc.lo:
index ee9ecc659440ab217931b0c4a4d250f0f31d6ce3..f7b46cebb225181082101bbf3a3320ce9e129e3f 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=Linux-PAM-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.linux-pam.org/library/
-PKG_MD5SUM:=ee4a480d77b341c99e8b1375f8f180c0
+PKG_HASH:=cd8beac5961e942e9c73b32a3cd1a3457755f8fb35d07c9ec64511e19e135ea4
 PKG_INSTALL:=1
 PKG_FIXUP:=autoreconf
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
index bb61336c4c1b97e5a44b6d875aff677b5d16aa09..c69c73317e7adaab86019ab78d891f0fd3805a25 100644 (file)
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libplist
-PKG_VERSION:=1.13
-PKG_RELEASE:=2
+PKG_VERSION:=2.0.0
+PKG_RELEASE:=3
 
 PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
 PKG_LICENSE:=LGPL-2.1+
@@ -18,8 +18,9 @@ PKG_LICENSE_FILES:=COPYING.LESSER
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/libimobiledevice/libplist.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=060eda6b1846968aa40b0d38dcf92ac46f933417
+PKG_SOURCE_VERSION:=62ec804736435fa34e37e66e228e17e2aacee1d7
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=0b6a7656b431f78b0f11370938e577bc16f30d2255ad675bf4b63a96876fb290
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
@@ -76,6 +77,8 @@ endef
 CONFIGURE_ARGS += \
        --without-cython
 
+TARGET_LDFLAGS += -lz
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/plist $(1)/usr/include/
index a4eda8e1765b7a2efc90ce9dcc1f0ad09b371ab9..fc48925c2775d3b76b25ec048bccfbae59b61277 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libpng
-PKG_VERSION:=1.2.57
+PKG_VERSION:=1.6.34
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@SF/libpng
-PKG_MD5SUM:=307052e5e8af97b82b17b64fb1b3677a
+PKG_HASH:=2f1e960d92ce3b3abd03d06dfec9637dfbd22febf107a536b44f7a47c60659f6
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 
 PKG_LICENSE:=Libpng GPL-2.0+ BSD-3-Clause
@@ -39,29 +39,32 @@ TARGET_CFLAGS += $(FPIC)
 CONFIGURE_ARGS += \
        --enable-shared \
        --enable-static \
+       $(if $(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),--enable-hardware-optimizations=yes --enable-arm-neon=yes)
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/libpng{,12}-config $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/libpng{,16}-config $(1)/usr/bin/
        $(SED) \
                's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
-               $(1)/usr/bin/libpng{,12}-config
+               $(1)/usr/bin/libpng{,16}-config
        $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/png{,conf}.h $(1)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/libpng12 $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/png{,conf,libconf}.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libpng16 $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng{,12}.{a,la,so*} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng16.{a,la,so*} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng.{a,la,so} $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpng{,12}.pc $(1)/usr/lib/pkgconfig/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpng{,16}.pc $(1)/usr/lib/pkgconfig/
        $(INSTALL_DIR) $(2)/bin
-       for f in libpng{,12}-config; do \
+       for f in libpng{,16}-config; do \
                $(LN) ../../usr/bin/$$$$f $(2)/bin/ ; \
        done
 endef
 
 define Package/libpng/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng{,12}.so.* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng16.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng.so $(1)/usr/lib/
 endef
 
 $(eval $(call HostBuild))
diff --git a/libs/libpng/patches/101-old-libtool.patch b/libs/libpng/patches/101-old-libtool.patch
new file mode 100644 (file)
index 0000000..47d89ce
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/configure.ac b/configure.ac
+index a978473..302ac4d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -70,7 +70,7 @@ AC_PROG_MAKE_SET
+ dnl libtool/libtoolize; version 2.4.2 is the tested version. This or any
+ dnl compatible later version may be used
+ LT_INIT([win32-dll])
+-LT_PREREQ([2.4.2])
++LT_PREREQ([2.4])
+ # Some awks crash when confronted with pnglibconf.dfa, do a test run now
+ # to make sure this doesn't happen
index e420a8e2c0ca1653d70be8400c56e66ac28d855f..c807329a51f6734e78415dac3c157598453d80c8 100644 (file)
@@ -13,7 +13,7 @@ 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_HASH:=be7551bcf0c210b8efffe4d2952d61feb8591edc922660910488bfaab040e82c
 PKG_BUILD_DIR:=$(BUILD_DIR)/radcli-$(PKG_VERSION)
 
 PKG_INSTALL:=1
diff --git a/libs/libredblack/Makefile b/libs/libredblack/Makefile
new file mode 100644 (file)
index 0000000..75a616a
--- /dev/null
@@ -0,0 +1,61 @@
+#
+# Copyright (C) 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:=libredblack
+PKG_VERSION:=0.2.3
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_LICENSE:=GPL-2.0+
+PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=a399310d99b61eec4d3c0677573ab5dddcf9395d
+PKG_MIRROR_HASH:=71b05e70988b97865f734c698dd5564e349680556ccb8634a5bddf344012f22a
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/sysrepo/libredblack.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
+
+PKG_BUILD_ROOT:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+define Package/libredblack
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=RedBlack tree library
+  URL:=$(PKG_SOURCE_URL)
+endef
+
+define Package/libredblack/description
+ RedBlack Balanced Tree Searching and Sorting Library.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libredblack.{so*,a,la} $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/redblack.h $(1)/usr/include/
+endef
+
+define Package/libredblack/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libredblack.{so*,a,la} $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/include/redblack.h $(1)/usr/include
+endef
+
+$(eval $(call BuildPackage,libredblack))
index a7619148c67337e52cbc5de81cdddcb6fb61080d..c01c89b65ecbd8da5f9c4bceb8e8d94f4310fe46 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.mega-nerd.com/SRC/
-PKG_MD5SUM:=1c7fb25191b4e6e3628d198a66a84f47
+PKG_HASH:=93b54bdf46d5e6d2354b7034395fe329c222a966790de34520702bb9642f1c06
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
index caf489e480b3f4d4b32ba58e8e62f451db69b7bd..b6cba662451d32d416ffae96bebe2e23fec4af36 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2016 OpenWrt.org
+# Copyright (C) 2007-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libsearpc
-PKG_VERSION:=5.1.4
+PKG_VERSION:=6.2.2
 PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
 PKG_LICENSE:=GPL-3.0
 
@@ -17,12 +17,13 @@ PKG_SOURCE_URL:=https://github.com/haiwen/libsearpc.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=8998e7b2c5587f0b94c48db24e2952d08def5add
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=207baa1fc63a60c117cf4985b60a18212b151fa070f208621633c3b53ab679bf
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/libsearpc
     SECTION:=libs
index 1ad5d2bff93cbb833a072fd2ba584cb8dd06184d..4b0b576a28c78060a4de6dabca331691d9849c05 100644 (file)
@@ -14,7 +14,7 @@ PKG_USE_MIPS16:=0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/seccomp/libseccomp/releases/download/v$(PKG_VERSION)/
-PKG_MD5SUM:=068af8e1bc36fcd4b326ee83875ab4fd
+PKG_HASH:=0ba1789f54786c644af54cdffc9fd0dd0a8bb2b2ee153933f658855d2851a740
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
 
 PKG_INSTALL:=1
index d491e32b8686935d327f49577e3420b571c716a1..6a02ff6985da587156a750d57c4b501201425177 100644 (file)
@@ -12,7 +12,6 @@ PKG_RELEASE:=1
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/libshout/
-PKG_MD5SUM:=89cebf8cb0197f639cde69c95177fe47
 PKG_HASH:=f3acb8dec26f2dbf6df778888e0e429a4ce9378a9d461b02a7ccbf2991bbf24d
 
 PKG_LICENSE:=LGPL-2.0+
index 524bb6f5e095784b17a8951f3c2bf7e1dc11fc57..f7ad98816bd9a159ca637d7ef8aaa9800d5158c6 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNOME/libsigc++/2.5
-PKG_MD5SUM:=0b74492da5f640ab69888a984c6520d7
+PKG_HASH:=ecf55f53d6058ba6e41985b862f2e95fb5c2b31c008caa16984e790547337ea7
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
 PKG_LICENSE:=LGPL-2.1
 
index fa92f14057916ec45bff51e9d7cefec3c90182f2..696ef761f2389d31d949fb5c86796e23dc713580 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libsndfile
-PKG_VERSION:=1.0.26
-PKG_RELEASE:=2
+PKG_VERSION:=1.0.28
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.mega-nerd.com/libsndfile/files/
-PKG_MD5SUM:=ec810a0c60c08772a8a5552704b63393
+PKG_HASH:=1ff33929f042fa333aed1e8923aa628c3ee9e1eb85512686c55092d1e5a9dfa9
 
 PKG_LICENSE:=LGPLv2.1
 PKG_LICENSE_FILES:=COPYING
diff --git a/libs/libsoc/Makefile b/libs/libsoc/Makefile
new file mode 100644 (file)
index 0000000..8209960
--- /dev/null
@@ -0,0 +1,71 @@
+#
+# Copyright (C) 2017 Yegor Yefremov <yegorslists@googlemail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libsoc
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/jackmitch/libsoc.git
+PKG_SOURCE_DATE:=2016-12-22
+PKG_SOURCE_VERSION:=5b788d4d558a78c52e6cfe97325e4564b307a3a0
+
+PKG_MAINTAINER:=Yegor Yefremov <yegorslists@googlemail.com>
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=LICENCE
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libsoc
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libpthread
+  TITLE:=SoC Library
+  URL:=https://github.com/jackmitch/libsoc
+endef
+
+define Package/libsoc/description
+  libsoc: C library for interfacing with common SoC peripherals through
+  generic kernel interfaces
+endef
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --disable-cxx
+
+MAKE_FLAGS += \
+       CFLAGS="$(TARGET_CFLAGS)" \
+       DESTDIR="$(PKG_INSTALL_DIR)" \
+       all install
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libsoc_board.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libsoc_conffile.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libsoc_debug.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libsoc_gpio.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libsoc_i2c.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libsoc_pwm.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libsoc_spi.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsoc.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsoc.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libsoc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsoc.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libsoc))
index 6dacbcb3e60b0a0f13c7e1d4f9bac915d791125a..704e32efebf6ef511d19c35e2efc48b93bb58405 100644 (file)
@@ -8,12 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libsodium
-PKG_VERSION:=1.0.11
-PKG_RELEASE:=2
+PKG_VERSION:=1.0.16
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://download.libsodium.org/libsodium/releases
-PKG_MD5SUM:=b58928d035064b2a46fb564937b83540
+PKG_SOURCE_URL:=https://download.libsodium.org/libsodium/releases \
+https://github.com/jedisct1/libsodium/releases/download/$(PKG_VERSION)
+PKG_HASH:=eeadc7e1e1bcef09680fb4837d448fbdf57224978f865ac1c16745868fbd0533
 
 PKG_FIXUP:=libtool autoreconf
 PKG_USE_MIPS16:=0
diff --git a/libs/libsoup/Makefile b/libs/libsoup/Makefile
new file mode 100644 (file)
index 0000000..385691f
--- /dev/null
@@ -0,0 +1,78 @@
+# 
+# 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:=libsoup
+PKG_VERSION:=2.60.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNOME/$(PKG_NAME)/2.60
+PKG_HASH:=1b0dc762f23abe4e0d29b77370e539fd35f31d8e8e0318d6ddccff395be68a22
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+TARGET_LDFLAGS+=\
+       -Wl,-rpath-link=$(STAGING_DIR)/usr/lib $(if $(ICONV_FULL),-liconv)
+
+define Package/libsoup
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=libsoup
+  URL:=http://live.gnome.org/LibSoup
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+  DEPENDS:=+glib2 +libxml2 +libgnutls +libsqlite3 $(ICONV_DEPENDS) $(INTL_DEPENDS)
+endef
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               --enable-ssl \
+               --disable-glibtest \
+               --without-apache-httpd \
+               --without-gnome \
+               --without-gssapi \
+               --enable-vala=no \
+               --disable-more-warnings \
+       )
+endef
+
+define package/libsoup/decription
+Libsoup is an HTTP library implementation in C
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/{lib/pkgconfig,include/libsoup-2.4/libsoup}
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libsoup-2.4.{so*,la,a} \
+               $(1)/usr/lib/
+
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
+               $(1)/usr/lib/pkgconfig/
+
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/include/libsoup-2.4/libsoup/*.h \
+               $(1)/usr/include/libsoup-2.4/libsoup/
+endef
+
+define Package/libsoup/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libsoup-2.4.so* \
+               $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libsoup))
index 9881fbb9d8717b708ffa4ae7ff2f3ca68d46f8a0..69dffc7de687b17435028c4b75b299755a4fa7d5 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2014-2016 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 # updated to work with latest source from abrasive
@@ -9,14 +7,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libsoxr
-PKG_VERSION:=0.1.1
-PKG_RELEASE:=3
+PKG_VERSION:=0.1.3
+PKG_RELEASE:=1
 
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://git.code.sf.net/p/soxr/code
-PKG_SOURCE_VERSION:=$(PKG_VERSION)
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/project/soxr/
+PKG_SOURCE:=soxr-$(PKG_VERSION)-Source.tar.xz
+PKG_HASH:=b111c15fdc8c029989330ff559184198c161100a59312f5dc19ddeb9b5a15889
+PKG_BUILD_DIR:=$(BUILD_DIR)/soxr-$(PKG_VERSION)-Source
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
                Mike Brady <mikebrady@eircom.net>
@@ -24,9 +21,6 @@ PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
 PKG_LICENSE:=LGPL-2.1
 PKG_LICENSE_FILES:=LICENCE
 
-PKG_FIXUP:=libtool
-PKG_REMOVE_FILES:=autogen.sh
-
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
 
@@ -48,6 +42,7 @@ endef
 
 CMAKE_OPTIONS:= -DBUILD_TESTS=0 -DBUILD_EXAMPLES=0
 CMAKE_OPTIONS+= -DHAVE_WORDS_BIGENDIAN_EXITCODE=$(if $(CONFIG_BIG_ENDIAN),0,1)
+CMAKE_OPTIONS+= -DWITH_OPENMP=0
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
diff --git a/libs/libsoxr/patches/010-Remove_automatic_avutil_inclusion.patch b/libs/libsoxr/patches/010-Remove_automatic_avutil_inclusion.patch
new file mode 100644 (file)
index 0000000..db66a14
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -134,7 +134,7 @@ if (WITH_AVFFT)
+   endif ()
+ endif ()
+-if (WITH_AVFFT OR (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" AND SIMD32_FOUND AND WITH_CR32))
++if (WITH_AVFFT)
+   find_package (LibAVUtil)
+   if (AVUTIL_FOUND)
+     include_directories (${AVUTIL_INCLUDE_DIRS})
diff --git a/libs/libssh/Makefile b/libs/libssh/Makefile
new file mode 100644 (file)
index 0000000..17dd3ba
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 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_LICENSE:=LGPL-2.1+ BSD-2-Clause
+PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
+
+PKG_NAME:=libssh
+PKG_VERSION:=0.7.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://red.libssh.org/attachments/download/218/
+PKG_HASH:=54e86dd5dc20e5367e58f3caab337ce37675f863f80df85b6b1614966a337095
+
+CMAKE_INSTALL:=1
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libssh
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=$(PKG_SOURCE_URL)
+  TITLE:=SSH library
+  DEPENDS:=+libpthread +librt +zlib +libopenssl
+endef
+
+define Package/libssh/description
+ libssh is a mulitplatform C library implementing the SSHv2 and SSHv1 protocol
+ for client and server implementations.
+endef
+
+CMAKE_OPTIONS = \
+       -DCMAKE_INSTALL_PREFIX:PATH=/usr \
+       -DCMAKE_BUILD_TYPE:STRING=Release \
+       -DHAVE_STRTOULL=1 \
+       -DHAVE_GETADDRINFO=1 \
+       -DHAVE_TERMIOS_H=1 \
+       -DWITH_EXAMPLES:BOOL=OFF \
+       -DWITH_GCRYPT:BOOL=OFF \
+       -DWITH_GSSAPI:BOOL=OFF \
+       -DWITH_LIBZ:BOOL=ON \
+       -DWITH_NACL:BOOL=OFF \
+       -DWITH_PCAP:BOOL=OFF \
+       -DWITH_SERVER:BOOL=ON \
+       -DWITH_SFTP:BOOL=ON \
+       -DWITH_SSH1:BOOL=OFF \
+       -DWITH_TESTING:BOOL=OFF \
+
+ifeq ($(CONFIG_BIG_ENDIAN),y)
+CMAKE_OPTIONS += -DWITH_BIG_ENDIAN=ON
+else
+CMAKE_OPTIONS += -DWITH_BIG_ENDIAN=OFF
+endif
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/libssh/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libssh/* $(1)/usr/include/libssh/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libssh* $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libssh/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libssh* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libssh))
diff --git a/libs/libssh/patches/001-compile.patch b/libs/libssh/patches/001-compile.patch
new file mode 100644 (file)
index 0000000..bbc994b
--- /dev/null
@@ -0,0 +1,35 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -35,10 +35,6 @@ include(DefineInstallationPaths)
+ include(DefineOptions.cmake)
+ include(CPackConfig.cmake)
+-# disallow in-source build
+-include(MacroEnsureOutOfSourceBuild)
+-macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there.")
+-
+ # search for libraries
+ if (WITH_ZLIB)
+     find_package(ZLIB REQUIRED)
+--- a/ConfigureChecks.cmake
++++ b/ConfigureChecks.cmake
+@@ -5,7 +5,6 @@ include(CheckFunctionExists)
+ include(CheckLibraryExists)
+ include(CheckTypeSize)
+ include(CheckCXXSourceCompiles)
+-include(TestBigEndian)
+ set(PACKAGE ${APPLICATION_NAME})
+ set(VERSION ${APPLICATION_VERSION})
+@@ -270,6 +269,8 @@ if (WITH_GSSAPI AND NOT GSSAPI_FOUND)
+ endif (WITH_GSSAPI AND NOT GSSAPI_FOUND)
+ # ENDIAN
+-if (NOT WIN32)
+-    test_big_endian(WORDS_BIGENDIAN)
+-endif (NOT WIN32)
++if (WITH_BIG_ENDIAN)
++  set(WORDS_BIGENDIAN 1)
++else (WITH_BIG_ENDIAN)
++  set(WORDS_BIGENDIAN 0)
++endif (WITH_BIG_ENDIAN)
diff --git a/libs/libssh/patches/002-disable-libssp.patch b/libs/libssh/patches/002-disable-libssp.patch
new file mode 100644 (file)
index 0000000..a4d9221
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/cmake/Modules/DefineCompilerFlags.cmake
++++ b/cmake/Modules/DefineCompilerFlags.cmake
+@@ -1,7 +1,6 @@
+ # define system dependent compiler flags
+ include(CheckCCompilerFlag)
+-include(CheckCCompilerFlagSSP)
+ if (UNIX AND NOT WIN32)
+     #
+@@ -21,11 +20,6 @@ if (UNIX AND NOT WIN32)
+             set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+         endif (WITH_FPIC)
+-        check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
+-        if (WITH_STACK_PROTECTOR)
+-            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
+-        endif (WITH_STACK_PROTECTOR)
+-
+         if (CMAKE_BUILD_TYPE)
+             string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
+             if (CMAKE_BUILD_TYPE_LOWER MATCHES (release|relwithdebinfo|minsizerel))
diff --git a/libs/libssh2/Config.in b/libs/libssh2/Config.in
new file mode 100644 (file)
index 0000000..708c07b
--- /dev/null
@@ -0,0 +1,15 @@
+if PACKAGE_libssh2
+
+choice
+       prompt "Choose crypto backend"
+       default LIBSSH2_MBEDTLS
+
+       config LIBSSH2_MBEDTLS
+       bool "mbedtls"
+
+       config LIBSSH2_OPENSSL
+       bool "openssl"
+
+endchoice
+
+endif
index 911d34e812d838073dbdefbe782ea1f8c7cbd2eb..926c010c97390d065b368529e0de5e915ed54903 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2015-2016 OpenWrt.org
+# Copyright (C) 2015-2018 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,26 +8,32 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libssh2
-PKG_VERSION:=1.7.0
-PKG_RELEASE:=1
+PKG_VERSION:=1.8.0
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.libssh2.org/download
-PKG_MD5SUM:=b01662a210e94cccf2f76094db7dac5c
+PKG_SOURCE_URL:=https://www.libssh2.org/download
+PKG_HASH:=39f34e2f6835f4b992cafe8625073a88e5a28ba78f83e8099610a7b3af4676d4
+
+PKG_FIXUP:=autoreconf
 
 PKG_INSTALL:=1
 
 PKG_LICENSE:=BSD
 PKG_LICENSE_FILES:=COPYING
 
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_LIBSSH2_MBEDTLS \
+       CONFIG_LIBSSH2_OPENSSL
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/libssh2
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE:=SSH2 library
-  URL:=http://www.libssh2.org/
-  DEPENDS:=+libopenssl +zlib
+  URL:=https://www.libssh2.org/
+  DEPENDS:=+LIBSSH2_MBEDTLS:libmbedtls +LIBSSH2_OPENSSL:libopenssl +zlib
   MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
 endef
 
@@ -35,19 +41,24 @@ define Package/libssh2/description
  libssh2 is a client-side C library implementing the SSH2 protocol.
 endef
 
-TARGET_CFLAGS += $(FPIC)
+define Package/libssh2/config
+       source "$(SOURCE)/Config.in"
+endef
 
 CONFIGURE_ARGS += \
        --disable-examples-build \
-       --with-libssl-prefix=$(STAGING_DIR)/usr
+       --disable-silent-rules \
+       $(if $(CONFIG_LIBSSH2_MBEDTLS),--with-mbedtls --with-libmbedtls-prefix=$(STAGING_DIR)/usr) \
+       $(if $(CONFIG_LIBSSH2_OPENSSL),--with-openssl --with-libssl-prefix=$(STAGING_DIR)/usr) \
+       --with-libz-prefix=$(STAGING_DIR)/usr
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(INSTALL_DIR) $(1)/usr/lib
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libssh2.so* $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libssh2.pc $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libssh2.pc $(1)/usr/lib/pkgconfig/
 endef
 
 define Package/libssh2/install
diff --git a/libs/libssh2/patches/01-fix-acinclude-m4.patch b/libs/libssh2/patches/01-fix-acinclude-m4.patch
new file mode 100644 (file)
index 0000000..d4e1182
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -386,9 +386,9 @@ AC_DEFUN([LIBSSH2_CHECKFOR_MBEDTLS], [
+   old_LDFLAGS=$LDFLAGS
+   old_CFLAGS=$CFLAGS
+-  if test -n "$use_mbedtls" && test "$use_mbedtls" != "no"; then
+-    LDFLAGS="$LDFLAGS -L$use_mbedtls/lib"
+-    CFLAGS="$CFLAGS -I$use_mbedtls/include"
++  if test -n "$with_libmbedtls_prefix" && test "$use_mbedtls" != "no"; then
++    LDFLAGS="$LDFLAGS -L$with_libmbedtls_prefix/lib"
++    CFLAGS="$CFLAGS -I$with_libmbedtls_prefix/include"
+   fi
+   AC_LIB_HAVE_LINKFLAGS([mbedtls], [], [
+@@ -412,9 +412,9 @@ AC_DEFUN([LIBSSH2_CHECKFOR_GCRYPT], [
+   old_LDFLAGS=$LDFLAGS
+   old_CFLAGS=$CFLAGS
+-  if test -n "$use_libgcrypt" && test "$use_libgcrypt" != "no"; then
+-    LDFLAGS="$LDFLAGS -L$use_libgcrypt/lib"
+-    CFLAGS="$CFLAGS -I$use_libgcrypt/include"
++  if test -n "$with_libgcrypt_prefix" && test "$use_libgcrypt" != "no"; then
++    LDFLAGS="$LDFLAGS -L$with_libgcrypt_prefix/lib"
++    CFLAGS="$CFLAGS -I$with_libgcrypt_prefix/include"
+   fi
+   AC_LIB_HAVE_LINKFLAGS([gcrypt], [], [
+     #include <gcrypt.h>
index 61b7be0d9403247ad2746e4925fde277f893e248..ed2c03be5d8cbd6c2f1db093a96c25240c313836 100644 (file)
@@ -20,7 +20,7 @@ PKG_SOURCE_URL=https://github.com/strophe/libstrophe
 PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=9931ad4fa2aa7f204c608010eb2ebf84bcf7d542
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MIRROR_MD5SUM:=6a499bcfc7c52db6765957ff38f48a344ad121ac0b665fd3d4adb7d8deadc427
+PKG_MIRROR_HASH:=6a499bcfc7c52db6765957ff38f48a344ad121ac0b665fd3d4adb7d8deadc427
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index 1bb4007224b06219917b709a12391380c0a275c5..1908b55eaf8110845720617d01e9ecd5832cd7a5 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=talloc
-PKG_VERSION:=2.1.7
+PKG_VERSION:=2.1.11
 MAJOR_VERSION:=2
-PKG_RELEASE:=2
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.samba.org/ftp/talloc/
-PKG_MD5SUM:=d6763d65d03d627816ae1d50c74576fe
+PKG_HASH:=639eb35556a0af999123c4d883e79be05ff9f00ab4f9e4ac2e5775f9c5eeeed3
 
 PKG_MAINTAINER:=Lucile Quirion <lucile.quirion@savoirfairelinux.com>
 PKG_LICENSE:=LGPL-3.0+
@@ -101,6 +101,8 @@ define Build/InstallDev
        $(CP) $(PKG_BUILD_DIR)/bin/default/libtalloc.so $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_BUILD_DIR)/bin/default/talloc.pc $(1)/usr/lib/pkgconfig/
 endef
 
 define Package/libtalloc/install
index 466547d463f1364908523deffacd483c4ae79d66..672807155c7bdaf4dc35068b164c0e6bac46d860 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libtasn1
-PKG_VERSION:=4.9
+PKG_VERSION:=4.12
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=4f6f7a8fd691ac2b8307c8ca365bad711db607d4ad5966f6938a9d2ecd65c920
+PKG_HASH:=6753da2e621257f33f5b051cc114d417e5206a0818fe0b1ecfd6153f70934753
 PKG_LICENSE:=LGPLv2.1+
 PKG_LICENSE_FILES:=COPYING.LIB
 
@@ -27,7 +27,7 @@ define Package/libtasn1
   CATEGORY:=Libraries
   TITLE:=An ASN.1 and DER structures manipulation library
   MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-  URL:=ftp://ftp.gnu.org/gnu/libtasn1/
+  URL:=https://www.gnu.org/software/libtasn1/
 endef
 
 define Package/libtasn1/description
index d5db86c70ba7d52db2a2dfdb21fcfc0f26febca9..0a19cbae74cf664df147d748749f32c8fa13a31a 100644 (file)
@@ -12,7 +12,7 @@ PKG_VERSION:=1.1.1
 PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://downloads.xiph.org/releases/theora/
-PKG_MD5SUM:=292ab65cedd5021d6b7ddd117e07cd8e
+PKG_HASH:=b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING LICENSE
diff --git a/libs/libtins/Makefile b/libs/libtins/Makefile
new file mode 100644 (file)
index 0000000..7eb8109
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2017 Steven Hessing
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libtins
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:= Steven Hessing <steven.hessing@gmail.com>
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/mfontanini/libtins.git
+PKG_SOURCE_VERSION:=v3.5
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=47cd7d659ffa75dcfc2172ef54151fd36dc87de9e0f04bb066f6b076a7df7b57
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+PKG_BUILD_PARALLEL:=1
+
+CMAKE_INSTALL:=1
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+CMAKE_OPTIONS += -D_RUN_RESULT_VAR=FORCE
+CMAKE_OPTIONS += -DLIBTINS_ENABLE_WPA2=0
+CMAKE_OPTIONS += -DLIBTINS_ENABLE_CXX11=1
+
+define Package/libtins
+       SECTION:=net
+       CATEGORY:=Libraries
+       TITLE:=libtins 
+       URL:=http://libtins.github.io/
+       DEPENDS:=+libstdcpp +libpcap 
+endef
+
+define Package/libtins/description
+libtins is a high-level, multiplatform C++ network packet sniffing and crafting library.
+endef
+
+define Package/libtins/install
+    $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libtins.so.3.5 $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libtins))
diff --git a/libs/libtirpc/Makefile b/libs/libtirpc/Makefile
new file mode 100644 (file)
index 0000000..0661634
--- /dev/null
@@ -0,0 +1,59 @@
+# 
+# Copyright (C) 2006-2018 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:=libtirpc
+PKG_VERSION:=1.0.2
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=@SF/libtirpc
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_HASH:=723c5ce92706cbb601a8db09110df1b4b69391643158f20ff587e20e7c5f90f5
+
+PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libtirpc
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Library TI RPC for RPC bindings
+  URL:=http://libtirpc.sourceforge.net/
+  DEPENDS:=+libpthread
+endef
+
+CONFIGURE_ARGS += --disable-gssapi
+# Info from Buildroot Makefile
+# getrpcby{number,name} are only provided if 'GQ' is defined
+TARGET_CFLAGS += -DGQ
+#CONFIGURE_VARS += \
+#      GSSGLUE_LIBS="-lkrb5 -lk5crypto -l:libcom_err.so.3 -lkeyutils -lresolv -gssapi_krb5" \
+#      GSSGLUE_CFLAGS=-I$(STAGING_DIR)/usr/include/krb5/
+
+#EXTRA_LDFLAGS := -lgssapi_krb5
+
+define Package/libtirpc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtirpc.so* $(1)/usr/lib
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtirpc.{a,so*} $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include
+       $(SED) 's,/usr,${STAGING_DIR}/usr,g' $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libtirpc.pc
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libtirpc.pc $(1)/usr/lib/pkgconfig/libtirpc.pc
+endef
+
+$(eval $(call BuildPackage,libtirpc))
diff --git a/libs/libtirpc/patches/01-Disable-parts-of-TIRPC-requiring-NIS-support.patch b/libs/libtirpc/patches/01-Disable-parts-of-TIRPC-requiring-NIS-support.patch
new file mode 100644 (file)
index 0000000..eb1bef3
--- /dev/null
@@ -0,0 +1,48 @@
+From 15adb318818f5d0ac609ef2b87643dd760487cb6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
+Date: Mon, 20 Jul 2015 20:30:11 +0200
+Subject: [PATCH 1/1] Disable parts of TIRPC requiring NIS support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+[yann.morin.1998@free.fr: update for 0.3.1]
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+[joerg.krause@embedded.rocks: update for 0.3.2]
+Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
+[peda@axentia.se: update for 1.0.1]
+Signed-off-by: Peter Rosin <peda@axentia.se>
+[bernd.kuhls@t-online.de: update for 1.0.2]
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ src/Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 6cc567a..9834f9a 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -24,7 +24,7 @@ libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c cln
+         rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \
+       svc_auth_des.c \
+         svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
+-        auth_time.c auth_des.c authdes_prot.c debug.c des_crypt.c des_impl.c
++        auth_des.c authdes_prot.c debug.c des_crypt.c des_impl.c
+ ## XDR
+ libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c xdr_sizeof.c
+@@ -41,8 +41,8 @@ if GSS
+     libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
+ endif
+-libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
+-libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
++#libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
++#libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
+ CLEANFILES           = cscope.* *~
+ DISTCLEANFILES               = Makefile.in
+-- 
+2.4.6
+
diff --git a/libs/libtirpc/patches/02-replace-__bzero-with-memset-API.patch b/libs/libtirpc/patches/02-replace-__bzero-with-memset-API.patch
new file mode 100644 (file)
index 0000000..d2b4da6
--- /dev/null
@@ -0,0 +1,30 @@
+From 20badc3e3608953fb5b36bb2e16fa51bd731aebc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 18 Apr 2017 09:35:35 -0700
+Subject: [PATCH] replace __bzero() with memset() API
+
+memset is available across all libc implementation
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/des_impl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/des_impl.c b/src/des_impl.c
+index 9dbccaf..15bec2a 100644
+--- a/src/des_impl.c
++++ b/src/des_impl.c
+@@ -588,7 +588,7 @@ _des_crypt (char *buf, unsigned len, struct desparams *desp)
+     }
+   tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0;
+   tbuf[0] = tbuf[1] = 0;
+-  __bzero (schedule, sizeof (schedule));
++  memset (schedule, 0, sizeof (schedule));
+   return (1);
+ }
+-- 
+2.12.2
+
diff --git a/libs/libtirpc/patches/03-uClibc-without-RPC-support-and-musl-does-not-install-rpcent.h.patch b/libs/libtirpc/patches/03-uClibc-without-RPC-support-and-musl-does-not-install-rpcent.h.patch
new file mode 100644 (file)
index 0000000..51229a0
--- /dev/null
@@ -0,0 +1,35 @@
+From 7aa1fe6a0f9280571117c30c03c2cc521cd86ec3 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sat, 23 Jun 2012 21:58:07 +0200
+Subject: [PATCH] uClibc without RPC support and musl does not install rpcent.h
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+[yann.morin.1998@free.fr: update for 0.3.1]
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+[joerg.krause@embedded.rocks: musl fix]
+Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
+[bernd.kuhls@t-online.de: update for 1.0.2]
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ tirpc/rpc/rpcent.h | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
+index 147f909..4a58180 100644
+--- a/tirpc/rpc/rpcent.h
++++ b/tirpc/rpc/rpcent.h
+@@ -48,8 +48,9 @@
+ extern "C" {
+ #endif
+-/* These are defined in /usr/include/rpc/netdb.h */
+-#if !defined(__GLIBC__) || defined(__UCLIBC__)
++/* These are defined in /usr/include/rpc/netdb.h, unless we are using
++   the C library without RPC support. */
++#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_RPC__) || !defined(__GLIBC__)
+ struct rpcent {
+       char    *r_name;        /* name of server for this rpc program */
+       char    **r_aliases;    /* alias list */
+-- 
+1.9.1
+
diff --git a/libs/libtirpc/patches/04-export_key_secretkey_is_set.patch b/libs/libtirpc/patches/04-export_key_secretkey_is_set.patch
new file mode 100644 (file)
index 0000000..a276ba2
--- /dev/null
@@ -0,0 +1,24 @@
+Add key_secretkey_is_set to exported symbols map
+
+key_secret_is_set is a typo in libtirpc map
+Patch taken from
+
+https://sourceforge.net/p/libtirpc/discussion/637321/thread/fd73d431/
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libtirpc-1.0.1/src/libtirpc.map
+===================================================================
+--- libtirpc-1.0.1.orig/src/libtirpc.map
++++ libtirpc-1.0.1/src/libtirpc.map
+@@ -298,7 +298,7 @@ TIRPC_0.3.2 {
+     key_gendes;
+     key_get_conv;
+     key_setsecret;
+-    key_secret_is_set;
++    key_secretkey_is_set;
+     key_setnet;
+     netname2host;
+     netname2user;
diff --git a/libs/libtirpc/patches/05-Disable-DES-authentification-support.patch b/libs/libtirpc/patches/05-Disable-DES-authentification-support.patch
new file mode 100644 (file)
index 0000000..0c65472
--- /dev/null
@@ -0,0 +1,142 @@
+From 79975eb4104667be85abd06874c258438826b674 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
+Date: Fri, 24 Jul 2015 14:45:52 +0200
+Subject: [PATCH] Disable DES authentification support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+uClibc and musl does not provide DES authentication.
+
+Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
+[peda@axentia.se: update for 1.0.1]
+Signed-off-by: Peter Rosin <peda@axentia.se>
+[bernd.kuhls@t-online.de: update for 1.0.2]
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ src/Makefile.am |  2 +-
+ src/rpc_soc.c   | 32 --------------------------------
+ 2 files changed, 1 insertion(+), 33 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 960a522..3a88e31 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -22,9 +22,8 @@ libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c cln
+         pmap_prot.c pmap_prot2.c pmap_rmt.c rpc_prot.c rpc_commondata.c \
+         rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \
+         rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \
+-      svc_auth_des.c \
+         svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
+-        auth_des.c authdes_prot.c debug.c des_crypt.c des_impl.c
++        debug.c
+ ## XDR
+ libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c xdr_sizeof.c
+diff --git a/src/svc_auth.c b/src/svc_auth.c
+--- a/src/svc_auth.c
++++ b/src/svc_auth.c
+@@ -114,9 +114,6 @@ _gss_authenticate(rqst, msg, no_dispatch)
+       case AUTH_SHORT:
+               dummy = _svcauth_short(rqst, msg);
+               return (dummy);
+-      case AUTH_DES:
+-              dummy = _svcauth_des(rqst, msg);
+-              return (dummy);
+ #ifdef HAVE_RPCSEC_GSS
+       case RPCSEC_GSS:
+               dummy = _svcauth_gss(rqst, msg, no_dispatch);
+diff --git a/src/rpc_soc.c b/src/rpc_soc.c
+index e146ed4..161a1ec 100644
+--- a/src/rpc_soc.c
++++ b/src/rpc_soc.c
+@@ -522,86 +521,6 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
+ }
+ /*
+- * Create the client des authentication object. Obsoleted by
+- * authdes_seccreate().
+- */
+-AUTH *
+-authdes_create(servername, window, syncaddr, ckey)
+-      char *servername;               /* network name of server */
+-      u_int window;                   /* time to live */
+-      struct sockaddr *syncaddr;      /* optional hostaddr to sync with */
+-      des_block *ckey;                /* optional conversation key to use */
+-{
+-      AUTH *nauth;
+-      char hostname[NI_MAXHOST];
+-
+-      if (syncaddr) {
+-              /*
+-               * Change addr to hostname, because that is the way
+-               * new interface takes it.
+-               */
+-              switch (syncaddr->sa_family) {
+-              case AF_INET:
+-                if (getnameinfo(syncaddr, sizeof(struct sockaddr_in), hostname,
+-                                sizeof hostname, NULL, 0, 0) != 0)
+-                  goto fallback;
+-                break;
+-              case AF_INET6:
+-                if (getnameinfo(syncaddr, sizeof(struct sockaddr_in6), hostname,
+-                                sizeof hostname, NULL, 0, 0) != 0)
+-                  goto fallback;
+-                break;
+-              default:
+-                goto fallback;
+-              }
+-              nauth = authdes_seccreate(servername, window, hostname, ckey);
+-              return (nauth);
+-      }
+-fallback:
+-      return authdes_seccreate(servername, window, NULL, ckey);
+-}
+-
+-/*
+- * Create the client des authentication object. Obsoleted by
+- * authdes_pk_seccreate().
+- */
+-extern AUTH *authdes_pk_seccreate(const char *, netobj *, u_int, const char *,
+-        const des_block *, nis_server *);
+-
+-AUTH *
+-authdes_pk_create(servername, pkey, window, syncaddr, ckey)
+-      char *servername;               /* network name of server */
+-      netobj *pkey;                   /* public key */
+-      u_int window;                   /* time to live */
+-      struct sockaddr *syncaddr;      /* optional hostaddr to sync with */
+-      des_block *ckey;                /* optional conversation key to use */
+-{
+-      AUTH *nauth;
+-      char hostname[NI_MAXHOST];
+-
+-      if (syncaddr) {
+-              /*
+-               * Change addr to hostname, because that is the way
+-               * new interface takes it.
+-               */
+-              switch (syncaddr->sa_family) {
+-              case AF_INET:
+-                if (getnameinfo(syncaddr, sizeof(struct sockaddr_in), hostname,
+-                                sizeof hostname, NULL, 0, 0) != 0)
+-                  goto fallback;
+-                break;
+-              default:
+-                goto fallback;
+-              }
+-              nauth = authdes_pk_seccreate(servername, pkey, window, hostname, ckey, NULL);
+-              return (nauth);
+-      }
+-fallback:
+-      return authdes_pk_seccreate(servername, pkey, window, NULL, ckey, NULL);
+-}
+-
+-
+-/*
+  * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
+  */
+ CLIENT *
+-- 
+2.4.6
+
diff --git a/libs/libtirpc/patches/06-include-stdint.h-for-uintptr_t.patch b/libs/libtirpc/patches/06-include-stdint.h-for-uintptr_t.patch
new file mode 100644 (file)
index 0000000..6203161
--- /dev/null
@@ -0,0 +1,31 @@
+From 18f8a605e176f0362da22fd1203eb7cedb136aaf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 20 Jun 2017 22:06:35 +0200
+Subject: [PATCH] include stdint.h for uintptr_t
+
+Fixes
+| ../../libtirpc-1.0.1/src/xdr_sizeof.c:93:13: error: 'uintptr_t' undeclared (first use in this function); did you mean '__intptr_t'?
+|   if (len < (uintptr_t)xdrs->x_base) {
+|              ^~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dmitrii Kolesnichenko <dmitrii@synopsys.com>
+---
+ src/xdr_sizeof.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/xdr_sizeof.c b/src/xdr_sizeof.c
+index d23fbd1..79d6707 100644
+--- a/src/xdr_sizeof.c
++++ b/src/xdr_sizeof.c
+@@ -39,6 +39,7 @@
+ #include <rpc/xdr.h>
+ #include <sys/types.h>
+ #include <stdlib.h>
++#include <stdint.h>
+ #include "un-namespace.h"
+ /* ARGSUSED */
+-- 
+2.9.4
+
index 2a85684b6c0026ac2c9beb29d0688f1d27e56435..ae0444c528ccf8b065eda6f6b5e52a487ead8567 100644 (file)
@@ -16,6 +16,7 @@ PKG_SOURCE_URL:=https://github.com/rakshasa/libtorrent.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=14e793b75dac95c51ad64ff9cd2dc6772b68c625
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=0971c21d0e6b7028bc319e97c82bdb213c17dfc503fc0f89b809e5ed7ce98142
 
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
diff --git a/libs/libudev-fbsd/Makefile b/libs/libudev-fbsd/Makefile
new file mode 100644 (file)
index 0000000..07263f1
--- /dev/null
@@ -0,0 +1,51 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libudev-fbsd
+
+PKG_RELEASE:=2
+PKG_VERSION:=20160820
+PKG_SOURCE_VERSION:=1f21323b817e70253d3c04bc8bedd61c477d0544
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=cc885851c97dcaef65d7f4fb0899ed1a01412b02e44851476ac47ce4da024d0b
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/jiixyj/libudev-fbsd.git
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libudev-fbsd
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=small udev shim for FreeBSD/devd (and other non-systemd)
+  URL:=https://github.com/jiixyj/libudev-fbsd
+  DEPENDS:=+libevdev
+  PROVIDES:=libudev
+  CONFLICTS:=libudev eudev udev
+endef
+
+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/*.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libudev-fbsd/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libudev-fbsd))
diff --git a/libs/libudev-fbsd/patches/001-fix-unused.patch b/libs/libudev-fbsd/patches/001-fix-unused.patch
new file mode 100644 (file)
index 0000000..1949433
--- /dev/null
@@ -0,0 +1,42 @@
+--- a/src/libudev.c
++++ b/src/libudev.c
+@@ -354,7 +354,7 @@ udev_device_get_subsystem(struct udev_de
+ const char *
+ udev_device_get_sysattr_value(
+-    struct udev_device *udev_device __unused, const char *sysattr)
++     __attribute__ ((unused))struct udev_device *udev_device, const char *sysattr)
+ {
+       (void)sysattr;
+       LOG("stub: udev_device_get_sysattr_value %s\n", sysattr);
+@@ -469,7 +469,7 @@ udev_device_get_parent_with_subsystem_de
+ }
+ struct udev_enumerate *
+-udev_enumerate_new(struct udev *udev __unused)
++udev_enumerate_new( __attribute__ ((unused))struct udev *udev)
+ {
+       LOG("udev_enumerate_new\n");
+       struct udev_enumerate *u = calloc(1, sizeof(struct udev_enumerate));
+@@ -538,7 +538,7 @@ udev_enumerate_get_list_entry(struct ude
+ int
+ udev_enumerate_add_match_sysname(
+-    struct udev_enumerate *udev_enumerate __unused, const char *sysname)
++     __attribute__ ((unused))struct udev_enumerate *udev_enumerate, const char *sysname)
+ {
+       (void)sysname;
+       LOG("stub: udev_enumerate_add_match_sysname %s\n", sysname);
+--- a/src/libudev.h
++++ b/src/libudev.h
+@@ -24,8 +24,8 @@ void udev_unref(struct udev *udev);
+ char const *udev_device_get_devnode(struct udev_device *udev_device);
+ dev_t udev_device_get_devnum(struct udev_device *udev_device);
+ char const *udev_device_get_property_value(
+-    struct udev_device *dummy __unused, char const *property);
+-struct udev *udev_device_get_udev(struct udev_device *dummy __unused);
++     __attribute__ ((unused))struct udev_device *dummy, char const *property);
++struct udev *udev_device_get_udev( __attribute__ ((unused))struct udev_device *dummy);
+ struct udev_device *udev_device_new_from_syspath(
+     struct udev *udev, char const *syspath);
+ struct udev_device *udev_device_new_from_devnum(
diff --git a/libs/libudev-fbsd/patches/002-replace-nitems.patch b/libs/libudev-fbsd/patches/002-replace-nitems.patch
new file mode 100644 (file)
index 0000000..7f4d0de
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/libudev.c
++++ b/src/libudev.c
+@@ -175,7 +175,7 @@ populate_properties_list(struct udev_dev
+       struct udev_list_entry **list_end = &udev_device->properties_list;
+-      for (unsigned i = 0; i < nitems(ids); ++i) {
++      for (unsigned i = 0; i < (sizeof(ids) / sizeof(ids[0])); ++i) {
+               char const *id = ids[i];
+               struct udev_list_entry *le;
diff --git a/libs/libudev-fbsd/patches/003-add-pkg-config-description.patch b/libs/libudev-fbsd/patches/003-add-pkg-config-description.patch
new file mode 100644 (file)
index 0000000..9aec7b9
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -11,6 +11,7 @@ install(TARGETS udev LIBRARY DESTINATION
+ install(FILES libudev.h DESTINATION include)
+ set(PKG_CONFIG_NAME libudev)
++set(PKG_CONFIG_DESCRIPTION small udev shim for FreeBSD/devd)
+ set(PKG_CONFIG_REQUIRES libevdev)
+ set(PKG_CONFIG_LIBDIR "\${prefix}/lib")
+ set(PKG_CONFIG_INCLUDEDIR "\${prefix}/include")
+--- a/src/pkg-config.pc.cmake
++++ b/src/pkg-config.pc.cmake
+@@ -3,6 +3,7 @@ libdir=${PKG_CONFIG_LIBDIR}
+ includedir=${PKG_CONFIG_INCLUDEDIR}
+ Name: ${PKG_CONFIG_NAME}
++Description: ${PKG_CONFIG_DESCRIPTION}
+ Version: 143
+ Requires: ${PKG_CONFIG_REQUIRES}
+ Libs: ${PKG_CONFIG_LIBS}
diff --git a/libs/libudev-fbsd/patches/005-extern-c.patch b/libs/libudev-fbsd/patches/005-extern-c.patch
new file mode 100644 (file)
index 0000000..de3ae35
--- /dev/null
@@ -0,0 +1,24 @@
+diff -ruN libudev-fbsd-20160820/src/libudev.h libudev-fbsd-20160820.mod/src/libudev.h
+--- libudev-fbsd-20160820/src/libudev.h        2017-11-17 16:46:56.705435146 +0100
++++ libudev-fbsd-20160820.mod/src/libudev.h    2017-11-17 16:48:07.276021522 +0100
+@@ -11,6 +11,11 @@
+ #include <fcntl.h>
+ #include <unistd.h>
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ struct udev;
+ struct udev_device;
+ struct udev_list_entry;
+@@ -83,4 +88,8 @@
+     struct udev_monitor *udev_monitor);
+ void udev_monitor_unref(struct udev_monitor *udev_monitor);
++#ifdef __cplusplus
++} /* extern "C" */
++#endif
++
+ #endif
diff --git a/libs/libudev-fbsd/patches/100-add-stub-udev_device_get_driver.patch b/libs/libudev-fbsd/patches/100-add-stub-udev_device_get_driver.patch
new file mode 100644 (file)
index 0000000..aaa56f3
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/src/libudev.c
++++ b/src/libudev.c
+@@ -130,6 +130,12 @@ udev_device_get_devnum(struct udev_devic
+ }
+ char const *
++udev_device_get_driver(struct udev_device *udev_device)
++{
++      return NULL;
++}
++
++char const *
+ udev_device_get_property_value(struct udev_device *dev, char const *property)
+ {
+       LOG("udev_device_get_property_value %s\n", property);
+--- a/src/libudev.h
++++ b/src/libudev.h
+@@ -30,6 +30,7 @@ struct udev_device *udev_device_new_from
+     struct udev *udev, char const *syspath);
+ struct udev_device *udev_device_new_from_devnum(
+     struct udev *udev, char type, dev_t devnum);
++char const *udev_device_get_driver(struct udev_device *udev_device);
+ char const *udev_device_get_syspath(struct udev_device *udev_device);
+ char const *udev_device_get_sysname(struct udev_device *udev_device);
+ char const *udev_device_get_subsystem(struct udev_device *udev_device);
diff --git a/libs/libudev-fbsd/patches/101-add-stub-udev_device_new_from_subsystem_sysname.patch b/libs/libudev-fbsd/patches/101-add-stub-udev_device_new_from_subsystem_sysname.patch
new file mode 100644 (file)
index 0000000..bc12d66
--- /dev/null
@@ -0,0 +1,72 @@
+--- a/src/libudev.c
++++ b/src/libudev.c
+@@ -26,6 +26,7 @@ struct udev_device {
+       struct udev *udev;
+       int refcount;
+       char syspath[32];
++      char sysfspath[64];
+       dev_t devnum;
+       char const *sysname;
+       char const *action;
+@@ -115,6 +116,29 @@ udev_device_new_from_devnum(struct udev
+       return NULL;
+ }
++struct udev_device *
++udev_device_new_from_subsystem_sysname(
++    struct udev *udev, const char *subsystem, const char *sysname)
++{
++      struct udev_device *u;
++      char sysfsname[64];
++      struct stat st;
++
++      snprintf(sysfsname, sizeof(sysfsname), "/sys/bus/%s/devices/%s/", subsystem, sysname);
++      if (stat(sysfsname, &st) == 0)
++      {
++              char sysfsdev[64];
++              u = calloc(1, sizeof(struct udev_device));
++              strncpy(u->sysfspath, sysfsname, sizeof(u->sysfspath));
++
++              return u;
++      }
++      else
++      {
++              return NULL;
++      }
++}
++
+ char const *
+ udev_device_get_devnode(struct udev_device *udev_device)
+ {
+@@ -132,6 +156,20 @@ udev_device_get_devnum(struct udev_devic
+ char const *
+ udev_device_get_driver(struct udev_device *udev_device)
+ {
++      if (udev_device->sysfspath)
++      {
++              char driverlnp[64];
++              char driverlnk[32];
++              snprintf(driverlnp, sizeof(driverlnp), "%s/driver",
++                       udev_device->sysfspath);
++              if (readlink(driverlnp, driverlnk, sizeof(driver)))
++              {
++                      char *drivernm;
++                      drivernm = strrchr(driverlnk, '/');
++                      if (drivernm)
++                              return ++drivernm;
++              }
++      }
+       return NULL;
+ }
+--- a/src/libudev.h
++++ b/src/libudev.h
+@@ -30,6 +30,8 @@ struct udev_device *udev_device_new_from
+     struct udev *udev, char const *syspath);
+ struct udev_device *udev_device_new_from_devnum(
+     struct udev *udev, char type, dev_t devnum);
++struct udev_device *udev_device_new_from_subsystem_sysname(
++    struct udev *udev, const char *subsystem, const char *sysname);
+ char const *udev_device_get_driver(struct udev_device *udev_device);
+ char const *udev_device_get_syspath(struct udev_device *udev_device);
+ char const *udev_device_get_sysname(struct udev_device *udev_device);
diff --git a/libs/libudev-fbsd/patches/102-add-stub-udev_enumerate_add_nomatch_sysattr.patch b/libs/libudev-fbsd/patches/102-add-stub-udev_enumerate_add_nomatch_sysattr.patch
new file mode 100644 (file)
index 0000000..86e6b96
--- /dev/null
@@ -0,0 +1,41 @@
+--- a/src/libudev.c
++++ b/src/libudev.c
+@@ -162,7 +162,7 @@ udev_device_get_driver(struct udev_devic
+               char driverlnk[32];
+               snprintf(driverlnp, sizeof(driverlnp), "%s/driver",
+                        udev_device->sysfspath);
+-              if (readlink(driverlnp, driverlnk, sizeof(driver)))
++              if (readlink(driverlnp, driverlnk, sizeof(driverlnk)))
+               {
+                       char *drivernm;
+                       drivernm = strrchr(driverlnk, '/');
+@@ -600,6 +600,18 @@ udev_enumerate_add_match_property(struct
+           value);
+       return -1;
+ }
++
++int
++udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate,
++    const char *sysattr, const char *value)
++{
++      (void)udev_enumerate;
++      (void)sysattr;
++      (void)value;
++      LOG("stub: udev_enumerate_add_nomatch_sysattr %s %s\n", sysattr,
++          value);
++      return -1;
++}
+ void
+ udev_enumerate_unref(struct udev_enumerate *udev_enumerate)
+--- a/src/libudev.h
++++ b/src/libudev.h
+@@ -59,6 +59,8 @@ int udev_enumerate_add_match_sysname(
+     struct udev_enumerate *udev_enumerate, char const *sysname);
+ int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate,
+     char const *property, char const *value);
++int udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate,
++    const char *sysattr, const char *value);
+ void udev_enumerate_unref(struct udev_enumerate *udev_enumerate);
+ #define udev_list_entry_foreach(list_entry, first_entry)                      \
index 81110624212291d86631a7b56232208459b004da..93129631835829b111d768854687acb69a9e2108 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=2
 PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/85
-PKG_MD5SUM:=5cd543cb8e7bce83a22c07a0579c95a1
+PKG_HASH:=b94aef08eab5359d0facaa7ead2ce81b193eef0c61379d9835213ebc0a46257a
 
 PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=COPYRIGHT
index 66168c1e59c345b32354f192be78c46acca6ab2b..e7a1e874fa10aef495bc6b5355e7bfa92c16b998 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://github.com/mhei/libugpio/releases/download/v$(PKG_VERSION)
-PKG_MD5SUM:=09c35abbc25f7ebff125bc43ff21ac35
+PKG_HASH:=07d96b46560f42843e46869f45f53d48afee71f9bbcf06f43267fafad0d50b05
 
 PKG_LICENSE:=LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING.LESSER
diff --git a/libs/libuhttpd/Makefile b/libs/libuhttpd/Makefile
new file mode 100755 (executable)
index 0000000..7f032de
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2014-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:=libuhttpd
+PKG_VERSION:=2.0.3
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+PKG_SOURCE_URL=https://github.com/zhaojh329/libuhttpd.git
+PKG_MIRROR_HASH:=f20e4081ba1bbea277a3c86f28fa451d54546817a58814fff91470550a5b8e5d
+CMAKE_INSTALL:=1
+
+PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_MAINTAINER:=Jianhui Zhao <jianhuizhao329@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libuhttpd/default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Networking
+  TITLE:=libuhttpd
+  DEPENDS:=+libubox +liblua
+endef
+
+define Package/libuhttpd-nossl
+  $(Package/libuhttpd/default)
+  TITLE += (NO SSL)
+  VARIANT:=nossl
+endef
+
+define Package/libuhttpd-openssl
+  $(Package/libuhttpd/default)
+  TITLE += (openssl)
+  DEPENDS += +libustream-openssl
+  VARIANT:=openssl
+endef
+
+define Package/libuhttpd-wolfssl
+  $(Package/libuhttpd/default)
+  TITLE += (wolfssl)
+  DEPENDS += +libustream-wolfssl
+  VARIANT:=wolfssl
+endef
+
+define Package/libuhttpd-mbedtls
+  $(Package/libuhttpd/default)
+  TITLE += (mbedtls)
+  DEPENDS += +libustream-mbedtls
+  VARIANT:=mbedtls
+endef
+
+ifeq ($(BUILD_VARIANT),nossl)
+  CMAKE_OPTIONS += -DUHTTPD_SSL_SUPPORT=off
+endif
+
+define Package/libuhttpd/default/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libuhttpd.so* $(1)/usr/lib/
+endef
+
+Package/libuhttpd-nossl/install = $(Package/libuhttpd/default/install)
+Package/libuhttpd-openssl/install = $(Package/libuhttpd/default/install)
+Package/libuhttpd-wolfssl/install = $(Package/libuhttpd/default/install)
+Package/libuhttpd-mbedtls/install = $(Package/libuhttpd/default/install)
+
+$(eval $(call BuildPackage,libuhttpd-nossl))
+$(eval $(call BuildPackage,libuhttpd-mbedtls))
+$(eval $(call BuildPackage,libuhttpd-wolfssl))
+$(eval $(call BuildPackage,libuhttpd-openssl))
index 854764f3e57c159ae0e1edc8d680c5c8e347fc6a..cef29893c90ce14d91828541f5dc9d17a50527fc 100644 (file)
@@ -8,9 +8,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libunistring
-PKG_VERSION:=0.9.6
+PKG_VERSION:=0.9.8
 PKG_RELEASE:=1
-PKG_MD5SUM:=dfae4ff5583649ed24d8f368f1d0543b
+PKG_HASH:=b792f2bd05d0fa7b339e39e353da7232b2e514e0db2cf5ed95beeff3feb53cf5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/libunistring
diff --git a/libs/libupm/Makefile b/libs/libupm/Makefile
new file mode 100644 (file)
index 0000000..327c2f5
--- /dev/null
@@ -0,0 +1,83 @@
+#
+# 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:=libupm
+PKG_VERSION:=0.4.0
+
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/intel-iot-devkit/upm.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=04dc6df4297a7766d6f1a8fef9699d586e7e0d92
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=26bc9c32eea0b8aa6218735e30a3d2317431518f0b2a055c0f21e78e6d92ca4f
+CMAKE_INSTALL:=1
+
+PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
+PKG_LICENSE:=LGPL-2.1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+UPM_MODULES:= \
+       a110x ad8232 adafruitss adc121c021 adis16448 adxl335 adxl345 am2315 apds9002 at42qt1070 biss0001 bmpx8x buzzer \
+       cjq4435 ds1307 ecs1030 enc03r flex gas gp2y0a grovecircularled grovecollision groveehr groveeldriver groveelectromagnet \
+       groveemg grovegprs grovegsr grovelinefinder grovemd grovemoisture groveo2 grovescam grove grovespeaker grovevdiv grovewater \
+       grovewfs guvas12d h3lis331dl hcsr04 hm11 hmc5883l hmtrp hp20x ht9170 htu21d hx711 i2clcd ina132 isd1820 itg3200 joystick12 \
+       l298 ldt0028 lm35 lol loudness lpd8806 lsm303 lsm9ds0 m24lr64e max31723 max31855 max44000 max5487 maxds3231m maxsonarez \
+       mg811 mhz16 mic mlx90614 mma7455 mma7660 mpl3115a2 mpr121 mpu9150 mq303a my9221 nrf24l01 nrf8001 nunchuck otp538u \
+       pn532 ppd42ns pulsensor rfr359f rgbringcoder rotaryencoder rpr220 servo si114x sm130 st7735 stepmotor sx6119 ta12200 tcs3414cs \
+       th02 tm1637 tsl2561 ttp223 ublox6 uln200xa waterlevel wheelencoder wt5001 yg1006 zfm20
+
+CMAKE_OPTIONS=-DBUILDARCH=$(CONFIG_ARCH) \
+       -DNODE_EXECUTABLE=$(STAGING_DIR_HOSTPKG)/bin/node \
+       -DSWIG_DIR=$(STAGING_DIR_HOSTPKG)/bin
+
+define Package/libupm/Default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libmraa +librt
+  SUBMENU:=IoT
+endef
+
+define Package/libupm
+  $(call Package/libupm/Default)
+  TITLE:=Intel IoT sensor library - Full
+endef
+
+define Package/libupm/install/Default
+       $(INSTALL_DIR) $(1)/usr/lib/{node/,python2.7/site-packages}; \
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupm-$(2).so* $(1)/usr/lib/; \
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/jsupm_$(2) $(1)/usr/lib/node/; \
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/{pyupm_$(2).py,_pyupm_$(2).so} \
+               $(1)/usr/lib/python2.7/site-packages/ ;
+endef
+
+define Package/libupm/install
+       $(foreach module, $(UPM_MODULES),       \
+               $(call Package/libupm/install/Default,$(1),$(module)))
+endef
+
+define UpmPackage
+define Package/libupm-$(1)
+  $(call Package/libupm/Default)
+  TITLE:=Intel IoT sensor library - $(1)
+endef
+
+define Package/libupm-$(1)/install
+       $(call Package/libupm/install/Default,$$(1),$(1))
+endef
+endef
+
+$(eval $(call BuildPackage,libupm))
+$(foreach package, $(UPM_MODULES),                     \
+       $(eval $(call UpmPackage,$(package)))           \
+       $(eval $(call BuildPackage,libupm-$(package)))  \
+)
diff --git a/libs/libupm/patches/001-version.patch b/libs/libupm/patches/001-version.patch
new file mode 100644 (file)
index 0000000..3d4fd6c
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -26,12 +26,7 @@
+ include(GNUInstallDirs)
+ # Make a version file containing the current version from git.
+-include (GetGitRevisionDescription)
+-git_describe (VERSION "--tags")
+-if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND")
+-  message (WARNING " - Install git to compile a production UPM!")
+-  set (VERSION "v0.4.0-dirty")
+-endif ()
++set (VERSION "v0.4.0")
+ message (INFO " - UPM Version ${VERSION}")
diff --git a/libs/libupm/patches/002-at42qt1070-id.patch b/libs/libupm/patches/002-at42qt1070-id.patch
new file mode 100644 (file)
index 0000000..85544c9
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/at42qt1070/at42qt1070.cxx
++++ b/src/at42qt1070/at42qt1070.cxx
+@@ -53,7 +53,7 @@
+         return;
+     }
+-    if (readChipID() != 0x2E) {
++    if (readChipID() != 0x1b && readChipID() != 0x2E) {
+         throw std::runtime_error("Chip ID does not match the expected value (2Eh)");
+     }
diff --git a/libs/libupm/patches/003-lsm303-args.patch b/libs/libupm/patches/003-lsm303-args.patch
new file mode 100644 (file)
index 0000000..d2b2d0e
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/lsm303/lsm303.h
++++ b/src/lsm303/lsm303.h
+@@ -34,7 +34,7 @@
+ /* LSM303 Address definitions */
+ #define LSM303_MAG 0x1E // assuming SA0 grounded
+-#define LSM303_ACC 0x18 // assuming SA0 grounded
++#define LSM303_ACC 0x1E // assuming SA0 grounded
+ /* LSM303 Register definitions */
+ #define CTRL_REG1_A 0x20
index ad49703a0a5429f069ae6833df8e59c964a5d5a2..035b6400a58825c9f1d238b9fdfccc491ab68d20 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/pupnp
-PKG_MD5SUM:=ee16e5d33a3ea7506f38d71facc057dd
+PKG_HASH:=b3142b39601243b50532eec90f4a27dba85eb86f58d4b849ac94edeb29d9b22a
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_FIXUP:=autoreconf
index 9a7db84a2d35e29ed2afa4ba58039e31a55858b6..0e5751f606ea06c47fdf53af5aa58d9f164d1277 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.lesbonscomptes.com/upmpdcli/downloads
-PKG_MD5SUM:=1b10905a365fc6277e1d8ced77278666
+PKG_HASH:=13027f8e2b5341d00370ccf34eb8845f1bce73ec58890c02a38dc639e9f91b13
 PKG_MAINTAINER:=Petko Bordjukov <bordjukov@gmail.com>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index 3b77f323a5d9943c51534e2d5d691c262e21050d..65282ff9f190002222e4a90b26e2528a0d6a2e1c 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Copyright (C) 2015 OpenWrt.org
-# Copyright (C) 2014-2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+# Copyright (C) 2014-2018 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=liburcu
-PKG_VERSION:=0.9.2
+PKG_VERSION:=0.9.4
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
@@ -17,7 +17,7 @@ PKG_LICENSE:=LGPL-2.1 GPL-2.0 GPL-3.0 MIT
 
 PKG_SOURCE:=userspace-rcu-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://lttng.org/files/urcu/
-PKG_MD5SUM:=49f86e68c1e2f41d303381a271b791d1
+PKG_HASH:=ec6c909249040dfa59bb34686482b62072ce5477f5e2e2153dac47de50b36b68
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/userspace-rcu-$(PKG_VERSION)
 PKG_BUILD_PARALLEL:=1
index 3b84d54d76f50cd7670d4d4b794954a06665da33..36c86120e3e17a26a68fab8ff4a0450800b46463 100644 (file)
@@ -20,6 +20,7 @@ PKG_SOURCE_URL:=https://github.com/libimobiledevice/libusbmuxd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=4397b3376dc4e4cb1c991d0aed61ce6482614196
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=e145b567cdefb1d2536f3eec863769c77474ce9a5d9c4c81ab0a75dc6fe3056a
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index 4f40a2021576fee9f264fed040163993fee3b15f..6a7555116454225af862a40a997bceb48b1d33ae 100644 (file)
@@ -8,16 +8,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libuv
-PKG_VERSION:=1.10.2
+PKG_VERSION:=1.19.2
 PKG_RELEASE:=1
 
 PKG_LICENSE_FILES:=LICENSE
 
-PKG_MAINTAINER:=Luka Perkov <luka.perkov@sartura.hr>
+PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
 
 PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://dist.libuv.org/dist/v$(PKG_VERSION)/
-PKG_MD5SUM:=fad96b56f517c1ad3f274a19a10c53b2
+PKG_HASH:=7cbcf2017e7116cf9da8ec1c6a146d578536b1e479458438873c991f984a53d7
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
 PKG_BUILD_PARALLEL:=1
index 3c9b8b9ced8919ef58ca85642c77a9d99b7d87e4..063c478b51cae72341738dd579e4434d781b0174 100644 (file)
@@ -18,6 +18,7 @@ PKG_SOURCE_VERSION:=2c6403405872aa865999b95ba15944295adf6c38
 
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=93f33620e00276989211d9c129a6d8b5e0f45df8d23235ff0c53c823c52a5ef5
 PKG_LICENSE:=BSD
 
 PKG_INSTALL:=1
diff --git a/libs/libuwsc/Makefile b/libs/libuwsc/Makefile
new file mode 100755 (executable)
index 0000000..6baf5b9
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2018 Jianhui Zhao
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libuwsc
+PKG_VERSION:=2.0.0
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+PKG_SOURCE_URL=https://github.com/zhaojh329/libuwsc.git
+PKG_MIRROR_HASH:=a5a4651881d9d218b5d86280afabf3e8d9158dc80ceda92fcc0b0505d2483c0b
+CMAKE_INSTALL:=1
+
+PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_MAINTAINER:=Jianhui Zhao <jianhuizhao329@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libuwsc/default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Networking
+  TITLE:=Lightweight WebSocket client library
+  DEPENDS:=+libubox
+endef
+
+define Package/libuwsc-nossl
+  $(Package/libuwsc/default)
+  TITLE += (NO SSL)
+  VARIANT:=nossl
+endef
+
+define Package/libuwsc-openssl
+  $(Package/libuwsc/default)
+  TITLE += (openssl)
+  DEPENDS += +libustream-openssl
+  VARIANT:=openssl
+endef
+
+define Package/libuwsc-wolfssl
+  $(Package/libuwsc/default)
+  TITLE += (wolfssl)
+  DEPENDS += +libustream-wolfssl
+  VARIANT:=wolfssl
+endef
+
+define Package/libuwsc-mbedtls
+  $(Package/libuwsc/default)
+  TITLE += (mbedtls)
+  DEPENDS += +libustream-mbedtls
+  VARIANT:=mbedtls
+endef
+
+ifeq ($(BUILD_VARIANT),nossl)
+  CMAKE_OPTIONS += -DUWSC_SSL_SUPPORT=off
+endif
+
+define Package/libuwsc/default/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libuwsc.so* $(1)/usr/lib/
+endef
+
+Package/libuwsc-nossl/install = $(Package/libuwsc/default/install)
+Package/libuwsc-openssl/install = $(Package/libuwsc/default/install)
+Package/libuwsc-wolfssl/install = $(Package/libuwsc/default/install)
+Package/libuwsc-mbedtls/install = $(Package/libuwsc/default/install)
+
+$(eval $(call BuildPackage,libuwsc-nossl))
+$(eval $(call BuildPackage,libuwsc-mbedtls))
+$(eval $(call BuildPackage,libuwsc-wolfssl))
+$(eval $(call BuildPackage,libuwsc-openssl))
index b6fda69bbcc5f2f3e08d8bf07f1c4d37a08a0f1e..d9a4d8c68dcc8aa09472a239cd195e82a554b33a 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.linuxtv.org/downloads/v4l-utils
-PKG_MD5SUM:=945a38979138997e805828a4a53e53ec
+PKG_HASH:=78ead27ee58a701d7c6342303cf4520bdd4a2b88a7813bc99a0b389307e4336b
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
index aa1c9295ae9254ed7a4aa8e1dd2f56acd5ec7232..550954e0292db4e3b14b2f5680960c19cf6af0bc 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2008-2015 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -9,11 +7,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libvorbis
 PKG_VERSION:=1.3.5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://downloads.xiph.org/releases/vorbis/
-PKG_MD5SUM:=28cb28097c07a735d6af56e598e1c90f
+PKG_HASH:=54f94a9527ff0a88477be0a71c0bab09a4c3febe0ed878b24824906cd4b0e1d1
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=BSD-3-Clause
diff --git a/libs/libvorbis/patches/100-CVE-2017-14632-CVE-2017-14633.patch b/libs/libvorbis/patches/100-CVE-2017-14632-CVE-2017-14633.patch
new file mode 100644 (file)
index 0000000..84601ff
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/lib/info.c
++++ b/lib/info.c
+@@ -583,7 +583,8 @@ int vorbis_analysis_headerout(vorbis_dsp
+   oggpack_buffer opb;
+   private_state *b=v->backend_state;
+-  if(!b||vi->channels<=0){
++  if(!b||vi->channels<=0||vi->channels>255){
++    b = NULL;
+     ret=OV_EFAULT;
+     goto err_out;
+   }
index e9eb7dab40387803bb764c9c1316e82dbeb76396..93b938fab684152bb4e5bc6e228e7e4f6025d06b 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2006-2016 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -10,13 +8,14 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=libvorbisidec
 PKG_REV:=20150104
 PKG_VERSION:=1.0.3-$(PKG_REV)
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://git.xiph.org/tremor.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=b56ffce0c0773ec5ca04c466bc00b1bbcaf65aef
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=a5095464c58c5e0909025bf4cdfdcdc07742f545b696829c97514481b9ba64db
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
@@ -52,6 +51,8 @@ define Build/InstallDev
        $(CP) $(PKG_INSTALL_DIR)/usr/include/tremor $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libvorbisidec.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
 endef
 
 define Package/libvorbisidec/install
index 6678970fe77c2a3f65eb28567d20f86f7bc901d7..b8aba66022095ed4024c71cecc7b7148438cff11 100644 (file)
@@ -9,11 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libvpx
-PKG_VERSION:=1.6.1
+PKG_VERSION:=1.7.0
 PKG_RELEASE:=1
 
 PKG_REV:=v$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_MIRROR_HASH:=be50ff18464d614a08726597ecbd72d1f11ec69ec04df2d9acdf646ecd9adcca
 PKG_SOURCE_URL:=https://chromium.googlesource.com/webm/libvpx
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=$(PKG_REV)
diff --git a/libs/libwebsockets/Makefile b/libs/libwebsockets/Makefile
new file mode 100644 (file)
index 0000000..fcafa90
--- /dev/null
@@ -0,0 +1,105 @@
+#
+# Copyright (C) 2014-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libwebsockets
+PKG_VERSION:=2.4.1
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://codeload.github.com/warmcat/libwebsockets/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=29414be4f79f6abc0e6aadccd09a4da0f0c431e3b5691f496acd081ae6a8240c
+
+
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
+
+PKG_LICENSE:=LGPL-2.1+exception
+PKG_LICENSE_FILES:=LICENSE
+
+CMAKE_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+CMAKE_OPTIONS += -DLWS_IPV6=$(if $(CONFIG_IPV6),ON,OFF)
+CMAKE_OPTIONS += -DLWS_WITHOUT_TESTAPPS=ON
+
+# other options worth noting
+# CMAKE_OPTIONS += -DLWS_WITHOUT_EXTENSIONS=ON
+# CMAKE_OPTIONS += -DLWS_WITHOUT_DAEMONIZE=ON
+# CMAKE_OPTIONS += -DLWS_WITHOUT_SERVER=ON
+# CMAKE_OPTIONS += -DLWS_WITHOUT_DEBUG=ON
+
+
+define Package/libwebsockets/Default
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=libwebsockets
+       DEPENDS:=+zlib +libcap
+       URL:=https://libwebsockets.org
+       MAINTAINER:=Karl Palsson <karlp@etactica.com>
+       PROVIDES:= libwebsockets
+endef
+
+define Package/libwebsockets-openssl
+       $(call Package/libwebsockets/Default)
+       TITLE += (OpenSSL)
+       DEPENDS += +libopenssl
+       VARIANT:=openssl
+endef
+
+define Package/libwebsockets-mbedtls
+       $(call Package/$(PKG_NAME)/Default)
+       TITLE += (mbedTLS)
+       DEPENDS += +libmbedtls
+       VARIANT:=mbedtls
+endef
+
+define Package/libwebsockets-full
+       $(call Package/libwebsockets/Default)
+       TITLE += (Full - OpenSSL, libuv, plugins, CGI)
+       DEPENDS += +libopenssl +libuv
+       VARIANT:=full
+endef
+
+ifeq ($(BUILD_VARIANT),openssl)
+    CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
+    CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
+    CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
+endif
+
+ifeq ($(BUILD_VARIANT),mbedtls)
+    CMAKE_OPTIONS += -DLWS_WITH_MBEDTLS=1
+endif
+
+ifeq ($(BUILD_VARIANT),full)
+    CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
+    CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
+    CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
+    CMAKE_OPTIONS += -DLWS_WITH_LIBUV=ON
+    CMAKE_OPTIONS += -DLWS_WITH_PLUGINS=ON
+    CMAKE_OPTIONS += -DLWS_WITH_SERVER_STATUS=ON
+    CMAKE_OPTIONS += -DLWS_WITH_ACCESS_LOG=ON
+    CMAKE_OPTIONS += -DLWS_WITH_CGI=ON
+endif
+
+define Package/libwebsockets/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets.so* $(1)/usr/lib/
+endef
+
+Package/libwebsockets-mbedtls/install = $(Package/libwebsockets/install)
+Package/libwebsockets-openssl/install = $(Package/libwebsockets/install)
+Package/libwebsockets-full/install = $(Package/libwebsockets/install)
+
+$(eval $(call BuildPackage,libwebsockets-openssl))
+$(eval $(call BuildPackage,libwebsockets-mbedtls))
+$(eval $(call BuildPackage,libwebsockets-full))
diff --git a/libs/libwebsockets/patches/001-CMakeLists-build-reproducible-by-default.patch b/libs/libwebsockets/patches/001-CMakeLists-build-reproducible-by-default.patch
new file mode 100644 (file)
index 0000000..c36a81d
--- /dev/null
@@ -0,0 +1,78 @@
+From d7b6c04aaf416344332e73f49fe457013e3ccf36 Mon Sep 17 00:00:00 2001
+From: Alexander Couzens <lynxis@fe80.eu>
+Date: Sun, 10 Dec 2017 00:54:06 +0100
+Subject: [PATCH] CMakeLists: build reproducible by default
+Merged-upstream: yes
+
+Using the build user and build hostname as part of the git hash breaks
+reproducible builds. Make this part optional, but build reproducible by
+default.
+---
+ CMakeLists.txt | 47 +++++++++++++++++++++++++++--------------------
+ 1 file changed, 27 insertions(+), 20 deletions(-)
+
+Index: libwebsockets-2.4.0/CMakeLists.txt
+===================================================================
+--- libwebsockets-2.4.0.orig/CMakeLists.txt
++++ libwebsockets-2.4.0/CMakeLists.txt
+@@ -39,26 +39,32 @@ message(STATUS "CMAKE_TOOLCHAIN_FILE='${
+ find_package(Git)
+ if(GIT_EXECUTABLE)
+       execute_process(
+-    WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+-    COMMAND "${GIT_EXECUTABLE}" describe
+-    OUTPUT_VARIABLE GIT_HASH
+-    OUTPUT_STRIP_TRAILING_WHITESPACE
+-    )
+-      execute_process(
+-    WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+-    COMMAND "whoami"
+-    OUTPUT_VARIABLE GIT_USER
+-    OUTPUT_STRIP_TRAILING_WHITESPACE
+-    )
+-      execute_process(
+-    WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+-    COMMAND "hostname"
+-    OUTPUT_VARIABLE GIT_HOST
+-    OUTPUT_STRIP_TRAILING_WHITESPACE
+-    )
+-      string(REGEX REPLACE "([^\\])[\\]([^\\])" "\\1\\\\\\\\\\2" GIT_USER ${GIT_USER})
+-    set(LWS_BUILD_HASH ${GIT_USER}@${GIT_HOST}-${GIT_HASH})
+-    message("Git commit hash: ${LWS_BUILD_HASH}")
++              WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
++              COMMAND "${GIT_EXECUTABLE}" describe
++              OUTPUT_VARIABLE GIT_HASH
++              OUTPUT_STRIP_TRAILING_WHITESPACE
++              )
++      set(LWS_BUILD_HASH ${GIT_HASH})
++
++      # appen the build user and hostname
++      if(NOT LWS_REPRODUCIBLE)
++              execute_process(
++                      WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
++                      COMMAND "whoami"
++                      OUTPUT_VARIABLE GIT_USER
++                      OUTPUT_STRIP_TRAILING_WHITESPACE
++                      )
++              execute_process(
++                      WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
++                      COMMAND "hostname"
++                      OUTPUT_VARIABLE GIT_HOST
++                      OUTPUT_STRIP_TRAILING_WHITESPACE
++                      )
++              string(REGEX REPLACE "([^\\])[\\]([^\\])" "\\1\\\\\\\\\\2" GIT_USER ${GIT_USER})
++              set(LWS_BUILD_HASH ${GIT_USER}@${GIT_HOST}-${GIT_HASH})
++      endif()
++
++      message("Git commit hash: ${LWS_BUILD_HASH}")
+ endif()
+ set(LWS_WITH_BUNDLED_ZLIB_DEFAULT OFF)
+@@ -121,6 +127,7 @@ option(LWS_AVOID_SIGPIPE_IGN "Android 7+
+ option(LWS_WITH_STATS "Keep statistics of lws internal operations" OFF)
+ option(LWS_WITH_SOCKS5 "Allow use of SOCKS5 proxy on client connections" OFF)
+ option(LWS_WITH_PEER_LIMITS "Track peers and restrict resources a single peer can allocate" OFF)
++option(LWS_REPRODUCIBLE "Build libwebsockets reproducible. It removes the build user and hostname from the build" ON)
+ macro(confirm_command CMD NOCMD)
+       find_program (HAVE_CMD_${CMD} ${CMD} )
index dbb7543b8d39983d07beb21f4b6fa4e466fe30f3..b6ed9292698d77c254fe903734b5375aebde1e78 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=x264
-PKG_VERSION:=snapshot-20160815-2245-stable
-PKG_RELEASE:=3
+PKG_VERSION:=snapshot-20170623-2245-stable
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://download.videolan.org/x264/snapshots/
 PKG_MAINTAINER:=Adrian Panella <ianchi74@outlook.com>
-PKG_MD5SUM:=93fa596ea1b5513fec73e9de27589dd4
+PKG_HASH:=e8af5d199b6af8124b6e54631ab7b2ff20f1ce86bbcc2f58bd800bc85bee6b2f
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
@@ -29,7 +29,8 @@ MAKE_FLAGS+= LD="$(TARGET_CC) -o"
 
 # ARM ASM depends on ARM1156 or later, blacklist earlier or incompatible cores
 # AMD Geode LX and i486 do not have SSE
-CPU_ASM_BLACKLIST:=geode i486 arm920t arm926ej-s arm1136j-s arm1176jzf-s fa526 mpcore xscale
+CPU_ASM_BLACKLIST:=geode i486 arm920t arm926ej-s arm1136j-s arm1176jzf-s fa526 mpcore xscale \
+                  mips32 24kc 34kc 74kc octeon mips64
 
 ifneq ($(CONFIG_SOFT_FLOAT)$(findstring $(call qstrip,$(CONFIG_CPU_TYPE)),$(CPU_ASM_BLACKLIST)),)
   CONFIGURE_VARS+= AS= 
@@ -51,7 +52,11 @@ endif
 CONFIGURE_ARGS += \
                --enable-shared \
                --enable-pic \
-               --disable-cli 
+               --enable-strip \
+               --disable-cli \
+               --disable-avs \
+               --disable-ffms \
+               --disable-lsmash
 
 define Package/libx264
   SECTION:=libs
index bbba0f07964839cebfff9e2014208f87e38e91ed..e13a0201c89c3b24d0efbe6ce4bb54de3347da29 100644 (file)
@@ -8,12 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xerces-c
-PKG_VERSION:=3.1.4
-PKG_RELEASE:=2
+PKG_MAIN_VER:=3.2
+PKG_VERSION:=3.2.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@APACHE/xerces/c/3/sources
-PKG_MD5SUM:=9973cc79481803f8b6652c52faf5195d963f50d209d4f681ec97e2aa014b6241
+PKG_HASH:=35d8db18ebe6db353850903981cd07cca64abeba071602e7e32596714352de08
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=Apache-2.0
@@ -72,14 +73,14 @@ define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include/xercesc/
        $(CP) $(PKG_INSTALL_DIR)/usr/include/xercesc/* $(1)/usr/include/xercesc/
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/{libxerces-c.a,libxerces-c-3.1.so,libxerces-c.so} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/{libxerces-c.a,libxerces-c-$(PKG_MAIN_VER).so,libxerces-c.so} $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/xerces-c.pc $(1)/usr/lib/pkgconfig/xerces-c.pc
 endef
 
 define Package/libxerces-c/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/{libxerces-c-3.1.so,libxerces-c.so} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/{libxerces-c-$(PKG_MAIN_VER).so,libxerces-c.so} $(1)/usr/lib/
 endef
 
 define Package/libxerces-c-samples/install
diff --git a/libs/libxerces-c/patches/0001-fix-configure-cross-compiling.patch b/libs/libxerces-c/patches/0001-fix-configure-cross-compiling.patch
new file mode 100644 (file)
index 0000000..9e639ac
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -194,7 +194,7 @@ AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#
+                     ]
+                  )
+ AC_MSG_CHECKING([for wcsrtombs])
+-AC_RUN_IFELSE(  [AC_LANG_PROGRAM([[#include <wchar.h>
++AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include <wchar.h>
+ #include <string.h>]],
+                                  [[
+ mbstate_t st;
+@@ -216,7 +216,7 @@ else
+                     ]
+                  )
+ AC_MSG_CHECKING([for mbsrtowcs])
+-AC_RUN_IFELSE(  [AC_LANG_PROGRAM([[#include <wchar.h>
++AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include <wchar.h>
+ #include <string.h>]],
+                                  [[
+ mbstate_t st;
index 155640c656ab5014fd9ff66daf147c4c2ee7fb9c..3cded08954d64720c7c2259ec5b1bc2b84925568 100644 (file)
@@ -8,14 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libxml2
-PKG_VERSION:=2.9.4
+PKG_VERSION:=2.9.8
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://gd.tuwien.ac.at/languages/libxml/ \
-       http://xmlsoft.org/sources/ \
-       ftp://fr.rpmfind.net/pub/libxml/
-PKG_MD5SUM:=ae249165c173b1ff386ee8ad676815f5
+PKG_SOURCE_URL:=http://xmlsoft.org/sources/
+PKG_HASH:=0b74e51595654f958148759cfef0993114ddccccbb6f31aee018f3558e8e2732
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
@@ -118,6 +116,10 @@ define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.{la,a,so*} $(1)/usr/lib/
 
+       $(INSTALL_DIR) $(1)/usr/lib/cmake/libxml2
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmake/libxml2/libxml2-config.cmake \
+               $(1)/usr/lib/cmake/libxml2
+
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxml-2.0.pc $(1)/usr/lib/pkgconfig/
 
index 955073a0073e2c7c2bf3cf9234011d9317004f9b..8c546c831452bf7b53ff01d980485e623b4d0209 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2014 OpenWrt.org
+# Copyright (C) 2014 - 2018 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libxslt
-PKG_VERSION:=1.1.28
+PKG_VERSION:=1.1.32
 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_HASH:=526ecd0abaf4a7789041622c3950c0e7f2c4c8835471515fd77eec684a355460
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
@@ -54,7 +54,7 @@ endef
 define Package/xsltproc
   SECTION:=utils
   CATEGORY:=Utilities
-  DEPENDS:=+libxml2 +libxslt +libexslt
+  DEPENDS:=+libxslt +PACKAGE_xsltproc:libexslt
   TITLE:=Gnome XSLT xsltproc Utility
   URL:=http://xmlsoft.org/XSLT/
 endef
@@ -64,6 +64,7 @@ define Package/xsltproc/description
 endef
 
 CONFIGURE_ARGS+= \
+       --disable-silent-rules \
        --enable-shared \
        --enable-static \
        --without-python \
@@ -72,8 +73,6 @@ CONFIGURE_ARGS+= \
        --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 \
@@ -129,14 +128,14 @@ endef
 define Package/libxslt/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) \
-               $(PKG_INSTALL_DIR)/usr/lib/libxslt.so.* \
+               $(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.* \
+               $(PKG_INSTALL_DIR)/usr/lib/libexslt.so* \
                $(1)/usr/lib/
 endef
 
diff --git a/libs/libyaml-cpp/Makefile b/libs/libyaml-cpp/Makefile
new file mode 100644 (file)
index 0000000..984e142
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2017 Steven Hessing
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libyaml-cpp
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:= Steven Hessing <steven.hessing@gmail.com>
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/jbeder/yaml-cpp/
+PKG_SOURCE_DATA:=2017-11-01
+PKG_SOURCE_VERSION:=beb44b872c07c74556314e730c6f20a00b32e8e5
+PKG_MIRROR_HASH:=3ddb1f5a6c564f33fd164c0300df8048c689c319964a08386d869637a0f5c8e2
+
+PKG_SOURCE_SUBDIR:=yaml-cpp
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_PARALLEL:=1
+
+CMAKE_INSTALL:=1
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+CMAKE_OPTIONS += -DBUILD_SHARED_LIBS=ON
+#CMAKE_OPTIONS += -DBUILD_SHARED_LIBS=OFF
+
+define Package/libyaml-cpp
+       SECTION:=development
+       CATEGORY:=Libraries
+       TITLE:=libyaml-cpp 
+       URL:=https://github.com/jbeder/yaml-cpp
+       DEPENDS:=+libstdcpp
+endef
+
+define Package/libyaml-cpp/description
+yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec.
+endef
+
+define Package/libyaml-cpp/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       #$(INSTALL_DATA) $(PKG_BUILD_DIR)/libyaml-cpp.so.0.5.3 $(1)/usr/lib/
+       #$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libyaml-cpp.so.0.5.3 $(1)/usr/lib/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libyaml-cpp.so.0.5 $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libyaml-cpp))
diff --git a/libs/libyang/Makefile b/libs/libyang/Makefile
new file mode 100644 (file)
index 0000000..9029519
--- /dev/null
@@ -0,0 +1,85 @@
+#
+# Copyright (C) 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:=libyang
+PKG_VERSION:=0.14.53
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_LICENSE:=GPL-2.0+
+PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=2698bd6484526facbf82b1263810b938b82a2f23
+PKG_MIRROR_HASH:=3bfe4fd8236f0d1903d275aa76e039645d1093ef4204ab3b9bef46aecbe68f72
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/CESNET/libyang.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
+
+PKG_BUILD_ROOT:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libyang
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=YANG data modeling language library
+  URL:=$(PKG_SOURCE_URL)
+  DEPENDS:=+libpcre +libpthread
+endef
+
+define Package/yanglint
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=YANG data modeling language utility
+  URL:=$(PKG_SOURCE_URL)
+  DEPENDS:=+libyang
+endef
+
+define Package/libyang/description
+ libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
+ The library is used e.g. in libnetconf2, Netopeer2 or sysrepo projects.
+endef
+
+TARGET_LDFLAGS += -lm
+
+CMAKE_OPTIONS += \
+       -DCMAKE_INSTALL_PREFIX:PATH=/usr \
+       -DCMAKE_BUILD_TYPE:STRING=Release
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyang.so* $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/include/libyang
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/include/libyang/* $(1)/usr/include/libyang/
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libyang.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libyang/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyang.so* $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/lib/libyang
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libyang/* $(1)/usr/lib/libyang/
+endef
+
+define Package/yanglint/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/yanglint $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libyang))
+$(eval $(call BuildPackage,yanglint))
index c4f38f45bce93c238ca04c27835553be3aee5bf5..1c172bd33c1a86166dc5ac6ac93acd0628fce155 100644 (file)
@@ -14,7 +14,7 @@ PKG_LICENSE:=GPL-3.0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.tildeslash.com/libzdb/dist/
-PKG_MD5SUM:=01d8519a596d62f6b43559cc29ecd36d
+PKG_HASH:=0f01abb1b01d1a1f4ab9b55ad3ba445d203fc3b4757abdf53e1d85e2b7b42695
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
diff --git a/libs/loudmouth/Makefile b/libs/loudmouth/Makefile
new file mode 100644 (file)
index 0000000..e5f77ca
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=loudmouth
+PKG_VERSION:=1.5.3
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_LICENSE:=LGPLv2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=46a3f1a13a6ec5ff5377c028ce25bc723ab86247af40e686aa2b24718a5cd0d1
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/mcabber/loudmouth.git
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/loudmouth
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+glib2 +libopenssl
+  TITLE:=loudmouth
+  URL:=https://github.com/mcabber/loudmouth
+endef
+
+define Package/loudmouth/description
+  Lightweight and easy-to-use C library for programming with the Jabber protocol
+endef
+
+CONFIGURE_ARGS += \
+       --with-ssl=openssl \
+       --with-idn=no
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/loudmouth-1.0/ \
+               $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+               $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/loudmouth/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+               $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,loudmouth))
diff --git a/libs/loudmouth/patches/001-allow-disable-libidn.patch b/libs/loudmouth/patches/001-allow-disable-libidn.patch
new file mode 100644 (file)
index 0000000..88aac5b
--- /dev/null
@@ -0,0 +1,39 @@
+diff --git a/configure.ac b/configure.ac
+index 8435d9a..148453c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -109,9 +109,22 @@ else
+ fi
+ AC_SUBST([TEST_DIRS])
+-PKG_CHECK_MODULES(LIBIDN, libidn, have_idn=yes, have_idn=no)
+-if test "x$have_idn" = "xyes"; then
+-        AC_DEFINE(HAVE_IDN, 1, [Define if IDN support is included])
++dnl +--------------------------------------------------------+
++dnl | Checking for libidn support                            |-
++dnl +--------------------------------------------------------+
++AC_ARG_WITH(idn,
++            AS_HELP_STRING([--with-idn=@<:@auto|no@:>@],
++                           [Whether to use libidn [[default=auto]]]),
++            ac_idn=$withval,
++            ac_idn=auto)
++
++if test "x$ac_idn" = "xauto"; then
++  PKG_CHECK_MODULES(LIBIDN, libidn, enable_idn=yes, enable_idn=no)
++  if test "x$enable_idn" = "xyes"; then
++    AC_DEFINE(HAVE_IDN, 1, [Define if IDN support is included])
++  fi
++else
++  enable_idn=no
+ fi
+ dnl Gtk doc
+@@ -323,7 +336,7 @@ echo "
+         prefix:                   ${prefix}
+         compiler:                 ${CC}
+-        Have IDN support:         ${have_idn}
++        Enable IDN support:       ${enable_idn}
+         Enable SSL:               ${enable_ssl}
+         Asynchronous DNS:         ${enable_asyncns}
+         Linux TCP keepalives:     ${use_keepalives}
diff --git a/libs/loudmouth/patches/900-disable-docs-examples-tests.patch b/libs/loudmouth/patches/900-disable-docs-examples-tests.patch
new file mode 100644 (file)
index 0000000..e2c91e6
--- /dev/null
@@ -0,0 +1,27 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,7 +1,7 @@
+ include $(top_srcdir)/build/Makefile.am.lm
+-SUBDIRS = loudmouth docs examples $(TEST_DIRS)
+-DIST_SUBDIRS = loudmouth docs examples tests
++SUBDIRS = loudmouth
++DIST_SUBDIRS = loudmouth
+ ACLOCAL_AMFLAGS = -I m4
+--- a/configure.ac
++++ b/configure.ac
+@@ -307,12 +307,7 @@ AC_SUBST(LOUDMOUTH_LIBS)
+ AC_OUTPUT([
+ Makefile
+-docs/Makefile
+-docs/reference/Makefile
+ loudmouth/Makefile
+-examples/Makefile
+-tests/Makefile
+-tests/parser-tests/Makefile
+ loudmouth-1.0.pc])
+ dnl ==========================================================================
index 872c5be149cc1f0863019e6d24c321c3104641c4..7b88f0ce4b7a2c8ead6c966ef202a087bbf1b3a9 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://lttng.org/files/$(PKG_NAME)/
-PKG_MD5SUM:=5c7de27a9968e01ac0b08c7c9cf554d0
+PKG_HASH:=a75c3ea6cbfa3a89107a2141b27ebabf13964e628855566571f09459bbbc8cb3
 
 PKG_LICENSE:=LGPL-2.1 GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index 6f1e0b79c973e7ac2cc3f3c87d86f7946dc89676..0856aed2f7eebf2f1660347fb83563fd9c3f8bf9 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://bitmath.org/code/mtdev/
-PKG_MD5SUM:=52c9610b6002f71d1642dc1a1cca5ec1
+PKG_HASH:=6677d5708a7948840de734d8b4675d5980d4561171c5a8e89e54adf7a13eba7f
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
diff --git a/libs/musl-fts/Makefile b/libs/musl-fts/Makefile
new file mode 100644 (file)
index 0000000..494f700
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# Copyright (C) 2017 Lucian Cristian <lucian.cristian@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+# updated to work with latest source from abrasive
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=musl-fts
+PKG_VERSION:=1.2.7
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/pullmoll/musl-fts.git
+PKG_SOURCE_VERSION:=0bde52df588e8969879a2cae51c3a4774ec62472
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=29c62a600128e9189b1b2e1aea568546178eedf739527f657873b3b773072ecb
+
+PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING AUTHORS
+
+PKG_FIXUP:=autoreconf
+PKG_REMOVE_FILES:=autogen.sh
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/musl-fts
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=fts implementation for musl libc
+  URL:=https://github.com/pullmoll/musl-fts
+  DEPENDS:= +libpthread
+endef
+
+define Package/musl-fts/description
+  The musl-fts package implements the fts(3) functions fts_open, fts_read, fts_children, fts_set and fts_close, which are missing in musl libc.
+endef
+
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/fts.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfts.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/musl-fts.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/musl-fts/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfts.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,musl-fts))
index 0650ee082d29810c2d6fc8fcf2b558a7edf436c2..cc90ef7236d09fa9a9ed7955da064e2847a25990 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -10,10 +10,10 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=mxml
 PKG_VERSION:=2.10
 PKG_RELEASE:=1
-PKG_MD5SUM:=8804c961a24500a95690ef287d150abe
+PKG_HASH:=267ff58b64ddc767170d71dab0c729c06f45e1df9a9b6f75180b564f09767891
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.msweet.org/files/project3/
+PKG_SOURCE_URL:=https://github.com/michaelrsweet/mxml/releases/download/release-$(PKG_VERSION)/
 PKG_FIXUP:=autoreconf
 
 PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
index d91a2234fa96cd73cc869f1eaf9c907a7ac4829c..bfe71865eaebd95cc347590ccdf20888c6fef348 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=2
 PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://hyperelliptic.org/nacl
-PKG_MD5SUM:=7efb5715561c3d10dafd3fa97b4f2d20
+PKG_HASH:=4f277f89735c8b0b8a6bbd043b3efb3fa1cc68a9a5da6a076507d067fc3b3bf8
 
 PKG_LICENSE:=PublicDomain
 
index 2cbcda42d71bd503d37407002bc0a59df6b7b95f..5cf2e36ec6a4082b222b9b68d5723b0ec857552c 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=neon
 PKG_VERSION:=0.30.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.webdav.org/neon
-PKG_MD5SUM:=e28d77bf14032d7f5046b3930704ef41
+PKG_HASH:=db0bd8cdec329b48f53a6f00199c92d5ba40b0f015b153718d1b15d3d967fbca
 
 PKG_INSTALL:=1
 
@@ -44,7 +44,7 @@ endef
 
 
 TARGET_CFLAGS += $(FPIC)
-TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
+TARGET_CPPFLAGS += -D_GNU_SOURCE
 
 CONFIGURE_ARGS += \
        --enable-shared \
diff --git a/libs/opencv/Makefile b/libs/opencv/Makefile
new file mode 100644 (file)
index 0000000..612d0f5
--- /dev/null
@@ -0,0 +1,73 @@
+#
+# Copyright (C) 2013-2014 wrtnode.com
+# Copyright (C) 2015-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=opencv
+PKG_VERSION:=3.1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
+PKG_SOURCE_URL:=http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/$(PKG_VERSION)/
+PKG_HASH:=1f6990249fdb82804fff40e96fa6d99949023ab0e3277eae4bd459b374e622a4
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/opencv/Default/description
+ OpenCV (Open Source Computer Vision Library) is an open source computer
+ vision and machine learning software library. OpenCV was built to provide
+ a common infrastructure for computer vision applications and to accelerate
+ the use of machine perception in the commercial products. Being a
+ BSD-licensed product, OpenCV makes it easy for businesses to utilize
+ and modify the code.
+endef
+
+define Package/opencv
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=OpenCV
+  URL:=http://opencv.org/
+  MAINTAINER:=WRTnode Team <pub@wrtnode.com>
+  DEPENDS:=+libpthread +librt +libstdcpp +zlib +libjpeg
+endef
+
+PKG_INSTALL:=1
+
+CMAKE_OPTIONS += -DBUILD_opencv_gpu:BOOL=OFF \
+       -DWITH_1394:BOOL=OFF -DBUILD_opencv_stitching:BOOL=OFF \
+       -DBUILD_opencv_superres:BOOL=OFF -DBUILD_opencv_ts:BOOL=OFF \
+       -DBUILD_opencv_highgui:BOOL=OFF \
+       -DBUILD_opencv_videostab:BOOL=OFF \
+       -DWITH_FFMPEG:BOOL=OFF \
+       -DWITH_GSTREAMER:BOOL=OFF \
+       -DWITH_LIBV4L:BOOL=OFF \
+       -DWITH_PNG:BOOL=OFF \
+       -DWITH_TIFF:BOOL=OFF \
+       -DCMAKE_VERBOSE:BOOL=OFF \
+       -DENABLE_PRECOMPILED_HEADERS=OFF
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/opencv $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/opencv2 $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopencv* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/opencv.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/opencv/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopencv* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,opencv))
diff --git a/libs/opencv/README.md b/libs/opencv/README.md
new file mode 100644 (file)
index 0000000..a5cdcdd
--- /dev/null
@@ -0,0 +1,23 @@
+Introduction
+===
+
+#### OpenCV: Open Source Computer Vision Library.OpenCV is based on (open source) issued cross-platform computer vision library, you can run on Linux, Windows and Mac OS operating systems.
+
+#### Resources
+
+* Homepage: <http://opencv.org>
+* Docs: <http://docs.opencv.org>
+* Q&A forum: <http://answers.opencv.org>
+* Issue tracking: <http://code.opencv.org>
+
+#### Contributing
+
+Please read before starting work on a pull request: <http://code.opencv.org/projects/opencv/wiki/How_to_contribute>
+
+Summary of guidelines:
+
+* One pull request per issue;
+* Choose the right base branch;
+* Include tests and documentation;
+* Clean up "oops" commits before submitting;
+* Follow the coding style guide.
index a1e40625f7973ec6786f314ddca1f9c9fb5fd4b7..7269cf67a1815cbb59588474119dc6884f05c8f9 100644 (file)
@@ -8,15 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openldap
-PKG_VERSION:=2.4.44
-PKG_RELEASE:=1
+PKG_VERSION:=2.4.45
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/ \
        ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/ \
        ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/ \
        ftp://ftp.plig.org/pub/OpenLDAP/openldap-release/
-PKG_MD5SUM:=693ac26de86231f8dcae2b4e9d768e51
+PKG_HASH:=cdd6cffdebcd95161a73305ec13fc7a78e9707b46ca9f84fb897cd5626df3824
+PKG_LICENSE:=OLDAP-2.8
+PKG_LICENSE_FILES:=LICENSE
 
 PKG_FIXUP:=autoreconf
 
diff --git a/libs/openldap/patches/110-reproducible-builds.patch b/libs/openldap/patches/110-reproducible-builds.patch
new file mode 100644 (file)
index 0000000..2cdce8e
--- /dev/null
@@ -0,0 +1,21 @@
+Index: openldap-2.4.45/build/mkversion
+===================================================================
+--- openldap-2.4.45.orig/build/mkversion
++++ openldap-2.4.45/build/mkversion
+@@ -50,7 +50,6 @@ if test $# != 1 ; then
+ fi
+ APPLICATION=$1
+-WHOWHERE="$USER@`uname -n`:`pwd`"
+ cat << __EOF__
+ /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+@@ -72,7 +71,6 @@ static const char copyright[] =
+ "COPYING RESTRICTIONS APPLY\n";
+ $static $const char $SYMBOL[] =
+-"@(#) \$$PACKAGE: $APPLICATION $VERSION (" __DATE__ " " __TIME__ ") \$\n"
+-"\t$WHOWHERE\n";
++"@(#) \$$PACKAGE: $APPLICATION $VERSION\$\n";
+ __EOF__
index 4a6a452d9a150fcdb9f072682e862b907ae86448..89456916948a1855bafeb72c68bc7db42bd59d12 100644 (file)
@@ -8,17 +8,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=opus
-PKG_VERSION:=1.1.4
+PKG_VERSION:=1.2.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://downloads.xiph.org/releases/opus/
-PKG_MD5SUM:=a2c09d995d0885665ff83b5df2505a5f
-PKG_HASH:=9122b6b380081dd2665189f97bfd777f04f92dc3ab6698eea1dbb27ad59d8692
+PKG_SOURCE_URL:=https://archive.mozilla.org/pub/opus/
+PKG_HASH:=cfafd339ccd9c5ef8d6ab15d7e1a412c054bf4cb4ecbbbcc78c12ef2def70732
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Ted Hess <thess@kitchensync.net> Ian Leonard <antonlacon@gmail.com>
+PKG_MAINTAINER:=Ted Hess <thess@kitchensync.net>, Ian Leonard <antonlacon@gmail.com>
 
 PKG_INSTALL:=1
 
@@ -46,6 +45,11 @@ ifeq ($(CONFIG_SOFT_FLOAT),y)
                --enable-fixed-point
 endif
 
+ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
+       CONFIGURE_ARGS+= \
+               --enable-fixed-point
+endif
+
 CPU_ASM_BLACKLIST:=xscale arm926ej-s
 
 ifneq ($(findstring $(call qstrip,$(CONFIG_CPU_TYPE)),$(CPU_ASM_BLACKLIST)),)
index a9facc13fd5a55946d480f5d898a6a12dbaf227d..a95120377701bc5ede7051bb739186728f44b095 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=p11-kit
 PKG_VERSION:=0.23.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=96f073270c489c9a594e1c9413f42db8
+PKG_HASH:=e57371669f3b157141b86c429bd9c29741994b2f5ff115fcb8a03e751b0f6ac4
 PKG_SOURCE_URL:=http://p11-glue.freedesktop.org/releases/
 
 PKG_INSTALL:=1
@@ -35,7 +35,8 @@ define Package/p11-kit/description
 endef
 
 CONFIGURE_ARGS+= \
-       --without-libffi
+       --without-libffi \
+       --disable-trust-module
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include/p11-kit-1/p11-kit/
index 861b561e2f8841d844e2ac6752b923cba21b7628..a30dadf377529be3ecda90eed5ed4b5c4b8aace7 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pcre
-PKG_VERSION:=8.40
+PKG_VERSION:=8.41
 PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
-PKG_MD5SUM:=41a842bf7dcecd6634219336e2167d1d
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
+PKG_HASH:=e62c7eac5ae7c0e7286db61ff82912e1c0b7a0c13706616e94a7dd729321b530
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 
 PKG_LICENSE:=BSD-3-Clause
@@ -53,6 +53,7 @@ CONFIGURE_ARGS += \
        --enable-utf8 \
        --enable-unicode-properties \
        --enable-pcre16 \
+       --with-match-limit-recursion=16000 \
 
 ifneq ($(CONFIG_PACKAGE_libpcrecpp),)
   CONFIGURE_ARGS+= --enable-cpp
diff --git a/libs/pcre/patches/001-CVE-2017-7186 b/libs/pcre/patches/001-CVE-2017-7186
deleted file mode 100644 (file)
index 984cf81..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#CVE-2017-7186 patch
---- trunk/pcre_internal.h      2016/05/21 13:34:44     1649
-+++ trunk/pcre_internal.h      2017/02/24 17:30:30     1688
-@@ -2772,6 +2772,9 @@
- extern const pcre_uint16 PRIV(ucd_stage2)[];
- extern const pcre_uint32 PRIV(ucp_gentype)[];
- extern const pcre_uint32 PRIV(ucp_gbtable)[];
-+#ifdef COMPILE_PCRE32
-+extern const ucd_record  PRIV(dummy_ucd_record)[];
-+#endif
- #ifdef SUPPORT_JIT
- extern const int         PRIV(ucp_typerange)[];
- #endif
-@@ -2780,9 +2783,15 @@
- /* UCD access macros */
- #define UCD_BLOCK_SIZE 128
--#define GET_UCD(ch) (PRIV(ucd_records) + \
-+#define REAL_GET_UCD(ch) (PRIV(ucd_records) + \
-         PRIV(ucd_stage2)[PRIV(ucd_stage1)[(int)(ch) / UCD_BLOCK_SIZE] * \
-         UCD_BLOCK_SIZE + (int)(ch) % UCD_BLOCK_SIZE])
-+        
-+#ifdef COMPILE_PCRE32
-+#define GET_UCD(ch) ((ch > 0x10ffff)? PRIV(dummy_ucd_record) : REAL_GET_UCD(ch))
-+#else
-+#define GET_UCD(ch) REAL_GET_UCD(ch)
-+#endif 
- #define UCD_CHARTYPE(ch)    GET_UCD(ch)->chartype
- #define UCD_SCRIPT(ch)      GET_UCD(ch)->script
---- trunk/pcre_ucd.c   2014/06/19 07:51:39     1490
-+++ trunk/pcre_ucd.c   2017/02/24 17:30:30     1688
-@@ -38,6 +38,20 @@
- const pcre_uint32 PRIV(ucd_caseless_sets)[] = {0};
- #else
-+/* If the 32-bit library is run in non-32-bit mode, character values
-+greater than 0x10ffff may be encountered. For these we set up a
-+special record. */
-+
-+#ifdef COMPILE_PCRE32
-+const ucd_record PRIV(dummy_ucd_record)[] = {{
-+  ucp_Common,    /* script */
-+  ucp_Cn,        /* type unassigned */
-+  ucp_gbOther,   /* grapheme break property */
-+  0,             /* case set */
-+  0,             /* other case */
-+  }};
-+#endif
-+
- /* When recompiling tables with a new Unicode version, please check the
- types in this structure definition from pcre_internal.h (the actual
- field names will be different):
diff --git a/libs/pcre2/Makefile b/libs/pcre2/Makefile
new file mode 100644 (file)
index 0000000..a6b079d
--- /dev/null
@@ -0,0 +1,95 @@
+#
+# Copyright (C) 2017 Shane Peelar
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pcre2
+PKG_VERSION:=10.30
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
+PKG_HASH:=90bd41c605d30e3745771eb81928d779f158081a51b2f314bbcc1f73de5773db
+PKG_MAINTAINER:=Shane Peelar <lookatyouhacker@gmail.com>
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENCE
+
+PKG_FIXUP:=autoreconf
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libpcre2/default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=http://www.pcre.org/
+endef
+
+define Package/libpcre2
+  $(call Package/libpcre2/default)
+  TITLE:=A Perl Compatible Regular Expression library
+endef
+
+define Package/libpcre2-16
+  $(call Package/libpcre2/default)
+  TITLE:=A Perl Compatible Regular Expression library (16bit support)
+endef
+
+
+define Package/libpcre2-32
+  $(call Package/libpcre2/default)
+  TITLE:=A Perl Compatible Regular Expression library (32bit support)
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-pcre2-16 \
+       --enable-pcre2-32 
+
+MAKE_FLAGS += \
+       CFLAGS="$(TARGET_CFLAGS)"
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pcre2-config $(1)/usr/bin/
+
+       $(INSTALL_DIR) $(2)/bin
+       $(LN) $(STAGING_DIR)/usr/bin/pcre2-config $(2)/bin
+
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/pcre*.h $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre*.{a,so*} $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpcre*.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libpcre2/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre2-{8,posix}.so* $(1)/usr/lib/
+endef
+
+define Package/libpcre2-16/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre2-16.so* $(1)/usr/lib/
+endef
+
+define Package/libpcre2-32/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre2-32.so* $(1)/usr/lib/
+endef
+
+
+
+$(eval $(call BuildPackage,libpcre2))
+$(eval $(call BuildPackage,libpcre2-16))
+$(eval $(call BuildPackage,libpcre2-32))
diff --git a/libs/pixman/Makefile b/libs/pixman/Makefile
new file mode 100644 (file)
index 0000000..76f5d98
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2018 Yousong Zhou <yszhou4tech@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pixman
+PKG_VERSION:=0.34.0
+PKG_RELEASE:=1
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3997aa20a88e
+PKG_SOURCE_URL:=https://www.cairographics.org/releases
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+
+define Package/pixman
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=a low-level software library for pixel manipulation
+  URL:=http://www.pixman.org/
+endef
+
+define Package/pixman/description
+  Pixman is a low-level software library for pixel manipulation, providing
+  features such as image compositing and trapezoid rasterization. Important
+  users of pixman are the cairo graphics library and the X server.
+endef
+
+define Package/pixman/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpixman*.so* $(1)/usr/lib
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,pixman))
diff --git a/libs/pixman/patches/0004-pixman-fix-detection-of-mips-dspr2.patch b/libs/pixman/patches/0004-pixman-fix-detection-of-mips-dspr2.patch
new file mode 100644 (file)
index 0000000..1b37b02
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/configure.ac.orig        2016-11-22 20:44:21.205150763 +0800
++++ b/configure.ac     2016-11-22 20:44:55.505161500 +0800
+@@ -720,7 +720,6 @@ dnl Check if assembler is gas compatible
+ have_mips_dspr2=no
+ AC_MSG_CHECKING(whether to use MIPS DSPr2 assembler)
+ xserver_save_CFLAGS=$CFLAGS
+-CFLAGS="-mdspr2 $CFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #if !(defined(__mips__) &&  __mips_isa_rev >= 2)
diff --git a/libs/pixman/patches/0005-pixman-arm-neon-assembler-fix.patch b/libs/pixman/patches/0005-pixman-arm-neon-assembler-fix.patch
new file mode 100644 (file)
index 0000000..4adaab6
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/pixman/pixman-private.h.orig     2016-11-22 22:10:33.574769654 +0800
++++ b/pixman/pixman-private.h  2016-11-22 22:10:47.638774056 +0800
+@@ -1,5 +1,3 @@
+-#include <float.h>
+-
+ #ifndef PIXMAN_PRIVATE_H
+ #define PIXMAN_PRIVATE_H
+@@ -17,6 +15,8 @@
+ #ifndef __ASSEMBLER__
++#include <float.h>
++
+ #ifndef PACKAGE
+ #  error config.h must be included before pixman-private.h
+ #endif
index fd3eefcb9ea16037d07a3ac1a31b29bf6d8963fb..417f6fbc6006ac130e7cd48099973693336e577b 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://pocoproject.org/releases/$(PKG_NAME)-$(PKG_VERSION)
-PKG_MD5SUM:=17783e30f5ef9c852544ac0e9d1fd316c4804317026059a9d6aad798b61c77f8
+PKG_HASH:=17783e30f5ef9c852544ac0e9d1fd316c4804317026059a9d6aad798b61c77f8
 
 PKG_LICENSE:=BSL-1.0
 PKG_LICENSE_FILES:=LICENSE
index 05071468d243084ffd76ea9f055497330a134e6e..19932fb06f2af4f1804055014efb85014987f280 100644 (file)
@@ -1,6 +1,3 @@
-#
-# Copyright (C) 2006-2014 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -8,8 +5,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=postgresql
-PKG_VERSION:=9.5.4
-PKG_RELEASE:=4
+PKG_VERSION:=9.6.6
+PKG_RELEASE:=1
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=PostgreSQL
 
@@ -18,12 +15,14 @@ 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_HASH:=399cdffcb872f785ba67e25d275463d74521566318cfef8fe219050d063c8154
+
 PKG_USE_MIPS16:=0
 PKG_FIXUP:=autoreconf
 PKG_MACRO_PATHS:=config
-PKG_BUILD_DEPENDS += postgresql/host
+PKG_BUILD_DEPENDS += readline/host postgresql/host
+PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
@@ -81,6 +80,24 @@ define Package/pgsql-server/description
 PostgreSQL databases Server.
 endef
 
+PGSQL_SERVER_BIN := \
+       pg_archivecleanup \
+       pg_basebackup \
+       pg_controldata \
+       pg_ctl \
+       pg_dump \
+       pg_dumpall \
+       pg_isready \
+       pg_receivexlog \
+       pg_recvlogical \
+       pg_resetxlog \
+       pg_restore \
+       pg_standby \
+       pg_upgrade \
+       pg_xlogdump \
+       postgres \
+       initdb
+
 PGSQL_CLI_EXTRA_BIN := \
        clusterdb       \
        createdb        \
@@ -109,7 +126,7 @@ endif
 TARGET_CONFIGURE_OPTS+=$(PGSQL_CONFIG_VARS)
 
 HOST_CONFIGURE_ARGS += \
-                       $(DISABLE_NLS) \
+                       --disable-nls \
                        --disable-rpath \
                        --without-bonjour \
                        --without-gssapi \
@@ -124,6 +141,7 @@ HOST_CONFIGURE_ARGS += \
                        --enable-depend
 
 CONFIGURE_ARGS += \
+                       $(DISABLE_NLS) \
                        --disable-rpath \
                        --without-bonjour \
                        --without-gssapi \
@@ -137,16 +155,20 @@ CONFIGURE_ARGS += \
                        --enable-depend \
                        $(if $(CONFIG_TARGET_avr32),--disable-spinlocks)
 
-# Need a native ecpg ,pg_config, and zic for build
+EXTRA_CFLAGS:= -I$(PKG_BUILD_DIR)/src/include/
+
+# Need a native ecpg, pg_config and zic for build
 define Host/Compile
+       $(MAKE) -C $(HOST_BUILD_DIR)/src/bin/pg_config CC="$(HOSTCC)"
        $(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)/lib/
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/common/libpgcommon.a $(STAGING_DIR_HOSTPKG)/lib/
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/port/libpgport.a $(STAGING_DIR_HOSTPKG)/lib/
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/bin/pg_config/pg_config $(STAGING_DIR_HOSTPKG)/lib/
        $(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/
@@ -162,15 +184,6 @@ 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/
@@ -188,8 +201,8 @@ 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/
+       $(INSTALL_BIN) $(foreach bin,$(PGSQL_SERVER_BIN),$(PKG_INSTALL_DIR)/usr/bin/$(bin)) $(1)/usr/bin/
+
        ln -sf postgres $(1)/usr/bin/postmaster
 
        $(INSTALL_DIR) $(1)/usr/share/postgresql
@@ -212,6 +225,9 @@ endef
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(STAGING_DIR_HOSTPKG)/lib/pg_config $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/host/bin/
+       $(LN) $(STAGING_DIR)/usr/bin/pg_config $(1)/host/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/
@@ -222,6 +238,8 @@ define Build/InstallDev
        $(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/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpq.pc $(1)/usr/lib/pkgconfig/
 endef
 
 $(eval $(call HostBuild))
index 78b6ab84e9e408fc1ae57df25f5c3fbe7a8f0d4e..8d4e377a4a778f9e02f2ebc8900388121d809a2c 100644 (file)
@@ -26,30 +26,56 @@ pg_server_ready() {
        return 1
 }
 
-# $1: dbname, $2: username, $3: password
+
+pg_test_db() {
+       if [ "$3" ]; then
+               echo "SHOW ALL;" | env PGPASSWORD="$3" $PSQL -U "$2" -d "$1" -q 2>/dev/null >/dev/null
+               return $?
+       else
+               echo "SHOW ALL;" | $PSQL -w -U "$2" -d "$1" -q 2>/dev/null >/dev/null
+               return $?
+       fi
+}
+
+pg_include_sql() {
+       if [ "$3" ]; then
+               env PGPASSWORD="$3" $PSQL -U "$2" -d "$1" -e -f "$4"
+               return $?
+       else
+               $PSQL -w -U "$2" -d "$1" -e -f "$4"
+               return $?
+       fi
+}
+
+# $1: dbname, $2: username, $3: password, $4: sql populate script
 pg_require_db() {
+       local ret
+
        pg_test_db $@ && return 0
        ( echo "CREATE DATABASE $1;"
        echo -n "CREATE USER $2"
        [ "$3" ] && echo -n " WITH PASSWORD '$3'"
-       echo ";"
-       echo "GRANT ALL PRIVILEGES ON DATABASE \"$1\" to $2;" ) |
+       echo " NOCREATEDB NOSUPERUSER NOCREATEROLE NOINHERIT;"
+       echo "GRANT ALL PRIVILEGES ON DATABASE \"$1\" TO $2;" ) |
                $PSQL -U postgres -d template1 -e
-       return $?
-}
+       ret=$?
+       [ "$ret" = "0" ] || return $ret
 
-pg_test_db() {
-       PGPASSWORD=$3
-       echo "SHOW ALL;" | $PSQL -U $2 -d $1 -q 2>/dev/null >/dev/null
-       return $?
+       if [ "$4" ]; then
+               pg_include_sql "$@"
+               ret=$?
+       fi
+
+       return $ret
 }
 
 uci_require_db() {
-       local dbname dbuser dbpass
+       local dbname dbuser dbpass dbscript
        config_get dbname $1 name
        config_get dbuser $1 user
        config_get dbpass $1 pass
-       pg_require_db $dbname $dbuser $dbpass
+       config_get dbscript $1 script
+       pg_require_db "$dbname" "$dbuser" "$dbpass" "$dbscript"
 }
 
 [ "$1" = "init" ] && {
index bc0d2e15e10221eb23638dd73ba8fc176a183979..ece527cbe785d5e185c8fd56f86ab7fba6c41747 100644 (file)
@@ -2,7 +2,7 @@
 +++ b/configure.in
 @@ -25,7 +25,7 @@ recommended.  You can remove the check f
  your responsibility whether the result works or not.])])
- AC_COPYRIGHT([Copyright (c) 1996-2015, PostgreSQL Global Development Group])
+ AC_COPYRIGHT([Copyright (c) 1996-2016, PostgreSQL Global Development Group])
  AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
 -AC_CONFIG_AUX_DIR(config)
 +AC_CONFIG_AUX_DIR([config])
diff --git a/libs/postgresql/patches/050-build-contrib.patch b/libs/postgresql/patches/050-build-contrib.patch
new file mode 100644 (file)
index 0000000..b127cf0
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/GNUmakefile.in
++++ b/GNUmakefile.in
+@@ -8,7 +8,7 @@ subdir =
+ top_builddir = .
+ include $(top_builddir)/src/Makefile.global
+-$(call recurse,all install,src config)
++$(call recurse,all install,src config contrib)
+ all:
+       +@echo "All of PostgreSQL successfully made. Ready to install."
index 0c60867838c33893992643910c736663c5cdab83..f6af04ed826c62d102670544c239d0266e4591dd 100644 (file)
@@ -1,13 +1,14 @@
---- a/src/bin/psql/print.h
-+++ b/src/bin/psql/print.h
-@@ -197,10 +197,6 @@ extern void setDecimalLocale(void);
- extern const printTextFormat *get_line_style(const printTableOpt *opt);
- extern void refresh_utf8format(const printTableOpt *opt);
+--- a/src/include/fe_utils/print.h
++++ b/src/include/fe_utils/print.h
+@@ -17,11 +17,7 @@
  
+ /* This is not a particularly great place for this ... */
 -#ifndef __CYGWIN__
 -#define DEFAULT_PAGER "more"
 -#else
  #define DEFAULT_PAGER "less"
 -#endif
  
- #endif   /* PRINT_H */
+ enum printFormat
+ {
index f0bec3a13753259608610022b3979e793e590624..5a7003c93a71e81dec21af92fbe32aec6c09ddd0 100644 (file)
@@ -1,8 +1,6 @@
-Index: postgresql-9.5.4/src/bin/pg_ctl/pg_ctl.c
-===================================================================
---- postgresql-9.5.4.orig/src/bin/pg_ctl/pg_ctl.c
-+++ postgresql-9.5.4/src/bin/pg_ctl/pg_ctl.c
-@@ -95,6 +95,7 @@ static char *event_source = NULL;
+--- a/src/bin/pg_ctl/pg_ctl.c
++++ b/src/bin/pg_ctl/pg_ctl.c
+@@ -88,6 +88,7 @@ static char *event_source = NULL;
  static char *register_servicename = "PostgreSQL";             /* FIXME: + version ID? */
  static char *register_username = NULL;
  static char *register_password = NULL;
@@ -10,7 +8,7 @@ Index: postgresql-9.5.4/src/bin/pg_ctl/pg_ctl.c
  static char *argv0 = NULL;
  static bool allow_core_files = false;
  static time_t start_time;
-@@ -2114,6 +2115,9 @@ do_help(void)
+@@ -1930,6 +1931,9 @@ do_help(void)
  #endif
        printf(_("  -s, --silent           only print errors, no informational messages\n"));
        printf(_("  -t, --timeout=SECS     seconds to wait when using -w option\n"));
@@ -20,7 +18,7 @@ Index: postgresql-9.5.4/src/bin/pg_ctl/pg_ctl.c
        printf(_("  -V, --version          output version information, then exit\n"));
        printf(_("  -w                     wait until operation completes\n"));
        printf(_("  -W                     do not wait until operation completes\n"));
-@@ -2310,6 +2314,7 @@ main(int argc, char **argv)
+@@ -2126,6 +2130,7 @@ main(int argc, char **argv)
                {"pgdata", required_argument, NULL, 'D'},
                {"silent", no_argument, NULL, 's'},
                {"timeout", required_argument, NULL, 't'},
@@ -28,7 +26,7 @@ Index: postgresql-9.5.4/src/bin/pg_ctl/pg_ctl.c
                {"core-files", no_argument, NULL, 'c'},
                {NULL, 0, NULL, 0}
        };
-@@ -2350,20 +2355,6 @@ main(int argc, char **argv)
+@@ -2166,20 +2171,6 @@ main(int argc, char **argv)
                }
        }
  
@@ -49,7 +47,7 @@ Index: postgresql-9.5.4/src/bin/pg_ctl/pg_ctl.c
  
        env_wait = getenv("PGCTLTIMEOUT");
        if (env_wait != NULL)
-@@ -2449,11 +2440,15 @@ main(int argc, char **argv)
+@@ -2265,11 +2256,15 @@ main(int argc, char **argv)
                                        wait_seconds_arg = true;
                                        break;
                                case 'U':
@@ -65,7 +63,7 @@ Index: postgresql-9.5.4/src/bin/pg_ctl/pg_ctl.c
                                        break;
                                case 'w':
                                        do_wait = true;
-@@ -2535,6 +2530,41 @@ main(int argc, char **argv)
+@@ -2351,6 +2346,41 @@ main(int argc, char **argv)
                exit(1);
        }
  
index 16b2f2be326e4585955e416d7681ca9f7ec3e9ee..334d7d969e5cf3562ca419744be582e27cf8b74a 100644 (file)
@@ -12,6 +12,7 @@ PKG_VERSION:=v1.2.1
 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MIRROR_HASH:=2ebe48454fe454d118cf952655a24477c4bed892cee7ae085dc56d05ac711a8a
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=git://github.com/protobuf-c/protobuf-c.git
 PKG_SOURCE_PROTO:=git
index 93d538a0a1ab23434def51f4553b4906ddac5db4..2f25156bfd136fdb3c93540a813647c7e928bf6a 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=protobuf
-PKG_VERSION:=2.6.1
+PKG_VERSION:=3.3.0
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-cpp-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/google/protobuf/releases/download/v$(PKG_VERSION)
-PKG_MD5SUM:=11aaac2d704eef8efd1867a807865d85
+PKG_HASH:=578a2589bf9258adb03245dec5d624b61536867ebb732dbb8aeb30d96b0ada1f
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
@@ -30,9 +30,9 @@ define Package/protobuf
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE:=A structured data encoding library
-  URL:=http://code.google.com/p/protobuf/
+  URL:=https://github.com/google/protobuf
   DEPENDS:=+zlib +libpthread +libstdcpp
-  MAINTAINER:=Jacob Siverskog <jacob@teenageengineering.com>
+  MAINTAINER:=Per Sandström <per.j.sandstrom@gmail.com>
 endef
 
 define Package/protobuf/description
diff --git a/libs/protobuf/patches/001-mipseb-compile.patch b/libs/protobuf/patches/001-mipseb-compile.patch
deleted file mode 100644 (file)
index f576833..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- -  2015-05-19 16:27:29.770936016 +0200
-+++ protobuf-2.6.1/src/google/protobuf/stubs/platform_macros.h 2015-05-19 13:49:52.115444643 +0200
-@@ -55,7 +55,7 @@
- #elif defined(__aarch64__)
- #define GOOGLE_PROTOBUF_ARCH_AARCH64 1
- #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
--#elif defined(__MIPSEL__)
-+#elif defined(__MIPSEL__) || defined(__MIPSEB__)
- #if defined(__LP64__)
- #define GOOGLE_PROTOBUF_ARCH_MIPS64 1
- #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
diff --git a/libs/protobuf/patches/003-mips2andHigher-compile.patch b/libs/protobuf/patches/003-mips2andHigher-compile.patch
deleted file mode 100644 (file)
index df97928..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- -  2015-05-19 16:29:09.614344473 +0200
-+++ protobuf-2.6.1/src/google/protobuf/stubs/atomicops_internals_mips_gcc.h    2015-05-19 13:49:52.127442746 +0200
-@@ -150,7 +150,7 @@
- }
- inline void MemoryBarrier() {
--  __asm__ __volatile__("sync" : : : "memory");
-+  __asm__ __volatile__(".set mips2; sync; .set mips0" : : : "memory");
- }
- inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
diff --git a/libs/psqlodbc/Makefile b/libs/psqlodbc/Makefile
new file mode 100644 (file)
index 0000000..5092b87
--- /dev/null
@@ -0,0 +1,76 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=psqlodbc
+PKG_RELEASE:=1
+PKG_VERSION:=09.06.0310
+PKG_HASH:=6c42078af094d61baca2c8bd1dc4d137a77377198ef94e4eda5989bdce3474c3
+
+PKG_SOURCE_URL:=https://ftp.postgresql.org/pub/odbc/versions/src/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+
+PKG_LICENSE:=LGPL-2.0+
+PKG_LICENSE_FILES:=license.txt
+
+PKG_INSTALL:=1
+PKG_BUILD_DEPENDS:=unixodbc/host
+
+include $(INCLUDE_DIR)/package.mk
+
+CONFIGURE_ARGS += \
+       --with-unixodbc=$(STAGING_DIR)/usr \
+       --with-libpq=$(STAGING_DIR)/usr
+
+define Package/psqlodbc/Default
+  SUBMENU:=database
+  URL:=https://odbc.postgresql.org/
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Postgresql driver for ODBC
+  DEPENDS:=+unixodbc +libpq
+endef
+
+define Package/psqlodbca
+$(call Package/psqlodbc/Default)
+  TITLE:=psqlODBC - PostgreSQL ODBC driver (ASCII)
+endef
+
+define Package/psqlodbcw
+$(call Package/psqlodbc/Default)
+  TITLE:=psqlODBC - PostgreSQL ODBC driver (UTF-8)
+endef
+
+define Package/psqlodbca/description
+       psqlODBC is the official PostgreSQL ODBC Driver.
+       It is released under the Library General Public Licence, or LGPL.
+endef
+
+define Package/psqlodbcw/description
+$(call Package/psqlodbca/description)
+       (UTF-8 version)
+endef
+
+define Package/psqlodbca/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/psqlodbca.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/etc/odbcinst.ini.d
+       echo "[PostgreSQL ANSI]" > $(1)/etc/odbcinst.ini.d/psqlodbca.ini
+       echo "Description = PostgreSQL ODBC driver (ANSI version)" >> $(1)/etc/odbcinst.ini.d/psqlodbca.ini
+       echo "Driver = /usr/lib/psqlodbca.so" >> $(1)/etc/odbcinst.ini.d/psqlodbca.ini
+
+endef
+
+define Package/psqlodbcw/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/psqlodbcw.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/etc/odbcinst.ini.d
+       echo "[PostgreSQL Unicode]" > $(1)/etc/odbcinst.ini.d/psqlodbcw.ini
+       echo "Description = PostgreSQL ODBC driver (Unicode version)" >> $(1)/etc/odbcinst.ini.d/psqlodbcw.ini
+       echo "Driver = /usr/lib/psqlodbcw.so" >> $(1)/etc/odbcinst.ini.d/psqlodbcw.ini
+endef
+
+$(eval $(call BuildPackage,psqlodbca))
+$(eval $(call BuildPackage,psqlodbcw))
index 5d3effbba9b7485978a1f6927b7ab1d5d382215c..9ab8a09f6e9cb16257ea6923c3ec2a8ae2b5f483 100644 (file)
@@ -17,7 +17,7 @@ PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.auto.tuwien.ac.at/~mkoegler/pth/
-PKG_MD5SUM:=9144b26dcc27e67498d63dd5456f934c
+PKG_HASH:=4024cafdd5d4bce2b1778a6be5491222c3f6e7ef1e43971264c451c0012c5c01
 
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
diff --git a/libs/pthsem/patches/003-linux4x-fix.patch b/libs/pthsem/patches/003-linux4x-fix.patch
new file mode 100644 (file)
index 0000000..d8e4d17
--- /dev/null
@@ -0,0 +1,13 @@
+Index: pthsem-2.0.8/acinclude.m4
+===================================================================
+--- pthsem-2.0.8.orig/acinclude.m4
++++ pthsem-2.0.8/acinclude.m4
+@@ -894,6 +894,8 @@ changequote(, )dnl
+             x2.[23456789]* ) ;;
+ changequote(, )dnl
+             x3.* ) ;;
++changequote(, )dnl
++            x4.* ) ;;
+ changequote([, ])
+             * ) braindead=yes ;;
+         esac
index 37d39aac1312c66e3d99ded6cc6fb5865fcd427c..a6a4e2f256ae30449823379bfd5c889ce46cc145 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2012 OpenWrt.org
+# Copyright (C) 2006-2017 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:=qrencode
-PKG_VERSION:=3.4.4
-PKG_RELEASE:=2
+PKG_VERSION:=4.0.0
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://fukuchi.org/works/qrencode/
-PKG_MD5SUM:=be545f3ce36ea8fbb58612d72c4222de
+PKG_HASH:=c90035e16921117d4086a7fdee65aab85be32beb4a376f6b664b8a425d327d0b
 PKG_MAINTAINER:=Jonathan Bennett <JBennett@incomsystems.biz>
 PKG_LICENSE:=LGPL-2.1+
 PKG_INSTALL:=1
@@ -56,7 +56,8 @@ CONFIGURE_ARGS+= \
        --enable-static \
        --disable-rpath \
        --disable-sdltest \
-       --without-tests 
+       --without-tests \
+       --without-png
 
 TARGET_LDFLAGS+= -s
 
diff --git a/libs/qrencode/patches/001-add-inline-svg.patch b/libs/qrencode/patches/001-add-inline-svg.patch
new file mode 100644 (file)
index 0000000..02f7d2a
--- /dev/null
@@ -0,0 +1,67 @@
+From 7dd8a1b6f4efab84025c735195ad9d84f6477359 Mon Sep 17 00:00:00 2001
+From: Jonathan Bennett <JBennett@incomsystems.biz>
+Date: Mon, 16 Oct 2017 11:59:23 -0500
+Subject: [PATCH] Adds the --inline option, which omits the xml tag for SVG
+ output.
+
+---
+ qrenc.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/qrenc.c b/qrenc.c
+index ed83d8a..373352e 100644
+--- a/qrenc.c
++++ b/qrenc.c
+@@ -45,6 +45,7 @@ static int structured = 0;
+ static int rle = 0;
+ static int svg_path = 0;
+ static int micro = 0;
++static int inline_svg = 0;
+ static QRecLevel level = QR_ECLEVEL_L;
+ static QRencodeMode hint = QR_MODE_8;
+ static unsigned char fg_color[4] = {0, 0, 0, 255};
+@@ -80,6 +81,7 @@ static const struct option options[] = {
+       {"margin"       , required_argument, NULL, 'm'},
+       {"dpi"          , required_argument, NULL, 'd'},
+       {"type"         , required_argument, NULL, 't'},
++      {"inline"       , no_argument      , NULL, 'I'},
+       {"structured"   , no_argument      , NULL, 'S'},
+       {"kanji"        , no_argument      , NULL, 'k'},
+       {"casesensitive", no_argument      , NULL, 'c'},
+@@ -95,7 +97,7 @@ static const struct option options[] = {
+       {NULL, 0, NULL, 0}
+ };
+-static char *optstring = "ho:r:l:s:v:m:d:t:Skci8MV";
++static char *optstring = "ho:r:l:s:v:m:d:t:ISkci8MV";
+ static void usage(int help, int longopt, int status)
+ {
+@@ -132,6 +134,7 @@ static void usage(int help, int longopt, int status)
+ "  -t {PNG,PNG32,EPS,SVG,XPM,ANSI,ANSI256,ASCII,ASCIIi,UTF8,ANSIUTF8},\n"
+ "  --type={PNG,PNG32,EPS,SVG,XPM,ANSI,ANSI256,ASCII,ASCIIi,UTF8,ANSIUTF8}\n"
+ "               specify the type of the generated image. (default=PNG)\n\n"
++"  -I, --inline Only useful for SVG output, generates an svg without the XML tag\n"
+ "  -S, --structured\n"
+ "               make structured symbols. Version must be specified.\n\n"
+ "  -k, --kanji  assume that the input text contains kanji (shift-jis).\n\n"
+@@ -551,7 +554,8 @@ static int writeSVG(const QRcode *qrcode, const char *outfile)
+       bg_opacity = (float)bg_color[3] / 255;
+       /* XML declaration */
+-      fputs( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n", fp );
++      if (!inline_svg)
++              fputs( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n", fp );
+       /* DTD
+          No document type specified because "while a DTD is provided in [the SVG]
+@@ -1324,6 +1328,9 @@ int main(int argc, char **argv)
+                                       exit(EXIT_FAILURE);
+                               }
+                               break;
++                      case 'I':
++                              inline_svg = 1;
++                              break;
+                       case 'S':
+                               structured = 1;
+                               break;
diff --git a/libs/qrencode/patches/001-disable-png.patch b/libs/qrencode/patches/001-disable-png.patch
deleted file mode 100644 (file)
index 345bb60..0000000
+++ /dev/null
@@ -1,306 +0,0 @@
---- a/qrenc.c
-+++ b/qrenc.c
-@@ -25,7 +25,6 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
--#include <png.h>
- #include <getopt.h>
- #include "qrencode.h"
-@@ -49,7 +48,6 @@
- static int verbose = 0;
- enum imageType {
--      PNG_TYPE,
-       EPS_TYPE,
-       SVG_TYPE,
-       ANSI_TYPE,
-@@ -60,7 +58,7 @@
-       ANSIUTF8_TYPE
- };
--static enum imageType image_type = PNG_TYPE;
-+static enum imageType image_type = SVG_TYPE;
- static const struct option options[] = {
-       {"help"         , no_argument      , NULL, 'h'},
-@@ -96,13 +94,13 @@
-               if(longopt) {
-                       fprintf(stderr,
- "Usage: qrencode [OPTION]... [STRING]\n"
--"Encode input data in a QR Code and save as a PNG or EPS image.\n\n"
-+"Encode input data in a QR Code and save as a SVG or EPS image.\n\n"
- "  -h, --help   display the help message. -h displays only the help of short\n"
- "               options.\n\n"
- "  -o FILENAME, --output=FILENAME\n"
- "               write image to FILENAME. If '-' is specified, the result\n"
- "               will be output to standard output. If -S is given, structured\n"
--"               symbols are written to FILENAME-01.png, FILENAME-02.png, ...\n"
-+"               symbols are written to FILENAME-01.svg, FILENAME-02.svg, ...\n"
- "               (suffix is removed from FILENAME, if specified)\n"
- "  -s NUMBER, --size=NUMBER\n"
- "               specify module size in dots (pixels). (default=3)\n\n"
-@@ -116,9 +114,9 @@
- "               specify the width of the margins. (default=4 (2 for Micro QR)))\n\n"
- "  -d NUMBER, --dpi=NUMBER\n"
- "               specify the DPI of the generated PNG. (default=72)\n\n"
--"  -t {PNG,EPS,SVG,ANSI,ANSI256,ASCII,ASCIIi,UTF8,ANSIUTF8}, --type={PNG,EPS,\n"
-+"  -t {EPS,SVG,ANSI,ANSI256,ASCII,ASCIIi,UTF8,ANSIUTF8}, --type={EPS,\n"
- "               SVG,ANSI,ANSI256,ASCII,ASCIIi,UTF8,ANSIUTF8}\n"
--"               specify the type of the generated image. (default=PNG)\n\n"
-+"               specify the type of the generated image. (default=SVG)\n\n"
- "  -S, --structured\n"
- "               make structured symbols. Version must be specified.\n\n"
- "  -k, --kanji  assume that the input text contains kanji (shift-jis).\n\n"
-@@ -133,7 +131,7 @@
- "      --background=RRGGBB[AA]\n"
- "               specify foreground/background color in hexadecimal notation.\n"
- "               6-digit (RGB) or 8-digit (RGBA) form are supported.\n"
--"               Color output support available only in PNG and SVG.\n"
-+"               Color output support available only in SVG.\n"
- "  -V, --version\n"
- "               display the version number and copyrights of the qrencode.\n\n"
- "      --verbose\n"
-@@ -153,12 +151,12 @@
-               } else {
-                       fprintf(stderr,
- "Usage: qrencode [OPTION]... [STRING]\n"
--"Encode input data in a QR Code and save as a PNG or EPS image.\n\n"
-+"Encode input data in a QR Code and save as a SVG or EPS image.\n\n"
- "  -h           display this message.\n"
- "  --help       display the usage of long options.\n"
- "  -o FILENAME  write image to FILENAME. If '-' is specified, the result\n"
- "               will be output to standard output. If -S is given, structured\n"
--"               symbols are written to FILENAME-01.png, FILENAME-02.png, ...\n"
-+"               symbols are written to FILENAME-01.svg, FILENAME-02.svg, ...\n"
- "               (suffix is removed from FILENAME, if specified)\n"
- "  -s NUMBER    specify module size in dots (pixels). (default=3)\n"
- "  -l {LMQH}    specify error correction level from L (lowest) to H (highest).\n"
-@@ -166,8 +164,8 @@
- "  -v NUMBER    specify the version of the symbol. (default=auto)\n"
- "  -m NUMBER    specify the width of the margins. (default=4 (2 for Micro))\n"
- "  -d NUMBER    specify the DPI of the generated PNG. (default=72)\n"
--"  -t {PNG,EPS,SVG,ANSI,ANSI256,ASCII,ASCIIi,UTF8,ANSIUTF8}\n"
--"               specify the type of the generated image. (default=PNG)\n"
-+"  -t {EPS,SVG,ANSI,ANSI256,ASCII,ASCIIi,UTF8,ANSIUTF8}\n"
-+"               specify the type of the generated image. (default=SVG)\n"
- "  -S           make structured symbols. Version must be specified.\n"
- "  -k           assume that the input text contains kanji (shift-jis).\n"
- "  -c           encode lower-case alphabet characters in 8-bit mode. (default)\n"
-@@ -178,7 +176,7 @@
- "  --background=RRGGBB[AA]\n"
- "               specify foreground/background color in hexadecimal notation.\n"
- "               6-digit (RGB) or 8-digit (RGBA) form are supported.\n"
--"               Color output support available only in PNG and SVG.\n"
-+"               Color output support available only in SVG.\n"
- "  -V           display the version number and copyrights of the qrencode.\n"
- "  [STRING]     input data. If it is not specified, data will be taken from\n"
- "               standard input.\n"
-@@ -253,128 +251,6 @@
-       return fp;
- }
--static int writePNG(QRcode *qrcode, const char *outfile)
--{
--      static FILE *fp; // avoid clobbering by setjmp.
--      png_structp png_ptr;
--      png_infop info_ptr;
--      png_colorp palette;
--      png_byte alpha_values[2];
--      unsigned char *row, *p, *q;
--      int x, y, xx, yy, bit;
--      int realwidth;
--
--      realwidth = (qrcode->width + margin * 2) * size;
--      row = (unsigned char *)malloc((realwidth + 7) / 8);
--      if(row == NULL) {
--              fprintf(stderr, "Failed to allocate memory.\n");
--              exit(EXIT_FAILURE);
--      }
--
--      if(outfile[0] == '-' && outfile[1] == '\0') {
--              fp = stdout;
--      } else {
--              fp = fopen(outfile, "wb");
--              if(fp == NULL) {
--                      fprintf(stderr, "Failed to create file: %s\n", outfile);
--                      perror(NULL);
--                      exit(EXIT_FAILURE);
--              }
--      }
--
--      png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
--      if(png_ptr == NULL) {
--              fprintf(stderr, "Failed to initialize PNG writer.\n");
--              exit(EXIT_FAILURE);
--      }
--
--      info_ptr = png_create_info_struct(png_ptr);
--      if(info_ptr == NULL) {
--              fprintf(stderr, "Failed to initialize PNG write.\n");
--              exit(EXIT_FAILURE);
--      }
--
--      if(setjmp(png_jmpbuf(png_ptr))) {
--              png_destroy_write_struct(&png_ptr, &info_ptr);
--              fprintf(stderr, "Failed to write PNG image.\n");
--              exit(EXIT_FAILURE);
--      }
--
--      palette = (png_colorp) malloc(sizeof(png_color) * 2);
--      if(palette == NULL) {
--              fprintf(stderr, "Failed to allocate memory.\n");
--              exit(EXIT_FAILURE);
--      }
--      palette[0].red   = fg_color[0];
--      palette[0].green = fg_color[1];
--      palette[0].blue  = fg_color[2];
--      palette[1].red   = bg_color[0];
--      palette[1].green = bg_color[1];
--      palette[1].blue  = bg_color[2];
--      alpha_values[0] = fg_color[3];
--      alpha_values[1] = bg_color[3];
--      png_set_PLTE(png_ptr, info_ptr, palette, 2);
--      png_set_tRNS(png_ptr, info_ptr, alpha_values, 2, NULL);
--
--      png_init_io(png_ptr, fp);
--      png_set_IHDR(png_ptr, info_ptr,
--                      realwidth, realwidth,
--                      1,
--                      PNG_COLOR_TYPE_PALETTE,
--                      PNG_INTERLACE_NONE,
--                      PNG_COMPRESSION_TYPE_DEFAULT,
--                      PNG_FILTER_TYPE_DEFAULT);
--      png_set_pHYs(png_ptr, info_ptr,
--                      dpi * INCHES_PER_METER,
--                      dpi * INCHES_PER_METER,
--                      PNG_RESOLUTION_METER);
--      png_write_info(png_ptr, info_ptr);
--
--      /* top margin */
--      memset(row, 0xff, (realwidth + 7) / 8);
--      for(y=0; y<margin * size; y++) {
--              png_write_row(png_ptr, row);
--      }
--
--      /* data */
--      p = qrcode->data;
--      for(y=0; y<qrcode->width; y++) {
--              bit = 7;
--              memset(row, 0xff, (realwidth + 7) / 8);
--              q = row;
--              q += margin * size / 8;
--              bit = 7 - (margin * size % 8);
--              for(x=0; x<qrcode->width; x++) {
--                      for(xx=0; xx<size; xx++) {
--                              *q ^= (*p & 1) << bit;
--                              bit--;
--                              if(bit < 0) {
--                                      q++;
--                                      bit = 7;
--                              }
--                      }
--                      p++;
--              }
--              for(yy=0; yy<size; yy++) {
--                      png_write_row(png_ptr, row);
--              }
--      }
--      /* bottom margin */
--      memset(row, 0xff, (realwidth + 7) / 8);
--      for(y=0; y<margin * size; y++) {
--              png_write_row(png_ptr, row);
--      }
--
--      png_write_end(png_ptr, info_ptr);
--      png_destroy_write_struct(&png_ptr, &info_ptr);
--
--      fclose(fp);
--      free(row);
--      free(palette);
--
--      return 0;
--}
--
- static int writeEPS(QRcode *qrcode, const char *outfile)
- {
-       FILE *fp;
-@@ -831,9 +707,6 @@
-       }
-       switch(image_type) {
--              case PNG_TYPE:
--                      writePNG(qrcode, outfile);
--                      break;
-               case EPS_TYPE:
-                       writeEPS(qrcode, outfile);
-                       break;
-@@ -887,9 +760,6 @@
-       size_t suffix_size;
-       switch(image_type) {
--              case PNG_TYPE:
--                      type_suffix = ".png";
--                      break;
-               case EPS_TYPE:
-                       type_suffix = ".eps";
-                       break;
-@@ -948,9 +818,6 @@
-               }
-               switch(image_type) {
--                      case PNG_TYPE: 
--                              writePNG(p->code, filename);
--                              break;
-                       case EPS_TYPE: 
-                               writeEPS(p->code, filename);
-                               break;
-@@ -1062,9 +929,7 @@
-                               }
-                               break;
-                       case 't':
--                              if(strcasecmp(optarg, "png") == 0) {
--                                      image_type = PNG_TYPE;
--                              } else if(strcasecmp(optarg, "eps") == 0) {
-+                              if(strcasecmp(optarg, "eps") == 0) {
-                                       image_type = EPS_TYPE;
-                               } else if(strcasecmp(optarg, "svg") == 0) {
-                                       image_type = SVG_TYPE;
-@@ -1133,11 +998,6 @@
-               exit(EXIT_SUCCESS);
-       }
--      if(outfile == NULL && image_type == PNG_TYPE) {
--              fprintf(stderr, "No output filename is given.\n");
--              exit(EXIT_FAILURE);
--      }
--
-       if(optind < argc) {
-               intext = (unsigned char *)argv[optind];
-               length = strlen((char *)intext);
---- a/configure.ac
-+++ b/configure.ac
-@@ -58,9 +58,6 @@
-  [build_tools=$withval], [build_tools=yes])
- AM_CONDITIONAL(BUILD_TOOLS, [test "x$build_tools" = "xyes" ])
--if test x$build_tools = xyes ; then
--      PKG_CHECK_MODULES(png, "libpng")
--fi
- dnl --with-tests
- AC_ARG_WITH([tests], [AS_HELP_STRING([--with-tests], [build tests [default=no]])],
-@@ -80,12 +77,6 @@
- echo "/* #undef WITH_TESTS */" >>confdefs.h
- fi
--if test x$build_tests = xyes ; then
--      SDL_REQUIRED_VERSION=1.2.0
--      AM_PATH_SDL($SDL_REQUIRED_VERSION,,AC_MSG_WARN([*** SDL $SDL_REQUIRED_VERSION or better is required.]))
--      AC_MSG_NOTICE([SDL check done.])
--      AM_ICONV_LINK
--fi
- AM_CONDITIONAL(HAVE_SDL, [test "x$SDL_CFLAGS" != "x" ])
index 3f1d014f2ae5b79ea73d590de00717381b517a11..28d01c245718482b56fb46040af608382ab0487c 100644 (file)
@@ -21,6 +21,7 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/phhusson/QuasselC
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_MIRROR_HASH:=80ca463c20f934a3730fb51c69f5299e2d35ca53a06f0ca746d3de97dbfc360b
 
 PKG_MAINTAINER:=Ben Rosser <rosser.bjr@gmail.com>
 
old mode 100755 (executable)
new mode 100644 (file)
index 5a1374f..93abdb5
@@ -1,49 +1,49 @@
-#\r
-# Copyright (C) 2016 Dana H. Myers <k6jq@comcast.net>\r
-#\r
-# This is free software, licensed under the GNU General Public License v2.\r
-# See /LICENSE for more information.\r
-#\r
-\r
-include $(TOPDIR)/rules.mk\r
-\r
-PKG_NAME:=rxtx\r
-PKG_VERSION:=2.2pre2\r
-PKG_RELEASE:=1\r
-PKG_LICENSE:=LGPL-2.1\r
-PKG_MAINTAINER:=Dana H. Myers <k6jq@comcast.net>\r
-\r
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip\r
-PKG_SOURCE_URL:=http://rxtx.qbang.org/pub/rxtx/\r
-PKG_MD5SUM:=7eedb18e3f33a427e2b0e9be8ce3f94c\r
-\r
-PKG_FIXUP:=patch-libtool\r
-PKG_CHECK_FORMAT_SECURITY:=0\r
-\r
-include $(INCLUDE_DIR)/package.mk\r
-\r
-define Package/rxtx\r
-  SECTION:=libs\r
-  CATEGORY:=Libraries\r
-  TITLE:=RX/TX Support for Java serial communications\r
-  URL:=http://rxtx.qbang.org/wiki/index.php/Main_Page\r
-  DEPENDS:=+libpthread\r
-endef\r
-\r
-define Package/rxtx/description\r
-       RX/TX Support for Java serial communications\r
-endef\r
-\r
-CONFIGURE_ARGS += \\r
-       --disable-PRINTER\r
-\r
-define Package/rxtx/install\r
-       $(INSTALL_DIR) \\r
-               $(1)/usr/lib/classpath\r
-       $(CP) $(PKG_BUILD_DIR)/$(GNU_TARGET_NAME)-gnu/.libs/*.so \\r
-               $(1)/usr/lib/classpath/\r
-       $(CP) $(PKG_BUILD_DIR)/RXTXcomm.jar \\r
-               $(1)/usr/lib/classpath/\r
-endef\r
-\r
-$(eval $(call BuildPackage,rxtx))\r
+#
+# Copyright (C) 2016 Dana H. Myers <k6jq@comcast.net>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=rxtx
+PKG_VERSION:=2.2pre2
+PKG_RELEASE:=1
+PKG_LICENSE:=LGPL-2.1
+PKG_MAINTAINER:=Dana H. Myers <k6jq@comcast.net>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
+PKG_SOURCE_URL:=http://rxtx.qbang.org/pub/rxtx/
+PKG_HASH:=3c30373e760f444def3650c76c5a00ae12fb1d860ec008750d084f4880495b03
+
+PKG_FIXUP:=patch-libtool
+PKG_CHECK_FORMAT_SECURITY:=0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/rxtx
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=RX/TX Support for Java serial communications
+  URL:=http://rxtx.qbang.org/wiki/index.php/Main_Page
+  DEPENDS:=+libpthread
+endef
+
+define Package/rxtx/description
+       RX/TX Support for Java serial communications
+endef
+
+CONFIGURE_ARGS += \
+       --disable-PRINTER
+
+define Package/rxtx/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib/classpath
+       $(CP) $(PKG_BUILD_DIR)/$(GNU_TARGET_NAME)-gnu/.libs/*.so \
+               $(1)/usr/lib/classpath/
+       $(CP) $(PKG_BUILD_DIR)/RXTXcomm.jar \
+               $(1)/usr/lib/classpath/
+endef
+
+$(eval $(call BuildPackage,rxtx))
index cca54729d7f85e1ce4e8075bf13ca63b59f5f30d..b493e8d3f7d34ca84ba59390276f3e002858c8fe 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://www.kernel.org/pub/linux/bluetooth/
-PKG_MD5SUM:=2d8b7841f2c11ab287718d562f2b981c
+PKG_HASH:=e61022cf576f14190241e7071753fdacdce5d1dea89ffd704110fc50be689309
 
 PKG_LICENSE:=LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING.LIB
index 48522a5eb7bcd773e666d85db26a56931a0f8c9d..01538ebe1804c3f58754d0bb768ebf5b5331576d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,14 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=speex
-PKG_VERSION:=1.2rc1
+PKG_VERSION:=1.2.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/speex/
-PKG_MD5SUM:=c4438b22c08e5811ff10e2b06ee9b9ae
+PKG_HASH:=eaae8af0ac742dc7d542c9439ac72f1f385ce838392dc849cae4536af9210094
 
 PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -27,14 +28,6 @@ define Package/libspeex
   MAINTAINER:=Peter Wagner <tripolar@gmx.at>
 endef
 
-define Package/libspeexdsp
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=Open source speech compression codec library output to DSP
-  URL:=http://www.speex.org/
-  MAINTAINER:=Peter Wagner <tripolar@gmx.at>
-endef
-
 define Package/libspeex/description
        Open source patent-free speech compression codec library.
        Speex is an Open Source/Free Software patent-free audio compression
@@ -47,48 +40,13 @@ define Package/libspeex/description
        This package contains the shared codec library, needed by other programs.
 endef
 
-TARGET_CFLAGS += $(FPIC)
-
-define Package/libspeexdsp/description
-       Open source patent-free speech compression codec library.
-       Speex is an Open Source/Free Software patent-free audio compression
-       format designed for speech. The Speex Project aims to lower the
-       barrier of entry for voice applications by providing a free
-       alternative to expensive proprietary speech codecs. Moreover, Speex
-       is well-adapted to Internet applications and provides useful features
-       that are not present in most other codecs.
-
-       This package contains the shared dsp library, needed by other programs.
-endef
-
-define Build/Configure
-       $(call Build/Configure/Default, \
-               --enable-shared \
-               --enable-static \
-               --enable-fixed-point \
-               --disable-oggtest \
-               --disable-float-api \
-               --disable-vbr \
-               --with-ogg=$(STAGING_DIR)/usr \
-       )
-endef
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               bin_PROGRAMS="" \
-               all install
-endef
-
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/speex $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeex.{a,so*} $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeexdsp.{a,so*} $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/speex.pc $(1)/usr/lib/pkgconfig/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/speexdsp.pc $(1)/usr/lib/pkgconfig/
 endef
 
 define Package/libspeex/install
@@ -96,10 +54,12 @@ define Package/libspeex/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeex.so.* $(1)/usr/lib/
 endef
 
-define Package/libspeexdsp/install
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeexdsp.so.* $(1)/usr/lib/
-endef
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --disable-binaries \
+       $(if $(CONFIG_SOFT_FLOAT),--enable-fixed-point --disable-float-api --disable-vbr)
 
 $(eval $(call BuildPackage,libspeex))
-$(eval $(call BuildPackage,libspeexdsp))
diff --git a/libs/speexdsp/Makefile b/libs/speexdsp/Makefile
new file mode 100644 (file)
index 0000000..5b94e14
--- /dev/null
@@ -0,0 +1,66 @@
+#
+# 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:=speexdsp
+PKG_VERSION:=1.2rc3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/speex/
+PKG_HASH:=4ae688600039f5d224bdf2e222d2fbde65608447e4c2f681585e4dca6df692f1
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libspeexdsp
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Open source speech compression codec library output to DSP
+  URL:=http://www.speex.org/
+  MAINTAINER:=Peter Wagner <tripolar@gmx.at>
+endef
+
+define Package/libspeexdsp/description
+       Open source patent-free speech compression codec library.
+       Speex is an Open Source/Free Software patent-free audio compression
+       format designed for speech. The Speex Project aims to lower the
+       barrier of entry for voice applications by providing a free
+       alternative to expensive proprietary speech codecs. Moreover, Speex
+       is well-adapted to Internet applications and provides useful features
+       that are not present in most other codecs.
+
+       This package contains the shared dsp library, needed by other programs.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/speex $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeexdsp.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/speexdsp.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libspeexdsp/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeexdsp.so.* $(1)/usr/lib/
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --disable-examples \
+       $(if $(CONFIG_aarch64),--disable-neon) \
+       $(if $(CONFIG_SOFT_FLOAT),--enable-fixed-point --disable-float-api)
+
+$(eval $(call BuildPackage,libspeexdsp))
diff --git a/libs/sqlite3/Config.in b/libs/sqlite3/Config.in
new file mode 100644 (file)
index 0000000..8e8fa6e
--- /dev/null
@@ -0,0 +1,18 @@
+menu "Configuration"
+       depends on PACKAGE_libsqlite3
+
+config SQLITE_FTS3
+       bool
+       prompt  "Enable FTS3"
+       help
+               "Enable support for full-text search version 3"
+       default y
+
+config SQLITE_RTREE
+       bool
+       prompt  "Enable RTREE"
+       help
+               "Enable support for the R*Tree index extension"
+       default y
+
+endmenu
index 7f9b1b34ce940b8ba5b36c635d32f56a51457249..78228eb03c70a1bc5cc577f185471c584af5be56 100644 (file)
@@ -8,23 +8,26 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sqlite
-PKG_VERSION:=3160000
-PKG_RELEASE:=1
+PKG_VERSION:=3210000
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
+PKG_HASH:=d7dd516775005ad87a57f428b6f86afd206cb341722927f104d3f0cf65fbbbe3
 PKG_SOURCE_URL:=http://www.sqlite.org/2017/
-PKG_MD5SUM:=5102404047054b2cec2f43463293f94dea39425d42bf386d24596ab4fac7c7ff
 
 PKG_LICENSE:=PUBLICDOMAIN
 PKG_LICENSE_FILES:=
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-autoconf-$(PKG_VERSION)
-PKG_BUILD_DEPENDS:=libncurses libreadline
 
 PKG_FIXUP:=autoreconf
 
 PKG_INSTALL:=1
 
+PKG_CONFIG_DEPENDS := \
+       CONFIG_SQLITE_FTS3 \
+       CONFIG_SQLITE_RTREE
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/sqlite3/Default
@@ -53,6 +56,10 @@ $(call Package/sqlite3/Default/description)
  programs.
 endef
 
+define Package/libsqlite3/config
+  source "$(SOURCE)/Config.in"
+endef
+
 define Package/sqlite3-cli
   $(call Package/sqlite3/Default)
   SECTION:=utils
@@ -73,10 +80,19 @@ TARGET_CFLAGS += $(FPIC) \
        -DHAVE_ISNAN=1 \
        -DHAVE_MALLOC_USABLE_SIZE=1
 
+ifneq ($(CONFIG_SQLITE_FTS3),y)
+TARGET_CFLAGS += -USQLITE_ENABLE_FTS3
+endif
+
+ifneq ($(CONFIG_SQLITE_RTREE),y)
+TARGET_CFLAGS += -USQLITE_ENABLE_RTREE
+endif
+
 CONFIGURE_ARGS += \
        --enable-shared \
        --enable-static \
-       --disable-editline
+       --disable-editline \
+       --disable-static-shell
 
 CONFIGURE_VARS += \
        config_BUILD_CC="$(HOSTCC)" \
index d453031ec126fd111ecd7d01bbecee03fec0c402..ca9bfd266bb7d2db163e14b86708248919f29e66 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.porcupine.org/pub/security
-PKG_MD5SUM:=e6fa25f71226d090f34de3f6b122fb5a
+PKG_HASH:=9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d
 
 PKG_LICENSE:=BSD
 PKG_LICENE_FILES:=DISCLAIMER
index 2fce3dc6013b8fd2eb3df8e1fc557207086697e2..db6cd056fb53f4933ccfda9122fc42ce9b208120 100644 (file)
@@ -8,18 +8,22 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tdb
-PKG_VERSION:=1.0.6
+PKG_VERSION:=1.3.15
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-2.0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/tdb
-PKG_MD5SUM:=6b643fdeb48304010dcd5f675e458b58
+PKG_SOURCE_URL:=https://www.samba.org/ftp/tdb/
+PKG_HASH:=b4a1bf3833601bd9f10aff363cb750860aef9ce5b4617989239923192f946728
 
 PKG_INSTALL:=1
-PKG_BUILD_DEPENDS:=+libgdbm
 
 include $(INCLUDE_DIR)/package.mk
+# for $(LINUX_VERSION)
+include $(INCLUDE_DIR)/kernel.mk
+# for $(VERSION_DIST)
+include $(INCLUDE_DIR)/version.mk
+#include $(INCLUDE_DIR)/version.mk
 
 define Package/tdb
   SUBMENU:=database
@@ -28,7 +32,6 @@ define Package/tdb
   TITLE:=Trivial Database
   URL:=http://sourceforge.net/projects/tdb/
   MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
-#  DEPENDS:=+libgdbm
 endef
 
 define Package/tdb/description
@@ -45,9 +48,42 @@ define Build/InstallDev
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
 endef
 
+CONFIGURE_ARGS = \
+       --target=$(GNU_TARGET_NAME) \
+       --build=$(GNU_HOST_NAME) \
+       --cross-compile \
+       --cross-answers="$(PKG_BUILD_DIR)/cache.txt" \
+       --program-prefix="" \
+       --prefix=$(CONFIGURE_PREFIX) \
+       --exec-prefix=$(CONFIGURE_PREFIX) \
+       --bindir=$(CONFIGURE_PREFIX)/bin \
+       --sbindir=$(CONFIGURE_PREFIX)/sbin \
+       --libexecdir=$(CONFIGURE_PREFIX)/lib \
+       --sysconfdir=/etc \
+       --datadir=$(CONFIGURE_PREFIX)/share \
+       --localstatedir=/var \
+       --mandir=$(CONFIGURE_PREFIX)/man \
+       --infodir=$(CONFIGURE_PREFIX)/info \
+       $(DISABLE_IPV6)
+
+CONFIGURE_ARGS += \
+       --disable-python \
+       --disable-rpath \
+       --disable-rpath-install \
+       --disable-rpath-private-install
+
+define Build/Configure
+       $(CP) ./files/tdb.cache.txt $(PKG_BUILD_DIR)/cache.txt
+       echo -e "\nChecking uname sysname type: \"$(VERSION_DIST)\" \
+               \nChecking uname release type: \"$(LINUX_VERSION)-$(GNU_TARGET_NAME)\" \
+               \nChecking uname machine type: \"$(ARCH)\" \
+               \nChecking uname version type: \"$(VERSION_DIST) Linux-$(LINUX_VERSION) $(shell date +%Y-%m-%d)\"\n" >> $(PKG_BUILD_DIR)/cache.txt;
+       $(call Build/Configure/Default)
+endef
+
 define Package/tdb/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
 endef
diff --git a/libs/tdb/files/tdb.cache.txt b/libs/tdb/files/tdb.cache.txt
new file mode 100644 (file)
index 0000000..714d534
--- /dev/null
@@ -0,0 +1,36 @@
+Checking simple C program: OK
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking for large file support without additional flags: OK
+Checking for -D_LARGE_FILES: OK
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: OK
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_INCOHERENT_MMAP: NO
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking if can we convert from CP850 to UCS-2LE: OK
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+Checking whether we can use Linux thread-specific credentials with 32-bit system calls: OK
+Checking whether we can use Linux thread-specific credentials: OK
+Checking whether setreuid is available: OK
+Checking whether setresuid is available: OK
+Checking whether seteuid is available: OK
+Checking whether fcntl locking is available: OK
+Checking whether fcntl lock supports open file description locks: OK
+Checking for the maximum value of the 'time_t' type: OK
+Checking whether the realpath function allows a NULL argument: OK
+Checking whether POSIX capabilities are available: OK
+Checking for ftruncate extend: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+getcwd takes a NULL argument: OK
+Checking value of NSIG: "65"
+Checking value of _NSIG: "65"
+Checking value of SIGRTMAX: "64"
+Checking value of SIGRTMIN: "34"
diff --git a/libs/tdb/patches/001-printf-fix.patch b/libs/tdb/patches/001-printf-fix.patch
deleted file mode 100644 (file)
index f88d942..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/tdbtool.c        2001-12-11 06:45:47.000000000 +0300
-+++ b/tdbtool.c        2014-11-14 15:14:00.401164300 +0300
-@@ -169,23 +169,21 @@ static void print_data(unsigned char *bu
- static void help(void)
- {
--      printf("
--tdbtool: 
--  create    dbname     : create a database
--  open      dbname     : open an existing database
--  erase                : erase the database
--  dump      dumpname   : dump the database as strings
--  insert    key  data  : insert a record
--  store     key  data  : store a record (replace)
--  show      key        : show a record by key
--  delete    key        : delete a record by key
--  list                 : print the database hash table and freelist
--  free                 : print the database freelist
--  1 | first            : print the first record
--  n | next             : print the next record
--  q | quit             : terminate
--  \\n                   : repeat 'next' command
--");
-+      printf("tdbtool:\n");
-+      printf("  create    dbname     : create a database\n");
-+      printf("  open      dbname     : open an existing database\n");
-+      printf("  erase                : erase the database\n");
-+      printf("  dump      dumpname   : dump the database as strings\n");
-+      printf("  insert    key  data  : insert a record\n");
-+      printf("  store     key  data  : store a record (replace)\n");
-+      printf("  show      key        : show a record by key\n");
-+      printf("  delete    key        : delete a record by key\n");
-+      printf("  list                 : print the database hash table and freelist\n");
-+      printf("  free                 : print the database freelist\n");
-+      printf("  1 | first            : print the first record\n");
-+      printf("  n | next             : print the next record\n");
-+      printf("  q | quit             : terminate\n");
-+      printf("  \\n                   : repeat 'next' command\n\n");
- }
- static void terror(char *why)
index 7c8d18e6b362905d63446a915032bf2b0609ad24..1d38b7798dc4a984aefc969a81dbc67802dfe2ab 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2006-2018 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tiff
-PKG_VERSION:=4.0.6
-PKG_RELEASE:=2
+PKG_VERSION:=4.0.9
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://download.osgeo.org/libtiff
-PKG_MD5SUM:=d1d2e940dea0b5ad435f21f03d96dd72
+PKG_SOURCE_URL:=https://download.osgeo.org/libtiff
+PKG_HASH:=6e7bdeec2c310734e734d19aae3a71ebe37a4d842e0e23dbb1b8921c0026cfcd
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=autogen.sh aclocal.m4
@@ -59,44 +59,41 @@ $(call Package/tiff/Default)
   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 \
-       )
+CONFIGURE_ARGS += \
+       $(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
+
+define Build/InstallDev/hxx
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/*.hxx $(1)/usr/include/
 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/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+       $(if $(CONFIG_PACKAGE_libtiffxx), $(call Build/InstallDev/hxx,$(1)))
 endef
 
 define Package/libtiff/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtiff.so.* $(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/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtiffxx.so* $(1)/usr/lib/
 endef
 
 define Package/tiff-utils/install
index 16a88e3ef042914d544b907acbc1260a095337a5..b10286e06f0b06d820a9842c6ef3e3e1e30f37d1 100644 (file)
@@ -1,6 +1,5 @@
-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
+--- a/Makefile.am
++++ b/Makefile.am
 @@ -25,7 +25,7 @@
  
  docdir = $(LIBTIFF_DOCDIR)
@@ -19,9 +18,8 @@ diff -rupN tiff-4.0.6/Makefile.am tiff-new/Makefile.am
  
  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
+--- a/test/Makefile.am
++++ b/test/Makefile.am
 @@ -23,7 +23,7 @@
  
  # Process this file with automake to produce Makefile.in.
diff --git a/libs/tiff/patches/002-CVE-2015-8665_and_CVE-2015-8683.patch b/libs/tiff/patches/002-CVE-2015-8665_and_CVE-2015-8683.patch
deleted file mode 100644 (file)
index 15807e1..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-From f3f0cad770593eaef0766e5be896a6a034fc6313 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Sat, 26 Dec 2015 17:32:03 +0000
-Subject: [PATCH] * libtiff/tif_getimage.c: fix out-of-bound reads in
- TIFFRGBAImage interface in case of unsupported values of
- SamplesPerPixel/ExtraSamples for LogLUV / CIELab. Add explicit call to
- TIFFRGBAImageOK() in TIFFRGBAImageBegin(). Fix CVE-2015-8665 reported by
- limingxing and CVE-2015-8683 reported by zzf of Alibaba.
-
----
- ChangeLog              |  8 ++++++++
- libtiff/tif_getimage.c | 37 +++++++++++++++++++++++--------------
- 2 files changed, 31 insertions(+), 14 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index a7d283a..4beb30b 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,11 @@
-+2015-12-26  Even Rouault <even.rouault at spatialys.com>
-+
-+      * libtiff/tif_getimage.c: fix out-of-bound reads in TIFFRGBAImage
-+      interface in case of unsupported values of SamplesPerPixel/ExtraSamples
-+      for LogLUV / CIELab. Add explicit call to TIFFRGBAImageOK() in
-+      TIFFRGBAImageBegin(). Fix CVE-2015-8665 reported by limingxing and
-+      CVE-2015-8683 reported by zzf of Alibaba.
-+
- 2015-09-12  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
-       * libtiff 4.0.6 released.
-diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c
-index fd0a4f9..fae1e31 100644
---- a/libtiff/tif_getimage.c
-+++ b/libtiff/tif_getimage.c
-@@ -1,4 +1,4 @@
--/* $Id: tif_getimage.c,v 1.90 2015-06-17 01:34:08 bfriesen Exp $ */
-+/* $Id: tif_getimage.c,v 1.94 2015-12-26 17:32:03 erouault Exp $ */
- /*
-  * Copyright (c) 1991-1997 Sam Leffler
-@@ -182,20 +182,22 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
-                                   "Planarconfiguration", td->td_planarconfig);
-                               return (0);
-                       }
--                      if( td->td_samplesperpixel != 3 )
-+                      if( td->td_samplesperpixel != 3 || colorchannels != 3 )
-             {
-                 sprintf(emsg,
--                        "Sorry, can not handle image with %s=%d",
--                        "Samples/pixel", td->td_samplesperpixel);
-+                        "Sorry, can not handle image with %s=%d, %s=%d",
-+                        "Samples/pixel", td->td_samplesperpixel,
-+                        "colorchannels", colorchannels);
-                 return 0;
-             }
-                       break;
-               case PHOTOMETRIC_CIELAB:
--            if( td->td_samplesperpixel != 3 || td->td_bitspersample != 8 )
-+            if( td->td_samplesperpixel != 3 || colorchannels != 3 || td->td_bitspersample != 8 )
-             {
-                 sprintf(emsg,
--                        "Sorry, can not handle image with %s=%d and %s=%d",
-+                        "Sorry, can not handle image with %s=%d, %s=%d and %s=%d",
-                         "Samples/pixel", td->td_samplesperpixel,
-+                        "colorchannels", colorchannels,
-                         "Bits/sample", td->td_bitspersample);
-                 return 0;
-             }
-@@ -255,6 +257,9 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
-       int colorchannels;
-       uint16 *red_orig, *green_orig, *blue_orig;
-       int n_color;
-+      
-+      if( !TIFFRGBAImageOK(tif, emsg) )
-+              return 0;
-       /* Initialize to normal values */
-       img->row_offset = 0;
-@@ -2508,29 +2513,33 @@ PickContigCase(TIFFRGBAImage* img)
-               case PHOTOMETRIC_RGB:
-                       switch (img->bitspersample) {
-                               case 8:
--                                      if (img->alpha == EXTRASAMPLE_ASSOCALPHA)
-+                                      if (img->alpha == EXTRASAMPLE_ASSOCALPHA &&
-+                                              img->samplesperpixel >= 4)
-                                               img->put.contig = putRGBAAcontig8bittile;
--                                      else if (img->alpha == EXTRASAMPLE_UNASSALPHA)
-+                                      else if (img->alpha == EXTRASAMPLE_UNASSALPHA &&
-+                                                       img->samplesperpixel >= 4)
-                                       {
-                                               if (BuildMapUaToAa(img))
-                                                       img->put.contig = putRGBUAcontig8bittile;
-                                       }
--                                      else
-+                                      else if( img->samplesperpixel >= 3 )
-                                               img->put.contig = putRGBcontig8bittile;
-                                       break;
-                               case 16:
--                                      if (img->alpha == EXTRASAMPLE_ASSOCALPHA)
-+                                      if (img->alpha == EXTRASAMPLE_ASSOCALPHA &&
-+                                              img->samplesperpixel >=4 )
-                                       {
-                                               if (BuildMapBitdepth16To8(img))
-                                                       img->put.contig = putRGBAAcontig16bittile;
-                                       }
--                                      else if (img->alpha == EXTRASAMPLE_UNASSALPHA)
-+                                      else if (img->alpha == EXTRASAMPLE_UNASSALPHA &&
-+                                                       img->samplesperpixel >=4 )
-                                       {
-                                               if (BuildMapBitdepth16To8(img) &&
-                                                   BuildMapUaToAa(img))
-                                                       img->put.contig = putRGBUAcontig16bittile;
-                                       }
--                                      else
-+                                      else if( img->samplesperpixel >=3 )
-                                       {
-                                               if (BuildMapBitdepth16To8(img))
-                                                       img->put.contig = putRGBcontig16bittile;
-@@ -2539,7 +2548,7 @@ PickContigCase(TIFFRGBAImage* img)
-                       }
-                       break;
-               case PHOTOMETRIC_SEPARATED:
--                      if (buildMap(img)) {
-+                      if (img->samplesperpixel >=4 && buildMap(img)) {
-                               if (img->bitspersample == 8) {
-                                       if (!img->Map)
-                                               img->put.contig = putRGBcontig8bitCMYKtile;
-@@ -2635,7 +2644,7 @@ PickContigCase(TIFFRGBAImage* img)
-                       }
-                       break;
-               case PHOTOMETRIC_CIELAB:
--                      if (buildMap(img)) {
-+                      if (img->samplesperpixel == 3 && buildMap(img)) {
-                               if (img->bitspersample == 8)
-                                       img->put.contig = initCIELabConversion(img);
-                               break;
diff --git a/libs/tiff/patches/003-fix_potential_out-of-bound_writes_in_decode_functions.patch b/libs/tiff/patches/003-fix_potential_out-of-bound_writes_in_decode_functions.patch
deleted file mode 100644 (file)
index 716ddfd..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-From 3899f0ab62dd307f63f87ec99aaf289e104f4070 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Sun, 27 Dec 2015 16:25:11 +0000
-Subject: [PATCH] * libtiff/tif_luv.c: fix potential out-of-bound writes in
- decode functions in non debug builds by replacing assert()s by regular if
- checks (bugzilla #2522). Fix potential out-of-bound reads in case of short
- input data.
-
----
- ChangeLog         |  7 +++++++
- libtiff/tif_luv.c | 57 +++++++++++++++++++++++++++++++++++++++++++------------
- 2 files changed, 52 insertions(+), 12 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index 4beb30b..b8aa23c 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,10 @@
-+2015-12-27  Even Rouault <even.rouault at spatialys.com>
-+
-+      * libtiff/tif_luv.c: fix potential out-of-bound writes in decode
-+      functions in non debug builds by replacing assert()s by regular if
-+      checks (bugzilla #2522).
-+      Fix potential out-of-bound reads in case of short input data.
-+
- 2015-12-26  Even Rouault <even.rouault at spatialys.com>
-       * libtiff/tif_getimage.c: fix out-of-bound reads in TIFFRGBAImage
-diff --git a/libtiff/tif_luv.c b/libtiff/tif_luv.c
-index 4e328ba..60a174d 100644
---- a/libtiff/tif_luv.c
-+++ b/libtiff/tif_luv.c
-@@ -1,4 +1,4 @@
--/* $Id: tif_luv.c,v 1.40 2015-06-21 01:09:09 bfriesen Exp $ */
-+/* $Id: tif_luv.c,v 1.41 2015-12-27 16:25:11 erouault Exp $ */
- /*
-  * Copyright (c) 1997 Greg Ward Larson
-@@ -202,7 +202,11 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
-       if (sp->user_datafmt == SGILOGDATAFMT_16BIT)
-               tp = (int16*) op;
-       else {
--              assert(sp->tbuflen >= npixels);
-+              if(sp->tbuflen < npixels) {
-+                      TIFFErrorExt(tif->tif_clientdata, module,
-+                                               "Translation buffer too short");
-+                      return (0);
-+              }
-               tp = (int16*) sp->tbuf;
-       }
-       _TIFFmemset((void*) tp, 0, npixels*sizeof (tp[0]));
-@@ -211,9 +215,11 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
-       cc = tif->tif_rawcc;
-       /* get each byte string */
-       for (shft = 2*8; (shft -= 8) >= 0; ) {
--              for (i = 0; i < npixels && cc > 0; )
-+              for (i = 0; i < npixels && cc > 0; ) {
-                       if (*bp >= 128) {               /* run */
--                              rc = *bp++ + (2-128);   /* TODO: potential input buffer overrun when decoding corrupt or truncated data */
-+                              if( cc < 2 )
-+                                      break;
-+                              rc = *bp++ + (2-128);
-                               b = (int16)(*bp++ << shft);
-                               cc -= 2;
-                               while (rc-- && i < npixels)
-@@ -223,6 +229,7 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
-                               while (--cc && rc-- && i < npixels)
-                                       tp[i++] |= (int16)*bp++ << shft;
-                       }
-+              }
-               if (i != npixels) {
- #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
-                       TIFFErrorExt(tif->tif_clientdata, module,
-@@ -268,13 +275,17 @@ LogLuvDecode24(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
-       if (sp->user_datafmt == SGILOGDATAFMT_RAW)
-               tp = (uint32 *)op;
-       else {
--              assert(sp->tbuflen >= npixels);
-+              if(sp->tbuflen < npixels) {
-+                      TIFFErrorExt(tif->tif_clientdata, module,
-+                                               "Translation buffer too short");
-+                      return (0);
-+              }
-               tp = (uint32 *) sp->tbuf;
-       }
-       /* copy to array of uint32 */
-       bp = (unsigned char*) tif->tif_rawcp;
-       cc = tif->tif_rawcc;
--      for (i = 0; i < npixels && cc > 0; i++) {
-+      for (i = 0; i < npixels && cc >= 3; i++) {
-               tp[i] = bp[0] << 16 | bp[1] << 8 | bp[2];
-               bp += 3;
-               cc -= 3;
-@@ -325,7 +336,11 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
-       if (sp->user_datafmt == SGILOGDATAFMT_RAW)
-               tp = (uint32*) op;
-       else {
--              assert(sp->tbuflen >= npixels);
-+              if(sp->tbuflen < npixels) {
-+                      TIFFErrorExt(tif->tif_clientdata, module,
-+                                               "Translation buffer too short");
-+                      return (0);
-+              }
-               tp = (uint32*) sp->tbuf;
-       }
-       _TIFFmemset((void*) tp, 0, npixels*sizeof (tp[0]));
-@@ -334,11 +349,13 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
-       cc = tif->tif_rawcc;
-       /* get each byte string */
-       for (shft = 4*8; (shft -= 8) >= 0; ) {
--              for (i = 0; i < npixels && cc > 0; )
-+              for (i = 0; i < npixels && cc > 0; ) {
-                       if (*bp >= 128) {               /* run */
-+                              if( cc < 2 )
-+                                      break;
-                               rc = *bp++ + (2-128);
-                               b = (uint32)*bp++ << shft;
--                              cc -= 2;                /* TODO: potential input buffer overrun when decoding corrupt or truncated data */
-+                              cc -= 2;
-                               while (rc-- && i < npixels)
-                                       tp[i++] |= b;
-                       } else {                        /* non-run */
-@@ -346,6 +363,7 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
-                               while (--cc && rc-- && i < npixels)
-                                       tp[i++] |= (uint32)*bp++ << shft;
-                       }
-+              }
-               if (i != npixels) {
- #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
-                       TIFFErrorExt(tif->tif_clientdata, module,
-@@ -413,6 +431,7 @@ LogLuvDecodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- static int
- LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- {
-+      static const char module[] = "LogL16Encode";
-       LogLuvState* sp = EncoderState(tif);
-       int shft;
-       tmsize_t i;
-@@ -433,7 +452,11 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
-               tp = (int16*) bp;
-       else {
-               tp = (int16*) sp->tbuf;
--              assert(sp->tbuflen >= npixels);
-+              if(sp->tbuflen < npixels) {
-+                      TIFFErrorExt(tif->tif_clientdata, module,
-+                                               "Translation buffer too short");
-+                      return (0);
-+              }
-               (*sp->tfunc)(sp, bp, npixels);
-       }
-       /* compress each byte string */
-@@ -506,6 +529,7 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- static int
- LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- {
-+      static const char module[] = "LogLuvEncode24";
-       LogLuvState* sp = EncoderState(tif);
-       tmsize_t i;
-       tmsize_t npixels;
-@@ -521,7 +545,11 @@ LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
-               tp = (uint32*) bp;
-       else {
-               tp = (uint32*) sp->tbuf;
--              assert(sp->tbuflen >= npixels);
-+              if(sp->tbuflen < npixels) {
-+                      TIFFErrorExt(tif->tif_clientdata, module,
-+                                               "Translation buffer too short");
-+                      return (0);
-+              }
-               (*sp->tfunc)(sp, bp, npixels);
-       }
-       /* write out encoded pixels */
-@@ -553,6 +581,7 @@ LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- static int
- LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
- {
-+      static const char module[] = "LogLuvEncode32";
-       LogLuvState* sp = EncoderState(tif);
-       int shft;
-       tmsize_t i;
-@@ -574,7 +603,11 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
-               tp = (uint32*) bp;
-       else {
-               tp = (uint32*) sp->tbuf;
--              assert(sp->tbuflen >= npixels);
-+              if(sp->tbuflen < npixels) {
-+                      TIFFErrorExt(tif->tif_clientdata, module,
-+                                               "Translation buffer too short");
-+                      return (0);
-+              }
-               (*sp->tfunc)(sp, bp, npixels);
-       }
-       /* compress each byte string */
diff --git a/libs/tiff/patches/004-fix_potential_out-of-bound_write_in_NeXTDecode.patch b/libs/tiff/patches/004-fix_potential_out-of-bound_write_in_NeXTDecode.patch
deleted file mode 100644 (file)
index f2b6b31..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-From 237c9c18b0b3479950e54a755ae428bf0f55f754 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Sun, 27 Dec 2015 16:55:20 +0000
-Subject: [PATCH] * libtiff/tif_next.c: fix potential out-of-bound write in
- NeXTDecode() triggered by http://lcamtuf.coredump.cx/afl/vulns/libtiff5.tif
- (bugzilla #2508)
-
----
- ChangeLog          |  6 ++++++
- libtiff/tif_next.c | 12 +++++++++---
- 2 files changed, 15 insertions(+), 3 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index b8aa23c..04926a3 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,11 @@
- 2015-12-27  Even Rouault <even.rouault at spatialys.com>
-+      * libtiff/tif_next.c: fix potential out-of-bound write in NeXTDecode()
-+      triggered by http://lcamtuf.coredump.cx/afl/vulns/libtiff5.tif
-+      (bugzilla #2508)
-+
-+2015-12-27  Even Rouault <even.rouault at spatialys.com>
-+
-       * libtiff/tif_luv.c: fix potential out-of-bound writes in decode
-       functions in non debug builds by replacing assert()s by regular if
-       checks (bugzilla #2522).
-diff --git a/libtiff/tif_next.c b/libtiff/tif_next.c
-index 17e0311..1248caa 100644
---- a/libtiff/tif_next.c
-+++ b/libtiff/tif_next.c
-@@ -1,4 +1,4 @@
--/* $Id: tif_next.c,v 1.16 2014-12-29 12:09:11 erouault Exp $ */
-+/* $Id: tif_next.c,v 1.17 2015-12-27 16:55:20 erouault Exp $ */
- /*
-  * Copyright (c) 1988-1997 Sam Leffler
-@@ -37,7 +37,7 @@
-       case 0: op[0]  = (unsigned char) ((v) << 6); break;     \
-       case 1: op[0] |= (v) << 4; break;       \
-       case 2: op[0] |= (v) << 2; break;       \
--      case 3: *op++ |= (v);      break;       \
-+      case 3: *op++ |= (v);      op_offset++; break;  \
-       }                                       \
- }
-@@ -106,6 +106,7 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
-                       uint32 imagewidth = tif->tif_dir.td_imagewidth;
-             if( isTiled(tif) )
-                 imagewidth = tif->tif_dir.td_tilewidth;
-+            tmsize_t op_offset = 0;
-                       /*
-                        * The scanline is composed of a sequence of constant
-@@ -122,10 +123,15 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
-                                * bounds, potentially resulting in a security
-                                * issue.
-                                */
--                              while (n-- > 0 && npixels < imagewidth)
-+                              while (n-- > 0 && npixels < imagewidth && op_offset < scanline)
-                                       SETPIXEL(op, grey);
-                               if (npixels >= imagewidth)
-                                       break;
-+                if (op_offset >= scanline ) {
-+                    TIFFErrorExt(tif->tif_clientdata, module, "Invalid data for scanline %ld",
-+                        (long) tif->tif_row);
-+                    return (0);
-+                }
-                               if (cc == 0)
-                                       goto bad;
-                               n = *bp++, cc--;
index 6ab09323917a550bc8553dc5900dc2a330c14ea0..23e1e039a5c2a457337a1a492192d0a05bca309a 100644 (file)
@@ -1,6 +1,6 @@
 --- a/libtiff/tiffiop.h
 +++ b/libtiff/tiffiop.h
-@@ -284,7 +284,7 @@ struct tiff {
+@@ -287,7 +287,7 @@ struct tiff {
  */
  #if defined(HAVE_FSEEKO)
  #  define fseek(stream,offset,whence)  fseeko(stream,offset,whence)
diff --git a/libs/tiff/patches/019-CVE-2017-18013.patch b/libs/tiff/patches/019-CVE-2017-18013.patch
new file mode 100644 (file)
index 0000000..0be96fb
--- /dev/null
@@ -0,0 +1,29 @@
+From c6f41df7b581402dfba3c19a1e3df4454c551a01 Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Sun, 31 Dec 2017 15:09:41 +0100
+Subject: [PATCH] libtiff/tif_print.c: TIFFPrintDirectory(): fix null pointer dereference on corrupted file. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2770
+
+---
+ libtiff/tif_print.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/libtiff/tif_print.c
++++ b/libtiff/tif_print.c
+@@ -667,13 +667,13 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd,
+ #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
+                       fprintf(fd, "    %3lu: [%8I64u, %8I64u]\n",
+                           (unsigned long) s,
+-                          (unsigned __int64) td->td_stripoffset[s],
+-                          (unsigned __int64) td->td_stripbytecount[s]);
++                          td->td_stripoffset ? (unsigned __int64) td->td_stripoffset[s] : 0,
++                          td->td_stripbytecount ? (unsigned __int64) td->td_stripbytecount[s] : 0);
+ #else
+                       fprintf(fd, "    %3lu: [%8llu, %8llu]\n",
+                           (unsigned long) s,
+-                          (unsigned long long) td->td_stripoffset[s],
+-                          (unsigned long long) td->td_stripbytecount[s]);
++                          td->td_stripoffset ? (unsigned long long) td->td_stripoffset[s] : 0,
++                          td->td_stripbytecount ? (unsigned long long) td->td_stripbytecount[s] : 0);
+ #endif
+       }
+ }
diff --git a/libs/tiff/patches/020-CVE-2017-9935.patch b/libs/tiff/patches/020-CVE-2017-9935.patch
new file mode 100644 (file)
index 0000000..9fd76e9
--- /dev/null
@@ -0,0 +1,113 @@
+--- a/libtiff/tif_dir.c
++++ b/libtiff/tif_dir.c
+@@ -1067,6 +1067,9 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va
+                       if (td->td_samplesperpixel - td->td_extrasamples > 1) {
+                               *va_arg(ap, uint16**) = td->td_transferfunction[1];
+                               *va_arg(ap, uint16**) = td->td_transferfunction[2];
++                      } else {
++                              *va_arg(ap, uint16**) = NULL;
++                              *va_arg(ap, uint16**) = NULL;
+                       }
+                       break;
+               case TIFFTAG_REFERENCEBLACKWHITE:
+--- a/tools/tiff2pdf.c
++++ b/tools/tiff2pdf.c
+@@ -237,7 +237,7 @@ typedef struct {
+       float tiff_whitechromaticities[2];
+       float tiff_primarychromaticities[6];
+       float tiff_referenceblackwhite[2];
+-      float* tiff_transferfunction[3];
++      uint16* tiff_transferfunction[3];
+       int pdf_image_interpolate;      /* 0 (default) : do not interpolate,
+                                          1 : interpolate */
+       uint16 tiff_transferfunctioncount;
+@@ -1047,6 +1047,8 @@ void t2p_read_tiff_init(T2P* t2p, TIFF*
+       uint16 pagen=0;
+       uint16 paged=0;
+       uint16 xuint16=0;
++      uint16 tiff_transferfunctioncount=0;
++      uint16* tiff_transferfunction[3];
+       directorycount=TIFFNumberOfDirectories(input);
+       t2p->tiff_pages = (T2P_PAGE*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,directorycount,sizeof(T2P_PAGE)));
+@@ -1147,26 +1149,48 @@ void t2p_read_tiff_init(T2P* t2p, TIFF*
+                 }
+ #endif
+               if (TIFFGetField(input, TIFFTAG_TRANSFERFUNCTION,
+-                                 &(t2p->tiff_transferfunction[0]),
+-                                 &(t2p->tiff_transferfunction[1]),
+-                                 &(t2p->tiff_transferfunction[2]))) {
+-                      if((t2p->tiff_transferfunction[1] != (float*) NULL) &&
+-                           (t2p->tiff_transferfunction[2] != (float*) NULL) &&
+-                           (t2p->tiff_transferfunction[1] !=
+-                            t2p->tiff_transferfunction[0])) {
+-                              t2p->tiff_transferfunctioncount = 3;
+-                              t2p->tiff_pages[i].page_extra += 4;
+-                              t2p->pdf_xrefcount += 4;
+-                      } else {
+-                              t2p->tiff_transferfunctioncount = 1;
+-                              t2p->tiff_pages[i].page_extra += 2;
+-                              t2p->pdf_xrefcount += 2;
+-                      }
+-                      if(t2p->pdf_minorversion < 2)
+-                              t2p->pdf_minorversion = 2;
++                                 &(tiff_transferfunction[0]),
++                                 &(tiff_transferfunction[1]),
++                                 &(tiff_transferfunction[2]))) {
++
++                        if((tiff_transferfunction[1] != (uint16*) NULL) &&
++                           (tiff_transferfunction[2] != (uint16*) NULL)
++                          ) {
++                            tiff_transferfunctioncount=3;
++                        } else {
++                            tiff_transferfunctioncount=1;
++                        }
+                 } else {
+-                      t2p->tiff_transferfunctioncount=0;
++                      tiff_transferfunctioncount=0;
+               }
++
++                if (i > 0){
++                    if (tiff_transferfunctioncount != t2p->tiff_transferfunctioncount){
++                        TIFFError(
++                            TIFF2PDF_MODULE,
++                            "Different transfer function on page %d",
++                            i);
++                        t2p->t2p_error = T2P_ERR_ERROR;
++                        return;
++                    }
++                }
++
++                t2p->tiff_transferfunctioncount = tiff_transferfunctioncount;
++                t2p->tiff_transferfunction[0] = tiff_transferfunction[0];
++                t2p->tiff_transferfunction[1] = tiff_transferfunction[1];
++                t2p->tiff_transferfunction[2] = tiff_transferfunction[2];
++                if(tiff_transferfunctioncount == 3){
++                        t2p->tiff_pages[i].page_extra += 4;
++                        t2p->pdf_xrefcount += 4;
++                        if(t2p->pdf_minorversion < 2)
++                                t2p->pdf_minorversion = 2;
++                } else if (tiff_transferfunctioncount == 1){
++                        t2p->tiff_pages[i].page_extra += 2;
++                        t2p->pdf_xrefcount += 2;
++                        if(t2p->pdf_minorversion < 2)
++                                t2p->pdf_minorversion = 2;
++                }
++
+               if( TIFFGetField(
+                       input, 
+                       TIFFTAG_ICCPROFILE, 
+@@ -1827,10 +1851,9 @@ void t2p_read_tiff_data(T2P* t2p, TIFF*
+                        &(t2p->tiff_transferfunction[0]),
+                        &(t2p->tiff_transferfunction[1]),
+                        &(t2p->tiff_transferfunction[2]))) {
+-              if((t2p->tiff_transferfunction[1] != (float*) NULL) &&
+-                   (t2p->tiff_transferfunction[2] != (float*) NULL) &&
+-                   (t2p->tiff_transferfunction[1] !=
+-                    t2p->tiff_transferfunction[0])) {
++              if((t2p->tiff_transferfunction[1] != (uint16*) NULL) &&
++                   (t2p->tiff_transferfunction[2] != (uint16*) NULL)
++                  ) {
+                       t2p->tiff_transferfunctioncount=3;
+               } else {
+                       t2p->tiff_transferfunctioncount=1;
index 5288dea4910aea19792a328c67fd5245a04cd5e6..c633c62ab9e9eb063df9ed96504fcb6166a2cdf2 100644 (file)
@@ -11,7 +11,7 @@ PKG_NAME:=tinycdb
 PKG_RELEASE:=1
 PKG_SOURCE_URL:=http://www.corpit.ru/mjt/tinycdb/
 PKG_VERSION:=0.78
-PKG_MD5SUM:=976266afc3f6e7e17492a8d18f21f8f6
+PKG_HASH:=50678f432d8ada8d69f728ec11c3140e151813a7847cf30a62d86f3a720ed63c
 PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
 PKG_LICENSE:=NLPL
 
diff --git a/libs/udns/Makefile b/libs/udns/Makefile
new file mode 100644 (file)
index 0000000..6eb81ee
--- /dev/null
@@ -0,0 +1,74 @@
+#
+# Copyright (C) 2017 Yousong Zhou <yszhou4tech@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=udns
+PKG_VERSION:=0.4
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=115108dc791a2f9e99e150012bcb459d9095da2dd7d80699b584ac0ac3768710
+PKG_SOURCE_URL:=http://www.corpit.ru/mjt/udns
+PKG_LICENSE:=LGPL-2.1
+PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libudns
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=DNS Resolver Library
+  URL:=http://www.corpit.ru/mjt/udns.html
+endef
+
+define Package/libudns/description
+  UDNS is a stub DNS resolver library with ability to perform both syncronous
+  and asyncronous DNS queries.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib
+endef
+
+define Package/libudns/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libudns.so* $(1)/usr/lib/
+endef
+
+define udns-utility-template
+  define Package/udns-$(1)
+    SECTION:=utils
+    CATEGORY:=Utilities
+    TITLE:= $(2)
+    URL:=http://www.corpit.ru/mjt/udns.html
+    DEPENDS:=+libudns
+  endef
+
+  define Package/udns-$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/
+  endef
+
+endef
+
+CONFIGURE_ARGS += $(DISABLE_IPV6)
+
+$(eval $(call udns-utility-template,dnsget,a simple DNS query tool))
+$(eval $(call udns-utility-template,rblcheck,a simple DNSBL lookups tool))
+$(eval $(call udns-utility-template,ex-rdns,a parallel rDNS resolver))
+
+$(eval $(call BuildPackage,libudns))
+$(eval $(call BuildPackage,udns-dnsget))
+$(eval $(call BuildPackage,udns-rblcheck))
+$(eval $(call BuildPackage,udns-ex-rdns))
diff --git a/libs/udns/patches/0001-use-autotools.patch b/libs/udns/patches/0001-use-autotools.patch
new file mode 100644 (file)
index 0000000..5da20d8
--- /dev/null
@@ -0,0 +1,78 @@
+--- a/dev/null 2017-05-06 19:04:40.272000000 +0800
++++ b/configure.ac     2017-05-13 20:56:26.761460807 +0800
+@@ -0,0 +1,56 @@
++# Copyright 2016 Yousong Zhou
++
++AC_PREREQ([2.67])
++AC_INIT([libudns], [0.4])
++AC_CONFIG_HEADERS([config.h])
++
++AM_INIT_AUTOMAKE([foreign])
++LT_INIT
++
++dnl Checks for programs.
++AC_PROG_CC
++AC_PROG_INSTALL
++AC_PROG_LN_S
++AC_PROG_LIBTOOL
++
++dnl Checks for library functions.
++AC_CHECK_LIB(socket, connect)
++AC_CHECK_FUNCS([malloc memset socket])
++AC_CHECK_FUNCS([getopt poll])
++AC_CHECK_FUNCS([inet_pton inet_ntop],
++                         [AC_DEFINE([HAVE_INET_PTON_NTOP], [1], [Have inet_pton and inet_ntop])])
++
++AC_ARG_ENABLE(ipv6,
++  AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
++  [case "${enable_ipv6}" in
++    no)
++      AC_MSG_NOTICE([disabling IPv6 at user request])
++      ipv6=no
++      ;;
++    yes)
++      ipv6=yes
++        force_ipv6=yes
++      ;;
++    *)
++      AC_MSG_ERROR([Invalid --enable-ipv6 argument \`$enable_ipv6'])
++      ;;
++    esac
++  ], [
++    dnl If nothing is specified, assume auto-detection.
++    ipv6=yes
++      force_ipv6=no
++  ]
++)
++
++if test "x$ipv6" = "xyes"; then
++  AC_CHECK_TYPE([struct sockaddr_in6],
++    [AC_DEFINE([HAVE_IPv6], [1], [Have ipv6 support])],
++    [if test "x$force_ipv6" = "xyes"; then
++      AC_MSG_ERROR([ipv6 support requested but cannot be fulfilled])
++     fi],
++    [#include <sys/socket.h>
++     #include <netinet/in.h>])
++fi
++
++AC_CONFIG_FILES([Makefile])
++AC_OUTPUT
+--- a/dev/null 2016-01-04 02:31:18.900000000 +0800
++++ b/Makefile.am      2016-02-22 20:12:01.938987311 +0800
+@@ -0,0 +1,16 @@
++# Copyright 2016 Yousong Zhou
++
++lib_LTLIBRARIES=libudns.la
++libudns_la_SOURCES= udns_dn.c udns_dntosp.c udns_parse.c udns_resolver.c udns_init.c \
++      udns_misc.c udns_XtoX.c \
++      udns_rr_a.c udns_rr_ptr.c udns_rr_mx.c udns_rr_txt.c udns_bl.c \
++      udns_rr_srv.c udns_rr_naptr.c udns_codes.c udns_jran.c
++include_HEADERS= udns.h
++
++bin_PROGRAMS = dnsget rblcheck ex-rdns
++dnsget_SOURCES = dnsget.c
++rblcheck_SOURCES = rblcheck.c
++ex_rdns_SOURCES = ex-rdns.c
++dnsget_LDADD = $(top_builddir)/libudns.la
++rblcheck_LDADD = $(top_builddir)/libudns.la
++ex_rdns_LDADD = $(top_builddir)/libudns.la
index d962371baa3470f8bfc1d6453bc5beac8e6d9241..6a1ca0dffdd63e6addc9b7bcbe38b9759ea9be78 100644 (file)
@@ -9,20 +9,29 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=unixodbc
 PKG_VERSION:=2.3.4
-PKG_RELEASE:=2
+PKG_RELEASE:=5
 
 PKG_SOURCE_URL:=ftp://ftp.unixodbc.org/pub/unixODBC/
 PKG_SOURCE:=unixODBC-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=bd25d261ca1808c947cb687e2034be81
+PKG_HASH:=2e1509a96bb18d248bf08ead0d74804957304ff7c6f8b2e5965309c632421e39
 PKG_BUILD_DIR:=$(BUILD_DIR)/unixODBC-$(PKG_VERSION)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/unixODBC-$(PKG_VERSION)
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=prog GPL libs LGPL
+HOST_BUILD_DEPENDS:=unixodbc
+
+# if your other package depends on unixodbc and needs
+# odbc_config, add to your other Makefile
+#  PKG_BUILD_DEPENDS:=unixodbc/host
 
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
 CONFIGURE_ARGS += \
        --disable-gui \
        --with-pic \
-       --enable-drivers
+       --enable-drivers \
+       --includedir=$(STAGING_DIR)/usr/include
 
 define Package/unixodbc/Default
   SUBMENU:=database
@@ -81,10 +90,8 @@ define Build/Compile
 endef
 
 define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
        $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/$(STAGING_DIR)/usr/include/*.h $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/etc
@@ -98,20 +105,46 @@ define Package/unixodbc/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libodbc[ci]*so* $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libodbc.*so* $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnn*so* $(1)/usr/lib/
-       $(INSTALL_DIR) $(1)/etc
-       $(CP) $(PKG_INSTALL_DIR)/etc/odbc* $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/odbc.init $(1)/etc/init.d/odbc
+       $(LN) /tmp/etc/odbcinst.ini $(1)/etc/odbcinst.ini
 endef
 
 define Package/unixodbc-tools/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/{dltest,isql,iusql,odbcinst,slencheck} $(1)/usr/bin/
 endef
 
 define Package/pgsqlodbc/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libodbcpsql*so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/etc/odbcinst.ini.d/
+       echo "[PostgreSQL]" > $(1)/etc/odbcinst.ini.d/pgsqlodbc.ini
+       echo "Description = unixODBC PostgreSQL driver" >> $(1)/etc/odbcinst.ini.d/pgsqlodbc.ini
+       echo "Driver = /usr/lib/libodbcpsql.so" >> $(1)/etc/odbcinst.ini.d/pgsqlodbc.ini
+endef
+
+define Host/Configure
+       $(call Host/Configure/Default)
+       cp $(PKG_BUILD_DIR)/config.h $(HOST_BUILD_DIR)
+       cp $(PKG_BUILD_DIR)/unixodbc_conf.h $(HOST_BUILD_DIR)
+endef
+
+define Host/Compile
+       $(MAKE) -C $(HOST_BUILD_DIR)/exe \
+               DESTDIR="$(HOST_INSTALL_DIR)" \
+               CC="$(HOSTCC)" \
+               CFLAGS="$(HOST_CFLAGS) -DUSE_UNIXODBC_CONF_H" \
+               LDFLAGS="$(HOST_LDFLAGS)" \
+               odbc_config
+endef
+
+define Host/Install
+       $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
+       $(CP) $(HOST_BUILD_DIR)/exe/odbc_config $(STAGING_DIR_HOST)/bin
 endef
 
 $(eval $(call BuildPackage,unixodbc))
 $(eval $(call BuildPackage,unixodbc-tools))
 $(eval $(call BuildPackage,pgsqlodbc))
+$(eval $(call HostBuild))
diff --git a/libs/unixodbc/files/odbc.init b/libs/unixodbc/files/odbc.init
new file mode 100644 (file)
index 0000000..32ae7f8
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh /etc/rc.common
+
+START=50
+
+gen_odbcinst() {
+       local inifile
+
+       echo "[ODBC]"
+       echo "Trace = off"
+       echo "TraceFile ="
+
+       for inifile in /etc/odbcinst.ini.d/*.ini; do
+               cat "$inifile"
+       done
+}
+
+start() {
+       [ ! -d /tmp/etc ] && mkdir /tmp/etc
+
+       gen_odbcinst > /tmp/etc/odbcinst.ini.new
+       chmod 0644 /tmp/etc/odbcinst.ini.new
+
+       [ -e /tmp/etc/odbcinst.ini ] && ( rm /tmp/etc/odbcinst.ini || return 1 )
+
+       mv /tmp/etc/odbcinst.ini.new /tmp/etc/odbcinst.ini
+}
diff --git a/libs/unixodbc/patches/100-cross-compile-odbc-config.patch b/libs/unixodbc/patches/100-cross-compile-odbc-config.patch
new file mode 100644 (file)
index 0000000..4b952ae
--- /dev/null
@@ -0,0 +1,36 @@
+--- a/exe/odbc-config.c
++++ b/exe/odbc-config.c
+@@ -40,6 +40,33 @@
+ #include <unistd.h>
+ #endif
++#ifdef USE_UNIXODBC_CONF_H
++
++#ifdef HAVE_UNISTD_H
++#undef HAVE_UNISTD_H
++#endif
++#ifdef HAVE_PWD_H
++#undef HAVE_PWD_H
++#endif
++#ifdef HAVE_SYS_TYPES_H
++#undef HAVE_SYS_TYPES_H
++#endif
++#ifdef HAVE_LONG_LONG
++#undef HAVE_LONG_LONG
++#endif
++#ifdef ODBCINT64
++#undef ODBCINT64
++#endif
++#ifdef UODBCINT64
++#undef UODBCINT64
++#endif
++#ifdef SIZEOF_LONG_INT
++#undef SIZEOF_LONG_INT
++#endif
++
++#include <unixodbc_conf.h>
++#endif
++
+ #include <sql.h>
+ static void usage( void )
diff --git a/libs/uw-imap/Makefile b/libs/uw-imap/Makefile
new file mode 100644 (file)
index 0000000..9fe5509
--- /dev/null
@@ -0,0 +1,73 @@
+#
+# Copyright (C) 2017 Lucian Cristian <lucian.cristian@gmail.com>
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=uw-imap
+PKG_VERSION:=2007f
+PKG_RELEASE:=1
+
+PKG_SOURCE:=imap-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:= \
+       https://www.mirrorservice.org/sites/ftp.cac.washington.edu/imap \
+       http://ftp.ntua.gr/pub/net/mail/imap \
+       http://gd.tuwien.ac.at/infosys/mail/imap
+
+PKG_HASH:=53e15a2b5c1bc80161d42e9f69792a3fa18332b7b771910131004eb520004a28
+PKG_BUILD_DIR:=$(BUILD_DIR)/imap-$(PKG_VERSION)
+
+PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
+
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=LICENSE.txt
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/uw-imap
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=University of Washington IMAP toolkit
+  URL:=https://www.washington.edu/imap/
+  DEPENDS:=+libpthread +libopenssl
+endef
+
+define Package/uw-imap/description
+    The UW IMAP tookit includes the following:
+    c-lient library : an API (application programming interface) used to build email clients and servers,
+    including support for IMAP,POP3, SMTP and NNTP protocols and for local mailbox file access on Unix and Windows
+endef
+
+TARGET_CFLAGS += \
+       -fPIC -DPIC -D_REENTRANT -DDISABLE_POP_PROXY -fno-strict-aliasing -Wno-pointer-sign \
+       -Wno-implicit-function-declaration -Wno-incompatible-pointer-types
+
+MAKE_FLAGS += \
+       SSLINCLUDE=$(STAGING_DIR)/usr/include SSLCERTS=/etc/ssl/certs GCCOPTLEVEL=" -Os" \
+       SSLDIR=$(STAGING_DIR)/usr SHLIBNAME=libc-client.so.$(PKG_VERSION) $(if $(CONFIG_IPV6),IP=6,IP=4)
+
+define Build/Compile
+    $(MAKE) -C $(PKG_BUILD_DIR) slx EXTRACFLAGS='$(TARGET_CFLAGS)' CC='$(TARGET_CC)' $(MAKE_FLAGS)
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR)  $(1)/usr/lib \
+                       $(1)/usr/include/c-client
+       $(CP) $(PKG_BUILD_DIR)/c-client/libc-client.so.$(PKG_VERSION) $(1)/usr/lib/
+       $(LN) libc-client.so.$(PKG_VERSION) $(1)/usr/lib/libc-client.so
+       $(CP) $(PKG_BUILD_DIR)/c-client/linkage.h $(1)/usr/include/c-client/
+       $(CP) $(PKG_BUILD_DIR)/src/c-client/*.h $(1)/usr/include/c-client/
+       $(CP) $(PKG_BUILD_DIR)/src/osdep/unix/*.h $(1)/usr/include/c-client/
+       $(LN) os_slx.h $(1)/usr/include/c-client/osdep.h
+endef
+
+define Package/uw-imap/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/c-client/libc-client.so.$(PKG_VERSION) $(1)/usr/lib/
+       $(LN) libc-client.so.$(PKG_VERSION) $(1)/usr/lib/libc-client.so
+endef
+
+
+$(eval $(call BuildPackage,uw-imap))
diff --git a/libs/uw-imap/patches/001-fix_Makefiles_and_shlib.patch b/libs/uw-imap/patches/001-fix_Makefiles_and_shlib.patch
new file mode 100644 (file)
index 0000000..cf0cc7f
--- /dev/null
@@ -0,0 +1,167 @@
+--- a/Makefile 2017-11-13 01:13:36.340236114 +0200
++++ b/Makefile 2017-11-13 01:34:56.869682313 +0200
+@@ -638,10 +638,6 @@
+       @echo + yourself, try adding IP6=4 to the make command line.
+       @echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+       @echo
+-      @echo Do you want to build with IPv6 anyway?  Type y or n please:
+-      @$(SH) -c 'read x; case "$$x" in y) exit 0;; *) (make noip6;exit 1);; esac'
+-      @echo OK, I will remember that you really want to build with IPv6.
+-      @echo You will not see this message again.
+       @$(TOUCH) ip6
+ noip6:
+@@ -678,20 +674,18 @@
+       $(TOOLS)/$@ "$(LN)" src/tmail tmail
+       $(LN) $(TOOLS)/$@ .
+-build:        OSTYPE rebuild rebuildclean bundled
++build:        OSTYPE rebuild rebuildclean
+ OSTYPE:
+       @$(MAKE) ip$(IP)
+       @echo Building c-client for $(BUILDTYPE)...
+       @$(TOUCH) SPECIALS
+-      echo `$(CAT) SPECIALS` $(EXTRASPECIALS) > c-client/SPECIALS
+       $(CD) c-client;$(MAKE) $(BUILDTYPE) EXTRACFLAGS='$(EXTRACFLAGS)'\
+        EXTRALDFLAGS='$(EXTRALDFLAGS)'\
+        EXTRADRIVERS='$(EXTRADRIVERS)'\
+        EXTRAAUTHENTICATORS='$(EXTRAAUTHENTICATORS)'\
+        PASSWDTYPE=$(PASSWDTYPE) SSLTYPE=$(SSLTYPE) IP=$(IP)\
+-       $(SPECIALS) $(EXTRASPECIALS)
+-      echo $(BUILDTYPE) > OSTYPE
++       $(SPECIALS) $(EXTRASPECIALS) OSTYPE=$(BUILDTYPE)
+       $(TOUCH) rebuild
+ rebuild:
+--- a/src/osdep/unix/Makefile  2017-11-13 01:37:58.674011768 +0200
++++ b/src/osdep/unix/Makefile  2017-11-13 03:30:18.204908962 +0200
+@@ -96,11 +96,11 @@
+ LOGINPW=std
+ SIGTYPE=bsd
+ CRXTYPE=std
+-ACTIVEFILE=/usr/lib/news/active
+-SPOOLDIR=/usr/spool
++ACTIVEFILE=/var/lib/news/active
++SPOOLDIR=/var/spool
+ MAILSPOOL=$(SPOOLDIR)/mail
+ NEWSSPOOL=$(SPOOLDIR)/news
+-RSHPATH=/usr/ucb/rsh
++RSHPATH=/usr/bin/rsh
+ MD5PWD=/etc/cram-md5.pwd
+ # Tries one of the test alternatives below if not specified.
+ LOCKPGM=
+@@ -154,7 +154,7 @@
+  dummy.o pseudo.o netmsg.o flstring.o fdstring.o \
+  rfc822.o nntp.o smtp.o imap4r1.o pop3.o \
+  unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o mix.o
+-CFLAGS=-g
++CFLAGS=$(BASECFLAGS) $(EXTRACFLAGS) -DCHUNKSIZE=$(CHUNKSIZE)
+ CAT=cat
+ MAKE=make
+@@ -162,6 +162,16 @@
+ RM=rm -rf
+ SH=sh
++OSCFLAGS= $(SSLCFLAGS) \
++       -DCREATEPROTO=$(CREATEPROTO) -DEMPTYPROTO=$(EMPTYPROTO) \
++       -DMD5ENABLE=\"$(MD5PWD)\" -DMAILSPOOL=\"$(MAILSPOOL)\" \
++       -DANONYMOUSHOME=\"$(MAILSPOOL)/anonymous\" \
++       -DACTIVEFILE=\"$(ACTIVEFILE)\" -DNEWSSPOOL=\"$(NEWSSPOOL)\" \
++       -DRSHPATH=\"$(RSHPATH)\" -DLOCKPGM=\"$(LOCKPGM)\" \
++       -DLOCKPGM1=\"$(LOCKPGM1)\" -DLOCKPGM2=\"$(LOCKPGM2)\" \
++       -DLOCKPGM3=\"$(LOCKPGM3)\"
++
++LDFLAGS= $(BASELDFLAGS) $(EXTRALDFLAGS) $(SSLLDFLAGS)
+ # Primary build command
+@@ -174,7 +184,7 @@
+ # Here if no make argument established
+ missing: osdep.h
+-      $(MAKE) all `$(CAT) SPECIALS`
++      $(MAKE) all $(SPECIALS)
+ osdep.h:
+       @echo You must specify what type of system
+@@ -674,7 +684,7 @@
+       @echo You are building for libc6/glibc versions of Secure Linux
+       @echo If you want libc5 versions you must use sl5 instead!
+       @echo If you want libc4 versions you must use sl4 instead!
+-      $(BUILD) `$(CAT) SPECIALS` OS=$@ \
++      $(BUILD) $(SPECIALS) OS=$@ \
+        SIGTYPE=psx CHECKPW=psx CRXTYPE=nfs \
+        SPOOLDIR=/var/spool \
+        ACTIVEFILE=/var/lib/news/active \
+@@ -863,7 +873,7 @@
+       @$(SH) ARCHIVE
+ .c.o:
+-      `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c
++      $(CC) -c $(CFLAGS) $*.c
+ # Cleanup
+@@ -922,8 +932,8 @@
+       @echo If you get No such file error messages for files x509.h, ssl.h,
+       @echo pem.h, buffer.h, bio.h, and crypto.h, that means that OpenSSL
+       @echo is not installed on your system.  Either install OpenSSL first
+-      @echo or build with command: make `$(CAT) OSTYPE` SSLTYPE=none
+-      `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c
++      @echo or build with command: make $(OSTYPE) SSLTYPE=none
++      $(CC) -c $(CFLAGS) $(OSCFLAGS) -c osdep.c
+ osdep.c: osdepbas.c osdepckp.c osdeplog.c osdepssl.c
+       $(CAT) osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c
+@@ -962,21 +972,14 @@
+ # Once-only environment setup
+-once: onceenv ckp$(PASSWDTYPE) ssl$(SSLTYPE) osdep.c
++once: ssl$(SSLTYPE) onceenv ckp$(PASSWDTYPE) osdep.c
+ onceenv:
+       @echo Once-only environment setup...
+-      echo $(CC) > CCTYPE
+-      echo $(BASECFLAGS) '$(EXTRACFLAGS)' -DCHUNKSIZE=$(CHUNKSIZE) > CFLAGS
+-      echo -DCREATEPROTO=$(CREATEPROTO) -DEMPTYPROTO=$(EMPTYPROTO) \
+-       -DMD5ENABLE=\"$(MD5PWD)\" -DMAILSPOOL=\"$(MAILSPOOL)\" \
+-       -DANONYMOUSHOME=\"$(MAILSPOOL)/anonymous\" \
+-       -DACTIVEFILE=\"$(ACTIVEFILE)\" -DNEWSSPOOL=\"$(NEWSSPOOL)\" \
+-       -DRSHPATH=\"$(RSHPATH)\" -DLOCKPGM=\"$(LOCKPGM)\" \
+-       -DLOCKPGM1=\"$(LOCKPGM1)\" -DLOCKPGM2=\"$(LOCKPGM2)\" \
+-       -DLOCKPGM3=\"$(LOCKPGM3)\" > OSCFLAGS
+-      echo $(BASELDFLAGS) $(EXTRALDFLAGS) > LDFLAGS
+       echo "$(ARRC) $(ARCHIVE) $(BINARIES);$(RANLIB) $(ARCHIVE)" > ARCHIVE
++      echo "$(OSCFLAGS)" > OSCFLAGS
++      echo "$(CC) $(CFLAGS) $(OSCFLAGS) -shared  -Wl,-soname,libc-client.so \
++      -o $(SHLIBNAME) $(BINARIES) $(LDFLAGS)" >> ARCHIVE
+       echo $(OS) > OSTYPE
+       ./drivers $(EXTRADRIVERS) $(DEFAULTDRIVERS) dummy
+       ./mkauths $(EXTRAAUTHENTICATORS) $(DEFAULTAUTHENTICATORS)
+@@ -1055,7 +1058,6 @@
+ sbasic:       # UNIX OpenSSL
+       @echo Building with SSL
+       $(LN) ssl_unix.c osdepssl.c
+-      echo $(SSLCFLAGS) >> OSCFLAGS
+       echo "  ssl_onceonlyinit ();" >> linkage.c
+ snopwd:       # Plaintext disable
+@@ -1063,13 +1065,12 @@
+       echo "  mail_parameters (NIL,SET_DISABLEPLAINTEXT,(void *) 2);" >> linkage.c
+ sldunix:# Normal UNIX SSL load flags
+-      echo $(SSLLDFLAGS) >> LDFLAGS
++      @echo Normal UNIX SSL load flags
+ sldsco:       # SCO SSL load flags
+ # Note: Tim Rice says that SSL has to be lunk before other libraries on SCO.
+-      echo $(SSLLDFLAGS) `cat LDFLAGS` > LDFLAGS.tmp
+-      mv LDFLAGS.tmp LDFLAGS
++      @echo SCO SSL load flags
+ # A monument to a hack of long ago and far away...
diff --git a/libs/uw-imap/patches/002-imap-2004a-doc.patch b/libs/uw-imap/patches/002-imap-2004a-doc.patch
new file mode 100644 (file)
index 0000000..dcae4ab
--- /dev/null
@@ -0,0 +1,30 @@
+Patch by Robert Scheck <redhat@linuxnetz.de> for uw-imap >= 2004a, which corrects
+paths to imapd, ipop2d and ipop3d in the man pages. 
+
+This patch is based on Red Hat Bugzilla ID #127271 and solves ID #229781.
+
+--- imap-2004a/src/imapd/imapd.8               2004-05-18 19:46:54.000000000 +0200
++++ imap-2004a/src/imapd/imapd.8.doc           2004-07-23 15:24:17.000000000 +0200
+@@ -3,7 +3,7 @@
+ .SH NAME
+ IMAPd \- Internet Message Access Protocol server
+ .SH SYNOPSIS
+-.B /usr/etc/imapd
++.B /usr/sbin/imapd
+ .SH DESCRIPTION
+ .I imapd
+ is a server which supports the
+--- imap-2004a/src/ipopd/ipopd.8               2004-05-18 19:50:05.000000000 +0200
++++ imap-2004a/src/ipopd/ipopd.8.doc           2004-07-23 15:23:38.000000000 +0200
+@@ -3,9 +3,9 @@
+ .SH NAME
+ IPOPd \- Post Office Protocol server
+ .SH SYNOPSIS
+-.B /usr/etc/ipop2d
++.B /usr/sbin/ipop2d
+ .PP
+-.B /usr/etc/ipop3d
++.B /usr/sbin/ipop3d
+ .SH DESCRIPTION
+ .I ipop2d
+ and
diff --git a/libs/uw-imap/patches/003-imap-2007e-overflow.patch b/libs/uw-imap/patches/003-imap-2007e-overflow.patch
new file mode 100644 (file)
index 0000000..86512b2
--- /dev/null
@@ -0,0 +1,13 @@
+diff -up imap-2007e/src/c-client/rfc822.c.overflow imap-2007e/src/c-client/rfc822.c
+--- imap-2007e/src/c-client/rfc822.c.overflow  2008-12-12 11:08:26.000000000 -0600
++++ imap-2007e/src/c-client/rfc822.c   2009-07-07 19:27:20.057772757 -0500
+@@ -384,6 +384,9 @@ void rfc822_parse_content (BODY *body,ST
+       if (CHR (bs) == '\012'){/* following LF? */
+         c = SNX (bs); i--;    /* yes, slurp it */
+       }
++      if (!i)                 /* Make sure we don't get an overflow for */
++        break;                /* messages ending on \015 (or the following */
++                              /* i-- will cause i to be MAXINT. Not good.) */
+       case '\012':            /* at start of a line, start with -- ? */
+       if (!(i && i-- && ((c = SNX (bs)) == '-') && i-- &&
+             ((c = SNX (bs)) == '-'))) break;
diff --git a/libs/uw-imap/patches/005-imap-2007e-authmd5.patch b/libs/uw-imap/patches/005-imap-2007e-authmd5.patch
new file mode 100644 (file)
index 0000000..66883a1
--- /dev/null
@@ -0,0 +1,29 @@
+diff -up imap-2007e/src/c-client/auth_md5.c.authmd5 imap-2007e/src/c-client/auth_md5.c
+--- imap-2007e/src/c-client/auth_md5.c.authmd5 2008-06-04 13:18:34.000000000 -0500
++++ imap-2007e/src/c-client/auth_md5.c 2009-07-07 19:24:12.348005485 -0500
+@@ -42,17 +42,17 @@ typedef struct {
+ /* Prototypes */
+-long auth_md5_valid (void);
+-long auth_md5_client (authchallenge_t challenger,authrespond_t responder,
++static long auth_md5_valid (void);
++static long auth_md5_client (authchallenge_t challenger,authrespond_t responder,
+                     char *service,NETMBX *mb,void *stream,
+                     unsigned long *trial,char *user);
+-char *auth_md5_server (authresponse_t responder,int argc,char *argv[]);
+-char *auth_md5_pwd (char *user);
++static char *auth_md5_server (authresponse_t responder,int argc,char *argv[]);
++static char *auth_md5_pwd (char *user);
+ char *apop_login (char *chal,char *user,char *md5,int argc,char *argv[]);
+-char *hmac_md5 (char *text,unsigned long tl,char *key,unsigned long kl);
+-void md5_init (MD5CONTEXT *ctx);
+-void md5_update (MD5CONTEXT *ctx,unsigned char *data,unsigned long len);
+-void md5_final (unsigned char *digest,MD5CONTEXT *ctx);
++static char *hmac_md5 (char *text,unsigned long tl,char *key,unsigned long kl);
++static void md5_init (MD5CONTEXT *ctx);
++static void md5_update (MD5CONTEXT *ctx,unsigned char *data,unsigned long len);
++static void md5_final (unsigned char *digest,MD5CONTEXT *ctx);
+ static void md5_transform (unsigned long *state,unsigned char *block);
+ static void md5_encode (unsigned char *dst,unsigned long *src,int len);
+ static void md5_decode (unsigned long *dst,unsigned char *src,int len);
diff --git a/libs/uw-imap/patches/006-imap-2007f-format-security.patch b/libs/uw-imap/patches/006-imap-2007f-format-security.patch
new file mode 100644 (file)
index 0000000..244153e
--- /dev/null
@@ -0,0 +1,12 @@
+diff -Naur imap-2007f.orig/src/osdep/unix/flocklnx.c imap-2007f/src/osdep/unix/flocklnx.c
+--- imap-2007f.orig/src/osdep/unix/flocklnx.c  2011-07-23 02:20:11.000000000 +0200
++++ imap-2007f/src/osdep/unix/flocklnx.c       2014-04-14 19:17:46.429000000 +0200
+@@ -57,7 +57,7 @@
+     case ENOLCK:              /* lock table is full */
+       sprintf (tmp,"File locking failure: %s",strerror (errno));
+       mm_log (tmp,WARN);      /* give the user a warning of what happened */
+-      if (!logged++) syslog (LOG_ERR,tmp);
++      if (!logged++) syslog (LOG_ERR, "%s", tmp);
+                               /* return failure if non-blocking lock */
+       if (op & LOCK_NB) return -1;
+       sleep (5);              /* slow down in case it loops */
diff --git a/libs/uw-imap/patches/007-imap-2007e-poll.patch b/libs/uw-imap/patches/007-imap-2007e-poll.patch
new file mode 100644 (file)
index 0000000..e25f1b6
--- /dev/null
@@ -0,0 +1,192 @@
+http://anonscm.debian.org/cgit/collab-maint/uw-imap.git/plain/debian/patches/1005_poll.patch
+
+Description: Use poll(2) instead of select(2) to support more than 1024 file descriptors
+Author: Ben Smithurst <ben.smithurst@gradwell.com>
+Bug-Debian: https://bugs.debian.org/478193
+
+diff --git a/src/osdep/unix/os_lnx.c b/src/osdep/unix/os_lnx.c
+index 03fd17d..671bbd6 100644
+--- a/src/osdep/unix/os_lnx.c
++++ b/src/osdep/unix/os_lnx.c
+@@ -41,6 +41,7 @@
+ extern int errno;             /* just in case */
+ #include <pwd.h>
+ #include "misc.h"
++#include <poll.h>
+ #include "fs_unix.c"
+diff --git a/src/osdep/unix/os_slx.c b/src/osdep/unix/os_slx.c
+index c94d632..f6bf27d 100644
+--- a/src/osdep/unix/os_slx.c
++++ b/src/osdep/unix/os_slx.c
+@@ -42,6 +42,7 @@ extern int errno;            /* just in case */
+ #include <pwd.h>
+ #include <shadow.h>
+ #include "misc.h"
++#include <poll.h>
+ #include "fs_unix.c"
+diff --git a/src/osdep/unix/tcp_unix.c b/src/osdep/unix/tcp_unix.c
+index 795fb4f..c69eaec 100644
+--- a/src/osdep/unix/tcp_unix.c
++++ b/src/osdep/unix/tcp_unix.c
+@@ -235,12 +235,11 @@ TCPSTREAM *tcp_open (char *host,char *service,unsigned long port)
+ int tcp_socket_open (int family,void *adr,size_t adrlen,unsigned short port,
+                    char *tmp,int *ctr,char *hst)
+ {
+-  int i,ti,sock,flgs;
++  int i,ti,sock,flgs,tmo;
++  struct pollfd pfd;
+   size_t len;
+   time_t now;
+   struct protoent *pt = getprotobyname ("tcp");
+-  fd_set rfds,wfds,efds;
+-  struct timeval tmo;
+   struct sockaddr *sadr = ip_sockaddr (family,adr,adrlen,port,&len);
+   blocknotify_t bn = (blocknotify_t) mail_parameters (NIL,GET_BLOCKNOTIFY,NIL);
+                               /* fetid Solaris */
+@@ -252,14 +251,6 @@ int tcp_socket_open (int family,void *adr,size_t adrlen,unsigned short port,
+     sprintf (tmp,"Unable to create TCP socket: %s",strerror (errno));
+     (*bn) (BLOCK_NONSENSITIVE,data);
+   }
+-  else if (sock >= FD_SETSIZE) {/* unselectable sockets are useless */
+-    sprintf (tmp,"Unable to create selectable TCP socket (%d >= %d)",
+-           sock,FD_SETSIZE);
+-    (*bn) (BLOCK_NONSENSITIVE,data);
+-    close (sock);
+-    sock = -1;
+-    errno = EMFILE;
+-  }
\f
+   else {                      /* get current socket flags */
+     flgs = fcntl (sock,F_GETFL,0);
+@@ -284,16 +275,11 @@ int tcp_socket_open (int family,void *adr,size_t adrlen,unsigned short port,
+     if ((sock >= 0) && ctr) { /* want open timeout? */
+       now = time (0);         /* open timeout */
+       ti = ttmo_open ? now + ttmo_open : 0;
+-      tmo.tv_usec = 0;
+-      FD_ZERO (&rfds);                /* initialize selection vector */
+-      FD_ZERO (&wfds);                /* initialize selection vector */
+-      FD_ZERO (&efds);                /* handle errors too */
+-      FD_SET (sock,&rfds);    /* block for error or readable or writable */
+-      FD_SET (sock,&wfds);
+-      FD_SET (sock,&efds);
++      pfd.fd = sock;
++      pfd.events = POLLIN | POLLOUT;
+       do {                    /* block under timeout */
+-      tmo.tv_sec = ti ? ti - now : 0;
+-      i = select (sock+1,&rfds,&wfds,&efds,ti ? &tmo : NIL);
++      tmo = ti ? ti - now : 0;
++      i = poll (&pfd, 1, ti ? tmo * 1000 : -1);
+       now = time (0);         /* fake timeout if interrupt & time expired */
+       if ((i < 0) && (errno == EINTR) && ti && (ti <= now)) i = 0;
+       } while ((i < 0) && (errno == EINTR));
+@@ -302,7 +288,7 @@ int tcp_socket_open (int family,void *adr,size_t adrlen,unsigned short port,
+       fcntl (sock,F_SETFL,flgs);
+       /* This used to be a zero-byte read(), but that crashes Solaris */
+                               /* get socket status */
+-      if(FD_ISSET(sock, &rfds)) while (((i = *ctr = read (sock,tmp,1)) < 0) && (errno == EINTR));
++      if(pfd.revents & POLLIN) while (((i = *ctr = read (sock,tmp,1)) < 0) && (errno == EINTR));
+       }       
+       if (i <= 0) {           /* timeout or error? */
+       i = i ? errno : ETIMEDOUT;/* determine error code */
+@@ -545,9 +531,8 @@ long tcp_getbuffer (TCPSTREAM *stream,unsigned long size,char *s)
+     stream->ictr -=n;
+   }
+   if (size) {
+-    int i;
+-    fd_set fds,efds;
+-    struct timeval tmo;
++    int i, tmo;
++    struct pollfd pfd;
+     time_t t = time (0);
+     blocknotify_t bn=(blocknotify_t) mail_parameters (NIL,GET_BLOCKNOTIFY,NIL);
+     (*bn) (BLOCK_TCPREAD,NIL);
+@@ -556,16 +541,13 @@ long tcp_getbuffer (TCPSTREAM *stream,unsigned long size,char *s)
+       time_t now = tl;
+       time_t ti = ttmo_read ? now + ttmo_read : 0;
+       if (tcpdebug) mm_log ("Reading TCP buffer",TCPDEBUG);
+-      tmo.tv_usec = 0;
+-      FD_ZERO (&fds);         /* initialize selection vector */
+-      FD_ZERO (&efds);                /* handle errors too */
+-                              /* set bit in selection vectors */
+-      FD_SET (stream->tcpsi,&fds);
+-      FD_SET (stream->tcpsi,&efds);
++
++      pfd.events = POLLIN;
++      pfd.fd = stream->tcpsi;
+       errno = NIL;            /* initially no error */
+       do {                    /* block under timeout */
+-      tmo.tv_sec = ti ? ti - now : 0;
+-      i = select (stream->tcpsi+1,&fds,NIL,&efds,ti ? &tmo : NIL);
++      tmo = ti ? ti - now : 0;
++      i = poll (&pfd, 1, ti ? tmo * 1000 : -1);
+       now = time (0);         /* fake timeout if interrupt & time expired */
+       if ((i < 0) && (errno == EINTR) && ti && (ti <= now)) i = 0;
+       } while ((i < 0) && (errno == EINTR));
+@@ -605,9 +587,8 @@ long tcp_getbuffer (TCPSTREAM *stream,unsigned long size,char *s)
+ long tcp_getdata (TCPSTREAM *stream)
+ {
+-  int i;
+-  fd_set fds,efds;
+-  struct timeval tmo;
++  int i, tmo;
++  struct pollfd pfd;
+   time_t t = time (0);
+   blocknotify_t bn = (blocknotify_t) mail_parameters (NIL,GET_BLOCKNOTIFY,NIL);
+   if (stream->tcpsi < 0) return NIL;
+@@ -617,15 +598,12 @@ long tcp_getdata (TCPSTREAM *stream)
+     time_t now = tl;
+     time_t ti = ttmo_read ? now + ttmo_read : 0;
+     if (tcpdebug) mm_log ("Reading TCP data",TCPDEBUG);
+-    tmo.tv_usec = 0;
+-    FD_ZERO (&fds);           /* initialize selection vector */
+-    FD_ZERO (&efds);          /* handle errors too */
+-    FD_SET (stream->tcpsi,&fds);/* set bit in selection vectors */
+-    FD_SET (stream->tcpsi,&efds);
++    pfd.fd = stream->tcpsi;
++    pfd.events = POLLIN;
+     errno = NIL;              /* initially no error */
+     do {                      /* block under timeout */
+-      tmo.tv_sec = ti ? ti - now : 0;
+-      i = select (stream->tcpsi+1,&fds,NIL,&efds,ti ? &tmo : NIL);
++      tmo = ti ? ti - now : 0;
++      i = poll (&pfd, 1, ti ? tmo * 1000 : -1);
+       now = time (0);         /* fake timeout if interrupt & time expired */
+       if ((i < 0) && (errno == EINTR) && ti && (ti <= now)) i = 0;
+     } while ((i < 0) && (errno == EINTR));
+@@ -677,9 +655,8 @@ long tcp_soutr (TCPSTREAM *stream,char *string)
+ long tcp_sout (TCPSTREAM *stream,char *string,unsigned long size)
+ {
+-  int i;
+-  fd_set fds,efds;
+-  struct timeval tmo;
++  int i, tmo;
++  struct pollfd pfd;
+   time_t t = time (0);
+   blocknotify_t bn = (blocknotify_t) mail_parameters (NIL,GET_BLOCKNOTIFY,NIL);
+   if (stream->tcpso < 0) return NIL;
+@@ -689,15 +666,12 @@ long tcp_sout (TCPSTREAM *stream,char *string,unsigned long size)
+     time_t now = tl;
+     time_t ti = ttmo_write ? now + ttmo_write : 0;
+     if (tcpdebug) mm_log ("Writing to TCP",TCPDEBUG);
+-    tmo.tv_usec = 0;
+-    FD_ZERO (&fds);           /* initialize selection vector */
+-    FD_ZERO (&efds);          /* handle errors too */
+-    FD_SET (stream->tcpso,&fds);/* set bit in selection vector */
+-    FD_SET(stream->tcpso,&efds);/* set bit in error selection vector */
++    pfd.fd = stream->tcpso;
++    pfd.events = POLLOUT;
+     errno = NIL;              /* block and write */
+     do {                      /* block under timeout */
+-      tmo.tv_sec = ti ? ti - now : 0;
+-      i = select (stream->tcpso+1,NIL,&fds,&efds,ti ? &tmo : NIL);
++      tmo = ti ? ti - now : 0;
++      i = poll (&pfd, 1, ti ? tmo * 1000 : -1);
+       now = time (0);         /* fake timeout if interrupt & time expired */
+       if ((i < 0) && (errno == EINTR) && ti && (ti <= now)) i = 0;
+     } while ((i < 0) && (errno == EINTR));
index 501f987e69559123ba822d4044779b63d29af3f5..177814761d11c2416b8049d3df4e37a47bc2b910 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=vips
-PKG_VERSION:=7.42.1
-PKG_RELEASE:=1
+PKG_VERSION:=8.6.1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.vips.ecs.soton.ac.uk/supported/7.42/
-PKG_MD5SUM:=33a4590924b3120ce309982ec85a7c16
+PKG_SOURCE_URL:=https://github.com/jcupitt/libvips/releases/download/v8.6.1/
+PKG_HASH:=f9ba6235ebc3e4d20af5f1604436bcd9686a3fecbe40838325d542f0c21a9270
 PKG_FIXUP:=autoreconf
 PKG_CHECK_FORMAT_SECURITY:=0
 
@@ -29,7 +29,7 @@ define Package/vips
   TITLE:=An image manipulation library
   URL:=http://www.vips.ecs.soton.ac.uk/
   MAINTAINER:=W. Michael Petullo <mike@flyn.org>
-  DEPENDS:=+glib2 +libexif +libjpeg +libpng +libxml2 $(INTL_DEPENDS)
+  DEPENDS:=+glib2 +libexif +libexpat +libjpeg +libpng +giflib +libstdcpp +libxml2 $(INTL_DEPENDS)
 endef
 
 TARGET_LDFLAGS+= \
diff --git a/libs/vips/patches/001-no_cpp.patch b/libs/vips/patches/001-no_cpp.patch
deleted file mode 100644 (file)
index 72e841c..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-diff -u --recursive --new-file vips-7.42.1-vanilla/configure.ac vips-7.42.1/configure.ac
---- vips-7.42.1-vanilla/configure.ac   2014-12-29 17:45:59.576995574 -0500
-+++ vips-7.42.1/configure.ac   2014-12-29 17:59:03.698808601 -0500
-@@ -264,7 +264,6 @@
- AC_PROG_AWK
- AC_PROG_CC
- AC_PROG_CC_STDC
--AC_PROG_CXX
- AC_C_CONST
- AC_C_RESTRICT
- AC_PROG_RANLIB
-@@ -272,19 +271,6 @@
- AC_PROG_LN_S
- AM_WITH_DMALLOC
--# vips_PROG_CXX_WORKS
--# Check whether the C++ compiler works.
--AC_DEFUN([vips_PROG_CXX_WORKS],
--  [AC_REQUIRE([AC_PROG_CXX])dnl
--   AC_CACHE_CHECK([whether the C++ compiler works],
--   [vips_cv_prog_cxx_works],
--   [AC_LANG_PUSH([C++])
--    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
--                   [vips_cv_prog_cxx_works=yes],
--                   [vips_cv_prog_cxx_works=no])
--    AC_LANG_POP([C++])])
--])
--
- # option to build without C++
- # handy for some embedded applications
- # also, including C++ source causes link problems on some
-@@ -292,24 +278,8 @@
- AC_ARG_ENABLE(cxx, 
-   AS_HELP_STRING([--enable-cxx], [build C++ components (default: test)]))
--if test x"$enable_cxx" != x"no"; then
--  vips_PROG_CXX_WORKS
--  if test x"$vips_cv_prog_cxx_works" = x"yes"; then 
--    AC_DEFINE(ENABLE_CXX,1,[build C++ components])
--    AM_CONDITIONAL(ENABLE_CXX, true)
--    # need -lstdc++ for (eg.) the C++ format loaders
--    # this gets added to vips.pc to help mingw and friends link programs
--    # using libvips
--    if test x"$vips_needs_stdcpp" != x"no"; then
--      VIPS_CXX_LIBS="-lstdc++"
--    fi
--    enable_cxx=yes
--  fi
--fi
--
- if test x"$enable_cxx" != x"yes"; then
-   AM_CONDITIONAL(ENABLE_CXX, false)
--  VIPS_CXX_LIBS=""
-   enable_cxx=no
- fi
-@@ -817,7 +787,6 @@
- AC_SUBST(VIPS_CFLAGS)
- AC_SUBST(VIPS_INCLUDES)
- AC_SUBST(VIPS_LIBS)
--AC_SUBST(VIPS_CXX_LIBS)
- AC_SUBST(PACKAGES_USED)
- AC_SUBST(EXTRA_LIBS_USED)
-@@ -850,12 +819,6 @@
-       libvips/create/Makefile 
-       libvips/resample/Makefile 
-       libvips/video/Makefile 
--      libvipsCC/include/Makefile 
--      libvipsCC/include/vips/Makefile 
--      libvipsCC/Makefile 
--      cplusplus/include/Makefile 
--      cplusplus/include/vips/Makefile 
--      cplusplus/Makefile 
-       tools/Makefile 
-       tools/batch_crop 
-       tools/batch_image_convert 
-@@ -866,7 +829,6 @@
-       test/Makefile 
-       test/variables.sh
-       swig/Makefile 
--      swig/vipsCC/Makefile 
-       man/Makefile
-       doc/Makefile
-       doc/reference/Makefile
-diff -u --recursive --new-file vips-7.42.1-vanilla/libvips/Makefile.am vips-7.42.1/libvips/Makefile.am
---- vips-7.42.1-vanilla/libvips/Makefile.am    2014-12-29 17:45:59.590996100 -0500
-+++ vips-7.42.1/libvips/Makefile.am    2014-12-29 17:59:32.053375826 -0500
-@@ -33,14 +33,6 @@
- # empty means default to C linking
- libvips_la_SOURCES = 
--# if we have C++ components enabled, make sure we link the top-level with c++
--#
--# sadly the if/endif isn't enough to stop automake detecting a c++ link even
--# when c++ is disabled ... comment out this line if you have linking problems
--if ENABLE_CXX
--nodist_EXTRA_libvips_la_SOURCES = resample/dummy2.cc
--endif
--
- # DLLs need dependant libs there too ... put @VIPS_LIBS@ at the end
- libvips_la_LIBADD = \
-       resample/libresample.la \
-diff -u --recursive --new-file vips-7.42.1-vanilla/libvips/resample/Makefile.am vips-7.42.1/libvips/resample/Makefile.am
---- vips-7.42.1-vanilla/libvips/resample/Makefile.am   2014-12-29 17:45:59.591996138 -0500
-+++ vips-7.42.1/libvips/resample/Makefile.am   2014-12-29 18:01:57.107188019 -0500
-@@ -1,30 +1,3 @@
--# only build the C++ stuff if ENABLE_CXX
--# you'd think we could just define a couple of variables, but that seems to
--# confuse libtool and make it link the library with g++
--# instead, have two completely different paths
--if ENABLE_CXX
--
--libresample_la_SOURCES = \
--      affine.c \
--      quadratic.c \
--      resample.c \
--      similarity.c \
--      resize.c \
--      presample.h \
--      shrink.c \
--      interpolate.c \
--      transform.c \
--      bicubic.cpp \
--      lbb.cpp \
--      nohalo.cpp \
--      vsqbs.cpp \
--      templates.h 
--
--EXTRA_DIST = \
--      dummy2.cc 
--
--else
--
- libresample_la_SOURCES = \
-       resample.c \
-       similarity.c \
-@@ -36,16 +9,6 @@
-       quadratic.c \
-       transform.c 
--EXTRA_DIST = \
--      dummy2.cc \
--      bicubic.cpp \
--      lbb.cpp \
--      nohalo.cpp \
--      vsqbs.cpp \
--      templates.h 
--
--endif
--
- noinst_LTLIBRARIES = libresample.la
- AM_CPPFLAGS = -I${top_srcdir}/libvips/include @VIPS_CFLAGS@ @VIPS_INCLUDES@ 
diff --git a/libs/vips/patches/001-no_introspection.patch b/libs/vips/patches/001-no_introspection.patch
new file mode 100644 (file)
index 0000000..54db292
--- /dev/null
@@ -0,0 +1,73 @@
+diff -u --recursive vips-8.6.1-vanilla/configure.ac vips-8.6.1/configure.ac
+--- vips-8.6.1-vanilla/configure.ac    2018-01-13 17:27:19.375813474 -0500
++++ vips-8.6.1/configure.ac    2018-01-13 17:27:38.486871756 -0500
+@@ -53,9 +53,6 @@
+ AC_SUBST(LIBRARY_REVISION)
+ AC_SUBST(LIBRARY_AGE)
+-# init introspection support
+-GOBJECT_INTROSPECTION_CHECK([1.30.0])
+-
+ # gir needs a list of source files to scan for introspection
+ #
+ # build with a glob and a list of files to exclude from scanning
+diff -u --recursive vips-8.6.1-vanilla/libvips/Makefile.am vips-8.6.1/libvips/Makefile.am
+--- vips-8.6.1-vanilla/libvips/Makefile.am     2018-01-13 17:27:19.366813446 -0500
++++ vips-8.6.1/libvips/Makefile.am     2018-01-13 17:27:57.256929001 -0500
+@@ -70,56 +70,3 @@
+       echo "#define VIPS_SONAME \"$$dlname\"" >> soname.h && \
+       cp soname.h $(DESTDIR)$(pkgincludedir) && \
+       rm soname.h
+-
+--include $(INTROSPECTION_MAKEFILE)
+-INTROSPECTION_GIRS =
+-INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)
+-INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+-
+-if HAVE_INTROSPECTION
+-
+-AM_CPPFLAGS = \
+-            -I${top_srcdir}/libvips/include \
+-            @VIPS_CFLAGS@ \
+-            @VIPS_INCLUDES@ \
+-            @INTROSPECTION_CFLAGS@ 
+-AM_LDFLAGS = \
+-           @INTROSPECTION_LIBS@ \
+-           @LDFLAGS@ 
+-LDADD = @INTROSPECTION_LIBS@ @VIPS_CFLAGS@ libvips.la @VIPS_LIBS@ 
+-
+-noinst_PROGRAMS = \
+-      introspect
+-introspect_SOURCES = \
+-      introspect.c
+-
+-# we can't get the _SOURCES lists from the subdirs directly, we get passed it
+-# by configure instead
+-introspection_sources = @vips_introspection_sources@
+-
+-# we make the vips8 API
+-Vips-8.0.gir: introspect
+-Vips_8_0_gir_INCLUDES = GObject-2.0
+-Vips_8_0_gir_CFLAGS = $(INCLUDES) -I${top_srcdir}/libvips/include
+-Vips_8_0_gir_LIBS = libvips.la
+-Vips_8_0_gir_FILES = $(introspection_sources)
+-INTROSPECTION_GIRS += Vips-8.0.gir
+-
+-# don't use
+-#   --warn-all --verbose
+-# too annoying
+-Vips_8_0_gir_SCANNERFLAGS = \
+-      --program=./introspect$(EXEEXT) \
+-      --identifier-prefix=Vips \
+-      --identifier-prefix=vips \
+-      --symbol-prefix=vips \
+-      --c-include=vips/vips.h
+-
+-girdir = $(datadir)/gir-1.0
+-gir_DATA = $(INTROSPECTION_GIRS)
+-
+-typelibdir = $(libdir)/girepository-1.0
+-typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+-
+-CLEANFILES += $(gir_DATA) $(typelib_DATA)
+-endif
index 998219a9fc48ad57092b880c4696ea1db4858090..780efb004e384201de8617ce8e634896c26b46c0 100644 (file)
@@ -8,15 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xmlrpc-c
-PKG_REV:=2640
-PKG_VERSION:=1.39.0
+PKG_VERSION:=1.39.12
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://svn.code.sf.net/p/xmlrpc-c/code/advanced
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=$(PKG_REV)
-PKG_SOURCE_PROTO:=svn
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=@SF/xmlrpc-c/Xmlrpc-c%20Super%20Stable/$(PKG_VERSION)
+PKG_HASH:=d830f3264a832dfe09f629cc64036acfd08121692526d0fabe090f7ff881ce08
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=VARIOUS
index f9a2877a034ee9f740454de6227d55591a1c4193..843b5967f2ad075095ffd61743b46b8016a06394 100644 (file)
@@ -16,6 +16,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_REV:=66cb08ca2ad8581080b626a75dfca266a890afb2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=95bfdb37f864318fc3c2ee736a747d4902d279a88f361770c89e60ff5e1d6f63
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_SOURCE_URL:=git://github.com/lloyd/yajl.git
index c2b818aa27c1cf35e79678f9762fb4be3d2c1a47..22f98ee07938d0e5aaa70e1c839019ada5af3727 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://pyyaml.org/download/libyaml/
-PKG_MD5SUM:=5fe00cda18ca5daeb43762b80c38e06e
+PKG_HASH:=7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
index 5ad53844fa942f2958c6dbea46b9675639c4eaf5..a82a70eecea493b83828e26e49591843616feb3c 100644 (file)
@@ -18,10 +18,9 @@ PKG_LICENSE_FILES:=LICENCE.txt
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= https://github.com/zeromq/zeromq4-1/releases/download/v$(PKG_VERSION)/
-PKG_MD5SUM:=a611ecc93fffeb6d058c0e6edf4ad4fb
+PKG_HASH:=e99f44fde25c2e4cb84ce440f87ca7d3fe3271c2b8cfbc67d55e4de25e6fe378
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_BUILD_DEPENDS:=libuuid
 
 PKG_FIXUP:=autoreconf
 
index c5770a15509d45b0b6f2bd05374e1eb66f36d362..8f8050868f7b5c25dcb6f320848a0dcdad605191 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=http://patches.freeiz.com/alpine/release/src/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=043b67666af73b26f9627ad97e2aaf92
+PKG_HASH:=ed639b6e5bb97e6b0645c85262ca6a784316195d461ce8d8411999bf80449227
 
 PKG_MAINTAINER:=Antti Seppälä <a.seppala@gmail.com>
 PKG_LICENSE:=Apache-2.0
index a3355594746d762fd584c6c2064598eeddbe9244..01a5a148f12ebd58f345ad728c75618ae35ef9bd 100644 (file)
@@ -16,7 +16,7 @@ PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/bogofilter
-PKG_MD5SUM:=d0a5eebb3274b23ceabe766a6443a1c5
+PKG_HASH:=e10287a58d135feaea26880ce7d4b9fa2841fb114a2154bf7da8da98aab0a6b4
 
 PKG_INSTALL:=1
 
diff --git a/mail/clamsmtp/Makefile b/mail/clamsmtp/Makefile
new file mode 100644 (file)
index 0000000..449594b
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2017 Lucian Cristian <lucian.cristian@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=clamsmtp
+PKG_VERSION:=1.10
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://thewalter.net/stef/software/clamsmtp/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=a52fdb4b26e11ece30c478a806c95b1eda16f4e73937bd560ece7017fb0df92a
+
+MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
+PKG_LICENSE:=GPLv2
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/clamsmtp
+  SECTION:=mail
+  CATEGORY:=Mail
+  DEPENDS:=+libpthread
+  TITLE:=clamsmtp
+  URL:=http://thewalter.net/stef/software/clamsmtp/
+endef
+
+define Package/clamsmtp/description
+       ClamSMTP is an SMTP filter that allows you to check for viruses using the ClamAV anti-virus software.
+endef
+
+define Package/clamsmtp/install
+       $(INSTALL_DIR)  $(1)/usr/sbin \
+                       $(1)/etc/init.d
+       $(CP) $(PKG_BUILD_DIR)/src/clamsmtpd $(1)/usr/sbin/
+       $(CP) $(PKG_BUILD_DIR)/doc/clamsmtpd.conf $(1)/etc/
+       $(INSTALL_BIN) ./files/clamsmtpd.init $(1)/etc/init.d/clamsmtpd
+endef
+
+$(eval $(call BuildPackage,clamsmtp))
diff --git a/mail/clamsmtp/files/clamsmtpd.init b/mail/clamsmtp/files/clamsmtpd.init
new file mode 100644 (file)
index 0000000..9b7cf87
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2017 Lucian Cristian
+
+START=91
+USE_PROCD=1
+
+PROG=/usr/sbin/clamsmtpd
+
+start_service(){
+        procd_open_instance
+        procd_set_param command $PROG -p /var/run/clamsmtpd.pid
+        procd_close_instance
+}
+service_triggers(){
+        procd_add_reload_trigger "clamsmtpd"
+}
index aad6e685352eb151c981b6cef45131e2621ba408..5fc3f8218e5ee268336b5f7fe2bcb20a7ffd40cf 100644 (file)
@@ -8,16 +8,23 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dovecot
-PKG_VERSION:=2.2.26.0
-PKG_RELEASE:=1
+PKG_VERSION:=2.2.33.2
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.dovecot.org/releases/2.2
-PKG_MD5SUM:=85bc42328de41d1eb8d6d3f1db666db8
+PKG_HASH:=fe1e3b78609a56ee22fc209077e4b75348fa1bbd54c46f52bde2472a4c4cee84
 PKG_LICENSE:=LGPL-2.1 MIT BSD-3-Clause Unique
 PKG_LICENSE_FILES:=COPYING COPYING.LGPL COPYING.MIT
+PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
 
 PKG_BUILD_DEPENDS:=libiconv
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_DOVECOT_LDAP \
+       CONFIG_DOVECOT_MYSQL \
+       CONFIG_DOVECOT_PGSQL \
+       CONFIG_DOVECOT_SQLITE \
+       CONFIG_DOVECOT_ICU
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
@@ -27,11 +34,11 @@ include $(INCLUDE_DIR)/package.mk
 define Package/dovecot
   SECTION:=mail
   CATEGORY:=Mail
-  DEPENDS:=+DOVECOT_LDAP:libopenldap +libopenssl +librt +zlib +libbz2 +libcap
+  DEPENDS:=+DOVECOT_LDAP:libopenldap +DOVECOT_MYSQL:libmysqlclient +DOVECOT_PGSQL:libpq +DOVECOT_SQLITE:libsqlite3 +libopenssl +librt +zlib +libbz2 +libcap +DOVECOT_ICU:icu
   TITLE:=An IMAP and POP3 daemon
-  MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
   URL:=http://www.dovecot.org/
   USERID:=dovecot=59:dovecot=59
+  ABI_VERSION:=$(PKG_VERSION)
 endef
 
 define Package/dovecot/description
@@ -46,9 +53,41 @@ define Package/dovecot/config
                         default n
                         help
                           Implements LDAP support in dovecot.
+                config DOVECOT_MYSQL
+                        bool "MYSQL support"
+                        default n
+                        help
+                          Implements MYSQL support in dovecot.
+                config DOVECOT_PGSQL
+                        bool "PostgreSQL support"
+                        default n
+                        help
+                          Implements PostgreSQL support in dovecot.
+                config DOVECOT_SQLITE
+                        bool "SQLite support"
+                        default n
+                        help
+                          Implements SQLite DB support in dovecot.
+                config DOVECOT_ICU
+                        bool "Enable i18n features"
+                        default n
+                        help
+                          Enable ICU (International Components for Unicode) support.
         endmenu
 endef
 
+define Package/dovecot/conffiles
+/etc/init.d/dovecot
+/etc/dovecot/
+endef
+
+define Package/dovecot-utils
+  SECTION:=mail
+  CATEGORY:=Mail
+  DEPENDS:=+dovecot
+  TITLE:=doveadm and dsync utilities for Dovecot
+endef
+
 CONFIGURE_ARGS += \
        --without-gssapi \
        --without-pam \
@@ -56,15 +95,11 @@ CONFIGURE_ARGS += \
        --with-notify=dnotify \
        --without-lzma \
        --without-lz4 \
-       --with-icu=no
-
-ifneq ($(strip $(CONFIG_DOVECOT_LDAP)),)
-  CONFIGURE_ARGS+= \
-       --with-ldap=yes
-else
-  CONFIGURE_ARGS+= \
-       --with-ldap=no
-endif
+       $(if $(CONFIG_DOVECOT_LDAP),--with-ldap=yes,--with-ldap=no) \
+       $(if $(CONFIG_DOVECOT_MYSQL),--with-mysql=yes,--with-mysql=no) \
+       $(if $(CONFIG_DOVECOT_PGSQL),--with-pgsql=yes,--with-pgsql=no) \
+       $(if $(CONFIG_DOVECOT_SQLITE),--with-sqlite=yes,--with-sqlite=no) \
+       $(if $(CONFIG_DOVECOT_ICU),--with-icu=yes,--with-icu=no)
 
 CONFIGURE_VARS += \
        RPCGEN= \
@@ -79,16 +114,24 @@ CONFIGURE_VARS += \
        lib_cv___va_copy=yes \
        lib_cv_va_val_copy=yes
 
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/dovecot $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot $(1)/usr/lib/
+       rm -f $(1)/usr/lib/dovecot/*.la
+endef
+
+
 define Package/dovecot/install
        $(INSTALL_DIR)  $(1)/etc/init.d \
                        $(1)/etc/dovecot \
-                       $(1)/usr/share/doc/dovecot/example-config \
+                       $(1)/usr/share/doc/dovecot \
                        $(1)/usr/lib/dovecot \
                        $(1)/usr/bin \
                        $(1)/usr/sbin
        $(CP) $(PKG_INSTALL_DIR)/etc/dovecot/* $(1)/etc/dovecot/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot/* $(1)/usr/lib/dovecot/
-       $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/dovecot/example-config $(1)/usr/share/doc/dovecot/example-config
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/dovecot/example-config $(1)/usr/share/doc/dovecot/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/doveconf $(1)/usr/bin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
        $(INSTALL_BIN) ./files/dovecot.init $(1)/etc/init.d/dovecot
@@ -96,4 +139,11 @@ define Package/dovecot/install
        find $(1)/usr/lib/dovecot/ -name "*.a" -o -name "*.la" | xargs rm
 endef
 
+define Package/dovecot-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/doveadm $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/dsync $(1)/usr/bin/
+endef
+
 $(eval $(call BuildPackage,dovecot))
+$(eval $(call BuildPackage,dovecot-utils))
index efe3cec9bbcfda0cce041d2efe27c7bfa252d676..b9b595fe48a8c013b6516f8f97e1d0c15c184651 100644 (file)
@@ -9,16 +9,19 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=emailrelay
 PKG_VERSION:=1.9
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.gz
 PKG_SOURCE_URL:=@SF/emailrelay/$(PKG_VERSION)
-PKG_MD5SUM:=0892fbf993407c6b5a16f96e23299b62
+PKG_HASH:=869a3e2d053237d7f63784acc25e748af2dbf2d9b9c5c48e4a5269d4e4b5bda0
+PKG_MAINTAINER:=Federico Di Marco <fededim@gmail.com>
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
-PKG_CONFIG_DEPENDS:=CONFIG_EMAILRELAY_SUPPORT_VERBOSE_DBG CONFIG_EMAILRELAY_SSL 
+PKG_CONFIG_DEPENDS:=CONFIG_EMAILRELAY_SUPPORT_VERBOSE_DBG CONFIG_EMAILRELAY_SSL
 
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
 
 #include $(INCLUDE_DIR)/uclibc++.mk   # $(CXX_DEPENDS)
 include $(INCLUDE_DIR)/package.mk
@@ -26,10 +29,9 @@ include $(INCLUDE_DIR)/package.mk
 define Package/emailrelay
   SECTION:=mail
   CATEGORY:=Mail
-  DEPENDS:=+EMAILRELAY_SSL:libopenssl +libstdcpp 
+  DEPENDS:=+EMAILRELAY_SSL:libopenssl +libstdcpp
   TITLE:=A simple SMTP proxy and MTA
   URL:=http://emailrelay.sourceforge.net/
-  MAINTAINER:=Federico Di Marco <fededim@gmail.com>
   MENU:=1
 endef
 
@@ -42,7 +44,7 @@ config EMAILRELAY_SUPPORT_VERBOSE_DBG
        help
          Enables support for extended logging (must also be explicitely enabled by using command line switch --debug when starting emailrelay)
 
-config EMAILRELAY_SSL 
+config EMAILRELAY_SSL
        bool "Enable support for OpenSSL"
        depends on PACKAGE_emailrelay
        default y
@@ -54,18 +56,19 @@ endef
 
 
 define Package/emailrelay/description
- Emailrelay is a simple SMTP proxy and store-and-forward message transfer agent (MTA). 
- When running as a proxy all e-mail messages can be passed through 
-  a user-defined program, such as a spam filter, which can drop, 
-  re-address or edit messages as they pass through. When running 
-  as a store-and-forward MTA incoming messages are stored in a 
-  local spool directory, and then forwarded to the next SMTP 
 server on request.
+ Emailrelay is a simple SMTP proxy and store-and-forward message transfer agent (MTA).
+
+ When running as a proxy all e-mail messages can be passed through
+ a user-defined program, such as a spam filter, which can drop,
+ re-address or edit messages as they pass through. When running
+ as a store-and-forward MTA incoming messages are stored in a
+ local spool directory, and then forwarded to the next SMTP
+ server on request.
 endef
 
 
 define Package/emailrelay/conffiles
+/etc/config/emailrelay
 /etc/emailrelay.auth
 endef
 
@@ -75,7 +78,7 @@ CONFIGURE_ARGS += \
        --enable-testing=no
 
 CONFIGURE_VARS += \
-       CXXFLAGS="$$$$CXXFLAGS -fno-rtti"       
+       CXXFLAGS="$$$$CXXFLAGS -fno-rtti"
 
 
 ifeq ($(CONFIG_EMAILRELAY_SSL),y)
@@ -94,7 +97,7 @@ endif
 
 ifeq ($(CONFIG_OPENSSL_WITH_SSL3),y)
        CONFIGURE_VARS += \
-               CXXFLAGS="$$$$CXXFLAGS -DSSL3_SUPPORT"  
+               CXXFLAGS="$$$$CXXFLAGS -DSSL3_SUPPORT"
 endif
 
 define Package/emailrelay/install
@@ -104,10 +107,10 @@ define Package/emailrelay/install
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-passwd $(1)/usr/bin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-poke $(1)/usr/bin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-submit $(1)/usr/bin/
-       $(INSTALL_DIR) $(1)/tmp/spool
-       $(INSTALL_DIR) $(1)/tmp/spool/emailrelay
        $(INSTALL_DIR) $(1)/etc
        $(INSTALL_DATA) files/$(PKG_NAME).auth $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
 endef
index 3d11bf0f2b010f60292e47d71b0ea780392dc0ae..8bc9594592783c172f842852c99ed08b88673ca8 100644 (file)
@@ -13,4 +13,4 @@
 #
 #NONE server 192.168.1.* keyword
 #LOGIN client smtpuser@smtpserver smtppassword
-#LOGIN server user1 secret
\ No newline at end of file
+#LOGIN server user1 secret
diff --git a/mail/emailrelay/files/emailrelay.config b/mail/emailrelay/files/emailrelay.config
new file mode 100644 (file)
index 0000000..1a4eb67
--- /dev/null
@@ -0,0 +1,28 @@
+config emailrelay 'server'
+       option enabled '0'
+       option mode 'server'
+       option port '25'
+       option remote_clients '0'
+#      option server_tls '/etc/path/to/certificate'
+#      option server_auth '/etc/emailrelay.auth'
+#      option extra_cmdline ''
+
+config emailrelay 'proxy'
+       option enabled '0'
+       option mode 'proxy'
+       option smarthost '192.0.2.1:25'
+       option port '25'
+       option remote_clients '0'
+#      option server_tls '/etc/path/to/certificate'
+#      option server_auth '/etc/emailrelay.auth'
+#      option client_tls '1'
+#      option client_auth '/etc/emailrelay.auth'
+#      option extra_cmdline ''
+
+config emailrelay 'cmdline'
+       option enabled '0'
+       option mode 'cmdline'
+       # specify all arguments that should be passed to emailrelay here
+       # see http://emailrelay.sourceforge.net/reference.html for command line reference
+       option extra_cmdline '--some-other --cmdline-options'
+
index 9fc33996ece2ee4388656bddef649a978a126d69..5b78f2170a60869bc9723234d5e8560ca5a11444 100644 (file)
@@ -1,15 +1,66 @@
 #!/bin/sh /etc/rc.common
-#see http://emailrelay.sourceforge.net/reference.html for command line reference
 
 START=90
 
+USE_PROCD=1
+PROG=/usr/bin/emailrelay
+NAME=emailrelay
 
-start() {
-        logger -t 'emailrelay' "Starting emailrelay service."
-        service_start /usr/bin/emailrelay --as-server --poll 60 --forward-to smtpserver:smtpport --spool-dir /tmp --client-tls --client-auth /etc/emailrelay.auth --server-auth /etc/emailrelay.auth --log
+
+emailrelay_instance()
+{
+       local enabled mode port remote_clients server_tls server_auth extra_cmdline smarthost client_tls client_auth
+
+       config_get_bool enabled "$1" enabled
+       config_get mode "$1" mode
+       config_get port "$1" port
+       config_get_bool remote_clients "$1" remote_clients
+       config_get server_tls "$1" server_tls
+       config_get server_auth "$1" server_auth
+       config_get extra_cmdline "$1" extra_cmdline
+       config_get smarthost "$1" smarthost
+       config_get_bool client_tls "$1" client_tls
+       config_get client_auth "$1" client_auth
+
+
+       [ "$enabled" = 0 ] && return 1
+
+       procd_open_instance
+       procd_set_param command "$PROG" --no-daemon
+
+       case "$mode" in
+               "server"|\
+               "proxy")
+                       procd_append_param command "--as-${mode}"
+                       [ -n "$smarthost" ] && procd_append_param command "$smarthost"
+                       [ -n "$port" ] && procd_append_param command --port "$port"
+                       [ "$remote_clients" = 1 ] && procd_append_param command --remote-clients
+                       [ -n "$server_tls" ] && procd_append_param command --server-tls "$server_tls"
+                       [ -n "$server_auth" ] && procd_append_param command --server-auth "$server_auth"
+                       [ "$client_tls" = 1 ] && procd_append_param command --client-tls
+                       [ -n "$client_auth" ] && procd_append_param command --client-auth "$client_auth"
+                       ;;
+               "cmdline")
+                       # empty by intention (just append extra_cmdline)
+                       ;;
+               *)
+                       echo "no mode specified"
+                       return 1
+                       ;;
+       esac
+
+       [ -n "$extra_cmdline" ] && procd_append_param command $extra_cmdline
+
+       procd_set_param respawn
+
+       procd_close_instance
 }
 
-stop() {
-        logger -t 'emailrelay' "Stopping emailrelay service."
-        service_stop /usr/bin/emailrelay
+
+start_service()
+{
+       [ ! -d /var/spool/emailrelay ] && mkdir -p /var/spool/emailrelay
+
+       config_load "${NAME}"
+       config_foreach emailrelay_instance emailrelay
 }
index 49c02f15e5386908326a39df7751a6e2fc01bb2d..0006eefde26be01e605e4b866d3dd47ce040d73f 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fdm
-PKG_VERSION:=1.7
-PKG_RELEASE:=1
+PKG_VERSION:=1.9
+PKG_RELEASE:=2
 PKG_LICENSE:=BSD-2-Clause
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/fdm
-PKG_MD5SUM:=aea0421571e8f3ec8f747a5d72c84348
+PKG_SOURCE:=$(PKG_VERSION).zip
+PKG_SOURCE_URL:=https://github.com/nicm/fdm/archive
+PKG_HASH:=ee08f9133657c8c959b738079c2e4f556cf5cca2daa8343feaf4f07698ad6086
 
 PKG_INSTALL:=1
 
@@ -38,8 +38,13 @@ define Package/fdm/description
   to a pipe, file, maildir, mbox or SMTP server, based on $(if $(CONFIG_FDM_WITH_PCRE),PCRE,POSIX regexp)
 endef
 
+ifdef CONFIG_FDM_WITH_PCRE
+       EXTRA_CFLAGS := -DPCRE
+       EXTRA_LDFLAGS += -lpcre
+endif
+
 MAKE_FLAGS += \
-       PREFIX="/usr"\
+       PREFIX="/usr" \
        $(if $(CONFIG_FDM_WITH_PCRE),PCRE=1)
 
 define Build/Prepare
@@ -47,6 +52,11 @@ define Build/Prepare
        $(CP) ./src/compat/* $(PKG_BUILD_DIR)/
 endef
 
+define Build/Configure
+       ( cd $(PKG_BUILD_DIR); ./autogen.sh )
+       $(call Build/Configure/Default)
+endef
+
 define Package/fdm/config
        source "$(SOURCE)/Config.in"
 endef
diff --git a/mail/fdm/patches/003-base64-fix.patch b/mail/fdm/patches/003-base64-fix.patch
new file mode 100644 (file)
index 0000000..2964568
--- /dev/null
@@ -0,0 +1,15 @@
+Index: fdm-1.9/Makefile.am
+===================================================================
+--- fdm-1.9.orig/Makefile.am
++++ fdm-1.9/Makefile.am
+@@ -107,7 +107,9 @@ dist_fdm_SOURCES = \
+       xmalloc.c \
+       \
+       parse.y \
+-      lex.c
++      lex.c \
++      b64_ntop.c \
++      b64_pton.c
+ nodist_fdm_SOURCES =
+ if NO_STRLCAT
diff --git a/mail/greyfix/Makefile b/mail/greyfix/Makefile
new file mode 100644 (file)
index 0000000..85bd8f8
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2017 Lucian Cristian <lucian.cristian@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=greyfix
+PKG_VERSION:=0.4.0
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.kim-minh.com/pub/greyfix
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=26013edce3a38d586282bfc22eb91bd22df54e3558ea1b3dae54d3e7a769e4fe
+
+MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
+PKG_LICENSE:=GPLv2
+
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/greyfix
+  SECTION:=mail
+  CATEGORY:=Mail
+  DEPENDS:=+libdb47
+  TITLE:=Greyfix - greylisting with Postfix.
+  URL:=http://www.kim-minh.com/pub/greyfix/
+endef
+
+define Package/greyfix/description
+       Greyfix is the greylisting policy daemon for Postfix written by Kim Minh Kaplan.
+endef
+
+CONFIGURE_ARGS += \
+       --localstatedir=/usr/lib \
+
+define Package/greyfix/install
+       $(INSTALL_DIR)  $(1)/usr/sbin \
+                       $(1)/usr/lib/greyfix
+       $(CP) $(PKG_BUILD_DIR)/greyfix $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,greyfix))
diff --git a/mail/greyfix/patches/100-ignore_cross_compile_test.patch b/mail/greyfix/patches/100-ignore_cross_compile_test.patch
new file mode 100644 (file)
index 0000000..fda272e
--- /dev/null
@@ -0,0 +1,40 @@
+--- a/configure        2017-03-08 20:12:00.720885949 +0200
++++ b/configure        2017-03-08 20:12:51.210722711 +0200
+@@ -4190,37 +4190,6 @@
+ fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking match between Berkeley DB header files and runtime" >&5
+-$as_echo_n "checking match between Berkeley DB header files and runtime... " >&6; }
+-if test "$cross_compiling" = yes; then :
+-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-as_fn_error $? "cannot run test program while cross compiling
+-See \`config.log' for more details" "$LINENO" 5; }
+-else
+-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-#include <db.h>
+-int
+-main ()
+-{
+-int M, m; db_version(&M, &m, 0);
+-                             return DB_VERSION_MAJOR != M || DB_VERSION_MINOR != m;
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_run "$LINENO"; then :
+-
+-else
+-  as_fn_error $? "Berkeley DB header file does not match the library file" "$LINENO" 5
+-fi
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+-fi
+-
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+-$as_echo "yes" >&6; }
+ ac_config_files="$ac_config_files Makefile"
+ cat >confcache <<\_ACEOF
index d8443acc80a096bb7a4629706eae0fa8e9542019..8875b5ad290302af301eb8c1d8c6cfec67a42afb 100644 (file)
@@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mailman
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=ftp://ftp.gnu.org/gnu/mailman/ http://ftp.gnu.org/gnu/mailman/
+PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
 PKG_VERSION:=2.1.23
-PKG_MD5SUM:=ceb2d8427e29f4e69b2505423ffeb60b
+PKG_HASH:=b022ca6f8534621c9dbe50c983948688bc4623214773b580c2c78e4a7ae43e69
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
 PKG_LICENSE:=GPL-2.0+
index f9480f152fa0ca08ac5449f74026b1ce3d2063c1..bd264948ae4508d34f83ffe543daa0d9a2d99d47 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/muquit/mailsend/archive/$(PKG_VERSION)
-PKG_MD5SUM:=60103c411a8627e893d35e7836f904e8
+PKG_HASH:=73cb1b2455de95ab126e3682bf19c62e6baabee00f449da692be0bebd3ceb26b
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
index 7784c2b2b47496ef3f76101522a774dee15d111a..b1441bb95ce4cd8e90e3f8c0f2dbc57b5fc1b667 100644 (file)
@@ -15,7 +15,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/msmtp-scripts
-PKG_MD5SUM:=2aec48d47b02facf2a33cf97a7434e969c1a054224406e6c55320d825c7902b2
+PKG_HASH:=2aec48d47b02facf2a33cf97a7434e969c1a054224406e6c55320d825c7902b2
 
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
index 09bf3c68651131d7d7aedb2148eb4e38c49bf815..91ae6de2e7ad9f1d235fb9ac7ed30904520e2604 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=msmtp
-PKG_VERSION:=1.6.2
-PKG_RELEASE:=3
+PKG_VERSION:=1.6.6
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@SF/msmtp
-PKG_MD5SUM:=3baca93c7e5f1aa9d36a2e5b38739ab9
+PKG_HASH:=da15db1f62bd0201fce5310adb89c86188be91cd745b7cb3b62b81a501e7fb5e
 
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
index 59d25df14fbfc596add66075b817f2753992ab7a..cc360363ed5758301652e13d0cdab2236fa05f88 100644 (file)
@@ -8,18 +8,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mutt
-PKG_VERSION:=1.7.2
+PKG_VERSION:=1.9.4
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=ftp://ftp.mutt.org/pub/mutt/ \
                https://bitbucket.org/mutt/mutt/downloads/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=15425c4c9946d58c22ccb44901544e6d
+PKG_HASH:=f4d1bf26350c1ac81b551f98e5a4fd80d7fecd86919aa8165e69fde87de1b5df
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=GPL
 PKG_MAINTAINER:=Phil Eichinger <phil@zankapfel.net>
 
+PKG_FIXUP:=autoreconf
 
 PKG_INSTALL:=1
 
@@ -28,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/mutt
   SECTION:=mail
   CATEGORY:=Mail
-  DEPENDS:=+libopenssl +libncursesw +zlib
+  DEPENDS:=+libopenssl +libncursesw +terminfo +zlib
   TITLE:=Console mail client
   URL:=http://www.mutt.org/
 endef
@@ -44,7 +45,8 @@ CONFIGURE_ARGS += \
        --enable-pop \
        --enable-imap \
        --with-ssl \
-       --without-idn
+       --without-idn \
+       --disable-doc
 
 define Package/mutt/install
        $(INSTALL_DIR) $(1)/usr/bin
diff --git a/mail/mutt/patches/0001-no-po-and-docs.patch b/mail/mutt/patches/0001-no-po-and-docs.patch
deleted file mode 100644 (file)
index 08d6e65..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-From b0e285a8c7faaec8807fdd677da6750f341f0109 Mon Sep 17 00:00:00 2001
-From: Phil Eichinger <phil@zankapfel.net>
-Date: Thu, 19 Nov 2015 13:18:53 +0100
-Subject: [PATCH] no po and docs
-
-[adapted old patch and converted to git patch]
-Signed-off-by: Phil Eichinger <phil@zankapfel.net>
----
- Makefile.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile.in b/Makefile.in
-index 1909835..cfa7ca0 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -470,7 +470,7 @@ get_cs_cmdline = $(call get_cs_compile,$
- AUTOMAKE_OPTIONS = 1.6 foreign
- @BUILD_IMAP_TRUE@IMAP_SUBDIR = imap
- @BUILD_IMAP_TRUE@IMAP_INCLUDES = -I$(top_srcdir)/imap
--SUBDIRS = m4 po intl doc contrib $(IMAP_SUBDIR)
-+SUBDIRS = m4 intl contrib $(IMAP_SUBDIR)
- bin_SCRIPTS = muttbug flea $(SMIMEAUX_TARGET)
- @BUILD_HCACHE_TRUE@HCVERSION = hcversion.h
- BUILT_SOURCES = keymap_defs.h patchlist.c reldate.h conststrings.c $(HCVERSION)
--- 
-2.1.4
-
diff --git a/mail/mutt/patches/0001-no-po.patch b/mail/mutt/patches/0001-no-po.patch
new file mode 100644 (file)
index 0000000..51ea760
--- /dev/null
@@ -0,0 +1,26 @@
+From 6dbfafd4b8bfc9f5e53db90c5279784c506a3253 Mon Sep 17 00:00:00 2001
+From: Phil Eichinger <phil@zankapfel.net>
+Date: Tue, 17 Oct 2017 06:44:04 +0200
+Subject: [PATCH] no po
+
+docs are disabled via ./configure --disable-doc now
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 4bc2db4..bb00927 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -14,7 +14,7 @@ IMAP_SUBDIR = imap
+ IMAP_INCLUDES = -I$(top_srcdir)/imap
+ endif
+-SUBDIRS = m4 po intl $(DOC_SUBDIR) contrib $(IMAP_SUBDIR)
++SUBDIRS = m4 intl $(DOC_SUBDIR) contrib $(IMAP_SUBDIR)
+ bin_SCRIPTS = muttbug flea $(SMIMEAUX_TARGET)
+-- 
+2.11.0
+
diff --git a/mail/mutt/patches/100-CVE-2014-9116.patch b/mail/mutt/patches/100-CVE-2014-9116.patch
deleted file mode 100644 (file)
index b1cf0f9..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Antonio Radici <antonio@debian.org>
-Date: Fri, 18 Sep 2015 11:48:47 +0200
-Subject: 771125-CVE-2014-9116-jessie
-
-This patch solves the issue raised by CVE-2014-9116 in bug 771125.
-
-We correctly redefine what are the whitespace characters as per RFC5322; by
-doing so we prevent mutt_substrdup from being used in a way that could lead to
-a segfault.
-
-The lib.c part was written by Antonio Radici <antonio@debian.org> to prevent
-crashes due to this kind of bugs from happening again.
-
-Signed-off-by: Matteo F. Vescovi <mfv@debian.org>
----
- lib.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff -rupN a/lib.c b/lib.c
---- a/lib.c
-+++ b/lib.c
-@@ -815,6 +815,9 @@ char *mutt_substrdup (const char *begin,
-   size_t len;
-   char *p;
-+  if (end != NULL && end < begin)
-+    return NULL;
-+
-   if (end)
-     len = end - begin;
-   else
diff --git a/mail/nail/Makefile b/mail/nail/Makefile
new file mode 100644 (file)
index 0000000..433cfc0
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nail
+PKG_VERSION:=12.5
+PKG_RELEASE:=2
+PKG_LICENSE:=BSD-2-Clause
+
+PKG_SOURCE:=heirloom-mailx_$(PKG_VERSION).orig.tar.gz
+PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/h/heirloom-mailx/
+PKG_HASH:=015ba4209135867f37a0245d22235a392b8bbed956913286b887c2e2a9a421ad
+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))
+
diff --git a/mail/nail/patches/100-handle-openssl-without-sslv2-sslv3.patch b/mail/nail/patches/100-handle-openssl-without-sslv2-sslv3.patch
new file mode 100644 (file)
index 0000000..793bc3d
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/openssl.c
++++ b/openssl.c
+@@ -216,11 +216,17 @@ ssl_select_method(const char *uhp)
+       cp = ssl_method_string(uhp);
+       if (cp != NULL) {
++#ifndef OPENSSL_NO_SSL2
+               if (equal(cp, "ssl2"))
+                       method = SSLv2_client_method();
+-              else if (equal(cp, "ssl3"))
++              else
++#endif
++#ifndef OPENSSL_NO_SSL3
++              if (equal(cp, "ssl3"))
+                       method = SSLv3_client_method();
+-              else if (equal(cp, "tls1"))
++              else
++#endif
++              if (equal(cp, "tls1"))
+                       method = TLSv1_client_method();
+               else {
+                       fprintf(stderr, catgets(catd, CATSET, 244,
diff --git a/mail/opendkim/Makefile b/mail/opendkim/Makefile
new file mode 100644 (file)
index 0000000..9a441e6
--- /dev/null
@@ -0,0 +1,105 @@
+#
+# Copyright (C) 2017 Val Kulkov <val.kulkov@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v3.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=opendkim
+PKG_VERSION:=2.10.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
+PKG_HASH:=43a0ba57bf942095fe159d0748d8933c6b1dd1117caf0273fa9a0003215e681b
+PKG_MAINTAINER:=Val Kulkov <val.kulkov@gmail.com>
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE LICENSE.Sendmail
+
+PKG_INSTALL:=1
+PKG_BUILD_DEPENDS:=openssl
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/opendkim
+  SECTION:=mail
+  CATEGORY:=Mail
+  DEPENDS:=+libopendkim
+  TITLE:=Open source milter for providing DKIM service
+  URL:=http://opendkim.org/
+  USERID:=opendkim:opendkim
+endef
+
+define Package/opendkim/description
+  The OpenDKIM daemon application and the opendkim-genkey Perl script for generating public/private key pairs.
+endef
+
+define Package/libopendkim
+  SECTION:=mail
+  CATEGORY:=Libraries
+  DEPENDS:=+libopenssl +libmilter-sendmail
+  TITLE:=Library for signing and verifying DKIM signatures
+  URL:=http://opendkim.org/
+endef
+
+define Package/libopendkim/description
+  Library for signing and verifying DomainKeys Identified Mail (DKIM) signatures.
+endef
+
+define Package/opendkim-tools
+  SECTION:=mail
+  CATEGORY:=Mail
+  DEPENDS:=+libopendkim
+  TITLE:=genzone, testkey and testmsg tools for OpenDKIM
+  URL:=http://opendkim.org/
+endef
+
+define Package/opendkim-tools/description
+  opendkim-genzone, opendkim-testkey and opendkim-testmsg tools.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --without-db \
+       --without-gcov \
+       --without-gprof \
+       --without-lcov \
+       --with-milter=$(STAGING_DIR)/usr
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/opendkim $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/opendkim-{genkey,genzone,testkey,testmsg} $(1)/usr/sbin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopendkim.so* $(1)/usr/lib/
+endef
+
+define Package/opendkim/conffiles
+/etc/opendkim.conf
+/etc/opendkim/
+endef
+
+define Package/opendkim/install
+       $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/opendkim $(1)/etc/init.d
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/opendkim $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/opendkim-genkey $(1)/usr/sbin/opendkim-genkey.pl
+       $(INSTALL_BIN) ./files/opendkim-genkey $(1)/usr/sbin/
+       $(INSTALL_DATA) ./files/opendkim.conf.simple $(1)/etc/opendkim/
+       $(INSTALL_BIN) ./files/opendkim.init $(1)/etc/init.d/opendkim
+endef
+
+define Package/libopendkim/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopendkim.so* $(1)/usr/lib/
+endef
+
+define Package/opendkim-tools/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/opendkim-{genzone,testkey,testmsg} $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,opendkim))
+$(eval $(call BuildPackage,libopendkim))
+$(eval $(call BuildPackage,opendkim-tools))
diff --git a/mail/opendkim/files/opendkim-genkey b/mail/opendkim/files/opendkim-genkey
new file mode 100644 (file)
index 0000000..f74c49b
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ -x /usr/bin/perl ]; then
+  /usr/sbin/opendkim-genkey.pl
+else
+  echo ""
+  echo "Perl is required for running this script. Install Perl or run"
+  echo "this script on another computer that has Perl with File::Basename"
+  echo "and Getopt::Long modules installed."
+  echo ""
+fi
diff --git a/mail/opendkim/files/opendkim.conf.simple b/mail/opendkim/files/opendkim.conf.simple
new file mode 100644 (file)
index 0000000..2b3e566
--- /dev/null
@@ -0,0 +1,45 @@
+# The default location of the OpenDKIM configuration file is
+# /etc/opendkim.conf
+
+# Enable to obtain very detailed logging about the logic behind
+# the filter's decision to either sign a message or verify it
+#LogWhy                 yes
+
+# Log to syslog
+Syslog                  yes
+# Log additional entries indicating successful signing or
+# verification of messages
+SyslogSuccess           yes
+
+# the canonicalization method(s) to be used when signing messages
+Canonicalization       relaxed/relaxed
+
+# A set of domains whose mail should be signed by this filter.
+# Mail from other domains will be verified rather than being signed
+Domain                 example.com
+
+# Defines the name of the selector to be used when signing messages
+Selector               default
+KeyFile                        /etc/openkim/example.com.private
+
+UserID                 opendkim:opendkim
+Socket                  inet:8891@localhost
+
+# if using a UNIX socket, make sure that /var/run/opendkim is writable
+# to the opendkim user
+#Socket                  local:/var/run/opendkim/opendkim
+
+ReportAddress           postmaster@example.com
+SendReports             yes
+
+## Hosts to sign email for - 127.0.0.1 is default
+## See the OPERATION section of opendkim(8) for more information
+#
+# InternalHosts                192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
+
+## For secondary mailservers - indicates not to sign or verify messages
+## from these hosts
+#
+# PeerList             X.X.X.X
+
+PidFile                        /var/run/opendkim.pid
diff --git a/mail/opendkim/files/opendkim.init b/mail/opendkim/files/opendkim.init
new file mode 100755 (executable)
index 0000000..237cec7
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+
+START=54
+STOP=54
+USE_PROCD=1
+
+start_service() {
+       chown opendkim.opendkim /etc/opendkim/*.private
+       procd_open_instance
+       procd_set_param command /usr/sbin/opendkim -f
+       procd_set_param respawn
+       procd_set_param file /etc/opendkim.conf
+       procd_close_instance
+}
+
diff --git a/mail/pigeonhole/Makefile b/mail/pigeonhole/Makefile
new file mode 100644 (file)
index 0000000..9add29e
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# 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:=dovecot-pigeonhole
+PKG_VERSION_PLUGIN:=0.4.21
+PKG_VERSION_DOVECOT:=$(shell make --no-print-directory -C ../dovecot/ val.PKG_VERSION V=s)
+PKG_VERSION:=$(PKG_VERSION_DOVECOT)-$(PKG_VERSION_PLUGIN)
+PKG_RELEASE:=2
+
+DOVECOT_VERSION:=2.2
+
+PKG_SOURCE:=dovecot-$(DOVECOT_VERSION)-pigeonhole-$(PKG_VERSION_PLUGIN).tar.gz
+PKG_SOURCE_URL:=https://pigeonhole.dovecot.org/releases/$(DOVECOT_VERSION)
+PKG_HASH:=4ae09cb788c5334d167f5a89ee70b0616c3231e5904ad258ce408e4953cfdd6a
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING COPYING.LGPL
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/dovecot-$(DOVECOT_VERSION)-pigeonhole-$(PKG_VERSION_PLUGIN)
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/dovecot-pigeonhole
+  SECTION:=mail
+  CATEGORY:=Mail
+  DEPENDS:=+dovecot
+  EXTRA_DEPENDS:=dovecot (>= $(PKG_VERSION_DOVECOT))
+  TITLE:=Mail filtering facilities for Dovecot
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+  URL:=https://wiki2.dovecot.org/Pigeonhole
+endef
+
+define Package/dovecot-pigeonhole/description
+  Pigeonhole provides mail filtering facilities for Dovecot using the Sieve
+  (RFC 5228) language.
+endef
+
+CONFIGURE_ARGS += \
+  --with-dovecot=$(STAGING_DIR)/usr/lib/dovecot/
+
+CONFIGURE_VARS += \
+  LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib/dovecot/" \
+  CPPFLAGS="$(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/dovecot/"
+
+define Package/dovecot-pigeonhole/install
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/dovecot/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot/* $(1)/usr/lib/dovecot/
+       find $(1)/usr/lib/dovecot/ -name "*.a" -o -name "*.la" | xargs rm
+endef
+
+$(eval $(call BuildPackage,dovecot-pigeonhole))
index 29ce3304f07fefa5ad84f086e3e2065bad2e2f58..9d4d2389e379168e0e4dd516372a22a727bff5f2 100644 (file)
@@ -1,4 +1,4 @@
-# 
+#
 # Copyright (C) 2014-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
@@ -9,14 +9,27 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=postfix
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=ftp://ftp.porcupine.org/mirrors/postfix-release/official/
-PKG_VERSION:=3.1.3
-PKG_MD5SUM:=28a1dedbbbedfcf5fc09fd88bac116b6
+PKG_VERSION:=3.2.4
+PKG_SOURCE_URL:= \
+       https://cdn.postfix.johnriley.me/mirrors/postfix-release/official/ \
+       ftp://ftp.porcupine.org/mirrors/postfix-release/official/
+
+PKG_HASH:=ec55ebaa2aa464792af8d5ee103eb68b27a42dc2b36a02fee42dafbf9740c7f6
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
 PKG_LICENSE:=IPL-1.0
 PKG_LICENSE_FILES:=LICENSE
-PKG_BUILD_DEPENDS:=+POSTFIX_CDB:tinycdb
+PKG_BUILD_DEPENDS:=POSTFIX_CDB:tinycdb
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_POSTFIX_TLS \
+       CONFIG_POSTFIX_SASL \
+       CONFIG_POSTFIX_LDAP \
+       CONFIG_POSTFIX_CDB \
+       CONFIG_POSTFIX_DB \
+       CONFIG_POSTFIX_SQLITE \
+       CONFIG_POSTFIX_PGSQL \
+       CONFIG_POSTFIX_PCRE \
+       CONFIG_POSTFIX_EAI \
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -24,8 +37,11 @@ define Package/postfix
   SECTION:=mail
   CATEGORY:=Mail
   TITLE:=Postfix Mail Transmit Agent
+  USERID:= \
+       postfix=25:postfix=25 \
+       postdrop=26:postdrop=26
   URL:=http://www.postfix.org/
-  DEPENDS:=+POSTFIX_TLS:libopenssl +POSTFIX_SASL:libsasl2 +POSTFIX_LDAP:libopenldap +POSTFIX_DB:libdb47 +POSTFIX_EAI:icu +libpcre
+  DEPENDS:=+POSTFIX_TLS:libopenssl +POSTFIX_SASL:libsasl2 +POSTFIX_LDAP:libopenldap +POSTFIX_DB:libdb47 +POSTFIX_SQLITE:libsqlite3 +POSTFIX_PGSQL:libpq +POSTFIX_EAI:icu +POSTFIX_PCRE:libpcre
 endef
 
 define Package/postfix/description
@@ -53,28 +69,42 @@ define Package/postfix/config
                        bool "BerkeleyDB support"
                        default n
                        help
-                         Implements support for btree files using Berkeley DB. Note that hash files support is not compiled into Berkeley DB OpenWRT distribution
+                         Implements support for btree and hash files using Berkeley DB.
                config POSTFIX_CDB
                        bool "CDB support"
                        default y
                        help
                          Implements support for cdb files using tinycdb
+               config POSTFIX_SQLITE
+                       bool "SQLITE support"
+                       default y
+                       help
+                         Implements support for SQLite3 DB
+               config POSTFIX_PGSQL
+                       bool "PostgreSQL support"
+                       default n
+                       help
+                         Implement support for PostgreSQL
+               config POSTFIX_PCRE
+                       bool "PCRE support"
+                       default y
+                       help
+                         Implement support for Perl Compatible Regular Expressions
                config POSTFIX_EAI
                        bool "SMTPUTF8 support"
                        default n
                        help
-                               Enable Postfix support for Email Address Internationalization
-                               (EAI) as defined in RFC 6531 (SMTPUTF8 extension), RFC 6532
-                               (Internationalized email headers) and RFC 6533
-                               (Internationalized delivery status notifications).
-                               Since version 3.0, Postfix fully supports UTF-8 email
-                               addresses and UTF-8 message header values.
+                         Enable Postfix support for Email Address Internationalization
+                         (EAI) as defined in RFC 6531 (SMTPUTF8 extension), RFC 6532
+                         (Internationalized email headers) and RFC 6533
+                         (Internationalized delivery status notifications).
+                         Since version 3.0, Postfix fully supports UTF-8 email
+                         addresses and UTF-8 message header values.
        endmenu
 endef
 
 CCARGS=-DNO_NIS
 AUXLIBS=-L$(STAGING_DIR)/usr/lib
-default_database_type=cdb
 
 ifdef CONFIG_POSTFIX_TLS
   CCARGS+=-DUSE_TLS
@@ -94,18 +124,38 @@ endif
 ifdef CONFIG_POSTFIX_CDB
   CCARGS+=-DHAS_CDB
   AUXLIBS+=-lcdb
+  ifndef default_database_type
+    default_database_type=cdb
+  endif
 endif
 
 ifdef CONFIG_POSTFIX_DB
   AUXLIBS+=-ldb
   CCARGS+=-DHAS_DB
-  ifndef CONFIG_POSTFIX_CDB
+  ifndef default_database_type
     default_database_type=btree
   endif
 else
   CCARGS+=-DNO_DB
 endif
 
+ifdef CONFIG_POSTFIX_SQLITE
+  CCARGS+=-DHAS_SQLITE -I$(STAGING_DIR)/usr/include/
+  AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lsqlite3 -lpthread
+endif
+
+ifdef CONFIG_POSTFIX_PGSQL
+  CCARGS+=-DHAS_PGSQL -I$(STAGING_DIR)/usr/include/
+  AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lpq
+endif
+
+ifdef CONFIG_POSTFIX_PCRE
+  CCARGS+=-DHAS_PCRE -I$(STAGING_DIR)/usr/include/
+  AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lpcre
+else
+  CCARGS+=-DNO_PCRE
+endif
+
 ifdef CONFIG_POSTFIX_EAI
   AUXLIBS+=-licuuc
   CCARGS+=-DHAS_EAI
@@ -117,13 +167,12 @@ endif
 
 CCARGS+=-DDEF_DB_TYPE=\"$(default_database_type)\"
 
-config_directory=/etc/postfix# also add this to postfix init file
+# prevent postfix-install from executing postconf at build time
+# by explicitly providing the default values to postfix-install
+config_directory=/etc/postfix
 sample_directory=/etc/postfix
 command_directory=/usr/sbin
 daemon_directory=/usr/libexec/postfix
-data_directory=/usr/var/lib/postfix
-queue_directory=/usr/var/spool/postfix
-mail_spool_directory=/usr/var/mail
 html_directory=no
 manpage_directory=no
 readme_directory=no
@@ -132,66 +181,38 @@ newaliases_path=/usr/bin/newaliases
 mailq_path=/usr/bin/mailq
 shlib_directory=/usr/lib/postfix
 meta_directory=/etc/postfix
+data_directory=/usr/var/lib/postfix
+queue_directory=/usr/var/spool/postfix
+mail_spool_directory=/usr/var/mail
 
 ln_suffix=.postfix
-ln_old_suffix=.old
+ln_suffix_pre_pf=.pre-postfix
+ln_suffix_legacy=.old
 
 define Package/postfix/conffiles
-$(config_directory)/main.cf
-$(config_directory)/master.cf
-$(config_directory)/aliases
-$(config_directory)/virtual
+$(config_directory)
 endef
 
 define Build/Configure
-       if [ "$(CONFIG_POSTFIX_DB)" = "" -a "$(CONFIG_POSTFIX_CDB)" = "" ]; then\
-         echo "Build error: You must select at least one of the DB types";\
-          exit 1;\
+       if [ "$(default_database_type)" = "" ]; then \
+               echo "Build error: CDB or BerkeleyDB support must be enabled."; \
+               exit 1; \
        fi
-
        cd $(PKG_BUILD_DIR); $(MAKE) makefiles CCARGS='$(CCARGS)' $(TARGET_CONFIGURE_OPTS) AUXLIBS="$(AUXLIBS)"
 endef
 
-# Steps to regenerate files/main.cf.default:
-#
-# 1. Compile the package with current file
-# 2. Execute the following command on target device:
-#      postconf -d > /tmp/main.cf.new
-# 3. Transfer /tmp/main.cf.new file to the build system
-# 4. Execute the following command:
-#      cat /tmp/main.cf.new | ( echo '# DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE'; echo '# TEXT HERE JUST SHOWS DEFAULT SETTINGS BUILT INTO POSTFIX.'; echo '#'; grep -v ^alias_maps\ = |grep -v ^alias_database\ = |grep -v ^command_directory\ = |grep -v ^config_directory\ = |grep -v ^daemon_directory\ = |grep -v ^data_directory\ = |grep -v ^default_database_type\ = |grep -v ^html_directory\ = |grep -v ^mail_spool_directory\ = |grep -v ^mailq_path\ = |grep -v ^manpage_directory\ = |grep -v ^meta_directory\ = |grep -v ^mydomain\ = |grep -v ^myhostname\ = |grep -v ^mynetworks\ = |grep -v ^mynetworks_style\ = |grep -v ^newaliases_path\ = |grep -v ^queue_directory\ = |grep -v ^readme_directory\ = |grep -v ^sample_directory\ = |grep -v ^sendmail_path\ = |grep -v ^shlib_directory\ = |grep -v ^smtputf8_enable\ = |grep -v ^virtual_maps\ = |grep -v ^process_id\ = ) > files/main.cf.default
-# 5. Done. Now you can rebuild the package with new main.cf.default.
-#
-
 define Build/Compile
        # Currently postfix has a bug with Makefiles that CCARGS are not passed to the compiler, so we are copying them to CC as a workaround
        cd $(PKG_BUILD_DIR); $(MAKE) $(TARGET_CONFIGURE_OPTS) CC='$(TARGET_CC) $(CCARGS)'
-       cp ./files/main.cf.default $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "default_database_type = $(default_database_type)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "alias_database = $(default_database_type):$(config_directory)/aliases" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "alias_maps = $(default_database_type):$(config_directory)/aliases" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "virtual_maps = $(default_database_type):$(config_directory)/virtual" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "sendmail_path = $(sendmail_path)$(ln_suffix)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "newaliases_path = $(newaliases_path)$(ln_suffix)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "mailq_path = $(mailq_path)$(ln_suffix)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "html_directory = $(html_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "manpage_directory = $(manpage_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "sample_directory = $(sample_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "readme_directory = $(readme_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "command_directory = $(command_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "daemon_directory = $(daemon_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "data_directory = $(data_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "queue_directory = $(queue_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "config_directory = $(config_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "mail_spool_directory = $(mail_spool_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "shlib_directory = $(shlib_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "meta_directory = $(meta_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
-       echo "smtputf8_enable = $(smtputf8_conf)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       $(foreach p, \
+               default_database_type config_directory command_directory daemon_directory \
+               shlib_directory manpage_directory data_directory queue_directory \
+               mail_spool_directory, \
+       echo "$(p) = $($(p))" >> $(PKG_BUILD_DIR)/conf/main.cf;)
 endef
 
 define Package/postfix/install
        cd $(PKG_BUILD_DIR); $(MAKE) install_root=$(1) command_directory=$(command_directory) daemon_directory=$(daemon_directory) data_directory=$(data_directory) html_directory=$(html_directory) mail_owner=postfix mailq_path=$(mailq_path)$(ln_suffix) manpage_directory=$(manpage_directory) newaliases_path=$(newaliases_path)$(ln_suffix) queue_directory=$(queue_directory) readme_directory=$(readme_directory) sendmail_path=$(sendmail_path)$(ln_suffix) setgid_group=postdrop sample_directory=$(sample_directory) config_directory=$(config_directory) shlib_directory=$(shlib_directory) meta_directory=$(meta_directory) mail_version=$(PKG_VERSION) non-interactive-package
-       $(INSTALL_DIR) $(1)$(mail_spool_directory)
        $(INSTALL_DIR) $(1)/etc/init.d/
        $(INSTALL_BIN) ./files/postfix.init $(1)/etc/init.d/postfix
 endef
@@ -199,69 +220,46 @@ endef
 define Package/postfix/postinst
 #!/bin/sh
 
- if [ -f "$${IPKG_INSTROOT}$(sendmail_path)" -a "$$(readlink "$${IPKG_INSTROOT}$(sendmail_path)")" != "$(sendmail_path)$(ln_suffix)" ]; then
-  mv "$${IPKG_INSTROOT}$(sendmail_path)" "$${IPKG_INSTROOT}$(sendmail_path)$(ln_old_suffix)"
-  echo "Warning: $${IPKG_INSTROOT}$(sendmail_path) saved as $${IPKG_INSTROOT}$(sendmail_path)$(ln_old_suffix)"
- fi
- if [ ! -f "$${IPKG_INSTROOT}$(sendmail_path)" ]; then
-  ln -s "$${IPKG_INSTROOT}$(sendmail_path)$(ln_suffix)" "$(sendmail_path)"
- fi
-
- if [ -f "$${IPKG_INSTROOT}$(newaliases_path)" -a "$$(readlink "$${IPKG_INSTROOT}$(newaliases_path)")" != "$(newaliases_path)$(ln_suffix)" ]; then
-  mv "$${IPKG_INSTROOT}$(newaliases_path)" "$${IPKG_INSTROOT}$(newaliases_path)$(ln_old_suffix)"
-  echo "Warning: $${IPKG_INSTROOT}$(newaliases_path) saved as $${IPKG_INSTROOT}$(newaliases_path)$(ln_old_suffix)"
- fi
- if [ ! -f "$${IPKG_INSTROOT}$(newaliases_path)" ]; then
-  ln -s "$${IPKG_INSTROOT}$(newaliases_path)$(ln_suffix)" "$(newaliases_path)"
- fi
-
- if [ -f "$${IPKG_INSTROOT}$(mailq_path)" -a "$$(readlink "$${IPKG_INSTROOT}$(mailq_path)")" != "$(mailq_path)$(ln_suffix)" ]; then
-  mv "$${IPKG_INSTROOT}$(mailq_path)" "$${IPKG_INSTROOT}$(mailq_path)$(ln_old_suffix)"
-  echo "Warning: $${IPKG_INSTROOT}$(mailq_path) saved as $${IPKG_INSTROOT}$(mailq_path)$(ln_old_suffix)"
- fi
- if [ ! -f "$(mailq_path)" ]; then
-  ln -s "$${IPKG_INSTROOT}$(mailq_path)$(ln_suffix)" "$(mailq_path)"
- fi
-
- grep -qc main\.cf "$${IPKG_INSTROOT}"/etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/main.cf" >> "$${IPKG_INSTROOT}"/etc/sysupgrade.conf
- grep -qc master\.cf "$${IPKG_INSTROOT}"/etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/master.cf" >> "$${IPKG_INSTROOT}"/etc/sysupgrade.conf
- grep -qc aliases "$${IPKG_INSTROOT}"/etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/aliases" >> "$${IPKG_INSTROOT}"/etc/sysupgrade.conf
- grep -qc virtual "$${IPKG_INSTROOT}"/etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/virtual" >> "$${IPKG_INSTROOT}"/etc/sysupgrade.conf
-
- touch "$${IPKG_INSTROOT}$(config_directory)"/opkg_postinst
-
- if [ -z "$${IPKG_INSTROOT}" ]; then
-  ps | grep "postfix/master" | grep -cvq grep >/dev/null && /etc/init.d/postfix restart
- fi
+for syml in $(sendmail_path) $(newaliases_path) $(mailq_path); do
+  file=$${IPKG_INSTROOT}$${syml}
+  if [ -f "$${file}$(ln_suffix_legacy)" ]; then
+    # update files saved by legacy versions of Postfix postinst script
+    mv "$${file}$(ln_suffix_legacy)" "$${file}$(ln_suffix_pre_pf)"
+  fi
+  if [ -f "$${file}" ]; then
+    linktarget=$$(basename $$(readlink "$${file}"))
+    postfixf=$$(basename "$${syml}")$(ln_suffix)
+    if [ $${linktarget} != $${postfixf} ]; then
+      mv "$${file}" "$${file}$(ln_suffix_pre_pf)"
+      echo "Info: $${file} saved as $${file}$(ln_suffix_pre_pf)"
+    fi
+  fi
+  if [ ! -f "$${file}" ]; then
+    ln -s "$${syml}$(ln_suffix)" "$${file}"
+  fi
+done
+# fix file/dir ownership in data_directory and queue_directory
+if [ -z "$${IPKG_INSTROOT}" ]; then
+  postfix set-permissions
+fi
 
 endef
 
-define Package/postfix/prerm
-#!/bin/sh
- ps | grep "postfix/master" | grep -cvq grep >/dev/null && postfix stop
- /etc/init.d/postfix disable
-endef
-
 define Package/postfix/postrm
 #!/bin/sh
- rm -f $${IPKG_INSTROOT}$(config_directory)/aliases.cdb $${IPKG_INSTROOT}$(config_directory)/aliases.db $${IPKG_INSTROOT}$(data_directory)/master.lock
-
- rm -f $${IPKG_INSTROOT}$(config_directory)/virtual.cdb $${IPKG_INSTROOT}$(config_directory)/virtual.db
-
- rm -f "$${IPKG_INSTROOT}$(sendmail_path)" "$${IPKG_INSTROOT}$(newaliases_path)" "$${IPKG_INSTROOT}$(mailq_path)"
-
- if [ -f "$${IPKG_INSTROOT}$(sendmail_path)$(ln_old_suffix)" ]; then
-  mv "$${IPKG_INSTROOT}$(sendmail_path)$(ln_old_suffix)" "$${IPKG_INSTROOT}$(sendmail_path)"
-  echo "Warning: $${IPKG_INSTROOT}$(sendmail_path) restored from $${IPKG_INSTROOT}$(sendmail_path)$(ln_old_suffix)"
- fi
- if [ -f "$${IPKG_INSTROOT}$(newaliases_path)$(ln_old_suffix)" ]; then
-  mv "$${IPKG_INSTROOT}$(newaliases_path)$(ln_old_suffix)" "$${IPKG_INSTROOT}$(newaliases_path)"
-  echo "Warning: $${IPKG_INSTROOT}$(newaliases_path) restored from $${IPKG_INSTROOT}$(newaliases_path)$(ln_old_suffix)"
- fi
- if [ -f "$${IPKG_INSTROOT}$(mailq_path)$(ln_old_suffix)" ]; then
-  mv "$${IPKG_INSTROOT}$(mailq_path)$(ln_old_suffix)" "$${IPKG_INSTROOT}$(mailq_path)"
-  echo "Warning: $${IPKG_INSTROOT}$(mailq_path) restored from $${IPKG_INSTROOT}$(mailq_path)$(ln_old_suffix)"
- fi
+rm -f "$(sendmail_path)" "$(newaliases_path)" "$(mailq_path)"
+
+for syml in "$(sendmail_path)" "$(newaliases_path)" "$(mailq_path)"; do
+  file=$${IPKG_INSTROOT}$${syml}
+  if [ -f "$${file}$(ln_suffix_legacy)" ]; then
+    # update files saved by legacy versions of Postfix postinst script
+    mv "$${file}$(ln_suffix_legacy)" "$${file}$(ln_suffix_pre_pf)"
+  fi
+  if [ -f "$${syml}$(ln_suffix_pre_pf)" ]; then
+    mv "$${syml}$(ln_suffix_pre_pf)" "$${syml}"
+    echo "Info: $${syml}$(ln_suffix_pre_pf) restored as $${syml}"
+  fi
+done
 endef
 
 $(eval $(call BuildPackage,postfix))
diff --git a/mail/postfix/files/main.cf.default b/mail/postfix/files/main.cf.default
deleted file mode 100644 (file)
index 5024579..0000000
+++ /dev/null
@@ -1,856 +0,0 @@
-# DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE
-# TEXT HERE JUST SHOWS DEFAULT SETTINGS BUILT INTO POSTFIX.
-#
-2bounce_notice_recipient = postmaster
-access_map_defer_code = 450
-access_map_reject_code = 554
-address_verify_cache_cleanup_interval = 12h
-address_verify_default_transport = $default_transport
-address_verify_local_transport = $local_transport
-address_verify_map = btree:$data_directory/verify_cache
-address_verify_negative_cache = yes
-address_verify_negative_expire_time = 3d
-address_verify_negative_refresh_time = 3h
-address_verify_pending_request_limit = 5000
-address_verify_poll_count = ${stress?{1}:{3}}
-address_verify_poll_delay = 3s
-address_verify_positive_expire_time = 31d
-address_verify_positive_refresh_time = 7d
-address_verify_relay_transport = $relay_transport
-address_verify_relayhost = $relayhost
-address_verify_sender = $double_bounce_sender
-address_verify_sender_dependent_default_transport_maps = $sender_dependent_default_transport_maps
-address_verify_sender_dependent_relayhost_maps = $sender_dependent_relayhost_maps
-address_verify_sender_ttl = 0s
-address_verify_service_name = verify
-address_verify_transport_maps = $transport_maps
-address_verify_virtual_transport = $virtual_transport
-allow_mail_to_commands = alias, forward
-allow_mail_to_files = alias, forward
-allow_min_user = no
-allow_percent_hack = yes
-allow_untrusted_routing = no
-alternate_config_directories =
-always_add_missing_headers = no
-always_bcc =
-anvil_rate_time_unit = 60s
-anvil_status_update_time = 600s
-append_at_myorigin = yes
-append_dot_mydomain = ${{$compatibility_level} < {1} ? {yes} : {no}}
-application_event_drain_time = 100s
-authorized_flush_users = static:anyone
-authorized_mailq_users = static:anyone
-authorized_submit_users = static:anyone
-backwards_bounce_logfile_compatibility = yes
-berkeley_db_create_buffer_size = 16777216
-berkeley_db_read_buffer_size = 131072
-best_mx_transport =
-biff = yes
-body_checks =
-body_checks_size_limit = 51200
-bounce_notice_recipient = postmaster
-bounce_queue_lifetime = 5d
-bounce_service_name = bounce
-bounce_size_limit = 50000
-bounce_template_file =
-broken_sasl_auth_clients = no
-canonical_classes = envelope_sender, envelope_recipient, header_sender, header_recipient
-canonical_maps =
-cleanup_service_name = cleanup
-command_execution_directory =
-command_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
-command_time_limit = 1000s
-compatibility_level = 0
-confirm_delay_cleared = no
-connection_cache_protocol_timeout = 5s
-connection_cache_service_name = scache
-connection_cache_status_update_time = 600s
-connection_cache_ttl_limit = 2s
-content_filter =
-cyrus_sasl_config_path =
-daemon_table_open_error_is_fatal = no
-daemon_timeout = 18000s
-debug_peer_level = 2
-debug_peer_list =
-debugger_command =
-default_delivery_slot_cost = 5
-default_delivery_slot_discount = 50
-default_delivery_slot_loan = 3
-default_delivery_status_filter =
-default_destination_concurrency_failed_cohort_limit = 1
-default_destination_concurrency_limit = 20
-default_destination_concurrency_negative_feedback = 1
-default_destination_concurrency_positive_feedback = 1
-default_destination_rate_delay = 0s
-default_destination_recipient_limit = 50
-default_extra_recipient_limit = 1000
-default_filter_nexthop =
-default_minimum_delivery_slots = 3
-default_privs = nobody
-default_process_limit = 100
-default_rbl_reply = $rbl_code Service unavailable; $rbl_class [$rbl_what] blocked using $rbl_domain${rbl_reason?; $rbl_reason}
-default_recipient_limit = 20000
-default_recipient_refill_delay = 5s
-default_recipient_refill_limit = 100
-default_transport = smtp
-default_transport_rate_delay = 0s
-default_verp_delimiters = +=
-defer_code = 450
-defer_service_name = defer
-defer_transports =
-delay_logging_resolution_limit = 2
-delay_notice_recipient = postmaster
-delay_warning_time = 0h
-deliver_lock_attempts = 20
-deliver_lock_delay = 1s
-destination_concurrency_feedback_debug = no
-detect_8bit_encoding_header = yes
-disable_dns_lookups = no
-disable_mime_input_processing = no
-disable_mime_output_conversion = no
-disable_verp_bounces = no
-disable_vrfy_command = no
-dns_ncache_ttl_fix_enable = no
-dnsblog_reply_delay = 0s
-dnsblog_service_name = dnsblog
-dont_remove = 0
-double_bounce_sender = double-bounce
-duplicate_filter_limit = 1000
-empty_address_default_transport_maps_lookup_key = <>
-empty_address_recipient = MAILER-DAEMON
-empty_address_relayhost_maps_lookup_key = <>
-enable_long_queue_ids = no
-enable_original_recipient = yes
-error_delivery_slot_cost = $default_delivery_slot_cost
-error_delivery_slot_discount = $default_delivery_slot_discount
-error_delivery_slot_loan = $default_delivery_slot_loan
-error_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
-error_destination_concurrency_limit = $default_destination_concurrency_limit
-error_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
-error_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
-error_destination_rate_delay = $default_destination_rate_delay
-error_destination_recipient_limit = $default_destination_recipient_limit
-error_extra_recipient_limit = $default_extra_recipient_limit
-error_initial_destination_concurrency = $initial_destination_concurrency
-error_minimum_delivery_slots = $default_minimum_delivery_slots
-error_notice_recipient = postmaster
-error_recipient_limit = $default_recipient_limit
-error_recipient_refill_delay = $default_recipient_refill_delay
-error_recipient_refill_limit = $default_recipient_refill_limit
-error_service_name = error
-error_transport_rate_delay = $default_transport_rate_delay
-execution_directory_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
-expand_owner_alias = no
-export_environment = TZ MAIL_CONFIG LANG
-fallback_transport =
-fallback_transport_maps =
-fast_flush_domains = $relay_domains
-fast_flush_purge_time = 7d
-fast_flush_refresh_time = 12h
-fault_injection_code = 0
-flush_service_name = flush
-fork_attempts = 5
-fork_delay = 1s
-forward_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
-forward_path = $home/.forward${recipient_delimiter}${extension}, $home/.forward
-frozen_delivered_to = yes
-hash_queue_depth = 1
-hash_queue_names = deferred, defer
-header_address_token_limit = 10240
-header_checks =
-header_size_limit = 102400
-helpful_warnings = yes
-home_mailbox =
-hopcount_limit = 50
-ignore_mx_lookup_error = no
-import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY DISPLAY LANG=C
-in_flow_delay = 1s
-inet_interfaces = all
-inet_protocols = all
-initial_destination_concurrency = 5
-internal_mail_filter_classes =
-invalid_hostname_reject_code = 501
-ipc_idle = 5s
-ipc_timeout = 3600s
-ipc_ttl = 1000s
-line_length_limit = 2048
-lmdb_map_size = 16777216
-lmtp_address_preference = any
-lmtp_address_verify_target = rcpt
-lmtp_assume_final = no
-lmtp_bind_address =
-lmtp_bind_address6 =
-lmtp_body_checks =
-lmtp_cname_overrides_servername = no
-lmtp_connect_timeout = 0s
-lmtp_connection_cache_destinations =
-lmtp_connection_cache_on_demand = yes
-lmtp_connection_cache_time_limit = 2s
-lmtp_connection_reuse_count_limit = 0
-lmtp_connection_reuse_time_limit = 300s
-lmtp_data_done_timeout = 600s
-lmtp_data_init_timeout = 120s
-lmtp_data_xfer_timeout = 180s
-lmtp_defer_if_no_mx_address_found = no
-lmtp_delivery_slot_cost = $default_delivery_slot_cost
-lmtp_delivery_slot_discount = $default_delivery_slot_discount
-lmtp_delivery_slot_loan = $default_delivery_slot_loan
-lmtp_delivery_status_filter = $default_delivery_status_filter
-lmtp_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
-lmtp_destination_concurrency_limit = $default_destination_concurrency_limit
-lmtp_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
-lmtp_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
-lmtp_destination_rate_delay = $default_destination_rate_delay
-lmtp_destination_recipient_limit = $default_destination_recipient_limit
-lmtp_discard_lhlo_keyword_address_maps =
-lmtp_discard_lhlo_keywords =
-lmtp_dns_reply_filter =
-lmtp_dns_resolver_options =
-lmtp_dns_support_level =
-lmtp_enforce_tls = no
-lmtp_extra_recipient_limit = $default_extra_recipient_limit
-lmtp_fallback_relay =
-lmtp_generic_maps =
-lmtp_header_checks =
-lmtp_host_lookup = dns
-lmtp_initial_destination_concurrency = $initial_destination_concurrency
-lmtp_lhlo_name = $myhostname
-lmtp_lhlo_timeout = 300s
-lmtp_line_length_limit = 998
-lmtp_mail_timeout = 300s
-lmtp_mime_header_checks =
-lmtp_minimum_delivery_slots = $default_minimum_delivery_slots
-lmtp_mx_address_limit = 5
-lmtp_mx_session_limit = 2
-lmtp_nested_header_checks =
-lmtp_per_record_deadline = no
-lmtp_pix_workaround_delay_time = 10s
-lmtp_pix_workaround_maps =
-lmtp_pix_workaround_threshold_time = 500s
-lmtp_pix_workarounds = disable_esmtp,delay_dotcrlf
-lmtp_quit_timeout = 300s
-lmtp_quote_rfc821_envelope = yes
-lmtp_randomize_addresses = yes
-lmtp_rcpt_timeout = 300s
-lmtp_recipient_limit = $default_recipient_limit
-lmtp_recipient_refill_delay = $default_recipient_refill_delay
-lmtp_recipient_refill_limit = $default_recipient_refill_limit
-lmtp_reply_filter =
-lmtp_rset_timeout = 20s
-lmtp_sasl_auth_cache_name =
-lmtp_sasl_auth_cache_time = 90d
-lmtp_sasl_auth_enable = no
-lmtp_sasl_auth_soft_bounce = yes
-lmtp_sasl_mechanism_filter =
-lmtp_sasl_password_maps =
-lmtp_sasl_path =
-lmtp_sasl_security_options = noplaintext, noanonymous
-lmtp_sasl_tls_security_options = $lmtp_sasl_security_options
-lmtp_sasl_tls_verified_security_options = $lmtp_sasl_tls_security_options
-lmtp_sasl_type = cyrus
-lmtp_send_dummy_mail_auth = no
-lmtp_send_xforward_command = no
-lmtp_sender_dependent_authentication = no
-lmtp_skip_5xx_greeting = yes
-lmtp_skip_quit_response = no
-lmtp_starttls_timeout = 300s
-lmtp_tcp_port = 24
-lmtp_tls_CAfile =
-lmtp_tls_CApath =
-lmtp_tls_block_early_mail_reply = no
-lmtp_tls_cert_file =
-lmtp_tls_ciphers = medium
-lmtp_tls_dcert_file =
-lmtp_tls_dkey_file = $lmtp_tls_dcert_file
-lmtp_tls_eccert_file =
-lmtp_tls_eckey_file = $lmtp_tls_eccert_file
-lmtp_tls_enforce_peername = yes
-lmtp_tls_exclude_ciphers =
-lmtp_tls_fingerprint_cert_match =
-lmtp_tls_fingerprint_digest = md5
-lmtp_tls_force_insecure_host_tlsa_lookup = no
-lmtp_tls_key_file = $lmtp_tls_cert_file
-lmtp_tls_loglevel = 0
-lmtp_tls_mandatory_ciphers = medium
-lmtp_tls_mandatory_exclude_ciphers =
-lmtp_tls_mandatory_protocols = !SSLv2, !SSLv3
-lmtp_tls_note_starttls_offer = no
-lmtp_tls_per_site =
-lmtp_tls_policy_maps =
-lmtp_tls_protocols = !SSLv2, !SSLv3
-lmtp_tls_scert_verifydepth = 9
-lmtp_tls_secure_cert_match = nexthop
-lmtp_tls_security_level =
-lmtp_tls_session_cache_database =
-lmtp_tls_session_cache_timeout = 3600s
-lmtp_tls_trust_anchor_file =
-lmtp_tls_verify_cert_match = hostname
-lmtp_tls_wrappermode = no
-lmtp_transport_rate_delay = $default_transport_rate_delay
-lmtp_use_tls = no
-lmtp_xforward_timeout = 300s
-local_command_shell =
-local_delivery_slot_cost = $default_delivery_slot_cost
-local_delivery_slot_discount = $default_delivery_slot_discount
-local_delivery_slot_loan = $default_delivery_slot_loan
-local_delivery_status_filter = $default_delivery_status_filter
-local_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
-local_destination_concurrency_limit = 2
-local_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
-local_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
-local_destination_rate_delay = $default_destination_rate_delay
-local_destination_recipient_limit = 1
-local_extra_recipient_limit = $default_extra_recipient_limit
-local_header_rewrite_clients = permit_inet_interfaces
-local_initial_destination_concurrency = $initial_destination_concurrency
-local_minimum_delivery_slots = $default_minimum_delivery_slots
-local_recipient_limit = $default_recipient_limit
-local_recipient_maps = proxy:unix:passwd.byname $alias_maps
-local_recipient_refill_delay = $default_recipient_refill_delay
-local_recipient_refill_limit = $default_recipient_refill_limit
-local_transport = local:$myhostname
-local_transport_rate_delay = $default_transport_rate_delay
-luser_relay =
-mail_name = Postfix
-mail_owner = postfix
-mail_release_date = 20161001
-mail_version = 3.1.3
-mailbox_command =
-mailbox_command_maps =
-mailbox_delivery_lock = fcntl, dotlock
-mailbox_size_limit = 51200000
-mailbox_transport =
-mailbox_transport_maps =
-maps_rbl_domains =
-maps_rbl_reject_code = 554
-masquerade_classes = envelope_sender, header_sender, header_recipient
-masquerade_domains =
-masquerade_exceptions =
-master_service_disable =
-max_idle = 100s
-max_use = 100
-maximal_backoff_time = 4000s
-maximal_queue_lifetime = 5d
-message_drop_headers = bcc, content-length, resent-bcc, return-path
-message_reject_characters =
-message_size_limit = 10240000
-message_strip_characters =
-milter_command_timeout = 30s
-milter_connect_macros = j {daemon_name} v
-milter_connect_timeout = 30s
-milter_content_timeout = 300s
-milter_data_macros = i
-milter_default_action = tempfail
-milter_end_of_data_macros = i
-milter_end_of_header_macros = i
-milter_header_checks =
-milter_helo_macros = {tls_version} {cipher} {cipher_bits} {cert_subject} {cert_issuer}
-milter_macro_daemon_name = $myhostname
-milter_macro_defaults =
-milter_macro_v = $mail_name $mail_version
-milter_mail_macros = i {auth_type} {auth_authen} {auth_author} {mail_addr} {mail_host} {mail_mailer}
-milter_protocol = 6
-milter_rcpt_macros = i {rcpt_addr} {rcpt_host} {rcpt_mailer}
-milter_unknown_command_macros =
-mime_boundary_length_limit = 2048
-mime_header_checks = $header_checks
-mime_nesting_limit = 100
-minimal_backoff_time = 300s
-multi_instance_directories =
-multi_instance_enable = no
-multi_instance_group =
-multi_instance_name =
-multi_instance_wrapper =
-multi_recipient_bounce_reject_code = 550
-mydestination = $myhostname, localhost.$mydomain, localhost
-myorigin = $myhostname
-nested_header_checks = $header_checks
-non_fqdn_reject_code = 504
-non_smtpd_milters =
-notify_classes = resource, software
-openssl_path = openssl
-owner_request_special = yes
-parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks,permit_mx_backup_networks,qmqpd_authorized_clients,relay_domains,smtpd_access_maps
-permit_mx_backup_networks =
-pickup_service_name = pickup
-pipe_delivery_status_filter = $default_delivery_status_filter
-plaintext_reject_code = 450
-postmulti_control_commands = reload flush
-postmulti_start_commands = start
-postmulti_stop_commands = stop abort drain quick-stop
-postscreen_access_list = permit_mynetworks
-postscreen_bare_newline_action = ignore
-postscreen_bare_newline_enable = no
-postscreen_bare_newline_ttl = 30d
-postscreen_blacklist_action = ignore
-postscreen_cache_cleanup_interval = 12h
-postscreen_cache_map = btree:$data_directory/postscreen_cache
-postscreen_cache_retention_time = 7d
-postscreen_client_connection_count_limit = $smtpd_client_connection_count_limit
-postscreen_command_count_limit = 20
-postscreen_command_filter =
-postscreen_command_time_limit = ${stress?{10}:{300}}s
-postscreen_disable_vrfy_command = $disable_vrfy_command
-postscreen_discard_ehlo_keyword_address_maps = $smtpd_discard_ehlo_keyword_address_maps
-postscreen_discard_ehlo_keywords = $smtpd_discard_ehlo_keywords
-postscreen_dnsbl_action = ignore
-postscreen_dnsbl_max_ttl = ${postscreen_dnsbl_ttl?{$postscreen_dnsbl_ttl}:{1}}h
-postscreen_dnsbl_min_ttl = 60s
-postscreen_dnsbl_reply_map =
-postscreen_dnsbl_sites =
-postscreen_dnsbl_threshold = 1
-postscreen_dnsbl_timeout = 10s
-postscreen_dnsbl_whitelist_threshold = 0
-postscreen_enforce_tls = $smtpd_enforce_tls
-postscreen_expansion_filter = $smtpd_expansion_filter
-postscreen_forbidden_commands = $smtpd_forbidden_commands
-postscreen_greet_action = ignore
-postscreen_greet_banner = $smtpd_banner
-postscreen_greet_ttl = 1d
-postscreen_greet_wait = ${stress?{2}:{6}}s
-postscreen_helo_required = $smtpd_helo_required
-postscreen_non_smtp_command_action = drop
-postscreen_non_smtp_command_enable = no
-postscreen_non_smtp_command_ttl = 30d
-postscreen_pipelining_action = enforce
-postscreen_pipelining_enable = no
-postscreen_pipelining_ttl = 30d
-postscreen_post_queue_limit = $default_process_limit
-postscreen_pre_queue_limit = $default_process_limit
-postscreen_reject_footer = $smtpd_reject_footer
-postscreen_tls_security_level = $smtpd_tls_security_level
-postscreen_upstream_proxy_protocol =
-postscreen_upstream_proxy_timeout = 5s
-postscreen_use_tls = $smtpd_use_tls
-postscreen_watchdog_timeout = 10s
-postscreen_whitelist_interfaces = static:all
-prepend_delivered_header = command, file, forward
-process_id_directory = pid
-process_name = postconf
-propagate_unmatched_extensions = canonical, virtual
-proxy_interfaces =
-proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps $sender_bcc_maps $recipient_bcc_maps $smtp_generic_maps $lmtp_generic_maps $alias_maps $smtpd_client_restrictions $smtpd_helo_restrictions $smtpd_sender_restrictions $smtpd_relay_restrictions $smtpd_recipient_restrictions
-proxy_write_maps = $smtp_sasl_auth_cache_name $lmtp_sasl_auth_cache_name $address_verify_map $postscreen_cache_map
-proxymap_service_name = proxymap
-proxywrite_service_name = proxywrite
-qmgr_clog_warn_time = 300s
-qmgr_daemon_timeout = 1000s
-qmgr_fudge_factor = 100
-qmgr_ipc_timeout = 60s
-qmgr_message_active_limit = 20000
-qmgr_message_recipient_limit = 20000
-qmgr_message_recipient_minimum = 10
-qmqpd_authorized_clients =
-qmqpd_client_port_logging = no
-qmqpd_error_delay = 1s
-qmqpd_timeout = 300s
-queue_file_attribute_count_limit = 100
-queue_minfree = 0
-queue_run_delay = 300s
-queue_service_name = qmgr
-rbl_reply_maps =
-receive_override_options =
-recipient_bcc_maps =
-recipient_canonical_classes = envelope_recipient, header_recipient
-recipient_canonical_maps =
-recipient_delimiter =
-reject_code = 554
-reject_tempfail_action = defer_if_permit
-relay_clientcerts =
-relay_delivery_slot_cost = $default_delivery_slot_cost
-relay_delivery_slot_discount = $default_delivery_slot_discount
-relay_delivery_slot_loan = $default_delivery_slot_loan
-relay_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
-relay_destination_concurrency_limit = $default_destination_concurrency_limit
-relay_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
-relay_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
-relay_destination_rate_delay = $default_destination_rate_delay
-relay_destination_recipient_limit = $default_destination_recipient_limit
-relay_domains = ${{$compatibility_level} < {2} ? {$mydestination} : {}}
-relay_domains_reject_code = 554
-relay_extra_recipient_limit = $default_extra_recipient_limit
-relay_initial_destination_concurrency = $initial_destination_concurrency
-relay_minimum_delivery_slots = $default_minimum_delivery_slots
-relay_recipient_limit = $default_recipient_limit
-relay_recipient_maps =
-relay_recipient_refill_delay = $default_recipient_refill_delay
-relay_recipient_refill_limit = $default_recipient_refill_limit
-relay_transport = relay
-relay_transport_rate_delay = $default_transport_rate_delay
-relayhost =
-relocated_maps =
-remote_header_rewrite_domain =
-require_home_directory = no
-reset_owner_alias = no
-resolve_dequoted_address = yes
-resolve_null_domain = no
-resolve_numeric_domain = no
-retry_delivery_slot_cost = $default_delivery_slot_cost
-retry_delivery_slot_discount = $default_delivery_slot_discount
-retry_delivery_slot_loan = $default_delivery_slot_loan
-retry_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
-retry_destination_concurrency_limit = $default_destination_concurrency_limit
-retry_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
-retry_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
-retry_destination_rate_delay = $default_destination_rate_delay
-retry_destination_recipient_limit = $default_destination_recipient_limit
-retry_extra_recipient_limit = $default_extra_recipient_limit
-retry_initial_destination_concurrency = $initial_destination_concurrency
-retry_minimum_delivery_slots = $default_minimum_delivery_slots
-retry_recipient_limit = $default_recipient_limit
-retry_recipient_refill_delay = $default_recipient_refill_delay
-retry_recipient_refill_limit = $default_recipient_refill_limit
-retry_transport_rate_delay = $default_transport_rate_delay
-rewrite_service_name = rewrite
-send_cyrus_sasl_authzid = no
-sender_bcc_maps =
-sender_canonical_classes = envelope_sender, header_sender
-sender_canonical_maps =
-sender_dependent_default_transport_maps =
-sender_dependent_relayhost_maps =
-sendmail_fix_line_endings = always
-service_throttle_time = 60s
-setgid_group = postdrop
-show_user_unknown_table_name = yes
-showq_service_name = showq
-smtp_address_preference = any
-smtp_address_verify_target = rcpt
-smtp_always_send_ehlo = yes
-smtp_bind_address =
-smtp_bind_address6 =
-smtp_body_checks =
-smtp_cname_overrides_servername = no
-smtp_connect_timeout = 30s
-smtp_connection_cache_destinations =
-smtp_connection_cache_on_demand = no
-smtp_connection_cache_time_limit = 2s
-smtp_connection_reuse_count_limit = 0
-smtp_connection_reuse_time_limit = 300s
-smtp_data_done_timeout = 600s
-smtp_data_init_timeout = 120s
-smtp_data_xfer_timeout = 180s
-smtp_defer_if_no_mx_address_found = no
-smtp_delivery_slot_cost = $default_delivery_slot_cost
-smtp_delivery_slot_discount = $default_delivery_slot_discount
-smtp_delivery_slot_loan = $default_delivery_slot_loan
-smtp_delivery_status_filter = $default_delivery_status_filter
-smtp_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
-smtp_destination_concurrency_limit = $default_destination_concurrency_limit
-smtp_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
-smtp_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
-smtp_destination_rate_delay = $default_destination_rate_delay
-smtp_destination_recipient_limit = $default_destination_recipient_limit
-smtp_discard_ehlo_keyword_address_maps =
-smtp_discard_ehlo_keywords =
-smtp_dns_reply_filter =
-smtp_dns_resolver_options =
-smtp_dns_support_level =
-smtp_enforce_tls = no
-smtp_extra_recipient_limit = $default_extra_recipient_limit
-smtp_fallback_relay = $fallback_relay
-smtp_generic_maps =
-smtp_header_checks =
-smtp_helo_name = $myhostname
-smtp_helo_timeout = 300s
-smtp_host_lookup = dns
-smtp_initial_destination_concurrency = $initial_destination_concurrency
-smtp_line_length_limit = 998
-smtp_mail_timeout = 300s
-smtp_mime_header_checks =
-smtp_minimum_delivery_slots = $default_minimum_delivery_slots
-smtp_mx_address_limit = 5
-smtp_mx_session_limit = 2
-smtp_nested_header_checks =
-smtp_never_send_ehlo = no
-smtp_per_record_deadline = no
-smtp_pix_workaround_delay_time = 10s
-smtp_pix_workaround_maps =
-smtp_pix_workaround_threshold_time = 500s
-smtp_pix_workarounds = disable_esmtp,delay_dotcrlf
-smtp_quit_timeout = 300s
-smtp_quote_rfc821_envelope = yes
-smtp_randomize_addresses = yes
-smtp_rcpt_timeout = 300s
-smtp_recipient_limit = $default_recipient_limit
-smtp_recipient_refill_delay = $default_recipient_refill_delay
-smtp_recipient_refill_limit = $default_recipient_refill_limit
-smtp_reply_filter =
-smtp_rset_timeout = 20s
-smtp_sasl_auth_cache_name =
-smtp_sasl_auth_cache_time = 90d
-smtp_sasl_auth_enable = no
-smtp_sasl_auth_soft_bounce = yes
-smtp_sasl_mechanism_filter =
-smtp_sasl_password_maps =
-smtp_sasl_path =
-smtp_sasl_security_options = noplaintext, noanonymous
-smtp_sasl_tls_security_options = $smtp_sasl_security_options
-smtp_sasl_tls_verified_security_options = $smtp_sasl_tls_security_options
-smtp_sasl_type = cyrus
-smtp_send_dummy_mail_auth = no
-smtp_send_xforward_command = no
-smtp_sender_dependent_authentication = no
-smtp_skip_5xx_greeting = yes
-smtp_skip_quit_response = yes
-smtp_starttls_timeout = 300s
-smtp_tls_CAfile =
-smtp_tls_CApath =
-smtp_tls_block_early_mail_reply = no
-smtp_tls_cert_file =
-smtp_tls_ciphers = medium
-smtp_tls_dane_insecure_mx_policy = dane
-smtp_tls_dcert_file =
-smtp_tls_dkey_file = $smtp_tls_dcert_file
-smtp_tls_eccert_file =
-smtp_tls_eckey_file = $smtp_tls_eccert_file
-smtp_tls_enforce_peername = yes
-smtp_tls_exclude_ciphers =
-smtp_tls_fingerprint_cert_match =
-smtp_tls_fingerprint_digest = md5
-smtp_tls_force_insecure_host_tlsa_lookup = no
-smtp_tls_key_file = $smtp_tls_cert_file
-smtp_tls_loglevel = 0
-smtp_tls_mandatory_ciphers = medium
-smtp_tls_mandatory_exclude_ciphers =
-smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
-smtp_tls_note_starttls_offer = no
-smtp_tls_per_site =
-smtp_tls_policy_maps =
-smtp_tls_protocols = !SSLv2, !SSLv3
-smtp_tls_scert_verifydepth = 9
-smtp_tls_secure_cert_match = nexthop, dot-nexthop
-smtp_tls_security_level =
-smtp_tls_session_cache_database =
-smtp_tls_session_cache_timeout = 3600s
-smtp_tls_trust_anchor_file =
-smtp_tls_verify_cert_match = hostname
-smtp_tls_wrappermode = no
-smtp_transport_rate_delay = $default_transport_rate_delay
-smtp_use_tls = no
-smtp_xforward_timeout = 300s
-smtpd_authorized_verp_clients = $authorized_verp_clients
-smtpd_authorized_xclient_hosts =
-smtpd_authorized_xforward_hosts =
-smtpd_banner = $myhostname ESMTP $mail_name
-smtpd_client_auth_rate_limit = 0
-smtpd_client_connection_count_limit = 50
-smtpd_client_connection_rate_limit = 0
-smtpd_client_event_limit_exceptions = ${smtpd_client_connection_limit_exceptions:$mynetworks}
-smtpd_client_message_rate_limit = 0
-smtpd_client_new_tls_session_rate_limit = 0
-smtpd_client_port_logging = no
-smtpd_client_recipient_rate_limit = 0
-smtpd_client_restrictions =
-smtpd_command_filter =
-smtpd_data_restrictions =
-smtpd_delay_open_until_valid_rcpt = yes
-smtpd_delay_reject = yes
-smtpd_discard_ehlo_keyword_address_maps =
-smtpd_discard_ehlo_keywords =
-smtpd_dns_reply_filter =
-smtpd_end_of_data_restrictions =
-smtpd_enforce_tls = no
-smtpd_error_sleep_time = 1s
-smtpd_etrn_restrictions =
-smtpd_expansion_filter = \t\40!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~
-smtpd_forbidden_commands = CONNECT GET POST
-smtpd_hard_error_limit = ${stress?{1}:{20}}
-smtpd_helo_required = no
-smtpd_helo_restrictions =
-smtpd_history_flush_threshold = 100
-smtpd_junk_command_limit = ${stress?{1}:{100}}
-smtpd_log_access_permit_actions =
-smtpd_milters =
-smtpd_noop_commands =
-smtpd_null_access_lookup_key = <>
-smtpd_peername_lookup = yes
-smtpd_per_record_deadline = ${stress?{yes}:{no}}
-smtpd_policy_service_default_action = 451 4.3.5 Server configuration problem
-smtpd_policy_service_max_idle = 300s
-smtpd_policy_service_max_ttl = 1000s
-smtpd_policy_service_policy_context =
-smtpd_policy_service_request_limit = 0
-smtpd_policy_service_retry_delay = 1s
-smtpd_policy_service_timeout = 100s
-smtpd_policy_service_try_limit = 2
-smtpd_proxy_ehlo = $myhostname
-smtpd_proxy_filter =
-smtpd_proxy_options =
-smtpd_proxy_timeout = 100s
-smtpd_recipient_limit = 1000
-smtpd_recipient_overshoot_limit = 1000
-smtpd_recipient_restrictions =
-smtpd_reject_footer =
-smtpd_reject_unlisted_recipient = yes
-smtpd_reject_unlisted_sender = no
-smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination
-smtpd_restriction_classes =
-smtpd_sasl_auth_enable = no
-smtpd_sasl_authenticated_header = no
-smtpd_sasl_exceptions_networks =
-smtpd_sasl_local_domain =
-smtpd_sasl_path = smtpd
-smtpd_sasl_security_options = noanonymous
-smtpd_sasl_service = smtp
-smtpd_sasl_tls_security_options = $smtpd_sasl_security_options
-smtpd_sasl_type = cyrus
-smtpd_sender_login_maps =
-smtpd_sender_restrictions =
-smtpd_service_name = smtpd
-smtpd_soft_error_limit = 10
-smtpd_starttls_timeout = ${stress?{10}:{300}}s
-smtpd_timeout = ${stress?{10}:{300}}s
-smtpd_tls_CAfile =
-smtpd_tls_CApath =
-smtpd_tls_always_issue_session_ids = yes
-smtpd_tls_ask_ccert = no
-smtpd_tls_auth_only = no
-smtpd_tls_ccert_verifydepth = 9
-smtpd_tls_cert_file =
-smtpd_tls_ciphers = medium
-smtpd_tls_dcert_file =
-smtpd_tls_dh1024_param_file =
-smtpd_tls_dh512_param_file =
-smtpd_tls_dkey_file = $smtpd_tls_dcert_file
-smtpd_tls_eccert_file =
-smtpd_tls_eckey_file = $smtpd_tls_eccert_file
-smtpd_tls_eecdh_grade = strong
-smtpd_tls_exclude_ciphers =
-smtpd_tls_fingerprint_digest = md5
-smtpd_tls_key_file = $smtpd_tls_cert_file
-smtpd_tls_loglevel = 0
-smtpd_tls_mandatory_ciphers = medium
-smtpd_tls_mandatory_exclude_ciphers =
-smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
-smtpd_tls_protocols = !SSLv2, !SSLv3
-smtpd_tls_received_header = no
-smtpd_tls_req_ccert = no
-smtpd_tls_security_level =
-smtpd_tls_session_cache_database =
-smtpd_tls_session_cache_timeout = 3600s
-smtpd_tls_wrappermode = no
-smtpd_upstream_proxy_protocol =
-smtpd_upstream_proxy_timeout = 5s
-smtpd_use_tls = no
-smtputf8_autodetect_classes = sendmail, verify
-soft_bounce = no
-stale_lock_time = 500s
-stress =
-strict_7bit_headers = no
-strict_8bitmime = no
-strict_8bitmime_body = no
-strict_mailbox_ownership = yes
-strict_mime_encoding_domain = no
-strict_rfc821_envelopes = no
-strict_smtputf8 = no
-sun_mailtool_compatibility = no
-swap_bangpath = yes
-syslog_facility = mail
-syslog_name = ${multi_instance_name?{$multi_instance_name}:{postfix}}
-tcp_windowsize = 0
-tls_append_default_CA = no
-tls_daemon_random_bytes = 32
-tls_dane_digest_agility = on
-tls_dane_digests = sha512 sha256
-tls_dane_trust_anchor_digest_enable = yes
-tls_disable_workarounds =
-tls_eecdh_strong_curve = prime256v1
-tls_eecdh_ultra_curve = secp384r1
-tls_export_cipherlist = aNULL:-aNULL:HIGH:MEDIUM:LOW:EXPORT:+RC4:@STRENGTH
-tls_high_cipherlist = aNULL:-aNULL:HIGH:@STRENGTH
-tls_legacy_public_key_fingerprints = no
-tls_low_cipherlist = aNULL:-aNULL:HIGH:MEDIUM:LOW:+RC4:@STRENGTH
-tls_medium_cipherlist = aNULL:-aNULL:HIGH:MEDIUM:+RC4:@STRENGTH
-tls_null_cipherlist = eNULL:!aNULL
-tls_preempt_cipherlist = no
-tls_random_bytes = 32
-tls_random_exchange_name = ${data_directory}/prng_exch
-tls_random_prng_update_period = 3600s
-tls_random_reseed_period = 3600s
-tls_random_source = dev:/dev/urandom
-tls_session_ticket_cipher = aes-256-cbc
-tls_ssl_options =
-tls_wildcard_matches_multiple_labels = yes
-tlsmgr_service_name = tlsmgr
-tlsproxy_enforce_tls = $smtpd_enforce_tls
-tlsproxy_service_name = tlsproxy
-tlsproxy_tls_CAfile = $smtpd_tls_CAfile
-tlsproxy_tls_CApath = $smtpd_tls_CApath
-tlsproxy_tls_always_issue_session_ids = $smtpd_tls_always_issue_session_ids
-tlsproxy_tls_ask_ccert = $smtpd_tls_ask_ccert
-tlsproxy_tls_ccert_verifydepth = $smtpd_tls_ccert_verifydepth
-tlsproxy_tls_cert_file = $smtpd_tls_cert_file
-tlsproxy_tls_ciphers = $smtpd_tls_ciphers
-tlsproxy_tls_dcert_file = $smtpd_tls_dcert_file
-tlsproxy_tls_dh1024_param_file = $smtpd_tls_dh1024_param_file
-tlsproxy_tls_dh512_param_file = $smtpd_tls_dh512_param_file
-tlsproxy_tls_dkey_file = $smtpd_tls_dkey_file
-tlsproxy_tls_eccert_file = $smtpd_tls_eccert_file
-tlsproxy_tls_eckey_file = $smtpd_tls_eckey_file
-tlsproxy_tls_eecdh_grade = $smtpd_tls_eecdh_grade
-tlsproxy_tls_exclude_ciphers = $smtpd_tls_exclude_ciphers
-tlsproxy_tls_fingerprint_digest = $smtpd_tls_fingerprint_digest
-tlsproxy_tls_key_file = $smtpd_tls_key_file
-tlsproxy_tls_loglevel = $smtpd_tls_loglevel
-tlsproxy_tls_mandatory_ciphers = $smtpd_tls_mandatory_ciphers
-tlsproxy_tls_mandatory_exclude_ciphers = $smtpd_tls_mandatory_exclude_ciphers
-tlsproxy_tls_mandatory_protocols = $smtpd_tls_mandatory_protocols
-tlsproxy_tls_protocols = $smtpd_tls_protocols
-tlsproxy_tls_req_ccert = $smtpd_tls_req_ccert
-tlsproxy_tls_security_level = $smtpd_tls_security_level
-tlsproxy_use_tls = $smtpd_use_tls
-tlsproxy_watchdog_timeout = 10s
-trace_service_name = trace
-transport_maps =
-transport_retry_time = 60s
-trigger_timeout = 10s
-undisclosed_recipients_header =
-unknown_address_reject_code = 450
-unknown_address_tempfail_action = $reject_tempfail_action
-unknown_client_reject_code = 450
-unknown_helo_hostname_tempfail_action = $reject_tempfail_action
-unknown_hostname_reject_code = 450
-unknown_local_recipient_reject_code = 550
-unknown_relay_recipient_reject_code = 550
-unknown_virtual_alias_reject_code = 550
-unknown_virtual_mailbox_reject_code = 550
-unverified_recipient_defer_code = 450
-unverified_recipient_reject_code = 450
-unverified_recipient_reject_reason =
-unverified_recipient_tempfail_action = $reject_tempfail_action
-unverified_sender_defer_code = 450
-unverified_sender_reject_code = 450
-unverified_sender_reject_reason =
-unverified_sender_tempfail_action = $reject_tempfail_action
-verp_delimiter_filter = -=+
-virtual_alias_address_length_limit = 1000
-virtual_alias_domains = $virtual_alias_maps
-virtual_alias_expansion_limit = 1000
-virtual_alias_maps = $virtual_maps
-virtual_alias_recursion_limit = 1000
-virtual_delivery_slot_cost = $default_delivery_slot_cost
-virtual_delivery_slot_discount = $default_delivery_slot_discount
-virtual_delivery_slot_loan = $default_delivery_slot_loan
-virtual_delivery_status_filter = $default_delivery_status_filter
-virtual_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
-virtual_destination_concurrency_limit = $default_destination_concurrency_limit
-virtual_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
-virtual_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
-virtual_destination_rate_delay = $default_destination_rate_delay
-virtual_destination_recipient_limit = $default_destination_recipient_limit
-virtual_extra_recipient_limit = $default_extra_recipient_limit
-virtual_gid_maps =
-virtual_initial_destination_concurrency = $initial_destination_concurrency
-virtual_mailbox_base =
-virtual_mailbox_domains = $virtual_mailbox_maps
-virtual_mailbox_limit = 51200000
-virtual_mailbox_lock = fcntl, dotlock
-virtual_mailbox_maps =
-virtual_minimum_delivery_slots = $default_minimum_delivery_slots
-virtual_minimum_uid = 100
-virtual_recipient_limit = $default_recipient_limit
-virtual_recipient_refill_delay = $default_recipient_refill_delay
-virtual_recipient_refill_limit = $default_recipient_refill_limit
-virtual_transport = virtual
-virtual_transport_rate_delay = $default_transport_rate_delay
-virtual_uid_maps =
index 912f8fcf2a7eae91092a971582527a3f39d25cd0..e33c3cfab8cbf52cc3d64a39968da8939b5e6a3a 100644 (file)
@@ -9,53 +9,35 @@ EXTRA_HELP="  status  Display the service status
        flush   Force delivery: attempt to deliver every message in the deferred mail queue
        postinst Force running a script that checks for users, group, configuration, permissions, etc"
 
-config_directory="$IPKG_INSTROOT"/etc/postfix
 
 postinst() {
-       rm -f "$config_directory"/opkg_postinst
-
-       group_exists postfix || group_add postfix 87
-       user_exists postfix || user_add postfix 87
-       group_exists postdrop || group_add postdrop 88
-
-       echo "myhostname = $(uci get system.@system[0].hostname)" >> "$config_directory"/main.cf.default
-       echo "mydomain = $(uci get system.@system[0].hostname|sed -e "s/[^\.]*\.\(.*\)/\1/")" >> "$config_directory"/main.cf.default
-       (eval $(ipcalc.sh $(uci get network.lan.ipaddr) $(uci get network.lan.netmask)); echo mynetworks = 127.0.0.0/8 $NETWORK/$PREFIX) >> "$config_directory"/main.cf.default
-       echo "mynetworks_style = subnet" >> "$config_directory"/main.cf.default
-
-       grep -qc "^sendmail_path[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^sendmail_path =" "$config_directory"/main.cf.default)"
-       grep -qc "^newaliases_path[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^newaliases_path =" "$config_directory"/main.cf.default)"
-       grep -qc "^mailq_path[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mailq_path =" "$config_directory"/main.cf.default)"
-       grep -qc "^html_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^html_directory =" "$config_directory"/main.cf.default)"
-       grep -qc "^manpage_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^manpage_directory =" "$config_directory"/main.cf.default)"
-       grep -qc "^sample_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^sample_directory =" "$config_directory"/main.cf.default)"
-       grep -qc "^readme_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^readme_directory =" "$config_directory"/main.cf.default)"
-       grep -qc "^command_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^command_directory =" "$config_directory"/main.cf.default)"
-       grep -qc "^daemon_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^daemon_directory =" "$config_directory"/main.cf.default)"
-       grep -qc "^data_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^data_directory =" "$config_directory"/main.cf.default)"
-       grep -qc "^queue_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^queue_directory =" "$config_directory"/main.cf.default)"
-       grep -qc "^config_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^config_directory =" "$config_directory"/main.cf.default)"
-       grep -qc "^mail_spool_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mail_spool_directory =" "$config_directory"/main.cf.default)"
-       grep -qc "^mail_owner[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mail_owner =" "$config_directory"/main.cf.default)"
-       grep -qc "^setgid_group[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^setgid_group =" "$config_directory"/main.cf.default)"
-       grep -qc "^myhostname[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^myhostname =" "$config_directory"/main.cf.default)"
-       grep -qc "^mydomain[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mydomain =" "$config_directory"/main.cf.default)"
-       #grep -qc "^mynetworks[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mynetworks =" "$config_directory"/main.cf.default)" #Setting mynetworks_style is enough
-       grep -qc "^mynetworks_style[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mynetworks_style =" "$config_directory"/main.cf.default)"
-       grep -qc "^shlib_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^shlib_directory =" "$config_directory"/main.cf.default)"
-       grep -qc "^meta_directory[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^meta_directory =" "$config_directory"/main.cf.default)"
-       grep -qc "^smtputf8_enable[^_]" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^smtputf8_enable =" "$config_directory"/main.cf.default)"
+       if [ -z "$(postconf -nh myhostname)" ]; then
+               postconf -e "myhostname = $(uci get system.@system[0].hostname)"
+       fi
+       if [ -z "$(postconf -nh mydomain)" ]; then
+               postconf -e "mydomain = $(uci get dhcp.@dnsmasq[0].domain)"
+       fi
+       if [ -z "$(postconf -nh mynetworks_style)" ]; then
+               postconf -e "mynetworks_style = subnet"
+       fi
+       mail_spool_directory=$(postconf -h mail_spool_directory)
+       if [ ! -d $mail_spool_directory ]; then
+               mkdir -p -m 0755 $mail_spool_directory
+               chown -R postfix $mail_spool_directory
+       fi
 
        postfix set-permissions
        postfix post-install upgrade-source
        postfix upgrade-configuration
        newaliases
-       postmap "$config_directory"/virtual
+       postmap $(postconf -h config_directory)/virtual
        postfix check
 }
 
 start() {
-       test -f "$config_directory"/opkg_postinst && postinst
+       if [ -z "$(postconf -nh myhostname)" ]; then
+               postinst
+       fi
        postfix start
 }
 
@@ -64,7 +46,6 @@ stop() {
 }
 
 reload() {
-       test -f "$config_directory"/opkg_postinst && postinst
        postfix reload
 }
 
index 50581446c88a136d4659f0c90389af4cfb7ea987..4418b24e943d8d43f92108cb637d62f2a195fbc5 100644 (file)
@@ -1,7 +1,7 @@
 diff -rupN postfix-2.8.1/src/smtpd/smtpd_check.c postfix-2.8.1_patched/src/smtpd/smtpd_check.c
 --- postfix-2.8.1/src/smtpd/smtpd_check.c      2011-01-04 22:03:50.000000000 +0300
 +++ postfix-2.8.1_patched/src/smtpd/smtpd_check.c      2011-03-06 19:35:39.000000000 +0300
-@@ -5296,7 +5296,7 @@ char   *smtpd_check_queue(SMTPD_STATE *s
+@@ -5302,7 +5302,7 @@ char   *smtpd_check_queue(SMTPD_STATE *s
       */
  #define BLOCKS(x)     ((x) / fsbuf.block_size)
  
diff --git a/mail/postfix/patches/110-glibc-defs.patch b/mail/postfix/patches/110-glibc-defs.patch
new file mode 100644 (file)
index 0000000..b2d7c17
--- /dev/null
@@ -0,0 +1,19 @@
+This patch fixes the runtime error when libmilter is used with Postfix:
+"unix_send_fd: your system has no support for file descriptor passing"
+
+The issue has been fixed upstream in 20170618 update to Postfix v.3.3:
+http://postfix.1071664.n5.nabble.com/Fix-check-for-file-descriptor-passing-td90983.html
+
+This patch must be removed before compiling Postfix v.3.3.*
+
+--- a/src/util/sys_defs.h
++++ b/src/util/sys_defs.h
+@@ -804,7 +804,7 @@ extern int initgroups(const char *, int)
+ #define KERNEL_VERSION(a,b,c) (LINUX_VERSION_CODE + 1)
+ #endif
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)) \
+-      || (__GLIBC__ < 2)
++      || (defined(__GLIBC__) && __GLIBC__ < 2)
+ #define CANT_USE_SEND_RECV_MSG
+ #define DEF_SMTP_CACHE_DEMAND 0
+ #else
index 75d6411003881e31a9b30f21a80fbebe760e0e01..297c48143e45a076f62e77603cb8d58b64ce62f8 100644 (file)
@@ -37,7 +37,7 @@ diff -Naur postfix-2.10.2/conf/post-install postfix-2.10.2_patched/conf/post-ins
 diff -Naur postfix-2.10.2/postfix-install postfix-2.10.2_patched/postfix-install
 --- postfix-2.10.2/postfix-install     2012-05-22 23:40:29.000000000 +0400
 +++ postfix-2.10.2_patched/postfix-install     2013-11-19 21:12:20.694160734 +0400
-@@ -554,13 +554,13 @@
+@@ -563,13 +563,13 @@
       exit 1;;
  esac
  
@@ -58,7 +58,7 @@ diff -Naur postfix-2.10.2/postfix-install postfix-2.10.2_patched/postfix-install
  
  for path in "$html_directory" "$readme_directory" "$shlib_directory"
  do
-@@ -573,7 +573,7 @@
+@@ -582,7 +582,7 @@
  done
  
  for path in "$daemon_directory" "$data_directory" "$command_directory" "$queue_directory" \
@@ -67,7 +67,7 @@ diff -Naur postfix-2.10.2/postfix-install postfix-2.10.2_patched/postfix-install
      "$meta_directory"
  do
     case "$path" in
-@@ -780,8 +780,8 @@
+@@ -789,8 +789,8 @@
                compare_or_replace $mode "$owner" "$group" html/$file \
                    $HTML_DIRECTORY/$file || exit 1;;
        '$manpage_directory')
index 1a9d8e9d547dee8b0d370e38594a257ead86ef45..c2f98958644523b4d66d1eb9967a89162fb49bc8 100644 (file)
@@ -1,10 +1,9 @@
-diff -Naur postfix-2.11.3/src/util/dict_db.c postfix-2.11.3_patched/src/util/dict_db.c
---- postfix-2.11.3/src/util/dict_db.c  2012-01-25 04:41:08.000000000 +0400
-+++ postfix-2.11.3_patched/src/util/dict_db.c  2014-11-01 12:36:44.287641712 +0300
-@@ -687,8 +687,8 @@
+--- a/src/util/dict_db.c       2017-07-16 16:56:00.819659962 +0300
++++ b/src/util/dict_db.c       2017-07-16 16:58:31.011401358 +0300
+@@ -733,8 +733,8 @@
+       msg_fatal("create DB database: %m");
+     if (db == 0)
        msg_panic("db_create null result");
-     if ((errno = db->set_cachesize(db, 0, dict_db_cache_size, 0)) != 0)
-       msg_fatal("set DB cache size %d: %m", dict_db_cache_size);
 -    if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0)
 -      msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM);
 +//    if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0)
index 7abff3b900129b07f840a450476ae350f0983eb0..8faa125214a650f4ad6649052999249632d980ae 100644 (file)
@@ -1,7 +1,7 @@
 diff -Naur postfix-2.11.1/src/util/sys_defs.h postfix-2.11.1.patched/src/util/sys_defs.h
 --- postfix-2.11.1/src/util/sys_defs.h 2013-09-30 00:51:55.000000000 +0400
 +++ postfix-2.11.1.patched/src/util/sys_defs.h 2014-09-29 03:11:48.962277971 +0400
-@@ -769,9 +769,8 @@
+@@ -759,9 +759,8 @@
  #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK
  #define DEF_MAILBOX_LOCK "fcntl, dotlock"     /* RedHat >= 4.x */
  #define HAS_FSYNC
index 076d875df0bb584eb189be59e48f8e45fc3fe970..2d35c0f104329e7f306255a56407dfe3bb6f2a1b 100644 (file)
@@ -1,6 +1,6 @@
 --- a/makedefs 2016-01-28 12:30:14.444082390 -0500
 +++ b/makedefs 2016-01-28 13:44:02.092006512 -0500
-@@ -198,7 +198,7 @@ error() {
+@@ -210,7 +210,7 @@ error() {
  
  case $# in
   # Officially supported usage.
@@ -9,7 +9,7 @@
      RELEASE=`(uname -r) 2>/dev/null`
      # No ${x%%y} support in Solaris 11 /bin/sh
      RELEASE_MAJOR=`expr "$RELEASE" : '\([0-9]*\)'` || exit 1
-@@ -212,6 +212,15 @@ case $# in
+@@ -224,6 +224,15 @@ case $# in
  esac
  
  case "$SYSTEM.$RELEASE" in
diff --git a/mail/postfix/patches/501-include_stdio.patch b/mail/postfix/patches/501-include_stdio.patch
new file mode 100644 (file)
index 0000000..4fc3f52
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/posttls-finger/posttls-finger.c
++++ b/src/posttls-finger/posttls-finger.c
+@@ -318,6 +318,7 @@
+ #include <sys/un.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
++#include <stdio.h>
+ #ifdef STRCASECMP_IN_STRINGS_H
+ #include <strings.h>
index 0dce776fae8531172baf9e151fb6ae2f7462ecc9..7f60e1e4a07e707ff9570f3f4290787bad2371ab 100644 (file)
@@ -1,7 +1,7 @@
 diff -Naur postfix-2.11.1/postfix-install postfix-2.11.1.patched/postfix-install
 --- postfix-2.11.1/postfix-install     2014-10-05 20:43:58.598876904 +0400
 +++ postfix-2.11.1.patched/postfix-install     2014-10-05 20:47:36.076700082 +0400
-@@ -852,23 +852,23 @@
+@@ -861,23 +861,23 @@
      esac
  done
  
diff --git a/mail/postfix/patches/900_less_overlayfs_rewrites.patch b/mail/postfix/patches/900_less_overlayfs_rewrites.patch
new file mode 100644 (file)
index 0000000..6e51f74
--- /dev/null
@@ -0,0 +1,24 @@
+diff -Naur a/conf/post-install b/conf/post-install
+--- a/conf/post-install        2015-12-28 00:00:45.000000000 +0000
++++ b/conf/post-install        2017-08-01 22:42:30.476896711 +0000
+@@ -561,15 +561,16 @@
+           then
+               set_permission=1
+           fi
++          test -n "$recursive" && nonrecursive="" || nonrecursive="-maxdepth 0"
+           test -n "$set_permission" && {
+-              chown $recursive $owner $path || exit 1
+-              test -z "$group" || chgrp $recursive $group $path || exit 1
++              find $path $nonrecursive ! -user $owner -exec chown $owner "{}" ";" || exit 1
++              test -z "$group" || find $path $nonrecursive ! -group $group -exec chgrp $group "{}" ";" || exit 1
+               # Don't "chmod -R"; queue file status is encoded in mode bits.
+               if [ "$type" = "d" -a -n "$recursive" ]
+               then
+-                  find $path -type d -exec chmod $mode "{}" ";"
++                  find $path -type d -a ! -perm $mode -exec chmod $mode "{}" ";"
+               else
+-                  chmod $mode $path
++                  find $path $nonrecursive ! -perm $mode -exec chmod $mode "{}" ";"
+               fi || exit 1
+           }
+       done
diff --git a/mail/sendmail/Makefile b/mail/sendmail/Makefile
new file mode 100644 (file)
index 0000000..818fb1e
--- /dev/null
@@ -0,0 +1,134 @@
+#
+# Copyright (C) 2017 Val Kulkov <val.kulkov@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v3.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=sendmail
+PKG_VERSION:=8.15.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://artfiles.org/sendmail.org/pub/sendmail/ \
+ftp://ftp.cs.berkeley.edu/ucb/sendmail/ \
+http://www.netgull.com/sendmail/
+PKG_HASH:=24f94b5fd76705f15897a78932a5f2439a32b1a2fdc35769bb1a5f5d9b4db439
+PKG_MAINTAINER:=Val Kulkov <val.kulkov@gmail.com>
+
+PKG_LICENSE:=Sendmail
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_INSTALL:=1
+PKG_BUILD_DEPENDS:=openssl
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_OS:=OpenWrt
+SITECONFIG:=site.$(TARGET_OS).m4
+
+#
+# Uncomment the following sections that are currently commented out
+# to enable building and packaging Sendmail executables and default
+# configuration files into the "sendmail" package.
+#
+# Note that in this edition of the "sendmail" package:
+#   1. No init script is provided to start the Sendmail daemon.
+#   2. The initial configuration files in /etc/mail are likely inadequate
+#      for running the Sendmail daemon on your LEDE/OpenWrt device.
+#   3. You may have to "opkg install m4" to build Sendmail configuration files
+#      from customized mc files on your LEDE/OpenWrt device using m4, or
+#      alternatively you may use a Linux computer to build configuration
+#      files from customized mc files.
+#   4. Compiling and building the "sendmail" package will likely fail at
+#      the packaging stage if you have already selected and built the "ssmtp"
+#      package. "ssmtp" installs /usr/sbin/sendmail in the form of a symlink
+#      to /usr/sbin/ssmtp. Where /usr/sbin/sendmail is already present,
+#      copying the sendmail executable into /usr/sbin/sendmail results in
+#      an error:
+#        cp: not writing through dangling symlink
+#        ...
+#        lede/source/include/toplevel.mk:206: recipe for target 'package/feeds/packages/libmilter/compile' failed
+#
+# ANYONE WHO IS READING THIS MAKEFILE AND WHO HAS THE KNOWLEDGE AND DESIRE
+# TO COMPLETE PORTING OF SENDMAIL TO LEDE/OPENWRT PLATFORM IS ENCOURAGED
+# TO DO SO AND TAKE OVER THE MAINTAINERSHIP OF THIS PACKAGE FROM VAL KULKOV.
+#
+#define Package/sendmail
+#  SECTION:=mail
+#  CATEGORY:=Mail
+#  DEPENDS:=+libopenssl
+#  TITLE:=A general purpose internetwork mail routing facility
+#  URL:=http://sendmail.org/
+#endef
+#
+#define Package/sendmail/description
+#   Sendmail is a general purpose internetwork email routing facility that
+#   supports many kinds of mail-transfer and delivery methods, including
+#   the Simple Mail Transfer Protocol (SMTP) used for email transport over
+#   the Internet.
+#endef
+#
+#define Package/sendmail/conffiles
+#/etc/mail/helpfile
+#/etc/mail/sendmail.cf
+#/etc/mail/submit.cf
+#/etc/mail/statistics
+#endef
+
+define Package/libmilter-sendmail
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libpthread
+  TITLE:=The sendmail Mail Filter API (Milter) library
+  URL:=http://sendmail.org/
+endef
+
+define Package/libmilter-sendmail/description
+  The sendmail Mail Filter API (Milter) is designed to allow third-party
+programs access to mail messages as they are being processed in order to
+filter meta-information and content.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/Prepare
+       $(Build/Prepare/Default)
+       $(CP) files/lm_getver.c $(PKG_BUILD_DIR)/libmilter/
+       $(CP) files/$(SITECONFIG) $(PKG_BUILD_DIR)/devtools/Site/
+       $(CP) files/$(TARGET_OS) $(PKG_BUILD_DIR)/devtools/OS/
+       $(CP) files/sharedlibrary.m4 $(PKG_BUILD_DIR)/devtools/M4/UNIX/
+       $(CP) $(PKG_BUILD_DIR)/cf/cf/generic-linux.mc $(PKG_BUILD_DIR)/cf/cf/sendmail.mc
+       $(SED) 's@TARGET_CC@$(TARGET_CC)@g' $(PKG_BUILD_DIR)/devtools/Site/$(SITECONFIG)
+       $(SED) 's@TARGET_CFLAGS@$(TARGET_CFLAGS)@g' $(PKG_BUILD_DIR)/devtools/Site/$(SITECONFIG)
+endef
+
+define Build/Compile
+       $(call Build/Compile/Default,)
+       $(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/libmilter $(MAKE_FLAGS) all
+       $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/libmilter $(MAKE_FLAGS) DESTDIR="$(PKG_INSTALL_DIR)" install
+       $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/cf/cf $(MAKE_FLAGS) DESTDIR="$(PKG_INSTALL_DIR)" install-cf
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/libmilter $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libmilter/* $(1)/usr/include/libmilter/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmilter.so* $(1)/usr/lib/
+endef
+
+define Package/libmilter-sendmail/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmilter.so* $(1)/usr/lib/
+endef
+
+#define Package/sendmail/install
+#      $(INSTALL_DIR) $(1)/etc/mail $(1)/usr/bin $(1)/usr/sbin
+#      $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/mail/* $(1)/etc/mail/
+#      $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+#      $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
+#endef
+
+$(eval $(call BuildPackage,libmilter-sendmail))
+#$(eval $(call BuildPackage,sendmail))
+
diff --git a/mail/sendmail/files/OpenWrt b/mail/sendmail/files/OpenWrt
new file mode 100644 (file)
index 0000000..bdcaad2
--- /dev/null
@@ -0,0 +1,60 @@
+dnl    DO NOT EDIT THIS FILE.
+dnl    Place personal settings in devtools/Site/site.config.m4
+
+define(`confDEPEND_TYPE', `CC-M')
+define(`confCCOPTS_SO', `-fPIC')
+define(`confSM_OS_HEADER', `sm_os_linux')
+define(`confLIBS', `-ldl')
+define(`confEBINDIR', `/usr/sbin')
+define(`confMKDIR', `mkdir')
+APPENDDEF(`confLIBSEARCH', `crypt nsl')
+
+define(`confMTCCOPTS', `-D_REENTRANT')
+define(`confMTLDOPTS', `-lpthread')
+define(`confLDOPTS_SO', `-shared')
+define(`confSONAME',`-soname')
+
+define(`currentuser', esyscmd(`id -nu'))
+define(`currentgroup', esyscmd(`id -ng'))
+
+define(`confDONT_INSTALL_CATMAN',)
+define(`confNO_MAN_BUILD',)
+define(`confINCOWN', currentuser)
+define(`confINCGRP', currentgroup)
+define(`confINCMODE', `644')
+define(`confLIBOWN', currentuser)
+define(`confLIBGRP', currentgroup)
+define(`confLIBMODE', `644')
+define(`confMBINOWN', currentuser)
+define(`confMBINGRP', currentgroup)
+define(`confMBINMODE', `750')
+define(`confSBINOWN', currentuser)
+define(`confSBINGRP', currentgroup)
+define(`confSBINMODE', `755')
+define(`confUBINOWN', currentuser)
+define(`confUBINGRP', currentgroup)
+define(`confUBINMODE', `755')
+define(`confGBINOWN', currentuser)
+define(`confGBINGRP', currentgroup)
+define(`confGBINMODE', `755')
+define(`confMSPQOWN', currentuser)
+
+ifelse(confBLDVARIANT, `DEBUG',
+dnl Debug build
+`
+       define(`confOPTIMIZE',`-g -Wall')
+',
+dnl Optimized build
+confBLDVARIANT, `OPTIMIZED',
+`
+       define(`confOPTIMIZE',`-O2')
+',
+dnl Purify build
+confBLDVARIANT, `PURIFY',
+`
+       define(`confOPTIMIZE',`-g')
+',
+dnl default
+`
+       define(`confOPTIMIZE',`-O2')
+')
diff --git a/mail/sendmail/files/lm_getver.c b/mail/sendmail/files/lm_getver.c
new file mode 100644 (file)
index 0000000..c12d1e7
--- /dev/null
@@ -0,0 +1,9 @@
+#include <stdio.h>
+#include "libmilter/mfapi.h"
+int main() {
+       printf("%d.%d.%d",
+               SM_LM_VRS_MAJOR(SMFI_VERSION),
+               SM_LM_VRS_MINOR(SMFI_VERSION),
+               SM_LM_VRS_PLVL(SMFI_VERSION)
+       );
+}
diff --git a/mail/sendmail/files/sharedlibrary.m4 b/mail/sendmail/files/sharedlibrary.m4
new file mode 100644 (file)
index 0000000..2c131be
--- /dev/null
@@ -0,0 +1,25 @@
+divert(0)dnl
+include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/links.m4')dnl
+bldLIST_PUSH_ITEM(`bldC_PRODUCTS', bldCURRENT_PRODUCT)dnl
+bldPUSH_TARGET(bldCURRENT_PRODUCT.so.confSOVER)dnl
+bldPUSH_INSTALL_TARGET(`install-'bldCURRENT_PRODUCT)dnl
+bldPUSH_CLEAN_TARGET(bldCURRENT_PRODUCT`-clean')dnl
+
+include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/defines.m4')
+divert(bldTARGETS_SECTION)
+
+bldCURRENT_PRODUCT.so.confSOVER: ${BEFORE} ${bldCURRENT_PRODUCT`OBJS'}
+       ${LD} ${LDOPTS_SO} -o bldCURRENT_PRODUCT.so.confSOVER confSONAME bldCURRENT_PRODUCT.so.confSOVER ${bldCURRENT_PRODUCT`OBJS'}
+ifdef(`bldLINK_SOURCES', `bldMAKE_SOURCE_LINKS(bldLINK_SOURCES)')
+
+install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT.so.confSOVER
+
+ifdef(`bldINSTALLABLE', `      ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${LIBDIR} ]; then confMKDIR -p ${DESTDIR}${LIBDIR}; else :; fi ')
+       ${LN} ${LNOPTS} bldCURRENT_PRODUCT.so.confSOVER ${DESTDIR}${LIBDIR}/bldCURRENT_PRODUCT.so
+       ${INSTALL} -c -m 644 bldCURRENT_PRODUCT.so.confSOVER ${DESTDIR}${LIBDIR}')
+
+bldCURRENT_PRODUCT-clean:
+       rm -f ${OBJS} bldCURRENT_PRODUCT.so* ${MANPAGES}
+
+divert(0)
+COPTS+= confCCOPTS_SO
diff --git a/mail/sendmail/files/site.OpenWrt.m4 b/mail/sendmail/files/site.OpenWrt.m4
new file mode 100644 (file)
index 0000000..9c485e4
--- /dev/null
@@ -0,0 +1,5 @@
+define(`confCC', `TARGET_CC')
+define(`confCCOPTS', `TARGET_CFLAGS')
+APPENDDEF(`confENVDEF',`-DSTARTTLS')
+APPENDDEF(`confLIBS', `-lssl -lcrypto')
+
diff --git a/mail/sendmail/patches/010-enable-nonroot-install.patch b/mail/sendmail/patches/010-enable-nonroot-install.patch
new file mode 100644 (file)
index 0000000..ff6e8b3
--- /dev/null
@@ -0,0 +1,17 @@
+Index: sendmail-8.15.2/cf/cf/Makefile
+===================================================================
+--- sendmail-8.15.2.orig/cf/cf/Makefile
++++ sendmail-8.15.2/cf/cf/Makefile
+@@ -80,10 +80,10 @@ install:
+ install-cf:  install-sendmail-cf install-submit-cf
+ install-sendmail-cf: $(CF).cf
+-      $(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(CF).cf ${DESTDIR}$(MAILDIR)/sendmail.cf
++      $(INSTALL) -c -m $(CFMODE) $(CF).cf ${DESTDIR}$(MAILDIR)/sendmail.cf
+ install-submit-cf: $(SUBMIT).cf
+-      $(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(SUBMIT).cf ${DESTDIR}$(MAILDIR)/submit.cf
++      $(INSTALL) -c -m $(CFMODE) $(SUBMIT).cf ${DESTDIR}$(MAILDIR)/submit.cf
+ depend:
diff --git a/mail/sendmail/patches/011-libmilter-so-version.patch b/mail/sendmail/patches/011-libmilter-so-version.patch
new file mode 100644 (file)
index 0000000..fdd5eee
--- /dev/null
@@ -0,0 +1,16 @@
+Index: sendmail-8.15.2/libmilter/Makefile.m4
+===================================================================
+--- sendmail-8.15.2.orig/libmilter/Makefile.m4
++++ sendmail-8.15.2/libmilter/Makefile.m4
+@@ -9,7 +9,10 @@ define(`confMT', `true')
+ SMSRCDIR=ifdef(`confSMSRCDIR', `confSMSRCDIR', `${SRCDIR}/sendmail')
+ PREPENDDEF(`confINCDIRS', `-I${SMSRCDIR} ')
+-bldPRODUCT_START(`library', `libmilter')
++# obtain libmilter version
++define(`confSOVER', `esyscmd(`gcc -I../include -o lm_getver lm_getver.c && ./lm_getver')')
++
++bldPRODUCT_START(`sharedlibrary', `libmilter')
+ define(`bldINSTALLABLE', `true')
+ define(`LIBMILTER_EXTRAS', `errstring.c strl.c')
+ APPENDDEF(`confENVDEF', `-DNOT_SENDMAIL -Dsm_snprintf=snprintf')
diff --git a/mail/sendmail/patches/100-misc-os-musl-fixes.patch b/mail/sendmail/patches/100-misc-os-musl-fixes.patch
new file mode 100644 (file)
index 0000000..dbe1517
--- /dev/null
@@ -0,0 +1,49 @@
+--- a/include/sm/conf.h
++++ b/include/sm/conf.h
+@@ -57,7 +57,7 @@
+ # endif /* ! HASNICE */
+ # ifndef HASRRESVPORT
+-#  define HASRRESVPORT        1       /* has rrsevport(3) call */
++#  define HASRRESVPORT        0       /* has rrsevport(3) call */
+ # endif /* ! HASRRESVPORT */
+ /**********************************************************************
+@@ -1470,7 +1470,9 @@ extern void              *malloc();
+ #  define SM_CONF_GETOPT      0       /* need a replacement for getopt(3) */
+ #  define HASUNAME    1       /* use System V uname(2) system call */
+ #  define HASUNSETENV 1       /* has unsetenv(3) call */
+-#  define ERRLIST_PREDEFINED  /* don't declare sys_errlist */
++#  ifdef __GLIBC__
++#   define ERRLIST_PREDEFINED /* don't declare sys_errlist */
++#  endif /* __GLIBC__ */
+ #  define GIDSET_T    gid_t   /* from <linux/types.h> */
+ #  ifndef HASGETUSERSHELL
+ #   define HASGETUSERSHELL 0  /* getusershell(3) broken in Slackware 2.0 */
+@@ -1508,6 +1510,7 @@ extern void              *malloc();
+ #  if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+ #   define HASSTRERROR        1       /* has strerror(3) */
+ #  endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */
++#  define HASSTRERROR 1       /* Patch for LEDE/OpenWRT: has strerror(3) */
+ #  ifndef TZ_TYPE
+ #   define TZ_TYPE    TZ_NONE         /* no standard for Linux */
+ #  endif /* ! TZ_TYPE */
+--- a/devtools/bin/Build
++++ b/devtools/bin/Build
+@@ -320,6 +320,16 @@ then
+       rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
+ fi
++#
++# LEDE/OpenWrt build system
++#
++if [ -n "$STAGING_DIR" -a -n "$OPENWRT_BUILD" ]
++then
++      os="OpenWrt"
++      rel="any"
++      arch="any"
++fi
++
+ if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
+ then
+       arch=`uname -m | sed -e 's/ //g' -e 's/\//-/g'`
diff --git a/mail/sendmail/patches/101-fix-format-security.patch b/mail/sendmail/patches/101-fix-format-security.patch
new file mode 100644 (file)
index 0000000..f559d96
--- /dev/null
@@ -0,0 +1,109 @@
+Index: sendmail-8.15.2/sendmail/envelope.c
+===================================================================
+--- sendmail-8.15.2.orig/sendmail/envelope.c
++++ sendmail-8.15.2/sendmail/envelope.c
+@@ -323,7 +323,7 @@ dropenvelope(e, fulldrop, split)
+                       /* don't free, allocated from e_rpool */
+                       e->e_message = sm_rpool_strdup_x(e->e_rpool, buf);
+-                      message(buf);
++                      message("%s", buf);
+                       e->e_flags |= EF_CLRQUEUE;
+               }
+               if (msg_timeout == MSG_NOT_BY)
+@@ -420,7 +420,7 @@ dropenvelope(e, fulldrop, split)
+                               /* don't free, allocated from e_rpool */
+                               e->e_message = sm_rpool_strdup_x(e->e_rpool,
+                                                                buf);
+-                              message(buf);
++                              message("%s", buf);
+                               e->e_flags |= EF_WARNING;
+                       }
+                       if (msg_timeout == MSG_WARN_BY)
+Index: sendmail-8.15.2/sendmail/parseaddr.c
+===================================================================
+--- sendmail-8.15.2.orig/sendmail/parseaddr.c
++++ sendmail-8.15.2/sendmail/parseaddr.c
+@@ -218,7 +218,7 @@ parseaddr(addr, a, flags, delim, delimpt
+                       msg = "Deferring message until queue run";
+               if (tTd(20, 1))
+                       sm_dprintf("parseaddr: queueing message\n");
+-              message(msg);
++              message("%s", msg);
+               if (e->e_message == NULL && e->e_sendmode != SM_DEFER)
+                       e->e_message = sm_rpool_strdup_x(e->e_rpool, msg);
+               a->q_state = QS_QUEUEUP;
+Index: sendmail-8.15.2/sendmail/srvrsmtp.c
+===================================================================
+--- sendmail-8.15.2.orig/sendmail/srvrsmtp.c
++++ sendmail-8.15.2/sendmail/srvrsmtp.c
+@@ -578,13 +578,13 @@ static bool      smtp_data __P((SMTP_T *, ENV
+                               bool tsave = QuickAbort;                \
+                                                                       \
+                               QuickAbort = false;                     \
+-                              usrerr(response);                       \
++                              usrerr("%s", response);                 \
+                               QuickAbort = tsave;                     \
+                               e->e_sendqueue = NULL;                  \
+                               goto doquit;                            \
+                       }                                               \
+                       else                                            \
+-                              usrerr(response);                       \
++                              usrerr("%s", response);                 \
+                       break;                                          \
+                                                                       \
+                 case SMFIR_REJECT:                                    \
+@@ -615,7 +615,7 @@ static bool        smtp_data __P((SMTP_T *, ENV
+                                         str, addr, MSG_TEMPFAIL);     \
+                               LogUsrErrs = false;                     \
+                       }                                               \
+-                      usrerr(MSG_TEMPFAIL);                           \
++                      usrerr("%s", MSG_TEMPFAIL);                             \
+                       break;                                          \
+                 default:                                              \
+                       milter_cmd_fail = false;                        \
+@@ -931,7 +931,7 @@ smtp(nullserver, d_flags, e)
+       }
+       else if (strncmp(nullserver, "421 ", 4) == 0)
+       {
+-              message(nullserver);
++              message("%s", nullserver);
+               goto doquit;
+       }
+@@ -1849,7 +1849,7 @@ smtp(nullserver, d_flags, e)
+                               if (nullserver != NULL)
+                               {
+                                       if (ISSMTPREPLY(nullserver))
+-                                              usrerr(nullserver);
++                                              usrerr("%s", nullserver);
+                                       else
+                                               usrerr("550 5.0.0 %s",
+                                                      nullserver);
+@@ -2452,7 +2452,7 @@ smtp(nullserver, d_flags, e)
+                                       tempfail = true;
+                                       smtp.sm_milterize = false;
+                                       if (response != NULL)
+-                                              usrerr(response);
++                                              usrerr("%s", response);
+                                       else
+                                               message("421 4.7.0 %s closing connection",
+                                                       MyHostName);
+@@ -3659,7 +3659,7 @@ smtp_data(smtp, e)
+                               (void) extenhsc(response + 4, ' ', e->e_enhsc);
+ #endif /* _FFR_MILTER_ENHSC */
+-                      usrerr(response);
++                      usrerr("%s", response);
+                       if (strncmp(response, "421 ", 4) == 0
+                           || strncmp(response, "421-", 4) == 0)
+                       {
+@@ -3779,7 +3779,7 @@ smtp_data(smtp, e)
+                       if (ISSMTPCODE(response))
+                               (void) extenhsc(response + 4, ' ', e->e_enhsc);
+ #endif /* _FFR_MILTER_ENHSC */
+-                      usrerr(response);
++                      usrerr("%s", response);
+                       if (strncmp(response, "421 ", 4) == 0
+                           || strncmp(response, "421-", 4) == 0)
+                               rv = false;
diff --git a/mail/sendmail/patches/102-pthreads-stack-size.patch b/mail/sendmail/patches/102-pthreads-stack-size.patch
new file mode 100644 (file)
index 0000000..a2e10d6
--- /dev/null
@@ -0,0 +1,48 @@
+This patch increases the stack size for pthreads from 80 KB, the default
+stack size for musl libc, to 2 MB. The default stack size for glibc is 8 MB.
+
+OpenDKIM, an application that depends on libmilter, segfaults if the stack
+size for pthreads is left unchanged at the musl default value of 80 KB.
+Apparently, OpenDKIM allocates blocks of 64 KB multiple times, which causes
+libmilter and therefore OpenDKIM to crash:
+https://git.alpinelinux.org/cgit/aports/commit/?id=95724d1bd53ae87f72e6388cb7323dbd8f84be9d
+
+This patch follows the patch suggested by an Alpine Linux user in bug report
+above. Also, a bug report has been filed upstream:
+https://sourceforge.net/p/opendkim/bugs/258/
+
+
+Index: sendmail-8.15.2/libmilter/libmilter.h
+===================================================================
+--- sendmail-8.15.2.orig/libmilter/libmilter.h
++++ sendmail-8.15.2/libmilter/libmilter.h
+@@ -127,10 +127,10 @@ struct smfi_str
+ # define MI_SOCK_READ(s, b, l)        read(s, b, l)
+ # define MI_SOCK_READ_FAIL(x) ((x) < 0)
+ # define MI_SOCK_WRITE(s, b, l)       write(s, b, l)
+-
+-# define thread_create(ptid,wr,arg) pthread_create(ptid, NULL, wr, arg)
+ # define sthread_get_id()     pthread_self()
++extern int thread_create(pthread_t *ptid, void *(*wr) (void *), void *arg);
++
+ typedef pthread_mutex_t smutex_t;
+ # define smutex_init(mp)      (pthread_mutex_init(mp, NULL) == 0)
+ # define smutex_destroy(mp)   (pthread_mutex_destroy(mp) == 0)
+Index: sendmail-8.15.2/libmilter/main.c
+===================================================================
+--- sendmail-8.15.2.orig/libmilter/main.c
++++ sendmail-8.15.2/libmilter/main.c
+@@ -16,6 +16,12 @@ SM_RCSID("@(#)$Id: main.c,v 8.85 2013-11
+ #include <fcntl.h>
+ #include <sys/stat.h>
++int thread_create(pthread_t *ptid, void *(*wr) (void *), void *arg) {
++      pthread_attr_t attr;
++      pthread_attr_init(&attr);
++      pthread_attr_setstacksize(&attr,2*1024*1024);
++      return pthread_create(ptid, &attr, wr, arg);
++}
+ static smfiDesc_ptr smfi = NULL;
diff --git a/mail/sendmail/patches/103-create-install-dirs.patch b/mail/sendmail/patches/103-create-install-dirs.patch
new file mode 100644 (file)
index 0000000..fa99810
--- /dev/null
@@ -0,0 +1,42 @@
+--- a/sendmail/Makefile.m4
++++ b/sendmail/Makefile.m4
+@@ -71,6 +71,7 @@ install-set-user-id: bldCURRENT_PRODUCT
+       ${INSTALL} -c -o ${S`'BINOWN} -g ${S`'BINGRP} -m ${S`'BINMODE} bldCURRENT_PRODUCT ${DESTDIR}${M`'BINDIR}
+       for i in ${sendmailTARGET_LINKS}; do \
+               rm -f $$i; \
++              mkdir -p $$(dirname $$i); \
+               ${LN} ${LNOPTS} ${M`'BINDIR}/sendmail $$i; \
+       done
+@@ -79,6 +80,7 @@ install-sm-mta: bldCURRENT_PRODUCT
+       ${INSTALL} -c -o ${M`'BINOWN} -g ${M`'BINGRP} -m ${M`'BINMODE} bldCURRENT_PRODUCT ${DESTDIR}${M`'BINDIR}/sm-mta
+       for i in confMTA_LINKS; do \
+               rm -f $$i; \
++              mkdir -p $$(dirname $$i); \
+               ${LN} ${LNOPTS} ${M`'BINDIR}/sm-mta $$i; \
+       done
+--- a/devtools/M4/UNIX/links.m4
++++ b/devtools/M4/UNIX/links.m4
+@@ -23,6 +23,7 @@ define(`bldMAKE_SOURCE_LINKS',
+ define(`bldMAKE_TARGET_LINKS',
+ `     for i in $2; do \
+               rm -f $$i; \
++              mkdir -p $$(dirname $$i); \
+               ln -s $1 $$i; \
+       done'
+ )dnl
+--- a/cf/cf/Makefile
++++ b/cf/cf/Makefile
+@@ -80,9 +80,11 @@ install:
+ install-cf:  install-sendmail-cf install-submit-cf
+ install-sendmail-cf: $(CF).cf
++      mkdir -p ${DESTDIR}$(MAILDIR)
+       $(INSTALL) -c -m $(CFMODE) $(CF).cf ${DESTDIR}$(MAILDIR)/sendmail.cf
+ install-submit-cf: $(SUBMIT).cf
++      mkdir -p ${DESTDIR}$(MAILDIR)
+       $(INSTALL) -c -m $(CFMODE) $(SUBMIT).cf ${DESTDIR}$(MAILDIR)/submit.cf
+ depend:
index 22db52a04867387aad8c270f34e2b5684cf64230..fb976d5e63439d5a658695b01f6fd3963b669675 100644 (file)
@@ -15,13 +15,13 @@ PKG_LICENSE:=GPL-2.0+
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.bz2
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/s/ssmtp
-PKG_MD5SUM:=22c37dc90c871e8e052b2cab0ad219d010fa938608cd66b21c8f3c759046fa36
+PKG_HASH:=22c37dc90c871e8e052b2cab0ad219d010fa938608cd66b21c8f3c759046fa36
 
 include $(INCLUDE_DIR)/package.mk
 
 TARGET_CFLAGS += $(TARGET_CPPFLAGS)
 
-define Package/$(PKG_NAME)
+define Package/ssmtp
        SECTION:=mail
        CATEGORY:=Mail
        DEPENDS:=+libopenssl
@@ -29,14 +29,14 @@ define Package/$(PKG_NAME)
        URL:=http://packages.debian.org/ssmtp
 endef
 
-define Package/$(PKG_NAME)/description
+define Package/ssmtp/description
 A secure, effective and simple way of getting mail off a system to your mail hub.
 Mail is simply forwarded to the configured mailhost, no daemons running in the background.
 Extremely easy configuration.
 
 endef
 
-define Package/$(PKG_NAME)/conffiles
+define Package/ssmtp/conffiles
 /etc/ssmtp/ssmtp.conf
 /etc/ssmtp/revaliases
 endef
@@ -47,7 +47,7 @@ CONFIGURE_VARS += \
 CONFIGURE_ARGS += \
        --enable-ssl
 
-define Package/$(PKG_NAME)/install
+define Package/ssmtp/install
        $(INSTALL_DIR) $(1)/etc/ssmtp
        $(INSTALL_CONF) $(PKG_BUILD_DIR)/ssmtp.conf $(1)/etc/ssmtp/
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/revaliases $(1)/etc/ssmtp/
@@ -56,4 +56,4 @@ define Package/$(PKG_NAME)/install
        ln -s /usr/sbin/ssmtp $(1)/usr/sbin/sendmail
 endef
 
-$(eval $(call BuildPackage,$(PKG_NAME)))
+$(eval $(call BuildPackage,ssmtp))
index edd5f7660fa6241baa5ed2dc6d50a58984331fdc..f2b80d9ee621fa988b23c34c24bda3b63af58930 100644 (file)
@@ -17,6 +17,7 @@ PKG_LICENSE:=GPL-3.0
 
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MIRROR_HASH:=8d887996b6b8cb465ec59f3f713fca46161cbb804cacd2b5405f836083fb58ba
 PKG_SOURCE_URL:=https://github.com/j0sh/crtmpserver.git
 PKG_SOURCE_SUBDIR:=crtmpserver-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=$(PKG_REV)
index d2ab7d1f0d5b5bf9be2a90667b8c9c4b3a31b2eb..ebe6e29342632be226b499de2a256b538f4746e6 100644 (file)
@@ -1,9 +1,37 @@
 if PACKAGE_libffmpeg-custom
 
+comment "Build Licensing"
+
+config FFMPEG_CUSTOM_GPL
+       bool "Allow use of GPL code"
+       help
+               By default, FFMpeg is licensed under the LGPL. This builds a GPL licensed version.
+               Some software requires this, such as libx264.
+       default y
+
+config FFMPEG_CUSTOM_GPLV3
+       bool "Use (L)GPL v3"
+       help
+               Uses the LPGL v3 if GPL isn't selected, or GPL v3 if it is.
+
+config FFMPEG_CUSTOM_NONFREE
+       bool "Use code with complex licensing requirements; see help"
+       help
+               This sets --enable-nonfree, which in almost all cases, will prohibit redistribution of the resulting package.
+               Use this with care.
+       default n
+
 config FFMPEG_CUSTOM_PATENTED
        bool "Include patented codecs and technologies"
        default BUILD_PATENTED
 
+comment "Build Properties"
+
+config FFMPEG_CUSTOM_LARGE
+       bool "Build libffmpeg for performance instead of minimizing size on disk"
+       default y if ( x86_64 )
+       default n
+
 comment "Profiles"
 
 config FFMPEG_CUSTOM_FFSERVER_SUPPORT
@@ -15,13 +43,13 @@ config FFMPEG_CUSTOM_FFSERVER_SUPPORT
 
 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_h264 if (BUILD_PATENTED)
+       select FFMPEG_CUSTOM_DECODER_hevc if (BUILD_PATENTED)
        select FFMPEG_CUSTOM_DECODER_jpegls
+       select FFMPEG_CUSTOM_DECODER_mp2
        select FFMPEG_CUSTOM_DECODER_mp3
        select FFMPEG_CUSTOM_DECODER_mpeg1video
        select FFMPEG_CUSTOM_DECODER_mpeg2video
@@ -29,7 +57,7 @@ config FFMPEG_CUSTOM_MINIDLNA_SUPPORT
        select FFMPEG_CUSTOM_DECODER_mpegvideo
        select FFMPEG_CUSTOM_DECODER_png
        select FFMPEG_CUSTOM_DECODER_opus
-       select FFMPEG_CUSTOM_DECODER_vc1
+       select FFMPEG_CUSTOM_DECODER_vc1 if (BUILD_PATENTED)
        select FFMPEG_CUSTOM_DECODER_vorbis
        select FFMPEG_CUSTOM_DECODER_wmav1
        select FFMPEG_CUSTOM_DECODER_wmav2
@@ -38,6 +66,7 @@ config FFMPEG_CUSTOM_MINIDLNA_SUPPORT
        select FFMPEG_CUSTOM_DEMUXER_matroska
        select FFMPEG_CUSTOM_DEMUXER_mov
        select FFMPEG_CUSTOM_DEMUXER_mp3
+       select FFMPEG_CUSTOM_DEMUXER_mpegps
        select FFMPEG_CUSTOM_DEMUXER_mpegts
        select FFMPEG_CUSTOM_DEMUXER_mpegvideo
        select FFMPEG_CUSTOM_DEMUXER_ogg
@@ -45,7 +74,6 @@ config FFMPEG_CUSTOM_MINIDLNA_SUPPORT
 
 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
@@ -54,7 +82,7 @@ config FFMPEG_CUSTOM_AUDIO_DEC_SUPPORT
        select FFMPEG_CUSTOM_DECODER_amrnb
        select FFMPEG_CUSTOM_DECODER_amrwb
        select FFMPEG_CUSTOM_DECODER_ape
-       select FFMPEG_CUSTOM_DECODER_atrac3
+       select FFMPEG_CUSTOM_DECODER_atrac3 if (BUILD_PATENTED)
        select FFMPEG_CUSTOM_DECODER_flac
        select FFMPEG_CUSTOM_DECODER_mp2
        select FFMPEG_CUSTOM_DECODER_mp3
@@ -91,12 +119,6 @@ config FFMPEG_CUSTOM_AUDIO_DEC_SUPPORT
        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
@@ -105,32 +127,38 @@ config FFMPEG_CUSTOM_AUDIO_DEC_SUPPORT
 
 comment "External Libraries"
 
-config FFMPEG_CUSTOM_SELECT_mp3lame
-       bool "MP3 LAME"
+config FFMPEG_CUSTOM_SELECT_libfdk-aac
+       bool "Fraunhofer FDK AAC encoding library (libfdk-aac)"
+       depends on FFMPEG_CUSTOM_NONFREE
        depends on FFMPEG_CUSTOM_PATENTED
+       depends on PACKAGE_fdk-aac
+
+config FFMPEG_CUSTOM_SELECT_libmp3lame
+       bool "Libmp3lame"
        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"
+       bool "Libopus"
 
-config FFMPEG_CUSTOM_SELECT_x264
-       bool "x264"
+config FFMPEG_CUSTOM_SELECT_libshine
+       bool "Libshine"
+
+config FFMPEG_CUSTOM_SELECT_libx264
+       bool "Libx264"
        depends on FFMPEG_CUSTOM_PATENTED
+       depends on FFMPEG_CUSTOM_GPL
        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"
@@ -140,11 +168,9 @@ config FFMPEG_CUSTOM_ENCODER_mpeg1video
 
 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"
@@ -166,16 +192,12 @@ 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"
@@ -197,7 +219,6 @@ config FFMPEG_CUSTOM_DECODER_atrac3
 
 config FFMPEG_CUSTOM_DECODER_flac
        bool "FLAC"
-       select FFMPEG_CUSTOM_PARSER_flac
 
 config FFMPEG_CUSTOM_DECODER_gif
        bool "GIF"
@@ -215,11 +236,9 @@ config FFMPEG_CUSTOM_DECODER_jpegls
 
 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
+       bool "MP3 (MPEG Audio Layer 3)"
 
 config FFMPEG_CUSTOM_DECODER_mpegvideo
        bool "MPEG Video"
@@ -229,11 +248,9 @@ config FFMPEG_CUSTOM_DECODER_mpeg1video
 
 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"
@@ -269,11 +286,9 @@ config FFMPEG_CUSTOM_DECODER_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"
@@ -282,7 +297,6 @@ comment "Muxers"
 
 config FFMPEG_CUSTOM_MUXER_ac3
        bool "AC3"
-       depends on FFMPEG_CUSTOM_PATENTED
 
 config FFMPEG_CUSTOM_MUXER_ffm
        bool "FFM (ffserver live feed)"
@@ -357,10 +371,9 @@ config FFMPEG_CUSTOM_DEMUXER_mov
 
 config FFMPEG_CUSTOM_DEMUXER_mp3
        bool "MP3 (MPEG Audio Layer 3)"
-       select FFMPEG_CUSTOM_PARSER_mpegaudio
 
 config FFMPEG_CUSTOM_DEMUXER_mpegvideo
-       bool "MPEG Video"
+       bool "MPEG Video (Raw)"
 
 config FFMPEG_CUSTOM_DEMUXER_mpegps
        bool "MPEG-2 (PS)"
@@ -409,7 +422,6 @@ comment "Parsers"
 
 config FFMPEG_CUSTOM_PARSER_aac
        bool "AAC (Advanced Audio Coding)"
-       depends on FFMPEG_CUSTOM_PATENTED
 
 config FFMPEG_CUSTOM_PARSER_ac3
        bool "AC3"
index f87401444dc7ecbc4ff1bd51abf8093803253303..023144a576edac795ee16836b1d0f7fccc1fc1c2 100644 (file)
@@ -1,5 +1,6 @@
 #
-# Copyright (C) 2006-2017 OpenWrt.org
+# Copyright (C) 2017 Ian Leonard <antonlacon@gmail.com>
+# Copyright (C) 2018 Ted Hess <thess@kitschensync.net>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,14 +9,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ffmpeg
-PKG_VERSION:=3.2.2
+PKG_VERSION:=3.2.10
 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_HASH:=3c1626220c7b68ff6be7312559f77f3c65ff6809daf645d4470ac0189926bdbc
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
+               Ian Leonard <antonlacon@gmail.com>
 
 PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3
 PKG_LICENSE_FILES:=COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1 COPYING.LGPLv3
@@ -119,12 +120,10 @@ FFMPEG_CUSTOM_PROTOCOLS:= \
        file http icecast pipe rtp tcp udp
 
 FFMPEG_MINI_DECODERS:= \
-       aac \
        ac3 \
        flac \
-       h264 \
-       hevc \
        jpegls \
+       mp2 \
        mp3 \
        mpeg1video \
        mpeg2video \
@@ -132,10 +131,12 @@ FFMPEG_MINI_DECODERS:= \
        mpegvideo \
        opus \
        png \
-       vc1 \
        vorbis \
-       wmav1 \
-       wmav2 \
+
+FFMPEG_PATENTED_MINI_DECODERS:= \
+       h264 \
+       hevc \
+       vc1 \
 
 FFMPEG_MINI_DEMUXERS:= \
        avi \
@@ -143,16 +144,15 @@ FFMPEG_MINI_DEMUXERS:= \
        matroska \
        mov \
        mp3 \
+       mpegps \
        mpegts \
        mpegvideo \
        ogg \
 
 FFMPEG_MINI_PROTOCOLS:= \
-       file \
+       file
 
 FFMPEG_AUDIO_DECODERS:= \
-       aac \
-       aac_latm \
        ac3 \
        adpcm_* \
        alac \
@@ -169,14 +169,9 @@ FFMPEG_AUDIO_DECODERS:= \
        pcm_* \
        vorbis \
        wavpack \
-       wmav1 \
-       wmav2 \
-       wmalossless \
-       wmapro \
        zlib \
 
 FFMPEG_AUDIO_DEMUXERS:= \
-       aac \
        ac3 \
        aiff \
        amr \
@@ -198,24 +193,30 @@ FFMPEG_AUDIO_DEMUXERS:= \
        wav \
        wv \
 
-FFMPEG_AUDIO_PARSERS:= \
-       aac \
-       aac_latm \
-       ac3 \
-       flac \
-       mpegaudio \
-       opus \
-
 FFMPEG_AUDIO_PROTOCOLS:= \
        file http icecast rtp tcp udp
 
+FFMPEG_PATENTED_DECODERS:= \
+       atrac3 \
+       h264 \
+       hevc \
+       vc1 \
+
+FFMPEG_PATENTED_MUXERS:= \
+       h264 \
+       hevc \
+
+FFMPEG_PATENTED_PARSERS:= \
+       h264 \
+       hevc \
+       vc1 \
 
 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_MUXER_%,$(FFMPEG_CUSTOM_MUXERS)) \
        $(patsubst %,CONFIG_FFMPEG_CUSTOM_DEMUXER_%,$(FFMPEG_CUSTOM_DEMUXERS)) \
        $(patsubst %,CONFIG_FFMPEG_CUSTOM_PARSER_%,$(FFMPEG_CUSTOM_PARSERS)) \
        $(patsubst %,CONFIG_FFMPEG_CUSTOM_PROTOCOL_%,$(FFMPEG_CUSTOM_PROTOCOLS))
@@ -224,12 +225,17 @@ include $(INCLUDE_DIR)/package.mk
 
 define Package/ffmpeg/Default
  TITLE:=FFmpeg
- URL:=http://ffmpeg.mplayerhq.hu/
+ URL:=https://ffmpeg.org/
+ DEPENDS+= +libpthread
 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.
+
+ FFmpeg licensing / patent issues are complex. It is the reponsibility of the
+ user to understand any requirements in this regard with its usage. See:
+ https://ffmpeg.org/legal.html for further information.
 endef
 
 
@@ -238,7 +244,7 @@ $(call Package/ffmpeg/Default)
  SECTION:=multimedia
  CATEGORY:=Multimedia
  TITLE+= program
- DEPENDS+= +libpthread +libffmpeg-full
+ DEPENDS+= +libffmpeg-full
  VARIANT:=full
 endef
 
@@ -270,7 +276,7 @@ $(call Package/ffserver/Default)
  SECTION:=multimedia
  CATEGORY:=Multimedia
  TITLE+= streaming server
- DEPENDS+= +libpthread +libffmpeg-full
+ DEPENDS+= +libffmpeg-full
  VARIANT:=full
 endef
 
@@ -285,17 +291,20 @@ $(call Package/ffmpeg/Default)
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE+= libraries
- DEPENDS+= @BUILD_PATENTED +libpthread +zlib +libbz2
+ DEPENDS+= +libpthread +zlib +libbz2
  PROVIDES:= libffmpeg
 endef
 
 
+# Package build suppressed when CONFIG_ALL=y
 define Package/libffmpeg-custom
 $(call Package/libffmpeg/Default)
  TITLE+= (custom)
- DEPENDS+= +FFMPEG_CUSTOM_SELECT_libopus:libopus \
-           +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib
-
+ DEPENDS+= @!ALL \
+           +FFMPEG_CUSTOM_SELECT_libopus:libopus \
+           +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib \
+           +FFMPEG_CUSTOM_SELECT_libshine:shine \
+           +PACKAGE_fdk-aac:fdk-aac
  VARIANT:=custom
  MENU:=1
 endef
@@ -327,10 +336,16 @@ endef
 define Package/libffmpeg-full
 $(call Package/libffmpeg/Default)
  TITLE+= (full)
- DEPENDS+= +alsa-lib +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib +libopus
+ DEPENDS+= +alsa-lib +PACKAGE_libopus:libopus
+ ifeq ($(CONFIG_SOFT_FLOAT),y)
+       DEPENDS+= +PACKAGE_shine:shine
+ else
+       DEPENDS+= +PACKAGE_lame-lib:lame-lib +PACKAGE_libx264:libx264
+ endif
  VARIANT:=full
 endef
 
+
 define Package/libffmpeg-full/description
 $(call Package/ffmpeg/Default/description)
  .
@@ -363,43 +378,21 @@ FFMPEG_CONFIGURE:= \
        --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 += \
+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 \
@@ -413,37 +406,71 @@ FFMPEG_CONFIGURE += \
        --disable-runtime-cpudetect
 
 else ifneq ($(findstring arm,$(CONFIG_ARCH)),)
-FFMPEG_CONFIGURE += \
+FFMPEG_CONFIGURE+= \
        --disable-runtime-cpudetect
+# XXX: GitHub issue 3320 ppc cpu with fpu but no altivec (WNDR4700)
 else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
-FFMPEG_CONFIGURE += \
+FFMPEG_CONFIGURE+= \
        --disable-altivec
 endif
 
-ifneq ($(CONFIG_YASM),y)
-FFMPEG_CONFIGURE += \
-       --disable-yasm
-
-endif
-
-#selectibly disable optimizations according to arch/cpu type
+# selectively disable optimizations according to arch/cpu type
 ifneq ($(findstring arm,$(CONFIG_ARCH)),)
-       ifeq (,$(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)))
-               FFMPEG_CONFIGURE+= \
-                       --disable-vfp
+       FFMPEG_CONFIGURE+= --enable-lto
+
+       ifneq ($(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)),)
+               FFMPEG_CONFIGURE+= --enable-vfp
+       else
+               FFMPEG_CONFIGURE+= --disable-vfp
        endif
-       ifeq (,$(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)))
+       ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
                FFMPEG_CONFIGURE+= \
-                       --disable-neon
+                       --enable-neon \
+                       --enable-vfp
+       else
+               FFMPEG_CONFIGURE+= --disable-neon
        endif
+endif
+
+ifeq ($(ARCH),x86_64)
+       FFMPEG_CONFIGURE+= --enable-lto
+endif
+
+ifneq ($(CONFIG_YASM),y)
+FFMPEG_CONFIGURE+= --disable-yasm
 
 endif
 
 ifeq ($(BUILD_VARIANT),full)
+
+  FFMPEG_DISABLE= \
+       $(foreach c, $(2), \
+               --disable-$(1)="$(c)" \
+       )
+
+       FFMPEG_CONFIGURE+= \
+               --enable-avresample \
+               $(if $(CONFIG_BUILD_PATENTED),, \
+                       $(call FFMPEG_DISABLE,decoder,$(FFMPEG_PATENTED_DECODERS)) \
+                       $(call FFMPEG_DISABLE,muxer,$(FFMPEG_PATENTED_MUXERS)) \
+                       $(call FFMPEG_DISABLE,parser,$(FFMPEG_PATENTED_PARSERS))) \
+               $(if $(CONFIG_PACKAGE_libopus),--enable-libopus)
+  ifeq ($(CONFIG_SOFT_FLOAT),y)
+       FFMPEG_CONFIGURE+= \
+               --enable-small \
+               \
+               $(if $(CONFIG_PACKAGE_shine),--enable-libshine)
+  else
+       ifeq ($(ARCH),x86_64)
+               FFMPEG_CONFIGURE+= --enable-hardcoded-tables
+       else
+               FFMPEG_CONFIGURE+= --enable-small
+       endif
        FFMPEG_CONFIGURE+= \
-               --enable-libopus --enable-decoder=libopus \
-               $(if $(CONFIG_PACKAGE_libx264),--enable-libx264) \
-               $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame)
+               --enable-gpl \
+               $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame) \
+               $(if $(CONFIG_PACKAGE_libx264),--enable-libx264 --enable-nonfree)
+  endif
 endif
 
 ifeq ($(BUILD_VARIANT),custom)
@@ -453,6 +480,26 @@ ifeq ($(BUILD_VARIANT),custom)
                $(if $($(3)_$(c)),--enable-$(1)="$(c)") \
        )
 
+  ifeq ($(CONFIG_FFMPEG_CUSTOM_LARGE),y)
+       FFMPEG_CONFIGURE+= \
+               --enable-hardcoded-tables
+  else
+       FFMPEG_CONFIGURE+= \
+               --enable-small
+  endif
+
+  ifeq ($(CONFIG_FFMPEG_CUSTOM_GPL),y)
+       FFMPEG_CONFIGURE+= --enable-gpl
+  endif
+
+  ifeq ($(CONFIG_FFMPEG_CUSTOM_GPLV3),y)
+       FFMPEG_CONFIGURE+= --enable-version3
+  endif
+
+  ifeq ($(CONFIG_FFMPEG_CUSTOM_NONFREE),y)
+       FFMPEG_CONFIGURE+= --enable-nonfree
+  endif
+
   FFMPEG_CONFIGURE+= \
        --disable-programs \
        --disable-avfilter \
@@ -471,23 +518,32 @@ ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_adpcm),y)
   FFMPEG_CONFIGURE+= \
        --enable-decoder=adpcm_ima_wav \
        --enable-decoder=adpcm_ima_qt \
-       --enable-decoder=adpcm_ms \
+       --enable-decoder=adpcm_ms
+endif
 
+ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libfdk-aac),y)
+  FFMPEG_CONFIGURE+= \
+       --enable-libfdk-aac --enable-encoder=libfdk_aac
+endif
+
+ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libmp3lame),y)
+  FFMPEG_CONFIGURE+= \
+       --enable-libmp3lame --enable-encoder=libmp3lame
 endif
 
 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
   FFMPEG_CONFIGURE+= \
-       --enable-libopus --enable-decoder=libopus
+       --enable-libopus --enable-decoder=libopus --enable-encoder=libopus
 endif
 
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_x264),y)
+ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libshine),y)
   FFMPEG_CONFIGURE+= \
-       --enable-libx264
+       --enable-libshine --enable-encoder=libshine
 endif
 
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_mp3lame),y)
+ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y)
   FFMPEG_CONFIGURE+= \
-       --enable-libmp3lame
+       --enable-libx264 --enable-encoder=libx264
 endif
 
 endif
@@ -500,6 +556,9 @@ ifeq ($(BUILD_VARIANT),audio-dec)
        )
 
   FFMPEG_CONFIGURE+= \
+       --enable-small \
+       --enable-gpl \
+       \
        --disable-programs \
        --disable-avfilter \
        --disable-postproc \
@@ -508,10 +567,8 @@ ifeq ($(BUILD_VARIANT),audio-dec)
        --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 \
-
+       --disable-decoder=pcm_bluray,pcm_dvd
 endif
 
 ifeq ($(BUILD_VARIANT),mini)
@@ -522,6 +579,8 @@ ifeq ($(BUILD_VARIANT),mini)
        )
 
   FFMPEG_CONFIGURE+= \
+       --enable-small \
+       \
        --disable-programs \
        --disable-avdevice \
        --disable-avfilter \
@@ -532,11 +591,12 @@ ifeq ($(BUILD_VARIANT),mini)
        $(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \
        $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \
        $(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS)) \
-
+       $(if $(CONFIG_BUILD_PATENTED), \
+               $(call FFMPEG_ENABLE,decoder,$(FFMPEG_PATENTED_MINI_DECODERS)))
 endif
 
 ifneq ($(CONFIG_TARGET_x86),)
-  TARGET_CFLAGS += -fomit-frame-pointer
+  TARGET_CFLAGS+= -fomit-frame-pointer
 endif
 
 define Build/Configure
@@ -558,13 +618,19 @@ define Build/InstallDev/custom
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avformat,avutil}.pc $(1)/usr/lib/pkgconfig/
 endef
 
+# Soft float is LGPL (no libpostproc); Hard float is GPL (yes libpostproc)
 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/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale} $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.{a,so*} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
+ifneq ($(CONFIG_SOFT_FLOAT),y)
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
+endif
 endef
 
 define Build/InstallDev/mini
@@ -622,9 +688,13 @@ define Package/libffmpeg-custom/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avformat,avutil}.so.* $(1)/usr/lib/
 endef
 
+# Soft float is LGPL (no libpostproc); Hard float is GPL (yes libpostproc)
 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/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.so.* $(1)/usr/lib/
+ifneq ($(CONFIG_SOFT_FLOAT),y)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
+endif
 endef
 
 define Package/libffmpeg-mini/install
@@ -640,6 +710,4 @@ $(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
+$(eval $(call BuildPackage,libffmpeg-custom))
index 5a5f3b52cb0080b1c1a04f30f473e012079f7833..b4eda099277db368d71f7b104710fc0959395fa0 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.firestorm.cx/fswebcam/files \
        http://www.sanslogic.co.uk/fswebcam/files
-PKG_MD5SUM:=1bfdb21904e816f100370ec8f4df986b
+PKG_HASH:=444d6a8a82102e09e935540c64a731021de36db03e1e74181f41ca6f39aa6474
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=LICENCE
diff --git a/multimedia/gphoto2/Makefile b/multimedia/gphoto2/Makefile
new file mode 100644 (file)
index 0000000..fd63354
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2006-2012 OpenWrt.org
+# Copyright (C) 2017      Leonardo Medici
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gphoto2
+PKG_VERSION:=2.5.15
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Leonardo Medici <leonardo_medici@me.com>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/gphoto
+PKG_HASH:=ae571a227983dc9997876702a73af5431d41f287ea0f483cda897c57a6084a77
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/gphoto2
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  TITLE:=Gphoto Digital Camera Control
+  URL:=http://www.gphoto.org/
+  DEPENDS:=+libgphoto2 +libpopt +libpthread +libreadline +libncurses +libexif +libjpeg
+endef
+
+define Package/gphoto2/description
+ For downloading and controlling digital cameras
+endef
+
+CONFIGURE_ARGS += \
+       --without-aalib \
+       --without-libiconv-prefix \
+       --without-libintl-prefix \
+
+CONFIGURE_VARS += \
+       LIBGPHOTO2_CFLAGS="$$$$CFLAGS -I$(STAGING_DIR)/usr/include/gphoto2 $$$$CPPFLAGS" \
+       LIBGPHOTO2_LIBS="$$$$LDFLAGS -lgphoto2 -lgphoto2_port -lltdl" \
+       LIBEXIF_CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \
+       LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \
+       POPT_CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \
+       POPT_LIBS="$$$$LDFLAGS -lpopt" \
+
+define Package/gphoto2/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,gphoto2))
diff --git a/multimedia/gphoto2/patches/001-automake-compat.patch b/multimedia/gphoto2/patches/001-automake-compat.patch
new file mode 100644 (file)
index 0000000..47c21f5
--- /dev/null
@@ -0,0 +1,46 @@
+Index: gphoto2-2.5.15/Makefile.am
+===================================================================
+--- gphoto2-2.5.15.orig/Makefile.am
++++ gphoto2-2.5.15/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = gphoto-m4 contrib doc gphoto2 packaging po tests
++SUBDIRS = gphoto-m4 contrib doc gphoto2 packaging tests
+ ACLOCAL_AMFLAGS = -I auto-m4 -I gphoto-m4
+ EXTRA_DIST = README.md
+Index: gphoto2-2.5.15/Makefile.in
+===================================================================
+--- gphoto2-2.5.15.orig/Makefile.in
++++ gphoto2-2.5.15/Makefile.in
+@@ -389,7 +389,7 @@ target_alias = @target_alias@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-SUBDIRS = gphoto-m4 contrib doc gphoto2 packaging po tests
++SUBDIRS = gphoto-m4 contrib doc gphoto2 packaging tests
+ ACLOCAL_AMFLAGS = -I auto-m4 -I gphoto-m4
+ EXTRA_DIST = README.md
+ all: config.h
+Index: gphoto2-2.5.15/configure.ac
+===================================================================
+--- gphoto2-2.5.15.orig/configure.ac
++++ gphoto2-2.5.15/configure.ac
+@@ -58,10 +58,7 @@ dnl ------------------------------------
+ GP_GETTEXT_HACK([],[Lutz Müller and others],[${MAIL_GPHOTO_TRANSLATION}])
+ ALL_LINGUAS="az cs da de en_GB es eu fi fr hu id is it ja nl pa pl pt_BR ro ru rw sk sr sv uk vi zh_CN zh_TW"
+ AM_GNU_GETTEXT_VERSION([0.14.1])
+-AM_GNU_GETTEXT([external])
+-AM_PO_SUBDIRS()
+ AM_ICONV()
+-GP_GETTEXT_FLAGS()
+ dnl We cannot use AC_DEFINE_UNQUOTED() for these definitions, as
+ dnl we require make to do insert the proper $(datadir) value
+@@ -407,7 +404,6 @@ AC_SUBST([AM_LDFLAGS])
+ # Create output files
+ # ---------------------------------------------------------------------------
+ AC_CONFIG_FILES([
+-po/Makefile.in 
+ Makefile
+ gphoto2/Makefile
+ gphoto-m4/Makefile
diff --git a/multimedia/gphoto2/patches/002-no-docs-test.patch b/multimedia/gphoto2/patches/002-no-docs-test.patch
new file mode 100644 (file)
index 0000000..d64a3c6
--- /dev/null
@@ -0,0 +1,44 @@
+Index: gphoto2-2.5.15/Makefile.am
+===================================================================
+--- gphoto2-2.5.15.orig/Makefile.am
++++ gphoto2-2.5.15/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = gphoto-m4 contrib doc gphoto2 packaging tests
++SUBDIRS = gphoto-m4 contrib gphoto2 packaging
+ ACLOCAL_AMFLAGS = -I auto-m4 -I gphoto-m4
+ EXTRA_DIST = README.md
+Index: gphoto2-2.5.15/Makefile.in
+===================================================================
+--- gphoto2-2.5.15.orig/Makefile.in
++++ gphoto2-2.5.15/Makefile.in
+@@ -389,7 +389,7 @@ target_alias = @target_alias@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-SUBDIRS = gphoto-m4 contrib doc gphoto2 packaging tests
++SUBDIRS = gphoto-m4 contrib gphoto2 packaging
+ ACLOCAL_AMFLAGS = -I auto-m4 -I gphoto-m4
+ EXTRA_DIST = README.md
+ all: config.h
+Index: gphoto2-2.5.15/configure.ac
+===================================================================
+--- gphoto2-2.5.15.orig/configure.ac
++++ gphoto2-2.5.15/configure.ac
+@@ -407,16 +407,10 @@ AC_CONFIG_FILES([
+ Makefile
+ gphoto2/Makefile
+ gphoto-m4/Makefile
+-doc/Makefile
+ contrib/Makefile
+ packaging/Makefile
+ packaging/rpm/Makefile
+ packaging/rpm/package.spec
+-tests/data/Makefile
+-tests/staging/subdir1/Makefile
+-tests/staging/subdir2/Makefile
+-tests/staging/Makefile
+-tests/Makefile
+ ])
+ AC_OUTPUT()dnl
diff --git a/multimedia/grilo-plugins/Makefile b/multimedia/grilo-plugins/Makefile
new file mode 100644 (file)
index 0000000..6fdbce2
--- /dev/null
@@ -0,0 +1,89 @@
+#
+# Copyright (C) 2006-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:=grilo-plugins
+PKG_VERSION:=0.3.5
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_LICENSE:=LGPLv2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNOME/grilo-plugins/0.3/
+PKG_HASH:=2977827b8ecb3e15535236180e57dc35e85058d111349bdb6a1597e62a5068fb
+
+PKG_BUILD_DEPENDS:=glib2 grilo
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/grilo-plugins/Default
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  TITLE:=grilo-plugins
+  URL:=https://wiki.gnome.org/Projects/Grilo
+endef
+
+define Package/grilo-plugins
+  $(call Package/grilo-plugins/Default)
+  MENU:=1
+  DEPENDS:=+grilo $(ICONV_DEPENDS) $(INTL_DEPENDS)
+  TITLE:=Plugins for the Grilo framework
+endef
+
+define Package/grilo/decription
+  Grilo is a framework that provides access to different sources of
+  multimedia content, using a pluggable system. This package contains 
+  plugins to get information from a number of sources.
+endef
+
+CONFIGURE_ARGS += \
+        --enable-static \
+        --without-libiconv-prefix \
+        --without-libintl-prefix \
+        --without-x \
+
+define Package/grilo-plugins/install
+       $(INSTALL_DIR) $(1)/usr/lib/grilo-0.3
+endef
+
+define BuildPlugin
+  define Package/grilo-plugins-$(1)
+    $(call Package/grilo-plugins/Default)
+    DEPENDS:=grilo-plugins
+    ifneq ($(4),)
+      DEPENDS+= $(4)
+    endif
+    TITLE:=$(2) plugin
+  endef
+
+  define Package/grilo-plugins-$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/lib/grilo-0.3
+       for p in $(3); do \
+               $(CP) $(PKG_INSTALL_DIR)/usr/lib/grilo-0.3/libgrl$$$$$$$${p}.so $$(1)/usr/lib/grilo-0.3; \
+       done
+  endef
+
+  $$(eval $$(call BuildPackage,grilo-plugins-$(1)))
+endef
+
+$(eval $(call BuildPackage,grilo-plugins))
+
+$(eval $(call BuildPlugin,dleyna,DLNA sharing,dleyna,,30))
+$(eval $(call BuildPlugin,dmap,DAAP and DPAP sharing,daap dpap,libdmapsharing,30))
+$(eval $(call BuildPlugin,gravatar,Gravatar provider,gravatar,,30))
+$(eval $(call BuildPlugin,jamendo,Jamendo sharing,jamendo,,30))
+$(eval $(call BuildPlugin,magnatune,Magnatune sharing,magnatune,,30))
+$(eval $(call BuildPlugin,opensubtitles,Openi subtitles provider,opensubtitles,,30))
+$(eval $(call BuildPlugin,raitv,Rai.tv sharing,raitv,,30))
+$(eval $(call BuildPlugin,shoutcast,SHOUTcast sharing,shoutcast,,30))
diff --git a/multimedia/grilo-plugins/patches/001-grilo-plugins-0.3.5-no-itstool-xmllint.patch b/multimedia/grilo-plugins/patches/001-grilo-plugins-0.3.5-no-itstool-xmllint.patch
new file mode 100644 (file)
index 0000000..af60233
--- /dev/null
@@ -0,0 +1,122 @@
+diff -u --recursive grilo-plugins-0.3.5-vanilla/configure grilo-plugins-0.3.5/configure
+--- grilo-plugins-0.3.5-vanilla/configure      2018-01-07 21:45:18.874540074 -0500
++++ grilo-plugins-0.3.5/configure      2018-01-07 21:46:31.145749381 -0500
+@@ -638,8 +638,6 @@
+ LTLIBOBJS
+ LIBOBJS
+ YELP_HELP_RULES
+-XMLLINT
+-ITSTOOL
+ HELP_DIR
+ YELP_LC_DIST
+ YELP_LC_MEDIA_LINKS
+@@ -1084,9 +1082,7 @@
+ GOM_CFLAGS
+ GOM_LIBS
+ TRACKER_SPARQL_CFLAGS
+-TRACKER_SPARQL_LIBS
+-ITSTOOL
+-XMLLINT'
++TRACKER_SPARQL_LIBS'
+ # Initialize some variables set by options.
+@@ -1855,8 +1851,6 @@
+               C compiler flags for TRACKER_SPARQL, overriding pkg-config
+   TRACKER_SPARQL_LIBS
+               linker flags for TRACKER_SPARQL, overriding pkg-config
+-  ITSTOOL     Path to the `itstool` command
+-  XMLLINT     Path to the `xmllint` command
+ Use these variables to override the choices made by `configure' or to help
+ it to find libraries and programs with nonstandard names/locations.
+@@ -16976,89 +16970,6 @@
+-# Extract the first word of "itstool", so it can be a program name with args.
+-set dummy itstool; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_prog_ITSTOOL+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-  if test -n "$ITSTOOL"; then
+-  ac_cv_prog_ITSTOOL="$ITSTOOL" # Let the user override the test.
+-else
+-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+-  IFS=$as_save_IFS
+-  test -z "$as_dir" && as_dir=.
+-    for ac_exec_ext in '' $ac_executable_extensions; do
+-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+-    ac_cv_prog_ITSTOOL="itstool"
+-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+-    break 2
+-  fi
+-done
+-  done
+-IFS=$as_save_IFS
+-
+-fi
+-fi
+-ITSTOOL=$ac_cv_prog_ITSTOOL
+-if test -n "$ITSTOOL"; then
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ITSTOOL" >&5
+-$as_echo "$ITSTOOL" >&6; }
+-else
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+-
+-if test x"$ITSTOOL" = x; then
+-  as_fn_error $? "itstool not found" "$LINENO" 5
+-fi
+-
+-
+-# Extract the first word of "xmllint", so it can be a program name with args.
+-set dummy xmllint; ac_word=$2
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if ${ac_cv_prog_XMLLINT+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-  if test -n "$XMLLINT"; then
+-  ac_cv_prog_XMLLINT="$XMLLINT" # Let the user override the test.
+-else
+-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+-for as_dir in $PATH
+-do
+-  IFS=$as_save_IFS
+-  test -z "$as_dir" && as_dir=.
+-    for ac_exec_ext in '' $ac_executable_extensions; do
+-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+-    ac_cv_prog_XMLLINT="xmllint"
+-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+-    break 2
+-  fi
+-done
+-  done
+-IFS=$as_save_IFS
+-
+-fi
+-fi
+-XMLLINT=$ac_cv_prog_XMLLINT
+-if test -n "$XMLLINT"; then
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
+-$as_echo "$XMLLINT" >&6; }
+-else
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+-
+-if test x"$XMLLINT" = x; then
+-  as_fn_error $? "xmllint not found" "$LINENO" 5
+-fi
+-
+ YELP_HELP_RULES='
+ HELP_ID ?=
+ HELP_POT ?=
diff --git a/multimedia/grilo/Makefile b/multimedia/grilo/Makefile
new file mode 100644 (file)
index 0000000..67e05f1
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# Copyright (C) 2009-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:=grilo
+PKG_VERSION:=0.3.4
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_LICENSE:=LGPLv2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNOME/grilo/0.3/
+PKG_HASH:=7c6964053b42574c2f14715d2392a02ea5cbace955eb73e067c77aa3e43b066e
+
+PKG_BUILD_DEPENDS:=glib2 libsoup libxml2
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+TARGET_LDFLAGS+= \
+       -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
+define Package/grilo
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  TITLE:=grilo
+  URL:=https://wiki.gnome.org/Projects/Grilo
+  DEPENDS:=+glib2 +libsoup +libxml2
+endef
+
+define Package/grilo/decription
+  Grilo is a framework that provides access to different sources of
+  multimedia content, using a pluggable system. 
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/grilo-0.3/ \
+               $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+               $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
+               $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/share/vala-0.30/vapi/
+       # Note: this are compiled elsewhere because grilo refuses to
+       # generate VAPI files unless gobject-introspection exists;
+       # OpenWrt does not yet have a gobject-introspection package.
+       $(INSTALL_DATA) \
+               ./files/*.vapi \
+               $(STAGING_DIR_HOSTPKG)/share/vala-0.30/vapi
+endef
+
+define Package/grilo/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+               $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,grilo))
diff --git a/multimedia/grilo/files/grilo-0.3.vapi b/multimedia/grilo/files/grilo-0.3.vapi
new file mode 100644 (file)
index 0000000..6bcd1bd
--- /dev/null
@@ -0,0 +1,1033 @@
+/* grilo-0.3.vapi generated by vapigen-0.30, do not modify. */
+
+[CCode (cprefix = "Grl", gir_namespace = "Grl", gir_version = "0.3", lower_case_cprefix = "grl_")]
+namespace Grl {
+       [CCode (cheader_filename = "grilo.h", type_id = "grl_caps_get_type ()")]
+       public class Caps : GLib.Object {
+               [CCode (has_construct_function = false)]
+               public Caps ();
+               public unowned GLib.List<Grl.KeyID> get_key_filter ();
+               public unowned GLib.List<Grl.KeyID> get_key_range_filter ();
+               public Grl.TypeFilter get_type_filter ();
+               public bool is_key_filter (Grl.KeyID key);
+               public bool is_key_range_filter (Grl.KeyID key);
+               public void set_key_filter (GLib.List<Grl.KeyID> keys);
+               public void set_key_range_filter (GLib.List<Grl.KeyID> keys);
+               public void set_type_filter (Grl.TypeFilter filter);
+               public bool test_option (string key, GLib.Value value);
+       }
+       [CCode (cheader_filename = "grilo.h", type_id = "grl_config_get_type ()")]
+       public class Config : GLib.Object {
+               [CCode (array_length = false, array_null_terminated = true)]
+               public weak void*[] _grl_reserved;
+               [CCode (has_construct_function = false)]
+               public Config (string plugin, string? source);
+               public string get_api_key ();
+               public uint8 get_api_key_blob (size_t size);
+               public string get_api_secret ();
+               public string get_api_token ();
+               public string get_api_token_secret ();
+               public uint8 get_binary (string param, size_t? size);
+               public bool get_boolean (string param);
+               public float get_float (string param);
+               public int get_int (string param);
+               public string get_password ();
+               public string get_plugin ();
+               public string get_source ();
+               public string get_string (string param);
+               public string get_username ();
+               public bool has_param (string param);
+               public void @set (string param, GLib.Value value);
+               public void set_api_key (string key);
+               public void set_api_key_blob (uint8 blob, size_t size);
+               public void set_api_secret (string secret);
+               public void set_api_token (string token);
+               public void set_api_token_secret (string secret);
+               public void set_binary (string param, uint8 blob, size_t size);
+               public void set_boolean (string param, bool value);
+               public void set_float (string param, float value);
+               public void set_int (string param, int value);
+               public void set_password (string password);
+               public void set_plugin (string plugin);
+               public void set_source (string source);
+               public void set_string (string param, string value);
+               public void set_username (string username);
+       }
+       [CCode (cheader_filename = "grilo.h", type_id = "grl_data_get_type ()")]
+       public class Data : GLib.Object {
+               [CCode (array_length = false, array_null_terminated = true)]
+               public weak void*[] _grl_reserved;
+               [CCode (has_construct_function = false)]
+               public Data ();
+               public void add_binary (Grl.KeyID key, uint8 buf, size_t size);
+               public void add_boxed (Grl.KeyID key, void* boxed);
+               public void add_float (Grl.KeyID key, float floatvalue);
+               public void add_int (Grl.KeyID key, int intvalue);
+               public void add_int64 (Grl.KeyID key, int64 intvalue);
+               public void add_related_keys (Grl.RelatedKeys relkeys);
+               public void add_string (Grl.KeyID key, string strvalue);
+               public Grl.Data dup ();
+               public unowned GLib.Value? @get (Grl.KeyID key);
+               public uint8 get_binary (Grl.KeyID key, out size_t size);
+               public bool get_boolean (Grl.KeyID key);
+               public void* get_boxed (Grl.KeyID key);
+               public float get_float (Grl.KeyID key);
+               public int get_int (Grl.KeyID key);
+               public int64 get_int64 (Grl.KeyID key);
+               public GLib.List<weak Grl.KeyID> get_keys ();
+               public unowned Grl.RelatedKeys get_related_keys (Grl.KeyID key, uint index);
+               public GLib.List<weak GLib.Value?> get_single_values_for_key (Grl.KeyID key);
+               public GLib.List<weak string> get_single_values_for_key_string (Grl.KeyID key);
+               public unowned string get_string (Grl.KeyID key);
+               public bool has_key (Grl.KeyID key);
+               public uint length (Grl.KeyID key);
+               public void remove (Grl.KeyID key);
+               public void remove_nth (Grl.KeyID key, uint index);
+               public void @set (Grl.KeyID key, GLib.Value value);
+               public void set_binary (Grl.KeyID key, uint8 buf, size_t size);
+               public void set_boolean (Grl.KeyID key, bool boolvalue);
+               public void set_boxed (Grl.KeyID key, void* boxed);
+               public void set_float (Grl.KeyID key, float floatvalue);
+               public void set_int (Grl.KeyID key, int intvalue);
+               public void set_int64 (Grl.KeyID key, int64 intvalue);
+               public void set_related_keys (Grl.RelatedKeys relkeys, uint index);
+               public void set_string (Grl.KeyID key, string strvalue);
+       }
+       [CCode (cheader_filename = "grilo.h")]
+       [Compact]
+       public class LogDomain {
+               public void free ();
+       }
+       [CCode (cheader_filename = "grilo.h", type_id = "grl_media_get_type ()")]
+       public class Media : Grl.Data {
+               [CCode (has_construct_function = false)]
+               public Media ();
+               public void add_artist (string artist);
+               public void add_author (string author);
+               public void add_director (string director);
+               public void add_external_player (string player);
+               public void add_external_url (string url);
+               public void add_genre (string genre);
+               public void add_keyword (string keyword);
+               public void add_lyrics (string lyrics);
+               public void add_mb_artist_id (string mb_artist_id);
+               public void add_performer (string performer);
+               public void add_producer (string producer);
+               public void add_region_data (string region, GLib.DateTime publication_date, string certificate);
+               public void add_thumbnail (string thumbnail);
+               public void add_thumbnail_binary (uint8 thumbnail, size_t size);
+               public void add_url_data (string url, string mime, int bitrate, float framerate, int width, int height);
+               [CCode (cname = "grl_media_audio_new", has_construct_function = false)]
+               public Media.audio_new ();
+               [CCode (cname = "grl_media_container_new", has_construct_function = false)]
+               public Media.container_new ();
+               public unowned string get_album ();
+               public unowned string get_artist ();
+               public unowned string get_artist_nth (uint index);
+               public unowned string get_author ();
+               public unowned string get_author_nth (uint index);
+               public int get_bitrate ();
+               public unowned string get_camera_model ();
+               public unowned string get_certificate ();
+               public int get_childcount ();
+               public unowned GLib.DateTime get_creation_date ();
+               public unowned string get_description ();
+               public unowned string get_director ();
+               public unowned string get_director_nth (uint index);
+               public int get_duration ();
+               public int get_episode ();
+               public unowned string get_episode_title ();
+               public float get_exposure_time ();
+               public unowned string get_external_url ();
+               public unowned string get_external_url_nth (uint index);
+               public bool get_favourite ();
+               public unowned string get_flash_used ();
+               public float get_framerate ();
+               public unowned string get_genre ();
+               public unowned string get_genre_nth (uint index);
+               public int get_height ();
+               public unowned string get_id ();
+               public float get_iso_speed ();
+               public unowned string get_keyword ();
+               public unowned string get_keyword_nth (uint index);
+               public GLib.DateTime get_last_played ();
+               public int get_last_position ();
+               public unowned string get_license ();
+               public unowned string get_lyrics ();
+               public unowned string get_lyrics_nth (uint index);
+               public unowned string get_mb_album_id ();
+               public unowned string get_mb_artist_id ();
+               public unowned string get_mb_artist_id_nth (uint index);
+               public unowned string get_mb_recording_id ();
+               public unowned string get_mb_track_id ();
+               public Grl.MediaType get_media_type ();
+               public unowned string get_mime ();
+               public unowned GLib.DateTime get_modification_date ();
+               public int get_orientation ();
+               public unowned string get_original_title ();
+               public unowned string get_performer ();
+               public unowned string get_performer_nth (uint index);
+               public int get_play_count ();
+               public unowned string get_player ();
+               public unowned string get_player_nth (uint index);
+               public unowned string get_producer ();
+               public unowned string get_producer_nth (uint index);
+               public unowned GLib.DateTime get_publication_date ();
+               public float get_rating ();
+               public unowned string get_region ();
+               public unowned string get_region_data (out unowned GLib.DateTime publication_date, out unowned string certificate);
+               public unowned string get_region_data_nth (uint index, out unowned GLib.DateTime publication_date, out unowned string certificate);
+               public int get_season ();
+               public unowned string get_show ();
+               public unowned string get_site ();
+               public int64 get_size ();
+               public unowned string get_source ();
+               public float get_start_time ();
+               public unowned string get_studio ();
+               public unowned string get_thumbnail ();
+               public uint8 get_thumbnail_binary (size_t size);
+               public uint8 get_thumbnail_binary_nth (size_t size, uint index);
+               public unowned string get_thumbnail_nth (uint index);
+               public unowned string get_title ();
+               public int get_track_number ();
+               public unowned string get_url ();
+               public unowned string get_url_data (out unowned string mime, out int bitrate, float framerate, int width, int height);
+               public unowned string get_url_data_nth (uint index, out unowned string mime, out int bitrate, float framerate, int width, int height);
+               public int get_width ();
+               [CCode (cname = "grl_media_image_new", has_construct_function = false)]
+               public Media.image_new ();
+               public bool is_audio ();
+               public bool is_container ();
+               public bool is_image ();
+               public bool is_video ();
+               public string serialize ();
+               public void set_album (string album);
+               public void set_artist (string artist);
+               public void set_author (string author);
+               public void set_bitrate (int bitrate);
+               public void set_camera_model (string camera_model);
+               public void set_certificate (string certificate);
+               public void set_childcount (int childcount);
+               public void set_creation_date (GLib.DateTime creation_date);
+               public void set_description (string description);
+               public void set_director (string director);
+               public void set_duration (int duration);
+               public void set_episode (int episode);
+               public void set_episode_title (string episode_title);
+               public void set_exposure_time (float exposure_time);
+               public void set_external_player (string player);
+               public void set_external_url (string url);
+               public void set_favourite (bool favourite);
+               public void set_flash_used (string flash_used);
+               public void set_framerate (float framerate);
+               public void set_genre (string genre);
+               public void set_height (int height);
+               public void set_id (string id);
+               public void set_iso_speed (float iso_speed);
+               public void set_keyword (string keyword);
+               public void set_last_played (GLib.DateTime last_played);
+               public void set_last_position (int last_position);
+               public void set_license (string license);
+               public void set_lyrics (string lyrics);
+               public void set_mb_album_id (string mb_album_id);
+               public void set_mb_artist_id (string mb_artist_id);
+               public void set_mb_recording_id (string mb_recording_id);
+               public void set_mb_track_id (string mb_track_id);
+               public void set_mime (string mime);
+               public void set_modification_date (GLib.DateTime modification_date);
+               public void set_orientation (int orientation);
+               public void set_original_title (string original_title);
+               public void set_performer (string performer);
+               public void set_play_count (int play_count);
+               public void set_producer (string producer);
+               public void set_publication_date (GLib.DateTime date);
+               public void set_rating (float rating, float max);
+               public void set_region (string region);
+               public void set_region_data (string region, GLib.DateTime publication_date, string certificate);
+               public void set_season (int season);
+               public void set_show (string show);
+               public void set_site (string site);
+               public void set_size (int64 size);
+               public void set_source (string source);
+               public void set_studio (string studio);
+               public void set_thumbnail (string thumbnail);
+               public void set_thumbnail_binary (uint8 thumbnail, size_t size);
+               public void set_title (string title);
+               public void set_track_number (int track_number);
+               public void set_url (string url);
+               public void set_url_data (string url, string mime, int bitrate, float framerate, int width, int height);
+               public void set_width (int width);
+               public static Grl.Media unserialize (string serial);
+               [CCode (cname = "grl_media_video_new", has_construct_function = false)]
+               public Media.video_new ();
+               [NoAccessorMethod]
+               public Grl.MediaType media_type { get; set construct; }
+       }
+       [CCode (cheader_filename = "grilo.h", type_id = "grl_operation_options_get_type ()")]
+       public class OperationOptions : GLib.Object {
+               [CCode (has_construct_function = false)]
+               public OperationOptions (Grl.Caps? caps);
+               public Grl.OperationOptions copy ();
+               public int get_count ();
+               public unowned GLib.Value? get_key_filter (Grl.KeyID key);
+               public GLib.List<weak Grl.KeyID> get_key_filter_list ();
+               public void get_key_range_filter (Grl.KeyID key, out GLib.Value min_value, out GLib.Value max_value);
+               public GLib.List<weak Grl.KeyID> get_key_range_filter_list ();
+               public Grl.ResolutionFlags get_resolution_flags ();
+               public uint get_skip ();
+               public Grl.TypeFilter get_type_filter ();
+               public bool key_is_set (string key);
+               public bool obey_caps (Grl.Caps caps, out Grl.OperationOptions supported_options, out Grl.OperationOptions unsupported_options);
+               public bool set_count (int count);
+               public bool set_key_filter_dictionary (GLib.HashTable<Grl.KeyID,GLib.Value?> filters);
+               public bool set_key_filter_value (Grl.KeyID key, GLib.Value value);
+               public bool set_key_range_filter_value (Grl.KeyID key, GLib.Value? min_value, GLib.Value? max_value);
+               public bool set_resolution_flags (Grl.ResolutionFlags flags);
+               public bool set_skip (uint skip);
+               public bool set_type_filter (Grl.TypeFilter filter);
+       }
+       [CCode (cheader_filename = "grilo.h", type_id = "grl_plugin_get_type ()")]
+       public class Plugin : GLib.Object {
+               [CCode (has_construct_function = false)]
+               protected Plugin ();
+               public unowned string get_author ();
+               public unowned string get_description ();
+               public unowned string get_filename ();
+               public unowned string get_id ();
+               public unowned string get_license ();
+               public unowned string get_module_name ();
+               public unowned string get_name ();
+               public unowned string get_site ();
+               public GLib.List<weak Grl.Source> get_sources ();
+               public unowned string get_version ();
+               public void register_keys ();
+               public void set_filename (string filename);
+               public void set_id (string id);
+               public void set_module (GLib.Module module);
+               public void set_module_name (string module_name);
+               public void unload ();
+               [NoAccessorMethod]
+               public bool loaded { get; }
+       }
+       [CCode (cheader_filename = "grilo.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "grl_range_value_get_type ()")]
+       [Compact]
+       public class RangeValue {
+               public GLib.Value max;
+               public GLib.Value min;
+               [CCode (has_construct_function = false)]
+               public RangeValue (GLib.Value min, GLib.Value max);
+               public Grl.RangeValue dup ();
+               public void free ();
+               public static void hashtable_insert (GLib.HashTable<void*,void*> hash_table, void* key, GLib.Value min, GLib.Value max);
+               public static GLib.HashTable<void*,Grl.RangeValue> hashtable_new ();
+       }
+       [CCode (cheader_filename = "grilo.h", type_id = "grl_registry_get_type ()")]
+       public class Registry : GLib.Object {
+               [CCode (has_construct_function = false)]
+               protected Registry ();
+               public bool activate_all_plugins ();
+               public bool activate_plugin_by_id (string plugin_id) throws GLib.Error;
+               public bool add_config (owned Grl.Config config) throws GLib.Error;
+               public bool add_config_from_file (string config_file) throws GLib.Error;
+               public bool add_config_from_resource (string resource_path) throws GLib.Error;
+               public void add_directory (string path);
+               public static unowned Grl.Registry get_default ();
+               public GLib.List<weak Grl.KeyID> get_metadata_keys ();
+               public GLib.List<weak Grl.Plugin> get_plugins (bool only_loaded);
+               public GLib.List<weak Grl.Source> get_sources (bool ranked);
+               public GLib.List<weak Grl.Source> get_sources_by_operations (Grl.SupportedOps ops, bool ranked);
+               public bool load_all_plugins (bool activate) throws GLib.Error;
+               public bool load_plugin (string library_filename) throws GLib.Error;
+               public bool load_plugin_directory (string path) throws GLib.Error;
+               public Grl.KeyID lookup_metadata_key (string key_name);
+               public unowned string lookup_metadata_key_desc (Grl.KeyID key);
+               public unowned string lookup_metadata_key_name (Grl.KeyID key);
+               public unowned GLib.List<Grl.KeyID> lookup_metadata_key_relation (Grl.KeyID key);
+               public GLib.Type lookup_metadata_key_type (Grl.KeyID key);
+               public unowned Grl.Plugin lookup_plugin (string plugin_id);
+               public unowned Grl.Source lookup_source (string source_id);
+               public bool metadata_key_validate (Grl.KeyID key, GLib.Value value);
+               public Grl.KeyID register_metadata_key (owned GLib.ParamSpec param_spec, Grl.KeyID bind_key) throws GLib.Error;
+               public Grl.KeyID register_metadata_key_system (GLib.ParamSpec param_spec, Grl.KeyID key, Grl.KeyID bind_key) throws GLib.Error;
+               public bool register_source (Grl.Plugin plugin, owned Grl.Source source) throws GLib.Error;
+               public void restrict_plugins (string plugins);
+               public void shutdown ();
+               public bool unload_plugin (string plugin_id) throws GLib.Error;
+               public bool unregister_source (Grl.Source source) throws GLib.Error;
+               public signal void metadata_key_added (string key);
+               public signal void source_added (Grl.Source source);
+               public signal void source_removed (Grl.Source source);
+       }
+       [CCode (cheader_filename = "grilo.h", type_id = "grl_related_keys_get_type ()")]
+       public class RelatedKeys : GLib.Object {
+               [CCode (has_construct_function = false)]
+               public RelatedKeys ();
+               public Grl.RelatedKeys dup ();
+               public unowned GLib.Value? @get (Grl.KeyID key);
+               public uint8 get_binary (Grl.KeyID key, out size_t size);
+               public bool get_boolean (Grl.KeyID key);
+               public void* get_boxed (Grl.KeyID key);
+               public float get_float (Grl.KeyID key);
+               public int get_int (Grl.KeyID key);
+               public int64 get_int64 (Grl.KeyID key);
+               public GLib.List<weak Grl.KeyID> get_keys ();
+               public unowned string get_string (Grl.KeyID key);
+               public bool has_key (Grl.KeyID key);
+               public void remove (Grl.KeyID key);
+               public void @set (Grl.KeyID key, GLib.Value value);
+               public void set_binary (Grl.KeyID key, uint8 buf, size_t size);
+               public void set_boolean (Grl.KeyID key, bool booleanvalue);
+               public void set_boxed (Grl.KeyID key, void* boxed);
+               public void set_float (Grl.KeyID key, float floatvalue);
+               public void set_int (Grl.KeyID key, int intvalue);
+               public void set_int64 (Grl.KeyID key, int64 intvalue);
+               public void set_string (Grl.KeyID key, string strvalue);
+       }
+       [CCode (cheader_filename = "grilo.h", type_id = "grl_source_get_type ()")]
+       public abstract class Source : GLib.Object {
+               [CCode (has_construct_function = false)]
+               protected Source ();
+               [NoWrapper]
+               public virtual void browse (Grl.SourceBrowseSpec bs);
+               public GLib.List<Grl.Media> browse_sync (Grl.Media? container, GLib.List<Grl.KeyID> keys, Grl.OperationOptions options) throws GLib.Error;
+               [NoWrapper]
+               public virtual void cancel (uint operation_id);
+               [CCode (cname = "grl_source_browse")]
+               public uint do_browse (Grl.Media? container, GLib.List<Grl.KeyID> keys, Grl.OperationOptions options, Grl.SourceResultCb callback);
+               [CCode (cname = "grl_source_query")]
+               public uint do_query (string query, GLib.List<Grl.KeyID> keys, Grl.OperationOptions options, Grl.SourceResultCb callback);
+               [CCode (cname = "grl_source_remove")]
+               public void do_remove (Grl.Media media, Grl.SourceRemoveCb callback);
+               [CCode (cname = "grl_source_resolve")]
+               public uint do_resolve (Grl.Media? media, GLib.List<Grl.KeyID> keys, Grl.OperationOptions options, Grl.SourceResolveCb callback);
+               [CCode (cname = "grl_source_search")]
+               public uint do_search (string text, GLib.List<Grl.KeyID> keys, Grl.OperationOptions options, Grl.SourceResultCb callback);
+               [CCode (cname = "grl_source_store")]
+               public void do_store (Grl.Media? parent, Grl.Media media, Grl.WriteFlags flags, Grl.SourceStoreCb callback);
+               [CCode (cname = "grl_source_store_metadata")]
+               public void do_store_metadata (Grl.Media media, GLib.List<Grl.KeyID>? keys, Grl.WriteFlags flags, Grl.SourceStoreCb callback);
+               public uint get_auto_split_threshold ();
+               public virtual unowned Grl.Caps get_caps (Grl.SupportedOps operation);
+               public unowned string get_description ();
+               public unowned GLib.Icon get_icon ();
+               public unowned string get_id ();
+               public uint get_media_from_uri (string uri, GLib.List<Grl.KeyID> keys, Grl.OperationOptions options, Grl.SourceResolveCb callback);
+               public Grl.Media get_media_from_uri_sync (string uri, GLib.List<Grl.KeyID> keys, Grl.OperationOptions options) throws GLib.Error;
+               public unowned string get_name ();
+               public unowned Grl.Plugin get_plugin ();
+               public int get_rank ();
+               public Grl.SupportedMedia get_supported_media ();
+               [CCode (cname = "grl_source_supported_operations")]
+               public uint get_supported_operations ();
+               [CCode (array_length = false, array_null_terminated = true)]
+               public unowned string[] get_tags ();
+               public virtual bool may_resolve (Grl.Media media, Grl.KeyID key_id, GLib.List<Grl.KeyID> missing_keys);
+               [NoWrapper]
+               public virtual void media_from_uri (Grl.SourceMediaFromUriSpec mfus);
+               public void notify_change (Grl.Media? media, Grl.SourceChangeType change_type, bool location_unknown);
+               public void notify_change_list (owned GLib.GenericArray<Grl.Media> changed_medias, Grl.SourceChangeType change_type, bool location_unknown);
+               public virtual bool notify_change_start () throws GLib.Error;
+               public virtual bool notify_change_stop () throws GLib.Error;
+               [NoWrapper]
+               public virtual void query (Grl.SourceQuerySpec qs);
+               public GLib.List<Grl.Media> query_sync (string query, GLib.List<Grl.KeyID> keys, Grl.OperationOptions options) throws GLib.Error;
+               [NoWrapper]
+               public virtual void remove (Grl.SourceRemoveSpec rs);
+               public void remove_sync (Grl.Media media) throws GLib.Error;
+               [NoWrapper]
+               public virtual void resolve (Grl.SourceResolveSpec ms);
+               public Grl.Media resolve_sync (Grl.Media? media, GLib.List<Grl.KeyID> keys, Grl.OperationOptions options) throws GLib.Error;
+               [NoWrapper]
+               public virtual void search (Grl.SourceSearchSpec ss);
+               public GLib.List<Grl.Media> search_sync (string text, GLib.List<Grl.KeyID> keys, Grl.OperationOptions options) throws GLib.Error;
+               public void set_auto_split_threshold (uint threshold);
+               public virtual unowned GLib.List<Grl.KeyID> slow_keys ();
+               [NoWrapper]
+               public virtual void store (Grl.SourceStoreSpec ss);
+               [NoWrapper]
+               public virtual void store_metadata (Grl.SourceStoreMetadataSpec sms);
+               public GLib.List<weak Grl.KeyID> store_metadata_sync (Grl.Media media, GLib.List<Grl.KeyID>? keys, Grl.WriteFlags flags) throws GLib.Error;
+               public void store_sync (Grl.Media? parent, Grl.Media media, Grl.WriteFlags flags) throws GLib.Error;
+               public virtual unowned GLib.List<Grl.KeyID> supported_keys ();
+               [NoWrapper]
+               public virtual Grl.SupportedOps supported_operations ();
+               public virtual bool test_media_from_uri (string uri);
+               public virtual unowned GLib.List<Grl.KeyID> writable_keys ();
+               public uint auto_split_threshold { get; set; }
+               [NoAccessorMethod]
+               public Grl.Plugin plugin { owned get; set construct; }
+               [NoAccessorMethod]
+               public int rank { get; set construct; }
+               [NoAccessorMethod]
+               public string source_desc { owned get; set construct; }
+               [NoAccessorMethod]
+               public GLib.Icon source_icon { owned get; set construct; }
+               [NoAccessorMethod]
+               public string source_id { owned get; set construct; }
+               [NoAccessorMethod]
+               public string source_name { owned get; set construct; }
+               [CCode (array_length = false, array_null_terminated = true)]
+               [NoAccessorMethod]
+               public string[] source_tags { owned get; set construct; }
+               [NoAccessorMethod]
+               public Grl.SupportedMedia supported_media { get; set construct; }
+               public signal void content_changed (GLib.GenericArray<Grl.Media> changed_medias, Grl.SourceChangeType change_type, bool location_unknown);
+       }
+       [CCode (cheader_filename = "grilo.h")]
+       [SimpleType]
+       public struct KeyID : uint32 {
+       }
+       [CCode (cheader_filename = "grilo.h")]
+       public struct MetadataKey {
+               [CCode (cname = "GRL_METADATA_KEY_INVALID")]
+               public static Grl.KeyID INVALID;
+               [CCode (cname = "GRL_METADATA_KEY_ALBUM")]
+               public static Grl.KeyID ALBUM;
+               [CCode (cname = "GRL_METADATA_KEY_ARTIST")]
+               public static Grl.KeyID ARTIST;
+               [CCode (cname = "GRL_METADATA_KEY_AUTHOR")]
+               public static Grl.KeyID AUTHOR;
+               [CCode (cname = "GRL_METADATA_KEY_BITRATE")]
+               public static Grl.KeyID BITRATE;
+               [CCode (cname = "GRL_METADATA_KEY_CERTIFICATE")]
+               public static Grl.KeyID CERTIFICATE;
+               [CCode (cname = "GRL_METADATA_KEY_CHILDCOUNT")]
+               public static Grl.KeyID CHILDCOUNT;
+               [CCode (cname = "GRL_METADATA_KEY_PUBLICATION_DATE")]
+               public static Grl.KeyID PUBLICATION_DATE;
+               [CCode (cname = "GRL_METADATA_KEY_DESCRIPTION")]
+               public static Grl.KeyID DESCRIPTION;
+               [CCode (cname = "GRL_METADATA_KEY_DURATION")]
+               public static Grl.KeyID DURATION;
+               [CCode (cname = "GRL_METADATA_KEY_EXTERNAL_PLAYER")]
+               public static Grl.KeyID EXTERNAL_PLAYER;
+               [CCode (cname = "GRL_METADATA_KEY_EXTERNAL_URL")]
+               public static Grl.KeyID EXTERNAL_URL;
+               [CCode (cname = "GRL_METADATA_KEY_FRAMERATE")]
+               public static Grl.KeyID FRAMERATE;
+               [CCode (cname = "GRL_METADATA_KEY_GENRE")]
+               public static Grl.KeyID GENRE;
+               [CCode (cname = "GRL_METADATA_KEY_HEIGHT")]
+               public static Grl.KeyID HEIGHT;
+               [CCode (cname = "GRL_METADATA_KEY_ID")]
+               public static Grl.KeyID ID;
+               [CCode (cname = "GRL_METADATA_KEY_LAST_PLAYED")]
+               public static Grl.KeyID LAST_PLAYED;
+               [CCode (cname = "GRL_METADATA_KEY_LAST_POSITION")]
+               public static Grl.KeyID LAST_POSITION;
+               [CCode (cname = "GRL_METADATA_KEY_LICENSE")]
+               public static Grl.KeyID LICENSE;
+               [CCode (cname = "GRL_METADATA_KEY_LYRICS")]
+               public static Grl.KeyID LYRICS;
+               [CCode (cname = "GRL_METADATA_KEY_MIME")]
+               public static Grl.KeyID MIME;
+               [CCode (cname = "GRL_METADATA_KEY_PLAY_COUNT")]
+               public static Grl.KeyID PLAY_COUNT;
+               [CCode (cname = "GRL_METADATA_KEY_RATING")]
+               public static Grl.KeyID RATING;
+               [CCode (cname = "GRL_METADATA_KEY_REGION")]
+               public static Grl.KeyID REGION;
+               [CCode (cname = "GRL_METADATA_KEY_SITE")]
+               public static Grl.KeyID SITE;
+               [CCode (cname = "GRL_METADATA_KEY_SOURCE")]
+               public static Grl.KeyID SOURCE;
+               [CCode (cname = "GRL_METADATA_KEY_STUDIO")]
+               public static Grl.KeyID STUDIO;
+               [CCode (cname = "GRL_METADATA_KEY_THUMBNAIL")]
+               public static Grl.KeyID THUMBNAIL;
+               [CCode (cname = "GRL_METADATA_KEY_THUMBNAIL_BINARY")]
+               public static Grl.KeyID THUMBNAIL_BINARY;
+               [CCode (cname = "GRL_METADATA_KEY_TITLE")]
+               public static Grl.KeyID TITLE;
+               [CCode (cname = "GRL_METADATA_KEY_URL")]
+               public static Grl.KeyID URL;
+               [CCode (cname = "GRL_METADATA_KEY_WIDTH")]
+               public static Grl.KeyID WIDTH;
+               [CCode (cname = "GRL_METADATA_KEY_SEASON")]
+               public static Grl.KeyID SEASON;
+               [CCode (cname = "GRL_METADATA_KEY_EPISODE")]
+               public static Grl.KeyID EPISODE;
+               [CCode (cname = "GRL_METADATA_KEY_EPISODE_TITLE")]
+               public static Grl.KeyID EPISODE_TITLE;
+               [CCode (cname = "GRL_METADATA_KEY_SHOW")]
+               public static Grl.KeyID SHOW;
+               [CCode (cname = "GRL_METADATA_KEY_CREATION_DATE")]
+               public static Grl.KeyID CREATION_DATE;
+               [CCode (cname = "GRL_METADATA_KEY_CAMERA_MODEL")]
+               public static Grl.KeyID CAMERA_MODEL;
+               [CCode (cname = "GRL_METADATA_KEY_ORIENTATION")]
+               public static Grl.KeyID ORIENTATION;
+               [CCode (cname = "GRL_METADATA_KEY_FLASH_USED")]
+               public static Grl.KeyID FLASH_USED;
+               [CCode (cname = "GRL_METADATA_KEY_EXPOSURE_TIME")]
+               public static Grl.KeyID EXPOSURE_TIME;
+               [CCode (cname = "GRL_METADATA_KEY_ISO_SPEED")]
+               public static Grl.KeyID ISO_SPEED;
+               [CCode (cname = "GRL_METADATA_KEY_TRACK_NUMBER")]
+               public static Grl.KeyID TRACK_NUMBER;
+               [CCode (cname = "GRL_METADATA_KEY_MODIFICATION_DATE")]
+               public static Grl.KeyID MODIFICATION_DATE;
+               [CCode (cname = "GRL_METADATA_KEY_START_TIME")]
+               public static Grl.KeyID START_TIME;
+               [CCode (cname = "GRL_METADATA_KEY_KEYWORD")]
+               public static Grl.KeyID KEYWORD;
+               [CCode (cname = "GRL_METADATA_KEY_PERFORMER")]
+               public static Grl.KeyID PERFORMER;
+               [CCode (cname = "GRL_METADATA_KEY_PRODUCER")]
+               public static Grl.KeyID PRODUCER;
+               [CCode (cname = "GRL_METADATA_KEY_DIRECTOR")]
+               public static Grl.KeyID DIRECTOR;
+               [CCode (cname = "GRL_METADATA_KEY_ORIGINAL_TITLE")]
+               public static Grl.KeyID ORIGINAL_TITLE;
+               [CCode (cname = "GRL_METADATA_KEY_MB_ALBUM_ID")]
+               public static Grl.KeyID MB_ALBUM_ID;
+               [CCode (cname = "GRL_METADATA_KEY_MB_TRACK_ID")]
+               public static Grl.KeyID MB_TRACK_ID;
+               [CCode (cname = "GRL_METADATA_KEY_MB_ARTIST_ID")]
+               public static Grl.KeyID MB_ARTIST_ID;
+               [CCode (cname = "GRL_METADATA_KEY_MB_RECORDING_ID")]
+               public static Grl.KeyID MB_RECORDING_ID;
+               [CCode (cname = "GRL_METADATA_KEY_AUDIO_TRACK")]
+               public static Grl.KeyID AUDIO_TRACK;
+               [CCode (cname = "GRL_METADATA_KEY_CHILDCOUNT_UNKNOWN")]
+               public static uint CHILDCOUNT_UNKNOWN;
+               [CCode (cname = "GRL_SOURCE_REMAINING_UNKNOWN")]
+               public static uint REMAINING_UNKNOWN;
+               public static GLib.List list_new (Grl.KeyID p, ...);
+       }
+       [CCode (cheader_filename = "grilo.h", has_type_id = false)]
+       public struct SourceBrowseSpec {
+               public weak Grl.Source source;
+               public uint operation_id;
+               public weak Grl.Media container;
+               public weak GLib.List<void*> keys;
+               public weak Grl.OperationOptions options;
+               [CCode (delegate_target_cname = "user_data")]
+               public weak Grl.SourceResultCb callback;
+               public void* user_data;
+       }
+       [CCode (cheader_filename = "grilo.h", has_type_id = false)]
+       public struct SourceMediaFromUriSpec {
+               public weak Grl.Source source;
+               public uint operation_id;
+               public weak string uri;
+               public weak GLib.List<void*> keys;
+               public weak Grl.OperationOptions options;
+               [CCode (delegate_target_cname = "user_data")]
+               public weak Grl.SourceResolveCb callback;
+               public void* user_data;
+       }
+       [CCode (cheader_filename = "grilo.h", has_type_id = false)]
+       public struct SourceQuerySpec {
+               public weak Grl.Source source;
+               public uint operation_id;
+               public weak string query;
+               public weak GLib.List<void*> keys;
+               public weak Grl.OperationOptions options;
+               [CCode (delegate_target_cname = "user_data")]
+               public weak Grl.SourceResultCb callback;
+               public void* user_data;
+       }
+       [CCode (cheader_filename = "grilo.h", has_type_id = false)]
+       public struct SourceRemoveSpec {
+               public weak Grl.Source source;
+               public weak string media_id;
+               public weak Grl.Media media;
+               [CCode (delegate_target_cname = "user_data")]
+               public weak Grl.SourceRemoveCb callback;
+               public void* user_data;
+       }
+       [CCode (cheader_filename = "grilo.h", has_type_id = false)]
+       public struct SourceResolveSpec {
+               public weak Grl.Source source;
+               public uint operation_id;
+               public weak Grl.Media media;
+               public weak GLib.List<void*> keys;
+               public weak Grl.OperationOptions options;
+               [CCode (delegate_target_cname = "user_data")]
+               public weak Grl.SourceResolveCb callback;
+               public void* user_data;
+       }
+       [CCode (cheader_filename = "grilo.h", has_type_id = false)]
+       public struct SourceSearchSpec {
+               public weak Grl.Source source;
+               public uint operation_id;
+               public weak string text;
+               public weak GLib.List<void*> keys;
+               public weak Grl.OperationOptions options;
+               [CCode (delegate_target_cname = "user_data")]
+               public weak Grl.SourceResultCb callback;
+               public void* user_data;
+       }
+       [CCode (cheader_filename = "grilo.h", has_type_id = false)]
+       public struct SourceStoreMetadataSpec {
+               public weak Grl.Source source;
+               public weak Grl.Media media;
+               public weak GLib.List<void*> keys;
+               public Grl.WriteFlags flags;
+               [CCode (delegate_target_cname = "user_data")]
+               public weak Grl.SourceStoreCb callback;
+               public void* user_data;
+               public weak GLib.List<void*> failed_keys;
+       }
+       [CCode (cheader_filename = "grilo.h", has_type_id = false)]
+       public struct SourceStoreSpec {
+               public weak Grl.Source source;
+               public weak Grl.Media parent;
+               public weak Grl.Media media;
+               [CCode (delegate_target_cname = "user_data")]
+               public weak Grl.SourceStoreCb callback;
+               public string user_data;
+       }
+       [CCode (cheader_filename = "grilo.h", cprefix = "GRL_CORE_ERROR_", has_type_id = false)]
+       public enum CoreError {
+               BROWSE_FAILED,
+               SEARCH_FAILED,
+               SEARCH_NULL_UNSUPPORTED,
+               QUERY_FAILED,
+               RESOLVE_FAILED,
+               MEDIA_NOT_FOUND,
+               STORE_FAILED,
+               STORE_METADATA_FAILED,
+               REMOVE_FAILED,
+               MEDIA_FROM_URI_FAILED,
+               CONFIG_LOAD_FAILED,
+               CONFIG_FAILED,
+               UNREGISTER_SOURCE_FAILED,
+               LOAD_PLUGIN_FAILED,
+               UNLOAD_PLUGIN_FAILED,
+               REGISTER_METADATA_KEY_FAILED,
+               NOTIFY_CHANGED_FAILED,
+               OPERATION_CANCELLED,
+               AUTHENTICATION_TOKEN
+       }
+       [CCode (cheader_filename = "grilo.h", cprefix = "GRL_LOG_LEVEL_", has_type_id = false)]
+       public enum LogLevel {
+               NONE,
+               ERROR,
+               WARNING,
+               MESSAGE,
+               INFO,
+               DEBUG,
+               LAST
+       }
+       [CCode (cheader_filename = "grilo.h", cprefix = "GRL_MEDIA_SERIALIZE_", type_id = "grl_media_serialize_type_get_type ()")]
+       public enum MediaSerializeType {
+               BASIC,
+               PARTIAL,
+               FULL
+       }
+       [CCode (cheader_filename = "grilo.h", cprefix = "GRL_MEDIA_TYPE_", type_id = "grl_media_type_get_type ()")]
+       public enum MediaType {
+               UNKNOWN,
+               AUDIO,
+               VIDEO,
+               IMAGE,
+               CONTAINER
+       }
+       [CCode (cheader_filename = "grilo.h", cprefix = "GRL_RANK_", has_type_id = false)]
+       public enum Rank {
+               LOWEST,
+               LOW,
+               DEFAULT,
+               HIGH,
+               HIGHEST
+       }
+       [CCode (cheader_filename = "grilo.h", cprefix = "GRL_RESOLVE_", type_id = "grl_resolution_flags_get_type ()")]
+       [Flags]
+       public enum ResolutionFlags {
+               NORMAL,
+               FULL,
+               IDLE_RELAY,
+               FAST_ONLY
+       }
+       [CCode (cheader_filename = "grilo.h", cprefix = "GRL_CONTENT_", type_id = "grl_source_change_type_get_type ()")]
+       public enum SourceChangeType {
+               CHANGED,
+               ADDED,
+               REMOVED
+       }
+       [CCode (cheader_filename = "grilo.h", cprefix = "GRL_SUPPORTED_MEDIA_", type_id = "grl_supported_media_get_type ()")]
+       [Flags]
+       public enum SupportedMedia {
+               NONE,
+               AUDIO,
+               VIDEO,
+               IMAGE,
+               ALL
+       }
+       [CCode (cheader_filename = "grilo.h", cprefix = "GRL_OP_", type_id = "grl_supported_ops_get_type ()")]
+       [Flags]
+       public enum SupportedOps {
+               NONE,
+               RESOLVE,
+               BROWSE,
+               SEARCH,
+               QUERY,
+               STORE,
+               STORE_PARENT,
+               STORE_METADATA,
+               REMOVE,
+               MEDIA_FROM_URI,
+               NOTIFY_CHANGE
+       }
+       [CCode (cheader_filename = "grilo.h", cprefix = "GRL_TYPE_FILTER_", type_id = "grl_type_filter_get_type ()")]
+       [Flags]
+       public enum TypeFilter {
+               NONE,
+               AUDIO,
+               VIDEO,
+               IMAGE,
+               ALL
+       }
+       [CCode (cheader_filename = "grilo.h", cprefix = "GRL_WRITE_", type_id = "grl_write_flags_get_type ()")]
+       [Flags]
+       public enum WriteFlags {
+               NORMAL,
+               FULL
+       }
+       [CCode (cheader_filename = "grilo.h", has_target = false)]
+       public delegate void OperationCancelCb (void* data);
+       [CCode (cheader_filename = "grilo.h", has_target = false)]
+       public delegate void PluginDeinitFunc (Grl.Plugin plugin);
+       [CCode (cheader_filename = "grilo.h", has_target = false)]
+       public delegate void PluginRegisterKeysFunc (Grl.Registry registry, Grl.Plugin plugin);
+       [CCode (cheader_filename = "grilo.h", instance_pos = 2.9)]
+       public delegate void SourceRemoveCb (Grl.Source source, owned Grl.Media media, GLib.Error? error);
+       [CCode (cheader_filename = "grilo.h", instance_pos = 3.9)]
+       public delegate void SourceResolveCb (Grl.Source source, uint operation_id, owned Grl.Media media, GLib.Error? error);
+       [CCode (cheader_filename = "grilo.h", instance_pos = 4.9)]
+       public delegate void SourceResultCb (Grl.Source source, uint operation_id, owned Grl.Media? media, uint remaining, GLib.Error? error);
+       [CCode (cheader_filename = "grilo.h", instance_pos = 3.9)]
+       public delegate void SourceStoreCb (Grl.Source source, owned Grl.Media media, GLib.List<Grl.KeyID> failed_keys, GLib.Error? error);
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_CONFIG_KEY_APIKEY")]
+       public const string CONFIG_KEY_APIKEY;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_CONFIG_KEY_APIKEY_BLOB")]
+       public const string CONFIG_KEY_APIKEY_BLOB;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_CONFIG_KEY_APISECRET")]
+       public const string CONFIG_KEY_APISECRET;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_CONFIG_KEY_APITOKEN")]
+       public const string CONFIG_KEY_APITOKEN;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_CONFIG_KEY_APITOKEN_SECRET")]
+       public const string CONFIG_KEY_APITOKEN_SECRET;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_CONFIG_KEY_PASSWORD")]
+       public const string CONFIG_KEY_PASSWORD;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_CONFIG_KEY_PLUGIN")]
+       public const string CONFIG_KEY_PLUGIN;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_CONFIG_KEY_SOURCE")]
+       public const string CONFIG_KEY_SOURCE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_CONFIG_KEY_USERNAME")]
+       public const string CONFIG_KEY_USERNAME;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_COUNT_INFINITY")]
+       public const int COUNT_INFINITY;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_KEYID_FORMAT")]
+       public const string KEYID_FORMAT;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_ALBUM")]
+       public const int METADATA_KEY_ALBUM;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_ARTIST")]
+       public const int METADATA_KEY_ARTIST;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_AUDIO_TRACK")]
+       public const int METADATA_KEY_AUDIO_TRACK;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_AUTHOR")]
+       public const int METADATA_KEY_AUTHOR;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_BITRATE")]
+       public const int METADATA_KEY_BITRATE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_CAMERA_MODEL")]
+       public const int METADATA_KEY_CAMERA_MODEL;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_CERTIFICATE")]
+       public const int METADATA_KEY_CERTIFICATE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_CHILDCOUNT")]
+       public const int METADATA_KEY_CHILDCOUNT;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_CHILDCOUNT_UNKNOWN")]
+       public const int METADATA_KEY_CHILDCOUNT_UNKNOWN;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_CREATION_DATE")]
+       public const int METADATA_KEY_CREATION_DATE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_DESCRIPTION")]
+       public const int METADATA_KEY_DESCRIPTION;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_DIRECTOR")]
+       public const int METADATA_KEY_DIRECTOR;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_DURATION")]
+       public const int METADATA_KEY_DURATION;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_EPISODE")]
+       public const int METADATA_KEY_EPISODE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_EPISODE_TITLE")]
+       public const int METADATA_KEY_EPISODE_TITLE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_EXPOSURE_TIME")]
+       public const int METADATA_KEY_EXPOSURE_TIME;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_EXTERNAL_PLAYER")]
+       public const int METADATA_KEY_EXTERNAL_PLAYER;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_EXTERNAL_URL")]
+       public const int METADATA_KEY_EXTERNAL_URL;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_FAVOURITE")]
+       public const int METADATA_KEY_FAVOURITE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_FLASH_USED")]
+       public const int METADATA_KEY_FLASH_USED;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_FRAMERATE")]
+       public const int METADATA_KEY_FRAMERATE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_GENRE")]
+       public const int METADATA_KEY_GENRE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_HEIGHT")]
+       public const int METADATA_KEY_HEIGHT;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_ID")]
+       public const int METADATA_KEY_ID;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_INVALID")]
+       public const int METADATA_KEY_INVALID;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_ISO_SPEED")]
+       public const int METADATA_KEY_ISO_SPEED;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_KEYWORD")]
+       public const int METADATA_KEY_KEYWORD;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_LAST_PLAYED")]
+       public const int METADATA_KEY_LAST_PLAYED;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_LAST_POSITION")]
+       public const int METADATA_KEY_LAST_POSITION;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_LICENSE")]
+       public const int METADATA_KEY_LICENSE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_LYRICS")]
+       public const int METADATA_KEY_LYRICS;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_MB_ALBUM_ID")]
+       public const int METADATA_KEY_MB_ALBUM_ID;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_MB_ARTIST_ID")]
+       public const int METADATA_KEY_MB_ARTIST_ID;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_MB_RECORDING_ID")]
+       public const int METADATA_KEY_MB_RECORDING_ID;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_MB_TRACK_ID")]
+       public const int METADATA_KEY_MB_TRACK_ID;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_MIME")]
+       public const int METADATA_KEY_MIME;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_MODIFICATION_DATE")]
+       public const int METADATA_KEY_MODIFICATION_DATE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_ORIENTATION")]
+       public const int METADATA_KEY_ORIENTATION;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_ORIGINAL_TITLE")]
+       public const int METADATA_KEY_ORIGINAL_TITLE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_PERFORMER")]
+       public const int METADATA_KEY_PERFORMER;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_PLAY_COUNT")]
+       public const int METADATA_KEY_PLAY_COUNT;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_PRODUCER")]
+       public const int METADATA_KEY_PRODUCER;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_PUBLICATION_DATE")]
+       public const int METADATA_KEY_PUBLICATION_DATE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_RATING")]
+       public const int METADATA_KEY_RATING;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_REGION")]
+       public const int METADATA_KEY_REGION;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_SEASON")]
+       public const int METADATA_KEY_SEASON;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_SHOW")]
+       public const int METADATA_KEY_SHOW;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_SITE")]
+       public const int METADATA_KEY_SITE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_SIZE")]
+       public const int METADATA_KEY_SIZE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_SOURCE")]
+       public const int METADATA_KEY_SOURCE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_START_TIME")]
+       public const int METADATA_KEY_START_TIME;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_STUDIO")]
+       public const int METADATA_KEY_STUDIO;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_THUMBNAIL")]
+       public const int METADATA_KEY_THUMBNAIL;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_THUMBNAIL_BINARY")]
+       public const int METADATA_KEY_THUMBNAIL_BINARY;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_TITLE")]
+       public const int METADATA_KEY_TITLE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_TITLE_FROM_FILENAME")]
+       public const int METADATA_KEY_TITLE_FROM_FILENAME;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_TRACK_NUMBER")]
+       public const int METADATA_KEY_TRACK_NUMBER;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_URL")]
+       public const int METADATA_KEY_URL;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_METADATA_KEY_WIDTH")]
+       public const int METADATA_KEY_WIDTH;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_OPERATION_OPTION_COUNT")]
+       public const string OPERATION_OPTION_COUNT;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_OPERATION_OPTION_KEY_EQUAL_FILTER")]
+       public const string OPERATION_OPTION_KEY_EQUAL_FILTER;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_OPERATION_OPTION_KEY_RANGE_FILTER")]
+       public const string OPERATION_OPTION_KEY_RANGE_FILTER;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_OPERATION_OPTION_RESOLUTION_FLAGS")]
+       public const string OPERATION_OPTION_RESOLUTION_FLAGS;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_OPERATION_OPTION_SKIP")]
+       public const string OPERATION_OPTION_SKIP;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_OPERATION_OPTION_TYPE_FILTER")]
+       public const string OPERATION_OPTION_TYPE_FILTER;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_PADDING")]
+       public const int PADDING;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_PADDING_SMALL")]
+       public const int PADDING_SMALL;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_PLUGIN_AUTHOR")]
+       public const string PLUGIN_AUTHOR;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_PLUGIN_DESCRIPTION")]
+       public const string PLUGIN_DESCRIPTION;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_PLUGIN_LICENSE")]
+       public const string PLUGIN_LICENSE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_PLUGIN_LIST_VAR")]
+       public const string PLUGIN_LIST_VAR;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_PLUGIN_NAME")]
+       public const string PLUGIN_NAME;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_PLUGIN_PATH_VAR")]
+       public const string PLUGIN_PATH_VAR;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_PLUGIN_RANKS_VAR")]
+       public const string PLUGIN_RANKS_VAR;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_PLUGIN_SITE")]
+       public const string PLUGIN_SITE;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_PLUGIN_VERSION")]
+       public const string PLUGIN_VERSION;
+       [CCode (cheader_filename = "grilo.h", cname = "GRL_SOURCE_REMAINING_UNKNOWN")]
+       public const int SOURCE_REMAINING_UNKNOWN;
+       [CCode (cheader_filename = "grilo.h")]
+       public static GLib.DateTime date_time_from_iso8601 (string date);
+       [CCode (cheader_filename = "grilo.h")]
+       public static void deinit ();
+       [CCode (cheader_filename = "grilo.h")]
+       public static GLib.Value? g_value_dup (GLib.Value value);
+       [CCode (cheader_filename = "grilo.h")]
+       public static void g_value_free (GLib.Value value);
+       [CCode (cheader_filename = "grilo.h")]
+       public static GLib.HashTable<string,GLib.Value?> g_value_hashtable_new ();
+       [CCode (cheader_filename = "grilo.h")]
+       public static GLib.HashTable<void*,GLib.Value?> g_value_hashtable_new_direct ();
+       [CCode (cheader_filename = "grilo.h")]
+       public static GLib.Value? g_value_new (GLib.Type g_type);
+       [CCode (cheader_filename = "grilo.h")]
+       public static void init ([CCode (array_length_cname = "argc", array_length_pos = 0.5)] ref unowned string[]? argv);
+       [CCode (cheader_filename = "grilo.h")]
+       public static GLib.OptionGroup init_get_option_group ();
+       [CCode (cheader_filename = "grilo.h")]
+       public static void log_configure (string config);
+       [CCode (cheader_filename = "grilo.h")]
+       public static void marshal_VOID__BOXED_ENUM_BOOLEAN (GLib.Closure closure, GLib.Value return_value, uint n_param_values, GLib.Value param_values, void* invocation_hint, void* marshal_data);
+       [CCode (cheader_filename = "grilo.h")]
+       public static unowned string metadata_key_get_desc (Grl.KeyID key);
+       [CCode (cheader_filename = "grilo.h")]
+       public static unowned string metadata_key_get_name (Grl.KeyID key);
+       [CCode (cheader_filename = "grilo.h")]
+       public static GLib.Type metadata_key_get_type (Grl.KeyID key);
+       [CCode (cheader_filename = "grilo.h")]
+       public static void metadata_key_setup_system_keys (Grl.Registry registry);
+       [CCode (cheader_filename = "grilo.h")]
+       public static void multiple_get_media_from_uri (string uri, GLib.List<Grl.KeyID> keys, Grl.OperationOptions options, Grl.SourceResolveCb callback);
+       [CCode (cheader_filename = "grilo.h")]
+       public static uint multiple_search (GLib.List<Grl.Source>? sources, string text, GLib.List<Grl.KeyID> keys, Grl.OperationOptions options, Grl.SourceResultCb callback);
+       [CCode (cheader_filename = "grilo.h")]
+       public static GLib.List<Grl.Media> multiple_search_sync (GLib.List<Grl.Source>? sources, string text, GLib.List<Grl.KeyID> keys, Grl.OperationOptions options) throws GLib.Error;
+       [CCode (cheader_filename = "grilo.h")]
+       public static void operation_cancel (uint operation_id);
+       [CCode (cheader_filename = "grilo.h")]
+       public static uint operation_generate_id ();
+       [CCode (cheader_filename = "grilo.h")]
+       public static void* operation_get_data (uint operation_id);
+       [CCode (cheader_filename = "grilo.h")]
+       public static void operation_init ();
+       [CCode (cheader_filename = "grilo.h")]
+       public static void operation_remove (uint operation_id);
+       [CCode (cheader_filename = "grilo.h")]
+       public static void operation_set_data (uint operation_id, void* user_data);
+       [CCode (cheader_filename = "grilo.h")]
+       public static void operation_set_data_full (uint operation_id, void* user_data, GLib.DestroyNotify? destroy_func);
+       [CCode (cheader_filename = "grilo.h")]
+       public static void operation_set_private_data (uint operation_id, void* private_data, [CCode (destroy_notify_pos = 3.1)] owned Grl.OperationCancelCb cancel_cb);
+       [CCode (cheader_filename = "grilo.h")]
+       public static void paging_translate (uint skip, uint count, uint max_page_size, uint page_size, uint page_number, uint internal_offset);
+}
diff --git a/multimedia/grilo/files/grilo-net-0.3.vapi b/multimedia/grilo/files/grilo-net-0.3.vapi
new file mode 100644 (file)
index 0000000..b5f6cef
--- /dev/null
@@ -0,0 +1,43 @@
+/* grilo-net-0.3.vapi generated by vapigen-0.30, do not modify. */
+
+[CCode (cprefix = "GrlNet", gir_namespace = "GrlNet", gir_version = "0.3", lower_case_cprefix = "grl_net_")]
+namespace GrlNet {
+       [CCode (cheader_filename = "net/grl-net.h", type_id = "grl_net_wc_get_type ()")]
+       public class Wc : GLib.Object {
+               [CCode (has_construct_function = false)]
+               public Wc ();
+               public static GLib.Quark error_quark ();
+               public void flush_delayed_requests ();
+               public async bool request_async (string uri, GLib.Cancellable? cancellable, out unowned string content, out size_t length) throws GLib.Error;
+               [CCode (finish_name = "grl_net_wc_request_finish")]
+               public async bool request_with_headers_async (string uri, GLib.Cancellable? cancellable, ..., out unowned string content, out size_t length) throws GLib.Error;
+               [CCode (finish_name = "grl_net_wc_request_finish")]
+               public async bool request_with_headers_hash_async (string uri, GLib.HashTable<string,string>? headers, GLib.Cancellable? cancellable, out unowned string content, out size_t length) throws GLib.Error;
+               public void set_cache (bool use_cache);
+               public void set_cache_size (uint cache_size);
+               public void set_log_level (uint log_level);
+               public void set_throttling (uint throttling);
+               [NoAccessorMethod]
+               public bool cache { get; set construct; }
+               [NoAccessorMethod]
+               public uint cache_size { get; set construct; }
+               [NoAccessorMethod]
+               public uint loglevel { get; set; }
+               [NoAccessorMethod]
+               public uint throttling { get; set; }
+               [NoAccessorMethod]
+               public string user_agent { owned get; set construct; }
+       }
+       [CCode (cheader_filename = "net/grl-net.h", cprefix = "GRL_NET_WC_ERROR_", has_type_id = false)]
+       public enum WcError {
+               UNAVAILABLE,
+               PROTOCOL_ERROR,
+               AUTHENTICATION_REQUIRED,
+               NOT_FOUND,
+               CONFLICT,
+               FORBIDDEN,
+               NETWORK_ERROR,
+               PROXY_ERROR,
+               CANCELLED
+       }
+}
index b394d7ddcbc9ef03b7ba006698e92d1bbd0c243f..9eb8e89302086e00624affd18ac482d407e9e3f6 100644 (file)
@@ -13,13 +13,13 @@ config GET_LIBAV_COMMON_AV_SUPPORT
        bool "Include support for common audio/video decoders"
        default y
        select GST1_LIBAV_DECODER_aac if GST1_LIBAV_PATENTED
-       select GST1_LIBAV_DECODER_ac3 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_ac3
        select GST1_LIBAV_DECODER_h264 if GST1_LIBAV_PATENTED
        select GST1_LIBAV_DECODER_atrac3 if GST1_LIBAV_PATENTED
        select GST1_LIBAV_DECODER_jpegls
-       select GST1_LIBAV_DECODER_mp3 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_mp3
        select GST1_LIBAV_DECODER_mpeg1video
-       select GST1_LIBAV_DECODER_mpeg2video if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_mpeg2video
        select GST1_LIBAV_DECODER_mpeg4 if GST1_LIBAV_PATENTED
        select GST1_LIBAV_DECODER_mpeg4aac if GST1_LIBAV_PATENTED
        select GST1_LIBAV_DECODER_mpegvideo
@@ -36,15 +36,14 @@ config GET_LIBAV_COMMON_AV_SUPPORT
        select GST1_LIBAV_PARSER_mpeg4video
        select GST1_LIBAV_DEMUXER_ac3
        select GST1_LIBAV_DEMUXER_h264 if GST1_LIBAV_PATENTED
-       select GST1_LIBAV_DEMUXER_mp3 if GST1_LIBAV_PATENTED
-       select GST1_LIBAV_DEMUXER_mpegvideo if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DEMUXER_mp3
+       select GST1_LIBAV_DEMUXER_mpegvideo
        select GST1_LIBAV_DEMUXER_ogg
 
 comment "Encoders ---"
 
 config GST1_LIBAV_ENCODER_ac3
        bool "AC3"
-       depends on GST1_LIBAV_PATENTED
        select GST1_LIBAV_PARSER_ac3
 
 config GST1_LIBAV_ENCODER_jpegls
@@ -55,7 +54,6 @@ config GST1_LIBAV_ENCODER_mpeg1video
 
 config GST1_LIBAV_ENCODER_mpeg2video
        bool "MPEG-2 Video"
-       depends on GST1_LIBAV_PATENTED
 
 config GST1_LIBAV_ENCODER_mpeg4
        bool "MPEG-4"
@@ -86,7 +84,6 @@ config GST1_LIBAV_DECODER_aac
 
 config GST1_LIBAV_DECODER_ac3
        bool "AC3"
-       depends on GST1_LIBAV_PATENTED
        select GST1_LIBAV_PARSER_ac3
 
 config GST1_LIBAV_DECODER_atrac3
@@ -105,11 +102,9 @@ config GST1_LIBAV_DECODER_jpegls
 
 config GST1_LIBAV_DECODER_mp2
        bool "MP2 (MPEG Audio Layer 2)"
-       depends on GST1_LIBAV_PATENTED
 
 config GST1_LIBAV_DECODER_mp3
        bool "MP3 (MPEG Audio Layer 2)"
-       depends on GST1_LIBAV_PATENTED
 
 config GST1_LIBAV_DECODER_mpegvideo
        bool "MPEG Video"
@@ -119,7 +114,6 @@ config GST1_LIBAV_DECODER_mpeg1video
 
 config GST1_LIBAV_DECODER_mpeg2video
        bool "MPEG-2 Video"
-       depends on GST1_LIBAV_PATENTED
 
 config GST1_LIBAV_DECODER_mpeg4
        bool "MPEG-4"
@@ -157,7 +151,6 @@ comment "Muxers ---"
 
 config GST1_LIBAV_MUXER_ac3
        bool "AC3"
-       depends on GST1_LIBAV_PATENTED
 
 config GST1_LIBAV_MUXER_ffm
        bool "FFM (ffserver live feed)"
index bed00ac34b3eadf0c02aa3b1f8e93c03e6d57f70..84890fb1cac8219534b9dce031a825db3ad1fb87 100644 (file)
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-libav
-PKG_VERSION:=1.8.2
-PKG_RELEASE:=2
+PKG_VERSION:=1.12.4
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
                Ted Hess <thess@kitschensync.net>
 
 PKG_SOURCE:=gst-libav-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-libav
-PKG_MD5SUM:=b5f3c7a27b39b5f5c2f0bfd546b0c655020faf6b38d27b64b346c43e5ebf687a
+PKG_HASH:=2a56aa5d2d8cd912f2bce17f174713d2c417ca298f1f9c28ee66d4aa1e1d9e62
 
 PKG_LICENSE:=GPL-2.0 LGPL-2.0
 PKG_LICENSE_FILES:=COPYING COPYING.LIB
@@ -109,8 +109,6 @@ PKG_CONFIG_DEPENDS:= \
        $(patsubst %,CONFIG_GST1_LIBAV_PARSER_%,$(LIBAV_PARSERS)) \
        $(patsubst %,CONFIG_GST1_LIBAV_PROTOCOL_%,$(LIBAV_PROTOCOLS))
 
-PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base
-
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
 
@@ -144,10 +142,13 @@ LIBAV_CONFIGURE_DEMUXERS:=$(call FILTER_CONFIG,DEMUXER,demuxer,$(LIBAV_DEMUXERS)
 LIBAV_CONFIGURE_PARSERS:=$(call FILTER_CONFIG,PARSER,parser,$(LIBAV_PARSERS))
 LIBAV_CONFIGURE_PROTOCOLS:=$(call FILTER_CONFIG,PROTOCOL,protocol,$(LIBAV_PROTOCOLS))
 
+# Strip off FPU notation
+REAL_CPU_TYPE:=$(firstword $(subst +, ,$(CONFIG_CPU_TYPE)))
+
 CONFIGURE_ARGS += \
        --without-system-libav \
-       --with-libav-extra-configure="--target-os=linux \
-       $(if $(findstring " ",$(CONFIG_CPU_TYPE)),,--cpu=$(CONFIG_CPU_TYPE)) \
+       --with-libav-extra-configure=" \
+       $(if $(REAL_CPU_TYPE),--cpu=$(call qstrip,$(REAL_CPU_TYPE)),) \
        --disable-bsfs \
        --disable-programs \
        --disable-devices \
index a2841458338829cd709bf4d2765dda0d77b222e4..02486ee215438e816b2f50f25b1a206beeb30496 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-plugins-bad
-PKG_VERSION:=1.8.2
+PKG_VERSION:=1.12.4
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
@@ -20,9 +20,7 @@ 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_HASH:=0c7857be16686d5c1ba6e34bd338664d3d4599d32714a8eca5c8a41a101e2d08
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
@@ -38,7 +36,7 @@ define Package/gstreamer1-bad/Default
   SECTION:=multimedia
   TITLE:=GStreamer
   URL:=http://gstreamer.freedesktop.org/
-  DEPENDS:= +libgstreamer1 $(ICONV_DEPENDS)
+  DEPENDS:= +gst1-plugins-base +libgstreamer1 +libgst1pbutils $(ICONV_DEPENDS)
 endef
 
 define Package/gstreamer1-bad/description/Default
@@ -245,8 +243,8 @@ $(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,camerabin,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,,))
@@ -263,7 +261,7 @@ $(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,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,,))
index ee5d05b3f046cdcda6d15ee70ce898b5cae2e4fa..67371c5da9ea432315bc2863ea71b8d1f4abd8dd 100644 (file)
@@ -1,16 +1,18 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -3717,7 +3717,6 @@ ext/x265/Makefile
- ext/xvid/Makefile
- ext/zbar/Makefile
+diff -u --recursive gst-plugins-bad-1.12.4-vanilla/configure.ac gst-plugins-bad-1.12.4/configure.ac
+--- gst-plugins-bad-1.12.4-vanilla/configure.ac        2018-02-11 19:43:06.962320214 -0500
++++ gst-plugins-bad-1.12.4/configure.ac        2018-02-11 19:43:48.643416395 -0500
+@@ -3717,7 +3717,6 @@
  ext/dtls/Makefile
+ ext/webrtcdsp/Makefile
+ ext/ttml/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
+diff -u --recursive gst-plugins-bad-1.12.4-vanilla/Makefile.am gst-plugins-bad-1.12.4/Makefile.am
+--- gst-plugins-bad-1.12.4-vanilla/Makefile.am 2018-02-11 19:43:06.987320271 -0500
++++ gst-plugins-bad-1.12.4/Makefile.am 2018-02-11 19:43:55.023431118 -0500
+@@ -2,11 +2,11 @@
  
  SUBDIRS = \
        gst-libs gst sys ext pkgconfig \
index 3bef421c3d662a6714055020a02e6fe556de8aad..fe38b2699ef928f4a3569965dcb9ca43131a1d7b 100644 (file)
@@ -1,7 +1,8 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -3617,38 +3617,6 @@ sys/wasapi/Makefile
- sys/wininet/Makefile
+diff -u --recursive gst-plugins-bad-1.12.4-vanilla/configure.ac gst-plugins-bad-1.12.4/configure.ac
+--- gst-plugins-bad-1.12.4-vanilla/configure.ac        2018-02-11 19:46:16.942758605 -0500
++++ gst-plugins-bad-1.12.4/configure.ac        2018-02-11 19:46:38.356808019 -0500
+@@ -3619,38 +3619,6 @@
+ sys/wasapi/Makefile
  sys/winks/Makefile
  sys/winscreencap/Makefile
 -tests/Makefile
@@ -12,6 +13,7 @@
 -tests/examples/camerabin2/Makefile
 -tests/examples/codecparsers/Makefile
 -tests/examples/directfb/Makefile
+-tests/examples/audiomixmatrix/Makefile
 -tests/examples/gl/Makefile
 -tests/examples/gl/cocoa/Makefile
 -tests/examples/gl/clutter/Makefile
@@ -21,7 +23,6 @@
 -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
  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
+diff -u --recursive gst-plugins-bad-1.12.4-vanilla/Makefile.am gst-plugins-bad-1.12.4/Makefile.am
+--- gst-plugins-bad-1.12.4-vanilla/Makefile.am 2018-02-11 19:46:16.980758692 -0500
++++ gst-plugins-bad-1.12.4/Makefile.am 2018-02-11 19:46:49.443833603 -0500
+@@ -2,11 +2,11 @@
  
  SUBDIRS = \
        gst-libs gst sys ext pkgconfig \
index 53686fdd802ee7aba684d7c63ac90bbdd3e6c509..ee5e0c86bb5e7bd202de280f5d15fd02b064a356 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-plugins-base
-PKG_VERSION:=1.8.2
+PKG_VERSION:=1.12.4
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
@@ -20,9 +20,8 @@ PKG_LICENSE_FILES:=COPYING.LIB COPYING
 PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-base-$(PKG_VERSION)
 PKG_SOURCE:=gst-plugins-base-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-base/
-PKG_MD5SUM:=9d7109c8fb0a5dec8edb17b0053c59a46aba7ddf48dc48ea822ebbbd4339d38d
+PKG_HASH:=4c306b03df0212f1b8903784e29bb3493319ba19ebebf13b0c56a17870292282
 
-PKG_BUILD_DEPENDS:= libgstreamer1
 PKG_CONFIG_DEPENDS:= \
        CONFIG_PACKAGE_gst1-mod-alsa \
        CONFIG_PACKAGE_gst1-mod-app \
index d4956062474dc496f2816ca54b30abb042d3221b..99e64d611dace442a9b21ccf87c1cf85edec1ed0 100644 (file)
@@ -1,6 +1,7 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -929,7 +929,6 @@ docs/design/Makefile
+diff -u --recursive gst-plugins-base-1.12.4-vanilla/configure.ac gst-plugins-base-1.12.4/configure.ac
+--- gst-plugins-base-1.12.4-vanilla/configure.ac       2018-02-11 09:52:04.704954684 -0500
++++ gst-plugins-base-1.12.4/configure.ac       2018-02-11 09:53:01.444071594 -0500
+@@ -964,7 +964,6 @@
  docs/libs/Makefile
  docs/plugins/Makefile
  docs/version.entities
@@ -8,9 +9,10 @@
  common/Makefile
  common/m4/Makefile
  m4/Makefile
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -13,7 +13,6 @@ SUBDIRS =                    \
+diff -u --recursive gst-plugins-base-1.12.4-vanilla/Makefile.am gst-plugins-base-1.12.4/Makefile.am
+--- gst-plugins-base-1.12.4-vanilla/Makefile.am        2018-02-11 09:52:04.704954684 -0500
++++ gst-plugins-base-1.12.4/Makefile.am        2018-02-11 09:53:08.156085423 -0500
+@@ -13,7 +13,6 @@
        tools                   \
        tests                   \
        docs                    \
@@ -18,7 +20,7 @@
        common                  \
        m4
  
-@@ -24,7 +23,6 @@ DIST_SUBDIRS =                       \
+@@ -24,7 +23,6 @@
        gst sys ext             \
        tools                   \
        tests                   \
index f177d1832234366a23e50fedc370fa7e28841313..926cec0393962d5f3a77536d97d61baa32973ac9 100644 (file)
@@ -1,6 +1,7 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -907,23 +907,6 @@ pkgconfig/gstreamer-video.pc
+diff -u --recursive gst-plugins-base-1.12.4-vanilla/configure.ac gst-plugins-base-1.12.4/configure.ac
+--- gst-plugins-base-1.12.4-vanilla/configure.ac       2018-02-11 09:54:25.065243893 -0500
++++ gst-plugins-base-1.12.4/configure.ac       2018-02-11 09:55:12.112340832 -0500
+@@ -942,24 +942,6 @@
  pkgconfig/gstreamer-video-uninstalled.pc
  pkgconfig/gstreamer-plugins-base.pc
  pkgconfig/gstreamer-plugins-base-uninstalled.pc
@@ -9,6 +10,7 @@
 -tests/examples/Makefile
 -tests/examples/app/Makefile
 -tests/examples/audio/Makefile
+-tests/examples/decodebin_next/Makefile
 -tests/examples/dynamic/Makefile
 -tests/examples/encoding/Makefile
 -tests/examples/fft/Makefile
 -tests/icles/Makefile
 -tests/icles/playback/Makefile
  docs/Makefile
- docs/design/Makefile
  docs/libs/Makefile
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -11,7 +11,6 @@ SUBDIRS =                    \
+ docs/plugins/Makefile
+diff -u --recursive gst-plugins-base-1.12.4-vanilla/Makefile.am gst-plugins-base-1.12.4/Makefile.am
+--- gst-plugins-base-1.12.4-vanilla/Makefile.am        2018-02-11 09:54:25.091243946 -0500
++++ gst-plugins-base-1.12.4/Makefile.am        2018-02-11 09:55:19.994357073 -0500
+@@ -11,7 +11,6 @@
        gst-libs                \
        gst sys $(SUBDIRS_EXT)  \
        tools                   \
@@ -34,7 +37,7 @@
        docs                    \
        common                  \
        m4
-@@ -22,7 +21,6 @@ DIST_SUBDIRS =                       \
+@@ -22,7 +21,6 @@
        gst-libs                \
        gst sys ext             \
        tools                   \
index a12c7e75ef638ef6654728f7ce963d0ceb443b9f..2390ca98f89acffe4831a4440278d00221f8a2d6 100644 (file)
@@ -1,20 +1,21 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -907,11 +907,6 @@ pkgconfig/gstreamer-video.pc
+diff -u --recursive gst-plugins-base-1.12.4-vanilla/configure.ac gst-plugins-base-1.12.4/configure.ac
+--- gst-plugins-base-1.12.4-vanilla/configure.ac       2018-02-11 09:55:52.832424735 -0500
++++ gst-plugins-base-1.12.4/configure.ac       2018-02-11 09:56:25.417491876 -0500
+@@ -942,10 +942,6 @@
  pkgconfig/gstreamer-video-uninstalled.pc
  pkgconfig/gstreamer-plugins-base.pc
  pkgconfig/gstreamer-plugins-base-uninstalled.pc
 -docs/Makefile
--docs/design/Makefile
 -docs/libs/Makefile
 -docs/plugins/Makefile
 -docs/version.entities
  common/Makefile
  common/m4/Makefile
  m4/Makefile
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -11,13 +11,11 @@ SUBDIRS =                  \
+diff -u --recursive gst-plugins-base-1.12.4-vanilla/Makefile.am gst-plugins-base-1.12.4/Makefile.am
+--- gst-plugins-base-1.12.4-vanilla/Makefile.am        2018-02-11 09:55:52.832424735 -0500
++++ gst-plugins-base-1.12.4/Makefile.am        2018-02-11 09:56:32.742506969 -0500
+@@ -11,13 +11,11 @@
        gst-libs                \
        gst sys $(SUBDIRS_EXT)  \
        tools                   \
diff --git a/multimedia/gst1-plugins-good/Makefile b/multimedia/gst1-plugins-good/Makefile
new file mode 100644 (file)
index 0000000..315b56a
--- /dev/null
@@ -0,0 +1,235 @@
+#
+# Copyright (C) 2009-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gst1-plugins-good
+PKG_VERSION:=1.12.4
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
+               Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=LGPLv2
+PKG_LICENSE_FILES:=COPYING
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-good-$(PKG_VERSION)
+PKG_SOURCE:=gst-plugins-good-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-good/
+PKG_HASH:=649f49bec60892d47ee6731b92266974c723554da1c6649f21296097715eb957
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+GST_GOOD_MODULES:=
+
+define Package/gstreamer1-good/Default
+  CATEGORY:=Multimedia
+  SECTION:=multimedia
+  TITLE:=GStreamer
+  URL:=http://gstreamer.freedesktop.org/
+  DEPENDS:= +libgstreamer1 +libgst1pbutils $(ICONV_DEPENDS)
+endef
+
+define Package/gstreamer1-good/description/Default
+ GStreamer open source multimedia framework
+endef
+
+
+define Package/gst1-plugins-good
+$(call Package/gstreamer1-good/Default)
+  TITLE+= plugins collection (good)
+  DEPENDS+= $(GST_DEPENDS)
+  HIDDEN:=1
+endef
+
+define Package/gst1-plugins-good/description
+$(call Package/gstreamer1-good/description/Default)
+ .
+ This meta package contains only dependencies to the other plugins from
+ the good plugins collection.
+endef
+
+
+define Package/gstreamer1-plugins-good
+  $(call Package/gstreamer1-good/Default)
+  TITLE+= plugins collection (good)
+  DEPENDS:=+ALL:gst1-plugins-good +gstreamer1-plugins-base
+endef
+
+define Package/gstreamer1-plugins-good/config
+    menu "Select GStreamer good modules"
+      depends on PACKAGE_gstreamer1-plugins-good
+
+
+    config gst1-plugins-good-all
+      bool "Include all GStreamer good plugins"
+      select PACKAGE_gst1-plugins-good
+
+    comment "Modules"
+
+   $(foreach mod,$(GST_GOOD_MODULES), \
+    config PACKAGE_gst1-mod-$(mod)
+      prompt "GStreamer $(mod) module"
+
+   )
+
+  endmenu
+
+endef
+
+GST_VERSION:=1.0
+
+CONFIGURE_ARGS += \
+       --disable-debug \
+       --disable-examples \
+       \
+       --disable-aalib \
+       --disable-annodex \
+       --disable-bz2 \
+       --disable-cairo \
+       --disable-directsound \
+       --disable-dv1394 \
+       --disable-esd \
+       --disable-gconf \
+       --disable-gconftool \
+       --disable-gdk_pixbuf \
+       --disable-hal \
+       --disable-libcaca \
+       --disable-libdv \
+       --disable-osx_audio \
+       --disable-osx_video \
+       --disable-pulse \
+       --disable-qtdemux \
+       --disable-rtspmanager \
+       --disable-shout2 \
+       --disable-sunaudio \
+       --disable-wavpack \
+       --disable-x \
+       --disable-xshm \
+       --disable-xvideo \
+       --disable-y4m \
+       --disable-zlib \
+       \
+       --without-libiconv-prefix \
+       --without-libintl-prefix \
+       --without-x \
+
+EXTRA_LDFLAGS+= \
+       -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
+       $(if $(ICONV_FULL),-liconv) \
+
+
+define Package/gst1-plugins-good/install
+       /bin/true
+endef
+
+
+# 1: short name
+# 2: description
+# 3: dependencies on other gstreamer libraries (short name)
+# 4: dependencies on other gstreamer plugins (short name)
+# 5: dependencies on other packages
+define GstBuildPlugin
+
+  GST_DEPENDS += +gst1-mod-$(1)
+
+  GST_GOOD_MODULES+= $(1)
+
+  define Package/gst1-mod-$(1)
+    $(call Package/gstreamer1-good/Default)
+    TITLE+= $(2) plugin (good)
+    DEPENDS+= $$(foreach p,$(3),+libgst1$$(p)) $$(foreach p,$(4),+gst1-mod-$$(p)) $(5)
+    HIDDEN:=1
+  endef
+
+  define Package/gst1-mod-$(1)/description
+   $(call Package/gstreamer1-good/description/Default)
+   .
+   This package contains the GStreamer $(2) plugin.
+  endef
+
+  define Package/gst1-mod-$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/lib/gstreamer-$(GST_VERSION)
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./usr/lib/gstreamer-$(GST_VERSION)/libgst$(1).so* \
+               $$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
+       )
+  endef
+
+  $$(eval $$(call BuildPackage,gst1-mod-$(1)))
+endef
+
+#$(eval $(call GstBuildPlugin,1394,IEEE 1394 support,,,))
+$(eval $(call GstBuildPlugin,alaw,alaw codec,audio,,))
+$(eval $(call GstBuildPlugin,alpha,alpha support,video,,))
+$(eval $(call GstBuildPlugin,alphacolor,alphacolor support,video,,))
+$(eval $(call GstBuildPlugin,apetag,apetag support,audio pbutils tag video,,))
+$(eval $(call GstBuildPlugin,audiofx,audio effects,audio fft controller,,))
+$(eval $(call GstBuildPlugin,audioparsers,audioparsers,audio tag pbutils,,))
+$(eval $(call GstBuildPlugin,auparse,auparse,audio tag pbutils,,))
+$(eval $(call GstBuildPlugin,autodetect,format auto-detection,,,))
+$(eval $(call GstBuildPlugin,avi,avi support,audio riff tag video,,))
+$(eval $(call GstBuildPlugin,cutter,audio cutter,audio,,))
+$(eval $(call GstBuildPlugin,debug,debugging,,,))
+$(eval $(call GstBuildPlugin,deinterlace,deinterlace support,video,,))
+$(eval $(call GstBuildPlugin,dtmf,dtmf support,rtp,,))
+#$(eval $(call GstBuildPlugin,dv,dv support,audio tag video,,))
+$(eval $(call GstBuildPlugin,effectv,effectvsupport,video,,))
+$(eval $(call GstBuildPlugin,equalizer,audio equalizer,audio controller,,))
+$(eval $(call GstBuildPlugin,flac,FLAC codec,audio pbutils tag,,+libflac))
+$(eval $(call GstBuildPlugin,flv,flv codec,audio pbutils tag video,,))
+$(eval $(call GstBuildPlugin,flxdec,flx codec,,,))
+#$(eval $(call GstBuildPlugin,gdkpixbuf,gdkpixbuf support,video,,))
+$(eval $(call GstBuildPlugin,goom2k1,goom support,audio video pbutils,,))
+$(eval $(call GstBuildPlugin,goom,goom support,audio video pbutils,,))
+$(eval $(call GstBuildPlugin,icydemux,icy demuxer,audio tag,,))
+$(eval $(call GstBuildPlugin,id3demux,ID3v1/v2 demuxer,pbutils tag,,))
+$(eval $(call GstBuildPlugin,imagefreeze,imagefreeze support,,,))
+$(eval $(call GstBuildPlugin,interleave,audio interleave,audio,,))
+$(eval $(call GstBuildPlugin,isomp4,isomp4 support,audio pbutils riff rtp tag video,,))
+#$(eval $(call GstBuildPlugin,jack,jack support,audio,,))
+$(eval $(call GstBuildPlugin,jpeg,jpeg support,video,,+libjpeg))
+$(eval $(call GstBuildPlugin,level,audio level,audio,,))
+$(eval $(call GstBuildPlugin,matroska,matroska support,audio pbutils riff tag video,,))
+$(eval $(call GstBuildPlugin,mulaw,mulaw support,audio,,))
+$(eval $(call GstBuildPlugin,multifile,multiple files access,video,,))
+$(eval $(call GstBuildPlugin,multipart,multipart stream handling,,,))
+$(eval $(call GstBuildPlugin,navigationtest,navigationtest support,video,,))
+$(eval $(call GstBuildPlugin,oss4,OSS 4 audio support,audio tag,,))
+$(eval $(call GstBuildPlugin,ossaudio,OSS audio support,audio,,))
+$(eval $(call GstBuildPlugin,png,png support,video,,+libpng))
+#$(eval $(call GstBuildPlugin,pulse,pulse support,audio pbutils tag video,,))
+$(eval $(call GstBuildPlugin,replaygain,volume normalization,pbutils,,))
+$(eval $(call GstBuildPlugin,rtpmanager,RTP manager,audio net rtp tag pbutils video,,))
+$(eval $(call GstBuildPlugin,rtp,RTP,audio rtp tag pbutils video,,))
+$(eval $(call GstBuildPlugin,rtsp,RTSP,net rtp rtsp sdp,,))
+$(eval $(call GstBuildPlugin,shapewipe,shapewipe support,video,,))
+#$(eval $(call GstBuildPlugin,shout2,shout2 support,,,))
+$(eval $(call GstBuildPlugin,smpte,smpte support,video,,))
+$(eval $(call GstBuildPlugin,soup,soup input,audio tag,,+libsoup))
+$(eval $(call GstBuildPlugin,spectrum,spectrum data output,audio fft,,))
+#$(eval $(call GstBuildPlugin,speex,speex support,audio tag,,))
+#$(eval $(call GstBuildPlugin,sty4menc,sty4menc support,video,,))
+#$(eval $(call GstBuildPlugin,taglib,taglib support,tag,,))
+$(eval $(call GstBuildPlugin,udp,UDP,net,,))
+$(eval $(call GstBuildPlugin,video4linux2,video4linux2 support,video allocators,,+libv4l))
+$(eval $(call GstBuildPlugin,videobox,videobox support,video,,))
+$(eval $(call GstBuildPlugin,videocrop,videocrop support,video,,))
+$(eval $(call GstBuildPlugin,videofilter,videofilter support,video,,))
+$(eval $(call GstBuildPlugin,videomixer,videomixer support,video,,))
+$(eval $(call GstBuildPlugin,vpx,vpx support,tag video,,+libvpx))
+$(eval $(call GstBuildPlugin,wavenc,Wav encoder,riff,,))
+#$(eval $(call GstBuildPlugin,wavpack,Wav packer,audio riff tag,,))
+$(eval $(call GstBuildPlugin,wavparse,Wav parser,audio riff tag,,))
+#$(eval $(call GstBuildPlugin,ximagesrc,ximagesrc support,video,,))
+
+$(eval $(call BuildPackage,gstreamer1-plugins-good))
+$(eval $(call BuildPackage,gst1-plugins-good))
diff --git a/multimedia/gst1-plugins-good/patches/001-no-translations.patch b/multimedia/gst1-plugins-good/patches/001-no-translations.patch
new file mode 100644 (file)
index 0000000..6b78b28
--- /dev/null
@@ -0,0 +1,22 @@
+diff -u --recursive gst-plugins-good-1.12.4-vanilla/configure.ac gst-plugins-good-1.12.4/configure.ac
+--- gst-plugins-good-1.12.4-vanilla/configure.ac       2018-02-11 10:34:37.773144289 -0500
++++ gst-plugins-good-1.12.4/configure.ac       2018-02-11 10:35:17.103223474 -0500
+@@ -1061,7 +1061,6 @@
+ sys/v4l2/Makefile
+ sys/waveform/Makefile
+ sys/ximage/Makefile
+-po/Makefile.in
+ tests/Makefile
+ tests/check/Makefile
+ tests/examples/Makefile
+diff -u --recursive gst-plugins-good-1.12.4-vanilla/Makefile.am gst-plugins-good-1.12.4/Makefile.am
+--- gst-plugins-good-1.12.4-vanilla/Makefile.am        2018-02-11 10:34:37.786144315 -0500
++++ gst-plugins-good-1.12.4/Makefile.am        2018-02-11 10:35:23.529236411 -0500
+@@ -4,7 +4,6 @@
+       gst sys ext             \
+       tests                   \
+       docs                    \
+-      po                      \
+       common                  \
+       m4                      \
+       pkgconfig
diff --git a/multimedia/gst1-plugins-good/patches/002-no-tests.patch b/multimedia/gst1-plugins-good/patches/002-no-tests.patch
new file mode 100644 (file)
index 0000000..187009f
--- /dev/null
@@ -0,0 +1,35 @@
+diff -u --recursive gst-plugins-good-1.12.4-vanilla/configure.ac gst-plugins-good-1.12.4/configure.ac
+--- gst-plugins-good-1.12.4-vanilla/configure.ac       2018-02-11 10:36:40.335391048 -0500
++++ gst-plugins-good-1.12.4/configure.ac       2018-02-11 10:37:22.304475546 -0500
+@@ -1061,20 +1061,6 @@
+ sys/v4l2/Makefile
+ sys/waveform/Makefile
+ sys/ximage/Makefile
+-tests/Makefile
+-tests/check/Makefile
+-tests/examples/Makefile
+-tests/examples/audiofx/Makefile
+-tests/examples/cairo/Makefile
+-tests/examples/equalizer/Makefile
+-tests/examples/jack/Makefile
+-tests/examples/level/Makefile
+-tests/examples/rtp/Makefile
+-tests/examples/shapewipe/Makefile
+-tests/examples/spectrum/Makefile
+-tests/examples/v4l2/Makefile
+-tests/files/Makefile
+-tests/icles/Makefile
+ common/Makefile
+ common/m4/Makefile
+ m4/Makefile
+diff -u --recursive gst-plugins-good-1.12.4-vanilla/Makefile.am gst-plugins-good-1.12.4/Makefile.am
+--- gst-plugins-good-1.12.4-vanilla/Makefile.am        2018-02-11 10:36:40.335391048 -0500
++++ gst-plugins-good-1.12.4/Makefile.am        2018-02-11 10:37:37.242505621 -0500
+@@ -2,7 +2,6 @@
+ ALWAYS_SUBDIRS =              \
+       gst sys ext             \
+-      tests                   \
+       docs                    \
+       common                  \
+       m4                      \
diff --git a/multimedia/gst1-plugins-good/patches/003-no-docs.patch b/multimedia/gst1-plugins-good/patches/003-no-docs.patch
new file mode 100644 (file)
index 0000000..f13cb61
--- /dev/null
@@ -0,0 +1,24 @@
+diff -u --recursive gst-plugins-good-1.12.4-vanilla/configure.ac gst-plugins-good-1.12.4/configure.ac
+--- gst-plugins-good-1.12.4-vanilla/configure.ac       2018-02-11 10:37:22.304475546 -0500
++++ gst-plugins-good-1.12.4/configure.ac       2018-02-11 10:38:15.248581736 -0500
+@@ -1064,9 +1064,6 @@
+ common/Makefile
+ common/m4/Makefile
+ m4/Makefile
+-docs/Makefile
+-docs/plugins/Makefile
+-docs/version.entities
+ pkgconfig/Makefile
+ pkgconfig/gstreamer-plugins-good-uninstalled.pc
+ )
+diff -u --recursive gst-plugins-good-1.12.4-vanilla/Makefile.am gst-plugins-good-1.12.4/Makefile.am
+--- gst-plugins-good-1.12.4-vanilla/Makefile.am        2018-02-11 10:37:37.242505621 -0500
++++ gst-plugins-good-1.12.4/Makefile.am        2018-02-11 10:38:28.838608856 -0500
+@@ -2,7 +2,6 @@
+ ALWAYS_SUBDIRS =              \
+       gst sys ext             \
+-      docs                    \
+       common                  \
+       m4                      \
+       pkgconfig
index 2f6c334c34ad9df8dad708ee73afdf5451ffd2e1..cd2b4251a9778f81d59be0bde1ed1bf505bf9de0 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-plugins-ugly
-PKG_VERSION:=1.8.2
+PKG_VERSION:=1.12.4
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
@@ -20,13 +20,12 @@ 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_HASH:=1c165b8d888ed350acd8e6ac9f6fe06508e6fcc0a3afc6ccc9fbeb30df9be522
 
-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-mpg123 \
        CONFIG_PACKAGE_gst1-mod-mpeg2dec \
 
 PKG_FIXUP:=autoreconf
@@ -110,7 +109,7 @@ CONFIGURE_ARGS += \
        --disable-dvdsub \
        --disable-iec958 \
        $(call GST_COND_SELECT,lame) \
-       $(call GST_COND_SELECT,mad) \
+       $(call GST_COND_SELECT,mpg123) \
        $(call GST_COND_SELECT,mpeg2dec) \
        --disable-mpegaudioparse \
        --disable-mpegstream \
@@ -170,7 +169,7 @@ 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,mpg123,MP3 decoder (using mpg123),audio tag,,+libid3tag +mpg123))
 $(eval $(call GstBuildPlugin,mpeg2dec,MPEG decoder,video,,+libmpeg2))
 
 $(eval $(call BuildPackage,gstreamer1-plugins-ugly))
index ea02ec82155e2573e16991b047541f3cd3974314..94ca8e2dd3f38214077057d5691c8c680e4318d4 100644 (file)
@@ -1,23 +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
+diff -u --recursive gst-plugins-ugly-1.12.4-vanilla/configure.ac gst-plugins-ugly-1.12.4/configure.ac
+--- gst-plugins-ugly-1.12.4-vanilla/configure.ac       2018-02-11 20:18:05.152825587 -0500
++++ gst-plugins-ugly-1.12.4/configure.ac       2018-02-11 20:18:33.859767165 -0500
+@@ -474,7 +474,6 @@
  tests/check/Makefile
+ tests/files/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
+ )
+diff -u --recursive gst-plugins-ugly-1.12.4-vanilla/Makefile.am gst-plugins-ugly-1.12.4/Makefile.am
+--- gst-plugins-ugly-1.12.4-vanilla/Makefile.am        2018-02-11 20:18:05.157825577 -0500
++++ gst-plugins-ugly-1.12.4/Makefile.am        2018-02-11 20:18:23.491788265 -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
+       
+ EXTRA_DIST = \
+       depcomp \
index 26cd48a3d85df1ca43453d65223c13da818b6c2b..b95d0e60fb0e559bed12163a6393e6e50a413e2b 100644 (file)
@@ -1,6 +1,7 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -478,9 +478,6 @@ ext/x264/Makefile
+diff -u --recursive gst-plugins-ugly-1.12.4-vanilla/configure.ac gst-plugins-ugly-1.12.4/configure.ac
+--- gst-plugins-ugly-1.12.4-vanilla/configure.ac       2018-02-11 20:19:01.875710150 -0500
++++ gst-plugins-ugly-1.12.4/configure.ac       2018-02-11 20:19:27.117658780 -0500
+@@ -470,9 +470,6 @@
  docs/Makefile
  docs/plugins/Makefile
  docs/version.entities
  m4/Makefile
  pkgconfig/Makefile
  pkgconfig/gstreamer-plugins-ugly-uninstalled.pc
---- a/Makefile.am
-+++ b/Makefile.am
+diff -u --recursive gst-plugins-ugly-1.12.4-vanilla/Makefile.am gst-plugins-ugly-1.12.4/Makefile.am
+--- gst-plugins-ugly-1.12.4-vanilla/Makefile.am        2018-02-11 20:19:01.875710150 -0500
++++ gst-plugins-ugly-1.12.4/Makefile.am        2018-02-11 20:19:34.402643954 -0500
 @@ -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
+       
+ EXTRA_DIST = \
+       depcomp \
index 3ef1255ade64341008e0379c722c95e033f90e65..8e56c4725783335508a1f527ae1193e7c71fab32 100644 (file)
@@ -1,6 +1,7 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -475,9 +475,6 @@ ext/mpg123/Makefile
+diff -u --recursive gst-plugins-ugly-1.12.4-vanilla/configure.ac gst-plugins-ugly-1.12.4/configure.ac
+--- gst-plugins-ugly-1.12.4-vanilla/configure.ac       2018-02-11 20:19:47.318617668 -0500
++++ gst-plugins-ugly-1.12.4/configure.ac       2018-02-11 20:19:56.171599652 -0500
+@@ -467,9 +467,6 @@
  ext/sidplay/Makefile
  ext/twolame/Makefile
  ext/x264/Makefile
  m4/Makefile
  pkgconfig/Makefile
  pkgconfig/gstreamer-plugins-ugly-uninstalled.pc
---- a/Makefile.am
-+++ b/Makefile.am
+diff -u --recursive gst-plugins-ugly-1.12.4-vanilla/Makefile.am gst-plugins-ugly-1.12.4/Makefile.am
+--- gst-plugins-ugly-1.12.4-vanilla/Makefile.am        2018-02-11 20:19:47.318617668 -0500
++++ gst-plugins-ugly-1.12.4/Makefile.am        2018-02-11 20:20:03.662584407 -0500
 @@ -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
+       
+ EXTRA_DIST = \
+       depcomp \
index c75ac0ddd55e5bec148f18a047eb470fd3070d99..3b3032765af3496ba7210d9bab09f4b45b3957fb 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gstreamer1
-PKG_VERSION:=1.8.2
+PKG_VERSION:=1.12.4
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_BUILD_DIR:=$(BUILD_DIR)/gstreamer-$(PKG_VERSION)
 PKG_SOURCE:=gstreamer-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gstreamer/
-PKG_MD5SUM:=9dbebe079c2ab2004ef7f2649fa317cabea1feb4fb5605c24d40744b90918341
+PKG_HASH:=5a8704aa4c2eeb04da192c4a9942f94f860ac1a585de90d9f914bac26a970674
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=autogen.sh aclocal.m4
@@ -121,6 +121,8 @@ CONFIGURE_ARGS += \
        --disable-examples \
        --disable-tests \
        --disable-valgrind \
+       --disable-gst-tracer-hooks \
+       --with-unwind=no \
        --without-libiconv-prefix \
        --without-libintl-prefix \
        --without-x \
@@ -135,11 +137,6 @@ define Build/InstallDev
                ./usr/include/gstreamer-$(GST_VERSION)/* \
                $(1)/usr/include/gstreamer-$(GST_VERSION)/ \
        )
-       $(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION)/include/gst
-       ( cd $(PKG_INSTALL_DIR); $(CP) \
-               ./usr/lib/gstreamer-$(GST_VERSION)/include/gst/*.h \
-               $(1)/usr/lib/gstreamer-$(GST_VERSION)/include/gst \
-       )
        $(INSTALL_DIR) $(1)/usr/lib
        ( cd $(PKG_INSTALL_DIR); $(CP) \
                ./usr/lib/libgst*-$(GST_VERSION).{a,la,so*} \
index 9c5b590fdb2943b9d140522de33cbe5db3799a48..1202812b9ced3ec4a56ff4ed11222b3ed910e83d 100644 (file)
@@ -1,6 +1,7 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -998,7 +998,6 @@ libs/gst/net/Makefile
+diff -u --recursive gstreamer-1.12.4-vanilla/configure.ac gstreamer-1.12.4/configure.ac
+--- gstreamer-1.12.4-vanilla/configure.ac      2018-02-10 17:37:16.379378242 -0500
++++ gstreamer-1.12.4/configure.ac      2018-02-10 17:40:18.742109326 -0500
+@@ -1083,7 +1083,6 @@
  plugins/Makefile
  plugins/elements/Makefile
  plugins/tracers/Makefile
@@ -8,9 +9,10 @@
  tests/Makefile
  tests/benchmarks/Makefile
  tests/check/Makefile
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -9,7 +9,6 @@ aclocal_DATA = gst-element-check-@GST_AP
+diff -u --recursive gstreamer-1.12.4-vanilla/Makefile.am gstreamer-1.12.4/Makefile.am
+--- gstreamer-1.12.4-vanilla/Makefile.am       2018-02-10 17:37:16.390378286 -0500
++++ gstreamer-1.12.4/Makefile.am       2018-02-10 17:40:29.112150898 -0500
+@@ -9,7 +9,6 @@
  SUBDIRS = pkgconfig \
        gst libs plugins tests \
        docs \
@@ -18,7 +20,7 @@
        m4 \
        common \
        data
-@@ -22,7 +21,6 @@ endif
+@@ -22,7 +21,6 @@
  DIST_SUBDIRS = pkgconfig \
        gst libs plugins tools tests \
        docs \
index 42874100b861ad6d49d03f344f2c3895d120fe8e..bc177daa244e8bae6b355e5a09bc1c7254495982 100644 (file)
@@ -1,6 +1,7 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -998,21 +998,6 @@ libs/gst/net/Makefile
+diff -u --recursive gstreamer-1.12.4-vanilla/configure.ac gstreamer-1.12.4/configure.ac
+--- gstreamer-1.12.4-vanilla/configure.ac      2018-02-10 17:43:59.957864211 -0500
++++ gstreamer-1.12.4/configure.ac      2018-02-10 17:44:19.772930084 -0500
+@@ -1083,20 +1083,6 @@
  plugins/Makefile
  plugins/elements/Makefile
  plugins/tracers/Makefile
@@ -13,7 +14,6 @@
 -tests/examples/controller/Makefile
 -tests/examples/stepping/Makefile
 -tests/examples/helloworld/Makefile
--tests/examples/manual/Makefile
 -tests/examples/memory/Makefile
 -tests/examples/netclock/Makefile
 -tests/examples/ptp/Makefile
  tools/Makefile
  common/Makefile
  common/m4/Makefile
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -7,7 +7,7 @@ aclocaldir = $(datadir)/aclocal
+diff -u --recursive gstreamer-1.12.4-vanilla/Makefile.am gstreamer-1.12.4/Makefile.am
+--- gstreamer-1.12.4-vanilla/Makefile.am       2018-02-10 17:43:59.959864217 -0500
++++ gstreamer-1.12.4/Makefile.am       2018-02-10 17:44:30.298965075 -0500
+@@ -7,7 +7,7 @@
  aclocal_DATA = gst-element-check-@GST_API_VERSION@.m4
  
  SUBDIRS = pkgconfig \
@@ -33,7 +34,7 @@
        docs \
        m4 \
        common \
-@@ -19,7 +19,7 @@ endif
+@@ -19,7 +19,7 @@
  
  # These are all the possible subdirs
  DIST_SUBDIRS = pkgconfig \
index 3d1187ae64e7ed271b5b968836a51714c532b2af..d7b4a73a15d6a377fbfba9536a54edd862413cf3 100644 (file)
@@ -1,27 +1,23 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -1001,18 +1001,6 @@ plugins/tracers/Makefile
+diff -u --recursive gstreamer-1.12.4-vanilla/configure.ac gstreamer-1.12.4/configure.ac
+--- gstreamer-1.12.4-vanilla/configure.ac      2018-02-10 17:45:28.053157030 -0500
++++ gstreamer-1.12.4/configure.ac      2018-02-10 17:45:47.703222322 -0500
+@@ -1086,12 +1086,6 @@
  tools/Makefile
  common/Makefile
  common/m4/Makefile
 -docs/Makefile
--docs/design/Makefile
--docs/faq/Makefile
 -docs/gst/Makefile
 -docs/gst/gstreamer.types
 -docs/libs/Makefile
 -docs/plugins/Makefile
--docs/manual/Makefile
--docs/pwg/Makefile
--docs/slides/Makefile
--docs/xsl/Makefile
 -docs/version.entities
  m4/Makefile
  pkgconfig/Makefile
  stamp.h
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -8,7 +8,6 @@ aclocal_DATA = gst-element-check-@GST_AP
+diff -u --recursive gstreamer-1.12.4-vanilla/Makefile.am gstreamer-1.12.4/Makefile.am
+--- gstreamer-1.12.4-vanilla/Makefile.am       2018-02-10 17:45:28.053157030 -0500
++++ gstreamer-1.12.4/Makefile.am       2018-02-10 17:45:58.940259656 -0500
+@@ -8,7 +8,6 @@
  
  SUBDIRS = pkgconfig \
        gst libs plugins \
@@ -29,7 +25,7 @@
        m4 \
        common \
        data
-@@ -20,7 +19,6 @@ endif
+@@ -20,7 +19,6 @@
  # These are all the possible subdirs
  DIST_SUBDIRS = pkgconfig \
        gst libs plugins tools \
index 2ef95b78137fd9f32c59f450846f7bbfdc089f05..b65c77ef9d62d6474a5a79b0b734ce011694bf89 100644 (file)
@@ -11,7 +11,6 @@ PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.xiph.org/releases/icecast/
-PKG_MD5SUM:=83d7d34dbe22f0f8fc119d2c9839efc0
 PKG_HASH:=c85ca48c765d61007573ee1406a797ae6cb31fb5961a42e7f1c87adb45ddc592
 
 PKG_MAINTAINER:=André Gaul <andre@gaul.io>, \
index c0569ab4fddd7c99f1ca9a94f729b297db6cb144..3120968f7acc8608c0ee2a243413ee9c29277d13 100644 (file)
@@ -11,7 +11,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://downloads.xiph.org/releases/ices/
-PKG_MD5SUM:=832c448cc993170a70fd95804fcda5b2
+PKG_HASH:=96458df835033c39236ad3bb099286c033241f8ea7c138e7ccf714e7ade75900
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
@@ -41,7 +41,7 @@ CONFIGURE_ARGS+= \
        --with-ogg="$(STAGING_DIR)/usr/include" \
        --with-vorbis="$(STAGING_DIR)/usr/include"
 
-TARGET_LDFLAGS+= -logg
+TARGET_LDFLAGS+= -logg -lvorbisidec
 
 define Package/ices/install
        $(INSTALL_DIR) $(1)/usr/bin
diff --git a/multimedia/lcdgrilo/Makefile b/multimedia/lcdgrilo/Makefile
new file mode 100644 (file)
index 0000000..a642365
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2009-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:=lcdgrilo
+PKG_VERSION:=0.0.12
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://www.flyn.org/projects/lcdgrilo
+PKG_HASH:=2e5028fff7a90b1a3688c466f048e978a52d9a4da20a382546d5e5bd42e2fc6a
+PKG_BUILD_DEPENDS:=vala
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/lcdgrilo
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  DEPENDS:=+grilo +grilo-plugins +libgee +libgstreamer1
+  TITLE:=lcdgrilo
+  URL:=http://www.flyn.org/projects/lcdgrilo/
+endef
+
+define Package/lcdgrilo/decription
+       A simple Grilo-based audio player meant to run on a Raspberry Pi with a PiFace CAD
+endef
+
+define Package/lcdgrilo/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/bin/lcdgrilo \
+               $(1)/usr/bin/
+       $(INSTALL_BIN) ./files/lcdgrilo.init $(1)/etc/init.d/lcdgrilo
+endef
+
+$(eval $(call BuildPackage,lcdgrilo))
diff --git a/multimedia/lcdgrilo/files/lcdgrilo.init b/multimedia/lcdgrilo/files/lcdgrilo.init
new file mode 100644 (file)
index 0000000..5c4ff1b
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2009-2012 OpenWrt.org
+
+START=60
+
+start() {
+       /usr/bin/lcdgrilo &
+       echo $! > /var/run/lcdgrilo.pid
+}
+
+stop() {
+       if [ ! -f /var/run/lcdgrilo.pid ]; then
+               return
+       fi
+       /bin/kill `cat /var/run/lcdgrilo.pid`
+}
index 144da201fa345d103185d0d25c03e0ad0ea2f8ac..fc80e56660e32594742a69dc7bd3e2e16ef0560d 100644 (file)
@@ -8,17 +8,20 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=minidlna
-PKG_VERSION:=1.1.5
-PKG_RELEASE:=1
+PKG_VERSION:=1.2.1
+PKG_RELEASE:=3
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/minidlna
-PKG_MD5SUM:=1970e553a1eb8a3e7e302e2ce292cbc4
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=67388ba23ab0c7033557a32084804f796aa2a796db7bb2b770fb76ac2a742eec
+
 PKG_LICENSE:=GPL-2.0 BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING LICENCE.miniupnpd
 
 PKG_MAINTAINER:=Knyazkov Dmitry <medavedik@gmail.com>
 
+PKG_FIXUP:=autoreconf
+
 PKG_BUILD_PARALLEL:=0
 PKG_BUILD_DEPENDS:=util-linux
 
@@ -45,11 +48,6 @@ define Package/minidlna/conffiles
 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 \
index 91a5cc3305bd31c0666abffda9b9f2398087b25c..924a99ea9da59c1f5f248e4efd8300123f296ba1 100644 (file)
@@ -7,6 +7,7 @@ config minidlna config
        option log_dir '/var/log'
        option inotify '1'
        option enable_tivo '0'
+       option wide_links '0'
        option strict_dlna '0'
        option presentation_url ''
        option notify_interval '900'
index a92a064d3c04118ae4633cedabf68c49f9c1ab39..c894186d342cd440d812c8ec0d431ef54c0eae86 100644 (file)
@@ -57,8 +57,10 @@ minidlna_create_config() {
        minidlna_cfg_addstr $cfg friendly_name
        minidlna_cfg_addstr $cfg db_dir
        minidlna_cfg_addstr $cfg log_dir
+       minidlna_cfg_addstr $cfg log_level 'error'
        minidlna_cfg_addbool $cfg inotify '1'
        minidlna_cfg_addbool $cfg enable_tivo '0'
+       minidlna_cfg_addbool $cfg wide_links '0'
        minidlna_cfg_addbool $cfg strict_dlna '0'
        minidlna_cfg_addstr $cfg album_art_names
        minidlna_cfg_addstr $cfg presentation_url
diff --git a/multimedia/minidlna/patches/002-dont-build-po-files.patch b/multimedia/minidlna/patches/002-dont-build-po-files.patch
new file mode 100644 (file)
index 0000000..3862324
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -17,7 +17,7 @@
+ AM_CFLAGS = -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 @STATIC_CFLAGS@
+-SUBDIRS=po
++SUBDIRS=
+ sbin_PROGRAMS = minidlnad
+ check_PROGRAMS = testupnpdescgen
+--- a/configure.ac
++++ b/configure.ac
+@@ -644,6 +644,8 @@ case "$target_os" in
+ esac
+-AC_OUTPUT([ po/Makefile.in
+-Makefile
+-])
++# AC_OUTPUT([ po/Makefile.in
++# Makefile
++# ])
++AC_CONFIG_FILES([Makefile])
++AC_OUTPUT
diff --git a/multimedia/minidlna/patches/010-libav-fix.patch b/multimedia/minidlna/patches/010-libav-fix.patch
deleted file mode 100644 (file)
index 5924599..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
---- a/libav.h
-+++ b/libav.h
-@@ -167,7 +167,7 @@
- static inline int
- lav_is_thumbnail_stream(AVStream *s, uint8_t **data, int *size)
- {
--#if LIBAVFORMAT_VERSION_INT >= ((54<<16)+(6<<8))
-+/*if LIBAVFORMAT_VERSION_INT >= ((54<<16)+(6<<8))
-       if (s->disposition & AV_DISPOSITION_ATTACHED_PIC &&
-           s->codec->codec_id == AV_CODEC_ID_MJPEG)
-       {
-@@ -177,6 +177,6 @@
-                       *size = s->attached_pic.size;
-               return 1;
-       }
--#endif
-+endif*/
-       return 0;
- }
index 69e05f499b56e64396b78e37e5b64b05b5e25f1f..bc8e44ce7f67fd726440790193b3afd85c241106 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2006-2015 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -10,14 +8,16 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=mjpg-streamer
 PKG_REV:=182
 PKG_VERSION:=r$(PKG_REV)
-PKG_RELEASE:=8
-PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_RELEASE:=10
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>, \
+               Ted Hess <thess@kitschensync.net>
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).1.tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).1.tar.xz
 PKG_SOURCE_URL:=https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer-experimental
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_SOURCE_PROTO:=svn
+PKG_MIRROR_HASH:=ccff417d0a34f7cee12c7984f77788267b1da0f2a7d849bc1b2e3614e670078b
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=LICENSE
@@ -71,6 +71,10 @@ define Build/Prepare
     endif
 endef
 
+define Build/Configure
+    $(RM) $(PKG_BUILD_DIR)/plugins/input_uvc/uvcvideo.h
+endef
+
 ifeq ($(CONFIG_MJPG_STREAMER_V4L2),y)
     TARGET_CFLAGS+= -DUSE_LIBV4L2
     TARGET_LDFLAGS+= -lv4l2
index 06630d42331e103ae847ca47527305d06287b1e7..b7c7ec38f0c13afcee0fe6542cce9bfae8f4fed4 100644 (file)
@@ -84,6 +84,7 @@ start_instance() {
 
        procd_open_instance
        procd_set_param command "$PROG" --input "$input_arg" --output "$output_arg"
+       [ "x$output" = 'xhttp' ] && procd_add_mdns "http" "tcp" "$port" "daemon=mjpg-streamer"
        procd_close_instance
 }
 
diff --git a/multimedia/mjpg-streamer/patches/035-remove_build_date-time.patch b/multimedia/mjpg-streamer/patches/035-remove_build_date-time.patch
new file mode 100644 (file)
index 0000000..f2d0519
--- /dev/null
@@ -0,0 +1,34 @@
+--- a/Makefile
++++ b/Makefile
+@@ -15,8 +15,8 @@ DESTDIR = /usr/local
+ # set the compiler to use
+ CC = gcc
+-SVNDEV := -D'SVN_REV="$(shell svnversion -c .)"'
+-CFLAGS += $(SVNDEV)
++#SVNDEV := -D'SVN_REV="$(shell svnversion -c .)"'
++#CFLAGS += $(SVNDEV)
+ # general compile flags, enable all warnings to make compile more verbose
+ CFLAGS += -DLINUX -D_GNU_SOURCE -Wall 
+--- a/mjpg_streamer.c
++++ b/mjpg_streamer.c
+@@ -253,15 +253,12 @@ int main(int argc, char *argv[])
+             /* v, version */
+         case 6:
+         case 7:
+-            printf("MJPG Streamer Version: %s\n" \
+-            "Compilation Date.....: %s\n" \
+-            "Compilation Time.....: %s\n",
++            printf("MJPG Streamer Version: %s\n",
+ #ifdef SVN_REV
+-            SVN_REV,
++            SVN_REV);
+ #else
+-            SOURCE_VERSION,
++            SOURCE_VERSION);
+ #endif
+-            __DATE__, __TIME__);
+             return 0;
+             break;
index 7b6b5f5b192a737c144470af96f73f0b3b57d028..1f0fca7b8a643825d30dcbe888760bbfc05035ca 100644 (file)
@@ -21,6 +21,7 @@ PKG_SOURCE_VERSION:=9479d910f2149b5558788bb86f97f26522794212
 
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_MIRROR_HASH:=02602c775ec3829dac59aed16ea6b0d78f77a435b9c360db1a05cb27227da97e
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 PKG_BUILD_PARALLEL:=1
 
index a025e8dab96cd0bbdffcacc3319d84eebfc9a54b..bb561eda926aa5e3003bf2224670504cd5c221b4 100644 (file)
@@ -13,6 +13,7 @@ PKG_VERSION:=20150412
 PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=7d38d6cb57529d832d87a49d23d3ce24ba088110e3721580139860486c15494c
 PKG_SOURCE_URL:=https://r-w-x.org/oggfwd.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
index 6b5b95f785e70ae2e3d18378f5376dc44aef4733..4523fa082cdc3d0367f765cdd3b27c814ad74e94 100644 (file)
@@ -14,6 +14,7 @@ PKG_RELEASE:=1
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)
 PKG_SOURCE_VERSION:=v$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=c18e3803d6e36348442ccf3b0ac4868948692491c7dd646d48576f5aec09cdd8
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/tvheadend/tvheadend.git
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
diff --git a/multimedia/v4l2rtspserver/Makefile b/multimedia/v4l2rtspserver/Makefile
new file mode 100644 (file)
index 0000000..9d442ec
--- /dev/null
@@ -0,0 +1,85 @@
+#
+# Copyright (C) 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_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/mpromonet/v4l2rtspserver.git
+PKG_SOURCE_VERSION:=d7e8dd4d35a802219222642a2e3b28f2dc5069c1
+PKG_DATE:=2017-12-20
+
+PKG_NAME:=v4l2rtspserver
+PKG_VERSION:=$(PKG_DATE)-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Roger Dammit <rogerdammit@gmail.com>
+
+LIVE555_VERSION:=2017.10.28
+LIVE555_MD5SUM:=a5acd14c4fa7b50f7270304d3b4a70ae
+LIVE555_FILE:=live.$(LIVE555_VERSION).tar.gz
+
+CMAKE_INSTALL:=1 
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/v4l2rtspserver
+       SECTION:=multimedia
+       CATEGORY:=Multimedia
+       TITLE:=v4l2rtspserver
+       DEPENDS:=+libstdcpp
+       URL:=https://github.com/mpromonet/v4l2rtspserver
+endef  
+
+define Package/v4l2rtspserver/description
+       RTSP server for v4L2 video sources
+endef
+
+define Package/v4l2rtspserver/conffiles
+       /etc/config/v4l2rtspserver
+endef
+
+define Download/live555
+       URL:=https://download.videolan.org/pub/contrib/live555/
+       FILE:=$(LIVE555_FILE)
+       MD5SUM:=$(LIVE555_MD5SUM)
+endef
+
+define Build/Prepare
+       $(Build/Prepare/Default)
+
+       ## need to compile some dependencies so that cmake will find them
+
+       # build live555
+        $(eval $(call Download,live555))
+
+       mkdir -p $(PKG_BUILD_DIR)/live555
+       $(TAR) -xf $(DL_DIR)/$(LIVE555_FILE) --strip=1 -C $(PKG_BUILD_DIR)/live555
+       $(CP) files/config.openwrt $(PKG_BUILD_DIR)/live555
+       ( cd $(PKG_BUILD_DIR)/live555; ./genMakefiles openwrt )
+
+       $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR)/live555 
+       $(MAKE) -C $(PKG_BUILD_DIR)/live555 PREFIX="$(STAGING_DIR)/usr/" install
+
+       # build v4l2wrapper
+       $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR)/v4l2wrapper CFLAGS="$(TARGET_CFLAGS) -I $(PKG_BUILD_DIR)/v4l2wrapper/inc"
+       $(CP) $(PKG_BUILD_DIR)/v4l2wrapper/libv4l2wrapper.a $(PKG_BUILD_DIR)
+
+       # patch cmake file
+       $(SED) 's/DEBUG/RELEASE/' $(PKG_BUILD_DIR)/CMakeLists.txt
+endef
+
+define Package/v4l2rtspserver/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v4l2rtspserver-$(PKG_VERSION) $(1)/usr/bin/
+       mv $(1)/usr/bin/v4l2rtspserver-$(PKG_VERSION) $(1)/usr/bin/v4l2rtspserver
+
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) files/v4l2rtspserver.init $(1)/etc/init.d/v4l2rtspserver
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) files/v4l2rtspserver.config $(1)/etc/config/v4l2rtspserver
+endef 
+
+$(eval $(call BuildPackage,v4l2rtspserver))
diff --git a/multimedia/v4l2rtspserver/files/config.openwrt b/multimedia/v4l2rtspserver/files/config.openwrt
new file mode 100644 (file)
index 0000000..0c87988
--- /dev/null
@@ -0,0 +1,19 @@
+COMPILE_OPTS =                 $(INCLUDES) -I. -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLOCALE_NOT_USED -DNO_SSTREAM=1 -DALLOW_RTSP_SERVER_PORT_REUSE=1 
+C =                            c
+C_COMPILER =                   $(GCC)
+CFLAGS +=                      $(COMPILE_OPTS)
+C_FLAGS =                      $(CFLAGS)
+CPP =                          cpp
+CPLUSPLUS_COMPILER =           $(AS) # optimizations are only in AR apparently, so use instead of CXX
+CPLUSPLUS_FLAGS =              $(COMPILE_OPTS) -Wall -DBSD=1
+CPLUSPLUS_FLAGS +=             $(CPPFLAGS) -fexceptions
+OBJ =                          o
+LINK =                         $(CXX) -o
+LINK_OPTS =                    -L. $(LDFLAGS)
+CONSOLE_LINK_OPTS =            $(LINK_OPTS)
+LIBRARY_LINK =                 $(AR) cr 
+LIBRARY_LINK_OPTS =    
+LIB_SUFFIX =                   a
+LIBS_FOR_CONSOLE_APPLICATION = $(CXXLIBS)
+LIBS_FOR_GUI_APPLICATION =     $(LIBS_FOR_CONSOLE_APPLICATION)
+EXE =
diff --git a/multimedia/v4l2rtspserver/files/v4l2rtspserver.config b/multimedia/v4l2rtspserver/files/v4l2rtspserver.config
new file mode 100644 (file)
index 0000000..7561362
--- /dev/null
@@ -0,0 +1,10 @@
+config v4l2rtspserver 'core'
+       option enabled '0'
+       option device '/dev/video0'
+       option port '554'
+       option resolution '640x480'
+       option fps '15'
+       option path 'stream'
+       option username 'openwrt'
+       option password 'openwrt'
+       option format 'h264'
diff --git a/multimedia/v4l2rtspserver/files/v4l2rtspserver.init b/multimedia/v4l2rtspserver/files/v4l2rtspserver.init
new file mode 100644 (file)
index 0000000..e4c837e
--- /dev/null
@@ -0,0 +1,83 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2017 OpenWrt.org
+
+# TODO: 
+# * support start multiple streams with one server
+# * support multiple usernames
+# * support HLS, etc.
+
+START=90
+STOP=10
+
+USE_PROCD=1
+
+SERVICE=v4l2rtspserver
+PROG=/usr/bin/$SERVICE
+
+error() {
+        logger -t "$SERVICE" "$@"
+}
+
+start_instance() {
+       local s="$1"
+
+       config_get_bool enabled "$1" 'enabled' 0
+       [ $enabled -eq 0 ] && return
+
+       # validate device
+       config_get device "$s" 'device'
+       if [ ! -c "$device" ]; then
+               error "device '$device' does not exist"
+               return 1
+       fi
+
+       # get options
+       config_get port "$s" 'port'
+       config_get resolution "$s" 'resolution'
+       config_get fps "$s" 'fps'
+       config_get username "$s" 'username'
+       config_get password "$s" 'password'
+       config_get path "$s" 'path'
+       config_get format "$s" 'format'
+
+       # pull out resolution width and height from string
+       local w="$(echo $resolution | cut -d'x' -f1)"
+       local h="$(echo $resolution | cut -d'x' -f2)"
+       
+       # make sure format is uppercase
+       format="$(echo $format | tr a-z A-Z)"
+
+       # build args
+       local args="-s"
+       args="$args -P $port"
+       args="$args -u ${path}"
+       args="$args -F $fps"
+       args="$args -W $w"
+       args="$args -H $h"
+       args="$args -f$format"
+       args="$args -c" # fixes issue with corrupt frames with H264
+               
+       if [ -n "$username" ]; then
+               args="$args -U ${username}:${password}"
+       fi
+
+       cmd="$PROG $args $device"
+
+       # procd stuff
+       procd_open_instance
+       procd_set_param file /etc/config/$SERVICE
+       procd_set_param command $cmd
+       procd_set_param stdout 1
+       procd_set_param stderr 1
+       procd_add_mdns "rtsp" "tcp" "$port" "daemon=$SERVICE" "path=/$path"
+       procd_close_instance
+}
+
+start_service() {
+       config_load "$SERVICE"
+       config_foreach start_instance "$SERVICE"
+}
+
+service_triggers() {
+       procd_add_reload_trigger "$SERVICE"
+}
index a533a077377dfb2e8d3bee8ae85e956d7d2b1018..346494170b7b90dd40d8da4f5685835af6ac6fba 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2013-2016 OpenWrt.org
+# Copyright (C) 2013-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xupnpd
-PKG_REV:=5c08c051caa0062cc1c401b2d26d1f36dffe9c55
-PKG_VERSION:=2016-07-06
+PKG_REV:=7ff74b2d5288fbc35c4f6fcb94466d408b1f853c
+PKG_VERSION:=2017-10-31
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
@@ -17,6 +17,7 @@ PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/clark15b/xupnpd.git
 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_MIRROR_HASH:=333e9938556c9a02b28732b5512626b991c65eaf0eb60d38e29f72ec513d312f
 
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=LICENSE
@@ -25,7 +26,7 @@ PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
 
-LUA_FLAGS:=-llua
+LUA_FLAGS:=-llua -lssl -lcrypto
 
 define Build/Compile
        (cd $(PKG_BUILD_DIR)/src; $(TARGET_CC) -v $(LUA_FLAGS) $(TARGET_CFLAGS) -fno-exceptions -fno-rtti -DWITH_URANDOM $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) -lm -ldl -lcrypt -o xupnpd *.c *.cpp)
@@ -34,7 +35,7 @@ endef
 define Package/xupnpd
   SECTION:=multimedia
   CATEGORY:=Multimedia
-  DEPENDS:=+liblua
+  DEPENDS:=+liblua +libopenssl
   TITLE:=eXtensible UPnP agent
   URL:=http://xupnpd.org/
 endef
index a510a7e44f74d5f7e77cc2ae4a9f2961e7597422..344556402be513278329db993493283123ea193c 100644 (file)
@@ -8,18 +8,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=youtube-dl
-PKG_VERSION:=2016.11.27
+PKG_VERSION:=2018.03.10
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://yt-dl.org/downloads/$(PKG_VERSION)/
-PKG_MD5SUM:=2bb2c4ebf5335d69e03e32a0309abfba
+PKG_HASH:=4bfadccb19e379ce38f5601c72dacf0ac5e03881230afee6df2152ab42fa75c5
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
 PKG_LICENSE:=Unlicense
 PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Adrian Panella <ianchi74@outlook.com>
 
+PKG_BUILD_DEPENDS:=python/host zip/host
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -39,7 +40,14 @@ endef
 
 define Package/youtube-dl/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/youtube-dl $(1)/usr/bin/
+       
+       python -m compileall $(PKG_BUILD_DIR)/youtube_dl/
+       cd $(PKG_BUILD_DIR) && zip --quiet youtube-dl-c.zip youtube_dl/*.pyc youtube_dl/*/*.pyc
+       cd $(PKG_BUILD_DIR) && zip --quiet --junk-paths youtube-dl-c.zip youtube_dl/__main__.pyc
+       echo '#!/usr/bin/env python' > $(PKG_BUILD_DIR)/youtube-dl-c
+       cat $(PKG_BUILD_DIR)/youtube-dl-c.zip >> $(PKG_BUILD_DIR)/youtube-dl-c
+       
+       $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/youtube-dl-c $(1)/usr/bin/youtube-dl
 endef
 
 $(eval $(call BuildPackage,youtube-dl))
index 9d35f8005fcd29fe24b219e55bd0d2e584ed0d77..4f69bd09ab3e2e06ee05eec29f2c0fe2495d1d1b 100644 (file)
@@ -8,12 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=acme
-PKG_SOURCE_VERSION:=6d84da588b98733dd9c4f5b88440281ab1eb4989
-PKG_VERSION:=1.4
-PKG_RELEASE:=1
+PKG_SOURCE_VERSION:=7b40cbe8c1a52041351524bcde4b37665a7cdf79
+PKG_VERSION:=1.6
+PKG_RELEASE:=3
 PKG_LICENSE:=GPLv3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE).tar.xz
+PKG_MIRROR_HASH:=008c6f779bcbbccbde9cdd2b37b07f7a1f5a0678ee9533ce3060690b63edf2c0
 PKG_SOURCE_URL:=git://github.com/Neilpang/acme.sh.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
@@ -25,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/acme
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+curl +ca-certificates +openssl-util +netcat
+  DEPENDS:=+curl +ca-bundle +openssl-util +netcat
   TITLE:=ACME (Letsencrypt) client
   PKGARCH:=all
   MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
@@ -47,6 +48,7 @@ define Build/Compile
 endef
 
 define Package/acme/install
+       $(INSTALL_DIR) $(1)/etc/acme
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_CONF) ./files/acme.config $(1)/etc/config/acme
        $(INSTALL_DIR) $(1)/etc/init.d
@@ -90,6 +92,7 @@ uci -q get ucitrack.@acme[0] > /dev/null && {
   uci delete ucitrack.@acme[0]
   uci commit
 }
+exit 0
 endef
 
 
index a4f7956de76624b5c4750a4cd439b6563465582b..c20cba203428e084521d58adc9280e8f0c8f17c6 100644 (file)
@@ -25,11 +25,12 @@ s.anonymous = true
 st = s:option(Value, "state_dir", translate("State directory"),
               translate("Where certs and other state files are kept."))
 st.rmempty = false
-st.datatype = "string"
+st.datatype = "directory"
 
 ae = s:option(Value, "account_email", translate("Account email"),
               translate("Email address to associate with account key."))
 ae.rmempty = false
+ae.datatype = "minlength(1)"
 
 d = s:option(Flag, "debug", translate("Enable debug logging"))
 d.rmempty = false
@@ -56,6 +57,12 @@ u = cs:option(Flag, "update_uhttpd", translate("Use for uhttpd"),
                         "(only select this for one certificate)."))
 u.rmempty = false
 
+wr = cs:option(Value, "webroot", translate("Webroot directory"),
+               translate("Webserver root directory. Set this to the webserver " ..
+                         "document root to run Acme in webroot mode. The web " ..
+                         "server must be accessible from the internet on port 80."))
+wr.rmempty = false
+
 dom = cs:option(DynamicList, "domains", translate("Domain names"),
                 translate("Domain names to include in the certificate. " ..
                           "The first name will be the subject name, subsequent names will be alt names. " ..
index c5cd7d3eab7c61cb78489c2aeddf9174a56dae42..af12ce1fb008e2f2f2f37e4dd1ae389569e7f3ab 100644 (file)
@@ -5,7 +5,8 @@ config acme
 
 config cert 'example'
        option enabled 0
-       option use_staging 0
+       option use_staging 1
        option keylength 2048
        option update_uhttpd 1
+       option webroot ""
        list domains example.org
index 94fd62426235607ef3d84af220947ca5d94bc5cd..50c5f9cd07a7a3acd95a69584ca6254214708a68 100644 (file)
@@ -10,7 +10,7 @@
 
 CHECK_CRON=$1
 ACME=/usr/lib/acme/acme.sh
-export SSL_CERT_DIR=/etc/ssl/certs
+export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
 export NO_TIMESTAMP=1
 
 UHTTPD_LISTEN_HTTP=
@@ -27,45 +27,85 @@ check_cron()
     /etc/init.d/cron start
 }
 
-debug()
+log()
 {
-    [ "$DEBUG" -eq "1" ] && echo "$@" >&2
+    logger -t acme -s -p daemon.info "$@"
 }
 
-pre_checks()
+err()
 {
-    echo "Running pre checks."
-    check_cron
-
-    [ -d "$STATE_DIR" ] || mkdir -p "$STATE_DIR"
-
-    if [ -e /etc/init.d/uhttpd ]; then
+    logger -t acme -s -p daemon.err "$@"
+}
 
-       UHTTPD_LISTEN_HTTP=$(uci get uhttpd.main.listen_http)
+debug()
+{
+    [ "$DEBUG" -eq "1" ] && logger -t acme -s -p daemon.debug "$@"
+}
 
-       uci set uhttpd.main.listen_http=''
-       uci commit uhttpd
-       /etc/init.d/uhttpd reload || return 1
-    fi
+get_listeners()
+{
+    netstat -nptl 2>/dev/null | awk 'match($4, /:80$/){split($7, parts, "/"); print parts[2];}' | uniq | tr "\n" " "
+}
 
-    iptables -I input_rule -p tcp --dport 80 -j ACCEPT || return 1
-    ip6tables -I input_rule -p tcp --dport 80 -j ACCEPT || return 1
+pre_checks()
+{
+    main_domain="$1"
+
+    log "Running pre checks for $main_domain."
+
+    listeners="$(get_listeners)"
+    debug "port80 listens: $listeners"
+
+    case "$listeners" in
+        "uhttpd")
+            debug "Found uhttpd listening on port 80; trying to disable."
+
+            UHTTPD_LISTEN_HTTP=$(uci get uhttpd.main.listen_http)
+
+            if [ -z "$UHTTPD_LISTEN_HTTP" ]; then
+                err "$main_domain: Unable to find uhttpd listen config."
+                err "Manually disable uhttpd or set webroot to continue."
+                return 1
+            fi
+
+            uci set uhttpd.main.listen_http=''
+            uci commit uhttpd || return 1
+            if ! /etc/init.d/uhttpd reload ; then
+                uci set uhttpd.main.listen_http="$UHTTPD_LISTEN_HTTP"
+                uci commit uhttpd
+                return 1
+            fi
+            ;;
+        "")
+            debug "Nothing listening on port 80."
+            ;;
+        *)
+            err "$main_domain: Cannot run in standalone mode; another daemon is listening on port 80."
+            err "Disable other daemon or set webroot to continue."
+            return 1
+            ;;
+    esac
+
+    iptables -I input_rule -p tcp --dport 80 -j ACCEPT -m comment --comment "ACME" || return 1
+    ip6tables -I input_rule -p tcp --dport 80 -j ACCEPT -m comment --comment "ACME" || return 1
     debug "v4 input_rule: $(iptables -nvL input_rule)"
     debug "v6 input_rule: $(ip6tables -nvL input_rule)"
-    debug "port80 listens: $(netstat -ntpl | grep :80)"
     return 0
 }
 
 post_checks()
 {
-    echo "Running post checks (cleanup)."
-    iptables -D input_rule -p tcp --dport 80 -j ACCEPT
-    ip6tables -D input_rule -p tcp --dport 80 -j ACCEPT
+    log "Running post checks (cleanup)."
+    # The comment ensures we only touch our own rules. If no rules exist, that
+    # is fine, so hide any errors
+    iptables -D input_rule -p tcp --dport 80 -j ACCEPT -m comment --comment "ACME" 2>/dev/null
+    ip6tables -D input_rule -p tcp --dport 80 -j ACCEPT -m comment --comment "ACME" 2>/dev/null
 
-    if [ -e /etc/init.d/uhttpd ]; then
+    if [ -e /etc/init.d/uhttpd ] && [ -n "$UHTTPD_LISTEN_HTTP" ]; then
         uci set uhttpd.main.listen_http="$UHTTPD_LISTEN_HTTP"
         uci commit uhttpd
         /etc/init.d/uhttpd reload
+        UHTTPD_LISTEN_HTTP=
     fi
 }
 
@@ -102,12 +142,14 @@ issue_cert()
     local main_domain
     local moved_staging=0
     local failed_dir
+    local webroot
 
     config_get_bool enabled "$section" enabled 0
     config_get_bool use_staging "$section" use_staging
     config_get_bool update_uhttpd "$section" update_uhttpd
     config_get domains "$section" domains
     config_get keylength "$section" keylength
+    config_get webroot "$section" webroot
 
     [ "$enabled" -eq "1" ] || return
 
@@ -116,13 +158,17 @@ issue_cert()
     set -- $domains
     main_domain=$1
 
+    [ -n "$webroot" ] || pre_checks "$main_domain" || return 1
+
+    log "Running ACME for $main_domain"
+
     if [ -e "$STATE_DIR/$main_domain" ]; then
         if [ "$use_staging" -eq "0" ] && is_staging "$main_domain"; then
-            echo "Found previous cert issued using staging server. Moving it out of the way."
+            log "Found previous cert issued using staging server. Moving it out of the way."
             mv "$STATE_DIR/$main_domain" "$STATE_DIR/$main_domain.staging"
             moved_staging=1
         else
-            echo "Found previous cert config. Issuing renew."
+            log "Found previous cert config. Issuing renew."
             $ACME --home "$STATE_DIR" --renew -d "$main_domain" $acme_args || return 1
             return 0
         fi
@@ -130,17 +176,28 @@ issue_cert()
 
 
     acme_args="$acme_args $(for d in $domains; do echo -n "-d $d "; done)"
-    acme_args="$acme_args --standalone"
     acme_args="$acme_args --keylength $keylength"
     [ -n "$ACCOUNT_EMAIL" ] && acme_args="$acme_args --accountemail $ACCOUNT_EMAIL"
     [ "$use_staging" -eq "1" ] && acme_args="$acme_args --staging"
 
+    if [ -z "$webroot" ]; then
+        log "Using standalone mode"
+        acme_args="$acme_args --standalone"
+    else
+        if [ ! -d "$webroot" ]; then
+            err "$main_domain: Webroot dir '$webroot' does not exist!"
+            return 1
+        fi
+        log "Using webroot dir: $webroot"
+        acme_args="$acme_args --webroot $webroot"
+    fi
+
     if ! $ACME --home "$STATE_DIR" --issue $acme_args; then
         failed_dir="$STATE_DIR/${main_domain}.failed-$(date +%s)"
-        echo "Issuing cert for $main_domain failed. Moving state to $failed_dir" >&2
+        err "Issuing cert for $main_domain failed. Moving state to $failed_dir"
         [ -d "$STATE_DIR/$main_domain" ] && mv "$STATE_DIR/$main_domain" "$failed_dir"
         if [ "$moved_staging" -eq "1" ]; then
-            echo "Restoring staging certificate" >&2
+            err "Restoring staging certificate"
             mv "$STATE_DIR/${main_domain}.staging" "$STATE_DIR/${main_domain}"
         fi
         return 1
@@ -152,6 +209,7 @@ issue_cert()
         # commit and reload is in post_checks
     fi
 
+    post_checks
 }
 
 load_vars()
@@ -163,19 +221,22 @@ load_vars()
     DEBUG=$(config_get "$section" debug)
 }
 
-if [ -n "$CHECK_CRON" ]; then
-    check_cron
-    exit 0
-fi
+check_cron
+[ -n "$CHECK_CRON" ] && exit 0
 
 config_load acme
 config_foreach load_vars acme
 
-pre_checks || exit 1
+if [ -z "$STATE_DIR" ] || [ -z "$ACCOUNT_EMAIL" ]; then
+    err "state_dir and account_email must be set"
+    exit 1
+fi
+
+[ -d "$STATE_DIR" ] || mkdir -p "$STATE_DIR"
+
 trap err_out HUP TERM
 trap int_out INT
 
 config_foreach issue_cert cert
-post_checks
 
 exit 0
index 15117902e94944258feb999e3fddf89d4f8aceb2..677f7fd231d32d77a44c22c93e5515f971c5a525 100644 (file)
@@ -1,12 +1,12 @@
 #
-# Copyright (c) 2015-2017 Dirk Brenken (dev@brenken.org)
+# Copyright (c) 2015-2018 Dirk Brenken (dev@brenken.org)
 # This is free software, licensed under the GNU General Public License v3.
 #
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=adblock
-PKG_VERSION:=2.6.2
+PKG_VERSION:=3.5.1
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0+
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
@@ -16,12 +16,13 @@ include $(INCLUDE_DIR)/package.mk
 define Package/adblock
        SECTION:=net
        CATEGORY:=Network
-       TITLE:=Powerful adblock script to block ad/abuse domains
+       TITLE:=Powerful adblock script to block ad/abuse domains by using DNS
+       DEPENDS:=+jshn +jsonfilter
        PKGARCH:=all
 endef
 
 define Package/adblock/description
-Powerful adblock script to block ad/abuse domains via dnsmasq or unbound dns backend.
+Powerful adblock script to block ad/abuse domains via dnsmasq, unbound, named, kresd or dnscrypt-proxy.
 The script supports many domain blacklist sites plus manual black- and whitelist overrides.
 Please see https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md for further information.
 
@@ -53,6 +54,7 @@ define Package/adblock/install
        $(INSTALL_CONF) ./files/adblock.conf $(1)/etc/config/adblock
 
        $(INSTALL_DIR) $(1)/etc/adblock
+       $(INSTALL_CONF) ./files/adblock.notify $(1)/etc/adblock/
        $(INSTALL_CONF) ./files/adblock.blacklist $(1)/etc/adblock/
        $(INSTALL_CONF) ./files/adblock.whitelist $(1)/etc/adblock/
 endef
index 6950ec792be239258fb0a2699c67897c0f30bc69..0b575e71e5c046ac7ea1506efa65c9e68cd41889 100644 (file)
@@ -4,11 +4,13 @@
 A lot of people already use adblocker plugins within their desktop browsers, but what if you are using your (smart) phone, tablet, watch or any other wlan gadget...getting rid of annoying ads, trackers and other abuse sites (like facebook ;-) is simple: block them with your router. When the dns server on your router receives dns requests, you will sort out queries that ask for the resource records of ad servers and return a simple 'NXDOMAIN'. This is nothing but **N**on-e**X**istent Internet or Intranet domain name, if domain name is unable to resolved using the dns server, a condition called the 'NXDOMAIN' occurred.  
 
 ## Main Features
-* support of the following domain block list sources (free for private usage, for commercial use please check their individual licenses):
+* support of the following domain blocklist sources (free for private usage, for commercial use please check their individual licenses):
     * [adaway](https://adaway.org)
     * => infrequent updates, approx. 400 entries (enabled by default)
     * [adguard](https://adguard.com)
     * => numerous updates on the same day, approx. 12.000 entries
+    * [bitcoin](https://github.com/hoshsadiq/adblock-nocoin-list)
+    * => infrequent updates, approx. 15 entries
     * [blacklist]()
     * => static local blacklist, located by default in '/etc/adblock/adblock.blacklist'
     * [disconnect](https://disconnect.me)
@@ -25,20 +27,24 @@ 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_cz](https://raw.githubusercontent.com/qxstyles/turris-hole-czech-block-list/master/turris-hole-czech-block-list)
+    * => regional blocklist for Czechia, maintained by Turris Omnia Users, infrequent updates, approx. 100 entries
+    * [reg_de](https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt)
+    * => regional blocklist for Germany, daily updates, approx. 9.200 entries
+    * [reg_id](https://easylist-downloads.adblockplus.org/abpindo+easylist.txt)
+    * => regional blocklist for Indonesia, daily updates, approx. 800 entries
+    * [reg_nl](https://easylist-downloads.adblockplus.org/easylistdutch+easylist.txt)
+    * => regional blocklist for the Netherlands, weekly updates, approx. 1300 entries
     * [reg_pl](http://adblocklist.org)
     * => regional blocklist for Poland, daily updates, approx. 50 entries
     * [reg_ro](https://easylist-downloads.adblockplus.org/rolist+easylist.txt)
     * => regional blocklist for Romania, weekly updates, approx. 600 entries
     * [reg_ru](https://code.google.com/p/ruadlist)
     * => regional blocklist for Russia, weekly updates, approx. 2.000 entries
-    * [securemecca](http://www.securemecca.com)
-    * => infrequent updates, approx. 25.000 entries
     * [shallalist](http://www.shallalist.de) (categories "adv" "costtraps" "spyware" "tracker" "warez" enabled by default)
     * => daily updates, approx. 32.000 entries (a short description of all shallalist categories can be found [online](http://www.shallalist.de/categories.html))
     * [spam404](http://www.spam404.com)
@@ -57,118 +63,171 @@ A lot of people already use adblocker plugins within their desktop browsers, but
     * => daily updates, approx. 440 entries
 * zero-conf like automatic installation & setup, usually no manual changes needed
 * simple but yet powerful adblock engine: adblock does not use error prone external iptables rulesets, http pixel server instances and things like that
-* automatically selects dnsmasq or unbound as dns backend
-* automatically selects uclient-fetch or wget as download utility (other tools like curl or aria2c are supported as well)
-* support http only mode (without installed ssl library) for all non-SSL blocklist sources
-* automatically supports a wide range of router modes, even AP modes are supported
+* supports five different dns backends / blocklist formats: dnsmasq, unbound, named (bind), kresd and dnscrypt-proxy
+* supports six different download utilities: uclient-fetch, wget, curl, aria2c, wget-nossl, busybox-wget
+* Really fast downloads & list processing as they are handled in parallel as background jobs in a configurable 'Download Queue'
+* provides 'http only' mode without installed ssl library for all non-SSL blocklist sources
+* supports a wide range of router modes, even AP modes are supported
 * full IPv4 and IPv6 support
-* supports tld compression (top level domain compression), this feature removes thousands of needless host entries from the block lists and lowers the memory footprint for the dns backends
-* each block list source will be updated and processed separately
-* block list source parsing by fast & flexible regex rulesets
-* overall duplicate removal in separate block lists
+* provides top level domain compression ('tld compression'), this feature removes thousands of needless host entries from the blocklist and lowers the memory footprint for the dns backend
+* blocklist source parsing by fast & flexible regex rulesets
+* overall duplicate removal in central blocklist 'adb_list.overall'
 * additional whitelist for manual overrides, located by default in /etc/adblock/adblock.whitelist
-* quality checks during block list update to ensure a reliable dns backend service
+* quality checks during blocklist update to ensure a reliable dns backend service
 * minimal status & error logging to syslog, enable debug logging to receive more output
 * procd based init system support (start/stop/restart/reload/suspend/resume/query/status)
-* procd based hotplug support, the adblock start will be solely triggered by network interface triggers
-* suspend & resume adblock actions temporarily without block list reloading
-* runtime information available via LuCI & via 'status' init command
+* procd network interface trigger support or classic time based startup
+* keep the dns cache intact after adblock processing (currently supported by unbound, named and kresd)
+* conditional dns backend restarts by old/new blocklist comparison with sha256sum (default) or md5sum
+* suspend & resume adblock actions temporarily without blocklist reloading
+* output comprehensive runtime information via LuCI or via 'status' init command
 * query function to quickly identify blocked (sub-)domains, e.g. for whitelisting
+* strong LuCI support
 * optional: force dns requests to local resolver
 * optional: force overall sort / duplicate removal for low memory devices (handle with care!)
-* optional: automatic block list backup & restore, backups will be (de-)compressed and restored on the fly in case of any runtime error
-* optional: add new adblock sources on your own via uci config
+* 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: 'Jail' blocklist generation which builds an additional list (/tmp/adb_list.jail) to block access to all domains except those listed in the whitelist file. You can use this restrictive blocklist manually e.g. for guest wifi or kidsafe configurations
+* optional: send notification emails in case of a processing error or if the overall domain count is &le; 0
+* optional: add new adblock sources on your own, see example below
 
 ## Prerequisites
-* [LEDE project](https://www.lede-project.org), tested with latest stable release (LEDE 17.01) and with current LEDE snapshot
+* [OpenWrt](https://openwrt.org), tested with the stable release series (17.01.x) and with the latest OpenWrt snapshot
 * a usual setup with an enabled dns backend at minimum - dump AP modes without a working dns backend are _not_ supported
 * a download utility:
     * to support all blocklist sources a full version (with ssl support) of 'wget', 'uclient-fetch' with one of the 'libustream-*' ssl libraries, 'aria2c' or 'curl' is required
-    * for limited devices with real memory constraints, adblock provides also a plain http option and supports wget-nossl and uclient-fetch (without libustream-ssl), too
+    * for limited devices with real memory constraints, adblock provides also a 'http only' option and supports wget-nossl and uclient-fetch (without libustream-ssl) as well
     * for more configuration options see examples below
 
-## LEDE trunk Installation & Usage
-* install 'adblock' (_opkg install adblock_) and that's it - the adblock start will be automatically triggered by procd interface trigger
+## Installation & Usage
+* install 'adblock' (_opkg install adblock_)
+* at minimum configure the appropriate dns backend ('dnsmasq' by default), the donwload utility and enable the adblock service in _/etc/config/adblock_
 * control the adblock service manually with _/etc/init.d/adblock_ start/stop/restart/reload/suspend/resume/status or use the LuCI frontend
-* enable/disable your favored block list sources in _/etc/config/adblock_ - 'adaway', 'disconnect' and 'yoyo' are enabled by default
 
 ## LuCI adblock companion package
-* for easy management of the various block list sources and all other adblock options you can also use a nice & efficient LuCI frontend
+* for easy management of the various blocklist sources and all other adblock options you should use the provided LuCI frontend
 * install 'luci-app-adblock' (_opkg install luci-app-adblock_)
 * the application is located in LuCI under 'Services' menu
 
 ## Tweaks
 * **runtime information:** the adblock status is available via _/etc/init.d/adblock status_ (see example below)
 * **debug logging:** for script debugging please set the config option 'adb\_debug' to '1' and check the runtime output with _logread -e "adblock"_
-* **storage expansion:** to process and store all block list sources at once it might helpful to enlarge your temp directory with a swap partition => see [openwrt wiki](https://wiki.openwrt.org/doc/uci/fstab) for further details
+* **storage expansion:** to process and store all blocklist sources at once it might helpful to enlarge your temp directory with a swap partition => see [OpenWrt Wiki](https://wiki.openwrt.org/doc/uci/fstab) for further details
 * **add white- / blacklist entries:** add domain white- or blacklist entries to always-allow or -deny certain (sub) domains, by default both lists are empty and located in _/etc/adblock_. Please add one domain per line - ip addresses, wildcards & regex are _not_ allowed (see example below)
-* **backup & restore block lists:** enable this feature, to restore automatically the latest compressed backup of your block lists in case of any processing error (e.g. a single block list source is not available during update). Please use an (external) solid partition and _not_ your volatile router temp directory for this
+* **backup & restore blocklists:** enable this feature, to restore automatically the latest compressed backup of your blocklists in case of any processing error (e.g. a single blocklist source is not available during update). Please use an (external) solid partition and _not_ your volatile router temp directory for this
+* **download queue size:** for further download & list processing performance improvements you can raise the 'adb\_maxqueue' value, e.g. '8' or '16' should be safe
 * **scheduled list updates:** for a scheduled call of the adblock service add an appropriate crontab entry (see example below)
-* **restrict procd interface trigger:** restrict the procd interface trigger to a (list of) certain interface(s) (default: wan). To disable it at all, remove all entries
+* **change startup behaviour:** by default the startup will be triggered by the 'wan' procd interface trigger. Choose 'none' to disable automatic startups, 'timed' to use a classic timeout (default 30 sec.) or select another trigger interface
 * **suspend & resume adblocking:** to quickly switch the adblock service 'on' or 'off', simply use _/etc/init.d/adblock [suspend|resume]_
-* **domain query:** to query the active block lists for a specific domain, please run _/etc/init.d/adblock query `<DOMAIN>`_ (see example below)
-* **add new list sources:** you could add new block list sources on your own via uci config, all you need is a source url and an awk one-liner (see example below)
+* **domain query:** to query the active blocklist for a certain domain, please use the LuCI frontend or run _/etc/init.d/adblock query `<DOMAIN>`_ (see example below)
+* **add new list sources:** you could add new blocklist sources on your own via uci config, all you need is a source url and an awk one-liner (see example below)
 * **disable active dns probing in windows 10:** to prevent a yellow exclamation mark on your internet connection icon (which wrongly means connected, but no internet), please change the following registry key/value from "1" to "0" _HKLM\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet\EnableActiveProbing_
 
 ## Further adblock config options
-* usually the pre-configured adblock setup works quite well and no manual config overrides are needed, all listed options apply to the 'global' config section:
-    * adb\_enabled => main switch to enable/disable adblock service (default: '1', enabled)
+* usually the pre-configured adblock setup works quite well and no manual overrides are needed
+* the following options apply to the 'global' config section:
+    * adb\_enabled => main switch to enable/disable adblock service (default: '0', disabled)
     * adb\_debug => enable/disable adblock debug output (default: '0', disabled)
-    * adb\_iface => set the procd interface trigger to a (list of) lan / wan interface(s) (default: 'wan')
-    * adb\_fetch => full path to a different download utility, see example below (default: not set, use wget)
-    * adb\_fetchparm => options for the download utility, see example below (default: not set, use wget options)
-    * adb\_triggerdelay => additional trigger delay in seconds before adblock processing starts (default: '2')
-    * adb\_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\_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 (int/default: '2')
+    * adb\_forcedns => force dns requests to local resolver (bool/default: '0', disabled)
+    * adb\_forcesrt => force overall sort on low memory devices with less than 64 MB RAM (bool/default: '0', disabled)
+    * adb\_backup_mode => do not automatically update blocklists during startup, use backups instead (bool/default: '0', disabled)
+    * adb\maxqueue => size of the download queue to handle downloads & list processing in parallel (int/default: '4')
+    * adb\_jail => builds an additional 'Jail' list (/tmp/adb_list.jail) to block access to all domains except those listed in the whitelist file (bool/default: '0', disabled)
+    * adb\_dnsflush => flush DNS cache after adblock processing, i.e. enable the old restart behavior (bool/default: '0', disabled)
+    * adb\_notify => send notification emails in case of a processing error or if the overall domain count is &le; 0 (bool/default: '0', disabled)
+    * adb\_notifycnt => Raise minimum domain count email notification trigger (int/default: '0')
 
 ## Examples
 **change default dns backend to 'unbound':**
+
+Adblock deposits the final blocklist 'adb_list.overall' in '/var/lib/unbound' where unbound can find them in its jail.  
+To preserve the DNS cache after adblock processing you need to install 'unbound-control'.  
+  
+**change default dns backend to 'named' (bind):**
+
+Adblock deposits the final blocklist 'adb_list.overall' in '/var/lib/bind'.  
+To preserve the DNS cache after adblock processing you need to install & configure 'bind-rdnc'.  
+To use the blocklist please modify '/etc/bind/named.conf':
 <pre><code>
-Adblock detects the presence of an active unbound dns backend and the block lists will be automatically pulled in by unbound.
-The adblock script deposits the sorted and filtered block lists in '/var/lib/unbound' where unbound can find them in its jail.
-If you use manual configuration for unbound, then just include the following line in your 'server:' clause:
+in the 'options' namespace add:
+  response-policy { zone "rpz"; };
 
-  include: "/var/lib/unbound/adb_list.*"
+and at the end of the file add:
+  zone "rpz" {
+    type master;
+    file "/var/lib/bind/adb_list.overall";
+    allow-query { none; };
+    allow-transfer { none; };
+  };
 </code></pre>
   
-**configuration for different download utilities:**
-<pre><code>
-wget (default):
-  option adb_fetch="/usr/bin/wget"
-  option adb_fetchparm="--no-config --quiet --no-cache --no-cookies --max-redirect=0 --timeout=10 --no-check-certificate -O"
+**change default dns backend to 'kresd':**
 
-aria2c:
-  option adb_fetch '/usr/bin/aria2c'
-  option adb_fetchparm '-q --timeout=10 --allow-overwrite=true --auto-file-renaming=false --check-certificate=false -o'
+The knot-resolver (kresd) is only available on Turris Omnia devices.  
+Adblock deposits the final blocklist 'adb_list.overall' in '/etc/kresd', no further configuration needed.
+  
+**change default dns backend to 'dnscrypt-proxy':**
 
-uclient-fetch:
-  option adb_fetch '/bin/uclient-fetch'
-  option adb_fetchparm '-q --timeout=10 --no-check-certificate -O'
+The required 'blacklist' option of dnscrypt-proxy is not enabled by default, because the package will be compiled without plugins support.  
+Take a custom OpenWrt build with plugins support to use this feature. Adblock deposits the final blocklist 'adb_list.overall' in '/tmp'.  
+To use the blocklist please modify '/etc/config/dnscrypt-proxy' per instance:
+<pre><code>
+  list blacklist 'domains:/tmp/adb_list.overall'
+</code></pre>
+  
+**enable email notification via msmtp:**
 
-curl:
-  option adb_fetch '/usr/bin/curl'
-  option adb_fetchparm '-s --connect-timeout 10 --insecure -o'
+To use the email notification you have to install & configure the package 'msmtp'.  
+Modify the file '/etc/msmtprc':
+<pre><code>
+[...]
+defaults
+auth            on
+tls             on
+tls_certcheck   off
+timeout         5
+syslog          LOG_MAIL
+[...]
+account         adb_notify
+host            smtp.gmail.com
+port            587
+from            dev.adblock@gmail.com
+user            dev.adblock
+password        xxx
 </code></pre>
+Edit the file '/etc/adblock/adblock.notify' and change at least the 'mail_receiver'.  
+Finally make this file executable via 'chmod' and test it directly. If no more errors come up you can comment 'mail_debug', too.
   
 **receive adblock runtime information:**
+
 <pre><code>
-root@blackhole:~# /etc/init.d/adblock status
+/etc/init.d/adblock status
 ::: adblock runtime information
- status          : active
adblock_version : 2.6.0
- blocked_domains : 113711
fetch_info      : wget (built-in)
- dns_backend     : dnsmasq
- last_rundate    : 12.04.2017 13:08:26
- system          : LEDE Reboot SNAPSHOT r3900-399d5cf532
+  + adblock_status  : enabled
 + adblock_version : 3.5.0
+  + overall_domains : 102324 (normal mode)
 + fetch_utility   : /usr/bin/wget (built-in)
+  + dns_backend     : kresd (/etc/kresd)
+  + last_rundate    : 30.01.2018 21:24:11
+  + system_release  : Turris Omnia, OpenWrt omnia 15.05/3.9.4
 </code></pre>
   
 **cronjob for a regular block list update (/etc/crontabs/root):**
+
 <pre><code>
-0 06 * * *    /etc/init.d/adblock start
+0 06 * * *    /etc/init.d/adblock reload
 </code></pre>
   
 **blacklist entry (/etc/adblock/adblock.blacklist):**
+
 <pre><code>
 ads.example.com
 
@@ -183,10 +242,11 @@ This entry does not block:
 </code></pre>
   
 **whitelist entry (/etc/adblock/adblock.whitelist):**
+
 <pre><code>
 here.com
 
-This entry removes the following (sub)domains from the block lists:
+This entry removes the following (sub)domains from the blocklist:
   maps.here.com
   here.com
 
@@ -195,53 +255,46 @@ This entry does not remove:
   www.adwhere.com
 </code></pre>
   
-**query active block lists for a certain (sub-)domain, e.g. for whitelisting:**
+**query the active blocklist for a certain (sub-)domain, e.g. for whitelisting:**
+
+The query function checks against the submitted (sub-)domain and recurses automatically to the upper top level domain. For every (sub-)domain it returns the first ten relevant results.
 <pre><code>
-/etc/init.d/adblock query example.www.doubleclick.net
-::: distinct results for domain 'example.www.doubleclick.net'
- no match
-::: distinct results for domain 'www.doubleclick.net'
- adb_list.sysctl      : www.doubleclick.net
-::: distinct results for domain 'doubleclick.net'
- adb_list.adaway      : ad-g.doubleclick.net
- adb_list.securemecca : 1168945.fls.doubleclick.net
- adb_list.sysctl      : 1435575.fls.doubleclick.net
- adb_list.whocares    : 3ad.doubleclick.net
-
-The query function checks against the submitted (sub-)domain and recurses automatically to the upper top level domain(s).
-For every domain it returns the overall count plus a distinct list of active block lists with the first relevant result.
-In the example above whitelist "www.doubleclick.net" to free the submitted domain.
+/etc/init.d/adblock query www.example.google.com
+::: results for domain 'www.example.google.com'
+  - no match
+::: results for domain 'example.google.com'
+  - no match
+::: results for domain 'google.com'
+  + ads.google.com
+  + adservices.google.com
+  + adwords.google.com
+  + ampcid.google.com
+  + analytics.google.com
+  + gg.google.com
+  + google.com.analytics.kdgsrltkcun.com
+  + googleadapis.l.google.com
+  + id.google.com
+  + pagead-googlehosted.l.google.com
+  + [...]
 </code></pre>
   
-**add a new block list source:**
-<pre><code>
-1. the easy way ...
-example: https://easylist-downloads.adblockplus.org/rolist+easylist.txt
-adblock already supports an easylist source, called 'ruadlist'. To add the additional local easylist
-as a new source, copy the existing config source 'ruadlist' section and change only
-the source name, the url and the description - that's all!
+**add a new blocklist source:**
 
-config source 'rolist'
+1. the easy way ...  
+example: https://easylist-downloads.adblockplus.org/rolist+easylist.txt  
+Adblock already supports an easylist source, called 'reg_ru'. To add the additional local easylist as a new source, copy the existing config source section and change only
+the source name, the url and the description - that's all!
+<pre><code>
+config source 'reg_ro'
   option enabled '0'
   option adb_src 'https://easylist-downloads.adblockplus.org/rolist+easylist.txt'
-  option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
-  option adb_src_desc 'focus on romanian ad related domains plus generic easylist additions, weekly updates, approx. 600 entries'
-
-2. a bit harder ...
-to add a really new source with different domain/host format you have to write a suitable
-awk one-liner on your own, so basic awk skills are needed. As a starting point check the already
-existing awk strings (adb_src_rset) in adblock config, maybe you need only small changes for your individual list.
-Download the desired list and test your new awk string locally with:
-  cat new.list | awk 'fs__individual search__search core__result'
-  'fs' => field separator (optional)
-  'individual search' => individual search part to filter out needless list information
-  'search core' => always '([A-Za-z0-9_-]+\.){1,}[A-Za-z]+', this is part of all list sources and should be unchanged
-  'result' => always '{print tolower(\$n)}', only the output column 'n' may vary
-the output result should be a sequential list with one domain/host per line - nothing more.
-
-If your awk one-liner works quite well, add a new source section in adblock config and test your new source
+  option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+  option adb_src_desc 'focus on romanian ads plus generic easylist additions, weekly updates, approx. 9.400 entries'
 </code></pre>
-  
+
+2. a bit harder ...  
+To add a really new source with different domain/host format you have to write a suitable awk one-liner on your own, so basic awk skills are needed. As a starting point check the already existing awk rulesets 'adb_src_rset' in the config file, probably you need only small changes for your individual list. Download the desired list and test your new awk string locally. The output result should be a sequential list with one domain/host per line - nothing more. If your awk one-liner works quite well, add a new source section to the adblock config file and test the new source.  
+
 ## Support
 Please join the adblock discussion in this [forum thread](https://forum.lede-project.org/t/adblock-2-x-support-thread/507) or contact me by mail <dev@brenken.org>  
 
index 0e4fd0257774c0add0370cb91c93cdb36a849eab..2feae31ff12504ed91b96e2ca2494ef0f7288039 100644 (file)
 # see 'https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md'
 
 config adblock 'global'
-       option adb_enabled '1'
+       option adb_enabled '0'
+       option adb_dns 'dnsmasq'
+       option adb_fetchutil 'uclient-fetch'
+       option adb_trigger 'wan'
+
+config adblock 'extra'
        option adb_debug '0'
        option adb_forcesrt '0'
        option adb_forcedns '0'
-       option adb_iface 'wan'
-       option adb_triggerdelay '2'
-       option adb_whitelist '/etc/adblock/adblock.whitelist'
-       option adb_whitelist_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\"^\"\$1\"\\\|[.]\"\$1)}'
        option adb_backup '0'
-       option adb_backupdir '/mnt'
-       option adb_rtfile '/tmp/adb_runtime.json'
+       option adb_maxqueue '4'
 
 config source 'adaway'
-       option enabled '1'
        option adb_src 'https://adaway.org/hosts.txt'
-       option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
+       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
        option adb_src_desc 'focus on mobile ads, infrequent updates, approx. 400 entries'
+       option enabled '1'
 
 config source 'adguard'
+       option adb_src 'https://filters.adtidy.org/windows/filters/15.txt'
+       option adb_src_rset 'BEGIN{FS=\"[/|^|\r]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([\/\^\r]|$)/{print tolower(\$3)}'
+       option adb_src_desc 'combined adguard dns filter list, frequent updates, approx. 17.000 entries'
        option enabled '0'
-       option adb_src 'https://raw.githubusercontent.com/AdguardTeam/AdguardDNS/master/Filters/filter.txt'
-       option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
-       option adb_src_desc 'combined adguard dns filter list, approx. 12.000 entries'
 
-config source 'blacklist'
+config source 'bitcoin'
+       option adb_src 'https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt'
+       option adb_src_rset '/^0\.0\.0\.0[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+       option adb_src_desc 'focus on malicious bitcoin mining sites, infrequent updates, approx. 80 entries'
        option enabled '0'
+
+config source 'blacklist'
        option adb_src '/etc/adblock/adblock.blacklist'
-       option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-       option adb_src_desc 'static local domain blacklist (always deny these domains)'
+       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_desc 'static local domain blacklist, always deny these domains'
+       option enabled '1'
 
 config source 'disconnect'
-       option enabled '1'
        option adb_src 'https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt'
-       option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-       option adb_src_desc 'mozilla driven blocklist, numerous updates on the same day, approx. 6.500 entries'
+       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_desc 'mozilla driven blocklist, numerous updates on the same day, approx. 4.700 entries'
+       option enabled '1'
 
 config source 'dshield'
-       option enabled '0'
        option adb_src 'https://www.dshield.org/feeds/suspiciousdomains_Low.txt'
-       option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-       option adb_src_desc 'generic blocklist, daily updates, approx. 4.500 entries'
+       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_desc 'generic blocklist, daily updates, approx. 3.500 entries'
+       option enabled '0'
 
 config source 'feodo'
-       option enabled '0'
        option adb_src 'https://feodotracker.abuse.ch/blocklist/?download=domainblocklist'
-       option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
+       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
        option adb_src_desc 'focus on feodo botnet, daily updates, approx. 0-10 entries'
+       option enabled '0'
 
 config source 'hphosts'
-       option enabled '0'
        option adb_src 'https://hosts-file.net/ad_servers.txt'
-       option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-       option adb_src_desc 'broad blocklist, monthly updates, approx. 50.000 entries'
+       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|\$)+/{print tolower(\$2)}'
+       option adb_src_desc 'broad blocklist, monthly updates, approx. 19.200 entries'
+       option enabled '0'
 
 config source 'malware'
+       option adb_src 'https://mirror.espoch.edu.ec/malwaredomains/justdomains'
+       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_desc 'broad blocklist, daily updates, approx. 18.300 entries'
        option enabled '0'
-       option adb_src 'https://mirror.cedia.org.ec/malwaredomains/justdomains'
-       option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-       option adb_src_desc 'broad blocklist, daily updates, approx. 16.000 entries'
 
 config source 'malwarelist'
-       option enabled '0'
        option adb_src 'http://www.malwaredomainlist.com/hostslist/hosts.txt'
-       option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-       option adb_src_desc 'focus on malware, daily updates, approx. 1.500 entries'
+       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+       option adb_src_desc 'focus on malware, daily updates, approx. 1.200 entries'
+       option enabled '0'
 
 config source 'openphish'
-       option enabled '0'
        option adb_src 'https://openphish.com/feed.txt'
-       option adb_src_rset '{FS=\"/\"} \$3 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$3)}'
-       option adb_src_desc 'focus on phishing, numerous updates on the same day, approx. 1.800 entries'
-
-config source 'palevo'
+       option adb_src_rset 'BEGIN{FS=\"/\"}/^http[s]?:\/\/([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+(\/|$)/{print tolower(\$3)}'
+       option adb_src_desc 'focus on phishing, numerous updates on the same day, approx. 2.400 entries'
        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 '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-       option adb_src_desc 'focus on ransomware, numerous updates on the same day, approx. 130 entries'
+       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_desc 'focus on ransomware, numerous updates on the same day, approx. 1900 entries'
+       option enabled '0'
 
 config source 'reg_cn'
-       option enabled '0'
        option adb_src 'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt'
-       option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
-       option adb_src_desc 'focus on chinese ads, daily updates, approx. 1.600 entries'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+       option adb_src_desc 'focus on chinese ads plus generic easylist additions, daily updates, approx. 11.700 entries'
+       option enabled '0'
 
-config source 'reg_pl'
+config source 'reg_cz'
+       option adb_src 'https://raw.githubusercontent.com/qxstyles/turris-hole-czech-block-list/master/turris-hole-czech-block-list'
+       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_desc 'focus on czech ads maintained by Turris Omnia Users, infrequent updates, approx. 100 entries'
        option enabled '0'
+
+config source 'reg_de'
+       option adb_src 'https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+       option adb_src_desc 'focus on german ads plus generic easylist additions, daily updates, approx. 9.200 entries'
+       option enabled '0'
+
+config source 'reg_id'
+       option adb_src 'https://easylist-downloads.adblockplus.org/abpindo+easylist.txt'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+       option adb_src_desc 'focus on indonesian ads plus generic easylist additions, weekly updates, approx. 9.600 entries'
+       option enabled '0'
+
+config source 'reg_nl'
+       option adb_src 'https://easylist-downloads.adblockplus.org/easylistdutch+easylist.txt'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[: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 enabled '0'
+
+config source 'reg_pl'
        option adb_src 'http://adblocklist.org/adblock-pxf-polish.txt'
-       option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
-       option adb_src_desc 'focus on polish ads, daily updates, approx. 50 entries'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+       option adb_src_desc 'focus on polish ads, daily updates, approx. 90 entries'
+       option enabled '0'
 
 config source 'reg_ro'
-       option enabled '0'
        option adb_src 'https://easylist-downloads.adblockplus.org/rolist+easylist.txt'
-       option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
-       option adb_src_desc 'focus on romanian ads plus generic easylist additions, weekly updates, approx. 600 entries'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[: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 enabled '0'
 
 config source 'reg_ru'
-       option enabled '0'
        option adb_src 'https://easylist-downloads.adblockplus.org/ruadlist+easylist.txt'
-       option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
-       option adb_src_desc 'focus on russian ads plus generic easylist additions, weekly updates, approx. 2.000 entries'
-
-config source 'securemecca'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[: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 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 '{FS=\"/\"} \$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-       option adb_src_desc 'broad blocklist subdivided in different categories, daily updates, approx. 32.000 entries'
+       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_desc 'broad blocklist subdivided in different categories, daily updates, approx. 31.700 entries'
        list adb_src_cat 'adv'
        list adb_src_cat 'costtraps'
        list adb_src_cat 'spyware'
        list adb_src_cat 'tracker'
        list adb_src_cat 'warez'
+       option enabled '0'
 
 config source 'spam404'
-       option enabled '0'
        option adb_src 'https://raw.githubusercontent.com/Dawsey21/Lists/master/main-blacklist.txt'
-       option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-       option adb_src_desc 'generic blocklist, infrequent updates, approx. 5.000 entries'
+       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)+/{print tolower(\$1)}'
+       option adb_src_desc 'generic blocklist, infrequent updates, approx. 6.000 entries'
+       option enabled '0'
 
 config source 'sysctl' 
-       option enabled '0'
        option adb_src 'http://sysctl.org/cameleon/hosts'
-       option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-       option adb_src_desc 'broad blocklist, weekly updates, approx. 21.000 entries'
+       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+       option adb_src_desc 'broad blocklist, weekly updates, approx. 16.500 entries'
+       option enabled '0'
 
 config source 'whocares'
-       option enabled '0'
        option adb_src 'http://someonewhocares.org/hosts/hosts'
-       option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-       option adb_src_desc 'broad blocklist, weekly updates, approx. 12.000 entries'
+       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+       option adb_src_desc 'broad blocklist, weekly updates, approx. 10.000 entries'
+       option enabled '0'
 
 config source 'winspy'
-       option enabled '0'
        option adb_src 'https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/win10/spy.txt'
-       option adb_src_rset '\$0 ~/^0\.0\.0\.0[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-       option adb_src_desc 'focus on windows spy & telemetry, infrequent updates, approx. 140 entries'
+       option adb_src_rset '/^0\.0\.0\.0[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+       option adb_src_desc 'focus on windows spy & telemetry domains, infrequent updates, approx. 300 entries'
+       option enabled '0'
 
 config source 'winhelp'
-       option enabled '0'
        option adb_src 'http://winhelp2002.mvps.org/hosts.txt'
-       option adb_src_rset '\$0 ~/^0\.0\.0\.0[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
-       option adb_src_desc 'broad blocklist, infrequent updates, approx. 15.000 entries'
+       option adb_src_rset '/^0\.0\.0\.0[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+       option adb_src_desc 'broad blocklist, infrequent updates, approx. 13.000 entries'
+       option enabled '0'
 
 config source 'yoyo'
-       option enabled '1'
        option adb_src 'https://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml&showintro=0&mimetype=plaintext'
-       option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-       option adb_src_desc 'focus on ad related domains, weekly updates, approx. 2.500 entries'
+       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_desc 'focus on ad related domains, weekly updates, approx. 2.400 entries'
+       option enabled '1'
 
 config source 'zeus'
-       option enabled '0'
        option adb_src 'https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist'
-       option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
-       option adb_src_desc 'focus on zeus botnet, daily updates, approx. 440 entries'
+       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_desc 'focus on zeus botnet, daily updates, approx. 400 entries'
+       option enabled '0'
index ee94aa8228dabe6574a029c83bee18650cf6c3ab..33aebbfee3570704662e9d54955c177e1a7eddfe 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh /etc/rc.common
 #
 
-START=50
+START=30
 USE_PROCD=1
 
 EXTRA_COMMANDS="suspend resume query status"
@@ -12,30 +12,40 @@ EXTRA_HELP="        suspend Suspend adblock processing
 
 adb_init="/etc/init.d/adblock"
 adb_script="/usr/bin/adblock.sh"
+adb_pidfile="/var/run/adblock.pid"
 
 boot()
 {
     adb_boot=1
-    ubus -t 30 wait_for network.interface 2>/dev/null
     rc_procd start_service
 }
 
 start_service()
 {
-    if [ $("${adb_init}" enabled; printf ${?}) -eq 0 ]
+    if [ $("${adb_init}" enabled; printf "%u" ${?}) -eq 0 ]
     then
         if [ -n "${adb_boot}" ]
         then
-            return 0
+            local trigger="$(uci_get adblock global adb_trigger)"
+            if [ "${trigger}" != "timed" ]
+            then
+                return 0
+            fi
         fi
         procd_open_instance "adblock"
         procd_set_param command "${adb_script}" "${@}"
+        procd_set_param pidfile "${adb_pidfile}"
         procd_set_param stdout 1
         procd_set_param stderr 1
         procd_close_instance
     fi
 }
 
+reload_service()
+{
+    rc_procd start_service reload
+}
+
 stop_service()
 {
     rc_procd "${adb_script}" stop
@@ -49,34 +59,52 @@ restart()
 
 suspend()
 {
+    [ -s "${adb_pidfile}" ] && return 1
     rc_procd "${adb_script}" suspend
 }
 
 resume()
 {
+    [ -s "${adb_pidfile}" ] && return 1
     rc_procd "${adb_script}" resume
 }
 
 query()
 {
+    [ -s "${adb_pidfile}" ] && return 1
     rc_procd "${adb_script}" query "${1}"
 }
 
 status()
 {
-    rc_procd "${adb_script}" status
+    local key keylist value rtfile="$(uci_get adblock extra adb_rtfile)"
+
+    rtfile="${rtfile:-"/tmp/adb_runtime.json"}"
+    if [ -s "${rtfile}" ]
+    then
+        printf "%s\n" "::: adblock runtime information"
+        json_load "$(cat "${rtfile}" 2>/dev/null)"
+        json_select data
+        json_get_keys keylist
+        for key in ${keylist}
+        do
+            json_get_var value "${key}"
+            printf "  + %-15s : %s\n" "${key}" "${value}"
+        done
+    else
+        printf "%s\n" "::: no adblock runtime information available"
+    fi
 }
 
 service_triggers()
 {
-    local iface="$(uci -q get adblock.global.adb_iface)"
-    local delay="$(uci -q get adblock.global.adb_triggerdelay)"
+    local trigger="$(uci_get adblock global adb_trigger)"
+    local delay="$(uci_get adblock extra adb_triggerdelay)"
 
-    PROCD_RELOAD_DELAY=$((${delay:=2} * 1000))
-    for name in ${iface}
-    do
-        procd_add_interface_trigger "interface.*.up" "${name}" "${adb_init}" start
-    done
-    PROCD_RELOAD_DELAY=1000
-    procd_add_config_trigger "config.change" "adblock" "${adb_init}" start
+    if [ "${trigger}" != "none" ] && [ "${trigger}" != "timed" ]
+    then
+        PROCD_RELOAD_DELAY=$((${delay:-2} * 1000))
+        procd_add_interface_trigger "interface.*.up" "${trigger}" "${adb_init}" start
+    fi
+    procd_add_reload_trigger "adblock"
 }
diff --git a/net/adblock/files/adblock.notify b/net/adblock/files/adblock.notify
new file mode 100644 (file)
index 0000000..10dc4d1
--- /dev/null
@@ -0,0 +1,63 @@
+#!/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.2"
+mail_daemon="$(command -v msmtp)"
+mail_profile="adb_notify"
+#mail_debug="--debug"
+mail_rc=1
+
+# mail daemon check
+#
+if [ ! -x "${mail_daemon}" ]
+then
+    mail_daemon="$(command -v sendmail)"
+fi
+
+# info preparation
+#
+sys_info="$(strings /etc/banner 2>/dev/null; ubus call system board | sed -e 's/\"release\": {//' | sed -e 's/^[ \t]*//' | sed -e 's/[{}\",]//g' | sed -e 's/[ ]/  \t/' | sed '/^$/d' 2>/dev/null)"
+adb_info="$(/etc/init.d/adblock status 2>/dev/null)"
+if [ -f "/var/log/messages" ]
+then
+    log_info="$(awk '/adblock-/{NR=1;max=79;if(length($0)>max+1)while($0){if(NR==1){print substr($0,1,max),"&#8629;"} else {print " ",substr($0,1,max)}{$0=substr($0,max+1);NR=NR+1}}else print}' /var/log/messages)"
+else
+    log_info="$(logread -e "adblock-" | awk '{NR=1;max=79;if(length($0)>max+1)while($0){if(NR==1){print substr($0,1,max),"&#8629;"} else {print " ",substr($0,1,max)}{$0=substr($0,max+1);NR=NR+1}}else print}')"
+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}\nMime-Version: 1.0\nContent-Type: text/html\nContent-Disposition: inline\n\n"
+
+# mail body
+#
+mail_text="<html><body><pre style='display:block;font-family:monospace;font-size:1rem;padding:20;background-color:#f3eee5;white-space:pre'>"
+mail_text="${mail_text}\n<strong>++\n++ System Information ++\n++</strong>\n${sys_info}"
+mail_text="${mail_text}\n\n<strong>++\n++ Adblock Information ++\n++</strong>\n${adb_info}"
+mail_text="${mail_text}\n\n<strong>++\n++ Logfile Information ++\n++</strong>\n${log_info}"
+mail_text="${mail_text}</pre></body></html>"
+
+# 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}
index 03f86b03e4fdc1257f36fbc31394730d394bf810..96b2c3814bd72cd12645ac2d901611bb51618fc4 100755 (executable)
 #
 LC_ALL=C
 PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-adb_ver="2.6.2"
-adb_sysver="$(ubus -S call system board | jsonfilter -e '@.release.description')"
-adb_enabled=1
+adb_ver="3.5.1"
+adb_sysver="unknown"
+adb_enabled=0
 adb_debug=0
+adb_backup_mode=0
 adb_forcesrt=0
 adb_forcedns=0
+adb_jail=0
+adb_maxqueue=4
+adb_notify=0
+adb_notifycnt=0
+adb_triggerdelay=0
 adb_backup=0
 adb_backupdir="/mnt"
-adb_whitelist="/etc/adblock/adblock.whitelist"
-adb_whitelist_rset="\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\"^\"\$1\"\\\|[.]\"\$1)}"
-adb_fetch="/usr/bin/wget"
-adb_fetchparm="--no-config --quiet --no-cache --no-cookies --max-redirect=0 --timeout=10 --no-check-certificate -O"
-adb_dnslist="dnsmasq unbound"
+adb_fetchutil="uclient-fetch"
+adb_dns="dnsmasq"
 adb_dnsprefix="adb_list"
+adb_dnsfile="${adb_dnsprefix}.overall"
+adb_dnsjail="${adb_dnsprefix}.jail"
+adb_dnsflush=0
+adb_whitelist="/etc/adblock/adblock.whitelist"
 adb_rtfile="/tmp/adb_runtime.json"
+adb_hashutil="$(command -v sha256sum)"
+adb_hashold=""
+adb_hashnew=""
+adb_cnt=0
+adb_rc=0
+adb_action="${1:-"start"}"
+adb_pidfile="/var/run/adblock.pid"
 
-# f_envload: load adblock environment
+# load adblock environment
 #
 f_envload()
 {
-    local dns_up cnt=0
+    local dns_up sys_call sys_desc sys_model sys_ver cnt=0
 
-    # source in system library
+    # get system information
     #
-    if [ -r "/lib/functions.sh" ] && [ -r "/usr/share/libubox/jshn.sh" ]
+    sys_call="$(ubus -S call system board 2>/dev/null)"
+    if [ -n "${sys_call}" ]
     then
-        . "/lib/functions.sh"
-        . "/usr/share/libubox/jshn.sh"
-    else
-        f_log "error" "system libraries not found"
+        sys_desc="$(printf '%s' "${sys_call}" | jsonfilter -e '@.release.description')"
+        sys_model="$(printf '%s' "${sys_call}" | jsonfilter -e '@.model')"
+        sys_ver="$(cat /etc/turris-version 2>/dev/null)"
+        if [ -n "${sys_ver}" ]
+        then
+            sys_desc="${sys_desc}/${sys_ver}"
+        fi
+        adb_sysver="${sys_model}, ${sys_desc}"
     fi
 
-    # set dns backend environment
+    # check hash utility
     #
-    while [ ${cnt} -le 20 ]
-    do
-        for dns in ${adb_dnslist}
-        do
-            dns_up="$(ubus -S call service list "{\"name\":\"${dns}\"}" | jsonfilter -l1 -e "@.${dns}.instances.*.running")"
-            if [ "${dns_up}" = "true" ]
-            then
-                case "${dns}" in
-                    dnsmasq)
-                        adb_dns="dnsmasq"
-                        adb_dnsdir="/tmp/dnsmasq.d"
-                        adb_dnshidedir="${adb_dnsdir}/.adb_hidden"
-                        adb_dnsformat="awk '{print \"local=/\"\$0\"/\"}'"
-                        break 2
-                        ;;
-                    unbound)
-                        adb_dns="unbound"
-                        adb_dnsdir="/var/lib/unbound"
-                        adb_dnshidedir="${adb_dnsdir}/.adb_hidden"
-                        adb_dnsformat="awk '{print \"local-zone: \042\"\$0\"\042 static\"}'"
-                        break 2
-                        ;;
-                esac
-            fi
-        done
-        sleep 1
-        cnt=$((cnt+1))
-    done
-    if [ -z "${adb_dns}" ]
+    if [ ! -x "${adb_hashutil}" ]
     then
-        f_log "error" "no active/supported DNS backend found"
+        adb_hashutil="$(command -v md5sum)"
     fi
 
-    # parse global section by callback
+    # source in system libraries
+    #
+    if [ -r "/lib/functions.sh" ] && [ -r "/usr/share/libubox/jshn.sh" ]
+    then
+        . "/lib/functions.sh"
+        . "/usr/share/libubox/jshn.sh"
+    else
+        f_log "err" "system libraries not found"
+    fi
+
+    # parse 'global' and 'extra' section by callback
     #
     config_cb()
     {
@@ -95,7 +96,7 @@ f_envload()
         fi
     }
 
-    # parse 'source' section
+    # parse 'source' typed sections
     #
     parse_config()
     {
@@ -116,280 +117,645 @@ f_envload()
     config_load adblock
     config_foreach parse_config source
 
-    # force dns to local resolver
+    # check dns backend
+    #
+    case "${adb_dns}" in
+        dnsmasq)
+            adb_dnsinstance="${adb_dnsinstance:-"0"}"
+            adb_dnsuser="${adb_dnsuser:-"dnsmasq"}"
+            adb_dnsdir="${adb_dnsdir:-"/tmp"}"
+            adb_dnsheader=""
+            adb_dnsdeny="awk '{print \"server=/\"\$0\"/\"}'"
+            if [ ${adb_jail} -eq 1 ]
+            then
+                adb_dnsallow="awk '{print \"server=/\"\$0\"/#\"}'"
+                adb_dnshalt="server=/#/"
+            fi
+        ;;
+        unbound)
+            adb_dnsinstance="${adb_dnsinstance:-"0"}"
+            adb_dnsuser="${adb_dnsuser:-"unbound"}"
+            adb_dnsdir="${adb_dnsdir:-"/var/lib/unbound"}"
+            adb_dnsheader=""
+            adb_dnsdeny="awk '{print \"local-zone: \042\"\$0\"\042 static\"}'"
+            if [ ${adb_jail} -eq 1 ]
+            then
+                adb_dnsallow="awk '{print \"local-zone: \042\"\$0\"\042 transparent\"}'"
+                adb_dnshalt="local-zone: \".\" static"
+            fi
+        ;;
+        named)
+            adb_dnsinstance="${adb_dnsinstance:-"0"}"
+            adb_dnsuser="${adb_dnsuser:-"bind"}"
+            adb_dnsdir="${adb_dnsdir:-"/var/lib/bind"}"
+            adb_dnsheader="\$TTL 2h"$'\n'"@ IN SOA localhost. root.localhost. (1 6h 1h 1w 2h)"$'\n'"  IN NS localhost."
+            adb_dnsdeny="awk '{print \"\"\$0\" CNAME .\n*.\"\$0\" CNAME .\"}'"
+            if [ ${adb_jail} -eq 1 ]
+            then
+                adb_dnsallow="awk '{print \"\"\$0\" CNAME rpz-passthru.\n*.\"\$0\" CNAME rpz-passthru.\"}'"
+                adb_dnshalt="* CNAME ."
+            fi
+        ;;
+        kresd)
+            adb_dnsinstance="${adb_dnsinstance:-"0"}"
+            adb_dnsuser="${adb_dnsuser:-"root"}"
+            adb_dnsdir="${adb_dnsdir:-"/etc/kresd"}"
+            adb_dnsheader="\$TTL 2h"$'\n'"@ IN SOA localhost. root.localhost. (1 6h 1h 1w 2h)"$'\n'"  IN NS  localhost."
+            adb_dnsdeny="awk '{print \"\"\$0\" CNAME .\n*.\"\$0\" CNAME .\"}'"
+            if [ ${adb_jail} -eq 1 ]
+            then
+                adb_dnsallow="awk '{print \"\"\$0\" CNAME rpz-passthru.\n*.\"\$0\" CNAME rpz-passthru.\"}'"
+                adb_dnshalt="* CNAME ."
+            fi
+        ;;
+        dnscrypt-proxy)
+            adb_dnsinstance="${adb_dnsinstance:-"0"}"
+            adb_dnsuser="${adb_dnsuser:-"nobody"}"
+            adb_dnsdir="${adb_dnsdir:-"/tmp"}"
+            adb_dnsheader=""
+            adb_dnsdeny="awk '{print \$0}'"
+        ;;
+    esac
+
+    # check adblock status
     #
-    if [ ${adb_forcedns} -eq 1 ] && [ -z "$(uci -q get firewall.adblock_dns)" ]
+    if [ ${adb_enabled} -eq 0 ]
     then
-        uci -q set firewall.adblock_dns="redirect"
-        uci -q set firewall.adblock_dns.name="Adblock DNS"
-        uci -q set firewall.adblock_dns.src="lan"
-        uci -q set firewall.adblock_dns.proto="tcp udp"
-        uci -q set firewall.adblock_dns.src_dport="53"
-        uci -q set firewall.adblock_dns.dest_port="53"
-        uci -q set firewall.adblock_dns.target="DNAT"
-    elif [ ${adb_forcedns} -eq 0 ] && [ -n "$(uci -q get firewall.adblock_dns)" ]
+        f_extconf
+        f_temp
+        f_rmdns
+        f_jsnup
+        f_log "info" "adblock is currently disabled, please set adb_enabled to '1' to use this service"
+        exit 0
+    fi
+
+    if [ -d "${adb_dnsdir}" ] && [ ! -f "${adb_dnsdir}/${adb_dnsfile}" ]
     then
-        uci -q delete firewall.adblock_dns
+        printf '%s\n' "${adb_dnsheader}" > "${adb_dnsdir}/${adb_dnsfile}"
     fi
-    if [ -n "$(uci -q changes firewall)" ]
+
+    if [ "${adb_action}" = "start" ] && [ "${adb_trigger}" = "timed" ]
     then
-        uci -q commit firewall
-        if [ $(/etc/init.d/firewall enabled; printf ${?}) -eq 0 ]
+        sleep ${adb_triggerdelay}
+    fi
+
+    while [ ${cnt} -le 30 ]
+    do
+        dns_up="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}" 2>/dev/null | jsonfilter -l1 -e "@[\"${adb_dns}\"].instances.*.running" 2>/dev/null)"
+        if [ "${dns_up}" = "true" ]
         then
-            /etc/init.d/firewall reload >/dev/null 2>&1
+            break
         fi
+        sleep 1
+        cnt=$((cnt+1))
+    done
+
+    if [ -z "${adb_dns}" ] || [ -z "${adb_dnsdeny}" ] || [ ! -x "$(command -v ${adb_dns})" ] || [ ! -d "${adb_dnsdir}" ]
+    then
+        f_log "err" "'${adb_dns}' not running, DNS backend not found"
     fi
 }
 
-# f_envcheck: check/set environment prerequisites
+# check environment
 #
 f_envcheck()
 {
     local ssl_lib
 
-    # check 'enabled' option
+    # check external uci config files
     #
-    if [ ${adb_enabled} -ne 1 ]
-    then
-        if [ -n "$(ls -dA "${adb_dnsdir}/${adb_dnsprefix}"* 2>/dev/null)" ]
-        then
-            f_rmdns
-            f_dnsrestart
-        fi
-        f_log "info " "adblock is currently disabled, please set adb_enabled to '1' to use this service"
-        exit 0
-    fi
+    f_extconf
 
     # check fetch utility
     #
-    ssl_lib="-"
-    if [ -x "${adb_fetch}" ]
-    then
-        if [ "$(readlink -fn "${adb_fetch}")" = "/usr/bin/wget-nossl" ]
-        then
-            adb_fetchparm="--no-config --quiet --no-cache --no-cookies --max-redirect=0 --timeout=10 -O"
-        elif [ "$(readlink -fn "/bin/wget")" = "/bin/busybox" ] || [ "$(readlink -fn "${adb_fetch}")" = "/bin/busybox" ]
-        then
-            adb_fetch="/bin/busybox"
-            adb_fetchparm="-q -O"
-        else
+    case "${adb_fetchutil}" in
+        uclient-fetch)
+            if [ -f "/lib/libustream-ssl.so" ]
+            then
+                adb_fetchparm="${adb_fetchparm:-"--timeout=10 --no-check-certificate -O"}"
+                ssl_lib="libustream-ssl"
+            else
+                adb_fetchparm="${adb_fetchparm:-"--timeout=10 -O"}"
+            fi
+        ;;
+        wget)
+            adb_fetchparm="${adb_fetchparm:-"--no-cache --no-cookies --max-redirect=0 --timeout=10 --no-check-certificate -O"}"
             ssl_lib="built-in"
-        fi
-    fi
-    if [ ! -x "${adb_fetch}" ] && [ "$(readlink -fn "/bin/wget")" = "/bin/uclient-fetch" ]
-    then
-        adb_fetch="/bin/uclient-fetch"
-        if [ -f "/lib/libustream-ssl.so" ]
-        then
-            adb_fetchparm="-q --timeout=10 --no-check-certificate -O"
-            ssl_lib="libustream-ssl"
-        else
-            adb_fetchparm="-q --timeout=10 -O"
-        fi
-    fi
-    if [ ! -x "${adb_fetch}" ] || [ -z "${adb_fetch}" ] || [ -z "${adb_fetchparm}" ]
-    then
-        f_log "error" "no download utility found, please install 'uclient-fetch' with 'libustream-mbedtls' or the full 'wget' package"
-    fi
-    adb_fetchinfo="${adb_fetch##*/} (${ssl_lib})"
+        ;;
+        wget-nossl)
+            adb_fetchparm="${adb_fetchparm:-"--no-cache --no-cookies --max-redirect=0 --timeout=10 -O"}"
+        ;;
+        busybox)
+            adb_fetchparm="${adb_fetchparm:-"-O"}"
+        ;;
+        curl)
+            adb_fetchparm="${adb_fetchparm:-"--connect-timeout 10 --insecure -o"}"
+            ssl_lib="built-in"
+        ;;
+        aria2c)
+            adb_fetchparm="${adb_fetchparm:-"--timeout=10 --allow-overwrite=true --auto-file-renaming=false --check-certificate=false -o"}"
+            ssl_lib="built-in"
+        ;;
+    esac
+    adb_fetchutil="$(command -v "${adb_fetchutil}")"
 
-    # create dns hideout directory
-    #
-    if [ ! -d "${adb_dnshidedir}" ]
+    if [ ! -x "${adb_fetchutil}" ] || [ -z "${adb_fetchutil}" ] || [ -z "${adb_fetchparm}" ]
     then
-        mkdir -p -m 660 "${adb_dnshidedir}"
-        chown -R "${adb_dns}":"${adb_dns}" "${adb_dnshidedir}" 2>/dev/null
-    else
-        rm -f "${adb_dnshidedir}/${adb_dnsprefix}"*
+        f_log "err" "download utility not found, please install 'uclient-fetch' with 'libustream-mbedtls' or the full 'wget' package"
     fi
+    adb_fetchinfo="${adb_fetchutil} (${ssl_lib:-"-"})"
 
-    # create adblock temp file/directory
-    #
-    adb_tmpload="$(mktemp -tu)"
-    adb_tmpfile="$(mktemp -tu)"
-    adb_tmpdir="$(mktemp -p /tmp -d)"
+    f_temp
+    f_jsnup "running"
+    f_log "info" "start adblock processing (${adb_action})"
+}
 
-    # prepare whitelist entries
-    #
-    if [ -s "${adb_whitelist}" ]
+# create temporay files and directories
+#
+f_temp()
+{
+    if [ -z "${adb_tmpdir}" ]
     then
-        awk "${adb_whitelist_rset}" "${adb_whitelist}" > "${adb_tmpdir}/tmp.whitelist"
+        adb_tmpdir="$(mktemp -p /tmp -d)"
+        adb_tmpload="$(mktemp -p ${adb_tmpdir} -tu)"
+        adb_tmpfile="$(mktemp -p ${adb_tmpdir} -tu)"
+    fi
+    if [ ! -s "${adb_pidfile}" ]
+    then
+        printf '%s' "${$}" > "${adb_pidfile}"
     fi
 }
 
-# f_rmtemp: remove temporary files & directories
+# remove temporay files and directories
 #
 f_rmtemp()
 {
     if [ -d "${adb_tmpdir}" ]
     then
-        rm -f "${adb_tmpload}"
-        rm -f "${adb_tmpfile}"
         rm -rf "${adb_tmpdir}"
     fi
+    > "${adb_pidfile}"
 }
 
-# f_rmdns: remove dns related files & directories
+# remove dns related files and directories
 #
 f_rmdns()
 {
     if [ -n "${adb_dns}" ]
     then
-        rm -f "${adb_dnsdir}/${adb_dnsprefix}"*
-        rm -f "${adb_backupdir}/${adb_dnsprefix}"*.gz
-        rm -rf "${adb_dnshidedir}"
+        f_hash
+        printf '%s\n' "${adb_dnsheader}" > "${adb_dnsdir}/${adb_dnsfile}"
+        > "${adb_dnsdir}/.${adb_dnsfile}"
         > "${adb_rtfile}"
+        rm -f "${adb_backupdir}/${adb_dnsprefix}"*.gz
+        f_hash
+        if [ ${?} -eq 1 ]
+        then
+            f_dnsup
+        fi
+        f_rmtemp
+    fi
+    f_log "debug" "f_rmdns::: dns: ${adb_dns}, dns_dir: ${adb_dnsdir}, dns_prefix: ${adb_dnsprefix}, dns_file: ${adb_dnsfile}, rt_file: ${adb_rtfile}, backup_dir: ${adb_backupdir}"
+}
+
+# commit uci changes
+#
+f_uci()
+{
+    local change config="${1}"
+
+    if [ -n "${config}" ]
+    then
+        change="$(uci -q changes "${config}" | awk '{ORS=" "; print $0}')"
+        if [ -n "${change}" ]
+        then
+            uci -q commit "${config}"
+            case "${config}" in
+                firewall)
+                    /etc/init.d/firewall reload >/dev/null 2>&1
+                ;;
+                *)
+                    /etc/init.d/"${adb_dns}" reload >/dev/null 2>&1
+                ;;
+            esac
+        fi
+    fi
+    f_log "debug" "f_uci  ::: config: ${config}, change: ${change}"
+}
+
+# list/overall count
+#
+f_count()
+{
+    local mode="${1}"
+
+    adb_cnt=0
+    if [ -s "${adb_dnsdir}/${adb_dnsfile}" ] && ([ -z "${mode}" ] || [ "${mode}" = "final" ])
+    then
+        if [ "${adb_dns}" = "named" ] || [ "${adb_dns}" = "kresd" ]
+        then
+            adb_cnt="$(( ($(wc -l 2>/dev/null < "${adb_dnsdir}/${adb_dnsfile}") - $(printf "%s" "${adb_dnsheader}" | grep -c "^")) / 2 ))"
+        else
+            adb_cnt="$(wc -l 2>/dev/null < "${adb_dnsdir}/${adb_dnsfile}")"
+        fi
+    elif [ "${mode}" = "whitelist" ] && [ -s "${adb_tmpdir}/tmp.whitelist" ]
+    then
+        adb_cnt="$(wc -l 2>/dev/null < "${adb_tmpdir}/tmp.whitelist")"
+    elif [ -s "${adb_tmpfile}" ]
+    then
+        adb_cnt="$(wc -l 2>/dev/null < "${adb_tmpfile}")"
     fi
 }
 
-# f_dnsrestart: restart the dns backend
+# set external config options
 #
-f_dnsrestart()
+f_extconf()
 {
-    local cnt=0
+    local uci_config
+
+    case "${adb_dns}" in
+        dnsmasq)
+            uci_config="dhcp"
+            if [ ${adb_enabled} -eq 1 ] && [ -z "$(uci -q get dhcp.@dnsmasq[${adb_dnsinstance}].serversfile | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
+            then
+                uci -q set dhcp.@dnsmasq[${adb_dnsinstance}].serversfile="${adb_dnsdir}/${adb_dnsfile}"
+            elif [ ${adb_enabled} -eq 0 ] && [ -n "$(uci -q get dhcp.@dnsmasq[${adb_dnsinstance}].serversfile | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
+            then
+                uci -q delete dhcp.@dnsmasq[${adb_dnsinstance}].serversfile
+            fi
+        ;;
+        kresd)
+            uci_config="resolver"
+            if [ ${adb_enabled} -eq 1 ] && [ -z "$(uci -q get resolver.kresd.rpz_file | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
+            then
+                uci -q add_list resolver.kresd.rpz_file="${adb_dnsdir}/${adb_dnsfile}"
+            elif [ ${adb_enabled} -eq 0 ] && [ -n "$(uci -q get resolver.kresd.rpz_file | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
+            then
+                uci -q del_list resolver.kresd.rpz_file="${adb_dnsdir}/${adb_dnsfile}"
+            fi
+            if [ ${adb_enabled} -eq 1 ] && [ ${adb_dnsflush} -eq 0 ] && [ "$(uci -q get resolver.kresd.keep_cache)" != "1" ]
+            then
+                uci -q set resolver.kresd.keep_cache="1"
+            elif [ ${adb_enabled} -eq 0 ] || ([ ${adb_dnsflush} -eq 1 ] && [ "$(uci -q get resolver.kresd.keep_cache)" = "1" ])
+            then
+                uci -q set resolver.kresd.keep_cache="0"
+            fi
+        ;;
+    esac
+    f_uci "${uci_config}"
+
+    uci_config="firewall"
+    if [ ${adb_enabled} -eq 1 ] && [ ${adb_forcedns} -eq 1 ] && \
+       [ -z "$(uci -q get firewall.adblock_dns)" ] && [ $(/etc/init.d/firewall enabled; printf "%u" ${?}) -eq 0 ]
+    then
+        uci -q set firewall.adblock_dns="redirect"
+        uci -q set firewall.adblock_dns.name="Adblock DNS"
+        uci -q set firewall.adblock_dns.src="lan"
+        uci -q set firewall.adblock_dns.proto="tcp udp"
+        uci -q set firewall.adblock_dns.src_dport="53"
+        uci -q set firewall.adblock_dns.dest_port="53"
+        uci -q set firewall.adblock_dns.target="DNAT"
+    elif [ -n "$(uci -q get firewall.adblock_dns)" ] && ([ ${adb_enabled} -eq 0 ] || [ ${adb_forcedns} -eq 0 ])
+    then
+        uci -q delete firewall.adblock_dns
+    fi
+    f_uci "${uci_config}"
+}
+
+# restart of the dns backend
+#
+f_dnsup()
+{
+    local dns_up cache_util cache_rc cnt=0
+
+    if [ ${adb_dnsflush} -eq 0 ] && [ ${adb_enabled} -eq 1 ] && [ "${adb_rc}" -eq 0 ]
+    then
+        case "${adb_dns}" in
+            dnsmasq)
+                killall -q -HUP "${adb_dns}"
+                cache_rc=${?}
+            ;;
+            unbound)
+                cache_util="$(command -v unbound-control)"
+                if [ -x "${cache_util}" ] && [ -d "${adb_tmpdir}" ] && [ -f "${adb_dnsdir}"/unbound.conf ]
+                then
+                    "${cache_util}" -c "${adb_dnsdir}"/unbound.conf dump_cache > "${adb_tmpdir}"/adb_cache.dump 2>/dev/null
+                fi
+                "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
+            ;;
+            kresd)
+                cache_util="keep_cache"
+                "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
+                cache_rc=${?}
+            ;;
+            named)
+                cache_util="$(command -v rndc)"
+                if [ -x "${cache_util}" ] && [ -f /etc/bind/rndc.conf ]
+                then
+                    "${cache_util}" -c /etc/bind/rndc.conf reload >/dev/null 2>&1
+                    cache_rc=${?}
+                else
+                    "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
+                fi
+            ;;
+            *)
+                "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
+            ;;
+        esac
+    else
+        "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
+    fi
 
-    "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
+    adb_rc=1
     while [ ${cnt} -le 10 ]
     do
-        adb_dnsup="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}" | jsonfilter -l1 -e "@.${adb_dns}.instances.*.running")"
-        if [ "${adb_dnsup}" = "true" ]
+        dns_up="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}" | jsonfilter -l1 -e "@[\"${adb_dns}\"].instances.*.running")"
+        if [ "${dns_up}" = "true" ]
         then
+            case "${adb_dns}" in
+                unbound)
+                    cache_util="$(command -v unbound-control)"
+                    if [ -x "${cache_util}" ] && [ -d "${adb_tmpdir}" ] && [ -s "${adb_tmpdir}"/adb_cache.dump ]
+                    then
+                        while [ ${cnt} -le 10 ]
+                        do
+                            "${cache_util}" -c "${adb_dnsdir}"/unbound.conf load_cache < "${adb_tmpdir}"/adb_cache.dump >/dev/null 2>&1
+                            cache_rc=${?}
+                            if [ ${cache_rc} -eq 0 ]
+                            then
+                                break
+                            fi
+                            cnt=$((cnt+1))
+                            sleep 1
+                        done
+                    fi
+                ;;
+            esac
+            adb_rc=0
             break
         fi
         cnt=$((cnt+1))
         sleep 1
     done
+    f_log "debug" "f_dnsup::: cache_util: ${cache_util:-"-"}, cache_rc: ${cache_rc:-"-"}, cache_flush: ${adb_dnsflush}, cache_cnt: ${cnt}, rc: ${adb_rc}"
+    return ${adb_rc}
 }
 
-# f_list: backup/restore/remove block lists
+# backup/restore/remove blocklists
 #
 f_list()
 {
-    local mode="${1}" in_rc="${adb_rc}" cnt=0
+    local file mode="${1}" in_rc="${adb_rc}"
 
     case "${mode}" in
         backup)
-            cnt="$(wc -l < "${adb_tmpfile}")"
-            if [ ${adb_backup} -eq 1 ] && [ -d "${adb_backupdir}" ]
+            if [ -d "${adb_backupdir}" ]
             then
-                gzip -cf "${adb_tmpfile}" > "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz"
+                gzip -cf "${adb_tmpfile}" 2>/dev/null > "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz"
                 adb_rc=${?}
             fi
-            ;;
+        ;;
         restore)
-            if [ ${adb_backup} -eq 1 ] && [ -d "${adb_backupdir}" ]
+            if [ -d "${adb_backupdir}" ] && [ -f "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz" ]
             then
-                rm -f "${adb_dnsdir}/${adb_dnsprefix}.${src_name}"
-                if [ -f "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz" ]
-                then
-                    gunzip -cf "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz" > "${adb_tmpfile}"
-                    adb_rc=${?}
-                fi
+                gunzip -cf "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz" 2>/dev/null > "${adb_tmpfile}"
+                adb_rc=${?}
             fi
-            ;;
+        ;;
         remove)
-            rm -f "${adb_dnsdir}/${adb_dnsprefix}.${src_name}"
             if [ -d "${adb_backupdir}" ]
             then
                 rm -f "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz"
             fi
             adb_rc=${?}
-            ;;
+        ;;
+        merge)
+            for file in "${adb_tmpfile}".*
+            do
+                cat "${file}" 2>/dev/null >> "${adb_tmpdir}/${adb_dnsfile}"
+                if [ ${?} -ne 0 ]
+                then
+                    adb_rc=${?}
+                    break
+                fi
+                rm -f "${file}"
+            done
+            adb_tmpfile="${adb_tmpdir}/${adb_dnsfile}"
+        ;;
+        final)
+            if [ -s "${adb_tmpdir}/tmp.whitelist" ]
+            then
+                grep -vf "${adb_tmpdir}/tmp.whitelist" "${adb_tmpdir}/${adb_dnsfile}" | eval "${adb_dnsdeny}" > "${adb_dnsdir}/${adb_dnsfile}"
+            else
+                eval "${adb_dnsdeny}" "${adb_tmpdir}/${adb_dnsfile}" > "${adb_dnsdir}/${adb_dnsfile}"
+            fi
+            if [ ${?} -eq 0 ] && [ -n "${adb_dnsheader}" ]
+            then
+                printf '%s\n' "${adb_dnsheader}" | cat - "${adb_dnsdir}/${adb_dnsfile}" > "${adb_tmpdir}/${adb_dnsfile}"
+                cat "${adb_tmpdir}/${adb_dnsfile}" > "${adb_dnsdir}/${adb_dnsfile}"
+            fi
+            adb_rc=${?}
+        ;;
     esac
-    f_log "debug" "name: ${src_name}, mode: ${mode}, count: ${cnt}, in_rc: ${in_rc}, out_rc: ${adb_rc}"
+    f_count "${mode}"
+    f_log "debug" "f_list ::: name: ${src_name:-"-"}, mode: ${mode}, cnt: ${adb_cnt}, in_rc: ${in_rc}, out_rc: ${adb_rc}"
 }
 
-# f_switch: suspend/resume adblock processing
+# top level domain compression
 #
-f_switch()
+f_tld()
 {
-    if [ -d "${adb_dnshidedir}" ]
+    local cnt cnt_srt cnt_tld source="${1}" temp="${1}.tld"
+
+    cnt="$(wc -l 2>/dev/null < "${source}")"
+    sort -u "${source}" > "${temp}"
+    if [ ${?} -eq 0 ]
     then
-        local source target status mode="${1}"
-        local dns_active="$(find "${adb_dnsdir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
-        local dns_passive="$(find "${adb_dnshidedir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
+        cnt_srt="$(wc -l 2>/dev/null < "${temp}")"
+        awk -F "." '{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' "${temp}" > "${source}"
+        if [ ${?} -eq 0 ]
+        then
+            sort "${source}" > "${temp}"
+            if [ ${?} -eq 0 ]
+            then
+                awk '{if(NR==1){tld=$NF};while(getline){if($NF!~tld"\\."){print tld;tld=$NF}}print tld}' "${temp}" > "${source}"
+                if [ ${?} -eq 0 ]
+                then
+                    awk -F "." '{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' "${source}" > "${temp}"
+                    if [ ${?} -eq 0 ]
+                    then
+                        sort "${temp}" > "${source}"
+                        if [ ${?} -eq 0 ]
+                        then
+                            cnt_tld="$(wc -l 2>/dev/null < "${source}")"
+                        else
+                            cat "${temp}" > "${source}"
+                        fi
+                    fi
+                else
+                    cat "${temp}" > "${source}"
+                fi
+            fi
+        else
+            cat "${temp}" > "${source}"
+        fi
+    fi
+    rm -f "${temp}"
+    f_log "debug" "f_tld  ::: source: ${source}, cnt: ${cnt:-"-"}, cnt_srt: ${cnt_srt:-"-"}, cnt_tld: ${cnt_tld:-"-"}"
+}
 
-        if [ -n "${dns_active}" ] && [ "${mode}" = "suspend" ]
+# blocklist hash compare
+#
+f_hash()
+{
+    local hash hash_rc=1
+
+    if [ -x "${adb_hashutil}" ] && [ -f "${adb_dnsdir}/${adb_dnsfile}" ]
+    then
+        hash="$(${adb_hashutil} "${adb_dnsdir}/${adb_dnsfile}" 2>/dev/null | awk '{print $1}')"
+        if [ -z "${adb_hashold}" ] && [ -n "${hash}" ]
         then
-            source="${adb_dnsdir}/${adb_dnsprefix}"
-            target="${adb_dnshidedir}"
-            status="suspended"
-        elif [ -n "${dns_passive}" ] && [ "${mode}" = "resume" ]
+            adb_hashold="${hash}"
+        elif [ -z "${adb_hashnew}" ] && [ -n "${hash}" ]
         then
-            source="${adb_dnshidedir}/${adb_dnsprefix}"
-            target="${adb_dnsdir}"
-            status="resumed"
+            adb_hashnew="${hash}"
         fi
-        if [ -n "${status}" ]
+        if [ -n "${adb_hashold}" ] && [ -n "${adb_hashnew}" ]
         then
-            mv -f "${source}"* "${target}"
-            f_dnsrestart
-            f_log "info " "adblock processing ${status}"
+            if [ "${adb_hashold}" = "${adb_hashnew}" ]
+            then
+                hash_rc=0
+            fi
+            adb_hashold=""
+            adb_hashnew=""
         fi
     fi
+    f_log "debug" "f_hash ::: hash_util: ${adb_hashutil}, hash: ${hash}, out_rc: ${hash_rc}"
+    return ${hash_rc}
 }
 
-# f_query: query block lists for certain (sub-)domains
+# suspend/resume adblock processing
 #
-f_query()
+f_switch()
 {
-    local search result cnt
-    local domain="${1}"
-    local tld="${domain#*.}"
-    local dns_active="$(find "${adb_dnsdir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
+    local mode="${1}"
 
-    if [ -z "${dns_active}" ]
+    if [ ! -s "${adb_dnsdir}/.${adb_dnsfile}" ] && [ "${mode}" = "suspend" ]
     then
-         printf "%s\n" "::: no active block lists found, please start / resume adblock first"
-    elif [ -z "${domain}" ] || [ "${domain}" = "${tld}" ]
+        f_hash
+        cat "${adb_dnsdir}/${adb_dnsfile}" > "${adb_dnsdir}/.${adb_dnsfile}"
+        printf '%s\n' "${adb_dnsheader}" > "${adb_dnsdir}/${adb_dnsfile}"
+        f_hash
+    elif [ -s "${adb_dnsdir}/.${adb_dnsfile}" ] && [ "${mode}" = "resume" ]
+    then
+        f_hash
+        cat "${adb_dnsdir}/.${adb_dnsfile}" > "${adb_dnsdir}/${adb_dnsfile}"
+        > "${adb_dnsdir}/.${adb_dnsfile}"
+        f_hash
+    fi
+    if [ ${?} -eq 1 ]
     then
-        printf "%s\n" "::: invalid domain input, please submit a specific (sub-)domain, e.g. 'www.abc.xyz'"
+        f_temp
+        f_dnsup
+        f_jsnup "${mode}"
+        f_log "info" "${mode} adblock processing"
+        f_rmtemp
+        exit 0
+    fi
+}
+
+# query blocklist for certain (sub-)domains
+#
+f_query()
+{
+    local search result field=1 domain="${1}" tld="${1#*.}"
+
+    if [ -z "${domain}" ] || [ "${domain}" = "${tld}" ]
+    then
+        printf "%s\n" "::: invalid domain input, please submit a single domain, e.g. 'doubleclick.net'"
     else
-        cd "${adb_dnsdir}"
+        case "${adb_dns}" in
+            dnsmasq)
+                field=2
+            ;;
+            unbound)
+                field=3
+            ;;
+        esac
         while [ "${domain}" != "${tld}" ]
         do
             search="${domain//./\.}"
-            result="$(grep -Hm1 "[/\"\.]${search}[/\"]" "${adb_dnsprefix}"* | awk -F ':|=|/|\"' '{printf(" %-20s : %s\n",$1,$4)}')"
-            printf "%s\n" "::: distinct results for domain '${domain}'"
-            printf "%s\n" "${result:=" no match"}"
+            result="$(awk -F '/|\"| ' "/^($search|[^\*].*[\/\"\. ]+${search})/{i++;{printf(\"  + %s\n\",\$${field})};if(i>9){printf(\"  + %s\n\",\"[...]\");exit}}" "${adb_dnsdir}/${adb_dnsfile}")"
+            printf "%s\n" "::: results for domain '${domain}'"
+            printf "%s\n" "${result:-"  - no match"}"
             domain="${tld}"
             tld="${domain#*.}"
         done
     fi
 }
 
-# f_status: output runtime information
+# update runtime information
 #
-f_status()
+f_jsnup()
 {
-    local key keylist value
+    local bg_pid rundate="$(/bin/date "+%d.%m.%Y %H:%M:%S")" status="${1:-"enabled"}" mode="normal mode" no_mail=0
 
-    if [ -s "${adb_rtfile}" ]
+    if [ ${adb_rc} -gt 0 ]
+    then
+        status="error"
+    fi
+    if [ ${adb_enabled} -eq 0 ]
+    then
+        status="disabled"
+    fi
+    if [ "${status}" = "suspend" ]
+    then
+        status="paused"
+    fi
+    if [ "${status}" = "resume" ]
+    then
+        no_mail=1
+        status="enabled"
+    fi
+    if [ "${status}" = "enabled" ]
     then
-        local dns_active="$(find "${adb_dnsdir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
-        local dns_passive="$(find "${adb_dnshidedir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
+        f_count
+    fi
 
-        if [ -n "${dns_active}" ]
-        then
-            value="active"
-        elif [ -n "${dns_passive}" ] || [ -z "${dns_active}" ]
-        then
-            value="no domains blocked"
-        fi
-        printf "%s\n" "::: adblock runtime information"
-        printf " %-15s : %s\n" "status" "${value}"
+    if [ ${adb_backup_mode} -eq 1 ]
+    then
+        mode="backup mode"
+    fi
+
+    if [ -z "${adb_fetchinfo}" ] && [ -s "${adb_rtfile}" ]
+    then
         json_load "$(cat "${adb_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
+        json_get_var adb_fetchinfo "fetch_utility"
     fi
+
+    json_init
+    json_add_object "data"
+    json_add_string "adblock_status" "${status}"
+    json_add_string "adblock_version" "${adb_ver}"
+    json_add_string "overall_domains" "${adb_cnt} (${mode})"
+    json_add_string "fetch_utility" "${adb_fetchinfo:-"-"}"
+    json_add_string "dns_backend" "${adb_dns} (${adb_dnsdir})"
+    json_add_string "last_rundate" "${rundate:-"-"}"
+    json_add_string "system_release" "${adb_sysver}"
+    json_close_object
+    json_dump > "${adb_rtfile}"
+
+    if [ ${adb_notify} -eq 1 ] && [ ${no_mail} -eq 0 ] && [ -x /etc/adblock/adblock.notify ] && \
+      ([ "${status}" = "error" ] || ([ "${status}" = "enabled" ] && [ ${adb_cnt} -le ${adb_notifycnt} ]))
+    then
+        (/etc/adblock/adblock.notify >/dev/null 2>&1) &
+        bg_pid=${!}
+    fi
+    f_log "debug" "f_jsnup::: status: ${status}, mode: ${mode}, cnt: ${adb_cnt}, notify: ${adb_notify}, notify_cnt: ${adb_notifycnt}, notify_pid: ${bg_pid:-"-"}"
 }
 
-# f_log: write to syslog, exit on error
+# write to syslog
 #
 f_log()
 {
@@ -397,190 +763,272 @@ f_log()
 
     if [ -n "${log_msg}" ] && ([ "${class}" != "debug" ] || [ ${adb_debug} -eq 1 ])
     then
-        logger -t "adblock-[${adb_ver}] ${class}" "${log_msg}"
-        if [ "${class}" = "error" ]
+        logger -p "${class}" -t "adblock-[${adb_ver}]" "${log_msg}"
+        if [ "${class}" = "err" ]
         then
-            logger -t "adblock-[${adb_ver}] ${class}" "Please check 'https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md' (${adb_sysver})"
-            f_rmtemp
-            if [ -n "$(ls -dA "${adb_dnsdir}/${adb_dnsprefix}"* 2>/dev/null)" ]
-            then
-                f_rmdns
-                f_dnsrestart
-            fi
-            exit 255
+            f_rmdns
+            f_jsnup
+            logger -p "${class}" -t "adblock-[${adb_ver}]" "Please also check 'https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md' (${adb_sysver})"
+            exit 1
         fi
     fi
 }
 
-# main function for block list processing
+# main function for blocklist processing
 #
 f_main()
 {
-    local enabled url cnt sum_cnt=0 mem_total=0
-    local src_name src_rset shalla_archive
-    mem_total="$(awk '$1 ~ /^MemTotal/ {printf $2}' "/proc/meminfo" 2>/dev/null)"
+    local tmp_load tmp_file src_name src_rset src_arc src_log mem_total mem_free enabled url cnt=1
+
+    mem_total="$(awk '/^MemTotal/ {print int($2/1000)}' "/proc/meminfo" 2>/dev/null)"
+    mem_free="$(awk '/^MemFree/ {print int($2/1000)}' "/proc/meminfo" 2>/dev/null)"
+    tmp_load="${adb_tmpload}"
+    tmp_file="${adb_tmpfile}"
+    > "${adb_dnsdir}/.${adb_dnsfile}"
+    > "${adb_tmpdir}/tmp.whitelist"
+    f_log "debug" "f_main ::: dns: ${adb_dns}, fetch_util: ${adb_fetchinfo}, backup: ${adb_backup}, backup_mode: ${adb_backup_mode}, dns_jail: ${adb_jail}, force_srt: ${adb_forcesrt}, force_dns: ${adb_forcedns}, mem_total: ${mem_total:-0}, mem_free: ${mem_free:-0}, max_queue: ${adb_maxqueue}"
 
-    f_log "info " "start adblock processing ..."
-    > "${adb_rtfile}"
+    # prepare whitelist entries
+    #
+    if [ -s "${adb_whitelist}" ]
+    then
+        adb_whitelist_rset="/^([^([:space:]|\#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{gsub(\"\\\.\",\"\\\.\",\$1);print tolower(\"^\"\$1\"\\\|\\\.\"\$1)}"
+        awk "${adb_whitelist_rset}" "${adb_whitelist}" > "${adb_tmpdir}/tmp.whitelist"
+        f_list whitelist
+        if [ ${adb_jail} -eq 1 ] && [ "${adb_dns}" != "dnscrypt-proxy" ]
+        then
+            adb_whitelist_rset="/^([^([:space:]|\#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}"
+            awk "${adb_whitelist_rset}" "${adb_whitelist}" > "${adb_tmpdir}/tmp.dnsjail"
+        fi
+    fi
+
+    # build 'dnsjail' list
+    #
+    if [ ${adb_jail} -eq 1 ] && [ "${adb_dns}" != "dnscrypt-proxy" ]
+    then
+        f_tld "${adb_tmpdir}/tmp.dnsjail"
+        eval "${adb_dnsallow}" "${adb_tmpdir}/tmp.dnsjail" > "/tmp/${adb_dnsjail}"
+        printf '%s\n' "${adb_dnshalt}" >> "/tmp/${adb_dnsjail}"
+        if [ -n "${adb_dnsheader}" ]
+        then
+            printf '%s\n' "${adb_dnsheader}" | cat - "/tmp/${adb_dnsjail}" > "${adb_tmpdir}/tmp.dnsjail"
+            cat "${adb_tmpdir}/tmp.dnsjail" > "/tmp/${adb_dnsjail}"
+        fi
+    fi
+
+    # main loop
+    #
     for src_name in ${adb_sources}
     do
         eval "enabled=\"\${enabled_${src_name}}\""
         eval "url=\"\${adb_src_${src_name}}\""
         eval "src_rset=\"\${adb_src_rset_${src_name}}\""
-        adb_dnsfile="${adb_tmpdir}/${adb_dnsprefix}.${src_name}"
-        > "${adb_tmpload}"
-        > "${adb_tmpfile}"
-        adb_rc=0
+        adb_tmpload="${tmp_load}.${src_name}"
+        adb_tmpfile="${tmp_file}.${src_name}"
 
         # basic pre-checks
         #
+        f_log "debug" "f_main ::: name: ${src_name}, enabled: ${enabled}"
         if [ "${enabled}" != "1" ] || [ -z "${url}" ] || [ -z "${src_rset}" ]
         then
             f_list remove
             continue
         fi
 
-        # download block list
+        # backup mode
         #
-        f_log "debug" "name: ${src_name}, enabled: ${enabled}, backup: ${adb_backup}, dns: ${adb_dns}, fetch: ${adb_fetchinfo}, memory: ${mem_total}, force srt/dns: ${adb_forcesrt}/${adb_forcedns}"
-        if [ "${src_name}" = "blacklist" ]
-        then
-            cat "${url}" 2>/dev/null > "${adb_tmpload}"
-            adb_rc=${?}
-        elif [ "${src_name}" = "shalla" ]
+        if [ ${adb_backup_mode} -eq 1 ] && [ "${adb_action}" = "start" ] && [ "${src_name}" != "blacklist" ]
         then
-            shalla_archive="${adb_tmpdir}/shallalist.tar.gz"
-            "${adb_fetch}" ${adb_fetchparm} "${shalla_archive}" "${url}" 2>/dev/null
-            adb_rc=${?}
-            if [ ${adb_rc} -eq 0 ]
+            f_list restore
+            if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
             then
-                for category in ${adb_src_cat_shalla}
-                do
-                    tar -xOzf "${shalla_archive}" BL/${category}/domains >> "${adb_tmpload}"
-                    adb_rc=${?}
-                    if [ ${adb_rc} -ne 0 ]
-                    then
-                        break
-                    fi
-                done
+                if ([ ${mem_total} -lt 64 ] || [ ${mem_free} -lt 40 ]) && [ ${adb_forcesrt} -eq 0 ]
+                then
+                    f_tld "${adb_tmpfile}"
+                fi
+                continue
             fi
-            rm -f "${shalla_archive}"
-            rm -rf "${adb_tmpdir}/BL"
-        else
-            "${adb_fetch}" ${adb_fetchparm} "${adb_tmpload}" "${url}" 2>/dev/null
-            adb_rc=${?}
         fi
 
-        # check download result and prepare domain output (incl. tld compression, list backup & restore)
+        # download queue processing
         #
-        if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpload}" ]
+        if [ "${src_name}" = "blacklist" ]
         then
-            awk "${src_rset}" "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
-            if [ -s "${adb_tmpfile}" ]
+            if [ -s "${url}" ]
             then
-                awk -F "." '{for(f=NF;f > 1;f--) printf "%s.", $f;print $1}' "${adb_tmpfile}" 2>/dev/null | sort -u > "${adb_tmpload}"
-                awk '{if(NR==1){tld=$NF};while(getline){if($NF !~ tld"\\."){print tld;tld=$NF}}print tld}' "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
-                awk -F "." '{for(f=NF;f > 1;f--) printf "%s.", $f;print $1}' "${adb_tmpfile}" 2>/dev/null > "${adb_tmpload}"
-                mv -f "${adb_tmpload}" "${adb_tmpfile}"
-                f_list backup
+                (
+                  src_log="$(cat "${url}" > "${adb_tmpload}" 2>&1)"
+                  adb_rc=${?}
+                  if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpload}" ]
+                  then
+                      awk "${src_rset}" "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
+                      adb_rc=${?}
+                      if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
+                      then
+                          rm -f "${adb_tmpload}"
+                          f_list download
+                          if ([ ${mem_total} -lt 64 ] || [ ${mem_free} -lt 40 ]) && [ ${adb_forcesrt} -eq 0 ]
+                          then
+                              f_tld "${adb_tmpfile}"
+                          fi
+                      fi
+                  else
+                      src_log="$(printf '%s' "${src_log}" | awk '{ORS=" ";print $0}')"
+                      f_log "debug" "f_main ::: name: ${src_name}, url: ${url}, rc: ${adb_rc}, log: ${src_log:-"-"}"
+                  fi
+                ) &
             else
-                f_list restore
+                continue
             fi
+        elif [ "${src_name}" = "shalla" ]
+        then
+            (
+              src_arc="${adb_tmpdir}"/shallalist.tar.gz
+              src_log="$("${adb_fetchutil}" ${adb_fetchparm} "${src_arc}" "${url}" 2>&1)"
+              adb_rc=${?}
+              if [ ${adb_rc} -eq 0 ] && [ -s "${src_arc}" ]
+              then
+                  for category in ${adb_src_cat_shalla}
+                  do
+                      tar -xOzf "${src_arc}" "BL/${category}/domains" >> "${adb_tmpload}"
+                      adb_rc=${?}
+                      if [ ${adb_rc} -ne 0 ]
+                      then
+                          break
+                      fi
+                  done
+              else
+                  src_log="$(printf '%s' "${src_log}" | awk '{ORS=" ";print $0}')"
+                  f_log "debug" "f_main ::: name: ${src_name}, url: ${url}, rc: ${adb_rc}, log: ${src_log:-"-"}"
+              fi
+              if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpload}" ]
+              then
+                  rm -f "${src_arc}"
+                  awk "${src_rset}" "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
+                  adb_rc=${?}
+                  if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
+                  then
+                      rm -f "${adb_tmpload}"
+                      f_list download
+                      if [ ${adb_backup} -eq 1 ]
+                      then
+                          f_list backup
+                      fi
+                      if ([ ${mem_total} -lt 64 ] || [ ${mem_free} -lt 40 ]) && [ ${adb_forcesrt} -eq 0 ]
+                      then
+                          f_tld "${adb_tmpfile}"
+                      fi
+                  elif [ ${adb_backup} -eq 1 ]
+                  then
+                      f_list restore
+                  fi
+              elif [ ${adb_backup} -eq 1 ]
+              then
+                  f_list restore
+              fi
+            ) &
         else
-            f_list restore
+            (
+              src_log="$("${adb_fetchutil}" ${adb_fetchparm} "${adb_tmpload}" "${url}" 2>&1)"
+              adb_rc=${?}
+              if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpload}" ]
+              then
+                  awk "${src_rset}" "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
+                  adb_rc=${?}
+                  if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
+                  then
+                      rm -f "${adb_tmpload}"
+                      f_list download
+                      if [ ${adb_backup} -eq 1 ]
+                      then
+                          f_list backup
+                      fi
+                      if ([ ${mem_total} -lt 64 ] || [ ${mem_free} -lt 40 ]) && [ ${adb_forcesrt} -eq 0 ]
+                      then
+                          f_tld "${adb_tmpfile}"
+                      fi
+                  elif [ ${adb_backup} -eq 1 ]
+                  then
+                      f_list restore
+                  fi
+              else
+                  src_log="$(printf '%s' "${src_log}" | awk '{ORS=" ";print $0}')"
+                  f_log "debug" "f_main ::: name: ${src_name}, url: ${url}, rc: ${adb_rc}, log: ${src_log:-"-"}"
+                  if [ ${adb_backup} -eq 1 ]
+                  then
+                      f_list restore
+                  fi
+              fi
+            ) &
         fi
-
-        # remove whitelist domains, final list preparation
-        #
-        if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
+        hold=$(( cnt % adb_maxqueue ))
+        if [ ${hold} -eq 0 ]
         then
-            if [ -s "${adb_tmpdir}/tmp.whitelist" ]
-            then
-                grep -vf "${adb_tmpdir}/tmp.whitelist" "${adb_tmpfile}" 2>/dev/null | eval "${adb_dnsformat}" > "${adb_dnsfile}"
-            else
-                cat "${adb_tmpfile}" 2>/dev/null | eval "${adb_dnsformat}" > "${adb_dnsfile}"
-            fi
-            adb_rc=${?}
-            if [ ${adb_rc} -ne 0 ]
-            then
-                f_list remove
-            fi
-        else
-            f_list remove
+            wait
         fi
+        cnt=$(( cnt + 1 ))
     done
 
-    # overall sort
+    # list merge
     #
-    for src_name in $(ls -dASr "${adb_tmpdir}/${adb_dnsprefix}"* 2>/dev/null)
-    do
-        if [ ${mem_total} -ge 64000 ] || [ ${adb_forcesrt} -eq 1 ]
-        then
-            if [ -s "${adb_tmpdir}/blocklist.overall" ]
-            then
-                sort "${adb_tmpdir}/blocklist.overall" "${adb_tmpdir}/blocklist.overall" "${src_name}" | uniq -u > "${adb_tmpdir}/tmp.blocklist"
-                mv -f "${adb_tmpdir}/tmp.blocklist" "${src_name}"
-            fi
-            cat "${src_name}" >> "${adb_tmpdir}/blocklist.overall"
-        fi
-        cnt="$(wc -l < "${src_name}")"
-        sum_cnt=$((sum_cnt + cnt))
-    done
+    wait
+    src_name="overall"
+    adb_tmpfile="${tmp_file}"
+    f_list merge
 
-    # restart the dns backend and export runtime information
+    # overall sort and conditional dns restart
     #
-    mv -f "${adb_tmpdir}/${adb_dnsprefix}"* "${adb_dnsdir}" 2>/dev/null
-    chown "${adb_dns}":"${adb_dns}" "${adb_dnsdir}/${adb_dnsprefix}"* 2>/dev/null
-    f_rmtemp
-    f_dnsrestart
-    if [ "${adb_dnsup}" = "true" ]
-    then
-        json_init
-        json_add_object "data"
-        json_add_string "adblock_version" "${adb_ver}"
-        json_add_string "blocked_domains" "${sum_cnt}"
-        json_add_string "fetch_info" "${adb_fetchinfo}"
-        json_add_string "dns_backend" "${adb_dns}"
-        json_add_string "last_rundate" "$(/bin/date "+%d.%m.%Y %H:%M:%S")"
-        json_add_string "system" "${adb_sysver}"
-        json_close_object
-        json_dump > "${adb_rtfile}"
-        f_log "info " "block lists with overall ${sum_cnt} domains loaded successfully (${adb_sysver})"
+    f_hash
+    if [ -s "${adb_tmpdir}/${adb_dnsfile}" ]
+    then
+        if ([ ${mem_total} -ge 64 ] && [ ${mem_free} -ge 40 ]) || [ ${adb_forcesrt} -eq 1 ]
+        then
+            f_tld "${adb_tmpdir}/${adb_dnsfile}"
+        fi
+        f_list final
+    else
+        > "${adb_dnsdir}/${adb_dnsfile}"
+    fi
+    chown "${adb_dnsuser}" "${adb_dnsdir}/${adb_dnsfile}" 2>/dev/null
+    f_hash
+    if [ ${?} -eq 1 ]
+    then
+        f_dnsup
+    fi
+    f_jsnup
+    if [ ${?} -eq 0 ]
+    then
+        f_log "info" "blocklist with overall ${adb_cnt} domains loaded successfully (${adb_sysver})"
     else
-        f_log "error" "dns backend restart with active block lists failed"
+        f_log "err" "dns backend restart with active blocklist failed"
     fi
+    f_rmtemp
+    exit ${adb_rc}
 }
 
 # handle different adblock actions
 #
 f_envload
-case "${1}" in
+case "${adb_action}" in
     stop)
-        f_rmtemp
         f_rmdns
-        f_dnsrestart
-        ;;
+    ;;
     restart)
-        f_rmtemp
         f_rmdns
         f_envcheck
         f_main
-        ;;
+    ;;
     suspend)
         f_switch suspend
-        ;;
+    ;;
     resume)
         f_switch resume
-        ;;
+    ;;
     query)
         f_query "${2}"
-        ;;
-    status)
-        f_status
-        ;;
-    *)
+    ;;
+    start|reload)
         f_envcheck
         f_main
-        ;;
+    ;;
 esac
-exit 0
index aadac26612c2420e149c07aae09f9a28cd2bd3eb..8b683eeb353bdd9f9e69d23bd539da9869e349d8 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=addrwatch
 PKG_VERSION:=0.8
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-master.tar.gz
 PKG_SOURCE_URL:=https://github.com/fln/addrwatch/releases/download/$(PKG_VERSION)/
-PKG_MD5SUM:=8f401415be993005fa5fb58a05e14295
+PKG_HASH:=0455bd8d2e18a793e1182712bf4df3e54a5b7575f82f5b79b60deef19ff93df8
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-master
@@ -46,7 +46,7 @@ define Package/addrwatch/install
        $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/addrwatch $(1)/usr/sbin/
        $(INSTALL_BIN) ./files/addrwatch.init $(1)/etc/init.d/addrwatch
-       $(INSTALL_CONF) ./files/addrwatch.config $(1)/etc/config/addrwatch$
+       $(INSTALL_CONF) ./files/addrwatch.config $(1)/etc/config/addrwatch
 endef
 
 $(eval $(call BuildPackage,addrwatch))
index c7cbbfe1b1da0f7e55f28baa6b2d575074950b2d..fb0ea469163ea8c01bfb72f94caf74973144c365 100644 (file)
@@ -4,8 +4,6 @@
 START=50
 USE_PROCD=1
 
-. /lib/functions/network.sh
-
 validate_section_addrwatch() {
        uci_validate_section addrwatch addrwatch "${1}" \
                'disabled:bool:0' \
@@ -65,6 +63,7 @@ start_instance() {
 }
 
 start_service() {
+       . /lib/functions/network.sh
        config_load 'addrwatch'
        config_foreach start_instance 'addrwatch'
 }
index 0127285c998241f59f85d36400ae84bdef5d0f7f..1eb3d2ee7621a245b1f1ef3cb466c6a9af908841 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://ftp.isc.org/isc/aggregate/
-PKG_MD5SUM:=6fcc515388bf2c5b0c8f9f733bfee7e1
+PKG_HASH:=166503005cd8722c730e530cc90652ddfa198a25624914c65dffc3eb87ba5482
 
 PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
 PKG_LICENSE:=ISC
index 866db9f03f9e699453311bf74a23d21c357bb7d4..7e472fb3c5839465f4baee9b1a76853f2ca4a1d3 100644 (file)
@@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=aircrack-ng
 PKG_VERSION:=1.2-rc1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://download.aircrack-ng.org/ \
                http://archive.aircrack-ng.org/aircrack-ng/$(PKG_VERSION)/
-PKG_MD5SUM:=c2f8648c92f7e46051c86c618d4fb0d5
+PKG_HASH:=cf3134521e1c3d7aed4e384e3e5e7b6959e2d485bd1554474608a3a9328e35fd
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
@@ -51,6 +51,8 @@ define Package/airmon-ng/description
   Bash script designed to turn wireless cards into monitor mode.
 endef
 
+TARGET_CFLAGS += -std=gnu89
+
 MAKE_FLAGS += prefix=/usr \
        libnl=true \
        sqlite=false \
index 60d9e63f62f14e1ad5a238823ffa04195494a0f6..bcada092192d9d8e48fc915d73d5f88ba47c9327 100644 (file)
@@ -19,14 +19,13 @@ PKG_SOURCE_URL:=https://github.com/probonopd/announce.git
 PKG_SOURCE_VERSION:=1368525c7305ca5bb4134242f332344f5f7e94e3
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_MIRROR_HASH:=247059922197db04e78c2845974d3dc2fc95a0624a0e0da32b5a13fd86a59d1b
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 
 PKG_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
-PKG_BUILD_DEPENDS:= +libpthread
-
 define Package/announce
        SECTION:=net
        CATEGORY:=Network
diff --git a/net/apache/Config.in b/net/apache/Config.in
new file mode 100644 (file)
index 0000000..5eb42b3
--- /dev/null
@@ -0,0 +1,11 @@
+menu "Configuration"
+        depends on PACKAGE_apache
+
+config APACHE_HTTP2
+        bool
+        prompt "Enable HTTP2"
+        help
+                Enable HTTPS2 support.
+        default n
+
+endmenu
index d436bd39282270235cf4dc66da5a5da795016a9b..9b13383469eef097c07a2b3276e9b99be2a16ae8 100644 (file)
@@ -8,20 +8,31 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=apache
-PKG_VERSION:=2.4.25
-PKG_RELEASE:=1
+PKG_VERSION:=2.4.28
+PKG_RELEASE:=2
 PKG_SOURCE_NAME:=httpd
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=Apache License
 
 PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@APACHE/httpd/
-PKG_MD5SUM:=2826f49619112ad5813c0be5afcc7ddb
+PKG_HASH:=c1197a3a62a4ab5c584ab89b249af38cf28b4adee9c0106b62999fd29f920666
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
 
 PKG_INSTALL:=1
 
+PKG_CONFIG_DEPENDS := \
+       CONFIG_APACHE_HTTP2
+
+ADDITIONAL_MODULES:=
+ifeq ($(CONFIG_APACHE_HTTP2),y)
+  ADDITIONAL_MODULES += --enable-http2
+endif
+ifneq ($(CONFIG_APACHE_HTTP2),y)
+  ADDITIONAL_MODULES += --enable-http2=no
+endif
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/apache/Default
@@ -38,9 +49,13 @@ define Package/apache/Default/description
  Server, it has grown to be the most popular web server on the Internet.
 endef
 
+define Package/apache/config
+  source "$(SOURCE)/Config.in"
+endef
+
 define Package/apache
 $(call Package/apache/Default)
-  DEPENDS:=+libapr +libaprutil +libpcre +libopenssl +unixodbc 
+  DEPENDS:=+libapr +libaprutil +libpcre +libopenssl +unixodbc +zlib +APACHE_HTTP2:libnghttp2
 endef
 
 define Package/apache/description
@@ -90,13 +105,14 @@ endef
 
 TARGET_CFLAGS += $(FPIC)
 TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
-TARGET_LDFLAGS += -lpthread 
+TARGET_LDFLAGS += -lpthread
 
 define Build/Configure
        $(call Build/Configure/Default, \
                --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
                --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
                --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
+               $(ADDITIONAL_MODULES) \
                --enable-http \
                --with-crypto \
                --with-sqlit3="$(STAGING_DIR)/usr" \
diff --git a/net/apache/patches/010-reproducible-builds.patch b/net/apache/patches/010-reproducible-builds.patch
new file mode 100644 (file)
index 0000000..7a5324b
--- /dev/null
@@ -0,0 +1,44 @@
+Description: Make builds reproducible
+ Don't use __DATE__ __TIME__. Use changelog date instead.
+ Sort exported symbols.
+Author: Jean-Michel Vourgère <nirgal@debian.org>
+Forwarded: no
+Last-Update: 2015-08-11
+
+Index: apache2/server/buildmark.c
+===================================================================
+--- apache2.orig/server/buildmark.c
++++ apache2/server/buildmark.c
+@@ -17,11 +17,7 @@
+ #include "ap_config.h"
+ #include "httpd.h"
+-#if defined(__DATE__) && defined(__TIME__)
+-static const char server_built[] = __DATE__ " " __TIME__;
+-#else
+-static const char server_built[] = "unknown";
+-#endif
++static const char server_built[] = "";
+ AP_DECLARE(const char *) ap_get_server_built()
+ {
+Index: apache2/server/Makefile.in
+===================================================================
+--- apache2.orig/server/Makefile.in
++++ apache2/server/Makefile.in
+@@ -1,3 +1,4 @@
++export LC_ALL = C
+ CLEAN_TARGETS = gen_test_char test_char.h \
+       ApacheCoreOS2.def httpd.exp export_files \
+@@ -80,8 +81,8 @@ httpd.exp: exports.c export_vars.h
+       @echo "#! ." > $@
+       @echo "* This file was AUTOGENERATED at build time." >> $@
+       @echo "* Please do not edit by hand." >> $@
+-      $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | grep -v apr_ | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@
+-      $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) export_vars.h | grep -v apr_ | sed -e 's/^\#[^!]*//' | sed -e '/^$$/d' >> $@
++      $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | grep -v apr_ | sed -e 's/^.*[)]\(.*\);$$/\1/' | sort >> $@
++      $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) export_vars.h | grep -v apr_ | sed -e 's/^\#[^!]*//' | sed -e '/^$$/d' | sort >> $@
+ #   developer stuff
index e0b80167edb2ec834e17c1daaaaf4c08644a965e..da18a0e165a4e6672146cc1d2a6eb3f0d2806444 100644 (file)
@@ -17,7 +17,7 @@ PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/apcupsd
-PKG_MD5SUM:=cc8f5ced77f38906a274787acb9bc980
+PKG_HASH:=db7748559b6b4c3784f9856561ef6ac6199ef7bd019b3edcd7e0a647bf8f9867
 
 PKG_BUILD_DEPENDS:=libgd
 
index 5d73ae1bf43b65000dc0ce16436d868f449ff308..e8ae8a81c296ed6869ccd9723766c3f8b56f15b0 100644 (file)
@@ -16,6 +16,7 @@ PKG_SOURCE_URL:=https://github.com/Jajcus/apinger.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=c7da72f7ec26eedd7fd8d224c0e10787b204f94e
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=c6739bef32568877ad63dbfa8e34b617a287e225a0344d4c41ba891e1f25d487
 
 PKG_MAINTAINER:=Alex Samorukov <samm@os2.kiev.ua>
 PKG_LICENSE:= GPL-2.0
index b0d7309d33c00320aeda1d65ff94a688426282e6..c5b0ac898f13a33957afc80e37bc493639acb22d 100644 (file)
@@ -1,45 +1,83 @@
-menu "Aria2 configuration"
+menu "Aria2 Configuration"
        depends on PACKAGE_aria2
 
 choice
-       prompt "SSL library"
+       prompt "SSL Library"
        default ARIA2_OPENSSL
 
 config ARIA2_OPENSSL
        bool "OpenSSL"
 
 config ARIA2_GNUTLS
-       bool "GNUTLS"
+       bool "GnuTLS"
 
 config ARIA2_NOSSL
-       bool "No SSL support"
+       bool "No SSL Support"
 
 endchoice
 
-config ARIA2_BITTORRENT
-       bool "Enable bittorrent support"
-       depends on ARIA2_OPENSSL
-       default n
+choice
+       prompt "Crypto Library"
+       depends on !ARIA2_OPENSSL
+       default ARIA2_NOCRYPTO
 
-config ARIA2_METALINK
-       bool "Enable metalink support"
-       default n
+config ARIA2_NETTLE
+       bool "Nettle"
 
-config ARIA2_SFTP
-        bool "Enable sftp support"
-        default n
+config ARIA2_LIBGCRYPT
+       bool "Libgcrypt"
+
+config ARIA2_NOCRYPTO
+       bool "No Crypto Library"
+
+endchoice
 
 choice
-       prompt "XML library"
-       default ARIA2_EXPAT
-       depends on ARIA2_METALINK
+       prompt "XML Library"
+       default ARIA2_NOXML
+
+config ARIA2_LIBXML2
+       bool "Libxml2"
 
 config ARIA2_EXPAT
-       bool "EXPAT"
+       bool "Expat"
 
-config ARIA2_LIBXML2
-       bool "LIBXML2"
+config ARIA2_NOXML
+       bool "No XML Library"
 
 endchoice
 
+config ARIA2_GMP
+       bool "GNU Multiple Precision Arithmetic Library"
+       depends on ARIA2_NETTLE
+       default n
+
+config ARIA2_BITTORRENT
+       bool "Enable Bittorrent Support"
+       depends on ARIA2_OPENSSL || ARIA2_LIBGCRYPT || \
+               (ARIA2_NETTLE && ARIA2_GMP)
+       default y
+
+config ARIA2_METALINK
+       bool "Enable Metalink Support"
+       depends on !ARIA2_NOXML
+       default n
+
+config ARIA2_SFTP
+       bool "Enable SFTP Support"
+       default n
+
+config ARIA2_ASYNC_DNS
+       bool "Enable Async DNS Support"
+       default n
+
+config ARIA2_COOKIE
+       bool "Enable Firefox3/Chromium Cookie Support"
+       default n
+
+config ARIA2_WEBSOCKET
+       bool "Enable JSON-RPC over WebSocket Support"
+       depends on ARIA2_OPENSSL || ARIA2_LIBGCRYPT || ARIA2_NETTLE
+       default y
+
 endmenu
index a96d4b86c42884b7e4035b1b571bf40441c8095c..751fee45fd0c3a77d291d7ae694b144a0eb404f9 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2012-2016 OpenWrt.org
+# Copyright (C) 2012-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -7,27 +7,35 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=aria2
-PKG_VERSION:=1.30.0
+PKG_VERSION:=1.33.0
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://github.com/aria2/aria2/releases/download/release-$(PKG_VERSION)/
-PKG_MD5SUM:=8c22f569d3fb9e42c5fd9a95173b9b5f
+PKG_HASH:=996e3fc2fd07ce2dd517e20a1f79b8b3dbaa5c7e27953b5fc19dae38f3874b8c
 PKG_INSTALL:=1
 
-PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>, Hsing-Wang Liao <kuoruan@gmail.com>
+PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>, \
+       Hsing-Wang Liao <kuoruan@gmail.com>
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=COPYING
 
 PKG_CONFIG_DEPENDS := \
-  ARIA2_NOSSL \
-  ARIA2_OPENSSL \
-  ARIA2_GNUTLS \
-  ARIA2_BITTORRENT \
-  ARIA2_METALINK \
-  ARIA2_SFTP \
-  ARIA2_EXPAT \
-  ARIA2_LIBXML2
+       CONFIG_ARIA2_NOSSL \
+       CONFIG_ARIA2_OPENSSL \
+       CONFIG_ARIA2_GNUTLS \
+       CONFIG_ARIA2_NOCRYPTO \
+       CONFIG_ARIA2_NETTLE \
+       CONFIG_ARIA2_LIBGCRYPT \
+       CONFIG_ARIA2_LIBXML2 \
+       CONFIG_ARIA2_EXPAT \
+       CONFIG_ARIA2_GMP \
+       CONFIG_ARIA2_BITTORRENT \
+       CONFIG_ARIA2_METALINK \
+       CONFIG_ARIA2_SFTP \
+       CONFIG_ARIA2_ASYNC_DNS \
+       CONFIG_ARIA2_COOKIE \
+       CONFIG_ARIA2_WEBSOCKET
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -41,30 +49,35 @@ define Package/aria2
   SUBMENU:=File Transfer
   TITLE:=lightweight download utility
   URL:=https://aria2.github.io/
-  DEPENDS:=+zlib +ARIA2_SFTP:libssh2 +ARIA2_LIBXML2:libxml2 +ARIA2_EXPAT:libexpat +libstdcpp +ARIA2_OPENSSL:libopenssl +ARIA2_GNUTLS:libgnutls
+  DEPENDS:=+zlib +libstdcpp +ARIA2_OPENSSL:libopenssl +ARIA2_GNUTLS:libgnutls \
+       +ARIA2_NETTLE:libnettle +ARIA2_LIBGCRYPT:libgcrypt +ARIA2_GMP:libgmp \
+       +ARIA2_LIBXML2:libxml2 +ARIA2_EXPAT:libexpat +ARIA2_SFTP:libssh2 \
+       +ARIA2_ASYNC_DNS:libcares +ARIA2_COOKIE:libsqlite3
+  USERID:=aria2=6800:aria2=6800
 endef
 
 define Package/aria2/description
- aria2 is a lightweight multi-protocol & multi-source command-line download
- utility
 aria2 is a lightweight multi-protocol & multi-source command-line download
 utility
 endef
 
 CONFIGURE_ARGS += \
        --disable-nls \
        $(if $(CONFIG_ARIA2_NOSSL),--disable,--enable)-ssl \
-       $(if $(CONFIG_ARIA2_OPENSSL),--with,--without)-openssl \
-       $(if $(CONFIG_ARIA2_GNUTLS),--with,--without)-gnutls \
        $(if $(CONFIG_ARIA2_BITTORRENT),--enable,--disable)-bittorrent \
        $(if $(CONFIG_ARIA2_METALINK),--enable,--disable)-metalink \
-       $(if $(CONFIG_ARIA2_SFTP),--with,--without)-libssh2 \
+       $(if $(CONFIG_ARIA2_WEBSOCKET),--enable,--disable)-websocket \
+       $(if $(CONFIG_ARIA2_OPENSSL),--with,--without)-openssl \
+       $(if $(CONFIG_ARIA2_GNUTLS),--with,--without)-gnutls \
+       $(if $(CONFIG_ARIA2_NETTLE),--with,--without)-libnettle \
+       $(if $(CONFIG_ARIA2_LIBGCRYPT),--with,--without)-libgcrypt \
+       $(if $(CONFIG_ARIA2_GMP),--with,--without)-libgmp \
        $(if $(CONFIG_ARIA2_LIBXML2),--with,--without)-libxml2 \
        $(if $(CONFIG_ARIA2_EXPAT),--with,--without)-libexpat \
-       --without-libnettle \
-       --without-libgmp \
-       --without-libgcrypt \
-       --without-libcares \
+       $(if $(CONFIG_ARIA2_SFTP),--with,--without)-libssh2 \
+       $(if $(CONFIG_ARIA2_ASYNC_DNS),--with,--without)-libcares \
+       $(if $(CONFIG_ARIA2_COOKIE),--with,--without)-sqlite3 \
        --without-libuv \
-       --without-sqlite3 \
        --with-libz
 
 define Package/aria2/install
index e6d76171fc54f0e38fef2a6a7bb466091ccb52c7..108a30e012d853746501ecbc657e5403cdf6846b 100644 (file)
@@ -1,10 +1,31 @@
 
+# You can use most aria2 command-line options, replace '-' with '_'.
+# eg. 'rpc-secret' ==> 'rpc_secret'
+#
+# We do not support all options at this time. But you can add any option
+# with 'list extra_settings'.
+#
+# You can also add new config sections to define multi instance.
+#
 config aria2 'main'
        option enabled '0'
-       option file_allocation 'none'
+       option user 'aria2'
+       option dir '/mnt/sda1/aria2'
+       option config_dir '/var/etc/aria2'
        option bt_enable_lpd 'true'
        option enable_dht 'true'
        option follow_torrent 'true'
-       option user 'root'
-       option dir '/mnt/sda1/aria2'
+       option file_allocation 'none'
        option save_session_interval '30'
+
+       # Add addition Headers here.
+       # eg. list header 'Content-Encoding: gzip'
+       list header ''
+
+       # Add BT trackers here.
+       # eg. list bt_tracker 'http://tracker.example.com/announce'
+       list bt_tracker ''
+
+       # Add extra settings here.
+       # eg. list extra_settings 'option=value'
+       list extra_settings ''
index d6bcda4ab7fc38a89f4645349ea1711821cb0336..c6d56a170cc70515bc2f803e01e22b5db84a90c0 100755 (executable)
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2014-2016 nanpuyue <nanpuyue@gmail.com>
-# Copyright (C) 2016 kuoruan <kuoruan@gmail.com>
+# Copyright (C) 2016-2017 Hsing-wang Liao <kuoruan@gmail.com>
+# Licensed to the public under the Apache License 2.0.
 
 START=99
-SERVICE_WRITE_PID=1
-SERVICE_DAEMONIZE=1
-
-
-append_params() {
-       local p; local v; local s="$1"; shift
-       for p in $*; do
-               config_get v "$s" "$p"
-               [ -n "$v" ] && (
-                       p=$(echo "$p" | sed -e 's|_|-|g');
-                       echo "$p=$v" >> $config_file
-                       )
+USE_PROCD=1
+
+NAME=aria2
+PROG=/usr/bin/aria2c
+
+_info() {
+       logger -p daemon.info -t "$NAME" "$*"
+}
+
+_err() {
+       logger -p daemon.err -t "$NAME" "$*"
+}
+
+_make_dir() {
+       local d
+       for d in "$@"; do
+               if [ ! -d "$d" ]; then
+                       mkdir -p "$d" 2>/dev/null || return 1
+               fi
        done
+
+       return 0
 }
 
-section_enabled() {
-       local result
-       config_get_bool result "$1" 'enabled' 0
-       [ $result -eq 1 ]
+_create_file() {
+       touch "$@" 2>/dev/null
 }
 
-option_disabled() {
-       local result
-       config_get_bool result "$1" "$2" 1
-       [ $result -eq 0 ]
+_change_owner() {
+       local u="$1"; shift
+
+       local d
+       for d in "$@"; do
+               if [ -f "$d" ]; then
+                       chown "$u" "$d" 2>/dev/null || return 1
+               elif [ -d "$d" ]; then
+                       chown -R "$u" "$d" 2>/dev/null || return 1
+               fi
+       done
+
+       return 0
 }
 
-start_instance() {
+_change_file_mode() {
+       local mod="$1"; shift
+       chmod "$mod" "$@" 2>/dev/null
+}
+
+_reset_dir_mode() {
+       local d
+       for d in "$@"; do
+               if [ -d "$d" ]; then
+                       find "$d" -type d -exec chmod 755 {} \; 2>/dev/null
+                       find "$d" -type f -exec chmod 644 {} \; 2>/dev/null
+               fi
+       done
+}
+
+append_options() {
+       local o; local v
+       for o in "$@"; do
+               v="$(eval echo "\$$o")"
+               [ -n "$v" ] && \
+                       echo "${o//_/-}=$v" >>"$config_file_tmp"
+       done
+}
+
+append_setting() {
        local s="$1"
-       local user
+       [ -n "$s" ] && \
+               echo "$s" >>"$config_file_tmp"
+}
+
+append_header() {
+       local h="$1"
+       [ -n "$h" ] && \
+               echo "header=\"${h}\"" >>"$config_file_tmp"
+}
+
+aria2_validate() {
+       uci_validate_section "$NAME" aria2 "$1" \
+               'enabled:bool:0' \
+               'enable_logging:bool' \
+               'enable_proxy:bool' \
+               'config_dir:string:/var/etc/aria2' \
+               'user:string' \
+               'all_proxy:string' \
+               'all_proxy_passwd:string' \
+               'all_proxy_user:string' \
+               'auto_save_interval:range(0,600)' \
+               'bt_enable_lpd:or("true","false")' \
+               'bt_max_open_files:uinteger' \
+               'bt_max_peers:uinteger' \
+               'bt_remove_unselected_file:or("true","false")' \
+               'bt_request_peer_speed_limit:string' \
+               'bt_save_metadata:or("true","false")' \
+               'bt_seed_unverified:or("true","false")' \
+               'bt_stop_timeout:uinteger' \
+               'bt_tracker:list(string)' \
+               'ca_certificate:file' \
+               'certificate:file' \
+               'check_certificate:or("true","false"):true' \
+               'connect_timeout:uinteger' \
+               'dht_listen_port:string' \
+               'dir:string' \
+               'disable_ipv6:or("true","false")' \
+               'disk_cache:string' \
+               'enable_dht:or("true","false"):true' \
+               'enable_dht6:or("true","false")' \
+               'enable_peer_exchange:or("true","false")' \
+               'event_poll:or("epoll","kqueue","port","poll","select")' \
+               'file_allocation:or("none","prealloc","trunc","falloc")' \
+               'follow_torrent:or("true","false","mem")' \
+               'force_save:or("true","false")' \
+               'http_accept_gzip:or("true","false")' \
+               'http_no_cache:or("true","false")' \
+               'listen_port:string' \
+               'log:string' \
+               'log_level:or("debug","info","notice","warn","error")' \
+               'lowest_speed_limit:string' \
+               'max_concurrent_downloads:uinteger' \
+               'max_connection_per_server:uinteger' \
+               'max_download_limit:string' \
+               'max_overall_download_limit:string' \
+               'max_overall_upload_limit:string' \
+               'max_tries:uinteger' \
+               'max_upload_limit:string' \
+               'min_split_size:string' \
+               'pause:or("true","false")' \
+               'pause_metadata:or("true","false")' \
+               'peer_id_prefix:string' \
+               'private_key:file' \
+               'retry_wait:uinteger' \
+               'rpc_auth_method:or("none","user_pass","token")' \
+               'rpc_certificate:file' \
+               'rpc_listen_port:range(1024,65535)' \
+               'rpc_passwd:string' \
+               'rpc_private_key:file' \
+               'rpc_secret:string' \
+               'rpc_secure:or("true","false")' \
+               'rpc_user:string' \
+               'save_session_interval:uinteger' \
+               'seed_ratio:ufloat' \
+               'seed_time:ufloat' \
+               'split:uinteger' \
+               'timeout:uinteger' \
+               'user_agent:string'
+}
 
-       section_enabled "$s" || return 1
+aria2_start() {
+       local section="$1"
+       aria2_validate "$section" || { _err "Validation failed."; return 1; }
 
-       config_get config_dir "$s" 'config_dir' '/var/etc/aria2'
-       config_get dir "$s" 'dir'
-       config_get user "$s" 'user'
+       [ "$enabled" = "1" ] || { _info "Instance \"${section}\" disabled."; return 1; }
+       [ -n "$dir" ] || { _err "Please set downlod dir."; return 1; }
+       [ -d "$dir" ] || { _err "Please create downlod dir first."; return 1; }
 
-       config_file="$config_dir/aria2.conf"
-       session_file="$config_dir/aria2.session"
-       dht_file="$config_dir/dht.dat"
-       log_file="$config_dir/aria2.log"
+       config_file="${config_dir}/${NAME}.conf.${section}"
+       config_file_tmp="${config_dir}/${NAME}.conf.tmp"
+       session_file="${config_dir}/${NAME}.session.${section}"
 
-       [ -d "$config_dir" ] || {
-               mkdir -m 0755 -p "$config_dir"
-               touch "$config_file"
+       _make_dir "$config_dir" || {
+               _err "Can't create config dir: ${config_dir}"
+               return 1
        }
 
-       [ -d "$dir" ] || {
-               mkdir -m 0755 -p "$dir" # create download dir
-               touch "$dir"
+       _create_file "$session_file" "$config_file" "$config_file_tmp" || {
+               _err "Can't create files: ${session_file}, ${config_file}, ${config_file_tmp}"
+               return 1
        }
 
-       touch "$session_file" # create session file
+       # create tmp file
+       cat >"$config_file_tmp" <<-EOF
+               # Auto generated file, changes to this file will lost.
+       EOF
+
+       append_setting "dir=${dir}"
+       append_setting "enable-rpc=true"
+       append_setting "rpc-allow-origin-all=true"
+       append_setting "rpc-listen-all=true"
+       append_setting "quiet=true"
+       append_setting "continue=true"
+       append_setting "input-file=${session_file}"
+       append_setting "save-session=${session_file}"
+
+       if [ -z "$enable_logging" ]; then
+               append_options "log" "log_level"
+       elif [ "$enable_logging" = "1" ]; then
+               log=${log:-"/var/log/aria2.log"}
+
+               local log_dir
+               log_dir="$(dirname "$log")"
+
+               _make_dir "$log_dir" || {
+                       _err "Can't create log dir: ${log_dir}"
+                       return 1
+               }
 
-       echo -e "enable-rpc=true\nrpc-allow-origin-all=true\nrpc-listen-all=true\nquiet=true" > $config_file
-       echo -e "continue=true\ninput-file=$session_file\nsave-session=$session_file" >> $config_file
+               # create or clear log file
+               echo >"$log"
 
-       option_disabled "$s" 'enable_dht' || echo "dht-file-path=$dht_file" >> $config_file
-       option_disabled "$s" 'enable_log' || {
-               [ -f "$log_file" ] && echo > $log_file # if log file exist, clear it
-                echo -e "log=$log_file" >> $config_file
-        }
+               append_setting "log=${log}"
+               append_options "log_level"
+       fi
+
+       if [ -z "$enable_proxy" ] || [ "$enable_proxy" = "1" ]; then
+               append_options "all_proxy" "all_proxy_user" "all_proxy_passwd"
+       fi
 
-       # if user is set, change dir owner
-       [ -z "$user" ] || {
-               chown -R $user:$user $config_dir
-               chown -R $user:$user $dir
+       unset_auth_method() {
+               uci -q batch <<-EOF
+                       set ${NAME}.${section}.rpc_auth_method=""
+                       commit $NAME
+               EOF
        }
 
-       append_params "$s" \
-               file_allocation bt_enable_lpd enable_dht rpc_user rpc_passwd rpc_listen_port dir bt_tracker disk_cache \
-               max_overall_download_limit max_overall_upload_limit max_download_limit max_upload_limit max_concurrent_downloads \
-               max_connection_per_server min_split_size split save_session_interval follow_torrent listen_port bt_max_peers \
-               peer_id_prefix user_agent rpc_secret log_level
-       
-       config_list_foreach "$s" extra_settings append_extrasettings
-       
-       SERVICE_UID="$user" \
-       service_start /usr/bin/aria2c --conf-path="$config_file" # start service
-}
+       if [ -z "$rpc_auth_method" ]; then
+               if [ -n "$rpc_secret" ]; then
+                       append_setting "rpc-secret=${rpc_secret}"
+               elif [ -n "$rpc_user" ]; then
+                       append_setting "rpc-user=${rpc_user}"
+                       append_setting "rcp-passwd=${rcp-passwd}"
+               else
+                       _info "It is recommand to set RPC secret."
+               fi
+       elif [ "$rpc_auth_method" = "token" ]; then
+               if [ -n "$rpc_secret" ]; then
+                       append_setting "rpc-secret=${rpc_secret}"
+               else
+                       unset_auth_method
+               fi
+       elif [ "$rpc_auth_method" = "user_pass" ]; then
+               if [ -n "$rcp_user" ]; then
+                       append_setting "rpc-user=${rpc_user}"
+                       append_setting "rcp-passwd=${rcp-passwd}"
+               else
+                       _info "Please set RPC user."
+                       unset_auth_method
+               fi
+       fi
 
-append_extrasettings() {
-       echo "$1" >> $config_file
-}
+       if [ ."$rpc_secure" = ."true" ] && [ -n "$rpc_certificate" ]; then
+               append_setting "rpc-secure=true"
+               append_options "rpc_certificate" "rpc_private_key"
+       fi
 
-start() {
-       logger -t ARIA2C 'Starting aria2c service'
-       config_load 'aria2'
-       config_foreach start_instance 'aria2'
-       return 0
-}
+       if [ ."$check_certificate" = ."true" ]; then
+               append_setting "check-certificate=true"
+               append_options "ca_certificate"
+       fi
 
-stop() {
-       if [ -n "`pidof aria2c`" ]; then
-               logger -t ARIA2C 'Shutting down aria2c service'
-               service_stop /usr/bin/aria2c
+       if [ ."$enable_dht" = ."true" ]; then
+               dht_file="${config_dir}/dht.dat.${section}"
+               _create_file "$dht_file" || {
+                       _err "Can't create DHT file: ${dht_file}"
+                       return 1
+               }
+
+               append_setting "enable-dht=true"
+               append_setting "dht-file-path=${dht_file}"
        fi
-       return 0
+
+       if [ ."$enable_dht6" = ."true" ] && [ ."$disable_ipv6" != ."true" ]; then
+               dht6_file="${config_dir}/dht6.dat.${section}"
+               _create_file "$dht6_file" || {
+                       _err "Can't create DHT6 file: ${dht6_file}"
+                       return 1
+               }
+
+               append_setting "enable-dht6=true"
+               append_setting "dht-file-path6=${dht6_file}"
+       fi
+
+       if [ -n "$bt_tracker" ]; then
+               local bt_tracker_list; local t
+               for t in $bt_tracker; do
+                       if [ -z "$bt_tracker_list" ]; then
+                               bt_tracker_list="$t"
+                       else
+                               bt_tracker_list="${bt_tracker_list},${t}"
+                       fi
+               done
+
+               append_setting "bt-tracker=${bt_tracker_list}"
+       fi
+
+       append_options "auto_save_interval" "bt_enable_lpd" "bt_max_open_files" "bt_max_peers" \
+               "bt_remove_unselected_file" "bt_request_peer_speed_limit" "bt_save_metadata" "bt_seed_unverified" \
+               "bt_stop_timeout" "certificate" "connect_timeout" "dht_listen_port" "disable_ipv6" "disk_cache" \
+               "enable_peer_exchange" "event_poll" "file_allocation" "follow_torrent" "force_save" "http_accept_gzip" \
+               "http_no_cache" "listen_port" "lowest_speed_limit" "max_concurrent_downloads" "max_connection_per_server" \
+               "max_download_limit" "max_overall_download_limit" "max_overall_upload_limit" "max_tries" \
+               "max_upload_limit" "min_split_size" "pause" "pause_metadata" "peer_id_prefix" "private_key" \
+               "retry_wait" "rpc_listen_port" "save_session_interval" "seed_ratio" "seed_time" "split" "timeout" \
+               "user_agent"
+
+       config_list_foreach "$section" "header" append_header
+       config_list_foreach "$section" "extra_settings" append_setting
+
+       sed '/^$/d' "$config_file_tmp" >"$config_file"
+       rm -f "$config_file_tmp"
+
+       _reset_dir_mode "$config_dir"
+       _change_file_mode 600 "$config_file"
+
+       if [ -n "$user" ]; then
+               if ( user_exists "$user" && _change_owner "$user" "$config_dir" "$log" ); then
+                               _info "Aria2 will run with uer '${user}'."
+                               if [ "$user" != "root" ]; then
+                                       _info "Please make sure user '${user}' has write access to downlod dir: ${dir}"
+                               fi
+               else
+                       _info "Set run user to '${user}' failed, default user will be used."
+                       user=
+               fi
+       fi
+
+       procd_open_instance "${NAME}.${section}"
+       procd_set_param command "$PROG"
+       procd_append_param command --conf-path="${config_file}"
+
+       procd_set_param respawn
+       procd_set_param stdout 1
+       procd_set_param stderr 1
+
+       procd_set_param file "$config_file"
+       [ -n "$user" ] && \
+               procd_set_param user "$user"
+
+       procd_add_jail "${NAME}.${section}" log
+       procd_add_jail_mount "$config_file"
+       procd_add_jail_mount_rw "$dir" "$config_dir" "$log"
+       procd_close_instance
 }
 
-restart() {
-       logger -t ARIA2C 'Restarting aria2c service'
-       stop
-       sleep 2 # give time to shutdown
-       start
+service_triggers() {
+       procd_add_reload_trigger "$NAME"
 }
 
+start_service() {
+       config_load "$NAME"
+       config_foreach aria2_start "aria2"
+}
diff --git a/net/ariang/Makefile b/net/ariang/Makefile
new file mode 100644 (file)
index 0000000..7fac5e8
--- /dev/null
@@ -0,0 +1,48 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ariang
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/mayswind/AriaNg-DailyBuild
+PKG_SOURCE_DATE:=2018-02-21
+PKG_SOURCE_VERSION:=f71a67cbb034aebcd076db3fadc1b9d8cdc470c7
+PKG_MIRROR_HASH:=13b07acbe29a68929295a82deb5a0122d8a56e328f783b6bc1efe9c72b99a702
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Ansuel Smith <ansuelsmth@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ariang
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Download Manager
+  DEPENDS:=+uhttpd +aria2
+  TITLE:=AriaNg is a web frontend making aria2 easier to use.
+  URL:=https://github.com/mayswind/AriaNg
+  PKGARCH:=all
+endef
+
+define Package/ariang/description
+       AriaNg is a web frontend making aria2 easier to use. AriaNg is written in pure html & javascript, thus it does not need any compilers or runtime environment.
+endef
+
+define Build/Compile
+endef
+
+define Package/ariang/install
+       $(INSTALL_DIR) \
+               $(1)/www/ariang
+
+       $(CP) \
+               $(PKG_BUILD_DIR)/{langs,css,js,fonts} \
+               $(PKG_BUILD_DIR)/index.html \
+               $(PKG_BUILD_DIR)/index.manifest \
+               $(PKG_BUILD_DIR)/LICENSE \
+               $(PKG_BUILD_DIR)/favicon.ico \
+               $(1)/www/ariang
+endef
+
+$(eval $(call BuildPackage,ariang))
index 78e84125af92e479b3de5521e7bf13e0f4c2d85c..147bd429c5e0085b06d45c538adff9f4ec8227f4 100644 (file)
@@ -18,6 +18,7 @@ PKG_SOURCE_URL:=https://github.com/royhills/arp-scan.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=69b2f70588565385f3a61d9b1f100f01747cd5e1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=1cfb670ddd1763dbf5c712aaefe4d6c4f825011969e36484e6c442794324f721
 
 PKG_FIXUP:=autoreconf
 
index 9b2404b8fd94b063c594888ce33d7dbad0f01bb7..429aa50ce4a090386b7dacecf28bc872c38ddd40 100644 (file)
@@ -13,10 +13,8 @@ PKG_MAINTAINER:=Daniel Danzberger <daniel@dd-wrt.com>
 PKG_LICENSE:=GPL-2.0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://freefr.dl.sourceforge.net/project/atftp/
-PKG_MD5SUM:=367bf401965fbed04585b1229c2191a8
-
-PKG_BUILD_DEPENDS:=libpcre libreadline
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
+PKG_HASH:=ae4c6f09cadb8d2150c3ce32d88f19036a54e8211f22d723e97864bb5e18f92d
 
 include $(INCLUDE_DIR)/package.mk
 
index 9a2776734c516c46a06956d6dfba5871923c179f..c28ce14cea3f6c8e940578ebf2feea3cfc53c141 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=http://www.harding.motd.ca/autossh/
-PKG_MD5SUM:=f86684b96e99d22b2e9d35dc63b0aa29
+PKG_HASH:=9e8e10a59d7619176f4b986e256f776097a364d1be012781ea52e08d04679156
 PKG_LICENSE:=0BSD
 
 include $(INCLUDE_DIR)/package.mk
index 4677a29729eae125559fee19bfffbcaeef38a4fb..c62aed87e065ab29f682b6c46a2f4e3df1839e04 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bcp38
 PKG_VERSION:=5
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_LICENCE:=GPL-3.0+
 
 include $(INCLUDE_DIR)/package.mk
index 00d50342e0e2e0d55a6a7090ac77cb76b566a179..736ea52c638c9f964ca5a166efa2c128b2e4710d 100755 (executable)
@@ -72,9 +72,9 @@ setup_iptables()
        iptables -N "$IPTABLES_CHAIN" 2>/dev/null
        iptables -F "$IPTABLES_CHAIN" 2>/dev/null
 
-       iptables -I output_rule -m state --state NEW -j "$IPTABLES_CHAIN"
-       iptables -I input_rule -m state --state NEW -j "$IPTABLES_CHAIN"
-       iptables -I forwarding_rule -m state --state NEW -j "$IPTABLES_CHAIN"
+       iptables -I output_rule -m conntrack --ctstate NEW -j "$IPTABLES_CHAIN"
+       iptables -I input_rule -m conntrack --ctstate NEW -j "$IPTABLES_CHAIN"
+       iptables -I forwarding_rule -m conntrack --ctstate NEW -j "$IPTABLES_CHAIN"
 
        # always accept DHCP traffic
        iptables -A "$IPTABLES_CHAIN" -p udp --dport 67:68 --sport 67:68 -j RETURN
@@ -90,9 +90,9 @@ destroy_ipset()
 
 destroy_iptables()
 {
-       iptables -D output_rule -m state --state NEW -j "$IPTABLES_CHAIN" 2>/dev/null
-       iptables -D input_rule -m state --state NEW -j "$IPTABLES_CHAIN" 2>/dev/null
-       iptables -D forwarding_rule -m state --state NEW -j "$IPTABLES_CHAIN" 2>/dev/null
+       iptables -D output_rule -m conntrack --ctstate NEW -j "$IPTABLES_CHAIN" 2>/dev/null
+       iptables -D input_rule -m conntrack --ctstate NEW -j "$IPTABLES_CHAIN" 2>/dev/null
+       iptables -D forwarding_rule -m conntrack --ctstate NEW -j "$IPTABLES_CHAIN" 2>/dev/null
        iptables -F "$IPTABLES_CHAIN" 2>/dev/null
        iptables -X "$IPTABLES_CHAIN" 2>/dev/null
 }
diff --git a/net/beanstalkd/Makefile b/net/beanstalkd/Makefile
new file mode 100644 (file)
index 0000000..db9d257
--- /dev/null
@@ -0,0 +1,50 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=beanstalkd
+PKG_VERSION:=1.9
+PKG_RELEASE:=1
+
+# for now, build from latest commit since releases are infrequent and
+# useful fixes trickle in...
+PKG_SOURCE_URL:=https://github.com/kr/beanstalkd.git
+PKG_SOURCE_VERSION:=b7b4a6a14b7e8d096dc8cbc255b23be17a228cbb
+
+PKG_SOURCE_PROTO:=git
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=6d5155ab347b731640495b1f0df6a4a849e84194d2ef0c2ec6af3879ee1aca2c
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-v$(PKG_VERSION)
+PKG_HASH:=6d5155ab347b731640495b1f0df6a4a849e84194d2ef0c2ec6af3879ee1aca2c
+
+PKG_MAINTAINER:=Philip Prindeville <philipp@redfish-solutions.com>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/beanstalkd
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Beanstalk
+endef
+
+define Package/beanstalkd/description
+ Beanstalk is a simple, fast work queue.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+       cd $(PKG_BUILD_DIR) && make CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" PREFIX=/usr
+endef
+
+define Package/beanstalkd/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/beanstalkd $(1)/usr/bin/beanstalkd
+
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/beanstalkd.init $(1)/etc/init.d/beanstalkd
+endef
+
+$(eval $(call BuildPackage,beanstalkd))
diff --git a/net/beanstalkd/files/beanstalkd.init b/net/beanstalkd/files/beanstalkd.init
new file mode 100644 (file)
index 0000000..992076d
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh /etc/rc.common
+# Beanstalk
+START=21
+STOP=11
+
+USE_PROCD=1
+PROG=/usr/bin/beanstalkd
+start_service() {
+    procd_open_instance
+    procd_set_param command $PROG
+    procd_close_instance
+}
diff --git a/net/beanstalkd/patches/900-makefile.patch b/net/beanstalkd/patches/900-makefile.patch
new file mode 100644 (file)
index 0000000..f948851
--- /dev/null
@@ -0,0 +1,116 @@
+diff --git a/Makefile b/Makefile
+index a3f345f..fe5a083 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,17 +1,16 @@
+-PREFIX=/usr/local
+-BINDIR=$(DESTDIR)$(PREFIX)/bin
+-CFLAGS=-Wall -Werror\
+-      -Wformat=2\
+-      -g\
+-
+-LDFLAGS=
+-OS=$(shell uname|tr A-Z a-z)
+-INSTALL=install
+-
+-VERS=$(shell ./vers.sh)
+-TARG=beanstalkd
+-MOFILE=main.o
+-OFILES=\
++PREFIX ?= /usr/local
++BINDIR = $(DESTDIR)$(PREFIX)/bin
++CFLAGS += -Wall -Werror -Wformat=2 -g
++LDFLAGS += 
++LDLIBS ?= 
++
++OS ?= $(shell uname | tr 'A-Z' 'a-z')
++INSTALL ?= install
++
++VERS = $(shell ./vers.sh)
++TARG = beanstalkd
++MOFILE = main.o
++OFILES = \
+       $(OS).o\
+       conn.o\
+       file.o\
+@@ -29,52 +28,44 @@ OFILES=\
+       vers.o\
+       walg.o\
+-TOFILES=\
++TOFILES = \
+       testheap.o\
+       testjobs.o\
+       testserv.o\
+       testutil.o\
+-HFILES=\
++HFILES = \
+       dat.h\
+       sd-daemon.h\
+ ifeq ($(OS),linux)
+-
+-LDLIBS=\
+-      -lrt\
+-
++   LDLIBS += -lrt
+ endif
+-CLEANFILES=\
++CLEANFILES = \
+       vers.c\
+-.PHONY: all
+ all: $(TARG)
+ $(TARG): $(OFILES) $(MOFILE)
+       $(LINK.o) -o $@ $^ $(LDLIBS)
+-.PHONY: install
+ install: $(BINDIR)/$(TARG)
+ $(BINDIR)/%: %
+       $(INSTALL) -d $(dir $@)
+       $(INSTALL) $< $@
+-CLEANFILES:=$(CLEANFILES) $(TARG)
++CLEANFILES := $(CLEANFILES) $(TARG)
+ $(OFILES) $(MOFILE): $(HFILES)
+-.PHONY: clean
+ clean:
+       rm -f *.o $(CLEANFILES)
+-.PHONY: check
+ check: ct/_ctcheck
+       ct/_ctcheck
+-.PHONY: bench
+ bench: ct/_ctcheck
+       ct/_ctcheck -b
+@@ -88,11 +79,8 @@ ct/ct.o ct/_ctcheck.o: ct/ct.h ct/internal.h
+ $(TOFILES): $(HFILES) ct/ct.h
+-CLEANFILES:=$(CLEANFILES) ct/_* ct/*.o
++CLEANFILES += ct/_* ct/*.o
+-ifneq ($(shell ./verc.sh),$(shell cat vers.c 2>/dev/null))
+-.PHONY: vers.c
+-endif
+ vers.c:
+       ./verc.sh >vers.c
+@@ -100,3 +88,9 @@ doc/beanstalkd.1 doc/beanstalkd.1.html: doc/beanstalkd.ronn
+       ronn $<
+ freebsd.o: darwin.c
++
++.PHONY: all install clean check bench
++
++ifneq ($(shell ./verc.sh),$(shell cat vers.c 2>/dev/null))
++.PHONY: vers.c
++endif
diff --git a/net/beanstalkd/patches/901-fix-headers.patch b/net/beanstalkd/patches/901-fix-headers.patch
new file mode 100644 (file)
index 0000000..ba6de6d
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/sd-daemon.c      2017-02-16 18:50:20.000000000 -0700
++++ b/sd-daemon.c      2017-02-16 19:21:09.086008361 -0700
+@@ -32,7 +32,7 @@
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <netinet/in.h>
+ #include <stdlib.h>
+ #include <errno.h>
diff --git a/net/beanstalkd/patches/902-replace-posix_fallocate.patch b/net/beanstalkd/patches/902-replace-posix_fallocate.patch
new file mode 100644 (file)
index 0000000..18b07c1
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/linux.c
++++ b/linux.c
+@@ -1,4 +1,6 @@
+ #define _XOPEN_SOURCE 600
++#include <unistd.h>
++#include <sys/types.h>
+ #include <stdint.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
+@@ -19,7 +19,7 @@ static int epfd;
+ int
+ rawfalloc(int fd, int len)
+ {
+-    return posix_fallocate(fd, 0, len);
++    return ftruncate(fd, len);
+ }
index 04d6bdc1b15d055a08c84a2a9f475a6b8374093e..ed3734642d7a8bf2ff77064154f70f4e53382183 100644 (file)
@@ -14,4 +14,24 @@ config BIND_ENABLE_FILTER_AAAA
                Additional details are available at
                https://kb.isc.org/article/AA-00576/0/Filter-AAAA-option-in-BIND-9-.html
 
+config BIND_LIBJSON
+       bool
+       default n
+       prompt "Include libjson support in bind-server"
+       help
+               BIND 9 supports reporting statistics about usage. libjson
+               is required to report server statistics in JSON format. 
+               Building with libjson support will require the libjson-c
+               package to be installed as well.
+
+config BIND_LIBXML2
+       bool
+       default n
+       prompt "Include libxml2 support in bind-server"
+       help
+               BIND 9 supports reporting statistics about usage. 
+               libxml2 is required to report server statistics in XML
+               format. Building with libjson support will require the
+               libxml2 package to be installed as well.
+
 endif
index a4a8b851065ff9a50dceb1acf27e87564ee9dcd6..1005eae3acea41415f74b110ad8c71434205a95e 100644 (file)
@@ -9,7 +9,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bind
-PKG_VERSION:=9.10.4-P5
+PKG_VERSION:=9.11.2-P1
 PKG_RELEASE:=1
 USERID:=bind=57:bind=57
 
@@ -18,9 +18,9 @@ PKG_LICENSE := BSD-3-Clause
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= \
-       ftp://ftp.isc.org/isc/bind9/$(PKG_VERSION) \
-       http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION)
-PKG_MD5SUM:=c53a3e34e7aabb16820b036ae9afd3c9
+       http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) \
+       http://ftp.isc.org/isc/bind9/$(PKG_VERSION)
+PKG_HASH:=cec31548832fca3f85d95178d4019b7d702039e8595d4c93914feba337df1212
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
@@ -29,15 +29,23 @@ PKG_INSTALL:=1
 PKG_USE_MIPS16:=0
 
 PKG_CONFIG_DEPENDS := \
-       CONFIG_OPENSSL_WITH_EC \
-       CONFIG_BIND_ENABLE_FILTER_AAAA
+       CONFIG_BIND_ENABLE_FILTER_AAAA \
+       CONFIG_BIND_LIBJSON \
+       CONFIG_BIND_LIBXML2
+
+ifdef CONFIG_BIND_LIBXML2
+  PKG_BUILD_DEPENDS += libxml2
+endif
+ifdef CONFIG_BIND_LIBJSON
+  PKG_BUILD_DEPENDS += libjson-c
+endif
 
 include $(INCLUDE_DIR)/package.mk
 
 define Package/bind/Default
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+bind-libs
+  DEPENDS:=+bind-libs +@OPENSSL_WITH_EC
   TITLE:=bind
   URL:=https://www.isc.org/software/bind
   SUBMENU:=IP Addresses and Names
@@ -46,14 +54,21 @@ endef
 define Package/bind-libs
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+libopenssl
+  DEPENDS:=+libopenssl +zlib
   TITLE:=bind shared libraries
   URL:=https://www.isc.org/software/bind
+ifdef CONFIG_BIND_LIBJSON
+  DEPENDS+= +libjson-c
+endif
+ifdef CONFIG_BIND_LIBXML2
+  DEPENDS+= +libxml2
+endif
 endef
 
 define Package/bind-server
   $(call Package/bind/Default)
   TITLE+= DNS server
+  DEPENDS+= +@OPENSSL_WITH_DEPRECATED
 endef
 
 define Package/bind-server/config
@@ -82,7 +97,7 @@ endef
 
 define Package/bind-dnssec
   $(call Package/bind/Default)
-  TITLE+= administration tools (dnssec-keygen and dnssec-signzone only)
+  TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
 endef
 
 define Package/bind-host
@@ -104,9 +119,8 @@ CONFIGURE_ARGS += \
        --disable-threads \
        --disable-linux-caps \
        --with-openssl="$(STAGING_DIR)/usr" \
-       --with-libjson=no \
        --with-libtool \
-       --with-libxml2=no \
+       --without-lmdb \
        --enable-epoll=yes \
        --with-gost=no \
        --with-gssapi=no \
@@ -119,6 +133,22 @@ ifdef CONFIG_BIND_ENABLE_FILTER_AAAA
                --enable-filter-aaaa
 endif
 
+ifdef CONFIG_BIND_LIBJSON
+       CONFIGURE_ARGS += \
+               --with-libjson="$(STAGING_DIR)/usr"
+else
+       CONFIGURE_ARGS += \
+               --with-libjson=no
+endif
+
+ifdef CONFIG_BIND_LIBXML2
+       CONFIGURE_ARGS += \
+               --with-libxml2="$(STAGING_DIR)/usr"
+else
+       CONFIGURE_ARGS += \
+               --with-libxml2=no
+endif
+
 CONFIGURE_VARS += \
        BUILD_CC="$(TARGET_CC)" \
 
@@ -174,6 +204,7 @@ define Package/bind-tools/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
@@ -196,6 +227,7 @@ endef
 define Package/bind-dnssec/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
 endef
 
index 321924b0c1f84604a475147d10e8ae338e2b3aad..2d0c152f7d8dd540ae2e8df9b79a47938f38ba78 100644 (file)
@@ -2,20 +2,20 @@ Index: bind-9.10.4-P3/bin/Makefile.in
 ===================================================================
 --- bind-9.10.4-P3.orig/bin/Makefile.in
 +++ bind-9.10.4-P3/bin/Makefile.in
-@@ -19,7 +19,7 @@ srcdir =     @srcdir@
+@@ -10,7 +10,7 @@ srcdir =     @srcdir@
  VPATH =               @srcdir@
  top_srcdir =  @top_srcdir@
  
 -SUBDIRS =     named rndc dig delv dnssec tools tests nsupdate \
 +SUBDIRS =     named rndc dig delv dnssec tools nsupdate \
-               check confgen @PYTHON_TOOLS@ @PKCS11_TOOLS@
+               check confgen @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@
  TARGETS =
  
 Index: bind-9.10.4-P3/lib/Makefile.in
 ===================================================================
 --- bind-9.10.4-P3.orig/lib/Makefile.in
 +++ bind-9.10.4-P3/lib/Makefile.in
-@@ -23,7 +23,7 @@ top_srcdir = @top_srcdir@
+@@ -14,7 +14,7 @@ top_srcdir = @top_srcdir@
  # Attempt to disable parallel processing.
  .NOTPARALLEL:
  .NO_PARALLEL:
index c3602603458058d2432c61eb8c90c40465ec43f6..878554fae1144104338ce63f5bb61c27ad123bab 100644 (file)
@@ -2,7 +2,7 @@ Index: bind-9.10.4-P3/configure.in
 ===================================================================
 --- bind-9.10.4-P3.orig/configure.in
 +++ bind-9.10.4-P3/configure.in
-@@ -167,26 +167,11 @@ esac
+@@ -157,26 +157,11 @@ esac
  #
  AC_CONFIG_FILES([make/rules make/includes])
  
diff --git a/net/bitlbee/Makefile b/net/bitlbee/Makefile
new file mode 100644 (file)
index 0000000..91d5fcf
--- /dev/null
@@ -0,0 +1,68 @@
+#
+# Copyright (C) 2016 Nikil Mehta <nikil.mehta@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bitlbee
+PKG_VERSION:=3.5.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://get.bitlbee.org/src/ \
+                       http://distcache.FreeBSD.org/local-distfiles/brix/
+PKG_HASH:=9636d7fd89ebb3756c13a9a3387736ca6d56ccf66ec0580d512f07b21db0fa69
+
+PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/bitlbee
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Instant Messaging
+  TITLE:=An IRC to other chat networks gateway
+  URL:=http://www.bitlbee.org/
+  DEPENDS:=+glib2 +libopenssl $(ICONV_DEPENDS) $(INTL_DEPENDS)
+endef
+
+define Package/bitlbee/description
+       This program can be used as an IRC server which forwards everything you
+       say to people on other chat networks: Jabber (which includes Google Talk
+       and Facebook Chat), ICQ, AIM, MSN, Yahoo! and Twitter/Identica/Status.net.
+endef
+
+define Package/bitlbee/conffiles
+/etc/bitlbee/bitlbee.conf
+/etc/bitlbee/motd.txt
+endef
+
+CONFIGURE_ARGS = \
+       --target=$(GNU_TARGET_NAME) \
+       --host=$(GNU_TARGET_NAME) \
+       --build=$(GNU_HOST_NAME) \
+       --prefix=$(CONFIGURE_PREFIX) \
+       --etcdir=/etc/bitlbee \
+       --ssl=openssl \
+       --msn=0
+
+define Build/Install
+       $(call Build/Install/Default,install install-etc)
+endef
+
+define Package/bitlbee/install 
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bitlbee $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/bitlbee
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/bitlbee/{bitlbee.conf,motd.txt} $(1)/etc/bitlbee
+endef
+
+$(eval $(call BuildPackage,bitlbee))
index a8c08fb2d41aa62d32ecb572e2539fd98a9578be..d8246152db3fe4c076aa2e423a6c82ca7574d870 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/tgraf/bmon/releases/download/v$(PKG_VERSION)/
-PKG_MD5SUM:=02fdc312b8ceeb5786b28bf905f54328f414040ff42f45c83007f24b76cc9f7a
+PKG_HASH:=02fdc312b8ceeb5786b28bf905f54328f414040ff42f45c83007f24b76cc9f7a
 PKG_MAINTAINER:=Baptiste Jonglez <openwrt-pkg@bitsofnetworks.org>
 PKG_LICENSE:=MIT
 
index 0075c0edb3a1adfa3849c3ca651babcebd1b4277..00c63ea44d81cd84f70c8891884d91c640637c9a 100644 (file)
@@ -17,13 +17,12 @@ PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/shemminger/bridg
 PKG_SOURCE_VERSION:=v${PKG_VERSION}
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=ce568c41f60987ed972c53fb8dab92bf45052849c4992e8ae931c1eb505630b7
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
 PKG_FIXUP:=autoreconf
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-
 include $(INCLUDE_DIR)/package.mk
 
 define Package/bridge
index 21c896c173156587faba4afd6cf0c6e3310ad010..7ac2572512bd7f40dbe72b79e6c895994df7c3b0 100644 (file)
@@ -10,7 +10,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.gropp.org/bwm-ng
-PKG_MD5SUM:=ef0c7669508e95f56250ad4f8db98b7f
+PKG_HASH:=027cf3c960cd96fc9ffacdf7713df62d0fc55eeef4a1388289f8a62ae5e50df0
 PKG_MAINTAINER:=Julen Landa Alustiza <julen@zokormazo.info>
 PKG_LICENSE:=GPL2-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/net/bwm-ng/patches/001-Use-static-inline-instead-of-inline.patch b/net/bwm-ng/patches/001-Use-static-inline-instead-of-inline.patch
new file mode 100644 (file)
index 0000000..da9ae70
--- /dev/null
@@ -0,0 +1,286 @@
+From d5daf15c2098040b8b01753d3cdce8c1c79fc528 Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Fri, 10 Feb 2017 21:30:49 +0100
+Subject: [PATCH] Use `static inline` instead of `inline`
+
+`inline` by itself is not portably guaranteed to emit
+an external definition when needed in C99. The current
+code base implicitly relies on GNU89 inline semantics,
+which _always_ emit an external definition. More recent
+versions of GCC and Clang switch to C99/C11 inline semantics
+by default, which fails with undefined references.
+
+See also:
+* http://www.greenend.org.uk/rjk/tech/inline.html
+* https://clang.llvm.org/compatibility.html#inline
+* http://blahg.josefsipek.net/?p=529
+---
+ src/bwm-ng.c  |  4 ++--
+ src/help.c    |  4 ++--
+ src/options.c | 16 ++++++++--------
+ src/output.c  | 22 +++++++++++-----------
+ src/process.c | 28 ++++++++++++++--------------
+ 5 files changed, 37 insertions(+), 37 deletions(-)
+
+diff --git a/src/bwm-ng.c b/src/bwm-ng.c
+index ad94ccd..c2ab0db 100644
+--- a/src/bwm-ng.c
++++ b/src/bwm-ng.c
+@@ -26,7 +26,7 @@
+ /* handle interrupt signal */
+ void sigint(int sig) FUNCATTR_NORETURN;
+-inline void init(void);
++static inline void init(void);
+ /* clear stuff and exit */
+ #ifdef __STDC__
+@@ -98,7 +98,7 @@ void sigint(int sig) {
+       deinit(0, NULL);
+ }
+-inline void init(void) {
++static inline void init(void) {
+       if_count=0;
+       delay=500;
+ #if EXTENDED_STATS    
+diff --git a/src/help.c b/src/help.c
+index 7fd9ca4..4853297 100644
+--- a/src/help.c
++++ b/src/help.c
+@@ -24,9 +24,9 @@
+ #include "global_vars.h"
+ #include "help.h"
+-inline void print_help_line(const char *short_c,const char * long_c,const char *descr);
++static inline void print_help_line(const char *short_c,const char * long_c,const char *descr);
+-inline void print_help_line(const char *short_c,const char * long_c,const char *descr) {
++static inline void print_help_line(const char *short_c,const char * long_c,const char *descr) {
+ #ifdef LONG_OPTIONS
+     printf("  %-23s",long_c);
+ #else
+diff --git a/src/options.c b/src/options.c
+index 1b65eeb..30dccb4 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -30,12 +30,12 @@ static char* getToken(char** str, const char* delims);
+ char *trim_whitespace(char *str);
+ int read_config(const char *config_file);
+ #endif
+-inline int str2output_unit(char *optarg);
++static inline int str2output_unit(char *optarg);
+ #if EXTENDED_STATS
+-inline int str2output_type(char *optarg);
++static inline int str2output_type(char *optarg);
+ #endif
+-inline int str2out_method(char *optarg);
+-inline int str2in_method(char *optarg);
++static inline int str2out_method(char *optarg);
++static inline int str2in_method(char *optarg);
+ #ifdef CONFIG_FILE
+  /******************************************************************************
+@@ -65,7 +65,7 @@ static char* getToken(char** str, const char* delims) {
+ /******************************************************************************/
+ #endif
+-inline int str2output_unit(char *optarg) {
++static inline int str2output_unit(char *optarg) {
+     if (optarg) {
+         if (!strcasecmp(optarg,"bytes")) return BYTES_OUT;
+         if (!strcasecmp(optarg,"bits")) return BITS_OUT;
+@@ -76,7 +76,7 @@ inline int str2output_unit(char *optarg) {
+ }
+ #if EXTENDED_STATS
+-inline int str2output_type(char *optarg) {
++static inline int str2output_type(char *optarg) {
+     if (optarg) {
+         if (!strcasecmp(optarg,"rate")) return RATE_OUT;
+         if (!strcasecmp(optarg,"max")) return MAX_OUT;
+@@ -87,7 +87,7 @@ inline int str2output_type(char *optarg) {
+ }
+ #endif  
+-inline int str2out_method(char *optarg) {
++static inline int str2out_method(char *optarg) {
+     if (optarg) {
+         if (!strcasecmp(optarg,"plain")) return PLAIN_OUT;
+ #ifdef HAVE_CURSES
+@@ -109,7 +109,7 @@ inline int str2out_method(char *optarg) {
+ }
+-inline int str2in_method(char *optarg) {
++static inline int str2in_method(char *optarg) {
+     if (optarg) {
+ #ifdef PROC_NET_DEV
+         if (!strcasecmp(optarg,"proc")) return PROC_IN;
+diff --git a/src/output.c b/src/output.c
+index 653e444..1425b3c 100644
+--- a/src/output.c
++++ b/src/output.c
+@@ -25,13 +25,13 @@
+ #include "output.h"
+ inline static const char *output_type2str(void);
+-inline const char *input2str(void);
+-inline const char *show_all_if2str(void);
+-inline ullong direction2value(char mode,struct inout_long stats);
++static inline const char *input2str(void);
++static inline const char *show_all_if2str(void);
++static inline ullong direction2value(char mode,struct inout_long stats);
+ #if EXTENDED_STATS
+-inline double direction_max2value(char mode,struct inouttotal_double stats,int items);
++static inline double direction_max2value(char mode,struct inouttotal_double stats,int items);
+ #endif
+-inline char *dyn_byte_value2str(double value,char *str,int buf_size);
++static inline char *dyn_byte_value2str(double value,char *str,int buf_size);
+ char *values2str(char mode,t_iface_speed_stats stats,t_iface_stats full_stats,float multiplier,char *str,int buf_size);
+ inline static const char *output_type2str(void) {
+@@ -59,7 +59,7 @@ inline static const char *output_type2str(void) {
+ }
+-inline const char *input2str(void) {
++static inline const char *input2str(void) {
+     switch (input_method) {
+ #ifdef SYSCTL
+         case SYSCTL_IN:
+@@ -121,7 +121,7 @@ inline const char *input2str(void) {
+     return "";
+ }
+-inline const char *show_all_if2str(void) {
++static inline const char *show_all_if2str(void) {
+     switch (show_all_if) {
+         case 1:
+                               return " (all)";
+@@ -262,7 +262,7 @@ int print_header(int option) {
+ }
+-inline ullong direction2value(char mode,struct inout_long stats) {
++static inline ullong direction2value(char mode,struct inout_long stats) {
+     switch (mode) {
+         case 0:
+             return stats.in;
+@@ -275,7 +275,7 @@ inline ullong direction2value(char mode,struct inout_long stats) {
+ }
+ #if EXTENDED_STATS
+-inline double direction_max2value(char mode,struct inouttotal_double stats,int items) {
++static inline double direction_max2value(char mode,struct inouttotal_double stats,int items) {
+     switch (mode) {
+         case 0:
+             return (double)(stats.in/items);
+@@ -288,7 +288,7 @@ inline double direction_max2value(char mode,struct inouttotal_double stats,int i
+ }
+ #endif
+-inline char *dyn_byte_value2str(double value,char *str,int buf_size) {
++static inline char *dyn_byte_value2str(double value,char *str,int buf_size) {
+     if (dynamic) {
+         if (value<1024)
+             snprintf(str,buf_size,"%15.2f  ",value);
+@@ -306,7 +306,7 @@ inline char *dyn_byte_value2str(double value,char *str,int buf_size) {
+     return str;
+ }
+-inline char *dyn_bit_value2str(double value,char *str,int buf_size) {
++static inline char *dyn_bit_value2str(double value,char *str,int buf_size) {
+     if (dynamic) {
+         if (value<1000)
+             snprintf(str,buf_size,"%15.2f  ",value);
+diff --git a/src/process.c b/src/process.c
+index 59eccf0..d06c6dd 100644
+--- a/src/process.c
++++ b/src/process.c
+@@ -26,19 +26,19 @@
+ short show_iface(char *instr, char *searchstr,char iface_is_up);
+ #if HAVE_GETTIMEOFDAY
+-inline long tvdiff(struct timeval newer, struct timeval older);
++static inline long tvdiff(struct timeval newer, struct timeval older);
+ float get_time_delay(int iface_num);
+ #endif
+-inline ullong calc_new_values(ullong new, ullong old);
++static inline ullong calc_new_values(ullong new, ullong old);
+ t_iface_speed_stats convert2calced_values(t_iface_speed_stats new, t_iface_speed_stats old);
+ t_iface_speed_stats convert2calced_disk_values(t_iface_speed_stats new, t_iface_speed_stats old);
+ #if EXTENDED_STATS
+-inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data);
+-inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data);
+-inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier);
++static inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data);
++static inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data);
++static inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier);
+ void save_avg(struct t_avg *avg,struct iface_speed_stats calced_stats,float multiplier);
+-inline void save_sum(struct inout_long *stats,struct inout_long new_stats_values);
+-inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier);
++static inline void save_sum(struct inout_long *stats,struct inout_long new_stats_values);
++static inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier);
+ #endif
+ /* returns the whether to show the iface or not
+@@ -74,7 +74,7 @@ short show_iface(char *instr, char *searchstr,char iface_is_up) {
+ #if HAVE_GETTIMEOFDAY
+ /* Returns: the time difference in milliseconds. */
+-inline long tvdiff(struct timeval newer, struct timeval older) {
++static inline long tvdiff(struct timeval newer, struct timeval older) {
+   return labs((newer.tv_sec-older.tv_sec)*1000+
+     (newer.tv_usec-older.tv_usec)/1000);
+ }
+@@ -95,7 +95,7 @@ float get_time_delay(int iface_num) {
+ #endif
+ /* basically new-old, but handles "overflow" of source aswell */
+-inline ullong calc_new_values(ullong new, ullong old) {
++static inline ullong calc_new_values(ullong new, ullong old) {
+     /* FIXME: WRAP_AROUND _might_ be wrong for libstatgrab, where the type is always long long */
+     return (new>=old) ? (ullong)(new-old) : (ullong)((
+ #ifdef HAVE_LIBKSTAT
+@@ -136,13 +136,13 @@ t_iface_speed_stats convert2calced_disk_values(t_iface_speed_stats new, t_iface_
+ #if EXTENDED_STATS
+ /* sub old values from cached for avg stats */
+-inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data) {
++static inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data) {
+     values->in-=data.in;
+     values->out-=data.out;
+     values->total-=data.total;
+ }
+-inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data) {
++static inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data) {
+     values->in+=data.in;
+     values->out+=data.out;
+     values->total+=data.total;
+@@ -151,7 +151,7 @@ inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_do
+ /* put new-old bytes in inout_long struct into a inouttotal_double struct 
+  * and add values to cached .value struct */
+-inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier) {
++static inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier) {
+     data->in=calced_stats.in*multiplier;
+     data->out=calced_stats.out*multiplier;
+     data->total=(calced_stats.in+calced_stats.out)*multiplier;
+@@ -201,13 +201,13 @@ void save_avg(struct t_avg *avg,struct iface_speed_stats calced_stats,float mult
+ }
+ /* add current in and out bytes to totals struct */
+-inline void save_sum(struct inout_long *stats,struct inout_long new_stats_values) {
++static inline void save_sum(struct inout_long *stats,struct inout_long new_stats_values) {
+     stats->in+=new_stats_values.in;
+     stats->out+=new_stats_values.out;
+ }
+ /* lookup old max values and save new if higher */
+-inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier) {
++static inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier) {
+     if (multiplier*calced_stats.in > stats->in)
+         stats->in=multiplier*calced_stats.in;
+     if (multiplier*calced_stats.out>stats->out)
index c36231a12d4cad3a34fc9fdeeedbe965f31eb5a7..cda049463bfa8203192f9b1602a64102cc6bdd9a 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cgi-io
-PKG_RELEASE:=1
+PKG_RELEASE:=5
 
 PKG_LICENSE:=GPL-2.0+
 
index 8a4ca192c5ad28b361ae7dfdaf98dc15cde8bfee..6d8b1585a8b2a26c04839b5679038a9e96f59819 100644 (file)
@@ -4,6 +4,9 @@ PROJECT(cgi-io C)
 
 INCLUDE(CheckFunctionExists)
 
+FIND_PATH(ubus_include_dir libubus.h)
+INCLUDE_DIRECTORIES(${ubus_include_dir})
+
 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
 
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
index 69df2d66a4996eeb4b7f7db3c20f85b0e4f818c8..2bfec623b00d84b37defb4bccfcc08ff95008924 100644 (file)
@@ -117,11 +117,11 @@ out:
 }
 
 static char *
-md5sum(const char *file)
+checksum(const char *applet, size_t sumlen, const char *file)
 {
        pid_t pid;
        int fds[2];
-       static char md5[33];
+       static char chksum[65];
 
        if (pipe(fds))
                return NULL;
@@ -141,20 +141,20 @@ md5sum(const char *file)
                close(fds[0]);
                close(fds[1]);
 
-               if (execl("/bin/busybox", "/bin/busybox", "md5sum", file, NULL));
+               if (execl("/bin/busybox", "/bin/busybox", applet, file, NULL))
                        return NULL;
 
                break;
 
        default:
-               memset(md5, 0, sizeof(md5));
-               read(fds[0], md5, 32);
+               memset(chksum, 0, sizeof(chksum));
+               read(fds[0], chksum, sumlen);
                waitpid(pid, NULL, 0);
                close(fds[0]);
                close(fds[1]);
        }
 
-       return md5;
+       return chksum;
 }
 
 static char *
@@ -266,7 +266,7 @@ postdecode(char **fields, int n_fields)
 static int
 response(bool success, const char *message)
 {
-       char *md5;
+       char *chksum;
        struct stat s;
 
        printf("Status: 200 OK\r\n");
@@ -274,9 +274,22 @@ response(bool success, const char *message)
 
        if (success)
        {
-               if (!stat(st.filename, &s) && (md5 = md5sum(st.filename)) != NULL)
-                       printf("\t\"size\": %u,\n\t\"checksum\": \"%s\"\n",
-                                  (unsigned int)s.st_size, md5);
+               if (!stat(st.filename, &s))
+                       printf("\t\"size\": %u,\n", (unsigned int)s.st_size);
+               else
+                       printf("\t\"size\": null,\n");
+
+               chksum = checksum("md5sum", 32, st.filename);
+               printf("\t\"checksum\": %s%s%s,\n",
+                       chksum ? "\"" : "",
+                       chksum ? chksum : "null",
+                       chksum ? "\"" : "");
+
+               chksum = checksum("sha256sum", 64, st.filename);
+               printf("\t\"sha256sum\": %s%s%s\n",
+                       chksum ? "\"" : "",
+                       chksum ? chksum : "null",
+                       chksum ? "\"" : "");
        }
        else
        {
@@ -577,6 +590,7 @@ main_backup(int argc, char **argv)
        pid_t pid;
        time_t now;
        int len;
+       int status;
        int fds[2];
        char buf[4096];
        char datestr[16] = { 0 };
@@ -610,6 +624,7 @@ main_backup(int argc, char **argv)
                return -1;
 
        default:
+               fcntl(fds[0], F_SETFL, fcntl(fds[0], F_GETFL) | O_NONBLOCK);
                now = time(NULL);
                strftime(datestr, sizeof(datestr) - 1, "%Y-%m-%d", localtime(&now));
 
@@ -621,10 +636,15 @@ main_backup(int argc, char **argv)
                printf("Content-Disposition: attachment; "
                       "filename=\"backup-%s-%s.tar.gz\"\r\n\r\n", hostname, datestr);
 
-               while ((len = read(fds[0], buf, sizeof(buf))) > 0)
-                       fwrite(buf, len, 1, stdout);
+               do {
+                       waitpid(pid, &status, 0);
 
-               waitpid(pid, NULL, 0);
+                       while ((len = read(fds[0], buf, sizeof(buf))) > 0) {
+                               fwrite(buf, len, 1, stdout);
+                               fflush(stdout);
+                       }
+
+               } while (!WIFEXITED(status));
 
                close(fds[0]);
                close(fds[1]);
index f36c8d5f2c4bdbd143fd372df4493473ab6bdd53..9035ade8f303f93f90b6d2ad0699618d24b8b0c9 100644 (file)
@@ -17,6 +17,7 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/ryd/chaosvpn.git
 PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_MIRROR_HASH:=da987a95cb33af730c2b08ceec3af29a61e523625479c7e8b978fad881abbb53
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_LICENSE:=Apache-2.0
 PKG_MAINTAINER:=Norbert Summer <git@o-g.at>
index 4e1cb12a4af9bba58c459315157841d62915b568..d4f0dc6470cfb9318ae0614c21c16411770115b2 100644 (file)
@@ -8,18 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=chrony
-PKG_VERSION:=2.4.1
-PKG_RELEASE:=2
+PKG_VERSION:=3.2
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://download.tuxfamily.org/chrony/
-PKG_MD5SUM:=d08dd5a7d79a89891d119adcccb4397d
+PKG_HASH:=329f6718dd8c3ece3eee78be1f4821cbbeb62608e7d23f25da293cfa433c4116
 
 PKG_MAINTAINER:=Miroslav Lichvar <mlichvar0@gmail.com>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
-PKG_BUILD_DEPENDS:=+pps-tools
+PKG_BUILD_DEPENDS:=pps-tools
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -50,7 +50,7 @@ CONFIGURE_ARGS+= \
        --host-system=Linux \
        --sysconfdir=/etc/chrony \
        --prefix=/usr \
-       --chronysockdir=/var/run/chrony \
+       --chronyrundir=/var/run/chrony \
        --disable-readline \
        --disable-rtc \
        --with-user=chrony
index b207c945e2d168d856a04248370ce7e71d5ccd35..410e63b948a187288a0fb0324a03294636d05567 100644 (file)
@@ -5,3 +5,6 @@ logchange 0.5
 
 # Don't log client accesses
 noclientlog
+
+# set the system clock else the kernel will always stay in UNSYNC state
+rtcsync
index e18d07e923ca1bb3caf6239dca5fedb426c18d83..7a3dd826969a2d35d4442fde6cb181af0a0e1f6e 100644 (file)
@@ -1,9 +1,9 @@
 diff --git a/sysincl.h b/sysincl.h
-index 30e9b48..8fe16c0 100644
+index a9e4da0..e2a6e78 100644
 --- a/sysincl.h
 +++ b/sysincl.h
-@@ -70,4 +70,8 @@
- #include <arpa/inet.h>
+@@ -80,4 +80,8 @@
+ #include <sys/random.h>
  #endif
  
 +#if defined(LINUX) && !defined(IP_FREEBIND)
index 3d67e94d74f3b860294ebdff3716b4df95446e4f..db7ba3f266454e4e2782904abbe4496dc54a3d8b 100644 (file)
@@ -8,23 +8,25 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cifs-utils
-PKG_VERSION:=6.4
-PKG_RELEASE:=2
+PKG_VERSION:=6.7
+PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=https://download.samba.org/pub/linux-cifs/cifs-utils/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=b7d75b67fd3987952896d27256c7293d
+PKG_HASH:=b2f21612474ab012e75accd167aab607a0614ff67efb56ea0f36789fa785cfab
 
 PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
 
+PKG_FIXUP:=libtool
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/cifsmount
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+kmod-fs-cifs
+  DEPENDS:=+kmod-fs-cifs +libtalloc
   TITLE:=CIFS mount utilities
   URL:=http://wiki.samba.org/index.php/LinuxCIFS_utils
 endef
diff --git a/net/cifs-utils/patches/001-fix-musl-build.patch b/net/cifs-utils/patches/001-fix-musl-build.patch
deleted file mode 100644 (file)
index e34d4f1..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From 6603cef0f06c450196a1bca06bb143d8fcda5651 Mon Sep 17 00:00:00 2001
-From: Felix Janda <felix.janda@posteo.de>
-Date: Fri, 5 Dec 2014 23:19:29 +0100
-Subject: [PATCH 1/1] mtab.c: include <paths.h> for _PATH_MOUNTED
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Backported from: 6603cef0f06c450196a1bca06bb143d8fcda5651
-
-Signed-off-by: Felix Janda <felix.janda@posteo.de>
-Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
----
- mtab.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/mtab.c b/mtab.c
-index 7b365b3..a662a3c 100644
---- a/mtab.c
-+++ b/mtab.c
-@@ -38,6 +38,7 @@
- #include <mntent.h>
- #include <stdlib.h>
- #include <signal.h>
-+#include <paths.h>
- #include "mount.h"
- #include "config.h"
--- 
-2.5.0
diff --git a/net/cjdns/Makefile b/net/cjdns/Makefile
deleted file mode 100644 (file)
index 8efd282..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-#
-# 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))
diff --git a/net/cjdns/files/cjdns.defaults b/net/cjdns/files/cjdns.defaults
deleted file mode 100644 (file)
index f2baf6d..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/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
diff --git a/net/cjdns/files/cjdns.init b/net/cjdns/files/cjdns.init
deleted file mode 100755 (executable)
index b6371d7..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/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
-}
diff --git a/net/cjdns/files/cjdrouteconf b/net/cjdns/files/cjdrouteconf
deleted file mode 100755 (executable)
index fa5e073..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/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
diff --git a/net/cjdns/lua/cjdns/admin.lua b/net/cjdns/lua/cjdns/admin.lua
deleted file mode 100644 (file)
index 2bb58d2..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
--- 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
diff --git a/net/cjdns/lua/cjdns/common.lua b/net/cjdns/lua/cjdns/common.lua
deleted file mode 100644 (file)
index 45f7dad..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
--- 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 {}
diff --git a/net/cjdns/lua/cjdns/init.lua b/net/cjdns/lua/cjdns/init.lua
deleted file mode 100644 (file)
index 32abbfc..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
--- 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"
diff --git a/net/cjdns/lua/cjdns/uci.lua b/net/cjdns/lua/cjdns/uci.lua
deleted file mode 100644 (file)
index 0127f44..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
-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
diff --git a/net/cjdns/lua/cjdns/udp.lua b/net/cjdns/lua/cjdns/udp.lua
deleted file mode 100644 (file)
index 9dd5901..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
--- 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
diff --git a/net/clamav/Makefile b/net/clamav/Makefile
new file mode 100644 (file)
index 0000000..1059415
--- /dev/null
@@ -0,0 +1,125 @@
+#
+# 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:=clamav
+PKG_VERSION:=0.99.3
+PKG_RELEASE:=1
+
+PKG_LICENSE:=GPL-2.0
+PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr> \
+               Lucian Cristian <lucian.cristian@gmail.com>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://www.clamav.net/downloads/production/
+PKG_HASH:=00fa5292a6e00a3a4035b826267748965d5d2c4943d8ff417d740238263e8e84
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/uclibc++.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/clamav/Default
+  SECTION:=net
+  DEPENDS:=+libpthread +uclibcxx +zlib +libcurl +libopenssl +libltdl +libpcre2 +USE_MUSL:musl-fts
+  CATEGORY:=Network
+  SUBMENU:=Web Servers/Proxies
+  TITLE:=ClamAV
+  URL:=http://www.clamav.net/
+endef
+
+define Package/clamav
+    $(call Package/clamav/Default)
+endef
+
+define Package/freshclam
+    $(call Package/clamav/Default)
+    DEPENDS+= +clamav
+    TITLE+=database updater
+endef
+
+define Package/clamav/description
+ ClamAV is an open source antivirus engine for detecting trojans,
+ viruses, malware & other malicious threats.
+endef
+
+define Package/freshclam/description
+ Database updater for ClamAV
+endef
+
+define Package/clamav/conffiles
+endef
+
+CONFIGURE_VARS += \
+       INCLUDES="" \
+       CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \
+       $(if $(CONFIG_USE_MUSL),LIBS="-lpthread -lfts",LIBS="-lpthread") \
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               --sysconfdir=/etc/clamav/ \
+               --prefix=/usr/ \
+               --exec-prefix=/usr/ \
+               --disable-xml \
+               --disable-bzip2 \
+               --with-user nobody \
+               --with-group nogroup \
+               --with-pcre="$(STAGING_DIR)/usr/" \
+               --with-openssl="$(STAGING_DIR)/usr/" \
+               --with-zlib="$(STAGING_DIR)/usr/" \
+               --disable-zlib-vcheck \
+               --disable-clamdtop \
+       )
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all install
+endef
+
+define Package/clamav/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamd $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamav-config $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clambc $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamconf $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamdscan $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamscan $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sigtool $(1)/usr/sbin/
+
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/clamav.h $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib*/* $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/clamav.config $(1)/etc/config/clamav
+
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_BIN) ./files/clamav.init $(1)/etc/init.d/clamav
+
+       $(INSTALL_DIR) $(1)/usr/share/clamav
+       $(CP) ./files/bytecode.cvd $(1)/usr/share/clamav/
+endef
+
+define Package/freshclam/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/freshclam $(1)/usr/sbin/
+
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/freshclam.config $(1)/etc/config/freshclam
+
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_BIN) ./files/freshclam.init $(1)/etc/init.d/freshclam
+endef
+
+$(eval $(call BuildPackage,clamav))
+$(eval $(call BuildPackage,freshclam))
diff --git a/net/clamav/files/bytecode.cvd b/net/clamav/files/bytecode.cvd
new file mode 100644 (file)
index 0000000..07ff8ab
Binary files /dev/null and b/net/clamav/files/bytecode.cvd differ
diff --git a/net/clamav/files/clamav.config b/net/clamav/files/clamav.config
new file mode 100644 (file)
index 0000000..26d941e
--- /dev/null
@@ -0,0 +1,35 @@
+config clamav 'clamav'
+       option clamd_config_file '/etc/clamav/clamd.conf'
+       option LogFile '/tmp/clamd.log'
+       option LogFileMaxSize '1M'
+       option LogTime 'no'
+       option LogVerbose 'no'
+       option ExtendedDetectionInfo 'no'
+       option OfficialDatabaseOnly 'no'
+       option StreamMinPort '1024'
+       option StreamMaxPort '2048'
+       option MaxThreads '10'
+       option ReadTimeout '30'
+       option CommandReadTimeout '5'
+       option MaxDirectoryRecursion '15'
+       option FollowDirectorySymlinks 'no'
+       option FollowFileSymlinks 'no'
+       option SelfCheck '600'
+       option DetectPUA 'yes'
+       option ScanPE 'yes'
+       option DisableCertCheck 'no'
+       option ScanELF 'yes'
+       option DetectBrokenExecutables 'no'
+       option ScanOLE2 'yes'
+       option ScanPDF 'yes'
+       option ScanSWF 'yes'
+       option ScanMail 'yes'
+       option ScanPartialMessages 'no'
+       option ScanArchive 'yes'
+       option ArchiveBlockEncrypted 'yes'
+       option MaxFileSize '10M'
+       option TemporaryDirectory '/tmp'
+       option LocalSocket '/var/run/clamav/clamd.sock'
+       option User 'nobody'
+       option ExitOnOOM 'yes'
+       option DatabaseDirectory '/usr/share/clamav'
diff --git a/net/clamav/files/clamav.init b/net/clamav/files/clamav.init
new file mode 100644 (file)
index 0000000..a02468e
--- /dev/null
@@ -0,0 +1,119 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+START=90
+STOP=10
+
+USE_PROCD=1
+PROG=/usr/sbin/clamd
+CLAMD_CONFIGFILE="/tmp/clamav/clamd.conf"
+
+validate_clamav_section() {
+       uci_validate_section clamav clamav "${1}" \
+               'clamd_config_file:string' \
+               'LogFile:string' \
+               'LogFileMaxSize:string' \
+               'LogVerbose:string' \
+               'ExtendedDetectionInfo:string' \
+               'LogTime:string' \
+               'OfficialDatabaseOnly:string' \
+               'StreamMinPort:uinteger' \
+               'StreamMaxPort:uinteger' \
+               'MaxThreads:uinteger' \
+               'ReadTimeout:uinteger' \
+               'CommandReadTimeout:uinteger' \
+               'MaxDirectoryRecursion:uinteger' \
+               'FollowDirectorySymlinks:string' \
+               'FollowFileSymlinks:string' \
+               'SelfCheck:uinteger' \
+               'DetectPUA:string' \
+               'ScanPE:string' \
+               'DisableCertCheck:string' \
+               'ScanELF:string' \
+               'DetectBrokenExecutables:string' \
+               'ScanOLE2:string' \
+               'ScanPDF:string' \
+               'ScanSWF:string' \
+               'ScanMail:string' \
+               'ScanPartialMessages:string' \
+               'ScanArchive:string' \
+               'TemporaryDirectory:string' \
+               'ArchiveBlockEncrypted:string' \
+               'MaxFileSize:string' \
+               'LocalSocket:string' \
+               'User:string' \
+               'ExitOnOOM:string' \
+               'DatabaseDirectory:string'
+}
+
+start_service() {
+       local clamd_config_file LogFile LogTime StreamMinPort \
+               StreamMaxPort MaxThreads ReadTimeout CommandReadTimeout MaxDirectoryRecursion \
+               FollowFileSymlinks FollowDirectorySymlinks SelfCheck DetectPUA ScanPE DisableCertCheck \
+               ScanELF DetectBrokenExecutables ScanOLE2 ScanPDF ScanSWF ScanMail ScanPartialMessages \
+               ScanArchive TemporaryDirectory ArchiveBlockEncrypted MaxFileSize LocalSocket User \
+               DatabaseDirectory
+
+       validate_clamav_section clamav || {
+               echo "validation failed"
+               return 1
+       }
+
+       mkdir -p $DatabaseDirectory
+       mkdir -p /etc/clamav/
+       mkdir -p /var/run/clamav/
+       chmod a+rw /var/run/clamav
+
+       mkdir -p $(dirname $CLAMD_CONFIGFILE)
+       ln -sf $clamd_config_file $CLAMD_CONFIGFILE
+
+       echo "LogFile " $LogFile > $CLAMD_CONFIGFILE
+       echo "LogFileMaxSize " $LogFileMaxSize >> $CLAMD_CONFIGFILE
+       echo "LogVerbose " $LogVerbose >> $CLAMD_CONFIGFILE
+       echo "ExtendedDetectionInfo " $ExtendedDetectionInfo >> $CLAMD_CONFIGFILE
+       echo "LogTime " $LogTime >> $CLAMD_CONFIGFILE
+       echo "OfficialDatabaseOnly " $OfficialDatabaseOnly >> $CLAMD_CONFIGFILE
+       echo "StreamMinPort " $StreamMinPort >> $CLAMD_CONFIGFILE
+       echo "StreamMaxPort " $StreamMaxPort >> $CLAMD_CONFIGFILE
+       echo "MaxThreads " $MaxThreads >> $CLAMD_CONFIGFILE
+       echo "ReadTimeout " $ReadTimeout >> $CLAMD_CONFIGFILE
+       echo "CommandReadTimeout " $CommandReadTimeout >> $CLAMD_CONFIGFILE
+       echo "MaxDirectoryRecursion " $MaxDirectoryRecursion >> $CLAMD_CONFIGFILE
+       echo "FollowDirectorySymlinks " $FollowDirectorySymlinks >> $CLAMD_CONFIGFILE
+       echo "FollowFileSymlinks " $FollowFileSymlinks >> $CLAMD_CONFIGFILE
+       echo "SelfCheck " $SelfCheck >> $CLAMD_CONFIGFILE
+       echo "DetectPUA " $DetectPUA >> $CLAMD_CONFIGFILE
+       echo "ScanPE " $ScanPE >> $CLAMD_CONFIGFILE
+       echo "DisableCertCheck " $DisableCertCheck >> $CLAMD_CONFIGFILE
+       echo "ScanELF " $ScanELF >> $CLAMD_CONFIGFILE
+       echo "DetectBrokenExecutables " $DetectBrokenExecutables >> $CLAMD_CONFIGFILE
+       echo "ScanOLE2 " $ScanOLE2 >> $CLAMD_CONFIGFILE
+       echo "ScanPDF " $ScanPDF >> $CLAMD_CONFIGFILE
+       echo "ScanSWF " $ScanSWF >> $CLAMD_CONFIGFILE
+       echo "ScanMail " $ScanMail >> $CLAMD_CONFIGFILE
+       echo "ScanPartialMessages " $ScanPartialMessages >> $CLAMD_CONFIGFILE
+       echo "ScanArchive " $ScanArchive >> $CLAMD_CONFIGFILE
+       echo "TemporaryDirectory " $TemporaryDirectory >> $CLAMD_CONFIGFILE
+       echo "ArchiveBlockEncrypted " $ArchiveBlockEncrypted >> $CLAMD_CONFIGFILE
+       echo "MaxFileSize " $MaxFileSize >> $CLAMD_CONFIGFILE
+       echo "LocalSocket " $LocalSocket >> $CLAMD_CONFIGFILE
+       echo "User " $User >> $CLAMD_CONFIGFILE
+       echo "ExitOnOOM " $ExitOnOOM >> $CLAMD_CONFIGFILE
+       echo "DatabaseDirectory " $DatabaseDirectory >> $CLAMD_CONFIGFILE
+
+       procd_open_instance
+       procd_set_param command $PROG -c $CLAMD_CONFIGFILE
+       procd_set_param file $CLAMD_CONFIGFILE
+       procd_close_instance
+}
+
+stop_service()
+{
+       service_stop ${PROG}
+}
+
+service_triggers()
+{
+       procd_add_reload_trigger "clamav"
+       procd_add_validation validate_clamav_section
+}
diff --git a/net/clamav/files/freshclam.config b/net/clamav/files/freshclam.config
new file mode 100644 (file)
index 0000000..ccce09a
--- /dev/null
@@ -0,0 +1,8 @@
+config freshclam 'freshclam'
+       option freshclam_config_file '/etc/clamav/freshclam.conf'
+       option UpdateLogFile '/tmp/freshclam.log'
+       option DatabaseMirror 'database.clamav.net'
+       option NotifyClamd '/etc/clamav/clamd.conf'
+       option DatabaseOwner 'root'
+       option CompressLocalDatabase 'yes'
+       option DatabaseDirectory '/usr/share/clamav'
diff --git a/net/clamav/files/freshclam.init b/net/clamav/files/freshclam.init
new file mode 100644 (file)
index 0000000..9504b7f
--- /dev/null
@@ -0,0 +1,66 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+START=90
+STOP=10
+
+USE_PROCD=1
+PROG=/usr/sbin/freshclam
+FRESHCLAM_CONFIGFILE="/tmp/clamav/freshclam.conf"
+
+validate_freshclam_section() {
+       uci_validate_section freshclam freshclam "${1}" \
+               'freshclam_config_file:string' \
+               'UpdateLogFile:string' \
+               'DatabaseMirror:string' \
+               'NotifyClamd:string' \
+               'DatabaseOwner:string' \
+               'CompressLocalDatabase:string' \
+               'DatabaseDirectory:string:'
+}
+
+start_service() {
+       local freshclam_config_file UpdateLogFile DatabaseOwner NotifyClamd DatabaseMirror \
+       DatabaseDirectory
+
+       validate_freshclam_section freshclam || {
+               echo "validation failed"
+               return 1
+       }
+
+       [ -f /tmp/freshclam.pid ] && echo "already running" && return 0
+
+       mkdir -p $DatabaseDirectory
+       mkdir -p /etc/clamav
+       touch /tmp/freshclam.log
+       touch /tmp/freshclam.pid
+
+       mkdir -p $(dirname $FRESHCLAM_CONFIGFILE)
+       ln -sf $freshclam_config_file $FRESHCLAM_CONFIGFILE
+
+       echo "UpdateLogFile " $UpdateLogFile > $FRESHCLAM_CONFIGFILE
+       echo "DatabaseMirror " $DatabaseMirror >> $FRESHCLAM_CONFIGFILE
+       echo "NotifyClamd " $NotifyClamd >> $FRESHCLAM_CONFIGFILE
+       echo "DatabaseOwner " $DatabaseOwner >> $FRESHCLAM_CONFIGFILE
+       echo "CompressLocalDatabase " $CompressLocalDatabase >> $FRESHCLAM_CONFIGFILE
+       echo "DatabaseDirectory " $DatabaseDirectory >> $FRESHCLAM_CONFIGFILE
+
+       procd_open_instance
+       procd_set_param command $PROG -d --config-file=$FRESHCLAM_CONFIGFILE -p /tmp/freshclam.pid --no-warnings
+       procd_set_param file $FRESHCLAM_CONFIGFILE
+       procd_close_instance
+}
+
+stop_service()
+{
+       [ ! -f /tmp/freshclam.pid ] && echo "not running" && return 0
+       PID=`cat /tmp/freshclam.pid`
+       kill $PID
+       rm -f /tmp/freshclam.pid
+}
+
+service_triggers()
+{
+       procd_add_reload_trigger "freshclam"
+       procd_add_validation validate_freshclam_section
+}
diff --git a/net/clamav/patches/001-compile.patch b/net/clamav/patches/001-compile.patch
new file mode 100644 (file)
index 0000000..096d9cb
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/clamdscan/proto.c
++++ b/clamdscan/proto.c
+@@ -59,6 +59,7 @@
+ #include "shared/misc.h"
+ #include "shared/clamdcom.h"
++#include <sys/un.h>
+ #include "proto.h"
+ #include "client.h"
diff --git a/net/conserver/Makefile b/net/conserver/Makefile
new file mode 100644 (file)
index 0000000..fbdad4d
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# Copyright (C) 2017 Bjørn Mork <bjorn@mork.no>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=conserver
+PKG_VERSION:=8.2.1
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Bjørn Mork <bjorn@mork.no>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.conserver.com/
+PKG_HASH:=251ae01997e8f3ee75106a5b84ec6f2a8eb5ff2f8092438eba34384a615153d0
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/conserver
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Connect multiple user to a serial console with logging
+  URL:=http://www.conserver.com/
+  DEPENDS:=+libopenssl
+endef
+
+define Package/conserver/description
+ Conserver is an application that allows multiple users to watch a
+ serial console at the same time.  It can log the data, allows users
+ to take write-access of a console (one at a time), and has a
+ variety of bells and whistles to accentuate that basic
+ functionality.  The idea is that conserver will log all your serial
+ traffic so you can go back and review why something crashed, look
+ at changes (if done on the console), or tie the console logs into a
+ monitoring system (just watch the logfiles it creates).  With
+ multi-user capabilities you can work on equipment with others,
+ mentor, train, etc.  It also does all that client-server stuff so
+ that, assuming you have a network connection, you can interact with
+ any of the equipment from home or wherever.
+endef
+
+define Package/conserver/conffiles
+/etc/conserver/conserver.cf
+/etc/conserver/conserver.passwd
+/etc/conserver/console.cf
+endef
+
+CONFIGURE_ARGS += \
+       --with-openssl \
+       --sysconfdir=/etc/conserver \
+       --with-port=3109 \
+       --with-logfile=/var/log/conserver/server.log
+
+define Package/conserver/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/conserver $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/console $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc/conserver
+       $(INSTALL_CONF) ./files/conserver.cf $(1)/etc/conserver/
+       $(INSTALL_CONF) ./files/console.cf $(1)/etc/conserver/
+       touch $(1)/etc/conserver/conserver.passwd
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/conserver.init $(1)/etc/init.d/conserver
+endef
+
+$(eval $(call BuildPackage,conserver))
diff --git a/net/conserver/files/conserver.cf b/net/conserver/files/conserver.cf
new file mode 100644 (file)
index 0000000..63f5de8
--- /dev/null
@@ -0,0 +1,13 @@
+config * {
+}
+default full {
+       rw *;
+}
+default * {
+       logfile /var/log/conserver/&.log;
+       timestamp "";
+       include full;
+}
+access * {
+       trusted 127.0.0.1;
+}
diff --git a/net/conserver/files/conserver.init b/net/conserver/files/conserver.init
new file mode 100644 (file)
index 0000000..03cca5f
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2017 Bjørn Mork <bjorn@mork.no>
+
+START=99
+STOP=99
+
+USE_PROCD=1
+
+start_service() {
+       [ -d /var/log/conserver ] || mkdir -m 0755 -p /var/log/conserver
+       procd_open_instance
+       procd_set_param command /usr/sbin/conserver
+       procd_close_instance
+}
diff --git a/net/conserver/files/console.cf b/net/conserver/files/console.cf
new file mode 100644 (file)
index 0000000..677b31c
--- /dev/null
@@ -0,0 +1,4 @@
+config * {
+       master  localhost;
+       port    3109;
+}
diff --git a/net/conserver/patches/001-remove-strip.patch b/net/conserver/patches/001-remove-strip.patch
new file mode 100644 (file)
index 0000000..9271c51
--- /dev/null
@@ -0,0 +1,48 @@
+diff -ur conserver-8.2.1.old/autologin/Makefile.in conserver-8.2.1/autologin/Makefile.in
+--- conserver-8.2.1.old/autologin/Makefile.in  2013-09-14 00:46:49.000000000 +0200
++++ conserver-8.2.1/autologin/Makefile.in      2016-03-30 17:11:44.489446435 +0200
+@@ -9,7 +9,7 @@
+ ### Installation programs and flags
+ INSTALL = @INSTALL@
+-INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s
++INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ LN_S = @LN_S@
+ MKDIR = @MKDIR@
+diff -ur conserver-8.2.1.old/conserver/Makefile.in conserver-8.2.1/conserver/Makefile.in
+--- conserver-8.2.1.old/conserver/Makefile.in  2013-09-14 00:46:53.000000000 +0200
++++ conserver-8.2.1/conserver/Makefile.in      2016-03-30 17:11:44.509446803 +0200
+@@ -14,7 +14,7 @@
+ ### Installation programs and flags
+ INSTALL = @INSTALL@
+-INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s
++INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ LN_S = @LN_S@
+ MKDIR = @MKDIR@
+diff -ur conserver-8.2.1.old/console/Makefile.in conserver-8.2.1/console/Makefile.in
+--- conserver-8.2.1.old/console/Makefile.in    2013-09-14 00:46:55.000000000 +0200
++++ conserver-8.2.1/console/Makefile.in        2016-03-30 17:11:44.481446288 +0200
+@@ -10,7 +10,7 @@
+ ### Installation programs and flags
+ INSTALL = @INSTALL@
+-INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s
++INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ LN_S = @LN_S@
+ MKDIR = @MKDIR@
+diff -ur conserver-8.2.1.old/contrib/chat/Makefile.in conserver-8.2.1/contrib/chat/Makefile.in
+--- conserver-8.2.1.old/contrib/chat/Makefile.in       2013-09-14 00:47:31.000000000 +0200
++++ conserver-8.2.1/contrib/chat/Makefile.in   2016-03-30 17:11:44.501446656 +0200
+@@ -10,7 +10,7 @@
+ ### Installation programs and flags
+ INSTALL = @INSTALL@
+-INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s
++INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ LN_S = @LN_S@
+ MKDIR = @MKDIR@
index c0c671f033f6907e6fde27ed3a545547bba75ec4..8c93f4592e05f434edf8eb64052a6809696d0ad0 100644 (file)
@@ -38,9 +38,6 @@ choice
 config COOVACHILLI_NOSSL
        bool "No SSL support"
 
-config COOVACHILLI_MATRIXSSL
-       bool "MatrixSSL"
-
 config COOVACHILLI_CYASSL
        bool "CyaSSL"
 
index b926a1d0843d973cb7ed83e4e9e02036199bd44e..a6e4c400c5a922f4458d262e8eeeeb615b0513f4 100644 (file)
@@ -12,14 +12,14 @@ PKG_VERSION:=1.3.0+20141128
 PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=git://github.com/coova/coova-chilli
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=b93de20a288c01c2ba28e96e31ad6da01627f45f
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=2adb27ec56172b18c5beee359dd7898d
+PKG_MIRROR_HASH:=89c9b313881c658a0f6b91329a78bb1a0151878b19bc99b315976081c6355557
 
 PKG_INSTALL:=1
 
@@ -31,7 +31,6 @@ PKG_CONFIG_DEPENDS := \
   COOVACHILLI_UAMDOMAINFILE \
   COOVACHILLI_LARGELIMITS \
   COOVACHILLI_NOSSL \
-  COOVACHILLI_MATRIXSSL \
   COOVACHILLI_CYASSL \
   COOVACHILLI_OPENSSL
 
@@ -42,7 +41,7 @@ define Package/coova-chilli
   SUBMENU:=Captive Portals
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+kmod-tun +librt +COOVACHILLI_MATRIXSSL:libmatrixssl +COOVACHILLI_CYASSL:libcyassl +COOVACHILLI_OPENSSL:libopenssl
+  DEPENDS:=+kmod-tun +librt +COOVACHILLI_CYASSL:libcyassl +COOVACHILLI_OPENSSL:libopenssl
   TITLE:=Wireless LAN HotSpot controller (Coova Chilli Version)
   URL:=http://www.coova.org/CoovaChilli
   MENU:=1
@@ -112,7 +111,6 @@ define Build/Configure
        $(if $(CONFIG_COOVACHILLI_USERAGENT),--enable,--disable)-useragent \
        $(if $(CONFIG_COOVACHILLI_LARGELIMITS),--enable,--disable)-largelimits \
        $(if $(CONFIG_COOVACHILLI_UAMDOMAINFILE),--enable,--disable)-uamdomainfile \
-       $(if $(CONFIG_COOVACHILLI_MATRIXSSL),--with,--without)-matrixssl \
        $(if $(CONFIG_COOVACHILLI_CYASSL),--with,--without)-cyassl \
        $(if $(CONFIG_COOVACHILLI_OPENSSL),--with,--without)-openssl \
        $(if $(CONFIG_PACKAGE_kmod-ipt-coova),--with-nfcoova) \
index 4ed43fc9b686a14a3cfa11975e36bf89655c2243..f8d449b2d66d8d13a590dbdf27cd17944bf8d6d9 100644 (file)
@@ -9,13 +9,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cshark
 PKG_VERSION=2015-11-24-$(PKG_SOURCE_VERSION)
-PKG_RELEASE=2
+PKG_RELEASE=3
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/cloudshark/cshark.git
 PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=e575ab3d35d75a6f70488001fcba45690ebe9b3e
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=280d2711308a5b051a43788519ae6857394690d3155fe954388c43cd9035ec84
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
@@ -32,15 +33,6 @@ define Package/cshark
   MAINTAINER:=Luka Perkov <luka@openwrt.org>
 endef
 
-define Package/luci-app-cshark
-  SECTION:=luci
-  CATEGORY:=LuCI
-  SUBMENU:=3. Applications
-  TITLE:=Cloudshark capture tool Web UI
-  DEPENDS:=+cshark +luci
-  MAINTAINER:=Luka Perkov <luka@openwrt.org>
-endef
-
 CMAKE_OPTIONS = \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DWITH_DEBUG=OFF \
@@ -66,10 +58,5 @@ define Package/cshark/install
                $(1)/etc/ssl/certs/
 endef
 
-define Package/luci-app-cshark/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua/luci
-       $(CP) -R $(PKG_BUILD_DIR)/openwrt/luci/luasrc/* $(1)/usr/lib/lua/luci/
-endef
 
 $(eval $(call BuildPackage,cshark))
-$(eval $(call BuildPackage,luci-app-cshark))
index 41853f297ee4dbc4814e92165d4236a8c2e537a4..82eb4fc32d8317184389427b980653bee947b25e 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/daemonlogger
-PKG_MD5SUM:=acb64aa6cd5777e297569f100b5c39ee
+PKG_HASH:=79fcd34d815e9c671ffa1ea3c7d7d50f895bb7a79b4448c4fd1c37857cf44a0b
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/net/danish/Makefile b/net/danish/Makefile
new file mode 100644 (file)
index 0000000..7b59594
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2017 Andrew McConachie
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=danish
+PKG_VERSION:=0.1
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Andrew McConachie <andrew@depht.com>
+PKG_LICENSE:=GPL-3.0
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/smutt/danish.git
+PKG_SOURCE_VERSION:=f726656a4e37c46c037f61334ac48b35b7de25be
+PKG_MIRROR_HASH:=cb0b4bb7a210091d807ee8e4a2876865f32a9bf195836eb2e1edf6c5975d1130
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../../lang/python/python-package.mk
+
+define Package/danish
+       SECTION:=net
+       CATEGORY:=Network
+       SUBMENU:=IP Addresses and Names
+       TITLE:=A middle box implementation of RFC 6698 for HTTPS.
+       URL:=https://github.com/smutt/danish
+       DEPENDS:=+python +python-dns +python-pcapy +python-dpkt +kmod-ipt-filter +iptables-mod-filter +dnsmasq-full
+endef
+
+define Package/danish/description
+  Danish is an experiment in middle-box DANE (RFC 6698) for HTTPS.
+  https://www.middlebox-dane.org/
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,\
+               install --prefix=/usr --root="$(PKG_INSTALL_DIR)", \
+       )
+endef
+
+define Package/danish/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP) $(PKG_BUILD_DIR)/danish.py $(1)/usr/sbin/danish
+       $(INSTALL_DIR) $(1)/etc/config
+       $(CP) $(PKG_BUILD_DIR)/danish.conf $(1)/etc/config/danish 
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(CP) $(PKG_BUILD_DIR)/danish.init $(1)/etc/init.d/danish
+endef
+
+$(eval $(call BuildPackage,danish))
diff --git a/net/dansguardian/Makefile b/net/dansguardian/Makefile
deleted file mode 100644 (file)
index eefefaa..0000000
+++ /dev/null
@@ -1,78 +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:=dansguardian
-PKG_VERSION:=2.12.0.3
-PKG_RELEASE:=1
-
-PKG_LICENSE:=GPL-2.0
-PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=@SF/dansguardian
-PKG_MD5SUM:=2a88d0392cd28eaec02b7ee727b2e253
-
-PKG_BUILD_PARALLEL:=1
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/uclibc++.mk
-include $(INCLUDE_DIR)/package.mk
-
-define Package/dansguardian
-  SECTION:=net
-  DEPENDS:=+libpthread $(CXX_DEPENDS) +zlib
-  CATEGORY:=Network
-  SUBMENU:=Web Servers/Proxies
-  TITLE:=DansGuardian
-  URL:=http://dansguardian.org
-endef
-
-define Package/dansguardian/conffiles
-/etc/dansguardian/dansguardianf1.conf
-/etc/config/dansguardian
-endef
-
-CONFIGURE_VARS += \
-       INCLUDES="" \
-       CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \
-       LIBS="-lpthread" \
-
-define Build/Configure
-       $(call Build/Configure/Default,\
-               --disable-clamav \
-               --with-sysconfsubdir=dansguardian \
-               --with-proxyuser=root \
-               --with-proxygroup=root \
-               --disable-pcre \
-       )
-endef
-
-define Package/dansguardian/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dansguardian $(1)/usr/sbin/
-
-       $(INSTALL_DIR) $(1)/etc
-       $(CP) $(PKG_INSTALL_DIR)/etc/dansguardian $(1)/etc/
-       $(INSTALL_CONF) ./files/dansguardianf1.conf $(1)/etc/dansguardian/dansguardianf1.conf
-
-       $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_CONF) ./files/dansguardian.config $(1)/etc/config/dansguardian
-
-       $(INSTALL_DIR) $(1)/usr/share/dansguardian
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/dansguardian/transparent1x1.gif $(1)/usr/share/dansguardian/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/dansguardian/blockedflash.swf $(1)/usr/share/dansguardian/
-
-       $(INSTALL_DIR) $(1)/usr/share/dansguardian/languages/ukenglish
-       $(CP) $(PKG_INSTALL_DIR)/usr/share/dansguardian/languages/ukenglish/* $(1)/usr/share/dansguardian/languages/ukenglish/
-
-       $(INSTALL_DIR) $(1)/etc/init.d/
-       $(INSTALL_BIN) ./files/dansguardian.init $(1)/etc/init.d/dansguardian
-endef
-
-$(eval $(call BuildPackage,dansguardian))
diff --git a/net/dansguardian/files/dansguardian.config b/net/dansguardian/files/dansguardian.config
deleted file mode 100644 (file)
index 86640af..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-config dansguardian 'dansguardian'
-       option config_file '/etc/dansguardian/dansguardianf1.conf'
-       option accessdeniedaddress 'http://YOURSERVER.YOURDOMAIN/cgi-bin/dansguardian.pl'
-       option bannediplist '/etc/dansguardian/lists/bannediplist'
-       option contentscanexceptions 'off'
-       option contentscannertimeout '60'
-       option createlistcachefiles 'on'
-       option custombannedflashfile '/usr/share/dansguardian/blockedflash.swf'
-       option custombannedimagefile '/usr/share/dansguardian/transparent1x1.gif'
-       option deletedownloadedtempfiles 'on'
-       option downloadmanager '/etc/dansguardian/downloadmanagers/default.conf'
-       option exceptioniplist '/etc/dansguardian/lists/exceptioniplist'
-       option filecachedir '/tmp'
-       option filtergroups '1'
-       option filtergroupslist '/etc/dansguardian/lists/filtergroupslist'
-       option filterip ''
-       option filterports '8080'
-       option forcequicksearch 'off'
-       option forwardedfor 'off'
-       option hexdecodecontent 'off'
-       option initialtrickledelay '20'
-       option ipcfilename '/tmp/.dguardianipc'
-       option ipipcfilename '/tmp/.dguardianipipc'
-       option languagedir '/usr/share/dansguardian/languages'
-       option language 'ukenglish'
-       option logadblocks 'off'
-       option logchildprocesshandling 'off'
-       option logclienthostnames 'off'
-       option logconnectionhandlingerrors 'on'
-       option logexceptionhits '2'
-       option logfileformat '1'
-       option loglevel '2'
-       option loglocation '/dev/null'
-       option logsyslog 'on'
-       option loguseragent 'off'
-       option maxagechildren '500'
-       option maxchildren '120'
-       option maxcontentfilecachescansize '20000'
-       option maxcontentfiltersize '256'
-       option maxcontentramcachescansize '2000'
-       option maxips '0'
-       option maxsparechildren '32'
-       option maxuploadsize '-1'
-       option minchildren '8'
-       option minsparechildren '4'
-       option nodaemon 'off'
-       option nologger 'off'
-       option nonstandarddelimiter 'on'
-       option perroomblockingdirectory '/etc/dansguardian/lists/bannedrooms/'
-       option phrasefiltermode '2'
-       option prefercachedlists 'off'
-       option preforkchildren '6'
-       option preservecase '0'
-       option proxyip '127.0.0.1'
-       option proxyport '3128'
-       option proxytimeout '20'
-       option recheckreplacedurls 'off'
-       option reportinglevel '3'
-       option reverseaddresslookups 'off'
-       option reverseclientiplookups 'off'
-       option scancleancache 'on'
-       option showweightedfound 'on'
-       option softrestart 'off'
-       option trickledelay '10'
-       option urlcacheage '900'
-       option urlcachenumber '1000'
-       option urlipcfilename '/tmp/.dguardianurlipc'
-       option usecustombannedflash 'on'
-       option usecustombannedimage 'on'
-       option usexforwardedfor 'off'
-       option weightedphrasemode '2'
diff --git a/net/dansguardian/files/dansguardian.init b/net/dansguardian/files/dansguardian.init
deleted file mode 100644 (file)
index 67ec6bd..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2015 OpenWrt.org
-
-START=90
-STOP=10
-
-USE_PROCD=1
-PROG=/usr/sbin/dansguardian
-CONFIGFILE="/tmp/dansguardian/dansguardian.conf"
-
-validate_dansguardian_section() {
-       uci_validate_section dansguardian dansguardian "${1}" \
-               'config_file:string' \
-               'accessdeniedaddress:string' \
-               'bannediplist:string' \
-               'contentscanexceptions:string' \
-               'contentscannertimeout:uinteger' \
-               'createlistcachefiles:string' \
-               'custombannedflashfile:string' \
-               'custombannedimagefile:string' \
-               'deletedownloadedtempfiles:string' \
-               'downloadmanager:string' \
-               'exceptioniplist:string' \
-               'filecachedir:string' \
-               'filtergroups:uinteger' \
-               'filtergroupslist:string' \
-               'filterip:ipaddr' \
-               'filterports:port:8080' \
-               'forcequicksearch:string' \
-               'forwardedfor:string' \
-               'hexdecodecontent:string' \
-               'initialtrickledelay:uinteger' \
-               'ipcfilename:string' \
-               'ipipcfilename:string' \
-               'languagedir:string' \
-               'language:string' \
-               'logadblocks:string' \
-               'logchildprocesshandling:string' \
-               'logclienthostnames:string' \
-               'logconnectionhandlingerrors:string' \
-               'logexceptionhits:range(0,2)' \
-               'logfileformat:range(1,4)' \
-               'loglevel:range(0,3)' \
-               'loglocation:string' \
-               'loguseragent:string' \
-               'maxagechildren:uinteger' \
-               'maxchildren:uinteger' \
-               'maxcontentfilecachescansize:uinteger' \
-               'maxcontentfiltersize:uinteger' \
-               'maxcontentramcachescansize:uinteger' \
-               'maxips:uinteger' \
-               'maxsparechildren:uinteger' \
-               'maxuploadsize:integer' \
-               'minchildren:uinteger' \
-               'minsparechildren:uinteger' \
-               'nodaemon:string' \
-               'nologger:string' \
-               'nonstandarddelimiter:string' \
-               'perroomblockingdirectory:string' \
-               'phrasefiltermode:range(0,3)' \
-               'prefercachedlists:string' \
-               'preforkchildren:uinteger' \
-               'preservecase:range(0,2)' \
-               'proxyip:ipaddr' \
-               'proxyport:port:3128' \
-               'proxytimeout:range(20,30)' \
-               'recheckreplacedurls:string' \
-               'reportinglevel:range(-1,3)' \
-               'reverseaddresslookups:string' \
-               'reverseclientiplookups:string' \
-               'scancleancache:string' \
-               'showweightedfound:string' \
-               'softrestart:string' \
-               'trickledelay:uinteger' \
-               'urlcacheage:uinteger' \
-               'urlcachenumber:uinteger' \
-               'urlipcfilename:string' \
-               'usecustombannedflash:string' \
-               'usecustombannedimage:string' \
-               'usexforwardedfor:string' \
-               'weightedphrasemode:range(0,2)'
-}
-
-start_service() {
-       local config_file accessdeniedaddress bannediplist contentscanexceptions contentscannertimeout \
-               createlistcachefiles custombannedflashfile custombannedimagefile deletedownloadedtempfiles \
-               downloadmanager exceptioniplist filecachedir filtergroups filtergroupslist filterip filterports \
-               forcequicksearch forwardedfor hexdecodecontent initialtrickledelay ipcfilename ipipcfilename \
-               language languagedir logadblocks logchildprocesshandling logclienthostnames logconnectionhandlingerrors \
-               logexceptionhits logfileformat loglevel loguseragent maxagechildren maxchildren maxcontentfilecachescansize \
-               maxcontentfiltersize maxcontentramcachescansize maxips maxsparechildren maxuploadsize minchildren minsparechildren \
-               nodaemon nologger nonstandarddelimiter perroomblockingdirectory phrasefiltermode prefercachedlists preforkchildren \
-               preservecase proxyip proxyport proxytimeout recheckreplacedurls reportinglevel reverseaddresslookups \
-               reverseclientiplookups scancleancache showweightedfound softrestart trickledelay urlcacheage urlcachenumber \
-               urlipcfilename usecustombannedflash usecustombannedimage usexforwardedfor weightedphrasemode
-
-       validate_dansguardian_section dansguardian || {
-               echo "validation failed"
-               return 1
-       }
-
-       mkdir -p $(dirname $CONFIGFILE)
-       ln -sf $config_file $(dirname $CONFIGFILE)
-
-       echo "accessdeniedaddress = " $accessdeniedaddress > $CONFIGFILE
-       echo "bannediplist = " $bannediplist >> $CONFIGFILE
-       echo "contentscanexceptions = " $contentscanexceptions >> $CONFIGFILE
-       echo "contentscannertimeout = " $contentscannertimeout >> $CONFIGFILE
-       echo "createlistcachefiles = " $createlistcachefiles >> $CONFIGFILE
-       echo "custombannedflashfile = " $custombannedflashfile >> $CONFIGFILE
-       echo "custombannedimagefile = " $custombannedimagefile >> $CONFIGFILE
-       echo "deletedownloadedtempfiles = " $deletedownloadedtempfiles >> $CONFIGFILE
-       echo "downloadmanager = " $downloadmanager >> $CONFIGFILE
-       echo "exceptioniplist = " $exceptioniplist >> $CONFIGFILE
-       echo "filecachedir = " $filecachedir >> $CONFIGFILE
-       echo "filtergroups = " $filtergroups >> $CONFIGFILE
-       echo "filtergroupslist = " $filtergroupslist >> $CONFIGFILE
-       echo "filterip = " $filterip >> $CONFIGFILE
-       echo "filterports = " $filterports >> $CONFIGFILE
-       echo "forcequicksearch = " $forcequicksearch >> $CONFIGFILE
-       echo "forwardedfor = " $forwardedfor >> $CONFIGFILE
-       echo "hexdecodecontent = " $hexdecodecontent >> $CONFIGFILE
-       echo "initialtrickledelay = " $initialtrickledelay >> $CONFIGFILE
-       echo "ipcfilename = " $ipcfilename >> $CONFIGFILE
-       echo "ipipcfilename = " $ipipcfilename >> $CONFIGFILE
-       echo "language = " $language >> $CONFIGFILE
-       echo "languagedir = " $languagedir >> $CONFIGFILE
-       echo "logadblocks = " $logadblocks >> $CONFIGFILE
-       echo "logchildprocesshandling = " $logchildprocesshandling >> $CONFIGFILE
-       echo "logclienthostnames = " $logclienthostnames >> $CONFIGFILE
-       echo "logconnectionhandlingerrors = " $logconnectionhandlingerrors >> $CONFIGFILE
-       echo "logexceptionhits = " $logexceptionhits >> $CONFIGFILE
-       echo "logfileformat = " $logfileformat >> $CONFIGFILE
-       echo "loglevel = " $loglevel >> $CONFIGFILE
-       echo "loglocation = " $loglocation >> $CONFIGFILE
-       echo "loguseragent = " $loguseragent >> $CONFIGFILE
-       echo "maxagechildren = " $maxagechildren >> $CONFIGFILE
-       echo "maxchildren = " $maxchildren >> $CONFIGFILE
-       echo "maxcontentfilecachescansize = " $maxcontentfilecachescansize >> $CONFIGFILE
-       echo "maxcontentfiltersize = " $maxcontentfiltersize >> $CONFIGFILE
-       echo "maxcontentramcachescansize = " $maxcontentramcachescansize >> $CONFIGFILE
-       echo "maxips = " $maxips >> $CONFIGFILE
-       echo "maxsparechildren = " $maxsparechildren >> $CONFIGFILE
-       echo "maxuploadsize = " $maxuploadsize >> $CONFIGFILE
-       echo "minchildren = " $minchildren >> $CONFIGFILE
-       echo "minsparechildren = " $minsparechildren >> $CONFIGFILE
-       echo "nodaemon = " $nodaemon >> $CONFIGFILE
-       echo "nologger = " $nologger >> $CONFIGFILE
-       echo "nonstandarddelimiter = " $nonstandarddelimiter >> $CONFIGFILE
-       echo "perroomblockingdirectory = " $perroomblockingdirectory >> $CONFIGFILE
-       echo "phrasefiltermode = " $phrasefiltermode >> $CONFIGFILE
-       echo "prefercachedlists = " $prefercachedlists >> $CONFIGFILE
-       echo "preforkchildren = " $preforkchildren >> $CONFIGFILE
-       echo "preservecase = " $preservecase >> $CONFIGFILE
-       echo "proxyip = " $proxyip >> $CONFIGFILE
-       echo "proxyport = " $proxyport >> $CONFIGFILE
-       echo "proxytimeout = " $proxytimeout >> $CONFIGFILE
-       echo "recheckreplacedurls = " $recheckreplacedurls >> $CONFIGFILE
-       echo "reportinglevel = " $reportinglevel >> $CONFIGFILE
-       echo "reverseaddresslookups = " $reverseaddresslookups >> $CONFIGFILE
-       echo "reverseclientiplookups = " $reverseclientiplookups >> $CONFIGFILE
-       echo "scancleancache = " $scancleancache >> $CONFIGFILE
-       echo "showweightedfound = " $showweightedfound >> $CONFIGFILE
-       echo "softrestart = " $softrestart >> $CONFIGFILE
-       echo "trickledelay = " $trickledelay >> $CONFIGFILE
-       echo "urlcacheage = " $urlcacheage >> $CONFIGFILE
-       echo "urlcachenumber = " $urlcachenumber >> $CONFIGFILE
-       echo "urlipcfilename = " $urlipcfilename >> $CONFIGFILE
-       echo "usecustombannedflash = " $usecustombannedflash >> $CONFIGFILE
-       echo "usecustombannedimage = " $usecustombannedimage >> $CONFIGFILE
-       echo "usexforwardedfor = " $usexforwardedfor >> $CONFIGFILE
-       echo "weightedphrasemode = " $weightedphrasemode >> $CONFIGFILE
-
-       procd_open_instance
-       procd_set_param command $PROG -N -c "$CONFIGFILE"
-       procd_set_param file $CONFIGFILE
-       procd_set_param respawn
-       procd_close_instance
-}
-
-stop_service()
-{
-       dansguardian -s | awk -F':' '{ print $2}' | xargs kill -9
-}
-
-service_triggers()
-{
-       procd_add_reload_trigger "dansguardian"
-       procd_add_validation validate_dansguardian_section
-}
diff --git a/net/dansguardian/files/dansguardianf1.conf b/net/dansguardian/files/dansguardianf1.conf
deleted file mode 100644 (file)
index 01e09ae..0000000
+++ /dev/null
@@ -1,348 +0,0 @@
-# DansGuardian filter group config file for version 2.12.0.0
-
-
-# Filter group mode
-# This option determines whether members of this group have their web access
-# unfiltered, filtered, or banned. This mechanism replaces the "banneduserlist"
-# and "exceptionuserlist" files from previous versions.
-#
-# 0 = banned
-# 1 = filtered
-# 2 = unfiltered (exception)
-#
-# Only filter groups with a mode of 1 need to define phrase, URL, site, extension,
-# mimetype and PICS lists; in other modes, these options are ignored to conserve
-# memory.
-#
-# Defaults to 0 if unspecified.
-# Unauthenticated users are treated as being in the first filter group.
-groupmode = 1
-
-# Filter group name
-# Used to fill in the -FILTERGROUP- placeholder in the HTML template file, and to
-# name the group in the access logs
-# Defaults to empty string
-#groupname = ''
-
-# Content filtering files location
-bannedphraselist = '/etc/dansguardian/lists/bannedphraselist'
-weightedphraselist = '/etc/dansguardian/lists/weightedphraselist'
-exceptionphraselist = '/etc/dansguardian/lists/exceptionphraselist'
-bannedsitelist = '/etc/dansguardian/lists/bannedsitelist'
-greysitelist = '/etc/dansguardian/lists/greysitelist'
-exceptionsitelist = '/etc/dansguardian/lists/exceptionsitelist'
-bannedurllist = '/etc/dansguardian/lists/bannedurllist'
-greyurllist = '/etc/dansguardian/lists/greyurllist'
-exceptionurllist = '/etc/dansguardian/lists/exceptionurllist'
-exceptionregexpurllist = '/etc/dansguardian/lists/exceptionregexpurllist'
-bannedregexpurllist = '/etc/dansguardian/lists/bannedregexpurllist'
-picsfile = '/etc/dansguardian/lists/pics'
-contentregexplist = '/etc/dansguardian/lists/contentregexplist'
-urlregexplist = '/etc/dansguardian/lists/urlregexplist'
-
-# Filetype filtering
-#
-# Blanket download blocking
-# If enabled, all files will be blocked, unless they match the
-# exceptionextensionlist or exceptionmimetypelist.
-# These lists do not override virus scanning.
-# Exception lists defined above override all types of filtering, including
-# the blanket download block.
-# Defaults to disabled.
-# (on | off)
-#
-blockdownloads = off
-exceptionextensionlist = '/etc/dansguardian/lists/exceptionextensionlist'
-exceptionmimetypelist = '/etc/dansguardian/lists/exceptionmimetypelist'
-#
-# Use the following lists to block specific kinds of file downloads.
-# The two exception lists above can be used to override these.
-#
-bannedextensionlist = '/etc/dansguardian/lists/bannedextensionlist'
-bannedmimetypelist = '/etc/dansguardian/lists/bannedmimetypelist'
-#
-# In either file filtering mode, the following list can be used to override
-# MIME type & extension blocks for particular domains & URLs (trusted download sites).
-#
-exceptionfilesitelist = '/etc/dansguardian/lists/exceptionfilesitelist'
-exceptionfileurllist = '/etc/dansguardian/lists/exceptionfileurllist'
-
-# Categorise without blocking:
-# Supply categorised lists here and the category string shall be logged against
-# matching requests, but matching these lists does not perform any filtering
-# action.
-#logsitelist = '/etc/dansguardian/lists/logsitelist'
-#logurllist = '/etc/dansguardian/lists/logurllist'
-#logregexpurllist = '/etc/dansguardian/lists/logregexpurllist'
-
-# Outgoing HTTP header rules:
-# Optional lists for blocking based on, and modification of, outgoing HTTP
-# request headers.  Format for headerregexplist is one modification rule per
-# line, similar to content/URL modifications.  Format for
-# bannedregexpheaderlist is one regular expression per line, with matching
-# headers causing a request to be blocked.
-# Headers are matched/replaced on a line-by-line basis, not as a contiguous
-# block.
-# Use for example, to remove cookies or prevent certain user-agents.
-headerregexplist = '/etc/dansguardian/lists/headerregexplist'
-bannedregexpheaderlist = '/etc/dansguardian/lists/bannedregexpheaderlist'
-
-# Weighted phrase mode
-# Optional; overrides the weightedphrasemode option in dansguardian.conf
-# for this particular group.  See documentation for supported values in
-# that file.
-#weightedphrasemode = 0
-
-# Naughtiness limit
-# This the limit over which the page will be blocked.  Each weighted phrase is given
-# a value either positive or negative and the values added up.  Phrases to do with
-# good subjects will have negative values, and bad subjects will have positive
-# values.  See the weightedphraselist file for examples.
-# As a guide:
-# 50 is for young children,  100 for old children,  160 for young adults.
-naughtynesslimit = 50
-
-# Search term blocking
-# Search terms can be extracted from search URLs and filtered using the
-# bannedphraselist, weightedphraselist and exceptionphraselist, with a separate
-# threshold for blocking than that used for normal page content.
-# To do this, the first two options below must be enabled.
-#
-# Search engine regular expression list
-# List of regular expressions for matching search engine URLs.  It is assumed
-# that the search terms themselves will be contained within the first submatch
-# of each expression.
-#searchengineregexplist = '/etc/dansguardian/lists/searchengineregexplist'
-#
-# Search term limit
-# The limit over which requests will be blocked for containing search terms
-# which match the weightedphraselist.  This should usually be lower than the
-# 'naughtynesslimit' value above, because the amount of text being filtered
-# is only a few words, rather than a whole page.
-# This option must be uncommented if searchengineregexplist is uncommented.
-# A value of 0 here indicates that search terms should be extracted,
-# for logging/reporting purposes, but no filtering should be performed
-# on the resulting text.
-#searchtermlimit = 30
-#
-# Search term lists
-# If the three lines below are uncommented, search term blocking will use
-# the banned, weighted & exception phrases from these lists, instead of using
-# the same phrase lists as for page content.  This is optional but recommended,
-# as weights for individual phrases in the "normal" lists may not be
-# appropriate for blocking when those phrases appear in a much smaller block
-# of text.
-# Please note that all or none of the below should be uncommented, not a
-# mixture.
-#bannedsearchtermlist = '/etc/dansguardian/lists/bannedsearchtermlist'
-#weightedsearchtermlist = '/etc/dansguardian/lists/weightedsearchtermlist'
-#exceptionsearchtermlist = '/etc/dansguardian/lists/exceptionsearchtermlist'
-
-# Category display threshold
-# This option only applies to pages blocked by weighted phrase filtering.
-# Defines the minimum score that must be accumulated within a particular
-# category in order for it to show up on the block pages' category list.
-# All categories under which the page scores positively will be logged; those
-# that were not displayed to the user appear in brackets.
-#
-# -1 = display only the highest scoring category
-# 0 = display all categories (default)
-# > 0 = minimum score for a category to be displayed
-categorydisplaythreshold = 0
-
-# Embedded URL weighting
-# When set to something greater than zero, this option causes URLs embedded within a
-# page's HTML (from links, image tags, etc.) to be extracted and checked against the
-# bannedsitelist and bannedurllist. Each link to a banned page causes the amount set
-# here to be added to the page's weighting.
-# The behaviour of this option with regards to multiple occurrences of a site/URL is
-# affected by the weightedphrasemode setting.
-#
-# NB: Currently, this feature uses regular expressions that require the PCRE library.
-# As such, it is only available if you compiled DansGuardian with '--enable-pcre=yes'.
-# You can check compile-time options by running 'dansguardian -v'.
-#
-# Set to 0 to disable.
-# Defaults to 0.
-# WARNING: This option is highly CPU intensive!
-embeddedurlweight = 0
-
-# Enable PICS rating support
-#
-# Defaults to disabled
-# (on | off)
-enablepics = off
-
-# Temporary Denied Page Bypass
-# This provides a link on the denied page to bypass the ban for a few minutes.  To be
-# secure it uses a random hashed secret generated at daemon startup.  You define the
-# number of seconds the bypass will function for before the deny will appear again.
-# To allow the link on the denied page to appear you will need to edit the template.html
-# or dansguardian.pl file for your language.
-# 300 = enable for 5 minutes
-# 0 = disable ( defaults to 0 )
-# -1 = enable but you require a separate program/CGI to generate a valid link
-bypass = 0
-
-# Temporary Denied Page Bypass Secret Key
-# Rather than generating a random key you can specify one.  It must be more than 8 chars.
-# '' = generate a random one (recommended and default)
-# 'Mary had a little lamb.' = an example
-# '76b42abc1cd0fdcaf6e943dcbc93b826' = an example
-bypasskey = ''
-
-# Infection/Scan Error Bypass
-# Similar to the 'bypass' setting, but specifically for bypassing files scanned and found
-# to be infected, or files that trigger scanner errors - for example, archive types with
-# recognised but unsupported compression schemes, or corrupt archives.
-# The option specifies the number of seconds for which the bypass link will be valid.
-# 300 = enable for 5 minutes
-# 0 = disable (default)
-# -1 = enable, but require a separate program/CGI to generate a valid link
-infectionbypass = 0
-
-# Infection/Scan Error Bypass Secret Key
-# Same as the 'bypasskey' option, but used for infection bypass mode.
-infectionbypasskey = ''
-
-# Infection/Scan Error Bypass on Scan Errors Only
-# Enable this option to allow infectionbypass links only when virus scanning fails,
-# not when a file is found to contain a virus.
-# on = enable (default and highly recommended)
-# off = disable
-infectionbypasserrorsonly = on
-
-# Disable content scanning
-# If you enable this option you will disable content scanning for this group.
-# Content scanning primarily is AV scanning (if enabled) but could include
-# other types.
-# (on|off) default = off.
-disablecontentscan = off
-
-# Enable Deep URL Analysis
-# When enabled, DG looks for URLs within URLs, checking against the bannedsitelist and
-# bannedurllist. This can be used, for example, to block images originating from banned
-# sites from appearing in Google Images search results, as the original URLs are
-# embedded in the thumbnail GET requests.
-# (on|off) default = off
-deepurlanalysis = off
-
-# reportinglevel
-#
-# -1 = log, but do not block - Stealth mode
-#  0 = just say 'Access Denied'
-#  1 = report why but not what denied phrase
-#  2 = report fully
-#  3 = use HTML template file (accessdeniedaddress ignored) - recommended
-#
-# If defined, this overrides the global setting in dansguardian.conf for
-# members of this filter group.
-#
-#reportinglevel = 3
-
-# accessdeniedaddress is the address of your web server to which the cgi
-# dansguardian reporting script was copied. Only used in reporting levels
-# 1 and 2.
-#
-# This webserver must be either:
-#  1. Non-proxied. Either a machine on the local network, or listed as an
-#     exception in your browser's proxy configuration.
-#  2. Added to the exceptionsitelist. Option 1 is preferable; this option is
-#     only for users using both transparent proxying and a non-local server
-#     to host this script.
-#
-# If defined, this overrides the global setting in dansguardian.conf for
-# members of this filter group.
-#
-#accessdeniedaddress = 'http://YOURSERVER.YOURDOMAIN/cgi-bin/dansguardian.pl'
-
-# HTML Template override
-# If defined, this specifies a custom HTML template file for members of this
-# filter group, overriding the global setting in dansguardian.conf. This is
-# only used in reporting level 3.
-#
-# The default template file path is <languagedir>/<language>/template.html
-# e.g. /usr/share/dansguardian/languages/ukenglish/template.html when using 'ukenglish'
-# language.
-#
-# This option generates a file path of the form:
-# <languagedir>/<language>/<htmltemplate>
-# e.g. /usr/share/dansguardian/languages/ukenglish/custom.html
-#
-#htmltemplate = 'custom.html'
-
-# Email reporting - original patch by J. Gauthier
-
-# Use SMTP
-# If on, will enable system wide events to be reported by email.
-# need to configure mail program (see 'mailer' in global config)
-# and email recipients
-# default usesmtp = off
-#!! Not compiled !!usesmtp = off
-
-# mailfrom
-# who the email would come from
-# example: mailfrom = 'dansguardian@mycompany.com'
-#!! Not compiled !!mailfrom = ''
-
-# avadmin
-# who the virus emails go to (if notify av is on)
-# example: avadmin = 'admin@mycompany.com'
-#!! Not compiled !!avadmin = ''
-
-# contentdmin
-# who the content emails go to (when thresholds are exceeded)
-# and contentnotify is on
-# example: contentadmin = 'admin@mycompany.com'
-#!! Not compiled !!contentadmin = ''
-
-# avsubject
-# Subject of the email sent when a virus is caught.
-# only applicable if notifyav is on
-# default avsubject = 'dansguardian virus block'
-#!! Not compiled !!avsubject = 'dansguardian virus block'
-
-# content
-# Subject of the email sent when violation thresholds are exceeded
-# default contentsubject = 'dansguardian violation'
-#!! Not compiled !!contentsubject = 'dansguardian violation'
-
-# notifyAV
-# This will send a notification, if usesmtp/notifyav is on, any time an
-# infection is found.
-# Important: If this option is off, viruses will still be recorded like a
-# content infraction.
-#!! Not compiled !!notifyav = off
-
-# notifycontent
-# This will send a notification, if usesmtp is on, based on thresholds
-# below
-#!! Not compiled !!notifycontent = off
-
-# thresholdbyuser
-# results are only predictable with user authenticated configs
-# if enabled the violation/threshold count is kept track of by the user
-#!! Not compiled !!thresholdbyuser = off
-
-#violations
-# number of violations before notification
-# setting to 0 will never trigger a notification
-#!! Not compiled !!violations = 0
-
-#threshold
-# this is in seconds. If 'violations' occur in 'threshold' seconds, then
-# a notification is made.
-# if this is set to 0, then whenever the set number of violations are made a
-# notifaction will be sent.
-#!! Not compiled !!threshold = 0
-
-#SSL certificate checking
-# Check that ssl certificates for servers on https connections are valid
-# and signed by a ca in the configured path
-sslcertcheck = off
-
-#SSL man in the middle
-# Forge ssl certificates for all sites, decrypt the data then re encrypt it
-# using a different private key. Used to filter ssl sites
-sslmitm = off
-
diff --git a/net/dansguardian/patches/001-compile.patch b/net/dansguardian/patches/001-compile.patch
deleted file mode 100644 (file)
index db8efa4..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/configure
-+++ b/configure
-@@ -827,7 +827,7 @@ sysconfdir='${prefix}/etc'
- sharedstatedir='${prefix}/com'
- localstatedir='${prefix}/var'
- includedir='${prefix}/include'
--oldincludedir='/usr/include'
-+oldincludedir='${prefix}/usr/include'
- docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
- infodir='${datarootdir}/info'
- htmldir='${docdir}'
-@@ -5265,7 +5265,7 @@ $as_echo_n "checking for zlib... " >&6;
- # Check whether --with-zlib was given.
- if test "${with_zlib+set}" = set; then :
-   withval=$with_zlib;  # check for header & func (in library) in given prefix
--      CPPFLAGS="${CPPFLAGS} -I${withval}/include"
-+      CPPFLAGS="${CPPFLAGS}"
-       if test "x$staticzlib" = "xtrue"; then
-               LIBS="-Bstatic -L${withval} -lz -Bdynamic ${LIBS}"
-       else
-@@ -7095,7 +7095,7 @@ $as_echo "#define ENABLE_NTLM /**/" >>co
- if test "${with_libiconv+set}" = set; then :
-   withval=$with_libiconv;  # check for header & func (in library) in given prefix
-                       if test "x$withval" != "x"; then
--                              CPPFLAGS="${CPPFLAGS} -I${withval}/include"
-+                              CPPFLAGS="${CPPFLAGS}"
-                               LIBS="-L${withval}/lib -liconv ${LIBS}"
-                       else
-                               LIBS="-liconv ${LIBS}"
index 027ad36688a04820a3dd17d23b5792f72a21d435..379c2600a718ec850a33e2bc3df2b3f84debf134 100644 (file)
@@ -18,7 +18,7 @@ PKG_LICENSE_FILES:=COPYING.GPL LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://unix4lyfe.org/darkstat
-PKG_MD5SUM:=963145de05cb21f4d93a9c244beeaea0
+PKG_HASH:=aeaf909585f7f43dc032a75328fdb62114e58405b06a92a13c0d3653236dedd7
 
 PKG_INSTALL:=1
 
@@ -27,7 +27,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/darkstat
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+libpcap +zlib
+  DEPENDS:=+libpcap +zlib +USE_GLIBC:libbsd
   TITLE:=Network bandwidth monitor
   URL:=http://unix4lyfe.org/darkstat/
 endef
index 4e1f09277b5dd65ea8a4219b17b7246c6e0b823e..1b2e0003dc122136e143c4812b33098120780a4f 100644 (file)
@@ -9,21 +9,22 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=davfs2
 PKG_VERSION:=1.5.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/davfs2/
-PKG_MD5SUM:=c9f0b557275b7ec88fec751bf22f30cf
+PKG_HASH:=c9c4e0f0912a782386216b2147eb9c36c47f193b8fcf3d637719e0b9fe7c96e0
 
 PKG_FIXUP:=gettext-version autoreconf
 
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
 
 define Package/davfs2
   SECTION:=net
   CATEGORY:=Network
   SUBMENU:=Filesystem
-  DEPENDS=+libneon +kmod-fuse +libfuse
+  DEPENDS=+libneon +kmod-fuse +libfuse $(ICONV_DEPENDS) $(INTL_DEPENDS)
   TITLE:=Mount a WebDAV resource as a regular file system.
   URL:=http://savannah.nongnu.org/projects/davfs2/
   MAINTAINER:=Federico Di Marco <fededim@gmail.com>
@@ -50,14 +51,14 @@ define Package/davfs2/conffiles
 /etc/davfs2/davfs2.conf
 endef
 
-TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
+TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include # $(ICONV_CFLAGS) $(INTL_CFLAGS)
 
-TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
+TARGET_CPPFLAGS += -D_GNU_SOURCE  # $(ICONV_CPFLAGS) $(INTL_CPPFLAGS)
 
 CONFIGURE_VARS += \
-       LDFLAGS="$(TARGET_LDFLAGS) -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib"
+       LDFLAGS="$(TARGET_LDFLAGS) -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib $(if $(INTL_FULL),-lintl) $(if $(ICONV_FULL),-liconv)" #$(INTL_LDFLAGS) $(ICONV_LDFLAGS) 
 
-CONFIGURE_ARGS += --with-neon="$(STAGING_DIR)/usr"
+CONFIGURE_ARGS += --with-neon="$(STAGING_DIR)/usr" --enable-largefile #--with-libintl-prefix=$(INTL_PREFIX) --with-libiconv-prefix=$(ICONV_PREFIX)
 
 define Package/davfs2/install
        $(INSTALL_DIR) $(1)/usr/sbin
diff --git a/net/davfs2/patches/300-have_iconv_h.patch b/net/davfs2/patches/300-have_iconv_h.patch
new file mode 100644 (file)
index 0000000..c126b5a
--- /dev/null
@@ -0,0 +1,40 @@
+diff --git a/src/webdav.c b/src/webdav.c
+index 1ff7c7f..74cd957 100644
+--- a/src/webdav.c
++++ b/src/webdav.c
+@@ -25,7 +25,7 @@
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+-#ifdef HAVE_ICONV_H
++#ifdef HAVE_ICONV
+ #include <iconv.h>
+ #endif
+ #ifdef HAVE_LANGINFO_H
+@@ -231,7 +231,7 @@ static int initialized;
+    Needed by  ssl_verify() which may be called at any time. */
+ static int have_terminal;
+-#ifdef HAVE_ICONV_H
++#ifdef HAVE_ICONV
+ /* Handle to convert character encoding from utf-8 to LC_CTYPE.
+    If NULL no conversion is done. */
+ static iconv_t from_utf_8;
+@@ -264,7 +264,7 @@ static char **cookie_list;
+ /* Private function prototypes and inline functions */
+ /*==================================================*/
+-#ifdef HAVE_ICONV_H
++#ifdef HAVE_ICONV
+ static void
+ convert(char **s, iconv_t conv);
+ #endif
+@@ -337,7 +337,7 @@ dav_init_webdav(const dav_args *args)
+     if (args->neon_debug & ~NE_DBG_HTTPPLAIN)
+         syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "Initializing webdav");
+-#ifdef HAVE_ICONV_H
++#ifdef HAVE_ICONV
+     char *lc_charset = nl_langinfo(CODESET);
+     if (lc_charset && strcasecmp(lc_charset, "UTF-8") != 0) {
+         from_utf_8 = iconv_open(lc_charset, "UTF-8");
index 7be49477f7036f631a75b41e4404cd33d5f9bb1c..30ef883e5b82d0d45b093c3416928c0c1c45843e 100755 (executable)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008-2017 OpenWrt.org
+# Copyright (C) 2008-2018 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 #
@@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=ddns-scripts
 # Version == major.minor.patch
 # increase on new functionality (minor) or patches (patch)
-PKG_VERSION:=2.7.6
+PKG_VERSION:=2.7.7
 # Release == build
 # increase on changes of services files or tld_names.dat
-PKG_RELEASE:=13
+PKG_RELEASE:=3
 
 PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
@@ -22,7 +22,7 @@ include $(INCLUDE_DIR)/package.mk
 # no default dependencies
 PKG_DEFAULT_DEPENDS=
 
-define Package/$(PKG_NAME)/Default
+define Package/ddns-scripts/Default
     SECTION:=net
     CATEGORY:=Network
     SUBMENU:=IP Addresses and Names
@@ -30,16 +30,16 @@ define Package/$(PKG_NAME)/Default
 endef
 
 ###### *************************************************************************
-define Package/$(PKG_NAME)
-    $(call Package/$(PKG_NAME)/Default)
+define Package/ddns-scripts
+    $(call Package/ddns-scripts/Default)
     TITLE:=Dynamic DNS Client scripts (with IPv6 support)
 endef
 # shown in LuCI package description
-define Package/$(PKG_NAME)/description
+define Package/ddns-scripts/description
     Dynamic DNS Client scripts (with IPv6 support) - Info: http://wiki.openwrt.org/doc/howto/ddns.client
 endef
 # shown in menuconfig <Help>
-define Package/$(PKG_NAME)/config
+define Package/ddns-scripts/config
        help
                A highly configurable set of scripts for doing dynamic dns updates.
                  - IPv6 support
@@ -54,55 +54,55 @@ define Package/$(PKG_NAME)/config
 endef
 
 ###### *************************************************************************
-define Package/$(PKG_NAME)_cloudflare
-    $(call Package/$(PKG_NAME)/Default)
+define Package/ddns-scripts_cloudflare
+    $(call Package/ddns-scripts/Default)
     TITLE:=CloudFlare.com API v1 (deprecated)
-    DEPENDS:=$(PKG_NAME)
+    DEPENDS:=ddns-scripts
 endef
-define Package/$(PKG_NAME)_cloudflare/description
+define Package/ddns-scripts_cloudflare/description
     Dynamic DNS Client scripts extension for CloudFlare.com API-v1 (deprecated)
 endef
 
 ###### *************************************************************************
-define Package/$(PKG_NAME)_cloudflare.com-v4
-    $(call Package/$(PKG_NAME)/Default)
+define Package/ddns-scripts_cloudflare.com-v4
+    $(call Package/ddns-scripts/Default)
     TITLE:=CloudFlare.com API v4 (require cURL)
-    DEPENDS:=$(PKG_NAME) +curl
+    DEPENDS:=ddns-scripts +curl
 endef
-define Package/$(PKG_NAME)_cloudflare.com-v4/description
+define Package/ddns-scripts_cloudflare.com-v4/description
     Dynamic DNS Client scripts extension for CloudFlare.com API-v4 (require/install cURL)
 endef
 
 ###### *************************************************************************
-define Package/$(PKG_NAME)_godaddy.com-v1
-    $(call Package/$(PKG_NAME)/Default)
+define Package/ddns-scripts_godaddy.com-v1
+    $(call Package/ddns-scripts/Default)
     TITLE:=GoDaddy.com (require cURL)
-    DEPENDS:=$(PKG_NAME) +curl
+    DEPENDS:=ddns-scripts +curl
 endef
-define Package/$(PKG_NAME)_godaddy.com-v1/description
+define Package/ddns-scripts_godaddy.com-v1/description
     Dynamic DNS Client scripts extension for GoDaddy.com (require/install cURL)
 endef
 
 ###### *************************************************************************
-define Package/$(PKG_NAME)_no-ip_com
-    $(call Package/$(PKG_NAME)/Default)
+define Package/ddns-scripts_no-ip_com
+    $(call Package/ddns-scripts/Default)
     TITLE:=DDNS extension for No-IP.com
-    DEPENDS:=$(PKG_NAME)
+    DEPENDS:=ddns-scripts
 endef
-define Package/$(PKG_NAME)_no-ip_com/description
+define Package/ddns-scripts_no-ip_com/description
     Dynamic DNS Client scripts extension for No-IP.com
 endef
 
 ###### *************************************************************************
-define Package/$(PKG_NAME)_nsupdate
-    $(call Package/$(PKG_NAME)/Default)
+define Package/ddns-scripts_nsupdate
+    $(call Package/ddns-scripts/Default)
     TITLE:=DDNS extension using Bind nsupdate
-    DEPENDS:=$(PKG_NAME) +bind-client
+    DEPENDS:=ddns-scripts +bind-client
 endef
-define Package/$(PKG_NAME)_nsupdate/description
+define Package/ddns-scripts_nsupdate/description
     Dynamic DNS Client scripts extension for direct updates using Bind nsupdate
 endef
-define Package/$(PKG_NAME)_nsupdate/config
+define Package/ddns-scripts_nsupdate/config
     help
        The script directly updates a PowerDNS (or maybe bind server) via nsupdate
        from bind-client package. It requires
@@ -112,6 +112,21 @@ define Package/$(PKG_NAME)_nsupdate/config
 
 endef
 
+###### *************************************************************************
+define Package/ddns-scripts_route53-v1
+    $(call Package/ddns-scripts/Default)
+    TITLE:=Amazon AWS Route 53 API v1
+    DEPENDS:=ddns-scripts +curl +openssl-util
+endef
+define Package/ddns-scripts_route53-v1/description
+       Dynamic DNS Client scripts extension for Amazon AWS Route53. Note: You
+       must also install ca-certificate or ca-bundle.
+       It requires:
+       "option username" to be a valid AWS access key id
+       "option password" to be the matching AWS secret key id
+       "option domain" to contain the hosted zone ID
+endef
+
 ###### *************************************************************************
 define Build/Configure
 endef
@@ -129,21 +144,21 @@ define Build/Compile
                -e '/^[[:space:]]*$$$$/d'       $$$$FILE; \
        done
        # compress public_suffix_list.dat
-       gzip -f9 $(PKG_BUILD_DIR)/files/public_suffix_list.dat
+       gzip -nf9 $(PKG_BUILD_DIR)/files/public_suffix_list.dat
 endef
 
-define Package/$(PKG_NAME)/conffiles
+define Package/ddns-scripts/conffiles
 /etc/config/ddns
 endef
 
 ###### *************************************************************************
-define Package/$(PKG_NAME)/preinst
+define Package/ddns-scripts/preinst
        #!/bin/sh
        # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
        exit 0  # suppress errors
 endef
-define Package/$(PKG_NAME)/install
+define Package/ddns-scripts/install
        $(INSTALL_DIR)  $(1)/etc/uci-defaults
        $(INSTALL_BIN)  $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns
        $(INSTALL_DIR)  $(1)/etc/hotplug.d/iface
@@ -159,7 +174,7 @@ define Package/$(PKG_NAME)/install
        $(INSTALL_DIR)  $(1)/usr/lib/ddns
        $(INSTALL_BIN)  $(PKG_BUILD_DIR)/files/dynamic_dns_*.sh $(1)/usr/lib/ddns
 endef
-define Package/$(PKG_NAME)/postinst
+define Package/ddns-scripts/postinst
        #!/bin/sh
        # if NOT run buildroot and PKG_UPGRADE then (re)start service if enabled
        [ -z "$${IPKG_INSTROOT}" -a "$${PKG_UPGRADE}" = "1" ] && {
@@ -171,7 +186,7 @@ define Package/$(PKG_NAME)/postinst
        }
        exit 0  # suppress errors
 endef
-define Package/$(PKG_NAME)/prerm
+define Package/ddns-scripts/prerm
        #!/bin/sh
        # if run within buildroot exit
        [ -n "$${IPKG_INSTROOT}" ] && exit 0
@@ -184,13 +199,13 @@ define Package/$(PKG_NAME)/prerm
 endef
 
 ###### *************************************************************************
-define Package/$(PKG_NAME)_cloudflare/preinst
+define Package/ddns-scripts_cloudflare/preinst
        #!/bin/sh
        # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
        exit 0  # suppress errors
 endef
-define Package/$(PKG_NAME)_cloudflare/install
+define Package/ddns-scripts_cloudflare/install
        $(INSTALL_DIR)  $(1)/etc/uci-defaults
        $(INSTALL_BIN)  $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_cloudflare
        $(INSTALL_DIR)  $(1)/usr/share
@@ -198,7 +213,7 @@ define Package/$(PKG_NAME)_cloudflare/install
        $(INSTALL_DIR)  $(1)/usr/lib/ddns
        $(INSTALL_BIN)  $(PKG_BUILD_DIR)/files/update_cloudflare_com_v1.sh $(1)/usr/lib/ddns
 endef
-define Package/$(PKG_NAME)_cloudflare/postinst
+define Package/ddns-scripts_cloudflare/postinst
        #!/bin/sh
        # remove old services file entries
        /bin/sed -i '/cloudflare\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services         >/dev/null 2>&1
@@ -216,7 +231,7 @@ define Package/$(PKG_NAME)_cloudflare/postinst
        }
        exit 0  # suppress errors
 endef
-define Package/$(PKG_NAME)_cloudflare/prerm
+define Package/ddns-scripts_cloudflare/prerm
        #!/bin/sh
        # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop                             >/dev/null 2>&1
@@ -227,19 +242,19 @@ define Package/$(PKG_NAME)_cloudflare/prerm
 endef
 
 ###### *************************************************************************
-define Package/$(PKG_NAME)_cloudflare.com-v4/preinst
+define Package/ddns-scripts_cloudflare.com-v4/preinst
        #!/bin/sh
        # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
        exit 0  # suppress errors
 endef
-define Package/$(PKG_NAME)_cloudflare.com-v4/install
+define Package/ddns-scripts_cloudflare.com-v4/install
        $(INSTALL_DIR) $(1)/etc/uci-defaults
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_cloudflare.com-v4
        $(INSTALL_DIR) $(1)/usr/lib/ddns
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_cloudflare_com_v4.sh $(1)/usr/lib/ddns
 endef
-define Package/$(PKG_NAME)_cloudflare.com-v4/postinst
+define Package/ddns-scripts_cloudflare.com-v4/postinst
        #!/bin/sh
        # remove old services file entries
        /bin/sed -i '/cloudflare\.com-v4/d' $${IPKG_INSTROOT}/etc/ddns/services         >/dev/null 2>&1
@@ -257,7 +272,7 @@ define Package/$(PKG_NAME)_cloudflare.com-v4/postinst
        }
        exit 0  # suppress errors
 endef
-define Package/$(PKG_NAME)_cloudflare.com-v4/prerm
+define Package/ddns-scripts_cloudflare.com-v4/prerm
        #!/bin/sh
        # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop                             >/dev/null 2>&1
@@ -268,19 +283,19 @@ define Package/$(PKG_NAME)_cloudflare.com-v4/prerm
 endef
 
 ###### *************************************************************************
-define Package/$(PKG_NAME)_godaddy.com-v1/preinst
+define Package/ddns-scripts_godaddy.com-v1/preinst
        #!/bin/sh
        # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
        exit 0  # suppress errors
 endef
-define Package/$(PKG_NAME)_godaddy.com-v1/install
+define Package/ddns-scripts_godaddy.com-v1/install
        $(INSTALL_DIR) $(1)/etc/uci-defaults
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_godaddy.com-v1
        $(INSTALL_DIR) $(1)/usr/lib/ddns
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_godaddy_com_v1.sh $(1)/usr/lib/ddns
 endef
-define Package/$(PKG_NAME)_godaddy.com-v1/postinst
+define Package/ddns-scripts_godaddy.com-v1/postinst
        #!/bin/sh
        # remove old services file entries
        /bin/sed -i '/godaddy\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services            >/dev/null 2>&1
@@ -298,7 +313,7 @@ define Package/$(PKG_NAME)_godaddy.com-v1/postinst
        }
        exit 0  # suppress errors
 endef
-define Package/$(PKG_NAME)_godaddy.com-v1/prerm
+define Package/ddns-scripts_godaddy.com-v1/prerm
        #!/bin/sh
        # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop                             >/dev/null 2>&1
@@ -309,19 +324,19 @@ define Package/$(PKG_NAME)_godaddy.com-v1/prerm
 endef
 
 ###### *************************************************************************
-define Package/$(PKG_NAME)_no-ip_com/preinst
+define Package/ddns-scripts_no-ip_com/preinst
        #!/bin/sh
        # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
        exit 0  # suppress errors
 endef
-define Package/$(PKG_NAME)_no-ip_com/install
+define Package/ddns-scripts_no-ip_com/install
        $(INSTALL_DIR) $(1)/etc/uci-defaults
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_no-ip_com
        $(INSTALL_DIR) $(1)/usr/lib/ddns
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_no-ip_com.sh $(1)/usr/lib/ddns
 endef
-define Package/$(PKG_NAME)_no-ip_com/postinst
+define Package/ddns-scripts_no-ip_com/postinst
        #!/bin/sh
        # remove old services file entries
        /bin/sed -i '/no-ip\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
@@ -337,7 +352,7 @@ define Package/$(PKG_NAME)_no-ip_com/postinst
        }
        exit 0  # suppress errors
 endef
-define Package/$(PKG_NAME)_no-ip_com/prerm
+define Package/ddns-scripts_no-ip_com/prerm
        #!/bin/sh
        # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop             >/dev/null 2>&1
@@ -347,19 +362,19 @@ define Package/$(PKG_NAME)_no-ip_com/prerm
 endef
 
 ###### *************************************************************************
-define Package/$(PKG_NAME)_nsupdate/preinst
+define Package/ddns-scripts_nsupdate/preinst
        #!/bin/sh
        # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
        exit 0  # suppress errors
 endef
-define Package/$(PKG_NAME)_nsupdate/install
+define Package/ddns-scripts_nsupdate/install
        $(INSTALL_DIR) $(1)/etc/uci-defaults
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_nsupdate
        $(INSTALL_DIR) $(1)/usr/lib/ddns
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_nsupdate.sh $(1)/usr/lib/ddns
 endef
-define Package/$(PKG_NAME)_nsupdate/postinst
+define Package/ddns-scripts_nsupdate/postinst
        #!/bin/sh
        # remove old services file entries
        /bin/sed -i '/bind-nsupdate/d' $${IPKG_INSTROOT}/etc/ddns/services      >/dev/null 2>&1
@@ -377,7 +392,7 @@ define Package/$(PKG_NAME)_nsupdate/postinst
        }
        exit 0  # suppress errors
 endef
-define Package/$(PKG_NAME)_nsupdate/prerm
+define Package/ddns-scripts_nsupdate/prerm
        #!/bin/sh
        # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop                     >/dev/null 2>&1
@@ -388,9 +403,51 @@ define Package/$(PKG_NAME)_nsupdate/prerm
 endef
 
 ###### *************************************************************************
-$(eval $(call BuildPackage,$(PKG_NAME)))
-$(eval $(call BuildPackage,$(PKG_NAME)_cloudflare))
-$(eval $(call BuildPackage,$(PKG_NAME)_cloudflare.com-v4))
-$(eval $(call BuildPackage,$(PKG_NAME)_godaddy.com-v1))
-$(eval $(call BuildPackage,$(PKG_NAME)_no-ip_com))
-$(eval $(call BuildPackage,$(PKG_NAME)_nsupdate))
+define Package/ddns-scripts_route53-v1/preinst
+       #!/bin/sh
+       # if NOT run buildroot then stop service
+       [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
+       exit 0  # suppress errors
+endef
+define Package/ddns-scripts_route53-v1/install
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_route53-v1
+       $(INSTALL_DIR) $(1)/usr/lib/ddns
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_route53_v1.sh $(1)/usr/lib/ddns
+endef
+define Package/ddns-scripts_route53-v1/postinst
+       #!/bin/sh
+       # remove old services file entries
+       /bin/sed -i '/route53-v1/d' $${IPKG_INSTROOT}/etc/ddns/services         >/dev/null 2>&1
+       /bin/sed -i '/route53-v1/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6    >/dev/null 2>&1
+       # and create new
+       printf "%s\\t%s\\n" '"route53-v1"' '"update_route53_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
+       printf "%s\\t%s\\n" '"route53-v1"' '"update_route53_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
+       # on real system restart service if enabled
+       [ -z "$${IPKG_INSTROOT}" ] && {
+               [ -x /etc/uci-defaults/ddns_route53-v1 ] && \
+                       /etc/uci-defaults/ddns_route53-v1 && \
+                               rm -f /etc/uci-defaults/route53.com-v1 >/dev/null 2>&1
+               /etc/init.d/ddns enabled \
+                       && /etc/init.d/ddns start >/dev/null 2>&1
+       }
+       exit 0  # suppress errors
+endef
+define Package/ddns-scripts_route53-v1/prerm
+       #!/bin/sh
+       # if NOT run buildroot then stop service
+       [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop                             >/dev/null 2>&1
+       # remove services file entries
+       /bin/sed -i 'route53-v1/d' $${IPKG_INSTROOT}/etc/ddns/services          >/dev/null 2>&1
+       /bin/sed -i 'route53-v1/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6     >/dev/null 2>&1
+       exit 0  # suppress errors
+endef
+
+###### *************************************************************************
+$(eval $(call BuildPackage,ddns-scripts))
+$(eval $(call BuildPackage,ddns-scripts_cloudflare))
+$(eval $(call BuildPackage,ddns-scripts_cloudflare.com-v4))
+$(eval $(call BuildPackage,ddns-scripts_godaddy.com-v1))
+$(eval $(call BuildPackage,ddns-scripts_no-ip_com))
+$(eval $(call BuildPackage,ddns-scripts_nsupdate))
+$(eval $(call BuildPackage,ddns-scripts_route53-v1))
index c8b3962aae0da75ea2f6a94625f42711cc4a3e07..90501ac695a507c2203eb350fde59512e7d136af 100755 (executable)
@@ -6,7 +6,7 @@
 # (Loosely) based on the script on the one posted by exobyte in the forums here:
 # http://forum.openwrt.org/viewtopic.php?id=14040
 # extended and partial rewritten
-#.2014-2017 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#.2014-2018 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
 #
 # function timeout
 # copied from http://www.ict.griffith.edu.au/anthony/software/timeout.sh
@@ -21,7 +21,7 @@
 . /lib/functions/network.sh
 
 # GLOBAL VARIABLES #
-VERSION="2.7.6-13"
+VERSION="2.7.7-2"
 SECTION_ID=""          # hold config's section name
 VERBOSE=0              # default mode is log to console, but easily changed with parameter
 MYPROG=$(basename $0)  # my program call name
@@ -31,6 +31,7 @@ PIDFILE=""            # pid file
 UPDFILE=""             # store UPTIME of last update
 DATFILE=""             # save stdout data of WGet and other external programs called
 ERRFILE=""             # save stderr output of WGet and other external programs called
+IPFILE=""              # store registered IP for read by LuCI status
 TLDFILE=/usr/share/public_suffix_list.dat.gz   # TLD file used by split_FQDN
 
 CHECK_SECONDS=0                # calculated seconds out of given
@@ -81,7 +82,7 @@ CURL=$(which curl)
 # CURL_SSL not empty then SSL support available
 CURL_SSL=$($(which curl) -V 2>/dev/null | grep "Protocols:" | grep -F "https")
 # CURL_PROXY not empty then Proxy support available
-CURL_PROXY=$(find /lib /usr/lib -name libcurl.so* -exec grep -i "all_proxy" {} 2>/dev/null \;)
+CURL_PROXY=$(find /lib /usr/lib -name libcurl.so* -exec strings {} 2>/dev/null \; | grep -im1 "all_proxy")
 
 UCLIENT_FETCH=$(which uclient-fetch)
 # UCLIENT_FETCH_SSL not empty then SSL support available
@@ -261,7 +262,9 @@ write_log() {
        [ $VERBOSE -gt 0 -o $__EXIT -gt 0 ] && echo -e "$__MSG"
        # write to logfile
        if [ ${use_logfile:-1} -eq 1 -o $VERBOSE -gt 1 ]; then
-               echo -e "$__MSG" >> $LOGFILE
+               printf "%s\n" "$__MSG" | \
+                       sed -e "s/$password/*password*/g; \
+                               s/$URL_PASS/*URL_PASS*/g" >> $LOGFILE
                # VERBOSE > 1 then NO loop so NO truncate log to $ddns_loglines lines
                [ $VERBOSE -gt 1 ] || sed -i -e :a -e '$q;N;'$ddns_loglines',$D;ba' $LOGFILE
        fi
@@ -894,6 +897,7 @@ get_local_ip () {
        while : ; do
                if [ -n "$ip_network" ]; then
                        # set correct program
+                       network_flush_cache     # force re-read data from ubus
                        [ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" \
                                            || __RUNPROG="network_get_ipaddr6"
                        eval "$__RUNPROG __DATA $ip_network" || \
@@ -1140,12 +1144,14 @@ get_registered_ip() {
                        fi
                        [ -n "$__DATA" ] && {
                                write_log 7 "Registered IP '$__DATA' detected"
+                               [ -z "$IPFILE" ] || echo "$__DATA" > $IPFILE
                                eval "$1=\"$__DATA\""   # valid data found
                                return 0                # leave here
                        }
                        write_log 4 "NO valid IP found"
                        __ERR=127
                fi
+               [ -z "$IPFILE" ] || echo "" > $IPFILE
 
                [ -n "$LUCI_HELPER" ] && return $__ERR  # no retry if called by LuCI helper script
                [ -n "$2" ] && return $__ERR            # $2 is given -> no retry
index 4948e981504ea382625b6ff352b9cf6e848eab42..ab3eb78e725e35ce3218bc4d39c945e560bd8fc9 100755 (executable)
@@ -2,7 +2,7 @@
 # /usr/lib/ddns/dynamic_dns_lucihelper.sh
 #
 #.Distributed under the terms of the GNU General Public License (GPL) version 2.0
-#.2014-2017 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#.2014-2018 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
 # This script is used by luci-app-ddns
 #
 # variables in small chars are read from /etc/config/ddns as parameter given here
@@ -104,6 +104,7 @@ case "$1" in
        get_registered_ip)
                [ -z "$lookup_host" ] && usage_err "command 'get_registered_ip': 'lookup_host' not set" 
                write_log 7 "-----> get_registered_ip IP"
+               [ -z "$SECTION" ] || IPFILE="$ddns_rundir/$SECTION.ip"
                IP=""
                get_registered_ip IP
                __RET=$?
index 46e5842908e48beefe039a9a299c52756e3c0925..b2baae231bd20a7030b1aa5b7a639380c30fda76 100755 (executable)
@@ -6,7 +6,7 @@
 # (Loosely) based on the script on the one posted by exobyte in the forums here:
 # http://forum.openwrt.org/viewtopic.php?id=14040
 # extended and partial rewritten
-#.2014-2017 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#.2014-2018 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
 #
 # variables in small chars are read from /etc/config/ddns
 # variables in big chars are defined inside these scripts as global vars
@@ -101,6 +101,7 @@ PIDFILE="$ddns_rundir/$SECTION_ID.pid"      # Process ID file
 UPDFILE="$ddns_rundir/$SECTION_ID.update"      # last update successful send (system uptime)
 DATFILE="$ddns_rundir/$SECTION_ID.dat" # save stdout data of WGet and other extern programs called
 ERRFILE="$ddns_rundir/$SECTION_ID.err" # save stderr output of WGet and other extern programs called
+IPFILE="$ddns_rundir/$SECTION_ID.ip"   #
 LOGFILE="$ddns_logdir/$SECTION_ID.log" # log file
 
 # VERBOSE > 1 delete logfile if exist to create an empty one
index 78b345675ad2ddf7db834d4f8d9d1df3b0932ddf..a5e43b3a4d89248c03591d4cb133c8d07f597b87 100644 (file)
@@ -37,6 +37,7 @@
 #.cloudflare.com-v4    !!! Please install additional package "ddns-scripts_cloudflare.com-v4"
 #.godaddy.com-v1       !!! Please install additional package "ddns-scripts_godaddy.com-v1"
 #.no-ip.com / noip.com !!! Please install additional package "ddns-scripts_no-ip_com"
+#.route53-v1           !!! Please install additional package "ddns-scripts_route53-v1"
 
 "3322.org"             "http://[USERNAME]:[PASSWORD]@members.3322.org/dyndns/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]"
 
@@ -44,6 +45,8 @@
 
 "afraid.org-basicauth" "http://[USERNAME]:[PASSWORD]@freedns.afraid.org/nic/update?hostname=[DOMAIN]&myip=[IP]"
 "afraid.org-keyauth"   "http://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]"
+"afraid.org-v2-basic"  "http://[USERNAME]:[PASSWORD]@sync.afraid.org/u/?h=[DOMAIN]&ip=[IP]"
+"afraid.org-v2-token"  "http://sync.afraid.org/u/[PASSWORD]/?address=[IP]"
 
 "all-inkl.com"         "http://[USERNAME]:[PASSWORD]@dyndns.kasserver.com/?myip=[IP]"
 
 
 "ddo.jp"               "http://free.ddo.jp/dnsupdate.php?dn=[DOMAIN]&pw=[PASSWORD]&ip=[IP]"
 
-"desec.io"             "http://[USERNAME]:[PASSWORD]@update.dedyn.io/?hostname=[DOMAIN]&myipv4=[IP]"   "good|nochg"
+"desec.io"             "http://update.dedyn.io/?username=[USERNAME]&password=[PASSWORD]&hostname=[DOMAIN]&myipv4=[IP]" "good|nochg"
 
 "dhis.org"             "http://[USERNAME]:[PASSWORD]@is.dhis.org/"
 
 "dnsdynamic.org"       "http://[USERNAME]:[PASSWORD]@www.dnsdynamic.org/api/?hostname=[DOMAIN]&myip=[IP]"      "good|nochg"
 
-"dnsexit.com"          "http://www.dnsexit.com/RemoteUpdate.sv?login=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&myip=[IP]"   "0=|1="
+"dnsever.com"          "http://[USERNAME]:[PASSWORD]@dyna.dnsever.com/update.php?host[[DOMAIN]]"
+
+"dnsexit.com"          "http://update.dnsexit.com/RemoteUpdate.sv?login=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&myip=[IP]"
 
 "dnshome.de"           "http://[USERNAME]:[PASSWORD]@www.dnshome.de/dyndns.php?hostname=[DOMAIN]&ip=[IP]"
 
-"dnsmadeeasy.com"      "http://www.dnsmadeeasy.com/servlet/updateip?username=[USERNAME]&password=[PASSWORD}&id=[DOMAIN]&ip=[IP]"       "success|ip-same"
+"dnsmadeeasy.com"      "http://cp.dnsmadeeasy.com/servlet/updateip?username=[USERNAME]&password=[PASSWORD]&id=[DOMAIN]&ip=[IP]"        "success|ip-same"
 
 "dnsmax.com"           "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=1&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]"
 
@@ -82,7 +87,7 @@
 
 "dtdns.com"            "http://www.dtdns.com/api/autodns.cfm?id=[DOMAIN]&pw=[PASSWORD]&ip=[IP]"
 
-"duckdns.org"          "http://www.duckdns.org/update?domains=[USERNAME]&token=[PASSWORD]&ip=[IP]"     "OK"
+"duckdns.org"          "http://www.duckdns.org/update?domains=[DOMAIN]&token=[PASSWORD]&ip=[IP]"       "OK"
 
 "duiadns.net"          "http://ip.duiadns.net/dynamic.duia?host=[DOMAIN]&password=[PASSWORD]&ip4=[IP]"
 
 
 "dynu.com"             "http://api.dynu.com/nic/update?hostname=[DOMAIN]&myip=[IP]&username=[USERNAME]&password=[PASSWORD]"
 
-"dynv6.com"            "http://dynv6.com/api/update?hostname=[DOMAIN]&token=[PASSWORD]&ipv4=[IP]"      "updated"
+"dynv6.com"            "http://dynv6.com/api/update?hostname=[DOMAIN]&token=[PASSWORD]&ipv4=[IP]"      "updated|unchanged"
 
 "easydns.com"          "http://[USERNAME]:[PASSWORD]@api.cp.easydns.com/dyn/generic.php?hostname=[DOMAIN]&myip=[IP]"   "NOERROR"
 
 
 "mydns.jp"             "http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV4ADDR=[IP]"
 
+"myip.co.ua"           "http://[USERNAME]:[PASSWORD]@myip.co.ua/update?hostname=[DOMAIN]&myip=[IP]"    "good"
+
 "myonlineportal.net"   "http://[USERNAME]:[PASSWORD]@myonlineportal.net/updateddns?hostname=[DOMAIN]&ip=[IP]"  "good|nochg"
 
 "mythic-beasts.com"    "http://dnsapi4.mythic-beasts.com/?domain=[USERNAME]&password=[PASSWORD]&command=REPLACE%20[DOMAIN]%2060%20A%20DYNAMIC_IP&origin=."
index 5b2cc23ad225c45d74a56bf00ecadd9f4e94e486..409aea376bae9073cc2b0565316a61a836985345 100644 (file)
 #.cloudflare.com-v4    !!! Please install additional package "ddns-scripts_cloudflare.com-v4"
 #.godaddy.com-v1       !!! Please install additional package "ddns-scripts_godaddy.com-v1"
 #.no-ip.com / noip.com !!! Please install additional package "ddns-scripts_no-ip_com"
+#.route53-v1           !!! Please install additional package "ddns-scripts_route53-v1"
 
 "afraid.org-basicauth" "http://[USERNAME]:[PASSWORD]@freedns.afraid.org/nic/update?hostname=[DOMAIN]&myip=[IP]"
 "afraid.org-keyauth"   "http://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]"
+"afraid.org-v2-basic"  "http://[USERNAME]:[PASSWORD]@v6.sync.afraid.org/u/?h=[DOMAIN]&ip=[IP]"
+"afraid.org-v2-token"  "http://v6.sync.afraid.org/u/[PASSWORD]/?address=[IP]"
 
 "all-inkl.com"         "http://[USERNAME]:[PASSWORD]@dyndns.kasserver.com/?myip=[IP]"
 
@@ -48,7 +51,7 @@
 # "ddnss.de"           "http://[USERNAME]:[PASSWORD]@ip6.ddnss.de/upd.php?host=[DOMAIN]&ip6=[IP]"      "good|nochg"
 "ddnss.de"             "http://ip6.ddnss.de/upd.php?user=[USERNAME]&pwd=[PASSWORD]&host=[DOMAIN]&ip6=[IP]"     "good|nochg"
 
-"desec.io"             "http://[USERNAME]:[PASSWORD]@update.dedyn.io/?hostname=[DOMAIN]&myipv6=[IP]"   "good|nochg"
+"desec.io"             "http://update.dedyn.io/?username=[USERNAME]&password=[PASSWORD]&hostname=[DOMAIN]&myipv6=[IP]" "good|nochg"
 
 "dhis.org"             "http://[USERNAME]:[PASSWORD]@is.dhis.org/"
 
@@ -63,7 +66,9 @@
 "dyn.com"              "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]"        "good|nochg"
 "dyndns.org"           "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]"        "good|nochg"
 
-"dynv6.com"            "http://dynv6.com/api/update?hostname=[DOMAIN]&token=[PASSWORD]&ipv6=[IP]"      "updated"
+"dynu.com"             "http://api.dynu.com/nic/update?hostname=[DOMAIN]&myipv6=[IP]&username=[USERNAME]&password=[PASSWORD]"
+
+"dynv6.com"            "http://dynv6.com/api/update?hostname=[DOMAIN]&token=[PASSWORD]&ipv6=[IP]"      "updated|unchanged"
 
 "goip.de"              "http://www.goip.de/setip?username=[USERNAME]&password=[PASSWORD]&subdomain=[DOMAIN]&ip6=[IP]"
 
index aef3b7327955469ab0402c00ddcced1084f70c66..0c77e8b2bba27d0f2ca7e094b0f20acca12147f6 100755 (executable)
@@ -5,15 +5,16 @@
 # script for sending updates to cloudflare.com
 #.based on Ben Kulbertis cloudflare-update-record.sh found at http://gist.github.com/benkulbertis
 #.and on George Johnson's cf-ddns.sh found at https://github.com/gstuartj/cf-ddns.sh
-#.2016-2017 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#.2016-2018 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
 # CloudFlare API documentation at https://api.cloudflare.com/
 #
 # This script is parsed by dynamic_dns_functions.sh inside send_update() function
 #
 # using following options from /etc/config/ddns
-# option username - your cloudflare e-mail
-# option password - cloudflare api key, you can get it from cloudflare.com/my-account/
-# option domain   - "hostname@yourdomain.TLD"  # syntax changed to remove split_FQDN() function and tld_names.dat.gz
+# option username  - your cloudflare e-mail
+# option password  - cloudflare api key, you can get it from cloudflare.com/my-account/
+# option domain    - "hostname@yourdomain.TLD" # syntax changed to remove split_FQDN() function and tld_names.dat.gz
+# option param_opt - Whether the record is receiving the performance and security benefits of Cloudflare (not empty => false)
 #
 # variable __IP already defined with the ip-address to use for update
 #
@@ -25,7 +26,7 @@
 [ $use_https -eq 0 ] && use_https=1    # force HTTPS
 
 # used variables
-local __HOST __DOMAIN __TYPE __URLBASE __PRGBASE __RUNPROG __DATA __IPV6 __ZONEID __RECID
+local __HOST __DOMAIN __TYPE __URLBASE __PRGBASE __RUNPROG __DATA __IPV6 __ZONEID __RECID __PROXIED
 local __URLBASE="https://api.cloudflare.com/client/v4"
 
 # split __HOST __DOMAIN from $domain
@@ -174,10 +175,16 @@ __DATA=$(grep -o '"content":"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1)
 }
 
 # update is needed
-# let's build data to send,
+# let's build data to send
+# set proxied parameter (default "true")
+[ -z "$param_opt" ] && __PROXIED="true" || {
+       __PROXIED="false"
+       write_log 7 "Cloudflare 'proxied' disabled"
+}
+
 # use file to work around " needed for json
 cat > $DATFILE << EOF
-{"id":"$__ZONEID","type":"$__TYPE","name":"$__HOST","content":"$__IP"}
+{"id":"$__ZONEID","type":"$__TYPE","name":"$__HOST","content":"$__IP","proxied":$__PROXIED}
 EOF
 
 # let's complete transfer command
index 9633b4e245569741855b13a9d6edb3b75e1cbdf6..9845d20a0abbc124ec7f30a3f0ab03357747cd95 100755 (executable)
@@ -4,7 +4,7 @@
 #
 # script for sending updates to godaddy.com
 #.based on GoDaddy.sh v1.0 by Nazar78 @ TeaNazaR.com
-#.2017 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#.2017-2018 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
 # GoDaddy Documentation at https://developer.godaddy.com/doc
 #
 # This script is parsed by dynamic_dns_functions.sh inside send_update() function
@@ -85,6 +85,7 @@ godaddy_transfer() {
                write_log 7 "$(cat $DATFILE)"
                return 1
        }
+       return 0
 }
 
 # Build base command to use
diff --git a/net/ddns-scripts/files/update_route53_v1.sh b/net/ddns-scripts/files/update_route53_v1.sh
new file mode 100644 (file)
index 0000000..6b9b029
--- /dev/null
@@ -0,0 +1,97 @@
+#!/bin/sh
+#.Distributed under the terms of the GNU General Public License (GPL) version 2.0
+#.based on Yuval Adam's route53.sh found at https://github.com/yuvadm/route53-ddns/blob/master/route53.sh
+#.2017 Max Berger <max at berger dot name>
+[ -z "$CURL_SSL" ] && write_log 14 "Amazon AWS Route53 communication require cURL with SSL support. Please install"
+[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing key as 'username'"
+[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing secret as 'password'"
+[ -z "$domain" ] && write_log 14 "Service section not configured correctly! Missing zone id as 'domain'"
+
+set -euo pipefail
+IFS=$'\n\t'
+
+ENDPOINT="route53.amazonaws.com"
+RECORD_TTL=300
+RECORD_NAME="$lookup_host".
+[ $use_ipv6 -eq 0 ] && RECORD_TYPE="A"
+[ $use_ipv6 -eq 1 ] && RECORD_TYPE="AAAA"
+RECORD_VALUE="$LOCAL_IP"
+HOSTED_ZONE_ID="$domain"
+API_PATH="/2013-04-01/hostedzone/${HOSTED_ZONE_ID}/rrset/"
+
+AWS_ACCESS_KEY_ID="$username"
+AWS_SECRET_ACCESS_KEY="$password"
+AWS_REGION='us-east-1'
+AWS_SERVICE='route53'
+
+hash() {
+    msg=$1
+    echo -en "$msg" | openssl dgst -sha256 | sed 's/^.* //'
+}
+
+sign_plain() {
+    # Sign message using a plaintext key
+    key=$1
+    msg=$2
+    echo -en "$msg" | openssl dgst -hex -sha256 -hmac "$key" | sed 's/^.* //'
+}
+
+sign() {
+    # Sign message using a hex formatted key
+    key=$1
+    msg=$2
+    echo -en "$msg" | openssl dgst -hex -sha256 -mac HMAC -macopt "hexkey:${key}" | sed 's/^.* //'
+}
+
+request_body="<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
+<ChangeResourceRecordSetsRequest xmlns=\"https://route53.amazonaws.com/doc/2013-04-01/\"> \
+<ChangeBatch> \
+   <Changes> \
+      <Change> \
+         <Action>UPSERT</Action> \
+         <ResourceRecordSet> \
+            <Name>${RECORD_NAME}</Name> \
+            <Type>${RECORD_TYPE}</Type> \
+            <TTL>${RECORD_TTL}</TTL> \
+            <ResourceRecords> \
+               <ResourceRecord> \
+                  <Value>${RECORD_VALUE}</Value> \
+               </ResourceRecord> \
+            </ResourceRecords> \
+         </ResourceRecordSet> \
+      </Change> \
+   </Changes> \
+</ChangeBatch> \
+</ChangeResourceRecordSetsRequest>"
+
+fulldate=$(date --utc +%Y%m%dT%H%M%SZ)
+shortdate=$(date --utc +%Y%m%d)
+signed_headers="host;x-amz-date"
+request_hash=$(hash "$request_body")
+canonical_request="POST\n${API_PATH}\n\nhost:route53.amazonaws.com\nx-amz-date:${fulldate}\n\n${signed_headers}\n${request_hash}"
+
+date_key=$(sign_plain "AWS4${AWS_SECRET_ACCESS_KEY}" "${shortdate}")
+region_key=$(sign "$date_key" $AWS_REGION)
+service_key=$(sign "$region_key" $AWS_SERVICE)
+signing_key=$(sign "$service_key" aws4_request)
+
+credential="${shortdate}/${AWS_REGION}/${AWS_SERVICE}/aws4_request"
+sigmsg="AWS4-HMAC-SHA256\n${fulldate}\n${credential}\n$(hash "$canonical_request")"
+
+signature=$(sign "$signing_key" "$sigmsg")
+
+authorization="AWS4-HMAC-SHA256 Credential=${AWS_ACCESS_KEY_ID}/${credential}, SignedHeaders=${signed_headers}, Signature=${signature}"
+
+ANSWER=$(curl \
+    -X "POST" \
+    -H "Host: route53.amazonaws.com" \
+    -H "X-Amz-Date: ${fulldate}" \
+    -H "Authorization: ${authorization}" \
+    -H "Content-Type: text/xml" \
+    -d "$request_body" \
+    "https://${ENDPOINT}${API_PATH}")
+write_log 7 "${ANSWER}"
+
+echo ${ANSWER} | grep Error >/dev/null && return 1
+echo ${ANSWER} | grep ChangeInfo >/dev/null && return 0
+return 2
index 937362ff460ecccf41ecb9fdd313fa29368887db..87847533948d16afccb66cf859e4c12ea0b28d1c 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=@SAVANNAH/dhcp-fwd/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=9d1ea7939fef93ae7d7caef43397a908
+PKG_HASH:=6abf8e6a72ad01df90efba543c9a18c149b24d50d000e66ce55209780dc04cd5
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index 9add734765b4a602016f74691940276d65d42a3c..a5119c6da0bb72950091ca651ef0edd7844a9734 100644 (file)
@@ -8,18 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dhcpcd
-PKG_VERSION:=6.4.3
+PKG_VERSION:=6.11.5
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=ftp://roy.marples.name/pub/dhcpcd \
     http://roy.marples.name/downloads/dhcpcd
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=b22005c131e7108ecf598b6a4ac091eb
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_HASH:=6f9674dc7e27e936cc787175404a6171618675ecfb6903ab9887b1b66a87d69e
 
 PKG_LICENSE:=BSD-2c
 PKG_LICENSE_FILES:=
 
-PKG_MAINTAINER:=Roy Marples <roy@marples.name>
+PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
@@ -45,8 +45,11 @@ define Package/dhcpcd/description
     * ARP ping profiles
 endef
 
-CONFIGURE_ARGS+=       --prefix=/ --sbindir=/sbin \
-                       --libexecdir=/lib/dhcpcd --dbdir=/var/dhcpcd
+CONFIGURE_ARGS+= \
+       --prefix=/ \
+       --sbindir=/sbin \
+       --libexecdir=/lib/dhcpcd \
+       --dbdir=/var/dhcpcd
 
 define Package/dhcpcd/install
        $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/dhcpcd/dhcpcd-hooks
diff --git a/net/dhcpcd/patches/001-fix-musl.patch b/net/dhcpcd/patches/001-fix-musl.patch
deleted file mode 100644 (file)
index 5751a4c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/dhcp6.c
-+++ b/dhcp6.c
-@@ -1047,8 +1047,8 @@ logsend:
-       ctx = ifp->ctx->ipv6;
-       dst.sin6_scope_id = ifp->index;
--      ctx->sndhdr.msg_name = (caddr_t)&dst;
--      ctx->sndhdr.msg_iov[0].iov_base = (caddr_t)state->send;
-+      ctx->sndhdr.msg_name = (void *)&dst;
-+      ctx->sndhdr.msg_iov[0].iov_base = (void *)state->send;
-       ctx->sndhdr.msg_iov[0].iov_len = state->send_len;
-       /* Set the outbound interface */
diff --git a/net/dmapd/Makefile b/net/dmapd/Makefile
new file mode 100644 (file)
index 0000000..91aefe4
--- /dev/null
@@ -0,0 +1,66 @@
+#
+# Copyright (C) 2009-2012 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:=dmapd
+PKG_VERSION:=0.0.73
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.flyn.org/projects/dmapd
+PKG_HASH:=5447e8d28cd93739efe479e8ca3e140043b11aca4427676e8990b300618011a1
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=2
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/dmapd
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+libdmapsharing +libdb47 +vips
+  TITLE:= dmapd
+  URL:=http://www.flyn.org/projects/dmapd/
+  USERID:=dmapd=56:dmapd=56
+endef
+
+define Package/dmapd/decription
+       Dmapd is a DMAP server
+endef
+
+define Package/dmapd/conffiles
+/etc/dmapd.conf
+endef
+
+TARGET_LDFLAGS+=\
+       -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
+
+define Package/dmapd/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/distro/dmapd.conf $(1)/etc/
+       $(INSTALL_BIN) ./files/dmapd.init $(1)/etc/init.d/dmapd
+       $(INSTALL_DIR) $(1)/usr/lib/dmapd/$(PKG_VERSION)/modules
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/sbin/dmapd \
+               $(1)/usr/sbin/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libdmapd.so* \
+               $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/dmapd/$(PKG_VERSION)/modules/*.so \
+               $(1)/usr/lib/dmapd/$(PKG_VERSION)/modules/
+endef
+
+$(eval $(call BuildPackage,dmapd))
diff --git a/net/dmapd/files/dmapd.init b/net/dmapd/files/dmapd.init
new file mode 100644 (file)
index 0000000..76ecd50
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2009-2012 OpenWrt.org
+
+START=60
+
+start() {
+       [ -d /var/run/dmapd ] || {
+               mkdir -m 0755 -p /var/run/dmapd
+               chown dmapd:dmapd /var/run/dmapd
+       }
+       [ -d /var/db/dmapd/DAAP ] || {
+               mkdir -m 0755 -p /var/db/dmapd/DAAP
+               chown dmapd:dmapd /var/db/dmapd/DAAP
+       }
+       [ -d /var/db/dmapd/DPAP ] || {
+               mkdir -m 0755 -p /var/db/dmapd/DPAP
+               chown dmapd:dmapd /var/db/dmapd/DPAP
+       }
+       mkdir -m 0755 -p /var/lock/subsys
+       mkdir -m 0755 -p /var/media/music
+       mkdir -m 0755 -p /var/media/pictures
+
+       service_start /usr/sbin/dmapd -u dmapd -g dmapd -m /var/media/music -p /var/media/pictures --vips-disc-threshold 64k
+}
+
+stop() {
+       service_stop /usr/sbin/dmapd
+}
diff --git a/net/dmapd/patches/001-dmapd_conf.patch b/net/dmapd/patches/001-dmapd_conf.patch
new file mode 100644 (file)
index 0000000..9c1e60a
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/distro/dmapd.conf
++++ b/distro/dmapd.conf
+@@ -3,7 +3,7 @@
+ Database-Dir=/var/db/dmapd
+ # Name that will be used to identify share:
+-Share-Name=dmapd
++Share-Name=OpenWrt
+ # User that dmapd will run as, current user if undefined:
+ User=dmapd
diff --git a/net/dmapd/patches/002-make_unit_test_optionnal.patch b/net/dmapd/patches/002-make_unit_test_optionnal.patch
new file mode 100644 (file)
index 0000000..3f42f6b
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -233,7 +233,13 @@ else
+   AM_CONDITIONAL(USE_LIBDB, false)
+ fi
+-PKG_CHECK_MODULES([CHECK], [check >= 0.9.4],have_check=yes,have_check=no)
++dnl Test if --enable-unit-test given
++AC_ARG_ENABLE(unit-test, [AC_HELP_STRING([--enable-unit-test],[enable unit test])])
++if test "x$enable_unit_test" = "xyes" ; then
++  PKG_CHECK_MODULES([CHECK], [check >= 0.9.4],have_check=yes,have_check=no)
++else
++  have_check=no
++fi
+ AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
+ AM_CONDITIONAL(FLYN, test "$FLYN")
diff --git a/net/dnscrypt-proxy/Config.in b/net/dnscrypt-proxy/Config.in
new file mode 100755 (executable)
index 0000000..50d09af
--- /dev/null
@@ -0,0 +1,8 @@
+menu "Configuration"
+       depends on PACKAGE_dnscrypt-proxy
+
+config DNSCRYPT_ENABLE_PLUGINS
+       bool "Enable plugin support (includes libldns and plugins, increases size by 125kB)"
+       default n
+
+endmenu
index c4b36f1b8b6825161a5c531efe2351901ceccd1b..ddaca8954970bea97e38307a26e4404a4d599b13 100644 (file)
@@ -1,7 +1,5 @@
 #
-# Copyright (C) 2016 OpenWrt.org
-# Copyright (C) 2012-2016 Black Roland and contributors (https://github.com/black-roland/exOpenWrt/graphs/contributors)
-# Copyright (C) 2011-2012 Entware
+# Copyright (C) 2018 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:=dnscrypt-proxy
-PKG_VERSION:=1.9.4
-PKG_RELEASE:=1
+PKG_VERSION:=1.9.5
+PKG_RELEASE:=8
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_VERSION:=f71ca699aa3399f0c103c1f13ce1a86f9ce9638c
+PKG_SOURCE_URL:=https://github.com/dyne/dnscrypt-proxy
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_MIRROR_HASH:=a3a52f7f85b390184695db688c9837bf51cf25c4cb2c1093bb315640dbd2a54f
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://download.dnscrypt.org/dnscrypt-proxy
-PKG_MD5SUM:=fdf4a708e7922e13b14555f315ca8d5361aec89b0595b06fdbbcaacfa4e6f11e
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
 PKG_MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
 PKG_LICENSE:=ISC
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_DNSCRYPT_ENABLE_PLUGINS
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -28,13 +32,14 @@ define Package/dnscrypt-proxy/Default
   SECTION:=net
   CATEGORY:=Network
   SUBMENU:=IP Addresses and Names
-  URL:=http://dnscrypt.org/
+  URL:=https://github.com/dyne/dnscrypt-proxy
   MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
 endef
 
 define Package/dnscrypt-proxy
   $(call Package/dnscrypt-proxy/Default)
-  DEPENDS:=+libsodium +dnscrypt-proxy-resolvers
+  DEPENDS:=+libsodium +dnscrypt-proxy-resolvers +DNSCRYPT_ENABLE_PLUGINS:libltdl \
+       +DNSCRYPT_ENABLE_PLUGINS:libldns
   TITLE:=A tool for securing communications between a client and a DNS resolver
 endef
 
@@ -50,7 +55,7 @@ endef
 define Package/dnscrypt-proxy-resolvers
   $(call Package/dnscrypt-proxy/Default)
   TITLE:=Package with current list of dnscrypt-proxy resolvers
-  VERSION:=$(PKG_VERSION)+git-20161129-f17bace-$(PKG_RELEASE)
+  VERSION:=$(PKG_VERSION)+git-20171001-2d43be3-$(PKG_RELEASE)
 endef
 
 define Package/dnscrypt-proxy-resolvers/description
@@ -68,11 +73,15 @@ define Package/hostip/description
   to IPv4 or IPv6 addresses.
 endef
 
+define Package/dnscrypt-proxy/config
+       source "$(SOURCE)/Config.in"
+endef
+
 define Build/Configure
        $(call Build/Configure/Default, \
        --prefix=/usr \
        --disable-ssp \
-       --disable-plugins \
+       $(if $(CONFIG_DNSCRYPT_ENABLE_PLUGINS),,--disable-plugins) \
        )
 endef
 
@@ -95,6 +104,12 @@ define Package/dnscrypt-proxy/install
        $(INSTALL_BIN) ./files/dnscrypt-proxy.init $(1)/etc/init.d/dnscrypt-proxy
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_CONF) ./files/dnscrypt-proxy.config $(1)/etc/config/dnscrypt-proxy
+       $(if $(CONFIG_DNSCRYPT_ENABLE_PLUGINS), \
+               $(INSTALL_DIR) $(1)/usr/lib/dnscrypt-proxy; \
+               $(CP) $(PKG_INSTALL_DIR)/usr/lib/dnscrypt-proxy/libdcplugin_example_cache.so $(1)/usr/lib/dnscrypt-proxy/; \
+               $(CP) $(PKG_INSTALL_DIR)/usr/lib/dnscrypt-proxy/libdcplugin_example_ldns_aaaa_blocking.so $(1)/usr/lib/dnscrypt-proxy/; \
+               $(CP) $(PKG_INSTALL_DIR)/usr/lib/dnscrypt-proxy/libdcplugin_example_ldns_blocking.so $(1)/usr/lib/dnscrypt-proxy/; \
+               $(CP) $(PKG_INSTALL_DIR)/usr/lib/dnscrypt-proxy/libdcplugin_example_logging.so $(1)/usr/lib/dnscrypt-proxy/)
 endef
 
 define Package/dnscrypt-proxy-resolvers/install
index 117e84937451c4e53649f0beec4670e2ab80f1dc..635422a1419453c49c6c22e76aacae2860d706e0 100644 (file)
@@ -1,20 +1,28 @@
+config global
+       # start dnscrypt-proxy from procd interface trigger rather than immediately in init
+       # if needed you can restrict trigger to certain interface(s)
+       # list procd_trigger 'wan'
+       # list procd_trigger 'wan6'
+
 config dnscrypt-proxy ns1
        option address '127.0.0.1'
        option port '5353'
        option resolver 'fvz-anyone'
+       # more details about the following options can be found in:
+       #    https://github.com/dyne/dnscrypt-proxy/blob/master/dnscrypt-proxy.conf
        # option resolvers_list '/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'
        # ephemeral keys option requires extra CPU cycles and can cause huge system load
        # option ephemeral_keys '0'
-       # more details at https://github.com/jedisct1/dnscrypt-proxy#public-key-client-authentication
        # option client_key '/path/to/client_key'
+       # option log_level '6'
        # option syslog '1'
        # option syslog_prefix 'dnscrypt-proxy'
        # option query_log_file '/path/to/logfile'
-       # enable cache may speed up dnscrypt-proxy, see https://github.com/jedisct1/dnscrypt-proxy/wiki/Go-faster
+       # enable cache may speed up dnscrypt-proxy
        # option local_cache '0'
-       # disable IPv6 may also speed up dnscrypt-proxy, see https://github.com/jedisct1/dnscrypt-proxy/wiki/Go-faster
+       # disable IPv6 may also speed up dnscrypt-proxy
        # option block_ipv6 '0'
-       # Blacklists allow you to block domains, ip, ... see https://github.com/jedisct1/dnscrypt-proxy/wiki/Filtering
+       # Blacklists allow you to block domains, ip, ...
        # list blacklist 'domains:/path/to/domains-blacklist-file.txt'
        # list blacklist 'domains:/path/to/domains-blacklist2-file.txt'
 
index ac7109ab3bdadada3bab8991b340acaec7134c99..0958c92844447e657e0d936d825d15dc5c3d61cb 100644 (file)
@@ -1,13 +1,18 @@
 #!/bin/sh /etc/rc.common
 
-START=50
+START=30
 USE_PROCD=1
 PROG=/usr/sbin/dnscrypt-proxy
 CONFIG_DIR=/var/etc
 USER=nobody
 
-dnscrypt_instance() {   
-    local config_path="$CONFIG_DIR/dnscrypt-proxy-$1.conf"     
+boot() {
+    dnscrypt_boot=1
+    rc_procd start_service
+}
+
+dnscrypt_instance() {
+    local config_path="$CONFIG_DIR/dnscrypt-proxy-$1.conf"
     create_config_file $1 "$config_path"
 
     procd_open_instance
@@ -16,8 +21,9 @@ dnscrypt_instance() {
 }
 
 create_config_file() {
-    local address port resolver resolvers_list ephemeral_keys client_key syslog syslog_prefix local_cache query_log_file block_ipv6
+    local address port resolver resolvers_list ephemeral_keys client_key log_level syslog syslog_prefix local_cache query_log_file block_ipv6 provider_name provider_key resolver_address
     local config_path="$2"
+    local plugins_support_enabled=$(dnscrypt-proxy --version | grep 'Support for plugins: present' | wc -l)
 
     [ ! -d "$CONFIG_DIR" ] && mkdir -p "$CONFIG_DIR"
     [ -f "$config_path" ] && rm "$config_path"
@@ -25,28 +31,55 @@ create_config_file() {
     config_get      address         $1 'address'        '127.0.0.1'
     config_get      port            $1 'port'           '5353'
     config_get      resolver        $1 'resolver'       ''
+    config_get      provider_name   $1 'providername'   ''
+    config_get      provider_key    $1 'providerkey'    ''
+    config_get      resolver_address $1 'resolveraddress'    ''
     config_get      resolvers_list  $1 'resolvers_list' '/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'
     config_get      client_key      $1 'client_key'     ''
     config_get      syslog_prefix   $1 'syslog_prefix'  'dnscrypt-proxy'
     config_get      query_log_file  $1 'query_log_file' ''
+    config_get      log_level       $1 'log_level'      '6'
+    config_get      blacklist       $1 'blacklist'      ''
     config_get_bool syslog          $1 'syslog'         '1'
     config_get_bool ephemeral_keys  $1 'ephemeral_keys' '0'
     config_get_bool local_cache     $1 'local_cache'    '0'
     config_get_bool block_ipv6      $1 'block_ipv6'     '0'
-       
+
     append_param_not_empty  "ResolverName"  "$resolver"         $config_path
     append_param            "ResolversList" "$resolvers_list"   $config_path
+    append_param_not_empty  "ProviderName"  "$provider_name"    $config_path
+    append_param_not_empty  "ProviderKey"   "$provider_key"     $config_path
+    append_param_not_empty  "ResolverAddress" "$resolver_address" $config_path
     append_param            "User"          "$USER"             $config_path
     append_param            "LocalAddress"  "$address:$port"    $config_path
     append_param_not_empty  "ClientKey"     "$client_key"       $config_path
     append_on_off           "EphemeralKeys" $ephemeral_keys     $config_path
+    append_param            "LogLevel"      "$log_level"        $config_path
     append_on_off           "Syslog"        $syslog             $config_path
     append_param            "SyslogPrefix"  "$syslog_prefix"    $config_path
     append_on_off           "LocalCache"    $local_cache        $config_path
     append_param_not_empty  "QueryLogFile"  "$query_log_file"   $config_path
-    append_yes_no           "BlockIPv6"     $block_ipv6         $config_path
 
-    config_list_foreach $1 'blacklist' append_blacklists $config_path  
+    if [ $plugins_support_enabled -ne 0 ] && [ $block_ipv6 -ne 0 ]
+    then
+        append_yes_no "BlockIPv6" $block_ipv6 $config_path
+    elif [ $block_ipv6 -ne 0 ]
+    then
+        log_ignored_param "block_ipv6"
+    fi
+
+    if [ $plugins_support_enabled -ne 0 ] && [ -n "$blacklist" ]
+    then
+        config_list_foreach $1 'blacklist' append_blacklists $config_path
+    elif [ -n "$blacklist" ]
+    then
+        log_ignored_param "blacklist"
+    fi
+}
+
+log_ignored_param() {
+    local param_name=$1
+    logger -t dnscrypt-proxy -p user.warn "dnscrypt-proxy plugins support not present, ignoring '$param_name' parameter."
 }
 
 append_on_off() {
@@ -57,7 +90,7 @@ append_on_off() {
 
     if [ $param_value -eq 1 ]
     then
-        value="on"     
+        value="on"
     else
         value="off"
     fi
@@ -73,7 +106,7 @@ append_yes_no() {
 
     if [ $param_value -eq 1 ]
     then
-        value="yes"    
+        value="yes"
     else
         value="no"
     fi
@@ -102,15 +135,32 @@ append_param_not_empty() {
 
 append_blacklists() {
     local value="$1"
-    local config_path="$2"     
+    local config_path="$2"
     append_param_not_empty "BlackList" "$value" $config_path
 }
 
 start_service() {
+    if [ -n "${dnscrypt_boot}" ]
+    then
+        return 0
+    fi
     config_load dnscrypt-proxy
     config_foreach dnscrypt_instance dnscrypt-proxy
 }
 
 service_triggers() {
+    local trigger
+    local triggerlist="$(uci_get dnscrypt-proxy.@global[0].procd_trigger)"
+
+    PROCD_RELOAD_DELAY=2000
+    if [ -n "${triggerlist}" ]
+    then
+        for trigger in ${triggerlist}
+        do
+            procd_add_interface_trigger "interface.*.up" "${trigger}" /etc/init.d/dnscrypt-proxy reload
+        done
+    else
+        procd_add_raw_trigger "interface.*.up" 2000 /etc/init.d/dnscrypt-proxy reload
+    fi
     procd_add_reload_trigger 'dnscrypt-proxy'
 }
index d84341f68b184a2e8b8d8b01c4930b262bbf5092..e2cf7b1324aa5ed127a68f4f7edfa5131b85edf1 100644 (file)
-Name,Full name,Description,Location,Coordinates,URL,Version,DNSSEC validation,No logs,Namecoin,Resolver address,Provider name,Provider public key,Provider public key TXT record\r
-adguard-dns-family-ns1,Adguard DNS Family Protection 1,Adguard DNS with safesearch and adult content blocking,Anycast,,https://adguard.com/en/adguard-dns/overview.html,1,no,yes,no,176.103.130.132:5443,2.dnscrypt.family.ns1.adguard.com,B831:5DD7:B14B:6EE3:20A4:70DC:2ED6:B1AA:398C:C9E5:86F8:5D45:45D6:B8C9:B500:5ABA,pk.family.ns1.adguard.com\r
-adguard-dns-family-ns2,Adguard DNS Family Protection 2,Adguard DNS with safesearch and adult content blocking,Anycast,,https://adguard.com/en/adguard-dns/overview.html,1,no,yes,no,176.103.130.134:5443,2.dnscrypt.family.ns2.adguard.com,8C21:17A9:EBC1:57D6:FB64:056F:0ADB:C11C:5D83:6734:73C4:6E25:8D9B:2F57:D4EE:351F,pk.family.ns2.adguard.com\r
-adguard-dns-ns1,Adguard DNS 1,Remove ads and protect your computer from malware,Anycast,,https://adguard.com/en/adguard-dns/overview.html,1,no,yes,no,176.103.130.130:5443,2.dnscrypt.default.ns1.adguard.com,D12B:47F2:52DC:F2C2:BBF8:9910:86EA:F79C:E449:5D8B:16C8:A0C4:322E:52CA:3F39:0873,pk.default.ns1.adguard.com\r
-adguard-dns-ns2,Adguard DNS 2,Remove ads and protect your computer from malware,Anycast,,https://adguard.com/en/adguard-dns/overview.html,1,no,yes,no,176.103.130.131:5443,2.dnscrypt.default.ns2.adguard.com,81D0:02D3:6A4C:A50C:473B:7479:650F:E12E:02B3:21CB:6138:562A:208E:403D:FDC5:5E94,pk.default.ns2.adguard.com\r
-cisco,Cisco OpenDNS,Remove your DNS blind spot,Anycast,,https://www.opendns.com,1,no,no,no,208.67.220.220,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,\r
-cisco-familyshield,Cisco OpenDNS with FamilyShield,Block websites not suitable for children,Anycast,,https://www.opendns.com/home-internet-security/parental-controls/,1,no,no,no,208.67.220.123,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,\r
-cisco-ipv6,Cisco OpenDNS over IPv6,Cisco OpenDNS IPv6 sandbox,Anycast,,https://www.opendns.com/about/innovations/ipv6/,1,no,no,no,[2620:0:ccc::2]:443,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,\r
-cisco-port53,Cisco OpenDNS backward compatibility port 53,Remove your DNS blind spot,Anycast,,https://www.opendns.com,1,no,no,no,208.67.220.220:53,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,\r
-cloudns-syd,CloudNS Sydney,CloudNS is an Australian based security focused DNS provider,"Sydney, AU",,https://cloudns.com.au,1,yes,yes,no,113.20.8.17,2.dnscrypt-cert-2.cloudns.com.au,67A4:323E:581F:79B9:BC54:825F:54FE:1025:8B4F:37EB:0D07:0BCE:4010:6195:D94F:E330,\r
-cs-cfi,CS cryptofree France DNSCrypt server,provided by cryptostorm.is,"Paris, France",,https://cryptostorm.is,1,no,yes,no,212.83.175.31,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
-cs-cfii,CS secondary cryptofree France DNSCrypt server,provided by cryptostorm.is,"Paris, France",,https://cryptostorm.is,1,no,yes,no,195.154.61.33,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
-cs-ch,CS Switzerland DNSCrypt server,provided by cryptostorm.is,"Baar, Switzerland",,https://cryptostorm.is,1,no,yes,no,185.60.147.77,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
-cs-de,CS Germany DNSCrypt server,provided by cryptostorm.is,"Frankfurt, Germany",,https://cryptostorm.is,1,no,yes,no,46.165.222.246,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
-cs-fr2,CS secondary France DNSCrypt server,provided by cryptostorm.is,"Paris, France",,https://cryptostorm.is,1,no,yes,yes,212.129.46.32,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
-cs-rome,CS Italy DNSCrypt server,provided by cryptostorm.is,"Buffalo, NY",,https://cryptostorm.is,1,no,yes,no,95.141.47.58,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
-cs-useast,CS New York City NY US DNSCrypt server,provided by cryptostorm.is,"Buffalo, NY",,https://cryptostorm.is,1,no,yes,no,173.234.159.235,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
-cs-usnorth,CS Chicago IL US DNSCrypt server,provided by cryptostorm.is,"Chicago, IL",,https://cryptostorm.is,1,no,yes,no,173.234.56.115,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
-cs-ussouth,CS Dallas TX US DNSCrypt server,provided by cryptostorm.is,"Dallas, TX",,https://cryptostorm.is,1,no,yes,no,70.32.38.67,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
-cs-ussouth2,CS Atlanta GA US DNSCrypt server,provided by cryptostorm.is,"Atlanta, GA",,https://cryptostorm.is,1,no,yes,no,108.62.19.131,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
-cs-uswest,CS Seattle WA US DNSCrypt server,provided by cryptostorm.is,"Seattle, WA",,https://cryptostorm.is,1,no,yes,yes,76.164.234.11,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
-cs-uswest2,CS Las Vegas NV US DNSCrypt server,provided by cryptostorm.is,"Las Vegas, NV",,https://cryptostorm.is,1,no,yes,no,104.238.194.235,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
-d0wn-au-ns1,D0wn Resolver Australia 01,Server provided by Martin 'd0wn' Albus,Australia,,https://dns.d0wn.biz,1,no,yes,yes,27.100.36.191,2.dnscrypt-cert.au.d0wn.biz,A7D9:0F8E:9A98:1381:176A:3D25:36DE:E865:8538:9CD8:78BC:C3B5:A146:23F1:C2EF:58D8,pubkey.au.dnscrypt.d0wn.biz\r
-d0wn-bg-ns1,D0wn Resolver Bulgaria 01,Server provided by Martin 'd0wn' Albus,Bulgaria,,https://dns.d0wn.biz,1,no,yes,yes,217.12.203.133,2.dnscrypt-cert.bg.d0wn.biz,423C:D823:B3EA:2015:F027:ECF1:5704:3EB7:764A:D02D:9447:56E6:51FD:D06F:E571:2FCC,pubkey.bg.dnscrypt.d0wn.biz\r
-d0wn-cy-ns1,D0wn Resolver Cyprus 01,Server provided by Martin 'd0wn' Albus,Cyprus,,https://dns.d0wn.biz,1,no,yes,yes,213.169.148.11,2.dnscrypt-cert.cy.d0wn.biz,2144:4FE7:59C3:13B9:FABB:FC2A:F975:9F9C:CD9A:2ED7:0978:3A25:7347:4B83:8F86:EA2B,pubkey.cy.dnscrypt.d0wn.biz\r
-d0wn-de-ns1,D0wn Resolver Germany 01,Server provided by Martin 'd0wn' Albus,Germany,,https://dns.d0wn.biz,1,no,yes,yes,82.211.31.248,2.dnscrypt-cert.de.d0wn.biz,B040:19F8:8D49:4682:41E3:EB58:5F61:173F:EF8E:55DA:0597:2DB7:27BB:C153:1DD8:D109,pubkey.de.dnscrypt.d0wn.biz\r
-d0wn-fr-ns2,D0wn Resolver France 02,Server provided by Martin 'd0wn' Albus,France,,https://dns.d0wn.biz,1,no,yes,yes,37.187.0.40,2.dnscrypt-cert.fr2.d0wn.biz,25A7:DB7B:7835:55D5:7DA4:7C0C:57F8:9C5F:0220:3D09:67E3:585A:723E:E0D1:CB38:F767,pubkey.fr2.dnscrypt.d0wn.biz\r
-d0wn-es-ns1,D0wn Resolver Spain 01- d0wn,Server provided by Martin 'd0wn' Albus,Spain,,https://dns.d0wn.biz,1,no,yes,yes,91.142.220.29,2.dnscrypt-cert.es.d0wn.biz,EB09:E854:AEDA:9705:CB47:ED69:EADD:4156:3653:82C5:C88D:A2E3:6917:3B54:4774:7505,pubkey.es.dnscrypt.d0wn.biz\r
-d0wn-gr-ns1,D0wn Resolver Greece 01,Server provided by Martin 'd0wn' Albus,Greece,,https://dns.d0wn.biz,1,no,yes,yes,85.25.105.193,2.dnscrypt-cert.gr.d0wn.biz,B19C:0B5C:48F2:58FA:0BE4:67F4:5F50:BC7F:985F:C544:8A4F:BC9D:5574:5A35:5701:8009,pubkey.gr.dnscrypt.d0wn.biz\r
-d0wn-hk-ns1,D0wn Resolver Hong Kong 01,Server provided by Martin 'd0wn' Albus,Hong Kong,,https://dns.d0wn.biz,1,no,yes,yes,45.124.66.200,2.dnscrypt-cert.hk.d0wn.biz,84ED:0DFF:7967:5DBD:2D93:65A2:A6AB:7F90:146F:A50B:048C:8C75:651B:AA55:7129:6740,pubkey.hk.dnscrypt.d0wn.biz\r
-d0wn-is-ns1,D0wn Resolver Iceland 01,Server provided by Martin 'd0wn' Albus,Iceland,,https://dns.d0wn.biz,1,no,yes,yes,37.235.49.61,2.dnscrypt-cert.is.d0wn.biz,2B28:974E:073A:6B38:722A:5BE1:F7A0:250C:508F:A809:238F:8F3D:76D8:6098:20D7:B2D9,pubkey.is.dnscrypt.d0wn.biz\r
-d0wn-lu-ns1,D0wn Resolver Luxembourg 01,Server provided by Martin 'd0wn' Albus,Luxembourg,,https://dns.d0wn.biz,1,no,yes,yes,104.244.72.13,2.dnscrypt-cert.lu.d0wn.biz,737B:B68B:7D3C:896F:260D:91C3:60A6:AD64:8CD3:1B22:4D5F:7089:490C:539F:2EC6:C309,pubkey.lu.dnscrypt.d0wn.biz\r
-d0wn-lu-ns1-ipv6,D0wn Resolver Luxembourg 01 over IPv6,Server provided by Martin 'd0wn' Albus,Luxembourg,,https://dns.d0wn.biz,1,no,yes,yes,[2605:6400:30:fbb5:0:1ce:1ce:babe]:443,2.dnscrypt-cert.lu.d0wn.biz,737B:B68B:7D3C:896F:260D:91C3:60A6:AD64:8CD3:1B22:4D5F:7089:490C:539F:2EC6:C309,pubkey.lu.dnscrypt.d0wn.biz\r
-d0wn-lv-ns1,D0wn Resolver Latvia 01,Server provided by Martin 'd0wn' Albus,Latvia,,https://dns.d0wn.biz,1,no,yes,yes,89.111.13.60,2.dnscrypt-cert.lv.d0wn.biz,9AC3:6B4C:7ADB:E7D6:D697:B6BF:151C:151A:B291:8C5D:B912:15F8:B986:5926:33A4:A5E1,pubkey.lv.dnscrypt.d0wn.biz\r
-d0wn-lv-ns2,D0wn Resolver Latvia 02,Server provided by Martin 'd0wn' Albus,Latvia,,https://dns.d0wn.biz,1,no,yes,yes,185.86.151.28,2.dnscrypt-cert.lv2.d0wn.biz,B111:F80C:E3E0:1C36:CC73:0995:009E:6351:EF08:0503:309D:9417:7AA3:8C67:916D:0CDF,pubkey.lv.dnscrypt.d0wn.biz\r
-d0wn-lv-ns2-ipv6,D0wn Resolver Latvia 01 over IPv6,Server provided by Martin 'd0wn' Albus,Latvia,,https://dns.d0wn.biz,1,no,yes,yes,[2a02:7aa0:1201::f60e:2719]:443,2.dnscrypt-cert.lv2.d0wn.biz,B111:F80C:E3E0:1C36:CC73:0995:009E:6351:EF08:0503:309D:9417:7AA3:8C67:916D:0CDF,pubkey.lv.dnscrypt.d0wn.biz\r
-d0wn-nl-ns3,D0wn Resolver Netherlands 03,Server provided by Martin 'd0wn' Albus,Netherlands,,https://dns.d0wn.biz,1,no,yes,yes,185.133.72.116,2.dnscrypt-cert.nl3.d0wn.biz,01FC:1AA9:F71F:F09E:55CE:0D04:9ACA:2B11:9536:319E:04A9:C3AE:77CB:127D:4C53:0651,pubkey.nl3.dnscrypt.d0wn.biz\r
-d0wn-nl-ns3-ipv6,D0wn Resolver Netherlands 03 over IPv6,Server provided by Martin 'd0wn' Albus,Netherlands,,https://dns.d0wn.biz,1,no,yes,yes,[2a06:7240:5:601:dead:beef:e3e7:7a9d]:443,2.dnscrypt-cert.nl3.d0wn.biz,01FC:1AA9:F71F:F09E:55CE:0D04:9ACA:2B11:9536:319E:04A9:C3AE:77CB:127D:4C53:0651,pubkey.nl2.dnscrypt.d0wn.biz\r
-d0wn-random-ns1,D0wn Resolver Moldova 01,Server provided by Martin 'd0wn' Albus,Moldova,,https://dns.d0wn.biz,1,no,yes,yes,178.17.170.133,2.dnscrypt-cert.random.d0wn.biz,A420:867F:ED5C:024C:C86A:EECE:AA05:194B:017F:D2FF:9E72:385A:874F:8CE5:6832:ED2E,pubkey.random.dnscrypt.d0wn.biz\r
-d0wn-random-ns2,D0wn Resolver Netherlands 02,Server provided by Martin 'd0wn' Albus,Netherlands,,https://dns.d0wn.biz,1,no,yes,yes,185.14.29.140,2.dnscrypt-cert.random2.d0wn.biz,7D73:F486:3C01:4CC9:B278:D107:F254:7A4F:1EA2:1081:07B0:CB82:645A:D8A4:B98A:B327,pubkey.random2.dnscrypt.d0wn.biz\r
-d0wn-ro-ns1,D0wn Resolver Romania 01,Server provided by Martin 'd0wn' Albus,Romania,,https://dns.d0wn.biz,1,no,yes,yes,77.81.104.121,2.dnscrypt-cert.ro.d0wn.biz,DA9E:6882:B0F8:335E:B5F4:A059:1B7D:EE6F:BD55:4451:93B4:13BF:AFFC:7D26:4527:CE1A,pubkey.ro.dnscrypt.d0wn.biz\r
-d0wn-ro-ns1-ipv6,D0wn Resolver Romania 01 over IPv6,Server provided by Martin 'd0wn' Albus,Romania,,https://dns.d0wn.biz,1,no,yes,yes,[2a04:9dc0:c1:7::cb9:f785]:443,2.dnscrypt-cert.ro.d0wn.biz,DA9E:6882:B0F8:335E:B5F4:A059:1B7D:EE6F:BD55:4451:93B4:13BF:AFFC:7D26:4527:CE1A,pubkey.ro.dnscrypt.d0wn.biz\r
-d0wn-ru-ns1,D0wn Resolver Russia 01,Server provided by Martin 'd0wn' Albus,Russia,,https://dns.d0wn.biz,1,no,yes,yes,91.214.71.181,2.dnscrypt-cert.ru.d0wn.biz,0ECA:BC40:E0A1:335F:0221:4240:AB86:2919:D16A:2393:CCEB:4B40:9EB9:4F24:3077:ED99,pubkey.ru.dnscrypt.d0wn.biz\r
-d0wn-se-ns1,D0wn Resolver Sweden 01,Server provided by Martin 'd0wn' Albus,Sweden,,https://dns.d0wn.biz,1,no,yes,yes,95.215.44.124,2.dnscrypt-cert.se.d0wn.biz,9D4F:762B:DD24:F77A:64B4:7E0F:F5C6:93FD:A02A:39E9:8FEC:0CEE:F252:3A5F:A403:C032,pubkey.se.dnscrypt.d0wn.biz\r
-d0wn-se-ns1-ipv6,D0wn Resolver Sweden 01 over IPv6,Server provided by Martin 'd0wn' Albus,Sweden,,https://dns.d0wn.biz,1,no,yes,yes,[2a02:7aa0:1619::4f50:a69]:443,2.dnscrypt-cert.se.d0wn.biz,9D4F:762B:DD24:F77A:64B4:7E0F:F5C6:93FD:A02A:39E9:8FEC:0CEE:F252:3A5F:A403:C032,pubkey.se.dnscrypt.d0wn.biz\r
-d0wn-sg-ns1,D0wn Resolver Singapore 01,Server provided by Martin 'd0wn' Albus,Singapore,,https://dns.d0wn.biz,1,no,yes,yes,128.199.248.105,2.dnscrypt-cert.sg.d0wn.biz,D82B:2B76:1DA0:8470:B55B:820C:FAAB:9F32:D632:E9E0:5616:2CE7:7D21:E970:98FF:4A34,pubkey.sg.dnscrypt.d0wn.biz\r
-d0wn-sg-ns2,D0wn Resolver Singapore 02,Server provided by Martin 'd0wn' Albus,Singapore,,https://dns.d0wn.biz,1,no,yes,yes,210.16.120.139,2.dnscrypt-cert.sg2.d0wn.biz,0F00:63C4:6EAF:29C3:29CD:E125:2033:6F0A:0C72:7CDD:F1F4:3D47:F95D:02BC:07F7:9FFC,pubkey.sg2.dnscrypt.d0wn.biz\r
-d0wn-sg-ns2-ipv6,D0wn Resolver Singapore 01 over IPv6,Server provided by Martin 'd0wn' Albus,Singapore,,https://dns.d0wn.biz,1,no,yes,yes,[2403:5680::1:200f]:443,2.dnscrypt-cert.sg2.d0wn.biz,0F00:63C4:6EAF:29C3:29CD:E125:2033:6F0A:0C72:7CDD:F1F4:3D47:F95D:02BC:07F7:9FFC,pubkey.sg.dnscrypt.d0wn.biz\r
-d0wn-tz-ns1,D0wn Resolver Tanzania 01,Server provided by Martin 'd0wn' Albus,Tanzania,,https://dns.d0wn.biz,1,no,yes,yes,41.79.69.13,2.dnscrypt-cert.tz.d0wn.biz,D606:15FB:D145:3BA1:4E76:8A3E:5C5C:B3AC:1746:1331:463D:A0AF:8CF7:DF04:DA4D:756D,pubkey.tz.dnscrypt.d0wn.biz\r
-d0wn-ua-ns1,D0wn Resolver Ukraine 01,Server provided by Martin 'd0wn' Albus,Ukraine,,https://dns.d0wn.biz,1,no,yes,yes,217.12.210.54,2.dnscrypt-cert.ua.d0wn.biz,3B1E:D468:FFD3:F261:20DE:E7F1:6A74:E1D5:D59E:B40D:F3EA:99BC:0B05:70CC:292D:99BA,pubkey.ua.dnscrypt.d0wn.biz\r
-d0wn-ua-ns1-ipv6,D0wn Resolver Ukraine 01 over IPv6,Server provided by Martin 'd0wn' Albus,Ukraine,,https://dns.d0wn.biz,1,no,yes,yes,[2a02:27a8:0:2::556]:443,2.dnscrypt-cert.ua.d0wn.biz,3B1E:D468:FFD3:F261:20DE:E7F1:6A74:E1D5:D59E:B40D:F3EA:99BC:0B05:70CC:292D:99BA,pubkey.ua.dnscrypt.d0wn.biz\r
-d0wn-uk-ns1,D0wn Resolver United Kingdom 01,Server provided by Martin 'd0wn' Albus,United Kingdom,,https://dns.d0wn.biz,1,no,yes,yes,185.121.25.85,2.dnscrypt-cert.uk.d0wn.biz,FADB:BE63:7FCD:FE22:0DBE:D433:438C:5A1D:C267:1E96:4B67:1918:B15F:9121:77D7:5B2E,pubkey.uk.dnscrypt.d0wn.biz\r
-d0wn-uk-ns1-ipv6,D0wn Resolver United Kingdom 01 over IPv6,Server provided by Martin 'd0wn' Albus,United Kingdom,,https://dns.d0wn.biz,1,no,yes,yes,[2a04:92c7:7:7::14ae:460a]:443,2.dnscrypt-cert.uk.d0wn.biz,FADB:BE63:7FCD:FE22:0DBE:D433:438C:5A1D:C267:1E96:4B67:1918:B15F:9121:77D7:5B2E,pubkey.uk.dnscrypt.d0wn.biz\r
-d0wn-us-ns1,D0wn Resolver United States of America 01,Server provided by Martin 'd0wn' Albus,United States of America,,https://dns.d0wn.biz,1,no,yes,yes,199.195.249.174,2.dnscrypt-cert.us.d0wn.biz,6741:6E7F:4744:194E:D725:91A2:1A62:A715:78F9:62CD:5263:84FC:DAA8:6C7E:4D9F:438B,pubkey.us.dnscrypt.d0wn.biz\r
-d0wn-us-ns1-ipv6,D0wn Resolver United States of America 01 over IPv6,Server provided by Martin 'd0wn' Albus,United States of America,,https://dns.d0wn.biz,1,no,yes,yes,[2605:6400:10:59:0:b19:b00b:babe]:443,2.dnscrypt-cert.us.d0wn.biz,6741:6E7F:4744:194E:D725:91A2:1A62:A715:78F9:62CD:5263:84FC:DAA8:6C7E:4D9F:438B,pubkey.us.dnscrypt.d0wn.biz\r
-d0wn-us-ns2,D0wn Resolver United States of America 02,Server provided by Martin 'd0wn' Albus,United States of America,,https://dns.d0wn.biz,1,no,yes,yes,209.141.53.57,2.dnscrypt-cert.us2.d0wn.biz,A22D:99C4:E2E9:CB94:67F0:E36A:619F:418B:466C:5786:C0B8:ACAA:B716:71F7:1F81:F5F8,pubkey.us.dnscrypt.d0wn.biz\r
-d0wn-us-ns2-ipv6,D0wn Resolver United States of America 02 over IPv6,Server provided by Martin 'd0wn' Albus,United States of America,,https://dns.d0wn.biz,1,no,yes,yes,[2605:6400:20:7d7:1:5ee:bad:c0de]:443,2.dnscrypt-cert.us2.d0wn.biz,A22D:99C4:E2E9:CB94:67F0:E36A:619F:418B:466C:5786:C0B8:ACAA:B716:71F7:1F81:F5F8,pubkey.us.dnscrypt.d0wn.biz\r
-dnscrypt.eu-dk,DNSCrypt.eu Denmark,"Free, non-logged, uncensored. Hosted by Netgroup.",Denmark,,https://dnscrypt.eu,1,yes,yes,no,77.66.84.233,2.dnscrypt-cert.resolver2.dnscrypt.eu,3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955,pubkey.resolver2.dnscrypt.eu\r
-dnscrypt.eu-dk-ipv6,DNSCrypt.eu Denmark over IPv6,"Free, non-logged, uncensored. Hosted by Netgroup.",Denmark,,https://dnscrypt.eu,1,yes,yes,no,[2001:1448:243::dc2]:443,2.dnscrypt-cert.resolver2.dnscrypt.eu,3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955,pubkey.resolver2.dnscrypt.eu\r
-dnscrypt.eu-nl,DNSCrypt.eu Holland,"Free, non-logged, uncensored. Hosted by RamNode.",Netherlands,,https://dnscrypt.eu,1,yes,yes,no,176.56.237.171,2.dnscrypt-cert.resolver1.dnscrypt.eu,67C0:0F2C:21C5:5481:45DD:7CB4:6A27:1AF2:EB96:9931:40A3:09B6:2B8D:1653:1185:9C66,pubkey.resolver1.dnscrypt.eu\r
-dnscrypt.org-fr,DNSCrypt.org France,DNSSEC/Non-logged/Uncensored - ARM server donated by Scaleway.com,"Paris, France",,https://fr.dnscrypt.org,2,yes,yes,no,212.47.228.136,2.dnscrypt-cert.fr.dnscrypt.org,E801:B84E:A606:BFB0:BAC0:CE43:445B:B15E:BA64:B02F:A3C4:AA31:AE10:636A:0790:324D,pubkey.fr.dnscrypt.org\r
-dyne.org,Dyne.org Server,Public DNSCrypt server provided by Dyne.org,"New York, US",,https://www.dyne.org,1,no,yes,no,198.199.70.248:5553,2.dnscrypt-cert.dyne.org,162F:051A:BACA:A042:A0C9:7769:91B4:BBA8:FE10:8F72:53CB:5077:A055:9BCF:AD39:73C5,\r
-fvz-anyone,Primary OpenNIC Anycast DNS Resolver,Fusl's public primary OpenNIC Tier2 Anycast DNS Resolver,Anycast,,http://dnsrec.meo.ws/,1,no,yes,yes,185.121.177.177,2.dnscrypt-cert.dnsrec.meo.ws,1A6A:D0A3:2B4C:5A61:A695:D153:670D:69AB:1690:3F9E:C3F7:F64F:13E5:35A3:18B2:28A5,\r
-fvz-anyone-ipv6,Primary OpenNIC Anycast DNS IPv6 Resolver,Fusl's public primary OpenNIC Tier2 Anycast DNS Resolver,Anycast,,http://dnsrec.meo.ws/,1,no,yes,yes,[2a05:dfc7:5::53]:443,2.dnscrypt-cert.dnsrec.meo.ws,1A6A:D0A3:2B4C:5A61:A695:D153:670D:69AB:1690:3F9E:C3F7:F64F:13E5:35A3:18B2:28A5,\r
-fvz-anytwo,Secondary OpenNIC Anycast DNS Resolver,Fusl's public secondary OpenNIC Tier2 Anycast DNS Resolver,Anycast,,http://dnsrec.meo.ws/,1,no,yes,yes,185.121.177.53,2.dnscrypt-cert.dnsrec.meo.ws,1A6A:D0A3:2B4C:5A61:A695:D153:670D:69AB:1690:3F9E:C3F7:F64F:13E5:35A3:18B2:28A5,\r
-fvz-anytwo-ipv6,Secondary OpenNIC Anycast DNS IPv6 Resolver,Fusl's public secondary OpenNIC Tier2 Anycast DNS Resolver,Anycast,,http://dnsrec.meo.ws/,1,no,yes,yes,[2a05:dfc7:5::5353]:443,2.dnscrypt-cert.dnsrec.meo.ws,1A6A:D0A3:2B4C:5A61:A695:D153:670D:69AB:1690:3F9E:C3F7:F64F:13E5:35A3:18B2:28A5,\r
-ipredator,Ipredator.se Server,Public DNSCrypt server in Sweden provided by Ipredator.se,Sweden,,https://www.ipredator.se,1,yes,yes,no,194.132.32.32,2.dnscrypt-cert.ipredator.se,C44C:566A:A8D6:46C4:32B1:04F5:3D00:961B:32DC:71CF:1C04:BD9E:B013:E480:E7A4:7828,pubkey.resolver2.ipredator.se\r
-ns0.dnscrypt.is,"ns0.dnscrypt.is in Reykjavík, Iceland","DNSSEC enabled, non-logging, uncensored. Sponsored by 1984 Hosting.","Reykjavík, Iceland",,https://dnscrypt.is,1,yes,yes,no,93.95.228.87,2.dnscrypt-cert.ns0.dnscrypt.is,EE41:6A83:451C:218F:37B2:B736:78C4:999F:7DE6:89D1:31D2:7866:7C8E:A8BB:1C95:B402,pubkey.ns0.dnscrypt.is\r
-okturtles,okTurtles,For a surveillance-free world. HTTPS is broken. DNSChain fixes it.,"Georgia, US","33.032501, -83.895699",http://okturtles.com/,1,no,yes,yes,23.226.227.93,2.dnscrypt-cert.okturtles.com,1D85:3953:E34F:AFD0:05F9:4C6F:D1CC:E635:D411:9904:0D48:D19A:5D35:0B6A:7C81:73CB,\r
-opennic-tumabox,TumaBox,Public DNS server operated by TumaBox.org,Germany,,http://wiki.tumabox.org/doku.php?id=dns,1,no,yes,yes,130.255.73.90:5353,2.tumabox.org,D591:7B11:6A35:3114:C238:AA99:A6EB:0C28:7CF7:6805:41AC:5DBF:A8A0:239E:228C:5B06,\r
-ovpnse,OVPN.se Integritet AB,Public DNS server in Sweden by OVPN.se,Sweden,"59.2877011, 18.0771273",https://www.ovpn.se,1,no,yes,no,46.227.67.134:55,2.dnscrypt-cert.dnscrypt01.ovpn.se,B0D6:3658:E23F:5AE1:495C:03C2:319D:D6F1:F2E1:E067:BD23:6F56:503F:27A8:C5D9:2390,\r
-soltysiak,Soltysiak,Public DNSCrypt server in Poland,Poland,"52.4014619, 16.9278078",http://dc1.soltysiak.com/,1,yes,yes,yes,178.216.201.222:2053,2.dnscrypt-cert.soltysiak.com,25C4:E188:2915:4697:8F9C:2BBD:B6A7:AFA4:01ED:A051:0508:5D53:03E7:1928:C066:8F21,pubkey.dc1.soltysiak.com\r
-soltysiak-ipv6,Soltysiak over IPv6,Public DNSCrypt server in Poland,Poland,"52.4014619, 16.9278078",http://dc1.soltysiak.com/,1,yes,yes,yes,[2001:470:70:4ff::2]:2053,2.dnscrypt-cert.soltysiak.com,25C4:E188:2915:4697:8F9C:2BBD:B6A7:AFA4:01ED:A051:0508:5D53:03E7:1928:C066:8F21,pubkey.dc1.soltysiak.com\r
-ventricle.us,Anatomical DNS,Public DNSCrypt resolver provided by Jacob Henner,"New York, NY",,https://jacobhenner.com,1,yes,yes,no,107.170.57.34,2.dnscrypt-cert.dnscrypt.ventricle.us,E985:F118:AD4E:3CC6:5FF2:2520:1890:C6F5:58B7:5B5A:52F5:6B17:CFEA:C100:5C8B:9BAA,pubkey.dnscrypt.ventricle.us\r
-yandex,Yandex,Yandex public DNS server,Anycast,,https://www.yandex.com,1,no,no,no,77.88.8.78:15353,2.dnscrypt-cert.browser.yandex.net,D384:C071:C9F7:4662:AF2A:CCD5:7B5D:CC97:14D4:07B6:AD36:01E1:AEDC:06D5:6D49:6327,\r
+Name,"Full name","Description","Location","Coordinates",URL,Version,DNSSEC validation,No logs,Namecoin,Resolver address,Provider name,Provider public key,Provider public key TXT record
+adguard-dns-family-ns1,"Adguard DNS Family Protection 1","Adguard DNS with safesearch and adult content blocking","Anycast","",https://adguard.com/en/adguard-dns/overview.html,1,no,yes,no,176.103.130.132:5443,2.dnscrypt.family.ns1.adguard.com,B831:5DD7:B14B:6EE3:20A4:70DC:2ED6:B1AA:398C:C9E5:86F8:5D45:45D6:B8C9:B500:5ABA,pk.family.ns1.adguard.com
+adguard-dns-family-ns2,"Adguard DNS Family Protection 2","Adguard DNS with safesearch and adult content blocking","Anycast","",https://adguard.com/en/adguard-dns/overview.html,1,no,yes,no,176.103.130.134:5443,2.dnscrypt.family.ns2.adguard.com,8C21:17A9:EBC1:57D6:FB64:056F:0ADB:C11C:5D83:6734:73C4:6E25:8D9B:2F57:D4EE:351F,pk.family.ns2.adguard.com
+adguard-dns-ns1,"Adguard DNS 1","Remove ads and protect your computer from malware","Anycast","",https://adguard.com/en/adguard-dns/overview.html,1,no,yes,no,176.103.130.130:5443,2.dnscrypt.default.ns1.adguard.com,D12B:47F2:52DC:F2C2:BBF8:9910:86EA:F79C:E449:5D8B:16C8:A0C4:322E:52CA:3F39:0873,pk.default.ns1.adguard.com
+adguard-dns-ns2,"Adguard DNS 2","Remove ads and protect your computer from malware","Anycast","",https://adguard.com/en/adguard-dns/overview.html,1,no,yes,no,176.103.130.131:5443,2.dnscrypt.default.ns2.adguard.com,81D0:02D3:6A4C:A50C:473B:7479:650F:E12E:02B3:21CB:6138:562A:208E:403D:FDC5:5E94,pk.default.ns2.adguard.com
+bikinhappy-sg,"BikinHappy Singapore","provided by bikinhappy.com","Singapore","",http://dns.bikinhappy.com,1,yes,yes,no,172.104.46.253:443,2.dnscrypt-cert.dns.bikinhappy.com,7167:91A0:745E:17ED:1E73:D426:C697:E8DF:EE4B:476B:149F:8449:62DD:4615:BD71:5C70,
+bn-fr0,"Babylon Network France 0","Non-logging, uncensored DNS resolver provided by Babylon Network","Roubaix, France","",https://babylon.network,1,no,yes,no,5.135.66.222:5353,2.dnscrypt-cert.babylon.network,8794:070A:143D:35CA:1CA6:32E7:B189:3028:4EAE:5DAF:EBB4:01E3:DF52:E9F0:37AB:D182,pk.fr0.dnscrypt.babylon.network
+bn-fr0-ipv6,"Babylon Network France 0 (IPv6)","Non-logging, uncensored IPv6 DNS resolver provided by Babylon Network","Roubaix, France","",https://babylon.network,1,no,yes,no,[2001:41d0:8:4480::222]:5353,2.dnscrypt-cert.babylon.network,8794:070A:143D:35CA:1CA6:32E7:B189:3028:4EAE:5DAF:EBB4:01E3:DF52:E9F0:37AB:D182,pk.fr0.dnscrypt.babylon.network
+bn-fr1,"Babylon Network France 1","Non-logging, uncensored DNS resolver provided by Babylon Network","Roubaix, France","",https://babylon.network,1,no,yes,no,164.132.130.171:5353,2.dnscrypt-cert.babylon.network,8794:070A:143D:35CA:1CA6:32E7:B189:3028:4EAE:5DAF:EBB4:01E3:DF52:E9F0:37AB:D182,pk.fr1.dnscrypt.babylon.network
+bn-fr1-ipv6,"Babylon Network France 1 (IPv6)","Non-logging, uncensored IPv6 DNS resolver provided by Babylon Network","Roubaix, France","",https://babylon.network,1,no,yes,no,[2001:41d0:1:82b5::171]:5353,2.dnscrypt-cert.babylon.network,8794:070A:143D:35CA:1CA6:32E7:B189:3028:4EAE:5DAF:EBB4:01E3:DF52:E9F0:37AB:D182,pk.fr1.dnscrypt.babylon.network
+bn-nl0,"Babylon Network Netherlands 0","Non-logging, uncensored DNS resolver provided by Babylon Network","Amsterdam, The Netherlands","",https://babylon.network,1,no,yes,no,87.253.152.190:5353,2.dnscrypt-cert.babylon.network,8794:070A:143D:35CA:1CA6:32E7:B189:3028:4EAE:5DAF:EBB4:01E3:DF52:E9F0:37AB:D182,pk.nl0.dnscrypt.babylon.network
+bn-nl0-ipv6,"Babylon Network Netherlands 0 (IPv6)","Non-logging, uncensored IPv6 DNS resolver provided by Babylon Network","Amsterdam, The Netherlands","",https://babylon.network,1,no,yes,no,[2a01:7c8:c020:3::190]:5353,2.dnscrypt-cert.babylon.network,8794:070A:143D:35CA:1CA6:32E7:B189:3028:4EAE:5DAF:EBB4:01E3:DF52:E9F0:37AB:D182,pk.nl0.dnscrypt.babylon.network
+cisco,"Cisco OpenDNS","Remove your DNS blind spot","Anycast","",https://www.opendns.com,1,no,no,no,208.67.220.220,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,
+cisco-familyshield,"Cisco OpenDNS with FamilyShield","Block websites not suitable for children","Anycast","",https://www.opendns.com/home-internet-security/parental-controls/,1,no,no,no,208.67.220.123,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,
+cisco-ipv6,"Cisco OpenDNS over IPv6","Cisco OpenDNS IPv6 sandbox","Anycast","",https://www.opendns.com/about/innovations/ipv6/,1,no,no,no,[2620:0:ccc::2]:443,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,
+cpunks-ru,"Cypherpunks.ru","Cypherpunks.ru public DNS server",Russia,,http://www.cypherpunks.ru/DNSCrypt.html,1,no,yes,no,77.51.181.209:5353,2.dnscrypt-cert.cypherpunks.ru,1838:CCA3:D953:0A66:3433:5D50:05BD:3758:44E3:977E:E868:2B6C:5528:12BD:A78D:2E99,
+cs-caeast,"CS Canada east DNSCrypt server","provided by cryptostorm.is","Montreal, CA",,"https://cryptostorm.is",1,"no","yes","yes",167.114.84.132:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-cawest,"CS Canada west DNSCrypt server","provided by cryptostorm.is","Vancouver, CA",,"https://cryptostorm.is",1,"no","yes","yes",162.221.207.228:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-cfi,"CS cryptofree France DNSCrypt server","provided by cryptostorm.is","Paris, France",,"https://cryptostorm.is",1,"no","yes","yes",212.83.175.31:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-cfii,"CS secondary cryptofree France DNSCrypt server","provided by cryptostorm.is","Paris, France",,"https://cryptostorm.is",1,"no","yes","yes",23.105.70.204:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-ch,"CS Switzerland DNSCrypt server","provided by cryptostorm.is","Baar, Switzerland",,"https://cryptostorm.is",1,"no","yes","yes",185.60.147.77:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-de,"CS Frankfurt, DE DNSCrypt server","provided by cryptostorm.is","Frankfurt, Germany",,"https://cryptostorm.is",1,"no","yes","yes",84.16.240.43:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-de3,"CS Dusseldorf, DE DNSCrypt server","provided by cryptostorm.is","Dusseldorf, Germany",,"https://cryptostorm.is",1,"no","yes","yes",89.163.214.174:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-dk,"CS Denmark DNSCrypt server","provided by cryptostorm.is","Copenhagen, Denmark",,"https://cryptostorm.is",1,"no","yes","yes",82.103.131.172:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-dk2,"CS secondary Denmark DNSCrypt server","provided by cryptostorm.is","Copenhagen, Denmark",,"https://cryptostorm.is",1,"no","yes","yes",185.212.169.139:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-es,"CS Spain DNSCrypt server","provided by cryptostorm.is","Valencia, Spain",,"https://cryptostorm.is",1,"no","yes","yes",185.140.114.51:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-fi,"CS Finland DNSCrypt server","provided by cryptostorm.is","Helsinki, Finland",,"https://cryptostorm.is",1,"no","yes","yes",185.117.118.20:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-fr,"CS France DNSCrypt server","provided by cryptostorm.is","Paris, France",,"https://cryptostorm.is",1,"no","yes","yes",212.129.46.86:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-fr2,"CS secondary France DNSCrypt server","provided by cryptostorm.is","Paris, France",,"https://cryptostorm.is",1,"no","yes","yes",212.129.46.32:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-lt,"CS Lithuania DNSCrypt server","provided by cryptostorm.is","Vilnius, Lithuania",,"https://cryptostorm.is",1,"no","yes","yes",46.166.170.10:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-lv,"CS Latvia DNSCrypt server","provided by cryptostorm.is","Riga, Latvia",,"https://cryptostorm.is",1,"no","yes","yes",80.233.134.52:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-md,"CS Moldova DNSCrypt server","provided by cryptostorm.is","Chisinau, Moldova",,"https://cryptostorm.is",1,"no","yes","yes",176.123.3.249:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-nl,"CS Netherlands DNSCrypt server","provided by cryptostorm.is","Rotterdam, Netherlands",,"https://cryptostorm.is",1,"no","yes","yes",213.163.64.208:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-pl,"CS Poland DNSCrypt server","provided by cryptostorm.is","Warsaw, Poland",,"https://cryptostorm.is",1,"no","yes","yes",5.133.8.187:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-pt,"CS Portugal DNSCrypt server","provided by cryptostorm.is","Lisbon, Portugal",,"https://cryptostorm.is",1,"no","yes","yes",109.71.42.228:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-ro,"CS Romania DNSCrypt server","provided by cryptostorm.is","Romania",,"https://cryptostorm.is",1,"no","yes","yes",5.254.96.195:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-rome,"CS Italy DNSCrypt server","provided by cryptostorm.is","Rome, Italy",,"https://cryptostorm.is",1,"no","yes","yes",185.94.193.234:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-uk,"CS England DNSCrypt server","provided by cryptostorm.is","Rugby, England",,"https://cryptostorm.is",1,"no","yes","yes",5.101.137.251:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-useast,"CS New York City NY US DNSCrypt server","provided by cryptostorm.is","Buffalo, NY",,"https://cryptostorm.is",1,"no","yes","yes",173.234.159.235:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-useast2,"CS Washington DC US DNSCrypt server","provided by cryptostorm.is","Washington, DC",,"https://cryptostorm.is",1,"no","yes","yes",198.7.58.227:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-usnorth,"CS Chicago IL US DNSCrypt server","provided by cryptostorm.is","Chicago, IL",,"https://cryptostorm.is",1,"no","yes","yes",173.234.56.115:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-ussouth,"CS Dallas TX US DNSCrypt server","provided by cryptostorm.is","Dallas, TX",,"https://cryptostorm.is",1,"no","yes","yes",70.32.38.67:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-ussouth2,"CS Atlanta GA US DNSCrypt server","provided by cryptostorm.is","Atlanta, GA",,"https://cryptostorm.is",1,"no","yes","yes",108.62.19.131:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-uswest,"CS Seattle WA US DNSCrypt server","provided by cryptostorm.is","Seattle, WA",,"https://cryptostorm.is",1,"no","yes","yes",64.120.5.251:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-uswest3,"CS secondary Las Vegas NV US DNSCrypt server","provided by cryptostorm.is","Las Vegas, NV",,"https://cryptostorm.is",1,"no","yes","yes",104.238.195.139:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+cs-uswest5,"CS Los Angeles CA US DNSCrypt server","provided by cryptostorm.is","Los Angeles, CA",,"https://cryptostorm.is",1,"no","yes","yes",173.208.95.75:443,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,
+d0wn-at-ns1,"D0wn Resolver Austria 01","Server provided by Martin 'd0wn' Albus","Austria","",https://dns.d0wn.biz,1,yes,yes,no,79.133.33.52,2.dnscrypt-cert.at.d0wn.biz,717E:5DF4:1841:CD4B:D92E:CE16:ECCC:443D:B305:B03D:86E6:69B7:4AC1:FBB6:18D0:2BB4,pubkey.at.dnscrypt.d0wn.biz
+d0wn-cz-ns1,"D0wn Resolver Czech Republic 01","Server provided by Martin 'd0wn' Albus","Czech Republic","",https://dns.d0wn.biz,1,yes,yes,no,81.2.237.32,2.dnscrypt-cert.cz.d0wn.biz,EE21:5055:4DA0:1367:BAC3:768A:7C1E:24BF:D777:ACD5:77A4:44F8:BDF3:84E0:5966:D855,pubkey.cz.dnscrypt.d0wn.biz
+d0wn-de-ns1,"D0wn Resolver Germany 01","Server provided by Martin 'd0wn' Albus","Germany","",https://dns.d0wn.biz,1,yes,yes,no,82.211.31.248,2.dnscrypt-cert.de.d0wn.biz,B040:19F8:8D49:4682:41E3:EB58:5F61:173F:EF8E:55DA:0597:2DB7:27BB:C153:1DD8:D109,pubkey.de.dnscrypt.d0wn.biz
+d0wn-de-ns1-ipv6,"D0wn Resolver Germany 01 over IPv6","Server provided by Martin 'd0wn' Albus","Germany","",https://dns.d0wn.biz,1,yes,yes,no,[2001:1608:10:195:3:dead:beef:cafe]:443,2.dnscrypt-cert.de.d0wn.biz,B040:19F8:8D49:4682:41E3:EB58:5F61:173F:EF8E:55DA:0597:2DB7:27BB:C153:1DD8:D109,pubkey.de.dnscrypt.d0wn.biz
+d0wn-es-ns1,"D0wn Resolver Spain 01","Server provided by Martin 'd0wn' Albus","Spain","",https://dns.d0wn.biz,1,yes,yes,no,91.142.220.29,2.dnscrypt-cert.es.d0wn.biz,EB09:E854:AEDA:9705:CB47:ED69:EADD:4156:3653:82C5:C88D:A2E3:6917:3B54:4774:7505,pubkey.es.dnscrypt.d0wn.biz
+d0wn-fr-ns1,"D0wn Resolver France 01","Server provided by Martin 'd0wn' Albus","France","",https://dns.d0wn.biz,1,yes,yes,no,151.80.7.115:1053,2.dnscrypt-cert.fr.d0wn.biz,58A8:22D3:29EB:C14F:BCEB:45AF:42EB:2F58:C797:0AD3:ED31:397D:1D34:8636:2375:7251,pubkey.fr.dnscrypt.d0wn.biz
+d0wn-fr-ns2,"D0wn Resolver France 02","Server provided by Martin 'd0wn' Albus","France","",https://dns.d0wn.biz,1,yes,yes,no,37.187.0.40,2.dnscrypt-cert.fr2.d0wn.biz,25A7:DB7B:7835:55D5:7DA4:7C0C:57F8:9C5F:0220:3D09:67E3:585A:723E:E0D1:CB38:F767,pubkey.fr2.dnscrypt.d0wn.biz
+d0wn-fr-ns2-ipv6,"D0wn Resolver France 02 over IPv6","Server provided by Martin 'd0wn' Albus","France","",https://dns.d0wn.biz,1,yes,yes,no,[2001:41D0:A:0028::1]:443,2.dnscrypt-cert.fr2.d0wn.biz,25A7:DB7B:7835:55D5:7DA4:7C0C:57F8:9C5F:0220:3D09:67E3:585A:723E:E0D1:CB38:F767,pubkey.fr2.dnscrypt.d0wn.biz
+d0wn-gr-ns1,"D0wn Resolver Greece 01","Server provided by Martin 'd0wn' Albus","Greece","",https://dns.d0wn.biz,1,yes,yes,no,85.25.105.193,2.dnscrypt-cert.gr.d0wn.biz,B19C:0B5C:48F2:58FA:0BE4:67F4:5F50:BC7F:985F:C544:8A4F:BC9D:5574:5A35:5701:8009,pubkey.gr.dnscrypt.d0wn.biz
+d0wn-id-ns1,"D0wn Resolver Indonesia 01","Server provided by Martin 'd0wn' Albus","Indonesia","",https://dns.d0wn.biz,1,yes,yes,no,45.114.118.195,2.dnscrypt-cert.id.d0wn.biz,BE93:B3F1:2A3B:2448:8F33:F91F:9461:5F73:D5CA:56D6:C789:96DE:7A18:D4DE:5182:094D,pubkey.id.dnscrypt.d0wn.biz
+d0wn-is-ns1,"D0wn Resolver Iceland 01","Server provided by Martin 'd0wn' Albus","Iceland","",https://dns.d0wn.biz,1,yes,yes,no,37.235.49.61,2.dnscrypt-cert.is.d0wn.biz,2B28:974E:073A:6B38:722A:5BE1:F7A0:250C:508F:A809:238F:8F3D:76D8:6098:20D7:B2D9,pubkey.is.dnscrypt.d0wn.biz
+d0wn-is-ns2,"D0wn Resolver Iceland 02","Server provided by Martin 'd0wn' Albus","Iceland","",https://dns.d0wn.biz,1,yes,yes,no,93.95.226.165,2.dnscrypt-cert.is2.d0wn.biz,8460:34A9:C630:CA3C:04AC:4A90:1625:F17A:87B2:ACB9:4180:AC48:1E2C:10E8:CEDE:1A6F,pubkey.is2.dnscrypt.d0wn.biz
+d0wn-it-ns1,"D0wn Resolver Italy 01","Server provided by Martin 'd0wn' Albus","Italy","",https://dns.d0wn.biz,1,yes,yes,no,31.14.133.188,2.dnscrypt-cert.it.d0wn.biz,2DEC:CEF8:A4D0:57DE:0D1A:CE8E:0A3C:BEB8:2135:61A8:BF0E:7373:0BA0:EC38:C876:3B50,pubkey.it.dnscrypt.d0wn.biz
+d0wn-lv-ns1,"D0wn Resolver Latvia 01","Server provided by Martin 'd0wn' Albus","Latvia","",https://dns.d0wn.biz,1,yes,yes,no,89.111.13.60,2.dnscrypt-cert.lv.d0wn.biz,9AC3:6B4C:7ADB:E7D6:D697:B6BF:151C:151A:B291:8C5D:B912:15F8:B986:5926:33A4:A5E1,pubkey.lv.dnscrypt.d0wn.biz
+d0wn-lv-ns2,"D0wn Resolver Latvia 02","Server provided by Martin 'd0wn' Albus","Latvia","",https://dns.d0wn.biz,1,yes,yes,no,185.86.151.28,2.dnscrypt-cert.lv2.d0wn.biz,B111:F80C:E3E0:1C36:CC73:0995:009E:6351:EF08:0503:309D:9417:7AA3:8C67:916D:0CDF,pubkey.lv.dnscrypt.d0wn.biz
+d0wn-lv-ns2-ipv6,"D0wn Resolver Latvia 01 over IPv6","Server provided by Martin 'd0wn' Albus","Latvia","",https://dns.d0wn.biz,1,yes,yes,no,[2a02:7aa0:1201::f60e:2719]:443,2.dnscrypt-cert.lv2.d0wn.biz,B111:F80C:E3E0:1C36:CC73:0995:009E:6351:EF08:0503:309D:9417:7AA3:8C67:916D:0CDF,pubkey.lv.dnscrypt.d0wn.biz
+d0wn-md-ns1,"D0wn Resolver Moldova 01","Server provided by Martin 'd0wn' Albus","Moldova","",https://dns.d0wn.biz,1,yes,yes,no,178.17.170.67:1053,2.dnscrypt-cert.md.d0wn.biz,3DB2:C4CB:39E2:6B82:FDDF:6D91:1A65:D164:F4F0:D237:8CDD:0C37:469F:24BA:B9A0:F9FF,pubkey.md.dnscrypt.d0wn.biz
+d0wn-md-ns1-ipv6,"D0wn Resolver Moldova 01 over IPv6","Server provided by Martin 'd0wn' Albus","Moldova","",https://dns.d0wn.biz,1,yes,yes,no,[2a00:1dc0:cafe::ad86:fa7e]:1053,2.dnscrypt-cert.md.d0wn.biz,3DB2:C4CB:39E2:6B82:FDDF:6D91:1A65:D164:F4F0:D237:8CDD:0C37:469F:24BA:B9A0:F9FF,pubkey.md.dnscrypt.d0wn.biz
+d0wn-mx-ns1,"D0wn Resolver Mexico 01","Server provided by Martin 'd0wn' Albus","Mexico","",https://dns.d0wn.biz,1,yes,yes,no,201.131.126.212,2.dnscrypt-cert.mx.d0wn.biz,999E:63F0:0DE7:C171:3A72:5625:2A3F:097B:EC3A:D28F:BE28:7569:5C37:E80D:3D55:4FD0,pubkey.mx.dnscrypt.d0wn.biz
+d0wn-nl-ns1,"D0wn Resolver Netherlands 01","Server provided by Martin 'd0wn' Albus","Netherlands","",https://dns.d0wn.biz,1,yes,yes,no,95.85.9.86:1053,2.dnscrypt-cert.nl.d0wn.biz,7BE6:68FE:A505:FFA7:4C27:C2CA:F881:59DA:038C:5741:13AA:2556:A4D2:2D0B:B6F0:009E,pubkey.nl.dnscrypt.d0wn.biz
+d0wn-nl-ns1-ipv6,"D0wn Resolver Netherlands 01 over IPv6","Server provided by Martin 'd0wn' Albus","Netherlands","",https://dns.d0wn.biz,1,yes,yes,no,[2a03:b0c0:0:1010::62:f001]:1053,2.dnscrypt-cert.nl.d0wn.biz,7BE6:68FE:A505:FFA7:4C27:C2CA:F881:59DA:038C:5741:13AA:2556:A4D2:2D0B:B6F0:009E,pubkey.nl.dnscrypt.d0wn.biz
+d0wn-nl-ns2,"D0wn Resolver Netherlands 02","Server provided by Martin 'd0wn' Albus","Netherlands","",https://dns.d0wn.biz,1,yes,yes,no,185.83.217.248:1053,2.dnscrypt-cert.nl2.d0wn.biz,DFAA:B7D8:29E6:1F34:4FED:2610:4221:70C9:ADC7:7E9F:A65F:4A46:0BAE:A735:3186:3B99,pubkey.nl2.dnscrypt.d0wn.biz
+d0wn-nl-ns2-ipv6,"D0wn Resolver Netherlands 02 over IPv6","Server provided by Martin 'd0wn' Albus","Netherlands","",https://dns.d0wn.biz,1,yes,yes,no,[2a02:2ca0:64:22::2]:1053,2.dnscrypt-cert.nl2.d0wn.biz,DFAA:B7D8:29E6:1F34:4FED:2610:4221:70C9:ADC7:7E9F:A65F:4A46:0BAE:A735:3186:3B99,pubkey.nl2.dnscrypt.d0wn.biz
+d0wn-nl-ns4,"D0wn Resolver Netherlands 04","Server provided by Martin 'd0wn' Albus","Netherlands","",https://dns.d0wn.biz,1,yes,yes,no,31.220.43.105,2.dnscrypt-cert.nl4.d0wn.biz,2A4F:4389:5CE6:3230:B4C5:76A5:AC38:6418:4D12:6949:B160:FDB0:9166:ABB4:CEC6:0672,pubkey.nl4.dnscrypt.d0wn.biz
+d0wn-random-ns1,"D0wn Resolver Moldova Random 01","Server provided by Martin 'd0wn' Albus","Moldova","",https://dns.d0wn.biz,1,yes,yes,no,178.17.170.133:443,2.dnscrypt-cert.random.d0wn.biz,A420:867F:ED5C:024C:C86A:EECE:AA05:194B:017F:D2FF:9E72:385A:874F:8CE5:6832:ED2E,pubkey.random.dnscrypt.d0wn.biz
+d0wn-random-ns1-ipv6,"D0wn Resolver Moldova Random 01 over IPv6","Server provided by Martin 'd0wn' Albus","Moldova","",https://dns.d0wn.biz,1,yes,yes,no,[2a00:1dc0:cafe::c6af:c19d]:443,2.dnscrypt-cert.random.d0wn.biz,A420:867F:ED5C:024C:C86A:EECE:AA05:194B:017F:D2FF:9E72:385A:874F:8CE5:6832:ED2E,pubkey.random.dnscrypt.d0wn.biz
+d0wn-random-ns2,"D0wn Resolver Netherlands Random 02","Server provided by Martin 'd0wn' Albus","Netherlands","",https://dns.d0wn.biz,1,yes,yes,no,185.14.29.140,2.dnscrypt-cert.random2.d0wn.biz,7D73:F486:3C01:4CC9:B278:D107:F254:7A4F:1EA2:1081:07B0:CB82:645A:D8A4:B98A:B327,pubkey.random2.dnscrypt.d0wn.biz
+d0wn-random-ns2-ipv6,"D0wn Resolver Netherlands Random 02 over IPv6","Server provided by Martin 'd0wn' Albus","Netherlands","",https://dns.d0wn.biz,1,yes,yes,no,[2a00:1ca8:a7::1e9]:443,2.dnscrypt-cert.random2.d0wn.biz,7D73:F486:3C01:4CC9:B278:D107:F254:7A4F:1EA2:1081:07B0:CB82:645A:D8A4:B98A:B327,pubkey.random2.dnscrypt.d0wn.biz
+d0wn-ru-ns1,"D0wn Resolver Russia 01","Server provided by Martin 'd0wn' Albus","Russia","",https://dns.d0wn.biz,1,yes,yes,no,91.214.71.181,2.dnscrypt-cert.ru.d0wn.biz,0ECA:BC40:E0A1:335F:0221:4240:AB86:2919:D16A:2393:CCEB:4B40:9EB9:4F24:3077:ED99,pubkey.ru.dnscrypt.d0wn.biz
+d0wn-se-ns1,"D0wn Resolver Sweden 01","Server provided by Martin 'd0wn' Albus","Sweden","",https://dns.d0wn.biz,1,yes,yes,no,95.215.44.124,2.dnscrypt-cert.se.d0wn.biz,9D4F:762B:DD24:F77A:64B4:7E0F:F5C6:93FD:A02A:39E9:8FEC:0CEE:F252:3A5F:A403:C032,pubkey.se.dnscrypt.d0wn.biz
+d0wn-se-ns1-ipv6,"D0wn Resolver Sweden 01 over IPv6","Server provided by Martin 'd0wn' Albus","Sweden","",https://dns.d0wn.biz,1,yes,yes,no,[2a02:7aa0:1619::4f50:a69]:443,2.dnscrypt-cert.se.d0wn.biz,9D4F:762B:DD24:F77A:64B4:7E0F:F5C6:93FD:A02A:39E9:8FEC:0CEE:F252:3A5F:A403:C032,pubkey.se.dnscrypt.d0wn.biz
+d0wn-se-ns2,"D0wn Resolver Sweden 02","Server provided by Martin 'd0wn' Albus","Sweden","",https://dns.d0wn.biz,1,yes,yes,no,31.220.5.186,2.dnscrypt-cert.se2.d0wn.biz,C57D:D6A4:178E:ADE2:D0C0:B138:A4D4:074A:DF59:1488:8711:5CAC:EB60:A37B:3492:DA15,pubkey.se2.dnscrypt.d0wn.biz
+d0wn-sg-ns1,"D0wn Resolver Singapore 01","Server provided by Martin 'd0wn' Albus","Singapore","",https://dns.d0wn.biz,1,yes,yes,no,128.199.248.105,2.dnscrypt-cert.sg.d0wn.biz,D82B:2B76:1DA0:8470:B55B:820C:FAAB:9F32:D632:E9E0:5616:2CE7:7D21:E970:98FF:4A34,pubkey.sg.dnscrypt.d0wn.biz
+d0wn-sg-ns1-ipv6,"D0wn Resolver Singapore 01 over IPv6","Server provided by Martin 'd0wn' Albus","Singapore","",https://dns.d0wn.biz,1,yes,yes,no,[2400:6180:0:d0::38:d001]:443,2.dnscrypt-cert.sg.d0wn.biz,D82B:2B76:1DA0:8470:B55B:820C:FAAB:9F32:D632:E9E0:5616:2CE7:7D21:E970:98FF:4A34,pubkey.sg.dnscrypt.d0wn.biz
+d0wn-tz-ns1,"D0wn Resolver Tanzania 01","Server provided by Martin 'd0wn' Albus","Tanzania","",https://dns.d0wn.biz,1,yes,yes,no,41.79.69.13,2.dnscrypt-cert.tz.d0wn.biz,D606:15FB:D145:3BA1:4E76:8A3E:5C5C:B3AC:1746:1331:463D:A0AF:8CF7:DF04:DA4D:756D,pubkey.tz.dnscrypt.d0wn.biz
+d0wn-tz-ns1-ipv6,"D0wn Resolver Tanzania 01 over IPv6","Server provided by Martin 'd0wn' Albus","Tanzania","",https://dns.d0wn.biz,1,yes,yes,no,[2c0f:fda8:5::2ed1:d2ec]:443,2.dnscrypt-cert.tz.d0wn.biz,D606:15FB:D145:3BA1:4E76:8A3E:5C5C:B3AC:1746:1331:463D:A0AF:8CF7:DF04:DA4D:756D,pubkey.tz.dnscrypt.d0wn.biz
+d0wn-us-ns1,"D0wn Resolver United States of America 01","Server provided by Martin 'd0wn' Albus","United States of America","",https://dns.d0wn.biz,1,yes,yes,no,107.181.187.219,2.dnscrypt-cert.us.d0wn.biz,04BB:6100:7CFF:C72B:AF91:8942:F9DC:12A9:61A1:C6F2:177F:7CF9:F3C9:1B43:9FBE:6B80,pubkey.us.dnscrypt.d0wn.biz
+d0wn-us-ns2,"D0wn Resolver United States of America 02","Server provided by Martin 'd0wn' Albus","United States of America","",https://dns.d0wn.biz,1,yes,yes,no,192.252.222.24,2.dnscrypt-cert.us2.d0wn.biz,729B:FABE:2295:D469:E911:F97E:3EE4:F6DB:0190:EA6F:7CF3:F7EE:BB6B:99B1:698A:237D,pubkey.us2.dnscrypt.d0wn.biz
+d0wn-us-ns4,"D0wn Resolver United States of America 04","Server provided by Martin 'd0wn' Albus","United States of America","",https://dns.d0wn.biz,1,yes,yes,no,107.181.168.52,2.dnscrypt-cert.us4.d0wn.biz,F392:5D53:A315:66C2:ACF2:B2D2:8A69:6739:B066:1B8C:EF1B:3AFD:E828:0D83:D4EA:6D7D,pubkey.us4.dnscrypt.d0wn.biz
+d0wn-za-ns1,"D0wn Resolver South Africa 01","Server provided by Martin 'd0wn' Albus","South Africa","",https://dns.d0wn.biz,1,yes,yes,no,169.239.181.3,2.dnscrypt-cert.za.d0wn.biz,FBBD:0F3A:AF2B:B1BB:CD8F:9324:D5F6:A68C:E722:3890:8B90:92CF:F6D2:BF7C:9EC1:1368,pubkey.za.dnscrypt.d0wn.biz
+dnscrypt.ca-1,"dnscrypt.ca Server 1","Uncensored DNSSEC validating and log-free","Montreal, Canada","","https://dnscrypt.ca/",1,yes,yes,no,"199.167.130.118:5353","2.dnscrypt-cert.dnscrypt.ca-1",74F7:4555:17BC:26F7:1177:E56D:7293:2788:6C72:915B:3F46:2830:3F91:0C47:C38E:8279,
+dnscrypt.ca-2,"dnscrypt.ca Server 2","Uncensored DNSSEC validating and log-free","Montreal, Canada","","https://dnscrypt.ca/",1,yes,yes,no,"199.167.128.112:5353","2.dnscrypt-cert.dnscrypt.ca-2",43D5:2C82:5922:96C2:DB6F:8D48:CE22:4FDC:C726:26E1:06F6:E388:6193:FA00:9029:631B,
+dnscrypt.eu-dk,"DNSCrypt.eu Denmark","Free, non-logged, uncensored. Hosted by Netgroup.","Denmark","",https://dnscrypt.eu,1,yes,yes,no,77.66.84.233,2.dnscrypt-cert.resolver2.dnscrypt.eu,3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955,pubkey.resolver2.dnscrypt.eu
+dnscrypt.eu-dk-ipv6,"DNSCrypt.eu Denmark over IPv6","Free, non-logged, uncensored. Hosted by Netgroup.","Denmark","",https://dnscrypt.eu,1,yes,yes,no,[2001:1448:243::dc2]:443,2.dnscrypt-cert.resolver2.dnscrypt.eu,3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955,pubkey.resolver2.dnscrypt.eu
+dnscrypt.eu-nl,"DNSCrypt.eu Holland","Free, non-logged, uncensored. Hosted by RamNode.","Netherlands","",https://dnscrypt.eu,1,yes,yes,no,176.56.237.171,2.dnscrypt-cert.resolver1.dnscrypt.eu,67C0:0F2C:21C5:5481:45DD:7CB4:6A27:1AF2:EB96:9931:40A3:09B6:2B8D:1653:1185:9C66,pubkey.resolver1.dnscrypt.eu
+dnscrypt.nl-ns0,"DNSCrypt.nl The Netherlands (NL)","Public DNSCrypt server in Amsterdam, the Netherlands","Netherlands","",https://dnscrypt.nl,1,yes,yes,no,45.76.35.212,2.dnscrypt-cert.ns0.dnscrypt.nl,4C84:FB8C:0511:5DFA:5F97:C5ED:0329:1370:C78A:BCD6:4E15:DD53:AB08:DE72:FB84:4ACA,pkey.ns0.dnscrypt.nl
+dnscrypt.nl-ns0-ipv6,"DNSCrypt.nl The Netherlands (NL) over IPv6","Public DNSCrypt server in Amsterdam, the Netherlands","Netherlands","",https://dnscrypt.nl,1,yes,yes,no,[2001:19f0:5001:30a:5400:ff:fe58:7140]:443,2.dnscrypt-cert.ns0.dnscrypt.nl,4C84:FB8C:0511:5DFA:5F97:C5ED:0329:1370:C78A:BCD6:4E15:DD53:AB08:DE72:FB84:4ACA,pkey.ns0.dnscrypt.nl
+dnscrypt.org-fr,"DNSCrypt.org France","DNSSEC/Non-logged/Uncensored - ARM server donated by Scaleway.com","Paris, France","",https://fr.dnscrypt.org,2,yes,yes,no,212.47.228.136,2.dnscrypt-cert.fr.dnscrypt.org,E801:B84E:A606:BFB0:BAC0:CE43:445B:B15E:BA64:B02F:A3C4:AA31:AE10:636A:0790:324D,pubkey.fr.dnscrypt.org
+fvz-anyone,"Primary OpenNIC Anycast DNS Resolver","Fusl's public primary OpenNIC Tier2 Anycast DNS Resolver","Anycast","",http://dnsrec.meo.ws/,1,no,yes,no,185.121.177.177,2.dnscrypt-cert.dnsrec.meo.ws,1A6A:D0A3:2B4C:5A61:A695:D153:670D:69AB:1690:3F9E:C3F7:F64F:13E5:35A3:18B2:28A5,
+fvz-anytwo,"Secondary OpenNIC Anycast DNS Resolver","Fusl's public secondary OpenNIC Tier2 Anycast DNS Resolver","Anycast","",http://dnsrec.meo.ws/,1,no,yes,no,169.239.202.202,2.dnscrypt-cert.dnsrec.meo.ws,1A6A:D0A3:2B4C:5A61:A695:D153:670D:69AB:1690:3F9E:C3F7:F64F:13E5:35A3:18B2:28A5,
+ipredator,"Ipredator.se Server","Public DNSCrypt server in Sweden provided by Ipredator.se","Sweden","",https://www.ipredator.se,1,yes,yes,no,194.132.32.32,2.dnscrypt-cert.ipredator.se,C44C:566A:A8D6:46C4:32B1:04F5:3D00:961B:32DC:71CF:1C04:BD9E:B013:E480:E7A4:7828,pubkey.resolver2.ipredator.se
+ns0.dnscrypt.is,"ns0.dnscrypt.is in Reykjavík, Iceland","DNSSEC enabled, non-logging, uncensored. Sponsored by 1984 Hosting.","Reykjavík, Iceland","",https://dnscrypt.is,1,yes,yes,no,93.95.228.87,2.dnscrypt-cert.ns0.dnscrypt.is,EE41:6A83:451C:218F:37B2:B736:78C4:999F:7DE6:89D1:31D2:7866:7C8E:A8BB:1C95:B402,pubkey.ns0.dnscrypt.is
+okturtles,"okTurtles","For a surveillance-free world. HTTPS is broken. DNSChain fixes it.","Georgia, US","33.032501, -83.895699",http://okturtles.com/,1,no,yes,no,23.226.227.93,2.dnscrypt-cert.okturtles.com,1D85:3953:E34F:AFD0:05F9:4C6F:D1CC:E635:D411:9904:0D48:D19A:5D35:0B6A:7C81:73CB,
+opennic-tumabox,"TumaBox","Public DNS server operated by TumaBox.org","Germany","",http://wiki.tumabox.org/doku.php?id=dns,1,no,yes,no,130.255.73.90:5353,2.tumabox.org,D591:7B11:6A35:3114:C238:AA99:A6EB:0C28:7CF7:6805:41AC:5DBF:A8A0:239E:228C:5B06,
+opennic-tumabox-ipv6,"TumaBox over IPv6","Public DNS server operated by TumaBox.org","Germany","",http://wiki.tumabox.org/doku.php?id=dns,1,no,yes,no,[2a02:e00:fffd:139::9]:5353,2.tumabox.org,D591:7B11:6A35:3114:C238:AA99:A6EB:0C28:7CF7:6805:41AC:5DBF:A8A0:239E:228C:5B06,
+securedns,SecureDNS,Uncensored and no logging,"Amsterdam, Netherlands",,https://securedns.eu,1,yes,yes,no,146.185.167.43:5353,2.dnscrypt-cert.securedns.eu,B3A5:9769:1457:5B04:89E1:9FAE:9C43:E679:FAF2:8C57:1897:0031:7F7B:B496:291F:B095,2.dnscrypt-cert.securedns.eu
+securedns-ipv6,SecureDNS over IPv6,Uncensored and no logging,"Amsterdam, Netherlands",,https://securedns.eu,1,yes,yes,no,[2a03:b0c0:0:1010::e9a:3001]:5353,2.dnscrypt-cert.securedns.eu,B3A5:9769:1457:5B04:89E1:9FAE:9C43:E679:FAF2:8C57:1897:0031:7F7B:B496:291F:B095,2.dnscrypt-cert.securedns.eu
+soltysiak,"Soltysiak","Public DNSCrypt server in Poland","Poland","52.4014619, 16.9278078",http://dc1.soltysiak.com/,1,yes,yes,yes,178.216.201.222:2053,2.dnscrypt-cert.soltysiak.com,25C4:E188:2915:4697:8F9C:2BBD:B6A7:AFA4:01ED:A051:0508:5D53:03E7:1928:C066:8F21,pubkey.dc1.soltysiak.com
+soltysiak-ipv6,"Soltysiak over IPv6","Public DNSCrypt server in Poland","Poland","52.4014619, 16.9278078",http://dc1.soltysiak.com/,1,yes,yes,yes,[2001:470:70:4ff::2]:2053,2.dnscrypt-cert.soltysiak.com,25C4:E188:2915:4697:8F9C:2BBD:B6A7:AFA4:01ED:A051:0508:5D53:03E7:1928:C066:8F21,pubkey.dc1.soltysiak.com
+ventricle.us,"Anatomical DNS","Public DNSCrypt resolver provided by Jacob Henner","New York, NY","",https://jacobhenner.com,1,yes,yes,no,107.170.57.34,2.dnscrypt-cert.dnscrypt.ventricle.us,E985:F118:AD4E:3CC6:5FF2:2520:1890:C6F5:58B7:5B5A:52F5:6B17:CFEA:C100:5C8B:9BAA,pubkey.dnscrypt.ventricle.us
+yandex,"Yandex","Yandex public DNS server","Anycast","",https://www.yandex.com,1,no,no,no,77.88.8.78:15353,2.dnscrypt-cert.browser.yandex.net,D384:C071:C9F7:4662:AF2A:CCD5:7B5D:CC97:14D4:07B6:AD36:01E1:AEDC:06D5:6D49:6327,
index ca32cd1dc1d940fc4338a0bd8d6c9de0bca5f697..f27ad745e5e086e852dbfd6c786fe2debfeec981 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dynapoint
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_MAINTAINER:=Tobias Ilte <tobias.ilte@campus.tu-berlin.de>
 PKG_LICENSE:=GPL-3.0+
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/$(PKG_NAME)
+define Package/dynapoint
     SECTION:=net
     CATEGORY:=Network
     SUBMENU:=wireless
@@ -23,19 +23,19 @@ define Package/$(PKG_NAME)
     TITLE:=Dynamic access point manager
 endef
 
-define Package/$(PKG_NAME)/description
+define Package/dynapoint/description
   Dynapoint uses LUA scripts to allow dynamic access point creation
   and deletion depending on changes of certain network conditions.
 endef
 
-define Package/$(PKG_NAME)/conffiles
+define Package/dynapoint/conffiles
 /etc/config/dynapoint
 endef
 
 define Build/Compile
 endef
 
-define Package/$(PKG_NAME)/install
+define Package/dynapoint/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) ./src/dynapoint.lua $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/etc/init.d
@@ -44,4 +44,4 @@ define Package/$(PKG_NAME)/install
        $(INSTALL_DATA) ./src/dynapoint.config $(1)/etc/config/dynapoint
 endef
 
-$(eval $(call BuildPackage,$(PKG_NAME)))
+$(eval $(call BuildPackage,dynapoint))
index 4d2e456a8a38431901b2b832dbea0ec6bbee8053..95006e13a7a75e593cf1edc1c77c77b969467692 100644 (file)
@@ -52,8 +52,22 @@ local curl = tonumber(uci_cursor:get("dynapoint", "internet", "use_curl"))
 if (curl == 1) then
   curl_interface = uci_cursor:get("dynapoint", "internet", "curl_interface")
 end
+function get_system_sections(t)
+  for pos,val in pairs(t) do
+    if (type(val)=="table") then
+      get_system_sections(val);
+    elseif (type(val)=="string") then
+      if (pos == "hostname") then
+         localhostname = val
+      end
+    end
+  end
+end
 if (tonumber(uci_cursor:get("dynapoint", "internet", "add_hostname_to_ssid")) == 1 ) then
-  localhostname = uci_cursor:get("system", "system", "hostname")
+  get_system_sections(getConfType("system","system"))
+  if (not localhostname) then
+     error("Failed to obtain system hostname")
+  end
 end
 
 local table_names_rule = {}
@@ -72,8 +86,8 @@ function get_dynapoint_sections(t)
         elseif (val == "!internet") then
           table_names_not_rule[#table_names_not_rule+1] = t[".name"]
           if (localhostname) then
-            ssids_not_rule[#ssids_not_rule+1] = t[".ssid"]
-            ssids_with_hostname[#ssids_with_hostname+1] = t[".ssid"].."_"..localhostname
+            ssids_not_rule[#ssids_not_rule+1] = uci_cursor:get("wireless", t[".name"], "ssid")
+            ssids_with_hostname[#ssids_with_hostname+1] = uci_cursor:get("wireless", t[".name"], "ssid").."_"..localhostname
           end
         end
       end
@@ -81,7 +95,6 @@ function get_dynapoint_sections(t)
   end
 end
 
-
 --print(table.getn(hosts))
 
 get_dynapoint_sections(getConfType("wireless","wifi-iface"))
@@ -126,21 +139,16 @@ end
 function change_wireless_config(switch_to_offline)
   if (switch_to_offline == 1) then
     log.syslog("info","Switched to OFFLINE")
-
     for i = 1, #table_names_not_rule do
       uci_cursor:set("wireless",table_names_not_rule[i], "disabled", "0")
       if (localhostname) then
         uci_cursor:set("wireless", table_names_not_rule[i], "ssid", ssids_with_hostname[i])
-        log.syslog("info","Bring up new AP "..ssids_with_hostname[i])
-      else
-        log.syslog("info","Bring up new AP "..ssids_not_rule[i])
       end
+      log.syslog("info","Bring up new AP "..uci_cursor:get("wireless", table_names_not_rule[i], "ssid"))
     end
-
     for i = 1, #table_names_rule do
       uci_cursor:set("wireless",table_names_rule[i], "disabled", "1")
     end
-
   else
     log.syslog("info","Switched to ONLINE")
     for i = 1, #table_names_not_rule do
index fac9737e0d54f123d033b032c2ae587e37588e0c..14462a460bd0a10ab8a27c27461a5dd1445308b4 100644 (file)
@@ -16,7 +16,7 @@ PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
 
 PKG_SOURCE:=v$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/$(PKG_NAME)/$(PKG_NAME)/archive/
-PKG_MD5SUM:=70613669ef00a480e3ebb62e12427cf4
+PKG_HASH:=cae011aacf6b250fc021c861fe46e15310349c474bca4553c0f829620e53e3bf
 
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
index 8c2b403b1bb96da81108c69dd7d7997e9204078d..87d1f068cb71dcfb8a19cabb96094a8b2c0d3674 100644 (file)
@@ -19,7 +19,7 @@ VERSION_TRANSFORMED:=$(subst .,-,$(PKG_VERSION))
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(VERSION_TRANSFORMED)
 PKG_SOURCE:=$(PKG_NAME)-$(VERSION_TRANSFORMED).tgz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=5ee3e5237c6a12059ae9d38380505d38448c2c12787f9fcc603cdb0a1a519312
+PKG_HASH:=5ee3e5237c6a12059ae9d38380505d38448c2c12787f9fcc603cdb0a1a519312
 
 PKG_BUILD_PARALLEL:=1
 
index ae3eff15f4d325589459a5d2e173b531a43b022e..9a0b9ba80459caa7468ebcf647725ed53684465e 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/e/etherwake
-PKG_MD5SUM:=628e8b2a28d47f262e4c26c989402a59
+PKG_HASH:=54241c7689579dc86e29e6afbc6d60e69f97135091a1395c8a10f6d5a2daec1d
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).orig
 
diff --git a/net/ethtool/Config.in b/net/ethtool/Config.in
deleted file mode 100644 (file)
index 7ec5553..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-menu "Configuration"
-       depends on PACKAGE_ethtool
-
-       config ETHTOOL_PRETTY_DUMP
-               bool "Enable pretty printing"
-
-endmenu
diff --git a/net/ethtool/Makefile b/net/ethtool/Makefile
deleted file mode 100644 (file)
index d0a0baf..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# 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:=ethtool
-PKG_VERSION:=4.8
-PKG_RELEASE:=1
-
-PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=@KERNEL/software/network/ethtool
-PKG_MD5SUM:=e9e7286178f172c9f21bafbfb978d6de
-
-PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILES:=COPYING
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-PKG_BUILD_PARALLEL:=1
-
-PKG_CONFIG_DEPENDS:=ETHTOOL_PRETTY_DUMP
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/ethtool
-  SECTION:=net
-  CATEGORY:=Network
-  TITLE:=Display or change ethernet card settings
-  URL:=http://www.kernel.org/pub/software/network/ethtool/
-endef
-
-define Package/ethtool/description
- ethtool is a small utility for examining and tuning your ethernet-based
- network interface
-endef
-
-define Package/ethtool/config
-       source "$(SOURCE)/Config.in"
-endef
-
-ifeq ($(CONFIG_ETHTOOL_PRETTY_DUMP),y)
-CONFIGURE_ARGS += --enable-pretty-dump
-else
-CONFIGURE_ARGS += --disable-pretty-dump
-endif
-
-define Package/ethtool/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ethtool $(1)/usr/sbin
-endef
-
-$(eval $(call BuildPackage,ethtool))
index ce279116d3e68713ae404328ff55a1bc25408c06..e52c15287d80663423bd2267a51a1bbf69f68f73 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).c
 PKG_SOURCE_URL:=http://distfiles.gentoo.org/distfiles/
-PKG_MD5SUM:=d26693c1a7c883d1432e05fb6f7ead6e
+PKG_HASH:=75b321e5d9dddcea2b38035b62ac30f2175ed43f3f187be6da19aaa67c4fe165
 PKG_MAINTAINER:=Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
 PKG_LICENSE:=GPL-2.0+
 UNPACK_CMD=$(CP) $(DL_DIR)/$(PKG_SOURCE) $(1)/
index aeaa1dfcf682a5c2b048d636b549953035fdbf0d..4e2bcd5f96240aafef1e8e5741c06c768c7ca9fb 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=2
 PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/86
-PKG_MD5SUM:=e53236d3049f64f7955ad9556da099eb
+PKG_HASH:=714ff09d7bd75f79783f744f6f8c5af2fe456c8cf876feaa704c205a73e043c9
 
 PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=COPYRIGHT
index 3b7a47aac89ecc8c6fa2d549f0da8219a92bf8a4..fcece20701934f96222e4b636bd4a9b468e38ddb 100644 (file)
@@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fossil
 PKG_VERSION:=1.34
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_LICENSE:=BSD-2-Clause
 PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
 
 PKG_SOURCE:=$(PKG_NAME)-src-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.fossil-scm.org/index.html/uv/download
-PKG_MD5SUM:=3d5a7da5c506a47784942236a788b29b
+PKG_HASH:=53a6b83e878feced9ac7705f87e5b6ea82727314e3e19202ae1c46c7e4dba49f
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-src-$(PKG_VERSION)
 
@@ -42,7 +42,7 @@ endef
 MAKE_FLAGS := \
        TCC="$(TARGET_CC)" \
        CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -DFOSSIL_ENABLE_JSON" \
-       LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath=$(TOOLCHAIN_DIR)/lib -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
+       LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath=$(TOOLCHAIN_DIR)/lib -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib -lm" \
 
 define Build/Configure
 endef
diff --git a/net/fping/Makefile b/net/fping/Makefile
new file mode 100644 (file)
index 0000000..b0f3ae7
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2016 Nikil Mehta <nikil.mehta@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fping
+PKG_VERSION:=4.0
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://fping.org/dist/
+PKG_HASH:=67eb4152b98ad34f99d2eec4e1098a0bb52caf13c0c89cd147349d08190fe8ce
+
+PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
+PKG_LICENSE:=BSD-4-Clause
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fping
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=sends ICMP ECHO_REQUEST packets to network hosts
+  URL:=http://fping.org/
+endef
+
+
+define Package/fping/description
+       fping is a ping like program which uses the Internet Control Message Protocol
+       (ICMP) echo request to determine if a target host is responding.  fping
+       differs from ping in that you can specify any number of targets on the command
+       line, or specify a file containing the lists of targets to ping.  Instead of
+       sending to one target until it times out or replies, fping will send out a
+       ping packet and move on to the next target in a round-robin fashion.
+endef
+
+CONFIGURE_ARGS+= \
+       --enable-ipv4 \
+       --enable-ipv6
+
+TARGET_CFLAGS += -std=gnu99
+
+define Package/fping/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fping $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,fping))
index 7603e86dfab7c7409a0a3d28801dac0c33c5a588..20d1dc5e2e7d8cccbcc3b288eaed7412f51f5419 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=freeradius3
 PKG_VERSION:=release_3_0_11
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/FreeRADIUS/freeradius-server/archive
-PKG_MD5SUM:=612cb1d9ad0d66e881d8b0592cd51720
+PKG_HASH:=f0b32edb90368c3b9523e2baa792a1794d8bad662407f0d210a6c460541379b7
 
 PKG_MAINTAINER:=Lucile Quirion <lucile.quirion@savoirfairelinux.com>
 PKG_LICENSE:=GPL-2.0
@@ -137,6 +137,8 @@ define Package/freeradius3-mod-eap/conffiles
 /etc/freeradius3/mods-available/eap
 /etc/freeradius3/mods-enabled/eap
 /etc/freeradius3/policy.d/eap
+/etc/freeradius3/sites-enabled/inner-tunnel
+/etc/freeradius3/sites-available/inner-tunnel
 endef
 
 define Package/freeradius3-mod-eap-gtc
@@ -169,11 +171,6 @@ define Package/freeradius3-mod-eap-peap
   TITLE:=EAP/PEAP module
 endef
 
-define Package/freeradius3-mod-eap-peap/conffiles
-/etc/freeradius3/sites-available/inner-tunnel
-/etc/freeradius3/sites-enabled/inner-tunnel
-endef
-
 define Package/freeradius3-mod-eap-tls
   $(call Package/freeradius3/Default)
   DEPENDS:=freeradius3-mod-eap @FREERADIUS3_OPENSSL
@@ -186,11 +183,6 @@ define Package/freeradius3-mod-eap-ttls
   TITLE:=EAP/TTLS module
 endef
 
-define Package/freeradius3-mod-eap-ttls/conffiles
-/etc/freeradius3/sites-available/inner-tunnel
-/etc/freeradius3/sites-enabled/inner-tunnel
-endef
-
 define Package/freeradius3-mod-exec
   $(call Package/freeradius3/Default)
   DEPENDS:=freeradius3
@@ -282,7 +274,15 @@ define Package/freeradius3-mod-passwd/conffiles
 /etc/freeradius3/mods-enabled/passwd
 endef
 
-# LDAP support has not been ported
+define Package/freeradius3-mod-ldap
+  $(call Package/freeradius3/Default)
+  DEPENDS:=freeradius3 +libopenldap @FREERADIUS3_OPENSSL
+  TITLE:=LDAP Authentication
+endef
+
+define Package/freeradius3-mod-ldap/conffiles
+/etc/freeradius3/mods-available/ldap
+endef
 
 define Package/freeradius3-mod-logintime
   $(call Package/freeradius3/Default)
@@ -404,7 +404,6 @@ CONFIGURE_ARGS+= \
        --without-rlm_idn \
        --without-rlm_ippool \
        --without-rlm_krb5 \
-       --without-rlm_ldap \
        --without-rlm_opendirectory \
        --without-rlm_pam \
        --without-rlm_perl \
@@ -481,6 +480,14 @@ else
   CONFIGURE_ARGS+= --without-rlm_unix
 endif
 
+ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius3-mod-ldap),)
+  CONFIGURE_ARGS+= --with-rlm_ldap \
+               --with-rlm_ldap-include-dir="$(STAGING_DIR)/usr/include" \
+               --with-rlm_ldap-lib-dir="$(STAGING_DIR)/usr/lib"
+else
+  CONFIGURE_ARGS+= --without-rlm_ldap
+endif
+
 CONFIGURE_VARS+= \
        LDFLAGS="$$$$LDFLAGS" \
        LIBS="$(CONFIGURE_LIBS)" \
@@ -595,6 +602,7 @@ $(eval $(call BuildPlugin,freeradius3-mod-exec,rlm_exec,))
 $(eval $(call BuildPlugin,freeradius3-mod-expiration,rlm_expiration,))
 $(eval $(call BuildPlugin,freeradius3-mod-expr,rlm_expr,))
 $(eval $(call BuildPlugin,freeradius3-mod-files,rlm_files,))
+$(eval $(call BuildPlugin,freeradius3-mod-ldap,rlm_ldap,))
 $(eval $(call BuildPlugin,freeradius3-mod-logintime,rlm_logintime,))
 $(eval $(call BuildPlugin,freeradius3-mod-mschap,rlm_mschap,))
 $(eval $(call BuildPlugin,freeradius3-mod-pap,rlm_pap,))
diff --git a/net/freeradius3/patches/001-fix-cert-expiry.patch b/net/freeradius3/patches/001-fix-cert-expiry.patch
new file mode 100644 (file)
index 0000000..578bbbc
--- /dev/null
@@ -0,0 +1,33 @@
+--- a/raddb/certs/ca.cnf
++++ b/raddb/certs/ca.cnf
+@@ -14,7 +14,7 @@ private_key          = $dir/ca.key
+ RANDFILE              = $dir/.rand
+ name_opt              = ca_default
+ cert_opt              = ca_default
+-default_days          = 60
++default_days          = 365
+ default_crl_days      = 30
+ default_md            = sha256
+ preserve              = no
+--- a/raddb/certs/client.cnf
++++ b/raddb/certs/client.cnf
+@@ -14,7 +14,7 @@ private_key          = $dir/ca.key
+ RANDFILE              = $dir/.rand
+ name_opt              = ca_default
+ cert_opt              = ca_default
+-default_days          = 60
++default_days          = 365
+ default_crl_days      = 30
+ default_md            = sha256
+ preserve              = no
+--- a/raddb/certs/server.cnf
++++ b/raddb/certs/server.cnf
+@@ -14,7 +14,7 @@ private_key          = $dir/server.key
+ RANDFILE              = $dir/.rand
+ name_opt              = ca_default
+ cert_opt              = ca_default
+-default_days          = 60
++default_days          = 365
+ default_crl_days      = 30
+ default_md            = sha256
+ preserve              = no
diff --git a/net/freeradius3/patches/002-disable-session-cache-CVE-2017-9148.patch b/net/freeradius3/patches/002-disable-session-cache-CVE-2017-9148.patch
new file mode 100644 (file)
index 0000000..458eeba
--- /dev/null
@@ -0,0 +1,47 @@
+Description: disable session caching in the server (as opposed to in the
+ config, which would be way harder to get right) to address
+ https://security-tracker.debian.org/tracker/CVE-2017-9148
+Author: Michael Stapelberg <stapelberg@debian.org>
+Forwarded: not-needed
+Last-Update: 2017-05-30
+
+---
+
+--- a/src/main/tls.c
++++ b/src/main/tls.c
+@@ -369,7 +369,7 @@ tls_session_t *tls_new_session(TALLOC_CT
+        *
+        *      FIXME: Also do it every N sessions?
+        */
+-      if (conf->session_cache_enable &&
++      if (/*conf->session_cache_enable*/0 &&
+           ((conf->session_last_flushed + ((int)conf->session_timeout * 1800)) <= request->timestamp)){
+               RDEBUG2("Flushing SSL sessions (of #%ld)", SSL_CTX_sess_number(conf->ctx));
+@@ -463,7 +463,7 @@ tls_session_t *tls_new_session(TALLOC_CT
+               state->mtu = vp->vp_integer;
+       }
+-      if (conf->session_cache_enable) state->allow_session_resumption = true; /* otherwise it's false */
++      if (/*conf->session_cache_enable*/0) state->allow_session_resumption = true; /* otherwise it's false */
+       return state;
+ }
+@@ -2675,7 +2675,7 @@ post_ca:
+       /*
+        *      Callbacks, etc. for session resumption.
+        */
+-      if (conf->session_cache_enable) {
++      if (/*conf->session_cache_enable*/0) {
+               /*
+                *      Cache sessions on disk if requested.
+                */
+@@ -2745,7 +2745,7 @@ post_ca:
+       /*
+        *      Setup session caching
+        */
+-      if (conf->session_cache_enable) {
++      if (/*conf->session_cache_enable*/0) {
+               /*
+                *      Create a unique context Id per EAP-TLS configuration.
+                */
index cbe221196b559c51f44b72c8dc286726d85f6968..65a1c941645adfe7438dca3c970153e3ace4e5e6 100644 (file)
@@ -9,11 +9,10 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fwknop
 PKG_VERSION:=2.6.9
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.cipherdyne.org/fwknop/download
-PKG_MD5SUM:=e2c49e9674888a028bd443a55c3aaa22
 PKG_HASH:=5bf47fe1fd30e862d29464f762c0b8bf89b5e298665c37624d6707826da956d4
 PKG_MAINTAINER:=Jonathan Bennett <JBennett@incomsystems.biz>
 PKG_LICENSE:=GPLv2
index 0874ee4076979ade13a20d684adb8c471c3e687e..8a2b7599edca9faa2d7cf7dffe95a0712dde7e09 100644 (file)
@@ -1,6 +1,9 @@
 config global
 #      option uci_enabled '1'
 
+config network
+#      option network 'wan'    # takes precedence over config.PCAP_INTF
+
 config access
        option SOURCE 'ANY'
        option HMAC_KEY 'CHANGEME'
index baf81b8da63935c60dfc6adaf4db35385d643bb1..f59691151623569c8d295eb002405969cc9b095e 100644 (file)
@@ -4,50 +4,59 @@
 # Copyright (C) 2009-2014 fwknop developers and contributors. For a full
 # list of contributors, see the file 'CREDITS'.
 #
-. /lib/functions.sh
+
+USE_PROCD=1
 START=95
 
 FWKNOPD_BIN=/usr/sbin/fwknopd
 
-start()
+start_service()
 {
-       gen_confs
-       if [ $UCI_ENABLED ]; then
-               $FWKNOPD_BIN -c /var/etc/fwknopd.conf -a /var/etc/access.conf 
-       else
-               $FWKNOPD_BIN 
+       generate_configuration
+
+       procd_open_instance
+       procd_set_param command "$FWKNOPD_BIN" --foreground --syslog-enable
+       procd_set_param respawn
+
+       if [ $UCI_ENABLED -eq 1 ]; then
+               procd_append_param command -c /var/etc/fwknopd.conf
+               procd_append_param command -a /var/etc/access.conf
        fi
 
-}
+       procd_append_param command -i "$DEPEND_IFNAME"
+       procd_set_param netdev "$DEPEND_IFNAME"
 
-stop()
-{
-        $FWKNOPD_BIN -K
+       procd_close_instance
 }
 
-restart()
+service_triggers()
 {
-    stop;
-    sleep 1;
-    start;
+       procd_add_reload_trigger "fwknopd"
 }
 
-reload()
+get_bool()
 {
-       gen_confs
-        $FWKNOPD_BIN -R
+       local _tmp="$1"
+       case "$_tmp" in
+               1|on|true|yes|enabled) _tmp=1;;
+               0|off|false|no|disabled) _tmp=0;;
+               *) _tmp="$2";;
+       esac
+       echo -n "$_tmp"
 }
 
-gen_confs()
+generate_configuration()
 {
        [ -f /tmp/access.conf.tmp ] && rm /tmp/access.conf.tmp
-       if [ -z "$( uci get fwknopd.@config[0].PCAP_INTF )" ]
-       then
-               . /lib/functions/network.sh
-               network_get_physdev device wan
-               uci set fwknopd.@config[0].PCAP_INTF="$device"
-               uci commit
-       fi
+
+       UCI_ENABLED=0
+       DEPEND_IFNAME=
+       local NETWORK=
+       local PCAP_INTF=
+       local USER_CONFIG_PATH=/etc/fwknop/fwknopd.conf
+       local DEFAULT_UCI_NETWORK=wan
+       local DEFAULT_FWKNOPD_IFNAME=eth0
+
        config_cb() {
                local type="$1"
                local name="$2"
@@ -55,7 +64,7 @@ gen_confs()
                        option_cb() {
                                local option="$1"
                                local value="$2"
-                               if [ "$option" = "uci_enabled" ] && [ "$value" -eq 1 ] ; then
+                               if [ "$option" = "uci_enabled" ] && [ "$(get_bool "$value" 0)" -eq 1 ] ; then
                                        > /var/etc/fwknopd.conf
                                        > /var/etc/access.conf
                                         chmod 600 /var/etc/fwknopd.conf
@@ -63,11 +72,22 @@ gen_confs()
                                        UCI_ENABLED=1
                                fi
                        }
+               elif [ "$type" = "network" ]; then
+                       option_cb() {
+                               local option="$1"
+                               local value="$2"
+                               if [ $UCI_ENABLED -eq 1 ] && [ $option = "network" ]; then
+                                       NETWORK="$value"
+                               fi
+                       }
                elif [ "$type" = "config" ]; then
                        option_cb() {
                                local option="$1"
                                local value="$2"
-                               if [ $UCI_ENABLED ]; then
+                               if [ $UCI_ENABLED -eq 1 ] && [ $option = "PCAP_INTF" ]; then
+                                       PCAP_INTF="$value"
+                                       echo "$option $value" >> /var/etc/fwknopd.conf  #writing each option to fwknopd.conf
+                               elif [ $UCI_ENABLED -eq 1 ]; then
                                        echo "$option $value" >> /var/etc/fwknopd.conf  #writing each option to fwknopd.conf
                                fi
                        }
@@ -80,22 +100,64 @@ gen_confs()
                        option_cb() {
                                local option="$1"
                                local value="$2"
-                               if [ $UCI_ENABLED ] && [ $option = "SOURCE" ]; then
+                               if [ $UCI_ENABLED -eq 1 ] && [ $option = "SOURCE" ]; then
                                        echo "$option $value" >> /var/etc/access.conf  #writing each option to access.conf
                                fi
-                               if [ $UCI_ENABLED ] && [ $option != "SOURCE" ]; then
+                               if [ $UCI_ENABLED -eq 1 ] && [ $option != "SOURCE" ]; then
                                        echo "$option $value" >> /tmp/access.conf.tmp  #writing each option to access.conf
                                fi
                        }
+               else
+                       option_cb() { return; }
+                       if [ -z "$type" ]; then
+                               # Finalize reading
+                               if [ -f /tmp/access.conf.tmp ] ; then
+                                       cat /tmp/access.conf.tmp >> /var/etc/access.conf
+                                       rm /tmp/access.conf.tmp
+                               fi
+                       fi
                fi
        }
 
        if [ -f /etc/config/fwknopd ]; then
                config_load fwknopd
-               if [ -f /tmp/access.conf.tmp ] ; then
-                       cat /tmp/access.conf.tmp >> /var/etc/access.conf
-                       rm /tmp/access.conf.tmp
-               fi
        fi
 
+       if [ $UCI_ENABLED -eq 0 ]; then
+               if [ -f $USER_CONFIG_PATH ] ; then
+                       # Scan user configuration for PCAP_INTF settings
+                       DEPEND_IFNAME="$( sed -ne '/^\s*PCAP_INTF\s\+/ { s/^\s*PCAP_INTF\s\+//; s/\s\+$//; p; q; }' /etc/fwknop/fwknopd.conf )"
+                       if [ -n "$DEPEND_IFNAME" ]; then
+                               logger -p daemon.debug -t "fwknopd[----]" "Found fwknopd.conf configuration, using PCAP_INTF interface $DEPEND_IFNAME"
+                       else
+                               logger -p daemon.info -t "fwknopd[----]" "No PCAP_INTF interface specified in fwknopd.conf, fwknopd's default $DEFAULT_FWKNOPD_IFNAME will be used"
+                               DEPEND_IFNAME="$DEFAULT_FWKNOPD_IFNAME"
+                       fi
+               else
+                       logger -p daemon.error -t "fwknopd[----]" "No $USER_CONFIG_PATH found, not starting"
+                       exit 1
+               fi
+       elif [ $UCI_ENABLED -eq 1 ]; then
+               if [ -n "$NETWORK" ] && [ -n "$PCAP_INTF" ]; then
+                       logger -p daemon.warn -t "fwknopd[----]" "Specified both network and PCAP_INTF. Ignoring PCAP_INTF"
+               elif [ -z "$NETWORK" ] && [ -z "$PCAP_INTF" ]; then
+                       # Fallback - compatibility with old script, which used wan interface by default
+                       logger -p daemon.info -t "fwknopd[----]" "Neither network, nor PCAP_INTF interface specified, trying network $DEFAULT_UCI_NETWORK"
+                       NETWORK="$DEFAULT_UCI_NETWORK"
+               fi
+
+               if [ -n "$NETWORK" ]; then
+                       . /lib/functions/network.sh
+                       network_get_physdev DEPEND_IFNAME "$NETWORK"
+                       if [ -n "$DEPEND_IFNAME" ]; then
+                               logger -p daemon.debug -t "fwknopd[----]" "Resolved network $NETWORK as interface $DEPEND_IFNAME"
+                       else
+                               logger -p daemon.warn -t "fwknopd[----]" "Cannot find interface for network $NETWORK, fwknopd's default $DEFAULT_FWKNOPD_IFNAME will be used"
+                               DEPEND_IFNAME="$DEFAULT_FWKNOPD_IFNAME"
+                       fi
+               elif [ -n "$PCAP_INTF" ]; then
+                       DEPEND_IFNAME="$PCAP_INTF"
+                       logger -p daemon.debug -t "fwknopd[----]" "Using configured PCAP_INTF interface $DEPEND_IFNAME"
+               fi
+       fi
 }
index 8598d8dd00cc4613f365ab2e2877558f6be4f4f9..b2d8e2c9350ae64efd5417005b72eeaafd5093a3 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2009-2016 OpenWrt.org
+# Copyright (C) 2009-2018 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=git
-PKG_VERSION:=2.11.3
-PKG_RELEASE:=1
+PKG_VERSION:=2.16.1
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/scm/git/
-PKG_HASH:=7343bbd489f59531d66bc086393f0d5f530b5175927c29fb97b07f9d2cbc31ac
+PKG_HASH:=cfad4337f2fdbfc1e2c8abce5e17e1dd4e1718a34ac2cbe3238fbe2426f2ea19
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
@@ -43,7 +43,7 @@ endef
 
 define Package/git-http
 $(call Package/git/Default)
-  DEPENDS+=git +libcurl +ca-certificates
+  DEPENDS+= +git +libcurl +ca-certificates
   TITLE:=Git HTTP commands
 endef
 
@@ -56,7 +56,7 @@ endef
 define Package/git-gitweb
 $(call Package/git/Default)
   TITLE:=Git repository web interface
-  DEPENDS:=git +perlbase-essential +perlbase-file +perlbase-fcntl +perlbase-encode +perlbase-digest +perlbase-time +perl-cgi
+  DEPENDS+= +git +perlbase-essential +perlbase-file +perlbase-fcntl +perlbase-encode +perlbase-digest +perlbase-time +perl-cgi
 endef
 
 define Package/git-gitweb/description
@@ -110,7 +110,10 @@ define Package/git/install
        $(RM) $(PKG_INSTALL_DIR)/usr/bin/git-cvsserver
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/git-* $(1)/usr/bin
        $(INSTALL_DIR) $(1)/usr/lib/git-core
-       $(LN) /usr/bin/git $(1)/usr/lib/git-core/git
+       ln $(1)/usr/bin/git $(1)/usr/lib/git-core/git
+       ln $(1)/usr/bin/git-shell $(1)/usr/lib/git-core/git-shell
+       ln $(1)/usr/bin/git-upload-pack $(1)/usr/lib/git-core/git-upload-pack
+       $(INSTALL_DIR) $(1)/usr/share/git-core/templates
        ( cd $(PKG_INSTALL_DIR); $(TAR) \
                --exclude=usr/lib/git-core/git-http-backend \
                --exclude=usr/lib/git-core/git-http-fetch \
@@ -118,10 +121,13 @@ define Package/git/install
                --exclude=usr/lib/git-core/git-remote-ftps \
                --exclude=usr/lib/git-core/git-remote-http \
                --exclude=usr/lib/git-core/git-remote-https \
+               --exclude=usr/lib/git-core/git \
+               --exclude=usr/lib/git-core/git-shell \
+               --exclude=usr/lib/git-core/git-upload-pack \
                -cf - \
                usr/lib/git-core \
+               usr/share/git-core/templates \
        ) | ( cd $(1); $(TAR) -xf - )
-       $(INSTALL_DIR) $(1)/usr/share/git-core/templates
 endef
 
 define Package/git-http/install
diff --git a/net/git/patches/100-configure_for_crosscompiling.patch b/net/git/patches/100-configure_for_crosscompiling.patch
new file mode 100644 (file)
index 0000000..eb8d4f7
--- /dev/null
@@ -0,0 +1,32 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -925,7 +925,8 @@ AC_RUN_IFELSE(
+               FILE *f = fopen(".", "r");
+               return f)]])],
+       [ac_cv_fread_reads_directories=no],
+-      [ac_cv_fread_reads_directories=yes])
++      [ac_cv_fread_reads_directories=yes],
++      [ac_cv_fread_reads_directories=no])
+ ])
+ if test $ac_cv_fread_reads_directories = yes; then
+       FREAD_READS_DIRECTORIES=UnfortunatelyYes
+@@ -959,7 +960,8 @@ AC_RUN_IFELSE(
+                 if (snprintf(buf, 3, "%s", "12345") != 5
+                     || strcmp(buf, "12")) return 1]])],
+       [ac_cv_snprintf_returns_bogus=no],
+-      [ac_cv_snprintf_returns_bogus=yes])
++      [ac_cv_snprintf_returns_bogus=yes],
++      [ac_cv_snprintf_returns_bogus=no])
+ ])
+ if test $ac_cv_snprintf_returns_bogus = yes; then
+       SNPRINTF_RETURNS_BOGUS=UnfortunatelyYes
+@@ -982,7 +984,8 @@ yippeeyeswehaveit
+ #endif
+ ]),
+       [ac_cv_sane_mode_bits=yes],
+-      [ac_cv_sane_mode_bits=no])
++      [ac_cv_sane_mode_bits=no],
++      [ac_cv_sane_mode_bits=yes])
+ ])
+ if test $ac_cv_sane_mode_bits = yes; then
+       NEEDS_MODE_TRANSLATION=
diff --git a/net/git/patches/200-disable_fasthash.patch b/net/git/patches/200-disable_fasthash.patch
deleted file mode 100644 (file)
index 91f255f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/config.mak.uname
-+++ b/config.mak.uname
-@@ -17,9 +17,6 @@ endif
- # because maintaining the nesting to match is a pain.  If
- # we had "elif" things would have been much nicer...
--ifeq ($(uname_M),x86_64)
--      XDL_FAST_HASH = YesPlease
--endif
- ifeq ($(uname_S),OSF1)
-       # Need this for u_short definitions et al
-       BASIC_CFLAGS += -D_OSF_SOURCE
diff --git a/net/git/patches/200-imapsend_without_curl.patch b/net/git/patches/200-imapsend_without_curl.patch
new file mode 100644 (file)
index 0000000..3d3a92e
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1234,7 +1234,7 @@ else
+       endif
+       curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
+       ifeq "$(curl_check)" "072200"
+-              USE_CURL_FOR_IMAP_SEND = YesPlease
++#             USE_CURL_FOR_IMAP_SEND = YesPlease
+       endif
+       ifdef USE_CURL_FOR_IMAP_SEND
+               BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND
diff --git a/net/git/patches/300-configure_for_crosscompiling b/net/git/patches/300-configure_for_crosscompiling
deleted file mode 100644 (file)
index 8a8ce28..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -867,7 +867,8 @@ AC_RUN_IFELSE(
-               FILE *f = fopen(".", "r");
-               return f && fread(&c, 1, 1, f)]])],
-       [ac_cv_fread_reads_directories=no],
--      [ac_cv_fread_reads_directories=yes])
-+      [ac_cv_fread_reads_directories=yes],
-+      [ac_cv_fread_reads_directories=no])
- ])
- if test $ac_cv_fread_reads_directories = yes; then
-       FREAD_READS_DIRECTORIES=UnfortunatelyYes
-@@ -901,7 +902,8 @@ AC_RUN_IFELSE(
-                 if (snprintf(buf, 3, "%s", "12345") != 5
-                     || strcmp(buf, "12")) return 1]])],
-       [ac_cv_snprintf_returns_bogus=no],
--      [ac_cv_snprintf_returns_bogus=yes])
-+      [ac_cv_snprintf_returns_bogus=yes],
-+      [ac_cv_snprintf_returns_bogus=no])
- ])
- if test $ac_cv_snprintf_returns_bogus = yes; then
-       SNPRINTF_RETURNS_BOGUS=UnfortunatelyYes
-@@ -924,7 +926,8 @@ yippeeyeswehaveit
- #endif
- ]),
-       [ac_cv_sane_mode_bits=yes],
--      [ac_cv_sane_mode_bits=no])
-+      [ac_cv_sane_mode_bits=no],
-+      [ac_cv_sane_mode_bits=yes])
- ])
- if test $ac_cv_sane_mode_bits = yes; then
-       NEEDS_MODE_TRANSLATION=
diff --git a/net/git/patches/400-imapsend_without_curl.patch b/net/git/patches/400-imapsend_without_curl.patch
deleted file mode 100644 (file)
index 06d32a9..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -1117,7 +1117,7 @@ else
-       endif
-       curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
-       ifeq "$(curl_check)" "072200"
--              USE_CURL_FOR_IMAP_SEND = YesPlease
-+#             USE_CURL_FOR_IMAP_SEND = YesPlease
-       endif
-       ifdef USE_CURL_FOR_IMAP_SEND
-               BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND
index 0d7011d8a2559b1730ce2f910f9a713dd1024481..52f0acdc63aa7f48286bc775af8a6395f0b4561a 100644 (file)
@@ -13,6 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=b2d96c36682391f45c63b21a91fbe77a969a7b362417c851dd0091a06fcc74d9
 PKG_SOURCE_URL:=https://github.com/sitaramc/gitolite.git
 PKG_SOURCE_VERSION:=908f8c6f3b8ef5b95829be7155be2557e71f4579
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
index 3dead69587fb12cce5cb4ece7d5b0773f42d2156..f8551fdd147640cd38640541f7f7f24949bb9500 100644 (file)
@@ -1,11 +1,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnunet
-PKG_SOURCE_VERSION:=a4295da3df82817ff2fe1fa547374a96a2e0280b
-PKG_VERSION:=0.10.2-git-20170111-$(PKG_SOURCE_VERSION)
+PKG_SOURCE_VERSION:=b673e9c3ed4a211b974bc602b893a427533566d7
+PKG_MIRROR_HASH:=89bc8cb5813bd38e0006d91fcd091b0eef533d6ff8462c800bf37d2e19966beb
+
+PKG_VERSION:=0.10.2-git-20180205-$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://gnunet.org/git/gnunet.git
 PKG_SOURCE_PROTO:=git
@@ -28,9 +30,8 @@ CONFIGURE_ARGS+= \
        $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mysql),--with-mysql="$(STAGING_DIR)/usr",--without-mysql) \
        $(if $(CONFIG_PACKAGE_$(PKG_NAME)-pgsql),--with-postgresql="$(STAGING_DIR)/usr/bin/pg_config",--without-postgresql) \
        $(if $(CONFIG_PACKAGE_libsqlite3),--with-sqlite="$(STAGING_DIR)/usr",--without-sqlite) \
-       --disable-testing \
+       --enable-testing \
        --disable-testruns \
-       --disable-wachs \
        --enable-experimental \
        --with-extractor=$(STAGING_DIR)/usr \
        --with-gnutls=$(STAGING_DIR)/usr \
@@ -137,14 +138,14 @@ define Package/gnunet/install
                $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
        done )
 
-       ( for lib in arm ats block cadet core datacache dht \
+       ( for lib in arm ats block blockgroup cadet core datacache dht \
            dns dnsparser fragmentation friends hello identity natauto natnew nse \
            peerinfo regexblock regex revocation scalarproduct set \
            statistics transport util; do \
                $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
        done )
 
-       ( for plug in ats_proportional block_dht block_regex   \
+       ( for plug in ats_proportional block_dht block_regex block_revocation  \
            transport_tcp transport_udp transport_unix; do \
                $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
        done )
@@ -191,6 +192,9 @@ PLUGIN_conversation:=gnsrecord_conversation
 LIBEXEC_conversation:=helper-audio-playback helper-audio-record service-conversation
 CONF_conversation:=conversation
 
+BIN_dht-cli:=dht-get dht-put dht-monitor
+PLUGIN_dht-cli:=block_test
+
 DEPENDS_hostlist:=+libmicrohttpd +libgnurl +ca-certificates
 LIBEXEC_hostlist:=daemon-hostlist
 CONF_hostlist:=hostlist
@@ -206,7 +210,6 @@ LIBEXEC_transport-wlan:=helper-transport-wlan
 
 DEPENDS_experiments:=+libglpk
 PLUGIN_experiments:=ats_mlp ats_ril
-LIBEXEC_experiments:=service-dht-whanau service-dht-xvine
 
 # BIN_dv:=dv
 LIB_dv:=dv
@@ -225,7 +228,7 @@ DEPENDS_gns:=+gnunet-vpn +iptables-mod-extra
 USERID_gns:=gnunet=958:gnunetdns=452
 BIN_gns:=gns gns-import.sh namecache namestore resolver
 LIB_gns:=gns gnsrecord namecache namestore
-PLUGIN_gns:=block_dns block_gns gnsrecord_dns gnsrecord_gns gnsrecord_identity
+PLUGIN_gns:=block_dns block_gns gnsrecord_conversation gnsrecord_dns gnsrecord_gns
 LIBEXEC_gns:=dns2gns helper-dns service-dns service-gns service-namecache service-namestore service-resolver service-zonemaster
 CONF_gns:=dns gns namecache namestore resolver zonemaster
 
@@ -262,6 +265,7 @@ BIN_social:=identity-token multicast social
 LIB_social:=consensus identityprovider multicast psyc psycstore psycutil secretsharing social
 LIBEXEC_social:=service-consensus service-evil-consensus service-identity-provider service-multicast service-psyc service-psycstore service-secretsharing service-social
 CONF_social:=consensus multicast psyc psycstore secretsharing social
+PLUGINS_social:=block_consensus
 
 PLUGIN_dhtcache-heap:=datacache_heap
 CONFLICTS_dhtcache-heap:=gnunet-dhtcache-pgsql gnunet-dhtcache-sqlite
@@ -288,7 +292,7 @@ PLUGIN_fs-mysql:=datastore_mysql
 CONFLICTS_fs-mysql:=gnunet-fs-pgsql gnunet-fs-sqlite
 
 DEPENDS_pgsql:=+libpq
-LIB_pgsql:=postgres pq
+LIB_pgsql:=pq
 
 DEPENDS_dhtcache-pgsql:=+gnunet-pgsql
 PLUGIN_dhtcache-pgsql:=datacache_postgres
@@ -306,21 +310,24 @@ DEPENDS_social-pgsql:=+gnunet-pgsql +gnunet-social
 PLUGIN_social-pgsql:=psycstore_postgres
 CONFLICTS_social-pgsql:=gnunet-social-sqlite gnunet-social-mysql
 
-DEPENDS_gns-sqlite:=+libsqlite3 +gnunet-gns
+DEPENDS_sqlite:=+libsqlite3
+LIB_sqlite:=sq
+
+DEPENDS_gns-sqlite:=+gnunet-gns +gnunet-sqlite
 PLUGIN_gns-sqlite:=namecache_sqlite namestore_sqlite
 CONFLICTS_gns-sqlite:=gnunet-gns-flat
 
-DEPENDS_peerstore-sqlite:=+libsqlite3 +gnunet-peerstore
+DEPENDS_peerstore-sqlite:=+gnunet-peerstore +gnunet-sqlite
 PLUGIN_peerstore-sqlite:=peerstore_sqlite
 CONFLICTS_peerstore-sqlite:=gnunet-peerstore-flat
 
-DEPENDS_dhtcache-sqlite:=+libsqlite3
+DEPENDS_dhtcache-sqlite:=+gnunet-sqlite
 PLUGIN_dhtcache-sqlite:=datacache_sqlite
 
-DEPENDS_fs-sqlite:=+libsqlite3 +gnunet-datastore
+DEPENDS_fs-sqlite:=+gnunet-datastore +gnunet-sqlite
 PLUGIN_fs-sqlite:=datastore_sqlite
 
-DEPENDS_social-sqlite:=+libsqlite3 +gnunet-social
+DEPENDS_social-sqlite:=+gnunet-social  +gnunet-sqlite
 PLUGIN_social-sqlite:=psycstore_sqlite
 
 DEPENDS_transport-bluetooth:=+bluez-libs
@@ -384,7 +391,8 @@ $(eval $(call PostInstFixSUIDPerms,gnunet-vpn))
 $(eval $(call BuildPackage,gnunet))
 $(eval $(call BuildComponent,conversation,conversation component,))
 $(eval $(call BuildComponent,datastore,data storage components,))
-$(eval $(call BuildComponent,dv,distance-vector routing component,y))
+$(eval $(call BuildComponent,dht-cli,DHT command line clients,))
+# $(eval $(call BuildComponent,dv,distance-vector routing component,y))
 $(eval $(call BuildComponent,experiments,experimental components,))
 $(eval $(call BuildComponent,fs,file-sharing components,))
 $(eval $(call BuildComponent,gns,name resolution components,y))
@@ -399,14 +407,15 @@ $(eval $(call BuildComponent,dhtcache-heap,heap-based dhtcache plugin,y))
 $(eval $(call BuildComponent,fs-heap,heap-based filesharing plugin,))
 $(eval $(call BuildComponent,gns-flat,flat storage GNS plugins,y))
 $(eval $(call BuildComponent,peerstore-flat,flat storage peerstore plugin,))
-$(eval $(call BuildComponent,mysql,mySQL datastore backend,))
+$(eval $(call BuildComponent,mysql,mySQL backend,))
 $(eval $(call BuildComponent,fs-mysql,mySQL filesharing plugins,))
 $(eval $(call BuildComponent,social-mysql,mySQL social plugins,))
-$(eval $(call BuildComponent,pgsql,PostgreSQL storage backends,))
+$(eval $(call BuildComponent,pgsql,PostgreSQL backend,))
 $(eval $(call BuildComponent,dhtcache-pgsql,PostgreSQL dhtcache plugin,))
 $(eval $(call BuildComponent,fs-pgsql,PostgreSQL filesharing plugin,))
 $(eval $(call BuildComponent,gns-pgsql,PostgreSQL GNS plugins,))
 $(eval $(call BuildComponent,social-pgsql,PostgreSQL social plugin,))
+$(eval $(call BuildComponent,sqlite,libsqlite3 backend,))
 $(eval $(call BuildComponent,dhtcache-sqlite,libsqlite3 dhtcache plugin,))
 $(eval $(call BuildComponent,fs-sqlite,libsqlite3 filesharing plugin,))
 $(eval $(call BuildComponent,gns-sqlite,libsqlite3 gns plugins,))
index 5975313fb01aced83cc3e1759f0151893173092c..722620c699de8d861a1f3ee2f98d0bbdee295521 100755 (executable)
@@ -10,6 +10,7 @@ GNUNET_HOME=/var/run/gnunet
 # LOGFILE=$GNUNET_HOME/gnunet.log
 CONFIGFILE=$GNUNET_HOME/gnunet.conf
 SUID_ROOT_HELPERS="exit nat-server nat-client transport-bluetooth transport-wlan vpn"
+EXTRA_COMMANDS="restart_transport"
 
 chmodown_execbin() {
        execname=/usr/lib/gnunet/libexec/gnunet-$1
@@ -34,6 +35,8 @@ fix_libexec_permissions() {
 }
 
 prepare_config() {
+       local had_exit_service=0;
+
        if [ ! -e "$GNUNET_HOME" ]; then
                mkdir -p $GNUNET_HOME
                chown gnunet:gnunet $GNUNET_HOME
@@ -80,7 +83,10 @@ prepare_config() {
                local __TYPE="$1"
                local __NAME="${2/_/-}"
                [ "${__TYPE}" = "gnunet-config" ] && _gnunet_section="${__NAME}"
-               [ "${__TYPE}" = "gnunet-exit-service" ] && _gnunet_section="${__NAME}.gnunet."
+               [ "${__TYPE}" = "gnunet-exit-service" ] && {
+                       had_exit_service=1
+                       _gnunet_section="${__NAME}.gnunet."
+               }
        }
        option_cb() {
                # $1    name of variable
@@ -89,19 +95,35 @@ prepare_config() {
                local __VAL="$2"
                gnunet-config -c $CONFIGFILE -w -s ${_gnunet_section} -o ${__OPT} -V "${__VAL}"
        }
+
        config_load gnunet
 
+       [ "$had_exit_service" -eq 1 ] && gnunet-config -c $CONFIGFILE -w -s exit -o FORCESTART -V YES
+
        return 0
 }
 
+restart_transport() {
+       gnunet-arm -c $CONFIGFILE -k transport
+       gnunet-arm -c $CONFIGFILE -i transport
+}
+
 start_service() {
        fix_libexec_permissions
        prepare_config
 
        procd_open_instance
        procd_set_param user gnunet
+#      procd_set_param env GNUNET_LOG="dht;;;;info"
+       procd_set_param stderr 1
        procd_set_param command $PROG -c $CONFIGFILE
        [ "$LOGFILE" ] && procd_append_param command -l $LOGFILE
        procd_set_param respawn
        procd_close_instance
 }
+
+service_triggers()
+{
+       procd_add_reload_trigger "gnunet"
+       procd_add_raw_trigger "interface.*.up" 3000 /etc/init.d/gnunet restart_transport
+}
index f15174e455149d5dc6f6cc21ef188a28a5b98ed9..b4c75501465a109a28b051aa01f64fa1e0189743 100644 (file)
@@ -8,15 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnurl
-PKG_VERSION:=7.51.0
+PKG_VERSION:=7.57.0
 PKG_RELEASE:=1
 
-PKG_DIST_VERSION:=$(subst .,_,$(strip $(PKG_VERSION)))
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_DIST_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://gnunet.org/sites/default/files
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_DIST_VERSION)
 
-PKG_MD5SUM:=2f0200d38eca6c9567447d2b8ac4676911ec73b9613a15bef31bbe9f9f22f4e5
+PKG_HASH:=2ccd2a641a9815df924b6a79ee47d12a27ee43bd05a3c6ba958108564580d3b7
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
@@ -100,7 +98,7 @@ endef
 define Build/InstallDev
        $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include/gnurl $(1)/usr/lib $(1)/usr/lib/pkgconfig
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnurl-config $(1)/usr/bin/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/curl/*.h $(1)/usr/include/gnurl
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/gnurl/*.h $(1)/usr/include/gnurl
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnurl.{a,so*} $(1)/usr/lib/
        $(CP) $(PKG_BUILD_DIR)/libgnurl.pc $(1)/usr/lib/pkgconfig/
        $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr/bin/gnurl-config
diff --git a/net/gnurl/patches/200-no_docs_tests.patch b/net/gnurl/patches/200-no_docs_tests.patch
deleted file mode 100644 (file)
index 25089eb..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -153,7 +153,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP)
- bin_SCRIPTS = gnurl-config
- SUBDIRS = lib src include
--DIST_SUBDIRS = $(SUBDIRS) tests packages docs scripts
-+DIST_SUBDIRS = $(SUBDIRS) packages
- pkgconfigdir = $(libdir)/pkgconfig
- pkgconfig_DATA = libgnurl.pc
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -612,7 +612,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP)
- bin_SCRIPTS = gnurl-config
- SUBDIRS = lib src include
--DIST_SUBDIRS = $(SUBDIRS) tests packages docs scripts
-+DIST_SUBDIRS = $(SUBDIRS) packages
- pkgconfigdir = $(libdir)/pkgconfig
- pkgconfig_DATA = libgnurl.pc
- LIB_VAUTH_CFILES = vauth/vauth.c vauth/cleartext.c vauth/cram.c         \
index 830633f72d6e44e9adb422a83605a6f55af6a410..e5d124b9725a89c5301dce17454ca7cf2742dafa 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=haproxy
-PKG_VERSION:=1.7.5
+PKG_VERSION:=1.8.4
 PKG_RELEASE:=01
 
 PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.haproxy.org/download/1.7/src/
-PKG_MD5SUM:=ed84c80cb97852d2aa3161ed16c48a1c
+PKG_SOURCE_URL:=https://www.haproxy.org/download/1.8/src/
+PKG_HASH:=e305b0a4e7dec08072841eef6ac6dcd1b5586b1eff09c2d51e152a912e8884a6
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_LICENSE:=GPL-2.0
@@ -27,19 +27,21 @@ define Package/haproxy/Default
   SECTION:=net
   CATEGORY:=Network
   TITLE:=The Reliable, High Performance TCP/HTTP Load Balancer
-  URL:=http://haproxy.1wt.eu/
+  URL:=https://www.haproxy.org/
 endef
 
-define Download/lua533
-       FILE:=lua-5.3.3.tar.gz
-       URL:=http://www.lua.org/ftp/
-       MD5SUM:=703f75caa4fdf4a911c1a72e67a27498
+define Download/lua534
+       FILE:=lua-5.3.4.tar.gz
+       URL:=https://www.lua.org/ftp/
+       HASH:=f681aa518233bc407e23acf0f5887c884f17436f000d453b2491a9f11a52400c
 endef
 
 define Build/Prepare
        $(call Build/Prepare/Default)
-       tar -zxvf $(DL_DIR)/lua-5.3.3.tar.gz -C $(PKG_BUILD_DIR)
-       ln -s $(PKG_BUILD_DIR)/lua-5.3.3 $(PKG_BUILD_DIR)/lua
+ifeq ($(ENABLE_LUA),y)
+       tar -zxvf $(DL_DIR)/lua-5.3.4.tar.gz -C $(PKG_BUILD_DIR)
+       ln -s $(PKG_BUILD_DIR)/lua-5.3.4 $(PKG_BUILD_DIR)/lua
+endif
 endef
 
 define Package/haproxy/Default/conffiles
@@ -51,7 +53,7 @@ define Package/haproxy/Default/description
 endef
 
 define Package/haproxy
-  DEPENDS+= +libpcre +libltdl +zlib +libpthread +libopenssl +libncursesw +libreadline +@OPENSSL_WITH_DEPRECATED +@OPENSSL_WITH_EC +@OPENSSL_WITH_EC2M  +@OPENSSL_WITH_DTLS +@OPENSSL_WITH_COMPRESSION +@OPENSSL_WITH_NPN  +@OPENSSL_WITH_PSK +@OPENSSL_WITH_SRP +@OPENSSL_ENGINE_DIGEST +@OPENSSL_ENGINE_CRYPTO
+  DEPENDS+= +libpcre +libltdl +zlib +libpthread +libopenssl +libncursesw +libreadline +libatomic +@OPENSSL_WITH_DEPRECATED +@OPENSSL_WITH_EC +@OPENSSL_WITH_EC2M  +@OPENSSL_WITH_DTLS +@OPENSSL_WITH_COMPRESSION +@OPENSSL_WITH_NPN  +@OPENSSL_WITH_PSK +@OPENSSL_WITH_SRP +@OPENSSL_ENGINE_DIGEST +@OPENSSL_ENGINE_CRYPTO
 
   TITLE+= (with SSL support)
   VARIANT:=ssl
@@ -75,7 +77,7 @@ endef
 define Package/haproxy-nossl
   TITLE+= (without SSL support)
   VARIANT:=nossl
-  DEPENDS+= +libpcre +libltdl +zlib +libpthread
+  DEPENDS+= +libpcre +libltdl +zlib +libpthread +libatomic
   TITLE+= (without SSL support)
 $(call Package/haproxy/Default)
 endef
@@ -89,6 +91,20 @@ $(call Package/haproxy/Default/description)
  This package is built without SSL support.
 endef
 
+ENABLE_LUA:=y
+ENABLE_REGPARM:=n
+
+ifeq ($(CONFIG_mips),y)
+  ENABLE_LUA:=n
+endif
+ifeq ($(CONFIG_mipsel),y)
+  ENABLE_LUA:=n
+endif
+
+ifeq ($(CONFIG_TARGET_x86),y)
+  ENABLE_REGPARM:=y
+endif
+
 ifeq ($(CONFIG_avr32),y)
   LINUX_TARGET:=linux26
 else
@@ -97,39 +113,48 @@ endif
 
 ifeq ($(BUILD_VARIANT),ssl)
        ADDON+=USE_OPENSSL=1
+       ADDON+=ADDLIB="-lcrypto -lm "
+endif
+
+ifeq ($(ENABLE_LUA),y)
        ADDON+=USE_LUA=1
-       ADDON+=LUA_LIB_NAME="lua533"
-       ADDON+=LUA_INC="$(STAGING_DIR)/lua-5.3.3/include"
-       ADDON+=LUA_LIB="$(STAGING_DIR)/lua-5.3.3/lib"
-       ADDON+=ADDLIB="-lcrypto -lm "   
-else
-       ADDON+=ADDLIB="-lm"
+       ADDON+=LUA_LIB_NAME="lua534"
+       ADDON+=LUA_INC="$(STAGING_DIR)/lua-5.3.4/include"
+       ADDON+=LUA_LIB="$(STAGING_DIR)/lua-5.3.4/lib"
 endif
 
+ifeq ($(ENABLE_REGPARM),y)
+       ADDON+=USE_REGPARM=1
+endif
 
-define Build/Compile
+ifeq ($(ENABLE_LUA),y)
+define Build/Compile/lua
        $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR)/lua \
-               INSTALL_TOP="$(STAGING_DIR)/lua-5.3.3/" \
+               INSTALL_TOP="$(STAGING_DIR)/lua-5.3.4/" \
                CC="$(TARGET_CC)" \
+               CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
                LDFLAGS="$(TARGET_LDFLAGS) -lncurses -lreadline" \
                LD="$(TARGET_LD)" \
                linux install
 
-       mv $(STAGING_DIR)/lua-5.3.3/lib/liblua.a $(STAGING_DIR)/lua-5.3.3/lib/liblua533.a
+       mv $(STAGING_DIR)/lua-5.3.4/lib/liblua.a $(STAGING_DIR)/lua-5.3.4/lib/liblua534.a
+endef
+endif
 
+define Build/Compile
+       $(call Build/Compile/lua)
        $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                CC="$(TARGET_CC)" \
-               PCREDIR="$(STAGING_DIR)/usr/include" \
+               PCREDIR="$(STAGING_DIR)/usr/" \
                SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530 " \
-               USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 USE_REGPARM=1 \
-               USE_ZLIB=yes USE_PCRE=1 USE_PCRE_JIT=1\
+               USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 USE_TFO=1 \
+               USE_ZLIB=yes USE_PCRE=1 USE_PCRE_JIT=1 USE_GETADDRINFO=1 \
                VERSION="$(PKG_VERSION)-patch$(PKG_RELEASE)" \
-               $(ADDON)
-               CFLAGS="$(TARGET_CFLAGS) -fno-align-jumps -fno-align-functions -fno-align-labels -fno-align-loops -pipe -fomit-frame-pointer -fhonour-copts" \
-               LD="$(TARGET_LD)" \
-               LDFLAGS="$(TARGET_LDFLAGS) -lcurses -lreadline" \
-               GNOREGIT=1
+               $(ADDON) \
+               LD="$(TARGET_CC)" \
+               LDFLAGS="$(TARGET_LDFLAGS) -latomic" \
+               IGNOREGIT=1
 
        $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
@@ -159,7 +184,6 @@ endef
 
 Package/haproxy-nossl/install = $(Package/haproxy/install)
 
-
 define Package/halog
        MENU:=1
        $(call Package/haproxy)
@@ -176,8 +200,7 @@ define Package/halog/install
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/halog/halog $(1)/usr/bin/
 endef
 
-$(eval $(call Download,lua533))
+$(eval $(call Download,lua534))
 $(eval $(call BuildPackage,haproxy))
 $(eval $(call BuildPackage,halog))
 $(eval $(call BuildPackage,haproxy-nossl))
-
diff --git a/net/haproxy/patches/0001-BUG-MEDIUM-ssl-Dont-always-treat-SSL_ERROR_SYSCALL-as-unrecovarable.patch b/net/haproxy/patches/0001-BUG-MEDIUM-ssl-Dont-always-treat-SSL_ERROR_SYSCALL-as-unrecovarable.patch
new file mode 100644 (file)
index 0000000..93b51dc
--- /dev/null
@@ -0,0 +1,61 @@
+From 2fcd544272a5498ffa49544e9f06b51bc93e55d1 Mon Sep 17 00:00:00 2001
+From: Olivier Houchard <ohouchard@haproxy.com>
+Date: Tue, 13 Feb 2018 15:17:23 +0100
+Subject: [PATCH] BUG/MEDIUM: ssl: Don't always treat SSL_ERROR_SYSCALL as
+ unrecovarable.
+
+Bart Geesink reported some random errors appearing under the form of
+termination flags SD in the logs for connections involving SSL traffic
+to reach the servers.
+
+Tomek Gacek and Mateusz Malek finally narrowed down the problem to commit
+c2aae74 ("MEDIUM: ssl: Handle early data with OpenSSL 1.1.1"). It happens
+that the special case of SSL_ERROR_SYSCALL isn't handled anymore since
+this commit.
+
+SSL_read() might return <= 0, and SSL_get_erro() return SSL_ERROR_SYSCALL,
+without meaning the connection is gone. Before flagging the connection
+as in error, check the errno value.
+
+This should be backported to 1.8.
+
+(cherry picked from commit 7e2e505006feb8f3b4a7f9e0ac5e89b5a8c4895e)
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ src/ssl_sock.c |    9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/src/ssl_sock.c b/src/ssl_sock.c
+index aecf3dd..f118724 100644
+--- a/src/ssl_sock.c
++++ b/src/ssl_sock.c
+@@ -5437,6 +5437,12 @@ static int ssl_sock_to_buf(struct connection *conn, struct buffer *buf, int coun
+                               break;
+                       } else if (ret == SSL_ERROR_ZERO_RETURN)
+                               goto read0;
++                      /* For SSL_ERROR_SYSCALL, make sure the error is
++                       * unrecoverable before flagging the connection as
++                       * in error.
++                       */
++                      if (ret == SSL_ERROR_SYSCALL && (!errno || errno == EAGAIN))
++                              goto clear_ssl_error;
+                       /* otherwise it's a real error */
+                       goto out_error;
+               }
+@@ -5451,11 +5457,12 @@ static int ssl_sock_to_buf(struct connection *conn, struct buffer *buf, int coun
+       conn_sock_read0(conn);
+       goto leave;
+  out_error:
++      conn->flags |= CO_FL_ERROR;
++clear_ssl_error:
+       /* Clear openssl global errors stack */
+       ssl_sock_dump_errors(conn);
+       ERR_clear_error();
+-      conn->flags |= CO_FL_ERROR;
+       goto leave;
+ }
+-- 
+1.7.10.4
+
diff --git a/net/haproxy/patches/0002-BUG-MEDIUM-ssl-Shutdown-the-connection-for-reading-on-SSL_ERROR_SYSCALL.patch b/net/haproxy/patches/0002-BUG-MEDIUM-ssl-Shutdown-the-connection-for-reading-on-SSL_ERROR_SYSCALL.patch
new file mode 100644 (file)
index 0000000..22274d3
--- /dev/null
@@ -0,0 +1,63 @@
+From f7fa1d461aa71bbc8a6c23fdcfc305f2e52ce5dd Mon Sep 17 00:00:00 2001
+From: Christopher Faulet <cfaulet@haproxy.com>
+Date: Mon, 19 Feb 2018 14:25:15 +0100
+Subject: [PATCH] BUG/MEDIUM: ssl: Shutdown the connection for reading on
+ SSL_ERROR_SYSCALL
+
+When SSL_read returns SSL_ERROR_SYSCALL and errno is unset or set to EAGAIN, the
+connection must be shut down for reading. Else, the connection loops infinitly,
+consuming all the CPU.
+
+The bug was introduced in the commit 7e2e50500 ("BUG/MEDIUM: ssl: Don't always
+treat SSL_ERROR_SYSCALL as unrecovarable."). This patch must be backported in
+1.8 too.
+
+(cherry picked from commit 4ac77a98cda3d0f9b1d9de7bbbda2c91357f0767)
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ src/ssl_sock.c |   14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/src/ssl_sock.c b/src/ssl_sock.c
+index f118724..a065bbb 100644
+--- a/src/ssl_sock.c
++++ b/src/ssl_sock.c
+@@ -5437,10 +5437,9 @@ static int ssl_sock_to_buf(struct connection *conn, struct buffer *buf, int coun
+                               break;
+                       } else if (ret == SSL_ERROR_ZERO_RETURN)
+                               goto read0;
+-                      /* For SSL_ERROR_SYSCALL, make sure the error is
+-                       * unrecoverable before flagging the connection as
+-                       * in error.
+-                       */
++                      /* For SSL_ERROR_SYSCALL, make sure to clear the error
++                       * stack before shutting down the connection for
++                       * reading. */
+                       if (ret == SSL_ERROR_SYSCALL && (!errno || errno == EAGAIN))
+                               goto clear_ssl_error;
+                       /* otherwise it's a real error */
+@@ -5453,16 +5452,19 @@ static int ssl_sock_to_buf(struct connection *conn, struct buffer *buf, int coun
+       conn_cond_update_sock_polling(conn);
+       return done;
++ clear_ssl_error:
++      /* Clear openssl global errors stack */
++      ssl_sock_dump_errors(conn);
++      ERR_clear_error();
+  read0:
+       conn_sock_read0(conn);
+       goto leave;
++
+  out_error:
+       conn->flags |= CO_FL_ERROR;
+-clear_ssl_error:
+       /* Clear openssl global errors stack */
+       ssl_sock_dump_errors(conn);
+       ERR_clear_error();
+-
+       goto leave;
+ }
+-- 
+1.7.10.4
+
diff --git a/net/haproxy/patches/0003-BUG-MEDIUM-http-Switch-the-HTTP-response-in-tunnel-mode-as-earlier-as-possible.patch b/net/haproxy/patches/0003-BUG-MEDIUM-http-Switch-the-HTTP-response-in-tunnel-mode-as-earlier-as-possible.patch
new file mode 100644 (file)
index 0000000..446a610
--- /dev/null
@@ -0,0 +1,69 @@
+From 8a5949f2d74c3a3a6c6da25449992c312b183ef3 Mon Sep 17 00:00:00 2001
+From: Christopher Faulet <cfaulet@haproxy.com>
+Date: Fri, 2 Feb 2018 15:54:15 +0100
+Subject: [PATCH] BUG/MEDIUM: http: Switch the HTTP response in tunnel mode as
+ earlier as possible
+
+When the body length is undefined (no Content-Length or Transfer-Encoding
+headers), The reponse remains in ending mode, waiting the request is done. So,
+most of time this is not a problem because the resquest is done before the
+response. But when a client sends data to a server that replies without waiting
+all the data, it is really not desirable to wait the end of the request to
+finish the response.
+
+This bug was introduced when the tunneling of the request and the reponse was
+refactored, in commit 4be980391 ("MINOR: http: Switch requests/responses in
+TUNNEL mode only by checking txn flag").
+
+This patch should be backported in 1.8 and 1.7.
+
+(cherry picked from commit fd04fcf5edb0a24cd29ce8f4d4dc2aa3a0e2e82c)
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ src/proto_http.c |   15 +++++----------
+ 1 file changed, 5 insertions(+), 10 deletions(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index 64bd410..29880ea 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -4634,16 +4634,8 @@ 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 (!(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))) {
++                      if (!(chn->flags & (CF_SHUTW|CF_SHUTW_NOW))) {
+                               channel_shutr_now(chn);
+                               channel_shutw_now(chn);
+                       }
+@@ -6241,6 +6233,8 @@ http_msg_forward_body(struct stream *s, struct http_msg *msg)
+               /* 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_TUNNEL;
++              goto ending;
+       }
+       msg->msg_state = HTTP_MSG_ENDING;
+@@ -6262,7 +6256,8 @@ http_msg_forward_body(struct stream *s, struct http_msg *msg)
+                        /* default_ret */ 1,
+                        /* on_error    */ goto error,
+                        /* on_wait     */ goto waiting);
+-      msg->msg_state = HTTP_MSG_DONE;
++      if (msg->msg_state == HTTP_MSG_ENDING)
++              msg->msg_state = HTTP_MSG_DONE;
+       return 1;
+   missing_data_or_waiting:
+-- 
+1.7.10.4
+
diff --git a/net/haproxy/patches/0004-BUG-MEDIUM-ssl-sample-ssl_bc_-fetch-keywords-are-broken.patch b/net/haproxy/patches/0004-BUG-MEDIUM-ssl-sample-ssl_bc_-fetch-keywords-are-broken.patch
new file mode 100644 (file)
index 0000000..11d2ef9
--- /dev/null
@@ -0,0 +1,103 @@
+From 7ccf7c9791f2b2329f3940d1347618af3a77bebc Mon Sep 17 00:00:00 2001
+From: Emeric Brun <ebrun@haproxy.com>
+Date: Mon, 19 Feb 2018 15:59:48 +0100
+Subject: [PATCH] BUG/MEDIUM: ssl/sample: ssl_bc_* fetch keywords are broken.
+
+Since the split between connections and conn-stream objects, this
+keywords are broken.
+
+This patch must be backported in 1.8
+
+(cherry picked from commit eb8def9f34c37537d56a69fcd211d4c4c8006bea)
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ src/ssl_sock.c |   31 ++++++++++++++-----------------
+ 1 file changed, 14 insertions(+), 17 deletions(-)
+
+diff --git a/src/ssl_sock.c b/src/ssl_sock.c
+index 4d0d5db..d832d76 100644
+--- a/src/ssl_sock.c
++++ b/src/ssl_sock.c
+@@ -6580,8 +6580,8 @@ smp_fetch_ssl_x_key_alg(const struct arg *args, struct sample *smp, const char *
+ static int
+ smp_fetch_ssl_fc(const struct arg *args, struct sample *smp, const char *kw, void *private)
+ {
+-      struct connection *conn = objt_conn((kw[4] != 'b') ? smp->sess->origin :
+-                                          smp->strm ? smp->strm->si[1].end : NULL);
++      struct connection *conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
++                                          smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
+       smp->data.type = SMP_T_BOOL;
+       smp->data.u.sint = (conn && conn->xprt == &ssl_sock);
+@@ -6625,8 +6625,8 @@ smp_fetch_ssl_fc_is_resumed(const struct arg *args, struct sample *smp, const ch
+ static int
+ smp_fetch_ssl_fc_cipher(const struct arg *args, struct sample *smp, const char *kw, void *private)
+ {
+-      struct connection *conn = objt_conn((kw[4] != 'b') ? smp->sess->origin :
+-                                          smp->strm ? smp->strm->si[1].end : NULL);
++      struct connection *conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
++                                          smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
+       smp->flags = 0;
+       if (!conn || !conn->xprt_ctx || conn->xprt != &ssl_sock)
+@@ -6651,9 +6651,8 @@ smp_fetch_ssl_fc_cipher(const struct arg *args, struct sample *smp, const char *
+ static int
+ smp_fetch_ssl_fc_alg_keysize(const struct arg *args, struct sample *smp, const char *kw, void *private)
+ {
+-      struct connection *conn = objt_conn((kw[4] != 'b') ? smp->sess->origin :
+-                                          smp->strm ? smp->strm->si[1].end : NULL);
+-
++      struct connection *conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
++                                          smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
+       int sint;
+       smp->flags = 0;
+@@ -6676,8 +6675,8 @@ smp_fetch_ssl_fc_alg_keysize(const struct arg *args, struct sample *smp, const c
+ static int
+ smp_fetch_ssl_fc_use_keysize(const struct arg *args, struct sample *smp, const char *kw, void *private)
+ {
+-      struct connection *conn = objt_conn((kw[4] != 'b') ? smp->sess->origin :
+-                                          smp->strm ? smp->strm->si[1].end : NULL);
++      struct connection *conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
++                                          smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
+       smp->flags = 0;
+       if (!conn || !conn->xprt_ctx || conn->xprt != &ssl_sock)
+@@ -6747,8 +6746,8 @@ smp_fetch_ssl_fc_alpn(const struct arg *args, struct sample *smp, const char *kw
+ static int
+ smp_fetch_ssl_fc_protocol(const struct arg *args, struct sample *smp, const char *kw, void *private)
+ {
+-      struct connection *conn = objt_conn((kw[4] != 'b') ? smp->sess->origin :
+-                                          smp->strm ? smp->strm->si[1].end : NULL);
++      struct connection *conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
++                                          smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
+       smp->flags = 0;
+       if (!conn || !conn->xprt_ctx || conn->xprt != &ssl_sock)
+@@ -6773,9 +6772,8 @@ static int
+ smp_fetch_ssl_fc_session_id(const struct arg *args, struct sample *smp, const char *kw, void *private)
+ {
+ #if OPENSSL_VERSION_NUMBER > 0x0090800fL
+-      struct connection *conn = objt_conn((kw[4] != 'b') ? smp->sess->origin :
+-                                          smp->strm ? smp->strm->si[1].end : NULL);
+-
++      struct connection *conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
++                                          smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
+       SSL_SESSION *ssl_sess;
+       smp->flags = SMP_F_CONST;
+@@ -6917,9 +6915,8 @@ static int
+ smp_fetch_ssl_fc_unique_id(const struct arg *args, struct sample *smp, const char *kw, void *private)
+ {
+ #if OPENSSL_VERSION_NUMBER > 0x0090800fL
+-      struct connection *conn = objt_conn((kw[4] != 'b') ? smp->sess->origin :
+-                                          smp->strm ? smp->strm->si[1].end : NULL);
+-
++      struct connection *conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
++                                          smp->strm ? cs_conn(objt_cs(smp->strm->si[1].end)) : NULL;
+       int finished_len;
+       struct chunk *finished_trash;
+-- 
+1.7.10.4
+
diff --git a/net/horst/Makefile b/net/horst/Makefile
new file mode 100644 (file)
index 0000000..6805199
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# 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.1
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/br101/horst/archive/v$(PKG_VERSION)/
+PKG_HASH:=74b4cb1143d93c73c3b4bbbe0c36f89a790401bde9e894e94e2a27339ca384d9
+
+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/conffiles
+/etc/config/horst
+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/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./horst.init $(1)/etc/init.d/horst
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./horst.config $(1)/etc/config/horst
+endef
+
+$(eval $(call BuildPackage,horst))
diff --git a/net/horst/horst.config b/net/horst/horst.config
new file mode 100644 (file)
index 0000000..17c0097
--- /dev/null
@@ -0,0 +1,4 @@
+config init 'init'
+       option disabled 1
+       option interface 'mon0'
+       option scan 1
diff --git a/net/horst/horst.init b/net/horst/horst.init
new file mode 100755 (executable)
index 0000000..bba67a2
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh /etc/rc.common
+
+START=94
+
+USE_PROCD=1
+PROG=/usr/sbin/horst
+
+start_service() {
+       config_load horst
+       config_get dis "init" 'disabled' '0'
+       [ "$dis" == "0" ] || exit
+
+       config_get intf "init" 'interface' 'wlan0'
+       config_get scan "init" 'scan' '0'
+       [ "$scan" == "0" ] && scan='' || scan="-s"
+
+       procd_open_instance
+       procd_set_param command $PROG -q -i $intf $scan -N
+       procd_set_param netdev $intf
+       procd_set_param respawn
+       procd_close_instance
+}
diff --git a/net/horst/patches/0001-reproducible-builds.patch b/net/horst/patches/0001-reproducible-builds.patch
new file mode 100644 (file)
index 0000000..541d16f
--- /dev/null
@@ -0,0 +1,26 @@
+Index: horst-5.1/conf_options.c
+===================================================================
+--- horst-5.1.orig/conf_options.c
++++ horst-5.1/conf_options.c
+@@ -519,7 +519,7 @@ void config_parse_file_and_cmdline(int a
+                       conf_filename = optarg;
+                       break;
+               case 'v':
+-                      printf("%s (build date: %s %s)\n", VERSION, __DATE__, __TIME__);
++                      printf("%s\n", VERSION);
+                       exit(0);
+               case 'h':
+               case '?':
+Index: horst-5.1/display-help.c
+===================================================================
+--- horst-5.1.orig/display-help.c
++++ horst-5.1/display-help.c
+@@ -36,7 +36,7 @@ void update_help_win(WINDOW *win)
+       print_centered(win, 2, COLS, "HORST - Horsts OLSR Radio Scanning Tool (or)");
+       print_centered(win, 3, COLS, "HORST - Highly Optimized Radio Scanning Tool");
+-      print_centered(win, 5, COLS, "Version " VERSION " (build date " __DATE__ " " __TIME__ ")");
++      print_centered(win, 5, COLS, "Version " VERSION);
+       print_centered(win, 6, COLS, "(C) 2005-2016 Bruno Randolf, Licensed under the GPLv2");
+       mvwprintw(win, 8, 2, "Known IEEE802.11 Packet Types:");
index c5441c278d75d3cfb3d827dba1315fa538fc7245..2650597e87e0b9a2d79f68ae9061fa3b464f914e 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=htpdate
 PKG_VERSION:=1.1.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.vervest.org/htp/archive/c/
-PKG_MD5SUM:=c612f63282e3f23b709f37a5c81d4739
+PKG_HASH:=0d75f91cb61f8869c8298d198fa52b9a139ae505b366e9d4d331af8bc1c04880
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=
@@ -26,7 +26,8 @@ define Package/htpdate
   CATEGORY:=Network
   TITLE:=an HTP (Hypertext Time Protocol) implementation
   URL:=http://www.vervest.com/htp/
-  MAINTAINER:=Tijs Van Buggenhout <tvbuggen@netzerk.be>
+  MAINTAINER:=Tijs Van Buggenhout <tvbuggen@netzerk.be>, \
+              Marcin Jurkowski <marcin1j@gmail.com>
 endef
 
 define Package/htpdate/description
@@ -38,7 +39,7 @@ define Package/htpdate/description
 endef
 
 define Package/htpdate/conffiles
-/etc/default/htpdate
+/etc/config/htpdate
 endef
 
 define Build/Compile
@@ -50,8 +51,8 @@ endef
 define Package/htpdate/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/htpdate $(1)/usr/sbin/
-       $(INSTALL_DIR) $(1)/etc/default/
-       $(INSTALL_CONF) ./files/htpdate.default $(1)/etc/default/htpdate
+       $(INSTALL_DIR) $(1)/etc/config/
+       $(INSTALL_CONF) ./files/htpdate.conf $(1)/etc/config/htpdate
        $(INSTALL_DIR) $(1)/etc/init.d/
        $(INSTALL_BIN) ./files/htpdate.init $(1)/etc/init.d/htpdate
 endef
diff --git a/net/htpdate/files/htpdate.conf b/net/htpdate/files/htpdate.conf
new file mode 100644 (file)
index 0000000..46bdf44
--- /dev/null
@@ -0,0 +1,11 @@
+config htpdate 'htpdate'
+       option enabled 1
+       list server 'www.google.com'
+       list server 'www.yahoo.com'
+       list server 'www.linux.com'
+       list server 'www.freebsd.org'
+       option proxy_host ''
+       option proxy_port '8080'
+       option debug 0
+       option sanity_check 1
+       #list option '-4'
diff --git a/net/htpdate/files/htpdate.default b/net/htpdate/files/htpdate.default
deleted file mode 100644 (file)
index 94674fd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-OPTIONS="www.google.com www.yahoo.com www.linux.org www.freebsd.org"
index 1409321df9c56f6707b04701a2cc5cc5b436fb6c..88176c84cc7c3be2d3fee74a388b993f8670b05a 100644 (file)
@@ -2,18 +2,53 @@
 # Copyright (C) 2006 OpenWrt.org
 
 START=49
-BIN=htpdate
-DEFAULT=/etc/default/$BIN
-RUN_D=/var/run
-PID_F=$RUN_D/$BIN.pid
-
-start() {
-       [ -f $DEFAULT ] && . $DEFAULT
-       mkdir -p $RUN_D
-       $BIN -l -s -t $OPTIONS && $BIN -D $OPTIONS
+USE_PROCD=1
+PROG=/usr/sbin/htpdate
+
+
+
+
+validate_htpdate_section() {
+       uci_validate_section htpdate htpdate "${1}" \
+               'server:list(host)' \
+               'proxy_host:host' \
+               'proxy_port:port:8080' \
+               'debug:bool:0' \
+               'sanity_check:bool:1' \
+               'option:list(string)' \
+               'enabled:bool:1'
 }
 
-stop() {
-       [ -f $PID_F ] && kill $(cat $PID_F)
+
+start_service() {
+       local server proxy debug sanity_check option enabled
+
+        validate_htpdate_section htpdate || {
+               echo "validation failed"
+               return 1
+       }
+
+       [ "$enabled" = 0 ] && return
+
+
+       procd_open_instance
+       procd_set_param command "$PROG" -f
+
+       [ -n "$proxy" ] && procd_append_param command -P $proxy:$proxy_port
+       [ "$debug" = "1" ] && procd_append_param command -d
+       [ "$sanity_check" = "0" ] && procd_append_param command -t
+       [ -n "$option" ] && procd_append_param command $option
+       for peer in $server; do
+               procd_append_param command $peer
+       done
+
+       procd_set_param stdout 1
+       procd_set_param stderr 1
+       procd_set_param respawn
+       procd_close_instance
 }
 
+service_triggers() {
+       procd_add_reload_trigger "htpdate"
+       procd_add_validation validate_htpdate_section
+}
diff --git a/net/htpdate/patches/101-daemon-run-in-foreground.patch b/net/htpdate/patches/101-daemon-run-in-foreground.patch
new file mode 100644 (file)
index 0000000..a68365a
--- /dev/null
@@ -0,0 +1,40 @@
+--- a/htpdate.c
++++ b/htpdate.c
+@@ -395,6 +395,7 @@ Usage: htpdate [-046abdhlqstxD] [-i pid
+   -b    burst mode\n\
+   -d    debug mode\n\
+   -D    daemon mode\n\
++  -f    run in foreground\n\
+   -h    help\n\
+   -i    pid file\n\
+   -l    use syslog for output\n\
+@@ -510,7 +511,7 @@ int main( int argc, char *argv[] ) {
+       /* Parse the command line switches and arguments */
+-      while ( (param = getopt(argc, argv, "046abdhi:lm:p:qstu:xDM:P:") ) != -1)
++      while ( (param = getopt(argc, argv, "046abdhi:lm:p:qstu:xDfM:P:") ) != -1)
+       switch( param ) {
+               case '0':                       /* HTTP/1.0 */
+@@ -593,6 +594,9 @@ int main( int argc, char *argv[] ) {
+                       daemonize = 1;
+                       logmode = 1;
+                       break;
++              case 'f':                       /* run in foreground */
++                      daemonize = 2;
++                      break;
+               case 'M':                       /* maximum poll interval */
+                       if ( ( maxsleep = atoi(optarg) ) <= 0 ) {
+                               fputs( "Invalid sleep time\n", stderr );
+@@ -631,7 +635,9 @@ int main( int argc, char *argv[] ) {
+       /* Run as a daemonize when -D is set */
+       if ( daemonize ) {
+-              runasdaemon( pidfile );
++              if ( daemonize == 1 ) {
++                      runasdaemon( pidfile );
++              }
+               /* Query only mode doesn't exist in daemon mode */
+               if ( !setmode )
+                       setmode = 1;
diff --git a/net/httping/Makefile b/net/httping/Makefile
new file mode 100644 (file)
index 0000000..7de0b72
--- /dev/null
@@ -0,0 +1,90 @@
+#
+# 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:=httping
+PKG_VERSION:=2.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://www.vanheusden.com/httping
+PKG_HASH:=3e895a0a6d7bd79de25a255a1376d4da88eb09c34efdd0476ab5a907e75bfaf8
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/httping/Default
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Httping is like 'ping' but for http-requests
+  URL:=http://www.vanheusden.com/httping/
+  DEPENDS:=$(INTL_DEPENDS)
+  MAINTAINER:=Marcin Jurkowski <marcin1j@gmail.com>
+endef
+
+define Package/httping/Default/description
+       Give it an url, and it'll show you how long it takes to connect, send a
+       request and retrieve the reply (only the headers). Be aware that the
+       transmission across the network also takes time!
+endef
+
+define Package/httping
+  $(call Package/httping/Default)
+  DEPENDS+= +libopenssl
+  TITLE+= (with SSL support)
+  VARIANT:=ssl
+endef
+
+define Package/httping/description
+       $(call Package/httping/Default/description)
+       This package is built with SSL support.
+endef
+
+define Package/httping-nossl
+  $(call Package/httping/Default)
+  TITLE+= (without SSL support)
+  VARIANT:=nossl
+endef
+
+define Package/httping-nossl/description
+       $(call Package/httping/Default/description)
+       This package is built without SSL support.
+endef
+
+define Build/Configure
+endef
+
+TARGET_LDFLAGS += $(INTL_LDFLAGS) $(if $(INTL_FULL),-lintl)
+
+MAKE_FLAGS += \
+       DEBUG="no" \
+       FW="no" \
+       NC="no" \
+       TFO="no" \
+       JSON="no" \
+       NAGIOS="no" \
+       HELP="yes" \
+       FULLHELP="no"
+
+
+ifeq ($(BUILD_VARIANT),nossl)
+       MAKE_FLAGS += SSL="no"
+endif
+
+define Package/httping/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/httping $(1)/usr/bin/
+endef
+
+Package/httping-nossl/install = $(Package/httping/install)
+
+$(eval $(call BuildPackage,httping))
+$(eval $(call BuildPackage,httping-nossl))
diff --git a/net/httping/patches/001-no_strip.patch b/net/httping/patches/001-no_strip.patch
new file mode 100644 (file)
index 0000000..3dd5e35
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/Makefile
++++ b/Makefile
+@@ -115,9 +115,6 @@ install: $(TARGET) $(TRANSLATIONS)
+       $(INSTALLMAN) $(MAN_RU) $(DESTDIR)/$(MANDIR)/ru/man1
+       $(INSTALLDIR) $(DESTDIR)/$(DOCDIR)
+       $(INSTALLDOC) $(DOCS) $(DESTDIR)/$(DOCDIR)
+-ifneq ($(DEBUG),yes)
+-      $(STRIP) $(DESTDIR)/$(BINDIR)/$(TARGET)
+-endif
+       mkdir -p $(DESTDIR)/$(PREFIX)/share/locale/nl/LC_MESSAGES
+       cp nl.mo $(DESTDIR)/$(PREFIX)/share/locale/nl/LC_MESSAGES/httping.mo
+       mkdir -p $(DESTDIR)/$(PREFIX)/share/locale/ru/LC_MESSAGES
diff --git a/net/httping/patches/002-fix_compile_warnings.patch b/net/httping/patches/002-fix_compile_warnings.patch
new file mode 100644 (file)
index 0000000..09bf321
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/http.c
++++ b/http.c
+@@ -4,6 +4,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <stdlib.h>
+ #ifndef NO_SSL
+ #include <openssl/ssl.h>
+ #include "mssl.h"
diff --git a/net/httping/patches/003-fix_response_time.patch b/net/httping/patches/003-fix_response_time.patch
new file mode 100644 (file)
index 0000000..e07970e
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/utils.c
++++ b/utils.c
+@@ -18,12 +18,11 @@
+ double get_ts(void)
+ {
+       struct timeval ts;
+-              struct timezone tz;
+-      if (gettimeofday(&ts, &tz) == -1)
++      if (gettimeofday(&ts, NULL) == -1)
+               error_exit(gettext("gettimeofday failed"));
+-      return (double)ts.tv_sec + ((double)ts.tv_usec)/1000000.0 + (double)(tz.tz_minuteswest * 60);
++      return (double)ts.tv_sec + ((double)ts.tv_usec)/1000000.0;
+ }
+ void split_string(const char *in, const char *split, char ***list, int *list_n)
diff --git a/net/httping/patches/004-minimize.patch b/net/httping/patches/004-minimize.patch
new file mode 100644 (file)
index 0000000..14cfe5b
--- /dev/null
@@ -0,0 +1,375 @@
+--- a/main.c
++++ b/main.c
+@@ -51,25 +51,40 @@ volatile int stop = 0;
+ int quiet = 0;
+ char machine_readable = 0;
++#ifdef ENABLE_JSON
+ char json_output = 0;
++#else
++#define json_output 0
++#endif
+ char show_ts = 0;
++#ifdef ENABLE_HELP_FORMAT
+ int max_x = 80, max_y = 24;
++#endif
++#ifdef ENABLE_NAGIOS
+ char nagios_mode = 0;
++#else
++#define nagios_mode 0
++#endif
++#ifdef NC
+ char ncurses_mode = 0;
++#else
++#define ncurses_mode 0
++#endif
+ int fd = -1;
+ volatile char got_sigquit = 0;
+-void handler_quit(int s)
++void handler_quit()
+ {
+       signal(SIGQUIT, handler_quit);
+       got_sigquit = 1;
+ }
++#ifdef ENABLE_HELP_FORMAT
+ void determine_terminal_size(int *max_y, int *max_x)
+ {
+         struct winsize size;
+@@ -104,6 +119,7 @@ void determine_terminal_size(int *max_y,
+                         *max_y = 24;
+         }
+ }
++#endif
+ void emit_statuslines(double run_time)
+ {
+@@ -159,6 +175,7 @@ void emit_headers(char *in)
+ #endif
+ }
++#ifdef ENABLE_JSON
+ void emit_json(char ok, int seq, double start_ts, stats_t *t_resolve, stats_t *t_connect, stats_t *t_request, int http_code, const char *msg, int header_size, int data_size, double Bps, const char *host, const char *ssl_fp, double toff_diff_ts, char tfo_success, stats_t *t_ssl, stats_t *t_write, stats_t *t_close, int n_cookies, stats_t *stats_to, stats_t *tcp_rtt_stats, int re_tx, int pmtu, int recv_tos, stats_t *t_total)
+ {
+       if (seq > 1)
+@@ -203,6 +220,7 @@ void emit_json(char ok, int seq, double
+       printf("\"tos\" : \"%02x\" ", recv_tos);
+       printf("}");
+ }
++#endif
+ char *get_ts_str(int verbose)
+ {
+@@ -240,8 +258,13 @@ void emit_error(int verbose, int seq, do
+               if (!quiet && !machine_readable && !nagios_mode && !json_output)
+                       printf("%s%s%s%s\n", ts ? ts : "", c_error, get_error(), c_normal);
++#ifdef ENABLE_JSON
+       if (json_output)
+               emit_json(0, seq, start_ts, NULL, NULL, NULL, -1, get_error(), -1, -1, -1, "", "", -1, 0, NULL, NULL, NULL, 0, NULL, NULL, 0, 0, 0, NULL);
++#else
++      (void) seq;
++      (void) start_ts;
++#endif
+       clear_error();
+@@ -590,6 +613,7 @@ void fetch_proxy_settings(char **proxy_u
+       }
+ }
++#ifdef ENABLE_NAGIOS
+ void parse_nagios_settings(const char *in, double *nagios_warn, double *nagios_crit)
+ {
+       char *dummy = strchr(in, ',');
+@@ -600,6 +624,7 @@ void parse_nagios_settings(const char *i
+       *nagios_crit = atof(dummy + 1);
+ }
++#endif
+ void parse_bind_to(const char *in, struct sockaddr_in *bind_to_4, struct sockaddr_in6 *bind_to_6, struct sockaddr_in **bind_to)
+ {
+@@ -722,6 +747,7 @@ char check_compressed(const char *reply)
+       return 0;
+ }
++#ifdef ENABLE_NAGIOS
+ int nagios_result(int ok, int nagios_mode, int nagios_exit_code, double avg_httping_time, double nagios_warn, double nagios_crit)
+ {
+       if (nagios_mode == 1)
+@@ -762,6 +788,7 @@ int nagios_result(int ok, int nagios_mod
+       return -1;
+ }
++#endif
+ void proxy_to_host_and_port(char *in, char **proxy_host, int *proxy_port)
+ {
+@@ -896,8 +923,10 @@ int main(int argc, char *argv[])
+       int n_static_cookies = 0, n_dynamic_cookies = 0;
+       char resolve_once = 0;
+       char have_resolved = 0;
++#ifdef ENABLE_NAGIOS
+       double nagios_warn=0.0, nagios_crit=0.0;
+       int nagios_exit_code = 2;
++#endif
+       double avg_httping_time = -1.0;
+       int get_instead_of_head = 0;
+       char show_Bps = 0, ask_compression = 0;
+@@ -928,9 +957,17 @@ int main(int argc, char *argv[])
+       stats_t t_connect, t_request, t_total, t_resolve, t_write, t_ssl, t_close, stats_to, tcp_rtt_stats, stats_header_size;
+       char first_resolve = 1;
+       double graph_limit = MY_DOUBLE_INF;
++#ifdef NC
++#ifdef FW
+       char nc_graph = 1;
++#else
++      #define nc_graph 1
++#endif
++#endif
+       char adaptive_interval = 0;
++#ifdef NC
+       double show_slow_log = MY_DOUBLE_INF;
++#endif
+       char use_tcp_nodelay = 1;
+       int max_mtu = -1;
+       int write_sleep = 500; /* in us (microseconds), determines resolution of transmit time determination */
+@@ -980,8 +1017,10 @@ int main(int argc, char *argv[])
+               {"user-agent",  1, NULL, 'I' },
+               {"referer",     1, NULL, 'S' },
+               {"resolve-once",0, NULL, 'r' },
++#ifdef ENABLE_NAGIOS
+               {"nagios-mode-1",       1, NULL, 'n' },
+               {"nagios-mode-2",       1, NULL, 'n' },
++#endif
+               {"bind-to",     1, NULL, 'y' },
+               {"quiet",       0, NULL, 'q' },
+               {"username",    1, NULL, 'U' },
+@@ -1052,7 +1091,9 @@ int main(int argc, char *argv[])
+ #endif
+       init_statst(&stats_header_size);
++#ifdef ENABLE_HELP_FORMAT
+       determine_terminal_size(&max_y, &max_x);
++#endif
+       signal(SIGPIPE, SIG_IGN);
+@@ -1108,11 +1149,11 @@ int main(int argc, char *argv[])
+                       case 14:
+                               draw_phase = 1;
+                               break;
+-#endif
+                       case 13:
+                               show_slow_log = atof(optarg);
+                               break;
++#endif
+                       case 12:
+                               adaptive_interval = 1;
+@@ -1144,9 +1185,11 @@ int main(int argc, char *argv[])
+                               fprintf(stderr, gettext("\n *** -A is no longer required ***\n\n"));
+                               break;
++#ifdef ENABLE_JSON
+                       case 'M':
+                               json_output = 1;
+                               break;
++#endif
+                       case 'v':
+                               verbose++;
+@@ -1338,6 +1381,7 @@ int main(int argc, char *argv[])
+                               version();
+                               return 0;
++#ifdef ENABLE_NAGIOS
+                       case 'n':
+                               if (nagios_mode)
+                                       error_exit(gettext("-n and -N are mutual exclusive\n"));
+@@ -1352,6 +1396,7 @@ int main(int argc, char *argv[])
+                               nagios_mode = 2;
+                               nagios_exit_code = atoi(optarg);
+                               break;
++#endif
+                       case 'P':
+                               auth_password = optarg;
+@@ -1497,8 +1542,10 @@ int main(int argc, char *argv[])
+                       printf("PING %s%s:%s%d%s (%s):\n", c_green, hostname, c_bright, portnr, c_normal, get);
+       }
++#ifdef ENABLE_JSON
+       if (json_output)
+               printf("[\n");
++#endif
+       if (adaptive_interval && wait <= 0.0)
+               error_exit(gettext("Interval must be > 0 when using adaptive interval"));
+@@ -1593,7 +1640,10 @@ int main(int argc, char *argv[])
+               int age = -1;
+               char *sc = NULL, *scdummy = NULL;
+               char *fp = NULL;
+-              int re_tx = 0, pmtu = 0, recv_tos = 0;
++              int recv_tos = 0;
++#if defined(NC) || defined(ENABLE_JSON)
++              int re_tx = 0, pmtu = 0;
++#endif
+               socklen_t recv_tos_len = sizeof recv_tos;
+               dstart = get_ts();
+@@ -1607,7 +1657,9 @@ int main(int argc, char *argv[])
+                       char req_sent = 0;
+                       double dummy_ms = 0.0;
+                       double their_est_ts = -1.0, toff_diff_ts = -1.0;
++#if defined(ENABLE_JSON) || defined(TCP_TFO)
+                       char tfo_success = 0;
++#endif
+                       double ssl_handshake = 0.0;
+                       char cur_have_resolved = 0;
+ #if defined(linux) || defined(__FreeBSD__)
+@@ -2114,7 +2166,7 @@ persistent_loop:
+                               update_statst(&tcp_rtt_stats, (double)info.tcpi_rtt / 1000.0);
+-#ifdef linux
++#if defined(linux) && (defined(NC) || defined(ENABLE_JSON))
+                               re_tx = info.tcpi_retransmits;
+                               pmtu = info.tcpi_pmtu;
+ #endif
+@@ -2134,6 +2186,7 @@ persistent_loop:
+                       toff_diff_ts = ((double)their_ts - their_est_ts) * 1000.0;
+                       update_statst(&stats_to, toff_diff_ts);
++#ifdef ENABLE_JSON
+                       if (json_output)
+                       {
+                               char current_host[4096] = { 0 };
+@@ -2145,7 +2198,9 @@ persistent_loop:
+                               emit_json(1, curncount, dstart, &t_resolve, &t_connect, &t_request, atoi(sc ? sc : "-1"), sc ? sc : "?", headers_len, len, Bps, current_host, fp, toff_diff_ts, tfo_success, &t_ssl, &t_write, &t_close, n_dynamic_cookies, &stats_to, &tcp_rtt_stats, re_tx, pmtu, recv_tos, &t_total);
+                       }
+-                      else if (machine_readable)
++                      else
++#endif
++                      if (machine_readable)
+                       {
+                               if (sc)
+                               {
+@@ -2404,14 +2459,18 @@ persistent_loop:
+               stats_line(1, complete_url, count, curncount, err, ok, started_at, verbose, &t_total, avg_httping_time, show_Bps ? &bps : NULL);
+ error_exit:
++#ifdef ENABLE_NAGIOS
+       if (nagios_mode)
+               return nagios_result(ok, nagios_mode, nagios_exit_code, avg_httping_time, nagios_warn, nagios_crit);
++#endif
+       if (!json_output && !machine_readable)
+               printf("%s", c_very_normal);
++#ifdef ENABLE_JSON
+       if (json_output)
+               printf("\n]\n");
++#endif
+       free_cookies(static_cookies, n_static_cookies);
+       free_cookies(dynamic_cookies, n_dynamic_cookies);
+--- a/help.c
++++ b/help.c
+@@ -93,6 +93,8 @@ void version(void)
+       fprintf(stderr, gettext("\n"));
+ }
++#ifdef ENABLE_HELP
++#ifdef ENABLE_HELP_FORMAT
+ void format_help(const char *short_str, const char *long_str, const char *descr)
+ {
+       int par_width = SWITCHES_COLUMN_WIDTH, max_wrap_width = par_width / 2, cur_par_width = 0;
+@@ -167,9 +169,30 @@ void format_help(const char *short_str,
+               p = n;
+       }
+ }
++#else
++void format_help(const char *short_str, const char *long_str, const char *descr)
++{
++      if (short_str)
++      {
++              fputs(short_str, stderr);
++              fputc(' ', stderr);
++      }
++
++      if (long_str)
++      {
++              fputs(long_str, stderr);
++              fputc(' ', stderr);
++      }
++
++      fputs(descr, stderr);
++      fputc('\n', stderr);
++}
++#endif
++#endif
+ void usage(const char *me)
+ {
++#ifdef ENABLE_HELP
+       char *dummy = NULL, has_color = 0;
+       char host[256] = { 0 };
+@@ -270,11 +293,15 @@ void usage(const char *me)
+       fprintf(stderr, gettext(" *** output mode settings ***\n"));
+       format_help("-q", "--quiet", gettext("quiet, only returncode"));
+       format_help("-m", "--parseable-output", gettext("give machine parseable output (see also -o and -e)"));
++#ifdef ENABLE_JSON
+       format_help("-M", NULL, gettext("json output, cannot be combined with -m"));
++#endif
+       format_help("-o rc,rc,...", "--ok-result-codes", gettext("what http results codes indicate 'ok' comma separated WITHOUT spaces inbetween default is 200, use with -e"));
+       format_help("-e x", "--result-string", gettext("string to display when http result code doesn't match"));
++#ifdef ENABLE_NAGIOS
+       format_help("-n warn,crit", "--nagios-mode-1 / --nagios-mode-2", gettext("Nagios-mode: return 1 when avg. response time >= warn, 2 if >= crit, otherwhise return 0"));
+       format_help("-N x", NULL, gettext("Nagios mode 2: return 0 when all fine, 'x' when anything failes"));
++#endif
+       format_help("-C cookie=value", "--cookie", gettext("add a cookie to the request"));
+       format_help("-Y", "--colors", gettext("add colors"));
+       format_help("-a", "--audible-ping", gettext("audible ping"));
+@@ -309,5 +336,6 @@ void usage(const char *me)
+       fprintf(stderr, gettext("Example:\n"));
+       fprintf(stderr, "\t%s %s%s -s -Z\n\n", me, host, has_color ? " -Y" : "");
++#endif
+       new_version_alert();
+ }
+--- a/Makefile
++++ b/Makefile
+@@ -88,6 +88,22 @@ OBJS+=fft.o
+ LDFLAGS+=-lfftw3
+ endif
++ifeq ($(JSON),yes)
++CFLAGS+=-DENABLE_JSON
++endif
++
++ifeq ($(NAGIOS),yes)
++CFLAGS+=-DENABLE_NAGIOS
++endif
++
++ifeq ($(HELP),yes)
++CFLAGS+=-DENABLE_HELP
++endif
++
++ifeq ($(HELPFORMAT),yes)
++CFLAGS+=-DENABLE_HELP_FORMAT
++endif
++
+ ifeq ($(DEBUG),yes)
+ CFLAGS+=-D_DEBUG -ggdb
+ LDFLAGS+=-g
index 42e154ce705a3293c8f485ec6385faf2d6bfd8cc..3bc8f9f8e2cfda020187fb93cda12bc90e4bf748 100644 (file)
@@ -1,14 +1,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=https_dns_proxy
-PKG_VERSION:=2017-01-07
-PKG_RELEASE=2
+PKG_VERSION:=2018-01-28
+PKG_RELEASE=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=627f468230a02d8c36915978cc4dce9f1458590aa30e2df723d59cb860acb192
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=c62ce3f6807a4067230a8bc5ea5a829f532de785
+PKG_SOURCE_VERSION:=843b768f0cd3aa6fa5aed4fa992776657bc18d14
 PKG_MAINTAINER:=Aaron Drew <aarond10@gmail.com>
 PKG_LICENSE:=MIT
 
@@ -19,7 +20,7 @@ define Package/https_dns_proxy
   SECTION:=net
   CATEGORY:=Network
   TITLE:=DNS over HTTPS proxy server
-  DEPENDS:=+libcares +libcurl +libev
+  DEPENDS:=+libcares +libcurl +libev +ca-bundle
 endef
 
 define Package/https_dns_proxy/install
index 17f3557387ca1cf6b5f4ae1577e93dd49a4d01ef..7f5aaa66930f07ba038ebedf7f5889e30a171ab0 100644 (file)
@@ -3,3 +3,5 @@ config https_dns_proxy
        option listen_port '5053'
        option user 'nobody'
        option group 'nogroup'
+       option subnet_addr ''
+       option proxy_server ''
index 333f3cac3ecb14914331c41fddf5782cbc8957c3..29bd71ed737832ae4b757cd977ef0c1a2d417f73 100644 (file)
@@ -13,11 +13,21 @@ start_instance() {
        config_get listen_port "$cfg" listen_port
        config_get user "$cfg" user
        config_get group "$cfg" group
+       config_get subnet_addr "$cfg" subnet_addr
+       config_get proxy_server "$cfg" proxy_server
+
+       if [ -n "$subnet_addr" ]; then
+               subnet_param="-e $subnet_addr"
+       fi
+
+       if [ -n "$proxy_server" ]; then
+               proxy_param="-t $proxy_server"
+       fi
 
        procd_open_instance
        procd_set_param command ${PROG} \
                -a "$listen_addr" -p "$listen_port" \
-               -u "$user" -g "$group"
+               -u "$user" -g "$group" $subnet_param $proxy_param
        procd_set_param respawn
        procd_close_instance
 }
diff --git a/net/i2pd/Makefile b/net/i2pd/Makefile
new file mode 100644 (file)
index 0000000..c15994e
--- /dev/null
@@ -0,0 +1,71 @@
+#
+# Copyright (C) 2015, 2016 gxcreator
+# Copyright (C) 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:=i2pd
+PKG_VERSION:=2.18.0
+PKG_RELEASE:=1
+PKG_BUILD_PARALLEL:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=1a04826b54e649ebb341d3feacdd05c0415335679d1aa787a74ea5995d419378
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/PurpleI2P/i2pd.git
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+PKG_LICENSE:=BSD-3-clause
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/i2pd
+       SECTION:=net
+       CATEGORY:=Network
+       DEPENDS:=+libopenssl +boost +boost-system +boost-filesystem \
+                +boost-program_options +boost-date_time +libatomic +zlib
+       TITLE:=full-featured C++ implementation of I2P client
+       URL:=https://github.com/PurpleI2P/i2pd
+       USERID:=i2pd:i2pd
+       MAINTAINER:=David Yang <mmyangfl@gmail.com>
+endef
+
+define Package/i2pd/description
+       I2P (Invisible Internet Protocol) is a universal anonymous network layer. All
+       communications over I2P are anonymous and end-to-end encrypted, participants
+       don't reveal their real IP addresses.
+endef
+
+define Package/i2pd/conffiles
+       /etc/i2pd/i2pd.conf
+       /etc/i2pd/subscriptions.txt
+       /etc/i2pd/tunnels.conf
+endef
+
+TARGET_LDFLAGS+=-latomic
+MAKE_FLAGS+=USE_AESNI=no USE_AVX=no
+
+define Package/i2pd/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/i2pd $(1)/usr/sbin
+       $(INSTALL_DIR) $(1)/usr/share/i2pd
+       $(CP) $(PKG_BUILD_DIR)/contrib/certificates  $(1)/usr/share/i2pd
+       $(INSTALL_DIR) $(1)/etc/i2pd
+       $(LN) /usr/share/i2pd/certificates $(1)/etc/i2pd/certificates
+       $(LN) /var/lib/i2pd/peerProfiles $(1)/etc/i2pd/peerProfiles
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/i2pd.conf $(1)/etc/i2pd
+       $(SED) ' \
+               s/127.0.0.1/192.168.1.1/g; \
+               s/datadir = \/var\/lib/datadir = \/etc/ \
+       ' $(1)/etc/i2pd/i2pd.conf
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/subscriptions.txt $(1)/etc/i2pd
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/tunnels.conf $(1)/etc/i2pd
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/i2pd.init $(1)/etc/init.d/i2pd
+endef
+
+$(eval $(call BuildPackage,i2pd))
diff --git a/net/i2pd/files/i2pd.init b/net/i2pd/files/i2pd.init
new file mode 100755 (executable)
index 0000000..f1c394a
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2017 OpenWrt.org
+
+USE_PROCD=1
+
+START=90
+STOP=10
+
+PROG=/usr/sbin/i2pd
+USER="i2pd"
+GROUP="i2pd"
+PIDFILE=/var/run/i2pd.pid
+DATADIR=/etc/i2pd
+PEERDIR=/var/lib/i2pd/peerProfiles
+
+
+start_service() {
+       ## RAM
+       if [ ! -d $PEERDIR ]; then
+               mkdir -p $PEERDIR
+               chown $USER:$GROUP $PEERDIR
+       fi
+
+       ## We need permissions
+       chown -R $USER:$GROUP $DATADIR
+       touch $PIDFILE
+       chown $USER:adm $PIDFILE
+
+       procd_open_instance
+       procd_set_param command $PROG --service --conf=/etc/i2pd/i2pd.conf
+       ## Don't know about i2pd user's HOME
+       procd_set_param env HOME=$DATADIR
+       procd_set_param limits nofile=4096
+       procd_set_param stdout 1
+       procd_set_param stderr 1
+       procd_set_param user $USER
+       procd_set_param pidfile $PIDFILE
+       procd_close_instance
+}
index 2ffb30a80768c89a2af8cef268eb752be8b4dc7a..3ef388136710f0e1c8cebfd47c3edd0a34fd561b 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.ibr.cs.tu-bs.de/projects/ibr-dtn/releases
-PKG_MD5SUM:=3e527cedc6132739403fc210e4f8abe2
+PKG_HASH:=eab066cf15f9c322d769c6c9c58adfb474cba7d446fd12e8de5ff6344376795b
 PKG_MAINTAINER:=Johannes Morgenroth <jm@m-network.de>
 PKG_LICENSE:=Apache-2.0
 
index 36d598749d1760f0d4117137698c9c1a8aa9ef0a..daa4d71c4ca86ac15197d7637f6059c267e7776a 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.ibr.cs.tu-bs.de/projects/ibr-dtn/releases
-PKG_MD5SUM:=933d37bf777700a6e1709d0f7a129613
+PKG_HASH:=9bd79636154093ab6bf4fd10d6c62d67c6db45141460847b19def327c93771ed
 PKG_MAINTAINER:=Johannes Morgenroth <jm@m-network.de>
 PKG_LICENSE:=Apache-2.0
 
diff --git a/net/ifstat/Makefile b/net/ifstat/Makefile
new file mode 100644 (file)
index 0000000..8b4d1ec
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2016 Nikil Mehta <nikil.mehta@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ifstat
+PKG_VERSION:=1.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://gael.roualland.free.fr/ifstat/
+PKG_HASH:=8599063b7c398f9cfef7a9ec699659b25b1c14d2bc0f535aed05ce32b7d9f507
+
+PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ifstat
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=InterFace STATistics Monitoring
+  URL:=http://gael.roualland.free.fr/ifstat/
+  DEPENDS:=+libnetsnmp
+endef
+
+define Package/ifstat/description
+       ifstat is a tool to report network interfaces bandwidth just like
+       vmstat/iostat do for other system counters. It can monitor local
+       interfaces by polling the kernel counters, or remote hosts
+       interfaces using SNMP.
+endef
+
+define Package/ifstat/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ifstat $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,ifstat))
diff --git a/net/inadyn/Makefile b/net/inadyn/Makefile
new file mode 100644 (file)
index 0000000..1da7213
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2017-2018 Daniel Engberg <daniel.engberg.lists@pyret.net>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=inadyn
+PKG_VERSION:=2.3
+PKG_RELEASE:=1
+PKG_MAINTAINER:=
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/troglobit/inadyn/releases/download/v$(PKG_VERSION)
+PKG_HASH:=4a98b80d8565b9e4cb32b19b7a8b06a22a7d9a6f4f03a5298a8d441b6187c760
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/inadyn
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+confuse +libopenssl +ca-certificates
+  TITLE:=A Dynamic DNS client with SSL/TLS support
+  URL:=http://troglobit.com/project/inadyn/
+  SUBMENU:=IP Addresses and Names
+endef
+
+define Package/inadyn/description
+  Inadyn is a small and simple Dynamic DNS, DDNS, client with HTTPS support
+endef
+
+define Package/inadyn/conffiles
+/etc/inadyn.conf
+endef
+
+CONFIGURE_ARGS += --enable-shared --disable-static --enable-openssl
+
+define Package/inadyn/install
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/inadyn $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,inadyn))
index 06639975781a41af39974c1ec1bd03504d5b3151..e6cf46c398ae772ed16ced2a82f6a63e988ea1c1 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iodine
 PKG_VERSION:=0.7.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://code.kryo.se/iodine/
-PKG_MD5SUM:=fdbf3b81cd69caf5230d76a8b039fd99
+PKG_HASH:=ad2b40acf1421316ec15800dcde0f587ab31d7d6f891fa8b9967c4ded93c013e
 
 PKG_MAINTAINER:=Uwe Kleine-König <uwe+openwrt@kleine-koenig.org>
 PKG_LICENSE:=ISC
diff --git a/net/iodine/patches/101-musl-workaround-incomplete-nameser-h.patch b/net/iodine/patches/101-musl-workaround-incomplete-nameser-h.patch
new file mode 100644 (file)
index 0000000..1f075d0
--- /dev/null
@@ -0,0 +1,27 @@
+The arpa/nameser.h header of musl libc indirectly depends on the endian.h
+header but fails to explicitely include it to properly define
+`__BYTE_ORDER` and `__BIG_ENDIAN` prior to declaring the DNS `HEADER`
+structure.
+
+When both the appropriate `__BYTE_ORDER` and `__BIG_ENDIAN` defines are
+unset, the `#if __BYTE_ORDER == __BIG_ENDIAN` condition in `nameser.h`
+evaluates to true, causing it to declare a bad (big endian) DNS packet
+header structure on little endian systems.
+
+Work around this musl bug by forcibly passing `-include endian.h` through
+the `osflags` file.
+
+An upstream fix for musl libc has been submitted with
+http://www.openwall.com/lists/musl/2017/12/04/3
+
+--- a/src/osflags
++++ b/src/osflags
+@@ -27,7 +27,7 @@ cflags)
+                       echo '-Dsocklen_t=int';
+               ;;
+               Linux)
+-                      FLAGS="-D_GNU_SOURCE"
++                      FLAGS="-D_GNU_SOURCE -include endian.h"
+                       echo $FLAGS;
+               ;;
+       esac
index e1491f7794242bccc19f3ae7ab1ab13c427dd2db..f31adbd9c3bb93381bbf68af211cfb9aac12f5d2 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE=1
 
 PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz
 PKG_SOURCE_URL:=http://mirrors.kernel.org/${PKG_NAME}/${PKG_VERSION}/
-PKG_MD5SUM:=7dcd9f0f48263c6b27a2c3d085dd7278b5c0feed1dfec8872a04899707fa23d8
+PKG_HASH:=7dcd9f0f48263c6b27a2c3d085dd7278b5c0feed1dfec8872a04899707fa23d8
 PKG_USE_MIPS16:=0
 
 PKG_BUILD_DEPENDS:=boost
@@ -163,6 +163,7 @@ PKG_TINYCBOR_NAME:=tinycbor
 PKG_TINYCBOR_PROTO:=git
 PKG_TINYCBOR_VERSION:=0.4
 PKG_TINYCBOR_SOURCE_VERSION:=a088996aa5f59b4f27f20fadad053d88bee357d4
+PKG_TINYCBOR_MIRROR_HASH:=77c600bd7362df8291148fa3d94ca780815ea2b74b817dca7565310ea0abff96
 PKG_TINYCBOR_SOURCE:=$(PKG_TINYCBOR_NAME)-$(PKG_TINYCBOR_VERSION).tar.bz2
 PKG_TINYCBOR_SOURCE_URL:=https://github.com/01org/tinycbor.git
 PKG_TINYCBOR_SUBDIR:=$(PKG_TINYCBOR_NAME)
@@ -170,6 +171,7 @@ PKG_TINYCBOR_SUBDIR:=$(PKG_TINYCBOR_NAME)
 define Download/iotivity-tinycbor
   FILE:=$(PKG_TINYCBOR_SOURCE)
   URL:=$(PKG_TINYCBOR_SOURCE_URL)
+  MIRROR_HASH:=$(PKG_TINYCBOR_MIRROR_HASH)
   PROTO:=$(PKG_TINYCBOR_PROTO)
   VERSION:=$(PKG_TINYCBOR_SOURCE_VERSION)
   SUBDIR:=$(PKG_TINYCBOR_SUBDIR)
index 806c16090a4949713168526b922287543a97f82e..a987fceb1d0720191f4f2bd2d0f15746fa4b9f98 100644 (file)
@@ -11,13 +11,14 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ipsec-tools
 PKG_VERSION:=0.8.2
-PKG_RELEASE:=5
-PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
+PKG_RELEASE:=7
+PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>, \
+       Vitaly Protsko <villy@sft.ru>
 PKG_LICENSE := BSD-3-Clause
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/ipsec-tools
-PKG_MD5SUM:=d53ec14a0a3ece64e09e5e34b3350b41
+PKG_HASH:=8eb6b38716e2f3a8a72f1f549c9444c2bc28d52c9536792690564c74fe722f2d
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
index e3e739b93b98ef795998ed082f8f1c742ed2bae3..45715b5a398a582fd7ba50de3981436f194c3938 100644 (file)
@@ -88,6 +88,41 @@ spd$spdcmd $ritem $litem any -P in ipsec esp/tunnel/$4-$gate/require;
   done
 }
 
+manage_nonesa() {
+  local spdcmd
+  local item
+  local cout cin
+
+  if [ -z "$4" ]; then
+    $log "Bad usage of manage_nonesa"
+    errno=3; return 3
+  fi
+
+  case "$1" in
+    add|up|1) spdcmd=add ;;
+    del|down|0) spdcmd=delete ;;
+    *) errno=3; return 3 ;;
+  esac
+
+  case "$2" in
+    local|remote) ;;
+    *) errno=3; return 3 ;;
+  esac
+
+  for item in $3 ; do
+    if [ "$2" = "local" ]; then
+      cout="$4 $item"
+      cin="$item $4"
+    else
+      cout="$item $4"
+      cin="$4 $item"
+    fi
+    echo "
+spd$spdcmd $cout any -P out none;
+spd$spdcmd $cin any -P in none;
+" | /usr/sbin/setkey -c 1>&2
+  done
+}
 
 . /lib/functions/network.sh
 
index 3ce41eb495863bb9c68f77d3b79860bc0820d8f6..e2c8400b47f33c592ecc629a0ed1fc7b6d518873 100644 (file)
@@ -51,6 +51,10 @@ config sainfo 'office'
        option  p2_proposal     'example_prop2'
        option  local_net       '192.168.8.0/24'
        option  remote_net      '192.168.1.0/24'
+# you can exclude some local or remote
+# addresses from SA rules
+       list    local_exclude   '192.168.8.0/30'
+       list    remote_exclude  '192.168.1.128/29'
 
 config sainfo 'welcome'
        option  p2_proposal     'example_in2'
index 6520d5bdeb9e3772d36a567d00849218a2b18044..247bdfc674c058bbecb4e2d52bf2c6e856ff3623 100644 (file)
@@ -183,10 +183,12 @@ setup_sa() {
     echo -e "  split_network include $locnet;\n}" >> $conf
 
   elif [ -z "$client" ]; then
-    manage_sa add $locnet $remnet $remote
+    config_list_foreach "$1" remote_exclude manage_nonesa add remote "$locnet"
+    config_list_foreach "$1" local_exclude manage_nonesa add local "$remnet"
+    manage_sa add "$locnet" "$remnet" $remote
     test $? -gt 0 -o $errno -gt 0 && return $errno
 
-    manage_fw add $confIntZone $confExtZone $remnet
+    manage_fw add $confIntZone $confExtZone "$remnet"
   fi
 }
 
@@ -339,8 +341,10 @@ destroy_sa() {
     errno=4; return 4
   fi
 
-  manage_sa del $locnet $remnet $2
-  manage_fw del $confIntZone $confExtZone $remnet
+  config_list_foreach "$1" remote_exclude manage_nonesa del remote "$locnet"
+  config_list_foreach "$1" local_exclude manage_nonesa del local "$remnet"
+  manage_sa del "$locnet" "$remnet" $2
+  manage_fw del $confIntZone $confExtZone "$remnet"
 }
 
 destroy_tunnel() {
diff --git a/net/ipsec-tools/patches/010-CVE-2016-10396.patch b/net/ipsec-tools/patches/010-CVE-2016-10396.patch
new file mode 100644 (file)
index 0000000..110b86c
--- /dev/null
@@ -0,0 +1,201 @@
+Description: Fix remotely exploitable DoS. http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10396
+Source: vendor; https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=51682
+Bug-debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=867986
+
+Index: ipsec-tools-0.8.2/src/racoon/isakmp_frag.c
+===================================================================
+--- ipsec-tools-0.8.2.orig/src/racoon/isakmp_frag.c
++++ ipsec-tools-0.8.2/src/racoon/isakmp_frag.c
+@@ -1,4 +1,4 @@
+-/*    $NetBSD: isakmp_frag.c,v 1.5 2009/04/22 11:24:20 tteras Exp $   */
++/*    $NetBSD: isakmp_frag.c,v 1.5.36.1 2017/04/21 16:50:42 bouyer Exp $      */
+ /* Id: isakmp_frag.c,v 1.4 2004/11/13 17:31:36 manubsd Exp */
+@@ -173,6 +173,43 @@ vendorid_frag_cap(gen)
+       return ntohl(hp[MD5_DIGEST_LENGTH / sizeof(*hp)]);
+ }
++static int 
++isakmp_frag_insert(struct ph1handle *iph1, struct isakmp_frag_item *item)
++{
++      struct isakmp_frag_item *pitem = NULL;
++      struct isakmp_frag_item *citem = iph1->frag_chain;
++
++      /* no frag yet, just insert at beginning of list */
++      if (iph1->frag_chain == NULL) {
++              iph1->frag_chain = item;
++              return 0;
++      }
++
++      do {
++              /* duplicate fragment number, abort (CVE-2016-10396) */
++              if (citem->frag_num == item->frag_num)
++                      return -1;
++
++              /* need to insert before current item */
++              if (citem->frag_num > item->frag_num) {
++                      if (pitem != NULL)
++                              pitem->frag_next = item;
++                      else
++                              /* insert at the beginning of the list  */
++                              iph1->frag_chain = item;
++                      item->frag_next = citem;
++                      return 0;
++              }
++
++              pitem = citem;
++              citem = citem->frag_next;
++      } while (citem != NULL);
++
++      /* we reached the end of the list, insert */
++      pitem->frag_next = item;
++      return 0;
++}
++
+ int 
+ isakmp_frag_extract(iph1, msg)
+       struct ph1handle *iph1;
+@@ -224,39 +261,43 @@ isakmp_frag_extract(iph1, msg)
+       item->frag_next = NULL;
+       item->frag_packet = buf;
+-      /* Look for the last frag while inserting the new item in the chain */
+-      if (item->frag_last)
+-              last_frag = item->frag_num;
++      /* Check for the last frag before inserting the new item in the chain */
++      if (item->frag_last) {
++              /* if we have the last fragment, indices must match */
++              if (iph1->frag_last_index != 0 &&
++                  item->frag_last != iph1->frag_last_index) {
++                      plog(LLV_ERROR, LOCATION, NULL,
++                           "Repeated last fragment index mismatch\n");
++                      racoon_free(item);
++                      vfree(buf);
++                      return -1;
++              }
+-      if (iph1->frag_chain == NULL) {
+-              iph1->frag_chain = item;
+-      } else {
+-              struct isakmp_frag_item *current;
++              last_frag = iph1->frag_last_index = item->frag_num;
++      }
+-              current = iph1->frag_chain;
+-              while (current->frag_next) {
+-                      if (current->frag_last)
+-                              last_frag = item->frag_num;
+-                      current = current->frag_next;
+-              }
+-              current->frag_next = item;
++      /* insert fragment into chain */
++      if (isakmp_frag_insert(iph1, item) == -1) {
++              plog(LLV_ERROR, LOCATION, NULL,
++                  "Repeated fragment index mismatch\n");
++              racoon_free(item);
++              vfree(buf);
++              return -1;
+       }
+-      /* If we saw the last frag, check if the chain is complete */
++      /* If we saw the last frag, check if the chain is complete
++       * we have a sorted list now, so just walk through */
+       if (last_frag != 0) {
++              item = iph1->frag_chain;
+               for (i = 1; i <= last_frag; i++) {
+-                      item = iph1->frag_chain;
+-                      do {
+-                              if (item->frag_num == i)
+-                                      break;
+-                              item = item->frag_next;
+-                      } while (item != NULL);
+-
++                      if (item->frag_num != i)
++                              break;
++                      item = item->frag_next;
+                       if (item == NULL) /* Not found */
+                               break;
+               }
+-              if (item != NULL) /* It is complete */
++              if (i > last_frag) /* It is complete */
+                       return 1;
+       }
+               
+@@ -291,15 +332,9 @@ isakmp_frag_reassembly(iph1)
+       }
+       data = buf->v;
++      item = iph1->frag_chain;
+       for (i = 1; i <= frag_count; i++) {
+-              item = iph1->frag_chain;
+-              do {
+-                      if (item->frag_num == i)
+-                              break;
+-                      item = item->frag_next;
+-              } while (item != NULL);
+-
+-              if (item == NULL) {
++              if (item->frag_num != i) {
+                       plog(LLV_ERROR, LOCATION, NULL, 
+                           "Missing fragment #%d\n", i);
+                       vfree(buf);
+@@ -308,6 +343,7 @@ isakmp_frag_reassembly(iph1)
+               }
+               memcpy(data, item->frag_packet->v, item->frag_packet->l);
+               data += item->frag_packet->l;
++              item = item->frag_next;
+       }
+ out:
+Index: ipsec-tools-0.8.2/src/racoon/isakmp_inf.c
+===================================================================
+--- ipsec-tools-0.8.2.orig/src/racoon/isakmp_inf.c
++++ ipsec-tools-0.8.2/src/racoon/isakmp_inf.c
+@@ -720,6 +720,7 @@ isakmp_info_send_nx(isakmp, remote, loca
+ #endif
+ #ifdef ENABLE_FRAG
+       iph1->frag = 0;
++      iph1->frag_last_index = 0;
+       iph1->frag_chain = NULL;
+ #endif
+Index: ipsec-tools-0.8.2/src/racoon/isakmp.c
+===================================================================
+--- ipsec-tools-0.8.2.orig/src/racoon/isakmp.c
++++ ipsec-tools-0.8.2/src/racoon/isakmp.c
+@@ -1071,6 +1071,7 @@ isakmp_ph1begin_i(rmconf, remote, local)
+               iph1->frag = 1;
+       else
+               iph1->frag = 0;
++      iph1->frag_last_index = 0;
+       iph1->frag_chain = NULL;
+ #endif
+       iph1->approval = NULL;
+@@ -1175,6 +1176,7 @@ isakmp_ph1begin_r(msg, remote, local, et
+ #endif
+ #ifdef ENABLE_FRAG
+       iph1->frag = 0;
++      iph1->frag_last_index = 0;
+       iph1->frag_chain = NULL;
+ #endif
+       iph1->approval = NULL;
+Index: ipsec-tools-0.8.2/src/racoon/handler.h
+===================================================================
+--- ipsec-tools-0.8.2.orig/src/racoon/handler.h
++++ ipsec-tools-0.8.2/src/racoon/handler.h
+@@ -1,4 +1,4 @@
+-/*    $NetBSD: handler.h,v 1.25 2010/11/17 10:40:41 tteras Exp $      */
++/*    $NetBSD: handler.h,v 1.26 2017/01/24 19:23:56 christos Exp $    */
+ /* Id: handler.h,v 1.19 2006/02/25 08:25:12 manubsd Exp */
+@@ -141,6 +141,7 @@ struct ph1handle {
+ #endif
+ #ifdef ENABLE_FRAG
+       int frag;                       /* IKE phase 1 fragmentation */
++      int frag_last_index;
+       struct isakmp_frag_item *frag_chain;    /* Received fragments */
+ #endif
index 9084867d301dbb6594e19a6830a3420e1ec69c11..368020f8fca90efb0b2ce2e9f5550ca7d939ec57 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://fedorahosted.org/releases/i/p/iptraf-ng/
-PKG_MD5SUM:=de27cfeeede96e2acfb0edc8439b034a
+PKG_HASH:=79140cf07c0cceb1b5723242847a73aa86f5e4f9dccfe8970fda6801d347eb09
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=LICENSE
index 6b6820d023cbafa65c2edd9f4c54520767734c3d..f981e95df43e15d71966d599087942d44c972d88 100644 (file)
@@ -8,61 +8,37 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=irssi
-PKG_VERSION:=0.8.21
+PKG_VERSION:=1.1.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=https://github.com/irssi/irssi/releases/download/0.8.21/
-PKG_MD5SUM:=b820760c3b4f3b0c24abe4db82b6366a
+PKG_SOURCE_URL:=https://github.com/irssi/irssi/releases/download/1.1.1/
+PKG_HASH:=784807e7a1ba25212347f03e4287cff9d0659f076edfb2c6b20928021d75a1bf
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
 
-define Package/irssi/Default
+define Package/irssi
   SUBMENU:=Instant Messaging
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+glib2 +libncurses +libpthread
+  DEPENDS:=+glib2 +libncurses +libpthread +libopenssl
   TITLE:=Console IRC client
   MAINTAINER:=Peter Wagner <tripolar@gmx.at>
-  URL:=http://irssi.org/
-endef
-
-define Package/irssi/Default/description
-       Irssi is a terminal based IRC client for UNIX systems.
-endef
-
-define Package/irssi
-$(call Package/irssi/Default)
-  TITLE+= (with OpenSSL support)
-  DEPENDS+= +libopenssl
-  VARIANT:=ssl
+  URL:=https://irssi.org/
 endef
 
 define Package/irssi/description
-$(call Package/irssi/Default/description)
- This package is built with OpenSSL support.
-endef
-
-define Package/irssi-nossl
-$(call Package/irssi/Default)
-  TITLE+= (without OpenSSL support)
-  VARIANT:=nossl
-endef
-
-define Package/irssi-nossl/description
-$(call Package/irssi/Default/description)
- This package is built without OpenSSL support.
+       Irssi is a terminal based IRC client for UNIX systems.
 endef
 
 CONFIGURE_ARGS += \
        --with-perl=no \
        --with-glib-prefix="$(STAGING_DIR)/usr" \
+       --with-ssl="$(STAGING_DIR)/usr" \
        --with-textui \
        --without-bot \
        --disable-proxy
@@ -70,17 +46,6 @@ CONFIGURE_ARGS += \
 EXTRA_CFLAGS+=$(TARGET_CPPFLAGS)
 EXTRA_LDFLAGS+=-lncurses
 
-ifeq ($(BUILD_VARIANT),ssl)
-       CONFIGURE_ARGS += \
-               --with-ssl="$(STAGING_DIR)/usr"
-endif
-
-ifeq ($(BUILD_VARIANT),nossl)
-       CONFIGURE_ARGS += \
-               --without-ssl \
-               --disable-ssl
-endif
-
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include/irssi
        $(CP) $(PKG_INSTALL_DIR)/usr/include/irssi/* $(1)/usr/include/irssi/
@@ -91,7 +56,5 @@ define Package/irssi/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/$(PKG_NAME)
 endef
 
-Package/irssi-nossl/install = $(Package/irssi/install)
-
 $(eval $(call BuildPackage,irssi))
-$(eval $(call BuildPackage,irssi-nossl))
+
index 738e7f965150db140c6c7df24dd5f64276e1842e..a2b43530eb999191327a09dafd2ba699c575dbbf 100644 (file)
@@ -9,19 +9,18 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=isc-dhcp
 UPSTREAM_NAME:=dhcp
-PKG_VERSION:=4.3.5
+PKG_VERSION:=4.4.0
 PKG_RELEASE:=1
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Antony Antony <antony@phenome.org>
+PKG_MAINTAINER:=Philip Prindeville <philipp@redfish-solutions.com>
 
 PKG_SOURCE:=$(UPSTREAM_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.isc.org/isc/dhcp/$(PKG_VERSION) \
                http://ftp.funet.fi/pub/mirrors/ftp.isc.org/isc/dhcp/$(PKG_VERSION) \
                http://ftp.iij.ad.jp/pub/network/isc/dhcp/$(PKG_VERSION)
-PKG_MD5SUM:=2b5e5b2fa31c2e27e487039d86f83d3f
-PKG_HASH:=eb95936bf15d2393c55dd505bc527d1d4408289cec5a9fa8abb99f7577e7f954
+PKG_HASH:=4a90be0f22ad81c987f5584661b60a594f1b21c581b82bfba3ae60f89ae44397
 
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
@@ -30,12 +29,15 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(UPSTREAM_NAME)-$(PKG_
 
 include $(INCLUDE_DIR)/package.mk
 
+DISABLE_NLS:=
+
 define Package/isc-dhcp/Default
   SECTION:=net
   CATEGORY:=Network
   SUBMENU:=IP Addresses and Names
   TITLE:=ISC's DHCP
   URL:=https://www.isc.org/software/dhcp
+  DEPENDS:=+zlib
 endef
 
 define Package/isc-dhcp-relay-ipv4
@@ -200,11 +202,10 @@ define Package/isc-dhcp-relay-$(BUILD_VARIANT)/install
 endef
 
 define Package/isc-dhcp-server-$(BUILD_VARIANT)/install
-       $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc
-       $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d
+       $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/uci-defaults
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcpd $(1)/usr/sbin
        $(INSTALL_BIN) ./files/dhcpd.init $(1)/etc/init.d/dhcpd
-       $(INSTALL_BIN) ./files/dhcpd.conf $(1)/etc
+       $(INSTALL_BIN) ./files/dhcpd.defaults $(1)/etc/uci-defaults
 ifeq ($(BUILD_VARIANT),ipv6)
        $(INSTALL_BIN) ./files/dhcpd6.init $(1)/etc/init.d/dhcpd6
        $(INSTALL_BIN) ./files/dhcpd6.conf $(1)/etc
diff --git a/net/isc-dhcp/files/dhcpd.conf b/net/isc-dhcp/files/dhcpd.conf
deleted file mode 100644 (file)
index 11985ce..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# dhcpd.conf
-
-authoritative;
-
-default-lease-time 3600;
-max-lease-time 86400;
-
-option domain-name-servers 192.168.1.1;
-
-subnet 192.168.1.0 netmask 255.255.255.0 {
-  range 192.168.1.10 192.168.1.50;
-  option routers 192.168.1.1;
-}
diff --git a/net/isc-dhcp/files/dhcpd.defaults b/net/isc-dhcp/files/dhcpd.defaults
new file mode 100644 (file)
index 0000000..bd6f3d2
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+uci -q get dhcp.isc_dhcpcd && exit 0
+touch /etc/config/dhcp
+
+uci batch <<EOF
+set dhcp.isc_dhcpd=isc_dhcpd
+set dhcp.isc_dhcpd.authoritative='1'
+set dhcp.isc_dhcpd.default_lease_time='3600'
+set dhcp.isc_dhcpd.max_lease_time='86400'
+commit dhcp
+EOF
index 3ca6c641ee43eb5994f05ed5b5335426d5194b2c..e853ffe0a1af76592feb37d1d3bd25d693abb78f 100644 (file)
 #!/bin/sh /etc/rc.common
 
-START=65
+START=19
+USE_PROCD=1
+PROG=/usr/sbin/dhcpd
 
 lease_file=/tmp/dhcpd.leases
-config_file=/etc/dhcpd.conf
-pid_file=/var/run/dhcpd.pid
+config_file=/tmp/run/dhcpd.conf
 
-start() {
-       if [ ! -e $lease_file ]; then
-               touch $lease_file
-       fi
+time2seconds() {
+       local timestring=$1
+       local multiplier number suffix
+
+       suffix="${timestring//[0-9 ]}"
+       number="${timestring%%$suffix}"
+       [ "$number$suffix" != "$timestring" ] && return 1
+       case "$suffix" in
+               "" | s)
+                       multiplier=1
+                       ;;
+               m)
+                       multiplier=60
+                       ;;
+               h)
+                       multiplier=3600
+                       ;;
+               d)
+                       multiplier=86400
+                       ;;
+               w)
+                       multiplier=604800
+                       ;;
+               *)
+                       return 1
+                       ;;
+       esac
+       echo $(( number * multiplier ))
+}
 
-       /usr/sbin/dhcpd -q -cf $config_file -lf $lease_file -pf $pid_file $dhcp_ifs
+# duplicated from dnsmasq init script
+hex_to_hostid() {
+       local var="$1"
+       local hex="${2#0x}" # strip optional "0x" prefix
 
-       if [ $? -ne 0 ]; then
+       if [ -n "${hex//[0-9a-fA-F]/}" ]; then
+               # is invalid hex literal
                return 1
        fi
+
+       # convert into host id
+       export "$var=$(
+               printf "%0x:%0x" \
+               $(((0x$hex >> 16) % 65536)) \
+               $(( 0x$hex        % 65536))
+               )"
+
+       return 0
 }
 
-stop() {
-       if [ ! -e $pid_file ]; then
-               return 1
+static_host_add() {
+       local cfg="$1"
+       local broadcast hostid macn macs mac name ip leasetime
+
+       config_get macs "$cfg" "mac"
+       [ -n "$macs" ] || return 0
+       config_get name "$cfg" "name"
+       [ -n "$name" ] || return 0
+       config_get ip "$cfg" "ip"
+       [ -n "$ip" ] || return 0
+
+       config_get_bool broadcast "$cfg" "broadcast" 0
+       config_get dns "$cfg" "dns"
+       config_get gateway "$cfg" "gateway"
+       config_get leasetime "$cfg" "leasetime"
+       if [ -n "$leasetime" ] ; then
+               leasetime="$(time2seconds "$leasetime")"
+               [ "$?" -ne 0 ] && return 1
+       fi
+
+       config_get hostid "$cfg" "hostid"
+       if [ -n "$hostid" ] ; then
+               hex_to_hostid hostid "$hostid" || return 1
        fi
 
-       kill -9 `cat $pid_file`
+       macn=0
+       for mac in $macs; do
+               macn=$(( macn + 1 ))
+       done
 
-       if [ $? -ne 0 ]; then
-               return 1
+       for mac in $macs; do
+               local secname="$name"
+               if [ $macn -gt 1 ] ; then
+                       secname="${name}-${mac//:}"
+               fi
+               echo "host $secname {"
+               echo " hardware ethernet $mac;"
+               echo " fixed-address $ip;"
+               echo " option host-name \"$name\";"
+               if [ "$broadcast" -eq 1 ] ; then
+                       echo " always-broadcast true;"
+               fi
+               if [ -n "$leasetime" ] ; then
+                       echo " default-lease-time $leasetime;"
+                       echo " max-lease-time $leasetime;"
+               fi
+               if [ -n "$hostid" ] ; then
+                       echo " option dhcp-client-identifier $hostid;"
+               fi
+               if [ -n "$dns" ] ; then
+                       echo " option domain-name-servers $dns;"
+               fi
+               if [ -n "$gateway" ] ; then
+                       echo " option routers $gateway;"
+               fi
+               echo "}"
+       done
+}
+
+static_hosts() {
+       config_foreach static_host_add host "$@"
+}
+
+gen_dhcp_subnet() {
+       echo "subnet $NETWORK netmask $NETMASK {"
+       echo " range $START $END;"
+       echo " option subnet-mask $netmask;"
+       if [ "$BROADCAST" != "0.0.0.0" ] ; then
+               echo " option broadcast-address $BROADCAST;"
+       fi
+       if [ "$dynamicdhcp" -eq 0 ] ; then
+               if [ "$authoritative" -eq 1 ] ; then
+                       echo " deny unknown-clients;"
+               else
+                       echo " ignore unknown-clients;"
+               fi
        fi
+       if [ -n "$leasetime" ] ; then
+               echo " default-lease-time $leasetime;"
+               echo " max-lease-time $leasetime;"
+       fi
+       echo " option routers $gateway;"
+       echo " option domain-name-servers $DNS;"
+       echo "}"
+}
+
+dhcpd_add() {
+       local cfg="$1"
+       local dhcp6range="::"
+       local dynamicdhcp end gateway ifname ignore leasetime limit net netmask
+       local proto networkid start subnet
+       local IP NETMASK BROADCAST NETWORK PREFIX DNS START END
+
+       config_get_bool ignore "$cfg" "ignore" 0
+       [ "$ignore" = "0" ] || return 0
+
+       config_get net "$cfg" "interface"
+       [ -n "$net" ] || return 0
+
+       config_get start "$cfg" "start"
+       [ -n "$start" ] || return 0
+
+       config_get limit "$cfg" "limit"
+       [ -n "$limit" ] || return 0
+
+       network_get_subnet subnet "$net" || return 0
+       network_get_device ifname "$net" || return 0
+       network_get_protocol proto "$net" || return 0
+
+       [ static = "$proto" ] || return 0
+
+       config_get_bool dynamicdhcp "$cfg" "dynamicdhcp" 1
+
+       dhcp_ifs="$dhcp_ifs $ifname"
+
+       eval "$(ipcalc.sh $subnet $start $limit)"
+
+       config_get netmask "$cfg" "netmask" "$NETMASK"
+       config_get leasetime "$cfg" "leasetime"
+       if [ -n "$leasetime" ] ; then
+               leasetime="$(time2seconds "$leasetime")"
+               [ "$?" -ne 0 ] && return 1
+       fi
+
+       if network_get_dnsserver dnsserver "$net" ; then
+               for dnsserv in $dnsserver ; do
+                       DNS="$DNS${DNS:+, }$dnsserv"
+               done
+       else
+               DNS="$IP"
+       fi
+
+       if ! network_get_gateway gateway "$net" ; then
+               gateway="$IP"
+       fi
+
+       gen_dhcp_subnet >> $config_file
+}
+
+general_config() {
+       local always_broadcast boot_unknown_clients log_facility
+       local default_lease_time max_lease_time
+       config_get_bool always_broadcast "isc_dhcpd" "always_broadcast" 0
+       config_get_bool authoritative "isc_dhcpd" "authoritative" 1
+       config_get_bool boot_unknown_clients "isc_dhcpd" "boot_unknown_clients" 1
+       config_get default_lease_time "isc_dhcpd" "default_lease_time" 3600
+       config_get max_lease_time "isc_dhcpd" "max_lease_time" 86400
+       config_get log_facility "isc_dhcpd" "log_facility"
+
+       [ $always_broadcast -eq 1 ] && echo "always-broadcast true;"
+       [ $authoritative -eq 1 ] && echo "authoritative;"
+       [ $boot_unknown_clients -eq 0 ] && echo "boot-unknown-clients false;"
+
+       default_lease_time="$(time2seconds "$default_lease_time")"
+       [ "$?" -ne 0 ] && return 1
+       max_lease_time="$(time2seconds "$max_lease_time")"
+       [ "$?" -ne 0 ] && return 1
+
+       if [ -n "$log_facility" ] ; then
+               echo "log-facility $log_facility;"
+       fi
+       echo "default-lease-time $default_lease_time;"
+       echo "max-lease-time $max_lease_time;"
+}
+
+start_service() {
+       if [ -n "$DHCPD_BOOT" ] ; then
+               return 0
+       fi
+
+       if [ ! -e $lease_file ] ; then
+               touch $lease_file
+       fi
+
+       dhcp_ifs=""
+
+       if [ -e "/etc/dhcpd.conf" ] ; then
+               config_file="/etc/dhcpd.conf"
+       else
+               . /lib/functions/network.sh
+
+               config_load dhcp
+               local authoritative
+               general_config > $config_file
+
+               config_foreach dhcpd_add dhcp
+
+               static_hosts >> $config_file
+
+               [ -z "$dhcp_ifs" ] && return 0
+       fi
+
+       procd_open_instance
+       procd_set_param command $PROG -q -f -cf $config_file -lf $lease_file $dhcp_ifs
+       procd_close_instance
+}
+
+boot() {
+       DHCPD_BOOT=1
+       start "$@"
+}
 
-       rm $pid_file
+service_triggers()
+{
+       procd_add_reload_trigger "dhcp"
+       procd_add_raw_trigger "interface.*" 3000 /etc/init.d/dhcpd reload
 }
index 27ce1e9300580f8b6227eacdf51014697232606a..664cc63cc6e7af825432ec55418f8db26379abc7 100644 (file)
@@ -1,30 +1,9 @@
-diff --git a/bind/Makefile.in b/bind/Makefile.in
-index bd784c6..5950d19 100644
 --- a/bind/Makefile.in
 +++ b/bind/Makefile.in
-@@ -85,13 +85,13 @@ bind2:
-               echo Bind export libraries already installed ;               \
-       else                                                                 \
-               echo Building BIND Export libraries - this takes some time. ;\
--              (cd ${bindsrcdir}/lib/export ;                               \
--                echo building in `pwd` ;                                   \
--                MAKE=${GMAKE} ${GMAKE} >> ${binddir}/build.log) ;          \
-+              (cd ${bindsrcdir}/lib/export/dns ;                           \
-+                echo building gen using ${BUILD_CC} in `pwd` ;             \
-+                $(MAKE) CC=${BUILD_CC} CFLAGS="-O2" LIBS="" gen) ;         \
-                                                                              \
-               echo Installing BIND Export libraries to ${binddir}. ;       \
-               (cd ${bindsrcdir}/lib/export ;                               \
--                MAKE=${GMAKE} ${GMAKE} install > ${binddir}/install.log) ; \
-+                $(MAKE) DESTDIR="" install > ${binddir}/build.log) ;       \
-       fi
- clean:
-@@ -100,6 +100,7 @@ clean:
+@@ -116,5 +116,6 @@ uninstall-bind: all
  
  # Include the following so that this Makefile is happy when the parent
  # tries to use them.
 +install-exec:
  
- distdir:
+ check distdir distclean dvi installcheck:
index ddef4f210d2f7aeb8b8a534b7cdf55ada9565777..c100f71c3aeb2d06be8a324aace718e7f89fa676 100644 (file)
@@ -1,19 +1,16 @@
 --- a/bind/Makefile.in
 +++ b/bind/Makefile.in
-@@ -63,8 +63,14 @@
-       else                                                            \
-               echo Configuring BIND Export libraries for DHCP. ;      \
+@@ -56,7 +56,12 @@ bind1:
+               echo Configuring BIND libraries for DHCP. ;             \
                rm -rf ${cleandirs} ${cleanfiles} ;                     \
--              (cd ${bindsrcdir} &&                                    \
+               (cd ${bindsrcdir} &&                                    \
 -                 ./configure ${bindconfig} > ${binddir}/configure.log); \
-+               (cd ${bindsrcdir} && export CC=${CROSS_CC} &&           \
-+                ./configure  --disable-atomic --disable-kqueue         \
++               export CC=${CROSS_CC} &&                               \
++                ./configure ${bindconfig} --disable-atomic             \
++               --disable-kqueue --disable-epoll --disable-kqueue      \
 +                --disable-epoll --disable-devpoll --without-openssl    \
-+                --without-libxml2 --enable-exportlib                   \
-+                --enable-threads=no                                    \
-+                --with-export-includedir=${binddir}/include            \
-+                --with-export-libdir=${binddir}/lib --with-gssapi=no   \
-+               --without-randomdev > ${binddir}/configure.log);       \
++                --without-libxml2 --disable-threads --without-gssapi   \
++                --without-randomdev > ${binddir}/configure.log);       \
        fi
  
  atf:
index aa0e1b97703f61e91f2bfdb4cba6b00d1ad39ebb..940846b5ca4beae37d3ec3e7065f81530e136e0b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2016 Dan Luedtke <mail@danrl.com>
+# Copyright (C) 2016-2017 Dan Luedtke <mail@danrl.com>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -7,19 +7,20 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=jool
-PKG_VERSION:=2016.12.17
-PKG_RELEASE:=1
+PKG_VERSION:=2018.01.17
+PKG_RELEASE:=2
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/NICMx/Jool.git
-PKG_SOURCE_VERSION:=66a791c90751d7941b08c142babe1deec73d0996
+PKG_SOURCE_VERSION:=9dfaf22e49f7905d94af9b73f9bee22c26d7dd4a
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=79b558561f06f3df01a541b1d39b7d3d88f91d0ee6b8ce3abf91ebbed737225a
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_DIR=$(KERNEL_BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 PKG_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
 
diff --git a/net/kadnode/Config.in b/net/kadnode/Config.in
new file mode 100644 (file)
index 0000000..4cf680a
--- /dev/null
@@ -0,0 +1,44 @@
+menu "Configuration"
+       depends on PACKAGE_kadnode
+
+config KADNODE_ENABLE_LPD
+       bool "Enable Local Peer Discovery"
+       depends on PACKAGE_kadnode
+       default y
+
+config KADNODE_ENABLE_CMD
+       bool "Enable Command Console"
+       depends on PACKAGE_kadnode
+       default y
+
+config KADNODE_ENABLE_DNS
+       bool "Enable the local DNS server"
+       depends on PACKAGE_kadnode
+       default y
+
+config KADNODE_ENABLE_TLS
+       bool "Enable TLS authentication support"
+       depends on PACKAGE_kadnode
+       default y
+
+config KADNODE_ENABLE_BOB
+       bool "Enable BOB authentication support"
+       depends on PACKAGE_kadnode
+       default y
+
+config KADNODE_ENABLE_UPNP
+       bool "Enable UPnP support to add port forwardings on other routers"
+       depends on PACKAGE_kadnode
+       default n
+
+config KADNODE_ENABLE_NATPMP
+       bool "Enable NAT-PMP support to add port forwardings on other routers"
+       depends on PACKAGE_kadnode
+       default n
+
+config KADNODE_ENABLE_DEBUG
+       bool "Build in debug mode"
+       depends on PACKAGE_kadnode
+       default n
+
+endmenu
diff --git a/net/kadnode/Makefile b/net/kadnode/Makefile
new file mode 100644 (file)
index 0000000..9692dfe
--- /dev/null
@@ -0,0 +1,94 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+
+PKG_NAME:=kadnode
+PKG_VERSION:=2.2.0
+PKG_RELEASE:=1
+
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/mwarning/KadNode
+PKG_SOURCE_VERSION:=c63e734950787d35c8bf1363448430942d1bb39d
+PKG_MIRROR_HASH:=dcecfb14169ac5c4c28bcf147681f6823aa2d8a37d29d35ab3e76b613cce085c
+PKG_LICENSE:=MIT
+
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/kadnode
+       SECTION:=net
+       CATEGORY:=Network
+       TITLE:=P2P DNS Resolver
+       SUBMENU:=IP Addresses and Names
+       URL:=https://github.com/mwarning/KadNode
+       MENU:=1
+       DEPENDS:=+KADNODE_ENABLE_BOB:libmbedtls +KADNODE_ENABLE_TLS:libmbedtls +KADNODE_ENABLE_UPNP:libminiupnpc +KADNODE_ENABLE_NATPMP:libnatpmp
+       MAINTAINER:=Moritz Warning <moritzwarning@web.de>
+endef
+
+define Package/kadnode/description
+       A P2P DNS system based on the BitTorrent network. It can be used as a decentralized DynDNS service.
+endef
+
+define Package/kadnode/config
+       source "$(SOURCE)/Config.in"
+endef
+
+FEATURES = 
+
+ifeq ($(CONFIG_KADNODE_ENABLE_CMD),y)
+FEATURES += cmd
+endif
+
+ifeq ($(CONFIG_KADNODE_ENABLE_LPD),y)
+FEATURES += lpd
+endif
+
+ifeq ($(CONFIG_KADNODE_ENABLE_TLS),y)
+FEATURES += tls
+endif
+
+ifeq ($(CONFIG_KADNODE_ENABLE_BOB),y)
+FEATURES += bob
+endif
+
+ifeq ($(CONFIG_KADNODE_ENABLE_DNS),y)
+FEATURES += dns
+endif
+
+ifeq ($(CONFIG_KADNODE_ENABLE_UPNP),y)
+FEATURES += upnp
+endif
+
+ifeq ($(CONFIG_KADNODE_ENABLE_NATPMP),y)
+FEATURES += natpmp
+endif
+
+ifeq ($(CONFIG_KADNODE_ENABLE_DEBUG),y)
+FEATURES += debug
+endif
+
+MAKE_FLAGS += FEATURES="$(FEATURES)"
+
+define Package/kadnode/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/kadnode $(1)/usr/bin/
+ifeq ($(CONFIG_KADNODE_ENABLE_CMD),y)
+       $(LN) /usr/bin/kadnode $(1)/usr/bin/kadnode-ctl
+endif
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) files/kadnode.init $(1)/etc/init.d/kadnode
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) files/kadnode.config $(1)/etc/config/kadnode
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) files/kadnode.postinst $(1)/etc/uci-defaults/99_kadnode
+endef
+
+$(eval $(call BuildPackage,kadnode))
diff --git a/net/kadnode/files/kadnode.config b/net/kadnode/files/kadnode.config
new file mode 100755 (executable)
index 0000000..3a79fc5
--- /dev/null
@@ -0,0 +1,58 @@
+##
+## KadNode is a P2P DNS resolver to resolve domains using the BitTorrent network.
+##
+
+config kadnode
+       option enabled 1
+
+
+## ECC Key usage:
+## 1. Create public/secret key pair with `kadnode --bob-create-key /etc/kadnode_secret.pem`
+## 2. Put the secret key file on the router that you want to resolve to and use it for option bob_load_key.
+## 3. Use the public key hex output with .p2p attached on other devices to resovle to the router IP address via kadnode.
+
+## Secret key for public key links
+#      list bob_load_key '/etc/kadnode_secret.pem'
+
+
+## TLS usage:
+## For resolving domains, put credentials on the router and use option tls_client_cert.
+## For announcing domains, put the certificates and secret key on router and use option tls_server_cert.
+
+## Folder of CA certificates
+## Install package 'ca-certificates' for the official CA set.
+#      list tls_client_cert '/etc/ssl/certs'
+
+## Server credentials
+#      list tls_server_cert '/ect/mynode.crt,/etc/mynode.key'
+
+
+## Add domains to be announced.
+## Note: Only needed in special situations since tls_server_cert and bob_load_key announce automatically its associated domains.
+#      list announce 'web.myname.p2p'
+
+## Load and store good nodes every 24h and on start/shutdown.
+#      option peerfile '/etc/kadnode/peers.txt'
+
+## Add static peers addresses.
+       list peer 'bttracker.debian.org:6881'
+       list peer 'router.bittorrent.com:6881'
+
+## Bind the DHT to this port.
+#      option port '6881'
+
+## Limit DHT communication to this interface.
+#      option ifname 'eth0'
+
+## Verbosity: quiet, verbose or debug
+#      option verbosity 'quiet'
+
+## Local port to accept forwarded requests.
+#      option dns_port '3535'
+
+## Disable multicast peer discovery on the LAN.
+#      option lpd_disable '1'
+
+## Disable port forwarding when this router is behind another
+## router in a private network that supports UPnP/NAT-PMP.
+#      option fwd_disable '1'
diff --git a/net/kadnode/files/kadnode.init b/net/kadnode/files/kadnode.init
new file mode 100755 (executable)
index 0000000..fb2ad50
--- /dev/null
@@ -0,0 +1,96 @@
+#!/bin/sh /etc/rc.common
+
+START=95
+USE_PROCD=1
+PROG=/usr/bin/kadnode
+OPTS=""
+
+
+boot()
+{
+       # Wait for the loopback interface to be ready
+       ubus -t 30 wait_for network.interface network.loopback 2>/dev/null
+       rc_procd start_service
+}
+
+xappend() {
+       local name="$2" value="$1"
+       OPTS="$OPTS--${name//_/-} ${value//'/\\'}
+"
+}
+
+append_opts_list() {
+       local name cfg="$1"; shift
+       for name in $*; do
+               config_list_foreach "$cfg" "$name" xappend "$name"
+       done
+}
+
+append_opts() {
+       local name value cfg="$1"; shift
+       for name in $*; do
+               config_get value "$cfg" "$name"
+               [ -n "$value" ] && xappend "$value" "$name"
+       done
+}
+
+append_opts_boolean() {
+       local name value cfg="$1"; shift
+       for name in $*; do
+               config_get_bool value "$cfg" "$name" 0
+               [ $value -gt 0 ] && xappend '' $name
+       done
+}
+
+section_enabled() {
+       config_get_bool enabled "$1" 'enabled' 0
+       [ $enabled -gt 0 ]
+}
+
+start_instance() {
+       local cfg="$1"
+       local CONFIG_FILE=/tmp/kadnode.${cfg}.conf
+
+       section_enabled "$cfg" || return
+
+       OPTS=""
+
+       append_opts "$cfg" lpd_addr dns_server dns_port verbosity peerfile config \
+               query_tld user port ifname cmd_port
+
+       append_opts_list "$cfg" announce peer tls_client_cert tls_server_cert bob_load_key
+
+       append_opts_boolean "$cfg" dns_proxy_enable lpd_disable fwd_disable ipv4 ipv6
+
+       # Close stdin when cmd feature is present
+       if [ $($PROG --version | grep -c cmd) -eq 1 ]; then
+               xappend "" "cmd_disable_stdin"
+       fi
+
+       echo "$OPTS" > $CONFIG_FILE
+
+       procd_open_instance
+       procd_set_param command $PROG
+       procd_set_param file $CONFIG_FILE
+       procd_set_param stderr 1
+       procd_set_param stdout 1
+       procd_append_param command --config $CONFIG_FILE
+       procd_close_instance
+}
+
+stop_instance() {
+       local cfg="$1"
+       local CONFIG_FILE=/tmp/kadnode.${cfg}.conf
+
+       rm -f $CONFIG_FILE
+}
+
+start_service() {
+       config_load 'kadnode'
+       config_foreach start_instance 'kadnode'
+}
+
+stop_service() {
+       config_load 'kadnode'
+       config_foreach stop_instance 'kadnode'
+}
diff --git a/net/kadnode/files/kadnode.postinst b/net/kadnode/files/kadnode.postinst
new file mode 100644 (file)
index 0000000..3190209
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+uci add_list dhcp.@dnsmasq[0].server='/p2p/::1#3535'
+uci commit dhcp
+
+exit 0
index 2eead1672015691f10d7fc28c4ad136c163cb59f..f5caa1f0bc0a6c3a970179bdbf78d9d832d49fa8 100644 (file)
@@ -8,17 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=keepalived
-PKG_VERSION:=1.2.19
+PKG_VERSION:=1.3.9
 PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= http://www.keepalived.org/software
-PKG_MD5SUM:=5c98b06639dd50a6bff76901b53febb6
-PKG_HASH:=32fbae732c1cd854cacd7a930d4a26f5bad6372cdecb5e3139f0c17e87493853
+PKG_HASH:=d5bdd25530acf60989222fd92fbfd596e06ecc356a820f4c1015708b76a8d4f3
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Ben Kelly <ben@benjii.net>
+PKG_MAINTAINER:=Ben Kelly <ben@benjii.net> \
+               Florian Eckert <fe@dev.tdt.de>
 
 PKG_INSTALL:=1
 
@@ -30,7 +30,13 @@ define Package/keepalived
   CATEGORY:=Network
   TITLE:=Failover and monitoring daemon for LVS clusters
   URL:=http://www.keepalived.org/
-  DEPENDS:=+PACKAGE_libnl-genl:libnl-genl +libopenssl
+  DEPENDS:= \
+    +PACKAGE_libnl-genl:libnl-genl \
+    +libopenssl \
+    +libip4tc \
+    +IPV6:libip6tc \
+    +libxtables \
+    +kmod-macvlan
 endef
 
 define Package/keepalived/description
@@ -39,17 +45,15 @@ endef
 
 define Package/keepalived/conffiles
 /etc/keepalived/keepalived.conf
+/etc/config/keepalived
+/etc/keepalived.user
 endef
 
 CONFIGURE_ARGS+= \
-       --enable-vrrp \
-       --enable-fwmark \
        --enable-sha1 \
        --disable-lvs \
        --disable-lvs-syncd \
        --disable-snmp \
-       --disable-debug \
-       --disable-profile \
        --with-kernel-dir="$(LINUX_DIR)/$(LINUX_UAPI_DIR)"
 
 MAKE_FLAGS += \
@@ -66,6 +70,10 @@ define Package/keepalived/install
        $(INSTALL_BIN) ./files/keepalived.init $(1)/etc/init.d/keepalived
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_CONF) ./files/keepalived.config $(1)/etc/config/keepalived
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) ./files/keepalived.user $(1)/etc/keepalived.user
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/keepalived
+       $(INSTALL_DATA) ./files/hotplug-user $(1)/etc/hotplug.d/keepalived/01-user
 endef
 
 $(eval $(call BuildPackage,keepalived))
diff --git a/net/keepalived/files/hotplug-user b/net/keepalived/files/hotplug-user
new file mode 100644 (file)
index 0000000..329a8d5
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+[ -f "/etc/keepalived.user" ] && {
+       /bin/sh /etc/keepalived.user "$@"
+}
+
+exit 0
index b2ad5f9fbd1e2baa6885cadb8d8795b42d98283b..7279381a81f7f74089bd29462135fe87a1d8acd1 100644 (file)
@@ -1,5 +1,5 @@
 config global_defs
-       option alt_config_file          "/etc/keepalived/keepalived.conf"
+#      option alt_config_file          "/etc/keepalived/keepalived.conf"
 #      list notification_email         "acassen@firewall.loc"
 #      list notification_email         "failover@firewall.loc"
 #      list notification_email         "sysadmin@firewall.loc"
index 6e850f02d8f5c80f3b39ae7e742dd1e2877ab363..49c64f0160eb88b6e74bd76a1ff395f9677d265e 100644 (file)
@@ -49,7 +49,14 @@ print_elems_indent() {
                eval optval=\$$opt
                [ -z "$optval" ] && continue
                printf "$indent$opt" >> $KEEPALIVED_CONF
-               [ "$no_val" == "0" ] && printf " $optval" >> $KEEPALIVED_CONF
+               [ "$no_val" == "0" ] && {
+                       local words=$(echo "$optval" | wc -w)
+                       if [ $words -gt 1 ]; then
+                               printf " \"$optval\"" >> $KEEPALIVED_CONF
+                       else
+                               printf " $optval" >> $KEEPALIVED_CONF
+                       fi
+               }
                printf "\n" >> $KEEPALIVED_CONF
        done
        unset optval
@@ -72,6 +79,18 @@ print_list_indent() {
        printf "$indent}\n" >> $KEEPALIVED_CONF
 }
 
+print_notify() {
+       local type=$1
+       shift
+       local name=$1
+       shift
+       for notify in $*; do
+               printf "$INDENT_1$notify" >> $KEEPALIVED_CONF
+               notify=$(echo $notify | tr 'a-z' 'A-Z')
+               printf " \"/bin/busybox env -i ACTION=$notify TYPE=$type NAME=$name /sbin/hotplug-call keepalived\"\n" >> $KEEPALIVED_CONF
+       done
+}
+
 global_defs() {
        local linkbeat_use_polling notification_email
 
@@ -104,13 +123,17 @@ print_ipaddress_indent() {
        # Default indent
        [ -z "$indent" ] && indent=$INDENT_1
 
-       # If no address or device exit
-       [ -z "$address" -o -z "$device" ] && return 0
+       # If no address exit
+       [ -z "$address" ] && return 0
 
-       # Add IP address/netmask and device
-       printf "$indent$address dev $device" >> $KEEPALIVED_CONF
-       # Add scope
-       [ -n "$scope" ] && printf " scope $scope" >> $KEEPALIVED_CONF
+       if [ -z "$device" ]; then
+               printf "$indent$address" >> $KEEPALIVED_CONF
+       else
+               # Add IP address/netmask and device
+               printf "$indent$address dev $device" >> $KEEPALIVED_CONF
+               # Add scope
+               [ -n "$scope" ] && printf " scope $scope" >> $KEEPALIVED_CONF
+       fi
 
        printf "\n" >> $KEEPALIVED_CONF
 }
@@ -235,8 +258,11 @@ vrrp_sync_group() {
        group="$valid_group"
        print_list_indent group
 
-       print_elems_indent $1 $INDENT_1 notify_backup notify_master notify_fault \
-               notify no_val_smtp_alert no_val_global_tracking
+       print_elems_indent $1 $INDENT_1 no_val_smtp_alert no_val_global_tracking
+
+       print_notify "GROUP" "$name" notify_backup notify_master \
+               notify_fault notify
+
        config_section_close
 }
 
@@ -257,14 +283,17 @@ vrrp_instance() {
                printf "$INDENT_1}\n" >> $KEEPALIVED_CONF
        }
 
-       print_elems_indent $1 $INDENT_1 use_vmac state interface \
+       print_elems_indent $1 $INDENT_1 state interface \
                mcast_src_ip unicast_src_ip virtual_router_id version priority \
-               advert_int preempt_delay debug notify_backup \
-               notify_master notify_fault notify_stop notify \
+               advert_int preempt_delay debug \
                lvs_sync_daemon_interface garp_master_delay garp_master_refresh \
                garp_master_repeat garp_master_refresh_repeat \
                no_val_vmac_xmit_base no_val_native_ipv6 no_val_accept \
-               no_val_dont_track_primary no_val_smtp_alert no_val_nopreempt
+               no_val_dont_track_primary no_val_smtp_alert no_val_nopreempt \
+               no_val_use_vmac
+
+       print_notify "INSTANCE" "$name" notify_backup notify_master \
+               notify_fault notify_stop
 
        # Handle virtual_ipaddress & virtual_ipaddress_excluded lists
        for opt in virtual_ipaddress virtual_ipaddress_excluded; do
@@ -290,8 +319,8 @@ vrrp_instance() {
                printf "$INDENT_1}\n" >> $KEEPALIVED_CONF
        done
 
-       # Handle track_interface & track_script lists
-       for opt in track_interface track_script; do
+       # Handle track_script lists
+       for opt in track_script; do
                config_get $opt $1 $opt
                eval optval=\$$opt
                [ -z "$optval" ] && continue
@@ -302,6 +331,18 @@ vrrp_instance() {
                printf "$INDENT_1}\n" >> $KEEPALIVED_CONF
        done
 
+       # Handle track_interface lists
+       for opt in track_interface; do
+               config_get $opt $1 $opt
+               eval optval=\$$opt
+               [ -z "$optval" ] && continue
+               printf "$INDENT_1$opt {\n" >> $KEEPALIVED_CONF
+               for t in $optval; do
+                       config_foreach print_track_elem_indent track_interface $t $INDENT_2
+               done
+               printf "$INDENT_1}\n" >> $KEEPALIVED_CONF
+       done
+
        # Handle simple lists of strings (with no spaces in between)
        for opt in unicast_peer; do
                config_get $opt $1 $opt
@@ -331,7 +372,8 @@ process_config() {
        rm -f $KEEPALIVED_CONF
 
        # First line
-       printf "! Configuration File for keepalived (autogenerated via init script)\n\n" > $KEEPALIVED_CONF
+       printf "! Configuration file for keepalived (autogenerated via init script)\n" > $KEEPALIVED_CONF
+       printf "! Written %s\n\n" "$(date +'%c')" >> $KEEPALIVED_CONF
 
        [ -f /etc/config/keepalived ] || return 0
        config_load 'keepalived'
@@ -362,31 +404,14 @@ process_config() {
        return 0
 }
 
-service_running() {
-       pgrep -x /usr/sbin/keepalived &> /dev/null
-}
-
-conf_md5() {
-       echo "$(md5sum $KEEPALIVED_CONF | awk '{print $1}')"
+service_triggers() {
+       procd_add_reload_trigger "keepalived"
 }
 
 reload_service() {
-       local cur_md5="$(conf_md5)"
-       running && {
-               process_config
-
-               # Return without performing the reload if config
-               # file md5sum has not changed
-               local new_md5="$(conf_md5)"
-               [ "$new_md5" == "$cur_md5" ] && return 0;
-
-               # SIGHUP is used by keepalived to do init.d reload
-               # Get the oldest process (assumption is that it's the parent process)
-               PID=$(pgrep -o /usr/sbin/keepalived)
-               kill -SIGHUP $PID
-               return 0
-       }
-       return 1
+       process_config
+       #SIGHUP is used by keepalived to do init.d reload
+       procd_send_signal keepalived
 }
 
 start_service() {
diff --git a/net/keepalived/files/keepalived.user b/net/keepalived/files/keepalived.user
new file mode 100644 (file)
index 0000000..283f53a
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# This file is interpreted as a shell script.
+# The first line of the script must be "#!/bin/sh" without quotes.
+# Lines beginning with # are comments and are not executed.
+#
+# There are three environment arguments that are passed to this script.
+#
+# $TYPE Set to INSTANCE or GROUP, depending on whether keepalived invoked the program from vrrp_instance or vrrp_sync_group.
+# $NAME Set to the name of the vrrp_instance or vrrp_sync_group.
+# $ACTION Set to the end state of the transition.
+# Valid values are:
+#     $TYPE==INSTANCE: [ NOTIFY_BACKUP | NOTIFY_MASTER | NOTIFY_FAULT | NOTIFY_STOP | NOTIFY ]
+#     $TYPE==GROUP: [ NOTIFY_BACKUP | NOTIFY_MASTER | NOTIFY_FAULT | NOTIFY ]
diff --git a/net/keepalived/patches/101-0001-vrrp-update-struct-msghdr.patch b/net/keepalived/patches/101-0001-vrrp-update-struct-msghdr.patch
deleted file mode 100644 (file)
index a18507c..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-From dbb2cac9139954bd18813e88bfcb622ad3e93c54 Mon Sep 17 00:00:00 2001
-From: Stijn Tintel <stijn@linux-ipv6.be>
-Date: Tue, 10 May 2016 04:26:31 +0300
-Subject: [PATCH] vrrp: update struct msghdr
-
-The vrrp netlink code assumes an order for the members of struct msghdr.
-This breaks recvmsg and sendmsg with musl libc on mips64. Fix this by
-using designated initializers instead.
-
-Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
----
- keepalived/vrrp/vrrp_netlink.c | 15 ++++++++++++---
- 1 file changed, 12 insertions(+), 3 deletions(-)
-
-diff --git a/keepalived/vrrp/vrrp_netlink.c b/keepalived/vrrp/vrrp_netlink.c
-index b19e2e7..2c2fd59 100644
---- a/keepalived/vrrp/vrrp_netlink.c
-+++ b/keepalived/vrrp/vrrp_netlink.c
-@@ -416,8 +416,12 @@ netlink_parse_info(int (*filter) (struct sockaddr_nl *, struct nlmsghdr *),
-               char buf[4096];
-               struct iovec iov = { buf, sizeof buf };
-               struct sockaddr_nl snl;
--              struct msghdr msg =
--                  { (void *) &snl, sizeof snl, &iov, 1, NULL, 0, 0 };
-+              struct msghdr msg = {
-+                      .msg_name = &snl,
-+                      .msg_namelen = sizeof(snl),
-+                      .msg_iov = &iov,
-+                      .msg_iovlen = 1,
-+              };
-               struct nlmsghdr *h;
-               status = recvmsg(nl->fd, &msg, 0);
-@@ -538,7 +542,12 @@ netlink_talk(nl_handle_t *nl, struct nlmsghdr *n)
-       int ret, flags;
-       struct sockaddr_nl snl;
-       struct iovec iov = { (void *) n, n->nlmsg_len };
--      struct msghdr msg = { (void *) &snl, sizeof snl, &iov, 1, NULL, 0, 0 };
-+      struct msghdr msg = {
-+              .msg_name = &snl,
-+              .msg_namelen = sizeof(snl),
-+              .msg_iov = &iov,
-+              .msg_iovlen = 1,
-+      };
-       memset(&snl, 0, sizeof snl);
-       snl.nl_family = AF_NETLINK;
--- 
-2.10.2
-
diff --git a/net/keepalived/patches/101-0002-Reinstate-initialisation-of-msghdr-fields.patch b/net/keepalived/patches/101-0002-Reinstate-initialisation-of-msghdr-fields.patch
deleted file mode 100644 (file)
index cf97513..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From eaabcc1b09cccff2f8815d03da4d5778ab6bbd17 Mon Sep 17 00:00:00 2001
-From: Quentin Armitage <quentin@armitage.org.uk>
-Date: Mon, 16 May 2016 23:09:13 +0100
-Subject: [PATCH] Reinstate initialisation of msghdr fields
-
-Commit dbb2cac removed initialisation of the struct msghdr msg_control,
-msg_controllen and msg_flags fields. This commit reinstates initialisation
-of those fields.
-
-Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
----
- keepalived/vrrp/vrrp_netlink.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/keepalived/vrrp/vrrp_netlink.c b/keepalived/vrrp/vrrp_netlink.c
-index 2c2fd59..62c37d6 100644
---- a/keepalived/vrrp/vrrp_netlink.c
-+++ b/keepalived/vrrp/vrrp_netlink.c
-@@ -421,6 +421,9 @@ netlink_parse_info(int (*filter) (struct sockaddr_nl *, struct nlmsghdr *),
-                       .msg_namelen = sizeof(snl),
-                       .msg_iov = &iov,
-                       .msg_iovlen = 1,
-+                      .msg_control = NULL,
-+                      .msg_controllen = 0,
-+                      .msg_flags = 0
-               };
-               struct nlmsghdr *h;
-@@ -547,6 +550,9 @@ netlink_talk(nl_handle_t *nl, struct nlmsghdr *n)
-               .msg_namelen = sizeof(snl),
-               .msg_iov = &iov,
-               .msg_iovlen = 1,
-+              .msg_control = NULL,
-+              .msg_controllen = 0,
-+              .msg_flags = 0
-       };
-       memset(&snl, 0, sizeof snl);
--- 
-2.10.2
-
index 25e32b1df252dd0c5c47b23304fec1593f7d9707..97f56fe8905d5d8a987280db34ea5a9810176f64 100644 (file)
@@ -15,9 +15,7 @@ PKG_LICENSE:=LGPLv2.1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.kismetwireless.net/code
-PKG_MD5SUM:=7fa6e86c5078a0e7d91fc9bf954c5107
-
-PKG_BUILD_DEPENDS:=libpcap libncurses libpcre
+PKG_HASH:=bdb21f153311f1ff3b16621bf0d6740f66369bf0982b0a289c9a12af8847e237
 
 include $(INCLUDE_DIR)/uclibc++.mk
 include $(INCLUDE_DIR)/package.mk
index 920122a2fe577a84a222456de7e24ccd2a7c263b..48c1e28ec9183d9100860151c1d7bc7bb109e28a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2014-2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+# Copyright (C) 2014-2018 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 #
 # 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:=knot
-PKG_VERSION:=2.3.0
+PKG_VERSION:=2.6.5
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-dns/
-PKG_MD5SUM:=7ca754f972fb07faa4f30e50d8a4385b
+PKG_HASH:=33cd676706e2baeb37cf3879ccbc91a1e1cd1ee5d7a082adff4d1e753ce49d46
 
 PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
 PKG_LICENSE:=GPL-3.0 LGPL-2.0 0BSD MIT OLDAP-2.8
@@ -28,6 +28,7 @@ define Package/knot-lib/Default
        SECTION:=libs
        CATEGORY:=Libraries
        TITLE:=Knot DNS
+       DEPENDS=+libpthread
        URL:=https://www.knot-dns.cz
 endef
 
@@ -36,85 +37,81 @@ define Package/knot/Default
        CATEGORY:=Network
        SUBMENU:=IP Addresses and Names
        TITLE:=Knot DNS
+       DEPENDS=+libatomic
        URL:=https://www.knot-dns.cz
-       USERID:=knot=5353:knot=5353
-endef
-
-define Package/knot-libdnssec
-       $(call Package/knot-lib/Default)
-       TITLE+= DNSSEC library
-       DEPENDS=+libpthread +libgnutls +jansson
 endef
 
-define Package/knot-libknot
+define Package/knot-libs
        $(call Package/knot-lib/Default)
-       TITLE+= library
-       DEPENDS=+libpthread +knot-libdnssec
+       TITLE+= common DNS and DNSSEC libraries
+       DEPENDS+=+libgnutls
 endef
 
 define Package/knot-libzscanner
        $(call Package/knot-lib/Default)
        TITLE+= zone parser library
-       DEPENDS=+libpthread
 endef
 
 define Package/knot
        $(call Package/knot/Default)
-       TITLE+= server
-       DEPENDS=+liburcu +libedit +knot-libdnssec +knot-libknot +knot-libzscanner
+       TITLE+= server with control utility
+       DEPENDS+=+libedit +liburcu +knot-libs +knot-libzscanner
+       EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
+                      knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
+       USERID:=knot=5353:knot=5353
 endef
 
 define Package/knot-dig
        $(call Package/knot/Default)
        TITLE+= advanced DNS lookup utility
-       DEPENDS=+knot-libdnssec +knot-libknot
+       DEPENDS+=+libedit +knot-libs
+       EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE))
 endef
 
 define Package/knot-host
        $(call Package/knot/Default)
        TITLE+= simple DNS lookup utility
-       DEPENDS=+knot-libdnssec +knot-libknot
+       DEPENDS+=+libedit +knot-libs
+       EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE))
 endef
 
 define Package/knot-nsupdate
        $(call Package/knot/Default)
        TITLE+= dynamic DNS update utility
-       DEPENDS=+knot-libdnssec +knot-libknot +knot-libzscanner
-endef
-
-define Package/knot-nsec3hash
-       $(call Package/knot/Default)
-       TITLE+= simple NSEC3 hash utility
-       DEPENDS=+knot-libdnssec
+       DEPENDS+=+libedit +knot-libs +knot-libzscanner
+       EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
+                      knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
 endef
 
 define Package/knot-zonecheck
        $(call Package/knot/Default)
        TITLE+= zonefile check utility
-       DEPENDS=+liburcu +knot-libdnssec +knot-libknot +knot-libzscanner
+       DEPENDS+=+libedit +liburcu +knot-libs +knot-libzscanner
+       EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
+                      knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
 endef
 
 define Package/knot-keymgr
        $(call Package/knot/Default)
        TITLE+= DNSSEC key management utility
-       DEPENDS=+liburcu +knot-libdnssec +knot-libknot +knot-libzscanner
+       DEPENDS+=+libedit +liburcu +knot-libs +knot-libzscanner
+       EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
+                      knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
 endef
 
 define Package/knot-tests
        $(call Package/knot/Default)
        TITLE+= tests
-       DEPENDS=+liburcu +libedit +knot-libdnssec +knot-libknot +knot-libzscanner
+       DEPENDS+=+libedit +liburcu +knot-libs +knot-libzscanner
+       EXTRA_DEPENDS:=knot-libs (=$(PKG_VERSION)-$(PKG_RELEASE)), \
+                      knot-libzscanner (=$(PKG_VERSION)-$(PKG_RELEASE))
 endef
 
-define Package/knot-libdnssec/description
-       Knot DNS DNSSEC library.
+define Package/knot-libs/description
+       Knot DNS common DNS and DNSSEC libraries.
 endef
 
-define Package/knot-libknot/description
-       Knot DNS library.
-endef
-
-define Package/knot-libdnssec/description
+define Package/knot-libzscanner/description
        Knot DNS zone parser library.
 endef
 
@@ -134,10 +131,6 @@ define Package/knot-nsupdate/description
        Knot DNS dynamic DNS update utility.
 endef
 
-define Package/knot-nsec3hash/description
-       Knot DNS simple NSEC3 hash utility.
-endef
-
 define Package/knot-zonecheck/description
        Knot DNS zonefile check utility.
 endef
@@ -158,8 +151,7 @@ CONFIGURE_ARGS +=                   \
        --with-rundir=/var/run/knot     \
        --with-storage=/var/lib/knot    \
        --with-configdir=/etc/knot      \
-       --with-timer-mapsize=50         \
-       --with-conf-mapsize=50
+       --with-conf-mapsize=20
 
 TARGET_CFLAGS += -DPSELECT_COMPAT -DNDEBUG
 
@@ -192,13 +184,9 @@ define Build/InstallDev
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc       $(1)/usr/lib/pkgconfig/
 endef
 
-define Package/knot-libdnssec/install
+define Package/knot-libs/install
        $(INSTALL_DIR)                                          $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnssec.so.*         $(1)/usr/lib/
-endef
-
-define Package/knot-libknot/install
-       $(INSTALL_DIR)                                          $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libknot.so.*           $(1)/usr/lib/
 endef
 
@@ -235,14 +223,9 @@ define Package/knot-nsupdate/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate     $(1)/usr/bin/
 endef
 
-define Package/knot-nsec3hash/install
-       $(INSTALL_DIR)                                          $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsec3hash    $(1)/usr/bin/
-endef
-
 define Package/knot-zonecheck/install
        $(INSTALL_DIR)                                          $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kzonecheck   $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kzonecheck    $(1)/usr/bin/
 endef
 
 define Package/knot-keymgr/install
@@ -258,50 +241,35 @@ define Package/knot-tests/install
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/runtests         $(1)/usr/share/knot/tap/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/tap/libtap.sh    $(1)/usr/share/knot/tap/
 
-       $(INSTALL_DIR)                                                                  $(1)/usr/share/knot/tests
-       find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
-               xargs -I{} basename {} | \
-               xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{}            $(1)/usr/share/knot/tests/test_{}
-
-       $(INSTALL_DIR)                                                                  $(1)/usr/share/knot/tests/dnssec
-       find $(PKG_BUILD_DIR)/src/dnssec/tests -maxdepth 1 -executable -type f | \
-               xargs -I{} basename {} | \
-               xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/src/dnssec/tests/{}       $(1)/usr/share/knot/tests/dnssec/test_{}
-
-       $(INSTALL_DIR)                                                                  $(1)/usr/share/knot/tests/contrib
-       find $(PKG_BUILD_DIR)/tests/contrib/.libs -maxdepth 1 -executable -type f | \
-               xargs -I{} basename {} | \
-               xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/contrib/.libs/{}    $(1)/usr/share/knot/tests/contrib/{}
+       $(INSTALL_DIR)                                                          $(1)/usr/share/knot/tests
 
-       $(INSTALL_DIR)                                                                  $(1)/usr/share/knot/tests/libknot
-       find $(PKG_BUILD_DIR)/tests/libknot/.libs -maxdepth 1 -executable -type f | \
-               xargs -I{} basename {} | \
-               xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/libknot/.libs/{}    $(1)/usr/share/knot/tests/libknot/{}
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/.libs/zscanner-tool  $(1)/usr/share/knot/tests/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/unittests            $(1)/usr/share/knot/tests/test_zscanner
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/zscanner/tests/TESTS               $(1)/usr/share/knot/tests/
+       cp -a $(PKG_BUILD_DIR)/src/zscanner/tests/data                          $(1)/usr/share/knot/tests/
 
-       $(INSTALL_DIR)                                                                  $(1)/usr/share/knot/tests/modules
-       find $(PKG_BUILD_DIR)/tests/modules/.libs -maxdepth 1 -executable -type f | \
+       find $(PKG_BUILD_DIR)/src/dnssec/tests -maxdepth 1 -executable -type f | \
                xargs -I{} basename {} | \
-               xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/modules/.libs/{}    $(1)/usr/share/knot/tests/modules/test_{}
+               xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/src/dnssec/tests/{}       $(1)/usr/share/knot/tests/dnssec_test_{}
 
-       $(INSTALL_DIR)                                                                  $(1)/usr/share/knot/tests/utils
-       find $(PKG_BUILD_DIR)/tests/utils/.libs -maxdepth 1 -executable -type f | \
+       find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
                xargs -I{} basename {} | \
-               xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/utils/.libs/{}      $(1)/usr/share/knot/tests/utils/{}
+               xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{}            $(1)/usr/share/knot/tests/{}
 
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/.libs/zscanner-tool  $(1)/usr/share/knot/tests/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/unittests            $(1)/usr/share/knot/tests/test_zscanner
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/zscanner/tests/TESTS               $(1)/usr/share/knot/tests/
-       cp -a $(PKG_BUILD_DIR)/src/zscanner/tests/data                          $(1)/usr/share/knot/tests/
+       for module in contrib libknot modules utils; do \
+               find $(PKG_BUILD_DIR)/tests/$$$${module}/.libs -maxdepth 1 -executable -type f | \
+                       xargs -I{} basename {} | \
+                       xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/$$$${module}/.libs/{} \
+                                                                                       $(1)/usr/share/knot/tests/$$$${module}_{}; \
+       done
 endef
 
-$(eval $(call BuildPackage,knot-libdnssec))
-$(eval $(call BuildPackage,knot-libknot))
+$(eval $(call BuildPackage,knot-libs))
 $(eval $(call BuildPackage,knot-libzscanner))
 $(eval $(call BuildPackage,knot))
 $(eval $(call BuildPackage,knot-dig))
 $(eval $(call BuildPackage,knot-host))
 $(eval $(call BuildPackage,knot-nsupdate))
-$(eval $(call BuildPackage,knot-nsec3hash))
 $(eval $(call BuildPackage,knot-zonecheck))
 $(eval $(call BuildPackage,knot-keymgr))
 $(eval $(call BuildPackage,knot-tests))
index e70c76b32a0f065551555502698ecb25c1ba5fde..b0b772eebe8a056553b2740778a911b78cf19850 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 cd `dirname "$0"`/tests
-../tap/runtests -b /tmp ./contrib/test_* ./dnssec/test_* ./libknot/test_* ./modules/test_* ./utils/test_* ./test_*
+../tap/runtests -b /tmp ./*test_*
 ret=$?
 cd -
 
index 215b09fbed153bb0930845a87f29395e2ac2858d..54ad80b75f04205d7ba96fde66fef98e85b08020 100644 (file)
@@ -1,5 +1,5 @@
 diff --git a/samples/knot.sample.conf.in b/samples/knot.sample.conf.in
-index e07c8a7..ecc13ad 100644
+index e07c8a7..8e057b0 100644
 --- a/samples/knot.sample.conf.in
 +++ b/samples/knot.sample.conf.in
 @@ -9,7 +9,7 @@ server:
@@ -11,3 +11,14 @@ index e07c8a7..ecc13ad 100644
  
  log:
      # Log info and more serious events to syslog.
+@@ -33,7 +33,9 @@ acl:
+ #    action: notify
+ template:
+-#  - id: default
++   - id: default
++     max-journal-db-size: 20M
++     max-timer-db-size: 5M
+ #    storage: "@storage_dir@"
+ zone:
diff --git a/net/knot/patches/03_contrib_files.patch b/net/knot/patches/03_contrib_files.patch
deleted file mode 100644 (file)
index 02f5198..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/contrib/files.c b/src/contrib/files.c
-index 8aee482..12f36ca 100644
---- a/src/contrib/files.c
-+++ b/src/contrib/files.c
-@@ -24,6 +24,10 @@
- #include <sys/stat.h>
- #include <unistd.h>
-+#ifndef O_NOFOLLOW
-+#define O_NOFOLLOW 0
-+#endif
-+
- static bool special_name(const char *name)
- {
-       return strcmp(name, ".") == 0 || strcmp(name, "..") == 0;
diff --git a/net/knot/patches/04_cookies_big_endian.patch b/net/knot/patches/04_cookies_big_endian.patch
deleted file mode 100644 (file)
index 6838495..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-From 84849be189c49ef9556bd84d5e5103317372e8a7 Mon Sep 17 00:00:00 2001
-From: Karel Slany <karel.slany@nic.cz>
-Date: Thu, 11 Aug 2016 11:39:39 +0200
-Subject: [PATCH] Added conversion to wire format when writing FNV64 hash
- values.
-
-Test on big-endian machines have been failing.
----
- src/libknot/cookies/alg-fnv64.c     |  6 +++---
- tests/libknot/test_cookies-client.c | 20 ++++++++++----------
- tests/libknot/test_cookies-server.c | 20 ++++++++++----------
- 3 files changed, 23 insertions(+), 23 deletions(-)
-
-diff --git a/src/libknot/cookies/alg-fnv64.c b/src/libknot/cookies/alg-fnv64.c
-index 9989a4f..5e263c1 100644
---- a/src/libknot/cookies/alg-fnv64.c
-+++ b/src/libknot/cookies/alg-fnv64.c
-@@ -17,10 +17,10 @@
- #include <assert.h>
- #include <stdint.h>
- #include <stdlib.h>
--#include <string.h>
- #include "contrib/fnv/fnv.h"
- #include "contrib/sockaddr.h"
-+#include "contrib/wire.h"
- #include "libknot/attribute.h"
- #include "libknot/cookies/alg-fnv64.h"
- #include "libknot/rrtype/opt-cookie.h"
-@@ -80,7 +80,7 @@ static uint16_t cc_gen_fnv64(const struct knot_cc_input *input,
-       assert(KNOT_OPT_COOKIE_CLNT == sizeof(hash_val));
-       cc_len = sizeof(hash_val);
--      memcpy(cc_out, &hash_val, cc_len);
-+      wire_write_u64(cc_out, hash_val);
-       return cc_len;
- }
-@@ -127,7 +127,7 @@ static uint16_t sc_gen_fnv64(const struct knot_sc_input *input,
-       assert(SRVR_FNV64_HASH_SIZE == sizeof(hash_val));
-       hash_len = sizeof(hash_val);
--      memcpy(hash_out, &hash_val, hash_len);
-+      wire_write_u64(hash_out, hash_val);
-       return hash_len;
- }
-diff --git a/tests/libknot/test_cookies-client.c b/tests/libknot/test_cookies-client.c
-index 44be903..712dbba 100644
---- a/tests/libknot/test_cookies-client.c
-+++ b/tests/libknot/test_cookies-client.c
-@@ -110,7 +110,7 @@ int main(int argc, char *argv[])
-       hash_len = knot_cc_alg_fnv64.gen_func(&cc_in, hash, hash_len);
-       ok(hash_len != 0 && hash_len == knot_cc_alg_fnv64.cc_size, "cookies: FNV64 client cookie output");
-       {
--              uint8_t expected[] = { 0x74, 0x31, 0xf9, 0xa8, 0x03, 0xef, 0x15, 0xb1 };
-+              uint8_t expected[] = { 0xb1, 0x15, 0xef, 0x03, 0xa8, 0xf9, 0x31, 0x74 };
-               ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 client cookie content");
-       }
-@@ -123,7 +123,7 @@ int main(int argc, char *argv[])
-       hash_len = knot_cc_alg_fnv64.gen_func(&cc_in, hash, hash_len);
-       ok(hash_len != 0 && hash_len == knot_cc_alg_fnv64.cc_size, "cookies: FNV64 client cookie output");
-       {
--              uint8_t expected[] = { 0x7c, 0x62, 0x25, 0xd2, 0x43, 0xdd, 0x09, 0xe7 };
-+              uint8_t expected[] = { 0xe7, 0x09, 0xdd, 0x43, 0xd2, 0x25, 0x62, 0x7c };
-               ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 client cookie content");
-       }
-@@ -136,7 +136,7 @@ int main(int argc, char *argv[])
-       hash_len = knot_cc_alg_fnv64.gen_func(&cc_in, hash, hash_len);
-       ok(hash_len != 0 && hash_len == knot_cc_alg_fnv64.cc_size, "cookies: FNV64 client cookie output");
-       {
--              uint8_t expected[] = { 0x7c, 0x62, 0x25, 0xd2, 0x43, 0xdd, 0x09, 0xe7 };
-+              uint8_t expected[] = { 0xe7, 0x09, 0xdd, 0x43, 0xd2, 0x25, 0x62, 0x7c };
-               ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 client cookie content");
-       }
-@@ -149,7 +149,7 @@ int main(int argc, char *argv[])
-       hash_len = knot_cc_alg_fnv64.gen_func(&cc_in, hash, hash_len);
-       ok(hash_len != 0 && hash_len == knot_cc_alg_fnv64.cc_size, "cookies: FNV64 client cookie output");
-       {
--              uint8_t expected[] = { 0x05, 0xa9, 0xd1, 0x08, 0x1b, 0x98, 0xe0, 0xaa };
-+              uint8_t expected[] = { 0xaa, 0xe0, 0x98, 0x1b, 0x08, 0xd1, 0xa9, 0x05 };
-               ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 client cookie content");
-       }
-@@ -162,7 +162,7 @@ int main(int argc, char *argv[])
-       hash_len = knot_cc_alg_fnv64.gen_func(&cc_in, hash, hash_len);
-       ok(hash_len != 0 && hash_len == knot_cc_alg_fnv64.cc_size, "cookies: FNV64 client cookie output");
-       {
--              uint8_t expected[] = { 0x05, 0xa9, 0xd1, 0x08, 0x1b, 0x98, 0xe0, 0xaa };
-+              uint8_t expected[] = { 0xaa, 0xe0, 0x98, 0x1b, 0x08, 0xd1, 0xa9, 0x05 };
-               ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 client cookie content");
-       }
-@@ -179,7 +179,7 @@ int main(int argc, char *argv[])
-       }
-       {
--              uint8_t cookie[] = { 0x33, 0x0c, 0xa6, 0x80, 0x94, 0x17, 0xe5, 0xaf };
-+              uint8_t cookie[] = { 0xaf, 0xe5, 0x17, 0x94, 0x80, 0xa6, 0x0c, 0x33 };
-               ret = knot_cc_check(cookie, sizeof(cookie), NULL, &knot_cc_alg_fnv64);
-               ok(ret == KNOT_EINVAL, "cookies: FNV64 client cookie check no input");
-       }
-@@ -190,7 +190,7 @@ int main(int argc, char *argv[])
-       cc_in.secret_data = secret;
-       cc_in.secret_len = sizeof(secret);
-       {
--              uint8_t cookie[] = { 0x33, 0x0c, 0xa6, 0x80, 0x94, 0x17, 0xe5, 0xaf };
-+              uint8_t cookie[] = { 0xaf, 0xe5, 0x17, 0x94, 0x80, 0xa6, 0x0c, 0x33 };
-               ret = knot_cc_check(cookie, sizeof(cookie), &cc_in, NULL);
-               ok(ret == KNOT_EINVAL, "cookies: FNV64 client cookie check no algorithm");
-       }
-@@ -201,7 +201,7 @@ int main(int argc, char *argv[])
-       cc_in.secret_data = secret;
-       cc_in.secret_len = sizeof(secret);
-       {
--              uint8_t cookie[] = { 0x33, 0x0c, 0xa6, 0x80, 0x94, 0x17, 0xe5, 0xaf };
-+              uint8_t cookie[] = { 0xaf, 0xe5, 0x17, 0x94, 0x80, 0xa6, 0x0c, 0x33 };
-               ret = knot_cc_check(cookie, sizeof(cookie), &cc_in, &knot_cc_alg_fnv64);
-               ok(ret == KNOT_EOK, "cookies: FNV64 client good cookie check");
-       }
-@@ -212,7 +212,7 @@ int main(int argc, char *argv[])
-       cc_in.secret_data = secret;
-       cc_in.secret_len = sizeof(secret);
-       {
--              uint8_t cookie[] = { 0x33, 0x0c, 0xa6, 0x80, 0x94, 0x17, 0xe5, 0xaf };
-+              uint8_t cookie[] = { 0xaf, 0xe5, 0x17, 0x94, 0x80, 0xa6, 0x0c, 0x33 };
-               ret = knot_cc_check(cookie, sizeof(cookie) - 1, &cc_in, &knot_cc_alg_fnv64);
-               ok(ret == KNOT_EINVAL, "cookies: FNV64 client cookie check invalid length");
-       }
-@@ -223,7 +223,7 @@ int main(int argc, char *argv[])
-       cc_in.secret_data = secret;
-       cc_in.secret_len = sizeof(secret);
-       {
--              uint8_t cookie[] = { 0x33, 0x0c, 0xa6, 0x80, 0x94, 0x17, 0xe5, 0xae };
-+              uint8_t cookie[] = { 0xaf, 0xe5, 0x17, 0x94, 0x80, 0xa6, 0x0c, 0x32 };
-               ret = knot_cc_check(cookie, sizeof(cookie), &cc_in, &knot_cc_alg_fnv64);
-               ok(ret == KNOT_EINVAL, "cookies: FNV64 client cookie check invalid cookie");
-       }
-diff --git a/tests/libknot/test_cookies-server.c b/tests/libknot/test_cookies-server.c
-index 32001c1..66a54ba 100644
---- a/tests/libknot/test_cookies-server.c
-+++ b/tests/libknot/test_cookies-server.c
-@@ -28,10 +28,10 @@
- #include "libknot/rrtype/opt-cookie.h"
- const char *cookie_opts[] = {
--      "\x00\x0a" "\x00\x10" "\x00\x01\x02\x03\x04\x05\x06\x07" "\xe0\xd9\x95\x4e\xbc\xc3\x99\x18", /* 8 octets long wrong server cookie. */
--      "\x00\x0a" "\x00\x10" "\x00\x01\x02\x03\x04\x05\x06\x07" "\xe0\xd9\x95\x4e\xbc\xc3\x99\x19", /* 8 octets long OK server cookie. */
--      "\x00\x0a" "\x00\x18" "\x00\x01\x02\x03\x04\x05\x06\x07" "\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\xc0\xbd\xdb\xec\x19\x78\x88\x38", /* 8B nonce 8B hash long wrong server cookie. */
--      "\x00\x0a" "\x00\x18" "\x00\x01\x02\x03\x04\x05\x06\x07" "\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\xc0\xbd\xdb\xec\x19\x78\x88\x39" /* 8B nonce 8B hash long OK server cookie. */
-+      "\x00\x0a" "\x00\x10" "\x00\x01\x02\x03\x04\x05\x06\x07" "\x19\x99\xc3\xbc\x4e\x95\xd9\xdf", /* 8 octets long wrong server cookie. */
-+      "\x00\x0a" "\x00\x10" "\x00\x01\x02\x03\x04\x05\x06\x07" "\x19\x99\xc3\xbc\x4e\x95\xd9\xe0", /* 8 octets long OK server cookie. */
-+      "\x00\x0a" "\x00\x18" "\x00\x01\x02\x03\x04\x05\x06\x07" "\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x39\x88\x78\x19\xec\xdb\xbd\xbf", /* 8B nonce 8B hash long wrong server cookie. */
-+      "\x00\x0a" "\x00\x18" "\x00\x01\x02\x03\x04\x05\x06\x07" "\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x39\x88\x78\x19\xec\xdb\xbd\xc0"/* 8B nonce 8B hash long OK server cookie. */
- };
- #define ROPT(i) ((const uint8_t *)cookie_opts[(i)])
-@@ -193,7 +193,7 @@ int main(int argc, char *argv[])
-       hash_len = knot_sc_alg_fnv64.hash_func(&sc_in, hash, hash_len);
-       ok(hash_len != 0, "cookies: FNV64 server cookie output");
-       {
--              uint8_t expected[] = { 0x75, 0x45, 0x7c, 0x9a, 0xe0, 0x13, 0xa8, 0xea };
-+              uint8_t expected[] = { 0xea, 0xa8, 0x13, 0xe0, 0x9a, 0x7c, 0x45, 0x75 };
-               ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 server cookie content");
-       }
-@@ -210,7 +210,7 @@ int main(int argc, char *argv[])
-       hash_len = knot_sc_alg_fnv64.hash_func(&sc_in, hash, hash_len);
-       ok(hash_len != 0, "cookies: FNV64 server cookie output");
-       {
--              uint8_t expected[] = { 0xc0, 0xbd, 0xdb, 0xec, 0x19, 0x78, 0x88, 0x39 };
-+              uint8_t expected[] = { 0x39, 0x88, 0x78, 0x19, 0xec, 0xdb, 0xbd, 0xc0 };
-               ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 server cookie content");
-       }
-@@ -227,7 +227,7 @@ int main(int argc, char *argv[])
-       hash_len = knot_sc_alg_fnv64.hash_func(&sc_in, hash, hash_len);
-       ok(hash_len != 0, "cookies: FNV64 server cookie output");
-       {
--              uint8_t expected[] = { 0xe0, 0xd9, 0x95, 0x4e, 0xbc, 0xc3, 0x99, 0x19 };
-+              uint8_t expected[] = { 0x19, 0x99, 0xc3, 0xbc, 0x4e, 0x95, 0xd9, 0xe0 };
-               ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 server cookie content");
-       }
-@@ -244,7 +244,7 @@ int main(int argc, char *argv[])
-       hash_len = knot_sc_alg_fnv64.hash_func(&sc_in, hash, hash_len);
-       ok(hash_len != 0, "cookies: FNV64 server cookie output");
-       {
--              uint8_t expected[] = { 0x4d, 0xde, 0xfa, 0x22, 0xb9, 0x0a, 0xcc, 0xd8 };
-+              uint8_t expected[] = { 0xd8, 0xcc, 0x0a, 0xb9, 0x22, 0xfa, 0xde, 0x4d };
-               ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 server cookie content");
-       }
-@@ -261,7 +261,7 @@ int main(int argc, char *argv[])
-       hash_len = knot_sc_alg_fnv64.hash_func(&sc_in, hash, hash_len);
-       ok(hash_len != 0, "cookies: FNV64 server cookie output");
-       {
--              uint8_t expected[] = { 0xa0, 0x35, 0xe3, 0xe0, 0x78, 0x7a, 0x91, 0xaf };
-+              uint8_t expected[] = { 0xaf, 0x91, 0x7a, 0x78, 0xe0, 0xe3, 0x35, 0xa0 };
-               ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 server cookie content");
-       }
-@@ -278,7 +278,7 @@ int main(int argc, char *argv[])
-       hash_len = knot_sc_alg_fnv64.hash_func(&sc_in, hash, hash_len);
-       ok(hash_len != 0, "cookies: FNV64 server cookie output");
-       {
--              uint8_t expected[] = { 0x8e, 0xa3, 0xf8, 0x97, 0x84, 0x0a, 0x3d, 0x8b };
-+              uint8_t expected[] = { 0x8b, 0x3d, 0x0a, 0x84, 0x97, 0xf8, 0xa3, 0x8e };
-               ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 server cookie content");
-       }
--- 
-2.7.4
-
index 2fd34e7a19c95a1db5669c8cd45ea2596d4889c9..7e3c28cfdd647e4c2984fcb89738835f76eb5fbf 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008-2016 OpenWrt.org
+# Copyright (C) 2008-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:=knxd
-PKG_VERSION=2016-10-08
+PKG_VERSION:=0.14.24
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/knxd/knxd.git
-PKG_SOURCE_VERSION:=43e90c6ee3028194c8ce6d7776e7dedbe1032dc1
+PKG_SOURCE_VERSION:=10f702e112ffb2ada50efd33ea5cdce3f6ce1f6e
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=f2e18dfbe02e9f8cbebd7b31652c4d7be4e63af23d4635316a14a1fe6184a399
 
 PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
 
@@ -38,7 +39,7 @@ define Package/knxd
   SECTION:=net
   CATEGORY:=Network
   TITLE:=EIB KNX daemon
-  DEPENDS:=+pthsem +libusb-1.0
+  DEPENDS:=+libusb-1.0 +libstdcpp +libev
 endef
 
 define Package/knxd/description
@@ -46,58 +47,34 @@ EIB KNX Daemon
 endef
 
 define Package/knxd/conffiles
+/etc/knxd.ini
 /etc/config/knxd
 endef
 
-define Package/knxd-tools
-  SECTION:=net
-  CATEGORY:=Network
-  TITLE:=EIB KNX Utils
-endef
-
-define Package/knxd-tools/description
-EIB KNX Tools
-endef
-
-TARGET_CXXFLAGS+= -fno-rtti
+TARGET_CXXFLAGS+= -std=c++0x
 TARGET_CXX=$(TARGET_CC)
 
 CONFIGURE_ARGS+= \
-       --disable-ft12 \
-       --enable-eibnetip \
-       --enable-eibnetiptunnel \
-       --enable-eibnetipserver \
-       --enable-usb \
-       --enable-tpuarts \
-       --disable-pei16s \
-       --enable-groupcache \
-       --without-pth-test \
-       --disable-systemd \
-       --without-libstdc
+       --disable-systemd
 
 EXTRA_LDFLAGS+= \
-       -fno-builtin -largp
+       -largp -lstdc++
 
 define Package/knxd/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libeibclient.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/knxd_args $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
-       $(RM) $(1)/usr/bin/knxtool
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/knxd/eibwrite-cgi $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/knxd/eibread-cgi $(1)/usr/bin/
 
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/knxd.init $(1)/etc/init.d/knxd
 
        $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./files/knxd.ini $(1)/etc/knxd.ini
        $(INSTALL_DATA) ./files/knxd.config $(1)/etc/config/knxd
 endef
 
-define Package/knxd-tools/install
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libeibclient.so* $(1)/usr/lib/
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knxtool $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/knxd/eibwrite-cgi $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/knxd/eibread-cgi $(1)/usr/bin/
-endef
-
 $(eval $(call BuildPackage,knxd))
-$(eval $(call BuildPackage,knxd-tools))
index 8a42854e646ffafded9ef681dacc1a147796438a..81dacaabd6c6c374ffa634aaaebe33d4c99225d0 100644 (file)
@@ -1,6 +1,6 @@
 config daemon args
        # driver:[arg]  a Layer-2 driver to use (knxd supports more than one)
-       option layer2 ""
+       #option layer2 ""
        # enable caching of group communication networkstate
        option GroupCache 0
        # FILE start the programm as daemon. Output will be written to FILE if given
@@ -8,7 +8,7 @@ config daemon args
        #enable the EIBnet/IP server to answer discovery and description requests (SEARCH, DESCRIPTION)
        option Discovery 1
        # EIBADDR set our EIB address to EIBADDR (default 0.0.1)
-       option eibaddr "0.0.1"
+       option eibaddr "0.0.2"
        # LEVEL set error level
        option error 0
        # PORT listen at TCP port PORT (default 6720)
@@ -16,15 +16,15 @@ config daemon args
        # wait for L_Data_ind while sending (for all EMI based backends)
        option no_emisend_queuing 0
        # SERVERNAME name of the EIBnet/IP server (default is 'knxd')
-       option Name "OpenWrt"
+       option Name "KNX2"
        # do not assume KNXnet/IP Tunneling bus interface can handle parallel cEMI requests
        option no_tunnel_client_queuing 0
        # the next Layer2 interface may not enter monitor mode
        option no_monitor 0
        # enable EIBnet/IP Routing in the EIBnet/IP server
-       option Routing 0
+       option Routing 1
        # [ip[:port]] starts an EIBnet/IP multicast server
-       option Server 1
+       option Server '224.0.23.12'
        # MASK set trace flags (bitmask)
        option trace 0
        # tpuarts backend should generate L2 acks for all group telegrams
@@ -40,4 +40,4 @@ config daemon args
        # example with tpuarts interface
        # option url 'tpuarts:/dev/ttyAMA0'
        # example with IP interface in tunnel mode
-       option url 'ip:'
+       option url 'usb:'
diff --git a/net/knxd/files/knxd.ini b/net/knxd/files/knxd.ini
new file mode 100644 (file)
index 0000000..b4193dd
--- /dev/null
@@ -0,0 +1,17 @@
+[A.tcp]
+server = knxd_tcp
+systemd-ignore = true
+[B.ip]
+driver = ip
+[debug-server]
+name = mcast:knxd
+[main]
+addr = 0.0.1
+background = true
+client-addrs = 0.0.2:10
+connections = A.tcp,server,B.ip
+[server]
+debug = debug-server
+discover = true
+server = ets_router
+tunnel = tunnel
index 6fabee19910e6d9363faa30fbb512683bd1e6a20..7eafebbb77de237dcc28108063c48c4d0a0958de 100644 (file)
@@ -33,27 +33,33 @@ start_service() {
        local options url
        config_load knxd
        append_parm args eibaddr "eibaddr" "0.0.1"
+       append_parm args client_addrs "client-addrs" "0.0.2:10"
        append_parm args layer2 "layer2"
        append_bool args GroupCache "GroupCache" 0
        append_parm args daemon "daemon" "/var/log/knxd.log"
-       append_bool args Discovery "Discovery" 1
        append_parm args error "error" # "5"
        append_parm args listen_tcp "listen-tcp" "6720"
-       append_bool args no_emisend_queuing "no-emisend-queuing" 0
+       append_parm args Interface "Interface" # "eth0"
+       append_parm args send_delay "send-delay" # "50"
        append_parm args Name "Name" "OpenWrt"
-       append_bool args no_tunnel_client_queuing "no-tunnel-client-queuing" 0
        append_bool args no_monitor "no-monitor" 0
        append_bool args Routing "Routing" 0
-       append_parm args trace "trace" # "7"
        append_bool args tpuarts_ack_all_group "tpuarts-ack-all-group" 0
        append_bool args tpuarts_ack_all_individual "tpuarts-ack-all-individual" 0
        append_bool args tpuarts_disch_reset "tpuarts-disch-reset" 0
        append_bool args Tunnelling "Tunnelling" 1
-       append_bool args Server "Server" 1
+       append_bool args Discovery "Discovery" 1
+       append_parm args Server "Server" "224.0.23.12"
        append_parm args listen_local "listen-local" "/var/run/knxd"
+       append_parm args trace "trace" # "7"
        config_get url args url
+       if [ "$url" == "usb:" ] ; then
+               url="usb:""$(findknxusb | tail -n1 | sed -e 's/device: \([0-9]:[0-9]:[0-9]\):[0-9].*/\1/')"
+       fi
+       echo "/usr/lib/knxd_args $params $url"
+       /usr/lib/knxd_args $params $url > /tmp/etc/knxd.ini
        procd_open_instance
-       procd_set_param command $PROG $params $url
+       procd_set_param command $PROG "/tmp/etc/knxd.ini"
        procd_set_param respawn
        procd_close_instance
 }
index f7e33ed104d32be25a190c8cba2c6ec2870ba1a5..b1da96ce9d766115a1bd989c8b89fc5173a0aa09 100644 (file)
@@ -1,8 +1,8 @@
---- a/src/client/Makefile.am 2014-12-21 20:17:14.000000000 +0100
-+++ b/src/client/Makefile.am 2014-12-21 20:18:50.639995000 +0100
+--- a/src/client/Makefile.am 2017-01-25 20:17:14.000000000 +0100
++++ b/src/client/Makefile.am 2017-01-25 20:18:50.639995000 +0100
 @@ -4,5 +4,5 @@
  BUILDJAVA =
  endif
 
--SUBDIRS=def c $(BUILDJAVA) php perl cs python pascal ruby lua .
+-SUBDIRS=def c $(BUILDJAVA) php perl cs python pascal ruby lua go .
 +SUBDIRS=def c $(BUILDJAVA) php perl cs .
index 5fac1fa2daade5f5f5c5ad3114bdb58d6427348d..d2a5395d33f7d61e376dc7afc5227738a790dff0 100644 (file)
@@ -7,15 +7,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=kplex
-PKG_VERSION:=20150809
+PKG_VERSION:=1.3.4
+PKG_RELEASE=1
 
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/stripydog/kplex.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=fec47cd1877ec7903969adefa4220838a706d940
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://www.stripydog.com/download
+PKG_HASH:=b507d85d5f1def40303326459268a6262d37ea5f13fb73b37b72854e53594dcc
 
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
@@ -45,6 +42,8 @@ endef
 define Package/kplex/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/kplex $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/kplex.conf.ex $(1)/etc/kplex.conf
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/kplex.init $(1)/etc/init.d/kplex
 endef
index b14a7e07dc522cabc3030d57d1e5385870df2cd6..8d76a36dadedc847197812ab6b878161bda76ad3 100644 (file)
@@ -8,21 +8,22 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=krb5
-PKG_VERSION:=1.14.2
-PKG_RELEASE:=2
+PKG_VERSION:=1.16
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=NOTICE
 
-PKG_SOURCE:=krb5-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://web.mit.edu/kerberos/dist/krb5/1.14/
-PKG_MD5SUM:=2e35f0af0344d68aba99cef616d3a64f
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://web.mit.edu/kerberos/dist/krb5/1.16/
+PKG_HASH:=faeb125f83b0fb4cdb2f99f088140631bb47d975982de0956d18c85842969e08
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
 PKG_CHECK_FORMAT_SECURITY:=0
+PKG_USE_MIPS16:=0
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -74,15 +75,19 @@ CONFIGURE_ARGS += \
        --without-system-verto \
        --without-tcl \
        --without-libedit \
-       --localstatedir=/etc
+       --localstatedir=/etc \
+       --with-size-optimizations \
+       --disable-rpath \
+       --without-krb5-config
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include \
-               $(1)/usr
+       $(CP) $(PKG_INSTALL_DIR)/usr/include $(1)/usr
        $(INSTALL_DIR) $(1)/usr
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib \
-               $(1)/usr
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib $(1)/usr
+       # needed for samba4, to detect system-krb5
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/krb5-config $(1)/usr/bin
 endef
 
 define Package/krb5-libs/install
diff --git a/net/l7-protocols/Makefile b/net/l7-protocols/Makefile
deleted file mode 100644 (file)
index 0258216..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#
-# 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:=l7-protocols
-PKG_VERSION:=2009-05-28
-PKG_RELEASE:=2
-PKG_LICENSE:=GPL-2.0
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/l7-filter
-PKG_MD5SUM:=91be154d12134dcdbc560cc7aa7fe4ce
-
-include $(INCLUDE_DIR)/uclibc++.mk
-include $(INCLUDE_DIR)/package.mk
-
-define Package/l7-protocols
-  SECTION:=net
-  CATEGORY:=Network
-  TITLE:=Protocols for layer7 filtering
-  URL:=http://l7-filter.sourceforge.net/
-  SUBMENU:=Firewall
-  MAINTAINER:=Lim Guo Wei <limguowei@gmail.com>
-  DEPENDS:=iptables-mod-filter
-endef
-
-define Package/l7-protocols/description
-       l7-filter classifies packets based on patterns in application
-       layer data. This allows correct classification of P2P traffic that
-       uses unpredictable ports as well as standard protocols running on
-       non-standard ports.
-endef
-
-define Package/l7-protocols-testing
-       $(call Package/l7-protocols)
-       TITLE:=testing utilities for layer7
-       DEPENDS+=l7-protocols $(CXX_DEPENDS)
-endef
-
-define Package/l7-protocols-testing/description
-       testing utilities for layer 7 patterns
-endef
-
-define Build/Configure
-endef
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_l7-protocols-testing),)
-  define Build/Compile
-       cd $(PKG_BUILD_DIR)/testing && $(MAKE) $(CONFIGURE_VARS)
-  endef
-else
-  define Build/Compile
-  endef
-endif
-
-define Package/l7-protocols/install
-       find $(PKG_BUILD_DIR) -name "README" -delete
-       $(INSTALL_DIR) $(1)/etc/l7-protocols
-       $(CP) $(PKG_BUILD_DIR)/extra \
-               $(PKG_BUILD_DIR)/file_types \
-               $(PKG_BUILD_DIR)/groups.sh \
-               $(PKG_BUILD_DIR)/malware \
-               $(PKG_BUILD_DIR)/protocols \
-               $(1)/etc/l7-protocols
-endef
-
-define Package/l7-protocols-testing/install
-       $(INSTALL_DIR) $(1)/etc/l7-protocols/testing
-       $(CP) $(PKG_BUILD_DIR)/testing/data \
-               $(1)/etc/l7-protocols/testing
-       $(INSTALL_BIN) \
-               $(PKG_BUILD_DIR)/testing/rand{chars,printable} \
-               $(PKG_BUILD_DIR)/testing/test_speed-{kernel,userspace} \
-               $(PKG_BUILD_DIR)/testing/match_kernel \
-               $(PKG_BUILD_DIR)/testing/doallspeeds.sh \
-               $(PKG_BUILD_DIR)/testing/test_match.sh \
-               $(PKG_BUILD_DIR)/testing/timeit.sh \
-               $(1)/etc/l7-protocols/testing
-endef
-
-$(eval $(call BuildPackage,l7-protocols))
-$(eval $(call BuildPackage,l7-protocols-testing))
diff --git a/net/l7-protocols/patches/100-testing_crosscompile.patch b/net/l7-protocols/patches/100-testing_crosscompile.patch
deleted file mode 100644 (file)
index b5d3953..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
---- a/testing/Makefile
-+++ b/testing/Makefile
-@@ -1,19 +1,19 @@
- all: randchars randprintable test_speed-kernel test_speed-userspace match_kernel
- randchars: randchars.c
--      gcc -O2 -o randchars randchars.c
-+      $(CC) $(CFLAGS) -o randchars randchars.c
- randprintable: randprintable.c
--      gcc -O2 -o randprintable randprintable.c
-+      $(CC) $(CFLAGS) -o randprintable randprintable.c
- test_speed-kernel: test_speed-kernel.c
--      gcc -o test_speed-kernel test_speed-kernel.c
-+      $(CC) $(CFLAGS) -o test_speed-kernel test_speed-kernel.c
- test_speed-userspace: test_speed-userspace.cpp l7-parse-patterns.cpp l7-parse-patterns.h
--      g++ -Wall -o test_speed-userspace test_speed-userspace.cpp l7-parse-patterns.cpp
-+      $(CXX) $(CXXFLAGS) -Wall -o test_speed-userspace test_speed-userspace.cpp l7-parse-patterns.cpp
- match_kernel: match-kernel.c
--      gcc -O2 -o match_kernel match-kernel.c
-+      $(CC) $(CFLAGS) -o match_kernel match-kernel.c
- clean:
-       rm -f randprintable randchars test_speed-kernel test_speed-userspace match_kernel
diff --git a/net/l7-protocols/patches/101-testing-timeit.patch b/net/l7-protocols/patches/101-testing-timeit.patch
deleted file mode 100644 (file)
index 6656889..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
---- a/testing/timeit.sh
-+++ b/testing/timeit.sh
-@@ -1,11 +1,8 @@
- #!/bin/bash
--# "man 1 time" for details
--export TIME="%U seconds"
--
- add()
- {
--      if ! dc -e ""; then
-+      if ! dc p >/dev/null 2>&1; then
-               echo you do not have dc, so I cannot add these numbers...
-               exit 1
-       fi
-@@ -14,7 +11,7 @@ add()
-       tot=0
-       while read n; do
--              tot=`dc -e "$n $tot + pop" 2> /dev/null`
-+              tot=`dc $n $tot + p 2> /dev/null`
-       done
-       echo $tot seconds
-@@ -34,7 +31,7 @@ extract()
- if [ ! $3 ] || [ $2 == "-h" ] || [ $2 == "--help" ]; then
-       echo
--      echo Syntax: ./timeit.sh patternfile kernel\|userspace all\|print\|real [data_files]
-+      echo Syntax: .//usr/bin/timeit.sh patternfile kernel\|userspace all\|print\|real [data_files]
-       echo
-       echo \"kernel\" uses the kernel pattern and library
-       echo \"userspace\" uses userspace pattern and library
-@@ -72,12 +69,12 @@ echo Timing $1
- if [ $3 == "all" ]; then
-       echo Using all characters
-       if [ $2 == "kernel" ]; then
--              if ! ./randchars | time $speedprog "`extract $1`" verbose; then
-+              if ! ./randchars | /usr/bin/time $speedprog "`extract $1`" verbose 2>&1 >/dev/null | grep user | cut -d\  -f2; then
-                       echo $speedprog failed. > /dev/stderr
-                       exit 1
-               fi
-       else
--              if ! ./randchars | time $speedprog -f "$1" -v; then
-+              if ! ./randchars | /usr/bin/time $speedprog -f "$1" -v 2>&1 >/dev/null | grep user | cut -d\  -f2; then
-                       echo $speedprog failed. > /dev/stderr
-                       exit 1
-               fi
-@@ -85,12 +82,12 @@ if [ $3 == "all" ]; then
- elif [ $3 == "print" ]; then
-       echo Using only printable characters
-       if [ $2 == "kernel" ]; then
--              if ! ./randprintable | time $speedprog "`extract $1`" verbose; then
-+              if ! ./randprintable | /usr/bin/time $speedprog "`extract $1`" verbose 2>&1 >/dev/null | grep user | cut -d\  -f2; then
-                       echo $speedprog failed. > /dev/stderr
-                       exit 1
-               fi
-       else
--              if ! ./randprintable | time $speedprog -f "$1" -v; then
-+              if ! ./randprintable | /usr/bin/time $speedprog -f "$1" -v 2>&1 >/dev/null | grep user | cut -d\  -f2; then
-                       echo $speedprog failed. > /dev/stderr
-                       exit 1
-               fi
-@@ -107,12 +104,12 @@ elif [ $3 == "real" ]; then
-                               printf $f\\t
-                               #echo `extract $1`
-                               if [ $2 == "kernel" ]; then
--                                      if ! cat $f | time $speedprog "`extract $1`" 2> /dev/stdout | tee -a tmp.$$; then
-+                                      if ! cat $f | /usr/bin/time $speedprog "`extract $1`" 2>&1 >/dev/null | grep user | cut -d\  -f2 | tee -a tmp.$$; then
-                                               echo $speedprog failed. > /dev/stderr
-                                               exit 1
-                                       fi
-                               else
--                                      if ! cat $f | time $speedprog -f "$1" 2> /dev/stdout | tee -a tmp.$$; then
-+                                      if ! cat $f | /usr/bin/time $speedprog -f "$1" 2>&1 >/dev/null | grep user | cut -d\  -f2 | tee -a tmp.$$; then
-                                               echo $speedprog failed. > /dev/stderr
-                                               exit 1
-                                       fi
-@@ -123,12 +120,12 @@ elif [ $3 == "real" ]; then
-               for f in data/*; do
-                       printf $f\\t
-                       if [ $2 == "kernel" ]; then
--                              if ! cat $f | time $speedprog "`extract $1`" 2> /dev/stdout | tee -a tmp.$$; then
-+                              if ! cat $f | /usr/bin/time $speedprog "`extract $1`" 2>&1 >/dev/null | grep user | cut -d\  -f2 | tee -a tmp.$$; then
-                                       echo $speedprog failed. > /dev/stderr
-                                       exit 1
-                               fi
-                       else
--                              if ! cat $f | time $speedprog -f "$1" 2> /dev/stdout | tee -a tmp.$$; then
-+                              if ! cat $f | /usr/bin/time $speedprog -f "$1" 2>&1 >/dev/null | grep user | cut -d\  -f2 | tee -a tmp.$$; then
-                                       echo $speedprog failed. > /dev/stderr
-                                       exit 1
-                               fi
-@@ -137,7 +134,7 @@ elif [ $3 == "real" ]; then
-       fi
-       printf Total:\ 
--      cat tmp.$$ | cut -d\  -f 2 | add
-+      cat tmp.$$ | cut -ds -f 1| add
-       rm tmp.$$
- else
diff --git a/net/l7-protocols/patches/102-testing-doallspeeds.patch b/net/l7-protocols/patches/102-testing-doallspeeds.patch
deleted file mode 100644 (file)
index 850a1d6..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/testing/doallspeeds.sh
-+++ b/testing/doallspeeds.sh
-@@ -25,11 +25,11 @@ for f in ../*/*.pat; do 
-       printf `basename $f .pat`
-       if [ $userspace ]; then 
--              gtime=`./timeit.sh $f userspace   real | grep Total | cut -d\  -f 2`
-+              gtime=`./timeit.sh $f userspace   real | grep Total | cut -d\  -f 2 | awk '{print $1}'`
-               printf \\t$gtime
-       fi
-       if [ $kernel ]; then 
--              htime=`./timeit.sh $f kernel real | grep Total | cut -d\  -f 2`
-+              htime=`./timeit.sh $f kernel real | grep Total | cut -d\  -f 2 | awk '{print $1}'`
-               printf \\t$htime
-       fi
-       printf \\n
index f5a982c644d126b03a551b04c1d390447fab5d71..9c1b3abc6a961fb67c0b5e757dc29c78097f536d 100644 (file)
@@ -18,8 +18,8 @@ PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.flyn.org/projects/lcdringer
-PKG_MD5SUM:=ff3fe82593792c9111f957dd533369fb
-PKG_BUILD_DEPENDS:=+vala
+PKG_HASH:=34f8a5325cb20bf404ac1a10fe63d013a077a12814c4558df4e55d95262ff618
+PKG_BUILD_DEPENDS:=vala
 
 PKG_INSTALL:=1
 
index 5cefd24b8582c949f8ffe6d1afd6bafef551f919..7a4cd3685dc7829aae18041ca7cad19a73e69933 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lftp
-PKG_VERSION:=4.7.5
-PKG_RELEASE:=1
+PKG_VERSION:=4.8.2
+PKG_RELEASE:=2
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://lftp.tech/ftp/ \
-               ftp://ftp.st.ryukoku.ac.jp/pub/network/ftp/lftp/
-PKG_MD5SUM:=88c1505f8264429353ea7f249597eeb7
-
+               https://mirror.csclub.uwaterloo.ca/gentoo-distfiles/distfiles/
+               
+PKG_HASH:=5c875b8476e05e856ebc8eec458e43317b2bebd6ed5f7725a733d4591548cd9c
 
 
 PKG_LICENSE:=GPL-3.0+
@@ -37,19 +37,9 @@ define Package/lftp/description
 LFTP is a sophisticated file transfer program with command line interface. It supports FTP, HTTP, FISH, SFTP, HTTPS and FTPS protocols. GNU Readline library is used for input.
 Every operation in lftp is reliable, that is any non-fatal error is handled and the operation is retried automatically. So if downloading breaks, it will be restarted from the point automatically. Even if ftp server does not support REST command, lftp will try to retrieve the file from the very beginning until the file is transferred completely. This is useful for dynamic-ip machines which change their IP addresses quite often, and for sites with very bad internet connectivity.
 
-If you exit lftp when some jobs are not finished yet, lftp will move itself to nohup mode in background. The same happens when you have a real modem hangup or when you close an xterm.
-
 lftp has shell-like command syntax allowing you to launch several commands in parallel in background (&). It is also possible to group commands within () and execute them in background. All background jobs are executed in the same single process. You can bring a foreground job to background with ^Z (c-z) and back with command `wait' (or `fg' which is alias to `wait'). To list running jobs, use command `jobs'. Some commands allow redirecting their output (cat, ls, ...) to file or via pipe to external command. Commands can be executed conditionally based on termination status of previous command (&&, ||).
 
 lftp has builtin mirror which can download or update a whole directory tree. There is also reverse mirror (mirror -R) which uploads or updates a directory tree on server.
-
-There is command `at' to launch a job at specified time in current context, command `queue' to queue commands for sequential execution for current server, and much more.
-
-LFTP supports IPv6 for both FTP and HTTP protocols. For FTP protocol it uses method described in RFC2428.
-
-Other low level stuff supported: ftp proxy, http proxy, ftp over http, opie/skey, fxp transfers, socks.
-
-LFTP supports secure versions of the protocols FTP and HTTP: FTPS (explicit and implicit) and HTTPS. LFTP needs to be linked with an SSL library to support them. GNU TLS and OpenSSL are both supported as SSL backend.
 endef
 
 CONFIGURE_ARGS += \
@@ -63,12 +53,7 @@ CONFIGURE_ARGS += \
        --with-zlib="$(STAGING_DIR)/usr" \
        --disable-static
 
-#CONFIGURE_VARS += \
-#      LIBS="-lz -lutil -lcurses -ldl" \
-#      i_cv_posix_fallocate_works=no
-
-#MAKE_VARS += \
-#      LD="$(TARGET_CXX)"
+TARGET_CXXFLAGS+= -std=c++11
 
 define Package/lftp/install
        $(INSTALL_DIR) $(1)/usr/bin
diff --git a/net/lighttpd/Makefile b/net/lighttpd/Makefile
new file mode 100644 (file)
index 0000000..fc22b1b
--- /dev/null
@@ -0,0 +1,240 @@
+#
+# Copyright (C) 2006-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:=lighttpd
+PKG_VERSION:=1.4.48
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://download.lighttpd.net/lighttpd/releases-1.4.x
+PKG_HASH:=0f8ad5aac7529d7b948b9d7e8cd0b4a9e177309d85d6bf6516e28e6e40d74f36
+
+PKG_LICENSE:=BSD-3c
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+REBUILD_MODULES=authn_gssapi authn_ldap authn_mysql cml magnet mysql_vhost trigger_b4_dl webdav
+
+PKG_CONFIG_DEPENDS:=CONFIG_LIGHTTPD_SSL $(patsubst %,CONFIG_PACKAGE_lighttpd-mod-%,$(REBUILD_MODULES))
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lighttpd/Default
+  SUBMENU:=Web Servers/Proxies
+  SECTION:=net
+  CATEGORY:=Network
+  URL:=http://www.lighttpd.net/
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+endef
+
+define Package/lighttpd
+  $(call Package/lighttpd/Default)
+  MENU:=1
+  DEPENDS:=+LIGHTTPD_SSL:libopenssl +libpcre +libpthread
+  TITLE:=A flexible and lightweight web server
+endef
+
+define Package/lighttpd/config
+config LIGHTTPD_SSL
+       bool "SSL support"
+       depends on PACKAGE_lighttpd
+       default y
+       help
+         Implements SSL support in lighttpd (using libopenssl). This
+         option is required if you enable the SSL engine in your
+         lighttpd confguration file.
+endef
+
+BASE_MODULES:=dirlisting indexfile staticfile
+
+CONFIGURE_ARGS+= \
+       --libdir=/usr/lib/lighttpd \
+       --sysconfdir=/etc/lighttpd \
+       --enable-shared \
+       --enable-static \
+       --disable-rpath \
+       --without-attr \
+       --without-bzip2 \
+       --without-fam \
+       --with-pcre \
+       --without-valgrind \
+        $(call autoconf_bool,CONFIG_IPV6,ipv6)
+
+CONFIGURE_VARS+= \
+       PCRE_LIB="-lpcre" \
+
+ifneq ($(strip $(CONFIG_LIGHTTPD_SSL)),)
+  CONFIGURE_ARGS+= \
+       --with-openssl="$(STAGING_DIR)/usr"
+  BASE_MODULES+= openssl
+else
+  CONFIGURE_ARGS+= \
+       --without-openssl
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-authn_gssapi),)
+  CONFIGURE_ARGS+= --with-krb5
+else
+  CONFIGURE_ARGS+= --without-krb5
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-authn_ldap),)
+  CONFIGURE_ARGS+= --with-ldap
+else
+  CONFIGURE_ARGS+= --without-ldap
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-authn_mysql),)
+  CONFIGURE_ARGS+= --with-mysql
+else
+  CONFIGURE_ARGS+= --without-mysql
+endif
+
+#ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-geoip),)
+#  CONFIGURE_ARGS+= --with-geoip
+#else
+#  CONFIGURE_ARGS+= --without-geoip
+#endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-cml)$(CONFIG_PACKAGE_lighttpd-mod-magnet),)
+  CONFIGURE_ARGS+= --with-lua
+else
+  CONFIGURE_ARGS+= --without-lua
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-mysql_vhost),)
+  CONFIGURE_ARGS+= --with-mysql
+else
+  CONFIGURE_ARGS+= --without-mysql
+endif
+
+#ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-cml)$(CONFIG_PACKAGE_lighttpd-mod-trigger_b4_dl),)
+#  CONFIGURE_ARGS+= --with-memcached
+#else
+#  CONFIGURE_ARGS+= --without-memcached
+#endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-trigger_b4_dl),)
+  CONFIGURE_ARGS+= --with-gdbm
+else
+  CONFIGURE_ARGS+= --without-gdbm
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-webdav),)
+  CONFIGURE_ARGS+= \
+       --with-webdav-locks \
+       --with-webdav-props
+  # XXX: needed by sqlite3 to prevent segfaults in mod_webdav.so
+  CONFIGURE_VARS+= \
+       LIBS="-lpthread"
+else
+  CONFIGURE_ARGS+= \
+       --without-webdav-locks \
+       --without-webdav-props
+endif
+
+define Build/Configure
+$(call Build/Configure/Default)
+       # XXX: override pcre (mis)detection by ./configure when cross-compiling
+       echo "#define HAVE_LIBPCRE 1" >>$(PKG_BUILD_DIR)/config.h
+       echo "#define HAVE_PCRE_H 1" >>$(PKG_BUILD_DIR)/config.h
+endef
+
+define Package/lighttpd/conffiles
+/etc/lighttpd/lighttpd.conf
+endef
+
+define Package/lighttpd/install
+       $(INSTALL_DIR) $(1)/etc/lighttpd
+       $(INSTALL_DATA) ./files/lighttpd.conf $(1)/etc/lighttpd/
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/config/conf.d/mime.conf $(1)/etc/lighttpd/
+       $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/lighttpd.init $(1)/etc/init.d/lighttpd
+       $(INSTALL_DIR) $(1)/usr/lib/lighttpd
+       for m in $(BASE_MODULES); do \
+               $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$$$${m}.so $(1)/usr/lib/lighttpd/ ; \
+       done
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lighttpd $(1)/usr/sbin/
+endef
+
+define BuildPlugin
+  define Package/lighttpd-mod-$(1)
+    $(call Package/lighttpd/Default)
+    DEPENDS:=lighttpd
+    ifneq ($(3),)
+      DEPENDS+= $(3)
+    endif
+    TITLE:=$(2) module
+  endef
+
+ ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-$(1)),)
+  define Package/lighttpd-mod-$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/lib/lighttpd
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$(1).so $$(1)/usr/lib/lighttpd
+       $(INSTALL_DIR) $$(1)/etc/lighttpd/conf.d
+       if [ -f $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf ]; then \
+               $(CP) $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
+       else \
+               echo 'server.modules += ( "mod_$(1)" )' > $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
+       fi
+  endef
+ endif
+
+  $$(eval $$(call BuildPackage,lighttpd-mod-$(1)))
+endef
+
+$(eval $(call BuildPackage,lighttpd))
+
+# First, permit redirect from HTTP to HTTPS.
+$(eval $(call BuildPlugin,redirect,URL redirection,+PACKAGE_lighttpd-mod-redirect:libpcre,10))
+
+# Next, permit authentication.
+$(eval $(call BuildPlugin,auth,Authentication,,20))
+$(eval $(call BuildPlugin,authn_file,File-based authentication,,20))
+$(eval $(call BuildPlugin,authn_gssapi,Kerberos-based authentication,+PACKAGE_lighttpd-mod-authn_gssapi:krb5-libs,20))
+$(eval $(call BuildPlugin,authn_ldap,LDAP-based authentication,+PACKAGE_lighttpd-mod-authn_ldap:libopenldap,20))
+$(eval $(call BuildPlugin,authn_mysql,Mysql-based authentication,+PACKAGE_lighttpd-mod-authn_mysql:libmysqlclient,20))
+
+# Finally, everything else.
+$(eval $(call BuildPlugin,access,Access restrictions,,30))
+$(eval $(call BuildPlugin,accesslog,Access logging,,30))
+$(eval $(call BuildPlugin,alias,Directory alias,,30))
+$(eval $(call BuildPlugin,cgi,CGI,,30))
+#$(eval $(call BuildPlugin,cml,Cache Meta Language,+PACKAGE_lighttpd-mod-cml:liblua +PACKAGE_lighttpd-mod-cml:libmemcached,30))
+$(eval $(call BuildPlugin,cml,Cache Meta Language,+PACKAGE_lighttpd-mod-cml:liblua,30))
+$(eval $(call BuildPlugin,compress,Compress output,+PACKAGE_lighttpd-mod-compress:zlib,30))
+$(eval $(call BuildPlugin,deflate,Compress dynamic output,+PACKAGE_lighttpd-mod-deflate:zlib,30))
+$(eval $(call BuildPlugin,evasive,Evasive,,30))
+$(eval $(call BuildPlugin,evhost,Enhanced Virtual-Hosting,,30))
+$(eval $(call BuildPlugin,expire,Expire,,30))
+$(eval $(call BuildPlugin,extforward,Extract client,,30))
+$(eval $(call BuildPlugin,fastcgi,FastCGI,,30))
+$(eval $(call BuildPlugin,flv_streaming,FLV streaming,,30))
+#$(eval $(call BuildPlugin,geoip,Geolocation,+PACKAGE_lighttpd-mod-geoip:libgeoip,30))
+$(eval $(call BuildPlugin,magnet,Magnet,+PACKAGE_lighttpd-mod-magnet:liblua,30))
+$(eval $(call BuildPlugin,mysql_vhost,Mysql virtual hosting,+PACKAGE_lighttpd-mod-mysql_vhost:libmysqlclient,30))
+$(eval $(call BuildPlugin,proxy,Proxy,,30))
+$(eval $(call BuildPlugin,rewrite,URL rewriting,+PACKAGE_lighttpd-mod-rewrite:libpcre,30))
+$(eval $(call BuildPlugin,rrdtool,RRDtool,,30))
+$(eval $(call BuildPlugin,scgi,SCGI,,30))
+$(eval $(call BuildPlugin,secdownload,Secure and fast download,,30))
+$(eval $(call BuildPlugin,setenv,Environment variable setting,,30))
+$(eval $(call BuildPlugin,simple_vhost,Simple virtual hosting,,30))
+$(eval $(call BuildPlugin,ssi,SSI,+PACKAGE_lighttpd-mod-ssi:libpcre,30))
+$(eval $(call BuildPlugin,status,Server status display,,30))
+#$(eval $(call BuildPlugin,trigger_b4_dl,Trigger before download,+PACKAGE_lighttpd-mod-trigger_b4_dl:libpcre +PACKAGE_lighttpd-mod-trigger_b4_dl:libgdbm +PACKAGE_lighttpd-mod-trigger_b4_dl:libmemcached,30))
+$(eval $(call BuildPlugin,trigger_b4_dl,Trigger before download,+PACKAGE_lighttpd-mod-trigger_b4_dl:libpcre +PACKAGE_lighttpd-mod-trigger_b4_dl:libgdbm,30))
+$(eval $(call BuildPlugin,userdir,User directory,,30))
+$(eval $(call BuildPlugin,usertrack,User tracking,,30))
+$(eval $(call BuildPlugin,webdav,WebDAV,+PACKAGE_lighttpd-mod-webdav:libsqlite3 +PACKAGE_lighttpd-mod-webdav:libuuid +PACKAGE_lighttpd-mod-webdav:libxml2,30))
+
diff --git a/net/lighttpd/files/lighttpd.conf b/net/lighttpd/files/lighttpd.conf
new file mode 100644 (file)
index 0000000..dd57765
--- /dev/null
@@ -0,0 +1,29 @@
+server.document-root        = "/www"
+server.upload-dirs          = ( "/tmp" )
+server.errorlog             = "/var/log/lighttpd/error.log"
+server.pid-file             = "/var/run/lighttpd.pid"
+server.username             = "http"
+server.groupname            = "www-data"
+
+index-file.names            = ( "index.php", "index.html",
+                                "index.htm", "default.htm",
+                              )
+
+static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
+
+### Options that are useful but not always necessary:
+#server.chroot               = "/"
+#server.port                 = 81
+#server.bind                 = "localhost"
+#server.tag                  = "lighttpd"
+#server.errorlog-use-syslog  = "enable"
+#server.network-backend      = "writev"
+
+### Use IPv6 if available
+#include_shell "/usr/share/lighttpd/use-ipv6.pl"
+
+#dir-listing.encoding        = "utf-8"
+#server.dir-listing          = "enable"
+
+include "/etc/lighttpd/mime.conf"
+include "/etc/lighttpd/conf.d/*.conf"
diff --git a/net/lighttpd/files/lighttpd.init b/net/lighttpd/files/lighttpd.init
new file mode 100644 (file)
index 0000000..84a3a18
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2011 OpenWrt.org
+
+START=50
+STOP=50
+
+USE_PROCD=1
+PROG=/usr/sbin/lighttpd
+
+validate_conf() {
+       $PROG -tt -f /etc/lighttpd/lighttpd.conf >/dev/null 2>&1 || {
+               echo "validation failed"
+               return 1
+       }
+}
+
+start_service() {
+       user_exists http || user_add http
+       [ -d /var/log/lighttpd ] || {
+               mkdir -m 0775 -p /var/log/lighttpd
+               chgrp www-data /var/log/lighttpd
+       }
+
+       validate_conf || exit 1
+
+       procd_open_instance
+       procd_set_param command $PROG -D -f /etc/lighttpd/lighttpd.conf
+       procd_close_instance
+}
+
+reload_service() {
+       procd_send_signal lighttpd
+}
index fd3032d9bc8c361bb6b63bf8d75414dc9aa7fb97..6c97d7b3e1cda40e95d34cf8fd829da0aadd83ce 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=linknx
-PKG_VERSION:=0.0.1.33
+PKG_VERSION:=0.0.1.34
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
@@ -16,9 +16,10 @@ PKG_LICENSE:=GPL-2.0+
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/linknx/linknx.git
-PKG_SOURCE_VERSION:=f627ed44feaea5a1f67c53f2810c44a14c059cef
+PKG_SOURCE_VERSION:=831ed395e232ead88e92cdf19f12e227e80e22cf
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)
-PKG_SOURCE:=$(PKG_NAME)-${PKG_VERSION}.tar.gz
+PKG_SOURCE:=$(PKG_NAME)-${PKG_VERSION}.tar.xz
+PKG_MIRROR_HASH:=1c53d181b5577d759b4d0faa5a267dd0a040d9fee1bfc6ad9545374b9002900f
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 PKG_BUILD_DEPENDS:=argp-standalone
index 6128521881e1b439f45afcee9cee1ddec5537ad5..1d84748feffccda0a59f9562bedba0736ce6af90 100644 (file)
@@ -9,16 +9,12 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=linuxptp
 PKG_VERSION:=1.8
-PKG_RELEASE:=2
-PKG_REV:=891d56e4292653c5c19ac8345159a1f1f5b2df26
+PKG_RELEASE:=4
 
 PKG_MAINTAINER:=Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=git://git.code.sf.net/p/linuxptp/code
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=$(PKG_REV)
-PKG_SOURCE_PROTO:=git
-PKG_MD5SUM:=
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)/v$(PKG_VERSION)
+PKG_HASH:=fa8e00f6ec73cefa7bb313dce7f60dfe5eb9e2bde3353594e9ac18edc93e5165
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
@@ -41,8 +37,10 @@ define Package/linuxptp/description
  computers.
 endef
 
+EXTRA_CFLAGS += -DHAVE_CLOCK_ADJTIME -DHAVE_POSIX_SPAWN -DHAVE_ONESTEP_SYNC
+
 MAKE_VARS += \
-       EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)"
+       EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CFLAGS)"
 
 define Package/linuxptp/install
        $(INSTALL_DIR) $(1)/usr/sbin
diff --git a/net/linuxptp/patches/002-netdb_fix.patch b/net/linuxptp/patches/002-netdb_fix.patch
new file mode 100644 (file)
index 0000000..2535568
--- /dev/null
@@ -0,0 +1,77 @@
+From 60db5d0b0fd8be9afede7e8a14e708f5429f2023 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli@gmail.com>
+Date: Sun, 7 May 2017 11:16:06 -0700
+Subject: [PATCH] udp: Avoid including netdb.h
+
+netdb.h pulls in a large chain of include files:
+rpc/netdb.h
+rpc/types.h
+
+rpc/types.h re-defines TRUE/FALSE and does it in this way:
+
+ #ifndef FALSE
+ #      define  FALSE   (0)
+ #endif
+
+ #ifndef TRUE
+ #      define  TRUE    (1)
+ #endif
+
+And this later causes build problems that appear in this way:
+
+mipsel-linux-gnu-gcc -Wall -DVER=1.8  -D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME
+-DHAVE_POSIX_SPAWN -DHAVE_ONESTEP_SYNC  -Os -pipe -mno-branch-likely
+-mips32r2 -mtune=24kc -fno-caller-saves -Wno-unused-result
+-D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro
+-I/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/include
+-I/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/include
+-I/home/florian/dev/toolchains/stbgcc-4.8-1.5/usr/include
+-I/home/florian/dev/toolchains/stbgcc-4.8-1.5/include
+-DHAVE_CLOCK_ADJTIME -DHAVE_POSIX_SPAWN -DHAVE_ONESTEP_SYNC   -c -o
+udp.o udp.c
+In file included from
+/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/include/rpc/netdb.h:45:0,
+                 from
+/home/florian/dev/toolchains/stbgcc-4.8-1.5/mipsel-linux-gnu/sys-root/usr/include/netdb.h:32,
+                 from udp.c:23:
+pdt.h:25:7: error: expected identifier before '(' token
+ enum {FALSE, TRUE};
+       ^
+<builtin>: recipe for target 'udp.o' failed
+
+Upon inspection, it does not appear that netdb.h is providing any useful
+definition or declaration, so let's just remove its inclusion.
+
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+---
+ udp.c  | 1 -
+ udp6.c | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/udp.c b/udp.c
+index 6dabc31836fe..530a2ee3748d 100644
+--- a/udp.c
++++ b/udp.c
+@@ -20,7 +20,6 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <net/if.h>
+-#include <netdb.h>
+ #include <netinet/in.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+diff --git a/udp6.c b/udp6.c
+index c229cac0c41c..89e27bf9e863 100644
+--- a/udp6.c
++++ b/udp6.c
+@@ -20,7 +20,6 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <net/if.h>
+-#include <netdb.h>
+ #include <netinet/in.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+-- 
+2.11.0
+
index b1776641ac8227f4f8b4710e50181aed44f84c3e..6783ea621d3067d2895512881574875f873bfdd9 100644 (file)
@@ -13,6 +13,7 @@ PKG_VERSION:=0.4
 PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MIRROR_HASH:=584300e1a59cc976f3599213487ea8425f94300887a51c9804f0292cf2f0c8cc
 PKG_SOURCE_URL:=git://github.com/LISPmob/lispmob.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
index 0d652920b85298dec3c926454525ac79aa6e4044..1b79a77fdd77f6c75345440eeac5a9511f678323 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/lksctp
-PKG_MD5SUM:=708bb0b5a6806ad6e8d13c55b067518e
+PKG_HASH:=0903dd526b7f30a89d5031aa2c82757612becc38ed7bc6e4f972f8deae351f26
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/net/luci-app-bcp38/Makefile b/net/luci-app-bcp38/Makefile
deleted file mode 100644 (file)
index ecf84fd..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# Copyright (C) 2010 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:=luci-app-bcp38
-PKG_VERSION:=2
-PKG_RELEASE:=2
-PKG_LICENSE:=Apache-2.0
-LUCI_DIR:=/usr/lib/lua/luci
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luci-app-bcp38
-  SECTION:=luci
-  CATEGORY:=LuCI
-  TITLE:=BCP38 LuCI interface
-  MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
-  PKGARCH:=all
-  DEPENDS:= lua luci-base +bcp38
-  SUBMENU:=3. Applications
-endef
-
-define Package/luci-app-bcp38/description
-       Control BCP38 subnet blocking
-endef
-
-define Build/Compile
-endef
-
-define Build/Configure
-endef
-
-define Package/luci-app-bcp38/install
-       $(INSTALL_DIR) $(1)$(LUCI_DIR)/controller $(1)$(LUCI_DIR)/model/cbi
-       $(INSTALL_DATA) ./files/bcp38-controller.lua $(1)$(LUCI_DIR)/controller/bcp38.lua
-       $(INSTALL_DATA) ./files/bcp38-cbi.lua $(1)$(LUCI_DIR)/model/cbi/bcp38.lua
-       $(INSTALL_DIR) $(1)/etc/uci-defaults
-       $(INSTALL_BIN) ./files/uci-defaults-bcp38 $(1)/etc/uci-defaults/luci-bcp38
-endef
-
-define Package/luci-app-bcp38/postinst
-#!/bin/sh
-[ -x /etc/uci-defaults/luci-bcp38 ] && /etc/uci-defaults/luci-bcp38 || exit 0
-endef
-
-define Package/luci-app-bcp38/postrm
-#!/bin/sh
-uci delete ucitrack.@bcp38[0]
-uci commit
-endef
-
-$(eval $(call BuildPackage,luci-app-bcp38))
diff --git a/net/luci-app-bcp38/files/bcp38-cbi.lua b/net/luci-app-bcp38/files/bcp38-cbi.lua
deleted file mode 100644 (file)
index 632074a..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Toke Høiland-Jørgensen <toke@toke.dk>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-local wa = require "luci.tools.webadmin"
-local net = require "luci.model.network".init()
-local ifaces = net:get_interfaces()
-
-m = Map("bcp38", translate("BCP38"),
-       translate("This function blocks packets with private address destinations " ..
-               "from going out onto the internet as per " ..
-               "<a href=\"http://tools.ietf.org/html/bcp38\">BCP 38</a>. " ..
-               "For IPv6, only source specific default routes are installed, so " ..
-               "no BCP38 firewall routes are needed."))
-
-s = m:section(TypedSection, "bcp38", translate("BCP38 config"))
-s.anonymous = true
--- BASIC
-e = s:option(Flag, "enabled", translate("Enable"))
-e.rmempty = false
-
-a = s:option(Flag, "detect_upstream", translate("Auto-detect upstream IP"),
-                               translate("Attempt to automatically detect if the upstream IP " ..
-                                       "will be blocked by the configuration, and add an exception if it will. " ..
-                                       "If this does not work correctly, you can add exceptions manually below."))
-a.rmempty = false
-
-n = s:option(ListValue, "interface", translate("Interface name"), translate("Interface to apply the blocking to " ..
-                                                       "(should be the upstream WAN interface)."))
-for _, iface in ipairs(ifaces) do
-     if iface:is_up() then
-       n:value(iface:name())
-     end
-end
-n.rmempty = false
-
-ma = s:option(DynamicList, "match",
-       translate("Blocked IP ranges"))
-
-ma.datatype = "ip4addr"
-
-nm = s:option(DynamicList, "nomatch",
-       translate("Allowed IP ranges"), translate("Takes precedence over blocked ranges. "..
-                                                 "Use to whitelist your upstream network if you're behind a double NAT " ..
-                                                 "and the auto-detection doesn't work."))
-
-nm.datatype = "ip4addr"
-
-
-return m
diff --git a/net/luci-app-bcp38/files/bcp38-controller.lua b/net/luci-app-bcp38/files/bcp38-controller.lua
deleted file mode 100644 (file)
index 7ea2283..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-module("luci.controller.bcp38", package.seeall)
-
-function index()
-       entry({"admin", "network", "firewall", "bcp38"},
-               cbi("bcp38"),
-               _("BCP38"), 50).dependent = false
-end
diff --git a/net/luci-app-bcp38/files/uci-defaults-bcp38 b/net/luci-app-bcp38/files/uci-defaults-bcp38
deleted file mode 100755 (executable)
index c204236..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-uci -q batch <<-EOF >/dev/null
-       delete ucitrack.@bcp38[-1]
-       add ucitrack bcp38
-        add_list ucitrack.@bcp38[0].affects=firewall
-       commit ucitrack
-EOF
-
-rm -f /tmp/luci-indexcache
-exit 0
diff --git a/net/luci-app-cjdns/Makefile b/net/luci-app-cjdns/Makefile
deleted file mode 100644 (file)
index 793b4ec..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# 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:=luci-app-cjdns
-PKG_VERSION:=1.3
-PKG_RELEASE:=5
-
-PKG_LICENSE:=GPL-3.0
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luci-app-cjdns
-       SECTION:=luci
-       CATEGORY:=LuCI
-       SUBMENU:=3. Applications
-       TITLE:=Encrypted near-zero-conf mesh routing protocol
-       URL:=https://github.com/hyperboria/cjdns
-       MAINTAINER:=Lars Gierth <larsg@systemli.org>
-       DEPENDS:=+cjdns +luci-base
-endef
-
-define Package/luci-app-cjdns/description
-       This package allows you to configure and inspect cjdns networking using LuCI.
-
-       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 Build/Compile
-endef
-
-define Package/luci-app-cjdns/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua/luci
-       $(CP) ./luasrc/* $(1)/usr/lib/lua/luci
-endef
-
-$(eval $(call BuildPackage,luci-app-cjdns))
diff --git a/net/luci-app-cjdns/luasrc/controller/cjdns.lua b/net/luci-app-cjdns/luasrc/controller/cjdns.lua
deleted file mode 100644 (file)
index 63644cb..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-module("luci.controller.cjdns", package.seeall)
-
-cjdns  = require "cjdns/init"
-dkjson = require "dkjson"
-
-function index()
-       if not nixio.fs.access("/etc/config/cjdns") then
-               return
-       end
-
-       entry({"admin", "services", "cjdns"},
-               cbi("cjdns/overview"), _("cjdns")).dependent = true
-
-       entry({"admin", "services", "cjdns", "overview"},
-               cbi("cjdns/overview"), _("Overview"), 1).leaf = false
-
-       entry({"admin", "services", "cjdns", "peering"},
-               cbi("cjdns/peering"), _("Peers"), 2).leaf = false
-
-       entry({"admin", "services", "cjdns", "iptunnel"},
-               cbi("cjdns/iptunnel"), _("IP Tunnel"), 3).leaf = false
-
-       entry({"admin", "services", "cjdns", "settings"},
-               cbi("cjdns/settings"), _("Settings"), 4).leaf = false
-
-       entry({"admin", "services", "cjdns", "cjdrouteconf"},
-               cbi("cjdns/cjdrouteconf"), _("cjdroute.conf"), 5).leaf = false
-
-       entry({"admin", "services", "cjdns", "peers"}, call("act_peers")).leaf = true
-       entry({"admin", "services", "cjdns", "ping"}, call("act_ping")).leaf = true
-end
-
-function act_peers()
-       require("cjdns/uci")
-       admin = cjdns.uci.makeInterface()
-
-       local page = 0
-       local peers = {}
-
-       while page do
-               local response, err = admin:auth({
-                       q = "InterfaceController_peerStats",
-                       page = page
-               })
-
-               if err or response.error then
-                       luci.http.status(502, "Bad Gateway")
-                       luci.http.prepare_content("application/json")
-                       luci.http.write_json({ err = err, response = response })
-                       return
-               end
-
-               for i,peer in pairs(response.peers) do
-                       peer.ipv6 = publictoip6(peer.publicKey)
-                       if peer.user == nil then
-                               peer.user = ''
-                               uci.cursor():foreach("cjdns", "udp_peer", function(udp_peer)
-                                       if peer.publicKey == udp_peer.public_key then
-                                               peer.user = udp_peer.user
-                                       end
-                               end)
-                       end
-                       peers[#peers + 1] = peer
-               end
-
-               if response.more then
-                       page = page + 1
-               else
-                       page = nil
-               end
-       end
-
-       luci.http.status(200, "OK")
-       luci.http.prepare_content("application/json")
-       luci.http.write_json(peers)
-end
-
-function act_ping()
-       require("cjdns/uci")
-       admin = cjdns.uci.makeInterface()
-
-       local response, err = admin:auth({
-               q = "SwitchPinger_ping",
-               path = luci.http.formvalue("label"),
-               timeout = tonumber(luci.http.formvalue("timeout"))
-       })
-
-       if err or response.error then
-               luci.http.status(502, "Bad Gateway")
-               luci.http.prepare_content("application/json")
-               luci.http.write_json({ err = err, response = response })
-               return
-       end
-
-       luci.http.status(200, "OK")
-       luci.http.prepare_content("application/json")
-       luci.http.write_json(response)
-end
-
-function publictoip6(publicKey)
-       local process = io.popen("/usr/bin/publictoip6 " .. publicKey, "r")
-       local ipv6    = process:read()
-       process:close()
-       return ipv6
-end
diff --git a/net/luci-app-cjdns/luasrc/model/cbi/cjdns/cjdrouteconf.lua b/net/luci-app-cjdns/luasrc/model/cbi/cjdns/cjdrouteconf.lua
deleted file mode 100644 (file)
index 00e9ae0..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-m = Map("cjdns", translate("cjdns"),
-  translate("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."))
-
-dkjson = require("dkjson")
-cjdns = require("cjdns")
-require("cjdns/uci")
-
-local f = SimpleForm("cjdrouteconf", translate("Edit cjdroute.conf"),
-       translate("JSON interface to what's /etc/cjdroute.conf on other systems. \
-    Will be parsed and written to UCI by <code>cjdrouteconf set</code>."))
-
-local o = f:field(Value, "_cjdrouteconf")
-o.template = "cbi/tvalue"
-o.rows = 25
-
-function o.cfgvalue(self, section)
-       return dkjson.encode(cjdns.uci.get(), { indent = true })
-end
-
-function o.write(self, section, value)
-  local obj, pos, err = dkjson.decode(value, 1, nil)
-
-  if obj then
-    cjdns.uci.set(obj)
-  end
-end
-
-return f
diff --git a/net/luci-app-cjdns/luasrc/model/cbi/cjdns/iptunnel.lua b/net/luci-app-cjdns/luasrc/model/cbi/cjdns/iptunnel.lua
deleted file mode 100644 (file)
index 02b37dd..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-uci = require "luci.model.uci"
-cursor = uci:cursor_state()
-
-m = Map("cjdns", translate("cjdns"),
-  translate("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."))
-
-m.on_after_commit = function(self)
-  os.execute("/etc/init.d/cjdns restart")
-end
-
--- Outgoing
-outgoing = m:section(TypedSection, "iptunnel_outgoing", translate("Outgoing IP Tunnel Connections"),
-  translate("Enter the public keys of the nodes that will provide Internet access."))
-outgoing.anonymous = true
-outgoing.addremove = true
-outgoing.template  = "cbi/tblsection"
-
-outgoing:option(Value, "public_key", translate("Public Key")).size = 55
-
--- Allowed
-allowed = m:section(TypedSection, "iptunnel_allowed", translate("Allowed IP Tunnel Connections"),
-  translate("Enter the public key of the node you will provide Internet access to, along with the \
-             IPv4 and/or IPv6 address you will assign them."))
-allowed.anonymous = true
-allowed.addremove = true
-
-public_key = allowed:option(Value, "public_key", translate("Public Key"))
-public_key.template = "cjdns/value"
-public_key.size = 55
-
-ipv4 = allowed:option(Value, "ipv4", translate("IPv4"))
-ipv4.template = "cjdns/value"
-ipv4.datatype = 'ipaddr'
-ipv4.size = 55
-
-ipv6 = allowed:option(Value, "ipv6", translate("IPv6"),
-  translate("IPv6 addresses should be entered <em>without</em> brackets here, e.g. <code>2001:123:ab::10</code>."))
-ipv6.template = "cjdns/value"
-ipv6.datatype = 'ip6addr'
-ipv6.size = 55
-
-return m
diff --git a/net/luci-app-cjdns/luasrc/model/cbi/cjdns/overview.lua b/net/luci-app-cjdns/luasrc/model/cbi/cjdns/overview.lua
deleted file mode 100644 (file)
index efa3a03..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-m = Map("cjdns", translate("cjdns"),
-  translate("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."))
-
-m:section(SimpleSection).template  = "cjdns/status"
-
-return m
diff --git a/net/luci-app-cjdns/luasrc/model/cbi/cjdns/peering.lua b/net/luci-app-cjdns/luasrc/model/cbi/cjdns/peering.lua
deleted file mode 100644 (file)
index 2b1fc1b..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-uci = require "luci.model.uci"
-cursor = uci:cursor_state()
-
-cjdns = require("cjdns")
-require("cjdns/uci")
-
-m = Map("cjdns", translate("cjdns"),
-  translate("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."))
-
-m.on_after_commit = function(self)
-  os.execute("/etc/init.d/cjdns restart")
-end
-
--- Authorized Passwords
-passwords = m:section(TypedSection, "password", translate("Authorized Passwords"),
-  translate("Anyone offering one of the these passwords will be allowed to peer with you on the existing UDP and Ethernet interfaces."))
-passwords.anonymous = true
-passwords.addremove = true
-passwords.template  = "cbi/tblsection"
-
-passwords:option(Value, "user", translate("User/Name"),
-  translate("Must be unique.")
-).default = "user-" .. cjdns.uci.random_string(6)
-passwords:option(Value, "contact", translate("Contact"), translate("Optional, for out-of-band communication."))
-passwords:option(Value, "password", translate("Password"),
-  translate("Hand out to your peer, in accordance with the peering best practices of the network.")
-).default = cjdns.uci.random_string(32)
-
--- UDP Peers
-udp_peers = m:section(TypedSection, "udp_peer", translate("Outgoing UDP Peers"),
-  translate("For peering via public IP networks, the peer handed you their Public Key and IP address/port along with a password. IPv6 addresses should be entered with square brackets, like so: <code>[2001::1]</code>."))
-udp_peers.anonymous = true
-udp_peers.addremove = true
-udp_peers.template  = "cbi/tblsection"
-udp_peers:option(Value, "user", translate("User/Name")).datatype = "string"
-
-udp_interface = udp_peers:option(Value, "interface", translate("UDP interface"))
-local index = 1
-for i,section in pairs(cursor:get_all("cjdns")) do
-  if section[".type"] == "udp_interface" then
-    udp_interface:value(index, section.address .. ":" .. section.port)
-  end
-end
-udp_interface.default = 1
-udp_peers:option(Value, "address", translate("IP address"))
-udp_peers:option(Value, "port", translate("Port")).datatype = "portrange"
-udp_peers:option(Value, "public_key", translate("Public key"))
-udp_peers:option(Value, "password", translate("Password"))
-
--- Ethernet Peers
-eth_peers = m:section(TypedSection, "eth_peer", translate("Outgoing Ethernet Peers"),
-  translate("For peering via local Ethernet networks, the peer handed you their Public Key and MAC address along with a password."))
-eth_peers.anonymous = true
-eth_peers.addremove = true
-eth_peers.template  = "cbi/tblsection"
-
-eth_interface = eth_peers:option(Value, "interface", translate("Ethernet interface"))
-local index = 1
-for i,section in pairs(cursor:get_all("cjdns")) do
-  if section[".type"] == "eth_interface" then
-    eth_interface:value(index, section.bind)
-  end
-end
-eth_interface.default = 1
-eth_peers:option(Value, "address", translate("MAC address")).datatype = "macaddr"
-eth_peers:option(Value, "public_key", translate("Public key"))
-eth_peers:option(Value, "password", translate("Password"))
-
-return m
diff --git a/net/luci-app-cjdns/luasrc/model/cbi/cjdns/settings.lua b/net/luci-app-cjdns/luasrc/model/cbi/cjdns/settings.lua
deleted file mode 100644 (file)
index d188915..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-m = Map("cjdns", translate("cjdns"),
-  translate("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."))
-
-m.on_after_commit = function(self)
-  os.execute("/etc/init.d/cjdns restart")
-end
-
-s = m:section(NamedSection, "cjdns", nil, translate("Settings"))
-s.addremove = false
-
--- Identity
-s:tab("identity", translate("Identity"))
-node6 = s:taboption("identity", Value, "ipv6", translate("IPv6 address"),
-      translate("This node's IPv6 address within the cjdns network."))
-node6.datatype = "ip6addr"
-pbkey = s:taboption("identity", Value, "public_key", translate("Public key"),
-      translate("Used for packet encryption and authentication."))
-pbkey.datatype = "string"
-prkey = s:taboption("identity", Value, "private_key", translate("Private key"),
-      translate("Keep this private. When compromised, generate a new keypair and IPv6."))
-prkey.datatype = "string"
-
--- Admin Interface
-s:tab("admin", translate("Admin API"), translate("The Admin API can be used by other applications or services to configure and inspect cjdns' routing and peering.<br/><br/>Documentation: <a href=\"https://github.com/cjdelisle/cjdns/tree/master/admin#cjdns-admin-api\">admin/README.md</a>"))
-aip = s:taboption("admin", Value, "admin_address", translate("IP Address"),
-      translate("IPv6 addresses should be entered like so: <code>[2001::1]</code>."))
-apt = s:taboption("admin", Value, "admin_port", translate("Port"))
-apt.datatype = "port"
-apw = s:taboption("admin", Value, "admin_password", translate("Password"))
-apw.datatype = "string"
-
--- Security
-s:tab("security", translate("Security"), translate("Functionality related to hardening the cjdroute process."))
-s:taboption("security", Flag, "seccomp", translate("SecComp sandboxing"))
-
--- UDP Interfaces
-udp_interfaces = m:section(TypedSection, "udp_interface", translate("UDP Interfaces"),
-  translate("These interfaces allow peering via public IP networks, such as the Internet, or many community-operated wireless networks. IPv6 addresses should be entered with square brackets, like so: <code>[2001::1]</code>."))
-udp_interfaces.anonymous = true
-udp_interfaces.addremove = true
-udp_interfaces.template = "cbi/tblsection"
-
-udp_address = udp_interfaces:option(Value, "address", translate("IP Address"))
-udp_address.placeholder = "0.0.0.0"
-udp_interfaces:option(Value, "port", translate("Port")).datatype = "portrange"
-
--- Ethernet Interfaces
-eth_interfaces = m:section(TypedSection, "eth_interface", translate("Ethernet Interfaces"),
-  translate("These interfaces allow peering via local Ethernet networks, such as home or office networks, or phone tethering. If an interface name is set to \"all\" each available device will be used."))
-eth_interfaces.anonymous = true
-eth_interfaces.addremove = true
-eth_interfaces.template = "cbi/tblsection"
-
-eth_bind = eth_interfaces:option(Value, "bind", translate("Network Interface"))
-eth_bind.placeholder = "br-lan"
-eth_beacon = eth_interfaces:option(Value, "beacon", translate("Beacon Mode"))
-eth_beacon:value(0, translate("0 -- Disabled"))
-eth_beacon:value(1, translate("1 -- Accept beacons"))
-eth_beacon:value(2, translate("2 -- Accept and send beacons"))
-eth_beacon.default = 2
-eth_beacon.datatype = "integer(range(0,2))"
-
-return m
diff --git a/net/luci-app-cjdns/luasrc/view/admin_status/index/cjdns.htm b/net/luci-app-cjdns/luasrc/view/admin_status/index/cjdns.htm
deleted file mode 100644 (file)
index 58c3843..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<%+cjdns/status%>
diff --git a/net/luci-app-cjdns/luasrc/view/cjdns/status.htm b/net/luci-app-cjdns/luasrc/view/cjdns/status.htm
deleted file mode 100644 (file)
index 9d43e85..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<script type="text/javascript">//<![CDATA[
-
-       var peersURI = '<%=luci.dispatcher.build_url("admin", "services", "cjdns", "peers")%>';
-       var updatePeers = function(x, peers) {
-               var table = document.getElementById('cjdns-peerings');
-               while (table.rows.length > 1) {
-                       table.deleteRow(1);
-               }
-
-               if ((peers) && ((peers.err) || (typeof peers.length === 'undefined'))) {
-                       var errpeer = (peers.err)
-                                               ? 'Socket Error: unable to connect to Admin API'
-                                               : 'No active peers';
-                       var row = table.insertRow(-1);
-                       row.className = 'cbi-section-table-row';
-                       var cell = row.insertCell(-1);
-                       cell.colSpan = 7;
-                       cell.textContent = errpeer;
-                       return;
-               };
-
-               peers.forEach(function(peer, i) {
-                       if (peer.user == null) {
-                               var user = '';
-                       } else if (peer.user == 'Local Peers') {
-                               var user = 'beacon';
-                       } else {
-                               var user = peer.user;
-                       }
-
-                       if (peer.isIncoming === 0) {
-                               var interface = 'outgoing';
-                       } else {
-                               var interface = 'incoming';
-                       }
-
-                       var status = interface + ', ' + peer.state.toLowerCase();
-
-                       if (peer.version === 0) {
-                               var version = '-';
-                       } else {
-                               var version = 'v' + peer.version;
-                       }
-
-                       var rxtx = lbbytes(peer.bytesIn) + ' / ' + lbbytes(peer.bytesOut);
-
-                       var row = table.insertRow(-1);
-                       row.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
-                       row.insertCell(-1).textContent = user;
-                       row.insertCell(-1).textContent = peer.ipv6;
-                       row.insertCell(-1).textContent = status;
-                       row.insertCell(-1).textContent = version;
-                       row.insertCell(-1).textContent = rxtx;
-                       var latencyCell = row.insertCell(-1);
-                       latencyCell.textContent = 'waiting';
-
-                       var pingURI = '<%=luci.dispatcher.build_url("admin", "services", "cjdns", "ping")%>';
-                       var timeout = 2000;
-                       XHR.get(pingURI, { label: peer.switchLabel, timeout: timeout }, function(x, pong) {
-                               var pongrsp = ((pong.err == "ai:recv > timeout") || (pong == "undefined") || (pong.ms >= timeout))
-                                       ? '> ' + timeout + ' ms'
-                                       : pong.ms + ' ms';
-                               latencyCell.textContent = pongrsp;
-                       })
-               });
-
-       };
-
-       XHR.get(peersURI, null, updatePeers);
-       XHR.poll(5, peersURI, null, updatePeers);
-
-//]]></script>
-
-<script type="text/javascript">
-<%# Author: [GitHub/75lb] -%>
-//<![CDATA[
-function lbbytes (bytes){
-
-       var kilobyte = 1024,
-           megabyte = kilobyte * 1024,
-           gigabyte = megabyte * 1024,
-           terabyte = gigabyte * 1024;
-
-       if ((bytes >= 0) && (bytes < kilobyte)) {
-               return bytes + " B";
-       } else if ((bytes >= kilobyte) && (bytes < megabyte)) {
-               return (bytes / kilobyte).toFixed(2) + " KB";
-       } else if ((bytes >= megabyte) && (bytes < gigabyte)) {
-               return (bytes / megabyte).toFixed(2) + " MB";
-       } else if ((bytes >= gigabyte) && (bytes < terabyte)) {
-               return (bytes / gigabyte).toFixed(2) + " GB";
-       } else if (bytes >= terabyte) {
-               return (bytes / terabyte).toFixed(2) + " TB";
-       } else {
-               return bytes + " B";
-       }
-};
-//]]>
-</script>
-
-<fieldset class="cbi-section">
-       <legend>Active cjdns peers</legend>
-       <table class="cbi-section-table" id="cjdns-peerings">
-               <tr class="cbi-section-table-titles">
-                       <th class="cbi-section-table-cell">User/Name</th>
-                       <th class="cbi-section-table-cell">IPv6</th>
-                       <th class="cbi-section-table-cell">Status</th>
-                       <th class="cbi-section-table-cell">Version</th>
-                       <th class="cbi-section-table-cell">Rx / Tx</th>
-                       <th class="cbi-section-table-cell">Latency</th>
-               </tr>
-               <tr class="cbi-section-table-row">
-                       <td colspan="7">Querying Admin API</td>
-               </tr>
-       </table>
-</fieldset>
diff --git a/net/luci-app-cjdns/luasrc/view/cjdns/value.htm b/net/luci-app-cjdns/luasrc/view/cjdns/value.htm
deleted file mode 100644 (file)
index d1e54bb..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<%+cbi/valueheader%>
-       <input type="<%=self.password and 'password" class="cbi-input-password' or 'text" class="cbi-input-text' %>" onchange="cbi_d_update(this.id)"<%=
-               attr("name", cbid) .. attr("id", cbid) .. attr("value", self:cfgvalue(section) or self.default) ..
-               ifattr(self.size, "size") .. ifattr(self.placeholder, "placeholder")
-       %> style="width: auto" />
-       <% if self.password then %><img src="<%=resource%>/cbi/reload.gif" style="vertical-align:middle" title="<%:Reveal/hide password%>" onclick="var e = document.getElementById('<%=cbid%>'); e.type = (e.type=='password') ? 'text' : 'password';" /><% end %>
-       <% if #self.keylist > 0 or self.datatype then -%>
-       <script type="text/javascript">//<![CDATA[
-               <% if #self.keylist > 0 then -%>
-               cbi_combobox_init('<%=cbid%>', {
-               <%-
-                       for i, k in ipairs(self.keylist) do
-               -%>
-                       <%-=string.format("%q", k) .. ":" .. string.format("%q", self.vallist[i])-%>
-                       <%-if i<#self.keylist then-%>,<%-end-%>
-               <%-
-                       end
-               -%>
-               }, '<%- if not self.rmempty and not self.optional then -%>
-                       <%-: -- Please choose -- -%>
-                       <%- elseif self.placeholder then -%>
-                       <%-= pcdata(self.placeholder) -%>
-               <%- end -%>', '
-               <%- if self.combobox_manual then -%>
-                       <%-=self.combobox_manual-%>
-               <%- else -%>
-                       <%-: -- custom -- -%>
-               <%- end -%>');
-               <%- end %>
-               <% if self.datatype then -%>
-               cbi_validate_field('<%=cbid%>', <%=tostring((self.optional or self.rmempty) == true)%>, '<%=self.datatype:gsub("'", "\\'")%>');
-               <%- end %>
-       //]]></script>
-       <% end -%>
-<%+cbi/valuefooter%>
diff --git a/net/luci-app-clamav/Makefile b/net/luci-app-clamav/Makefile
deleted file mode 100644 (file)
index fed8e63..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luci-app-clamav
-PKG_RELEASE:=20150520
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-PKG_LICENSE:=Apache-2.0
-PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luci-app-clamav
-  SECTION:=luci
-  CATEGORY:=LuCI
-  SUBMENU:=3. Applications
-  TITLE:=ClamAV Web UI
-  DEPENDS:=+luci-mod-admin-full +clamav
-endef
-
-define Package/luci-app-clamav/description
- This package will install ClamAV Web UI.
-endef
-
-define Build/Prepare
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/luci-app-clamav/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller/
-       $(INSTALL_BIN) \
-               ./files/controller/clamav-controller.lua \
-               $(1)/usr/lib/lua/luci/controller/clamav.lua
-
-       $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/
-       $(INSTALL_BIN) \
-               ./files/model/cbi/clamav-cbi.lua \
-               $(1)/usr/lib/lua/luci/model/cbi/clamav.lua
-endef
-
-$(eval $(call BuildPackage,luci-app-clamav))
diff --git a/net/luci-app-clamav/files/controller/clamav-controller.lua b/net/luci-app-clamav/files/controller/clamav-controller.lua
deleted file mode 100644 (file)
index 02f3bfc..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---[[
-
-LuCI ClamAV module
-
-Copyright (C) 2015, Itus Networks, Inc.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Author: Marko Ratkaj <marko.ratkaj@sartura.hr>
-       Luka Perkov <luka.perkov@sartura.hr>
-
-]]--
-
-module("luci.controller.clamav", package.seeall)
-
-function index()
-       entry({"admin", "services", "clamav"}, cbi("clamav"), _("ClamAV"))
-end
diff --git a/net/luci-app-clamav/files/model/cbi/clamav-cbi.lua b/net/luci-app-clamav/files/model/cbi/clamav-cbi.lua
deleted file mode 100644 (file)
index ff98139..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
---[[
-
-LuCI ClamAV module
-
-Copyright (C) 2015, Itus Networks, Inc.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Author: Marko Ratkaj <marko.ratkaj@sartura.hr>
-       Luka Perkov <luka.perkov@sartura.hr>
-
-]]--
-
-local fs = require "nixio.fs"
-local sys = require "luci.sys"
-require "ubus"
-
-m = Map("clamav", translate("ClamAV"))
-m.on_after_commit = function() luci.sys.call("/etc/init.d/clamav restart") end
-
-s = m:section(TypedSection, "clamav")
-s.anonymous = true
-s.addremove = false
-
-s:tab("tab_advanced", translate("Settings"))
-s:tab("tab_logs", translate("Log"))
-
---------------- Settings --------------
-
-LogFileMaxSize = s:taboption("tab_advanced", Value, "LogFileMaxSize", translate("Max size of log file"))
-LogFileMaxSize:value("512K",  translate("512K"))
-LogFileMaxSize:value("1M",  translate("1M"))
-LogFileMaxSize:value("2M",  translate("2M"))
-LogFileMaxSize.default = "1M"
-
-LogTime = s:taboption("tab_advanced", ListValue, "LogTime", translate("Log time with each message"))
-LogTime:value("no",  translate("No"))
-LogTime:value("yes",  translate("Yes"))
-LogTime.default = "no"
-
-LogVerbose = s:taboption("tab_advanced", ListValue, "LogVerbose", translate("Enable verbose logging"))
-LogVerbose:value("no",  translate("No"))
-LogVerbose:value("yes",  translate("Yes"))
-LogVerbose.default = "no"
-
-ExtendedDetectionInfo = s:taboption("tab_advanced", ListValue, "ExtendedDetectionInfo", translate("Log additional infection info"))
-ExtendedDetectionInfo:value("no",  translate("No"))
-ExtendedDetectionInfo:value("yes",  translate("Yes"))
-ExtendedDetectionInfo.default = "no"
-
-dummy3 = s:taboption("tab_advanced", DummyValue, "")
-dummy4 = s:taboption("tab_advanced", DummyValue, "")
-
-MaxDirectoryRecursion = s:taboption("tab_advanced", Value, "MaxDirectoryRecursion", translate("Max directory scan depth"))
-MaxDirectoryRecursion:value("15",  translate("15"))
-MaxDirectoryRecursion:value("20",  translate("20"))
-MaxDirectoryRecursion.default = "15"
-
-FollowDirectorySymlink = s:taboption("tab_advanced", ListValue, "FollowDirectorySymlink", translate("Follow directory symlinks"))
-FollowDirectorySymlink:value("no",  translate("No"))
-FollowDirectorySymlink:value("yes",  translate("Yes"))
-FollowDirectorySymlink.default = "no"
-
-FollowFileSymlinks = s:taboption("tab_advanced", ListValue, "FollowFileSymlinks", translate("Follow file symlinks"))
-FollowFileSymlinks:value("no",  translate("No"))
-FollowFileSymlinks:value("yes",  translate("Yes"))
-FollowFileSymlinks.default = "no"
-
-DetectPUA = s:taboption("tab_advanced", ListValue, "DetectPUA", translate("Detect possibly unwanted apps"))
-DetectPUA:value("no",  translate("No"))
-DetectPUA:value("yes",  translate("Yes"))
-DetectPUA.default = "no"
-
-ScanPE = s:taboption("tab_advanced", ListValue, "ScanPE", translate("Scan portable executables"))
-ScanPE:value("no",  translate("No"))
-ScanPE:value("yes",  translate("Yes"))
-ScanPE.default = "yes"
-
-ScanELF = s:taboption("tab_advanced", ListValue, "ScanELF", translate("Scan ELF files"))
-ScanELF:value("no",  translate("No"))
-ScanELF:value("yes",  translate("Yes"))
-ScanELF.default = "yes"
-
-DetectBrokenExecutables = s:taboption("tab_advanced", ListValue, "DetectBrokenExecutables", translate("Detect broken executables"))
-DetectBrokenExecutables:value("no",  translate("No"))
-DetectBrokenExecutables:value("yes",  translate("Yes"))
-DetectBrokenExecutables.default = "no"
-
-ScanOLE2 = s:taboption("tab_advanced", ListValue, "ScanOLE2", translate("Scan MS Office and .msi files"))
-ScanOLE2:value("no",  translate("No"))
-ScanOLE2:value("yes",  translate("Yes"))
-ScanOLE2.default = "yes"
-
-ScanPDF = s:taboption("tab_advanced", ListValue, "ScanPDF", translate("Scan pdf files"))
-ScanPDF:value("no",  translate("No"))
-ScanPDF:value("yes",  translate("Yes"))
-ScanPDF.default = "yes"
-
-ScanSWF = s:taboption("tab_advanced", ListValue, "ScanSWF", translate("Scan swf files"))
-ScanSWF:value("no",  translate("No"))
-ScanSWF:value("yes",  translate("Yes"))
-ScanSWF.default = "yes"
-
-ScanMail = s:taboption("tab_advanced", ListValue, "ScanMail", translate("Scan emails"))
-ScanMail:value("no",  translate("No"))
-ScanMail:value("yes",  translate("Yes"))
-ScanMail.default = "yes"
-
-ScanPartialMessages = s:taboption("tab_advanced", ListValue, "ScanPartialMessages", translate("Scan RFC1341 messages split over many emails"))
-ScanPartialMessages:value("no",  translate("No"))
-ScanPartialMessages:value("yes",  translate("Yes"))
-ScanPartialMessages.default = "no"
-
-ScanArchive = s:taboption("tab_advanced", ListValue, "ScanArchive", translate("Scan archives"))
-ScanArchive:value("no",  translate("No"))
-ScanArchive:value("yes",  translate("Yes"))
-ScanArchive.default = "yes"
-
-ArchiveBlockEncrypted = s:taboption("tab_advanced", ListValue, "ArchiveBlockEncrypted", translate("Block encrypted archives"))
-ArchiveBlockEncrypted:value("no",  translate("No"))
-ArchiveBlockEncrypted:value("yes",  translate("Yes"))
-ArchiveBlockEncrypted.default = "no"
-
-dummy5 = s:taboption("tab_advanced", DummyValue, "")
-dummy6 = s:taboption("tab_advanced", DummyValue, "")
-
-StreamMinPort = s:taboption("tab_advanced", Value, "StreamMinPort", translate("Port range, lowest port"))
-StreamMinPort.datatype = "portrange"
-StreamMinPort:value("1024",translate("1024"))
-StreamMinPort.default = "1024"
-
-StreamMaxPort = s:taboption("tab_advanced", Value, "StreamMaxPort", translate("Port range, highest port"))
-StreamMaxPort.datatype = "portrange"
-StreamMaxPort:value("2048",translate("2048"))
-StreamMaxPort.default = "2048"
-
-MaxThreads = s:taboption("tab_advanced", Value, "MaxThreads", translate("Max number of threads"))
-MaxThreads.datatype = "and(uinteger,min(1))"
-MaxThreads:value("10",translate("10"))
-MaxThreads:value("20",translate("20"))
-MaxThreads.default = "10"
-
-SelfCheck = s:taboption("tab_advanced", Value, "SelfCheck", translate("Database check every N sec"))
-SelfCheck.datatype = "and(uinteger,min(1))"
-SelfCheck:value("600",translate("600"))
-SelfCheck.default = "600"
-
-MaxFileSize = s:taboption("tab_advanced", Value, "MaxFileSize", translate("Max size of scanned file"))
-MaxFileSize.datatype = "string"
-MaxFileSize:value("150M",translate("150M"))
-MaxFileSize:value("50M",translate("50M"))
-MaxFileSize.default = "150M"
-
------------------- Log --------------------
-
-clamav_logfile = s:taboption("tab_logs", TextValue, "lines", "")
-clamav_logfile.wrap = "off"
-clamav_logfile.rows = 25
-clamav_logfile.rmempty = true
-
-function clamav_logfile.cfgvalue()
-       local uci = require "luci.model.uci".cursor_state()
-       local file = "/tmp/clamd.log"
-       if file then
-               return fs.readfile(file) or ""
-       else
-               return ""
-       end
-end
-
-function clamav_logfile.write()
-end
-
-return m
diff --git a/net/luci-app-e2guardian/Makefile b/net/luci-app-e2guardian/Makefile
deleted file mode 100644 (file)
index 880f373..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luci-app-e2guardian
-PKG_RELEASE:=20150520
-
-PKG_LICENSE:=Apache-2.0
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luci-app-e2guardian
-  SECTION:=luci
-  CATEGORY:=LuCI
-  SUBMENU:=3. Applications
-  TITLE:=E2Guardian Web UI
-  DEPENDS:=+luci-mod-admin-full +e2guardian
-  MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
-endef
-
-define Package/luci-app-e2guardian/description
- This package will install E2Guardian Web UI.
-endef
-
-define Build/Prepare
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/luci-app-e2guardian/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller/
-       $(INSTALL_BIN) \
-               ./files/e2guardian-controller.lua \
-               $(1)/usr/lib/lua/luci/controller/e2guardian.lua
-
-       $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/
-       $(INSTALL_BIN) \
-               ./files//e2guardian-cbi.lua \
-               $(1)/usr/lib/lua/luci/model/cbi/e2guardian.lua
-endef
-
-$(eval $(call BuildPackage,luci-app-e2guardian))
diff --git a/net/luci-app-e2guardian/files/e2guardian-cbi.lua b/net/luci-app-e2guardian/files/e2guardian-cbi.lua
deleted file mode 100644 (file)
index b621321..0000000
+++ /dev/null
@@ -1,399 +0,0 @@
---[[
-
-LuCI E2Guardian module
-
-Copyright (C) 2015, Itus Networks, Inc.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Author: Marko Ratkaj <marko.ratkaj@sartura.hr>
-       Luka Perkov <luka.perkov@sartura.hr>
-
-]]--
-
-local fs = require "nixio.fs"
-local sys = require "luci.sys"
-
-m = Map("e2guardian", translate("E2Guardian"))
-m.on_after_commit = function() luci.sys.call("/etc/init.d/e2guardian restart") end
-
-s = m:section(TypedSection, "e2guardian")
-s.anonymous = true
-s.addremove = false
-
-s:tab("tab_general", translate("General Settings"))
-s:tab("tab_additional", translate("Additional Settings"))
-s:tab("tab_logs", translate("Logs"))
-
-
------------------ General Settings Tab -----------------------
-
-filterip = s:taboption("tab_general", Value, "filterip", translate("IP that E2Guardian listens"))
-filterip.datatype = "ip4addr"
-
-filterports = s:taboption("tab_general", Value, "filterports", translate("Port that E2Guardian listens"))
-filterports.datatype = "portrange"
-filterports.placeholder = "0-65535"
-
-proxyip = s:taboption("tab_general", Value, "proxyip", translate("IP address of the proxy"))
-proxyip.datatype = "ip4addr"
-proxyip.default = "127.0.0.1"
-
-proxyport = s:taboption("tab_general", Value, "proxyport", translate("Port of the proxy"))
-proxyport.datatype = "portrange"
-proxyport.placeholder = "0-65535"
-
-languagedir = s:taboption("tab_general", Value, "languagedir", translate("Language dir"))
-languagedir.datatype = "string"
-languagedir.default = "/usr/share/e2guardian/languages"
-
-language = s:taboption("tab_general", Value, "language", translate("Language to use"))
-language.datatype = "string"
-language.default = "ukenglish"
-
-loglevel = s:taboption("tab_general", ListValue, "loglevel", translate("Logging Settings"))
-loglevel:value("0",  translate("none"))
-loglevel:value("1",  translate("just denied"))
-loglevel:value("2",  translate("all text based"))
-loglevel:value("3",  translate("all requests"))
-loglevel.default = "2"
-
-logexceptionhits = s:taboption("tab_general", ListValue, "logexceptionhits", translate("Log Exception Hits"))
-logexceptionhits:value("0",  translate("never"))
-logexceptionhits:value("1",  translate("log, but don't mark as exceptions"))
-logexceptionhits:value("2",  translate("log and mark"))
-logexceptionhits.default = "2"
-
-logfileformat = s:taboption("tab_general", ListValue, "logfileformat", translate("Log File Format"))
-logfileformat:value("1",  translate("DansgGuardian format, space delimited"))
-logfileformat:value("2",  translate("CSV-style format"))
-logfileformat:value("3",  translate("Squid Log File Format"))
-logfileformat:value("4",  translate("Tab delimited"))
-logfileformat:value("5",  translate("Protex format"))
-logfileformat:value("6",  translate("Protex format with server field blanked"))
-logfileformat.default = "1"
-
-accessdeniedaddress = s:taboption("tab_general", Value, "accessdeniedaddress", translate("Access denied address"),
-translate("Server to which the cgi e2guardian reporting script was copied. Reporting levels 1 and 2 only"))
-accessdeniedaddress.datatype = "string"
-accessdeniedaddress.default = "http://YOURSERVER.YOURDOMAIN/cgi-bin/e2guardian.pl"
-
-usecustombannedimage = s:taboption("tab_general", ListValue, "usecustombannedimage", translate("Banned image replacement"))
-usecustombannedimage:value("on",  translate("Yes"))
-usecustombannedimage:value("off",  translate("No"))
-usecustombannedimage.default = "on"
-
-custombannedimagefile = s:taboption("tab_general", Value, "custombannedimagefile", translate("Custom banned image file"))
-custombannedimagefile.datatype = "string"
-custombannedimagefile.default = "/usr/share/e2guardian/transparent1x1.gif"
-
-usecustombannedflash = s:taboption("tab_general", ListValue, "usecustombannedflash", translate("Banned flash replacement"))
-usecustombannedflash:value("on",  translate("Yes"))
-usecustombannedflash:value("off",  translate("No"))
-usecustombannedflash.default = "on"
-
-custombannedflashfile = s:taboption("tab_general", Value, "custombannedflashfile", translate("Custom banned flash file"))
-custombannedflashfile.datatype = "string"
-custombannedflashfile.default = "/usr/share/e2guardian/blockedflash.swf"
-
-filtergroups = s:taboption("tab_general", Value, "filtergroups", translate("Number of filter groups"))
-filtergroups.datatype = "and(uinteger,min(1))"
-filtergroups.default = "1"
-
-filtergroupslist = s:taboption("tab_general", Value, "filtergroupslist", translate("List of filter groups"))
-filtergroupslist.datatype = "string"
-filtergroupslist.default = "/etc/e2guardian/lists/filtergroupslist"
-
-bannediplist = s:taboption("tab_general", Value, "bannediplist", translate("List of banned IPs"))
-bannediplist.datatype = "string"
-bannediplist.default = "/etc/e2guardian/lists/bannediplist"
-
-exceptioniplist = s:taboption("tab_general", Value, "exceptioniplist", translate("List of IP exceptions"))
-exceptioniplist.datatype = "string"
-exceptioniplist.default = "/etc/e2guardian/lists/exceptioniplist"
-
-perroomblockingdirectory = s:taboption("tab_general", Value, "perroomblockingdirectory", translate("Per-Room blocking definition directory"))
-perroomblockingdirectory.datatype = "string"
-perroomblockingdirectory.default = "/etc/e2guardian/lists/bannedrooms/"
-
-showweightedfound = s:taboption("tab_general", ListValue, "showweightedfound", translate("Show weighted phrases found"))
-showweightedfound:value("on",  translate("Yes"))
-showweightedfound:value("off",  translate("No"))
-showweightedfound.default = "on"
-
-weightedphrasemode = s:taboption("tab_general", ListValue, "weightedphrasemode", translate("Weighted phrase mode"))
-weightedphrasemode:value("0",  translate("off"))
-weightedphrasemode:value("1",  translate("on, normal operation"))
-weightedphrasemode:value("2",  translate("on, phrase found only counts once on a page"))
-weightedphrasemode.default = "2"
-
-urlcachenumber = s:taboption("tab_general", Value, "urlcachenumber", translate("Clean result caching for URLs"))
-urlcachenumber.datatype = "and(uinteger,min(0))"
-urlcachenumber.default = "1000"
-
-urlcacheage = s:taboption("tab_general", Value, "urlcacheage", translate("Age before they should be ignored in seconds"))
-urlcacheage.datatype = "and(uinteger,min(0))"
-urlcacheage.default = "900"
-
-scancleancache = s:taboption("tab_general", ListValue, "scancleancache", translate("Cache for content (AV) scans as 'clean'"))
-scancleancache:value("on",  translate("Yes"))
-scancleancache:value("off",  translate("No"))
-scancleancache.default = "on"
-
-phrasefiltermode = s:taboption("tab_general", ListValue, "phrasefiltermode", translate("Filtering options"))
-phrasefiltermode:value("0",  translate("raw"))
-phrasefiltermode:value("1",  translate("smart"))
-phrasefiltermode:value("2",  translate("both raw and smart"))
-phrasefiltermode:value("3",  translate("meta/title"))
-phrasefiltermode.default = "2"
-
-preservecase = s:taboption("tab_general", ListValue, "perservecase", translate("Lower caseing options"))
-preservecase:value("0",  translate("force lower case"))
-preservecase:value("1",  translate("don't change"))
-preservecase:value("2",  translate("scan fist in lower, then in original"))
-preservecase.default = "0"
-
-hexdecodecontent = s:taboption("tab_general", ListValue, "hexdecodecontent", translate("Hex decoding options"))
-hexdecodecontent:value("on",  translate("Yes"))
-hexdecodecontent:value("off",  translate("No"))
-hexdecodecontent.default = "off"
-
-forcequicksearch = s:taboption("tab_general", ListValue, "forcequicksearch", translate("Quick search"))
-forcequicksearch:value("on",  translate("Yes"))
-forcequicksearch:value("off",  translate("No"))
-forcequicksearch.default = "off"
-
-reverseaddresslookups= s:taboption("tab_general", ListValue, "reverseaddresslookups", translate("Reverse lookups for banned site and URLs"))
-reverseaddresslookups:value("on",  translate("Yes"))
-reverseaddresslookups:value("off",  translate("No"))
-reverseaddresslookups.default = "off"
-
-reverseclientiplookups = s:taboption("tab_general", ListValue, "reverseclientiplookups", translate("Reverse lookups for banned and exception IP lists"))
-reverseclientiplookups:value("on",  translate("Yes"))
-reverseclientiplookups:value("off",  translate("No"))
-reverseclientiplookups.default = "off"
-
-logclienthostnames = s:taboption("tab_general", ListValue, "logclienthostnames", translate("Perform reverse lookups on client IPs for successful requests"))
-logclienthostnames:value("on",  translate("Yes"))
-logclienthostnames:value("off",  translate("No"))
-logclienthostnames.default = "off"
-
-createlistcachefiles = s:taboption("tab_general", ListValue, "createlistcachefiles", translate("Build bannedsitelist and bannedurllist cache files"))
-createlistcachefiles:value("on",translate("Yes"))
-createlistcachefiles:value("off",translate("No"))
-createlistcachefiles.default = "on"
-
-prefercachedlists = s:taboption("tab_general", ListValue, "prefercachedlists", translate("Prefer cached list files"))
-prefercachedlists:value("on",  translate("Yes"))
-prefercachedlists:value("off",  translate("No"))
-prefercachedlists.default = "off"
-
-maxuploadsize = s:taboption("tab_general", Value, "maxuploadsize", translate("Max upload size (in Kbytes)"))
-maxuploadsize:value("-1",  translate("no blocking"))
-maxuploadsize:value("0",  translate("complete block"))
-maxuploadsize.default = "-1"
-
-maxcontentfiltersize = s:taboption("tab_general", Value, "maxcontentfiltersize", translate("Max content filter size"),
-translate("The value must not be higher than max content ram cache scan size or 0 to match it"))
-maxcontentfiltersize.datatype = "and(uinteger,min(0))"
-maxcontentfiltersize.default = "256"
-
-maxcontentramcachescansize = s:taboption("tab_general", Value, "maxcontentramcachescansize", translate("Max content ram cache scan size"),
-translate("This is the max size of file that DG will download and cache in RAM"))
-maxcontentramcachescansize.datatype = "and(uinteger,min(0))"
-maxcontentramcachescansize.default = "2000"
-
-maxcontentfilecachescansize = s:taboption("tab_general", Value, "maxcontentfilecachescansize", translate("Max content file cache scan size"))
-maxcontentfilecachescansize.datatype = "and(uinteger,min(0))"
-maxcontentfilecachescansize.default = "20000"
-
-proxytimeout = s:taboption("tab_general", Value, "proxytimeout", translate("Proxy timeout (5-100)"))
-proxytimeout.datatype = "range(5,100)"
-proxytimeout.default = "20"
-
-proxyexchange = s:taboption("tab_general", Value, "proxyexchange", translate("Proxy header excahnge (20-300)"))
-proxyexchange.datatype = "range(20,300)"
-proxyexchange.default = "20"
-
-pcontimeout = s:taboption("tab_general", Value, "pcontimeout", translate("Pconn timeout"),
-translate("How long a persistent connection will wait for other requests"))
-pcontimeout.datatype = "range(5,300)"
-pcontimeout.default = "55"
-
-filecachedir = s:taboption("tab_general", Value, "filecachedir", translate("File cache directory"))
-filecachedir.datatype = "string"
-filecachedir.default = "/tmp"
-
-deletedownloadedtempfiles = s:taboption("tab_general", ListValue, "deletedownloadedtempfiles", translate("Delete file cache after user completes download"))
-deletedownloadedtempfiles:value("on",  translate("Yes"))
-deletedownloadedtempfiles:value("off", translate("No"))
-deletedownloadedtempfiles.default = "on"
-
-initialtrickledelay = s:taboption("tab_general", Value, "initialtrickledelay", translate("Initial Trickle delay"),
-translate("Number of seconds a browser connection is left waiting before first being sent *something* to keep it alive"))
-initialtrickledelay.datatype = "and(uinteger,min(0))"
-initialtrickledelay.default = "20"
-
-trickledelay = s:taboption("tab_general", Value, "trickledelay", translate("Trickle delay"),
-translate("Number of seconds a browser connection is left waiting before being sent more *something* to keep it alive"))
-trickledelay.datatype = "and(uinteger,min(0))"
-trickledelay.default = "10"
-
-downloadmanager = s:taboption("tab_general", Value, "downloadmanager", translate("Download manager"))
-downloadmanager.datatype = "string"
-downloadmanager.default = "/etc/e2guardian/downloadmanagers/default.conf"
-
-contentscannertimeout = s:taboption("tab_general", Value, "contentscannertimeout", translate("Content scanner timeout"))
-contentscannertimeout.datatype = "and(uinteger,min(0))"
-contentscannertimeout.default = "60"
-
-contentscanexceptions = s:taboption("tab_general", ListValue, "contentscanexceptions", translate("Content scan exceptions"))
-contentscanexceptions:value("on",  translate("Yes"))
-contentscanexceptions:value("off", translate("No"))
-contentscanexceptions.default = "off"
-
-recheckreplacedurls = s:taboption("tab_general", ListValue, "recheckreplacedurls", translate("e-check replaced URLs"))
-recheckreplacedurls:value("on",  translate("Yes"))
-recheckreplacedurls:value("off", translate("No"))
-recheckreplacedurls.default = "off"
-
-forwardedfor = s:taboption("tab_general", ListValue, "forwardedfor", translate("Misc setting: forwardedfor"),
-translate("If on, it may help solve some problem sites that need to know the source ip."))
-forwardedfor:value("on",  translate("Yes"))
-forwardedfor:value("off", translate("No"))
-forwardedfor.default = "off"
-
-usexforwardedfor = s:taboption("tab_general", ListValue, "usexforwardedfor", translate("Misc setting: usexforwardedfor"),
-translate("This is for when you have squid between the clients and E2Guardian"))
-usexforwardedfor:value("on",  translate("Yes"))
-usexforwardedfor:value("off", translate("No"))
-usexforwardedfor.default = "off"
-
-logconnectionhandlingerrors = s:taboption("tab_general", ListValue, "logconnectionhandlingerrors", translate("Log debug info about log()ing and accept()ing"))
-logconnectionhandlingerrors:value("on",  translate("Yes"))
-logconnectionhandlingerrors:value("off", translate("No"))
-logconnectionhandlingerrors.default = "on"
-
-logchildprocesshandling = s:taboption("tab_general", ListValue, "logchildprocesshandling", translate("Log child process handling"))
-logchildprocesshandling:value("on",  translate("Yes"))
-logchildprocesshandling:value("off", translate("No"))
-logchildprocesshandling.default = "off"
-
-maxchildren = s:taboption("tab_general", Value, "maxchildren", translate("Max number of processes to spawn"))
-maxchildren.datatype = "and(uinteger,min(0))"
-maxchildren.default = "180"
-
-minchildren = s:taboption("tab_general", Value, "minchildren", translate("Min number of processes to spawn"))
-minchildren.datatype = "and(uinteger,min(0))"
-minchildren.default = "20"
-
-minsparechildren = s:taboption("tab_general", Value, "minsparechildren", translate("Min number of processes to keep ready"))
-minsparechildren.datatype = "and(uinteger,min(0))"
-minsparechildren.default = "16"
-
-preforkchildren = s:taboption("tab_general", Value, "preforkchildren", translate("Sets minimum nuber of processes when it runs out"))
-preforkchildren.datatype = "and(uinteger,min(0))"
-preforkchildren.default = "10"
-
-maxsparechildren = s:taboption("tab_general", Value, "maxsparechildren", translate("Sets the maximum number of processes to have doing nothing"))
-maxsparechildren.datatype = "and(uinteger,min(0))"
-maxsparechildren.default = "32"
-
-maxagechildren = s:taboption("tab_general", Value, "maxagechildren", translate("Max age of child process"))
-maxagechildren.datatype = "and(uinteger,min(0))"
-maxagechildren.default = "500"
-
-maxips = s:taboption("tab_general", Value, "maxips", translate("Max number of clinets allowed to connect"))
-maxips:value("0",  translate("no limit"))
-maxips.default = "0"
-
-ipipcfilename = s:taboption("tab_general", Value, "ipipcfilename", translate("IP list IPC server directory and filename"))
-ipipcfilename.datatype = "string"
-ipipcfilename.default = "/tmp/.dguardianipc"
-
-urlipcfilename = s:taboption("tab_general", Value, "urlipcfilename", translate("Defines URL list IPC server directory and filename used to communicate with the URL cache process"))
-urlipcfilename.datatype = "string"
-urlipcfilename.default = "/tmp/.dguardianurlipc"
-
-ipcfilename = s:taboption("tab_general", Value, "ipcfilename", translate("Defines URL list IPC server directory and filename used to communicate with the URL cache process"))
-ipcfilename.datatype = "string"
-ipcfilename.default = "/tmp/.dguardianipipc"
-
-nodeamon = s:taboption("tab_general", ListValue, "nodeamon", translate("Disable deamoning"))
-nodeamon:value("on",  translate("Yes"))
-nodeamon:value("off", translate("No"))
-nodeamon.default = "off"
-
-nologger = s:taboption("tab_general", ListValue, "nologger", translate("Disable logger"))
-nologger:value("on",  translate("Yes"))
-nologger:value("off", translate("No"))
-nologger.default = "off"
-
-logadblock = s:taboption("tab_general", ListValue, "logadblock", translate("Enable logging of ADs"))
-logadblock:value("on",  translate("Yes"))
-logadblock:value("off", translate("No"))
-logadblock.default = "off"
-
-loguseragent = s:taboption("tab_general", ListValue, "loguseragent", translate("Enable logging of client user agent"))
-loguseragent:value("on",  translate("Yes"))
-loguseragent:value("off", translate("No"))
-loguseragent.default = "off"
-
-softrestart = s:taboption("tab_general", ListValue, "softrestart", translate("Enable soft restart"))
-softrestart:value("on",  translate("Yes"))
-softrestart:value("off", translate("No"))
-softrestart.default = "off"
-
-
------------------------- Additional Settings Tab ----------------------------
-
-e2guardian_config_file = s:taboption("tab_additional", TextValue, "_data", "")
-e2guardian_config_file.wrap = "off"
-e2guardian_config_file.rows = 25
-e2guardian_config_file.rmempty = false
-
-function e2guardian_config_file.cfgvalue()
-       local uci = require "luci.model.uci".cursor_state()
-       file = "/etc/e2guardian/e2guardianf1.conf"
-       if file then
-               return fs.readfile(file) or ""
-       else
-               return ""
-       end
-end
-
-function e2guardian_config_file.write(self, section, value)
-       if value then
-               local uci = require "luci.model.uci".cursor_state()
-               file = "/etc/e2guardian/e2guardianf1.conf"
-               fs.writefile(file, value:gsub("\r\n", "\n"))
-       end
-end
-
-
----------------------------- Logs Tab -----------------------------
-
-e2guardian_logfile = s:taboption("tab_logs", TextValue, "lines", "")
-e2guardian_logfile.wrap = "off"
-e2guardian_logfile.rows = 25
-e2guardian_logfile.rmempty = true
-
-function e2guardian_logfile.cfgvalue()
-       local uci = require "luci.model.uci".cursor_state()
-       file = "/tmp/e2guardian/access.log"
-       if file then
-               return fs.readfile(file) or ""
-       else
-               return "Can't read log file"
-       end
-end
-
-function e2guardian_logfile.write()
-        return ""
-end
-
-return m
diff --git a/net/luci-app-e2guardian/files/e2guardian-controller.lua b/net/luci-app-e2guardian/files/e2guardian-controller.lua
deleted file mode 100644 (file)
index dd545f5..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---[[
-
-LuCI E2Guardian module
-
-Copyright (C) 2015, Itus Networks, Inc.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Author: Marko Ratkaj <marko.ratkaj@sartura.hr>
-       Luka Perkov <luka.perkov@sartura.hr>
-
-]]--
-
-module("luci.controller.e2guardian", package.seeall)
-
-function index()
-       entry({"admin", "services", "e2guardian"}, cbi("e2guardian"), _("E2Guardian"))
-end
diff --git a/net/luci-app-squid/Makefile b/net/luci-app-squid/Makefile
deleted file mode 100644 (file)
index 91ce724..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luci-app-squid
-PKG_RELEASE:=20150608
-
-PKG_LICENSE:=Apache-2.0
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luci-app-squid
-  SECTION:=luci
-  CATEGORY:=LuCI
-  SUBMENU:=3. Applications
-  TITLE:=Squid Web UI
-  DEPENDS:=+luci-mod-admin-full +squid
-  MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
-endef
-
-define Package/luci-app-squid/description
- This package will install Squid Web UI.
-endef
-
-define Build/Prepare
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/luci-app-squid/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller/
-       $(INSTALL_BIN) \
-               ./files/squid-controller.lua \
-               $(1)/usr/lib/lua/luci/controller/squid.lua
-
-       $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/
-       $(INSTALL_BIN) \
-               ./files//squid-cbi.lua \
-               $(1)/usr/lib/lua/luci/model/cbi/squid.lua
-endef
-
-$(eval $(call BuildPackage,luci-app-squid))
diff --git a/net/luci-app-squid/files/squid-cbi.lua b/net/luci-app-squid/files/squid-cbi.lua
deleted file mode 100644 (file)
index 0ac554a..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
---[[
-
-LuCI Squid module
-
-Copyright (C) 2015, OpenWrt.org
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Author: Marko Ratkaj <marko.ratkaj@sartura.hr>
-
-]]--
-
-local fs = require "nixio.fs"
-local sys = require "luci.sys"
-require "ubus"
-
-m = Map("squid", translate("Squid"))
-m.on_after_commit = function() luci.sys.call("/etc/init.d/squid restart") end
-
-s = m:section(TypedSection, "squid")
-s.anonymous = true
-s.addremove = false
-
-s:tab("general", translate("General Settings"))
-
-http_port = s:taboption("general", Value, "http_port", translate("Port"))
-http_port.datatype = "portrange"
-http_port.placeholder = "0-65535"
-
-visible_hostname = s:taboption("general", Value, "visible_hostname", translate("Visible Hostname"))
-visible_hostname.datatype="string"
-visible_hostname.placeholder = "OpenWrt"
-
-coredump_dir = s:taboption("general", Value, "coredump_dir", translate("Coredump files directory"))
-coredump_dir.datatype="string"
-coredump_dir.placeholder = "/tmp/squid"
-
-s:tab("advanced", translate("Advanced Settings"))
-
-squid_config_file = s:taboption("advanced", TextValue, "_data", "")
-squid_config_file.wrap = "off"
-squid_config_file.rows = 25
-squid_config_file.rmempty = false
-
-function squid_config_file.cfgvalue()
-       local uci = require "luci.model.uci".cursor_state()
-       local file = uci:get("squid", "squid", "config_file")
-       if file then
-               return fs.readfile(file) or ""
-       else
-               return ""
-       end
-end
-
-function squid_config_file.write(self, section, value)
-    if value then
-               local uci = require "luci.model.uci".cursor_state()
-               local file = uci:get("squid", "squid", "config_file")
-       fs.writefile(file, value:gsub("\r\n", "\n"))
-    end
-end
-
-return m
diff --git a/net/luci-app-squid/files/squid-controller.lua b/net/luci-app-squid/files/squid-controller.lua
deleted file mode 100644 (file)
index 09946a1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
---[[
-
-LuCI Squid module
-
-Copyright (C) 2015, OpenWrt.org
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Author: Marko Ratkaj <marko.ratkaj@sartura.hr>
-
-]]--
-
-module("luci.controller.squid", package.seeall)
-
-function index()
-       entry({"admin", "services", "squid"}, cbi("squid"), _("Squid"))
-end
index 024ce7526d6db1a85ab506b4f21d9896d0fb7b1e..31fb2c716b601c29c8e9b03cfae1c99fd8ba5da3 100644 (file)
@@ -13,6 +13,7 @@ PKG_SOURCE_URL:=https://github.com/jow-/MAC-Telnet.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=37d83cbc9c07266d6c957d27bf75285b305eceab
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=13429f1a870121cdbbfb687e0581967904798000eca1f8f9c1e9dc87dee5669b
 
 PKG_LICENSE:=GPL-2.0+
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
index 4b2f5be68bb39c75c67db8b609b6f4e36bc342b0..72d01aa3f381c6d9db760e003d13d02202e34eeb 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mDNSResponder
 PKG_VERSION:=576.30.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=mDNSResponder-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://opensource.apple.com/tarballs/mDNSResponder/
-PKG_MD5SUM:=940057ac8b513b00e8e9ca12ef796762
+PKG_HASH:=4737cb51378377e11d0edb7bcdd1bec79cbdaa7b27ea09c13e3006e58f8d92c0
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
 PKG_LICENSE:=Apache-2.0
 
@@ -86,7 +86,7 @@ endef
 # not found:
 MAKE_FLAGS += \
        LD="$(TARGET_CC)"  \
-       CFLAGS_DEBUG="$(TARGET_CFLAGS)" \
+       CFLAGS_DEBUG="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
        LINKOPTS=-lc \
        LDCONFIG= \
        ETCBASE="$(PKG_INSTALL_DIR)/etc" \
index df56608d5bc93a094144661af3e9e7ee184811a8..974588d200a62efbff514e904a5767c8db579ee2 100644 (file)
@@ -1,6 +1,3 @@
-diff --git a/.gitignore b/.gitignore
-new file mode 100644
-index 0000000..920cdfc
 --- /dev/null
 +++ b/.gitignore
 @@ -0,0 +1,4 @@
@@ -8,11 +5,9 @@ index 0000000..920cdfc
 +mDNSPosix/build
 +mDNSPosix/objects
 +
-diff --git a/Clients/Makefile b/Clients/Makefile
-index 383af31..925c20e 100755
 --- a/Clients/Makefile
 +++ b/Clients/Makefile
-@@ -34,7 +34,7 @@ TARGETS = build/dns-sd build/dns-sd64
+@@ -36,7 +36,7 @@ TARGETS = build/dns-sd build/dns-sd64
  LIBS =
  else
  TARGETS = build/dns-sd
@@ -21,8 +16,6 @@ index 383af31..925c20e 100755
  endif
  
  all: $(TARGETS)
-diff --git a/mDNSPosix/PosixDaemon.c b/mDNSPosix/PosixDaemon.c
-index 88b3292..e86a6c7 100644
 --- a/mDNSPosix/PosixDaemon.c
 +++ b/mDNSPosix/PosixDaemon.c
 @@ -37,6 +37,11 @@
@@ -88,11 +81,9 @@ index 88b3292..e86a6c7 100644
      if (mStatus_NoError == err)
          err = MainLoop(&mDNSStorage);
  
-diff --git a/mDNSPosix/Responder.c b/mDNSPosix/Responder.c
-index 3996b7b..e58d8eb 100755
 --- a/mDNSPosix/Responder.c
 +++ b/mDNSPosix/Responder.c
-@@ -603,7 +603,8 @@ static mStatus RegisterServicesInFile(const char *filePath)
+@@ -603,7 +603,8 @@ static mStatus RegisterServicesInFile(co
          status = mStatus_UnknownErr;
      }
  
@@ -102,11 +93,9 @@ index 3996b7b..e58d8eb 100755
  
      return status;
  }
-diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
-index 6effa12..7c1d6eb 100755
 --- a/mDNSPosix/mDNSPosix.c
 +++ b/mDNSPosix/mDNSPosix.c
-@@ -138,7 +138,7 @@ mDNSlocal void SockAddrTomDNSAddr(const struct sockaddr *const sa, mDNSAddr *ipA
+@@ -138,7 +138,7 @@ mDNSlocal void SockAddrTomDNSAddr(const
  
  // mDNS core calls this routine when it needs to send a packet.
  mDNSexport mStatus mDNSPlatformSendUDP(const mDNS *const m, const void *const msg, const mDNSu8 *const end,
@@ -115,7 +104,7 @@ index 6effa12..7c1d6eb 100755
                                         mDNSIPPort dstPort, mDNSBool useBackgroundTrafficClass)
  {
      int err = 0;
-@@ -583,9 +583,17 @@ mDNSlocal void FreePosixNetworkInterface(PosixNetworkInterface *intf)
+@@ -583,9 +583,17 @@ mDNSlocal void FreePosixNetworkInterface
  {
      assert(intf != NULL);
      if (intf->intfName != NULL) free((void *)intf->intfName);
@@ -135,7 +124,7 @@ index 6effa12..7c1d6eb 100755
  #endif
  
      // Move interface to the RecentInterfaces list for a minute
-@@ -724,6 +732,29 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf
+@@ -724,6 +732,29 @@ mDNSlocal int SetupSocket(struct sockadd
              if (err < 0) { err = errno; perror("setsockopt - IP_MULTICAST_TTL"); }
          }
  
@@ -165,7 +154,7 @@ index 6effa12..7c1d6eb 100755
          // And start listening for packets
          if (err == 0)
          {
-@@ -805,6 +836,29 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf
+@@ -805,6 +836,29 @@ mDNSlocal int SetupSocket(struct sockadd
              if (err < 0) { err = errno; perror("setsockopt - IPV6_MULTICAST_HOPS"); }
          }
  
@@ -195,7 +184,7 @@ index 6effa12..7c1d6eb 100755
          // And start listening for packets
          if (err == 0)
          {
-@@ -836,7 +890,12 @@ mDNSlocal int SetupSocket(struct sockaddr *intfAddr, mDNSIPPort port, int interf
+@@ -836,7 +890,12 @@ mDNSlocal int SetupSocket(struct sockadd
      }
  
      // Clean up
@@ -209,7 +198,7 @@ index 6effa12..7c1d6eb 100755
      assert((err == 0) == (*sktPtr != -1));
      return err;
  }
-@@ -938,19 +997,14 @@ mDNSlocal int SetupInterfaceList(mDNS *const m)
+@@ -942,19 +1001,14 @@ mDNSlocal int SetupInterfaceList(mDNS *c
      int err            = 0;
      struct ifi_info *intfList      = get_ifi_info(AF_INET, mDNStrue);
      struct ifi_info *firstLoopback = NULL;
@@ -232,7 +221,7 @@ index 6effa12..7c1d6eb 100755
  #endif
  
      if (err == 0)
-@@ -1026,7 +1080,7 @@ mDNSlocal mStatus OpenIfNotifySocket(int *pFD)
+@@ -1030,7 +1084,7 @@ mDNSlocal mStatus OpenIfNotifySocket(int
      /* Subscribe the socket to Link & IP addr notifications. */
      mDNSPlatformMemZero(&snl, sizeof snl);
      snl.nl_family = AF_NETLINK;
@@ -241,7 +230,7 @@ index 6effa12..7c1d6eb 100755
      ret = bind(sock, (struct sockaddr *) &snl, sizeof snl);
      if (0 == ret)
          *pFD = sock;
-@@ -1104,11 +1158,18 @@ mDNSlocal mDNSu32       ProcessRoutingNotification(int sd)
+@@ -1108,11 +1162,18 @@ mDNSlocal mDNSu32       ProcessRoutingNo
          PrintNetLinkMsg(pNLMsg);
  #endif
  
@@ -262,7 +251,7 @@ index 6effa12..7c1d6eb 100755
  
          // Advance pNLMsg to the next message in the buffer
          if ((pNLMsg->nlmsg_flags & NLM_F_MULTI) != 0 && pNLMsg->nlmsg_type != NLMSG_DONE)
-@@ -1279,8 +1340,12 @@ mDNSexport mStatus mDNSPlatformInit(mDNS *const m)
+@@ -1283,8 +1344,12 @@ mDNSexport mStatus mDNSPlatformInit(mDNS
      if (err == mStatus_NoError) err = SetupSocket(&sa, zeroIPPort, 0, &m->p->unicastSocket6);
  #endif
  
@@ -275,7 +264,7 @@ index 6effa12..7c1d6eb 100755
  
      // Tell mDNS core about DNS Servers
      mDNS_Lock(m);
-@@ -1313,9 +1378,17 @@ mDNSexport void mDNSPlatformClose(mDNS *const m)
+@@ -1317,9 +1382,17 @@ mDNSexport void mDNSPlatformClose(mDNS *
  {
      assert(m != NULL);
      ClearInterfaceList(m);
@@ -295,7 +284,7 @@ index 6effa12..7c1d6eb 100755
  #endif
  }
  
-@@ -1571,14 +1644,14 @@ mDNSexport mStatus    mDNSPlatformClearSPSMACAddr(void)
+@@ -1575,14 +1648,14 @@ mDNSexport mStatus    mDNSPlatformClearS
  mDNSexport mDNSu16 mDNSPlatformGetUDPPort(UDPSocket *sock)
  {
      (void) sock; // unused
@@ -312,8 +301,6 @@ index 6effa12..7c1d6eb 100755
      return mDNSfalse;
  }
  
-diff --git a/mDNSPosix/mDNSUNP.c b/mDNSPosix/mDNSUNP.c
-index b392fc7..f551ad5 100755
 --- a/mDNSPosix/mDNSUNP.c
 +++ b/mDNSPosix/mDNSUNP.c
 @@ -63,6 +63,7 @@
@@ -324,7 +311,7 @@ index b392fc7..f551ad5 100755
  
  /* Converts a prefix length to IPv6 network mask */
  void plen_to_mask(int plen, char *addr) {
-@@ -86,7 +87,7 @@ struct ifi_info *get_ifi_info_linuxv6(int family, int doaliases)
+@@ -86,7 +87,7 @@ struct ifi_info *get_ifi_info_linuxv6(in
      FILE *fp;
      char addr[8][5];
      int flags, myflags, index, plen, scope;
@@ -333,7 +320,7 @@ index b392fc7..f551ad5 100755
      char addr6[32+7+1]; /* don't forget the seven ':' */
      struct addrinfo hints, *res0;
      struct sockaddr_in6 *sin6;
-@@ -94,7 +95,8 @@ struct ifi_info *get_ifi_info_linuxv6(int family, int doaliases)
+@@ -94,7 +95,8 @@ struct ifi_info *get_ifi_info_linuxv6(in
      int err;
      int sockfd = -1;
      struct ifreq ifr;
@@ -343,7 +330,7 @@ index b392fc7..f551ad5 100755
      res0=NULL;
      ifihead = NULL;
      ifipnext = &ifihead;
-@@ -106,11 +108,12 @@ struct ifi_info *get_ifi_info_linuxv6(int family, int doaliases)
+@@ -106,11 +108,12 @@ struct ifi_info *get_ifi_info_linuxv6(in
              goto gotError;
          }
          while (fscanf(fp,
@@ -370,8 +357,6 @@ index b392fc7..f551ad5 100755
      }
      return(ifihead);    /* pointer to first structure in linked list */
  }
-diff --git a/mDNSShared/dnsextd_parser.y b/mDNSShared/dnsextd_parser.y
-index 18c5990..d4b63ce 100644
 --- a/mDNSShared/dnsextd_parser.y
 +++ b/mDNSShared/dnsextd_parser.y
 @@ -15,6 +15,8 @@
diff --git a/net/mdnsresponder/patches/120-reproducible-builds.patch b/net/mdnsresponder/patches/120-reproducible-builds.patch
new file mode 100644 (file)
index 0000000..b1e7caa
--- /dev/null
@@ -0,0 +1,52 @@
+--- a/Clients/dns-sd.c
++++ b/Clients/dns-sd.c
+@@ -1811,7 +1811,7 @@ Fail:
+ // NOT static -- otherwise the compiler may optimize it out
+ // The "@(#) " pattern is a special prefix the "what" command looks for
+-const char VersionString_SCCS[] = "@(#) dns-sd " STRINGIFY(mDNSResponderVersion) " (" __DATE__ " " __TIME__ ")";
++const char VersionString_SCCS[] = "@(#) dns-sd " STRINGIFY(mDNSResponderVersion);
+ #if _BUILDING_XCODE_PROJECT_
+ // If the process crashes, then this string will be magically included in the automatically-generated crash log
+--- a/mDNSPosix/PosixDaemon.c
++++ b/mDNSPosix/PosixDaemon.c
+@@ -289,9 +289,9 @@ asm (".desc ___crashreporter_info__, 0x1
+ // For convenience when using the "strings" command, this is the last thing in the file
+ #if mDNSResponderVersion > 1
+-mDNSexport const char mDNSResponderVersionString_SCCS[] = "@(#) mDNSResponder-" STRINGIFY(mDNSResponderVersion) " (" __DATE__ " " __TIME__ ")";
++mDNSexport const char mDNSResponderVersionString_SCCS[] = "@(#) mDNSResponder-" STRINGIFY(mDNSResponderVersion);
+ #elif MDNS_VERSIONSTR_NODTS
+ mDNSexport const char mDNSResponderVersionString_SCCS[] = "@(#) mDNSResponder (Engineering Build)";
+ #else
+-mDNSexport const char mDNSResponderVersionString_SCCS[] = "@(#) mDNSResponder (Engineering Build) (" __DATE__ " " __TIME__ ")";
++mDNSexport const char mDNSResponderVersionString_SCCS[] = "@(#) mDNSResponder (Engineering Build)";
+ #endif
+--- a/mDNSShared/Java/JNISupport.c
++++ b/mDNSShared/Java/JNISupport.c
+@@ -1069,4 +1069,4 @@ exit:
+ // NOT static -- otherwise the compiler may optimize it out
+ // The "@(#) " pattern is a special prefix the "what" command looks for
+-const char VersionString_SCCS[] = "@(#) libjdns_sd " STRINGIFY(mDNSResponderVersion) " (" __DATE__ " " __TIME__ ")";
++const char VersionString_SCCS[] = "@(#) libjdns_sd " STRINGIFY(mDNSResponderVersion);
+--- a/mDNSShared/dnsextd.c
++++ b/mDNSShared/dnsextd.c
+@@ -3141,7 +3141,7 @@ mDNS mDNSStorage;
+ // For convenience when using the "strings" command, this is the last thing in the file
+ // The "@(#) " pattern is a special prefix the "what" command looks for
+-const char mDNSResponderVersionString_SCCS[] = "@(#) dnsextd " STRINGIFY(mDNSResponderVersion) " (" __DATE__ " " __TIME__ ")";
++const char mDNSResponderVersionString_SCCS[] = "@(#) dnsextd " STRINGIFY(mDNSResponderVersion);
+ #if _BUILDING_XCODE_PROJECT_
+ // If the process crashes, then this string will be magically included in the automatically-generated crash log
+--- a/mDNSShared/dnssd_clientlib.c
++++ b/mDNSShared/dnssd_clientlib.c
+@@ -363,4 +363,4 @@ DNSServiceErrorType DNSSD_API TXTRecordG
+ // NOT static -- otherwise the compiler may optimize it out
+ // The "@(#) " pattern is a special prefix the "what" command looks for
+-const char VersionString_SCCS_libdnssd[] = "@(#) libdns_sd " STRINGIFY(mDNSResponderVersion) " (" __DATE__ " " __TIME__ ")";
++const char VersionString_SCCS_libdnssd[] = "@(#) libdns_sd " STRINGIFY(mDNSResponderVersion);
index 98904eb2d1c0f1187785fae3c9d79c2d31aaeab4..ec8869442c1d6f8a66000f7742f5d0e56555aa18 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=memcached
-PKG_VERSION:=1.4.36
+PKG_VERSION:=1.5.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://memcached.org/files
-PKG_MD5SUM:=1e028fbab7288911fcaa5ed2a21817fe
+PKG_HASH:=9ac93113bdb5d037e79c61277386564ac2e5e31d49e594f11e554e4c149b7245
 
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 
index e9c793dbd60f82df67d63424c05bff11ba99aac2..f67f1022d3c3d7a197ae8286f53cede2b33f2f60 100644 (file)
@@ -10,13 +10,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mii-tool
 PKG_VERSION=2016-10-06-$(PKG_SOURCE_VERSION)
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=git://git.code.sf.net/p/net-tools/code
 PKG_SOURCE_VERSION:=115f1af2494ded1fcd21c8419d5e289bc4df380f
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=b67157e2912dd210b3e3184b358db6759177a1d8ed6916763e5a629f154f9d7a
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/net/mii-tool/patches/001-mii-tool-4.9-compatibility.patch b/net/mii-tool/patches/001-mii-tool-4.9-compatibility.patch
new file mode 100644 (file)
index 0000000..2472b1c
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/iptunnel.c       2016-07-10 20:15:29.000000000 +0200
++++ b/iptunnel.c       2017-10-19 19:51:09.172782821 +0200
+@@ -26,7 +26,6 @@
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <netinet/in.h>
+-#include <netinet/ip.h>
+ #include <arpa/inet.h>
+ #include <net/if.h>
+ #include <net/if_arp.h>
diff --git a/net/mikrotik-btest/Makefile b/net/mikrotik-btest/Makefile
new file mode 100644 (file)
index 0000000..4b994e8
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2017 Roger Pueyo Centelles <roger.pueyo@guifi.net>
+#
+# This is free software, licensed under the GNU General Public License v3
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mikrotik_btest
+PKG_VERSION:=0.5.1
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/kadosch/mikrotik_btest.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=02a0e7df411b5e7775fe2795709996a30afb7f47
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=f72e1c8e2d98ca9e1c6a7fba35838a4a3c25b2dcd4bd8b10b67662003b3a14d1
+
+PKG_LICENSE:=GPLv3
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mikrotik-btest
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Bandwidth test client for Mikrotik BTest server
+  DEPENDS:=+libpthread +librt
+  URL:=https://github.com/kadosch/mikrotik_btest.git
+  MAINTAINER:=Roger Pueyo Centelles <roger.pueyo@guifi.net>
+endef
+
+define Package/mikrotik-btest/description
+       A bandwidth test client compatible with Mikrotik's RouterOS BTest server.
+endef
+
+define Package/mikrotik-btest/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/mikrotik_btest $(1)/usr/bin/mikrotik_btest
+endef
+
+$(eval $(call BuildPackage,mikrotik-btest))
index f86539a0ceb5637180a7685776a8d4d1a310f778..e4783b70b6657ca3d7f161d5ca0919e74f50544f 100644 (file)
@@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mini_snmpd
 PKG_VERSION:=1.4-rc1
-PKG_RELEASE:=2
-PKG_MAINTAINER:=Luke McKee <hojuruku@gmail.com>
+PKG_RELEASE:=3
+PKG_MAINTAINER:=Marcin Jurkowski <marcin1j@gmail.com>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
@@ -19,6 +19,7 @@ PKG_SOURCE_URL:=https://github.com/troglobit/mini-snmpd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=203d92e60ed09466d6676c6ad20ad6cb2ce08a5d
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=175d4d9b69c3195ef850eaffd8ac63d012a052089b4a9d074b4d3aef96888b8f
 
 PKG_FIXUP:=autoreconf
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
index 0fb63d4d8f222b5d4058316a4c7e41d7866969e0..e3461563065791530ed8cbf844b1f3fda00d996c 100644 (file)
@@ -71,7 +71,7 @@ append_interface() {
        local name="$1" netdev netdev_count
        [ -z $netdev_count ] && netdev_count=0
        # for the purposes of snmp monitoring it doesn't need to be up, it just needs to exist in /proc/net/dev
-       netdev=$(ubus -S call network.interface dump|jsonfilter -e "@.interface[@.interface=\"$name\"].l3_device")  
+       network_get_device netdev "$name"
        if [ -n "$netdev" ] && grep -qF "$netdev" /proc/net/dev ]; then 
                [ $netdev_count -ge 4 ] && {
                        _err "$cfg: too many network interfaces configured, ignoring $name"
@@ -84,7 +84,7 @@ append_interface() {
                        append interfaces_arg "$netdev"
                fi
        else
-                _err "$cfg: physical interface for network $name not found in uci or kernel so not monitoring"
+                _log "$cfg: physical interface for network $name not found in uci or kernel so not monitoring"
        fi
 }
 
@@ -100,10 +100,12 @@ watch_interfaces() {
        config_get_bool enabled "$cfg" "enabled" '1'
        [ "$enabled" -gt 0 ] || return 0
        config_get listen_interface "$cfg" listen_interface
-       # listen_interface_up=$(ubus -S call network.interface dump | jsonfilter -e "@.interface[@.interface=\"$listen_interface\"].up")
        # If the interface is up & instance is running we'll watch at the instance level and only restart that instance if it's bound interface changes
        # Regardless of ubus knowing about an interface (in the case it's not yet configured)
        [ -n "$listen_interface" ] && trigger_interfaces="${listen_interface} ${trigger_interfaces} "
+       # Restart daemon if one of monitored interfaces changes
+       config_get reload_interfaces "$cfg" interfaces
+
 }
 
 validate_mini_snmpd_section() {
@@ -126,6 +128,11 @@ service_triggers() {
                        procd_add_interface_trigger "interface.*" $n /etc/init.d/mini_snmpd start
                 done
         }
+       [ -n "$reload_interfaces" ] && {
+               for n in $reload_interfaces; do
+                       procd_add_reload_interface_trigger $n
+               done
+       }
         procd_close_trigger
        procd_add_validation validate_mini_snmpd_section
 }
@@ -146,35 +153,19 @@ start_instance() {
                 return 1
        }
        
-       local listen_interface_json listen_interface_ip listen_interface_device listen_interface_up ubus_exit ubus_err
+       local listen_interface_json listen_interface_ip listen_interface_device listen_interface_up
        [ -n "$listen_interface" ] && {
-               listen_interface_json=$(ubus -S call network.interface.$listen_interface status)
-               ubus_exit=$?
-               [ $ubus_exit = 4 ] && {
-                       _err "$cfg: listen_interface $listen_interface not properly configured in ubus network.interface.* not starting this instance "
-                       return 1
-               }
-               [ $ubus_exit = 255 -a -z "$listen_interface_json" ] && { 
-                       _log "$cfg: ubusd not yet up, will try to start mini_snmpd shorlty when procd detects $listen_interface comes up"
-                       return 1
-               }
-               [ -z "$listen_interface_json" ] && { 
-                       ubus_err=`ubus call network.interface.$listen_interface status 2>&1 >/dev/null`
-                       _err "$cfg: unknown ubus error. exit: $ubus_exit errormsg: $ubus_err "
-                       return 1
-               }
-               listen_interface_up=$(jsonfilter -s "$listen_interface_json" -e '@.up')
                if [ "$ipv6" = 1 ]; then
-                       listen_interface_ip=$(jsonfilter -s "$listen_interface_json" -e "@['ipv6-address'][0].address")
+                       network_get_ipaddrs6 listen_interface_ip "$listen_interface"
                else
-                       listen_interface_ip=$(jsonfilter -s "$listen_interface_json" -e "@['ipv4-address'][0].address")
+                       network_get_ipaddrs listen_interface_ip "$listen_interface"
                fi
-               [ -n "$listen_interface_ip" -a "$listen_interface_up" = 'true' ] || {
+               network_is_up "$listen_interface" && [ -n "$listen_interface_ip" ] || {
                        _log "$cfg:listen interface $listen_interface not up yet / not configured properly"
                        _log "$cfg:procd will try again when interface state changes"
                        return 1
                }
-               listen_interface_device=$(jsonfilter -s "$listen_interface_json" -e '@.l3_device')
+               network_get_physdev listen_interface_device "$listen_interface"
        }
 
        [ $validation_failed ] && {  
@@ -223,17 +214,23 @@ start_instance() {
        # uci_validate_section() aka /sbin/validate_data can only cast default values not defined in /etc/config/* to string 
        # e.g. ="1" however it sets bools defined in /etc/config/* to =1 / =0
        [ "$auth" = 1 -o "$auth" = "1" ] && procd_append_param command "-a"
-       [ -n "$disks_arg" ] && procd_append_param command "-d $disks_arg" 
-       [ -n "$interfaces_arg" ] && procd_append_param command "-i $interfaces_arg"
+       [ -n "$disks_arg" ] && procd_append_param command "-d" "$disks_arg"
+       [ -n "$interfaces_arg" ] && {
+               procd_append_param netdev ${interfaces_arg//,/ }
+               procd_append_param command "-i" "$interfaces_arg"
+       }
        [ -n "$listen_interface_device" ] && {
                 procd_append_param command "-I" "$listen_interface_device"
                 # and this monitors the hardware device for changes outside of ubus - just a guess
-                procd_set_param netdev $listen_interface_device
+                procd_append_param netdev $listen_interface_device
        }
        procd_close_instance
 }
 
 start_service() {
+       . /lib/functions.sh
+       . /lib/functions/network.sh
+
        config_load 'mini_snmpd'
        config_foreach start_instance 'mini_snmpd'
 }
index fbf6222100d56d924d9fa4d3af2ab3c080e23f2e..c41766a4891056740809e2ffb91ce5ab10b89ff0 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=miniupnpc
-PKG_VERSION:=1.9
+PKG_VERSION:=2.0.20170509
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://miniupnp.free.fr/files
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=5ef3ba321e6df72d6519b728b292073e
+PKG_HASH:=d3c368627f5cdfb66d3ebd64ca39ba54d6ff14a61966dbecb8dd296b7039f16a
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
 
 PKG_INSTALL:=1
@@ -60,6 +60,7 @@ endef
 define Package/miniupnpc/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upnpc $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/listdevices $(1)/usr/bin/
 endef
 
 define Package/libminiupnpc/install
index 93f6772c72f84717f98960bc578c5681704360eb..dd8d029ff78916c357efe4da2993b98d632d073e 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -151,8 +151,8 @@ installpythonmodule3:      pythonmodule3
+@@ -187,8 +187,8 @@ installpythonmodule3:      pythonmodule3
        python3 setup.py install
  
  validateminixml:      minixmlvalid
index 320707ef27618e839a327ff41929a6663a172297..c9a5abc58c98ef4dbd3c76ac134c3909667dd56a 100644 (file)
@@ -1,6 +1,6 @@
 --- a/upnpcommands.c
 +++ b/upnpcommands.c
-@@ -367,7 +367,7 @@ UPNP_AddPortMapping(const char * control
+@@ -370,7 +370,7 @@ UPNP_AddPortMapping(const char * control
        AddPortMappingArgs[5].elt = "NewEnabled";
        AddPortMappingArgs[5].val = "1";
        AddPortMappingArgs[6].elt = "NewPortMappingDescription";
@@ -8,4 +8,4 @@
 +      AddPortMappingArgs[6].val = desc?desc:"miniupnpc";
        AddPortMappingArgs[7].elt = "NewLeaseDuration";
        AddPortMappingArgs[7].val = leaseDuration?leaseDuration:"0";
-       if(!(buffer = simpleUPnPcommand(-1, controlURL, servicetype,
+       buffer = simpleUPnPcommand(-1, controlURL, servicetype,
diff --git a/net/miniupnpd/Makefile b/net/miniupnpd/Makefile
deleted file mode 100644 (file)
index 42023ff..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-# 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:=miniupnpd
-PKG_VERSION:=2.0.20170421
-PKG_RELEASE:=1
-
-PKG_SOURCE_URL:=http://miniupnp.free.fr/files
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_HASH:=9677aeccadf73b4bf8bb9d832c32b5da8266b4d58eed888f3fd43d7656405643
-
-PKG_MAINTAINER:=Markus Stenberg <fingon@iki.fi>
-PKG_LICENSE:=BSD-3-Clause
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/miniupnpd
-  SECTION:=net
-  CATEGORY:=Network
-  DEPENDS:=+iptables +libip4tc +IPV6:libip6tc +IPV6:ip6tables +libuuid
-  TITLE:=Lightweight UPnP IGD, NAT-PMP & PCP daemon
-  SUBMENU:=Firewall
-  URL:=http://miniupnp.free.fr/
-endef
-
-define Package/miniupnpd/config
-config MINIUPNPD_IGDv2
-       bool
-       default y
-       prompt "Enable IGDv2"
-endef
-
-define Package/miniupnpd/conffiles
-/etc/config/upnpd
-endef
-
-define Package/miniupnpd/postinst
-#!/bin/sh
-
-if [ -z "$$IPKG_INSTROOT" ]; then
-  ( . /etc/uci-defaults/99-miniupnpd )
-  rm -f /etc/uci-defaults/99-miniupnpd
-fi
-
-exit 0
-endef
-
-define Build/Prepare
-       $(call Build/Prepare/Default)
-       echo "OpenWrt" | tr \(\)\  _ >$(PKG_BUILD_DIR)/os.openwrt
-endef
-
-MAKE_FLAGS += \
-       TARGET_OPENWRT=1 TEST=0 \
-       LIBS="" \
-       CC="$(TARGET_CC) -DIPTABLES_143 \
-               -lip4tc $(if $(CONFIG_IPV6),-lip6tc) -luuid" \
-       CONFIG_OPTIONS="--portinuse --leasefile \
-               $(if $(CONFIG_IPV6),--ipv6) \
-               $(if $(CONFIG_MINIUPNPD_IGDv2),--igd2)" \
-       -f Makefile.linux \
-       miniupnpd
-
-
-define Package/miniupnpd/install
-       $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/uci-defaults $(1)/etc/hotplug.d/iface $(1)/usr/share/miniupnpd
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/miniupnpd $(1)/usr/sbin/miniupnpd
-       $(INSTALL_BIN) ./files/miniupnpd.init $(1)/etc/init.d/miniupnpd
-       $(INSTALL_CONF) ./files/upnpd.config $(1)/etc/config/upnpd
-       $(INSTALL_DATA) ./files/miniupnpd.hotplug $(1)/etc/hotplug.d/iface/50-miniupnpd
-       $(INSTALL_DATA) ./files/miniupnpd.defaults $(1)/etc/uci-defaults/99-miniupnpd
-       $(INSTALL_DATA) ./files/firewall.include $(1)/usr/share/miniupnpd/firewall.include
-endef
-
-$(eval $(call BuildPackage,miniupnpd))
diff --git a/net/miniupnpd/files/firewall.include b/net/miniupnpd/files/firewall.include
deleted file mode 100644 (file)
index 0eb96d7..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/sh
-# miniupnpd integration for firewall3
-
-IP6TABLES=/usr/sbin/ip6tables
-
-iptables -t filter -N MINIUPNPD 2>/dev/null
-iptables -t nat -N MINIUPNPD 2>/dev/null
-iptables -t nat -N MINIUPNPD-POSTROUTING 2>/dev/null
-
-[ -x $IP6TABLES ] && $IP6TABLES -t filter -N MINIUPNPD 2>/dev/null
-
-. /lib/functions/network.sh
-
-ADDED=0
-
-add_extzone_rules() {
-    local ext_zone=$1
-
-    [ -z "$ext_zone" ] && return
-
-    # IPv4 - due to NAT, need to add both to nat and filter table
-    iptables -t filter -I zone_${ext_zone}_forward -j MINIUPNPD
-    iptables -t nat -I zone_${ext_zone}_prerouting -j MINIUPNPD
-    iptables -t nat -I zone_${ext_zone}_postrouting -j MINIUPNPD-POSTROUTING
-
-    # IPv6 if available - filter only
-    [ -x $IP6TABLES ] && {
-        $IP6TABLES -t filter -I zone_${ext_zone}_forward -j MINIUPNPD
-    }
-    ADDED=$(($ADDED + 1))
-}
-
-# By default, user configuration is king.
-
-for ext_iface in $(uci -q get upnpd.config.external_iface); do
-    add_extzone_rules $(fw3 -q network "$ext_iface")
-done
-
-add_extzone_rules $(uci -q get upnpd.config.external_zone)
-
-[ ! $ADDED = 0 ] && exit 0
-
-
-# If really nothing is available, resort to network_find_wan{,6} and
-# assume external interfaces all have same firewall zone.
-
-# (This heuristic may fail horribly, in case of e.g. multihoming, so
-# please set external_zone in that case!)
-
-network_find_wan wan_iface
-network_find_wan6 wan6_iface
-
-for ext_iface in $wan_iface $wan6_iface; do
-    # fw3 -q network fails on sub-interfaces => map to device first
-    network_get_device ext_device $ext_iface
-    add_extzone_rules $(fw3 -q device "$ext_device")
-done
diff --git a/net/miniupnpd/files/miniupnpd.defaults b/net/miniupnpd/files/miniupnpd.defaults
deleted file mode 100644 (file)
index 7271389..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-uci -q batch <<-EOT
-       delete firewall.miniupnpd
-       set firewall.miniupnpd=include
-       set firewall.miniupnpd.type=script
-       set firewall.miniupnpd.path=/usr/share/miniupnpd/firewall.include
-       set firewall.miniupnpd.family=any
-       set firewall.miniupnpd.reload=1
-       commit firewall
-EOT
-
-exit 0
diff --git a/net/miniupnpd/files/miniupnpd.hotplug b/net/miniupnpd/files/miniupnpd.hotplug
deleted file mode 100644 (file)
index 320437e..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-/etc/init.d/miniupnpd enabled || exit 0
-
-. /lib/functions/service.sh
-
-# If miniupnpd is not running:
-# - check on _any_ event (even updates may contribute to network_find_wan*)
-
-# If miniupnpd _is_ running:
-# - check only on ifup (otherwise lease updates etc would cause
-#   miniupnpd state loss)
-
-[ ! "$ACTION" = "ifup" ] && service_check /usr/sbin/miniupnpd && exit 0
-
-tmpconf="/var/etc/miniupnpd.conf"
-extiface=$(uci get upnpd.config.external_iface)
-extzone=$(uci get upnpd.config.external_zone)
-
-. /lib/functions/network.sh
-
-for iface in $(uci get upnpd.config.internal_iface); do
-    network_get_device device $iface
-    [ "$DEVICE" = "$device" ] && /etc/init.d/miniupnpd restart && exit 0
-done
-
-
-if [ -z "$extiface" ] ; then
-  # manual external zone (if dynamically find interfaces
-  # belonging to it) overrides network_find_wan*
-  if [ -n "$extzone" ] ; then
-    ifname=$(fw3 -q zone $extzone | head -1)
-  fi
-  [ -n "$extiface" ] || network_find_wan extiface
-  [ -n "$extiface" ] || network_find_wan6 extiface
-fi
-
-[ -n "$ifname" ] || network_get_device ifname ${extiface}
-grep -q "ext_ifname=$ifname" $tmpconf || /etc/init.d/miniupnpd restart
diff --git a/net/miniupnpd/files/miniupnpd.init b/net/miniupnpd/files/miniupnpd.init
deleted file mode 100644 (file)
index c934a28..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006-2014 OpenWrt.org
-
-START=94
-STOP=15
-
-SERVICE_USE_PID=1
-
-upnpd_get_port_range() {
-       local _var="$1"; shift
-       local _val
-
-       config_get _val "$@"
-
-       case "$_val" in
-               [0-9]*[:-][0-9]*)
-                       export -n -- "${_var}_start=${_val%%[:-]*}"
-                       export -n -- "${_var}_end=${_val##*[:-]}"
-               ;;
-               [0-9]*)
-                       export -n -- "${_var}_start=$_val"
-                       export -n -- "${_var}_end="
-               ;;
-       esac
-}
-
-conf_rule_add() {
-       local cfg="$1"
-       local tmpconf="$2"
-       local action external_port_start external_port_end int_addr
-       local internal_port_start internal_port_end
-
-       config_get action "$cfg" action "deny"               # allow or deny
-       upnpd_get_port_range "ext" "$cfg" ext_ports "0-65535" # external ports: x, x-y, x:y
-       config_get int_addr "$cfg" int_addr "0.0.0.0/0"       # ip or network and subnet mask (internal)
-       upnpd_get_port_range "int" "$cfg" int_ports "0-65535" # internal ports: x, x-y, x:y or range
-
-       # Make a single IP IP/32 so that miniupnpd.conf can use it.
-       case "$int_addr" in
-               */*) ;;
-               *) int_addr="$int_addr/32" ;;
-       esac
-
-       echo "${action} ${ext_start}${ext_end:+-}${ext_end} ${int_addr} ${int_start}${int_end:+-}${int_end}" >>$tmpconf
-}
-
-upnpd_write_bool() {
-       local opt="$1"
-       local def="${2:-0}"
-       local alt="$3"
-       local val
-
-       config_get_bool val config "$opt" "$def"
-       if [ "$val" -eq 0 ]; then
-               echo "${alt:-$opt}=no" >> $tmpconf
-       else
-               echo "${alt:-$opt}=yes" >> $tmpconf
-       fi
-}
-
-boot() {
-       return
-}
-
-start() {
-       config_load "upnpd"
-       local extiface intiface upload download logging secure enabled natpmp
-       local extip port usesysuptime conffile serial_number model_number
-       local uuid notify_interval presentation_url enable_upnp
-       local upnp_lease_file clean_ruleset_threshold clean_ruleset_interval
-        local ipv6_listening_ip enabled
-
-       config_get_bool enabled config enabled 1
-
-       [ "$enabled" -gt 0 ] || return 1
-
-       config_get extiface config external_iface
-       config_get extzone config external_zone
-       config_get intiface config internal_iface
-       config_get extip config external_ip
-       config_get port config port 5000
-       config_get upload   config upload
-       config_get download config download
-       config_get_bool logging config log_output 0
-       config_get conffile config config_file
-       config_get serial_number config serial_number
-       config_get model_number config model_number
-       config_get uuid config uuid
-       config_get notify_interval config notify_interval
-       config_get presentation_url config presentation_url
-       config_get upnp_lease_file config upnp_lease_file
-       config_get clean_ruleset_threshold config clean_ruleset_threshold
-       config_get clean_ruleset_interval config clean_ruleset_interval
-       config_get ipv6_listening_ip config ipv6_listening_ip
-
-       local args
-
-       . /lib/functions/network.sh
-
-       local ifname
-
-        # manual external interface overrides everything
-        if [ -z "$extiface" ] ; then
-            # manual external zone (if dynamically find interfaces
-            # belonging to it) overrides network_find_wan*
-            if [ -n "$extzone" ] ; then
-                ifname=$(fw3 -q zone $extzone | head -1)
-            fi
-            [ -n "$extiface" ] || network_find_wan extiface
-            [ -n "$extiface" ] || network_find_wan6 extiface
-        fi
-
-       [ -n "$ifname" ] || network_get_device ifname ${extiface}
-
-       if [ -n "$conffile" ]; then
-               args="-f $conffile"
-       else
-               local tmpconf="/var/etc/miniupnpd.conf"
-               args="-f $tmpconf"
-               mkdir -p /var/etc
-
-               echo "ext_ifname=$ifname" >$tmpconf
-
-               [ -n "$extip" ] && \
-                       echo "ext_ip=$extip" >>$tmpconf
-
-               local iface
-               for iface in ${intiface:-lan}; do
-                       local device
-                       network_get_device device "$iface" && {
-                               echo "listening_ip=$device" >>$tmpconf
-                       }
-               done
-
-               [ "$port" != "auto" ] && \
-                       echo "port=$port" >>$tmpconf
-
-               config_load "upnpd"
-               upnpd_write_bool enable_natpmp 1
-               upnpd_write_bool enable_upnp 1
-               upnpd_write_bool secure_mode 1
-               upnpd_write_bool pcp_allow_thirdparty 0
-               upnpd_write_bool system_uptime 1
-
-               [ -n "$upnp_lease_file" ] && \
-                       echo "lease_file=$upnp_lease_file" >>$tmpconf
-
-               [ -n "$upload" -a -n "$download" ] && {
-                       echo "bitrate_down=$(($download * 1024 * 8))" >>$tmpconf
-                       echo "bitrate_up=$(($upload * 1024 * 8))" >>$tmpconf
-               }
-
-               [ -n "${presentation_url}" ] && \
-                       echo "presentation_url=${presentation_url}" >>$tmpconf
-
-               [ -n "${notify_interval}" ] && \
-                       echo "notify_interval=${notify_interval}" >>$tmpconf
-
-               [ -n "${clean_ruleset_threshold}" ] && \
-                       echo "clean_ruleset_threshold=${clean_ruleset_threshold}" >>$tmpconf
-
-               [ -n "${clean_ruleset_interval}" ] && \
-                       echo "clean_ruleset_interval=${clean_ruleset_interval}" >>$tmpconf
-
-               [ -n "${ipv6_listening_ip}" ] && \
-                       echo "ipv6_listening_ip=${ipv6_listening_ip}" >>$tmpconf
-
-               [ -z "$uuid" ] && {
-                       uuid="$(cat /proc/sys/kernel/random/uuid)"
-                       uci set upnpd.config.uuid=$uuid
-                       uci commit upnpd
-               }
-
-               [ "$uuid" = "nocli" ] || \
-                       echo "uuid=$uuid" >>$tmpconf
-
-               [ -n "${serial_number}" ] && \
-                       echo "serial=${serial_number}" >>$tmpconf
-
-               [ -n "${model_number}" ] && \
-                       echo "model_number=${model_number}" >>$tmpconf
-
-           config_foreach conf_rule_add perm_rule "$tmpconf"
-       fi
-
-
-       if [ -n "$ifname" ]; then
-               # start firewall
-               iptables -L MINIUPNPD >/dev/null 2>/dev/null || fw3 reload
-
-               if [ "$logging" = "1" ]; then
-                       SERVICE_DAEMONIZE=1 \
-                       service_start /usr/sbin/miniupnpd $args -d
-               else
-                       SERVICE_DAEMONIZE= \
-                       service_start /usr/sbin/miniupnpd $args
-               fi
-       else
-               logger -t "upnp daemon" "external interface not found, not starting"
-       fi
-}
-
-stop() {
-       service_stop /usr/sbin/miniupnpd
-
-       iptables -t nat -F MINIUPNPD 2>/dev/null
-       iptables -t filter -F MINIUPNPD 2>/dev/null
-
-        [ -x /usr/sbin/ip6tables ] && {
-           ip6tables -t filter -F MINIUPNPD 2>/dev/null
-        }
-}
diff --git a/net/miniupnpd/files/upnpd.config b/net/miniupnpd/files/upnpd.config
deleted file mode 100644 (file)
index 9a65bfa..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-config upnpd config
-       option enabled          0
-       option enable_natpmp    1
-       option enable_upnp      1
-       option secure_mode      1
-       option log_output       0
-       option download         1024
-       option upload           512
-        #by default, looked up dynamically from ubus
-       #option external_iface  wan
-       option internal_iface   lan
-       option port             5000
-       option upnp_lease_file  /var/upnp.leases
-       
-config perm_rule
-       option action           allow
-       option ext_ports        1024-65535
-       option int_addr         0.0.0.0/0       # Does not override secure_mode
-       option int_ports        1024-65535
-       option comment          "Allow high ports"
-
-config perm_rule
-       option action           deny
-       option ext_ports                0-65535
-       option int_addr         0.0.0.0/0
-       option int_ports                0-65535
-       option comment          "Default deny"
diff --git a/net/miniupnpd/patches/101-no-ssl-uuid.patch b/net/miniupnpd/patches/101-no-ssl-uuid.patch
deleted file mode 100644 (file)
index 81cea10..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-We do not need to autodetect SSL/UUID; SSL we do not support, UUID we always do.
-
---- a/Makefile.linux
-+++ b/Makefile.linux
-@@ -153,14 +153,18 @@ LDLIBS += $(shell $(PKG_CONFIG) --static
- LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libnetfilter_conntrack)
- endif # ($(TEST),1)
-+ifeq ($(TARGET_OPENWRT),)
-+# n/a - we don't enable https server for IGD v2 anyway in OpenWrt
- LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libssl)
-+# n/a - we hardcodedly support libuuid
- TEST := $(shell $(PKG_CONFIG) --exists uuid && echo 1)
- ifeq ($(TEST),1)
- LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l uuid)
- else
- $(info please install uuid-dev package / libuuid)
- endif # ($(TEST),1)
-+endif
- TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o
diff --git a/net/miniupnpd/patches/102-ipv6-ext-port.patch b/net/miniupnpd/patches/102-ipv6-ext-port.patch
deleted file mode 100644 (file)
index 806c7fd..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/pcpserver.c
-+++ b/pcpserver.c
-@@ -982,6 +982,7 @@ static int CreatePCPMap_NAT(pcp_info_t *
-                                  timestamp);
-       if (r < 0)
-               return PCP_ERR_NO_RESOURCES;
-+      pcp_msg_info->ext_port = pcp_msg_info->int_port;
-       return PCP_SUCCESS;
- }
diff --git a/net/miniupnpd/patches/103-no-ipv6-autodetection.patch b/net/miniupnpd/patches/103-no-ipv6-autodetection.patch
deleted file mode 100644 (file)
index 50d5a39..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-The miniupnpd makefile tries to autodetect iptables capabilities.
-This will incorrectly detect capabilities such as ipv6 support even though it is disabled for the target build.
-
-As the OpenWRT buildsystem already passes the right compile flags, we can skip the autodetection.
-
-
---- a/netfilter/Makefile
-+++ b/netfilter/Makefile
-@@ -38,8 +38,6 @@ endif
- endif
- endif
--LIBS +=  /lib/libip4tc.so /lib/libip6tc.so
--
- all:  iptcrdr.o testiptcrdr iptpinhole.o \
-         testiptcrdr_peer testiptcrdr_dscp test_nfct_get
- #        testiptpinhole
---- a/Makefile.linux
-+++ b/Makefile.linux
-@@ -73,7 +73,6 @@ CPPFLAGS += -DIPTABLES_143
- endif
- CFLAGS  += $(shell $(PKG_CONFIG) --cflags libiptc)
--LDLIBS  += $(shell $(PKG_CONFIG) --static --libs-only-l libiptc)
- LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L libiptc)
- LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-other libiptc)
- else
diff --git a/net/miniupnpd/patches/104-always-libuuid.patch b/net/miniupnpd/patches/104-always-libuuid.patch
deleted file mode 100644 (file)
index d6c0770..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-As it turns out, the 'magic' libuuid/bsd uuid check just checks
-outside buildtree altogether for the uuid_generate. So we just
-hardcode it.
-
---- a/genconfig.sh
-+++ b/genconfig.sh
-@@ -367,12 +367,7 @@ case $FW in
- esac
- # UUID API
--if grep uuid_create /usr/include/uuid.h > /dev/null 2>&1 ; then
--      echo "#define BSD_UUID" >> ${CONFIGFILE}
--fi
--if grep uuid_generate /usr/include/uuid/uuid.h > /dev/null 2>&1 ; then
--      echo "#define LIB_UUID" >> ${CONFIGFILE}
--fi
-+echo "#define LIB_UUID" >> ${CONFIGFILE}
- # set V6SOCKETS_ARE_V6ONLY to 0 if it was not set above
- if [ -z "$V6SOCKETS_ARE_V6ONLY" ] ; then
diff --git a/net/mosquitto/Config.in b/net/mosquitto/Config.in
new file mode 100644 (file)
index 0000000..4599736
--- /dev/null
@@ -0,0 +1,13 @@
+config MOSQUITTO_LWS
+    bool "libwebsockets support"
+    depends on PACKAGE_mosquitto-ssl
+    default y
+    help
+        Includes websockets support in the broker, via libwebsockets
+
+config MOSQUITTO_PASSWD
+    bool "Include mosquitto_passwd utility"
+    depends on PACKAGE_mosquitto-ssl
+    default y
+    help
+        mosquitto_passwd is a tool for managing password files for mosquitto.
diff --git a/net/mosquitto/Makefile b/net/mosquitto/Makefile
new file mode 100644 (file)
index 0000000..2713f5d
--- /dev/null
@@ -0,0 +1,231 @@
+#
+# Copyright (C) 2011-2013 OpenWrt.org
+# Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mosquitto
+PKG_VERSION:=1.4.15
+PKG_RELEASE:=3
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE.txt
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://mosquitto.org/files/source/
+PKG_HASH:=7d3b3e245a3b4ec94b05678c8199c806359737949f4cfe0bf936184f6ca89a83
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mosquitto/default
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=mosquitto - an MQTT message broker
+  URL:=http://www.mosquitto.org/
+  MAINTAINER:=Karl Palsson <karlp@etactica.com>
+  DEPENDS:= +librt +libuuid
+  USERID:=mosquitto=200:mosquitto=200
+endef
+
+define Package/mosquitto-ssl
+    $(call Package/mosquitto/default)
+    TITLE+= (with SSL support)
+    DEPENDS+= +libopenssl +MOSQUITTO_LWS:libwebsockets-openssl
+    VARIANT:=ssl
+    PROVIDES:=mosquitto
+endef
+
+define Package/mosquitto-nossl
+    $(call Package/mosquitto/default)
+    TITLE+= (without SSL support)
+    VARIANT:=nossl
+    PROVIDES:=mosquitto
+endef
+
+define Package/mosquitto-ssl/config
+       source "$(SOURCE)/Config.in"
+endef
+
+define Package/mosquitto/default/description
+Mosquitto is an open source (BSD licensed) message broker that implements
+the MQTT protocol version 3.1 and 3.1.1. MQTT provides a lightweight
+method of carrying out messaging using a publish/subscribe model.
+
+This package also includes some basic support for configuring via UCI
+endef
+
+define Package/mosquitto-ssl/description
+       $(call Package/mosquitto/default/description)
+This package is built with SSL support.  TLS-PSK will be included (in both
+the client and broker) if OpenSSL is built with TLS-PSK support.
+endef
+
+define Package/mosquitto-nossl/description
+        $(call Package/mosquitto/default/description)
+        This package is built WITHOUT SSL support.
+endef
+
+
+define Package/mosquitto-client/default
+    $(Package/mosquitto/default)
+    TITLE:= mosquitto - client tools
+    DEPENDS+=+libcares
+    PROVIDES:=mosquitto-client
+endef
+define Package/mosquitto-client-ssl
+    $(call Package/mosquitto-client/default)
+    TITLE+= (With SSL support)
+    DEPENDS+=+libmosquitto-ssl
+    VARIANT:=ssl
+endef
+define Package/mosquitto-client-nossl
+    $(call Package/mosquitto-client/default)
+    TITLE+= (Without SSL support)
+    DEPENDS+=+libmosquitto-nossl
+    VARIANT:=nossl
+endef
+
+define Package/mosquitto-client/default/description
+ Command line client tools for publishing messages to MQTT servers
+and subscribing to topics.
+endef
+
+define Package/mosquitto-client-ssl/description
+$(call Package/mosquitto-client/default/description)
+        This package is built with SSL support
+endef
+define Package/mosquitto-client-nossl/description
+$(call Package/mosquitto-client/default/description)
+        This package is built without SSL support
+endef
+
+define Package/libmosquitto/default
+    $(Package/mosquitto/default)
+    SECTION:=libs
+    CATEGORY:=Libraries
+    DEPENDS:=+libpthread +librt +libcares
+    TITLE:= mosquitto - client library
+    PROVIDES:=libmosquitto
+endef
+
+define Package/libmosquitto-ssl
+    $(call Package/libmosquitto/default)
+    TITLE+= (With SSL Support)
+    DEPENDS+= +libopenssl
+    VARIANT=ssl
+endef
+define Package/libmosquitto-nossl
+    $(call Package/libmosquitto/default)
+    TITLE+= (Without SSL Support)
+    VARIANT=nossl
+endef
+
+define Package/libmosquitto/default/description
+ Library required for mosquitto's command line client tools, also for
+use by any third party software that wants to communicate with a
+mosquitto server.
+
+Should be useable for communicating with any MQTT v3.1/3.1.1 compatible
+server, such as IBM's RSMB, in addition to Mosquitto
+endef
+
+define Package/libmosquitto-ssl/description
+    $(call Package/libmosquitto/default/description)
+    This package is built with SSL support
+endef
+define Package/libmosquitto-nossl/description
+    $(call Package/libmosquitto/default/description)
+    This package is built without SSL support
+endef
+
+define Package/libmosquittopp
+    SECTION:=libs
+    CATEGORY:=Libraries
+    DEPENDS:=libmosquitto +libstdcpp
+    TITLE:= mosquitto - client c++ library
+endef
+
+define Package/libmosquittopp/description
+ C++ Library wrapper for libmosquitto.
+endef
+
+define Package/mosquitto-ssl/conffiles
+/etc/mosquitto/mosquitto.conf
+/etc/config/mosquitto
+endef
+
+Package/mosquitto-nossl/conffiles = $(Package/mosquitto-ssl/conffiles)
+
+define Package/mosquitto/install/default
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto
+       $(INSTALL_DIR) $(1)/etc/mosquitto
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf
+       $(CP) ./files/* $(1)/
+endef
+
+define Package/mosquitto-nossl/install
+       $(call Package/mosquitto/install/default,$(1))
+endef
+
+define Package/mosquitto-ssl/install
+       $(call Package/mosquitto/install/default,$(1))
+ifeq ($(CONFIG_MOSQUITTO_PASSWD),y)
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto_passwd $(1)/usr/bin
+endif
+endef
+
+define Package/mosquitto-client-ssl/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
+endef
+Package/mosquitto-client-nossl/install = $(Package/mosquitto-client-ssl/install)
+
+# This installs files into ./staging_dir/. so that you can cross compile from the host
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
+       $(CP) $(PKG_BUILD_DIR)/lib/cpp/mosquittopp.h $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
+       $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
+       $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
+endef
+
+# This installs files on the target.  Compare with Build/InstallDev
+define Package/libmosquitto-ssl/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
+       $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
+endef
+Package/libmosquitto-nossl/install = $(Package/libmosquitto-ssl/install)
+
+define Package/libmosquittopp/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
+       $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
+endef
+
+# Applies to all...
+MAKE_FLAGS += WITH_DOCS=no UNAME=Linux
+ifeq ($(BUILD_VARIANT),nossl)
+       MAKE_FLAGS += WITH_TLS=no WITH_WEBSOCKETS=no
+else
+       MAKE_FLAGS += WITH_WEBSOCKETS=$(if $(CONFIG_MOSQUITTO_LWS),"yes","no")
+       MAKE_FLAGS += WITH_TLS_PSK=$(if $(CONFIG_OPENSSL_WITH_PSK),"yes","no")
+endif
+
+$(eval $(call BuildPackage,mosquitto-ssl))
+$(eval $(call BuildPackage,mosquitto-nossl))
+$(eval $(call BuildPackage,libmosquitto-ssl))
+$(eval $(call BuildPackage,libmosquitto-nossl))
+$(eval $(call BuildPackage,libmosquittopp))
+$(eval $(call BuildPackage,mosquitto-client-ssl))
+$(eval $(call BuildPackage,mosquitto-client-nossl))
diff --git a/net/mosquitto/files/etc/config/mosquitto b/net/mosquitto/files/etc/config/mosquitto
new file mode 100644 (file)
index 0000000..fc7544c
--- /dev/null
@@ -0,0 +1,4 @@
+config owrt owrt
+    option use_uci 0
+
+config mosquitto mosquitto
diff --git a/net/mosquitto/files/etc/init.d/mosquitto b/net/mosquitto/files/etc/init.d/mosquitto
new file mode 100755 (executable)
index 0000000..a84bcee
--- /dev/null
@@ -0,0 +1,211 @@
+#!/bin/sh /etc/rc.common
+# Basic init script for mosquitto
+# April 2012, OpenWrt.org
+# Provides support for the luci-app-mosquitto package, if installed
+
+START=80
+USE_PROCD=1
+TCONF=/tmp/mosquitto.generated.conf
+
+# Usage: append_if cfg uci_name output_name
+# add a config line of the form "output_name <value>"
+# if the "uci_name" was found.
+# output_name defaults to uci_name if not specified.
+append_if() {
+    local cfg="$1"
+    local uci_name="$2"
+    local out_name="$3"
+    if [ -z "$out_name" ]; then
+        out_name=$uci_name
+    fi
+    config_get val $cfg $uci_name
+    if [ -n "$val" ]; then
+        echo "$out_name $val" >> $TCONF
+    fi
+}
+
+# mosquitto uses true/false, uci uses 1/0
+# note that this is not shell truthy, but equality with 1!
+append_bool() {
+    if [ $2 -eq 1 ]; then
+        echo "$1 true" >> $TCONF
+    else
+        echo "$1 false" >> $TCONF
+    fi
+}
+
+# as per append_if, but gets the value as a uci bool, not raw
+append_optional_bool() {
+    local cfg="$1"
+    local uci_name="$2"
+    local out_name="$3"
+    config_get val $cfg $uci_name
+    if [ -n "$val" ]; then
+        config_get_bool real $cfg $uci_name
+        append_bool $out_name $real
+    fi
+}
+
+
+convert_mosq_general() {
+       local cfg="$1"
+       config_get destinations "$1" log_dest
+       for dest in $destinations; do
+               echo "log_dest $dest" >> $TCONF
+       done
+
+       config_get_bool no_remote "$1" no_remote_access 0
+       if [ "$no_remote" -eq 1 ]; then
+               echo "bind_address localhost" >> $TCONF
+       fi
+
+       config_get port "$1" port 1883
+       echo "port $port" >> $TCONF
+       append_if "$1" protocol
+       append_if "$1" max_inflight_messages
+       append_if "$1" max_queued_messages
+       append_if "$1" sys_interval
+}
+
+convert_persistence() {
+       local cfg="$1"
+
+       append_if "$cfg" client_expiration persistent_client_expiration
+       append_if "$cfg" autosave_interval
+       append_optional_bool "$cfg" autosave_on_changes autosave_on_changes
+       append_optional_bool "$cfg" persistence persistence
+       append_if "$cfg" file persistence_file
+       config_get loc "$cfg" location
+       if [ -n "$loc" ]; then
+               [ -d "$loc" ] || {
+                       mkdir -p "$loc";
+                       chown mosquitto "$loc";
+               }
+               echo "persistence_location $loc" >> $TCONF
+       fi
+}
+
+add_listener() {
+    echo "" >> $TCONF
+    config_get port "$1" port
+    if [ -z "$port" ]; then
+        echo "Ignoring listener section without port"
+        return
+    fi
+    config_get_bool no_remote "$1" no_remote_access 0
+    if [ "$no_remote" -eq 1 ]; then
+        echo "listener $port 127.0.0.1" >> $TCONF
+    else
+        echo "listener $port" >> $TCONF
+    fi
+
+    append_if "$1" protocol
+    append_if "$1" http_dir
+    append_optional_bool "$1" use_username_as_clientid use_username_as_clientid
+    append_if "$1" cafile
+    append_if "$1" capath
+    append_if "$1" certfile
+    append_if "$1" keyfile
+    append_if "$1" tls_version
+    append_optional_bool "$1" require_certificate require_certificate
+    append_optional_bool "$1" use_identity_as_username use_identity_as_username
+    append_if "$1" crlfile
+    append_if "$1" ciphers
+    append_if "$1" psk_hint
+}
+
+add_topic() {
+    echo "topic $1" >> $TCONF
+}
+
+add_bridge() {
+    config_get conn "$1" connection
+    config_get addr "$1" address
+    if [ -z "$conn" -o -z "$addr" ]; then
+        echo "Ignoring bridge section, misisng connection/address"
+        return
+    fi
+    echo "" >> $TCONF
+    echo "# Bridge connection from UCI section" >> $TCONF
+    append_if "$1" connection
+    append_if "$1" address
+
+    config_list_foreach "$1" topic add_topic
+    append_optional_bool "$1" cleansession cleansession
+    append_optional_bool "$1" try_private try_private
+    append_optional_bool "$1" notifications notifications
+    append_optional_bool "$1" round_robin round_robin
+
+    # Note, deprecated upstream, preserve old uci configs
+    append_if "$1" clientid remote_clientid
+    append_if "$1" remote_clientid
+    append_if "$1" local_clientid
+    append_if "$1" notification_topic
+    append_if "$1" keepalive_interval
+    append_if "$1" start_type
+    append_if "$1" restart_timeout
+    append_if "$1" idle_timeout
+    append_if "$1" threshold
+    append_if "$1" protocol_version bridge_protocol_version
+    append_optional_bool "$1" attempt_unsubscribe bridge_attempt_unsubscribe
+    append_if "$1" identity bridge_identity
+    append_if "$1" psk bridge_psk
+    append_if "$1" tls_version bridge_tls_version
+
+    append_if "$1" restart_timeout
+    append_if "$1" capath bridge_capath
+    append_if "$1" cafile bridge_cafile
+    append_if "$1" certfile bridge_certfile
+    append_if "$1" keyfile bridge_keyfile
+    # Note, deprecated upstream, preserve old uci configs
+    append_if "$1" username remote_username
+    # Note, deprecated upstream, preserve old uci configs
+    append_if "$1" password remote_password
+    append_if "$1" remote_username
+    append_if "$1" remote_password
+}
+
+
+convert_uci() {
+       rm -rf $TCONF
+       echo "Generating mosquitto config file in $TCONF"
+       echo "# mosquitto.conf file generated from UCI config." >>$TCONF
+       # Don't include a timestamp, it makes md5sum compares fail
+
+       config_load mosquitto
+       config_foreach convert_mosq_general "mosquitto"
+       config_foreach convert_persistence "persistence"
+       config_foreach add_listener "listener"
+       config_foreach add_bridge "bridge"
+}
+
+start_service_real() {
+       local cfg="$1"
+       local use_uci write_pid
+       config_get use_uci "$cfg" use_uci
+       if [ "$use_uci" -eq 1 ]; then
+               CONF=$TCONF
+               convert_uci
+       else
+               CONF=/etc/mosquitto/mosquitto.conf
+        fi
+       config_get write_pid "$cfg" write_pid 0
+
+       procd_open_instance
+       procd_set_param command mosquitto
+       procd_append_param command -c $CONF
+       # Makes /etc/init.d/mosquitto reload work if you edit the final file.
+       procd_set_param file $CONF
+       [ "$write_pid" -eq 1 ] && procd_set_param pidfile /var/run/mosquitto.pid
+       procd_close_instance
+}
+
+start_service() {
+       config_load mosquitto
+       config_foreach start_service_real owrt
+}
+
+service_triggers() {
+       # Makes "reload_config" work
+       procd_add_reload_trigger "mosquitto"
+}
diff --git a/net/mosquitto/patches/100-remove-build-timestamps.patch b/net/mosquitto/patches/100-remove-build-timestamps.patch
new file mode 100644 (file)
index 0000000..7dadcf7
--- /dev/null
@@ -0,0 +1,56 @@
+diff --git a/config.mk b/config.mk
+index bfaa208..2a3e2bf 100644
+--- a/config.mk
++++ b/config.mk
+@@ -87,7 +87,6 @@ WITH_SOCKS:=yes
+ # Also bump lib/mosquitto.h, CMakeLists.txt,
+ # installer/mosquitto.nsi, installer/mosquitto-cygwin.nsi
+ VERSION=1.4.15
+-TIMESTAMP:=$(shell date "+%F %T%z")
+ # Client library SO version. Bump if incompatible API/ABI changes are made.
+ SOVERSION=1
+@@ -115,7 +114,7 @@ LIB_CFLAGS:=${CFLAGS} ${CPPFLAGS} -I. -I.. -I../lib
+ LIB_CXXFLAGS:=$(LIB_CFLAGS) ${CPPFLAGS}
+ LIB_LDFLAGS:=${LDFLAGS}
+-BROKER_CFLAGS:=${LIB_CFLAGS} ${CPPFLAGS} -DVERSION="\"${VERSION}\"" -DTIMESTAMP="\"${TIMESTAMP}\"" -DWITH_BROKER
++BROKER_CFLAGS:=${LIB_CFLAGS} ${CPPFLAGS} -DVERSION="\"${VERSION}\"" -DWITH_BROKER
+ CLIENT_CFLAGS:=${CFLAGS} ${CPPFLAGS} -I../lib -DVERSION="\"${VERSION}\""
+ ifneq ($(or $(findstring $(UNAME),FreeBSD), $(findstring $(UNAME),OpenBSD)),)
+diff --git a/src/conf.c b/src/conf.c
+index 25d80a6..9ab0599 100644
+--- a/src/conf.c
++++ b/src/conf.c
+@@ -338,7 +338,7 @@ void mqtt3_config_cleanup(struct mqtt3_config *config)
+ static void print_usage(void)
+ {
+-      printf("mosquitto version %s (build date %s)\n\n", VERSION, TIMESTAMP);
++      printf("mosquitto version %s\n\n", VERSION);
+       printf("mosquitto is an MQTT v3.1.1/v3.1 broker.\n\n");
+       printf("Usage: mosquitto [-c config_file] [-d] [-h] [-p port]\n\n");
+       printf(" -c : specify the broker config file.\n");
+diff --git a/src/mosquitto.c b/src/mosquitto.c
+index 22b6372..b581f45 100644
+--- a/src/mosquitto.c
++++ b/src/mosquitto.c
+@@ -291,7 +291,7 @@ int main(int argc, char *argv[])
+               rc = 1;
+               return rc;
+       }
+-      _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s (build date %s) starting", VERSION, TIMESTAMP);
++      _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s starting", VERSION);
+       if(int_db.config_file){
+               _mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "Config loaded from %s.", int_db.config_file);
+       }else{
+@@ -308,8 +308,6 @@ int main(int argc, char *argv[])
+               /* Set static $SYS messages */
+               snprintf(buf, 1024, "mosquitto version %s", VERSION);
+               mqtt3_db_messages_easy_queue(&int_db, NULL, "$SYS/broker/version", 2, strlen(buf), buf, 1);
+-              snprintf(buf, 1024, "%s", TIMESTAMP);
+-              mqtt3_db_messages_easy_queue(&int_db, NULL, "$SYS/broker/timestamp", 2, strlen(buf), buf, 1);
+       }
+ #endif
index ac07cb371361cb2cfa3d5aa6bca8e44401a68891..363affb43c3d02d47fef51bd91fce72640419931 100644 (file)
@@ -17,6 +17,7 @@ PKG_SOURCE_URL:=https://github.com/traviscross/mtr.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=4911c96ee4b3c31692664a845dccddabdfef107646d4861b21fd4053bd2b76e8
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
diff --git a/net/mwan3-luci/Makefile b/net/mwan3-luci/Makefile
deleted file mode 100644 (file)
index 8c77394..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# 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:=luci-app-mwan3
-PKG_VERSION:=1.4
-PKG_RELEASE:=5
-PKG_MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
-PKG_LICENSE:=GPLv2
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luci-app-mwan3
-  SECTION:=LuCI
-  CATEGORY:=LuCI
-  SUBMENU:=3. Applications
-  TITLE:=LuCI support for the MWAN3 multiwan hotplug script
-  DEPENDS:=+mwan3 +luci-mod-admin-full +luci-app-firewall +luci-lib-nixio
-  PKGARCH:=all
-  MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
-endef
-
-define Package/luci-app-mwan3/description
-Hotplug script which makes configuration of multiple WAN interfaces simple and
-manageable with loadbalancing/failover support for up to 250 physical or logical
-WAN interfaces, connection tracking and an easy to manage traffic ruleset
-endef
-
-define Build/Compile
-endef
-
-define Package/luci-app-mwan3/install
-       $(CP) ./files/* $(1)
-endef
-
-$(eval $(call BuildPackage,luci-app-mwan3))
diff --git a/net/mwan3-luci/files/etc/hotplug.d/iface/16-mwancustombak b/net/mwan3-luci/files/etc/hotplug.d/iface/16-mwancustombak
deleted file mode 100755 (executable)
index 6e2875e..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-# to enable this script uncomment the case loop at the bottom
-# to report mwan status on interface hotplug ifup/ifdown events modify the lines in the send_alert function
-
-send_alert()
-{
-       # variable "$1" stores the MWAN status information
-       # insert your code here to send the contents of "$1"
-       echo "$1"
-}
-
-gather_event_info()
-{
-       # create event information message
-       local EVENT_INFO="Interface [ "$INTERFACE" ($DEVICE) ] on router [ "$(uci -p /var/state get system.@system[0].hostname)" ] has triggered a hotplug [ "$ACTION" ] event on "$(date +"%a %b %d %Y %T %Z")""
-
-       # get current interface, policy and rule status
-       local CURRENT_STATUS="$(/usr/sbin/mwan3 status)"
-
-       # get last 50 MWAN systemlog messages
-       local MWAN_LOG="$(echo -e "Last 50 MWAN systemlog entries. Newest entries sorted at the top:\n$(logread | grep mwan3 | tail -n 50 | sed 'x;1!H;$!d;x')")"
-
-       # pass event info to send_alert function
-       send_alert "$(echo -e "$EVENT_INFO\n\n$CURRENT_STATUS\n\n$MWAN_LOG")"
-}
-
-#case "$ACTION" in
-#      ifup)
-#              gather_event_info
-#      ;;
-#
-#      ifdown)
-#              gather_event_info
-#      ;;
-#esac
-
-exit 0
diff --git a/net/mwan3-luci/files/etc/uci-defaults/mwan-luci b/net/mwan3-luci/files/etc/uci-defaults/mwan-luci
deleted file mode 100755 (executable)
index ff9a229..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-# replace existing mwan ucitrack entry
-uci -q batch <<-EOF >/dev/null
-       del ucitrack.@mwan3[-1]
-       add ucitrack mwan3
-       set ucitrack.@mwan3[-1].exec="/usr/sbin/mwan3 restart"
-       commit ucitrack
-EOF
-
-# remove LuCI cache
-rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
-
-exit 0
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua b/net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua
deleted file mode 100644 (file)
index 3d5a23d..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-module("luci.controller.mwan3", package.seeall)
-
-sys = require "luci.sys"
-ut = require "luci.util"
-
-ip = "/usr/bin/ip -4 "
-
-function index()
-       if not nixio.fs.access("/etc/config/mwan3") then
-               return
-       end
-
-       entry({"admin", "network", "mwan"},
-               alias("admin", "network", "mwan", "overview"),
-               _("Load Balancing"), 600)
-
-       entry({"admin", "network", "mwan", "overview"},
-               alias("admin", "network", "mwan", "overview", "overview_interface"),
-               _("Overview"), 10)
-       entry({"admin", "network", "mwan", "overview", "overview_interface"},
-               template("mwan/overview_interface"))
-       entry({"admin", "network", "mwan", "overview", "interface_status"},
-               call("interfaceStatus"))
-       entry({"admin", "network", "mwan", "overview", "overview_detailed"},
-               template("mwan/overview_detailed"))
-       entry({"admin", "network", "mwan", "overview", "detailed_status"},
-               call("detailedStatus"))
-
-       entry({"admin", "network", "mwan", "configuration"},
-               alias("admin", "network", "mwan", "configuration", "interface"),
-               _("Configuration"), 20)
-       entry({"admin", "network", "mwan", "configuration", "interface"},
-               arcombine(cbi("mwan/interface"), cbi("mwan/interfaceconfig")),
-               _("Interfaces"), 10).leaf = true
-       entry({"admin", "network", "mwan", "configuration", "member"},
-               arcombine(cbi("mwan/member"), cbi("mwan/memberconfig")),
-               _("Members"), 20).leaf = true
-       entry({"admin", "network", "mwan", "configuration", "policy"},
-               arcombine(cbi("mwan/policy"), cbi("mwan/policyconfig")),
-               _("Policies"), 30).leaf = true
-       entry({"admin", "network", "mwan", "configuration", "rule"},
-               arcombine(cbi("mwan/rule"), cbi("mwan/ruleconfig")),
-               _("Rules"), 40).leaf = true
-
-       entry({"admin", "network", "mwan", "advanced"},
-               alias("admin", "network", "mwan", "advanced", "hotplugscript"),
-               _("Advanced"), 100)
-       entry({"admin", "network", "mwan", "advanced", "hotplugscript"},
-               form("mwan/advanced_hotplugscript"))
-       entry({"admin", "network", "mwan", "advanced", "mwanconfig"},
-               form("mwan/advanced_mwanconfig"))
-       entry({"admin", "network", "mwan", "advanced", "networkconfig"},
-               form("mwan/advanced_networkconfig"))
-       entry({"admin", "network", "mwan", "advanced", "wirelessconfig"},
-               form("mwan/advanced_wirelessconfig"))
-       entry({"admin", "network", "mwan", "advanced", "diagnostics"},
-               template("mwan/advanced_diagnostics"))
-       entry({"admin", "network", "mwan", "advanced", "diagnostics_display"},
-               call("diagnosticsData"), nil).leaf = true
-       entry({"admin", "network", "mwan", "advanced", "troubleshooting"},
-               template("mwan/advanced_troubleshooting"))
-       entry({"admin", "network", "mwan", "advanced", "troubleshooting_display"},
-               call("troubleshootingData"))
-end
-
-function getInterfaceStatus(ruleNumber, interfaceName)
-       if ut.trim(sys.exec("uci -p /var/state get mwan3." .. interfaceName .. ".enabled")) == "1" then
-               if ut.trim(sys.exec(ip .. "route list table " .. ruleNumber)) ~= "" then
-                       if ut.trim(sys.exec("uci -p /var/state get mwan3." .. interfaceName .. ".track_ip")) ~= "" then
-                               return "online"
-                       else
-                               return "notMonitored"
-                       end
-               else
-                       return "offline"
-               end
-       else
-               return "notEnabled"
-       end
-end
-
-function getInterfaceName()
-       local ruleNumber, status = 0, ""
-       uci.cursor():foreach("mwan3", "interface",
-               function (section)
-                       ruleNumber = ruleNumber+1
-                       status = status .. section[".name"] .. "[" .. getInterfaceStatus(ruleNumber, section[".name"]) .. "]"
-               end
-       )
-       return status
-end
-
-function interfaceStatus()
-       local ntm = require "luci.model.network".init()
-
-       local mArray = {}
-
-       -- overview status
-       local statusString = getInterfaceName()
-       if statusString ~= "" then
-               mArray.wans = {}
-               wansid = {}
-
-               for wanName, interfaceState in string.gfind(statusString, "([^%[]+)%[([^%]]+)%]") do
-                       local wanInterfaceName = ut.trim(sys.exec("uci -p /var/state get network." .. wanName .. ".ifname"))
-                               if wanInterfaceName == "" then
-                                       wanInterfaceName = "X"
-                               end
-                       local wanDeviceLink = ntm:get_interface(wanInterfaceName)
-                               wanDeviceLink = wanDeviceLink and wanDeviceLink:get_network()
-                               wanDeviceLink = wanDeviceLink and wanDeviceLink:adminlink() or "#"
-                       wansid[wanName] = #mArray.wans + 1
-                       mArray.wans[wansid[wanName]] = { name = wanName, link = wanDeviceLink, ifname = wanInterfaceName, status = interfaceState }
-               end
-       end
-
-       -- overview status log
-       local mwanLog = ut.trim(sys.exec("logread | grep mwan3 | tail -n 50 | sed 'x;1!H;$!d;x'"))
-       if mwanLog ~= "" then
-               mArray.mwanlog = { mwanLog }
-       end
-
-       luci.http.prepare_content("application/json")
-       luci.http.write_json(mArray)
-end
-
-function detailedStatus()
-       local mArray = {}
-
-       -- detailed mwan status
-       local detailStatusInfo = ut.trim(sys.exec("/usr/sbin/mwan3 status"))
-       if detailStatusInfo ~= "" then
-               mArray.mwandetail = { detailStatusInfo }
-       end
-
-       luci.http.prepare_content("application/json")
-       luci.http.write_json(mArray)
-end
-
-function diagnosticsData(interface, tool, task)
-       function getInterfaceNumber()
-               local number = 0
-               uci.cursor():foreach("mwan3", "interface",
-                       function (section)
-                               number = number+1
-                               if section[".name"] == interface then
-                                       interfaceNumber = number
-                               end
-                       end
-               )
-       end
-
-       local mArray = {}
-
-       local results = ""
-       if tool == "service" then
-               os.execute("/usr/sbin/mwan3 " .. task)
-               if task == "restart" then
-                       results = "MWAN3 restarted"
-               elseif task == "stop" then
-                       results = "MWAN3 stopped"
-               else
-                       results = "MWAN3 started"
-               end
-       else
-               local interfaceDevice = ut.trim(sys.exec("uci -p /var/state get network." .. interface .. ".ifname"))
-               if interfaceDevice ~= "" then
-                       if tool == "ping" then
-                               local gateway = ut.trim(sys.exec("route -n | awk '{if ($8 == \"" .. interfaceDevice .. "\" && $1 == \"0.0.0.0\" && $3 == \"0.0.0.0\") print $2}'"))
-                               if gateway ~= "" then
-                                       if task == "gateway" then
-                                               local pingCommand = "ping -c 3 -W 2 -I " .. interfaceDevice .. " " .. gateway
-                                               results = pingCommand .. "\n\n" .. sys.exec(pingCommand)
-                                       else
-                                               local tracked = ut.trim(sys.exec("uci -p /var/state get mwan3." .. interface .. ".track_ip"))
-                                               if tracked ~= "" then
-                                                       for z in tracked:gmatch("[^ ]+") do
-                                                               local pingCommand = "ping -c 3 -W 2 -I " .. interfaceDevice .. " " .. z
-                                                               results = results .. pingCommand .. "\n\n" .. sys.exec(pingCommand) .. "\n\n"
-                                                       end
-                                               else
-                                                       results = "No tracking IP addresses configured on " .. interface
-                                               end
-                                       end
-                               else
-                                       results = "No default gateway for " .. interface .. " found. Default route does not exist or is configured incorrectly"
-                               end
-                       elseif tool == "rulechk" then
-                               getInterfaceNumber()
-                               local rule1 = sys.exec(ip .. "rule | grep $(echo $((" .. interfaceNumber .. " + 1000)))")
-                               local rule2 = sys.exec(ip .. "rule | grep $(echo $((" .. interfaceNumber .. " + 2000)))")
-                               if rule1 ~= "" and rule2 ~= "" then
-                                       results = "All required interface IP rules found:\n\n" .. rule1 .. rule2
-                               elseif rule1 ~= "" or rule2 ~= "" then
-                                       results = "Missing 1 of the 2 required interface IP rules\n\n\nRules found:\n\n" .. rule1 .. rule2
-                               else
-                                       results = "Missing both of the required interface IP rules"
-                               end
-                       elseif tool == "routechk" then
-                               getInterfaceNumber()
-                               local routeTable = sys.exec(ip .. "route list table " .. interfaceNumber)
-                               if routeTable ~= "" then
-                                       results = "Interface routing table " .. interfaceNumber .. " was found:\n\n" .. routeTable
-                               else
-                                       results = "Missing required interface routing table " .. interfaceNumber
-                               end
-                       elseif tool == "hotplug" then
-                               if task == "ifup" then
-                                       os.execute("/usr/sbin/mwan3 ifup " .. interface)
-                                       results = "Hotplug ifup sent to interface " .. interface .. "..."
-                               else
-                                       os.execute("/usr/sbin/mwan3 ifdown " .. interface)
-                                       results = "Hotplug ifdown sent to interface " .. interface .. "..."
-                               end
-                       end
-               else
-                       results = "Unable to perform diagnostic tests on " .. interface .. ". There is no physical or virtual device associated with this interface"
-               end
-       end
-       if results ~= "" then
-               results = ut.trim(results)
-               mArray.diagnostics = { results }
-       end
-
-       luci.http.prepare_content("application/json")
-       luci.http.write_json(mArray)
-end
-
-function troubleshootingData()
-       local ver = require "luci.version"
-
-       local mArray = {}
-
-       -- software versions
-       local wrtRelease = ut.trim(ver.distversion)
-               if wrtRelease ~= "" then
-                       wrtRelease = "OpenWrt - " .. wrtRelease
-               else
-                       wrtRelease = "OpenWrt - unknown"
-               end
-       local luciRelease = ut.trim(ver.luciversion)
-               if luciRelease ~= "" then
-                       luciRelease = "\nLuCI - " .. luciRelease
-               else
-                       luciRelease = "\nLuCI - unknown"
-               end
-       local mwanVersion = ut.trim(sys.exec("opkg info mwan3 | grep Version | awk '{print $2}'"))
-               if mwanVersion ~= "" then
-                       mwanVersion = "\n\nmwan3 - " .. mwanVersion
-               else
-                       mwanVersion = "\n\nmwan3 - unknown"
-               end
-       local mwanLuciVersion = ut.trim(sys.exec("opkg info luci-app-mwan3 | grep Version | awk '{print $2}'"))
-               if mwanLuciVersion ~= "" then
-                       mwanLuciVersion = "\nmwan3-luci - " .. mwanLuciVersion
-               else
-                       mwanLuciVersion = "\nmwan3-luci - unknown"
-               end
-       mArray.versions = { wrtRelease .. luciRelease .. mwanVersion .. mwanLuciVersion }
-
-       -- mwan config
-       local mwanConfig = ut.trim(sys.exec("cat /etc/config/mwan3"))
-               if mwanConfig == "" then
-                       mwanConfig = "No data found"
-               end
-       mArray.mwanconfig = { mwanConfig }
-
-       -- network config
-       local networkConfig = ut.trim(sys.exec("cat /etc/config/network | sed -e 's/.*username.*/       USERNAME HIDDEN/' -e 's/.*password.*/   PASSWORD HIDDEN/'"))
-               if networkConfig == "" then
-                       networkConfig = "No data found"
-               end
-       mArray.netconfig = { networkConfig }
-
-       -- wireless config
-       local wirelessConfig = ut.trim(sys.exec("cat /etc/config/wireless | sed -e 's/.*username.*/     USERNAME HIDDEN/' -e 's/.*password.*/   PASSWORD HIDDEN/' -e 's/.*key.*/        KEY HIDDEN/'"))
-               if wirelessConfig == "" then
-                       wirelessConfig = "No data found"
-               end
-       mArray.wificonfig = { wirelessConfig }
-       
-       -- ifconfig
-       local ifconfig = ut.trim(sys.exec("ifconfig"))
-               if ifconfig == "" then
-                       ifconfig = "No data found"
-               end
-       mArray.ifconfig = { ifconfig }
-
-       -- route -n
-       local routeShow = ut.trim(sys.exec("route -n"))
-               if routeShow == "" then
-                       routeShow = "No data found"
-               end
-       mArray.routeshow = { routeShow }
-
-       -- ip rule show
-       local ipRuleShow = ut.trim(sys.exec(ip .. "rule show"))
-               if ipRuleShow == "" then
-                       ipRuleShow = "No data found"
-               end
-       mArray.iprule = { ipRuleShow }
-
-       -- ip route list table 1-250
-       local routeList, routeString = ut.trim(sys.exec(ip .. "rule | sed 's/://g' | awk '$1>=2001 && $1<=2250' | awk '{print $NF}'")), ""
-               if routeList ~= "" then
-                       for line in routeList:gmatch("[^\r\n]+") do
-                               routeString = routeString .. line .. "\n" .. sys.exec(ip .. "route list table " .. line)
-                       end
-                       routeString = ut.trim(routeString)
-               else
-                       routeString = "No data found"
-               end
-       mArray.routelist = { routeString }
-
-       -- default firewall output policy
-       local firewallOut = ut.trim(sys.exec("uci -p /var/state get firewall.@defaults[0].output"))
-               if firewallOut == "" then
-                       firewallOut = "No data found"
-               end
-       mArray.firewallout = { firewallOut }
-
-       -- iptables
-       local iptables = ut.trim(sys.exec("iptables -L -t mangle -v -n"))
-               if iptables == "" then
-                       iptables = "No data found"
-               end
-       mArray.iptables = { iptables }
-
-       luci.http.prepare_content("application/json")
-       luci.http.write_json(mArray)
-end
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_hotplugscript.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_hotplugscript.lua
deleted file mode 100644 (file)
index 0e7b8b1..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
--- ------ hotplug script configuration ------ --
-
-fs = require "nixio.fs"
-sys = require "luci.sys"
-ut = require "luci.util"
-
-script = "/etc/hotplug.d/iface/16-mwancustom"
-scriptBackup = "/etc/hotplug.d/iface/16-mwancustombak"
-
-if luci.http.formvalue("cbid.luci.1._restorebak") then -- restore button has been clicked
-       luci.http.redirect(luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript") .. "?restore=yes")
-elseif luci.http.formvalue("restore") == "yes" then -- restore script from backup
-       os.execute("cp -f " .. scriptBackup .. " " .. script)
-end
-
-
-m5 = SimpleForm("luci", nil)
-       m5:append(Template("mwan/advanced_hotplugscript")) -- highlight current tab
-
-f = m5:section(SimpleSection, nil,
-       translate("This section allows you to modify the contents of /etc/hotplug.d/iface/16-mwancustom<br />" ..
-       "This is useful for running system commands and/or scripts based on interface ifup or ifdown hotplug events<br /><br />" ..
-       "Notes:<br />" ..
-       "The first line of the script must be &#34;#!/bin/sh&#34; without quotes<br />" ..
-       "Lines beginning with # are comments and are not executed<br /><br />" ..
-       "Available variables:<br />" ..
-       "$ACTION is the hotplug event (ifup, ifdown)<br />" ..
-       "$INTERFACE is the interface name (wan1, wan2, etc.)<br />" ..
-       "$DEVICE is the device name attached to the interface (eth0.1, eth1, etc.)"))
-
-
-restore = f:option(Button, "_restorebak", translate("Restore default hotplug script"))
-       restore.inputtitle = translate("Restore...")
-       restore.inputstyle = "apply"
-
-t = f:option(TextValue, "lines")
-       t.rmempty = true
-       t.rows = 20
-
-       function t.cfgvalue()
-               local hps = fs.readfile(script)
-               if not hps or hps == "" then -- if script does not exist or is blank restore from backup
-                       sys.call("cp -f " .. scriptBackup .. " " .. script)
-                       return fs.readfile(script)
-               else
-                       return hps
-               end
-       end
-
-       function t.write(self, section, data) -- format and write new data to script
-               return fs.writefile(script, ut.trim(data:gsub("\r\n", "\n")) .. "\n")
-       end
-
-
-return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_mwanconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_mwanconfig.lua
deleted file mode 100644 (file)
index e0a99e8..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
--- ------ mwan configuration ------ --
-
-ut = require "luci.util"
-
-mwanConfig = "/etc/config/mwan3"
-
-
-m5 = SimpleForm("luci", nil)
-       m5:append(Template("mwan/advanced_mwanconfig")) -- highlight current tab
-
-
-f = m5:section(SimpleSection, nil,
-       translate("This section allows you to modify the contents of /etc/config/mwan3"))
-
-t = f:option(TextValue, "lines")
-       t.rmempty = true
-       t.rows = 20
-
-       function t.cfgvalue()
-               return nixio.fs.readfile(mwanConfig) or ""
-       end
-
-       function t.write(self, section, data) -- format and write new data to script
-               return nixio.fs.writefile(mwanConfig, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n")
-       end
-
-       function f.handle(self, state, data)
-               return true
-       end
-
-
-return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_networkconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_networkconfig.lua
deleted file mode 100644 (file)
index b93d897..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
--- ------ network configuration ------ --
-
-ut = require "luci.util"
-
-networkConfig = "/etc/config/network"
-
-
-m5 = SimpleForm("networkconf", nil)
-       m5:append(Template("mwan/advanced_networkconfig")) -- highlight current tab
-
-
-f = m5:section(SimpleSection, nil,
-       translate("This section allows you to modify the contents of /etc/config/network"))
-
-t = f:option(TextValue, "lines")
-       t.rmempty = true
-       t.rows = 20
-
-       function t.cfgvalue()
-               return nixio.fs.readfile(networkConfig) or ""
-       end
-
-       function t.write(self, section, data) -- format and write new data to script
-               return nixio.fs.writefile(networkConfig, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n")
-       end
-
-       function f.handle(self, state, data)
-               return true
-       end
-
-
-return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_wirelessconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_wirelessconfig.lua
deleted file mode 100644 (file)
index 95e9f7c..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
--- ------ wireless configuration ------ --
-
-ut = require "luci.util"
-
-wirelessConfig = "/etc/config/wireless"
-
-
-m5 = SimpleForm("wirelessconf", nil)
-       m5:append(Template("mwan/advanced_wirelessconfig")) -- highlight current tab
-
-
-f = m5:section(SimpleSection, nil,
-       translate("This section allows you to modify the contents of /etc/config/wireless"))
-
-t = f:option(TextValue, "lines")
-       t.rmempty = true
-       t.rows = 20
-
-       function t.cfgvalue()
-               return nixio.fs.readfile(wirelessConfig) or ""
-       end
-
-       function t.write(self, section, data) -- format and write new data to script
-               return nixio.fs.writefile(wirelessConfig, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n")
-       end
-
-       function f.handle(self, state, data)
-               return true
-       end
-
-
-return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/interface.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/interface.lua
deleted file mode 100644 (file)
index a8e68a0..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
--- ------ extra functions ------ --
-
-function interfaceCheck() -- find issues with too many interfaces, reliability and metric
-       uci.cursor():foreach("mwan3", "interface",
-               function (section)
-                       local interfaceName = section[".name"]
-                       interfaceNumber = interfaceNumber+1 -- count number of mwan interfaces configured
-                       -- create list of metrics for none and duplicate checking
-                       local metricValue = ut.trim(sys.exec("uci -p /var/state get network." .. interfaceName .. ".metric"))
-                       if metricValue == "" then
-                               errorFound = 1
-                               errorNoMetricList = errorNoMetricList .. interfaceName .. " "
-                       else
-                               metricList = metricList .. interfaceName .. " " .. metricValue .. "\n"
-                       end
-                       -- check if any interfaces have a higher reliability requirement than tracking IPs configured
-                       local trackingNumber = tonumber(ut.trim(sys.exec("echo $(uci -p /var/state get mwan3." .. interfaceName .. ".track_ip) | wc -w")))
-                       if trackingNumber > 0 then
-                               local reliabilityNumber = tonumber(ut.trim(sys.exec("uci -p /var/state get mwan3." .. interfaceName .. ".reliability")))
-                               if reliabilityNumber and reliabilityNumber > trackingNumber then
-                                       errorFound = 1
-                                       errorReliabilityList = errorReliabilityList .. interfaceName .. " "
-                               end
-                       end
-                       -- check if any interfaces are not properly configured in /etc/config/network or have no default route in main routing table
-                       if ut.trim(sys.exec("uci -p /var/state get network." .. interfaceName)) == "interface" then
-                               local interfaceDevice = ut.trim(sys.exec("uci -p /var/state get network." .. interfaceName .. ".ifname"))
-                               if interfaceDevice == "uci: Entry not found" or interfaceDevice == "" then
-                                       errorFound = 1
-                                       errorNetConfigList = errorNetConfigList .. interfaceName .. " "
-                                       errorRouteList = errorRouteList .. interfaceName .. " "
-                               else
-                                       local routeCheck = ut.trim(sys.exec("route -n | awk '{if ($8 == \"" .. interfaceDevice .. "\" && $1 == \"0.0.0.0\" && $3 == \"0.0.0.0\") print $1}'"))
-                                       if routeCheck == "" then
-                                               errorFound = 1
-                                               errorRouteList = errorRouteList .. interfaceName .. " "
-                                       end
-                               end
-                       else
-                               errorFound = 1
-                               errorNetConfigList = errorNetConfigList .. interfaceName .. " "
-                               errorRouteList = errorRouteList .. interfaceName .. " "
-                       end
-               end
-       )
-       -- check if any interfaces have duplicate metrics
-       local metricDuplicateNumbers = sys.exec("echo '" .. metricList .. "' | awk '{print $2}' | uniq -d")
-       if metricDuplicateNumbers ~= "" then
-               errorFound = 1
-               local metricDuplicates = ""
-               for line in metricDuplicateNumbers:gmatch("[^\r\n]+") do
-                       metricDuplicates = sys.exec("echo '" .. metricList .. "' | grep '" .. line .. "' | awk '{print $1}'")
-                       errorDuplicateMetricList = errorDuplicateMetricList .. metricDuplicates
-               end
-               errorDuplicateMetricList = sys.exec("echo '" .. errorDuplicateMetricList .. "' | tr '\n' ' '")
-       end
-end
-
-function interfaceWarnings() -- display status and warning messages at the top of the page
-       local warnings = ""
-       if interfaceNumber <= 250 then
-               warnings = "<strong>There are currently " .. interfaceNumber .. " of 250 supported interfaces configured</strong>"
-       else
-               warnings = "<font color=\"ff0000\"><strong>WARNING: " .. interfaceNumber .. " interfaces are configured exceeding the maximum of 250!</strong></font>"
-       end
-       if errorReliabilityList ~= " " then
-               warnings = warnings .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces have a higher reliability requirement than there are tracking IP addresses!</strong></font>"
-       end
-       if errorRouteList ~= " " then
-               warnings = warnings .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces have no default route in the main routing table!</strong></font>"
-       end
-       if errorNetConfigList ~= " " then
-               warnings = warnings .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces are configured incorrectly or not at all in /etc/config/network!</strong></font>"
-       end
-       if errorNoMetricList ~= " " then
-               warnings = warnings .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces have no metric configured in /etc/config/network!</strong></font>"
-       end
-       if errorDuplicateMetricList ~= " " then
-               warnings = warnings .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces have duplicate metrics configured in /etc/config/network!</strong></font>"
-       end
-       return warnings
-end
-
--- ------ interface configuration ------ --
-
-dsp = require "luci.dispatcher"
-sys = require "luci.sys"
-ut = require "luci.util"
-
-interfaceNumber = 0
-metricList = ""
-errorFound = 0
-errorDuplicateMetricList = " "
-errorNetConfigList = " "
-errorNoMetricList = " "
-errorReliabilityList = " "
-errorRouteList = " "
-interfaceCheck()
-
-
-m5 = Map("mwan3", translate("MWAN Interface Configuration"),
-       translate(interfaceWarnings()))
-       m5:append(Template("mwan/config_css"))
-
-
-mwan_interface = m5:section(TypedSection, "interface", translate("Interfaces"),
-       translate("MWAN supports up to 250 physical and/or logical interfaces<br />" ..
-       "MWAN requires that all interfaces have a unique metric configured in /etc/config/network<br />" ..
-       "Names must match the interface name found in /etc/config/network (see advanced tab)<br />" ..
-       "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" ..
-       "Interfaces may not share the same name as configured members, policies or rules"))
-       mwan_interface.addremove = true
-       mwan_interface.dynamic = false
-       mwan_interface.sectionhead = "Interface"
-       mwan_interface.sortable = true
-       mwan_interface.template = "cbi/tblsection"
-       mwan_interface.extedit = dsp.build_url("admin", "network", "mwan", "configuration", "interface", "%s")
-       function mwan_interface.create(self, section)
-               TypedSection.create(self, section)
-               m5.uci:save("mwan3")
-               luci.http.redirect(dsp.build_url("admin", "network", "mwan", "configuration", "interface", section))
-       end
-
-
-enabled = mwan_interface:option(DummyValue, "enabled", translate("Enabled"))
-       enabled.rawhtml = true
-       function enabled.cfgvalue(self, s)
-               if self.map:get(s, "enabled") == "1" then
-                       return "Yes"
-               else
-                       return "No"
-               end
-       end
-
-track_ip = mwan_interface:option(DummyValue, "track_ip", translate("Tracking IP"))
-       track_ip.rawhtml = true
-       function track_ip.cfgvalue(self, s)
-               tracked = self.map:get(s, "track_ip")
-               if tracked then
-                       local ipList = ""
-                       for k,v in pairs(tracked) do
-                               ipList = ipList .. v .. "<br />"
-                       end
-                       return ipList
-               else
-                       return "&#8212;"
-               end
-       end
-
-reliability = mwan_interface:option(DummyValue, "reliability", translate("Tracking reliability"))
-       reliability.rawhtml = true
-       function reliability.cfgvalue(self, s)
-               if tracked then
-                       return self.map:get(s, "reliability") or "&#8212;"
-               else
-                       return "&#8212;"
-               end
-       end
-
-count = mwan_interface:option(DummyValue, "count", translate("Ping count"))
-       count.rawhtml = true
-       function count.cfgvalue(self, s)
-               if tracked then
-                       return self.map:get(s, "count") or "&#8212;"
-               else
-                       return "&#8212;"
-               end
-       end
-
-timeout = mwan_interface:option(DummyValue, "timeout", translate("Ping timeout"))
-       timeout.rawhtml = true
-       function timeout.cfgvalue(self, s)
-               if tracked then
-                       local timeoutValue = self.map:get(s, "timeout")
-                       if timeoutValue then
-                               return timeoutValue .. "s"
-                       else
-                               return "&#8212;"
-                       end
-               else
-                       return "&#8212;"
-               end
-       end
-
-interval = mwan_interface:option(DummyValue, "interval", translate("Ping interval"))
-       interval.rawhtml = true
-       function interval.cfgvalue(self, s)
-               if tracked then
-                       local intervalValue = self.map:get(s, "interval")
-                       if intervalValue then
-                               return intervalValue .. "s"
-                       else
-                               return "&#8212;"
-                       end
-               else
-                       return "&#8212;"
-               end
-       end
-
-down = mwan_interface:option(DummyValue, "down", translate("Interface down"))
-       down.rawhtml = true
-       function down.cfgvalue(self, s)
-               if tracked then
-                       return self.map:get(s, "down") or "&#8212;"
-               else
-                       return "&#8212;"
-               end
-       end
-
-up = mwan_interface:option(DummyValue, "up", translate("Interface up"))
-       up.rawhtml = true
-       function up.cfgvalue(self, s)
-               if tracked then
-                       return self.map:get(s, "up") or "&#8212;"
-               else
-                       return "&#8212;"
-               end
-       end
-
-metric = mwan_interface:option(DummyValue, "metric", translate("Metric"))
-       metric.rawhtml = true
-       function metric.cfgvalue(self, s)
-               local metricValue = sys.exec("uci -p /var/state get network." .. s .. ".metric")
-               if metricValue ~= "" then
-                       return metricValue
-               else
-                       return "&#8212;"
-               end
-       end
-
-errors = mwan_interface:option(DummyValue, "errors", translate("Errors"))
-       errors.rawhtml = true
-       function errors.cfgvalue(self, s)
-               if errorFound == 1 then
-                       local mouseOver, lineBreak = "", ""
-                       if string.find(errorReliabilityList, " " .. s .. " ") then
-                               mouseOver = "Higher reliability requirement than there are tracking IP addresses"
-                               lineBreak = "&#10;&#10;"
-                       end
-                       if string.find(errorRouteList, " " .. s .. " ") then
-                               mouseOver = mouseOver .. lineBreak .. "No default route in the main routing table"
-                               lineBreak = "&#10;&#10;"
-                       end
-                       if string.find(errorNetConfigList, " " .. s .. " ") then
-                               mouseOver = mouseOver .. lineBreak .. "Configured incorrectly or not at all in /etc/config/network"
-                               lineBreak = "&#10;&#10;"
-                       end
-                       if string.find(errorNoMetricList, " " .. s .. " ") then
-                               mouseOver = mouseOver .. lineBreak .. "No metric configured in /etc/config/network"
-                               lineBreak = "&#10;&#10;"
-                       end
-                       if string.find(errorDuplicateMetricList, " " .. s .. " ") then
-                               mouseOver = mouseOver .. lineBreak .. "Duplicate metric configured in /etc/config/network"
-                       end
-                       if mouseOver == "" then
-                               return ""
-                       else
-                               return "<span title=\"" .. mouseOver .. "\"><img src=\"/luci-static/resources/cbi/reset.gif\" alt=\"error\"></img></span>"
-                       end
-               else
-                       return ""
-               end
-       end
-
-
-return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/interfaceconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/interfaceconfig.lua
deleted file mode 100644 (file)
index 387ff01..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
--- ------ extra functions ------ --
-
-function interfaceCheck()
-       metricValue = ut.trim(sys.exec("uci -p /var/state get network." .. arg[1] .. ".metric"))
-       if metricValue == "" then -- no metric
-               errorNoMetric = 1
-       else -- if metric exists create list of interface metrics to compare against for duplicates
-               uci.cursor():foreach("mwan3", "interface",
-                       function (section)
-                               local metricValue = ut.trim(sys.exec("uci -p /var/state get network." .. section[".name"] .. ".metric"))
-                               metricList = metricList .. section[".name"] .. " " .. metricValue .. "\n"
-                       end
-               )
-               -- compare metric against list
-               local metricDuplicateNumbers, metricDuplicates = sys.exec("echo '" .. metricList .. "' | awk '{print $2}' | uniq -d"), ""
-               for line in metricDuplicateNumbers:gmatch("[^\r\n]+") do
-                       metricDuplicates = sys.exec("echo '" .. metricList .. "' | grep '" .. line .. "' | awk '{print $1}'")
-                       errorDuplicateMetricList = errorDuplicateMetricList .. metricDuplicates
-               end
-               if sys.exec("echo '" .. errorDuplicateMetricList .. "' | grep -w " .. arg[1]) ~= "" then
-                       errorDuplicateMetric = 1
-               end
-       end
-       -- check if this interface has a higher reliability requirement than track IPs configured
-       local trackingNumber = tonumber(ut.trim(sys.exec("echo $(uci -p /var/state get mwan3." .. arg[1] .. ".track_ip) | wc -w")))
-       if trackingNumber > 0 then
-               local reliabilityNumber = tonumber(ut.trim(sys.exec("uci -p /var/state get mwan3." .. arg[1] .. ".reliability")))
-               if reliabilityNumber and reliabilityNumber > trackingNumber then
-                       errorReliability = 1
-               end
-       end
-       -- check if any interfaces are not properly configured in /etc/config/network or have no default route in main routing table
-       if ut.trim(sys.exec("uci -p /var/state get network." .. arg[1])) == "interface" then
-               local interfaceDevice = ut.trim(sys.exec("uci -p /var/state get network." .. arg[1] .. ".ifname"))
-               if interfaceDevice == "uci: Entry not found" or interfaceDevice == "" then
-                       errorNetConfig = 1
-                       errorRoute = 1
-               else
-                       local routeCheck = ut.trim(sys.exec("route -n | awk '{if ($8 == \"" .. interfaceDevice .. "\" && $1 == \"0.0.0.0\" && $3 == \"0.0.0.0\") print $1}'"))
-                       if routeCheck == "" then
-                               errorRoute = 1
-                       end
-               end
-       else
-               errorNetConfig = 1
-               errorRoute = 1
-       end
-end
-
-function interfaceWarnings() -- display warning messages at the top of the page
-       local warns, lineBreak = "", ""
-       if errorReliability == 1 then
-               warns = "<font color=\"ff0000\"><strong>WARNING: this interface has a higher reliability requirement than there are tracking IP addresses!</strong></font>"
-               lineBreak = "<br /><br />"
-       end
-       if errorRoute == 1 then
-               warns = warns .. lineBreak .. "<font color=\"ff0000\"><strong>WARNING: this interface has no default route in the main routing table!</strong></font>"
-               lineBreak = "<br /><br />"
-       end
-       if errorNetConfig == 1 then
-               warns = warns .. lineBreak .. "<font color=\"ff0000\"><strong>WARNING: this interface is configured incorrectly or not at all in /etc/config/network!</strong></font>"
-               lineBreak = "<br /><br />"
-       end
-       if errorNoMetric == 1 then
-               warns = warns .. lineBreak .. "<font color=\"ff0000\"><strong>WARNING: this interface has no metric configured in /etc/config/network!</strong></font>"
-       elseif errorDuplicateMetric == 1 then
-               warns = warns .. lineBreak .. "<font color=\"ff0000\"><strong>WARNING: this and other interfaces have duplicate metrics configured in /etc/config/network!</strong></font>"
-       end
-       return warns
-end
-
--- ------ interface configuration ------ --
-
-dsp = require "luci.dispatcher"
-sys = require "luci.sys"
-ut = require "luci.util"
-arg[1] = arg[1] or ""
-
-metricValue = ""
-metricList = ""
-errorDuplicateMetricList = ""
-errorNoMetric = 0
-errorDuplicateMetric = 0
-errorRoute = 0
-errorNetConfig = 0
-errorReliability = 0
-interfaceCheck()
-
-
-m5 = Map("mwan3", translate("MWAN Interface Configuration - " .. arg[1]),
-       translate(interfaceWarnings()))
-       m5.redirect = dsp.build_url("admin", "network", "mwan", "configuration", "interface")
-
-
-mwan_interface = m5:section(NamedSection, arg[1], "interface", "")
-       mwan_interface.addremove = false
-       mwan_interface.dynamic = false
-
-
-enabled = mwan_interface:option(ListValue, "enabled", translate("Enabled"))
-       enabled.default = "1"
-       enabled:value("1", translate("Yes"))
-       enabled:value("0", translate("No"))
-
-track_ip = mwan_interface:option(DynamicList, "track_ip", translate("Tracking IP"),
-       translate("This IP address will be pinged to dermine if the link is up or down. Leave blank to assume interface is always online"))
-       track_ip.datatype = "ipaddr"
-
-reliability = mwan_interface:option(Value, "reliability", translate("Tracking reliability"),
-       translate("Acceptable values: 1-100. This many Tracking IP addresses must respond for the link to be deemed up"))
-       reliability.datatype = "range(1, 100)"
-       reliability.default = "1"
-
-count = mwan_interface:option(ListValue, "count", translate("Ping count"))
-       count.default = "1"
-       count:value("1")
-       count:value("2")
-       count:value("3")
-       count:value("4")
-       count:value("5")
-
-timeout = mwan_interface:option(ListValue, "timeout", translate("Ping timeout"))
-       timeout.default = "2"
-       timeout:value("1", translate("1 second"))
-       timeout:value("2", translate("2 seconds"))
-       timeout:value("3", translate("3 seconds"))
-       timeout:value("4", translate("4 seconds"))
-       timeout:value("5", translate("5 seconds"))
-       timeout:value("6", translate("6 seconds"))
-       timeout:value("7", translate("7 seconds"))
-       timeout:value("8", translate("8 seconds"))
-       timeout:value("9", translate("9 seconds"))
-       timeout:value("10", translate("10 seconds"))
-
-interval = mwan_interface:option(ListValue, "interval", translate("Ping interval"))
-       interval.default = "5"
-       interval:value("1", translate("1 second"))
-       interval:value("3", translate("3 seconds"))
-       interval:value("5", translate("5 seconds"))
-       interval:value("10", translate("10 seconds"))
-       interval:value("20", translate("20 seconds"))
-       interval:value("30", translate("30 seconds"))
-       interval:value("60", translate("1 minute"))
-       interval:value("300", translate("5 minutes"))
-       interval:value("600", translate("10 minutes"))
-       interval:value("900", translate("15 minutes"))
-       interval:value("1800", translate("30 minutes"))
-       interval:value("3600", translate("1 hour"))
-
-down = mwan_interface:option(ListValue, "down", translate("Interface down"),
-       translate("Interface will be deemed down after this many failed ping tests"))
-       down.default = "3"
-       down:value("1")
-       down:value("2")
-       down:value("3")
-       down:value("4")
-       down:value("5")
-       down:value("6")
-       down:value("7")
-       down:value("8")
-       down:value("9")
-       down:value("10")
-
-up = mwan_interface:option(ListValue, "up", translate("Interface up"),
-       translate("Downed interface will be deemed up after this many successful ping tests"))
-       up.default = "3"
-       up:value("1")
-       up:value("2")
-       up:value("3")
-       up:value("4")
-       up:value("5")
-       up:value("6")
-       up:value("7")
-       up:value("8")
-       up:value("9")
-       up:value("10")
-
-metric = mwan_interface:option(DummyValue, "metric", translate("Metric"),
-       translate("This displays the metric assigned to this interface in /etc/config/network"))
-       metric.rawhtml = true
-       function metric.cfgvalue(self, s)
-               if errorNoMetric == 0 then
-                       return metricValue
-               else
-                       return "&#8212;"
-               end
-       end
-
-
-return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/member.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/member.lua
deleted file mode 100644 (file)
index 3bccbd9..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
--- ------ member configuration ------ --
-
-ds = require "luci.dispatcher"
-
-
-m5 = Map("mwan3", translate("MWAN Member Configuration"))
-       m5:append(Template("mwan/config_css"))
-
-
-mwan_member = m5:section(TypedSection, "member", translate("Members"),
-       translate("Members are profiles attaching a metric and weight to an MWAN interface<br />" ..
-       "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" ..
-       "Members may not share the same name as configured interfaces, policies or rules"))
-       mwan_member.addremove = true
-       mwan_member.dynamic = false
-       mwan_member.sectionhead = "Member"
-       mwan_member.sortable = true
-       mwan_member.template = "cbi/tblsection"
-       mwan_member.extedit = ds.build_url("admin", "network", "mwan", "configuration", "member", "%s")
-       function mwan_member.create(self, section)
-               TypedSection.create(self, section)
-               m5.uci:save("mwan3")
-               luci.http.redirect(ds.build_url("admin", "network", "mwan", "configuration", "member", section))
-       end
-
-
-interface = mwan_member:option(DummyValue, "interface", translate("Interface"))
-       interface.rawhtml = true
-       function interface.cfgvalue(self, s)
-               return self.map:get(s, "interface") or "&#8212;"
-       end
-
-metric = mwan_member:option(DummyValue, "metric", translate("Metric"))
-       metric.rawhtml = true
-       function metric.cfgvalue(self, s)
-               return self.map:get(s, "metric") or "1"
-       end
-
-weight = mwan_member:option(DummyValue, "weight", translate("Weight"))
-       weight.rawhtml = true
-       function weight.cfgvalue(self, s)
-               return self.map:get(s, "weight") or "1"
-       end
-
-
-return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/memberconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/memberconfig.lua
deleted file mode 100644 (file)
index 181d22e..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
--- ------ extra functions ------ --
-
-function cbi_add_interface(field)
-       uci.cursor():foreach("mwan3", "interface",
-               function (section)
-                       field:value(section[".name"])
-               end
-       )
-end
-
--- ------ member configuration ------ --
-
-dsp = require "luci.dispatcher"
-arg[1] = arg[1] or ""
-
-
-m5 = Map("mwan3", translate("MWAN Member Configuration - ") .. arg[1])
-       m5.redirect = dsp.build_url("admin", "network", "mwan", "configuration", "member")
-
-
-mwan_member = m5:section(NamedSection, arg[1], "member", "")
-       mwan_member.addremove = false
-       mwan_member.dynamic = false
-
-
-interface = mwan_member:option(Value, "interface", translate("Interface"))
-       cbi_add_interface(interface)
-
-metric = mwan_member:option(Value, "metric", translate("Metric"),
-       translate("Acceptable values: 1-1000. Defaults to 1 if not set"))
-       metric.datatype = "range(1, 1000)"
-
-weight = mwan_member:option(Value, "weight", translate("Weight"),
-       translate("Acceptable values: 1-1000. Defaults to 1 if not set"))
-       weight.datatype = "range(1, 1000)"
-
-
--- ------ currently configured interfaces ------ --
-
-mwan_interface = m5:section(TypedSection, "interface", translate("Currently Configured Interfaces"))
-       mwan_interface.addremove = false
-       mwan_interface.dynamic = false
-       mwan_interface.sortable = false
-       mwan_interface.template = "cbi/tblsection"
-
-
-return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/policy.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/policy.lua
deleted file mode 100644 (file)
index e141d69..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
--- ------ extra functions ------ --
-
-function policyCheck() -- check to see if any policy names exceed the maximum of 15 characters
-       uci.cursor():foreach("mwan3", "policy",
-               function (section)
-                       if string.len(section[".name"]) > 15 then
-                               nameTooLong = 1
-                               err_name_list = err_name_list .. section[".name"] .. " "
-                       end
-               end
-       )
-end
-
-function policyWarn() -- display status and warning messages at the top of the page
-       if nameTooLong == 1 then
-               return "<font color=\"ff0000\"><strong>WARNING: Some policies have names exceeding the maximum of 15 characters!</strong></font>"
-       else
-               return ""
-       end
-end
-
--- ------ policy configuration ------ --
-
-ds = require "luci.dispatcher"
-sys = require "luci.sys"
-
-nameTooLong = 0
-err_name_list = " "
-policyCheck()
-
-
-m5 = Map("mwan3", translate("MWAN Policy Configuration"),
-       translate(policyWarn()))
-       m5:append(Template("mwan/config_css"))
-
-
-mwan_policy = m5:section(TypedSection, "policy", translate("Policies"),
-       translate("Policies are profiles grouping one or more members controlling how MWAN distributes traffic<br />" ..
-       "Member interfaces with lower metrics are used first. Interfaces with the same metric load-balance<br />" ..
-       "Load-balanced member interfaces distribute more traffic out those with higher weights<br />" ..
-       "Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be 15 characters or less<br />" ..
-       "Policies may not share the same name as configured interfaces, members or rules"))
-       mwan_policy.addremove = true
-       mwan_policy.dynamic = false
-       mwan_policy.sectionhead = "Policy"
-       mwan_policy.sortable = true
-       mwan_policy.template = "cbi/tblsection"
-       mwan_policy.extedit = ds.build_url("admin", "network", "mwan", "configuration", "policy", "%s")
-       function mwan_policy.create(self, section)
-               TypedSection.create(self, section)
-               m5.uci:save("mwan3")
-               luci.http.redirect(ds.build_url("admin", "network", "mwan", "configuration", "policy", section))
-       end
-
-
-use_member = mwan_policy:option(DummyValue, "use_member", translate("Members assigned"))
-       use_member.rawhtml = true
-       function use_member.cfgvalue(self, s)
-               local memberConfig, memberList = self.map:get(s, "use_member"), ""
-               if memberConfig then
-                       for k,v in pairs(memberConfig) do
-                               memberList = memberList .. v .. "<br />"
-                       end
-                       return memberList
-               else
-                       return "&#8212;"
-               end
-               
-       end
-
-last_resort = mwan_policy:option(DummyValue, "last_resort", translate("Last resort"))
-       last_resort.rawhtml = true
-       function last_resort.cfgvalue(self, s)
-               local action = self.map:get(s, "last_resort")
-               if action == "blackhole" then
-                       return "blackhole (drop)"
-               elseif action == "default" then
-                       return "default (use main routing table)"
-               else
-                       return "unreachable (reject)"
-               end
-       end
-
-errors = mwan_policy:option(DummyValue, "errors", translate("Errors"))
-       errors.rawhtml = true
-       function errors.cfgvalue(self, s)
-               if not string.find(err_name_list, " " .. s .. " ") then
-                       return ""
-               else
-                       return "<span title=\"Name exceeds 15 characters\"><img src=\"/luci-static/resources/cbi/reset.gif\" alt=\"error\"></img></span>"
-               end
-       end
-
-
-return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/policyconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/policyconfig.lua
deleted file mode 100644 (file)
index f48a104..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
--- ------ extra functions ------ --
-
-function policyCheck() -- check to see if this policy's name exceed the maximum of 15 characters
-       policyNameLength = string.len(arg[1])
-       if policyNameLength > 15 then
-               nameTooLong = 1
-       end
-end
-
-function policyWarn() -- display status and warning messages at the top of the page
-       if nameTooLong == 1 then
-               return "<font color=\"ff0000\"><strong>WARNING: this policy's name is " .. policyNameLength .. " characters exceeding the maximum of 15!</strong></font>"
-       else
-               return ""
-       end
-end
-
-function cbiAddMember(field)
-       uci.cursor():foreach("mwan3", "member",
-               function (section)
-                       field:value(section[".name"])
-               end
-       )
-end
-
--- ------ policy configuration ------ --
-
-dsp = require "luci.dispatcher"
-arg[1] = arg[1] or ""
-
-nameTooLong = 0
-policyCheck()
-
-
-m5 = Map("mwan3", translate("MWAN Policy Configuration - " .. arg[1]),
-       translate(policyWarn()))
-       m5.redirect = dsp.build_url("admin", "network", "mwan", "configuration", "policy")
-
-
-mwan_policy = m5:section(NamedSection, arg[1], "policy", "")
-       mwan_policy.addremove = false
-       mwan_policy.dynamic = false
-
-
-use_member = mwan_policy:option(DynamicList, "use_member", translate("Member used"))
-       cbiAddMember(use_member)
-
-last_resort = mwan_policy:option(ListValue, "last_resort", translate("Last resort"),
-       translate("When all policy members are offline use this behavior for matched traffic"))
-       last_resort.default = "unreachable"
-       last_resort:value("unreachable", translate("unreachable (reject)"))
-       last_resort:value("blackhole", translate("blackhole (drop)"))
-       last_resort:value("default", translate("default (use main routing table)"))
-
-
--- ------ currently configured members ------ --
-
-mwan_member = m5:section(TypedSection, "member", translate("Currently Configured Members"))
-       mwan_member.addremove = false
-       mwan_member.dynamic = false
-       mwan_member.sortable = false
-       mwan_member.template = "cbi/tblsection"
-
-
-return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/rule.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/rule.lua
deleted file mode 100644 (file)
index a22e010..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
--- ------ extra functions ------ --
-
-function ruleCheck() -- determine if rules needs a proper protocol configured
-       uci.cursor():foreach("mwan3", "rule",
-               function (section)
-                       local sourcePort = ut.trim(sys.exec("uci -p /var/state get mwan3." .. section[".name"] .. ".src_port"))
-                       local destPort = ut.trim(sys.exec("uci -p /var/state get mwan3." .. section[".name"] .. ".dest_port"))
-                       if sourcePort ~= "" or destPort ~= "" then -- ports configured
-                               local protocol = ut.trim(sys.exec("uci -p /var/state get mwan3." .. section[".name"] .. ".proto"))
-                               if protocol == "" or protocol == "all" then -- no or improper protocol
-                                       error_protocol_list = error_protocol_list .. section[".name"] .. " "
-                               end
-                       end
-               end
-       )
-end
-
-function ruleWarn() -- display warning messages at the top of the page
-       if error_protocol_list ~= " " then
-               return "<font color=\"ff0000\"><strong>WARNING: some rules have a port configured with no or improper protocol specified! Please configure a specific protocol!</strong></font>"
-       else
-               return ""
-       end
-end
-
--- ------ rule configuration ------ --
-
-dsp = require "luci.dispatcher"
-sys = require "luci.sys"
-ut = require "luci.util"
-
-error_protocol_list = " "
-ruleCheck()
-
-
-m5 = Map("mwan3", translate("MWAN Rule Configuration"),
-       translate(ruleWarn()))
-       m5:append(Template("mwan/config_css"))
-
-
-mwan_rule = m5:section(TypedSection, "rule", translate("Traffic Rules"),
-       translate("Rules specify which traffic will use a particular MWAN policy based on IP address, port or protocol<br />" ..
-       "Rules are matched from top to bottom. Rules below a matching rule are ignored. Traffic not matching any rule is routed using the main routing table<br />" ..
-       "Traffic destined for known (other than default) networks is handled by the main routing table. Traffic matching a rule, but all WAN interfaces for that policy are down will be blackholed<br />" ..
-       "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" ..
-       "Rules may not share the same name as configured interfaces, members or policies"))
-       mwan_rule.addremove = true
-       mwan_rule.anonymous = false
-       mwan_rule.dynamic = false
-       mwan_rule.sectionhead = "Rule"
-       mwan_rule.sortable = true
-       mwan_rule.template = "cbi/tblsection"
-       mwan_rule.extedit = dsp.build_url("admin", "network", "mwan", "configuration", "rule", "%s")
-       function mwan_rule.create(self, section)
-               TypedSection.create(self, section)
-               m5.uci:save("mwan3")
-               luci.http.redirect(dsp.build_url("admin", "network", "mwan", "configuration", "rule", section))
-       end
-
-
-src_ip = mwan_rule:option(DummyValue, "src_ip", translate("Source address"))
-       src_ip.rawhtml = true
-       function src_ip.cfgvalue(self, s)
-               return self.map:get(s, "src_ip") or "&#8212;"
-       end
-
-src_port = mwan_rule:option(DummyValue, "src_port", translate("Source port"))
-       src_port.rawhtml = true
-       function src_port.cfgvalue(self, s)
-               return self.map:get(s, "src_port") or "&#8212;"
-       end
-
-dest_ip = mwan_rule:option(DummyValue, "dest_ip", translate("Destination address"))
-       dest_ip.rawhtml = true
-       function dest_ip.cfgvalue(self, s)
-               return self.map:get(s, "dest_ip") or "&#8212;"
-       end
-
-dest_port = mwan_rule:option(DummyValue, "dest_port", translate("Destination port"))
-       dest_port.rawhtml = true
-       function dest_port.cfgvalue(self, s)
-               return self.map:get(s, "dest_port") or "&#8212;"
-       end
-
-proto = mwan_rule:option(DummyValue, "proto", translate("Protocol"))
-       proto.rawhtml = true
-       function proto.cfgvalue(self, s)
-               return self.map:get(s, "proto") or "all"
-       end
-
-sticky = mwan_rule:option(DummyValue, "sticky", translate("Sticky"))
-       sticky.rawhtml = true
-       function sticky.cfgvalue(self, s)
-               if self.map:get(s, "sticky") == "1" then
-                       stickied = 1
-                       return "Yes"
-               else
-                       stickied = nil
-                       return "No"
-               end
-       end
-
-timeout = mwan_rule:option(DummyValue, "timeout", translate("Sticky timeout"))
-       timeout.rawhtml = true
-       function timeout.cfgvalue(self, s)
-               if stickied then
-                       local timeoutValue = self.map:get(s, "timeout")
-                       if timeoutValue then
-                               return timeoutValue .. "s"
-                       else
-                               return "600s"
-                       end
-               else
-                       return "&#8212;"
-               end
-       end
-
-ipset = mwan_rule:option(DummyValue, "ipset", translate("IPset"))
-       ipset.rawhtml = true
-       function ipset.cfgvalue(self, s)
-               return self.map:get(s, "ipset") or "&#8212;"
-       end
-
-use_policy = mwan_rule:option(DummyValue, "use_policy", translate("Policy assigned"))
-       use_policy.rawhtml = true
-       function use_policy.cfgvalue(self, s)
-               return self.map:get(s, "use_policy") or "&#8212;"
-       end
-
-errors = mwan_rule:option(DummyValue, "errors", translate("Errors"))
-       errors.rawhtml = true
-       function errors.cfgvalue(self, s)
-               if not string.find(error_protocol_list, " " .. s .. " ") then
-                       return ""
-               else
-                       return "<span title=\"No protocol specified\"><img src=\"/luci-static/resources/cbi/reset.gif\" alt=\"error\"></img></span>"
-               end
-       end
-
-
-return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/ruleconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/ruleconfig.lua
deleted file mode 100644 (file)
index f7fb341..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
--- ------ extra functions ------ --
-
-function ruleCheck() -- determine if rule needs a protocol specified
-       local sourcePort = ut.trim(sys.exec("uci -p /var/state get mwan3." .. arg[1] .. ".src_port"))
-       local destPort = ut.trim(sys.exec("uci -p /var/state get mwan3." .. arg[1] .. ".dest_port"))
-       if sourcePort ~= "" or destPort ~= "" then -- ports configured
-               local protocol = ut.trim(sys.exec("uci -p /var/state get mwan3." .. arg[1] .. ".proto"))
-               if protocol == "" or protocol == "all" then -- no or improper protocol
-                       error_protocol = 1
-               end
-       end
-end
-
-function ruleWarn() -- display warning message at the top of the page
-       if error_protocol == 1 then
-               return "<font color=\"ff0000\"><strong>WARNING: this rule is incorrectly configured with no or improper protocol specified! Please configure a specific protocol!</strong></font>"
-       else
-               return ""
-       end
-end
-
-function cbiAddPolicy(field)
-       uci.cursor():foreach("mwan3", "policy",
-               function (section)
-                       field:value(section[".name"])
-               end
-       )
-end
-
-function cbiAddProtocol(field)
-       local protocols = ut.trim(sys.exec("cat /etc/protocols | grep ' # ' | awk '{print $1}' | grep -vw -e 'ip' -e 'tcp' -e 'udp' -e 'icmp' -e 'esp' | grep -v 'ipv6' | sort | tr '\n' ' '"))
-       for p in string.gmatch(protocols, "%S+") do
-               field:value(p)
-       end
-end
-
--- ------ rule configuration ------ --
-
-dsp = require "luci.dispatcher"
-sys = require "luci.sys"
-ut = require "luci.util"
-arg[1] = arg[1] or ""
-
-error_protocol = 0
-ruleCheck()
-
-
-m5 = Map("mwan3", translate("MWAN Rule Configuration - ") .. arg[1],
-       translate(ruleWarn()))
-       m5.redirect = dsp.build_url("admin", "network", "mwan", "configuration", "rule")
-
-
-mwan_rule = m5:section(NamedSection, arg[1], "rule", "")
-       mwan_rule.addremove = false
-       mwan_rule.dynamic = false
-
-
-src_ip = mwan_rule:option(Value, "src_ip", translate("Source address"),
-       translate("Supports CIDR notation (eg \"192.168.100.0/24\") without quotes"))
-       src_ip.datatype = ipaddr
-
-src_port = mwan_rule:option(Value, "src_port", translate("Source port"),
-       translate("May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or as a portrange (eg \"1024:2048\") without quotes"))
-
-dest_ip = mwan_rule:option(Value, "dest_ip", translate("Destination address"),
-       translate("Supports CIDR notation (eg \"192.168.100.0/24\") without quotes"))
-       dest_ip.datatype = ipaddr
-
-dest_port = mwan_rule:option(Value, "dest_port", translate("Destination port"),
-       translate("May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or as a portrange (eg \"1024:2048\") without quotes"))
-
-proto = mwan_rule:option(Value, "proto", translate("Protocol"),
-       translate("View the contents of /etc/protocols for protocol descriptions"))
-       proto.default = "all"
-       proto.rmempty = false
-       proto:value("all")
-       proto:value("ip")
-       proto:value("tcp")
-       proto:value("udp")
-       proto:value("icmp")
-       proto:value("esp")
-       cbiAddProtocol(proto)
-
-sticky = mwan_rule:option(ListValue, "sticky", translate("Sticky"),
-       translate("Traffic from the same source IP address that previously matched this rule within the sticky timeout period will use the same WAN interface"))
-       sticky.default = "0"
-       sticky:value("1", translate("Yes"))
-       sticky:value("0", translate("No"))
-
-timeout = mwan_rule:option(Value, "timeout", translate("Sticky timeout"),
-       translate("Seconds. Acceptable values: 1-1000000. Defaults to 600 if not set"))
-       timeout.datatype = "range(1, 1000000)"
-
-ipset = mwan_rule:option(Value, "ipset", translate("IPset"),
-       translate("Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/youtube.com/youtube\")"))
-
-use_policy = mwan_rule:option(Value, "use_policy", translate("Policy assigned"))
-       cbiAddPolicy(use_policy)
-       use_policy:value("unreachable", translate("unreachable (reject)"))
-       use_policy:value("blackhole", translate("blackhole (drop)"))
-       use_policy:value("default", translate("default (use main routing table)"))
-
-
--- ------ currently configured policies ------ --
-
-mwan_policy = m5:section(TypedSection, "policy", translate("Currently Configured Policies"))
-       mwan_policy.addremove = false
-       mwan_policy.dynamic = false
-       mwan_policy.sortable = false
-       mwan_policy.template = "cbi/tblsection"
-
-
-return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/admin_status/index/mwan.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/admin_status/index/mwan.htm
deleted file mode 100644 (file)
index 53b997a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<%+mwan/openwrt_overview_status%>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_diagnostics.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_diagnostics.htm
deleted file mode 100644 (file)
index 14d404b..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-<%+header%>
-
-<ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
-       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
-</ul>
-
-<%
-       local uci = require "luci.model.uci"
-
-       interfaceNames = ""
-       uci.cursor():foreach("mwan3", "interface",
-               function (section)
-                       interfaceNames = interfaceNames .. section[".name"] .. " "
-               end
-       )
-%>
-
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
-<script type="text/javascript">//<![CDATA[
-       var stxhr = new XHR();
-
-       function update_status(tool, task)
-       {
-               var iface = document.getElementById('mwaniface').value;
-               var output = document.getElementById('diag_output');
-
-               if (tool == "service")
-                       {
-                               output.innerHTML =
-                                       '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="padding: 20px; vertical-align: middle;" /> ' +
-                                       "Waiting for MWAN to " + task + "..."
-                               ;
-                       }
-                       else
-                       {
-                               output.innerHTML =
-                                       '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="padding: 20px; vertical-align: middle;" /> ' +
-                                       "Waiting for diagnostic results..."
-                               ;
-                       }
-
-               output.parentNode.style.display = 'block';
-               output.style.display = 'inline';
-
-               stxhr.get('<%=luci.dispatcher.build_url("admin", "network", "mwan", "advanced")%>/diagnostics_display' + '/' + iface + '/' + tool + '/' + task, null,
-                       function(x, mArray)
-                       {
-                               if (mArray.diagnostics)
-                               {
-                                       output.innerHTML = String.format('<pre id="diag_output_css">%h</pre>', mArray.diagnostics[0]);
-                               }
-                               else
-                               {
-                                       output.innerHTML = '<pre id="diag_output_css"><strong>No diagnostic results returned</strong></pre>';
-                               }
-                       }
-               );
-       }
-//]]></script>
-
-<div id="mwan_diagnostics" class="cbi-map">
-       <fieldset id="diag_select" class="cbi-section">
-               <legend><%:MWAN Interface Diagnostics%></legend>
-               <select id="mwaniface">
-                       <% for z in interfaceNames:gmatch("[^ ]+") do -%><option value="<%=z%>"><%=z%></option><%- end %>
-               </select>
-               <div id="buttoncss">
-                       <input type="button" value="<%:Ping default gateway%>" class="cbi-button cbi-button-apply" onclick="update_status('ping', 'gateway')" />
-                       <input type="button" value="<%:Ping tracking IP%>" class="cbi-button cbi-button-apply" onclick="update_status('ping', 'track_ip')" />
-                       <input type="button" value="<%:Check IP rules%>" class="cbi-button cbi-button-apply" onclick="update_status('rulechk', null)" />
-                       <input type="button" value="<%:Check routing table%>" class="cbi-button cbi-button-apply" onclick="update_status('routechk', null)" />
-                       <input type="button" value="<%:Hotplug ifup%>" class="cbi-button cbi-button-apply" onclick="update_status('hotplug', 'ifup')" />
-                       <input type="button" value="<%:Hotplug ifdown%>" class="cbi-button cbi-button-apply" onclick="update_status('hotplug', 'ifdown')" />
-               </div>
-       </fieldset>
-       <fieldset id="diag_select" class="cbi-section">
-               <legend><%:MWAN Service Control%></legend>
-               <div id="buttoncss">
-                       <input type="button" value="<%:Restart MWAN%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'restart')" />
-                       <input type="button" value="<%:Stop MWAN%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'stop')" />
-                       <input type="button" value="<%:Start MWAN%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'start')" />
-               </div>
-       </fieldset>
-       <fieldset class="cbi-section" style="display:none">
-               <legend><%:Diagnostic Results%></legend>
-               <div id="diag_output"></div>
-       </fieldset>
-</div>
-
-<style type="text/css">
-  .container {  /* container for entire page. fixes bootstrap theme's ridiculously small page width */
-       max-width: none;
-       margin-left: 30px;
-       padding-right: 30px;
-       width: auto;
-  }
-  #mwan_diagnostics {
-       background-color: #FFFFFF;
-       border: 1px dotted #555555;
-       padding: 20px;
-  }
-  #diag_select {
-       padding: 12px 20px 20px 20px;
-  }
-  #mwaniface {
-       float: left;
-       margin: 8px 20px 0px 0px;
-  }
-  #buttoncss {
-       display: table;
-       float: left;
-       text-align: left;
-  }
-  .cbi-button {
-       margin: 8px 20px 0px 0px;
-       min-width: 153px;
-  }
-  #diag_output_css {
-       padding: 20px;
-       text-align: left;
-  }
-</style>
-
-<%+footer%>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_hotplugscript.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_hotplugscript.htm
deleted file mode 100644 (file)
index 4c2a0dc..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<ul class="cbi-tabmenu">
-       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
-</ul>
-
-<style type="text/css">
-  .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
-       max-width: none;
-       margin: 0px 0px 0px 30px;
-       padding-right: 30px;
-       width: auto;
-  }
-  .cbi-section-node {
-       margin-top: 20px;
-  }
-  .cbi-section {
-       border: 1px dotted #555555;
-       padding: 20px;
-  }
-</style>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_mwanconfig.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_mwanconfig.htm
deleted file mode 100644 (file)
index fba3fa6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
-       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
-</ul>
-
-<style type="text/css">
-  .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
-       max-width: none;
-       margin: 0px 0px 0px 30px;
-       padding-right: 30px;
-       width: auto;
-  }
-  .cbi-section-node {
-       margin-top: 20px;
-  }
-  .cbi-section {
-       border: 1px dotted #555555;
-       padding: 20px;
-  }
-</style>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_networkconfig.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_networkconfig.htm
deleted file mode 100644 (file)
index cf90112..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
-       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
-</ul>
-
-<style type="text/css">
-  .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
-       max-width: none;
-       margin: 0px 0px 0px 30px;
-       padding-right: 30px;
-       width: auto;
-  }
-  .cbi-section-node {
-       margin-top: 20px;
-  }
-  .cbi-section {
-       border: 1px dotted #555555;
-       padding: 20px;
-  }
-</style>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_troubleshooting.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_troubleshooting.htm
deleted file mode 100644 (file)
index 0a12496..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<%+header%>
-
-<ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
-       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
-</ul>
-
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
-<script type="text/javascript">//<![CDATA[
-       XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "network", "mwan", "advanced", "troubleshooting_display")%>', null,
-               function(x, mArray)
-               {
-                       var tshoot = document.getElementById('troubleshoot_text');
-                       if (mArray.versions)
-                       {
-                               var versions = '<span class="description">Software versions : </span><br /><br />';
-                               var mwanConfig = '<br /><br /><span class="description">Output of &#34;cat /etc/config/mwan3&#34; : </span><br /><br />';
-                               var netConfig = '<br /><br /><span class="description">Output of &#34;cat /etc/config/network&#34; : </span><br /><br />';
-                               var wifiConfig = '<br /><br /><span class="description">Output of &#34;cat /etc/config/wireless&#34; : </span><br /><br />';
-                               var ifconfig = '<br /><br /><span class="description">Output of &#34;ifconfig&#34; : </span><br /><br />';
-                               var ipRoute = '<br /><br /><span class="description">Output of &#34;route -n&#34; : </span><br /><br />';
-                               var ipRuleShow = '<br /><br /><span class="description">Output of &#34;ip rule show&#34; : </span><br /><br />';
-                               var routeListTable = '<br /><br /><span class="description">Output of &#34;ip route list table 1-250&#34; : </span><br /><br />';
-                               var firewallOut = '<br /><br /><span class="description">Firewall default output policy (must be ACCEPT) : </span><br /><br />';
-                               var iptables = '<br /><br /><span class="description">Output of &#34;iptables -L -t mangle -v -n&#34; : </span><br /><br />';
-                               tshoot.innerHTML = String.format(
-                                       '<pre>%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s</pre>',
-                                       versions, mArray.versions[0], mwanConfig, mArray.mwanconfig[0], netConfig, mArray.netconfig[0],
-                                       wifiConfig, mArray.wificonfig[0], ifconfig, mArray.ifconfig[0], ipRoute, mArray.routeshow[0],
-                                       ipRuleShow, mArray.iprule[0], routeListTable, mArray.routelist[0], firewallOut, mArray.firewallout[0],
-                                       iptables, mArray.iptables[0]
-                               );
-                       }
-                       else
-                       {
-                               tshoot.innerHTML = '<strong>Error collecting troubleshooting information</strong>';
-                       }
-               }
-       );
-//]]></script>
-
-<div id="troubleshoot">
-       <fieldset class="cbi-section">
-               <legend><%:Troubleshooting Data%></legend>
-               <div id="troubleshoot_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
-       </fieldset>
-</div>
-
-<style type="text/css">
-  .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
-       max-width: none;
-       margin-left: 30px;
-       padding-right: 30px;
-       width: auto;
-  }
-  #troubleshoot {
-       background-color: #FFFFFF;
-       border: 1px dotted #555555;
-       padding: 20px;
-  }
-  #troubleshoot_text {
-       padding: 20px;
-       text-align: left;
-  }
-  .description {
-       background-color: rgb(78, 186, 241);
-  }
-</style>
-
-<%+footer%>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_wirelessconfig.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_wirelessconfig.htm
deleted file mode 100644 (file)
index 5077674..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
-       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
-</ul>
-
-<style type="text/css">
-  .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
-       max-width: none;
-       margin: 0px 0px 0px 30px;
-       padding-right: 30px;
-       width: auto;
-  }
-  .cbi-section-node {
-       margin-top: 20px;
-  }
-  .cbi-section {
-       border: 1px dotted #555555;
-       padding: 20px;
-  }
-</style>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/config_css.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/config_css.htm
deleted file mode 100644 (file)
index 99da487..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<style type="text/css">
-  .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
-       max-width: none;
-       margin-left: 30px;
-       padding-right: 30px;
-       width: auto;
-  }
-  table td {   /* cells showing the configuration values */
-       padding: 0px;
-       text-align: center;
-       vertical-align: middle;
-  }
-  table th {   /* column for configuration section name */
-       padding: 0px;
-       text-align: center;
-       vertical-align: middle;
-  }
-  table tbody th {     /* column for configuration section name */
-       padding: 0px;
-       vertical-align: middle;
-  }
-  .cbi-section-node table div {        /* rows */
-       padding-top: 5px;
-  }
-  table.cbi-section-table td.cbi-section-table-cell {  /* sort buttons column */
-       text-align: center;
-  }
-  .cbi-section h3 {
-       color: rgb(85, 85, 85);
-       font-family: Trebuchet MS,Verdana,sans-serif;
-       font-style: italic;
-       font-weight: normal;
-  }
-</style>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/openwrt_overview_status.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/openwrt_overview_status.htm
deleted file mode 100644 (file)
index 9329b92..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "mwan", "overview", "interface_status")%>', null,
-               function(x, mArray)
-               {
-                       var status = document.getElementById('mwan_status_text');
-                       if (mArray.wans)
-                       {
-                               var temp = '';
-                               for ( var i = 0; i < mArray.wans.length; i++ )
-                               {
-                                       var stat = '';
-                                       var cssc = '';
-                                       switch (mArray.wans[i].status)
-                                       {
-                                               case 'online':
-                                                       stat = 'Online (tracking active)';
-                                                       cssc = 'wanon';
-                                                       break;
-                                               case 'notMonitored':
-                                                       stat = 'Online (tracking off)';
-                                                       cssc = 'wanon';
-                                                       break;
-                                               case 'offline':
-                                                       stat = 'Offline';
-                                                       cssc = 'wanoff';
-                                                       break;
-                                               case 'notEnabled':
-                                                       stat = 'Disabled';
-                                                       cssc = 'wanoff';
-                                                       break;
-                                       }
-                                       temp += String.format(
-                                               '<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
-                                               cssc, mArray.wans[i].name, mArray.wans[i].link, mArray.wans[i].ifname, stat
-                                       );
-                               }
-                               status.innerHTML = temp;
-                       }
-                       else
-                       {
-                               status.innerHTML = '<strong>No MWAN interfaces found</strong>';
-                       }
-               }
-       );
-//]]></script>
-
-<fieldset id="interface_field" class="cbi-section">
-       <legend><%:MWAN Interface Live Status%></legend>
-       <div id="mwan_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
-</fieldset>
-
-<style type="text/css">
-  .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
-       max-width: 1044px;
-  }
-  #interface_field {
-       padding: 12px 20px 20px 20px;
-  }
-  #mwan_status_text {
-       display: table;
-       font-size: 14px;
-       margin: auto;
-       max-width: 1044px;
-       min-width: 246px;
-       width: 100%;
-  }
-  .wanon {
-       background-color: rgb(144, 240, 144);
-  }
-  .wanoff {
-       background-color: rgb(240, 144, 144);
-  }
-  .wanon, .wanoff {
-       border-radius: 60px;
-       box-shadow: 0px 2px 5px -3px;
-       float: left;
-       margin: 8px 3px 0px 3px;
-       min-height: 30px;
-       min-width: 235px;
-       padding: 5px 10px 8px 10px;
-       text-align: center;
-  }
-</style>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/overview_detailed.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/overview_detailed.htm
deleted file mode 100644 (file)
index b80b9f3..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<%+header%>
-
-<ul class="cbi-tabmenu">
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/overview")%>"><%:Interface Status%></a></li>
-       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/overview/overview_detailed")%>"><%:Detailed Status%></a></li>
-</ul>
-
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
-<script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "mwan", "overview", "detailed_status")%>', null,
-               function(x, mArray)
-               {
-                       var status = document.getElementById('mwan_detail_text');
-                       if (mArray.mwandetail)
-                       {
-                               status.innerHTML = String.format('<pre>%s</pre>', mArray.mwandetail[0]);
-                       }
-                       else
-                       {
-                               status.innerHTML = '<strong>No detailed status information available</strong>';
-                       }
-               }
-       );
-//]]></script>
-
-<div id="mwan_detail_status">
-       <fieldset class="cbi-section">
-               <legend><%:MWAN Detailed Status%></legend>
-               <div id="mwan_detail_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
-       </fieldset>
-</div>
-
-<style type="text/css">
-  .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
-       max-width: none;
-       margin-left: 30px;
-       padding-right: 30px;
-       width: auto;
-  }
-  #mwan_detail_status {
-       border: 1px dotted #555555;
-       background-color: #FFFFFF;
-       padding: 20px;
-  }
-  #mwan_detail_text {
-       padding: 20px;
-       text-align: left;
-  }
-</style>
-
-<%+footer%>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/overview_interface.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/overview_interface.htm
deleted file mode 100644 (file)
index 472c7ce..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-<%+header%>
-
-<ul class="cbi-tabmenu">
-       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/overview")%>"><%:Interface Status%></a></li>
-       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/overview/overview_detailed")%>"><%:Detailed Status%></a></li>
-</ul>
-
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
-<script type="text/javascript">//<![CDATA[
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "mwan", "overview", "interface_status")%>', null,
-               function(x, mArray)
-               {
-                       var statusDiv = document.getElementById('mwan_status_text');
-                       if (mArray.wans)
-                       {
-                               var interfaceStatus = '';
-                               for ( var i = 0; i < mArray.wans.length; i++ )
-                               {
-                                       var status = '';
-                                       var css = '';
-                                       switch (mArray.wans[i].status)
-                                       {
-                                               case 'online':
-                                                       status = 'Online (tracking active)';
-                                                       css = 'wanon';
-                                                       break;
-                                               case 'notMonitored':
-                                                       status = 'Online (tracking off)';
-                                                       css = 'wanon';
-                                                       break;
-                                               case 'offline':
-                                                       status = 'Offline';
-                                                       css = 'wanoff';
-                                                       break;
-                                               case 'notEnabled':
-                                                       status = 'Disabled';
-                                                       css = 'wanoff';
-                                                       break;
-                                       }
-                                       interfaceStatus += String.format(
-                                               '<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
-                                               css, mArray.wans[i].name, mArray.wans[i].link, mArray.wans[i].ifname, status
-                                       );
-                               }
-                               statusDiv.innerHTML = interfaceStatus;
-                       }
-                       else
-                       {
-                               statusDiv.innerHTML = '<strong>No MWAN interfaces found</strong>';
-                       }
-
-                       var logs = document.getElementById('mwan_statuslog_text');
-                       if (mArray.mwanlog)
-                       {
-                               var mwanLog = 'Last 50 MWAN systemlog entries. Newest entries sorted at the top :';
-                               logs.innerHTML = String.format('<pre>%s<br /><br />%s</pre>', mwanLog, mArray.mwanlog[0]);
-                       }
-                       else
-                       {
-                               logs.innerHTML = '<strong>No MWAN systemlog history found</strong>';
-                       }
-               }
-       );
-//]]></script>
-
-<div id="mwan_interface_status">
-       <fieldset id="interface_field" class="cbi-section">
-               <legend><%:MWAN Interface Live Status%></legend>
-               <div id="mwan_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
-       </fieldset>
-       <fieldset class="cbi-section">
-               <legend><%:MWAN Interface Systemlog%></legend>
-               <div id="mwan_statuslog_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
-       </fieldset>
-</div>
-
-<style type="text/css">
-  .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
-       max-width: none;
-       margin-left: 30px;
-       padding-right: 30px;
-       width: auto;
-  }
-  #mwan_interface_status {
-       background-color: #FFFFFF;
-       border: 1px dotted #555555;
-       padding: 20px;
-  }
-  #interface_field {
-       padding: 12px 20px 20px 20px;
-  }
-  #mwan_status_text {
-       display: table;
-       font-size: 14px;
-       margin: auto;
-       max-width: 1044px;
-       min-width: 246px;
-       width: 100%;
-  }
-  .wanon {
-       background-color: rgb(144, 240, 144);
-  }
-  .wanoff {
-       background-color: rgb(240, 144, 144);
-  }
-  .wanon, .wanoff {
-       border-radius: 60px;
-       box-shadow: 0px 2px 5px -3px;
-       float: left;
-       margin: 8px 3px 0px 3px;
-       min-height: 30px;
-       min-width: 235px;
-       padding: 5px 10px 8px 10px;
-       text-align: center;
-  }
-  #mwan_statuslog_text {
-       padding: 20px;
-       text-align: left;
-  }
-</style>
-
-<%+footer%>
index 394a642f9a823fcc15429b4028901c4e4b93d6f0..b4b8a222cb11e439851644eb3efe175684546c4f 100644 (file)
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mwan3
-PKG_VERSION:=2.5.2
-PKG_RELEASE:=5
+PKG_VERSION:=2.6.11
+PKG_RELEASE:=2
 PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
 PKG_LICENSE:=GPLv2
 
@@ -19,7 +19,13 @@ define Package/mwan3
    SECTION:=net
    CATEGORY:=Network
    SUBMENU:=Routing and Redirection
-   DEPENDS:=+ip +ipset +iptables +iptables-mod-conntrack-extra +iptables-mod-ipopt
+   DEPENDS:= \
+     +ip \
+     +ipset \
+     +iptables \
+     +iptables-mod-conntrack-extra \
+     +iptables-mod-ipopt \
+     +jshn
    TITLE:=Multiwan hotplug script with connection tracking support
    MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
    PKGARCH:=all
@@ -39,6 +45,22 @@ endef
 define Build/Compile
 endef
 
+define Package/mwan3/postinst
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+       /etc/init.d/rpcd restart
+fi
+exit 0
+endef
+
+define Package/mwan3/postrm
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+       /etc/init.d/rpcd restart
+fi
+exit 0
+endef
+
 define Package/mwan3/install
 $(CP) ./files/* $(1)
 endef
diff --git a/net/mwan3/files/etc/hotplug.d/iface/14-mwan3 b/net/mwan3/files/etc/hotplug.d/iface/14-mwan3
new file mode 100644 (file)
index 0000000..4f8e0be
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/mwan3/mwan3.sh
+. /lib/functions/network.sh
+
+[ "$ACTION" = "ifup" -o "$ACTION" = "ifdown" ] || exit 1
+[ -n "$INTERFACE" ] || exit 2
+
+if [ "$ACTION" = "ifup" ]; then
+       [ -n "$DEVICE" ] || exit 3
+fi
+
+config_load mwan3
+config_get_bool enabled globals 'enabled' '0'
+[ ${enabled} -gt 0 ] || exit 0
+
+config_get local_source globals local_source 'none'
+[ "${local_source}" = "none" ] && {
+       exit 0
+}
+
+[ "${local_source}" = "$INTERFACE" ] || {
+       exit 0
+}
+
+mwan3_lock
+src_ip=$(uci_get_state mwan3 globals src_ip)
+[ "${src_ip}" != "" ] && {
+       ip route del default via "${src_ip}" dev lo 1>/dev/null 2>&1
+       ip addr del "${src_ip}/32" dev lo 1>/dev/null 2>&1
+}
+
+sleep 1
+
+[ "$ACTION" = "ifup" ] && {
+       network_get_ipaddr src_ip "${local_source}"
+       if [ "${src_ip}" = "" ]; then
+               $LOG warn "Unable to set source ip for own initiated traffic (${local_source})"
+       else
+               ip addr add "${src_ip}/32" dev lo
+               ip route add default via "${src_ip}" dev lo
+               uci_toggle_state mwan3 globals src_ip "${src_ip}"
+       fi
+}
+mwan3_unlock
+
+exit 0
index e3fd16cef0f27f492bb78f288e4ffdc9ef23f078..f94b400934bd3772e56ec23f12f68b143b23658a 100644 (file)
@@ -3,6 +3,7 @@
 . /lib/functions.sh
 . /lib/functions/network.sh
 . /lib/mwan3/mwan3.sh
+. /usr/share/libubox/jshn.sh
 
 [ "$ACTION" == "ifup" -o "$ACTION" == "ifdown" ] || exit 1
 [ -n "$INTERFACE" ] || exit 2
@@ -11,51 +12,76 @@ if [ "$ACTION" == "ifup" ]; then
         [ -n "$DEVICE" ] || exit 3
 fi
 
-mwan3_set_connected_iptables
-
 config_load mwan3
+config_get_bool enabled globals 'enabled' '0'
+[ ${enabled} -gt 0 ] || exit 0
+
 config_get enabled $INTERFACE enabled 0
+config_get initial_state $INTERFACE initial_state "online"
 [ "$enabled" == "1" ] || exit 0
 
+mwan3_lock
+mwan3_init
+mwan3_set_connected_iptables
+mwan3_unlock
+
 if [ "$ACTION" == "ifup" ]; then
        config_get family $INTERFACE family ipv4
        if [ "$family" = "ipv4" ]; then
                ubus call network.interface.${INTERFACE}_4 status &>/dev/null
                if [ "$?" -eq "0" ]; then
-                       network_get_gateway gateway ${INTERFACE}_4
+                       network_get_ipaddr src_ip ${INTERFACE}_4
                else
-                       network_get_gateway gateway $INTERFACE
+                       network_get_ipaddr src_ip ${INTERFACE}
                fi
+               [ -n "$src_ip" ] || src_ip="0.0.0.0"
        elif [ "$family" = "ipv6" ]; then
                ubus call network.interface.${INTERFACE}_6 status &>/dev/null
                if [ "$?" -eq "0" ]; then
-                       network_get_gateway6 gateway ${INTERFACE}_6
+                       network_get_ipaddr6 src_ip ${INTERFACE}_6
                else
-                       network_get_gateway6 gateway ${INTERFACE}
+                       network_get_ipaddr6 src_ip ${INTERFACE}
                fi
+               [ -n "$src_ip" ] || src_ip="::"
        fi
+fi
 
-       [ -n "$gateway" ] || exit 9
+if [ "$initial_state" = "offline" ]; then
+       json_load "$(ubus call mwan3 status '{"section":"interfaces"}')"
+       json_select "interfaces"
+       json_select "${INTERFACE}"
+       json_get_var running running
+       json_get_var status status
+else
+       status=online
+       running=1
 fi
 
-$LOG notice "$ACTION interface $INTERFACE (${DEVICE:-unknown})"
+mwan3_lock
+$LOG notice "Execute "$ACTION" event on interface $INTERFACE (${DEVICE:-unknown})"
 
 case "$ACTION" in
        ifup)
                mwan3_set_general_rules
                mwan3_set_general_iptables
-               mwan3_create_iface_rules $INTERFACE $DEVICE
                mwan3_create_iface_iptables $INTERFACE $DEVICE
+               mwan3_create_iface_rules $INTERFACE $DEVICE
                mwan3_create_iface_route $INTERFACE $DEVICE
-               mwan3_track $INTERFACE $DEVICE
-               mwan3_set_policies_iptables
-               mwan3_set_user_rules
-               mwan3_flush_conntrack $INTERFACE $DEVICE "ifup"
+               if [ ${running} -eq 1 -a "${status}" = "online" ]; then
+                       $LOG notice "Starting tracker on interface $INTERFACE (${DEVICE:-unknown})"
+                       mwan3_set_iface_hotplug_state $INTERFACE "online"
+                       mwan3_track $INTERFACE $DEVICE "online" "$src_ip"
+                       mwan3_set_policies_iptables
+                       mwan3_set_user_rules
+                       mwan3_flush_conntrack $INTERFACE $DEVICE "ifup"
+               else
+                       $LOG notice "Starting tracker on interface $INTERFACE (${DEVICE:-unknown})"
+                       mwan3_set_iface_hotplug_state $INTERFACE "offline"
+                       mwan3_track $INTERFACE $DEVICE "unknown" "$src_ip"
+               fi
        ;;
        ifdown)
-               mwan3_delete_iface_rules $INTERFACE
-               mwan3_delete_iface_iptables $INTERFACE
-               mwan3_delete_iface_route $INTERFACE
+               mwan3_set_iface_hotplug_state $INTERFACE "offline"
                mwan3_delete_iface_ipset_entries $INTERFACE
                mwan3_track_signal $INTERFACE $DEVICE
                mwan3_set_policies_iptables
@@ -64,4 +90,6 @@ case "$ACTION" in
        ;;
 esac
 
+mwan3_unlock
+
 exit 0
index 485f8de4e96f67aeefea72378912584848a22e69..9372c736e100607f9411eb327ff47e7ef7d3d14e 100644 (file)
@@ -4,6 +4,9 @@
        . /lib/functions.sh
 
        config_load mwan3
+       config_get_bool enabled globals 'enabled' '0'
+       [ ${enabled} -gt 0 ] || exit 0
+
        config_get enabled "$INTERFACE" enabled 0
        [ "${enabled}" = "1" ] || exit 0
        env -i ACTION="$ACTION" INTERFACE="$INTERFACE" DEVICE="$DEVICE" \
diff --git a/net/mwan3/files/etc/init.d/mwan3 b/net/mwan3/files/etc/init.d/mwan3
new file mode 100755 (executable)
index 0000000..dac1fb8
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh /etc/rc.common
+
+START=19
+
+reload() {
+       local enabled
+
+       config_load mwan3
+       config_get_bool enabled globals 'enabled' 0
+       [ ${enabled} -gt 0 ] || {
+               echo "Warning: mwan3 is global disabled. Usage: /etc/init.d/mwan3 start"
+               exit 0
+       }
+       mwan3 restart
+}
+
+boot() {
+       . /lib/config/uci.sh
+       uci_toggle_state mwan3 globals enabled "1"
+}
+
+start() {
+       . /lib/config/uci.sh
+       uci_toggle_state mwan3 globals enabled "1"
+       mwan3 start
+}
+
+stop() {
+       . /lib/config/uci.sh
+       uci_toggle_state mwan3 globals enabled "0"
+       mwan3 stop
+}
index 3c1f9fb7a871f406d40a30048e3447cccb436449..39989ab9bb640f17dbd5ab0286173778e0c74fbb 100644 (file)
@@ -7,6 +7,10 @@
 #
 # There are three main environment variables that are passed to this script.
 #
-# $ACTION      Either "ifup" or "ifdown"
+# $ACTION
+#      <ifup>         Is called by netifd and mwan3track
+#      <ifdown>       Is called by netifd and mwan3track
+#      <connected>    Is only called by mwan3track if tracking was successful
+#      <disconnected> Is only called by mwan3track if tracking has failed
 # $INTERFACE   Name of the interface which went up or down (e.g. "wan" or "wwan")
 # $DEVICE      Physical device name which interface went up or down (e.g. "eth0" or "wwan0")
diff --git a/net/mwan3/files/lib/mwan3/common.sh b/net/mwan3/files/lib/mwan3/common.sh
new file mode 100644 (file)
index 0000000..1af1299
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+get_uptime() {
+       local uptime=$(cat /proc/uptime)
+       echo "${uptime%%.*}"
+}
index 3798d7eb055c00e4d09a8497bdc8bcbe8618d68d..275723008d7bb2f3db1c7b3705673636c0ada3c2 100644 (file)
@@ -5,9 +5,105 @@ IP6="ip -6"
 IPS="ipset"
 IPT4="iptables -t mangle -w"
 IPT6="ip6tables -t mangle -w"
-LOG="logger -t mwan3 -p"
+LOG="logger -t mwan3[$$] -p"
 CONNTRACK_FILE="/proc/net/nf_conntrack"
 
+MWAN3_STATUS_DIR="/var/run/mwan3"
+MWAN3TRACK_STATUS_DIR="/var/run/mwan3track"
+MWAN3_INTERFACE_MAX=""
+DEFAULT_LOWEST_METRIC=256
+MMX_MASK=""
+MMX_DEFAULT=""
+MMX_BLACKHOLE=""
+MM_BLACKHOLE=""
+
+MMX_UNREACHABLE=""
+MM_UNREACHABLE=""
+
+
+# counts how many bits are set to 1
+# n&(n-1) clears the lowest bit set to 1
+mwan3_count_one_bits()
+{
+       local count n
+       count=0
+       n=$(($1))
+       while [ "$n" -gt "0" ]; do
+               n=$((n&(n-1)))
+               count=$((count+1))
+       done
+       echo $count
+}
+
+# maps the 1st parameter so it only uses the bits allowed by the bitmask (2nd parameter)
+# which means spreading the bits of the 1st parameter to only use the bits that are set to 1 in the 2nd parameter
+# 0 0 0 0 0 1 0 1 (0x05) 1st parameter
+# 1 0 1 0 1 0 1 0 (0xAA) 2nd parameter
+#     1   0   1          result
+mwan3_id2mask()
+{
+       local bit_msk bit_val result
+       bit_val=0
+       result=0
+       for bit_msk in $(seq 0 31); do
+               if [ $((($2>>bit_msk)&1)) = "1" ]; then
+                       if [ $((($1>>bit_val)&1)) = "1" ]; then
+                               result=$((result|(1<<bit_msk)))
+                       fi
+                       bit_val=$((bit_val+1))
+               fi
+       done
+       printf "0x%x" $result
+}
+
+mwan3_init()
+{
+       local bitcnt
+       local mmdefault
+
+       [ -d $MWAN3_STATUS_DIR ] || mkdir -p $MWAN3_STATUS_DIR/iface_state
+
+       # mwan3's MARKing mask (at least 3 bits should be set)
+       if [ -e "${MWAN3_STATUS_DIR}/mmx_mask" ]; then
+               MMX_MASK=$(cat "${MWAN3_STATUS_DIR}/mmx_mask")
+               MWAN3_INTERFACE_MAX=$(uci_get_state mwan3 globals iface_max)
+       else
+               config_load mwan3
+               config_get MMX_MASK globals mmx_mask '0xff00'
+               echo "$MMX_MASK" > "${MWAN3_STATUS_DIR}/mmx_mask"
+               $LOG notice "Using firewall mask ${MMX_MASK}"
+
+               bitcnt=$(mwan3_count_one_bits MMX_MASK)
+               mmdefault=$(((1<<bitcnt)-1))
+               MWAN3_INTERFACE_MAX=$(($mmdefault-3))
+               uci_toggle_state mwan3 globals iface_max "$MWAN3_INTERFACE_MAX"
+               $LOG notice "Max interface count is ${MWAN3_INTERFACE_MAX}"
+       fi
+
+       # mark mask constants
+       bitcnt=$(mwan3_count_one_bits MMX_MASK)
+       mmdefault=$(((1<<bitcnt)-1))
+       MM_BLACKHOLE=$(($mmdefault-2))
+       MM_UNREACHABLE=$(($mmdefault-1))
+
+       # MMX_DEFAULT should equal MMX_MASK
+       MMX_DEFAULT=$(mwan3_id2mask mmdefault MMX_MASK)
+       MMX_BLACKHOLE=$(mwan3_id2mask MM_BLACKHOLE MMX_MASK)
+       MMX_UNREACHABLE=$(mwan3_id2mask MM_UNREACHABLE MMX_MASK)
+}
+
+mwan3_lock() {
+       lock /var/run/mwan3.lock
+}
+
+mwan3_unlock() {
+       lock -u /var/run/mwan3.lock
+}
+
+mwan3_lock_clean() {
+       rm -rf /var/run/mwan3.lock
+}
+
 mwan3_get_iface_id()
 {
        local _tmp _iface _iface_count
@@ -64,12 +160,14 @@ mwan3_set_general_rules()
 
        for IP in "$IP4" "$IP6"; do
 
-               if [ -z "$($IP rule list | awk '$1 == "2253:"')" ]; then
-                       $IP rule add pref 2253 fwmark 0xfd00/0xff00 blackhole
+               RULE_NO=$(($MM_BLACKHOLE+2000))
+               if [ -z "$($IP rule list | awk -v var="$RULE_NO:" '$1 == var')" ]; then
+                       $IP rule add pref $RULE_NO fwmark $MMX_BLACKHOLE/$MMX_MASK blackhole
                fi
 
-               if [ -z "$($IP rule list | awk '$1 == "2254:"')" ]; then
-                       $IP rule add pref 2254 fwmark 0xfe00/0xff00 unreachable
+               RULE_NO=$(($MM_UNREACHABLE+2000))
+               if [ -z "$($IP rule list | awk -v var="$RULE_NO:" '$1 == var')" ]; then
+                       $IP rule add pref $RULE_NO fwmark $MMX_UNREACHABLE/$MMX_MASK unreachable
                fi
        done
 }
@@ -87,7 +185,7 @@ mwan3_set_general_iptables()
                if ! $IPT -S mwan3_connected &> /dev/null; then
                        $IPT -N mwan3_connected
                        $IPS -! create mwan3_connected list:set
-                       $IPT -A mwan3_connected -m set --match-set mwan3_connected dst -j MARK --set-xmark 0xff00/0xff00
+                       $IPT -A mwan3_connected -m set --match-set mwan3_connected dst -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
                fi
 
                if ! $IPT -S mwan3_ifaces_out &> /dev/null; then
@@ -100,13 +198,13 @@ mwan3_set_general_iptables()
 
                if ! $IPT -S mwan3_hook &> /dev/null; then
                        $IPT -N mwan3_hook
-                       $IPT -A mwan3_hook -j CONNMARK --restore-mark --nfmask 0xff00 --ctmask 0xff00
-                       $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_ifaces_in
-                       $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_connected
-                       $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_ifaces_out
-                       $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_rules
-                       $IPT -A mwan3_hook -j CONNMARK --save-mark --nfmask 0xff00 --ctmask 0xff00
-                       $IPT -A mwan3_hook -m mark ! --mark 0xff00/0xff00 -j mwan3_connected
+                       $IPT -A mwan3_hook -j CONNMARK --restore-mark --nfmask $MMX_MASK --ctmask $MMX_MASK
+                       $IPT -A mwan3_hook -m mark --mark 0x0/$MMX_MASK -j mwan3_ifaces_in
+                       $IPT -A mwan3_hook -m mark --mark 0x0/$MMX_MASK -j mwan3_connected
+                       $IPT -A mwan3_hook -m mark --mark 0x0/$MMX_MASK -j mwan3_ifaces_out
+                       $IPT -A mwan3_hook -m mark --mark 0x0/$MMX_MASK -j mwan3_rules
+                       $IPT -A mwan3_hook -j CONNMARK --save-mark --nfmask $MMX_MASK --ctmask $MMX_MASK
+                       $IPT -A mwan3_hook -m mark ! --mark $MMX_DEFAULT/$MMX_MASK -j mwan3_connected
                fi
 
                if ! $IPT -S PREROUTING | grep mwan3_hook &> /dev/null; then
@@ -121,7 +219,7 @@ mwan3_set_general_iptables()
 
 mwan3_create_iface_iptables()
 {
-       local id family src_ip src_ipv6
+       local id family
 
        config_get family $1 family ipv4
        mwan3_get_iface_id id $1
@@ -129,14 +227,6 @@ mwan3_create_iface_iptables()
        [ -n "$id" ] || return 0
 
        if [ "$family" == "ipv4" ]; then
-
-               ubus call network.interface.${1}_4 status &>/dev/null
-               if [ "$?" -eq "0" ]; then
-                       network_get_ipaddr src_ip ${1}_4
-               else
-                       network_get_ipaddr src_ip $1
-               fi
-
                $IPS -! create mwan3_connected list:set
 
                if ! $IPT4 -S mwan3_ifaces_in &> /dev/null; then
@@ -156,28 +246,20 @@ mwan3_create_iface_iptables()
                fi
 
                $IPT4 -F mwan3_iface_in_$1
-               $IPT4 -A mwan3_iface_in_$1 -i $2 -m set --match-set mwan3_connected src -m mark --mark 0x0/0xff00 -m comment --comment "default" -j MARK --set-xmark 0xff00/0xff00
-               $IPT4 -A mwan3_iface_in_$1 -i $2 -m mark --mark 0x0/0xff00 -m comment --comment "$1" -j MARK --set-xmark $(($id*256))/0xff00
+               $IPT4 -A mwan3_iface_in_$1 -i $2 -m set --match-set mwan3_connected src -m mark --mark 0x0/$MMX_MASK -m comment --comment "default" -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
+               $IPT4 -A mwan3_iface_in_$1 -i $2 -m mark --mark 0x0/$MMX_MASK -m comment --comment "$1" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
 
-               $IPT4 -D mwan3_ifaces_in -m mark --mark 0x0/0xff00 -j mwan3_iface_in_$1 &> /dev/null
-               $IPT4 -A mwan3_ifaces_in -m mark --mark 0x0/0xff00 -j mwan3_iface_in_$1
+               $IPT4 -D mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1 &> /dev/null
+               $IPT4 -A mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1
 
                $IPT4 -F mwan3_iface_out_$1
-               $IPT4 -A mwan3_iface_out_$1 -s $src_ip -m mark --mark 0x0/0xff00 -m comment --comment "$1" -j MARK --set-xmark $(($id*256))/0xff00
+               $IPT4 -A mwan3_iface_out_$1 -o $2 -m mark --mark 0x0/$MMX_MASK -m comment --comment "$1" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
 
-               $IPT4 -D mwan3_ifaces_out -m mark --mark 0x0/0xff00 -j mwan3_iface_out_$1 &> /dev/null
-               $IPT4 -A mwan3_ifaces_out -m mark --mark 0x0/0xff00 -j mwan3_iface_out_$1
+               $IPT4 -D mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1 &> /dev/null
+               $IPT4 -A mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1
        fi
 
        if [ "$family" == "ipv6" ]; then
-
-               ubus call network.interface.${1}_6 status &>/dev/null
-               if [ "$?" -eq "0" ]; then
-                       network_get_ipaddr6 src_ipv6 ${1}_6
-               else
-                       network_get_ipaddr6 src_ipv6 $1
-               fi
-
                $IPS -! create mwan3_connected_v6 hash:net family inet6
 
                if ! $IPT6 -S mwan3_ifaces_in &> /dev/null; then
@@ -197,17 +279,17 @@ mwan3_create_iface_iptables()
                fi
 
                $IPT6 -F mwan3_iface_in_$1
-               $IPT6 -A mwan3_iface_in_$1 -i $2 -m set --match-set mwan3_connected_v6 src -m mark --mark 0x0/0xff00 -m comment --comment "default" -j MARK --set-xmark 0xff00/0xff00
-               $IPT6 -A mwan3_iface_in_$1 -i $2 -m mark --mark 0x0/0xff00 -m comment --comment "$1" -j MARK --set-xmark $(($id*256))/0xff00
+               $IPT6 -A mwan3_iface_in_$1 -i $2 -m set --match-set mwan3_connected_v6 src -m mark --mark 0x0/$MMX_MASK -m comment --comment "default" -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
+               $IPT6 -A mwan3_iface_in_$1 -i $2 -m mark --mark 0x0/$MMX_MASK -m comment --comment "$1" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
 
-               $IPT6 -D mwan3_ifaces_in -m mark --mark 0x0/0xff00 -j mwan3_iface_in_$1 &> /dev/null
-               $IPT6 -A mwan3_ifaces_in -m mark --mark 0x0/0xff00 -j mwan3_iface_in_$1
+               $IPT6 -D mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1 &> /dev/null
+               $IPT6 -A mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1
 
                $IPT6 -F mwan3_iface_out_$1
-               $IPT6 -A mwan3_iface_out_$1 -s $src_ipv6 -m mark --mark 0x0/0xff00 -m comment --comment "$1" -j MARK --set-xmark $(($id*256))/0xff00
+               $IPT6 -A mwan3_iface_out_$1 -o $2 -m mark --mark 0x0/$MMX_MASK -m comment --comment "$1" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
 
-               $IPT6 -D mwan3_ifaces_out -m mark --mark 0x0/0xff00 -j mwan3_iface_out_$1 &> /dev/null
-               $IPT6 -A mwan3_ifaces_out -m mark --mark 0x0/0xff00 -j mwan3_iface_out_$1
+               $IPT6 -D mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1 &> /dev/null
+               $IPT6 -A mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1
        fi
 }
 
@@ -217,22 +299,22 @@ mwan3_delete_iface_iptables()
 
        if [ "$family" == "ipv4" ]; then
 
-               $IPT4 -D mwan3_ifaces_in -m mark --mark 0x0/0xff00 -j mwan3_iface_in_$1 &> /dev/null
+               $IPT4 -D mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1 &> /dev/null
                $IPT4 -F mwan3_iface_in_$1 &> /dev/null
                $IPT4 -X mwan3_iface_in_$1 &> /dev/null
 
-               $IPT4 -D mwan3_ifaces_out -m mark --mark 0x0/0xff00 -j mwan3_iface_out_$1 &> /dev/null
+               $IPT4 -D mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1 &> /dev/null
                $IPT4 -F mwan3_iface_out_$1 &> /dev/null
                $IPT4 -X mwan3_iface_out_$1 &> /dev/null
        fi
 
        if [ "$family" == "ipv6" ]; then
 
-               $IPT6 -D mwan3_ifaces_in -m mark --mark 0x0/0xff00 -j mwan3_iface_in_$1 &> /dev/null
+               $IPT6 -D mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1 &> /dev/null
                $IPT6 -F mwan3_iface_in_$1 &> /dev/null
                $IPT6 -X mwan3_iface_in_$1 &> /dev/null
 
-               $IPT6 -D mwan3_ifaces_out -m mark --mark 0x0/0xff00 -j mwan3_iface_out_$1 &> /dev/null
+               $IPT6 -D mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1 &> /dev/null
                $IPT6 -F mwan3_iface_out_$1 &> /dev/null
                $IPT6 -X mwan3_iface_out_$1 &> /dev/null
        fi
@@ -248,32 +330,37 @@ mwan3_create_iface_route()
        [ -n "$id" ] || return 0
 
        if [ "$family" == "ipv4" ]; then
-               ubus call network.interface.${1}_4 status &>/dev/null
-               if [ "$?" -eq "0" ]; then
+               if ubus call network.interface.${1}_4 status &>/dev/null; then
                        network_get_gateway route_args ${1}_4
                else
                        network_get_gateway route_args $1
                fi
 
-               route_args="via $route_args dev $2"
+               if [ -n "$route_args" -a "$route_args" != "0.0.0.0" ]; then
+                       route_args="via $route_args"
+               else
+                       route_args=""
+               fi
 
                $IP4 route flush table $id
-               $IP4 route add table $id default $route_args
+               $IP4 route add table $id default $route_args dev $2
        fi
 
        if [ "$family" == "ipv6" ]; then
-
-               ubus call network.interface.${1}_6 status &>/dev/null
-               if [ "$?" -eq "0" ]; then
+               if ubus call network.interface.${1}_6 status &>/dev/null; then
                        network_get_gateway6 route_args ${1}_6
                else
                        network_get_gateway6 route_args $1
                fi
 
-               route_args="via $route_args dev $2"
+               if [ -n "$route_args" -a "$route_args" != "::" ]; then
+                       route_args="via $route_args"
+               else
+                       route_args=""
+               fi
 
                $IP6 route flush table $id
-               $IP6 route add table $id default $route_args
+               $IP6 route add table $id default $route_args dev $2
        fi
 }
 
@@ -315,7 +402,7 @@ mwan3_create_iface_rules()
                done
 
                $IP4 rule add pref $(($id+1000)) iif $2 lookup main
-               $IP4 rule add pref $(($id+2000)) fwmark $(($id*256))/0xff00 lookup $id
+               $IP4 rule add pref $(($id+2000)) fwmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK lookup $id
        fi
 
        if [ "$family" == "ipv6" ]; then
@@ -329,7 +416,7 @@ mwan3_create_iface_rules()
                done
 
                $IP6 rule add pref $(($id+1000)) iif $2 lookup main
-               $IP6 rule add pref $(($id+2000)) fwmark $(($id*256))/0xff00 lookup $id
+               $IP6 rule add pref $(($id+2000)) fwmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK lookup $id
        fi
 }
 
@@ -374,7 +461,7 @@ mwan3_delete_iface_ipset_entries()
        [ -n "$id" ] || return 0
 
        for setname in $(ipset -n list | grep ^mwan3_sticky_); do
-               for entry in $(ipset list $setname | grep "$(echo $(($id*256)) | awk '{ printf "0x%08x", $1; }')" | cut -d ' ' -f 1); do
+               for entry in $(ipset list $setname | grep "$(echo $(mwan3_id2mask id MMX_MASK) | awk '{ printf "0x%08x", $1; }')" | cut -d ' ' -f 1); do
                        $IPS del $setname $entry
                done
        done
@@ -382,17 +469,21 @@ mwan3_delete_iface_ipset_entries()
 
 mwan3_track()
 {
-       local track_ip track_ips
+       local track_ip track_ips pid
 
        mwan3_list_track_ips()
        {
-               track_ips="$1 $track_ips"
+               track_ips="$track_ips $1"
        }
        config_list_foreach $1 track_ip mwan3_list_track_ips
 
-       kill $(pgrep -f "mwan3track $1") &> /dev/null
+       for pid in $(pgrep -f "mwan3track $1 $2"); do
+               kill -TERM "$pid" > /dev/null 2>&1
+               sleep 1
+               kill -KILL "$pid" > /dev/null 2>&1
+       done
        if [ -n "$track_ips" ]; then
-               [ -x /usr/sbin/mwan3track ] && /usr/sbin/mwan3track $1 $2 $track_ips &
+               [ -x /usr/sbin/mwan3track ] && /usr/sbin/mwan3track "$1" "$2" "$3" "$4" $track_ips &
        fi
 }
 
@@ -400,7 +491,7 @@ mwan3_track_signal()
 {
        local pid
 
-       pid="$(pgrep -f "mwan3track $1")"
+       pid="$(pgrep -f "mwan3track $1 $2")"
        if [ "${pid}" != "" ]; then
                kill -USR1 "${pid}"
        else
@@ -417,6 +508,7 @@ mwan3_set_policy()
        config_get weight $1 weight 1
 
        [ -n "$iface" ] || return 0
+       [ "$metric" -gt $DEFAULT_LOWEST_METRIC ] && $LOG warn "Member interface $iface has >$DEFAULT_LOWEST_METRIC metric. Not appending to policy" && return 0
 
        mwan3_get_iface_id id $iface
 
@@ -426,12 +518,12 @@ mwan3_set_policy()
 
        if [ "$family" == "ipv4" ]; then
 
-               if [ -n "$($IP4 route list table $id)" ]; then
+               if [ "$(mwan3_get_iface_hotplug_state $iface)" = "online" ]; then
                        if [ "$metric" -lt "$lowest_metric_v4" ]; then
 
                                total_weight_v4=$weight
                                $IPT4 -F mwan3_policy_$policy
-                               $IPT4 -A mwan3_policy_$policy -m mark --mark 0x0/0xff00 -m comment --comment "$iface $weight $weight" -j MARK --set-xmark $(($id*256))/0xff00
+                               $IPT4 -A mwan3_policy_$policy -m mark --mark 0x0/$MMX_MASK -m comment --comment "$iface $weight $weight" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
 
                                lowest_metric_v4=$metric
 
@@ -452,19 +544,19 @@ mwan3_set_policy()
 
                                probability="-m statistic --mode random --probability $probability"
 
-                               $IPT4 -I mwan3_policy_$policy -m mark --mark 0x0/0xff00 $probability -m comment --comment "$iface $weight $total_weight_v4" -j MARK --set-xmark $(($id*256))/0xff00
+                               $IPT4 -I mwan3_policy_$policy -m mark --mark 0x0/$MMX_MASK $probability -m comment --comment "$iface $weight $total_weight_v4" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
                        fi
                fi
        fi
 
        if [ "$family" == "ipv6" ]; then
 
-               if [ -n "$($IP6 route list table $id)" ]; then
+               if [ "$(mwan3_get_iface_hotplug_state $iface)" = "online" ]; then
                        if [ "$metric" -lt "$lowest_metric_v6" ]; then
 
                                total_weight_v6=$weight
                                $IPT6 -F mwan3_policy_$policy
-                               $IPT6 -A mwan3_policy_$policy -m mark --mark 0x0/0xff00 -m comment --comment "$iface $weight $weight" -j MARK --set-xmark $(($id*256))/0xff00
+                               $IPT6 -A mwan3_policy_$policy -m mark --mark 0x0/$MMX_MASK -m comment --comment "$iface $weight $weight" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
 
                                lowest_metric_v6=$metric
 
@@ -485,7 +577,7 @@ mwan3_set_policy()
 
                                probability="-m statistic --mode random --probability $probability"
 
-                               $IPT6 -I mwan3_policy_$policy -m mark --mark 0x0/0xff00 $probability -m comment --comment "$iface $weight $total_weight_v6" -j MARK --set-xmark $(($id*256))/0xff00
+                               $IPT6 -I mwan3_policy_$policy -m mark --mark 0x0/$MMX_MASK $probability -m comment --comment "$iface $weight $total_weight_v6" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
                        fi
                fi
        fi
@@ -513,21 +605,21 @@ mwan3_create_policies_iptables()
 
                case "$last_resort" in
                        blackhole)
-                               $IPT -A mwan3_policy_$1 -m mark --mark 0x0/0xff00 -m comment --comment "blackhole" -j MARK --set-xmark 0xfd00/0xff00
+                               $IPT -A mwan3_policy_$1 -m mark --mark 0x0/$MMX_MASK -m comment --comment "blackhole" -j MARK --set-xmark $MMX_BLACKHOLE/$MMX_MASK
                        ;;
                        default)
-                               $IPT -A mwan3_policy_$1 -m mark --mark 0x0/0xff00 -m comment --comment "default" -j MARK --set-xmark 0xff00/0xff00
+                               $IPT -A mwan3_policy_$1 -m mark --mark 0x0/$MMX_MASK -m comment --comment "default" -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
                        ;;
                        *)
-                               $IPT -A mwan3_policy_$1 -m mark --mark 0x0/0xff00 -m comment --comment "unreachable" -j MARK --set-xmark 0xfe00/0xff00
+                               $IPT -A mwan3_policy_$1 -m mark --mark 0x0/$MMX_MASK -m comment --comment "unreachable" -j MARK --set-xmark $MMX_UNREACHABLE/$MMX_MASK
                        ;;
                esac
        done
 
-       lowest_metric_v4=256
+       lowest_metric_v4=$DEFAULT_LOWEST_METRIC
        total_weight_v4=0
 
-       lowest_metric_v6=256
+       lowest_metric_v6=$DEFAULT_LOWEST_METRIC
        total_weight_v6=0
 
        config_list_foreach $1 use_member mwan3_set_policy
@@ -552,8 +644,8 @@ mwan3_set_sticky_iptables()
 
                        for IPT in "$IPT4" "$IPT6"; do
                                if [ -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" -a -n "$($IPT -S mwan3_iface_out_$1 2> /dev/null)" ]; then
-                                       $IPT -I mwan3_rule_$rule -m mark --mark $(($id*256))/0xff00 -m set ! --match-set mwan3_sticky_$rule src,src -j MARK --set-xmark 0x0/0xff00
-                                       $IPT -I mwan3_rule_$rule -m mark --mark 0/0xff00 -j MARK --set-xmark $(($id*256))/0xff00
+                                       $IPT -I mwan3_rule_$rule -m mark --mark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK -m set ! --match-set mwan3_sticky_$rule src,src -j MARK --set-xmark 0x0/$MMX_MASK
+                                       $IPT -I mwan3_rule_$rule -m mark --mark 0/$MMX_MASK -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
                                fi
                        done
                fi
@@ -587,11 +679,11 @@ mwan3_set_user_iptables_rule()
 
        if [ -n "$use_policy" ]; then
                if [ "$use_policy" == "default" ]; then
-                       policy="MARK --set-xmark 0xff00/0xff00"
+                       policy="MARK --set-xmark $MMX_DEFAULT/$MMX_MASK"
                elif [ "$use_policy" == "unreachable" ]; then
-                       policy="MARK --set-xmark 0xfe00/0xff00"
+                       policy="MARK --set-xmark $MMX_UNREACHABLE/$MMX_MASK"
                elif [ "$use_policy" == "blackhole" ]; then
-                       policy="MARK --set-xmark 0xfd00/0xff00"
+                       policy="MARK --set-xmark $MMX_BLACKHOLE/$MMX_MASK"
                else
                        if [ "$sticky" -eq 1 ]; then
 
@@ -609,8 +701,8 @@ mwan3_set_user_iptables_rule()
                                        $IPT -F mwan3_rule_$1
                                done
 
-                               $IPS -! create mwan3_sticky_v4_$rule hash:ip,mark markmask 0xff00 timeout $timeout
-                               $IPS -! create mwan3_sticky_v6_$rule hash:ip,mark markmask 0xff00 timeout $timeout family inet6
+                               $IPS -! create mwan3_sticky_v4_$rule hash:ip,mark markmask $MMX_MASK timeout $timeout
+                               $IPS -! create mwan3_sticky_v6_$rule hash:ip,mark markmask $MMX_MASK timeout $timeout family inet6
                                $IPS -! create mwan3_sticky_$rule list:set
                                $IPS -! add mwan3_sticky_$rule mwan3_sticky_v4_$rule
                                $IPS -! add mwan3_sticky_$rule mwan3_sticky_v6_$rule
@@ -618,7 +710,7 @@ mwan3_set_user_iptables_rule()
                                config_foreach mwan3_set_sticky_iptables interface
 
                                for IPT in "$IPT4" "$IPT6"; do
-                                       $IPT -A mwan3_rule_$1 -m mark --mark 0/0xff00 -j $policy
+                                       $IPT -A mwan3_rule_$1 -m mark --mark 0/$MMX_MASK -j $policy
                                        $IPT -A mwan3_rule_$1 -m mark ! --mark 0xfc00/0xfc00 -j SET --del-set mwan3_sticky_$rule src,src
                                        $IPT -A mwan3_rule_$1 -m mark ! --mark 0xfc00/0xfc00 -j SET --add-set mwan3_sticky_$rule src,src
                                done
@@ -641,10 +733,10 @@ mwan3_set_user_iptables_rule()
                        for IPT in "$IPT4" "$IPT6"; do
                                case $proto in
                                        tcp|udp)
-                                       $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/0xff00 -m comment --comment "$1" -j $policy &> /dev/null
+                                       $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/$MMX_MASK -m comment --comment "$1" -j $policy &> /dev/null
                                        ;;
                                        *)
-                                       $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m mark --mark 0/0xff00 -m comment --comment "$1" -j $policy &> /dev/null
+                                       $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m mark --mark 0/$MMX_MASK -m comment --comment "$1" -j $policy &> /dev/null
                                        ;;
                                esac
                        done
@@ -653,10 +745,10 @@ mwan3_set_user_iptables_rule()
 
                        case $proto in
                                tcp|udp)
-                               $IPT4 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/0xff00 -m comment --comment "$1" -j $policy &> /dev/null
+                               $IPT4 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/$MMX_MASK -m comment --comment "$1" -j $policy &> /dev/null
                                ;;
                                *)
-                               $IPT4 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m mark --mark 0/0xff00 -m comment --comment "$1" -j $policy &> /dev/null
+                               $IPT4 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m mark --mark 0/$MMX_MASK -m comment --comment "$1" -j $policy &> /dev/null
                                ;;
                        esac
 
@@ -664,10 +756,10 @@ mwan3_set_user_iptables_rule()
 
                        case $proto in
                                tcp|udp)
-                               $IPT6 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/0xff00 -m comment --comment "$1" -j $policy &> /dev/null
+                               $IPT6 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/$MMX_MASK -m comment --comment "$1" -j $policy &> /dev/null
                                ;;
                                *)
-                               $IPT6 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m mark --mark 0/0xff00 -m comment --comment "$1" -j $policy &> /dev/null
+                               $IPT6 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m mark --mark 0/$MMX_MASK -m comment --comment "$1" -j $policy &> /dev/null
                                ;;
                        esac
                fi
@@ -690,6 +782,19 @@ mwan3_set_user_rules()
        config_foreach mwan3_set_user_iptables_rule rule
 }
 
+mwan3_set_iface_hotplug_state() {
+       local iface=$1
+       local state=$2
+
+       echo -n $state > $MWAN3_STATUS_DIR/iface_state/$iface
+}
+
+mwan3_get_iface_hotplug_state() {
+       local iface=$1
+
+       cat $MWAN3_STATUS_DIR/iface_state/$iface 2>/dev/null || echo "unknown"
+}
+
 mwan3_report_iface_status()
 {
        local device result track_ips tracking IP IPT
@@ -711,16 +816,14 @@ mwan3_report_iface_status()
 
        if [ -z "$id" -o -z "$device" ]; then
                result="unknown"
-       elif [ -n "$($IP rule | awk '$1 == "'$(($id+1000)):'"')"i -a -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" -a -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" -a -n "$($IPT -S mwan3_iface_out_$1 2> /dev/null)" -a -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
-               result="online"
+       elif [ -n "$($IP rule | awk '$1 == "'$(($id+1000)):'"')" -a -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" -a -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" -a -n "$($IPT -S mwan3_iface_out_$1 2> /dev/null)" -a -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
+               result="$(mwan3_get_iface_hotplug_state $1)"
        elif [ -n "$($IP rule | awk '$1 == "'$(($id+1000)):'"')" -o -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" -o -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" -o -n "$($IPT -S mwan3_iface_out_$1 2> /dev/null)" -o -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
                result="error"
+       elif [ "$enabled" == "1" ]; then
+               result="offline"
        else
-               if [ "$enabled" == "1" ]; then
-                       result="offline"
-               else
-                       result="disabled"
-               fi
+               result="disabled"
        fi
 
        mwan3_list_track_ips()
@@ -730,7 +833,7 @@ mwan3_report_iface_status()
        config_list_foreach $1 track_ip mwan3_list_track_ips
 
        if [ -n "$track_ips" ]; then
-               if [ -n "$(ps -w | grep mwan3track | grep -v grep | sed '/.*\/usr\/sbin\/mwan3track \([^ ]*\) .*$/!d;s//\1/' | awk '$1 == "'$1'"')" ]; then
+               if [ -n "$(pgrep -f "mwan3track $1 $device")" ]; then
                        tracking="active"
                else
                        tracking="down"
@@ -860,3 +963,13 @@ mwan3_flush_conntrack()
                $LOG warning "connection tracking not enabled"
        fi
 }
+
+mwan3_track_clean()
+{
+       rm -rf "$MWAN3_STATUS_DIR/${1}" &> /dev/null
+       [ -d "$MWAN3_STATUS_DIR" ] && {
+               if [ -z "$(ls -A "$MWAN3_STATUS_DIR")" ]; then
+                       rm -rf "$MWAN3_STATUS_DIR"
+               fi
+       }
+}
index bbc570f6c2b3c3b185e3f27e4d7ff4abdb85a85e..a772e133e8cb27421f913f848a90415cedca3a34 100755 (executable)
@@ -1,10 +1,11 @@
 #!/bin/sh
 
 . /lib/functions.sh
+. /lib/functions/network.sh
 . /usr/share/libubox/jshn.sh
+. /lib/mwan3/common.sh
 
-MWAN3_STATUS_DIR="/var/run/mwan3track"
-MWAN3_PID_FILE="/var/run/mwan3track"
+MWAN3TRACK_STATUS_DIR="/var/run/mwan3track"
 
 IPS="ipset"
 IPT4="iptables -t mangle -w"
@@ -34,22 +35,32 @@ get_mwan3_status() {
        local iface="${1}"
        local iface_select="${2}"
        local running="0"
-       local pid
+       local age=0
+       local pid device time_p time_n
+
+       network_get_device device $1
 
        if [ "${iface}" = "${iface_select}" ] || [ "${iface_select}" = "" ]; then
-               pid="$(pgrep -f "mwan3track $iface_selected")"
+               pid="$(pgrep -f "mwan3track $iface $device")"
                if [ "${pid}" != "" ]; then
                        running="1"
                fi
 
+               time_p="$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/TIME")"
+               [ -z "${time_p}" ] || {
+                       time_n="$(get_uptime)"
+                       let age=time_n-time_p
+               }
+
                json_add_object "${iface}"
-               json_add_string "score" "$(cat "$MWAN3_STATUS_DIR/${iface}/SCORE")"
-               json_add_string "lost" "$(cat "$MWAN3_STATUS_DIR/${iface}/LOST")"
-               json_add_string "turn" "$(cat "$MWAN3_STATUS_DIR/${iface}/TURN")"
-               json_add_string "status" "$(cat "$MWAN3_STATUS_DIR/${iface}/STATUS")"
+               json_add_int age "$age"
+               json_add_int "score" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/SCORE")"
+               json_add_int "lost" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/LOST")"
+               json_add_int "turn" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/TURN")"
+               json_add_string "status" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/STATUS")"
                json_add_boolean "running" "${running}"
                json_add_array "track_ip"
-               for file in $MWAN3_STATUS_DIR/${iface}/*; do
+               for file in $MWAN3TRACK_STATUS_DIR/${iface}/*; do
                        track="${file#*/TRACK_}"
                        if [ "${track}" != "${file}" ]; then
                                json_add_object
index f23d2e71b72c468c871feb454d6842b5e2e7b020..5089630ed4aaf3900b5ff7e8d4ecda797bba5b3b 100755 (executable)
@@ -36,7 +36,8 @@ ifdown()
 
        ACTION=ifdown INTERFACE=$1 /sbin/hotplug-call iface
 
-       kill $(pgrep -f "mwan3track $1") &> /dev/null
+       kill $(pgrep -f "mwan3track $1 $2") &> /dev/null
+       mwan3_track_clean $1
 }
 
 ifup()
@@ -53,6 +54,12 @@ ifup()
                echo "Too many arguments. Usage: mwan3 ifup <interface>" && exit 0
        fi
 
+       config_get_bool enabled globals 'enabled' 0
+       [ ${enabled} -gt 0 ] || {
+               echo "Warning: mwan3 is global disabled. Usage: /etc/init.d/mwan3 start"
+               exit 0
+       }
+
        config_get enabled "$1" enabled 0
 
        device=$(uci -p /var/state get network.$1.ifname) &> /dev/null
@@ -111,19 +118,34 @@ status()
 
 start()
 {
+       local enabled
+
        config_load mwan3
+       config_get_bool enabled globals 'enabled' 0
+       [ ${enabled} -gt 0 ] || {
+               echo "Warning: mwan3 is global disabled. Usage: /etc/init.d/mwan3 start"
+               exit 0
+       }
+
        config_foreach ifup interface
 }
 
 stop()
 {
-       local ipset route rule table IP IPT
+       local ipset route rule table IP IPT pid
 
-       killall mwan3track &> /dev/null
+       for pid in $(pgrep -f "mwan3track"); do
+               kill -TERM "$pid" > /dev/null 2>&1
+               sleep 1
+               kill -KILL "$pid" > /dev/null 2>&1
+       done
+
+       config_load mwan3
+       config_foreach mwan3_track_clean interface
 
        for IP in "$IP4" "$IP6"; do
 
-               for route in $($IP route list table all | sed 's/.*table \([^ ]*\) .*/\1/' |  awk '{print $1}' | awk '{for(i=1;i<=NF;i++) if($i+0>0) if($i+0<255) {print;break}}'); do
+               for route in $(seq 1 $MWAN3_INTERFACE_MAX); do
                        $IP route flush table $route &> /dev/null
                done
 
@@ -153,6 +175,9 @@ stop()
        for ipset in $($IPS -n list | grep mwan3 | grep -E '_v4|_v6'); do
                $IPS -q destroy $ipset
        done
+
+       mwan3_lock_clean
+       rm -rf $MWAN3_STATUS_DIR $MWAN3TRACK_STATUS_DIR
 }
 
 restart() {
@@ -162,6 +187,7 @@ restart() {
 
 case "$1" in
        ifup|ifdown|interfaces|policies|connected|rules|status|start|stop|restart)
+               mwan3_init
                $*
        ;;
        *)
index 8afe9012939b91cd13ba0b6efb9508b37e1fd0eb..e8080b59c02772c0b56c0378ea472ae10209acfc 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 . /lib/functions.sh
+. /lib/mwan3/common.sh
 
 LOG="logger -t $(basename "$0")[$$] -p"
 INTERFACE=""
@@ -10,12 +11,6 @@ IFDOWN_EVENT=0
 
 clean_up() {
        $LOG notice "Stopping mwan3track for interface \"${INTERFACE}\""
-       if [ "$(pgrep -f "mwan3track ${INTERFACE}")" = "" ]; then
-               rm -rf "/var/run/mwan3track/${INTERFACE}" &> /dev/null
-       fi
-       if [ -z "$(ls -A "/var/run/mwan3track")" ]; then
-               rm -rf "/var/run/mwan3track"
-       fi
        exit 0
 }
 
@@ -24,19 +19,63 @@ if_down() {
        IFDOWN_EVENT=1
 }
 
+validate_track_method() {
+       case "$1" in
+               ping)
+                       which ping 1>/dev/null 2>&1 || {
+                               $LOG warn "Missing ping. Please install iputils-ping package or enable ping util and recompile busybox."
+                               return 1
+                       }
+                       ;;
+               arping)
+                       which arping 1>/dev/null 2>&1 || {
+                               $LOG warn "Missing arping. Please install iputils-arping package."
+                               return 1
+                       }
+                       ;;
+               httping)
+                       which httping 1>/dev/null 2>&1 || {
+                               $LOG warn "Missing httping. Please install httping package."
+                               return 1
+                       }
+                       [ -n "$2" -a "$2" != "0.0.0.0" -a "$2" != "::" ] || {
+                               $LOG warn "Cannot determine source IP for the interface which is required by httping."
+                               return 1
+                       }
+                       ;;
+               *)
+                       $LOG warn "Unsupported tracking method: $track_method"
+                       return 2
+                       ;;
+       esac
+}
+
 main() {
        local reliability count timeout interval failure_interval
        local recovery_interval down up size
+       local keep_failure_interval
 
-       [ -z "$3" ] && echo "Error: should not be started manually" && exit 0
+       [ -z "$5" ] && echo "Error: should not be started manually" && exit 0
 
        INTERFACE=$1
        DEVICE=$2
+       STATUS=$3
+       SRC_IP=$4
        mkdir -p /var/run/mwan3track/$1
-       trap clean_up SIGINT SIGTERM
-       trap if_down SIGUSR1
+       trap clean_up TERM
+       trap if_down USR1
 
        config_load mwan3
+       config_get track_method $1 track_method ping
+       validate_track_method $track_method $SRC_IP || {
+               track_method=ping
+               if validate_track_method $track_method; then
+                       $LOG warn "Using ping to track interface $INTERFACE avaliability"
+               else
+                       $LOG err "No track method avaliable"
+                       exit 1
+               fi
+       }
        config_get reliability $1 reliability 1
        config_get count $1 count 1
        config_get timeout $1 timeout 4
@@ -45,28 +84,45 @@ main() {
        config_get up $1 up 5
        config_get size $1 size 56
        config_get failure_interval $1 failure_interval $interval
+       config_get_bool keep_failure_interval $1 keep_failure_interval 0
        config_get recovery_interval $1 recovery_interval $interval
 
        local score=$(($down+$up))
-       local track_ips=$(echo $* | cut -d ' ' -f 3-99)
+       local track_ips=$(echo $* | cut -d ' ' -f 5-99)
        local host_up_count=0
        local lost=0
        local sleep_time=0
        local turn=0
 
-       echo "offline" > /var/run/mwan3track/$1/STATUS
+       if [ "$STATUS" = "unknown" ]; then
+               echo "unknown" > /var/run/mwan3track/$1/STATUS
+               score=0
+       else
+               echo "online" > /var/run/mwan3track/$1/STATUS
+       fi
        while true; do
 
                sleep_time=$interval
 
                for track_ip in $track_ips; do
-                       ping -I $2 -c $count -W $timeout -s $size -q $track_ip &> /dev/null
-                       if [ $? -eq 0 ]; then
-                               let host_up_count++
-                               echo "up" > /var/run/mwan3track/$1/TRACK_${track_ip}
+                       if [ $host_up_count -lt $reliability ]; then
+                               case "$track_method" in
+                                       ping)
+                                               ping -I $DEVICE -c $count -W $timeout -s $size -q $track_ip &> /dev/null ;;
+                                       arping)
+                                               arping -I $DEVICE -c $count -w $timeout -q $track_ip &> /dev/null ;;
+                                       httping)
+                                               httping -y $SRC_IP -c $count -t $timeout -q $track_ip &> /dev/null ;;
+                               esac
+                               if [ $? -eq 0 ]; then
+                                       let host_up_count++
+                                       echo "up" > /var/run/mwan3track/$1/TRACK_${track_ip}
+                               else
+                                       let lost++
+                                       echo "down" > /var/run/mwan3track/$1/TRACK_${track_ip}
+                               fi
                        else
-                               let lost++
-                               echo "down" > /var/run/mwan3track/$1/TRACK_${track_ip}
+                               echo "skipped" > /var/run/mwan3track/$1/TRACK_${track_ip}
                        fi
                done
 
@@ -75,6 +131,9 @@ main() {
 
                        if [ $score -lt $up ]; then
                                score=0
+                               [ ${keep_failure_interval} -eq 1 ] && {
+                                       sleep_time=$failure_interval
+                               }
                        else
                                sleep_time=$failure_interval
                        fi
@@ -83,6 +142,7 @@ main() {
                                echo "offline" > /var/run/mwan3track/$1/STATUS
                                $LOG notice "Interface $1 ($2) is offline"
                                env -i ACTION=ifdown INTERFACE=$1 DEVICE=$2 /sbin/hotplug-call iface
+                               env -i ACTION="disconnected" INTERFACE="$1" DEVICE="$2" /sbin/hotplug-call iface
                                score=0
                        fi
                else
@@ -102,8 +162,9 @@ main() {
 
                        if [ $score -eq $up ]; then
                                $LOG notice "Interface $1 ($2) is online"
+                               echo "online" > /var/run/mwan3track/$1/STATUS
+                               env -i ACTION="connected" INTERFACE="$1" DEVICE="$2" /sbin/hotplug-call iface
                                env -i ACTION=ifup INTERFACE=$1 DEVICE=$2 /sbin/hotplug-call iface
-                               rm -rf "/var/run/mwan3track/${1}" &> /dev/null
                                exit 0
                        fi
                fi
@@ -113,6 +174,7 @@ main() {
                echo "${lost}" > /var/run/mwan3track/$1/LOST
                echo "${score}" > /var/run/mwan3track/$1/SCORE
                echo "${turn}" > /var/run/mwan3track/$1/TURN
+               echo "$(get_uptime)" > /var/run/mwan3track/$1/TIME
 
                host_up_count=0
                sleep "${sleep_time}" &
index 130b31b6eb98c9be700da0ed94850467525fb0e1..4f726e2147cf25b34e73740a46c8a47a74b874d8 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nbd
-PKG_VERSION:=3.11
+PKG_VERSION:=3.16.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@SF/nbd
-PKG_MD5SUM:=73d11644a28b9f335292cdb3bdc4b74b
+PKG_HASH:=422f62bdf6e6b973bd82083dc52b6577396fe00aa6607837ac464e476124155b
 PKG_LICENSE:=GPL-2.0+
 PKG_MAINTAINER:=Marcin Jurkowski <marcin1j@gmail.com>
 
@@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/package.mk
 # -liconv due to glib2, to be revisited later
 include $(INCLUDE_DIR)/nls.mk
 
-PKG_BUILD_DEPENDS:=glib2 libintl
+PKG_BUILD_DEPENDS:=glib2 gettext
 
 define Package/nbd
   SECTION:=net
@@ -51,7 +51,8 @@ define Package/nbd-server/description
 endef
 
 CONFIGURE_ARGS += \
-       --disable-glibtest
+       --disable-glibtest \
+       --without-gnutls
 
 TARGET_CFLAGS += --std=gnu99 -DNODAEMON
 
diff --git a/net/nbd/patches/100-make-gnutls-test-optional.patch b/net/nbd/patches/100-make-gnutls-test-optional.patch
new file mode 100644 (file)
index 0000000..29586ea
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -210,7 +210,11 @@ dnl               ;;
+ dnl   esac
+ dnl fi
+-PKG_CHECK_MODULES(GnuTLS, [gnutls >= 2.12.0],[HAVE_GNUTLS=1],[HAVE_GNUTLS=0])
++AC_ARG_WITH([gnutls], AS_HELP_STRING([--with-gnutls], [Build with GnuTLS]))
++AS_IF([test "x$with_gnutls" = "xyes"], [
++      PKG_CHECK_MODULES(GnuTLS, [gnutls >= 2.12.0],[HAVE_GNUTLS=1],[HAVE_GNUTLS=0])
++])
++
+ if test x$HAVE_GNUTLS = x1; then
+       AC_DEFINE(HAVE_GNUTLS, 1, [Define to 1 if you have a GnuTLS version of 2.12 or above])
+ else
diff --git a/net/nbd/patches/101-fix-build-without-gnutls.patch b/net/nbd/patches/101-fix-build-without-gnutls.patch
new file mode 100644 (file)
index 0000000..44cbf4e
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -35,7 +35,7 @@ nbd_client_CFLAGS = $(client_flags) @Gnu
+ nbd_client_LDADD = $(client_libs) @GnuTLS_LIBS@
+ else
+ nbd_client_SOURCES = $(client_srcs)
+-nbd_client_CFLAGS = $(client_flags)
++nbd_client_CFLAGS = $(client_flags) -DNOTLS -DPROG_NAME='"nbd-client"'
+ nbd_client_LDADD = $(client_libs)
+ endif
+ endif
index 56bd08bb26c235d2583a18145fdf94fcba931621..855f729af16777ffe6d914b46a56c77afac08234 100644 (file)
@@ -15,7 +15,7 @@ PKG_LICENSE_FILES:=
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://dl.fefe.de/
-PKG_MD5SUM:=421c4855bd3148b7d0a4342942b4bf13
+PKG_HASH:=6cfa72edd5f7717bf7a4a93ccc74c4abd89892360e2e0bb095a73c24b9359b88
 
 PKG_BUILD_DEPENDS:=libowfat
 
index 3446d151426291a5c2dc4929a6d15099ace0f072..0237a54da5f1818213ed397d655874050c7c4596 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=net-snmp
 PKG_VERSION:=5.7.3
-PKG_RELEASE:=3
+PKG_RELEASE:=9
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/net-snmp
-PKG_MD5SUM:=d4a3459e1577d0efa8d96ca70a885e53
+PKG_HASH:=12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0
 PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
 PKG_LICENSE:=MIT BSD-3-Clause-Clear
 
@@ -72,7 +72,13 @@ endef
 define Package/snmp-utils/description
 $(call Package/net-snmp/Default/description)
  .
- This package contains SNMP client utilities.
+ This package contains SNMP client utilities:
+   - snmpget
+   - snmpset
+   - snmpstatus
+   - snmptest
+   - snmptrap
+   - snmpwalk
 endef
 
 
@@ -96,8 +102,21 @@ $(call Package/net-snmp/Default)
 endef
 
 
+define Package/snmptrapd
+$(call Package/net-snmp/Default)
+  DEPENDS:=+libnetsnmp
+  TITLE:=Open source SNMP implementation (notification receiver)
+endef
+
+define Package/snmptrapd/description
+$(call Package/net-snmp/Default/description)
+ .
+ This package contains the SNMP notification receiver.
+endef
+
 
 SNMP_MIB_MODULES_INCLUDED = \
+       agent/extend \
        agentx \
        host/hr_device \
        host/hr_disk \
@@ -182,6 +201,7 @@ CONFIGURE_ARGS += \
        --with-transports="$(SNMP_TRANSPORTS_INCLUDED)" \
        --without-openssl \
        --without-libwrap \
+       --without-mysql \
        --without-rpm \
        --without-zlib \
        --with-nl \
@@ -208,6 +228,7 @@ define Build/InstallDev
        $(INSTALL_DIR) $(2)/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(2)/bin/
        $(SED) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin/net-snmp-config
+       $(LN) $(STAGING_DIR)/host/bin/net-snmp-config $(STAGING_DIR)/usr/bin/
 
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/net-snmp $(1)/usr/include/
@@ -238,15 +259,25 @@ define Package/snmpd/install
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
        $(INSTALL_DIR) $(1)/etc/snmp
-       ln -sf /var/run/snmpd.conf $(1)/etc/snmp/
+       $(LN) /var/run/snmpd.conf $(1)/etc/snmp/
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(1)/usr/sbin/snmpd
 endef
 
+define Package/snmptrapd/install
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/snmptrapd.init $(1)/etc/init.d/snmptrapd
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmptrapd.so.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmptrapd $(1)/usr/sbin/
+endef
+
 $(eval $(call BuildPackage,libnetsnmp))
 $(eval $(call BuildPackage,snmp-mibs))
 $(eval $(call BuildPackage,snmp-utils))
 $(eval $(call BuildPackage,snmpd))
 $(eval $(call BuildPackage,snmpd-static))
+$(eval $(call BuildPackage,snmptrapd))
index ac152d83eb91d920e46e90309ae7d72620203343..e18864d539bef1bb99d306f1f3a355d36f531267 100644 (file)
@@ -1,5 +1,5 @@
 config agent
-       option agentaddress UDP:161
+       option agentaddress UDP:161,UDP6:161
 
 config agentx
        option agentxsocket /var/run/agentx.sock
@@ -14,6 +14,16 @@ config com2sec private
        option source localhost
        option community private
 
+config com2sec6 public6
+       option secname ro
+       option source default
+       option community public
+
+config com2sec6 private6
+       option secname rw
+       option source localhost
+       option community private
+
 config group public_v1
        option group public
        option version v1
@@ -87,3 +97,34 @@ config engineid
 #      option engineid 'LEDE'
        option engineidtype '3'
        option engineidnic 'eth0'
+
+#config trapcommunity 'trapcommunity'
+#      option community 'public'
+
+#config trapsink
+#      option host 'nms.system.com'
+#      option community 'public'
+#      option port '162'
+
+#config trap2sink
+#      option host 'nms.system.com'
+#      option community 'secret'
+#      option port '162'
+
+#config informsink
+#      option host 'nms.sytem.com'
+#      option community 'public'
+#      option port '162'
+
+#config authtrapenable 'authtrapenable'
+#      option enable '1'
+
+#config v1trapaddress 'v1trapaddress'
+#      option host '1.2.3.4'
+
+#config trapsess 'trapsess'
+#      option trapsess '-v 3 -e 0x80001f88808c18d3f7b0000 -u trapuser -a MD5 -A administrator -l authPriv -x DES -X rootpasswd udp:127.0.0.1:162'
+
+config snmpd general
+       option enabled '1'
+#      list network 'wan'
index 7df67de28ea9c8c89a3323ea74068880d9617e73..caffecf6640778f22d6f0742e6f56b73a04c9721 100644 (file)
@@ -210,13 +210,75 @@ snmpd_engineid_add() {
        [ -n "$engineidnic" ] && echo "engineIDNic $engineidnic" >> $CONFIGFILE
 }
 
+snmpd_sink_add() {
+       local cfg="$1"
+       local section="$2"
+       local community
+       local port
+       local host
+
+       config_get host "$cfg" host
+       [ -n "section" -a -n "$host" ] || return 0
+       # optional community
+       config_get community "$cfg" community
+       # optional port
+       config_get port "$cfg" port
+       port=${port:+:$port}
+       echo "$section $host$port $community" >> $CONFIGFILE
+}
+
+append_parm() {
+       local section="$1"
+       local option="$2"
+       local switch="$3"
+       local _loctmp
+       config_get _loctmp "$section" "$option"
+       [ -z "$_loctmp" ] && return 0
+       echo "$switch $_loctmp" >> $CONFIGFILE
+}
+
+append_authtrapenable() {
+       local section="$1"
+       local option="$2"
+       local switch="$3"
+       local _loctmp
+       config_get_bool _loctmp "$section" "$option"
+       [ -z "$_loctmp" ] && return 0
+       [ "$_loctmp" -gt 0 ] && echo "$switch $_loctmp" >> $CONFIGFILE
+}
+
+snmpd_setup_fw_rules() {
+       local net="$1"
+       local zone
+
+       zone=$(fw3 -q network "$net" 2>/dev/null)
+
+       local handled_zone
+       for handled_zone in $HANDLED_SNMP_ZONES; do
+               [ "$handled_zone" = "$zone" ] && return
+       done
+
+       json_add_object ""
+       json_add_string type rule
+       json_add_string src "$zone"
+       json_add_string proto udp
+       json_add_string dest_port 161
+       json_add_string target ACCEPT
+       json_close_object
+
+       HANDLED_SNMP_ZONES="$HANDLED_SNMP_ZONES $zone"
+}
+
 start_service() {
        [ -f "$CONFIGFILE" ] && rm -f "$CONFIGFILE"
 
-       procd_open_instance
-
        config_load snmpd
 
+       config_get_bool snmp_enabled general enabled 1
+       [ "$snmp_enabled" -eq 0 ] && return
+
+       procd_open_instance
+
        config_foreach snmpd_agent_add agent
        config_foreach snmpd_agentx_add agentx
        config_foreach snmpd_system_add system
@@ -234,7 +296,14 @@ start_service() {
        config_foreach snmpd_exec_add exec
        config_foreach snmpd_disk_add disk
        config_foreach snmpd_engineid_add engineid
-       
+       append_parm trapcommunity community trapcommunity
+       config_foreach snmpd_sink_add trapsink trapsink
+       config_foreach snmpd_sink_add trap2sink trap2sink
+       config_foreach snmpd_sink_add informsink informsink
+       append_authtrapenable authtrapenable enable authtrapenable
+       append_parm v1trapaddress host v1trapaddress
+       append_parm trapsess trapsess trapsess
+
        procd_set_param command $PROG -Lf /dev/null -f
        procd_set_param file $CONFIGFILE
        procd_set_param respawn
@@ -243,6 +312,14 @@ start_service() {
                procd_append_param netdev "$iface"
        done
 
+       procd_open_data
+
+       json_add_array firewall
+       config_list_foreach general network snmpd_setup_fw_rules
+       json_close_array
+
+       procd_close_data
+
        procd_close_instance
 }
 
diff --git a/net/net-snmp/files/snmptrapd.init b/net/net-snmp/files/snmptrapd.init
new file mode 100644 (file)
index 0000000..43278a2
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+
+START=50
+
+USE_PROCD=1
+PROG="/usr/sbin/snmptrapd"
+
+start_service() {
+       procd_open_instance
+
+       procd_set_param command $PROG -Lf /dev/null -f
+       procd_set_param respawn
+
+       procd_close_instance
+}
index ddfedbfee6f63246fc238674681b29960d62c9d8..430b963dadc28fe23defb8299516cb9a52c37f72 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=netatalk
-PKG_VERSION:=3.1.10
-PKG_RELEASE:=1
+PKG_VERSION:=3.1.11
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/netatalk
-PKG_MD5SUM:=2b40161985bb32cff5660bf689a4704f15c33bb87565efc7805dd5c75ad1fcc7
+PKG_HASH:=3434472ba96d3bbe3b024274438daad83b784ced720f7662a4c1d0a1078799a6
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
@@ -28,7 +28,7 @@ define Package/netatalk
   DEPENDS:=+libattr +libdb47 +libgcrypt +libopenssl $(LIBRPC_DEPENDS)
   TITLE:=netatalk
   URL:=http://netatalk.sourceforge.net
-  MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+  MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
 endef
 
 define Package/netatalk/decription
@@ -37,10 +37,6 @@ define Package/netatalk/decription
   Protocol Suite.
 endef
 
-define Package/netatalk/conffiles
-/etc/netatalk/afpd.conf
-endef
-
 TARGET_CFLAGS += -std=gnu99
 TARGET_LDFLAGS += $(LIBRPC)
 
@@ -89,8 +85,8 @@ define Package/netatalk/install
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_dbd $(1)/usr/sbin/
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_metad $(1)/usr/sbin/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/uams/*.so $(1)/usr/lib/uams/
-       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/afp.conf $(1)/etc/
-       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/extmap.conf $(1)/etc/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/afp.conf $(1)/etc/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/extmap.conf $(1)/etc/
        $(INSTALL_BIN) ./files/afpd.init $(1)/etc/init.d/afpd
 endef
 
index 0248f0d13e3c81fb092676559507118f858f4b09..5a56317fbcd6b4534b5beb8275dce879ec05cf8f 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=0a29eff1736ddb5effd0b1ec1f6fe0ef
+PKG_HASH:=b55af0bbdf5acc02d1eb6ab18da2acd77a400bafd074489003f3df09676332bb
 PKG_MAINTAINER:=Adam Gensler <openwrt@a.gnslr.us>
 PKG_LICENSE:=GPL-2.0
 PKG_INSTALL:=1
index 8002d8439c5b7086de02b8ab02d6abfa24236fb5..dc6d36d14a4f70e46707b90e65ca881f8f3a099f 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-LINUXONLY.tar.gz
 PKG_SOURCE_URL:=@SF/netdiscover
-PKG_MD5SUM:=8780e66d00496e933b4064cfe9ae61da
+PKG_HASH:=01c6e090c3b06e374005f7efcead3b5b2f63f47bfb94383c1dbde9abcf1cd8aa
 PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
 PKG_LICENSE:=GPL-2.0
 
@@ -30,10 +30,6 @@ define Package/netdiscover
   URL:=https://sourceforge.net/projects/netdiscover
 endef
 
-CONFIGURE_VARS+= \
-       CPPFLAGS="$(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/lib/libnet-1.2.x/lib" \
-       LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib/libnet-1.2.x/lib"
-
 define Package/netdiscover/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/netdiscover $(1)/usr/sbin/
diff --git a/net/netopeer2/Config_keystored.in b/net/netopeer2/Config_keystored.in
new file mode 100644 (file)
index 0000000..7325250
--- /dev/null
@@ -0,0 +1,7 @@
+if PACKAGE_netopeer2-keystored
+
+config SSH_KEYS
+       bool "Generate default ssh keys"
+       default y
+
+endif
diff --git a/net/netopeer2/Makefile b/net/netopeer2/Makefile
new file mode 100644 (file)
index 0000000..b9f2968
--- /dev/null
@@ -0,0 +1,131 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# Warning by default OpenWrt does not have a root password which is necessery for NETCONF server.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=netopeer2
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
+
+PKG_VERSION:=0.4.13
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=ae560bef2e70d274f6d028b59e3cb398ea2a621d
+PKG_MIRROR_HASH:=43b7f9c436afc76de539a7426b1462249326318b9b836f1d49282106a730a6b8
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/CESNET/Netopeer2.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
+
+PKG_BUILD_ROOT:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+CMAKE_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/netopeer2-keystored/config
+  source "$(SOURCE)/Config_keystored.in"
+endef
+
+define Package/netopeer2-server
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=NETCONF server
+  URL:=$(PKG_SOURCE_URL)
+  DEPENDS:=+libpthread +libyang +libnetconf2 +netopeer2-keystored +libsysrepo +sysrepocfg +sysrepoctl +sysrepo
+  MENU:=1
+endef
+
+define Package/netopeer2-cli
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Netopeer2 cli tool
+  URL:=$(PKG_SOURCE_URL)
+  DEPENDS:=+libpthread +libyang +libnetconf2 +libopenssl
+endef
+
+define Package/netopeer2-keystored
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Netopeer2 key store management
+  URL:=$(PKG_SOURCE_URL)
+  DEPENDS:=+libopenssl +libsysrepo +sysrepo +sysrepocfg +sysrepoctl +SSH_KEYS:openssh-keygen +SSH_KEYS:openssl-util
+  MENU:=1
+endef
+
+define Package/netopeer2/description
+ Netopeer2 is a set of tools implementing network configuration tools based on the NETCONF
+ Protocol. This is the second generation of the toolset, originally available as the Netopeer
+ project. Netopeer2 is based on the new generation of the NETCONF and YANG libraries -
+ libyang and libnetconf2. The Netopeer server uses sysrepo as a NETCONF datastore implementation.
+endef
+
+CMAKE_OPTIONS += \
+       -DCMAKE_INSTALL_PREFIX:PATH=/usr \
+       -DCMAKE_BUILD_TYPE:STRING=Release \
+       -DKEYSTORED_KEYS_DIR:STRING=/etc/keystored/keys
+
+define Package/netopeer2-server/install
+       $(INSTALL_DIR) $(1)/bin
+       $(INSTALL_BIN) $(PKG_BUILD_ROOT)/server/netopeer2-server $(1)/bin/
+
+       $(INSTALL_DIR) $(1)/etc/sysrepo/yang
+       $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-ssh-server.yang $(1)/etc/sysrepo/yang/ietf-ssh-server@2016-11-02.yang
+       $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-tls-server.yang $(1)/etc/sysrepo/yang/ietf-tls-server@2016-11-02.yang
+       $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/iana-crypt-hash.yang $(1)/etc/sysrepo/yang/iana-crypt-hash@2014-08-06.yang
+       $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-x509-cert-to-name.yang $(1)/etc/sysrepo/yang/ietf-x509-cert-to-name@2014-12-10.yang
+       $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-netconf-server.yang $(1)/etc/sysrepo/yang/ietf-netconf-server@2016-11-02.yang
+       $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-system.yang $(1)/etc/sysrepo/yang/ietf-system@2014-08-06.yang
+
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) ./files/netopeer2-server.default $(1)/etc/uci-defaults/99_netopeer2-server
+
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_BIN) ./files/netopeer2-server.init $(1)/etc/init.d/netopeer2-server
+
+       $(INSTALL_DIR) $(1)/usr/share/netopeer2-server
+       $(INSTALL_DATA) ./files/stock_config.xml $(1)/usr/share/netopeer2-server
+endef
+
+define Package/netopeer2-cli/install
+       $(INSTALL_DIR) $(1)/bin
+       $(INSTALL_BIN) $(PKG_BUILD_ROOT)/cli/netopeer2-cli $(1)/bin/
+endef
+
+define Package/netopeer2-keystored/install
+       $(INSTALL_DIR) $(1)/usr/lib/sysrepo/plugins/
+       $(INSTALL_BIN) $(PKG_BUILD_ROOT)/keystored/libkeystored.so $(1)/usr/lib/sysrepo/plugins/
+
+       $(INSTALL_DIR) $(1)/etc/sysrepo/yang
+       $(INSTALL_DATA) $(PKG_BUILD_ROOT)/modules/ietf-keystore.yang $(1)/etc/sysrepo/yang/ietf-keystore@2016-10-31.yang
+
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+
+       $(INSTALL_DIR) $(1)/etc/keystored/keys
+ifeq ($(CONFIG_SSH_KEYS),y)
+       $(INSTALL_BIN) ./files/netopeer2-keystored-keygen.default $(1)/etc/uci-defaults/97_netopeer2-keystored
+else
+       $(INSTALL_BIN) ./files/netopeer2-keystored.default $(1)/etc/uci-defaults/97_netopeer2-keystored
+       #ssh key name is specified in ./files/stock_config.xml file, you will need to provide the ssh keys yourself.
+       $(INSTALL_DATA) ./files/ssh_host_rsa_key.pem $(1)/etc/keystored/keys
+       $(INSTALL_DATA) ./files/ssh_host_rsa_key.pub.pem $(1)/etc/keystored/keys
+endif
+
+       $(INSTALL_DIR) $(1)/usr/share/netopeer2-keystored
+       $(INSTALL_DATA) $(PKG_BUILD_ROOT)/keystored/stock_key_config.xml $(1)/usr/share/netopeer2-keystored
+endef
+
+$(eval $(call BuildPackage,netopeer2-server))
+$(eval $(call BuildPackage,netopeer2-cli))
+$(eval $(call BuildPackage,netopeer2-keystored))
diff --git a/net/netopeer2/files/netopeer2-keystored-keygen.default b/net/netopeer2/files/netopeer2-keystored-keygen.default
new file mode 100644 (file)
index 0000000..df28081
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# Warning, problems can occur if the device restarts in the middle of this uci-default script
+
+if [ -x /bin/sysrepoctl ]; then
+       match=$(sysrepoctl -l | grep "ietf-keystore ")
+       if [ ! "$match" ]; then
+               sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-keystore@2016-10-31.yang -o root:root -p 600
+               if [ -x /bin/sysrepocfg ]; then
+                       sysrepocfg -d startup -i /usr/share/netopeer2-keystored/stock_key_config.xml ietf-keystore
+                       rm /usr/share/netopeer2-keystored/stock_key_config.xml
+               fi
+
+               #generate ssh keys
+               ssh-keygen -t rsa -f /tmp/ssh_host_rsa_key -N ""
+               openssl rsa -in /tmp/ssh_host_rsa_key -outform pem > /etc/keystored/keys/ssh_host_rsa_key.pem
+               openssl rsa -pubout -in /etc/keystored/keys/ssh_host_rsa_key.pem -out /etc/keystored/keys/ssh_host_rsa_key.pub.pem
+               rm /tmp/ssh_host_rsa_key
+       fi
+fi
+
+exit 0
diff --git a/net/netopeer2/files/netopeer2-keystored.default b/net/netopeer2/files/netopeer2-keystored.default
new file mode 100644 (file)
index 0000000..dda6f45
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Warning, problems can occur if the device restarts in the middle of this uci-default script
+
+if [ -x /bin/sysrepoctl ]; then
+       match=$(sysrepoctl -l | grep "ietf-keystore ")
+       if [ ! "$match" ]; then
+               sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-keystore@2016-10-31.yang -o root:root -p 600
+               if [ -x /bin/sysrepocfg ]; then
+                       sysrepocfg -d startup -i /usr/share/netopeer2-keystored/stock_key_config.xml ietf-keystore
+                       rm /usr/share/netopeer2-keystored/stock_key_config.xml
+               fi
+       fi
+fi
+
+exit 0
diff --git a/net/netopeer2/files/netopeer2-server.default b/net/netopeer2/files/netopeer2-server.default
new file mode 100644 (file)
index 0000000..8a7b7fe
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# Warning, problems can occur if the device restarts in the middle of this uci-default script
+
+if [ -x /bin/sysrepoctl ]; then
+       match=$(sysrepoctl -l | grep "ietf-ssh-server ")
+       if [ ! "$match" ]; then
+               sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-ssh-server@2016-11-02.yang -p 600
+       fi
+
+       match=$(sysrepoctl -l | grep "ietf-tls-server ")
+       if [ ! "$match" ]; then
+               sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-tls-server@2016-11-02.yang -p 600
+       fi
+
+       match=$(sysrepoctl -l | grep "iana-crypt-hash ")
+       if [ ! "$match" ]; then
+               sysrepoctl --install --yang=/etc/sysrepo/yang/iana-crypt-hash@2014-08-06.yang -p 600
+       fi
+
+       match=$(sysrepoctl -l | grep "ietf-x509-cert-to-name ")
+       if [ ! "$match" ]; then
+               sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-x509-cert-to-name@2014-12-10.yang -p 600
+       fi
+
+       match=$(sysrepoctl -l | grep "ietf-netconf-server ")
+       if [ ! "$match" ]; then
+               sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-server@2016-11-02.yang -o root:root -p 600
+               sysrepoctl -m ietf-netconf-server -e listen
+               sysrepoctl -m ietf-netconf-server -e ssh-listen
+               if [ -x /bin/sysrepocfg ]; then
+                       sysrepocfg -d startup -i /usr/share/netopeer2-server/stock_config.xml ietf-netconf-server
+                       rm /usr/share/netopeer2-server/stock_config.xml
+               fi
+       fi
+
+       match=$(sysrepoctl -l | grep "ietf-system ")
+       if [ ! "$match" ]; then
+               sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-system@2014-08-06.yang -o root:root -p 600
+               sysrepoctl -m ietf-system -e authentication
+               sysrepoctl -m ietf-system -e local-users
+       fi
+fi
+
+exit 0
diff --git a/net/netopeer2/files/netopeer2-server.init b/net/netopeer2/files/netopeer2-server.init
new file mode 100644 (file)
index 0000000..59f7699
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh /etc/rc.common
+
+START=99
+STOP=11
+
+USE_PROCD=1
+PROG=/bin/netopeer2-server
+
+start_service() {
+
+    PERSIST_FILE=/etc/sysrepo/data/ietf-keystore.persist
+
+    while [ ! -f $PERSIST_FILE ]
+    do
+        echo "no persist file yet"
+        sleep 3
+    done
+
+    RETRY_CNT=5
+    LAST_LINE=$(tail -n1 $PERSIST_FILE)
+
+    while [[ -f $PERSIST_FILE && $LAST_LINE != "</module>" ]]
+    do
+        sleep 1
+
+        echo "$RETRY_CNT: $LAST_LINE"
+        LAST_LINE=$(tail -n1 $PERSIST_FILE)
+        RETRY_CNT=$(($RETRY_CNT-1))
+
+        if [ $RETRY_CNT -le 0 ];
+        then
+            rm $PERSIST_FILE
+            RETRY_CNT=5
+        fi
+         done
+
+    procd_open_instance
+    procd_set_param command $PROG
+    procd_append_param command -d -v 0
+    procd_set_param respawn
+    procd_close_instance
+}
+
+stop_service()
+{
+    service_stop ${PROG}
+}
diff --git a/net/netopeer2/files/stock_config.xml b/net/netopeer2/files/stock_config.xml
new file mode 100644 (file)
index 0000000..4576684
--- /dev/null
@@ -0,0 +1,17 @@
+<netconf-server xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-server">
+  <listen>
+    <endpoint>
+      <name>test_ssh_listen_endpt</name>
+      <ssh>
+        <address>::</address>
+        <port>830</port>
+        <host-keys>
+          <host-key>
+            <name>test_ssh_listen_key</name>
+            <public-key>ssh_host_rsa_key</public-key>
+          </host-key>
+        </host-keys>
+      </ssh>
+    </endpoint>
+  </listen>
+</netconf-server>
diff --git a/net/netopeer2/patches/001-remove-sysrepoctl-commands-from-cmake b/net/netopeer2/patches/001-remove-sysrepoctl-commands-from-cmake
new file mode 100644 (file)
index 0000000..1d14ee0
--- /dev/null
@@ -0,0 +1,40 @@
+Index: netopeer2-c204b59f9c2bb7e63eb907f33c44adbf208295ee/keystored/CMakeLists.txt
+===================================================================
+--- netopeer2-c204b59f9c2bb7e63eb907f33c44adbf208295ee.orig/keystored/CMakeLists.txt
++++ netopeer2-c204b59f9c2bb7e63eb907f33c44adbf208295ee/keystored/CMakeLists.txt
+@@ -105,6 +105,7 @@ endif()
+ install(DIRECTORY DESTINATION ${KEYSTORED_KEYS_DIR}
+         DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE)
++if(FALSE)
+ # install all the required modules and enable features
+ install(CODE "
+     execute_process(COMMAND ${SYSREPOCTL_EXECUTABLE} -l RESULT_VARIABLE RET OUTPUT_VARIABLE INSTALLED_MODULES ERROR_VARIABLE OUT)
+@@ -154,6 +155,7 @@ install(CODE "
+             message(FATAL_ERROR \"  Command sysrepocfg import failed:\\n  \${OUT}\")
+         endif()
+     endif()")
++endif()
+ # plugins should be installed into sysrepo plugins dir
+ install(TARGETS keystored DESTINATION ${SR_PLUGINS_DIR})
+Index: netopeer2-c204b59f9c2bb7e63eb907f33c44adbf208295ee/server/CMakeLists.txt
+===================================================================
+--- netopeer2-c204b59f9c2bb7e63eb907f33c44adbf208295ee.orig/server/CMakeLists.txt
++++ netopeer2-c204b59f9c2bb7e63eb907f33c44adbf208295ee/server/CMakeLists.txt
+@@ -147,6 +147,7 @@ include_directories(${SYSREPO_INCLUDE_DI
+ # install binary
+ install(TARGETS netopeer2-server DESTINATION ${CMAKE_INSTALL_BINDIR})
++if(FALSE)
+ # only for configuration
+ if (ENABLE_CONFIGURATION)
+     # find sysrepoctl
+@@ -239,6 +240,7 @@ if (ENABLE_CONFIGURATION)
+         endif()")
+ endif()
++endif()
+ # clean cmake cache
+ add_custom_target(cleancache
diff --git a/net/netopeer2/patches/002-fix-for-cmake-build b/net/netopeer2/patches/002-fix-for-cmake-build
new file mode 100644 (file)
index 0000000..bd29d4d
--- /dev/null
@@ -0,0 +1,58 @@
+Index: netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/CMakeLists.txt
+===================================================================
+--- /dev/null
++++ netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/CMakeLists.txt
+@@ -0,0 +1,5 @@
++cmake_minimum_required(VERSION 2.6)
++
++add_subdirectory(server)
++add_subdirectory(cli)
++add_subdirectory(keystored)
+Index: netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/cli/CMakeLists.txt
+===================================================================
+--- netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d.orig/cli/CMakeLists.txt
++++ netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/cli/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ cmake_minimum_required(VERSION 2.6)
+ # include custom Modules
+-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../CMakeModules/")
++set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
+ project(netopeer2-cli C)
+ include(GNUInstallDirs)
+@@ -83,7 +83,7 @@ endif()
+ install(FILES ${PROJECT_SOURCE_DIR}/doc/${PROJECT_NAME}.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+ # clean cmake cache
+-add_custom_target(cleancache
++add_custom_target(cleancache_cli
+                   COMMAND make clean
+                   COMMAND find . -iname '*cmake*' -not -name CMakeLists.txt -exec rm -rf {} +
+                   COMMAND rm -rf Makefile Doxyfile
+Index: netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/keystored/CMakeLists.txt
+===================================================================
+--- netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d.orig/keystored/CMakeLists.txt
++++ netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/keystored/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ cmake_minimum_required(VERSION 2.6)
+ # include custom Modules
+-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../CMakeModules/")
++set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
+ project(keystored C)
+ include(GNUInstallDirs)
+Index: netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/server/CMakeLists.txt
+===================================================================
+--- netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d.orig/server/CMakeLists.txt
++++ netopeer2-0.4.13-ae560bef2e70d274f6d028b59e3cb398ea2a621d/server/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ cmake_minimum_required(VERSION 2.8.9)
+ # include custom Modules
+-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../CMakeModules/")
++set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
+ project(netopeer2-server C)
+ include(GNUInstallDirs)
index f50b7e8ddb61ecec4abae5c9781c813a6e439014..5f15333949e1009065f29e60a542867c1be3f29a 100644 (file)
@@ -14,7 +14,7 @@ PKG_LICENSE:=Custom
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.netperf.org/netperf/
-PKG_MD5SUM:=ad1c5342d61f297c417a93133aeba65a
+PKG_HASH:=842af17655835c8be7203808c3393e6cb327a8067f3ed1f1053eb78b4e40375a
 
 include $(INCLUDE_DIR)/package.mk
 
index e58c6eb444ab5852a89f7f1ed1280844c5f8ed2a..06f78f7e90af143bf8f81faff1b87042e321edf5 100644 (file)
@@ -7,9 +7,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nfs-kernel-server
-PKG_VERSION:=2.1.1
+PKG_VERSION:=2.3.1
 PKG_RELEASE:=1
-PKG_MD5SUM:=1157abcfaa8670f990f408cf280426b4
+PKG_HASH:=ca92f1ab86b2af4dcd62d7716d46a6cdec268e83fe8d564cd8ff1464cc495989
 
 PKG_SOURCE_URL:=@SF/nfs
 PKG_SOURCE:=nfs-utils-$(PKG_VERSION).tar.bz2
@@ -86,6 +86,7 @@ CONFIGURE_ARGS += \
 
 CONFIGURE_VARS += \
        libblkid_cv_is_recent=yes \
+       ac_cv_lib_resolv___res_querydomain=yes \
        CONFIG_SQLITE3_TRUE="\#" \
        CONFIG_NFSDCLD_TRUE="\#"
 
index efe565c5b4290775a8e7fc208dbfae2fe0e9c050..8e926e1eb1065031ca8c688614e9dcd55115a8e7 100644 (file)
@@ -1,11 +1,9 @@
 Musl will always return something with getservbyport so we cannot skip
 ports that returns non-null.
 
-diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c
-index fd576d9..d72a0bf 100644
 --- a/utils/statd/rmtcall.c
 +++ b/utils/statd/rmtcall.c
-@@ -90,8 +90,10 @@ statd_get_socket(void)
+@@ -93,8 +93,10 @@ statd_get_socket(void)
                                        __func__);
                        break;
                }
@@ -14,5 +12,5 @@ index fd576d9..d72a0bf 100644
                if (se == NULL)
 +#endif
                        break;
-               /* rather not use that port, try again */
  
+               if (retries == MAX_BRP_RETRIES) {
diff --git a/net/nfs-kernel-server/patches/102-limits.patch b/net/nfs-kernel-server/patches/102-limits.patch
new file mode 100644 (file)
index 0000000..67701c3
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/support/misc/file.c
++++ b/support/misc/file.c
+@@ -27,6 +27,7 @@
+ #include <dirent.h>
+ #include <stdlib.h>
+ #include <stdbool.h>
++#include <limits.h>
+ #include "xlog.h"
+ #include "misc.h"
index bf6b834c2989a0fa48e38250eb7923bc70aeebf6..4cec04026e21e756937e16b40e5f41068acc01e0 100644 (file)
@@ -66,6 +66,11 @@ config NGINX_HTTP_AUTH_BASIC
        prompt "Enable HTTP auth basic"
        default y
 
+config NGINX_HTTP_AUTH_REQUEST
+       bool
+       prompt "Enable HTTP auth request module"
+       default n
+
 config NGINX_HTTP_AUTOINDEX
        bool
        prompt "Enable HTTP autoindex module"
@@ -167,6 +172,11 @@ config NGINX_HTTP_CACHE
        prompt "Enable HTTP cache"
        default y
 
+config NGINX_HTTP_V2
+       bool
+       prompt "Enable HTTP_V2 module"
+       default n
+
 config NGINX_PCRE
        bool
        prompt "Enable PCRE library usage"
@@ -182,4 +192,14 @@ config NGINX_LUA
        prompt "Enable Lua module"
        default n
 
+config NGINX_HTTP_REAL_IP
+       bool
+       prompt "Enable HTTP real ip module"
+       default n
+
+config NGINX_HTTP_SECURE_LINK
+       bool
+       prompt "Enable HTTP secure link module"
+       default n
+
 endmenu
index 5ebdaa51d5cd761fcb60814c8bee5cb04af6a067..d018514aa2c9556472bb76f19b5a11c9a15bdff1 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nginx
-PKG_VERSION:=1.10.2
+PKG_VERSION:=1.12.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://nginx.org/download/
-PKG_MD5SUM:=e8f5f4beed041e63eb97f9f4f55f3085
+PKG_HASH:=305f379da1d5fb5aefa79e45c829852ca6983c7cd2a79328f8e084a324cf0416
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=2-clause BSD-like license
 
@@ -33,6 +33,7 @@ PKG_CONFIG_DEPENDS := \
        CONFIG_NGINX_HTTP_USERID \
        CONFIG_NGINX_HTTP_ACCESS \
        CONFIG_NGINX_HTTP_AUTH_BASIC \
+       CONFIG_NGINX_HTTP_AUTH_REQUEST \
        CONFIG_NGINX_HTTP_AUTOINDEX \
        CONFIG_NGINX_HTTP_GEO \
        CONFIG_NGINX_HTTP_MAP \
@@ -54,9 +55,12 @@ PKG_CONFIG_DEPENDS := \
        CONFIG_NGINX_HTTP_UPSTREAM_KEEPALIVE \
        CONFIG_NGINX_HTTP_UPSTREAM_ZONE \
        CONFIG_NGINX_HTTP_CACHE \
+       CONFIG_NGINX_HTTP_V2 \
        CONFIG_NGINX_PCRE \
        CONFIG_NGINX_NAXSI \
-       CONFIG_NGINX_LUA
+       CONFIG_NGINX_LUA \
+       CONFIG_NGINX_HTTP_REAL_IP \
+       CONFIG_NGINX_HTTP_SECURE_LINK
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -133,6 +137,9 @@ endif
 ifneq ($(CONFIG_NGINX_HTTP_AUTH_BASIC),y)
   ADDITIONAL_MODULES += --without-http_auth_basic_module
 endif
+ifeq ($(CONFIG_NGINX_HTTP_AUTH_REQUEST),y)
+  ADDITIONAL_MODULES += --with-http_auth_request_module
+endif
 ifneq ($(CONFIG_NGINX_HTTP_AUTOINDEX),y)
   ADDITIONAL_MODULES += --without-http_autoindex_module
 endif
@@ -192,6 +199,15 @@ endif
 ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_KEEPALIVE),y)
   ADDITIONAL_MODULES += --without-http_upstream_keepalive_module
 endif
+ifeq ($(CONFIG_NGINX_HTTP_V2),y)
+  ADDITIONAL_MODULES += --with-http_v2_module
+endif
+ifeq ($(CONFIG_NGINX_HTTP_REAL_IP),y)
+  ADDITIONAL_MODULES += --with-http_realip_module
+endif
+ifeq ($(CONFIG_NGINX_HTTP_SECURE_LINK),y)
+  ADDITIONAL_MODULES += --with-http_secure_link_module
+endif
 
 TARGET_CFLAGS += -fvisibility=hidden -ffunction-sections -fdata-sections -DNGX_LUA_NO_BY_LUA_BLOCK
 TARGET_LDFLAGS += -Wl,--gc-sections
@@ -254,7 +270,7 @@ define  Prepare/nginx-naxsi
 endef
 
 define Download/lua-nginx
-       VERSION:=1967998b0eedab1ff51bff8fafa5fc3db47976aa
+       VERSION:=cdd2ae921f67bf396c743406493127be496e57ce
        SUBDIR:=lua-nginx
        FILE:=lua-nginx-module-$(PKG_VERSION)-$$(VERSION).tar.gz
        URL:=https://github.com/openresty/lua-nginx-module.git
index 36d7aaff49b69913aabbd1033b7e5100839601e0..8a0e88200bf12374dd187ed41a8ca76a961b3fd0 100644 (file)
@@ -10,7 +10,7 @@
 +      'Y', '3', 'p', 'M', '\n'
 +};
 +
- int main() {
+ int main(void) {
 -    printf("%d", (int) sizeof($ngx_type));
 +    printf("dummy use of object_code_block to avoid gc-section: %c", object_code_block[0]);
      return 0;
index 3778609caf7ac5b1983df7ccbddf5757dd3aa206..052862a6d9c9529a461e8f26f91447a0fddb80b7 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ngircd
-PKG_VERSION:=23
+PKG_VERSION:=24
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Claudio Leite <leitec@staticky.com>
 PKG_LICENSE:=GPL-2.0
@@ -18,7 +18,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= \
         http://ngircd.barton.de/pub/ngircd/ \
         ftp://ftp.berlios.de/pub/ngircd/
-PKG_MD5SUM:=a58e0075fea60176fa7df092ca7e2c6a
+PKG_HASH:=3e00a7da52c81fc1e02bb996a27bf43da905ba7037bf8c6bb3bd13321e0c85ab
 
 PKG_INSTALL:=1
 
diff --git a/net/nlbwmon/Makefile b/net/nlbwmon/Makefile
new file mode 100644 (file)
index 0000000..c8ce443
--- /dev/null
@@ -0,0 +1,48 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nlbwmon
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/jow-/nlbwmon.git
+PKG_SOURCE_DATE:=2017-12-05
+PKG_SOURCE_VERSION:=75accd647459a8a4167f9baa402d116cad41caa9
+PKG_MIRROR_HASH:=821572fdd11bba4a62ecea0b0ddee24645d2ceccdfe7a83dfe5f5edea433ef02
+
+CMAKE_INSTALL:=1
+
+PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
+PKG_LICENSE:=ISC
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+CMAKE_OPTIONS += -DLIBNL_LIBRARY_TINY=ON
+TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
+
+define Package/nlbwmon
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+libubox +libnl-tiny +zlib +kmod-nf-conntrack-netlink
+  TITLE:=LEDE Traffic Usage Monitor
+endef
+
+define Package/nlbwmon/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nlbwmon $(1)/usr/sbin/nlbwmon
+       $(LN) nlbwmon $(1)/usr/sbin/nlbw
+       $(INSTALL_DIR) $(1)/usr/share/nlbwmon
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/protocols.txt $(1)/usr/share/nlbwmon/protocols
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/nlbwmon.init $(1)/etc/init.d/nlbwmon
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/nlbwmon.config $(1)/etc/config/nlbwmon
+endef
+
+define Package/nlbwmon/conffiles
+/usr/share/nlbwmon/protocols
+endef
+
+
+$(eval $(call BuildPackage,nlbwmon))
diff --git a/net/nlbwmon/files/nlbwmon.config b/net/nlbwmon/files/nlbwmon.config
new file mode 100644 (file)
index 0000000..3b15396
--- /dev/null
@@ -0,0 +1,51 @@
+config nlbwmon
+       # Interval at which the temporary in-memory database is committed to
+       # the persistent database directory
+       option commit_interval 24h
+
+       # Interval at which traffic counters of still established connections
+       # are refreshed from netlink information
+       option refresh_interval 30s
+
+       # Storage directory for the database files
+       option database_directory /var/lib/nlbwmon
+
+       # Amount of database generations to retain. If the limit is reached,
+       # the oldest database files are deleted.
+       option database_generations 10
+
+       # Accounting period interval; may be either in the format YYYY-MM-DD/NN
+       # to start a new accounting period exactly every NN days, beginning at
+       # the given date, or a number specifiying the day of month at which to
+       # start the next accounting period.
+       #option database_interval '2017-01-17/14' # every 14 days, starting at Tue
+       #option database_interval '-2' # second last day of month, e.g. 30th in March
+       option database_interval '1' # first day of month (default)
+
+       # The maximum amount of entries that should be put into the database,
+       # setting the limit to 0 will allow databases to grow indefinitely.
+       option database_limit 10000
+
+       # Whether to preallocate the maximum possible database size in memory.
+       # This is mainly useful for memory constrained systems which might not
+       # be able to satisfy memory allocation after longer uptime periods.
+       # Only effective in conjunction with database_limit, ignored otherwise.
+       #option database_prealloc 0
+
+       # Whether to gzip compress archive databases. Compressing the database
+       # files makes accessing old data slightly slower but helps to reduce
+       # storage requirements.
+       #option database_compress 1
+
+       # Protocol description file, used to distinguish traffic streams by
+       # IP protocol number and port
+       option protocol_database /usr/share/nlbwmon/protocols
+
+       # List of local subnets. Only conntrack streams from or to any of these
+       # subnets are counted. Logical interface names may be specified to
+       # resolve the local subnets on the fly.
+       list local_network '192.168.0.0/16'
+       list local_network '172.16.0.0/12'
+       list local_network '10.0.0.0/8'
+       list local_network 'lan'
+
diff --git a/net/nlbwmon/files/nlbwmon.init b/net/nlbwmon/files/nlbwmon.init
new file mode 100755 (executable)
index 0000000..3f01d0f
--- /dev/null
@@ -0,0 +1,89 @@
+#!/bin/sh /etc/rc.common
+
+START=60
+
+USE_PROCD=1
+NAME=nlbwmon
+PROG=/usr/sbin/nlbwmon
+
+add_subnet() {
+       local network="$1"
+       local range ranges
+
+       case "$network" in
+               *.*|*:*)
+                       procd_append_param command '-s' "$network"
+               ;;
+               *)
+                       if network_get_subnets ranges "$network"; then
+                               for range in $ranges; do
+                                       procd_append_param command '-s' "$range"
+                               done
+                       fi
+
+                       if network_get_subnets6 ranges "$network"; then
+                               for range in $ranges; do
+                                       procd_append_param command '-s' "$range"
+                               done
+                       fi
+               ;;
+       esac
+}
+
+add_option() {
+       local cfg="$1"
+       local flag="$2"
+       local option="$3"
+       local default="$4"
+       local value
+
+       config_get value "$cfg" "$option" "$default"
+       [ -n "$value" ] && procd_append_param command "$flag" "$value"
+}
+
+add_bool() {
+       local cfg="$1"
+       local flag="$2"
+       local option="$3"
+       local default="$4"
+       local value
+
+       config_get_bool value "$cfg" "$option" "$default"
+       [ $value -eq 1 ] && procd_append_param command "$flag"
+}
+
+parse_config() {
+       . /lib/functions/network.sh
+
+       local cfg="$1"
+       local dir
+
+       config_get dir "$cfg" database_directory /var/lib/nlbwmon
+
+       mkdir -p "$dir"
+       procd_append_param command -o "$dir"
+
+       add_option "$cfg" -i commit_interval 24h
+       add_option "$cfg" -r refresh_interval 30s
+       add_option "$cfg" -p protocol_database /usr/share/nlbwmon/protocols
+       add_option "$cfg" -G database_generations 10
+       add_option "$cfg" -I database_interval 1
+       add_option "$cfg" -L database_limit 10000
+
+       add_bool "$cfg" -P database_prealloc 0
+       add_bool "$cfg" -Z database_compress 1
+
+       config_list_foreach "$cfg" local_network add_subnet
+}
+
+start_service() {
+       procd_open_instance
+       procd_set_param stderr 1
+       procd_set_param command "$PROG"
+
+       config_load nlbwmon
+       config_foreach parse_config nlbwmon
+
+       procd_close_instance
+}
+
index 6fa208b5cf8b375694bc70007339237056edde52..064e33f7210874cf8e8e7425762470374d48229e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2016 OpenWrt.org
+# 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:=nmap
-PKG_VERSION:=7.31
+PKG_VERSION:=7.60
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://nmap.org/dist/
-PKG_MD5SUM:=f2f6660142a777862342a58cc54258ea
+PKG_SOURCE_URL:=https://nmap.org/dist/
+PKG_HASH:=a8796ecc4fa6c38aad6139d9515dc8113023a82e9d787e5a5fb5fa1b05516f21
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
@@ -29,7 +29,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSI
 
 include $(INCLUDE_DIR)/package.mk
 
-NMAP_DEPENDS:=+libpcap +libstdcpp
+NMAP_DEPENDS:=+libpcap +libstdcpp +zlib +libpcre
 NCAT_DEPENDS:=+libpcap
 NPING_DEPENDS:=+libpcap +libpthread +libstdcpp
 NDIFF_DEPENDS:=+python
@@ -85,7 +85,7 @@ endef
 
 CONFIGURE_ARGS += \
        --with-libdnet=included \
-       --with-libpcre=included \
+       --with-libpcre="$(STAGING_DIR)/usr" \
        --with-libpcap="$(STAGING_DIR)/usr" \
        --without-liblua \
        --without-zenmap
@@ -95,7 +95,7 @@ CONFIGURE_VARS += \
        CXXFLAGS="$$$$CXXFLAGS -fno-builtin"
 
 ifeq ($(BUILD_VARIANT),ssl)
-       CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr"
+       CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" --without-libssh2
 else
        CONFIGURE_ARGS += --without-openssl
 endif
diff --git a/net/nmap/patches/001-fix-missing-includes.patch b/net/nmap/patches/001-fix-missing-includes.patch
deleted file mode 100644 (file)
index 3985bad..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/ncat/ncat_ssl.c b/ncat/ncat_ssl.c
-index ee8ca97..9ff495c 100644
---- a/ncat/ncat_ssl.c
-+++ b/ncat/ncat_ssl.c
-@@ -128,7 +128,9 @@
- #include <stdio.h>
- #include <openssl/ssl.h>
-+#include <openssl/bn.h>
- #include <openssl/err.h>
-+#include <openssl/rsa.h>
- #include <openssl/rand.h>
- #include <openssl/x509.h>
- #include <openssl/x509v3.h>
diff --git a/net/noddos/Makefile b/net/noddos/Makefile
new file mode 100644 (file)
index 0000000..a69c9fb
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2017 Steven Hessing
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+# Name and release number of this package
+PKG_NAME:=noddos
+PKG_RELEASE:=1
+PKG_LICENSE:=GPLv3
+PKG_MAINTAINER:=Steven Hessing <steven.hessing@gmail.com>
+
+PKG_SOURCE_VERSION:=0.5.5
+PKG_SOURCE_URL:=https://github.com/noddos/noddos/releases/download/v$(PKG_SOURCE_VERSION)/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_HASH:=1f5be0c1015b0407036eecc8449d60d2abcacec442bba55db85fc32e89f754db
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+
+CMAKE_INSTALL:=1
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/noddos
+       SECTION:=net
+       CATEGORY:=Network
+       TITLE:=noddos -- device-aware cloud-powered firewall
+       URL:=https://www.noddos.io/
+       DEPENDS:=+libstdcpp +libnetfilter-conntrack +libcurl +libopenssl +openssl-util +ca-bundle +ca-certificates +wget +bzip2 +libtins +ipset +libpthread +libyaml-cpp
+endef
+
+define Package/noddos/description
+Noddos discovers what devices you have in your network and tailors the firewall rules based on whitelisted flows for that device. Noddos downloads the firewall rules periodically from the cloud. In order to support creating these firewall rules, noddos can, after opt-in, upload anonimized traffic statistics for each device to the cloud. The Luci interface is available in the luci-apps-noddos package. For information, visit https://www.noddos.io/
+endef
+
+define Package/noddos/conffiles
+       /etc/config/noddos
+endef
+
+define Package/noddos/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_DIR) $(1)/etc/noddos
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/noddos $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/getnoddosdeviceprofiles $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/makenoddoscert.sh $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/noddos.init $(1)/etc/init.d/noddos
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/noddos.uciconfig $(1)/etc/config/noddos
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/noddos.yml-base $(1)/etc/noddos
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/noddosconfig.pem $(1)/etc/noddos
+endef
+
+define Package/noddos/prerm
+       #!/bin/sh
+       # check if we are on real system
+       if [ -z "$${IPKG_INSTROOT}" ]; then
+               /etc/init.d/noddos stop
+               echo "Removing rc.d symlink for noddos"
+               /etc/init.d/noddos disable
+       fi
+       exit 0
+endef
+
+define Package/noddos/postrm
+       #!/bin/sh
+       # check if we are on real system
+       if [ -z "$${IPKG_INSTROOT}" ]; then
+               echo "Removing noddos data directory"
+               rm -rf /var/lib/noddos
+               if [ -f /var/etc/noddos.yml ]; then
+                       rm /var/etc/noddos.yml
+               fi
+       fi
+       exit 0
+endef
+
+$(eval $(call BuildPackage,noddos))
index b8bd8f9c876f3356e3b0eaca523cd188eb71ba4b..334ba8726c12b6d8a226908031945bdc68bf75e5 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.nlnetlabs.nl/downloads/nsd
-PKG_MD5SUM:=a3f2a9885bc8664ba4a25c938d26a587
+PKG_HASH:=c45cd4ba2101a027e133b2be44db9378e27602e05f09a5ef25019e1ae45291af
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
index bca4b65fcea4da0d38e4f1461345e741227e68a2..460307e56edf684cd9fde6e0ae8c684ab9e2c599 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://doolittle.icarus.com/ntpclient/
-PKG_MD5SUM:=a64689398f2df8933ee0d8da246e9eaa
+PKG_HASH:=9ad9b028385082fb804167f464e2db0a0b3d33780acd399327e64898b8fcfddd
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
index f1e57ad4ffa74ed40015651b749ba5d4e7a00131..807e68d8e6a429814a678b706e0f909f54b55010 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ntp
-PKG_VERSION:=4.2.8p9
-PKG_RELEASE:=2
+PKG_VERSION:=4.2.8p11
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/
-PKG_HASH:=b724287778e1bac625b447327c9851eedef020517a3545625e9f652a90f30b72
+PKG_HASH:=f14a39f753688252d683ff907035ffff106ba8d3db21309b742e09b5c3cd278e
 
 PKG_LICENSE:=Unique
 PKG_LICENSE_FILES:=COPYRIGHT html/copyright.html
@@ -42,6 +42,7 @@ endef
 
 define Package/ntpd
 $(call Package/ntpd/Default)
+  DEPENDS+= +ntp-utils
   TITLE+= server
   USERID:=ntp=123:ntp=123
 endef
@@ -86,10 +87,6 @@ $(call Package/ntpd/Default/description)
  This package contains the ntp-keygen.
 endef
 
-define Package/ntpd/conffiles
-/etc/ntp.conf
-endef
-
 CONFIGURE_VARS += \
        ac_cv_header_md5_h=no \
        ac_cv_lib_rt_sched_setscheduler=no \
@@ -116,10 +113,7 @@ define Package/ntpd/install
        $(INSTALL_DIR) $(1)/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpd/ntpd $(1)/sbin/
        $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpq/ntpq $(1)/usr/sbin/
        $(INSTALL_BIN) ./files/ntpd.hotplug-helper $(1)/usr/sbin/
-       $(INSTALL_DIR) $(1)/etc
-       $(INSTALL_CONF) ./files/ntp.conf $(1)/etc/
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/ntpd.init $(1)/etc/init.d/ntpd
        $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
@@ -148,6 +142,7 @@ endef
 define Package/ntp-utils/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdc/ntpdc $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpq/ntpq $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/util/ntptime $(1)/usr/sbin/
 endef
 
diff --git a/net/ntpd/README.md b/net/ntpd/README.md
new file mode 100644 (file)
index 0000000..70e11a6
--- /dev/null
@@ -0,0 +1,86 @@
+# Configuring NTPD with UCI
+
+## Precedent
+Sysntpd is the lightweight implementation of the NTP protocol under
+Busybox.  It supports many (but not all) of the same parameters.
+
+It is configured as a `config timeserver ntp` section in `/etc/config/system`,
+below.
+
+## Configuration
+
+A sample configuration looks like:
+
+**/etc/config/system**:
+
+```
+config timeserver ntp
+       option enabled 1
+       option enable_server 1
+       list server tick.udel.edu
+       list server tock.udel.edu
+       list interface eth0
+       list interface eth1
+       list interface eth2
+```
+
+If you want to temporarily disable the service without deleting all of the
+configuration state, this is done by clearing the `enabled` parameter.  If
+this parameter is `1` (the default), the service is enabled.
+
+The service can run as a stand-alone client (`enable_server 0`, the default)
+or it can also operate as a server in turn to local clients, by setting this
+parameter to `1`.
+
+The parameter(s) `server` enumerate a list of servers to be used for
+reference NTP servers by the local daemon.  At least one is required,
+and two or more are recommended (unless you have an extremely available
+local server).  They should be picked to be geographically divergent,
+and preferrably reachable via different network carriers to protect
+against network partitions, etc.  They should also be high-quality
+time providers (i.e. having stable, accurate clock sources).
+
+The `interface` parameter enumerates the list of interfaces on which
+the server is reachable (see `enable_server 1` above), and may be a
+subset of all of the interfaces present on the system.  For security
+reasons, you may elect to only offer the service on internal networks.
+If omitted, it defaults to _all_ interfaces.
+
+## Differences with `sysntpd`
+
+Busybox `sysntpd` supports configuring servers based on DHCP
+provisioning (option 6, per the [DHCP and BOOTP
+Parameter](https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml)
+list from IANA).  This functionality is enabled (in Busybox) with the
+`use_dhcp` boolean parameter (default `1`), and the `dhcp_interface`
+list parameter, which enumerates the interfaces whose provisioning
+is to be utilized.
+
+### Considerations for DHCP-provisioned NTP servers
+
+Most terrestrial and satellite ISPs have access to very high-quality
+clock sources (these are required to maintain synchronization on T3,
+OC3, etc trunks or earth terminals) but seldom offer access to those
+time sources via NTP in turn to their clients, mostly from a misplaced
+fear that their time source might come under attack (a slave closely
+tied to the master could also provide extremely high-quality time
+without the risk of network desynchronization should it come under
+sophisticated attack).
+
+As a result, the NTP servers that your ISP may point you at are
+often of unknown/unverified quality, and you use them at your own
+risk.
+
+Early millenial versions of Windows (2000, XP, etc) used NTP only
+to _initially set_ the clock to approximately 100ms accuracy (and
+not maintain sychronization), so the bar wasn't set very high.
+Since then, requirements for higher-qualty timekeeping have
+arisen (e.g. multi-master SQL database replication), but most ISPs
+have not kept up with the needs of their users.
+
+Current releases of Windows use Domain Controllers for time
+acquisition via the [NT5DS protocol](https://blogs.msdn.microsoft.com/w32time/2007/07/07/what-is-windows-time-service/)
+when domain joined.
+
+Because of the unreliable quality of NTP servers DHCP-provisioned by
+ISPs, support for this functionality was deemed unnecessary.
diff --git a/net/ntpd/files/ntp.conf b/net/ntpd/files/ntp.conf
deleted file mode 100644 (file)
index 8bfb8e3..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# use a random selection of 4 public stratum 2 servers
-# see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers
-
-#restrict default nomodify notrap noquery
-#restrict default noquery
-
-restrict 127.0.0.1
-
-driftfile  /var/lib/ntp/ntp.drift
-
-server 0.openwrt.pool.ntp.org iburst
-server 1.openwrt.pool.ntp.org iburst
-server 2.openwrt.pool.ntp.org iburst
-server 3.openwrt.pool.ntp.org iburst
-
-
-# GPS(NMEA)+PPS
-#server 127.127.20.0 minpoll 4 prefer
-#fudge 127.127.20.0 flag3 1 flag2 0
-
-# SMA PPS
-#server 127.127.28.0 minpoll 4 prefer
-#fudge 127.127.28.0 refid PPS flag3 1
-
-#server 192.168.1.253
-
index 975be751ec78a189091eaaa7d7c630b09303e5ea..67a4d6aaa35190ee2f0911d03a3673b0922a9e22 100644 (file)
@@ -1,10 +1,10 @@
+#!/bin/sh
+
 NAME=ntpd
-CONFIG=/etc/ntp.conf
-COMMAND=/sbin/$NAME
+COMMAND=/etc/init.d/$NAME
 
 [ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
-        [ -x $COMMAND ] && [ -r $CONFIG ] && {
-               killall ntpd
-               /etc/init.d/ntpd start
-        } &
+       $COMMAND enabled && {
+               $COMMAND restart
+        }
 }
index 555825c64839514e3f15e55e0dc6d995422ed98b..eacf4c55d399c7970e9057d8e62c30c41f38788b 100644 (file)
@@ -1,13 +1,15 @@
 #!/bin/sh
 
+SLEEPTIME=10
+
 while true
 do
        STATUS="$(/usr/sbin/ntpq -c 'rv 0 stratum'|awk -F '=' '{ print $2 }')"
 
-       if [ -n "$STATUS" ] && [ "$STATUS" -lt "16" ]
+       if [[ -n "$STATUS" && "$STATUS" -lt "16" ]]
        then
                ACTION="stratum" /sbin/hotplug-call ntp
-               exit 0
+               SLEEPTIME=660
        fi
-       sleep 10
+       sleep $SLEEPTIME
 done
index 55dd3e84f1eeb132ddd03a9c42c69c0941a5f5d2..0aaf132a4406a198acd6b981658e5ab71a8a2e1e 100644 (file)
@@ -8,12 +8,77 @@ USE_PROCD=1
 PROG=/sbin/ntpd
 HOTPLUG_HELPER=/usr/sbin/ntpd.hotplug-helper
 
+config_file=/var/run/ntpd.conf
+
+trunc() {
+       echo -n "" > $config_file
+}
+
+emit() {
+       echo -e "$@" >> $config_file
+}
+
+validate_ntp_section() {
+       uci_validate_section system timeserver "${1}" \
+               'server:list(host)' 'enabled:bool:1' 'enable_server:bool:0' \
+               'interface:list(string)'
+}
+
 start_service() {
+       local server enabled enable_server interface intf
+
+       validate_ntp_section ntp || {
+               echo "validation failed"
+               return 1
+       }
+
+       [ "$enabled" = 0 ] && return
+
+       [ -z "$server" -a "$enable_server" = 0 ] && return
+
+       # not sure that the interfaces enumerated should be validated,
+       # since some of them might be dynamic interfaces (like IPsec
+       # tunnels) which aren't known by ubus.
+
+       trunc
+       emit "driftfile /var/lib/ntp/ntp.drift\n"
+
+       if [ "$enable_server" != 0 ]; then
+               emit "restrict default limited kod nomodify notrap nopeer"
+               emit "restrict -6 default limited kod nomodify notrap nopeer"
+       else
+               emit "restrict -4 default noserve"
+               emit "restrict -6 default noserve"
+       fi
+       emit "restrict source noquery"
+
+       emit "\n# No limits for local monitoring"
+       emit "restrict 127.0.0.1"
+       emit "restrict -6 ::1\n"
+
+       if [ -n "$interface" ]; then
+               local loopback=$(ubus call network.interface dump | jsonfilter -e "@.interface[@.interface='loopback']['device']")
+
+               local saw_lo=
+               for intf in $interface; do
+                       emit "interface listen $intf"
+                       [ "$intf" = "$loopback" ] && saw_lo=1
+               done
+               [ -z "$saw_lo" ] && emit "interface listen $loopback"
+               emit ""
+       fi
+
+       for i in $server
+       do
+               emit "server $i iburst"
+       done
+
        mkdir -p /var/lib/ntp
        chown -R ntp:ntp /var/lib/ntp
 
        procd_open_instance
-       procd_set_param command $PROG -g -u ntp:ntp -p /var/run/ntpd.pid -n
+       procd_set_param command $PROG -g -u ntp:ntp -p /var/run/ntpd.pid -n \
+               -c $config_file
        procd_close_instance
 
        procd_open_instance
index 7828a25ca49f5c1ebb362233e7df131a7487a126..020f198506ad625bdde200bd1b89b16e173862f3 100644 (file)
@@ -18,6 +18,7 @@ PKG_SOURCE_URL:=https://github.com/nunojpg/ntripcaster.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=03878920195cf854b38a1ea424f1cae57353fa87
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=264656e5f9f9583c477208f005371124bfcbb7ba548f418eb5f1215059d1294b
 
 PKG_LICENSE:=GPL-2.0+
 
index f0d92d58e8aa99ad18035bf4afa58f1eef13bedf..391f625e3f6753db5e0417d205eb44cd37baab88 100644 (file)
@@ -18,6 +18,7 @@ PKG_SOURCE_URL:=https://github.com/nunojpg/ntripclient.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=dcfb2cb3e6f31b7291a94e7f86379c78ffc0d44e
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=8d16f2bd0295a2e77fe8651e5f973c3ca4cf0d62fc4d671ebb54cfa8dc7debd0
 
 PKG_LICENSE:=GPL-2.0+
 
index a3e3cf978c3f66fc51848d8fd13d7b428f6c91fb..62becdb4074c3137890daee00c6f65f41719a038 100644 (file)
@@ -18,6 +18,7 @@ PKG_SOURCE_URL:=https://github.com/nunojpg/ntripserver.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=c3034ab575e8442222eb8c2ee9e224cac99cfa6d
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=71f168c4b41c9e1063280fc8aa21d8794c064708fbfa4929093ef5a139e2e736
 
 PKG_LICENSE:=GPL-2.0+
 
index b48102f34f131568bfada501da6b75d46b0f8b62..b7f403b782012f7a422ed6dc4b8e56c257e51029 100644 (file)
@@ -1,77 +1,3 @@
-       config NUT_SERVER
-               depends on PACKAGE_nut
-               bool "Include server components (upsd)"
-               help
-                       upsd is responsible for serving the data from the drivers to the
-                       clients. It connects to each driver and maintains a local cache of the
-                       current state. Queries from the clients are served from this cache, so
-                       delays are minimal. This program is essential, and must be running at
-                       all times to actually make any use out of the drivers and clients.
-               default y
-               
-       config NUT_CLIENTS_UPSC
-               depends on PACKAGE_nut
-               bool "Include command line client (upsc)"
-               help
-                       upsc is provided as a quick way to poll the status of a UPS server. It
-                       can be used inside shell scripts and other programs that need UPS data
-                       but don't want to include the full interface.
-               default y
-               
-       config NUT_CLIENTS_UPSLOG
-               depends on PACKAGE_nut
-               bool "Include logging client (upslog)"
-               help
-                       upslog is a daemon that will poll a UPS at periodic intervals, fetch the
-                       variables that interest you, format them, and write them to a file.
-               default n
-               
-       config NUT_CLIENTS_UPSCMD
-               depends on PACKAGE_nut
-               bool "Include UPS controller (upscmd)"
-               help
-                       upscmd allows you to invoke "instant commands" in your UPS hardware. Not
-                       all hardware supports this, so check the list with -l to see if anything
-                       will work on your equipment. On hardware that supports it, you can use
-                       this program to start and stop battery tests, invoke a front panel test
-                       (beep!), turn the load on or off, and more.
-               default n
-               
-       config NUT_CLIENTS_UPSRW
-               depends on PACKAGE_nut
-               bool "Include UPS variable editor (upsrw)"
-               help
-                       upsrw allows you to view and change the read/write variables inside your
-                       UPS. It sends commands via the upsd to your driver, which configures the
-                       hardware for you. The list of variables that allow you to change their
-                       values is based on the capabilities of your UPS equipment. Not all
-                       models support this feature. Typically, cheaper hardware does not
-                       support any of them.
-               default n
-               
-       config NUT_CLIENTS_UPSMON
-               depends on PACKAGE_nut
-               bool "Include monitor and shutdown controller (upsmon)"
-               help
-                       upsmon is the client process that is responsible for the most important
-                       part of UPS monitoring--shutting down the system when the power goes
-                       out. It can call out to other helper programs for notification purposes
-                       during power events. upsmon can monitor multiple systems using a single
-                       process. Every UPS that is defined in the upsmon.conf configuration file
-                       is assigned a power value and a type (slave or master).
-               default y
-               
-       config NUT_CLIENTS_UPSSCHED
-               depends on NUT_CLIENTS_UPSMON
-               bool "Include helper for triggering events from upsmon (upssched)"
-               help
-                       upssched was created to allow users to execute programs at times relative
-                       to events being monitored by upsmon. The original purpose was to allow
-                       for a shutdown to occur after some fixed period on battery, but there are
-                       other uses that are possible.
-                       You can alternatively write your own script and save some space.
-               default n
-       
        config NUT_SSL
                depends on PACKAGE_nut
                bool "Build with support for OpenSSL"
                help
                        If you have a UPS you can connect to via SNMP, select this.
                default n
-               
+
+       config NUT_DRIVER_SERIAL
+               depends on PACKAGE_nut
+               bool "Build with suport for serial drivers"
+               help
+                       If you have a UPS connected via serial cable, select this.
+               default n
index a6ed1c647066b7c03ff6ced67cd9a0fcd814f78e..a7c3e7343ae042064257bb944bfeaa22cb7a5cae 100644 (file)
@@ -1,5 +1,5 @@
-#
-# Copyright (C) 2006-2015 OpenWrt.org
+
+# Copyright (C) 2006-2016 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,28 +9,22 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nut
 PKG_VERSION:=2.7.4
-PKG_RELEASE:=2
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.networkupstools.org/source/2.7/
-PKG_MD5SUM:=3ba53656933d7471f95140b32a5b8d5c
-PKG_MAINTAINER:=Martin Rowe <martin.p.rowe@gmail.com>
+PKG_HASH:=980e82918c52d364605c0703a5dcf01f74ad2ef06e3d365949e43b7d406d25a7
+PKG_MAINTAINER:=Daniel Dickinson <lede@cshore.thecshore.com>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=LICENSE-GPL2
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/nut-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL:=1
 
 PKG_CONFIG_DEPENDS:= \
-       CONFIG_NUT_CLIENTS_UPSC \
-       CONFIG_NUT_CLIENTS_UPSCMD \
-       CONFIG_NUT_CLIENTS_UPSLOG \
-       CONFIG_NUT_CLIENTS_UPSMON \
-       CONFIG_NUT_CLIENTS_UPSRW \
-       CONFIG_NUT_CLIENTS_UPSSCHED \
        CONFIG_NUT_DRIVER_SNMP \
        CONFIG_NUT_DRIVER_USB \
-       CONFIG_NUT_SERVER \
+       CONFIG_NUT_DRIVER_SERIAL \
        CONFIG_NUT_SSL
 
 include $(INCLUDE_DIR)/package.mk
@@ -39,10 +33,10 @@ define Package/nut/Default
        SECTION:=net
        CATEGORY:=Network
        URL:=http://www.networkupstools.org/
-       DEPENDS:=nut
+       TITLE:=Network UPS Tools (NUT)
 endef
 
-define Package/nut/description
+define Package/nut/description/Default
 Network UPS Tools (NUT) is a client/server monitoring system that
 allows computers to share uninterruptible power supply (UPS) and
 power distribution unit (PDU) hardware. Clients access the hardware
@@ -52,68 +46,241 @@ endef
 
 define Package/nut
        $(call Package/nut/Default)
-       TITLE:=Network UPS Tools
-       DEPENDS:= \
-               +libpthread \
-               +NUT_DRIVER_SNMP:libnetsnmp \
-               +NUT_DRIVER_USB:libusb-compat \
-               +NUT_SSL:libopenssl
        MENU:=1
 endef
 
+define Package/nut/description
+$(call Package/nut/description/Default)
+endef
+
 define Package/nut/config
        source "$(SOURCE)/Config.in"
 endef
 
-define Package/nut/conffiles
-/etc/nut/nut.conf
-$(if $(CONFIG_NUT_CLIENTS_UPSMON),/etc/nut/upsmon.conf)
-$(if $(CONFIG_NUT_CLIENTS_UPSSCHED),/etc/nut/upssched.conf)
-$(if $(CONFIG_NUT_SERVER),/etc/nut/ups.conf)
-$(if $(CONFIG_NUT_SERVER),/etc/nut/upsd.conf)
-$(if $(CONFIG_NUT_SERVER),/etc/nut/upsd.users)
+define Package/nut/install
+       true
 endef
 
-define Package/nut/install
+define Package/nut-server/install
+       $(INSTALL_DIR) $(1)/etc/nut
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_DIR) $(1)/usr/share/nut
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/nut-server.init $(1)/etc/init.d/nut-server
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsd $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsdrvctl $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/nut/cmdvartab $(1)/usr/share/nut/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/nut/driver.list $(1)/usr/share/nut/
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/nut_server $(1)/etc/config/nut_server
+       ln -sf /var/etc/nut/nut.conf $(1)/etc/nut/nut.conf
+       ln -sf /var/etc/nut/ups.conf $(1)/etc/nut/ups.conf
+       ln -sf /var/etc/nut/upsd.users  $(1)/etc/nut/upsd.users
+       ln -sf /var/etc/nut/upsd.conf $(1)/etc/nut/upsd.conf
+endef
+
+define Package/nut-common
+       $(call Package/nut/Default)
+       TITLE+= (common)
+       DEPENDS:= nut \
+               +NUT_DRIVER_SNMP:libnetsnmp \
+               +NUT_DRIVER_USB:libusb-compat \
+               +NUT_SSL:libopenssl \
+               +PACKAGE_libwrap:libwrap
+endef
+
+define Package/nut-common/description
+$(call Package/nut/description/Default)
+This package contains the common files.
+endef
+
+define Package/nut-common/install
        $(INSTALL_DIR) $(1)/etc/nut
-       $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupsclient.so* $(1)/usr/lib/
+       ln -sf /var/etc/nut/nut.conf $(1)/etc/nut/nut.conf
+endef
+
+define Package/nut-server
+       $(call Package/nut/Default)
+       TITLE+= (server)
+       DEPENDS:=nut +nut-common
+endef
+
+define Package/nut-server/description
+$(call Package/nut/description/Default)
+upsd is responsible for serving the data from the drivers to the
+clients. It connects to each driver and maintains a local cache of the
+current state. Queries from the clients are served from this cache, so
+delays are minimal. This program is essential, and must be running at
+all times to actually make any use out of the drivers and clients.
+endef
+
+define Package/nut-server/conffiles
+/etc/config/nut_server
+endef
+
+define Package/nut-upsmon
+  $(call Package/nut/Default)
+       TITLE+= (monitor)
+       DEPENDS:=nut +nut-common
+       USERID:=nut=113:nut=113
+endef
+
+define Package/nut-upsmon/description
+$(call Package/nut/description/Default)
+upsmon is the client process that is responsible for the most important
+part of UPS monitoring--shutting down the system when the power goes
+out. It can call out to other helper programs for notification purposes
+during power events. upsmon can monitor multiple systems using a single
+process. Every UPS that is defined in the upsmon.conf configuration file
+is assigned a power value and a type (slave or master).
+endef
+
+define Package/nut-upsmon/conffiles
+/etc/config/nut_monitor
+endef
+
+define Package/nut-upsmon/install
+       $(INSTALL_DIR) $(1)/etc/nut
        $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/nut.conf.sample $(1)/etc/nut/nut.conf
-       $(if $(or $(CONFIG_NUT_CLIENTS_UPSC),\
-               $(CONFIG_NUT_CLIENTS_UPSCMD),\
-               $(CONFIG_NUT_CLIENTS_LOG),\
-               $(CONFIG_NUT_CLIENTS_UPSRW),\
-               $(CONFIG_NUT_CLIENTS_UPSMON),\
-               $(CONFIG_NUT_CLIENTS_UPSSCHED)),$(CP) $(PKG_INSTALL_DIR)/usr/lib/libupsclient.so* $(1)/usr/lib/)
-       $(if $(or $(CONFIG_NUT_SERVER),\
-               $(CONFIG_NUT_CLIENTS_UPSMON)),$(INSTALL_DIR) $(1)/etc/init.d)
-       $(if $(CONFIG_NUT_SERVER),$(INSTALL_DIR) $(1)/lib/nut)
-       $(if $(CONFIG_NUT_SERVER),$(INSTALL_DIR) $(1)/usr/share/nut)
-       $(if $(CONFIG_NUT_SERVER),$(CP) ./files/nut-server.init $(1)/etc/init.d/)
-       $(if $(CONFIG_NUT_SERVER),$(CP) $(PKG_INSTALL_DIR)/usr/sbin/upsd $(1)/usr/sbin)
-       $(if $(CONFIG_NUT_SERVER),$(CP) $(PKG_INSTALL_DIR)/usr/sbin/upsdrvctl $(1)/usr/sbin)
-       $(if $(CONFIG_NUT_SERVER),$(CP) $(PKG_INSTALL_DIR)/usr/share/nut/cmdvartab $(1)/usr/share/nut/)
-       $(if $(CONFIG_NUT_SERVER),$(CP) $(PKG_INSTALL_DIR)/usr/share/nut/driver.list $(1)/usr/share/nut/)
-       $(if $(CONFIG_NUT_SERVER),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/ups.conf.sample $(1)/etc/nut/ups.conf)
-       $(if $(CONFIG_NUT_SERVER),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsd.conf.sample $(1)/etc/nut/upsd.conf)
-       $(if $(CONFIG_NUT_SERVER),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsd.users.sample $(1)/etc/nut/upsd.users)
-       $(if $(CONFIG_NUT_CLIENTS_UPSC),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upsc $(1)/usr/bin/)
-       $(if $(CONFIG_NUT_CLIENTS_UPSCMD),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upscmd $(1)/usr/bin/)
-       $(if $(CONFIG_NUT_CLIENTS_UPSLOG),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upslog $(1)/usr/bin/)
-       $(if $(CONFIG_NUT_CLIENTS_UPSRW),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upsrw $(1)/usr/bin/)
-       $(if $(CONFIG_NUT_CLIENTS_UPSMON),$(CP) ./files/nut-monitor.init $(1)/etc/init.d/)
-       $(if $(CONFIG_NUT_CLIENTS_UPSMON),$(CP) $(PKG_INSTALL_DIR)/usr/sbin/upsmon $(1)/usr/sbin/)
-       $(if $(CONFIG_NUT_CLIENTS_UPSMON),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsmon.conf.sample $(1)/etc/nut/upsmon.conf)
-       $(if $(CONFIG_NUT_CLIENTS_UPSSCHED),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upssched-cmd $(1)/usr/bin/)
-       $(if $(CONFIG_NUT_CLIENTS_UPSSCHED),$(CP) $(PKG_INSTALL_DIR)/usr/sbin/upssched $(1)/usr/sbin/)
-       $(if $(CONFIG_NUT_CLIENTS_UPSSCHED),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upssched.conf.sample $(1)/etc/nut/upssched.conf)
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/nut-monitor.init $(1)/etc/init.d/nut-monitor
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsmon $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/nut_monitor $(1)/etc/config/nut_monitor
+       ln -sf /var/etc/nut/upsmon.conf $(1)/etc/nut/upsmon.conf
+endef
+
+define Package/nut-upsmon-sendmail-notify
+       $(call Package/nut/Default)
+       TITLE+= (upsmon with notifications via sendmail)
+       DEPENDS:=nut +nut-upsmon
+       CONFLICTS:=nut-upssched
+endef
+
+define Package/nut-upsmon-sendmail-notify/description
+$(call Package/nut/description/Default)
+upsmon with default notification via sendmail
+endef
+
+define Package/nut-upsmon-sendmail-notify/install
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/uci-defaults
+       $(INSTALL_BIN) ./files/nut-sendmail-notify $(1)/usr/bin/
+       $(INSTALL_DATA) ./files/nut-sendmail-notify.default $(1)/etc/uci-defaults/nut-sendmail-notify
+endef
+
+define Package/nut-upsc
+       $(call Package/nut/Default)
+       TITLE+= (upsc command)
+       DEPENDS:=nut +nut-common
+endef
+
+define Package/nut-upsc/description
+$(call Package/nut/description/Default)
+upsc is provided as a quick way to poll the status of a UPS server. It
+can be used inside shell scripts and other programs that need UPS data
+but don not want to include the full interface.
+endef
+
+define Package/nut-upsc/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upsc $(1)/usr/bin
+endef
+
+define Package/nut-upslog
+       $(call Package/nut/Default)
+       TITLE+= (logging client)
+       DEPENDS:=nut +nut-common
+endef
+
+define Package/nut-upslog/description
+$(call Package/nut/description/Default)
+upslog is a daemon that will poll a UPS at periodic intervals, fetch the
+variables that interest you, format them, and write them to a file.
+endef
+
+define Package/nut-upslog/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upslog $(1)/usr/bin/
+endef
+
+define Package/nut-upscmd
+       $(call Package/nut/Default)
+       TITLE+= (controller)
+       DEPENDS:=nut +nut-common
+endef
+
+define Package/nut-upscmd/description
+$(call Package/nut/description/Default)
+upscmd allows you to invoke "instant commands" in your UPS hardware. Not
+all hardware supports this, so check the list with -l to see if anything
+will work on your equipment. On hardware that supports it, you can use
+this program to start and stop battery tests, invoke a front panel test
+(beep!), turn the load on or off, and more.
+endef
+
+define Package/nut-upscmd/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upscmd $(1)/usr/bin/
+endef
+
+define Package/nut-upsrw
+       $(call Package/nut/Default)
+       TITLE+= (variable editor)
+       DEPENDS:=nut +nut-common
+endef
+
+define Package/nut-upsrw/description
+$(call Package/nut/description/Default)
+upsrw allows you to view and change the read/write variables inside your
+UPS. It sends commands via the upsd to your driver, which configures the
+hardware for you. The list of variables that allow you to change their
+values is based on the capabilities of your UPS equipment. Not all
+models support this feature. Typically, cheaper hardware does not
+support any of them.
+endef
+
+define Package/nut-upsrw/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upsrw $(1)/usr/bin/
+endef
+
+define Package/nut-upssched
+       $(call Package/nut/Default)
+       TITLE+= (helper for triggering events from upsmon)
+       DEPENDS:=nut +nut-common +nut-upsmon
+endef
+
+define Package/nut-upssched/description
+$(call Package/nut/description/Default)
+upssched was created to allow users to execute programs at times relative
+to events being monitored by upsmon. The original purpose was to allow
+for a shutdown to occur after some fixed period on battery, but there are
+other uses that are possible.
+You can alternatively write your own script and save some space.
+endef
+
+define Package/nut-upssched/conffiles
+/etc/nut/upssched.conf
+endef
+
+define Package/nut-upssched/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_DIR) $(1)/etc/nut
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upssched-cmd $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upssched $(1)/usr/sbin/
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upssched.conf.sample $(1)/etc/nut/upssched.conf
+       $(INSTALL_DATA) ./files/nut-sched.default $(1)/etc/uci-defaults/nut-upssched
 endef
 
 define Package/nut-web-cgi
        $(call Package/nut/Default)
        TITLE+= Web CGI interface
-       DEPENDS+=+libgd
+       DEPENDS:=nut +nut-common +libgd
 endef
 
 define Package/nut-web-cgi/description
@@ -127,23 +294,31 @@ define Package/nut-web-cgi/conffiles
 /etc/nut/upsset.conf
 /etc/nut/upsstats.html
 /etc/nut/upsstats-single.html
+/etc/config/nut_cgi
+/etc/httpd.conf
 endef
 
 define Package/nut-web-cgi/install
+       $(INSTALL_DIR) $(1)/www/cgi-bin/nut $(1)/www/nut
        $(INSTALL_DIR) $(1)/etc/nut
-       $(INSTALL_DIR) $(1)/usr/share/www/cgi-bin
-       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/hosts.conf.sample $(1)/etc/nut/hosts.conf
-       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsset.conf.sample $(1)/etc/nut/upsset.conf
+       $(CP) $(PKG_INSTALL_DIR)/usr/html/* $(1)/www/nut/
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/cgi-bin/* $(1)/www/cgi-bin/nut
+       $(INSTALL_CONF) ./files/add_nut_httpd_conf $(1)/etc/uci-defaults/add_nut_httpd_conf
        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats.html.sample $(1)/etc/nut/upsstats.html
        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats-single.html.sample $(1)/etc/nut/upsstats-single.html
-       $(CP) $(PKG_INSTALL_DIR)/usr/share/www/nut $(1)/usr/share/www/
-       $(CP) $(PKG_INSTALL_DIR)/usr/share/www/cgi-bin/nut $(1)/usr/share/www/cgi-bin/
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsset.conf.sample $(1)/etc/nut/upsset.conf
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/nut_cgi $(1)/etc/config/nut_cgi
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/nut-cgi.init $(1)/etc/init.d/nut-cgi
+       ln -sf /var/etc/nut/hosts.conf $(1)/etc/nut/hosts.conf
 endef
 
 define Package/nut-avahi-service
        $(call Package/nut/Default)
        TITLE+= (Avahi service)
-       DEPENDS+=+avahi-daemon
+       DEPENDS:=nut +avahi-daemon
 endef
 
 define Package/nut-avahi-service/description
@@ -166,8 +341,10 @@ define DriverPackage
         define Package/nut-driver-$(2)
                $(call Package/nut/Default)
                TITLE:=$(2) (NUT $(1) driver)
+               DEPENDS:=nut +nut-common
                $(if $(filter $(1),snmp),DEPENDS+= @NUT_DRIVER_SNMP)
                $(if $(filter $(1),usb),DEPENDS+= @NUT_DRIVER_USB)
+               $(if $(filter $(1),serial),DEPENDS+= @NUT_DRIVER_SERIAL)
         endef
        # Deliberately empty description in order to trigger a build failure.
        # It should be overridden by the list below, and when updating to a
@@ -323,17 +500,17 @@ CONFIGURE_ARGS += \
        --$(if $(CONFIG_NUT_DRIVER_USB),with,without)-usb \
        --without-avahi \
        --$(if $(CONFIG_NUT_DRIVER_SNMP),with,without)-snmp \
+       --$(if $(CONFIG_NUT_DRIVER_SERIAL),with,without)-serial \
        --without-neon \
        --without-powerman \
+       --without-wrap \
+       --with-cgi \
        --without-ipmi \
        --without-freeipmi \
        --$(if $(CONFIG_NUT_SSL),with,without)-ssl $(if $(CONFIG_NUT_SSL),--with-openssl) \
        --without-libltdl \
-       --$(if $(CONFIG_PACKAGE_nut-web-cgi),with,without)-cgi \
-       --with-statepath=/var/run \
+       --with-statepath=/var/run/nut \
        --with-drvpath=/lib/nut \
-       --with-cgipath=/usr/share/www/cgi-bin/nut \
-       --with-htmlpath=/usr/share/www/nut \
        --with-user=root \
        --with-group=root
 
@@ -345,6 +522,15 @@ define Build/InstallDev
 endef
 
 $(eval $(call BuildPackage,nut))
+$(eval $(call BuildPackage,nut-common))
+$(eval $(call BuildPackage,nut-server))
+$(eval $(call BuildPackage,nut-upsmon))
+$(eval $(call BuildPackage,nut-upsmon-sendmail-notify))
+$(eval $(call BuildPackage,nut-upsc))
+$(eval $(call BuildPackage,nut-upscmd))
+$(eval $(call BuildPackage,nut-upslog))
+$(eval $(call BuildPackage,nut-upsrw))
+$(eval $(call BuildPackage,nut-upssched))
 $(eval $(call BuildPackage,nut-web-cgi))
 $(eval $(call BuildPackage,nut-avahi-service))
 $(foreach d,$(filter-out $(SERIAL_DRIVERLIST_IGNORE),$(SERIAL_DRIVERLIST)),$(eval $(call BuildPackage,nut-driver-$(d))))
diff --git a/net/nut/files/add_nut_httpd_conf b/net/nut/files/add_nut_httpd_conf
new file mode 100644 (file)
index 0000000..b8fa847
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+grep -q '/cgi-bin/nut' /etc/httpd.conf 2>/dev/null || {
+       echo '/cgi-bin/nut:root:$p$root' >>/etc/httpd.conf
+       /etc/init.d/uhttpd restart
+}
diff --git a/net/nut/files/nut-cgi.init b/net/nut/files/nut-cgi.init
new file mode 100755 (executable)
index 0000000..d63d98b
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh /etc/rc.common
+# Copyright © 2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+START=51
+
+DEFAULT=/etc/default/nut
+UPSCGI_C=/var/etc/nut/hosts.conf
+
+nut_upscgi_add() {
+       local cfg="$1"
+       local upsname
+       local hostname
+       local port
+       local displayname
+
+       config_get upsname "$cfg" upsname
+       config_get hostname "$cfg" hostname localhost
+       config_get port "$cfg" port
+       config_get pass "$cfg" password
+       system="$upsname@$hostname"
+       if [ -n "$port" ]; then
+           system="$system:$port";
+       fi
+       config_get displayname "$cfg" displayname
+       echo "MONITOR $system \"$displayname\"" >> $UPSCGI_C
+}
+
+start() {
+       rm -f $UPSCGI_C
+
+       config_load nut_cgi
+
+       config_foreach nut_upscgi_add host
+
+       chmod 640 /var/etc/nut/hosts.conf
+}
+
+stop() {
+       rm -f $UPSCGI_C
+}
+
index e9fdb336d79d274b6dc4f51ec9fbbf4b364a168e..388c376ee9e5d048942470db900926a253b80ca6 100755 (executable)
 
 START=60
 USE_PROCD=1
+UPSMON_C=/var/etc/nut/upsmon.conf
 
-restart() {
-       stop_service
-       start_service
+nut_upsmon_conf() {
+       local cfg="$1"
+
+       echo "# Config file automatically generated from UCI config" > $UPSMON_C
+
+       config_get runas "$cfg" runas "nut"
+       [ -n "$runas" ] && echo "RUN_AS_USER $runas" >> $UPSMON_C
+
+       config_get val "$cfg" minsupplies 1
+       echo "MINSUPPLIES $val" >> $UPSMON_C
+
+       config_get val "$cfg" shutdowncmd "/sbin/halt"
+       echo "SHUTDOWNCMD \"$val\"" >> $UPSMON_C
+
+       config_get val "$cfg" notifycmd
+       [ -n "$val" ] && echo "NOTIFYCMD \"$val\"" >> $UPSMON_C
+
+       config_get val "$cfg" pollfreq 5
+       echo "POLLFREQ $val" >> $UPSMON_C
+
+       config_get val "$cfg" pollfreqalert 5
+       echo "POLLFREQALERT $val" >> $UPSMON_C
+
+       config_get val "$cfg" hostsync 15
+       echo "HOSTSYNC $val" >> $UPSMON_C
+
+       config_get val "$cfg" deadtime 15
+       echo "DEADTIME $val" >> $UPSMON_C
+
+       config_get val "$cfg" powerdownflag /var/run/killpower
+       echo "POWERDOWNFLAG $val" >> $UPSMON_C
+
+       config_get val "$cfg" onlinemsg
+       [ -n "$val" ] && echo "NOTIFYMSG ONLINE \"$val\"" >> $UPSMON_C
+       config_get val "$cfg" onbattmsg
+       [ -n "$val" ] && echo "NOTIFYMSG ONBATT \"$val\"" >> $UPSMON_C
+       config_get val "$cfg" lowbattmsg
+       [ -n "$val" ] && echo "NOTIFYMSG LOWBATT \"$val\"" >> $UPSMON_C
+       config_get val "$cfg" fsdmsg
+       [ -n "$val" ] && echo "NOTIFYMSG FSD \"$val\"" >> $UPSMON_C
+       config_get val "$cfg" commokmsg
+       [ -n "$val" ] && echo "NOTIFYMSG COMMOK \"$val\"" >> $UPSMON_C
+       config_get val "$cfg" commbadmsg
+       [ -n "$val" ] && echo "NOTIFYMSG COMMBAD \"$val\"" >> $UPSMON_C
+       config_get val "$cfg" shutdownmsg
+       [ -n "$val" ] && echo "NOTIFYMSG SHUTDOWN \"$val\"" >> $UPSMON_C
+       config_get val "$cfg" replbattmsg
+       [ -n "$val" ] && echo "NOTIFYMSG REPLBATT \"$val\"" >> $UPSMON_C
+       config_get val "$cfg" nocommmsg
+       [ -n "$val" ] && echo "NOTIFYMSG NOCOMM \"$val\"" >> $UPSMON_C
+       config_get val "$cfg" noparentmsg
+       [ -n "$val" ] && echo "NOTIFYMSG NOPARENT \"$val\"" >> $UPSMON_C
+
+       notifylist() {
+               local value="$1"
+               append optval "$value" "+"
+       }
+
+       setnotify() {
+               local cfg="$1"
+               local optname="$2"
+               local optval
+               config_list_foreach "$cfg" "$optname" notifylist
+               if [ -z "$optval" ]; then
+                       # If no list fallback to trying option, fallback to default
+                       config_get optval "$cfg" "$optname" "$default"
+                       if [ -n "$optval" ]; then
+                               echo "$optval"
+                       else
+                               # No default, so do the NUT default
+                               echo "SYSLOG"
+                       fi
+               else
+                       echo "$optval"
+               fi
+        }
+
+       local default optval
+       val=""
+       config_list_foreach "$cfg" defaultnotify notifylist
+       default="$optval"
+       echo "NOTIFYFLAG ONLINE $(setnotify "$cfg" onlinenotify)" >> $UPSMON_C
+       echo "NOTIFYFLAG ONBATT $(setnotify "$cfg" onbattnotify)" >> $UPSMON_C
+       echo "NOTIFYFLAG LOWBATT $(setnotify "$cfg" lowbatnotify)" >> $UPSMON_C
+       echo "NOTIFYFLAG FSD $(setnotify "$cfg" fsdnotify)" >> $UPSMON_C
+       echo "NOTIFYFLAG COMMOK $(setnotify "$cfg" commoknotify)" >> $UPSMON_C
+       echo "NOTIFYFLAG COMMBAD $(setnotify "$cfg" commbadnotify)" >> $UPSMON_C
+       echo "NOTIFYFLAG SHUTDOWN $(setnotify "$cfg" shutdownnotify)" >> $UPSMON_C
+       echo "NOTIFYFLAG REPLBATT $(setnotify "$cfg" repolbattnotify)" >> $UPSMON_C
+       echo "NOTIFYFLAG NOCOMM $(setnotify "$cfg" nocommnotify)" >> $UPSMON_C
+       echo "NOTIFYFLAG NOPARENT $(setnotify "$cfg" noparentnotify)" >> $UPSMON_C
+
+       config_get val "$cfg" rbwarntime 43200
+       echo "RBWARNTIME $val" >> $UPSMON_C
+
+       config_get val "$cfg" nocommwarntime 300
+       echo "NOCOMMWARNTIME $val" >> $UPSMON_C
+
+       config_get val "$cfg" finaldelay 5
+       echo "FINALDELAY $val" >> $UPSMON_C
+
+       config_get val "$cfg" certpath
+       if [ -n "$val" ]; then echo "CERTPATH $val" >> $UPSMON_C; fi
+
+       config_get_bool val "$cfg" certverify 0
+       if [ -n "$val" ]; then echo "CERTVERIFY $val" >> $UPSMON_C; fi
+
+       config_get_bool val "$cfg" forcessl 0
+       if [ -n "$val" ]; then echo "FORCESSL $val" >> $UPSMON_C; fi
+}
+
+nut_upsmon_add() {
+       local cfg="$1"
+       local type="$2"
+       local upsname
+       local hostname
+       local port
+       local powervalue
+       local username
+       local password
+       local system
+
+       # If no core config, use defaults
+       [ -r $UPSMON_C ] || nut_upsmon_conf ""
+
+       config_get upsname "$cfg" upsname
+       config_get hostname "$cfg" hostname localhost
+       config_get port "$cfg" port
+       config_get powervalue "$cfg" powervalue 1
+       config_get username "$cfg" username
+       config_get password "$cfg" password
+       system="$upsname@$hostname"
+       if [ -n "$port" ]; then
+           system="$system:$port";
+       fi
+       echo "MONITOR $system $powervalue $username $password $type" >> $UPSMON_C
 }
 
 start_service() {
-       upsmon -p
+       rm -f $UPSMON_C
+
+       config_load nut_monitor
+
+       config_foreach nut_upsmon_conf upsmon
+       config_foreach nut_upsmon_add master master
+       config_foreach nut_upsmon_add slave slave
+
+       [ -z "$(cat /var/etc/nut/nut.conf)" ] && echo "MODE=netclient" >>/var/etc/nut/nut.conf
+
+       chmod 640 $UPSMON_C
+       chmod 640 /var/etc/nut/nut.conf
+
+       [ -d /var/run/nut ] || {
+               mkdir -m 0750 -p /var/run/nut
+               chown ${runas:-root}:$(id -gn ${runas:-root}) /var/run/nut
+       }
+
+       chown ${runas:-root}:$(id -gn ${runas:-root}) $UPSMON_C
+       $DEBUG /usr/sbin/upsmon $UPSMON_OPTIONS
 }
 
 stop_service() {
-       upsmon -c stop
+       [ -r $PID_F ] && /usr/sbin/upsmon -c stop
+       rm -f $UPSMON_C
 }
 
 reload_service() {
diff --git a/net/nut/files/nut-sched.default b/net/nut/files/nut-sched.default
new file mode 100644 (file)
index 0000000..d8b13f0
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+uci batch <<EOF
+set nut_monitor.@upsmon[-1]=upsmon
+set nut_monitor.@upsmon[-1].notifycmd=/usr/bin/upssched-cmd
+set nut_monitor.@upsmon[-1].defaultnotify="SYSLOG EXEC"
+commit nut_monitor
+EOF
+
+
diff --git a/net/nut/files/nut-sendmail-notify b/net/nut/files/nut-sendmail-notify
new file mode 100755 (executable)
index 0000000..749aa9b
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+/usr/sbin/sendmail root <<EOF
+From: root
+To: root
+Subject: UPS $NOTIFYTYPE Notification
+
+$1
+.
+EOF
diff --git a/net/nut/files/nut-sendmail-notify.default b/net/nut/files/nut-sendmail-notify.default
new file mode 100644 (file)
index 0000000..54ea909
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+. /lib/functions.sh
+
+REMOVEDEFAULTNOTIFY=0
+SKIPADDSYSLOG=0
+SKIPADDEXEC=0
+
+upsmon() {
+       local cfg="$1"
+       local val
+
+       config_get val "$cfg" defaultnotify
+       if [ -n "$val" ]; then
+               if echo "$val" |grep -q "IGNORE"; then
+                       REMOVEDEFAULTNOTIFY=1
+               else
+                       SKIPADDSYSLOG=1
+                       if echo "$val" |grep -q "EXEC"; then
+                               SKIPADDEXEC=1
+                       fi
+               fi
+       fi
+}
+
+config_load nut_monitor
+config_foreach upsmon upsmon
+
+uci set nut_monitor.@upsmon[-1]=upsmon
+uci set nut_monitor.@upsmon[-1].notifycmd=/usr/bin/nut-sendmail-notify
+
+if [ "$REMOVEDEFAULTNOTIFY" = "1" ]; then
+       uci delete nut_monitor.@upsmon[-1].defaultnotify || true
+fi
+
+if [ "$SKIPADDEXEC" != "1" ]; then
+       uci add_list nut_monitor.@upsmon[-1].defaultnotify="EXEC"
+fi
+
+if [ "$SKIPADDSYSLOG" != "1" ]; then
+       uci add_list nut_monitor.@upsmon[-1].defaultnotify="SYSLOG"
+fi
+
+uci commit nut_monitor
index f9971be444379020855b47acab1dd80db5c37a34..e064dd721358bb31681fca75f8ccb4146e31e9a6 100755 (executable)
 #!/bin/sh /etc/rc.common
-
+# Copyright © 2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
 START=50
+
+RUN_D=/var/run
+PID_F=$RUN_D/upsd.pid
+UPS_C=/var/etc/nut/ups.conf
+USERS_C=/var/etc/nut/upsd.users
+UPSD_C=/var/etc/nut/upsd.conf
+
 USE_PROCD=1
 
-restart() {
-       stop_service
-       start_service
+listen_address() {
+    local cfg="$1"
+
+    config_get address "$cfg" address "::1"
+    config_get port "$cfg" port
+    echo "LISTEN $address $port" >>$UPSD_C
+}
+
+upsd_statepath() {
+    local cfg="$1"
+    config_get statepath "$cfg" statepath
+}
+
+upsd_config() {
+    local cfg="$1"
+    local maxage maxconn certfile
+
+    # Note runas support requires you make sure USB device file is readable by
+    # the runas user
+    config_get runas "$cfg" runas
+
+    config_get maxage "$cfg" maxage
+    [ -n "$maxage" ] && echo "MAXAGE $maxage" >>$UPSD_C
+
+    config_get statepath "$cfg" statepath
+    [ -n "$statepath" ] && echo "STATEPATH $statepath" >>$UPSD_C
+
+    config_get maxconn "$cfg" maxconn
+    [ -n "$maxconn" ] && echo "MAXCONN $maxconn" >>$UPSD_C
+
+    #NOTE: certs only apply to SSL-enabled version
+    config_get certfile "$cfg" certfile
+    [ -n "$certfile" ] && echo "CERTFILE $certfile" >>$UPSD_C
+}
+
+nut_user_add() {
+       local cfg="$1"
+       local a
+       local val
+
+       config_get val "$cfg" username "$1"
+       echo "[$val]" >> $USERS_C
+
+       config_get val "$cfg" password
+       echo "  password = $val" >> $USERS_C
+
+       config_get val "$cfg" actions
+       for a in $val; do
+           echo "  actions = $a" >> $USERS_C
+       done
+
+       instcmd() {
+               local val="$1"
+               echo "  instcmds = $val" >> $USERS_C
+       }
+
+       config_list_foreach "$cfg" instcmd instcmd
+
+       config_get val "$cfg" upsmon
+       if [ -n "$val" ]; then
+           echo "  upsmon $val" >> $USERS_C
+       fi
 }
 
 start_service() {
-       upsdrvctl start
-       upsd
+       local runas statepath
+
+        mkdir -p /var/etc/nut
+       chmod -R 750 /var/etc/nut
+
+       rm -f $UPSD_C
+       rm -f $USERS_C
+       rm -f $UPSD_C
+       rm -f /var/etc/nut/nut.conf
+
+       echo "# Config file automatically generated from UCI config" > $UPS_C
+       echo "# Config file automatically generated from UCI config" > $USERS_C
+       echo "# Config file automatically generated from UCI config" > $UPSD_C
+
+        local in_driver have_drivers
+       config_cb() {
+           if [ "$1" != "driver" ]; then
+               in_driver=
+           else
+               echo "[$2]" >> $UPS_C
+               in_driver=true
+               have_drivers=true
+           fi
+       }
+       option_cb() {
+           if [ "$in_driver" = "true" ]; then
+               echo " $1 = $2" >> $UPS_C
+           fi
+       }
+
+       config_load nut_server
+
+       config_foreach nut_user_add user
+       config_foreach upsd_config upsd
+       config_foreach listen_address listen_address
+
+       echo "MODE=netserver" >>/var/etc/nut/nut.conf
+
+       chmod 0640 $USERS_C
+       chmod 0640 $UPS_C
+       chmod 0640 $UPSD_C
+       chmod 0640 /var/etc/nut/nut.conf
+       [ -d "${statepath:-/var/run/nut}" ] || {
+               mkdir -m 0750 -p "${statepath:-/var/run/nut}"
+               chown $runas:$(id -gn $runas) "${statepath:-/var/run/nut}"
+       }
+
+       if [ -n "$runas" ]; then
+               chown -R $runas:$(id -gn $runas) /var/etc/nut
+       fi
+
+       if [ "$have_drivers" = "true" ]; then
+           $DEBUG /usr/sbin/upsd ${runas:+-u $runas} $OPTIONS
+           $DEBUG /usr/sbin/upsdrvctl ${runas:+-u $runas} start
+       fi
+}
+
+
+nut_driver_stop() {
+       local cfg="$1"
+       local driver
+
+       config_get driver "$cfg" driver
+
+       [ -r ${statepath:-/var/run/nut}/$driver-$cfg ] && /usr/sbin/upsdrvctl stop $cfg
 }
 
 stop_service() {
-       upsd -c stop
-       upsdrvctl stop
+       [ -r $PID_F ] && /usr/sbin/upsd -c stop
+       config_load ups
+       config_foreach upsd_statepath upsd
+       config_foreach nut_driver_stop driver
 }
 
 reload_service() {
diff --git a/net/nut/files/nut_cgi b/net/nut/files/nut_cgi
new file mode 100644 (file)
index 0000000..9f0bed6
--- /dev/null
@@ -0,0 +1,6 @@
+#config host
+#      option upsname upsname
+#      option hostname localhost
+#      option port # optional port number
+#      option displayname "Display Name"
+
diff --git a/net/nut/files/nut_monitor b/net/nut/files/nut_monitor
new file mode 100644 (file)
index 0000000..0b71e95
--- /dev/null
@@ -0,0 +1,54 @@
+#config upsmon 'upsmon'
+#      option runas run-as-user
+#      option minsupplies 1
+#      option shutdowncmd /sbin/halt
+#      option notifycmd /path/to/cmd
+#      list defaultnotify SYSLOG
+#      option pollfreq 5
+#      option pollfreqalert 5
+#      option hostsync 15
+#      option deadtime 15
+#      option powerdownflags /var/run/killpower
+#      option onlinemsg "online message"
+#      option onbattmsg "on battery message"
+#      option lowbattmsg "low battery message"
+#      option fsdmsg "forced shutdown message"
+#      option comokmsg "communications restored message"
+#      option combadmsg "communications bad message"
+#      option shutdowmsg "shutdown message"
+#      option replbattmsg "replace battery message"
+#      option nocommmsg "no communications message"
+#      option noparentmsg "no parent message"
+#      option onlinenotify "online notify flag 1|0"
+#      option onbattnotify "on battery notify flag 1|0"
+#      option lowbattnotify "low battery notify flag 1|0"
+#      option fsdnotify "forced shutdown notify flag 1|0"
+#      option comoknotify "communications restored notify flag 1|0"
+#      option combadnotify "communications bad notify flag 1|0"
+#      option shutdownotify "shutdown notify flag 1|0"
+#      option replbattnotify "replace battery notify flag 1|0"
+#      option nocommnotify "no communications notify flag 1|0"
+#      option noparentnotify "no parent notify flag 1|0"
+#      option rbwarntime 4200 # replace battery warn time
+#      option nocommwarntime 300 # no communications warn time
+#      option finaldelay 5 # final delay
+#      option certpath /path/to/ca/dir
+#      option certverify 0
+#      option forcessl 0
+
+#config master
+#      option upsname upsname
+#      option hostname localhost
+#      option port # optional port number
+#      option powervalue 1
+#      option username upsuser
+#      option password upspassword
+
+#config slave
+#      option upsname upsname
+#      option hostname localhost
+#      option port # optional port number
+#      option powervalue 1
+#      option username upsuser
+#      option password upspassword
+
diff --git a/net/nut/files/nut_server b/net/nut/files/nut_server
new file mode 100644 (file)
index 0000000..bebd169
--- /dev/null
@@ -0,0 +1,23 @@
+#config driver 'upsname'
+#      option driver usbhid-ups
+#      option port auto
+#      option other other-value
+#      option runas root
+
+#config user
+#      option username upsuser
+#      option password upspassword
+#      option actions optional-action
+#      list instcmd optional-instant-command
+#      option upsmon slave|master
+
+#config listen_address
+#      option address ::1
+#      option port 3493
+
+#config upsd 'upsd'
+#      option maxage 15
+#      option statepath /var/run/nut
+#      option maxconn 1024
+# NB: certificates only apply to SSL-enabled version
+#       option certfile /usr/local/etc/upsd.pem
index 51facf5bcd899d61380e753abc428f04a043ab53..fbf308e412b728af5bbb58a1e686dc2ebbe8b8e7 100644 (file)
@@ -13,14 +13,14 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://pypi.python.org/packages/source/o/obfsproxy
-PKG_MD5SUM:=f596aeeda7bf03cdf0e78e68e6e7ac9f
+PKG_HASH:=1e26c2faef1cfcf856ddf60e9647058a7c78fb0d47f05b58a0f847ed7cc41a66
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/obfsproxy
        SECTION:=net
index a5767f704abb2e804da741f5925a0a5a6d06faba..7e4ee679dd4281144f89f0204c397cc04882affc 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ocserv
-PKG_VERSION:=0.11.8
+PKG_VERSION:=0.11.11
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
 
 PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/ocserv/
-PKG_HASH:=735b9b88a004d5bc8a91d4093d07ea0e2c9fac370a35d84beccc394ed24420c7
+PKG_HASH:=4d7b663f10d840b6dfc216e13f287defc28195394fa9f80fad578186105fabf8
 
 PKG_LICENSE:=GPLv2+
 PKG_LICENSE_FILES:=COPYING
@@ -44,12 +44,12 @@ define Package/ocserv
 endef
 
 define Package/ocserv/description
- OpenConnect server (ocserv) is an SSL VPN server. Its purpose is to be 
+ OpenConnect server (ocserv) is an SSL VPN server. Its purpose is to be
  a secure, small, fast and configurable VPN server. It implements the
  OpenConnect SSL VPN protocol, and has also (currently experimental)
  compatibility with clients using the AnyConnect SSL VPN protocol. The
  OpenConnect VPN protocol uses the standard IETF security protocols such
- as TLS 1.2, and Datagram TLS to provide the secure VPN service. 
+ as TLS 1.2, and Datagram TLS to provide the secure VPN service.
 endef
 
 EXTRA_CPPFLAGS+=-I$(STAGING_DIR)/usr/include/readline/
index a3b7692deeefdfca4a5f9bf344840f55893b56d0..7b3ad33ec7aa11f624b6527bc7266dfa625c7db2 100644 (file)
@@ -50,7 +50,7 @@ max-same-clients = |MAX_SAME|
 
 # TCP and UDP port number
 tcp-port = |PORT|
-|UDP|udp-port = |PORT|
+|UDP|udp-port = |UDP_PORT|
 
 # Stats report time. The number of seconds after which each
 # worker process will report its usage statistics (number of
old mode 100644 (file)
new mode 100755 (executable)
index bce9339..489ec89
@@ -3,6 +3,8 @@
 START=50
 USE_PROCD=1
 
+. $IPKG_INSTROOT/lib/functions/network.sh
+
 setup_config() {
        config_get port         $1 port "4443"
        config_get max_clients  $1 max_clients "8"
@@ -11,6 +13,7 @@ setup_config() {
        config_get predictable_ips  $1 predictable_ips "1"
        config_get compression  $1 compression "0"
        config_get udp          $1 udp "1"
+       config_get udp_port     $1 udp_port ""
        config_get auth         $1 auth "plain"
        config_get cisco_compat $1 cisco_compat "1"
        config_get ipaddr       $1 ipaddr ""
@@ -33,26 +36,26 @@ setup_config() {
                                uci set dhcp.lan.start=100
                                uci set dhcp.lan.limit=91
                        fi
-                       ip=$(uci get network.lan.ipaddr)
+                       network_get_ipaddr ip lan
                        ipaddr="$(echo $ip|cut -d . -f1,2,3).192"
                        netmask="255.255.255.192"
-                       uci set ocserv.config.ipaddr="$ipaddr"
-                       uci set ocserv.config.netmask="$netmask"
-                       uci commit
                fi
 
                if test -z "$ip6addr";then
-                       ip6addr=$(uci get network.lan.ip6addr 2>/dev/null)
-                       test -n "$ip6addr" && uci set ocserv.config.ip6addr="$ip6addr"
-                       uci commit
+                       network_get_ipaddr6 ip6addr lan
+                       # Append ipv6 prefix
+                       test -n "$ip6addr" && ip6addr="$ip6addr/96"
                fi
 
                ping_leases=1
-               test -n "$ipaddr" && sysctl -w "net.ipv4.conf.$(uci get network.lan.ifname).proxy_arp"=1 >/dev/null
-               test -n "$ip6addr" && sysctl -w "net.ipv6.conf.$(uci get network.lan.ifname).proxy_ndp"=1 >/dev/null
+               local ifname
+               if network_get_device ifname lan; then
+                       test -n "$ipaddr" && sysctl -w "net.ipv4.conf.$ifname.proxy_arp"=1 >/dev/null
+                       test -n "$ip6addr" && sysctl -w "net.ipv6.conf.$ifname.proxy_ndp"=1 >/dev/null
+               fi
        else
-               test "$ipaddr" = "" && ipaddr="192.168.100.0"
-               test "$netmask" = "" && ipaddr="255.255.255.0"
+               test -z "$ipaddr" && ipaddr="192.168.100.0"
+               test -z "$netmask" && netmask="255.255.255.0"
        fi
 
        enable_default_domain="#"
@@ -69,6 +72,7 @@ setup_config() {
        test $split_dns = "1" && enable_split_dns=""
        test $compression = "1" && enable_compression=""
 
+       test -z $udp_port && udp_port="$port"
        test -z $default_domain && default_domain=$(uci get dhcp.@dnsmasq[0].domain)
        test -n $default_domain && enable_default_domain=""
        test -z $ip6addr && enable_ipv6="#"
@@ -81,6 +85,7 @@ setup_config() {
 
        mkdir -p /var/etc
        sed -e "s/|PORT|/$port/g" \
+           -e "s/|UDP_PORT|/$udp_port/g" \
            -e "s/|MAX_CLIENTS|/$max_clients/g" \
            -e "s/|MAX_SAME|/$max_same/g" \
            -e "s/|DPD|/$dpd/g" \
@@ -147,7 +152,7 @@ start_service() {
        [ -f /etc/config/ocserv-dir/ca-key.pem ] && mv /etc/config/ocserv-dir/ca-key.pem /etc/ocserv/ca-key.pem
        [ -f /etc/config/ocserv-dir/ca.pem ] && mv /etc/config/ocserv-dir/ca.pem /etc/ocserv/ca.pem
        [ -f /etc/config/ocserv-dir/server-key.pem ] && mv /etc/config/ocserv-dir/server-key.pem /etc/ocserv/server-key.pem
-       [ -f /etc/config/ocserv-dir/server-cert.pem ] && mv /etc/config/ocserv-dir/server-cert.pem /etc/ocserv/server-cert.pem 
+       [ -f /etc/config/ocserv-dir/server-cert.pem ] && mv /etc/config/ocserv-dir/server-cert.pem /etc/ocserv/server-cert.pem
        [ -d /etc/config/ocserv-dir ] && rmdir /etc/config/ocserv-dir
 
        [ ! -f /etc/ocserv/ca-key.pem ] && [ -x /usr/bin/certtool ] && {
diff --git a/net/ola/Makefile b/net/ola/Makefile
new file mode 100644 (file)
index 0000000..eca389d
--- /dev/null
@@ -0,0 +1,116 @@
+#
+# Copyright (C) 2006-2015 OpenWrt.org
+# Copyright (C) 2015-2017 Christian Beier <dontmind@freeshell.org>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ola
+PKG_VERSION:=0.10.5
+PKG_RELEASE:=2
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/OpenLightingProject/ola.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=32db3c49d435398d017c6b5c0b25e02a7a831f5c
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=11ed6540bd667c1662d91de93a260a9a63a98725851f768647e2b9b2efe1ae34
+PKG_LICENSE:=LGPL-2.1+
+
+PKG_FIXUP:=libtool
+PKG_INSTALL:=1
+
+PKG_BUILD_PARALLEL:=1
+PKG_USE_MIPS16:=0
+
+HOST_BUILD_DEPENDS:=protobuf/host
+PKG_BUILD_DEPENDS:=ola/host
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ola
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Open Lighting Architecture Daemon
+  URL:=https://www.openlighting.org/
+  MAINTAINER:=Christian Beier <dontmind@freeshell.org>
+  DEPENDS:=+protobuf +libusb-1.0 +libuuid +libstdcpp +libpthread +librt +zlib +libncurses +liblo
+endef
+
+define Package/ola/description
+  OLA (Open Lighting Architecture) is a framework that allows applications to
+  send and receive DMX512, using various hardware devices and 'DMX over IP'
+  protocols. It enables software controllers talk to DMX hardware.
+endef
+
+CONFIGURE_ARGS += \
+       --disable-dependency-tracking \
+       --disable-static \
+       --disable-fatal-warnings \
+       --disable-unittests \
+       --disable-http \
+       --without-dns-sd \
+        --with-ola-protoc-plugin=$(HOST_BUILD_DIR)/protoc/ola_protoc_plugin
+
+HOST_CONFIGURE_ARGS += \
+       --disable-all-plugins \
+       --disable-slp \
+       --disable-osc \
+       --disable-uart \
+       --disable-libusb \
+       --disable-libftdi \
+       --disable-http  \
+       --disable-examples \
+       --disable-unittests \
+       --disable-doxygen-html \
+       --disable-doxygen-doc
+
+# only build the ola_protoc thingy
+define Host/Compile
+       cd $(HOST_BUILD_DIR); \
+               $(MAKE) protoc/ola_protoc_plugin
+endef
+
+# nothing to install for host part
+define Host/Install
+endef
+
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/ola $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/olad $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+define Package/ola/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
+
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/olad.init $(1)/etc/init.d/olad
+
+       $(INSTALL_DIR) $(1)/usr/share/ola/pids
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/ola/pids/* $(1)/usr/share/ola/pids
+endef
+
+define Package/ola/postinst
+#!/bin/sh
+
+# make sure the conf dir exists and is writeable by the group olad uses
+mkdir -p $${IPKG_INSTROOT}/etc/ola
+chgrp nogroup $${IPKG_INSTROOT}/etc/ola
+chmod 775 $${IPKG_INSTROOT}/etc/ola
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,ola))
diff --git a/net/ola/files/olad.init b/net/ola/files/olad.init
new file mode 100644 (file)
index 0000000..e99239e
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2009-2015 OpenWrt.org
+# Copyright (C) 2015 Christian Beier <dontmind@freeshell.org>
+
+USE_PROCD=1
+
+START=90
+
+start_service() {
+       procd_open_instance
+       procd_set_param user nobody
+       procd_set_param command /usr/bin/olad --syslog --log-level 2 --config-dir /etc/ola
+       procd_set_param respawn
+       procd_close_instance
+}
diff --git a/net/ola/patches/001-Eliminate-protobuf-AddDescriptors-call.patch b/net/ola/patches/001-Eliminate-protobuf-AddDescriptors-call.patch
new file mode 100644 (file)
index 0000000..a7ac379
--- /dev/null
@@ -0,0 +1,91 @@
+From d7f13fdc516ffa36b16b89e7f398a8a36b4188d9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christoph=20M=C3=BCllner?= <christophm30@gmail.com>
+Date: Sat, 2 Dec 2017 00:08:55 +0100
+Subject: [PATCH 1/6] Eliminate protobuf AddDescriptors() call.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Eliminating protobuf's AddDescriptors() calls enabled
+forward-compatibility with libprotobuf. That allows to
+run OLA on recent Linux distrubutions.
+
+Tested on x86_64 running Fedora 27 with protobuf 3.3.1
+in combination with QLC+ and a uDMX controller.
+
+See #1192.
+
+Signed-off-by: Christoph Müllner <christophm30@gmail.com>
+---
+ config/ola.m4               | 3 ---
+ protoc/CppFileGenerator.cpp | 8 --------
+ protoc/GeneratorHelpers.cpp | 5 -----
+ protoc/GeneratorHelpers.h   | 3 ---
+ 4 files changed, 19 deletions(-)
+
+diff --git a/config/ola.m4 b/config/ola.m4
+index 6080932e9..d3b8cc8f8 100644
+--- a/config/ola.m4
++++ b/config/ola.m4
+@@ -24,9 +24,6 @@ AC_DEFUN([PROTOBUF_SUPPORT],
+ AC_REQUIRE_CPP()
+ PKG_CHECK_MODULES(libprotobuf, [protobuf >= $1])
+-PKG_CHECK_MODULES(libprotobuf2, [protobuf < 3.2], [],
+-                  [AC_MSG_ERROR([OLA currently requires protobuf < 3.2, see issue 1192])])
+-
+ AC_SUBST([libprotobuf_CFLAGS])
+ AC_ARG_WITH([protoc],
+diff --git a/protoc/CppFileGenerator.cpp b/protoc/CppFileGenerator.cpp
+index 518c17879..e7dd95ccb 100644
+--- a/protoc/CppFileGenerator.cpp
++++ b/protoc/CppFileGenerator.cpp
+@@ -196,14 +196,6 @@ void FileGenerator::GenerateBuildDescriptors(Printer* printer) {
+       "assigndescriptorsname", GlobalAssignDescriptorsName(m_output_name));
+     printer->Indent();
+-    // Make sure the file has found its way into the pool.  If a descriptor
+-    // is requested *during* static init then AddDescriptors() may not have
+-    // been called yet, so we call it manually.  Note that it's fine if
+-    // AddDescriptors() is called multiple times.
+-    printer->Print(
+-      "$adddescriptorsname$();\n",
+-      "adddescriptorsname", GlobalAddDescriptorsName(m_file->name()));
+-
+     // Get the file's descriptor from the pool.
+     printer->Print(
+       "const ::google::protobuf::FileDescriptor* file =\n"
+diff --git a/protoc/GeneratorHelpers.cpp b/protoc/GeneratorHelpers.cpp
+index 19609181e..6f619b5c0 100644
+--- a/protoc/GeneratorHelpers.cpp
++++ b/protoc/GeneratorHelpers.cpp
+@@ -104,11 +104,6 @@ string FilenameIdentifier(const string& filename) {
+   return result;
+ }
+-// Return the name of the AddDescriptors() function for a given file.
+-string GlobalAddDescriptorsName(const string& filename) {
+-  return "protobuf_AddDesc_" + FilenameIdentifier(filename);
+-}
+-
+ // Return the name of the AssignDescriptors() function for a given file.
+ string GlobalAssignDescriptorsName(const string& filename) {
+   return "protobuf_AssignDesc_" + FilenameIdentifier(filename);
+diff --git a/protoc/GeneratorHelpers.h b/protoc/GeneratorHelpers.h
+index 35efdbb04..fa91a915d 100644
+--- a/protoc/GeneratorHelpers.h
++++ b/protoc/GeneratorHelpers.h
+@@ -67,9 +67,6 @@ string StripProto(const string& filename);
+ // Convert a file name into a valid identifier.
+ string FilenameIdentifier(const string& filename);
+-// Return the name of the AddDescriptors() function for a given file.
+-string GlobalAddDescriptorsName(const string& filename);
+-
+ // Return the name of the AssignDescriptors() function for a given file.
+ string GlobalAssignDescriptorsName(const string& filename);
+-- 
+2.11.0
+
diff --git a/net/ola/patches/002-remove-visibility-inlines-hidden-flag.patch b/net/ola/patches/002-remove-visibility-inlines-hidden-flag.patch
new file mode 100644 (file)
index 0000000..fe1acdf
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/Makefile.am b/Makefile.am
+index 22647be..7dcf0de 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -32,7 +32,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = --enable-python-libs
+ COMMON_CXXFLAGS_ONLY_WARNINGS = \
+     -I$(top_srcdir)/include \
+     -I$(top_builddir)/include \
+-    -Wall -Wformat -W -fvisibility-inlines-hidden \
++    -Wall -Wformat -W \
+     $(libprotobuf_CFLAGS)
+ COMMON_CXXFLAGS = $(COMMON_CXXFLAGS_ONLY_WARNINGS)
diff --git a/net/openconnect/Config.in b/net/openconnect/Config.in
new file mode 100644 (file)
index 0000000..d73bd3a
--- /dev/null
@@ -0,0 +1,21 @@
+# openconnect avanced configuration
+
+menu "Configuration"
+       depends on PACKAGE_openconnect
+
+choice
+       prompt "SSL library"
+       default OPENCONNECT_GNUTLS
+
+config OPENCONNECT_GNUTLS
+       bool "GnuTLS support"
+
+config OPENCONNECT_OPENSSL
+       bool "OpenSSL"
+
+endchoice
+
+config OPENCONNECT_STOKEN
+       bool "stoken support"
+
+endmenu
diff --git a/net/openconnect/Makefile b/net/openconnect/Makefile
new file mode 100644 (file)
index 0000000..a0e6c66
--- /dev/null
@@ -0,0 +1,81 @@
+#
+# Copyright (C) 2006-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:=openconnect
+PKG_VERSION:=7.08
+PKG_RELEASE:=8
+PKG_USE_MIPS16:=0
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/openconnect/
+PKG_HASH:=1c44ec1f37a6a025d1ca726b9555649417f1d31a46f747922b84099ace628a03
+PKG_LICENSE:=LGPLv2.1+
+
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_OPENCONNECT_GNUTLS \
+       CONFIG_OPENCONNECT_OPENSSL \
+
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/openconnect/config
+       source "$(SOURCE)/Config.in"
+endef
+
+define Package/openconnect
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+libxml2 +kmod-tun +resolveip +vpnc-scripts +OPENCONNECT_OPENSSL:libopenssl +OPENCONNECT_OPENSSL:p11-kit +OPENCONNECT_OPENSSL:libp11 +OPENCONNECT_GNUTLS:libgnutls +OPENCONNECT_STOKEN:libstoken
+  TITLE:=OpenConnect VPN client (Cisco AnyConnect and Juniper/Pulse compatible)
+  MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
+  URL:=http://www.infradead.org/openconnect/
+  SUBMENU:=VPN
+endef
+
+define Package/openconnect/description
+       A VPN client compatible with Cisco's AnyConnect SSL VPN, ocserv and Juniper (Pulse secure).
+
+        OpenConnect is a client that follows the Cisco's AnyConnect SSL VPN protocol,
+        which is supported by IOS 12.4(9)T or later on Cisco SR500, 870, 880, 1800,
+        2800, 3800, 7200 Series and Cisco 7301 Routers, as well as the OpenConnect
+        VPN server. It has later been ported to support the Juniper SSL VPN which
+        is now known as Pulse Connect Secure.
+endef
+
+CONFIGURE_ARGS += \
+       --disable-shared \
+       --with-vpnc-script=/lib/netifd/vpnc-script \
+       --without-libpcsclite \
+       --without-stoken \
+       --without-libpskc \
+       --without-gssapi \
+       --without-lz4
+
+ifeq ($(CONFIG_OPENCONNECT_OPENSSL),y)
+CONFIGURE_ARGS += \
+       --without-gnutls
+endif
+
+ifeq ($(CONFIG_OPENCONNECT_STOKEN),y)
+CONFIGURE_ARGS += \
+       --with-stoken
+endif
+
+define Package/openconnect/install
+       $(INSTALL_DIR) $(1)/etc/openconnect/
+       $(INSTALL_DIR) $(1)/lib/netifd/proto
+       $(INSTALL_BIN) ./files/openconnect.sh $(1)/lib/netifd/proto/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/openconnect $(1)/usr/sbin/
+       $(INSTALL_BIN) ./files/openconnect-wrapper $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
+       $(INSTALL_DATA) ./files/openconnect.upgrade $(1)/lib/upgrade/keep.d/openconnect
+endef
+
+$(eval $(call BuildPackage,openconnect))
diff --git a/net/openconnect/README b/net/openconnect/README
new file mode 100644 (file)
index 0000000..019058c
--- /dev/null
@@ -0,0 +1,49 @@
+The openconnect client expects to be configured using the uci interface.
+
+To setup a VPN connection, add the following to /etc/config/network:
+
+config interface 'MYVPN'
+       option proto 'openconnect'
+       option interface 'wan'
+       option server 'vpn.example.com'
+       option port '4443'
+       option username 'test'
+       option password 'secret'
+       option serverhash 'AE7FF6A0426F0A0CD0A02EB9EC3C5066FAEB0B25'
+       option defaultroute '0'
+       option authgroup 'DEFAULT'
+
+       # For second factor auth:
+
+       # when a fixed 2FA password can be used
+       #option password2 'my-fixed-2fa-password'
+
+       # RSA tokens, must be built with stoken support
+       #option token_mode 'rsa'
+       #option token_secret 'secret'
+
+       # HOTP/TOTP tokens
+       #option token_mode 'hotp'
+       #option token_secret '00'
+
+       # tokens from script
+       #option token_mode 'script'
+       #option token_script '/lib/custom/getocpass.sh'
+
+       # Juniper vpn support
+       #option juniper '1'
+
+The additional files are also used:
+/etc/openconnect/user-cert-vpn-MYVPN.pem: The user certificate
+/etc/openconnect/user-key-vpn-MYVPN.pem: The user private key
+/etc/openconnect/ca-vpn-MYVPN.pem: The CA certificate (instead of serverhash)
+
+After these are setup you can initiate the VPN using "ifup MYVPN", and
+deinitialize it using ifdown. You may also use the luci web interface
+(Network -> Interfaces -> MYVPN Connect).
+
+Note that you need to configure the firewall to allow communication between
+the MYVPN interface and lan.
+
+There is a luci plugin to allow configuring an openconnect interface from
+the web environment; see the luci-proto-openconnect package.
diff --git a/net/openconnect/files/openconnect-wrapper b/net/openconnect/files/openconnect-wrapper
new file mode 100755 (executable)
index 0000000..8a4ff78
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# This script wraps openconnect in order to obtain the password
+# file from cmd.
+
+# $1 password file
+# $2... are passed to openconnect
+
+test -z "$1" && exit 1
+
+pwfile=$1
+shift
+exec /usr/sbin/openconnect "$@" <$pwfile
diff --git a/net/openconnect/files/openconnect.sh b/net/openconnect/files/openconnect.sh
new file mode 100755 (executable)
index 0000000..dc1d42b
--- /dev/null
@@ -0,0 +1,111 @@
+#!/bin/sh
+. /lib/functions.sh
+. ../netifd-proto.sh
+init_proto "$@"
+
+proto_openconnect_init_config() {
+       proto_config_add_string "server"
+       proto_config_add_int "port"
+       proto_config_add_int "mtu"
+       proto_config_add_int "juniper"
+       proto_config_add_string "interface"
+       proto_config_add_string "username"
+       proto_config_add_string "serverhash"
+       proto_config_add_string "authgroup"
+       proto_config_add_string "password"
+       proto_config_add_string "password2"
+       proto_config_add_string "token_mode"
+       proto_config_add_string "token_secret"
+       proto_config_add_string "token_script"
+       proto_config_add_string "os"
+       proto_config_add_string "csd_wrapper"
+       no_device=1
+       available=1
+}
+
+proto_openconnect_setup() {
+       local config="$1"
+
+       json_get_vars server port interface username serverhash authgroup password password2 token_mode token_secret token_script os csd_wrapper mtu juniper
+
+       grep -q tun /proc/modules || insmod tun
+       ifname="vpn-$config"
+
+       logger -t openconnect "initializing..."
+
+       logger -t "openconnect" "adding host dependency for $server at $config"
+       for ip in $(resolveip -t 10 "$server"); do
+               logger -t "openconnect" "adding host dependency for $ip at $config"
+               proto_add_host_dependency "$config" "$ip" "$interface"
+       done
+
+       [ -n "$port" ] && port=":$port"
+
+       cmdline="$server$port -i "$ifname" --non-inter --syslog --script /lib/netifd/vpnc-script"
+       [ -n "$mtu" ] && cmdline="$cmdline --mtu $mtu"
+
+       # migrate to standard config files
+       [ -f "/etc/config/openconnect-user-cert-vpn-$config.pem" ] && mv "/etc/config/openconnect-user-cert-vpn-$config.pem" "/etc/openconnect/user-cert-vpn-$config.pem"
+       [ -f "/etc/config/openconnect-user-key-vpn-$config.pem" ] && mv "/etc/config/openconnect-user-key-vpn-$config.pem" "/etc/openconnect/user-key-vpn-$config.pem"
+       [ -f "/etc/config/openconnect-ca-vpn-$config.pem" ] && mv "/etc/config/openconnect-ca-vpn-$config.pem" "/etc/openconnect/ca-vpn-$config.pem"
+
+       [ -f /etc/openconnect/user-cert-vpn-$config.pem ] && append cmdline "-c /etc/openconnect/user-cert-vpn-$config.pem"
+       [ -f /etc/openconnect/user-key-vpn-$config.pem ] && append cmdline "--sslkey /etc/openconnect/user-key-vpn-$config.pem"
+       [ -f /etc/openconnect/ca-vpn-$config.pem ] && {
+               append cmdline "--cafile /etc/openconnect/ca-vpn-$config.pem"
+               append cmdline "--no-system-trust"
+       }
+
+       if [ "${juniper:-0}" -gt 0 ]; then
+               append cmdline "--juniper"
+       fi
+
+       [ -n "$serverhash" ] && {
+               append cmdline " --servercert=$serverhash"
+               append cmdline "--no-system-trust"
+       }
+       [ -n "$authgroup" ] && append cmdline "--authgroup $authgroup"
+       [ -n "$username" ] && append cmdline "-u $username"
+       [ -n "$password" ] || [ "$token_mode" = "script" ] && {
+               umask 077
+               mkdir -p /var/etc
+               pwfile="/var/etc/openconnect-$config.passwd"
+               [ -n "$password" ] && {
+                       echo "$password" > "$pwfile"
+                       [ -n "$password2" ] && echo "$password2" >> "$pwfile"
+               }
+               [ "$token_mode" = "script" ] && {
+                       $token_script > "$pwfile" 2> /dev/null || {
+                               logger -t openconenct "Cannot get password from script '$token_script'"
+                               proto_setup_failed "$config"
+                       }
+               }
+               append cmdline "--passwd-on-stdin"
+       }
+
+       [ -n "$token_mode" -a "$token_mode" != "script" ] && append cmdline "--token-mode=$token_mode"
+       [ -n "$token_secret" ] && append cmdline "--token-secret=$token_secret"
+       [ -n "$os" ] && append cmdline "--os=$os"
+       [ -n "$csd_wrapper" ] && [ -x "$csd_wrapper" ] && append cmdline "--csd-wrapper=$csd_wrapper"
+
+       proto_export INTERFACE="$config"
+       logger -t openconnect "executing 'openconnect $cmdline'"
+
+       if [ -f "$pwfile" ]; then
+               proto_run_command "$config" /usr/sbin/openconnect-wrapper $pwfile $cmdline
+       else
+               proto_run_command "$config" /usr/sbin/openconnect $cmdline
+       fi
+}
+
+proto_openconnect_teardown() {
+       local config="$1"
+
+       pwfile="/var/etc/openconnect-$config.passwd"
+
+       rm -f $pwfile
+       logger -t openconnect "bringing down openconnect"
+       proto_kill_command "$config" 2
+}
+
+add_protocol openconnect
diff --git a/net/openconnect/files/openconnect.upgrade b/net/openconnect/files/openconnect.upgrade
new file mode 100644 (file)
index 0000000..01bad65
--- /dev/null
@@ -0,0 +1,9 @@
+/etc/openconnect/user-cert-vpn-*.pem
+/etc/openconnect/user-key-vpn-*.pem
+/etc/openconnect/ca-vpn-*.pem
+/etc/openconnect/pre-init.d/
+/etc/openconnect/connect.d/
+/etc/openconnect/post-connect.d/
+/etc/openconnect/disconnect.d/
+/etc/openconnect/post-disconnect.d/
+/etc/openconnect/reconnect.d/
diff --git a/net/openconnect/patches/0001-Fix-compilation-with-libp11-version-0.4.7.patch b/net/openconnect/patches/0001-Fix-compilation-with-libp11-version-0.4.7.patch
new file mode 100644 (file)
index 0000000..c6e139a
--- /dev/null
@@ -0,0 +1,50 @@
+From 03ecd34e0137b3f0bf0d2fc3ab7f7d8b3682785e Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Thu, 14 Dec 2017 18:03:35 +0800
+Subject: [PATCH] Fix compilation with libp11 version >= 0.4.7
+
+libp11 0.4.7 renamed then dropped macro definition in commits
+
+ 4f0fce4: Error reporting fixes
+ e4c641b: PKCS11 errors separated into P11 and CKR
+
+This change assumes that libp11 will restore compatibility by bringing
+back old forms of macro definition
+
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ openssl-pkcs11.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/openssl-pkcs11.c b/openssl-pkcs11.c
+index 61da123..ba7e491 100644
+--- a/openssl-pkcs11.c
++++ b/openssl-pkcs11.c
+@@ -30,6 +30,24 @@
+ #include <libp11.h>
+ #include <p11-kit/pkcs11.h>
++#ifndef ERR_LIB_PKCS11
++#     if defined(ERR_LIB_CKR)
++#             define ERR_LIB_PKCS11 ERR_LIB_CKR
++#     elif defined(ERR_LIB_USER)
++#             define ERR_LIB_PKCS11 ERR_LIB_USER
++#     else
++#             error undefined macro ERR_LIB_PKCS11
++#     endif
++#endif
++
++#ifndef PKCS11_F_PKCS11_LOGIN
++#     if defined(CKR_F_PKCS11_LOGIN)
++#             define PKCS11_F_PKCS11_LOGIN CKR_F_PKCS11_LOGIN
++#     else
++#             error undefined macro PKCS11_F_PKCS11_LOGIN
++#     endif
++#endif
++
+ static PKCS11_CTX *pkcs11_ctx(struct openconnect_info *vpninfo)
+ {
+       PKCS11_CTX *ctx;
+-- 
+1.8.3.1
+
index 4c2b9e8278f23a904b73706fb47fd2a96e94018e..b6d611c7d93646d358b81e75c0866ef063a29506 100644 (file)
@@ -17,7 +17,7 @@ PKG_LICENSE:=MIT License
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/opennhrp
-PKG_MD5SUM:=eb42ddb13e07ceb415b9ebb8eaca28ee
+PKG_HASH:=1517d53d688ffc165a1da20c344d96b4c53e60f34bd73c64e60cb67cfca4e9ab
 
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
index b6881c2b1d33e1b63f97ba108458ae2c4ba6b49b..3a19387b0d0110fc5c25d7ffccb524a61c0588c4 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssh
-PKG_VERSION:=7.4p1
+PKG_VERSION:=7.6p1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://ftp.spline.de/pub/OpenBSD/OpenSSH/portable/ \
-               https://anorien.csc.warwick.ac.uk/pub/OpenBSD/OpenSSH/portable/ \
-               https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/
-PKG_MD5SUM:=b2db2a83caf66a208bb78d6d287cdaa3
+PKG_SOURCE_URL:=https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
+               https://ftp.spline.de/pub/OpenBSD/OpenSSH/portable/ \
+               https://anorien.csc.warwick.ac.uk/pub/OpenBSD/OpenSSH/portable/
+PKG_HASH:=a323caeeddfe145baaa0db16e98d784b1fbc7dd436a6bf1f479dfd5cd1d21723
 
 PKG_LICENSE:=BSD ISC
 PKG_LICENSE_FILES:=LICENCE
@@ -23,8 +23,6 @@ PKG_LICENSE_FILES:=LICENCE
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 
-PKG_BUILD_DEPENDS:=libopenssl
-
 include $(INCLUDE_DIR)/package.mk
 
 define Package/openssh/Default
@@ -93,6 +91,8 @@ endef
 
 define Package/openssh-server/conffiles
 /etc/ssh/sshd_config
+/etc/ssh/ssh_host_*_key
+/etc/ssh/ssh_host_*_key.pub
 endef
 
 define Package/openssh-server-pam
@@ -175,7 +175,7 @@ CONFIGURE_ARGS += \
        --without-pam
 endif
 
-ifeq ($(CONFIG_OPENSSL_ENGINE),y)
+ifeq ($(CONFIG_OPENSSL_ENGINE_CRYPTO),y)
 CONFIGURE_ARGS+= \
        --with-ssl-engine
 endif
@@ -248,6 +248,7 @@ define Package/openssh-server/install
        $(INSTALL_DIR) $(1)/etc/ssh
        chmod 0700 $(1)/etc/ssh
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ssh/sshd_config $(1)/etc/ssh/
+       sed -r -i 's,^#(HostKey /etc/ssh/ssh_host_(rsa|ecdsa|ed25519)_key)$$$$,\1,' $(1)/etc/ssh/sshd_config
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/sshd.init $(1)/etc/init.d/sshd
        $(INSTALL_DIR) $(1)/usr/sbin
index c4354bb2aa55c1dab5314dfc9e6c7396c49a8bb0..a75daae4cd3f9229be0183c505d266f6c7aa6ec1 100644 (file)
@@ -20,7 +20,11 @@ start_service() {
        }; done
        mkdir -m 0700 -p /var/empty
 
+       local lport=`grep ^Port /etc/ssh/sshd_config | cut -d " " -f 2`
+       [ -z $lport ] && lport=22
+
        procd_open_instance
+       procd_add_mdns "ssh" "tcp" "$lport"
        procd_set_param command $PROG -D
        procd_close_instance
 }
diff --git a/net/openssh/patches/100-dscp-qos.patch b/net/openssh/patches/100-dscp-qos.patch
new file mode 100644 (file)
index 0000000..630cc09
--- /dev/null
@@ -0,0 +1,21 @@
+--- a/ssh_config
++++ b/ssh_config
+@@ -48,3 +48,6 @@
+ #   VisualHostKey no
+ #   ProxyCommand ssh -q -W %h:%p gateway.example.com
+ #   RekeyLimit 1G 1h
++
++# enable DSCP QoS values (per RFC-4594)
++#IPQoS AF21 AF11
+--- a/sshd_config
++++ b/sshd_config
+@@ -107,6 +107,9 @@ AuthorizedKeysFile .ssh/authorized_keys
+ # no default banner path
+ #Banner none
++# enable DSCP QoS values (per RFC-4594)
++#IPQoS AF21 AF11
++
+ # override default of no subsystems
+ Subsystem     sftp    /usr/libexec/sftp-server
diff --git a/net/openssh/patches/130-implicit_memset_decl_fix.patch b/net/openssh/patches/130-implicit_memset_decl_fix.patch
deleted file mode 100644 (file)
index 7d46d20..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/includes.h
-+++ b/includes.h
-@@ -60,6 +60,9 @@
- /*
-  *-*-nto-qnx needs these headers for strcasecmp and LASTLOG_FILE respectively
-  */
-+#ifdef HAVE_STRING_H
-+# include <string.h>
-+#endif
- #ifdef HAVE_STRINGS_H
- # include <strings.h>
- #endif
diff --git a/net/openssh/patches/140-pam_uclibc_pthreads_fix.patch b/net/openssh/patches/140-pam_uclibc_pthreads_fix.patch
deleted file mode 100644 (file)
index 1319b52..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
---- a/auth-pam.c
-+++ b/auth-pam.c
-@@ -159,7 +159,7 @@ sshpam_sigchld_handler(int sig)
-       }
-       if (WIFSIGNALED(sshpam_thread_status) &&
-           WTERMSIG(sshpam_thread_status) == SIGTERM)
--              return; /* terminated by pthread_cancel */
-+              return; /* terminated by pthread2_cancel */
-       if (!WIFEXITED(sshpam_thread_status))
-               sigdie("PAM: authentication thread exited unexpectedly");
-       if (WEXITSTATUS(sshpam_thread_status) != 0)
-@@ -168,14 +168,14 @@ sshpam_sigchld_handler(int sig)
- /* ARGSUSED */
- static void
--pthread_exit(void *value)
-+pthread2_exit(void *value)
- {
-       _exit(0);
- }
- /* ARGSUSED */
- static int
--pthread_create(sp_pthread_t *thread, const void *attr,
-+pthread2_create(sp_pthread_t *thread, const void *attr,
-     void *(*thread_start)(void *), void *arg)
- {
-       pid_t pid;
-@@ -201,7 +201,7 @@ pthread_create(sp_pthread_t *thread, con
- }
- static int
--pthread_cancel(sp_pthread_t thread)
-+pthread2_cancel(sp_pthread_t thread)
- {
-       signal(SIGCHLD, sshpam_oldsig);
-       return (kill(thread, SIGTERM));
-@@ -209,7 +209,7 @@ pthread_cancel(sp_pthread_t thread)
- /* ARGSUSED */
- static int
--pthread_join(sp_pthread_t thread, void **value)
-+pthread2_join(sp_pthread_t thread, void **value)
- {
-       int status;
-@@ -510,7 +510,7 @@ sshpam_thread(void *ctxtp)
-       /* XXX - can't do much about an error here */
-       ssh_msg_send(ctxt->pam_csock, sshpam_err, &buffer);
-       buffer_free(&buffer);
--      pthread_exit(NULL);
-+      pthread2_exit(NULL);
-  auth_fail:
-       buffer_put_cstring(&buffer,
-@@ -521,7 +521,7 @@ sshpam_thread(void *ctxtp)
-       else
-               ssh_msg_send(ctxt->pam_csock, PAM_AUTH_ERR, &buffer);
-       buffer_free(&buffer);
--      pthread_exit(NULL);
-+      pthread2_exit(NULL);
-       return (NULL); /* Avoid warning for non-pthread case */
- }
-@@ -533,8 +533,8 @@ sshpam_thread_cleanup(void)
-       debug3("PAM: %s entering", __func__);
-       if (ctxt != NULL && ctxt->pam_thread != 0) {
--              pthread_cancel(ctxt->pam_thread);
--              pthread_join(ctxt->pam_thread, NULL);
-+              pthread2_cancel(ctxt->pam_thread);
-+              pthread2_join(ctxt->pam_thread, NULL);
-               close(ctxt->pam_psock);
-               close(ctxt->pam_csock);
-               memset(ctxt, 0, sizeof(*ctxt));
-@@ -698,7 +698,7 @@ sshpam_init_ctx(Authctxt *authctxt)
-       }
-       ctxt->pam_psock = socks[0];
-       ctxt->pam_csock = socks[1];
--      if (pthread_create(&ctxt->pam_thread, NULL, sshpam_thread, ctxt) == -1) {
-+      if (pthread2_create(&ctxt->pam_thread, NULL, sshpam_thread, ctxt) == -1) {
-               error("PAM: failed to start authentication thread: %s",
-                   strerror(errno));
-               close(socks[0]);
diff --git a/net/openssh/patches/200-dscp-qos.patch b/net/openssh/patches/200-dscp-qos.patch
deleted file mode 100644 (file)
index 827a668..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/ssh_config
-+++ b/ssh_config
-@@ -46,3 +46,6 @@
- #   VisualHostKey no
- #   ProxyCommand ssh -q -W %h:%p gateway.example.com
- #   RekeyLimit 1G 1h
-+
-+# enable DSCP QoS values (per RFC-4594)
-+#IPQoS AF21 AF11
---- a/sshd_config
-+++ b/sshd_config
-@@ -122,6 +122,9 @@ UsePrivilegeSeparation sandbox             # Defaul
- # no default banner path
- #Banner none
-+# enable DSCP QoS values (per RFC-4594)
-+#IPQoS AF21 AF11
-+
- # override default of no subsystems
- Subsystem     sftp    /usr/libexec/sftp-server
index e47633211904d2d4525c221b288c2f61c992c96b..19c383812e13c7e4f7397a79ca8112120c112a09 100644 (file)
@@ -1,6 +1,3 @@
-#
-# Copyright (C) 2006-2014 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -8,9 +5,10 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=opentracker
-PKG_VERSION:=20151211
-PKG_RELEASE:=2
-PKG_REV:=ba25d2b2a84a31eac2956b71cb12b4b0748b35f5
+PKG_VERSION:=20170428
+PKG_RELEASE:=1
+PKG_REV:=9c7be324f5a4306dd81eab2f982f87e2c42ffdf1
+PKG_MIRROR_HASH:=fda6098a9bdf080c852c5b513ada67d065c1286ad3d4617c05f3a3d9ebb81536
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=Beerware
 
index 2a0fcf63f59cdf7d5d6626a963e8e69564b7636c..96978f5c89842f16c579e14970853b99ab5f3f39 100644 (file)
@@ -1,6 +1,6 @@
-# 
+#
 # Copyright (C) 2013 Julius Schulz-Zander <julius@net.t-labs.tu-berlin.de>
-# Copyright (C) 2014 OpenWrt.org
+# Copyright (C) 2014-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -12,53 +12,33 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=openvswitch
 
-PKG_RELEASE:=7
-PKG_VERSION:=2.5.0
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
+PKG_VERSION:=2.8.2
+PKG_RELEASE:=1
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=COPYING
 PKG_USE_MIPS16:=0
 
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/openvswitch/ovs
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=22d4614ddf83988a3771fb379ea029e663b4455a
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://www.openvswitch.org/releases/
+PKG_HASH:=87b4a7e7134a44ce1f808d3415a2244b4518c2b0b2a42fa2f8231e592f13103d
+
+PKG_BUILD_DEPENDS:=python/host python-six/host
 
 PKG_BUILD_PARALLEL:=1
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
-# Upstream package supports kernels between 2.6.32 and 4.3 
-# see https://github.com/openvswitch/ovs/blob/master/FAQ.md
-# This list is pruned to only those kernels used in OpenWRT
-# Support for kernel 4.4 is backported
-SUPPORTED_KERNELS:=LINUX_3_18||LINUX_4_1||LINUX_4_3||LINUX_4_4
-
-# If only kmod-openvswitch is enabled, then override default make path to only
-# build and install the datapath/linux subdirectory which cuts down compilation
-# time dramatically.
-ifeq ($(CONFIG_PACKAGE_openvswitch-base),)
- ifneq ($(CONFIG_PACKAGE_kmod-openvswitch),)
-  MAKE_PATH := datapath/linux
- endif
-endif
-
-# Additionally register PKG_CONFIG_DEPENDS to trigger a rebuild of the code
-# base if the package selection changes.
-PKG_CONFIG_DEPENDS := \
-       CONFIG_PACKAGE_openvswitch-base \
-       CONFIG_PACKAGE_kmod-openvswitch
+PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-host.mk
+include ../../lang/python/python-package.mk
 
 define Package/openvswitch/Default
   SECTION:=net
   SUBMENU:=Open vSwitch
   CATEGORY:=Network
   URL:=http://openvswitch.org/
-  MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
 endef
 
 define Package/openvswitch/Default/description
@@ -74,7 +54,7 @@ endef
 define Package/openvswitch-base
   $(call Package/openvswitch/Default)
   TITLE:=Open vSwitch Userspace Package (base)
-  DEPENDS:=+libpcap +libopenssl +librt +kmod-openvswitch @($(SUPPORTED_KERNELS))
+  DEPENDS:=+libpcap +libopenssl +librt +kmod-openvswitch
 endef
 
 define Package/openvswitch-base/description
@@ -83,38 +63,56 @@ define Package/openvswitch-base/description
   to conserve some room and allow more configurability.
 endef
 
-define Package/openvswitch-python
+define Package/openvswitch-ovn-base
   $(call Package/openvswitch/Default)
-  TITLE:=Open vSwitch Python Support
-  DEPENDS:=+openvswitch +PACKAGE_openvswitch-python:python
+  TITLE:=Open Virtual Networking (base)
+  DEPENDS:=+openvswitch-base
 endef
 
-define Package/openvswitch-python/description
-  Provides bindings and libraries for using Python to manipulate/work with Open vSwitch.
+define Package/openvswitch-ovn-base/description
+  Provides the main userspace components required for Open Virtual Networking
+  over Open vSwitch.
 endef
 
-define Package/openvswitch-ipsec
+OVN_BIN_TOOLS:=ovn-controller ovn-controller-vtep ovn-detrace \
+       ovn-docker-overlay-driver ovn-docker-underlay-driver \
+       ovn-nbctl ovn-sbctl ovn-trace
+define Package/openvswitch-ovn
   $(call Package/openvswitch/Default)
-  TITLE:=Open vSwitch GRE through IPsec tool
-  DEPENDS:=+openvswitch-python
+  TITLE:=Open Virtual Networking (base)
+  DEPENDS:=+openvswitch-ovn-base $(foreach t,$(OVN_BIN_TOOLS),+openvswitch-$(t))
 endef
 
-define Package/openvswitch-ipsec/description
-  The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with 
-  IPsec.
+define Package/openvswitch-ovn/description
+  Provides all the components required for Open Virtual Networking
+  (including the tools)
 endef
 
-define Package/openvswitch-benchmark
+define Package/openvswitch-vtep
   $(call Package/openvswitch/Default)
-  TITLE:=Open vSwitch flow setup benchmark utility
-  DEPENDS:=+openvswitch
+  TITLE:=Open vSwitch VXLAN Tunnel End Point
+  DEPENDS:=+openvswitch-base
 endef
 
-define Package/openvswitch-benchmark/description
-  Utility for running OpenVSwitch benchmarking
+define Package/openvswitch-vtep/description
+  This schema specifies relations that a VTEP can use to integrate physi‐
+  cal ports into logical switches maintained by a network  virtualization
+  controller such as NSX.
+endef
+
+define Package/openvswitch-python
+  $(call Package/openvswitch/Default)
+  TITLE:=Open vSwitch Python Support
+  DEPENDS:=+PACKAGE_openvswitch-python:python +PACKAGE_openvswitch-python:python-six
 endef
 
-OVS_BIN_TOOLS:=ovs-appctl ovs-ofctl ovs-dpctl ovs-vsctl ovsdb-client
+define Package/openvswitch-python/description
+  Provides bindings and libraries for using Python to manipulate/work with Open vSwitch.
+endef
+
+OVS_BIN_TOOLS:= \
+       ovsdb-client ovs-l3ping ovs-dpctl-top \
+       ovs-tcpdump ovs-tcpundump ovs-pcap ovs-parse-backtrace
 define Package/openvswitch
   $(call Package/openvswitch/Default)
   TITLE:=Open vSwitch Userspace Package
@@ -123,50 +121,85 @@ endef
 
 define Package/openvswitch/description
   Provides the main userspace components required for Open vSwitch to function.
-  Includes also the main OVS utilities (ovs-appctl, ovs-vsctl, etc).
+  Includes also most of  OVS utilities.
 endef
 
 define KernelPackage/openvswitch
   SECTION:=kernel
   CATEGORY:=Kernel modules
   SUBMENU:=Network Support
-  TITLE:=Open vSwitch Kernel Package
-  KCONFIG:=CONFIG_BRIDGE
-  DEPENDS:=+kmod-stp @IPV6 +kmod-gre +kmod-lib-crc32c +kmod-vxlan +kmod-nf-conntrack +kmod-nf-conntrack6 @($(SUPPORTED_KERNELS))
-  FILES:= \
-       $(PKG_BUILD_DIR)/datapath/linux/openvswitch.$(LINUX_KMOD_SUFFIX)
-  AUTOLOAD:=$(call AutoLoad,21,openvswitch)
+  TITLE:=Open vSwitch kernel datapath
+  KCONFIG:=CONFIG_OPENVSWITCH
+  DEPENDS:= \
+       +kmod-lib-crc32c +kmod-mpls \
+       +kmod-nf-nat +IPV6:kmod-nf-nat6
+  FILES:= $(LINUX_DIR)/net/openvswitch/openvswitch.ko
+  AUTOLOAD:=$(call AutoProbe,openvswitch)
+endef
+
+define KernelPackage/openvswitch-gre
+  SECTION:=kernel
+  CATEGORY:=Kernel modules
+  SUBMENU:=Network Support
+  TITLE:=Open vSwitch GRE tunneling support
+  KCONFIG:= CONFIG_OPENVSWITCH_GRE
+  DEPENDS:= +kmod-openvswitch +kmod-gre
+  FILES:= $(LINUX_DIR)/net/openvswitch/vport-gre.ko
+  AUTOLOAD:=$(call AutoProbe,vport-gre)
+endef
+
+define KernelPackage/openvswitch-vxlan
+  SECTION:=kernel
+  CATEGORY:=Kernel modules
+  SUBMENU:=Network Support
+  TITLE:=Open vSwitch VXLAN tunneling support
+  KCONFIG:= CONFIG_OPENVSWITCH_VXLAN
+  DEPENDS:= +kmod-openvswitch +kmod-vxlan
+  FILES:= $(LINUX_DIR)/net/openvswitch/vport-vxlan.ko
+  AUTOLOAD:=$(call AutoProbe,vport-vxlan)
 endef
 
-define KernelPackage/openvswitch/description
-  This package contains the Open vSwitch kernel moodule and bridge compat
-  module. Furthermore, it supports OpenFlow.
+define KernelPackage/openvswitch-geneve
+  SECTION:=kernel
+  CATEGORY:=Kernel modules
+  SUBMENU:=Network Support
+  TITLE:=Open vSwitch Geneve tunneling support
+  KCONFIG:= CONFIG_OPENVSWITCH_GENEVE
+  DEPENDS:= +kmod-openvswitch +kmod-geneve
+  FILES:= $(LINUX_DIR)/net/openvswitch/vport-geneve.ko
+  AUTOLOAD:=$(call AutoProbe,vport-geneve)
 endef
 
-CONFIGURE_ARGS += --with-linux=$(LINUX_DIR) --with-rundir=/var/run
 CONFIGURE_ARGS += --enable-ndebug
-CONFIGURE_ARGS += --disable-ssl
 CONFIGURE_ARGS += --enable-shared
 
 TARGET_CFLAGS += -flto -std=gnu99
 
-CONFIGURE_VARS += KARCH=$(LINUX_KARCH)
+CONFIGURE_VARS += \
+       ovs_cv_flake8=no \
+       ovs_cv_python3=no \
+       ovs_cv_sphinx=no \
+       ovs_cv_python=$(PYTHON) \
+       ovs_cv_python_host=$(HOST_PYTHON_BIN) \
+       KARCH=$(LINUX_KARCH)
+
+MAKE_VARS += PYTHONPATH="$(HOST_PYTHONPATH)"
 MAKE_FLAGS += ARCH="$(LINUX_KARCH)"
 
 define OvsBinUtility
-  define Package/openvswitch-$(1)
+  define Package/openvswitch-$(2)
      $(call Package/openvswitch/Default)
-     TITLE:=$(2)
-     DEPENDS:=+openvswitch-base
+     TITLE:=$(3)
+     DEPENDS:=+$(1) $(4)
   endef
 
-  define Package/openvswitch-$(1)/description
-    $(2)
+  define Package/openvswitch-$(2)/description
+    $(3)
   endef
 
-  define Package/openvswitch-$(1)/install
+  define Package/openvswitch-$(2)/install
     $(INSTALL_DIR) $$(1)/usr/bin/ ;\
-    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/
+    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/
   endef
 endef
 
@@ -177,20 +210,46 @@ define Package/openvswitch-base/install
        $(INSTALL_BIN) ./files/etc/init.d/openvswitch.init $(1)/etc/init.d/openvswitch
 
        $(INSTALL_DIR) $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libofproto.so*  $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopenvswitch.so*  $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libovsdb.so*  $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsflow.so*  $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libofproto*.so*  $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopenvswitch*.so*  $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libovsdb*.so*  $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsflow*.so*  $(1)/usr/lib/
 
        $(INSTALL_DIR) $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovsdb-tool $(1)/usr/bin/
+       $(foreach bin,ovsdb-tool ovs-appctl ovs-ofctl ovs-dpctl ovs-vsctl ovs-pki, \
+               $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(bin) $(1)/usr/bin/ ; )
 
        $(INSTALL_DIR) $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ovs-vswitchd $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ovsdb-server $(1)/usr/sbin/
 
-       $(INSTALL_DIR) $(1)/usr/share/openvswitch/
-       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/share/openvswitch/vswitch.ovsschema $(1)/usr/share/openvswitch/
+       $(INSTALL_DIR) $(1)/usr/share/openvswitch/scripts
+       $(INSTALL_CONF) \
+               $(PKG_INSTALL_DIR)/usr/share/openvswitch/vswitch.ovsschema \
+               $(1)/usr/share/openvswitch/
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/share/openvswitch/scripts/ovs-lib \
+               $(1)/usr/share/openvswitch/scripts
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/share/openvswitch/scripts/ovs-ctl \
+               $(1)/usr/share/openvswitch/scripts
+endef
+
+define Package/openvswitch-ovn-base/install
+       $(INSTALL_DIR) $(1)/usr/lib/ $(1)/usr/bin/ $(1)/usr/share/openvswitch/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libovn*.so* $(1)/usr/lib/
+
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovn-northd $(1)/usr/bin/
+
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/share/openvswitch/ovn-nb.ovsschema $(1)/usr/share/openvswitch/
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/share/openvswitch/ovn-sb.ovsschema $(1)/usr/share/openvswitch/
+endef
+
+define Package/openvswitch-vtep/install
+       $(INSTALL_DIR) $(1)/usr/lib/ $(1)/usr/bin/ $(1)/usr/share/openvswitch/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtep-ctl $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libvtep*.so* $(1)/usr/lib/
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/share/openvswitch/vtep.ovsschema $(1)/usr/share/openvswitch/
 endef
 
 define Package/openvswitch-python/install
@@ -198,32 +257,48 @@ define Package/openvswitch-python/install
        $(CP) $(PKG_INSTALL_DIR)/usr/share/openvswitch/python/ovs/* $(1)/usr/lib/python$(PYTHON_VERSION)/ovs
 endef
 
-define Package/openvswitch-ipsec/install
-       $(INSTALL_DIR) $(1)/usr/sbin/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/debian/ovs-monitor-ipsec $(1)/usr/sbin/
-endef
-
-define Package/openvswitch-benchmark/install
-       $(INSTALL_DIR) $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovs-benchmark $(1)/usr/bin/
+define Package/openvswitch-ovn/install
+       :
 endef
 
 define Package/openvswitch/install
        :
 endef
 
-$(eval $(call OvsBinUtility,ovs-appctl,Open vSwitch app control utility))
-$(eval $(call OvsBinUtility,ovs-ofctl,Open vSwitch OpenFlow control utility))
-$(eval $(call OvsBinUtility,ovs-dpctl,Open vSwitch datapath management utility))
-$(eval $(call OvsBinUtility,ovs-vsctl,Open vSwitch ovs-vswitchd management utility))
-$(eval $(call OvsBinUtility,ovsdb-client,Open vSwitch database JSON-RPC client))
+$(eval $(call OvsBinUtility,openvswitch-base,ovs-appctl,Open vSwitch app control utility))
+$(eval $(call OvsBinUtility,openvswitch-base,ovs-ofctl,Open vSwitch OpenFlow control utility))
+$(eval $(call OvsBinUtility,openvswitch-base,ovs-dpctl,Open vSwitch datapath management utility))
+$(eval $(call OvsBinUtility,openvswitch-base,ovs-vsctl,Open vSwitch ovs-vswitchd management utility))
+$(eval $(call OvsBinUtility,openvswitch-base,ovsdb-client,Open vSwitch database JSON-RPC client))
+$(eval $(call OvsBinUtility,openvswitch-base,ovs-l3ping,Check network deployment for L3 tunneling problems))
+$(eval $(call OvsBinUtility,openvswitch-base,ovs-docker,Open vSwitch docker tool))
+$(eval $(call OvsBinUtility,openvswitch-base,ovs-dpctl-top,Top like behavior for ovs-dpctl dump-flows))
+$(eval $(call OvsBinUtility,openvswitch-base,ovs-pki,OpenFlow public key infrastructure management utility))
+$(eval $(call OvsBinUtility,openvswitch-base,ovs-tcpdump,Dump traffic from an Open vSwitch port using tcpdump))
+$(eval $(call OvsBinUtility,openvswitch-base,ovs-tcpundump,Convert ``tcpdump -xx`` output to hex strings))
+$(eval $(call OvsBinUtility,openvswitch-base,ovs-pcap,Print packets from a pcap file as hex))
+$(eval $(call OvsBinUtility,openvswitch-base,ovs-parse-backtrace,parses ovs-appctl backtrace output))
+
+$(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-controller,Open Virtual Network local controller))
+$(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-controller-vtep,Open Virtual Network local controller for vtep enabled physical switches,+openvswitch-vtep))
+$(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-detrace,Convert ``ovs-appctl ofproto/trace`` output to combine OVN logical flow information))
+$(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-docker-overlay-driver,OVN Docker overlay driver utility))
+$(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-docker-underlay-driver,OVN Docker underlay driver utility))
+$(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-nbctl,Open Virtual Network northbound db management utility))
+$(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-sbctl,Utility for querying and configuring OVN_Southbound data‐base))
+$(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-trace,Open Virtual Network logical network tracing utility))
 
 $(foreach t,$(OVS_BIN_TOOLS),$(eval $(call BuildPackage,openvswitch-$(t))))
+$(foreach t,$(OVN_BIN_TOOLS),$(eval $(call BuildPackage,openvswitch-$(t))))
 
 $(eval $(call BuildPackage,openvswitch-base))
+$(eval $(call BuildPackage,openvswitch-ovn-base))
+$(eval $(call BuildPackage,openvswitch-ovn))
+$(eval $(call BuildPackage,openvswitch-vtep))
 $(eval $(call BuildPackage,openvswitch-python))
-$(eval $(call BuildPackage,openvswitch-ipsec))
-$(eval $(call BuildPackage,openvswitch-benchmark))
 $(eval $(call BuildPackage,openvswitch))
-$(eval $(call KernelPackage,openvswitch))
 
+$(eval $(call KernelPackage,openvswitch))
+$(eval $(call KernelPackage,openvswitch-gre))
+$(eval $(call KernelPackage,openvswitch-vxlan))
+$(eval $(call KernelPackage,openvswitch-geneve))
index ffe879a057d2a593911241cec3c9742d74c9f8fa..84655e74c3d2bb43537648790fc4c7e20763c577 100644 (file)
@@ -1,41 +1,22 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2013 Julius Schulz-Zander <julius@net.t-labs.tu-berlin.de>
-# Copyright (C) 2014 OpenWrt.org
+# Copyright (C) 2014-2017 OpenWrt.org
 
 START=15
-USE_PROCD=1
 
-start_service() {
-       [ -x /var/run/openvswitch ] || mkdir -p /var/run/openvswitch
-       [ -e /etc/openvswitch/conf.db ] || {
-               /usr/bin/ovsdb-tool create /etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema
-       }
+start() {
+       /usr/share/openvswitch/scripts/ovs-ctl start
+}
 
-       # ovsdb-server
-       procd_open_instance
-       procd_set_param command /usr/sbin/ovsdb-server
-       procd_append_param command --remote=punix:/var/run/db.sock
-       procd_append_param command --remote=db:Open_vSwitch,Open_vSwitch,manager_options
-       procd_append_param command --pidfile=/var/run/ovsdb-server.pid
-       procd_set_param respawn
-       procd_append_param respawn 3600
-       procd_append_param respawn 5
-       procd_append_param respawn -1
-       procd_set_param nice
-       procd_append_param nice -10
-       procd_close_instance
+stop() {
+       /usr/share/openvswitch/scripts/ovs-ctl stop
+}
 
-       # ovs-vswitchd
-       procd_open_instance
-       procd_set_param command /usr/sbin/ovs-vswitchd
-       procd_append_param command --pidfile=/var/run/ovs-vswitchd.pid
-       procd_set_param respawn
-       procd_append_param respawn 3600
-       procd_append_param respawn 5
-       procd_append_param respawn -1
-       procd_set_param nice
-       procd_append_param nice -10
-       procd_close_instance
+restart() {
+       /usr/share/openvswitch/scripts/ovs-ctl restart
+}
 
+status() {
+       /usr/share/openvswitch/scripts/ovs-ctl status
 }
 
diff --git a/net/openvswitch/patches/0001-musl-compatibility.patch b/net/openvswitch/patches/0001-musl-compatibility.patch
new file mode 100644 (file)
index 0000000..ddcc5fc
--- /dev/null
@@ -0,0 +1,39 @@
+diff --git a/configure.ac b/configure.ac
+index e6a23a6..8a7c6d6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -118,7 +118,6 @@ OVS_CHECK_XENSERVER_VERSION
+ OVS_CHECK_GROFF
+ OVS_CHECK_GNU_MAKE
+ OVS_CHECK_TLS
+-OVS_CHECK_ATOMIC_LIBS
+ OVS_CHECK_GCC4_ATOMICS
+ OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(1)
+ OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(2)
+diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
+index 712cb5a..e840f10 100644
+--- a/lib/netdev-linux.c
++++ b/lib/netdev-linux.c
+@@ -40,7 +40,9 @@
+ #include <netpacket/packet.h>
+ #include <net/if.h>
+ #include <net/if_arp.h>
++#if defined(__UCLIBC__) || defined(__GLIBC__)
+ #include <net/if_packet.h>
++#endif
+ #include <net/route.h>
+ #include <netinet/in.h>
+ #include <poll.h>
+diff --git a/lib/ovs-atomic.h b/lib/ovs-atomic.h
+index 9ead907..0a131d7 100644
+--- a/lib/ovs-atomic.h
++++ b/lib/ovs-atomic.h
+@@ -318,7 +318,7 @@
+ #include "util.h"
+ #define IN_OVS_ATOMIC_H
+-    #if __CHECKER__
++    #if 1
+         /* sparse doesn't understand some GCC extensions we use. */
+         #include "ovs-atomic-pthreads.h"
+     #elif __has_extension(c_atomic)
diff --git a/net/openvswitch/patches/0001-netdev-linux-Use-unsigned-int-for-ifi_flags.patch b/net/openvswitch/patches/0001-netdev-linux-Use-unsigned-int-for-ifi_flags.patch
deleted file mode 100644 (file)
index ed537d1..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-From 12edcd800d924f69630768eeece842373dee5bb0 Mon Sep 17 00:00:00 2001
-From: Helmut Schaa <helmut.schaa@googlemail.com>
-Date: Wed, 8 Jan 2014 13:48:33 +0100
-Subject: [PATCH 1/2] netdev-linux: Use unsigned int for ifi_flags
-
-ifi_flags is unsigned, the local equivalents should do the same.
-
-Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
----
- lib/netdev-linux.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
-index 9bdbbdf..9eaac33 100644
---- a/lib/netdev-linux.c
-+++ b/lib/netdev-linux.c
-@@ -2709,7 +2709,7 @@ update_flags(struct netdev_linux *netdev, enum netdev_flags off,
-              enum netdev_flags on, enum netdev_flags *old_flagsp)
-     OVS_REQUIRES(netdev->mutex)
- {
--    int old_flags, new_flags;
-+    unsigned int old_flags, new_flags;
-     int error = 0;
-     old_flags = netdev->ifi_flags;
--- 
-1.8.1.4
-
diff --git a/net/openvswitch/patches/0002-netdev-linux-Let-interface-flag-survive-internal-por.patch b/net/openvswitch/patches/0002-netdev-linux-Let-interface-flag-survive-internal-por.patch
deleted file mode 100644 (file)
index b31816a..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From b9284f535e93c337ab21f330753e60e1038f9a27 Mon Sep 17 00:00:00 2001
-From: Helmut Schaa <helmut.schaa@googlemail.com>
-Date: Wed, 8 Jan 2014 13:48:49 +0100
-Subject: [PATCH 2/2] netdev-linux: Let interface flag survive internal port
- setup
-
-Due to a race condition when bringing up an internal port on Linux
-some interface flags (e.g. IFF_MULTICAST) are falsely reset. This
-happens because netlink events may be processed after the according
-netdev has been brought up (which sets interface flags).
-
-Fix this by reading the interface flags just before updating them
-if they have not been updated by from the kernel yet.
-
-Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
----
- lib/netdev-linux.c | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
-index 9eaac33..423e72e 100644
---- a/lib/netdev-linux.c
-+++ b/lib/netdev-linux.c
-@@ -2712,7 +2712,13 @@ update_flags(struct netdev_linux *netdev, enum netdev_flags off,
-     unsigned int old_flags, new_flags;
-     int error = 0;
--    old_flags = netdev->ifi_flags;
-+    if (!(netdev->cache_valid & VALID_DRVINFO)) {
-+        /* Most likely the debvice flags are not in sync yet, fetch them now */
-+        get_flags(&netdev->up, &old_flags);
-+    } else {
-+        old_flags = netdev->ifi_flags;
-+    }
-+
-     *old_flagsp = iff_to_nd_flags(old_flags);
-     new_flags = (old_flags & ~nd_to_iff_flags(off)) | nd_to_iff_flags(on);
-     if (new_flags != old_flags) {
--- 
-1.8.1.4
-
diff --git a/net/openvswitch/patches/0004-musl-compatibility.patch b/net/openvswitch/patches/0004-musl-compatibility.patch
deleted file mode 100644 (file)
index ddcc5fc..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-diff --git a/configure.ac b/configure.ac
-index e6a23a6..8a7c6d6 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -118,7 +118,6 @@ OVS_CHECK_XENSERVER_VERSION
- OVS_CHECK_GROFF
- OVS_CHECK_GNU_MAKE
- OVS_CHECK_TLS
--OVS_CHECK_ATOMIC_LIBS
- OVS_CHECK_GCC4_ATOMICS
- OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(1)
- OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(2)
-diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
-index 712cb5a..e840f10 100644
---- a/lib/netdev-linux.c
-+++ b/lib/netdev-linux.c
-@@ -40,7 +40,9 @@
- #include <netpacket/packet.h>
- #include <net/if.h>
- #include <net/if_arp.h>
-+#if defined(__UCLIBC__) || defined(__GLIBC__)
- #include <net/if_packet.h>
-+#endif
- #include <net/route.h>
- #include <netinet/in.h>
- #include <poll.h>
-diff --git a/lib/ovs-atomic.h b/lib/ovs-atomic.h
-index 9ead907..0a131d7 100644
---- a/lib/ovs-atomic.h
-+++ b/lib/ovs-atomic.h
-@@ -318,7 +318,7 @@
- #include "util.h"
- #define IN_OVS_ATOMIC_H
--    #if __CHECKER__
-+    #if 1
-         /* sparse doesn't understand some GCC extensions we use. */
-         #include "ovs-atomic-pthreads.h"
-     #elif __has_extension(c_atomic)
diff --git a/net/openvswitch/patches/0008-add-back-old-gfp-this-node-define.patch b/net/openvswitch/patches/0008-add-back-old-gfp-this-node-define.patch
deleted file mode 100644 (file)
index ec7d325..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git a/datapath/flow.c b/datapath/flow.c
-index a7a2063..8db8041 100644
---- a/datapath/flow.c
-+++ b/datapath/flow.c
-@@ -51,6 +51,14 @@
- #include "vlan.h"
-+#ifndef GFP_THISNODE
-+#ifdef CONFIG_NUMA  
-+#define GFP_THISNODE    (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
-+#else                             
-+#define GFP_THISNODE    ((__force gfp_t)0)
-+#endif 
-+#endif
-+
- u64 ovs_flow_used_time(unsigned long flow_jiffies)
- {
-       struct timespec cur_ts;
diff --git a/net/openvswitch/patches/0009-fix-test-ovn.patch b/net/openvswitch/patches/0009-fix-test-ovn.patch
deleted file mode 100644 (file)
index 10bd37a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/tests/test-ovn.c
-+++ b/tests/test-ovn.c
-@@ -1043,7 +1043,7 @@ wait_pid(pid_t *pids, int *n)
-     int status;
-     pid_t pid;
--    pid = waitpid(WAIT_ANY, &status, 0);
-+    pid = waitpid(-1, &status, 0);
-     if (pid < 0) {
-         ovs_fatal(errno, "waitpid failed");
-     } else if (WIFEXITED(status)) {
diff --git a/net/openvswitch/patches/0010-lib-ovs-thread-Ensure-that-thread-stacks-are-always-.patch b/net/openvswitch/patches/0010-lib-ovs-thread-Ensure-that-thread-stacks-are-always-.patch
deleted file mode 100644 (file)
index 88f5d26..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-From 8147cec9ee8feea9440cf79365709ddc32ff57d5 Mon Sep 17 00:00:00 2001
-From: Alexandru Ardelean <ardeleanalex@gmail.com>
-Date: Thu, 4 Feb 2016 09:20:34 +0200
-Subject: [PATCH] lib/ovs-thread: Ensure that thread stacks are always at least
- 512 kB.
-
-This makes a difference for libc implementations (such as musl libc) that
-have a really small default pthread stack size.
-
-Will reference this discussion:
-http://patchwork.ozlabs.org/patch/572340/
-
-Reported-by: Robert McKay <robert@mckay.com>
-Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
-[blp@ovn.org made style changes]
-Signed-off-by: Ben Pfaff <blp@ovn.org>
----
- lib/ovs-thread.c | 29 +++++++++++++++++++++++++++++
- 1 file changed, 29 insertions(+)
-
-diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c
-index 6ebda07..b0e10ee 100644
---- a/lib/ovs-thread.c
-+++ b/lib/ovs-thread.c
-@@ -340,6 +340,25 @@ ovsthread_wrapper(void *aux_)
-     return aux.start(aux.arg);
- }
-+static void
-+set_min_stack_size(pthread_attr_t *attr, size_t min_stacksize)
-+{
-+    size_t stacksize;
-+    int error;
-+
-+    error = pthread_attr_getstacksize(attr, &stacksize);
-+    if (error) {
-+        ovs_abort(error, "pthread_attr_getstacksize failed");
-+    }
-+
-+    if (stacksize < min_stacksize) {
-+        error = pthread_attr_setstacksize(attr, min_stacksize);
-+        if (error) {
-+            ovs_abort(error, "pthread_attr_setstacksize failed");
-+        }
-+    }
-+}
-+
- /* Starts a thread that calls 'start(arg)'.  Sets the thread's name to 'name'
-  * (suffixed by its ovsthread_id()).  Returns the new thread's pthread_t. */
- pthread_t
-@@ -358,10 +377,20 @@ ovs_thread_create(const char *name, void *(*start)(void *), void *arg)
-     aux->arg = arg;
-     ovs_strlcpy(aux->name, name, sizeof aux->name);
-
--    error = pthread_create(&thread, NULL, ovsthread_wrapper, aux);
-+    /* Some small systems use a default stack size as small as 80 kB, but OVS
-+     * requires approximately 384 kB according to the following analysis:
-+     * http://openvswitch.org/pipermail/dev/2016-January/065049.html
-+     *
-+     * We use 512 kB to give us some margin of error. */
-+    pthread_attr_t attr;
-+    pthread_attr_init(&attr);
-+    set_min_stack_size(&attr, 512 * 1024);
-+
-+    error = pthread_create(&thread, &attr, ovsthread_wrapper, aux);
-     if (error) {
-         ovs_abort(error, "pthread_create failed");
-     }
-+    pthread_attr_destroy(&attr);
-     return thread;
- }
\f
--- 
-2.1.4
-
diff --git a/net/openvswitch/patches/0011-kernel-4-4-support.patch b/net/openvswitch/patches/0011-kernel-4-4-support.patch
deleted file mode 100644 (file)
index 1a492e4..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-diff --git a/acinclude.m4 b/acinclude.m4
-index 11c7787..07dd647 100644
---- a/acinclude.m4
-+++ b/acinclude.m4
-@@ -134,10 +134,10 @@ AC_DEFUN([OVS_CHECK_LINUX], [
-     AC_MSG_RESULT([$kversion])
-     if test "$version" -ge 4; then
--       if test "$version" = 4 && test "$patchlevel" -le 3; then
-+       if test "$version" = 4 && test "$patchlevel" -le 4; then
-           : # Linux 4.x
-        else
--          AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.3.x is not supported (please refer to the FAQ for advice)])
-+          AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.4.x is not supported (please refer to the FAQ for advice)])
-        fi
-     elif test "$version" = 3; then
-        : # Linux 3.x
-diff --git a/datapath/actions.c b/datapath/actions.c
-index 20413c9..719c43d 100644
---- a/datapath/actions.c
-+++ b/datapath/actions.c
-@@ -706,7 +706,8 @@ static void ovs_fragment(struct vport *vport, struct sk_buff *skb, u16 mru,
-               skb_dst_set_noref(skb, &ovs_dst);
-               IPCB(skb)->frag_max_size = mru;
--              ip_do_fragment(skb->sk, skb, ovs_vport_output);
-+              ip_do_fragment(NET_ARG(dev_net(ovs_dst.dev))
-+                      skb->sk, skb, ovs_vport_output);
-               refdst_drop(orig_dst);
-       } else if (ethertype == htons(ETH_P_IPV6)) {
-               const struct nf_ipv6_ops *v6ops = nf_get_ipv6_ops();
-@@ -727,7 +728,8 @@ static void ovs_fragment(struct vport *vport, struct sk_buff *skb, u16 mru,
-               skb_dst_set_noref(skb, &ovs_rt.dst);
-               IP6CB(skb)->frag_max_size = mru;
--              v6ops->fragment(skb->sk, skb, ovs_vport_output);
-+              v6ops->fragment(NET_ARG(dev_net(ovs_rt.dst.dev))
-+                      skb->sk, skb, ovs_vport_output);
-               refdst_drop(orig_dst);
-       } else {
-               WARN_ONCE(1, "Failed fragment ->%s: eth=%04x, MRU=%d, MTU=%d.",
-diff --git a/datapath/conntrack.c b/datapath/conntrack.c
-index 795ed91..3b9bfba 100644
---- a/datapath/conntrack.c
-+++ b/datapath/conntrack.c
-@@ -323,7 +323,7 @@ static int handle_fragments(struct net *net, struct sw_flow_key *key,
-               int err;
-               memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
--              err = ip_defrag(skb, user);
-+              err = ip_defrag(NET_ARG(net) skb, user);
-               if (err)
-                       return err;
-@@ -374,7 +374,7 @@ ovs_ct_expect_find(struct net *net, const struct nf_conntrack_zone *zone,
- {
-       struct nf_conntrack_tuple tuple;
--      if (!nf_ct_get_tuplepr(skb, skb_network_offset(skb), proto, &tuple))
-+      if (!nf_ct_get_tuplepr(skb, skb_network_offset(skb), proto, NET_ARG(net) &tuple))
-               return NULL;
-       return __nf_ct_expect_find(net, zone, &tuple);
- }
-diff --git a/datapath/datapath.c b/datapath/datapath.c
-index e3d3c8c..a4157f4 100644
---- a/datapath/datapath.c
-+++ b/datapath/datapath.c
-@@ -96,8 +96,12 @@ static bool ovs_must_notify(struct genl_family *family, struct genl_info *info,
- static void ovs_notify(struct genl_family *family, struct genl_multicast_group *grp,
-                      struct sk_buff *skb, struct genl_info *info)
- {
--      genl_notify(family, skb, genl_info_net(info),
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
-+    genl_notify(family, skb, info, GROUP_ID(grp), GFP_KERNEL);
-+#else
-+    genl_notify(family, skb, genl_info_net(info),
-                   info->snd_portid, GROUP_ID(grp), info->nlhdr, GFP_KERNEL);
-+#endif
- }
- /**
-diff --git a/datapath/linux/compat/include/linux/netfilter_ipv6.h b/datapath/linux/compat/include/linux/netfilter_ipv6.h
-index 3939e14..b724623 100644
---- a/datapath/linux/compat/include/linux/netfilter_ipv6.h
-+++ b/datapath/linux/compat/include/linux/netfilter_ipv6.h
-@@ -13,7 +13,7 @@
-  * the callback parameter needs to be in the form that older kernels accept.
-  * We don't backport the other ipv6_ops as they're currently unused by OVS. */
- struct ovs_nf_ipv6_ops {
--      int (*fragment)(struct sock *sk, struct sk_buff *skb,
-+      int (*fragment)(NET_ARG(net) struct sock *sk, struct sk_buff *skb,
-                       int (*output)(OVS_VPORT_OUTPUT_PARAMS));
- };
- #define nf_ipv6_ops ovs_nf_ipv6_ops
-diff --git a/datapath/linux/compat/include/net/ip.h b/datapath/linux/compat/include/net/ip.h
-index cd87bcc..b749301 100644
---- a/datapath/linux/compat/include/net/ip.h
-+++ b/datapath/linux/compat/include/net/ip.h
-@@ -66,8 +66,20 @@ static inline unsigned int rpl_ip_skb_dst_mtu(const struct sk_buff *skb)
- #define ip_skb_dst_mtu rpl_ip_skb_dst_mtu
- #endif /* HAVE_IP_SKB_DST_MTU */
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
-+#define NET_PARAM(x) struct net *x,
-+#define NET_ARG(x) x,
-+#define NET_DEV_NET(x) dev_net(x)
-+#define NET_DECLARE_INIT(x,y)
-+#else
-+#define NET_PARAM(x)
-+#define NET_ARG(x)
-+#define NET_DEV_NET(x)
-+#define NET_DECLARE_INIT(x,y) struct net *x = y;
-+#endif
-+
- #ifdef HAVE_IP_FRAGMENT_TAKES_SOCK
--#define OVS_VPORT_OUTPUT_PARAMS struct sock *sock, struct sk_buff *skb
-+#define OVS_VPORT_OUTPUT_PARAMS NET_PARAM(net) struct sock *sock, struct sk_buff *skb
- #else
- #define OVS_VPORT_OUTPUT_PARAMS struct sk_buff *skb
- #endif
-@@ -89,12 +101,13 @@ static inline bool ip_defrag_user_in_between(u32 user,
- #endif /* < v4.2 */
- #ifndef HAVE_IP_DO_FRAGMENT
--static inline int rpl_ip_do_fragment(struct sock *sk, struct sk_buff *skb,
-+static inline int rpl_ip_do_fragment(NET_PARAM(net) struct sock *sk, struct sk_buff *skb,
-                                    int (*output)(OVS_VPORT_OUTPUT_PARAMS))
- {
-       unsigned int mtu = ip_skb_dst_mtu(skb);
-       struct iphdr *iph = ip_hdr(skb);
-       struct rtable *rt = skb_rtable(skb);
-       struct net_device *dev = rt->dst.dev;
-+      NET_DECLARE_INIT(net, dev_net(dev));
-       if (unlikely(((iph->frag_off & htons(IP_DF)) && !skb->ignore_df) ||
-@@ -102,7 +115,7 @@ static inline int rpl_ip_do_fragment(struct sock *sk, struct sk_buff *skb,
-                     IPCB(skb)->frag_max_size > mtu))) {
-               pr_warn("Dropping packet in ip_do_fragment()\n");
--              IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS);
-+              IP_INC_STATS(net, IPSTATS_MIB_FRAGFAILS);
-               kfree_skb(skb);
-               return -EMSGSIZE;
-       }
-@@ -116,8 +129,7 @@ static inline int rpl_ip_do_fragment(struct sock *sk, struct sk_buff *skb,
- #define ip_do_fragment rpl_ip_do_fragment
- #endif /* IP_DO_FRAGMENT */
--int rpl_ip_defrag(struct sk_buff *skb, u32 user);
--#define ip_defrag rpl_ip_defrag
-+int rpl_ip_defrag(NET_PARAM(net) struct sk_buff *skb, u32 user);
- int __init rpl_ipfrag_init(void);
- void rpl_ipfrag_fini(void);
-@@ -127,14 +139,15 @@ void rpl_ipfrag_fini(void);
-  * ("inet: frag: Always orphan skbs inside ip_defrag()"), but it should be
-  * always included in kernels 4.5+. */
- #if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0)
--static inline int rpl_ip_defrag(struct sk_buff *skb, u32 user)
-+static inline int rpl_ip_defrag(NET_PARAM(net) struct sk_buff *skb, u32 user)
- {
-       skb_orphan(skb);
--      return ip_defrag(skb, user);
-+      return ip_defrag(NET_ARG(net) skb, user);
- }
--#define ip_defrag rpl_ip_defrag
- #endif
-+#define ip_defrag rpl_ip_defrag
-+
- static inline int rpl_ipfrag_init(void) { return 0; }
- static inline void rpl_ipfrag_fini(void) { }
- #endif /* HAVE_CORRECT_MRU_HANDLING && OVS_FRAGMENT_BACKPORT */
-diff --git a/datapath/linux/compat/include/net/ip6_tunnel.h b/datapath/linux/compat/include/net/ip6_tunnel.h
-index ce65087..eacf9ca 100644
---- a/datapath/linux/compat/include/net/ip6_tunnel.h
-+++ b/datapath/linux/compat/include/net/ip6_tunnel.h
-@@ -17,11 +17,15 @@ static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb,
-       pkt_len = skb->len - skb_inner_network_offset(skb);
-       /* TODO: Fix GSO for ipv6 */
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
-+      err = ip6_local_out(dev_net(dev), sk, skb);
-+#else
- #ifdef HAVE_IP6_LOCAL_OUT_SK
-       err = ip6_local_out_sk(sk, skb);
- #else
-       err = ip6_local_out(skb);
- #endif
-+#endif /* >= kernel 4.4 */
-       if (net_xmit_eval(err) != 0)
-               pkt_len = net_xmit_eval(err);
-       else
-diff --git a/datapath/linux/compat/include/net/vxlan.h b/datapath/linux/compat/include/net/vxlan.h
-index b50cd17..230f3ad 100644
---- a/datapath/linux/compat/include/net/vxlan.h
-+++ b/datapath/linux/compat/include/net/vxlan.h
-@@ -218,10 +218,20 @@ struct vxlan_dev {
- struct net_device *rpl_vxlan_dev_create(struct net *net, const char *name,
-                                   u8 name_assign_type, struct vxlan_config *conf);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
-+static inline __be16 vxlan_dev_dst_port(struct vxlan_dev *vxlan,
-+                                      unsigned short family)
-+{
-+      if (family == AF_INET6)
-+              return inet_sk(vxlan->vn6_sock->sock->sk)->inet_sport;
-+      return inet_sk(vxlan->vn4_sock->sock->sk)->inet_sport;
-+}
-+#else
- static inline __be16 vxlan_dev_dst_port(struct vxlan_dev *vxlan)
- {
-       return inet_sport(vxlan->vn_sock->sock->sk);
- }
-+#endif
- static inline netdev_features_t vxlan_features_check(struct sk_buff *skb,
-                                                    netdev_features_t features)
-diff --git a/datapath/linux/compat/ip_fragment.c b/datapath/linux/compat/ip_fragment.c
-index cf2daaa..e168196 100644
---- a/datapath/linux/compat/ip_fragment.c
-+++ b/datapath/linux/compat/ip_fragment.c
-@@ -674,11 +674,11 @@ out_fail:
- }
- /* Process an incoming IP datagram fragment. */
--int rpl_ip_defrag(struct sk_buff *skb, u32 user)
-+int rpl_ip_defrag(NET_ARG(net) struct sk_buff *skb, u32 user)
- {
-       struct net_device *dev = skb->dev ? : skb_dst(skb)->dev;
-       int vif = vrf_master_ifindex_rcu(dev);
--      struct net *net = dev_net(dev);
-+      NET_DECLARE_INIT(net, dev_net(dev));
-       struct ipq *qp;
-       IP_INC_STATS_BH(net, IPSTATS_MIB_REASMREQDS);
-diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c
-index eb397e8..5ea3c52 100644
---- a/datapath/linux/compat/stt.c
-+++ b/datapath/linux/compat/stt.c
-@@ -1450,7 +1450,11 @@ static void clean_percpu(struct work_struct *work)
- }
- #ifdef HAVE_NF_HOOKFN_ARG_OPS
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
-+#define FIRST_PARAM void *priv
-+#else
- #define FIRST_PARAM const struct nf_hook_ops *ops
-+#endif /* >= kernel 4.4 */
- #else
- #define FIRST_PARAM unsigned int hooknum
- #endif
-@@ -1498,7 +1502,9 @@ static unsigned int nf_ip_hook(FIRST_PARAM, struct sk_buff *skb, LAST_PARAM)
- static struct nf_hook_ops nf_hook_ops __read_mostly = {
-       .hook           = nf_ip_hook,
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
-       .owner          = THIS_MODULE,
-+#endif
-       .pf             = NFPROTO_IPV4,
-       .hooknum        = NF_INET_LOCAL_IN,
-       .priority       = INT_MAX,
-diff --git a/datapath/vport-vxlan.c b/datapath/vport-vxlan.c
-index c05f5d4..3cbb568 100644
---- a/datapath/vport-vxlan.c
-+++ b/datapath/vport-vxlan.c
-@@ -153,7 +153,12 @@ static int vxlan_get_egress_tun_info(struct vport *vport, struct sk_buff *skb,
- {
-       struct vxlan_dev *vxlan = netdev_priv(vport->dev);
-       struct net *net = ovs_dp_get_net(vport->dp);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
-+      unsigned short family = ip_tunnel_info_af(upcall->egress_tun_info);
-+      __be16 dst_port = vxlan_dev_dst_port(vxlan, family);
-+#else
-       __be16 dst_port = vxlan_dev_dst_port(vxlan);
-+#endif
-       __be16 src_port;
-       int port_min;
-       int port_max;
diff --git a/net/openvswitch/patches/0100-netdev-linux-Use-unsigned-int-for-ifi_flags.patch b/net/openvswitch/patches/0100-netdev-linux-Use-unsigned-int-for-ifi_flags.patch
new file mode 100644 (file)
index 0000000..290e44f
--- /dev/null
@@ -0,0 +1,28 @@
+From c27232c954cdbe0207252ad88fddad4fd6ac0fbc Mon Sep 17 00:00:00 2001
+From: Helmut Schaa <helmut.schaa@googlemail.com>
+Date: Wed, 8 Jan 2014 13:48:33 +0100
+Subject: [PATCH 100/104] netdev-linux: Use unsigned int for ifi_flags
+
+ifi_flags is unsigned, the local equivalents should do the same.
+
+Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
+---
+ lib/netdev-linux.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
+index c0471be15..0750e5f2c 100644
+--- a/lib/netdev-linux.c
++++ b/lib/netdev-linux.c
+@@ -2788,7 +2788,7 @@ update_flags(struct netdev_linux *netdev, enum netdev_flags off,
+              enum netdev_flags on, enum netdev_flags *old_flagsp)
+     OVS_REQUIRES(netdev->mutex)
+ {
+-    int old_flags, new_flags;
++    unsigned int old_flags, new_flags;
+     int error = 0;
+     old_flags = netdev->ifi_flags;
+-- 
+2.16.2
+
diff --git a/net/openvswitch/patches/0101-netdev-linux-Let-interface-flag-survive-internal-por.patch b/net/openvswitch/patches/0101-netdev-linux-Let-interface-flag-survive-internal-por.patch
new file mode 100644 (file)
index 0000000..c8bbd31
--- /dev/null
@@ -0,0 +1,41 @@
+From a6df8dd455c8be7c0c2ba79f35cf5390e892b39e Mon Sep 17 00:00:00 2001
+From: Helmut Schaa <helmut.schaa@googlemail.com>
+Date: Wed, 8 Jan 2014 13:48:49 +0100
+Subject: [PATCH 101/104] netdev-linux: Let interface flag survive internal
+ port setup
+
+Due to a race condition when bringing up an internal port on Linux
+some interface flags (e.g. IFF_MULTICAST) are falsely reset. This
+happens because netlink events may be processed after the according
+netdev has been brought up (which sets interface flags).
+
+Fix this by reading the interface flags just before updating them
+if they have not been updated by from the kernel yet.
+
+Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
+---
+ lib/netdev-linux.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
+index 0750e5f2c..59e7b9c96 100644
+--- a/lib/netdev-linux.c
++++ b/lib/netdev-linux.c
+@@ -2791,7 +2791,13 @@ update_flags(struct netdev_linux *netdev, enum netdev_flags off,
+     unsigned int old_flags, new_flags;
+     int error = 0;
+-    old_flags = netdev->ifi_flags;
++    if (!(netdev->cache_valid & VALID_DRVINFO)) {
++        /* Most likely the debvice flags are not in sync yet, fetch them now */
++        get_flags(&netdev->up, &old_flags);
++    } else {
++        old_flags = netdev->ifi_flags;
++    }
++
+     *old_flagsp = iff_to_nd_flags(old_flags);
+     new_flags = (old_flags & ~nd_to_iff_flags(off)) | nd_to_iff_flags(on);
+     if (new_flags != old_flags) {
+-- 
+2.16.2
+
diff --git a/net/openvswitch/patches/0102-python-separate-host-target-python-for-cross-compile.patch b/net/openvswitch/patches/0102-python-separate-host-target-python-for-cross-compile.patch
new file mode 100644 (file)
index 0000000..4c4f623
--- /dev/null
@@ -0,0 +1,59 @@
+From b3cc748d502f7f87aeb103b3f69573b0e640e2ba Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Wed, 28 Feb 2018 13:42:44 +0800
+Subject: [PATCH 102/104] python: separate host/target python for cross-compile
+
+At the moment, python-six is a requirement for openvswitch python
+library on target machine.
+
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ Makefile.am       |  2 +-
+ m4/openvswitch.m4 | 12 ++++--------
+ 2 files changed, 5 insertions(+), 9 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 31d633179..4b9e8d491 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -59,7 +59,7 @@ endif
+ # foo/__init__.pyc will cause Python to ignore foo.py.
+ run_python = \
+       PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH \
+-      PYTHONDONTWRITEBYTECODE=yes $(PYTHON)
++      PYTHONDONTWRITEBYTECODE=yes $(PYTHON_HOST)
+ ALL_LOCAL =
+ BUILT_SOURCES =
+diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
+index 00ffad35f..52f207bda 100644
+--- a/m4/openvswitch.m4
++++ b/m4/openvswitch.m4
+@@ -347,20 +347,16 @@ else:
+    if test $ovs_cv_python = no; then
+      AC_MSG_ERROR([cannot find python 2.7 or higher.])
+    fi
+-   AM_MISSING_PROG([PYTHON], [python])
++   AC_SUBST([PYTHON])
+    PYTHON=$ovs_cv_python
++   AM_MISSING_PROG([PYTHON_HOST], [python])
++   PYTHON_HOST=$ovs_cv_python_host
+    # HAVE_PYTHON is always true.  (Python has not always been a build
+    # requirement, so this variable is now obsolete.)
+    AC_SUBST([HAVE_PYTHON])
+    HAVE_PYTHON=yes
+-   AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON" = yes])
+-
+-   AC_MSG_CHECKING([whether $PYTHON has six library])
+-   if ! $PYTHON -c 'import six ; six.moves.range' >&AS_MESSAGE_LOG_FD 2>&1; then
+-     AC_MSG_ERROR([Missing Python six library or version too old.])
+-   fi
+-   AC_MSG_RESULT([yes])])
++   AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON" = yes])])
+ dnl Checks for Python 3.x, x >= 4.
+ AC_DEFUN([OVS_CHECK_PYTHON3],
+-- 
+2.16.2
+
diff --git a/net/openvswitch/patches/0103-ovs-ctl-fix-setting-hostname.patch b/net/openvswitch/patches/0103-ovs-ctl-fix-setting-hostname.patch
new file mode 100644 (file)
index 0000000..473f211
--- /dev/null
@@ -0,0 +1,33 @@
+From 05a6fa94778f9d6c54ca676de80708d03d6c365a Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Wed, 14 Mar 2018 16:40:01 +0800
+Subject: [PATCH 103/104] ovs-ctl: fix setting hostname
+
+The command "hostname" is not available in OpenWrt by default.
+
+The other thing to note is that currently kernel.hostname is not a fully
+qualitied name
+
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ utilities/ovs-ctl.in | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
+index 4ddc450fb..52018e6d3 100755
+--- a/utilities/ovs-ctl.in
++++ b/utilities/ovs-ctl.in
+@@ -68,9 +68,7 @@ ovs_vsctl () {
+ }
+ set_hostname () {
+-    # 'hostname -f' needs network connectivity to work.  So we should
+-    # call this only after ovs-vswitchd is running.
+-    ovs_vsctl set Open_vSwitch . external-ids:hostname="$(hostname -f)"
++    ovs_vsctl set Open_vSwitch . external-ids:hostname="$(sysctl -n kernel.hostname)"
+ }
+ set_system_ids () {
+-- 
+2.16.2
+
diff --git a/net/openvswitch/patches/0104-ovs-lib-fix-install_dir.patch b/net/openvswitch/patches/0104-ovs-lib-fix-install_dir.patch
new file mode 100644 (file)
index 0000000..f6f6747
--- /dev/null
@@ -0,0 +1,31 @@
+From d8dd661e1c100a2d2ba0361cf6c91dcdedfeeb70 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Wed, 14 Mar 2018 16:44:13 +0800
+Subject: [PATCH 104/104] ovs-lib: fix install_dir()
+
+The command "install" is not available in OpenWrt by default
+
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ utilities/ovs-lib.in | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
+index 1bccea0c5..457297f3f 100644
+--- a/utilities/ovs-lib.in
++++ b/utilities/ovs-lib.in
+@@ -157,7 +157,10 @@ install_dir () {
+     [ "${OVS_USER##*:}" != "" ] && INSTALL_GROUP="${OVS_USER##*:}"
+     if test ! -d "$DIR"; then
+-        install -d -m "$INSTALL_MODE" -o "$INSTALL_USER" -g "$INSTALL_GROUP" "$DIR"
++        mkdir -p "$DIR"
++        chmod "$INSTALL_MODE"
++        chown "$INSTALL_USER" "$DIR"
++        chgrp "$INSTALL_GROUP" "$DIR"
+         restorecon "$DIR" >/dev/null 2>&1
+     fi
+ }
+-- 
+2.16.2
+
index 2cdaaa9fdc67e84d7757f76f080235926db7b6fe..d5269cc039c55280738e21ca2906b882384d68a8 100644 (file)
@@ -15,7 +15,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/p910nd
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=COPYING
-PKG_MD5SUM:=69461a6c54dca0b13ecad5b83864b43e
+PKG_HASH:=4ac980a3ae24babae6f70f0a692625ece03a4a92c357fbb10d2e368386c3c26f
 PKG_MAINTAINER:=Philipp Kerling <pkerling@casix.org>
 
 PKG_INSTALL:=1
diff --git a/net/pagekitec/Makefile b/net/pagekitec/Makefile
new file mode 100644 (file)
index 0000000..1abed4c
--- /dev/null
@@ -0,0 +1,104 @@
+#
+# Copyright (C) 2012-2018 Karl Palsson <karlp@tweak.net.au>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pagekitec
+PKG_REV:=0.91.171102
+PKG_VERSION:=$(PKG_REV)C
+PKG_RELEASE:=1
+PKG_LICENSE:=Apache-2.0
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/pagekite/libpagekite.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=v$(PKG_REV)
+
+include $(INCLUDE_DIR)/package.mk
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+CONFIGURE_ARGS += --without-java
+
+define Package/pagekitec/default
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Make localhost servers publicly visible.
+  URL:=https://pagekite.net/wiki/Floss/LibPageKite/
+  MAINTAINER:= Karl Palsson <karlp@tweak.net.au>
+  DEPENDS:=+libopenssl +libpthread +libev
+endef
+
+define Package/libpagekite
+  $(call Package/pagekitec/default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= (library)
+endef
+
+define Package/pagekitec
+  $(call Package/pagekitec/default)
+  DEPENDS:=+libpagekite
+endef
+
+define Package/pagekitec/default/description
+PageKite is a system for running publicly visible servers (generally
+web servers) on machines without a direct connection to the Internet,
+such as mobile devices or computers behind restrictive firewalls.
+PageKite works around NAT, firewalls and IP-address limitations by
+using a combination of tunnels and reverse proxies.
+
+This package provides an implementation of the PageKite Protocol in C,
+optimized for high-performance or embedded applications.
+
+endef
+
+define Package/libpagekite/description
+  $(call Package/pagekitec/default/description)
+
+This package contains the core library
+endef
+
+define Package/pagekitec/description
+  $(call Package/pagekitec/default/description)
+
+This package contains a basic backend useful for exposing http/ssh servers.
+
+Basic UCI support for configuring this backend is also included.
+endef
+
+define Package/pagekitec/conffiles
+/etc/config/pagekitec
+endef
+
+define Build/Configure
+       (cd $(PKG_BUILD_DIR); ./autogen.sh );
+       $(call Build/Configure/Default)
+endef
+
+#this installs files into ./staging_dir/. so that you can cross compile from the host
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/{include,lib/pkgconfig}
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libpagekite/pagekite.h $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpagekite.{a,so*} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libpagekite/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libpagekite.so* $(1)/usr/lib
+endef
+
+define Package/pagekitec/install
+       $(CP) ./files/* $(1)/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pagekitec $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,pagekitec))
+$(eval $(call BuildPackage,libpagekite))
diff --git a/net/pagekitec/files/etc/config/pagekitec b/net/pagekitec/files/etc/config/pagekitec
new file mode 100644 (file)
index 0000000..a26f615
--- /dev/null
@@ -0,0 +1 @@
+config pagekitec pagekitec
diff --git a/net/pagekitec/files/etc/init.d/pagekitec b/net/pagekitec/files/etc/init.d/pagekitec
new file mode 100755 (executable)
index 0000000..56dab0f
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh /etc/rc.common
+# Oct 2012, karlp@remake.is
+START=90
+APP=pagekitec
+USE_PROCD=1
+
+add_instance() {
+       local cfg="$1"
+       local kitename kitesecret simple_http simple_ssh static
+       config_get kitename "$cfg" kitename
+       config_get kitesecret "$cfg" kitesecret
+       [ -z "$kitename" -o -z "$kitesecret" ] && {
+               echo "Both kitename and kitesecret must be specified"
+               return 1
+       }
+       config_get_bool simple_http "$cfg" simple_http 0
+       config_get_bool simple_ssh "$cfg" simple_ssh 0
+       config_get_bool static "$cfg" static 0
+
+       procd_open_instance
+       procd_set_param command $APP
+       procd_append_param command -s
+       [ $static -eq 1 ] && procd_append_param command -S
+       [ $simple_http -eq 1 ] && procd_append_param command 80 http $kitename 80 $kitesecret
+       [ $simple_ssh -eq 1 ] && procd_append_param command 22 raw $kitename 443 $kitesecret
+       procd_close_instance
+}
+
+start_service() {
+       config_load pagekitec && config_foreach add_instance pagekitec
+}
+
+service_triggers()
+{
+       procd_add_reload_trigger "pagekitec"
+}
index f6e152d658a18acf7efadc16e3030ce04c7a6e6b..7891f0c28146943ef2f500b9c582aae123758546 100644 (file)
@@ -8,14 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pingcheck
-PKG_VERSION:=0.1
+PKG_VERSION:=2017-10-02
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=511a6bedd65169ffd1aadb38dd470d53d445cffcc3a322ec2dd0dee6009162a6
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=https://github.com/br101/pingcheck.git
+PKG_SOURCE_URL:=https://github.com/br101/pingcheck
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=0f099998782f550e2abebdc65bcc3e969b798769
+PKG_SOURCE_VERSION:=12e65e2f3fd2a17db785d28756df43ccade29b1b
 
 PKG_MAINTAINER:=Bruno Randolf <br1@einfach.org>
 PKG_LICENSE:=GPL-2.0+
@@ -31,12 +32,14 @@ define Package/pingcheck
        DEPENDS:=+libubus +libuci
        MAINTAINER:=Bruno Randolf <br1@einfach.org>
        TITLE:=Check Internet and interface connectivity
+       URL:=https://github.com/br101/pingcheck
 endef
 
 define Package/pingcheck/description
-Checks by using "ping" (ICMP echo) wether a configured host (normally on the
-internet) can be reached via a specific interface. Then makes this information
-available via ubus and triggers "online" and "offline" scripts.
+Checks by using "ping" (ICMP echo) or by opening connections to TCP port 80
+wether a configured host (normally on the internet) can be reached via a
+specific interface. Then makes this information available via ubus and triggers
+"online" and "offline" scripts.
 endef
 
 define Package/pingcheck/conffiles
@@ -45,7 +48,7 @@ endef
 
 define Package/pingcheck/install
        $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/pingcheck $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/pingcheck $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./pingcheck.init $(1)/etc/init.d/pingcheck
        $(INSTALL_DIR) $(1)/etc/config
diff --git a/net/pixiewps/Makefile b/net/pixiewps/Makefile
new file mode 100644 (file)
index 0000000..9d5fd41
--- /dev/null
@@ -0,0 +1,49 @@
+# Copyright (C) 2017-2018 Yousong Zhou
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pixiewps
+PKG_VERSION:=1.4.2
+PKG_RELEASE:=2
+PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/wiire-a/pixiewps/releases/download/v$(PKG_VERSION)
+PKG_HASH:=c4dc0569e476ebdbd85992da2d1ff799db97ed0040da9dc44e13d08a97a9de1e
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=LICENSE.md
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/pixiewps
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=wireless
+  TITLE:=An offline WPS bruteforce utility
+  URL:=https://github.com/wiire-a/pixiewps
+  DEPENDS:=+libpthread
+endef
+
+define Package/pixiewps/description
+  Pixiewps is a tool written in C used to bruteforce offline the WPS PIN
+  exploiting the low or non-existing entropy of some Access Points, the so-called
+  "pixie-dust attack" discovered by Dominique Bongard in summer 2014.  It is
+  meant for educational purposes only.
+endef
+
+# override flags by pixiewps' own Makefile
+MAKE_FLAGS += \
+       CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
+       CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
+       LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
+
+define Package/pixiewps/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/pixiewps $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,pixiewps))
index 48c24a1dc2eb87e4a104434affaebdb5922ab540..93aa18a26a28b5e6cfd98904d27268f67ba77a02 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=polipo
 PKG_VERSION:=1.1.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.pps.jussieu.fr/~jch/software/files/$(PKG_NAME)/
-PKG_MD5SUM:=86939e331e656f638271f578b6e3f893
+PKG_HASH:=a259750793ab79c491d05fcee5a917faf7d9030fb5d15e05b3704e9c9e4ee015
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -33,6 +33,8 @@ define Package/polipo/description
  by a larger group.
 endef
 
+TARGET_CFLAGS += -DHAVE_IPv6
+
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                CC="$(TARGET_CC)" \
index fdc4b39d836905700034c620404f7d083711f58f..4882b4feaa044a4650eb02031191fe7d8b2c8113 100644 (file)
@@ -13,6 +13,7 @@ PKG_MAINTAINER:=Mike Maraya <mike.maraya@gmail.com>
 PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=LICENSE
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MIRROR_HASH:=0bffa393e740711db3eb930fc2674843c56b0dc9db15ac1887fec8776401af2a
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=git://github.com/mmaraya/port-mirroring.git
 PKG_SOURCE_PROTO:=git
index 03969f79d6a1ec4eb8224462131a82151068eaa6..061555169879635e8db9608d98ac59aa2c61e6dd 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=http://neil.brown.name/portmap/
-PKG_MD5SUM:=ac108ab68bf0f34477f8317791aaf1ff
+PKG_HASH:=02c820d39f3e6e729d1bea3287a2d8a6c684f1006fb9612f97dcad4a281d41de
 
 PKG_LICENSE:=BSD-4c
 PKG_LICENSE_FILES:=portmap.man
index f188cc07668592159f9cfe060033c73324bfa5e8..62a33881f5dffae5caf0bb0c4a89f163df6083c9 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/poptop
-PKG_MD5SUM:=36f9f45c6ffa92bc3b6e24ae2d053505
+PKG_HASH:=8fcd8b8a42de2af59e9fe8cbaa9f894045c977f4d038bbd6346a8522bb7f06c0
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
index 8d482089b779033d2217f24ec824bc2b4fbc44a8..b71251d077b2beab40fae395741d9a6ecadd33be 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=privoxy
 PKG_VERSION:=3.0.26
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=privoxy-$(PKG_VERSION)-stable-src.tar.gz
 PKG_SOURCE_URL:=@SF/ijbswa
-PKG_MD5SUM:=8a1c842112ccea68c19b7ceb4a0e999f
+PKG_HASH:=57e415b43ee5dfdca74685cc034053eaae962952fdabd086171551a86abf9cd8
 PKG_BUILD_DIR:=$(BUILD_DIR)/privoxy-$(PKG_VERSION)-stable
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
@@ -21,7 +21,7 @@ PKG_INSTALL:=1
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=LICENSE
 
-PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
+PKG_MAINTAINER:=
 
 PKG_CONFIG_DEPENDS:= \
   CONFIG_IPV6 \
@@ -49,7 +49,7 @@ PKG_CONFIG_DEPENDS:= \
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/$(PKG_NAME)
+define Package/privoxy
   SECTION:=net
   CATEGORY:=Network
   SUBMENU:=Web Servers/Proxies
@@ -61,12 +61,12 @@ define Package/$(PKG_NAME)
 endef
 
 # shown in LuCI package description
-define Package/$(PKG_NAME)/description
+define Package/privoxy/description
 $(TITLE) - Homepage: www.privoxy.org
 endef
 
 # shown in make menuconfig <Help>
-define Package/$(PKG_NAME)/config
+define Package/privoxy/config
        help
                Privoxy is a web proxy with advanced filtering capabilities for protecting
                privacy, modifying web page content, managing cookies, controlling access,
@@ -77,7 +77,6 @@ define Package/$(PKG_NAME)/config
                Run as : $(USERID)
                Version: $(PKG_VERSION)-$(PKG_RELEASE)
                Home   : $(URL)
-               $(PKG_MAINTAINER)
 
        source "$(SOURCE)/Config.in"
 endef
@@ -110,14 +109,14 @@ CONFIGURE_ARGS += \
 # needed otherwise errors during compile
 MAKE_FLAGS:=
 
-define Package/$(PKG_NAME)/conffiles
+define Package/privoxy/conffiles
 /etc/config/privoxy
 /etc/privoxy/user.action
 /etc/privoxy/user.filter
 /etc/privoxy/user.trust
 endef
 
-define Package/$(PKG_NAME)/preinst
+define Package/privoxy/preinst
        #!/bin/sh
        [ -n "$${IPKG_INSTROOT}" ] && exit 0    # if run within buildroot exit
 
@@ -127,7 +126,7 @@ define Package/$(PKG_NAME)/preinst
        exit 0  # suppress errors from stop command
 endef
 
-define Package/$(PKG_NAME)/install
+define Package/privoxy/install
        if [ -f $(PKG_INSTALL_DIR)/etc/privoxy/trust ]; then \
                mv -f $(PKG_INSTALL_DIR)/etc/privoxy/trust $(PKG_INSTALL_DIR)/etc/privoxy/user.trust; \
        fi
@@ -155,10 +154,10 @@ define Package/$(PKG_NAME)/install
        $(INSTALL_CONF) ./files/privoxy.config $(1)/etc/config/privoxy
 endef
 
-define Package/$(PKG_NAME)/postinst
+define Package/privoxy/postinst
        #!/bin/sh
        grep -i privoxy $${IPKG_INSTROOT}/etc/services >/dev/null 2>&1 || \
                echo -e "privoxy\t8118" >> $${IPKG_INSTROOT}/etc/services
 endef
 
-$(eval $(call BuildPackage,$(PKG_NAME)))
+$(eval $(call BuildPackage,privoxy))
index b35fd03c1606a621508fdca564123110ab83a459..f08b7d2636ac1ec589876ff3eef103c2c02eac4a 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://prosody.im/downloads/source
-PKG_MD5SUM:=d743adea6cfbaacc3a24cc0c3928bb1b
+PKG_HASH:=1a59a322b71928a21985522aa00d0eab3552208d7bf9ecb318542a1b2fee3e8d
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=MIT/X11
 
index 09e59370916daeadad9c74e649fd745d739dc25b..7fee5712785c3f9fef68b181979ebfb11f60bf67 100644 (file)
@@ -21,6 +21,7 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/phhusson/quassel-irssi
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_MIRROR_HASH:=fd13b2497e3b0d0779e0ce3d8b27c37e207d2a73b5b6dc0cb2799bd4472fc5e1
 
 PKG_MAINTAINER:=Ben Rosser <rosser.bjr@gmail.com>
 
index 26cacd7770c3665ad2969b6fa396238f4e6f7989..513e0bbac8a121c42b123f993dc9e329866329f3 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008-2016 OpenWrt.org
+# Copyright (C) 2008-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 #
@@ -7,28 +7,28 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=radicale
-PKG_VERSION:=1.1.1
-PKG_RELEASE:=2
+PKG_VERSION:=1.1.6
+PKG_RELEASE:=1
 PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
 
-PKG_SOURCE:=Radicale-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pypi.python.org/packages/source/R/Radicale/
-PKG_MD5SUM:=a29dd538377ea24cec83237a636122ae
-
-# needed for "r"adicale <-> "R"adicale
-PKG_BUILD_DIR:=$(BUILD_DIR)/Radicale-$(PKG_VERSION)
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL=https://github.com/Kozea/Radicale
+PKG_SOURCE_VERSION:=7568ec39f09a753217fb2d525c5f8db64f4d98f4
+PKG_MIRROR_HASH:=73de51e296479f860d4d8cd383a6aa34e8c702d9fca63b0499c7fcc2e794e6df
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../../lang/python/python-package.mk
+include ../../lang/python/python3-package.mk
 
 # no default dependencies
 PKG_DEFAULT_DEPENDS:=
 
-define Package/$(PKG_NAME)/Default
+define Package/radicale/Default
   SECTION:=net
   CATEGORY:=Network
   SUBMENU:=Web Servers/Proxies
@@ -37,29 +37,29 @@ define Package/$(PKG_NAME)/Default
   PKGARCH:=all
   USERID:=radicale=5232:radicale=5232
 endef
-define Package/$(PKG_NAME)-py2
-  $(call Package/$(PKG_NAME)/Default)
+define Package/radicale-py2
+  $(call Package/radicale/Default)
   TITLE+= (Python 2)
   VARIANT:=2
   DEPENDS:=+python-logging +python-openssl +python-xml +python-codecs
 endef
-define Package/$(PKG_NAME)-py3
-  $(call Package/$(PKG_NAME)/Default)
+define Package/radicale-py3
+  $(call Package/radicale/Default)
   TITLE+= (Python 3)
   VARIANT:=3
   DEPENDS:=+python3-logging +python3-openssl +python3-xml +python3-codecs +python3-email
 endef
 
 # shown in LuCI package description
-define Package/$(PKG_NAME)-py2/description
+define Package/radicale-py2/description
 Radicale CalDAV/CardDAV server (Python 2) - Homepage: http://radicale.org/
 endef
-define Package/$(PKG_NAME)-py3/description
+define Package/radicale-py3/description
 Radicale CalDAV/CardDAV server (Python 3) - Homepage: http://radicale.org/
 endef
 
 # shown in make menuconfig <Help>
-define Package/$(PKG_NAME)-py2/config
+define Package/radicale-py2/config
     help
        The Radicale Project is a CalDAV (calendar) and CardDAV (contact) server.
        It aims to be a light solution, easy to use, easy to install, easy to configure.
@@ -69,14 +69,14 @@ define Package/$(PKG_NAME)-py2/config
        Version : $(PKG_VERSION)
        Homepage: http://radicale.org/
 endef
-Package/$(PKG_NAME)-py3/config = $(Package/$(PKG_NAME)-py2/config)
+Package/radicale-py3/config = $(Package/radicale-py2/config)
 
-define Package/$(PKG_NAME)-py2/conffiles
+define Package/radicale-py2/conffiles
 /etc/config/radicale
 /etc/radicale/users
 /etc/radicale/rights
 endef
-Package/$(PKG_NAME)-py3/conffiles = $(Package/$(PKG_NAME)-py2/conffiles)
+Package/radicale-py3/conffiles = $(Package/radicale-py2/conffiles)
 
 define Build/Configure
        # nothing to configure
@@ -85,7 +85,7 @@ define Build/Compile
        # nothing to compile
 endef
 
-define Package/$(PKG_NAME)-py2/preinst
+define Package/radicale-py2/preinst
        #!/bin/sh
        [ -n "$${IPKG_INSTROOT}" ] && exit 0    # if run within buildroot exit
 
@@ -94,11 +94,11 @@ define Package/$(PKG_NAME)-py2/preinst
 
        exit 0  # suppress errors from stop command
 endef
-define Package/$(PKG_NAME)-py3/preinst
-$(call Package/$(PKG_NAME)-py2/preinst)
+define Package/radicale-py3/preinst
+$(call Package/radicale-py2/preinst)
 endef
 
-define Package/$(PKG_NAME)/inst_all
+define Package/radicale/inst_all
        $(INSTALL_DIR)  $(1)/etc/init.d
        $(INSTALL_BIN)  ./files/radicale.init    $(1)/etc/init.d/radicale
 
@@ -120,27 +120,27 @@ define Package/$(PKG_NAME)/inst_all
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/radicale $(1)/usr/bin/
 endef
-define Package/$(PKG_NAME)-py2/install
-       $(call Package/$(PKG_NAME)/inst_all, $(1))
+define Package/radicale-py2/install
+       $(call Package/radicale/inst_all, $(1))
        $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/radicale
        $(CP) $(PKG_BUILD_DIR)/radicale/* $(1)$(PYTHON_PKG_DIR)/radicale
 endef
-define Package/$(PKG_NAME)-py3/install
-       $(call Package/$(PKG_NAME)/inst_all, $(1))
+define Package/radicale-py3/install
+       $(call Package/radicale/inst_all, $(1))
        $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)/radicale
        $(CP) $(PKG_BUILD_DIR)/radicale/* $(1)$(PYTHON3_PKG_DIR)/radicale
 endef
 
-define Package/$(PKG_NAME)-py2/postinst
+define Package/radicale-py2/postinst
        #!/bin/sh
        # patch /usr/bin/radicale force run using python2
        /bin/sed -i 's/python/python2/' $${IPKG_INSTROOT}/usr/bin/radicale
 endef
-define Package/$(PKG_NAME)-py3/postinst
+define Package/radicale-py3/postinst
        #!/bin/sh
        # patch /usr/bin/radicale force run using python3
        /bin/sed -i 's/python/python3/' $${IPKG_INSTROOT}/usr/bin/radicale
 endef
 
-$(eval $(call BuildPackage,$(PKG_NAME)-py2))
-$(eval $(call BuildPackage,$(PKG_NAME)-py3))
+$(eval $(call BuildPackage,radicale-py2))
+$(eval $(call BuildPackage,radicale-py3))
index 7387e03209d6e335515b2c612c08668e5f3b74d0..2a37ad3b605aa6e398267d1f7cc5ab9be3267992 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://software.uninett.no/radsecproxy/
-PKG_MD5SUM:=b868f7faf4887a10376d1bd96ef75368
+PKG_HASH:=9923203c3aaf17e31d5bc7a61b99e5a6aa0ef19a8397616f6ef9c0c41948f7d2
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=LICENSE
index 1a499de7c64ab8a9e65d1061f49e046e358f114b..79af9f854a829213c8b6d245144d126885278529 100644 (file)
@@ -1,5 +1,6 @@
 #
 # Copyright (C) 2012-2015 OpenWrt.org
+# Copyright (C) 2017 Yousong Zhou
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,46 +9,50 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=reaver
-PKG_VERSION:=1.4
-PKG_RELEASE:=2
+PKG_VERSION:=1.6.4
+PKG_RELEASE:=1
 PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/reaver-wps
-PKG_MD5SUM:=05441dda7bacfcbe1e831c85d1ea3bc9
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/t6x/reaver-wps-fork-t6x/releases/download/v$(PKG_VERSION)
+PKG_HASH:=bf63b3d5a5596b0bd292a995f778dc99b0b89af88237cc2cfd7c4abbce942bb2
+
 PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=docs/LICENSE
 
 PKG_USE_MIPS16:=0
 PKG_AUTOMAKE_PATHS:=src
 PKG_FIXUP:=autoreconf
 
 include $(INCLUDE_DIR)/package.mk
-
 CONFIGURE_PATH:=src
 MAKE_PATH:=src
 
+CONFIGURE_ARGS += --enable-savetocurrent
+
 define Package/reaver
   SECTION:=net
   CATEGORY:=Network
   SUBMENU:=wireless
   TITLE:=Efficient brute force attack against Wifi Protected Setup
-  URL:=https://code.google.com/p/reaver-wps/
-  DEPENDS:=+libpcap +libsqlite3
+  URL:=https://github.com/t6x/reaver-wps-fork-t6x
+  DEPENDS:=+libpcap
 endef
 
 define Package/reaver/description
-  Reaver targets the external registrar functionality mandated by the WiFi
-  Protected Setup specification.
-  Access points will provide authenticated registrars with their current
-  wireless configuration (including the WPA PSK), and also accept a new
-  configuration from the registrar.
+  Reaver has been designed to be a robust and practical attack against Wi-Fi
+  Protected Setup (WPS) registrar PINs in order to recover WPA/WPA2
+  passphrases. It has been tested against a wide variety of access points and
+  WPS implementations.
+
+  This is reaver-wps-fork-t6x, a community forked version, which has included
+  various bug fixes and additional attack method (the offline Pixie Dust
+  attack).
 endef
 
 define Package/reaver/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/{reaver,wash} $(1)/usr/bin/
-       $(INSTALL_DIR) $(1)/etc/reaver
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/reaver.db $(1)/etc/reaver/
 endef
 
 $(eval $(call BuildPackage,reaver))
diff --git a/net/reaver/patches/0001-wpscrack-big-endian-fixes.patch b/net/reaver/patches/0001-wpscrack-big-endian-fixes.patch
deleted file mode 100644 (file)
index da76c2e..0000000
+++ /dev/null
@@ -1,565 +0,0 @@
-From 4e7af9f022996cb0a03b30f6af265b757807dfa2 Mon Sep 17 00:00:00 2001
-From: Paul Fertser <fercerpav@gmail.com>
-Date: Wed, 27 Jun 2012 17:44:55 +0400
-Subject: [PATCH 1/3] wpscrack: big-endian fixes
-
-This should fix access to the radiotap, 802.11, LLC/SNAP and WFA
-headers' fields. Run-time tested on an ar71xx BE system.
-
-Signed-off-by: Paul Fertser <fercerpav@gmail.com>
----
- src/80211.c    |   65 +++++++++++++++++++------------
- src/builder.c  |   23 +++++------
- src/defs.h     |  116 +++++++++++++++++++++++++++++++++++++++-----------------
- src/exchange.c |   23 ++++++-----
- src/wpsmon.c   |   13 ++++--
- 5 files changed, 151 insertions(+), 89 deletions(-)
-
-diff --git a/src/80211.c b/src/80211.c
-index c2aff59..19f1e92 100644
---- a/src/80211.c
-+++ b/src/80211.c
-@@ -90,17 +90,19 @@ void read_ap_beacon()
-                 if(header.len >= MIN_BEACON_SIZE)
-                 {
-                         rt_header = (struct radio_tap_header *) radio_header(packet, header.len);
--                        frame_header = (struct dot11_frame_header *) (packet + rt_header->len);
--
-+                      size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+                      frame_header = (struct dot11_frame_header *) (packet + rt_header_len);
-+                      
-                       if(is_target(frame_header))
-                       {
--                                if(frame_header->fc.type == MANAGEMENT_FRAME && frame_header->fc.sub_type == SUBTYPE_BEACON)
-+                                if((frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
-+                                 __cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON))
-                                 {
--                                              beacon = (struct beacon_management_frame *) (packet + rt_header->len + sizeof(struct dot11_frame_header));
-+                                              beacon = (struct beacon_management_frame *) (packet + rt_header_len + sizeof(struct dot11_frame_header));
-                                               set_ap_capability(beacon->capability);
-                                       /* Obtain the SSID and channel number from the beacon packet */
--                                      tag_offset = rt_header->len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-+                                      tag_offset = rt_header_len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-                                       channel = parse_beacon_tags(packet, header.len);
-                                       
-                                       /* If no channel was manually specified, switch to the AP's current channel */
-@@ -135,29 +137,31 @@ int8_t signal_strength(const u_char *packet, size_t len)
-       {
-               header = (struct radio_tap_header *) packet;
--              if((header->flags & SSI_FLAG) == SSI_FLAG)
-+              uint32_t flags = __le32_to_cpu(header->flags);
-+              
-+              if((flags & SSI_FLAG) == SSI_FLAG)
-               {
--                      if((header->flags & TSFT_FLAG) == TSFT_FLAG)
-+                      if((flags & TSFT_FLAG) == TSFT_FLAG)
-                       {
-                               offset += TSFT_SIZE;
-                       }
--                      if((header->flags & FLAGS_FLAG) == FLAGS_FLAG)
-+                      if((flags & FLAGS_FLAG) == FLAGS_FLAG)
-                       {
-                               offset += FLAGS_SIZE;
-                       }
-       
--                      if((header->flags & RATE_FLAG) == RATE_FLAG)
-+                      if((flags & RATE_FLAG) == RATE_FLAG)
-                       {
-                               offset += RATE_SIZE;
-                       }
--                      if((header->flags & CHANNEL_FLAG) == CHANNEL_FLAG)
-+                      if((flags & CHANNEL_FLAG) == CHANNEL_FLAG)
-                       {
-                               offset += CHANNEL_SIZE;
-                       }
--                      if((header->flags & FHSS_FLAG) == FHSS_FLAG)
-+                      if((flags & FHSS_FLAG) == FHSS_FLAG)
-                       {
-                               offset += FHSS_FLAG;
-                       }
-@@ -196,11 +200,13 @@ int is_wps_locked()
-               if(header.len >= MIN_BEACON_SIZE)
-               {
-                       rt_header = (struct radio_tap_header *) radio_header(packet, header.len);
--                      frame_header = (struct dot11_frame_header *) (packet + rt_header->len);
-+                      size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+                      frame_header = (struct dot11_frame_header *) (packet + rt_header_len);
-                       if(memcmp(frame_header->addr3, get_bssid(), MAC_ADDR_LEN) == 0)
-                       {
--                              if(frame_header->fc.type == MANAGEMENT_FRAME && frame_header->fc.sub_type == SUBTYPE_BEACON)
-+                                if((frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
-+                                 __cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON))
-                               {
-                                       if(parse_wps_parameters(packet, header.len, &wps))
-                                       {
-@@ -411,24 +417,30 @@ int associate_recv_loop()
-                 if(header.len >= MIN_AUTH_SIZE)
-                 {
-                       rt_header = (struct radio_tap_header *) radio_header(packet, header.len);
--                        dot11_frame = (struct dot11_frame_header *) (packet + rt_header->len);
-+                      size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+                      dot11_frame = (struct dot11_frame_header *) (packet + rt_header_len);
-                         if((memcmp(dot11_frame->addr3, get_bssid(), MAC_ADDR_LEN) == 0) &&
-                            (memcmp(dot11_frame->addr1, get_mac(), MAC_ADDR_LEN) == 0))
-                         {
--                              if(dot11_frame->fc.type == MANAGEMENT_FRAME)
-+                                if((dot11_frame->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE)) ==
-+                                 __cpu_to_le16(IEEE80211_FTYPE_MGMT))
-                               {
--                                      auth_frame = (struct authentication_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header->len);
--                                      assoc_frame = (struct association_response_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header->len);
-+                                      auth_frame = (struct authentication_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header_len);
-+                                      assoc_frame = (struct association_response_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header_len);
-                                       /* Did we get an authentication packet with a successful status? */
--                                      if((dot11_frame->fc.sub_type == SUBTYPE_AUTHENTICATION) && (auth_frame->status == AUTHENTICATION_SUCCESS))
-+                                      if((dot11_frame->fc & __cpu_to_le16(IEEE80211_FCTL_STYPE)) ==
-+                                         __cpu_to_le16(IEEE80211_STYPE_AUTH)
-+                                         && (auth_frame->status == __cpu_to_le16(AUTHENTICATION_SUCCESS)))
-                                               {
-                                                       ret_val = AUTH_OK;
-                                                       break;
-                                               }
-                                       /* Did we get an association packet with a successful status? */
--                                              else if((dot11_frame->fc.sub_type == SUBTYPE_ASSOCIATION) && (assoc_frame->status == ASSOCIATION_SUCCESS))
-+                                              else if((dot11_frame->fc & __cpu_to_le16(IEEE80211_FCTL_STYPE)) ==
-+                                              __cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP)
-+                                              && (assoc_frame->status == __cpu_to_le16(ASSOCIATION_SUCCESS)))
-                                       {
-                                               ret_val = ASSOCIATE_OK;
-                                               break;
-@@ -455,13 +467,14 @@ enum encryption_type supported_encryption(const u_char *packet, size_t len)
-       if(len > MIN_BEACON_SIZE)
-       {
-               rt_header = (struct radio_tap_header *) radio_header(packet, len);
--              beacon = (struct beacon_management_frame *) (packet + rt_header->len + sizeof(struct dot11_frame_header));
--              offset = tag_offset = rt_header->len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-+              size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+              beacon = (struct beacon_management_frame *) (packet + rt_header_len + sizeof(struct dot11_frame_header));
-+              offset = tag_offset = rt_header_len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-               
-               tag_len = len - tag_offset;
-               tag_data = (const u_char *) (packet + tag_offset);
--              if((beacon->capability & CAPABILITY_WEP) == CAPABILITY_WEP)
-+              if((__le16_to_cpu(beacon->capability) & CAPABILITY_WEP) == CAPABILITY_WEP)
-               {
-                       enc = WEP;
-@@ -509,7 +522,7 @@ int parse_beacon_tags(const u_char *packet, size_t len)
-       struct radio_tap_header *rt_header = NULL;
-       rt_header = (struct radio_tap_header *) radio_header(packet, len);
--      tag_offset = rt_header->len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-+      tag_offset = __le16_to_cpu(rt_header->len) + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-       if(tag_offset < len)
-       {
-@@ -548,7 +561,7 @@ int parse_beacon_tags(const u_char *packet, size_t len)
-               {
-                       if(ie_len  == 1)
-                       {
--                              memcpy((int *) &channel, channel_data, ie_len);
-+                              channel = *(uint8_t*)channel_data;
-                       }
-                       free(channel_data);
-               }
-@@ -603,13 +616,13 @@ int check_fcs(const u_char *packet, size_t len)
-       if(len > 4)
-       {
-               /* Get the packet's reported FCS (last 4 bytes of the packet) */
--              memcpy((uint32_t *) &fcs, (packet + (len-4)), 4);
-+              fcs = __le32_to_cpu(*(uint32_t*)(packet + (len-4)));
-               /* FCS is not calculated over the radio tap header */
-               if(has_rt_header())
-               {
-                       rt_header = (struct radio_tap_header *) packet;
--                      offset += rt_header->len;
-+                      offset += __le16_to_cpu(rt_header->len);
-               }
-               if(len > offset)
-diff --git a/src/builder.c b/src/builder.c
-index 37f2de7..6bf89e7 100644
---- a/src/builder.c
-+++ b/src/builder.c
-@@ -44,9 +44,8 @@ const void *build_radio_tap_header(size_t *len)
-               memset((void *) buf, 0, sizeof(struct radio_tap_header));
-               rt_header = (struct radio_tap_header *) buf;
--              rt_header->len = sizeof(struct radio_tap_header);
--      
--              *len = rt_header->len;
-+              *len = sizeof(struct radio_tap_header);
-+              rt_header->len = __cpu_to_le16(*len);
-       }
-       
-       return buf;
-@@ -67,9 +66,9 @@ const void *build_dot11_frame_header(uint16_t fc, size_t *len)
-       
-               frag_seq += SEQ_MASK;
--              header->duration = DEFAULT_DURATION;
--              memcpy((void *) &header->fc, (void *) &fc, sizeof(struct frame_control));
--              header->frag_seq = frag_seq;
-+              header->duration = __cpu_to_le16(DEFAULT_DURATION);
-+              header->fc = __cpu_to_le16(fc);
-+              header->frag_seq = __cpu_to_le16(frag_seq);
-               memcpy((void *) header->addr1, get_bssid(), MAC_ADDR_LEN);
-               memcpy((void *) header->addr2, get_mac(), MAC_ADDR_LEN);
-@@ -91,8 +90,8 @@ const void *build_authentication_management_frame(size_t *len)
-               memset((void *) buf, 0, *len);
-               frame = (struct authentication_management_frame *) buf;
--              frame->algorithm = OPEN_SYSTEM;
--              frame->sequence = 1;
-+              frame->algorithm = __cpu_to_le16(OPEN_SYSTEM);
-+              frame->sequence = __cpu_to_le16(1);
-               frame->status = 0;
-       }
-       
-@@ -111,8 +110,8 @@ const void *build_association_management_frame(size_t *len)
-               memset((void *) buf, 0, *len);
-               frame = (struct association_request_management_frame *) buf;
--              frame->capability = get_ap_capability();
--              frame->listen_interval = LISTEN_INTERVAL;
-+              frame->capability = __cpu_to_le16(get_ap_capability());
-+              frame->listen_interval = __cpu_to_le16(LISTEN_INTERVAL);
-       }
-       return buf;
-@@ -133,7 +132,7 @@ const void *build_llc_header(size_t *len)
-               header->dsap = LLC_SNAP;
-               header->ssap = LLC_SNAP;
-               header->control_field = UNNUMBERED_FRAME;
--              header->type = DOT1X_AUTHENTICATION;
-+              header->type = __cpu_to_be16(DOT1X_AUTHENTICATION);
-       }
-@@ -279,7 +278,7 @@ const void *build_wfa_header(uint8_t op_code, size_t *len)
-               header = (struct wfa_expanded_header *) buf;
-       
-               memcpy(header->id, WFA_VENDOR_ID, sizeof(header->id));
--              header->type = SIMPLE_CONFIG;
-+              header->type = __cpu_to_be32(SIMPLE_CONFIG);
-               header->opcode = op_code;
-       }
-       
-diff --git a/src/defs.h b/src/defs.h
-index b2f45ea..0c628e7 100644
---- a/src/defs.h
-+++ b/src/defs.h
-@@ -41,6 +41,7 @@
- #include <string.h>
- #include <time.h>
- #include <pcap.h>
-+#include <asm/byteorder.h>
- #include "wps.h"
-@@ -65,10 +66,10 @@
- #define MANAGEMENT_FRAME      0x00
- #define SUBTYPE_BEACON                0x08
--#define DOT1X_AUTHENTICATION  0x8E88
-+#define DOT1X_AUTHENTICATION  0x888E
- #define DOT1X_EAP_PACKET      0x00
--#define SIMPLE_CONFIG         0x01000000
-+#define SIMPLE_CONFIG         0x00000001
- #define P1_SIZE                       10000
- #define P2_SIZE                       1000
-@@ -282,66 +283,111 @@ enum wfa_elements
-       WEP_TRANSMIT_KEY = 0x10064
- };
-+#define IEEE80211_FCTL_VERS           0x0003
-+#define IEEE80211_FCTL_FTYPE          0x000c
-+#define IEEE80211_FCTL_STYPE          0x00f0
-+#define IEEE80211_FCTL_TODS           0x0100
-+#define IEEE80211_FCTL_FROMDS         0x0200
-+#define IEEE80211_FCTL_MOREFRAGS      0x0400
-+#define IEEE80211_FCTL_RETRY          0x0800
-+#define IEEE80211_FCTL_PM             0x1000
-+#define IEEE80211_FCTL_MOREDATA               0x2000
-+#define IEEE80211_FCTL_PROTECTED      0x4000
-+#define IEEE80211_FCTL_ORDER          0x8000
-+
-+#define IEEE80211_SCTL_FRAG           0x000F
-+#define IEEE80211_SCTL_SEQ            0xFFF0
-+
-+#define IEEE80211_FTYPE_MGMT          0x0000
-+#define IEEE80211_FTYPE_CTL           0x0004
-+#define IEEE80211_FTYPE_DATA          0x0008
-+
-+/* management */
-+#define IEEE80211_STYPE_ASSOC_REQ     0x0000
-+#define IEEE80211_STYPE_ASSOC_RESP    0x0010
-+#define IEEE80211_STYPE_REASSOC_REQ   0x0020
-+#define IEEE80211_STYPE_REASSOC_RESP  0x0030
-+#define IEEE80211_STYPE_PROBE_REQ     0x0040
-+#define IEEE80211_STYPE_PROBE_RESP    0x0050
-+#define IEEE80211_STYPE_BEACON                0x0080
-+#define IEEE80211_STYPE_ATIM          0x0090
-+#define IEEE80211_STYPE_DISASSOC      0x00A0
-+#define IEEE80211_STYPE_AUTH          0x00B0
-+#define IEEE80211_STYPE_DEAUTH                0x00C0
-+#define IEEE80211_STYPE_ACTION                0x00D0
-+
-+/* control */
-+#define IEEE80211_STYPE_BACK_REQ      0x0080
-+#define IEEE80211_STYPE_BACK          0x0090
-+#define IEEE80211_STYPE_PSPOLL                0x00A0
-+#define IEEE80211_STYPE_RTS           0x00B0
-+#define IEEE80211_STYPE_CTS           0x00C0
-+#define IEEE80211_STYPE_ACK           0x00D0
-+#define IEEE80211_STYPE_CFEND         0x00E0
-+#define IEEE80211_STYPE_CFENDACK      0x00F0
-+
-+/* data */
-+#define IEEE80211_STYPE_DATA                  0x0000
-+#define IEEE80211_STYPE_DATA_CFACK            0x0010
-+#define IEEE80211_STYPE_DATA_CFPOLL           0x0020
-+#define IEEE80211_STYPE_DATA_CFACKPOLL                0x0030
-+#define IEEE80211_STYPE_NULLFUNC              0x0040
-+#define IEEE80211_STYPE_CFACK                 0x0050
-+#define IEEE80211_STYPE_CFPOLL                        0x0060
-+#define IEEE80211_STYPE_CFACKPOLL             0x0070
-+#define IEEE80211_STYPE_QOS_DATA              0x0080
-+#define IEEE80211_STYPE_QOS_DATA_CFACK                0x0090
-+#define IEEE80211_STYPE_QOS_DATA_CFPOLL               0x00A0
-+#define IEEE80211_STYPE_QOS_DATA_CFACKPOLL    0x00B0
-+#define IEEE80211_STYPE_QOS_NULLFUNC          0x00C0
-+#define IEEE80211_STYPE_QOS_CFACK             0x00D0
-+#define IEEE80211_STYPE_QOS_CFPOLL            0x00E0
-+#define IEEE80211_STYPE_QOS_CFACKPOLL         0x00F0
-+
- #pragma pack(1)
- struct radio_tap_header
- {
-       uint8_t revision;       
-       uint8_t pad;
--      uint16_t len;
--      uint32_t flags;
--};
--
--struct frame_control
--{
--        unsigned version : 2;
--        unsigned type : 2;
--        unsigned sub_type : 4;
--
--        unsigned to_ds : 1;
--        unsigned from_ds : 1;
--        unsigned more_frag : 1;
--        unsigned retry : 1;
--        unsigned pwr_mgt : 1;
--        unsigned more_data : 1;
--        unsigned protected_frame : 1;
--        unsigned order : 1;
-+      __le16 len;
-+      __le32 flags;
- };
- struct dot11_frame_header
- {
--      struct frame_control fc;
--        uint16_t duration;
-+      __le16 fc;
-+      __le16 duration;
-       unsigned char addr1[MAC_ADDR_LEN];
-       unsigned char addr2[MAC_ADDR_LEN];
-       unsigned char addr3[MAC_ADDR_LEN];
--      uint16_t frag_seq;
-+      __le16 frag_seq;
- };
- struct authentication_management_frame
- {
--      uint16_t algorithm;
--      uint16_t sequence;
--      uint16_t status;
-+      __le16 algorithm;
-+      __le16 sequence;
-+      __le16 status;
- };
- struct association_request_management_frame
- {
--      uint16_t capability;
--      uint16_t listen_interval;
-+      __le16 capability;
-+      __le16 listen_interval;
- };
- struct association_response_management_frame
- {
--      uint16_t capability;
--      uint16_t status;
--      uint16_t id;
-+      __le16 capability;
-+      __le16 status;
-+      __le16 id;
- };
- struct beacon_management_frame
- {
-       unsigned char timestamp[TIMESTAMP_LEN];
--      uint16_t beacon_interval;
--      uint16_t capability;
-+      __le16 beacon_interval;
-+      __le16 capability;
- };
- struct llc_header
-@@ -350,7 +396,7 @@ struct llc_header
-       uint8_t ssap;
-       uint8_t control_field;
-       unsigned char org_code[3];
--      uint16_t type;
-+      __be16 type;
- };
- struct dot1X_header
-@@ -371,7 +417,7 @@ struct eap_header
- struct wfa_expanded_header
- {
-       unsigned char id[3];
--      uint32_t type;
-+      __be32 type;
-       uint8_t opcode;
-       uint8_t flags;
- };
-diff --git a/src/exchange.c b/src/exchange.c
-index 23c87e9..4f9a82b 100644
---- a/src/exchange.c
-+++ b/src/exchange.c
-@@ -306,26 +306,27 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header)
-       /* Cast the radio tap and 802.11 frame headers and parse out the Frame Control field */
-       rt_header = (struct radio_tap_header *) packet;
--      frame_header = (struct dot11_frame_header *) (packet+rt_header->len);
-+      size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+      frame_header = (struct dot11_frame_header *) (packet+rt_header_len);
-       /* Does the BSSID/source address match our target BSSID? */
-       if(memcmp(frame_header->addr3, get_bssid(), MAC_ADDR_LEN) == 0)
-       {
-               /* Is this a data packet sent to our MAC address? */
--              if(frame_header->fc.type == DATA_FRAME && 
--                      frame_header->fc.sub_type == SUBTYPE_DATA && 
--                      (memcmp(frame_header->addr1, get_mac(), MAC_ADDR_LEN) == 0)) 
-+              if (((frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
-+                   __cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)) &&
-+                  (memcmp(frame_header->addr1, get_mac(), MAC_ADDR_LEN) == 0)) 
-               {
-                       llc = (struct llc_header *) (packet +
--                                                      rt_header->len +
-+                                                      rt_header_len +
-                                                       sizeof(struct dot11_frame_header)
-                       );
-                       /* All packets in our exchanges will be 802.1x */
--                      if(llc->type == DOT1X_AUTHENTICATION)
-+                      if(llc->type == __cpu_to_be16(DOT1X_AUTHENTICATION))
-                       {
-                               dot1x = (struct dot1X_header *) (packet +
--                                                              rt_header->len +
-+                                                              rt_header_len +
-                                                               sizeof(struct dot11_frame_header) +
-                                                               sizeof(struct llc_header)
-                               );
-@@ -334,7 +335,7 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header)
-                               if(dot1x->type == DOT1X_EAP_PACKET && (header->len >= EAP_PACKET_SIZE))
-                               {
-                                       eap = (struct eap_header *) (packet +
--                                                                      rt_header->len +
-+                                                                      rt_header_len +
-                                                                       sizeof(struct dot11_frame_header) +
-                                                                       sizeof(struct llc_header) +
-                                                                       sizeof(struct dot1X_header)
-@@ -366,7 +367,7 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header)
-                                               else if((eap->type == EAP_EXPANDED) && (header->len > WFA_PACKET_SIZE))
-                                               {
-                                                       wfa = (struct wfa_expanded_header *) (packet +
--                                                                                      rt_header->len +
-+                                                                                      rt_header_len +
-                                                                                       sizeof(struct dot11_frame_header) +
-                                                                                       sizeof(struct llc_header) +
-                                                                                       sizeof(struct dot1X_header) +
-@@ -374,14 +375,14 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header)
-                                                       );
-                                               
-                                                       /* Verify that this is a WPS message */
--                                                      if(wfa->type == SIMPLE_CONFIG)
-+                                                      if(wfa->type == __cpu_to_be32(SIMPLE_CONFIG))
-                                                       {
-                                                               wps_msg_len =   (size_t) ntohs(eap->len) - 
-                                                                               sizeof(struct eap_header) - 
-                                                                               sizeof(struct wfa_expanded_header);
-                                                               wps_msg = (const void *) (packet +
--                                                                                      rt_header->len +
-+                                                                                      rt_header_len +
-                                                                                               sizeof(struct dot11_frame_header) +
-                                                                                               sizeof(struct llc_header) +
-                                                                                               sizeof(struct dot1X_header) +
-diff --git a/src/wpsmon.c b/src/wpsmon.c
-index d976924..22a394f 100644
---- a/src/wpsmon.c
-+++ b/src/wpsmon.c
-@@ -295,7 +295,8 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
-         }
-       rt_header = (struct radio_tap_header *) radio_header(packet, header->len);
--      frame_header = (struct dot11_frame_header *) (packet + rt_header->len);
-+      size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+      frame_header = (struct dot11_frame_header *) (packet + rt_header_len);
-       /* If a specific BSSID was specified, only parse packets from that BSSID */
-       if(!is_target(frame_header))
-@@ -323,15 +324,17 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
-                               channel_changed = 1;
-                       }
--                      if(frame_header->fc.sub_type == PROBE_RESPONSE ||
--                                   frame_header->fc.sub_type == SUBTYPE_BEACON)
-+                      unsigned fsub_type = frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_STYPE);
-+
-+                      if(fsub_type == __cpu_to_le16(IEEE80211_STYPE_PROBE_RESP) ||
-+                         fsub_type == __cpu_to_le16(IEEE80211_STYPE_BEACON))
-                       {
-                               wps_parsed = parse_wps_parameters(packet, header->len, wps);
-                       }
-       
-                       if(!is_done(bssid) && (get_channel() == channel || source == PCAP_FILE))
-                       {
--                              if(frame_header->fc.sub_type == SUBTYPE_BEACON && 
-+                              if(fsub_type == __cpu_to_le16(IEEE80211_STYPE_BEACON) && 
-                                  mode == SCAN && 
-                                  !passive && 
-                                  should_probe(bssid))
-@@ -369,7 +372,7 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
-                                * If there was no WPS information, then the AP does not support WPS and we should ignore it from here on.
-                                * If this was a probe response, then we've gotten all WPS info we can get from this AP and should ignore it from here on.
-                                */
--                              if(!wps_parsed || frame_header->fc.sub_type == PROBE_RESPONSE)
-+                              if(!wps_parsed || fsub_type == __cpu_to_le16(IEEE80211_STYPE_PROBE_RESP))
-                               {
-                                       mark_ap_complete(bssid);
-                               }
--- 
-1.7.7
-
diff --git a/net/reaver/patches/0002-Use-the-current-directory-for-storing-and-loading-se.patch b/net/reaver/patches/0002-Use-the-current-directory-for-storing-and-loading-se.patch
deleted file mode 100644 (file)
index dd1bb42..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-From cd444949f3176790101b8bdc9656831a03d8c01d Mon Sep 17 00:00:00 2001
-From: Paul Fertser <fercerpav@gmail.com>
-Date: Tue, 10 Jul 2012 11:13:29 +0400
-Subject: [PATCH 2/3] Use the current directory for storing and loading
- sessions
-
-This allows the user to always explicitely choose (by changing the
-current directory before launching the program) where the session
-files should go. Useful e.g. to avoid hogging the precious space on
-embedded devices, just cd /tmp before starting the app.
-
-Signed-off-by: Paul Fertser <fercerpav@gmail.com>
----
- src/session.c |   16 +++-------------
- 1 files changed, 3 insertions(+), 13 deletions(-)
-
-diff --git a/src/session.c b/src/session.c
-index d3af0c3..308f213 100644
---- a/src/session.c
-+++ b/src/session.c
-@@ -62,7 +62,7 @@ int restore_session()
-               memset(file, 0, FILENAME_MAX);
-               bssid = mac2str(get_bssid(), '\0');
--              snprintf(file, FILENAME_MAX, "%s/%s.%s", CONF_DIR, bssid, CONF_EXT);
-+              snprintf(file, FILENAME_MAX, "%s.%s", bssid, CONF_EXT);
-               free(bssid);
-       }
-@@ -199,18 +199,8 @@ int save_session()
-               }
-               else
-               {       
--                      /* 
--                       * If the configuration directory exists, save the session file there; else, save it to the 
--                       * current working directory.
--                       */
--                      if(configuration_directory_exists())
--                      {
--                              snprintf((char *) &file_name, FILENAME_MAX, "%s/%s.%s", CONF_DIR, bssid, CONF_EXT);
--                      }
--                      else
--                      {
--                              snprintf((char *) &file_name, FILENAME_MAX, "%s.%s", bssid, CONF_EXT);
--                      }
-+                      /* save session to the current directory */
-+                      snprintf((char *) &file_name, FILENAME_MAX, "%s.%s", bssid, CONF_EXT);
-               }
-               /* Don't bother saving anything if nothing has been done */
--- 
-1.7.7
-
diff --git a/net/reaver/patches/0003-wash-wpsmon-use-less-useless-spaces-in-output-to-fit.patch b/net/reaver/patches/0003-wash-wpsmon-use-less-useless-spaces-in-output-to-fit.patch
deleted file mode 100644 (file)
index 64b290b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-From 638bb8d70d6c7e5dc99975e0bf57d8ce0455e2cc Mon Sep 17 00:00:00 2001
-From: Paul Fertser <fercerpav@gmail.com>
-Date: Tue, 10 Jul 2012 11:25:00 +0400
-Subject: [PATCH 3/3] wash/wpsmon: use less useless spaces in output to fit
- narrow terminals
-
-Signed-off-by: Paul Fertser <fercerpav@gmail.com>
----
- src/wpsmon.c |    6 +++---
- 1 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/wpsmon.c b/src/wpsmon.c
-index 22a394f..e0948b3 100644
---- a/src/wpsmon.c
-+++ b/src/wpsmon.c
-@@ -262,8 +262,8 @@ void monitor(char *bssid, int passive, int source, int channel, int mode)
-       if(!header_printed)
-       {
--              cprintf(INFO, "BSSID                  Channel       RSSI       WPS Version       WPS Locked        ESSID\n");
--              cprintf(INFO, "---------------------------------------------------------------------------------------------------------------\n");
-+              cprintf(INFO, "BSSID              Channel  RSSI  WPS Version  WPS Locked  ESSID\n");
-+              cprintf(INFO, "--------------------------------------------------------------------------------------\n");
-               header_printed = 1;
-       }
-@@ -360,7 +360,7 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
-                                                       break;
-                                       }
--                                      cprintf(INFO, "%17s      %2d            %.2d        %d.%d               %s               %s\n", bssid, channel, rssi, (wps->version >> 4), (wps->version & 0x0F), lock_display, ssid);
-+                                      cprintf(INFO, "%17s    %2d       %.2d   %d.%d          %s         %s\n", bssid, channel, rssi, (wps->version >> 4), (wps->version & 0x0F), lock_display, ssid);
-                               }
-                               if(probe_sent)
--- 
-1.7.7
-
diff --git a/net/reaver/patches/0004-Fixed-probe-request-bug-in-wash.patch b/net/reaver/patches/0004-Fixed-probe-request-bug-in-wash.patch
deleted file mode 100644 (file)
index 9b51d06..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-From a8edcc1ce2a55e0e02ee13c46c6a5f22dd7920e9 Mon Sep 17 00:00:00 2001
-From: "cheffner@tacnetsol.com"
- <cheffner@tacnetsol.com@027a3e96-2d37-f1c0-85d6-5ce5a08386c2>
-Date: Tue, 27 Mar 2012 16:25:10 +0000
-Subject: [PATCH] Fixed probe request bug in wash.
-
-git-svn-id: http://reaver-wps.googlecode.com/svn/trunk@113 027a3e96-2d37-f1c0-85d6-5ce5a08386c2
----
- src/wpsmon.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/src/wpsmon.c b/src/wpsmon.c
-index da688b9..d976924 100644
---- a/src/wpsmon.c
-+++ b/src/wpsmon.c
-@@ -132,6 +132,11 @@ int main(int argc, char *argv[])
-               usage(argv[0]);
-               goto end;
-       }
-+      else if(get_iface())
-+      {
-+              /* Get the MAC address of the specified interface */
-+              read_iface_mac();
-+      }
-       if(get_iface() && source == PCAP_FILE)
-       {
-@@ -300,6 +305,7 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
-       set_ssid(NULL);
-       bssid = (char *) mac2str(frame_header->addr3, ':');
-+      set_bssid((unsigned char *) frame_header->addr3);
-       if(bssid)
-       {
-@@ -383,6 +389,7 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
- end:
-       if(wps) free(wps);
-+      set_bssid((unsigned char *) NULL_MAC);
-       return;
- }
--- 
-2.6.4
-
diff --git a/net/reaver/patches/0100-Include-sys-types.h-for-definition-of-u_char.patch b/net/reaver/patches/0100-Include-sys-types.h-for-definition-of-u_char.patch
deleted file mode 100644 (file)
index 541968a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-From 811f5c0b0a226edfbf5aa2f316e083f30ec3cd8d Mon Sep 17 00:00:00 2001
-From: Yousong Zhou <yszhou4tech@gmail.com>
-Date: Tue, 18 Aug 2015 14:34:26 +0800
-Subject: [PATCH] Include <sys/types.h> for definition of u_char.
-
-Fixes build with musl-libc.
-
-Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
----
- src/libwps/libwps.h |    1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/libwps/libwps.h b/src/libwps/libwps.h
-index b04dd8b..bdd7b9a 100755
---- a/src/libwps/libwps.h
-+++ b/src/libwps/libwps.h
-@@ -17,6 +17,7 @@
- #include <stdio.h>
- #include <string.h>
- #include <arpa/inet.h>
-+#include <sys/types.h>
- #define LIBWPS_MAX_STR_LEN 256
--- 
-1.7.10.4
-
diff --git a/net/reaver/patches/0101-pcap-use-65536-as-snaplen.patch b/net/reaver/patches/0101-pcap-use-65536-as-snaplen.patch
deleted file mode 100644 (file)
index 03f4318..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/init.c.orig  2016-12-08 13:23:17.386891467 +0800
-+++ b/src/init.c       2016-12-08 13:23:20.850892551 +0800
-@@ -121,7 +121,7 @@ pcap_t *capture_init(char *capture_sourc
-       pcap_t *handle = NULL;
-       char errbuf[PCAP_ERRBUF_SIZE] = { 0 };
-       
--      handle = pcap_open_live(capture_source, BUFSIZ, 1, 0, errbuf);
-+      handle = pcap_open_live(capture_source, 65536, 1, 0, errbuf);
-       if(!handle)
-       {
-               handle = pcap_open_offline(capture_source, errbuf);
index 4f5f563cae81c4a07151c57b1e8345ee2c29c7dd..29c53a53748a151e26bba1925d1bbab33f4ffb56 100644 (file)
@@ -12,6 +12,7 @@ PKG_VERSION:=0.4-20150907
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=30ced050c58cbdd39732921a794b053127e9c45ebdcdd4a6023bdc5e434607da
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/darkk/redsocks.git
index 4fe476d4190ff402bf509c91b4b8ae75e9a634fc..333c903df577a0cc1ab3990e8743e44bc5fb5cbc 100644 (file)
@@ -13,7 +13,7 @@ PKG_LICENSE:=GPL-2.0+
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://lpccomp.bc.ca/remserial/
-PKG_MD5SUM:=b19b57fd118329c5ea3aaf9887f946a6
+PKG_HASH:=4cbe9c754a2be4926789500bafb84bda54e11b01aab522a3ce71ec4db615fefb
 
 PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
 
index c35bafb31ad83950bb4674fc2824cdbba80a2cf0..89ee79930c7bdb66b06a17c3200db1a6f403b7ce 100644 (file)
@@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rp-pppoe
 PKG_VERSION:=3.12
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 PKG_MAINTAINER:=Daniel Dickinson <lede@cshore.thecshore.com>
 PKG_LICENSE:=LGPL-2.0+
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://roaringpenguin.com/files/download
-PKG_MD5SUM:=00794e04031546b0e9b8cf286f2a6d1ccfc4a621b2a3abb2d7ef2a7ab7cc86c2
+PKG_HASH:=00794e04031546b0e9b8cf286f2a6d1ccfc4a621b2a3abb2d7ef2a7ab7cc86c2
 
 PKG_BUILD_DEPENDS:=ppp
 
@@ -37,7 +37,7 @@ endef
 define Package/rp-pppoe-common
   $(call Package/rp-pppoe/Default)
   TITLE+= common
-  DEPENDS:=+ppp
+  DEPENDS:=ppp
 endef
 
 define Package/rp-pppoe-common/description
@@ -69,7 +69,7 @@ endef
 
 define Package/rp-pppoe-server
   $(call Package/rp-pppoe/Default)
-  DEPENDS:=+rp-pppoe-common
+  DEPENDS:=+rp-pppoe-common +ppp-mod-pppoe
   TITLE+= server
 endef
 
@@ -102,7 +102,7 @@ endef
 TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/src/libevent -isystem $(PKG_BUILD_DIR)/missing-headers
 CONFIGURE_PATH := ./src
 CONFIGURE_ARGS += ac_cv_path_PPPD=/usr/sbin/pppd --enable-plugin=$(STAGING_DIR)/usr/include/
-MAKE_FLAGS := DESTDIR="$(PKG_INSTALL_DIR)" install
+MAKE_FLAGS := DESTDIR="$(PKG_INSTALL_DIR)" PLUGIN_PATH=rp-pppoe.so install
 MAKE_PATH := ./src
 
 define Build/Prepare
@@ -132,7 +132,6 @@ define Package/rp-pppoe-server/install
        $(INSTALL_DIR) $(1)/etc/ppp/plugins
        $(INSTALL_DIR) $(1)/usr/sbin
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-server $(1)/usr/sbin/
-       $(CP) $(PKG_INSTALL_DIR)/etc/ppp/plugins/rp-pppoe.so $(1)/etc/ppp/plugins/
        $(INSTALL_DATA) ./files/pppoe-server.default $(1)/etc/uci-defaults/
 endef
 
index 4aeeee8c18483b45d97b9d54f338a0affa96d1a8..1c9b16ec77c8e7d4b942b2bea2ee24b4b9cd67a0 100755 (executable)
@@ -27,7 +27,7 @@ pppoe_relay_instance() {
     config_get server_interfaces "$cfg" server_interface
     config_get client_interfaces "$cfg" client_interface
     config_get both_interfaces "$cfg" both_interfaces
-    config_get maxsessions "$cfg" maxsesssions
+    config_get maxsessions "$cfg" maxsessions
     config_get timeout "$cfg" timeout
     config_get_bool use_non_uci_config "$cfg" use_non_uci_config 0
 
@@ -44,7 +44,7 @@ pppoe_relay_instance() {
        for interface in $both_interfaces; do
            append OPTIONS "-B $interface"
        done
-       [ -n "$maxsesssions" ] && append OPTIONS "-n $maxsesssions"
+       [ -n "$maxsessions" ] && append OPTIONS "-n $maxsessions"
        [ -n "$timeout" ] && append OPTIONS "-i $timeout"
     fi
 
index dd2568ec89863e09bed142584d49472835312d7d..8236eec0416f17c7dfcba0945837ae1f95fbb600 100755 (executable)
@@ -16,7 +16,7 @@ pppoe_instance() {
        config_get interface "$cfg" interface
        config_get ac_name "$cfg" ac_name
        config_get service_names "$cfg" service_name
-       config_get maxsessionsperpeer "$cfg" maxsesssionsperpeer
+       config_get maxsessionsperpeer "$cfg" maxsessionsperpeer
        config_get localip "$cfg" localip
        config_get firstremoteip "$cfg" firstremoteip
        config_get maxsessions "$cfg" maxsessions
@@ -38,7 +38,7 @@ pppoe_instance() {
                append OPTIONS "-S $service_name"
            done
            append OPTIONS "-I $interface"
-           [ -n "$maxsesssionsperpeer" ] && append OPTIONS "-x $maxsesssionsperpeer"
+           [ -n "$maxsessionsperpeer" ] && append OPTIONS "-x $maxsessionsperpeer"
            [ -n "$localip" ] && append OPTIONS "-L $localip"
            [ -n "$firstremoteip" ] && append OPTIONS "-R $firstremoteip"
            [ -n "maxsessions" ] && append OPTIONS "-N $maxsessions"
@@ -53,7 +53,7 @@ pppoe_instance() {
 
        procd_open_instance
        procd_set_param command /usr/sbin/pppoe-server -F
-       procd_append_param command $OPTIONS
+       procd_append_param command -k $OPTIONS
        procd_set_param file /etc/ppp/options
        procd_append_param file /etc/ppp/pppoe-server-options
        procd_close_instance
index d45593aae7871a66212513fd167c053b56b730ed..a109c08473ffd0414f417dff8edc67807e03b25b 100644 (file)
@@ -1,15 +1,15 @@
 --- a/src/configure
 +++ b/src/configure
-@@ -3661,7 +3661,7 @@ done
+@@ -3691,7 +3691,7 @@ done
  
  for ac_header in linux/if.h
  do :
 -  ac_fn_c_check_header_compile "$LINENO" "linux/if.h" "ac_cv_header_linux_if_h" "#include<sys/socket.h>
 +  ac_fn_c_check_header_compile "$LINENO" "linux/if.h" "ac_cv_header_linux_if_h" "#include <sys/socket.h>
  "
- if test "x$ac_cv_header_linux_if_h" = x""yes; then :
+ if test "x$ac_cv_header_linux_if_h" = xyes; then :
    cat >>confdefs.h <<_ACEOF
-@@ -3675,10 +3675,11 @@ done
+@@ -3705,10 +3705,11 @@ done
  for ac_header in linux/if_pppox.h
  do :
    ac_fn_c_check_header_compile "$LINENO" "linux/if_pppox.h" "ac_cv_header_linux_if_pppox_h" "
@@ -24,8 +24,8 @@
 +#include <linux/in6.h>
  
  "
- if test "x$ac_cv_header_linux_if_pppox_h" = x""yes; then :
-@@ -4611,7 +4612,7 @@ esac
+ if test "x$ac_cv_header_linux_if_pppox_h" = xyes; then :
+@@ -4644,7 +4645,7 @@ esac
  $as_echo_n "checking packing order of bit fields... " >&6; }
  if test "${rpppoe_cv_pack_bitfields+set}" != set ; then
  if test "$cross_compiling" = yes; then :
index 9dc1c72ac15ecf847df8d0b499ce3b65113e37d4..7b63ddb99572944afd3b0766474eddb978a73f51 100644 (file)
@@ -7,5 +7,5 @@
 -      @CC@ -o $@ @RDYNAMIC@ $^ $(LDFLAGS) $(PPPOE_SERVER_LIBS) -Llibevent -levent
 +      @CC@ -o $@ @RDYNAMIC@ $^ $(LDFLAGS) $(PPPOE_SERVER_LIBS)
  
- pppoe: pppoe.o if.o debug.o common.o ppp.o discovery.o
-       @CC@ -o $@ $^ $(LDFLAGS)
+ # Experimental code from Savoir Faire Linux.  I do not consider it
+ # production-ready, so not part of the official distribution.
index c9a5f69be667a449f46de895a04c240f9a853fdc..8e9185e2cd66a17bc6bac096e7f65177def2f737 100644 (file)
@@ -1,8 +1,6 @@
-Index: rp-pppoe-3.11/src/configure
-===================================================================
---- rp-pppoe-3.11.orig/src/configure   2016-05-21 23:42:58.142423086 -0400
-+++ rp-pppoe-3.11/src/configure        2016-05-21 23:42:58.178423086 -0400
-@@ -3646,7 +3646,7 @@
+--- a/src/configure
++++ b/src/configure
+@@ -3676,7 +3676,7 @@ fi
  done
  
  
@@ -11,11 +9,9 @@ Index: rp-pppoe-3.11/src/configure
  do :
    as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
  ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-Index: rp-pppoe-3.11/src/if.c
-===================================================================
---- rp-pppoe-3.11.orig/src/if.c        2012-08-17 14:31:25.000000000 -0400
-+++ rp-pppoe-3.11/src/if.c     2016-05-21 23:45:13.546423086 -0400
-@@ -30,10 +30,6 @@
+--- a/src/if.c
++++ b/src/if.c
+@@ -30,10 +30,6 @@ static char const RCSID[] =
  #include <linux/if_packet.h>
  #endif
  
@@ -26,11 +22,9 @@ Index: rp-pppoe-3.11/src/if.c
  #ifdef HAVE_ASM_TYPES_H
  #include <asm/types.h>
  #endif
-Index: rp-pppoe-3.11/src/plugin.c
-===================================================================
---- rp-pppoe-3.11.orig/src/plugin.c    2012-08-17 14:31:25.000000000 -0400
-+++ rp-pppoe-3.11/src/plugin.c 2016-05-21 23:43:55.314423086 -0400
-@@ -49,7 +49,6 @@
+--- a/src/plugin.c
++++ b/src/plugin.c
+@@ -49,7 +49,6 @@ static char const RCSID[] =
  #include <unistd.h>
  #include <fcntl.h>
  #include <signal.h>
diff --git a/net/rp-pppoe/patches/130-static-lib-fix.patch b/net/rp-pppoe/patches/130-static-lib-fix.patch
new file mode 100644 (file)
index 0000000..c7806dd
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -139,7 +139,8 @@ plugin/plugin.o: plugin.c
+       @CC@ -DPLUGIN=1 '-DRP_VERSION="$(VERSION)"' $(CFLAGS) -I$(PPPD_INCDIR) -c -o $@ -fPIC $<
+ plugin/libplugin.a: plugin/discovery.o plugin/if.o plugin/common.o plugin/debug.o
+-      ar -rc $@ $^
++      $(AR) -rc $@ $^
++      @RANLIB@ $@
+ plugin/discovery.o: discovery.c
+       @CC@ -DPLUGIN=1 $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o $@ -fPIC $<
index dfbfdf16c9ae40f45887a3e092b3411e7c28792a..ea1c594510004a29df6bf773510d5371e29b3418 100644 (file)
@@ -3,11 +3,13 @@ if PACKAGE_rsync
        config RSYNC_xattr
                bool
                prompt "Enable xattr support"
+               default y if USE_FS_ACL_ATTR
                default n
 
        config RSYNC_acl
                bool
                prompt "Enable ACL support"
+               default y if USE_FS_ACL_ATTR
                default n
 
        config RSYNC_zlib
index aa4f00ae2ddc00e06596b12907764950867525dc..f6701f86c59de8835c8d86648526b2355904a126 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rsync
-PKG_VERSION:=3.1.2
+PKG_VERSION:=3.1.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://download.samba.org/pub/rsync/src
-PKG_MD5SUM:=0f758d7e000c0f7f7d3792610fad70cb
+PKG_HASH:=55cc554efec5fdaad70de921cd5a5eeb6c29a95524c715f3bbf849235b0800c0
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
index 1e33215d2d76ceedffb1401a255a7aa2b15bdb11..95fd470d0dd39774a8c3dff0585aea78dc29562a 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.rsyslog.com/files/download/rsyslog/
-PKG_MD5SUM:=750d552bdcbf255c85f464ffbe21168a
+PKG_HASH:=94346237ecfa22c9f78cebc3f18d59056f5d9846eb906c75beaa7e486f02c695
 
 PKG_MAINTAINER:=Dov Murik <dmurik@us.ibm.com>
 PKG_LICENSE:=GPL-3.0
index 596854eba3e4c79b8ec27fb27de8e1bf2ff6e8f1..5de243ea73eb667f1381c2cf172a372491c42640 100644 (file)
@@ -16,6 +16,7 @@ PKG_SOURCE_URL:=https://github.com/rakshasa/rtorrent.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=62cb5a4605c0664bc522e0e0da9c72f09cf643a9
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=3c6834b12ebfa8d62618f6e9dbc06dfa593861fa0b435d2fd1bddb0e886fc77b
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index 4771e8d1492999baa4c75804cdff24527abee94d..c03a14e857459618275b8d5502621e4173147c50 100644 (file)
@@ -15,12 +15,10 @@ PKG_LICENSE_FILES:=PKG-INFO
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
 PKG_SOURCE_URL:=https://bitbucket.org/secdev/scapy/downloads/
-PKG_MD5SUM:=a30d828e59801d1d092219b349f1da9e
-
-PKG_BUILD_DEPENDS:=python python-setuptools
+PKG_HASH:=8972c02e39a826a10c02c2bdd5025f7251dce9589c57befd9bb55c65f02e4934
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/scapy
   SECTION:=net
index 384fe460be1bdf761083dd56f38909380db64693..64603ed8fe551dd25a9ca674ec124fc3148342f9 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2016 OpenWrt.org
+# Copyright (C) 2007-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,21 +8,22 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=seafile-ccnet
-PKG_VERSION:=5.1.4
+PKG_VERSION:=6.2.2
 PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
 PKG_LICENSE:=GPL-3.0
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/haiwen/ccnet.git
+PKG_SOURCE_URL:=https://github.com/haiwen/ccnet-server.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=44f74fdc5160c1bf16a92e71d79b856763ddbc15
+PKG_SOURCE_VERSION:=6b9d7e2920aa9b807f9efe9038439b57ce949ecc
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=8aed6d2283ac7b3148f9b5c82b1d992ed36dc5193000cf727bdcfae7446ce1fe
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/seafile-ccnet
     SECTION:=net
@@ -33,7 +34,7 @@ define Package/seafile-ccnet
     DEPENDS:=+libsearpc +libevent2 +libopenssl \
                +glib2 +python +libzdb +libuuid \
                +libpthread +libsqlite3 +jansson $(ICONV_DEPENDS)
-    EXTRA_DEPENDS:=libsearpc (=5.1.4-8998e7b2c5587f0b94c48db24e2952d08def5add-1)
+    EXTRA_DEPENDS:=libsearpc (=6.2.2-8998e7b2c5587f0b94c48db24e2952d08def5add-1)
 endef
 
 define Package/seafile-ccnet/description
index 09458b6ca3b8f74c2d6c18e38c98dc7aaf8c911a..2cf27aef1f1cb2fbb724196c0263d9e1e08d8594 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2016 OpenWrt.org
+# Copyright (C) 2007-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,18 +8,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=seafile-seahub
-PKG_VERSION:=5.1.4
+PKG_VERSION:=6.2.2
 PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
 PKG_LICENSE:=Apache-2.0
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/haiwen/seahub.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=1e1c02aa4f2a0256ffa29a28224aad2d678f43a0
+PKG_SOURCE_VERSION:=120e7a299e77968f1af48ea2dcf4bd9b909c426f
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=511500c40dd7b1009f77109c6df810df1cf2c17a84a8f6841d592a9e05d22064
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/seafile-seahub
     SECTION:=net
index 49b67f8f1dbe96788a7b6153d69e2bdac2fc88ee..efae34d131262ceefd22af0847f84c1f55e415e7 100644 (file)
@@ -1,23 +1,25 @@
-diff -rupN seafile-seahub-5.1.1.orig/Makefile seafile-seahub-5.1.1/Makefile
---- seafile-seahub-5.1.1.orig/Makefile 2016-04-26 23:59:48.000000000 +0200
-+++ seafile-seahub-5.1.1/Makefile      2016-04-28 09:03:35.507105416 +0200
+diff -rupN seafile-seahub-6.2.2.orig/Makefile seafile-seahub-6.2.2/Makefile
+--- seafile-seahub-6.2.2.orig/Makefile 2017-10-22 22:28:22.000000000 +0200
++++ seafile-seahub-6.2.2/Makefile      2017-10-22 22:46:18.007470936 +0200
 @@ -1,3 +1,6 @@
 +include $(TOPDIR)/rules.mk
-+$(call include_mk, python-package.mk)
++include $(TOPDIR)/feeds/packages/lang/python/python-package.mk
 +
  PROJECT=seahub
  
  develop: setup-git
-@@ -9,7 +12,7 @@ dist: locale uglify statici18n collectst
+@@ -9,7 +12,9 @@ dist: locale uglify statici18n collectst
  
  locale:
        @echo "--> Compile locales"
--      django-admin.py compilemessages
+-      django-admin.py compilemessages && cd seahub/two_factor && django-admin.py compilemessages
++      $(call HostPython,,$(STAGING_DIR)/usr/bin/django-admin.py compilemessages)
++      cd seahub/two_factor
 +      $(call HostPython,,$(STAGING_DIR)/usr/bin/django-admin.py compilemessages)
        @echo ""
  
  uglify:
-@@ -19,7 +22,7 @@ uglify:
+@@ -19,17 +24,17 @@ uglify:
  
  statici18n:
        @echo "--> Generate JS locale files in static/scripts/i18n"
@@ -26,3 +28,15 @@ diff -rupN seafile-seahub-5.1.1.orig/Makefile seafile-seahub-5.1.1/Makefile
  
  collectstatic:
        @echo "--> Collect django static files to media/assets"
+       rm -rf media/assets 2> /dev/null
+-      python manage.py collectstatic --noinput
++      $(call HostPython,,manage.py collectstatic --noinput)
+ compressstatic:
+       @echo "--> Compress static files(css) to media/CACHE"
+       rm -rf media/CACHE 2> /dev/null
+-      python manage.py compress
++      $(call HostPython,,manage.py compress)
+ clean:
+       @echo '--> Cleaning media/static cache & dist'
diff --git a/net/seafile-server/Config.in b/net/seafile-server/Config.in
new file mode 100644 (file)
index 0000000..d83f795
--- /dev/null
@@ -0,0 +1,16 @@
+menu "Configuration"
+       depends on PACKAGE_seafile-server
+
+config SEAFILE_FUSE_SUPPORT
+       bool "Enable FUSE support"
+       select PACKAGE_libfuse
+       default n
+
+config SEAFILE_CONSOLE_SUPPORT
+       bool "Enable seafile server console"
+       default n
+
+config SEAFILE_RIAK_SUPPORT
+       bool "Enable support for riak backend"
+       default n
+endmenu
diff --git a/net/seafile-server/Makefile b/net/seafile-server/Makefile
new file mode 100644 (file)
index 0000000..12b2b2c
--- /dev/null
@@ -0,0 +1,149 @@
+#
+# Copyright (C) 2007-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:=seafile-server
+PKG_VERSION:=6.2.2
+PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
+PKG_LICENSE:=GPL-3.0
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/haiwen/seafile-server.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=6978d2cb2e05cc774370b4d06c9f0a864df71936
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=99aa9c41641d7c0ffe18bbab75418b1347dd9e156124472bbee5a6dda09a8057
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include ../../lang/python/python-package.mk
+
+define Package/seafile-server
+    SECTION:=net
+    CATEGORY:=Network
+    TITLE:=Seafile server
+    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+    URL:=http://seafile.com/
+    DEPENDS:=+libarchive +libopenssl +glib2 +libsearpc +seafile-ccnet +seafile-seahub +sqlite3-cli +python-mysql +python-urllib3 \
+               +jansson +libevent2 +libevent2-openssl +zlib +libzdb +libsqlite3 +libmysqlclient \
+               +libpthread +libuuid +bash +procps-ng +procps-ng-pkill +SEAFILE_FUSE_SUPPORT:libfuse $(ICONV_DEPENDS)
+    EXTRA_DEPENDS:=seafile-ccnet (=6.2.2-6b9d7e2920aa9b807f9efe9038439b57ce949ecc-1), seafile-seahub (=6.2.2-120e7a299e77968f1af48ea2dcf4bd9b909c426f-1)
+    MENU:=1
+endef
+
+define Package/seafile-server/config
+       source "$(SOURCE)/Config.in"
+endef
+
+define Package/seafile-server/description
+   Open source cloud storage with advanced features on privacy protection and teamwork.
+endef
+
+CONFIGURE_ARGS += --disable-client \
+                   --enable-server \
+                   --enable-python \
+                   --disable-static-build \
+                   --disable-server-pkg
+
+ifeq ($(CONFIG_SEAFILE_FUSE_SUPPORT),y)
+       CONFIGURE_ARGS += --enable-fuse
+       TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/fuse
+else
+       CONFIGURE_ARGS += --disable-fuse
+endif
+
+ifeq ($(CONFIG_SEAFILE_CONSOLE_SUPPORT),y)
+       CONFIGURE_ARGS += --enable-console
+else
+       CONFIGURE_ARGS += --disable-console
+endif
+
+ifeq ($(CONFIG_SEAFILE_RIAK_SUPPORT),y)
+       CONFIGURE_ARGS += --enable-riak
+else
+       CONFIGURE_ARGS += --disable-riak
+endif
+
+PKG_BUILD_DEPENDS:=vala/host libevhtp
+
+# This is required as python-package.mk overrides the default setting of having interlinking enabled
+ifdef CONFIG_USE_MIPS16
+       TARGET_CFLAGS += -minterlink-mips16
+endif
+TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -liconv \
+                   -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz -levent_openssl -levent
+
+define Package/seafile-server/conffiles
+/etc/config/seafile
+endef
+
+define Package/seafile-server/install
+       $(INSTALL_DIR) $(1)/usr/{bin,lib}
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(INSTALL_DIR) $(1)/usr/share/seafile/seafile-server
+       $(INSTALL_DIR) $(1)/usr/share/seafile/conf
+       $(INSTALL_DIR) $(1)/etc/{config,init.d}
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seafile/ $(1)$(PYTHON_PKG_DIR)/
+       $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seaserv/ $(1)$(PYTHON_PKG_DIR)/
+       $(CP) $(PKG_BUILD_DIR)/scripts/seaf-gc.sh $(1)/usr/share/seafile/seafile-server/
+       $(CP) $(PKG_BUILD_DIR)/scripts/seaf-fsck.sh $(1)/usr/share/seafile/seafile-server/
+ifeq ($(CONFIG_SEAFILE_FUSE_SUPPORT),y)
+       $(CP) $(PKG_BUILD_DIR)/scripts/seaf-fuse.sh $(1)/usr/share/seafile/seafile-server/
+endif
+       $(CP) $(PKG_BUILD_DIR)/scripts/setup-seafile-mysql.py $(1)/usr/share/seafile/seafile-server/
+       $(CP) $(PKG_BUILD_DIR)/scripts/setup-seafile-mysql.sh $(1)/usr/share/seafile/seafile-server/
+       $(CP) $(PKG_BUILD_DIR)/scripts/sqlite2mysql.py $(1)/usr/share/seafile/seafile-server/
+       $(CP) $(PKG_BUILD_DIR)/scripts/sqlite2mysql.sh $(1)/usr/share/seafile/seafile-server/
+       $(CP) $(PKG_BUILD_DIR)/scripts/check_init_admin.py $(1)/usr/share/seafile/seafile-server/
+       $(CP) $(PKG_BUILD_DIR)/scripts/upgrade/ $(1)/usr/share/seafile/seafile-server/
+       $(CP) ./files/seafile.conf $(1)/etc/config/seafile
+       $(INSTALL_BIN) ./files/seafile.init $(1)/etc/init.d/seafile
+       $(INSTALL_BIN) ./files/seahub.init $(1)/etc/init.d/seahub
+       find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/seafile/ $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libseafile.pc $(1)/usr/lib/pkgconfig/
+       $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seafile/ $(1)$(PYTHON_PKG_DIR)/
+       $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seaserv/ $(1)$(PYTHON_PKG_DIR)/
+endef
+
+define Package/seafile-server/postinst
+#!/bin/sh
+[ ! -f /etc/init.d/seafile ] && exit 0
+
+if [ ! -d /usr/share/seafile/seafile-data ]
+then
+   echo "*** Installation completed, running configuration script..."
+   /etc/init.d/seafile setup
+
+   if [ $$? -ne 0 ]
+   then
+      echo
+      echo "*** ERROR: Configuration failed. Please fix the issues if any and re-run the script using the command below:"
+      echo "*** \"/etc/init.d/seafile setup\""
+   fi
+else
+   echo "*** seafile-data directory already exists."
+   echo
+   echo "*** In case you are upgrading seafile, please run the appropriate upgrade script"
+   echo "*** manually before using the new version."
+   echo "*** Upgrade scripts are located at \"/usr/share/seafile/seafile-server/upgrade\""
+   echo
+   echo "*** For more information, please read http://manual.seafile.com/deploy/upgrade.html"
+fi
+endef
+
+$(eval $(call BuildPackage,seafile-server))
diff --git a/net/seafile-server/files/seafile.conf b/net/seafile-server/files/seafile.conf
new file mode 100644 (file)
index 0000000..f4c0ea9
--- /dev/null
@@ -0,0 +1,12 @@
+# Start Seahub in fastcgi mode - 1 = enable, 0 = disable
+SEAHUB_FASTCGI=0
+# Listen on the port specified below (defaults to 8000)
+SEAHUB_PORT=8000
+# Method of serving requests (fastcgi mode only) - threaded or prefork
+# Using threaded mode is recommended as it consumes less resources
+SEAHUB_METHOD=threaded
+# The maximum number of worker processes/threads (fastcgi mode only)
+# General formula: (2 x $num_cores) + 1
+# To set the number of workers in WSGI mode (which is the default)
+# please edit /usr/share/seafile/seafile-server/runtime/seahub.conf
+SEAHUB_WORKERS=3
diff --git a/net/seafile-server/files/seafile.init b/net/seafile-server/files/seafile.init
new file mode 100755 (executable)
index 0000000..1c6553a
--- /dev/null
@@ -0,0 +1,157 @@
+#!/bin/bash /etc/rc.common
+
+START=98
+APP=seafile
+EXTRA_HELP="   setup   Runs the setup script
+       create_admin    Creates the administrative login
+       reset_admin     Alias to create_admin"
+EXTRA_COMMANDS="setup create_admin reset_admin"
+
+TOPDIR=/usr/share/seafile
+default_ccnet_conf_dir=${TOPDIR}/ccnet
+central_config_dir=${TOPDIR}/conf
+seaf_controller=/usr/bin/seafile-controller
+
+function validate_ccnet_conf_dir () {
+       if [[ ! -d ${default_ccnet_conf_dir} ]]; then
+               echo "Error: there is no ccnet config directory."
+               echo "Have you run \"/etc/init.d/seafile setup\"?"
+               echo ""
+               exit 1
+       fi
+}
+
+function validate_central_conf_dir () {
+       if [[ ! -d ${central_config_dir} ]]; then
+               echo "Error: there is no conf/ directory."
+               echo "Have you run \"/etc/init.d/seafile setup\"?"
+               echo ""
+               exit 1
+       fi
+}
+
+function read_seafile_data_dir () {
+       seafile_ini=${default_ccnet_conf_dir}/seafile.ini
+       if [[ ! -f ${seafile_ini} ]]; then
+               echo "Error: ${seafile_ini} not found."
+               exit 1
+       fi
+       seafile_data_dir=$(cat "${seafile_ini}")
+       if [[ ! -d ${seafile_data_dir} ]]; then
+               echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
+               echo "Please check it first, or create this directory yourself."
+               echo ""
+               exit 1
+       fi
+}
+
+function test_config() {
+       if ! ${seaf_controller} --test \
+               -c "${default_ccnet_conf_dir}" \
+               -d "${seafile_data_dir}" \
+               -F "${central_config_dir}" ; then
+               exit 1
+       fi
+}
+
+function check_component_running() {
+       name=$1
+       cmd=$2
+       if pid=$(pgrep -f "$cmd" 2>/dev/null); then
+               return 1
+       fi
+}
+
+function validate_already_running () {
+       check_component_running "seafile-controller" "seafile-controller -F ${central_config_dir}" || return 1
+       check_component_running "ccnet-server" "ccnet-server -F ${central_config_dir}" || return 1
+       check_component_running "seaf-server" "seaf-server -F ${central_config_dir}" || return 1
+       check_component_running "fileserver" "fileserver -F ${central_config_dir}" || return 1
+       check_component_running "seafdav" "wsgidav.server.run_server" || return 1
+}
+
+function start_seafile_server () {
+       if ! validate_already_running; then
+               if [[ "$name" == "seafile-controller" ]]; then
+                       echo "Seafile already running."
+               else
+                       echo "Error: component [$name] is already running. Please try stopping it manually by running \"kill $pid\"."
+                       echo "To force killing the process, use \"kill -9 $pid\"."
+               fi
+               exit 1
+       fi
+       validate_central_conf_dir
+       validate_ccnet_conf_dir
+       read_seafile_data_dir
+       test_config
+
+       echo "Starting seafile server, please wait ..."
+
+       ${seaf_controller} \
+               -F "${central_config_dir}" \
+               -c "${default_ccnet_conf_dir}" \
+               -d "${seafile_data_dir}"
+
+       sleep 3
+
+       # check if seafile server started successfully
+       if ! pgrep -f "seafile-controller -F ${central_config_dir}" 2>/dev/null 1>&2; then
+               echo "Failed to start seafile server"
+               exit 1
+       fi
+
+       echo "Seafile server started"
+       echo
+}
+
+function stop_seafile_server () {
+       if ! pgrep -f "seafile-controller -F ${central_config_dir}" 2>/dev/null 1>&2; then
+               echo "Seafile server not running"
+       else
+               echo "Stopping seafile server ..."
+               pkill -SIGTERM -f "seafile-controller -F ${central_config_dir}"
+               pkill -f "ccnet-server -F ${central_config_dir}"
+               pkill -f "seaf-server -F ${central_config_dir}"
+               pkill -f "fileserver -F ${central_config_dir}"
+               pkill -f "soffice.*--invisible --nocrashreport"
+               pkill -f  "wsgidav.server.run_server"
+               retry=1
+               while ! validate_already_running && [ $retry -lt 60 ]; do sleep 1; ((retry++)); done
+               if ! validate_already_running; then
+                       echo "Error: [$name] component is still running. Please try stopping it manually by running \"kill $pid\"."
+                       echo "To force killing the process, use \"kill -9 $pid\"."
+               fi
+
+       fi
+}
+
+function restart_seafile_server () {
+       stop_seafile_server
+       start_seafile_server
+}
+
+function start() {
+       start_seafile_server
+}
+
+function stop() {
+       stop_seafile_server
+}
+
+function restart() {
+       restart_seafile_server
+}
+
+function setup() {
+       cd "$TOPDIR" && \
+               /usr/bin/seafile-admin setup
+}
+
+function create_admin() {
+       cd "$TOPDIR" && \
+               /usr/bin/seafile-admin create-admin
+}
+
+function reset_admin() {
+       create_admin
+}
diff --git a/net/seafile-server/files/seahub.init b/net/seafile-server/files/seahub.init
new file mode 100755 (executable)
index 0000000..da3a1d1
--- /dev/null
@@ -0,0 +1,226 @@
+#!/bin/bash /etc/rc.common
+
+START=99
+APP=seahub
+EXTRA_HELP="   clearsessions   Clears expired sessions from database"
+EXTRA_COMMANDS="clearsessions"
+
+SEAHUB_FASTCGI=0
+SEAHUB_PORT=8000
+SEAHUB_METHOD=threaded
+SEAHUB_WORKERS=3
+
+[ -f /etc/config/seafile ] && \
+       . /etc/config/seafile
+
+INSTALLPATH=/usr/share/seafile/seafile-server
+TOPDIR=$(dirname "${INSTALLPATH}")
+default_ccnet_conf_dir=${TOPDIR}/ccnet
+central_config_dir=${TOPDIR}/conf
+
+manage_py=${INSTALLPATH}/seahub/manage.py
+gunicorn_conf=${INSTALLPATH}/runtime/seahub.conf
+pidfile=/var/run/seafile/seahub.pid
+errorlog=${INSTALLPATH}/runtime/error.log
+accesslog=${INSTALLPATH}/runtime/access.log
+gunicorn_exe=/usr/bin/gunicorn
+
+function check_python_executable() {
+       if [[ "$PYTHON" != "" && -x $PYTHON ]]; then
+               return 0
+       fi
+
+       if which python2.7 2>/dev/null 1>&2; then
+               PYTHON=python2.7
+       elif which python27 2>/dev/null 1>&2; then
+               PYTHON=python27
+       else
+               echo
+               echo "Can't find a python executable of version 2.7 or above in PATH"
+               echo "Install python 2.7+ before continue."
+               echo "Or if you installed it in a non-standard PATH, set the PYTHON enviroment varirable to it"
+               echo
+               exit 1
+       fi
+}
+
+function validate_ccnet_conf_dir() {
+       if [[ ! -d ${default_ccnet_conf_dir} ]]; then
+               echo "Error: there is no ccnet config directory."
+               echo "Have you run '/etc/init.d/seafile setup'?"
+               echo ""
+               exit 1
+       fi
+}
+
+function read_seafile_data_dir() {
+       seafile_ini=${default_ccnet_conf_dir}/seafile.ini
+       if [[ ! -f ${seafile_ini} ]]; then
+               echo "Error: ${seafile_ini} not found."
+               exit 1
+       fi
+       seafile_data_dir=$(cat "${seafile_ini}")
+       if [[ ! -d ${seafile_data_dir} ]]; then
+               echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
+               echo "Please check it first, or create this directory yourself."
+               echo ""
+               exit 1
+       fi
+}
+
+function validate_seahub_running() {
+       if pid=$(pgrep -f "${manage_py}" 2>/dev/null); then
+               return 1
+       elif pid=$(pgrep -f "seahub.wsgi:application" 2>/dev/null); then
+               return 1
+       fi
+}
+
+function validate_port() {
+       if ! [[ ${SEAHUB_PORT} =~ ^[1-9][0-9]{1,4}$ ]] ; then
+               printf "\033[033m${SEAHUB_PORT}\033[m is not a valid port number\n"
+               exit 1
+       fi
+}
+
+function warning_if_seafile_not_running() {
+       if ! pgrep -f "seafile-controller -F ${central_config_dir}" 2>/dev/null 1>&2; then
+               echo
+               echo "Error: seafile-controller not running. Have you run \"/etc/init.d/seafile start\"?"
+               echo
+               exit 1
+       fi
+}
+
+function prepare_seahub_log_dir() {
+       logdir="${TOPDIR}/logs"
+       if ! [[ -d "${logsdir}" ]]; then
+               if ! mkdir -p "${logdir}"; then
+                   echo "Error: failed to create log dir \"${logdir}\""
+                   exit 1
+               fi
+       fi
+       export SEAHUB_LOG_DIR="${logdir}"
+}
+
+function before_start() {
+       prepare_env
+       warning_if_seafile_not_running
+       if ! validate_seahub_running; then
+               echo "Seahub is already running."
+               exit 1
+       fi
+       prepare_seahub_log_dir
+       validate_port
+}
+
+function start_seahub() {
+       before_start
+       echo "Starting seahub at port ${SEAHUB_PORT} ..."
+       check_init_admin
+       $PYTHON $gunicorn_exe seahub.wsgi:application -c "${gunicorn_conf}" -b "0.0.0.0:${SEAHUB_PORT}" --preload
+
+       # Ensure seahub is started successfully
+       retry=1
+       while ! validate_seahub_running && [[ ! -f "${pidfile}"  ]] && [[ $retry -lt 120 ]]; do sleep 1; ((retry++)); done
+       if ! validate_seahub_running && [[ -f "${pidfile}" ]]; then
+               echo
+               echo "Seahub is started"
+               echo
+       else
+               printf "\033[33mError: Seahub failed to start.\033[m\n"
+               exit 1
+       fi
+}
+
+function start_seahub_fastcgi() {
+       before_start
+
+       # Returns 127.0.0.1 if SEAFILE_FASTCGI_HOST is unset or hasn't got any value,
+       # otherwise returns value of SEAFILE_FASTCGI_HOST environment variable
+       address=`(test -z "$SEAFILE_FASTCGI_HOST" && echo "127.0.0.1") || echo $SEAFILE_FASTCGI_HOST`
+
+       echo "Starting seahub (fastcgi) at ${address}:${SEAHUB_PORT} ..."
+       check_init_admin
+       $PYTHON "${manage_py}" runfcgi host=${address} port=${SEAHUB_PORT} pidfile=${pidfile} \
+               outlog=${accesslog} errlog=${errorlog} maxchildren=${SEAHUB_WORKERS} method=${SEAHUB_METHOD}
+
+       # Ensure seahub is started successfully
+       retry=1
+       while ! validate_seahub_running && [[ ! -f "${pidfile}"  ]] && [[ $retry -lt 120 ]]; do sleep 1; ((retry++)); done
+       if ! validate_seahub_running && [[ -f "${pidfile}" ]]; then
+               echo
+               echo "Seahub is started"
+               echo
+       else
+               printf "\033[33mError: Seahub failed to start.\033[m\n"
+               exit 1
+       fi
+}
+
+function prepare_env() {
+       check_python_executable
+       validate_ccnet_conf_dir
+       read_seafile_data_dir
+
+       export CCNET_CONF_DIR=${default_ccnet_conf_dir}
+       export SEAFILE_CONF_DIR=${seafile_data_dir}
+       export SEAFILE_CENTRAL_CONF_DIR=${central_config_dir}
+       export PYTHONPATH="${INSTALLPATH}/seahub:${INSTALLPATH}/seahub/thirdpart:${PYTHONPATH}"
+}
+
+function clear_sessions() {
+       prepare_env
+
+       echo "Start clear expired session records ..."
+       $PYTHON "${manage_py}" clearsessions
+
+       echo
+       echo "Done"
+       echo
+}
+
+function stop_seahub() {
+       if [[ -f ${pidfile} ]]; then
+               pid=$(cat "${pidfile}")
+               echo "Stopping seahub ..."
+               kill ${pid}
+               rm -f ${pidfile}
+               retry=1
+               while ! validate_seahub_running && [ $retry -lt 60 ]; do sleep 1; ((retry++)); done
+               if ! validate_seahub_running; then
+                       echo "Error: seahub cannot be stopped. Please try stopping it manually by running \"kill $(echo "$pid" | tr '\n' ' ')\"."
+                       echo "To force killing the processes, use \"kill -9 $(echo "$pid" | tr '\n' ' ')\"."
+               fi
+       else
+               echo "Seahub is not running"
+       fi
+}
+
+function check_init_admin() {
+       check_init_admin_script=${INSTALLPATH}/check_init_admin.py
+       if ! $PYTHON $check_init_admin_script; then
+               exit 1
+       fi
+}
+
+function start() {
+       if [ "$SEAHUB_FASTCGI" == "1" ]; then
+               start_seahub_fastcgi
+       else
+               start_seahub
+       fi
+}
+
+function stop() {
+       stop_seahub
+}
+
+function restart() {
+       stop
+       start
+}
+
+function clearsessions() {
+       clear_sessions
+}
diff --git a/net/seafile-server/patches/020-script-patches.patch b/net/seafile-server/patches/020-script-patches.patch
new file mode 100644 (file)
index 0000000..585784d
--- /dev/null
@@ -0,0 +1,77 @@
+diff -rupN seafile-server-5.1.1.orig/scripts/seaf-fsck.sh seafile-server-5.1.1/scripts/seaf-fsck.sh
+--- seafile-server-5.1.1.orig/scripts/seaf-fsck.sh     2016-04-21 11:05:26.000000000 +0200
++++ seafile-server-5.1.1/scripts/seaf-fsck.sh  2016-04-22 09:10:13.075581325 +0200
+@@ -7,7 +7,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
+ TOPDIR=$(dirname "${INSTALLPATH}")
+ default_ccnet_conf_dir=${TOPDIR}/ccnet
+ default_conf_dir=${TOPDIR}/conf
+-seaf_fsck=${INSTALLPATH}/seafile/bin/seaf-fsck
++seaf_fsck=/usr/bin/seaf-fsck
+ export PATH=${INSTALLPATH}/seafile/bin:$PATH
+ export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
+diff -rupN seafile-server-5.1.1.orig/scripts/seaf-gc.sh seafile-server-5.1.1/scripts/seaf-gc.sh
+--- seafile-server-5.1.1.orig/scripts/seaf-gc.sh       2016-04-21 11:05:26.000000000 +0200
++++ seafile-server-5.1.1/scripts/seaf-gc.sh    2016-04-22 09:10:27.211581999 +0200
+@@ -7,7 +7,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
+ TOPDIR=$(dirname "${INSTALLPATH}")
+ default_ccnet_conf_dir=${TOPDIR}/ccnet
+ default_conf_dir=${TOPDIR}/conf
+-seaf_gc=${INSTALLPATH}/seafile/bin/seafserv-gc
++seaf_gc=/usr/bin/seafserv-gc
+ seaf_gc_opts=""
+ export PATH=${INSTALLPATH}/seafile/bin:$PATH
+diff -rupN seafile-server-5.1.1.orig/scripts/setup-seafile-mysql.sh seafile-server-5.1.1/scripts/setup-seafile-mysql.sh
+--- seafile-server-5.1.1.orig/scripts/setup-seafile-mysql.sh   2016-04-21 11:05:26.000000000 +0200
++++ seafile-server-5.1.1/scripts/setup-seafile-mysql.sh        2016-04-22 09:11:50.083585953 +0200
+@@ -40,15 +40,10 @@ function check_python_executable() {
+ function check_python_module () {
+     module=$1
+     name=$2
+-    hint=$3
+     printf "  Checking python module: ${name} ... "
+     if ! $PYTHON -c "import ${module}" 2>/dev/null 1>&2; then
+         echo
+         printf "\033[33m ${name} \033[m is not installed, Please install it first.\n"
+-        if [[ "${hint}" != "" ]]; then
+-            printf "${hint}"
+-            echo
+-        fi
+         err_and_quit;
+     fi
+     echo -e "Done."
+@@ -70,14 +65,10 @@ function check_python () {
+         if [[ $PYTHON == "python2.6" ]]; then
+             py26="2.6"
+         fi
+-        hint="\nOn Debian/Ubntu: apt-get install python-setuptools\nOn CentOS/RHEL: yum install python${py26}-distribute"
+-        check_python_module pkg_resources setuptools "${hint}"
+-
+-        hint="\nOn Debian/Ubntu: apt-get install python-imaging\nOn CentOS/RHEL: yum install python${py26}-imaging"
+-        check_python_module PIL python-imaging "${hint}"
+-        hint='\nOn Debian/Ubuntu:\n\nsudo apt-get install python-mysqldb\n\nOn CentOS/RHEL:\n\nsudo yum install MySQL-python'
+-        check_python_module MySQLdb python-mysqldb "${hint}"
++        check_python_module pkg_resources setuptools
++        check_python_module PIL python-imaging
++        check_python_module MySQLdb python-mysqldb
+     fi
+     echo
+ }
+@@ -85,5 +76,6 @@ function check_python () {
+ check_python;
+ export PYTHON=$PYTHON
++export PYTHONPATH="/usr/share/seafile/seafile-server/seahub/thirdpart:$PYTHONPATH"
+ exec $PYTHON "$python_script"
+diff -rupN seafile-server-5.1.1.orig/scripts/sqlite2mysql.sh seafile-server-5.1.1/scripts/sqlite2mysql.sh
+--- seafile-server-5.1.1.orig/scripts/sqlite2mysql.sh  2016-04-21 11:05:26.000000000 +0200
++++ seafile-server-5.1.1/scripts/sqlite2mysql.sh       2016-04-22 09:02:22.047558854 +0200
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # This shell script and corresponding sqlite2mysql.py are used to
+ # migrate Seafile data from SQLite to MySQL.
diff --git a/net/seafile-server/patches/030-pidfiles-in-same-directory.patch b/net/seafile-server/patches/030-pidfiles-in-same-directory.patch
new file mode 100644 (file)
index 0000000..bb3f86c
--- /dev/null
@@ -0,0 +1,24 @@
+diff -rupN seafile-server-5.1.1.orig/controller/seafile-controller.c seafile-server-5.1.1/controller/seafile-controller.c
+--- seafile-server-5.1.1.orig/controller/seafile-controller.c  2016-04-19 15:44:32.000000000 +0200
++++ seafile-server-5.1.1/controller/seafile-controller.c       2016-04-19 16:23:05.785000218 +0200
+@@ -21,7 +21,7 @@
+ SeafileController *ctl;
+-static char *controller_pidfile = NULL;
++static char *controller_pidfile = "/var/run/seafile/seafile-controller.pid";
+ char *bin_dir = NULL;
+ char *installpath = NULL;
+@@ -575,9 +575,9 @@ stop_ccnet_server ()
+ static void
+ init_pidfile_path (SeafileController *ctl)
+ {
+-    char *pid_dir = g_build_filename (topdir, "pids", NULL);
++    char *pid_dir = g_path_get_dirname (controller_pidfile);
+     if (!g_file_test(pid_dir, G_FILE_TEST_EXISTS)) {
+-        if (g_mkdir(pid_dir, 0777) < 0) {
++        if (g_mkdir(pid_dir, 0755) < 0) {
+             seaf_warning("failed to create pid dir %s: %s", pid_dir, strerror(errno));
+             controller_exit(1);
+         }
diff --git a/net/seafile-server/patches/040-seafile-admin.patch b/net/seafile-server/patches/040-seafile-admin.patch
new file mode 100644 (file)
index 0000000..667cdad
--- /dev/null
@@ -0,0 +1,61 @@
+diff -rupN seafile-server-5.1.1.orig/tools/seafile-admin seafile-server-5.1.1/tools/seafile-admin
+--- seafile-server-5.1.1.orig/tools/seafile-admin      2016-04-19 15:44:33.000000000 +0200
++++ seafile-server-5.1.1/tools/seafile-admin   2016-04-26 10:55:11.826798430 +0200
+@@ -449,9 +449,12 @@ workers = 3
+ # Logging
+ runtime_dir = os.path.dirname(__file__)
+-pidfile = os.path.join(runtime_dir, 'seahub.pid')
++pidfile = '/var/run/seafile/seahub.pid'
+ errorlog = os.path.join(runtime_dir, 'error.log')
+ accesslog = os.path.join(runtime_dir, 'access.log')
++
++# for file upload, we need a longer timeout value (default is only 30s, too short)
++timeout = 1200
+ '''
+     try:
+@@ -526,6 +529,7 @@ def check_django_version():
+ def check_python_module(import_name, package_name=None, silent=False):
++    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "seahub.settings")
+     package_name = package_name or import_name
+     if not silent:
+         info('checking %s' % package_name)
+@@ -785,7 +789,7 @@ def check_layout(args):
+     conf[CONF_SEAFILE_DIR] = seafile_data_dir
+     conf[CONF_SEAHUB_DIR] = seahub_dir
+     conf[CONF_SEAHUB_CONF] = seahub_conf
+-    conf[CONF_SEAHUB_PIDFILE] = os.path.join(runtime_dir, 'seahub.pid')
++    conf[CONF_SEAHUB_PIDFILE] = '/var/run/seafile/seahub.pid'
+     conf[CONF_SEAHUB_OUTLOG] = os.path.join(runtime_dir, 'access.log')
+     conf[CONF_SEAHUB_ERRLOG] = os.path.join(runtime_dir, 'error.log')
+@@ -836,10 +840,13 @@ def setup_seafile(args):
+     print '-----------------------------------------------------------------'
+     print '-----------------------------------------------------------------'
+     print
+-    print 'To start/stop seafile server:'
++    print 'To start, stop or restart seafile:'
++    print
++    print highlight('         # /etc/init.d/seafile { start | stop | restart }')
+     print
+-    print highlight('         $ cd %s' % cwd)
+-    print highlight('         $ %s { start | stop }' % SCRIPT_NAME)
++    print 'To start, stop or restart seahub:'
++    print
++    print highlight('         # /etc/init.d/seahub { start | stop | restart }')
+     print
+     print 'If you have any problem, refer to\n'
+     print
+@@ -903,8 +910,7 @@ def start_seafile(args):
+ def stop_seafile(dummy):
+     info('Stopping seafile server')
+     pkill('seafile-controller')
+-    runtime_dir = os.path.join(cwd, 'seafile-server', 'runtime')
+-    pidfile = os.path.join(runtime_dir, 'seahub.pid')
++    pidfile = '/var/run/seafile/seahub.pid'
+     try:
+         with open(pidfile, 'r') as fp:
+             pid = fp.read().strip('\n ')
diff --git a/net/seafile-server/patches/050-libseafile-makefile-fixes.patch b/net/seafile-server/patches/050-libseafile-makefile-fixes.patch
new file mode 100644 (file)
index 0000000..38c5ad4
--- /dev/null
@@ -0,0 +1,43 @@
+diff -rupN seafile-server-5.1.1.orig/lib/Makefile.am seafile-server-5.1.1/lib/Makefile.am
+--- seafile-server-5.1.1.orig/lib/Makefile.am  2016-04-21 11:05:26.000000000 +0200
++++ seafile-server-5.1.1/lib/Makefile.am       2016-04-22 10:09:41.567751561 +0200
+@@ -1,3 +1,5 @@
++include $(TOPDIR)/rules.mk
++
+ pcfiles = libseafile.pc
+ pkgconfig_DATA = $(pcfiles)
+ pkgconfigdir = $(libdir)/pkgconfig
+@@ -35,7 +37,7 @@ seafile-rpc-wrapper.c: seafile-object.h
+ seafile-object.h: ${seafile_object_define}
+       rm -f $@
+-      valac --pkg posix ${seafile_object_define} -C -H seafile-object.h
++      "$(STAGING_DIR_HOSTPKG)/bin/valac" --pkg posix ${seafile_object_define} -C -H seafile-object.h
+ DISTCLEANFILES = ${searpc_gen}
+@@ -64,7 +66,7 @@ rpc_table.stamp: ${top_srcdir}/lib/rpc_t
+       @rm -f rpc_table.tmp
+       @touch rpc_table.tmp
+       @echo "[libsearpc]: generating rpc header files"
+-      @PYTHON@ `which searpc-codegen.py` ${top_srcdir}/lib/rpc_table.py
++      @PYTHON@ "$(STAGING_DIR)/usr/bin/searpc-codegen.py" ${top_srcdir}/lib/rpc_table.py
+       @echo "[libsearpc]: done"
+       @mv -f rpc_table.tmp $@
+@@ -74,7 +76,7 @@ vala.stamp: ${seafile_object_define}
+       rm -f ${seafile_object_gen}
+       @rm -f vala.tmp
+       @touch vala.tmp
+-      valac -C --pkg posix $^
++      "$(STAGING_DIR_HOSTPKG)/bin/valac" -C --pkg posix $^
+       @mv -f vala.tmp $@
+ ${seafile_object_gen}: vala.stamp
+@@ -90,5 +92,5 @@ install-data-local:
+ if MACOS
+       sed -i '' -e "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
+ else
+-      ${SED} -i "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
++      ${SED} "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
+ endif
diff --git a/net/seafile-server/patches/060-timestamps-as-int64.patch b/net/seafile-server/patches/060-timestamps-as-int64.patch
new file mode 100644 (file)
index 0000000..5e655d8
--- /dev/null
@@ -0,0 +1,39 @@
+diff -rupN seafile-server-5.1.1.orig/lib/repo.vala seafile-server-5.1.1/lib/repo.vala
+--- seafile-server-5.1.1.orig/lib/repo.vala    2016-04-19 15:44:32.000000000 +0200
++++ seafile-server-5.1.1/lib/repo.vala 2016-04-25 21:29:33.327962235 +0200
+@@ -30,7 +30,7 @@ public class Repo : Object {
+     // data format version
+     public int version { get; set; }
+-    public int    last_modify { get; set; }
++    public int64  last_modify { get; set; }
+     public int64  size { get; set; }
+     public int64  file_count { get; set; }
+     public string head_cmmt_id { get; set; }
+@@ -40,7 +40,7 @@ public class Repo : Object {
+     public string repo_id { get; set; }
+     public string repo_name { get; set; }
+     public string repo_desc { get; set; }
+-    public int last_modified { get; set; }
++    public int64 last_modified { get; set; }
+     // Section 2: Encryption related
+     // Members in this section should be set for every Repo object
+@@ -63,7 +63,7 @@ public class Repo : Object {
+         get { return _relay_id; }
+         set { _relay_id = value; }
+     }
+-    public int  last_sync_time { get; set; }
++    public int64  last_sync_time { get; set; }
+     public bool auto_sync { get; set; }
+     public bool worktree_invalid { get; set; }
+@@ -155,7 +155,7 @@ public class DeletedEntry : Object {
+     public string obj_name { get; set; }
+     public string basedir { get; set; }
+     public int mode { get; set; }
+-    public int delete_time { get; set; }
++    public int64 delete_time { get; set; }
+     public int64 file_size { get; set; }
+     public string scan_stat { get; set; }
+ }
diff --git a/net/seafile-server/patches/070-fuse-mount.patch b/net/seafile-server/patches/070-fuse-mount.patch
new file mode 100644 (file)
index 0000000..827e7f3
--- /dev/null
@@ -0,0 +1,21 @@
+diff -rupN seafile-server-5.1.1.orig/scripts/seaf-fuse.sh seafile-server-5.1.1/scripts/seaf-fuse.sh
+--- seafile-server-5.1.1.orig/scripts/seaf-fuse.sh     2016-05-29 08:43:19.000000000 +0200
++++ seafile-server-5.1.1/scripts/seaf-fuse.sh  2016-05-29 09:13:06.286680653 +0200
+@@ -7,7 +7,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
+ TOPDIR=$(dirname "${INSTALLPATH}")
+ default_ccnet_conf_dir=${TOPDIR}/ccnet
+ default_conf_dir=${TOPDIR}/conf
+-seaf_fuse=${INSTALLPATH}/seafile/bin/seaf-fuse
++seaf_fuse=/usr/bin/seaf-fuse
+ export PATH=${INSTALLPATH}/seafile/bin:$PATH
+ export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
+@@ -68,7 +68,7 @@ function validate_already_running () {
+ }
+ function warning_if_seafile_not_running () {
+-    if ! pgrep -f "seafile-controller -c ${default_ccnet_conf_dir}" 2>/dev/null 1>&2; then
++    if ! pgrep -f "seafile-controller -F ${default_conf_dir}" 2>/dev/null 1>&2; then
+         echo
+         echo "Warning: seafile-controller not running. Have you run \"./seafile.sh start\" ?"
+         echo
index 61def0e0725e6de6171bd330b57e17da547d1553..da33832c7ea9d1041c21fc6035528533092142e1 100644 (file)
@@ -8,13 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ser2net
-PKG_VERSION:=3.3
-PKG_RELEASE:=1
+PKG_VERSION:=3.5
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/ser2net
-PKG_MD5SUM:=8daf1cfd70d2b220b184c412c64faf2c
-PKG_HASH:=3d1cef5f48df8291e57d4d7d4eac2fc809ae644a5524ffca4aebef0f4e4153dc
+PKG_HASH:=ba9e1d60a89fd7ed075553b4a2074352902203f7fbd9b65b15048c05f0e3f3be
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
@@ -44,9 +43,16 @@ endef
 
 define Package/ser2net/install
        $(INSTALL_DIR) $(1)/usr/sbin
-       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ser2net $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ser2net $(1)/usr/sbin/
+
        $(INSTALL_DIR) $(1)/etc
-       $(INSTALL_CONF) $(PKG_BUILD_DIR)/ser2net.conf $(1)/etc/
+       $(INSTALL_CONF) ./files/ser2net.conf $(1)/etc/
+
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/ser2net.config $(1)/etc/config/ser2net
+
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/ser2net.init $(1)/etc/init.d/ser2net
 endef
 
 $(eval $(call BuildPackage,ser2net))
diff --git a/net/ser2net/files/ser2net.conf b/net/ser2net/files/ser2net.conf
new file mode 100644 (file)
index 0000000..2c9605b
--- /dev/null
@@ -0,0 +1,70 @@
+#
+# This is a minimal example configuration file for ser2net. For a version with
+# detailed comments and all possible configuration directives, please visit:
+# https://github.com/cminyard/ser2net/blob/master/ser2net.conf
+#
+# On OpenWrt/LEDE systems, this configuration serves as a base configuration.
+# During boot of the system, the UCI configuration file /etc/config/ser2net is
+# parsed and converted to additional configuration lines which are _appended_
+# to this file. The ser2net daemon is then started with the combined
+# configuration file /tmp/ser2net.conf.
+#
+# A basic service configuration line has the following format:
+# <network port>:<state>:<timeout>:<device>:<options>
+#      network port
+#              Name or number of the port to accept connections
+#              from for this device.  A port number may be of the form
+#              [ipv4,|ipv6,][tcp,|udp,][host,]port, such as
+#              127.0.0.1,2000 or ipv4,tcp,localhost,2000.  If the host is
+#              specified, it will only bind to the IP address
+#              specified. Otherwise it will bind to all the ports on the
+#              machine.  If ipv4 or ipv6 is specified, it will only bind
+#              to that network type.
+#
+#      state
+#              Either raw or rawlp or telnet or off.  off disables
+#              the  port  from  accepting  connections.  It can be
+#              turned on later from the control port.  raw enables
+#              the port and  transfers  all data as-is between the
+#              port  and  the long.  rawlp  enables  the port  and
+#              transfers  all input data to device, device is open
+#              without  any  termios  setting.  It  allow  to  use
+#              /dev/lpX  devices  and  printers connected to them.
+#              telnet enables the port and runs the telnet  proto-
+#              col  on the port to set up telnet parameters.  This
+#              is most useful for using telnet.
+#
+#      timeout
+#              The time (in seconds) before the port will be  dis-
+#              connected  if  there  is no activity on it.  A zero
+#              value disables this function.
+#
+#      device
+#              The  name  of  the  device   to  connect  to.  This
+#              must be in the form of /dev/<device>.
+#
+#      options
+#              Sets  operational  parameters  for the serial port.
+#              For a serial device (not IPMI SOL):
+#              Options 300, 1200, 2400, 4800, 9600, 19200, 38400,
+#              57600, 115200 set the various baud rates.  EVEN,
+#              ODD, NONE (MARK and SPACE if supported) set the parity.
+#              Note that MARK and SPACE are not available on all systems
+#              or hardware, if it is not supported then it will be
+#              silently set to ODD or EVEN parity.
+#              1STOPBIT, 2STOPBITS set
+#              the number of stop bits.  5DATABITS, 6DATABITS,
+#              7DATABITS, 8DATABITS set the number of data bits.
+#              [-]XONXOFF turns on (- off) XON/XOFF support.
+#              [-]RTSCTS turns on (- off) hardware flow control,
+#              [-]LOCAL turns off (- on) monitoring of the modem lines,
+#              and [-]HANGUP_WHEN_DONE turns on (- off) lowering the
+#              modem control lines when the connection is done.
+#              [-]NOBREAK disables automatic setting of the break
+#              setting of the serial port.
+#
+#              The "[-]remctl" option allow remote control (ala RFC
+#              2217) of serial-port configuration.
+#
+# Example:
+# 5000:telnet:0:/dev/ttyAPP0:115200 8DATABITS NONE 1STOPBIT -XONXOFF -LOCAL -RTSCTS remctl
diff --git a/net/ser2net/files/ser2net.config b/net/ser2net/files/ser2net.config
new file mode 100644 (file)
index 0000000..8ea5216
--- /dev/null
@@ -0,0 +1,67 @@
+config ser2net global
+       option enabled 1
+
+config controlport
+       option enabled 0
+       option host localhost
+       option port 2000
+
+config default
+       option speed 115200
+       option databits 8
+       option parity 'none'
+       option stopbits 1
+       option rtscts false
+       option local false
+       option remctl true
+
+#config led rx
+#      option driver sysfs
+#      option device 'duckbill:green:rs485'
+#      option duration 20
+#      option state 1
+
+#config led tx
+#      option driver sysfs
+#      option device 'duckbill:red:rs485'
+#      option duration 20
+#      option state 1
+
+config proxy
+       option enabled 0
+       option port 5000
+       option protocol telnet
+       option timeout 0
+       option device '/dev/ttyAPP0'
+       option baudrate 115200
+       option databits 8
+       option parity 'none'
+       option stopbits 1
+#      option led_tx 'tx'
+#      option led_rx 'rx'
+       option rtscts false
+       option local false
+       option xonxoff false
+       list options ''
+
+config proxy
+       option enabled 0
+       option port 5001
+       option protocol telnet
+       option timeout 0
+       option device '/dev/ttyUSB0'
+       option baudrate 115200
+       option databits 8
+       option parity 'none'
+       option stopbits 1
+
+config proxy
+       option enabled 0
+       option port 5002
+       option protocol raw
+       option timeout 0
+       option device '/dev/ttyUSB1'
+       option baudrate 9600
+       option databits 8
+       option parity 'none'
+       option stopbits 1
diff --git a/net/ser2net/files/ser2net.init b/net/ser2net/files/ser2net.init
new file mode 100644 (file)
index 0000000..2f7a3d5
--- /dev/null
@@ -0,0 +1,186 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2017 Michael Heimpold
+
+START=75
+STOP=10
+
+USE_PROCD=1
+PROG=/usr/sbin/ser2net
+
+STATICCFGFILE="/etc/ser2net.conf"
+DYNAMICCFGFILE="/tmp/ser2net.conf"
+
+list_cb_append() {
+       local var="$2"
+       local value="$1"
+       local sep="${3:- }"
+
+       eval "export ${NO_EXPORT:+-n} -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\""
+}
+
+append_bool() {
+       local var="$1"
+       local key="$2"
+       local val="$3"
+       local uc="$4"
+       local s=""
+
+       [ "$uc" -eq 1 ] && key=`echo "$key" | tr '[a-z]' '[A-Z]'`
+       [ "$val" -eq 0 ] && s="-"
+
+       append "$var" "$s$key"
+}
+
+ser2net_default() {
+       local cfg="$1"
+       local key val
+
+       for key in speed baudrate databits stopbits parity chardelay_scale chardelay_min; do
+               config_get val "$cfg" "$key"
+               [ -n "$val" ] || continue
+
+               case "$key" in
+                       baudrate) key="speed" ;;
+                       hangup_when_done) ;;
+                       telnet_brk_on_sync) ;;
+                       deassert_CTS_DCD_DSR_on_connect) ;;
+                       *) key=`echo "$key" | tr '_' '-'`
+               esac
+
+               echo "DEFAULT:$key:$val"
+       done
+
+       for key in chardelay deassert_CTS_DCD_DSR_on_connect hangup_when_done kickolduser \
+                  local nobreak remctl rtscts telnet_brk_on_sync xonxoff; do
+               config_get_bool val "$cfg" "$key"
+               [ -n "$val" ] || continue
+               [ "$val" -eq 0 ] && val="false" || val="true"
+               echo "DEFAULT:$key:$val"
+       done
+
+       echo
+}
+
+ser2net_controlport() {
+       local cfg="$1"
+       local enabled host port
+
+       config_get_bool enabled "$cfg" enabled 0
+       [ "$enabled" -eq 0 ] && return 0
+
+       config_get host "$cfg" host
+       config_get port "$cfg" port
+
+       echo -e "CONTROLPORT:${host:+$host,}$port\n"
+}
+
+ser2net_led() {
+       local cfg="$1"
+       local driver device state duration
+
+       config_get driver "$cfg" driver sysfs
+       config_get device "$cfg" device
+       config_get state "$cfg" state 1
+       config_get duration "$cfg" duration 20
+
+       echo -e "LED:$cfg:$driver:device=$device state=$state duration=$duration\n"
+}
+
+ser2net_proxy() {
+       local cfg="$1"
+       local enabled port protocol timeout device baudrate databits parity stopbits
+       local led_tx led_rx key boolval options
+
+       config_get_bool enabled "$cfg" enabled 0
+       [ "$enabled" -eq 0 ] && return 0
+
+       config_get port "$cfg" port
+       [ "$port" -le 0 -o "$port" -gt 65535 ] && return 1
+
+       config_get protocol "$cfg" protocol
+       case "$protocol" in
+               raw|rawlp|telnet|off) ;;
+               *) return 1
+       esac
+
+       config_get timeout "$cfg" timeout 0
+       config_get device "$cfg" device
+       [ -z "$device" ] && return 1
+
+       config_get baudrate "$cfg" baudrate
+       [ -n "$baudrate" ] && append options "$baudrate"
+
+       config_get databits "$cfg" databits
+       if [ -n "$databits" ]; then
+               [ "$databits" -lt 5 -o "$databits" -gt 8 ] && return 1
+               append options "${databits}DATABITS"
+       fi
+
+       config_get parity "$cfg" parity
+       parity=`echo "$parity" | tr '[a-z]' '[A-Z]'`
+       case "$parity" in
+               EVEN|ODD|NONE|MARK|SPACE) append options "$parity" ;;
+               "") ;;
+               *) return 1
+       esac
+
+       config_get stopbits "$cfg" stopbits
+       case "$stopbits" in
+               1) append options "${stopbits}STOPBIT" ;;
+               2) append options "${stopbits}STOPBITS" ;;
+               "") ;;
+               *) return 1
+       esac
+
+       config_get led_tx "$cfg" led_tx
+       [ -n "$led_tx" ] && append options "led-tx=$led_tx"
+
+       config_get led_rx "$cfg" led_rx
+       [ -n "$led_rx" ] && append options "led-rx=$led_rx"
+
+       for key in rtscts local xonxoff nobreak hangup_when_done; do
+               config_get_bool boolval "$cfg" "$key"
+               [ -n "$boolval" ] || continue
+               append_bool options "$key" "$boolval" 1
+       done
+
+       for key in chardelay telnet_brk_on_sync kickolduser remctl; do
+               config_get_bool boolval "$cfg" "$key"
+               [ -n "$boolval" ] || continue
+               append_bool options "$key" "$boolval" 0
+       done
+
+       config_list_foreach "$cfg" options list_cb_append options
+
+       if [ "`echo "$device" | sed 's/://g'`" != "$device" ]; then
+               echo "DEVICE:$cfg:$device"
+               device="$cfg"
+       fi
+
+       echo -e "$port:$protocol:$timeout:$device:$options\n"
+}
+
+start_service() {
+       local enabled
+
+       config_load ser2net
+
+       config_get_bool enabled global enabled 0
+       [ "$enabled" -gt 0 ] || return 0
+
+       cat "$STATICCFGFILE" - 2>/dev/null <<-EOF > "$DYNAMICCFGFILE"
+       
+       #
+       # Following part is auto-generated from UCI settings in /etc/config/ser2net
+       #
+       EOF
+
+       config_foreach ser2net_controlport controlport >> "$DYNAMICCFGFILE"
+       config_foreach ser2net_default default >> "$DYNAMICCFGFILE"
+       config_foreach ser2net_led led >> "$DYNAMICCFGFILE"
+       config_foreach ser2net_proxy proxy >> "$DYNAMICCFGFILE"
+
+       procd_open_instance
+       procd_set_param command "$PROG" -n -c "$DYNAMICCFGFILE"
+       procd_close_instance
+}
index 3e8c9be243bf2d6f3b562149f2c9e5152a6c6197..3d18bbb2439c46a4627002890765d0907b8bef4c 100644 (file)
@@ -9,7 +9,8 @@ PKG_SOURCE_URL:=https://github.com/zhao-gang/shadowsocks-tiny.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=b59d754f838213d60b908aed0b7d4d5a81f273e2
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_MAINTAINER:=Zhao, Gang <gang.zhao.42@gmail.com>
+PKG_MIRROR_HASH:=55da440f514507359ccc86aa07ee97cecfa3ad2c65db92e031b1dc7a27eac494
+PKG_MAINTAINER:=Gang Zhao <gang.zhao.42@gmail.com>
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
index 5287ec608261ff3200a0b73cb5c96b1fc2eba145..e96642f0932515af0e69eb3a2f5567eb1a9d9ca4 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2015 OpenWrt.org
+# Copyright (C) 2017-2018 Yousong Zhou <yszhou4tech@gmail.com>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 
 include $(TOPDIR)/rules.mk
 
+# Checklist when bumping versions
+#
+# - update cipher list by checking src/crypto.c:crypto_init()
+# - check if default mode has changed from being tcp_only
+#
 PKG_NAME:=shadowsocks-libev
-PKG_VERSION:=2.6.1
-PKG_RELEASE:=1
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
-PKG_SOURCE_VERSION:=a3bf80cf11e0a88589abdd87266b5351f270197c
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
-PKG_MAINTAINER:=Jian Chang <aa65535@live.com>
-PKG_MIRROR_MD5SUM:=fc60936d8b990fdecd69b908bc6b770b1c1e54598da6622cc9669750c76fa2d1
-
-PKG_LICENSE:=GPLv2
-PKG_LICENSE_FILES:=LICENSE
+PKG_VERSION:=3.1.3
+PKG_RELEASE:=2
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION)
+PKG_HASH:=58fb438d2cfe33cfa6ac8c50e587e2138c50e59a4b943f88d22883bf2e192a96
+
+PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
+
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=LICENSE
 
-PKG_INSTALL:=1
 PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
 PKG_USE_MIPS16:=0
 PKG_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/shadowsocks-libev/Default
-       SECTION:=net
-       CATEGORY:=Network
-       TITLE:=Lightweight Secured Socks5 Proxy $(2)
-       URL:=https://github.com/shadowsocks/shadowsocks-libev
-       VARIANT:=$(1)
-       DEPENDS:=$(3) +libpthread +ipset +ip +iptables-mod-tproxy +libpcre +zlib
+
+define Package/shadowsocks-libev-config
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Web Servers/Proxies
+  TITLE:=shadowsocks-libev config scripts
+  URL:=https://github.com/shadowsocks/shadowsocks-libev
 endef
 
-CONFIGURE_ARGS += \
-       --disable-documentation \
+define Package/shadowsocks-libev-config/install
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./files/shadowsocks-libev.config $(1)/etc/config/shadowsocks-libev
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/shadowsocks-libev.init $(1)/etc/init.d/shadowsocks-libev
+endef
 
-Package/shadowsocks-libev = $(call Package/shadowsocks-libev/Default,openssl,(OpenSSL),+libopenssl)
-Package/shadowsocks-libev-mbedtls = $(call Package/shadowsocks-libev/Default,mbedtls,(mbed TLS),+libmbedtls)
 
-define Package/shadowsocks-libev/description
-Shadowsocks-libev is a lightweight secured socks5 proxy for embedded devices and low end boxes.
+define Package/shadowsocks-libev/Default
+  define Package/shadowsocks-libev-$(1)
+    SECTION:=net
+    CATEGORY:=Network
+    SUBMENU:=Web Servers/Proxies
+    TITLE:=shadowsocks-libev $(1)
+    URL:=https://github.com/shadowsocks/shadowsocks-libev
+    DEPENDS:=+libcares +libev +libmbedtls +libpcre +libpthread +libsodium +shadowsocks-libev-config +zlib
+  endef
+
+  define Package/shadowsocks-libev-$(1)/install
+       $$(INSTALL_DIR) $$(1)/usr/bin
+       $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin
+  endef
+
+endef
+
+SHADOWSOCKS_COMPONENTS:=ss-local ss-redir ss-tunnel ss-server
+define shadowsocks-libev/templates
+  $(foreach component,$(SHADOWSOCKS_COMPONENTS),
+    $(call Package/shadowsocks-libev/Default,$(component))
+  )
 endef
+$(eval $(call shadowsocks-libev/templates))
 
-Package/shadowsocks-libev-mbedtls/description = $(Package/shadowsocks-libev/description)
 
-define Package/shadowsocks-libev/conffiles
-/etc/config/shadowsocks-libev
+define Package/shadowsocks-libev-ss-rules
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Web Servers/Proxies
+  TITLE:=shadowsocks-libev ss-rules
+  URL:=https://github.com/shadowsocks/shadowsocks-libev
+  DEPENDS:=+ip +ipset +iptables-mod-tproxy +resolveip +shadowsocks-libev-ss-redir +shadowsocks-libev-config
 endef
 
-Package/shadowsocks-libev-mbedtls/conffiles = $(Package/shadowsocks-libev/conffiles)
+define Package/shadowsocks-libev-ss-rules/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) ./files/ss-rules $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_DATA) ./files/firewall.ss-rules $(1)/etc
+       $(INSTALL_BIN) ./files/ss-rules.defaults $(1)/etc/uci-defaults
+endef
 
-define Package/shadowsocks-libev/postinst
+define Package/shadowsocks-libev-ss-rules/prerm
 #!/bin/sh
-uci -q batch <<-EOF >/dev/null
-       delete firewall.shadowsocks_libev
-       set firewall.shadowsocks_libev=include
-       set firewall.shadowsocks_libev.type=script
-       set firewall.shadowsocks_libev.path=/usr/share/shadowsocks-libev/firewall.include
-       set firewall.shadowsocks_libev.reload=1
+s=firewall.ss_rules
+uci get "$$s" >/dev/null || exit 0
+uci batch <<-EOF
+       delete $$s
        commit firewall
 EOF
-exit 0
 endef
 
-Package/shadowsocks-libev-mbedtls/postinst = $(Package/shadowsocks-libev/postinst)
-
-ifeq ($(BUILD_VARIANT),mbedtls)
-       CONFIGURE_ARGS += --with-crypto-library=mbedtls
-endif
-
-define Package/shadowsocks-libev/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-{redir,tunnel} $(1)/usr/bin
-       $(INSTALL_BIN) ./files/ss-rules $(1)/usr/bin
-       $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_DATA) ./files/shadowsocks-libev.config $(1)/etc/config/shadowsocks-libev
-       $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) ./files/shadowsocks-libev.init $(1)/etc/init.d/shadowsocks-libev
-       $(INSTALL_DIR) $(1)/usr/share/shadowsocks-libev
-       $(INSTALL_DATA) ./files/firewall.include $(1)/usr/share/shadowsocks-libev/firewall.include
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       $(FIND) $(PKG_BUILD_DIR) \
+                          -name '*.o' \
+                       -o -name '*.lo' \
+                       -o -name '.deps' \
+                       -o -name '.libs' \
+               | $(XARGS) rm -rvf
 endef
 
-Package/shadowsocks-libev-mbedtls/install = $(Package/shadowsocks-libev/install)
-
-$(eval $(call BuildPackage,shadowsocks-libev))
-$(eval $(call BuildPackage,shadowsocks-libev-mbedtls))
+CONFIGURE_ARGS += \
+       --disable-documentation \
+       --disable-silent-rules \
+       --disable-assert \
+       --disable-ssp \
+
+$(eval $(call BuildPackage,shadowsocks-libev-config))
+$(eval $(call BuildPackage,shadowsocks-libev-ss-rules))
+$(foreach component,$(SHADOWSOCKS_COMPONENTS), \
+  $(eval $(call BuildPackage,shadowsocks-libev-$(component))) \
+)
diff --git a/net/shadowsocks-libev/README.md b/net/shadowsocks-libev/README.md
new file mode 100644 (file)
index 0000000..ada7120
--- /dev/null
@@ -0,0 +1,97 @@
+## components
+
+`ss-local` provides SOCKS5 proxy with UDP associate support.
+
+        socks5                                     ss              plain
+       --------> tcp:local_address:local_port ----> ss server -------> dest
+
+`ss-redir`.  The REDIRECT and TPROXY part are to be provided by `ss-rules` script.  REDIRECT only works for tcp traffic (see also darkk/redsocks).  TPROXY is used to proxy udp messages, but it's only available in the PREROUTING chain and as such cannot proxy local out traffic.
+
+         plain             plain                                 ss              plain
+       ---------> REDIRECT ------> tcp:local_address:local_port ----> ss server -----> original dest
+
+         plain            plain                                 ss              plain
+       ---------> TPROXY -------> udp:local_address:local_port -----> ss server -----> original dest
+
+`ss-tunnel` provides ssh `-L` local-forwarding-like tunnel.  Typically it's used to tunnel DNS traffic to the remote.
+
+         plain                                       ss               plain
+       ---------> tcp|udp:local_address:local_port ------> ss server -------> tunnel_address
+
+`ss-server`, the "ss server" in the above diagram
+
+## uci
+
+Option names are the same as those used in json config files.  Check `validate_xxx` func definition of the [service script](files/shadowsocks-libev.init) and shadowsocks-libev's own documentation for supported options and expected value types.  A [sample config file](files/shadowsocks-libev.config) is also provided for reference.
+
+Every section have a `disabled` option to temporarily turn off the component instance or component instances referring to it.
+
+Section type `server` is for definition of remote shadowsocks servers.  They will be referred to from other component sections and as such should be named (as compared to anonymous section).
+
+Section type `ss_local`, `ss_redir`, `ss_tunnel` are for specification of shadowsocks-libev components.  They share mostly a common set of options like `local_port`, `verbose`, `fast_open`, `timeout`, etc.
+
+We can have multiple instances of component and `server` sections.  The relationship between them is many-to-one.  This will have the following implications
+
+ - It's possible to have both `ss_local` and `ss_redir` referring to the same `server` definition
+ - It's possible to have multiple instances of `ss_redir` listening on the same address:port with `reuse_port` enabled referring to the same or different `server` sections
+
+`ss_rules` section is for configuring the behaviour of `ss-rules` script.  There can only exist at most one such section with the name also being `ss_rules`
+
+       redir_tcp               name of ss_redir section with mode tcp_only or tcp_and_udp
+       redir_udp               name of ss_redir section with mode udp_only or tcp_and_udp
+       ifnames                 only apply rules on packets from these ifnames
+
+       --- for incoming packets having source address in
+
+       src_ips_bypass          will bypass the redir chain
+       src_ips_forward         will always go through the redir chain
+       src_ips_checkdst        will continue to have their destination addresses checked
+
+       --- otherwise, the default action can be specified with
+
+       src_default             bypass, forward, [checkdst]
+
+       --- if the previous check result is checkdst,
+       --- then packets having destination address in
+
+       dst_ips_bypass_file
+       dst_ips_bypass          will bypass the redir chain
+       dst_ips_forward_file
+       dst_ips_forward         will go through the redir chain
+
+       --- otherwise, the default action can be specified with
+
+       dst_default             [bypass], forward
+
+       --- for local out tcp packets, the default action can be specified with
+
+       local_default           [bypass], forward, checkdst
+
+Bool option `dst_forward_recentrst` requires iptables/netfilter `recent` match module (`opkg install iptables-mod-conntrack-extra`).  When enabled, `ss-rules` will setup iptables rules to forward through `ss-redir` those packets whose destination have recently sent to us multiple tcp-rst.
+
+ss-rules uses kernel ipset mechanism for storing addresses/networks.  Those ipsets are also part of the API and can be populated by other programs, e.g. dnsmasq with builtin ipset support.  For more details please read output of `ss-rules --help`
+
+Note also that `src_ips_xx` and `dst_ips_xx` actually also accepts cidr network representation.  Option names are retained in its current form for backward compatibility coniderations
+
+## notes and faq
+
+Useful paths and commands for debugging
+
+       # check current running status
+       ubus call service list '{"name": "shadowsocks-libev"}'
+       ubus call service list '{"name": "shadowsocks-libev", "verbose": true}'
+
+       # dump validate definition
+       ubus call service validate '{"package": "shadowsocks-libev"}'
+       ubus call service validate '{"package": "shadowsocks-libev"}' \
+               | jsonfilter -e '$["shadowsocks-libev"]["ss_tunnel"]'
+
+       # check json config
+       ls -l /var/etc/shadowsocks-libev/
+
+       # set uci config option verbose to 1, restart the service and follow the log
+       logread -f
+
+ss-redir needs to open a new socket and setsockopt IP_TRANSPARENT when sending udp reply to client.  This requires `CAP_NET_ADMIN` and as such the process cannot run as `nobody`
+
+ss-local, ss-redir, etc. supports specifying an array of remote ss server, but supporting this in uci seems to be overkill.  The workaround can be defining multiple `server` sections and multiple `ss-redir` instances with `reuse_port` enabled
diff --git a/net/shadowsocks-libev/files/firewall.include b/net/shadowsocks-libev/files/firewall.include
deleted file mode 100644 (file)
index 3a00e80..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-if pidof ss-redir>/dev/null; then
-       /etc/init.d/shadowsocks-libev rules
-       logger -t ShadowSocks-libev "Reloading ShadowSocks-libev due to restart of firewall"
-fi
diff --git a/net/shadowsocks-libev/files/firewall.ss-rules b/net/shadowsocks-libev/files/firewall.ss-rules
new file mode 100644 (file)
index 0000000..3a1d32c
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/shadowsocks-libev reload
index 95aec7b2ec441fcb7d08857e63b6bc4603a87270..93768e9711f44035465f1130a173c2cf8fcd6511 100644 (file)
@@ -1,15 +1,61 @@
-
-config shadowsocks-libev
-       option enable '1'
-       option server '127.0.0.1'
-       option server_port '8388'
+config ss_local
+       option disabled 1
+       option server 'sss0'
+       option local_address '0.0.0.0'
        option local_port '1080'
-       option password 'barfoo!'
+       option timeout '30'
+
+config ss_tunnel
+       option disabled 1
+       option server 'sss0'
+       option local_address '0.0.0.0'
+       option local_port '1090'
+       option tunnel_address 'example.com:80'
+       option mode 'tcp_and_udp'
        option timeout '60'
-       option encrypt_method 'rc4-md5'
-       option ignore_list '/dev/null'
-       option udp_mode '0'
-       option tunnel_enable '1'
-       option tunnel_port '5300'
-       option tunnel_forward '8.8.4.4:53'
-       option lan_ac_mode '0'
+
+config ss_redir hi
+       option disabled 1
+       option server 'sss0'
+       option local_address '0.0.0.0'
+       option local_port '1100'
+       option mode 'tcp_and_udp'
+       option timeout '60'
+       option fast_open 1
+       option verbose 1
+       option reuse_port 1
+
+config ss_redir hj
+       option disabled 1
+       option server 'sss0'
+       option local_address '0.0.0.0'
+       option local_port '1100'
+       option mode 'tcp_and_udp'
+       option timeout '60'
+       option fast_open 1
+       option verbose 1
+       option reuse_port 1
+
+config ss_rules 'ss_rules'
+       option disabled 1
+       option redir_tcp 'hi'
+       option redir_udp 'hi'
+       option src_default 'checkdst'
+       option dst_default 'bypass'
+       option local_default 'checkdst'
+       list src_ips_forward '192.168.1.4'
+       list dst_ips_forward '8.8.8.8'
+
+config server 'sss0'
+       option disabled 1
+       option server '192.168.1.3'
+       option server_port '9001'
+       option password '********'
+       option method 'aes-256-cfb'
+
+config ss_server
+       option disabled 1
+       option server_port '9001'
+       option password '********'
+       option method 'aes-256-cfb'
+       option bind_address '192.168.7.72'
index 9a64038a722a140ff3547a9e26ea278c95af3c99..22d825d0b1bddde32db38337c2135615a1ae2e9f 100644 (file)
 #!/bin/sh /etc/rc.common
+#
+# Copyright (C) 2017 Yousong Zhou <yszhou4tech@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v3.
+# See /LICENSE for more information.
+#
 
-START=90
-STOP=15
-
-SERVICE_USE_PID=1
-SERVICE_WRITE_PID=1
-SERVICE_DAEMONIZE=1
-EXTRA_COMMANDS="rules"
-CONFIG_FILE=/var/etc/shadowsocks-libev.json
-
-get_config() {
-       config_get_bool enable $1 enable
-       config_get server $1 server
-       config_get server_port $1 server_port
-       config_get local_port $1 local_port
-       config_get timeout $1 timeout
-       config_get password $1 password
-       config_get encrypt_method $1 encrypt_method
-       config_get ignore_list $1 ignore_list
-       config_get udp_mode $1 udp_mode
-       config_get udp_server $1 udp_server
-       config_get udp_server_port $1 udp_server_port
-       config_get udp_local_port $1 udp_local_port
-       config_get udp_timeout $1 udp_timeout
-       config_get udp_password $1 udp_password
-       config_get udp_encrypt_method $1 udp_encrypt_method
-       config_get_bool tunnel_enable $1 tunnel_enable
-       config_get tunnel_port $1 tunnel_port
-       config_get tunnel_forward $1 tunnel_forward
-       config_get lan_ac_mode $1 lan_ac_mode
-       config_get lan_ac_ip $1 lan_ac_ip
-       config_get wan_bp_ip $1 wan_bp_ip
-       config_get wan_fw_ip $1 wan_fw_ip
-       config_get ipt_ext $1 ipt_ext
-       : ${timeout:=60}
-       : ${udp_timeout:=60}
-       : ${tunnel_port:=5300}
-       : ${tunnel_forward:=8.8.4.4:53}
-}
-
-start_rules() {
-       local ac_args
-
-       if [ -n "$lan_ac_ip" ]; then
-               case $lan_ac_mode in
-                       1) ac_args="w$lan_ac_ip"
-                       ;;
-                       2) ac_args="b$lan_ac_ip"
-                       ;;
-               esac
+USE_PROCD=1
+START=99
+
+ss_confdir=/var/etc/shadowsocks-libev
+ss_bindir=/usr/bin
+q='"'
+
+ss_mkjson() {
+       echo "{" >"$confjson"
+       if ss_mkjson_ "$@" >>$confjson; then
+               sed -i -e '/^\s*$/d' -e '2,$s/^/\t/' -e '$s/,$//' "$confjson"
+               echo "}" >>"$confjson"
+       else
+               rm -f "$confjson"
+               return 1
        fi
-       /usr/bin/ss-rules \
-               -s "$server" \
-               -l "$local_port" \
-               -S "$udp_server" \
-               -L "$udp_local_port" \
-               -i "$ignore_list" \
-               -a "$ac_args" \
-               -b "$wan_bp_ip" \
-               -w "$wan_fw_ip" \
-               -e "$ipt_ext" \
-               -o $udp
-       return $?
-}
-
-start_redir() {
-       cat <<-EOF >$CONFIG_FILE
-               {
-                   "server": "$server",
-                   "server_port": $server_port,
-                   "local_address": "0.0.0.0",
-                   "local_port": $local_port,
-                   "password": "$password",
-                   "timeout": $timeout,
-                   "method": "$encrypt_method"
-               }
-EOF
-       if [ "$udp_mode" = 2 ]; then
-               /usr/bin/ss-redir \
-                       -c $CONFIG_FILE \
-                       -f /var/run/ss-redir_t.pid
-               cat <<-EOF >$CONFIG_FILE
-                       {
-                           "server": "$udp_server",
-                           "server_port": $udp_server_port,
-                           "local_address": "0.0.0.0",
-                           "local_port": $udp_local_port,
-                           "password": "$udp_password",
-                           "timeout": $udp_timeout,
-                           "method": "$udp_encrypt_method"
-                       }
-EOF
+}
+
+ss_mkjson_() {
+       local func
+
+       for func in "$@"; do
+               "$func" || return 1
+       done
+}
+
+ss_mkjson_server_conf() {
+       local cfgserver
+
+       config_get cfgserver "$cfg" server
+       [ -n "$cfgserver" ] || return 1
+       eval "$(validate_server_section "$cfg" ss_validate_mklocal)"
+       validate_server_section "$cfgserver" || return 1
+       [ "$disabled" = 0 ] || return 1
+       ss_mkjson_server_conf_ "$cfgserver"
+}
+
+ss_mkjson_server_conf_() {
+       [ -n "$server_port" ] || return 1
+       password="${password//\"/\\\"}"
+       cat <<-EOF
+               ${server:+${q}server${q}: ${q}$server${q},}
+               "server_port": $server_port,
+               ${method:+${q}method${q}: ${q}$method${q},}
+               ${key:+${q}key${q}: ${q}$key${q},}
+               ${password:+${q}password${q}: ${q}$password${q},}
+       EOF
+}
+
+ss_mkjson_common_conf() {
+       [ "$ipv6_first" = 0 ] && ipv6_first=false || ipv6_first=true
+       [ "$fast_open" = 0 ] && fast_open=false || fast_open=true
+       [ "$reuse_port" = 0 ] && reuse_port=false || reuse_port=true
+       cat <<-EOF
+               "use_syslog": true,
+               "ipv6_first": $ipv6_first,
+               "fast_open": $fast_open,
+               "reuse_port": $reuse_port,
+               ${local_address:+${q}local_address${q}: ${q}$local_address${q},}
+               ${local_port:+${q}local_port${q}: $local_port,}
+               ${mode:+${q}mode${q}: ${q}$mode${q},}
+               ${mtu:+${q}mtu${q}: $mtu,}
+               ${timeout:+${q}timeout${q}: $timeout,}
+               ${user:+${q}user${q}: ${q}$user${q},}
+       EOF
+}
+
+ss_mkjson_ss_local_conf() {
+       ss_mkjson_server_conf
+}
+
+ss_mkjson_ss_redir_conf() {
+       ss_mkjson_server_conf
+}
+
+ss_mkjson_ss_server_conf() {
+       ss_mkjson_server_conf_
+}
+
+ss_mkjson_ss_tunnel_conf() {
+       ss_mkjson_server_conf || return 1
+       [ -n "$tunnel_address" ] || return 1
+       cat <<-EOF
+               ${tunnel_address:+${q}tunnel_address${q}: ${q}$tunnel_address${q},}
+       EOF
+}
+
+ss_xxx() {
+       local cfg="$1"
+       local cfgtype="$2"
+       local bin="$ss_bindir/${cfgtype/_/-}"
+       local confjson="$ss_confdir/$cfgtype.$cfg.json"
+
+       [ -x "$bin" ] || return
+       eval "$("validate_${cfgtype}_section" "$cfg" ss_validate_mklocal)"
+       "validate_${cfgtype}_section" "$cfg" || return 1
+       [ "$disabled" = 0 ] || return
+
+       if ss_mkjson \
+                       ss_mkjson_common_conf \
+                       ss_mkjson_${cfgtype}_conf \
+                       ; then
+               procd_open_instance "$cfgtype.$cfg"
+               procd_set_param command "$bin" -c "$confjson"
+               [ "$verbose" = 0 ] || procd_append_param command -v
+               [ "$no_delay" = 0 ] || procd_append_param command --no-delay
+               [ -z "$bind_address" ] || procd_append_param command -b "$bind_address"
+               procd_set_param file "$confjson"
+               procd_set_param respawn
+               procd_close_instance
+               ss_rules_cb
        fi
-       /usr/bin/ss-redir \
-               -c $CONFIG_FILE \
-               -f /var/run/ss-redir.pid \
-               $udp
-       return $?
 }
 
-start_tunnel() {
-       : ${udp:="-u"}
-       /usr/bin/ss-tunnel \
-               -c $CONFIG_FILE \
-               -l $tunnel_port \
-               -L $tunnel_forward \
-               -f /var/run/ss-tunnel.pid \
-               $udp
-       return $?
+ss_rules_cb() {
+       local cfgserver server
+
+       if [ "$cfgtype" = ss_redir ]; then
+               config_get cfgserver "$cfg" server
+               config_get server "$cfgserver" server
+               ss_redir_servers="$ss_redir_servers $server"
+               if [ "$mode" = tcp_only -o "$mode" = "tcp_and_udp" ]; then
+                       eval "ss_rules_redir_tcp_$cfg=$local_port"
+               fi
+               if [ "$mode" = udp_only -o "$mode" = "tcp_and_udp" ]; then
+                       eval "ss_rules_redir_udp_$cfg=$local_port"
+               fi
+       fi
 }
 
-rules() {
+ss_rules() {
+       local cfg="ss_rules"
+       local bin="$ss_bindir/ss-rules"
+       local cfgtype
+       local local_port_tcp local_port_udp
+       local args
+
+       [ -x "$bin" ] || return 1
+       config_get cfgtype "$cfg" TYPE
+       [ "$cfgtype" = ss_rules ] || return 1
+
+       eval "$(validate_ss_rules_section "$cfg" ss_validate_mklocal)"
+       validate_ss_rules_section "$cfg" || return 1
+       [ "$disabled" = 0 ] || return 1
+
+       eval local_port_tcp="\$ss_rules_redir_tcp_$redir_tcp"
+       eval local_port_udp="\$ss_rules_redir_udp_$redir_udp"
+       [ -n "$local_port_tcp" -o -n "$local_port_udp" ] || return 1
+       ss_redir_servers="$(echo "$ss_redir_servers" | tr ' ' '\n' | sort -u)"
+       [ "$dst_forward_recentrst" = 0 ] || args="$args --dst-forward-recentrst"
+
+       "$bin" \
+                       -s "$ss_redir_servers" \
+                       -l "$local_port_tcp" \
+                       -L "$local_port_udp" \
+                       --src-default "$src_default" \
+                       --dst-default "$dst_default" \
+                       --local-default "$local_default" \
+                       --dst-bypass-file "$dst_ips_bypass_file" \
+                       --dst-forward-file "$dst_ips_forward_file" \
+                       --dst-bypass "$dst_ips_bypass" \
+                       --dst-forward "$dst_ips_forward" \
+                       --src-bypass "$src_ips_bypass" \
+                       --src-forward "$src_ips_forward" \
+                       --src-checkdst "$src_ips_checkdst" \
+                       --ifnames "$ifnames" \
+                       --ipt-extra "$ipt_args" \
+                       $args \
+               || "$bin" -f
+}
+
+start_service() {
+       local cfgtype
+
+       mkdir -p "$ss_confdir"
        config_load shadowsocks-libev
-       config_foreach get_config shadowsocks-libev
-       [ "$enable" = 1 ] || exit 0
-       mkdir -p /var/run /var/etc
-
-       : ${server:?}
-       : ${server_port:?}
-       : ${local_port:?}
-       : ${password:?}
-       : ${encrypt_method:?}
-       case $udp_mode in
-               1) udp="-u"
-               ;;
-               2)
-                       udp="-U"
-                       : ${udp_server:?}
-                       : ${udp_server_port:?}
-                       : ${udp_local_port:?}
-                       : ${udp_password:?}
-                       : ${udp_encrypt_method:?}
-               ;;
-       esac
-
-       start_rules
-}
-
-boot() {
-       until iptables-save -t nat | grep -q "^:zone_lan_prerouting"; do
-               sleep 1
+       for cfgtype in ss_local ss_redir ss_server ss_tunnel; do
+               config_foreach ss_xxx "$cfgtype" "$cfgtype"
        done
-       start
+       ss_rules
+}
+
+stop_service() {
+       local bin="$ss_bindir/ss-rules"
+
+       [ -x "$bin" ] && "$bin" -f
+       rm -rf "$ss_confdir"
+}
+
+service_triggers() {
+       procd_add_reload_interface_trigger wan
+       procd_add_reload_trigger shadowsocks-libev
+       procd_open_validate
+       validate_server_section
+       validate_ss_local_section
+       validate_ss_redir_section
+       validate_ss_rules_section
+       validate_ss_server_section
+       validate_ss_tunnel_section
+       procd_close_validate
+}
+
+ss_validate_mklocal() {
+       local tuple opts
+
+       shift 2
+       for tuple in "$@"; do
+               opts="${tuple%%:*} $opts"
+       done
+       [ -z "$opts" ] || echo "local $opts"
+}
+
+ss_validate() {
+       uci_validate_section shadowsocks-libev "$@"
+}
+
+validate_common_server_options_() {
+       local cfgtype="$1"; shift
+       local cfg="$1"; shift
+       local func="$1"; shift
+       local stream_methods='"table", "rc4", "rc4-md5", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "bf-cfb", "camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "salsa20", "chacha20", "chacha20-ietf"'
+       local aead_methods='"aes-128-gcm", "aes-192-gcm", "aes-256-gcm", "chacha20-ietf-poly1305", "xchacha20-ietf-poly1305"'
+
+       "${func:-ss_validate}" "$cfgtype" "$cfg" "$@" \
+               'disabled:bool:0' \
+               'server:host' \
+               'server_port:port' \
+               'password:string' \
+               'key:string' \
+               "method:or($stream_methods, $aead_methods)"
+}
+
+validate_common_client_options_() {
+       validate_common_options_ "$@" \
+               'server:uci("shadowsocks-libev", "@server")' \
+               'local_address:host:0.0.0.0' \
+               'local_port:port'
+}
+
+validate_common_options_() {
+       local cfgtype="$1"; shift
+       local cfg="$1"; shift
+       local func="$1"; shift
+
+       "${func:-ss_validate}" "$cfgtype" "$cfg" "$@" \
+               'disabled:bool:0' \
+               'fast_open:bool:0' \
+               'ipv6_first:bool:0' \
+               'no_delay:bool:0' \
+               'reuse_port:bool:0' \
+               'verbose:bool:0' \
+               'mode:or("tcp_only", "udp_only", "tcp_and_udp"):tcp_only' \
+               'mtu:uinteger' \
+               'timeout:uinteger' \
+               'user:string'
+}
+
+validate_server_section() {
+       validate_common_server_options_ server "$1" "$2"
+}
+
+validate_ss_local_section() {
+       validate_common_client_options_ ss_local "$1" "$2"
+}
+
+validate_ss_redir_section() {
+       validate_common_client_options_ ss_redir "$1" "$2"
+}
+
+validate_ss_rules_section() {
+       "${2:-ss_validate}" ss_rules "$1" \
+               'disabled:bool:0' \
+               'redir_tcp:uci("shadowsocks-libev", "@ss_redir")' \
+               'redir_udp:uci("shadowsocks-libev", "@ss_redir")' \
+               'src_ips_bypass:or(ip4addr,cidr4)' \
+               'src_ips_forward:or(ip4addr,cidr4)' \
+               'src_ips_checkdst:or(ip4addr,cidr4)' \
+               'dst_ips_bypass_file:file' \
+               'dst_ips_bypass:or(ip4addr,cidr4)' \
+               'dst_ips_forward_file:file' \
+               'dst_ips_forward:or(ip4addr,cidr4)' \
+               'src_default:or("bypass", "forward", "checkdst"):checkdst' \
+               'dst_default:or("bypass", "forward"):bypass' \
+               'local_default:or("bypass", "forward", "checkdst"):bypass' \
+               'dst_forward_recentrst:bool:0' \
+               'ifnames:maxlength(15)' \
+               'ipt_args:string'
 }
 
-start() {
-       rules && start_redir
-       [ "$tunnel_enable" = 1 ] && start_tunnel
+validate_ss_server_section() {
+       validate_common_server_options_ ss_server "$1" \
+               validate_common_options_ \
+               "$2" \
+               'bind_address:ipaddr'
 }
 
-stop() {
-       /usr/bin/ss-rules -f
-       killall -q -9 ss-redir
-       killall -q -9 ss-tunnel
+validate_ss_tunnel_section() {
+       validate_common_client_options_ ss_tunnel "$1" \
+               "$2" \
+               'tunnel_address:regex(".+\:[0-9]+")'
 }
old mode 100644 (file)
new mode 100755 (executable)
index 8ce1000..b0a3060
-#!/bin/sh
-
-usage() {
-       cat <<-EOF
-               Usage: ss-rules [options]
-
-               Valid options are:
-
-                   -s <server_host>        hostname or ip of shadowsocks remote server
-                   -l <local_port>         port number of shadowsocks local server
-                   -i <ip_list_file>       a file content is bypassed ip list
-                   -a <lan_ips>            lan ip of access control, need a prefix to
-                                           define access control mode
-                   -b <wan_ips>            wan ip of will be bypassed
-                   -w <wan_ips>            wan ip of will be forwarded
-                   -e <extra_options>      extra options for iptables
-                   -o                      apply the rules to the OUTPUT chain
-                   -u                      enable udprelay mode, TPROXY is required
-                   -U                      enable udprelay mode, using different IP
-                                           and ports for TCP and UDP
-                   -f                      flush the rules
-EOF
-}
+#!/bin/sh -e
+#
+# Copyright (C) 2017 Yousong Zhou <yszhou4tech@gmail.com>
+#
+# The design idea was derived from ss-rules by Jian Chang <aa65535@live.com>
+#
+# This is free software, licensed under the GNU General Public License v3.
+# See /LICENSE for more information.
+#
 
-loger() {
-       # 1.alert 2.crit 3.err 4.warn 5.notice 6.info 7.debug
-       logger -st ss-rules[$$] -p$1 $2
-}
+ss_rules_usage() {
+       cat >&2 <<EOF
+Usage: ss-rules [options]
+
+       -h, --help      Show this help message then exit
+       -f, --flush     Flush rules, ipset then exit
+       -l <port>       Local port number of ss-redir with TCP mode
+       -L <port>       Local port number of ss-redir with UDP mode
+       -s <ips>        List of ip addresses of remote shadowsocks server
+       --ifnames       Only apply rules on packets from these ifnames
+       --src-bypass <ips|cidr>
+       --src-forward <ips|cidr>
+       --src-checkdst <ips|cidr>
+       --src-default <bypass|forward|checkdst>
+                       Packets will have their src ip checked in order against
+                       bypass, forward, checkdst list and will bypass, forward
+                       through, or continue to have their dst ip checked
+                       respectively on the first match.  Otherwise, --src-default
+                       decide the default action
+       --dst-bypass <ips|cidr>
+       --dst-forward <ips|cidr>
+       --dst-bypass-file <file>
+       --dst-forward-file <file>
+       --dst-default <bypass|forward>
+                       Same as with their --src-xx equivalent
+       --dst-forward-recentrst
+                       Forward those packets whose destinations have recently
+                       sent to us multiple tcp-rst packets
+       --local-default <bypass|forward|checkdst>
+                       Default action for local out TCP traffic
+
+The following ipsets will be created by ss-rules.  They are also intended to be
+populated by other programs like dnsmasq with ipset support
 
-ipt_n="iptables -t nat"
-ipt_m="iptables -t mangle"
+       ss_rules_src_bypass
+       ss_rules_src_forward
+       ss_rules_src_checkdst
+       ss_rules_dst_bypass
+       ss_rules_dst_forward
+EOF
+}
 
-flush_r() {
-       local IPT
+o_dst_bypass_="
+       0.0.0.0/8
+       10.0.0.0/8
+       100.64.0.0/10
+       127.0.0.0/8
+       169.254.0.0/16
+       172.16.0.0/12
+       192.0.0.0/24
+       192.0.2.0/24
+       192.31.196.0/24
+       192.52.193.0/24
+       192.88.99.0/24
+       192.168.0.0/16
+       192.175.48.0/24
+       198.18.0.0/15
+       198.51.100.0/24
+       203.0.113.0/24
+       224.0.0.0/4
+       240.0.0.0/4
+       255.255.255.255
+"
+o_src_default=bypass
+o_dst_default=bypass
+o_local_default=bypass
 
-       IPT=$(iptables-save -t nat)
-       eval $(echo "$IPT" | grep "_SS_SPEC_RULE_" | \
-               sed -e 's/^-A/$ipt_n -D/' -e 's/$/;/')
+__errmsg() {
+       echo "ss-rules: $*" >&2
+}
 
-       for chain in $(echo "$IPT" | awk '/^:SS_SPEC/{print $1}'); do
-               $ipt_n -F ${chain:1} 2>/dev/null && $ipt_n -X ${chain:1}
+ss_rules_parse_args() {
+       while [ "$#" -gt 0 ]; do
+               case "$1" in
+                       -h|--help) ss_rules_usage; exit 0;;
+                       -f|--flush) ss_rules_flush; exit 0;;
+                       -l) o_redir_tcp_port="$2"; shift 2;;
+                       -L) o_redir_udp_port="$2"; shift 2;;
+                       -s) o_remote_servers="$2"; shift 2;;
+                       --ifnames) o_ifnames="$2"; shift 2;;
+                       --ipt-extra) o_ipt_extra="$2"; shift 2;;
+                       --src-default) o_src_default="$2"; shift 2;;
+                       --dst-default) o_dst_default="$2"; shift 2;;
+                       --local-default) o_local_default="$2"; shift 2;;
+                       --src-bypass) o_src_bypass="$2"; shift 2;;
+                       --src-forward) o_src_forward="$2"; shift 2;;
+                       --src-checkdst) o_src_checkdst="$2"; shift 2;;
+                       --dst-bypass) o_dst_bypass="$2"; shift 2;;
+                       --dst-forward) o_dst_forward="$2"; shift 2;;
+                       --dst-forward-recentrst) o_dst_forward_recentrst=1; shift 1;;
+                       --dst-bypass-file) o_dst_bypass_file="$2"; shift 2;;
+                       --dst-forward-file) o_dst_forward_file="$2"; shift 2;;
+                       *) __errmsg "unknown option $1"; return 1;;
+               esac
        done
 
-       IPT=$(iptables-save -t mangle)
-       eval $(echo "$IPT" | grep "_SS_SPEC_RULE_" | \
-               sed -e 's/^-A/$ipt_m -D/' -e 's/$/;/')
+       if [ -z "$o_redir_tcp_port" -a -z "$o_redir_udp_port" ]; then
+               __errmsg "Requires at least -l or -L option"
+               return 1
+       fi
+       if [ -n "$o_dst_forward_recentrst" ] && ! iptables -m recent -h >/dev/null; then
+               __errmsg "Please install iptables-mod-conntrack-extra with opkg"
+               return 1
+       fi
+       o_remote_servers="$(for s in $o_remote_servers; do resolveip -4 "$s"; done)"
+}
 
-       for chain in $(echo "$IPT" | awk '/^:SS_SPEC/{print $1}'); do
-               $ipt_m -F ${chain:1} 2>/dev/null && $ipt_m -X ${chain:1}
+ss_rules_flush() {
+       local setname
+
+       iptables-save --counters | grep -v ss_rules_ | iptables-restore --counters
+       while ip rule del fwmark 1 lookup 100 2>/dev/null; do true; done
+       ip route flush table 100
+       for setname in $(ipset -n list | grep "ss_rules_"); do
+               ipset destroy "$setname" 2>/dev/null || true
        done
+}
 
-       ip rule del fwmark 0x01/0x01 table 100 2>/dev/null
-       ip route del local 0.0.0.0/0 dev lo table 100 2>/dev/null
-       ipset -X ss_spec_lan_ac 2>/dev/null
-       ipset -X ss_spec_wan_ac 2>/dev/null
-       return 0
+ss_rules_ipset_init() {
+       ipset --exist restore <<-EOF
+               create ss_rules_src_bypass hash:net hashsize 64
+               create ss_rules_src_forward hash:net hashsize 64
+               create ss_rules_src_checkdst hash:net hashsize 64
+               create ss_rules_dst_bypass hash:net hashsize 64
+               create ss_rules_dst_bypass_ hash:net hashsize 64
+               create ss_rules_dst_forward hash:net hashsize 64
+               create ss_rules_dst_forward_recentrst_ hash:ip hashsize 64 timeout 3600
+               $(ss_rules_ipset_mkadd ss_rules_dst_bypass_ "$o_dst_bypass_ $o_remote_servers")
+               $(ss_rules_ipset_mkadd ss_rules_src_bypass "$o_src_bypass")
+               $(ss_rules_ipset_mkadd ss_rules_src_forward "$o_src_forward")
+               $(ss_rules_ipset_mkadd ss_rules_src_checkdst "$o_src_checkdst")
+               $(ss_rules_ipset_mkadd ss_rules_dst_bypass "$o_dst_bypass $(cat "$o_dst_bypass_file" 2>/dev/null)")
+               $(ss_rules_ipset_mkadd ss_rules_dst_forward "$o_dst_forward $(cat "$o_dst_forward_file" 2>/dev/null)")
+       EOF
 }
 
-ipset_r() {
-       ipset -! -R <<-EOF || return 1
-               create ss_spec_wan_ac hash:net
-               $(echo -e "$IPLIST" | sed -e "s/^/add ss_spec_wan_ac /")
-               $(for ip in $WAN_FW_IP; do echo "add ss_spec_wan_ac $ip nomatch"; done)
-EOF
-       $ipt_n -N SS_SPEC_WAN_AC && \
-       $ipt_n -A SS_SPEC_WAN_AC -m set --match-set ss_spec_wan_ac dst -j RETURN && \
-       $ipt_n -A SS_SPEC_WAN_AC -j SS_SPEC_WAN_FW
-       return $?
+ss_rules_ipset_mkadd() {
+       local setname="$1"; shift
+       local i
+
+       for i in $*; do
+               echo "add $setname $i"
+       done
 }
 
-fw_rule() {
-       $ipt_n -N SS_SPEC_WAN_FW && \
-       $ipt_n -A SS_SPEC_WAN_FW -p tcp \
-               -j REDIRECT --to-ports $local_port 2>/dev/null || {
-               loger 3 "Can't redirect, please check the iptables."
-               exit 1
-       }
-       return $?
+ss_rules_iptchains_init() {
+       ss_rules_iptchains_init_tcp
+       ss_rules_iptchains_init_udp
 }
 
-ac_rule() {
-       local TAG ROUTECHAIN
+ss_rules_iptchains_init_tcp() {
+       local local_target
 
-       if [ -n "$LAN_AC_IP" ]; then
-               if [ "${LAN_AC_IP:0:1}" = "w" ]; then
-                       TAG="nomatch"
-               else
-                       if [ "${LAN_AC_IP:0:1}" != "b" ]; then
-                               loger 3 "Bad argument \`-a $LAN_AC_IP\`."
-                               return 2
-                       fi
-               fi
-       fi
+       [ -n "$o_redir_tcp_port" ] || return 0
 
-       ROUTECHAIN=PREROUTING
-       if iptables-save -t nat | grep -q "^:zone_lan_prerouting"; then
-               ROUTECHAIN=zone_lan_prerouting
-       fi
+       ss_rules_iptchains_init_ nat tcp
 
-       ipset -! -R <<-EOF || return 1
-               create ss_spec_lan_ac hash:net
-               $(for ip in ${LAN_AC_IP:1}; do echo "add ss_spec_lan_ac $ip $TAG"; done)
-EOF
-       $ipt_n -A $ROUTECHAIN -p tcp $EXT_ARGS \
-               -m set ! --match-set ss_spec_lan_ac src \
-               -m comment --comment "_SS_SPEC_RULE_" -j SS_SPEC_WAN_AC
+       case "$o_local_default" in
+               checkdst) local_target=ss_rules_dst ;;
+               forward) local_target=ss_rules_forward ;;
+               bypass|*) return 0;;
+       esac
 
-       if [ "$OUTPUT" = 1 ]; then
-               $ipt_n -A OUTPUT -p tcp $EXT_ARGS \
-                       -m comment --comment "_SS_SPEC_RULE_" -j SS_SPEC_WAN_AC
-       fi
-       return $?
+       iptables-restore --noflush <<-EOF
+               *nat
+               :ss_rules_local_out -
+               -I OUTPUT 1 -p tcp -j ss_rules_local_out
+               -A ss_rules_local_out -m set --match-set ss_rules_dst_bypass_ dst -j RETURN
+               -A ss_rules_local_out -p tcp $o_ipt_extra -j $local_target -m comment --comment "local_default: $o_local_default"
+               COMMIT
+       EOF
 }
 
-tp_rule() {
-       [ -n "$TPROXY" ] || return 0
-       ip rule add fwmark 0x01/0x01 table 100
-       ip route add local 0.0.0.0/0 dev lo table 100
-       $ipt_m -N SS_SPEC_TPROXY
-       $ipt_m -A SS_SPEC_TPROXY -p udp -m set ! --match-set ss_spec_wan_ac dst \
-               -j TPROXY --on-port $LOCAL_PORT --tproxy-mark 0x01/0x01
-       $ipt_m -A PREROUTING -p udp $EXT_ARGS \
-               -m set ! --match-set ss_spec_lan_ac src \
-               -m comment --comment "_SS_SPEC_RULE_" -j SS_SPEC_TPROXY
-       return $?
+ss_rules_iptchains_init_udp() {
+       [ -n "$o_redir_udp_port" ] || return 0
+       ss_rules_iptchains_init_ mangle udp
 }
 
-while getopts ":s:l:S:L:i:e:a:b:w:ouUf" arg; do
-       case $arg in
-               s)
-                       server=$OPTARG
-                       ;;
-               l)
-                       local_port=$OPTARG
-                       ;;
-               S)
-                       SERVER=$OPTARG
-                       ;;
-               L)
-                       LOCAL_PORT=$OPTARG
-                       ;;
-               i)
-                       IGNORE=$OPTARG
-                       ;;
-               e)
-                       EXT_ARGS=$OPTARG
-                       ;;
-               a)
-                       LAN_AC_IP=$OPTARG
-                       ;;
-               b)
-                       WAN_BP_IP=$(for ip in $OPTARG; do echo $ip; done)
-                       ;;
-               w)
-                       WAN_FW_IP=$OPTARG
-                       ;;
-               o)
-                       OUTPUT=1
-                       ;;
-               u)
-                       TPROXY=1
-                       ;;
-               U)
-                       TPROXY=2
+ss_rules_iptchains_init_() {
+       local table="$1"
+       local proto="$2"
+       local forward_rules
+       local src_default_target dst_default_target
+       local recentrst_mangle_rules recentrst_addset_rules
+
+       case "$proto" in
+               tcp)
+                       forward_rules="-A ss_rules_forward -p tcp -j REDIRECT --to-ports $o_redir_tcp_port"
+                       if [ -n "$o_dst_forward_recentrst" ]; then
+                               recentrst_mangle_rules="
+                                       *mangle
+                                       -I PREROUTING 1 -p tcp -m tcp --tcp-flags RST RST -m recent --name ss_rules_recentrst --set --rsource
+                                       COMMIT
+                               "
+                               recentrst_addset_rules="
+                                       -A ss_rules_dst -m recent --name ss_rules_recentrst --rcheck --rdest --seconds 3 --hitcount 3 -j SET --add-set ss_rules_dst_forward_recentrst_ dst --exist
+                                       -A ss_rules_dst -m set --match-set ss_rules_dst_forward_recentrst_ dst -j ss_rules_forward
+                               "
+                       fi
                        ;;
-               f)
-                       flush_r
-                       exit 0
+               udp)
+                       ip rule add fwmark 1 lookup 100
+                       ip route add local default dev lo table 100
+                       forward_rules="-A ss_rules_forward -p udp -j TPROXY --on-port "$o_redir_udp_port" --tproxy-mark 0x01/0x01"
                        ;;
        esac
-done
-
-if [ -z "$server" -o -z "$local_port" ]; then
-       usage
-       exit 2
-fi
+       case "$o_src_default" in
+               forward) src_default_target=ss_rules_forward ;;
+               checkdst) src_default_target=ss_rules_dst ;;
+               bypass|*) src_default_target=RETURN ;;
+       esac
+       case "$o_dst_default" in
+               forward) dst_default_target=ss_rules_forward ;;
+               bypass|*) dst_default_target=RETURN ;;
+       esac
+       sed -e '/^\s*$/d' -e 's/^\s\+//' <<-EOF | iptables-restore --noflush
+               *$table
+               :ss_rules_pre_src -
+               :ss_rules_src -
+               :ss_rules_dst -
+               :ss_rules_forward -
+               $(ss_rules_iptchains_mkprerules "$proto")
+               -A ss_rules_pre_src -m set --match-set ss_rules_dst_bypass_ dst -j RETURN
+               -A ss_rules_pre_src -p $proto $o_ipt_extra -j ss_rules_src
+               -A ss_rules_src -m set --match-set ss_rules_src_bypass src -j RETURN
+               -A ss_rules_src -m set --match-set ss_rules_src_forward src -j ss_rules_forward
+               -A ss_rules_src -m set --match-set ss_rules_src_checkdst src -j ss_rules_dst
+               -A ss_rules_src -j $src_default_target -m comment --comment "src_default: $o_src_default"
+               -A ss_rules_dst -m set --match-set ss_rules_dst_bypass dst -j RETURN
+               -A ss_rules_dst -m set --match-set ss_rules_dst_forward dst -j ss_rules_forward
+               $recentrst_addset_rules
+               -A ss_rules_dst -j $dst_default_target -m comment --comment "dst_default: $o_dst_default"
+               $forward_rules
+               COMMIT
+               $recentrst_mangle_rules
+       EOF
+}
 
-if [ "$TPROXY" = 1 ]; then
-       SERVER=$server
-       LOCAL_PORT=$local_port
-fi
+ss_rules_iptchains_mkprerules() {
+       local proto="$1"
 
-if [ "$TPROXY" = 2 ]; then
-       if [ -z "$SERVER" -o -z "$LOCAL_PORT" ]; then
-               loger 3 "Please use -S and -L specifies IP and port for UDP."
+       if [ -z "$o_ifnames" ]; then
+               echo "-I PREROUTING 1 -p $proto -j ss_rules_pre_src"
+       else
+               echo $o_ifnames \
+                       | tr ' ' '\n' \
+                       | sed "s/.*/-I PREROUTING 1 -i \\0 -p $proto -j ss_rules_pre_src/"
        fi
-fi
-
-if [ -f "$IGNORE" ]; then
-       IGNORE_IP=$(cat $IGNORE 2>/dev/null)
-fi
-
-IPLIST=$(cat <<-EOF | grep -E "^([0-9]{1,3}\.){3}[0-9]{1,3}"
-       $server
-       $SERVER
-       0.0.0.0/8
-       10.0.0.0/8
-       100.64.0.0/10
-       127.0.0.0/8
-       169.254.0.0/16
-       172.16.0.0/12
-       192.0.0.0/24
-       192.0.2.0/24
-       192.88.99.0/24
-       192.168.0.0/16
-       198.18.0.0/15
-       198.51.100.0/24
-       203.0.113.0/24
-       224.0.0.0/4
-       240.0.0.0/4
-       255.255.255.255
-       $WAN_BP_IP
-       $IGNORE_IP
-EOF
-)
-
-flush_r && fw_rule && ipset_r && ac_rule && tp_rule
+}
 
-exit $?
+ss_rules_parse_args "$@"
+ss_rules_flush
+ss_rules_ipset_init
+ss_rules_iptchains_init
diff --git a/net/shadowsocks-libev/files/ss-rules.defaults b/net/shadowsocks-libev/files/ss-rules.defaults
new file mode 100755 (executable)
index 0000000..c89e2d0
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+s=firewall.ss_rules
+uci get "$s" >/dev/null && exit 0
+uci batch <<-EOF
+       set $s=include
+       set $s.path=/etc/firewall.ss-rules
+       set $s.reload=1
+       commit firewall
+EOF
diff --git a/net/shorewall-core/Makefile b/net/shorewall-core/Makefile
new file mode 100644 (file)
index 0000000..1dcc6ef
--- /dev/null
@@ -0,0 +1,66 @@
+#
+# Copyright (C) 2008-2012 OpenWrt.org
+# Copyright (C) 2017 Willem van den Akker <wvdakker@wilsoft.nl>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=shorewall-core
+PKG_MAJOR_MINOR_VERSION:=5.1
+PKG_BUGFIX_MAJOR_VERSION:=12
+PKG_BUGFIX_MINOR_VERSION:=.3
+PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION)
+PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://slovakia.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://shorewall.de/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://www.shorewall.com.au/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_HASH:=146c7fdae3f81a950182bc77e17d516a8885454d22351cb9cf90b562e985785a
+
+PKG_MAINTAINER:=Willem van den Akker <wvdakker@wilsoft.nl>
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/shorewall-core
+    SECTION:=net
+    CATEGORY:=Network
+    TITLE:=Shorewall Core
+    URL:=http://www.shorewall.net/
+    SUBMENU:=Firewall
+endef
+
+define Package/shorewall-core/description
+       The Shoreline Firewall, is high-level tool for configuring Netfilter.
+       This package provides the core Shorewall libraries installed in /usr/share/shorewall/,
+       which are required for the rest of the Shorewall packages to work.
+endef
+
+define Package/shorewall-core/conffiles
+       /usr/share/shorewall/shorewallrc
+endef
+
+CONFIGURE_ARGS += \
+       vendor=openwrt
+
+define Build/Compile
+       DESTDIR=$(PKG_INSTALL_DIR) $(PKG_BUILD_DIR)/install.sh
+endef
+
+define Package/shorewall-core/install
+       $(INSTALL_DIR) $(1)/usr/share/shorewall/
+       $(INSTALL_DIR) $(1)/usr/sbin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/shorewall $(1)/usr/share/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/shorewall/wait4ifup $(1)/usr/share/shorewall/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/shorewall $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,shorewall-core))
diff --git a/net/shorewall-core/patches/110-lib.common.patch b/net/shorewall-core/patches/110-lib.common.patch
new file mode 100644 (file)
index 0000000..aeb7579
--- /dev/null
@@ -0,0 +1,22 @@
+Index: shorewall-core-5.1.7.2/lib.common
+===================================================================
+--- shorewall-core-5.1.7.2.orig/lib.common     2017-10-11 08:01:06.191862789 +0200
++++ shorewall-core-5.1.7.2/lib.common  2017-10-11 08:01:06.187863006 +0200
+@@ -345,7 +345,7 @@
+     if [ -z "$MODULESDIR" ]; then
+       uname=$(uname -r)
+-      MODULESDIR=/lib/modules/$uname/kernel/net/ipv${g_family}/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/kernel/net/sched:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset
++      MODULESDIR=/lib/modules/$uname:/lib/modules/$uname/kernel/net/ipv${g_family}/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/kernel/net/sched:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset
+       if [ -n "$extras" ]; then
+           for directory in $(split "$extras"); do
+               MODULESDIR="$MODULESDIR:/lib/modules/$uname/$directory"
+@@ -399,7 +399,7 @@
+     if [ -z "$MODULESDIR" ]; then
+       uname=$(uname -r)
+-      MODULESDIR=/lib/modules/$uname/kernel/net/ipv${g_family}/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/kernel/net/sched:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset
++      MODULESDIR=/lib/modules/$uname:/lib/modules/$uname/kernel/net/ipv${g_family}/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/kernel/net/sched:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset
+       if [ -n "$extras" ]; then
+           for directory in $(split "$extras"); do
+               MODULESDIR="$MODULESDIR:/lib/modules/$uname/$directory"
diff --git a/net/shorewall-lite/Makefile b/net/shorewall-lite/Makefile
new file mode 100644 (file)
index 0000000..a446958
--- /dev/null
@@ -0,0 +1,81 @@
+#
+# Copyright (C) 2008-2012 OpenWrt.org
+# Copyright (C) 2017 Willem van den Akker <wvdakker@wilsoft.nl>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=shorewall-lite
+PKG_MAJOR_MINOR_VERSION:=5.1
+PKG_BUGFIX_MAJOR_VERSION:=12
+PKG_BUGFIX_MINOR_VERSION:=.3
+PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION)
+PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://slovakia.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://shorewall.de/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://www.shorewall.com.au/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_HASH:=41a9c0e618bf22cca5cbbd5e507a8420f87e5e3c062459b6b607b980966b708c
+
+PKG_MAINTAINER:=Willem van den Akker <wvdakker@wilsoft.nl>
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/shorewall-lite
+    SECTION:=net
+    CATEGORY:=Network
+    DEPENDS:=+ip +iptables +shorewall-core
+    TITLE:=Shorewall Lite
+    URL:=http://www.shorewall.net/
+    SUBMENU:=Firewall
+endef
+
+define Package/shorewall-lite/description
+       The Shoreline Firewall, is high-level tool for configuring Netfilter.
+
+       Shorewall allows for central administration of multiple IPv4 firewalls
+       through use of Shorewall lite. The full Shorewall product is installed
+       on a central administrative system where compiled Shorewall scripts are
+       generated. These scripts are copied to the firewall systems where they
+       run under the control of Shorewall-lite.
+
+       Note: This is the IPv4 implementation of Shorewall.
+endef
+
+define Package/shorewall-lite/conffiles
+/etc/shorewall-lite/
+endef
+
+CONFIGURE_ARGS += \
+       vendor=openwrt
+
+define Build/Compile
+       DESTDIR=$(PKG_INSTALL_DIR) $(PKG_BUILD_DIR)/install.sh
+endef
+
+define Package/shorewall-lite/install
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface/
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_DIR) $(1)/etc/shorewall-lite/state/
+       $(INSTALL_DIR) $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/usr/share/shorewall-lite/
+       $(CP) $(PKG_INSTALL_DIR)/etc/shorewall-lite/ $(1)/etc/
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/shorewall-lite/ $(1)/usr/share/
+       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/shorewall-lite $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/shorewall-lite/shorecap $(1)/usr/share/shorewall-lite/
+       $(INSTALL_BIN) ./files/hostname $(1)/usr/share/shorewall-lite/
+       $(INSTALL_BIN) ./files/hotplug_iface $(1)/etc/hotplug.d/iface/05-shorewall-lite
+       $(INSTALL_BIN) ./files/shorewall-lite.init $(1)/etc/init.d/shorewall-lite
+       $(INSTALL_BIN) ./files/vardir $(1)/etc/shorewall-lite/
+endef
+
+$(eval $(call BuildPackage,shorewall-lite))
diff --git a/net/shorewall-lite/files/hostname b/net/shorewall-lite/files/hostname
new file mode 100644 (file)
index 0000000..db08bac
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+uci get system.@system[0].hostname
diff --git a/net/shorewall-lite/files/hotplug_iface b/net/shorewall-lite/files/hotplug_iface
new file mode 100644 (file)
index 0000000..90ed80c
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# should restart shorewall when an interface comes up
+
+case "$ACTION" in
+    ifup)
+        /etc/init.d/shorewall-lite restart
+        ;;
+    ifdown)
+        # might need to restore some routing
+        /etc/init.d/shorewall-lite restart
+        ;;
+esac
\ No newline at end of file
diff --git a/net/shorewall-lite/files/shorewall-lite.init b/net/shorewall-lite/files/shorewall-lite.init
new file mode 100644 (file)
index 0000000..c3236e5
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh /etc/rc.common
+
+USE_PROCD=1
+START=50
+
+load_params () {
+    . /usr/share/shorewall/shorewallrc
+}
+
+start_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall -l $OPTIONS start $STARTOPTIONS
+}
+
+stop_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall -l $OPTIONS stop $STOPOPTIONS
+}
+
+restart_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall -l $OPTIONS restart $RESTARTOPTIONS
+}
+
+reload_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall -l $OPTIONS reload $RESTARTOPTIONS
+}
diff --git a/net/shorewall-lite/files/vardir b/net/shorewall-lite/files/vardir
new file mode 100644 (file)
index 0000000..8a5071d
--- /dev/null
@@ -0,0 +1,3 @@
+# move state dir out of ram
+VARDIR=/etc/shorewall-lite/state
+
diff --git a/net/shorewall-lite/patches/010-install_cp.patch b/net/shorewall-lite/patches/010-install_cp.patch
new file mode 100644 (file)
index 0000000..4e47198
--- /dev/null
@@ -0,0 +1,13 @@
+Index: shorewall-lite-5.1.7.2/install.sh
+===================================================================
+--- shorewall-lite-5.1.7.2.orig/install.sh     2017-10-11 08:15:57.201324746 +0200
++++ shorewall-lite-5.1.7.2/install.sh  2017-10-11 08:15:57.197324953 +0200
+@@ -492,7 +492,7 @@
+ if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PRODUCT} ]; then
+     [ ${DESTDIR} ] && make_parent_directory ${DESTDIR}${SYSCONFDIR} 0755
+-    install_file ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/${PRODUCT} 0640
++    install_file ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/${PRODUCT}/${SYSCONFFILE} 0640
+     echo "$SYSCONFFILE file installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
+ fi
diff --git a/net/shorewall-lite/patches/020-set-PATH.patch b/net/shorewall-lite/patches/020-set-PATH.patch
new file mode 100644 (file)
index 0000000..d800f2f
--- /dev/null
@@ -0,0 +1,11 @@
+--- shorewall-lite-5.1.9/shorewall-lite.conf.orig      2017-12-17 09:06:52.301331288 -0500
++++ shorewall-lite-5.1.9/shorewall-lite.conf   2017-12-17 09:05:55.769714392 -0500
+@@ -36,7 +36,7 @@
+ IPTABLES=
+-PATH=
++PATH=/usr/sbin:/usr/bin:/sbin:/bin
+ SHOREWALL_SHELL=
diff --git a/net/shorewall-lite/patches/120-logfile.patch b/net/shorewall-lite/patches/120-logfile.patch
new file mode 100644 (file)
index 0000000..ff1c02e
--- /dev/null
@@ -0,0 +1,13 @@
+Index: shorewall-lite-5.1.7.2/shorewall-lite.conf
+===================================================================
+--- shorewall-lite-5.1.7.2.orig/shorewall-lite.conf    2017-10-11 08:19:35.565847520 +0200
++++ shorewall-lite-5.1.7.2/shorewall-lite.conf 2017-10-11 08:19:35.561847733 +0200
+@@ -28,7 +28,7 @@
+ #                            L O G G I N G
+ ###############################################################################
+-LOGFILE=
++LOGFILE=/dev/null
+ ###############################################################################
+ #     L O C A T I O N   O F   F I L E S   A N D   D I R E C T O R I E S
diff --git a/net/shorewall/Makefile b/net/shorewall/Makefile
new file mode 100644 (file)
index 0000000..ad6e7cf
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2008-2012 OpenWrt.org
+# Copyright (C) 2017 Willem van den Akker <wvdakker@wilsoft.nl>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=shorewall
+PKG_MAJOR_MINOR_VERSION:=5.1
+PKG_BUGFIX_MAJOR_VERSION:=12
+PKG_BUGFIX_MINOR_VERSION:=.3
+PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION)
+PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://slovakia.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://shorewall.de/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://www.shorewall.com.au/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_HASH:=c1bdb6eef7059247737d74ffd9475b11a036253c2d8667d4fea296a1be0768bc
+
+PKG_MAINTAINER:=Willem van den Akker <wvdakker@wilsoft.nl>
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/shorewall
+    SECTION:=devel
+    CATEGORY:=Network
+    DEPENDS:=+ip +iptables +kmod-ipt-hashlimit +kmod-ipt-raw +iptables-mod-hashlimit +shorewall-core \
+               +perl +perlbase-autoloader +perlbase-autouse +perlbase-dynaloader +perlbase-digest \
+               +perlbase-findbin +perlbase-getopt +perlbase-hash
+    TITLE:=Shorewall Central Administration System
+    URL:=http://www.shorewall.net/
+    SUBMENU:=Firewall
+endef
+
+define Package/shorewall/description
+       The Shoreline Firewall, is high-level tool for configuring Netfilter.
+
+       Shorewall allows for central administration of multiple IPv4 firewalls.
+       This is the full Shorewall product which will compile Shorewall scripts.
+       It is not recommended to run it on a low memory system.
+
+       Note: This is the IPv4 implementation of Shorewall.
+             This full Shorewal packages also installs Perl which can make the image big (about +2M).
+endef
+
+CONFIGURE_ARGS += \
+       vendor=openwrt
+
+define Build/Compile
+       DESTDIR=$(PKG_INSTALL_DIR) $(PKG_BUILD_DIR)/install.sh
+endef
+
+define Package/shorewall/conffiles
+/etc/shorewall/
+endef
+
+define Package/shorewall/install
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface/
+       $(INSTALL_DIR) $(1)/etc/shorewall/
+       $(INSTALL_DIR) $(1)/usr/lib/shorewall/
+       $(INSTALL_DIR) $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/usr/share/shorewall/
+       $(INSTALL_BIN) ./files/hotplug_iface $(1)/etc/hotplug.d/iface/05-shorewall
+       $(INSTALL_BIN) ./files/hostname $(1)/etc/shorewall/
+       $(INSTALL_BIN) ./files/shorewall.init $(1)/etc/init.d/shorewall
+       $(INSTALL_BIN) ./files/vardir $(1)/etc/shorewall/
+       $(CP) $(PKG_INSTALL_DIR)/etc/shorewall/. $(1)/etc/shorewall/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/shorewall/. $(1)/usr/lib/shorewall/
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/shorewall/. $(1)/usr/share/shorewall/
+endef
+
+$(eval $(call BuildPackage,shorewall))
diff --git a/net/shorewall/files/hostname b/net/shorewall/files/hostname
new file mode 100644 (file)
index 0000000..29c736e
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+uci get system.@system[0].hostname
+
diff --git a/net/shorewall/files/hotplug_iface b/net/shorewall/files/hotplug_iface
new file mode 100644 (file)
index 0000000..f787424
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# should restart shorewall when an interface comes up
+
+case "$ACTION" in
+    ifup)
+        /etc/init.d/shorewall restart
+        ;;
+    ifdown)
+        # might need to restore some routing
+        /etc/init.d/shorewall restart
+        ;;
+esac
diff --git a/net/shorewall/files/shorewall.init b/net/shorewall/files/shorewall.init
new file mode 100644 (file)
index 0000000..ef2f00a
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh /etc/rc.common
+
+USE_PROCD=1
+START=50
+
+load_params () {
+    . /usr/share/shorewall/shorewallrc
+}
+
+start_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall $OPTIONS start $STARTOPTIONS
+}
+
+stop_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall $OPTIONS stop $STOPOPTIONS
+}
+
+restart_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall $OPTIONS restart $RESTARTOPTIONS
+}
+
+reload_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall $OPTIONS reload $RESTARTOPTIONS
+}
diff --git a/net/shorewall/files/vardir b/net/shorewall/files/vardir
new file mode 100644 (file)
index 0000000..f9a55a8
--- /dev/null
@@ -0,0 +1,2 @@
+VARDIR=/tmp/state
+
diff --git a/net/shorewall/patches/120-logfile.patch b/net/shorewall/patches/120-logfile.patch
new file mode 100644 (file)
index 0000000..5b65ff0
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/configfiles/shorewall.conf
++++ b/configfiles/shorewall.conf
+@@ -33,7 +33,7 @@ FIREWALL=
+ #                            L O G G I N G
+ ###############################################################################
+-LOG_LEVEL="info"
++LOG_LEVEL="warn"
+ BLACKLIST_LOG_LEVEL=
+@@ -101,7 +101,7 @@ RESTOREFILE=restore
+ SHOREWALL_SHELL=/bin/sh
+-SUBSYSLOCK=/var/lock/subsys/shorewall
++SUBSYSLOCK=/var/lock/shorewall
+ TC=
diff --git a/net/shorewall/patches/130-set-path.patch b/net/shorewall/patches/130-set-path.patch
new file mode 100644 (file)
index 0000000..78e0c67
--- /dev/null
@@ -0,0 +1,13 @@
+Index: shorewall-5.1.9/configfiles/shorewall.conf
+===================================================================
+--- shorewall-5.1.9.orig/configfiles/shorewall.conf    2017-12-18 08:09:12.043625770 +0100
++++ shorewall-5.1.9/configfiles/shorewall.conf 2017-12-18 08:09:54.353402257 +0100
+@@ -93,7 +93,7 @@
+ NFACCT=
+-PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin"
++PATH="/usr/sbin:/usr/bin:/sbin:/bin"
+ PERL=/usr/bin/perl
diff --git a/net/shorewall6-lite/Makefile b/net/shorewall6-lite/Makefile
new file mode 100644 (file)
index 0000000..7920a24
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2008-2012 OpenWrt.org
+# Copyright (C) 2017 Willem van den Akker <wvdakker@wilsoft.nl>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=shorewall6-lite
+PKG_MAJOR_MINOR_VERSION:=5.1
+PKG_BUGFIX_MAJOR_VERSION:=12
+PKG_BUGFIX_MINOR_VERSION:=.3
+PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION)
+PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://slovakia.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://shorewall.de/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://www.shorewall.com.au/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_HASH:=1cdd4f0e7b5dc45db897bd6b2d3740fb3dfbcdffe2abc1fd7cdaabb9161dc8f9
+
+PKG_MAINTAINER:=Willem van den Akker <wvdakker@wilsoft.nl>
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/shorewall6-lite
+    SECTION:=net
+    CATEGORY:=Network
+    DEPENDS:=+ip +ip6tables +shorewall-core
+    TITLE:=Shorewall6 Lite
+    URL:=http://www.shorewall.net/
+    SUBMENU:=Firewall
+endef
+
+define Package/shorewall6-lite/description
+       The Shoreline Firewall, is high-level tool for configuring Netfilter.
+
+       Shorewall6 allows for central administration of multiple IPv6 firewalls
+       through use of Shorewall6 lite. The full Shorewall6 product is installed
+       on a central administrative system where compiled Shorewall6 scripts are
+       generated. These scripts are copied to the firewall systems where they
+       run under the control of Shorewall6-lite.
+
+       Note: This is the IPv6 implementation of Shorewall.
+endef
+
+define Package/shorewall6-lite/conffiles
+/etc/shorewall6-lite/
+endef
+
+CONFIGURE_ARGS += \
+       vendor=openwrt
+
+define Build/Compile
+       DESTDIR=$(PKG_INSTALL_DIR) $(PKG_BUILD_DIR)/install.sh
+endef
+
+define Package/shorewall6-lite/install
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface/
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_DIR) $(1)/etc/shorewall6-lite/state/
+       $(INSTALL_DIR) $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/usr/share/shorewall6-lite/
+       $(CP) $(PKG_INSTALL_DIR)/etc/shorewall6-lite/ $(1)/etc/
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/shorewall6-lite/ $(1)/usr/share/
+       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/shorewall6-lite $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/shorewall6-lite/shorecap $(1)/usr/share/shorewall6-lite/
+       $(INSTALL_BIN) ./files/hostname $(1)/usr/share/shorewall6-lite/
+       $(INSTALL_BIN) ./files/hotplug_iface $(1)/etc/hotplug.d/iface/05-shorewall6-lite
+       $(INSTALL_BIN) ./files/shorewall6-lite.init $(1)/etc/init.d/shorewall6-lite
+       $(INSTALL_BIN) ./files/vardir $(1)/etc/shorewall6-lite/
+endef
+
+$(eval $(call BuildPackage,shorewall6-lite))
diff --git a/net/shorewall6-lite/files/hostname b/net/shorewall6-lite/files/hostname
new file mode 100644 (file)
index 0000000..db08bac
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+uci get system.@system[0].hostname
diff --git a/net/shorewall6-lite/files/hotplug_iface b/net/shorewall6-lite/files/hotplug_iface
new file mode 100644 (file)
index 0000000..bb8973b
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# should restart shorewall when an interface comes up
+
+case "$ACTION" in
+    ifup)
+        /etc/init.d/shorewall6-lite restart
+        ;;
+    ifdown)
+        # might need to restore some routing
+        /etc/init.d/shorewall6-lite restart
+        ;;
+esac
\ No newline at end of file
diff --git a/net/shorewall6-lite/files/shorewall6-lite.init b/net/shorewall6-lite/files/shorewall6-lite.init
new file mode 100644 (file)
index 0000000..c2ab8ce
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh /etc/rc.common
+
+USE_PROCD=1
+START=50
+
+load_params () {
+    . /usr/share/shorewall/shorewallrc
+}
+
+start_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall -6l $OPTIONS start $STARTOPTIONS
+}
+
+stop_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall -6l $OPTIONS stop $STOPOPTIONS
+}
+
+restart_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall -6l $OPTIONS restart $RESTARTOPTIONS
+}
+
+reload_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall -6l $OPTIONS reload $RESTARTOPTIONS
+}
diff --git a/net/shorewall6-lite/files/vardir b/net/shorewall6-lite/files/vardir
new file mode 100644 (file)
index 0000000..e7a9030
--- /dev/null
@@ -0,0 +1,2 @@
+# move state dir out of ram
+VARDIR=/etc/shorewall6-lite/state
diff --git a/net/shorewall6-lite/patches/010-install_cp.patch b/net/shorewall6-lite/patches/010-install_cp.patch
new file mode 100644 (file)
index 0000000..2be3701
--- /dev/null
@@ -0,0 +1,13 @@
+Index: shorewall6-lite-5.1.7.2/install.sh
+===================================================================
+--- shorewall6-lite-5.1.7.2.orig/install.sh    2017-10-11 15:34:43.612217209 +0200
++++ shorewall6-lite-5.1.7.2/install.sh 2017-10-11 15:34:43.608217428 +0200
+@@ -492,7 +492,7 @@
+ if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PRODUCT} ]; then
+     [ ${DESTDIR} ] && make_parent_directory ${DESTDIR}${SYSCONFDIR} 0755
+-    install_file ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/${PRODUCT} 0640
++    install_file ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/${PRODUCT}/${SYSCONFFILE} 0640
+     echo "$SYSCONFFILE file installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
+ fi
diff --git a/net/shorewall6-lite/patches/020-set-PATH.patch b/net/shorewall6-lite/patches/020-set-PATH.patch
new file mode 100644 (file)
index 0000000..a75cc69
--- /dev/null
@@ -0,0 +1,11 @@
+--- shorewall6-lite-5.1.9/shorewall6-lite.conf.orig    2017-12-17 09:06:52.301331288 -0500
++++ shorewall6-lite-5.1.9/shorewall6-lite.conf 2017-12-17 09:05:55.769714392 -0500
+@@ -36,7 +36,7 @@
+ IP6TABLES=
+-PATH=
++PATH=/usr/sbin:/usr/bin:/sbin:/bin
+ SHOREWALL_SHELL=
diff --git a/net/shorewall6-lite/patches/120-logfile.patch b/net/shorewall6-lite/patches/120-logfile.patch
new file mode 100644 (file)
index 0000000..6afb39d
--- /dev/null
@@ -0,0 +1,13 @@
+Index: shorewall6-lite-5.1.10.2/shorewall6-lite.conf
+===================================================================
+--- shorewall6-lite-5.1.10.2.orig/shorewall6-lite.conf 2018-01-04 22:09:34.461951267 +0100
++++ shorewall6-lite-5.1.10.2/shorewall6-lite.conf      2018-01-04 22:10:23.559291269 +0100
+@@ -28,7 +28,7 @@
+ #                            L O G G I N G
+ ###############################################################################
+-LOGFILE=
++LOGFILE=/dev/null
+ ###############################################################################
+ #     L O C A T I O N   O F   F I L E S   A N D   D I R E C T O R I E S
diff --git a/net/shorewall6/Makefile b/net/shorewall6/Makefile
new file mode 100644 (file)
index 0000000..e3e6f79
--- /dev/null
@@ -0,0 +1,81 @@
+#
+# Copyright (C) 2008-2012 OpenWrt.org
+# Copyright (C) 2017 Willem van den Akker <wvdakker@wilsoft.nl>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=shorewall6
+PKG_MAJOR_MINOR_VERSION:=5.1
+PKG_BUGFIX_MAJOR_VERSION:=12
+PKG_BUGFIX_MINOR_VERSION:=.3
+PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION)
+PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://slovakia.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://shorewall.de/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
+       http://www.shorewall.com.au/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_HASH:=082a1c1baa2bb301c258cd3401a8aa6cdcde0f14fe67eb40f3009c4d3e4860f5
+
+PKG_MAINTAINER:=Willem van den Akker <wvdakker@wilsoft.nl>
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/shorewall6
+    SECTION:=net
+    CATEGORY:=Network
+    DEPENDS:=+ip +ip6tables +kmod-ipt-hashlimit +kmod-ipt-raw6 +iptables-mod-hashlimit +shorewall-core \
+               +perl +perlbase-autoloader +perlbase-autouse +perlbase-dynaloader +perlbase-digest \
+               +perlbase-findbin +perlbase-getopt +perlbase-hash
+    TITLE:=Shorewall6 Central Administration System
+    URL:=http://www.shorewall.net/
+    SUBMENU:=Firewall
+endef
+
+define Package/shorewall6/description
+       The Shoreline Firewall, is high-level tool for configuring Netfilter.
+
+       Shorewall allows for central administration of multiple IPv6 firewalls.
+       This is the full Shorewall product which will compile Shorewall scripts
+       It is not recommended to run it on a low memory system.
+
+       Note: This is the IPv6 implementation of Shorewall.
+             This full Shorewal packages also installs Perl which can make the image big (about +2M).
+endef
+
+CONFIGURE_ARGS += \
+       vendor=openwrt
+
+define Package/shorewall6/conffiles
+/etc/shorewall6/
+endef
+
+define Build/Compile
+       DESTDIR=$(PKG_INSTALL_DIR) $(PKG_BUILD_DIR)/install.sh
+endef
+
+define Package/shorewall6/install
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_DIR) $(1)/etc/shorewall6/
+       $(INSTALL_DIR) $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/usr/share/shorewall6/
+       $(INSTALL_BIN) ./files/hostname $(1)/etc/shorewall6/
+       $(INSTALL_BIN) ./files/hotplug_iface $(1)/etc/hotplug.d/iface/05-shorewall6
+       $(INSTALL_BIN) ./files/shorewall6.init $(1)/etc/init.d/shorewall6
+       $(INSTALL_BIN) ./files/vardir $(1)/etc/shorewall6/
+       $(CP) $(PKG_INSTALL_DIR)/etc/shorewall6/. $(1)/etc/shorewall6/
+       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/shorewall6 $(1)/usr/sbin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/shorewall6/. $(1)/usr/share/shorewall6/
+endef
+
+$(eval $(call BuildPackage,shorewall6))
diff --git a/net/shorewall6/files/hostname b/net/shorewall6/files/hostname
new file mode 100644 (file)
index 0000000..29c736e
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+uci get system.@system[0].hostname
+
diff --git a/net/shorewall6/files/hotplug_iface b/net/shorewall6/files/hotplug_iface
new file mode 100644 (file)
index 0000000..aaa03e8
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# should restart shorewall when an interface comes up
+
+case "$ACTION" in
+    ifup)
+        /etc/init.d/shorewall6 restart
+        ;;
+    ifdown)
+        # might need to restore some routing
+        /etc/init.d/shorewall6 restart
+        ;;
+esac
diff --git a/net/shorewall6/files/shorewall6.init b/net/shorewall6/files/shorewall6.init
new file mode 100644 (file)
index 0000000..5f74de3
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh /etc/rc.common
+
+USE_PROCD=1
+START=50
+
+load_params () {
+    . /usr/share/shorewall/shorewallrc
+}
+
+start_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall -6 $OPTIONS start $STARTOPTIONS
+}
+
+stop_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall -6 $OPTIONS stop $STOPOPTIONS
+}
+
+restart_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall -6 $OPTIONS restart $RESTARTOPTIONS
+}
+
+reload_service() {
+    load_params
+    
+    ${SBINDIR}/shorewall -6 $OPTIONS reload $RESTARTOPTIONS
+}
diff --git a/net/shorewall6/files/vardir b/net/shorewall6/files/vardir
new file mode 100644 (file)
index 0000000..f9a55a8
--- /dev/null
@@ -0,0 +1,2 @@
+VARDIR=/tmp/state
+
diff --git a/net/shorewall6/patches/120-logfile.patch b/net/shorewall6/patches/120-logfile.patch
new file mode 100644 (file)
index 0000000..3f7d41f
--- /dev/null
@@ -0,0 +1,22 @@
+Index: shorewall6-5.1.4.1/configfiles/shorewall6.conf
+===================================================================
+--- shorewall6-5.1.4.1.orig/configfiles/shorewall6.conf        2017-10-05 11:28:34.893849703 +0200
++++ shorewall6-5.1.4.1/configfiles/shorewall6.conf     2017-10-05 11:29:13.047785350 +0200
+@@ -34,7 +34,7 @@
+ #                            L O G G I N G
+ ###############################################################################
+-LOG_LEVEL="info"
++LOG_LEVEL="warn"
+ BLACKLIST_LOG_LEVEL=
+@@ -98,7 +98,7 @@
+ SHOREWALL_SHELL=/bin/sh
+-SUBSYSLOCK=/var/lock/subsys/shorewall6
++SUBSYSLOCK=/var/lock/shorewall6
+ TC=
diff --git a/net/shorewall6/patches/130-set-path.patch b/net/shorewall6/patches/130-set-path.patch
new file mode 100644 (file)
index 0000000..f020ae7
--- /dev/null
@@ -0,0 +1,13 @@
+Index: shorewall6-5.1.9/configfiles/shorewall6.conf
+===================================================================
+--- shorewall6-5.1.9.orig/configfiles/shorewall6.conf  2017-12-18 08:13:01.999494346 +0100
++++ shorewall6-5.1.9/configfiles/shorewall6.conf       2017-12-18 08:13:37.253618974 +0100
+@@ -92,7 +92,7 @@
+ PERL=/usr/bin/perl
+-PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin"
++PATH="/usr/sbin:/usr/bin:/sbin:/bin"
+ RESTOREFILE=restore
index a2a4c50577562a4f84f849a0f270b571584e07a6..c1f5a410748d74d0c90c4c0290720323d84b3ff3 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2015 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=siit
 PKG_VERSION:=1.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPLv2+
 
 include $(INCLUDE_DIR)/package.mk
index ea68b74512de1b51b66be073cbcc487aaceb2963..55668353a6f8ff02e62eb1f71ba5b32342f6b66b 100644 (file)
@@ -1166,7 +1166,11 @@ static int siit_xmit(struct sk_buff *skb, struct net_device *dev)
        siit_stats(dev)->rx_bytes += skb->len;
        siit_stats(dev)->rx_packets++;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+       netif_trans_update(dev);
+#else
        dev->trans_start = jiffies;
+#endif
 
        /* Upper layer (IP) protocol forms sk_buff for outgoing packet
         * and sets IP header + Ether header too. IP layer sets outgoing
diff --git a/net/simple-adblock/Makefile b/net/simple-adblock/Makefile
new file mode 100644 (file)
index 0000000..fd5b99b
--- /dev/null
@@ -0,0 +1,62 @@
+# Copyright (c) 2017 Stan Grishin (stangri@melmac.net)
+# This is free software, licensed under the GNU General Public License v3.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=simple-adblock
+PKG_VERSION:=1.5.8
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-3.0+
+PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/$(PKG_NAME)
+       SECTION:=net
+       CATEGORY:=Network
+       TITLE:=Simple AdBlock Service
+       PKGARCH:=all
+endef
+
+define Package/$(PKG_NAME)/description
+This service provides dnsmasq-based ad blocking.
+Please see the README for further information.
+
+endef
+
+define Package/$(PKG_NAME)/conffiles
+/etc/config/simple-adblock
+endef
+
+define Build/Prepare
+       mkdir -p $(PKG_BUILD_DIR)/files/
+       $(CP) ./files/simple-adblock.init $(PKG_BUILD_DIR)/files/simple-adblock.init
+       sed -i "s|^\(PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(PKG_BUILD_DIR)/files/simple-adblock.init
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/$(PKG_NAME)/install
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/simple-adblock.init $(1)/etc/init.d/simple-adblock
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/simple-adblock.conf $(1)/etc/config/simple-adblock
+endef
+
+define Package/$(PKG_NAME)/prerm
+       #!/bin/sh
+       # check if we are on real system
+       if [ -z "$${IPKG_INSTROOT}" ]; then
+               echo "Stopping service and removing rc.d symlink for simple-adblock"
+               /etc/init.d/simple-adblock stop || true
+               /etc/init.d/simple-adblock killcache || true
+               /etc/init.d/simple-adblock disable
+       fi
+       exit 0
+endef
+
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/net/simple-adblock/files/README.md b/net/simple-adblock/files/README.md
new file mode 100644 (file)
index 0000000..000465c
--- /dev/null
@@ -0,0 +1,128 @@
+# Simple AdBlock
+A simple DNSMASQ-based AdBlocking service for OpenWrt/LEDE Project. Loosely based on [bole5's](https://forum.openwrt.org/profile.php?id=45571) idea with major performance improvements, added features and Web UI (as a separate package); inspired by @dibdot's innovation.
+
+## Features
+- Supports OpenWrt Designated Driver and LEDE Project.
+- Super-fast due to the nature of supported block lists and backgrounding of already downloaded data while next list is downloading.
+- Supports both hosts files and domains lists for blocking (to keep it lean and fast).
+- Everything is configurable from Web UI.
+- Allows you to easily add your own domains to whitelist or blacklist.
+- Allows you to easily add URLs to your own blocked hosts or domains lists to block/whitelist (just put whitelisted domains one per line).
+- Requires no configuration for the download utility wherever you want to use wget/libopenssl or uclient-fetch/libustream-mbedtls.
+- Installs dependencies automatically (DD/LEDE-default uclient-fetch libustream-mbedtls).
+- Doesn't stay in memory -- creates the list of blocked domains and then uses DNSMASQ and firewall rules to serve "domain not found reply".
+- As some of the default lists are using https, reliably works with either wget/libopenssl or uclient-fetch/libustream-mbedtls.
+- Very lightweight and easily hackable, the whole script is just one /etc/init.d/simple-adblock file.
+- Logs single entry in the system log with the number of blocked domains if verbosity is set to 0.
+- Retains the downloaded/sorted adblocking list on service stop and reuses it on service start (use reload if you want to force re-download of the list).
+- Blocks ads served over https.
+- Proudly made in Canada, using locally-sourced electrons.
+
+If you want a more robust AdBlocking, supporting free memory detection and complex block lists, check out [@dibdot's adblock](https://github.com/openwrt/packages/tree/master/net/adblock/files).
+
+
+## Screenshot (luci-app-simple-adblock)
+![screenshot](https://raw.githubusercontent.com/stangri/screenshots/master/simple-adblock/screenshot04.png "screenshot")
+
+
+## Requirements
+This service requires the following packages to be installed on your router: ```dnsmasq``` or ```dnsmasq-full``` and either ```ca-certificates```, ```wget``` and ```libopenssl``` (for OpenWrt 15.05.1) or ```uclient-fetch``` and ```libustream-mbedtls``` (for OpenWrt DD trunk and all LEDE Project builds). Additionally installation of ```coreutils-sort``` is highly recommended as it speeds up blocklist processing.
+
+To satisfy the requirements for connect to your router via ssh and run the following commands:
+###### OpenWrt 15.05.1
+```sh
+opkg update; opkg install ca-certificates wget libopenssl coreutils-sort dnsmasq
+```
+
+###### LEDE Project 17.01.x and OpenWrt 18.xx or later
+```sh
+opkg update; opkg install uclient-fetch libustream-mbedtls coreutils-sort dnsmasq
+```
+
+###### IPv6 Support
+For IPv6 support additionally install ```ip6tables-mod-nat``` and ```kmod-ipt-nat6``` packages from Web UI or run the following in the command line:
+```sh
+opkg update; opkg install ip6tables-mod-nat kmod-ipt-nat6
+```
+
+###### Speed up blocklist processing with coreutils-sort
+The ```coreutils-sort``` is an optional, but recommended package as it speeds up sorting and removing duplicates from the merged list dramatically. If opkg complains that it can't install ```coreutils-sort``` because /usr/bin/sort is already provided by busybox, you can run ```opkg --force-overwrite install coreutils-sort```.
+
+
+#### Unmet dependencies
+If you are running a development (trunk/snapshot) build of OpenWrt/LEDE Project on your router and your build is outdated (meaning that packages of the same revision/commit hash are no longer available and when you try to satisfy the [requirements](#requirements) you get errors), please flash either current LEDE release image or current development/snapshot image.
+
+
+## How to install
+Install ```simple-adblock``` and  ```luci-app-simple-adblock``` packages from Web UI or run the following in the command line:
+```sh
+opkg update; opkg install simple-adblock luci-app-simple-adblock
+```
+
+If ```simple-adblock``` and  ```luci-app-simple-adblock``` packages are not found in the official feed/repo for your version of OpenWrt/LEDE Project, you will need to [add a custom repo to your router](#add-custom-repo-to-your-router) first.
+
+
+#### Add custom repo to your router
+If your router is not set up with the access to repository containing these packages you will need to add custom repository to your router by connecting to your router via ssh and running the following commands:
+
+###### OpenWrt 15.05.1
+```sh
+opkg update; opkg install ca-certificates wget libopenssl
+echo -e -n 'untrusted comment: public key 7ffc7517c4cc0c56\nRWR//HUXxMwMVnx7fESOKO7x8XoW4/dRidJPjt91hAAU2L59mYvHy0Fa\n' > /tmp/stangri-repo.pub && opkg-key add /tmp/stangri-repo.pub
+! grep -q 'stangri_repo' /etc/opkg/customfeeds.conf && echo 'src/gz stangri_repo https://raw.githubusercontent.com/stangri/openwrt-repo/master' >> /etc/opkg/customfeeds.conf
+opkg update
+```
+
+###### LEDE Project and OpenWrt 18.xx or later
+```sh
+opkg update; opkg install uclient-fetch libustream-mbedtls
+echo -e -n 'untrusted comment: public key 7ffc7517c4cc0c56\nRWR//HUXxMwMVnx7fESOKO7x8XoW4/dRidJPjt91hAAU2L59mYvHy0Fa\n' > /tmp/stangri-repo.pub && opkg-key add /tmp/stangri-repo.pub
+! grep -q 'stangri_repo' /etc/opkg/customfeeds.conf && echo 'src/gz stangri_repo https://raw.githubusercontent.com/stangri/openwrt-repo/master' >> /etc/opkg/customfeeds.conf
+opkg update
+```
+
+
+#### Default Settings
+Default configuration has service disabled (use Web UI to enable/start service or run ```uci set simple-adblock.config.enabled=1```) and selected ad/malware lists suitable for routers with 64Mb RAM. The configuration file has lists in descending order starting with biggest ones, comment out or delete the lists you don't want or your router can't handle.
+
+
+## How to customize
+You can use Web UI (found in Services/Simple AdBlock) to add/remove/edit links to:
+- hosts files (127.0.0.1 or 0.0.0.0 followed by space and domain name per line) to be blocked.
+- domains lists (one domain name per line) to be blocked.
+- domains lists (one domain name per line) to be whitelisted. It is useful if you want to run simple-adblock on multiple routers and maintain one centralized whitelist which you can publish on a web-server.
+
+Please note that these lists **have** to include either ```http://``` or ```https://``` prefix. Some of the top block lists (both hosts files and domains lists) suitable for routers with at least 8MB RAM are used in the default simple-adblock installation.
+
+You can also use Web UI to add individual domains to be blocked or whitelisted.
+
+If you want to use CLI to customize simple-adblock config, you can probably figure out how to do it by looking at the contents of ```/etc/config/simple-adblock``` or output of the ```uci show simple-adblock``` command.
+
+## How does it work
+This service downloads (and processes in the background, removing comments and other useless data) lists of hosts and domains to be blocked, combines those lists into one big block list, removes duplicates and sorts it and then removes your whitelisted domains from the block list before converting to to dnsmasq-compatible file and restarting dnsmasq. The result of the process is that dnsmasq returns "domain not found" for the blocked domains.
+
+If you specify ```google.com``` as a domain to be whitelisted, you will have access to ```google.com```, ```www.google.com```, ```analytics.google.com```, but not fake domains like ```email-google.com``` or ```drive.google.com.verify.signin.normandeassociation.com``` for example. If you only want to allow ```www.google.com``` while blocking all other ```google.com``` subdomains, just specify ```www.google.com``` as domain to be whitelisted.
+
+In general, whatever domain is specified to be whitelisted; it, along with with its subdomains will be whitelisted, but not any fake domains containing it.
+
+## Documentation / Discussion
+Please head to [OpenWrt Forum](https://forum.openwrt.org/viewtopic.php?pid=307950) or [LEDE Project Forum](https://forum.lede-project.org/t/simple-adblock-fast-lean-and-fully-uci-luci-configurable-adblocking/1327/) for discussion of this package.
+
+## What's New
+1.5.8:
+- Better start/stop/reload logic.
+- Better uninstall logic.
+- Better start/stop/reload from Web UI.
+- New command-line ```check``` command.
+
+1.5.7:
+- Much stricter filters for hosts and domains lists resulting in better garbage removal.
+- Better handling of service start/enable from Web UI and enabled flag management.
+- Implemented support to set one of the router LEDs on/off based on the AdBlocking status.
+- Fixed the output bug when verbosity=1.
+- No longer using enabled in config file, Simple AdBlocking Web UI now enables/disables service directly.
+- Reworked console/system log output logic and formatting.
+- Processes already downloaded lists in the background while downloading next list from config, dramatically increasing overall speed.
+
+1.0.0:
+- Initial release
diff --git a/net/simple-adblock/files/simple-adblock.conf b/net/simple-adblock/files/simple-adblock.conf
new file mode 100644 (file)
index 0000000..4358094
--- /dev/null
@@ -0,0 +1,25 @@
+config simple-adblock 'config'
+       option enabled '0'
+       option verbosity '2'
+       option force_dns '1'
+       option hosts_file '/var/dnsmasq.d/simple-adblock'
+  list whitelist_domain 'raw.githubusercontent.com'
+#      list blacklist_hosts_url 'http://support.it-mate.co.uk/downloads/hosts.txt'
+#      list blacklist_hosts_url 'http://hostsfile.mine.nu/Hosts'
+#      list blacklist_hosts_url 'http://hosts-file.net/.\ad_servers.txt'
+#      list blacklist_hosts_url 'http://sysctl.org/cameleon/hosts.win'
+       list blacklist_hosts_url 'http://www.mvps.org/winhelp2002/hosts.txt'
+       list blacklist_hosts_url 'http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext'
+       list blacklist_hosts_url 'http://www.malwaredomainlist.com/hostslist/hosts.txt'
+       list blacklist_hosts_url 'https://adaway.org/hosts.txt'
+       list blacklist_hosts_url 'http://someonewhocares.org/hosts/hosts'
+       list blacklist_hosts_url 'https://zeustracker.abuse.ch/blocklist.php?download=hostfile'
+       list blacklist_domains_url 'http://mirror1.malwaredomains.com/files/justdomains'
+       list blacklist_domains_url 'https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt'
+       list blacklist_domains_url 'https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt'
+       list blacklist_domains_url 'https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt'
+       list blacklist_domains_url 'https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt'
+       list blacklist_domains_url 'https://ssl.bblck.me/blacklists/domain-list.txt'
+       list blacklist_domains_url 'http://dshield.org/feeds/suspiciousdomains_High.txt'
+#      list blacklist_domains_url 'http://dshield.org/feeds/suspiciousdomains_Medium.txt'
+#      list blacklist_domains_url 'http://dshield.org/feeds/suspiciousdomains_Low.txt'
diff --git a/net/simple-adblock/files/simple-adblock.init b/net/simple-adblock/files/simple-adblock.init
new file mode 100644 (file)
index 0000000..9e6b9af
--- /dev/null
@@ -0,0 +1,234 @@
+#!/bin/sh /etc/rc.common
+PKG_VERSION=
+
+export START=94
+export USE_PROCD=1
+
+readonly A_TMP='/var/hosts.allowed.tmp'
+readonly B_TMP='/var/hosts.blocked.tmp'
+readonly T_TMP='/var/simple-adblock.hosts'
+readonly dl='wget --no-check-certificate -qO-'
+readonly h_filter='/localhost/d;/^#/d;/^[^0-9]/d;s/^0\.0\.0\.0.//;s/^127\.0\.0\.1.//;s/[[:space:]]*#.*$//;s/[[:cntrl:]]$//;s/[[:space:]]//g;/[`~!@#\$%\^&\*()=+;:"'\'',<>?/\|[{}]/d;/]/d;/\./!d;/^$/d;'
+readonly d_filter='/^#/d;s/[[:space:]]*#.*$//;s/[[:space:]]*$//;s/[[:cntrl:]]$//;/[[:space:]]/d;/[`~!@#\$%\^&\*()=+;:"'\'',<>?/\|[{}]/d;/]/d;/\./!d;/^$/d;'
+readonly f_filter='s|^|local=/|;s|$|/|'
+readonly _OK_='\033[0;32m\xe2\x9c\x93\033[0m'
+readonly _FAIL_='\033[0;31m\xe2\x9c\x97\033[0m'
+readonly __OK__='\033[0;32m[\xe2\x9c\x93]\033[0m'
+readonly __FAIL__='\033[0;31m[\xe2\x9c\x97]\033[0m'
+readonly _ERROR_='\033[0;31mERROR\033[0m'
+
+export EXTRA_COMMANDS="check killcache"
+export EXTRA_HELP="    check   Checks if specified <string> is found in current blacklist"
+
+readonly packageName='simple-adblock'
+readonly serviceName="$packageName $PKG_VERSION"
+ok() { case $verbosity in 1) output "$_OK_";; 2) output "$__OK__\n";; esac; }
+okn() { case $verbosity in 1) output "$_OK_\n";; 2) output "$__OK__\n";; esac; }
+fail() { case $verbosity in 1) output "$_FAIL_";; 2) output "$__FAIL__\n";; esac; }
+failn() { case $verbosity in 1) output "$_FAIL_\n";; 2) output "$__FAIL__\n";; esac; }
+output() { [[ $# -ne 1 ]] && { [[ ! $((verbosity & $1)) -gt 0 ]] && return 0 || shift; }; local msg; msg=$(echo -n "${1/$serviceName /service }" | sed 's|\\033\[[0-9]\?;\?[0-9]\?[0-9]\?m||g'); [[ -t 1 ]] && echo -e -n "$1"; [[ $(echo -e -n "$msg" | wc -l) -gt 0 ]] && logger -t "${packageName:-service} [$$]" "$(echo -e -n ${logmsg}${msg})" && logmsg='' || logmsg=${logmsg}${msg}; }
+led_on(){ [[ -n "$led" && -e "$led/trigger" ]] && echo "default-on" > "$led/trigger"; }
+led_off(){ [[ -n "$led" && -e "$led/trigger" ]] && echo "none" > "$led/trigger"; }
+export serviceEnabled verbosity force_dns debug led wan_if wan_gw wanphysdev hosts_file
+
+boot() { ( sleep 120 && rc_procd start_service && rc_procd service_triggers | cat &); }
+
+load_package_config() {
+       config_load "$packageName"
+       config_get_bool serviceEnabled 'config' 'enabled' 1
+       config_get_bool force_dns      'config' 'force_dns' 1
+       config_get_bool debug          'config' 'debug' 0
+       config_get verbosity           'config' 'verbosity' '2'
+       config_get hosts_file          'config' 'hosts_file' "/var/dnsmasq.d/${packageName}"
+       config_get led                 'config' 'led'
+       source  /lib/functions/network.sh
+}
+
+is_enabled() {
+               local sleepCount=1
+               load_package_config
+
+               if [ "$debug" -ne 0 ]; then
+                       exec 1>>/tmp/simple-adblock.log
+                       exec 2>&1
+                       set -x
+               fi
+
+               led="${led:+/sys/class/leds/$led}"
+               [ $serviceEnabled -gt 0 ] || return 1
+               while : ; do
+                       network_flush_cache; network_find_wan wan_if;   network_get_gateway wan_gw $wan_if;
+                       [[ $sleepCount -ge 25 || -n "$wan_gw" ]] && break
+                       output "$serviceName waiting for wan gateway...\n"; sleep 2; let "sleepCount+=1";
+               done
+               [ -n "$wan_gw" ] && return 0
+               output "$_ERROR_: $serviceName failed to discover WAN gateway.\n"; return 1;
+}
+
+iptables_destroy() {
+  [ $force_dns -eq 0 ] && return 0
+       [ -z "$packageName" ] && return 1
+       iptables-save | grep -Fv -- "$packageName" | iptables-restore
+       lsmod | grep -q ip6table_nat && ip6tables-save | grep -Fv -- "$packageName" | ip6tables-restore
+       [ -z "$1" ] && output 'No longer forcing local DNS server.\n'
+}
+
+iptables_create() {
+       local ip ipv6 label ipv6wan brname
+       network_get_ipaddr ip lan; network_get_ipaddr6 ipv6 lan; network_get_device brname lan; network_get_physdev wanphysdev wan;
+       ipv6wan=$(ifconfig $wanphysdev | grep inet6 | awk '{print $3}')
+
+       iptables_destroy 'quiet'
+       if [ $force_dns -ne 0 ]; then
+               [ -n "$ip" ] && iptables -t nat -A prerouting_rule -i $brname -p tcp --dport 53 -j DNAT --to $ip -m comment --comment "$packageName"
+               [ -n "$ip" ] && iptables -t nat -A prerouting_rule -i $brname -p udp --dport 53 -j DNAT --to $ip -m comment --comment "$packageName"
+               if [[ -n "$ipv6" && -n "$ipv6wan" ]] && lsmod | grep -q ip6table_nat; then
+                       ip6tables -t nat -A PREROUTING -i $brname -p tcp --dport 53 -j DNAT --to-destination [$ipv6] -m comment --comment "$packageName"
+                       ip6tables -t nat -A PREROUTING -i $brname -p udp --dport 53 -j DNAT --to-destination [$ipv6] -m comment --comment "$packageName"
+                       label="$ip/$ipv6"
+               else
+                       label="$ip"
+               fi
+               if [ -z "$1" ]; then
+                       if [ -n "$label" ]; then
+                               output "Forcing local DNS server: $label.\n"
+                       else
+                               output "$_ERROR_: $serviceName failed to obtain LAN IP address for DNS forcing!\n"
+                       fi
+               fi
+       fi
+}
+
+stop_adblocking() {
+       load_package_config
+  [ -f $hosts_file ] && mv $hosts_file $T_TMP
+  output 3 "Restarting dnsmasq "
+       led_off
+  /etc/init.d/dnsmasq restart >/dev/null 2>&1
+       if [[ $? -eq 0 ]]; then
+               okn; output "$serviceName stopped.\n";
+       else
+               failn; output "$_ERROR_: $serviceName failed to reload dnsmasq!\n";
+       fi
+}
+
+process_url() {
+       local label type D_TMP R_TMP
+       [[ -n "$1" && -n "$2" && -n "$3" ]] || return 1
+       local url=$1
+       [ "$2" == "hosts" ] && label="Hosts: $(echo $1 | cut -d'/' -f3)" filter="$h_filter" || label="Domains: $(echo $1 | cut -d'/' -f3)" filter="$d_filter"
+       [ "$3" == "blocked" ] && { type='Blocked'; D_TMP="$B_TMP"; } || { type='Allowed'; D_TMP="$A_TMP"; }
+       R_TMP="/var/simple-adblock_$(head -c40 /dev/urandom 2>/dev/null | tr -dc 'A-Za-z0-9' 2>/dev/null)"
+       while [ -e "$R_TMP" ]; do R_TMP="/var/simple-adblock_$(head -c40 /dev/urandom 2>/dev/null | tr -dc 'A-Za-z0-9' 2>/dev/null)"; done
+       touch "$R_TMP"
+    output 2 "[DL] $type $label "
+    $dl "${url}" > "$R_TMP" 2>/dev/null && ok || fail
+       { sed -i "$filter" "$R_TMP"; cat "$R_TMP" >> "$D_TMP"; rm -f "$R_TMP"; } &
+}
+
+start_adblocking() {
+               local whitelist_domains blacklist_domains whitelist_domains_urls blacklist_domains_urls blacklist_hosts_urls
+    config_get whitelist_domains          'config' 'whitelist_domain'
+    config_get blacklist_domains          'config' 'blacklist_domain'
+    config_get whitelist_domains_urls     'config' 'whitelist_domains_url'
+    config_get blacklist_domains_urls     'config' 'blacklist_domains_url'
+    config_get blacklist_hosts_urls       'config' 'blacklist_hosts_url'
+
+    local hf w_filter
+
+       [ ! -d ${hosts_file%/*} ] && mkdir -p ${hosts_file%/*}
+       [ ! -f "$hosts_file" ] && touch "$hosts_file"
+       if [[ -s $T_TMP && ! "$1" == "reload" ]]; then
+               output 3 'Found existing data file, reusing it '
+               mv $T_TMP $hosts_file && okn || failn
+       else
+               [ -f $A_TMP ] && rm -f $A_TMP; [ -f $B_TMP ] && rm -f $B_TMP; [ -f $T_TMP ] && rm -f $T_TMP; [ -f $hosts_file ] && rm -f $hosts_file;
+               if [ "$(awk '/^MemFree/ {print int($2/1000)}' "/proc/meminfo")" -lt 32 ]; then
+                       output 1 'Low free memory, restarting dnsmasq...'
+                       /etc/init.d/dnsmasq restart >/dev/null 2>&1 && okn || failn
+               fi
+    touch $A_TMP; touch $B_TMP; touch $T_TMP;
+    if [ -n "$blacklist_hosts_urls" ]; then
+           output 1 '[DL] Blocked Hosts '
+           for hf in ${blacklist_hosts_urls}; do process_url "$hf" 'hosts' 'blocked'; done
+                       output 1 '\n'
+               fi
+    if [ -n "$blacklist_domains_urls" ]; then
+           output 1 '[DL] Blocked Domains '
+           for hf in ${blacklist_domains_urls}; do process_url "$hf" 'domains' 'blocked'; done
+                       output 1 '\n'
+               fi
+    if [ -n "$whitelist_domains_urls" ]; then
+           output 1 '[DL] Allowed Domains '
+           for hf in ${whitelist_domains_urls}; do process_url "$hf" 'domains' 'allowed'; done
+                       output 1 '\n'
+               fi
+               output 3 'Waiting for background processes '
+               wait && okn
+    [ -n "$blacklist_domains" ] && for hf in ${blacklist_domains}; do echo "$hf" | sed "$d_filter" >> $B_TMP; done
+    whitelist_domains="${whitelist_domains}"$'\n'"$(cat $A_TMP)"
+    [ -n "$whitelist_domains" ] && for hf in ${whitelist_domains}; do hf=$(echo $hf | sed 's/\./\\./g'); w_filter="$w_filter/^${hf}$/d;/\\.${hf}$/d;"; done
+               if [ -s $B_TMP ]; then
+                   output 1 'Processing downloads '
+                   output 2 'Sorting merged file '; sort $B_TMP | uniq > $T_TMP && ok || fail
+                   output 2 'Whitelisting domains '; sed -i "$w_filter" $T_TMP && ok || fail
+                   output 2 'Formatting merged file '; sed "$f_filter" $T_TMP > $B_TMP && mv $B_TMP $hosts_file && ok || fail
+                   output 1 '\n'
+                   output 3 'Removing temporary files '
+                       [ -f $A_TMP ] && rm -f $A_TMP; [ -f $B_TMP ] && rm -f $B_TMP; [ -f $T_TMP ] && rm -f $T_TMP;
+                   okn
+               fi
+       fi
+
+       if [ -s $hosts_file ]; then
+               output 3 'Restarting dnsmasq '
+               /etc/init.d/dnsmasq restart >/dev/null 2>&1
+               if [[ $? -eq 0 ]]; then
+                       led_on; okn;
+                       output "$serviceName blocking $(wc -l < $hosts_file) domains $_OK_\n"
+               else
+                       failn; output "$_ERROR_: $serviceName failed to reload dnsmasq!\n";
+                       exit 1
+               fi
+       else
+               output "$_ERROR_: $serviceName failed to create its data file!\n"
+               exit 1
+       fi
+}
+
+check() {
+       load_package_config
+       local string="$1"
+       if [ ! -f $hosts_file ]; then
+               echo "No local blacklist ($hosts_file) found."
+       elif [ -z "$string" ]; then
+               echo "Usage: /etc/init.d/${serviceName} check <string>"
+       elif grep -m1 -q $string $hosts_file; then
+               echo "Found $(grep $string $hosts_file | wc -l) matches for $string in $hosts_file:"
+               grep $string $hosts_file | sed 's|local=/||;s|/$||;'
+       else
+               echo "The $string is not found in current blacklist."
+       fi
+}
+
+start_service() {
+  is_enabled || return 1
+       if [ -f "$hosts_file" ]; then
+               output "Reloading $serviceName...\n"
+               iptables_create 'quiet'
+               start_adblocking 'reload'
+       else
+               output "Starting $serviceName...\n"
+               iptables_create
+               start_adblocking
+       fi
+}
+
+stop_service() {
+  load_package_config
+       output "Stopping $serviceName...\n"
+       iptables_destroy
+       stop_adblocking
+}
+
+killcache() { [ -s $T_TMP ] && rm -f $T_TMP; }
diff --git a/net/sipgrep/Makefile b/net/sipgrep/Makefile
deleted file mode 100644 (file)
index 272eefe..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright (C) 2016 Daniel Engberg <daniel.engberg.lists@pyret.net>
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=sipgrep
-PKG_VERSION:=20160914-devel
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
-PKG_LICENSE:=GPL-3.0
-PKG_LICENSE_FILES:=COPYING
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=https://github.com/sipcapture/sipgrep
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=df8a95b066569be92aa38cad01086ea595b36863
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-
-PKG_FIXUP:=autoreconf
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/sipgrep
-  SECTION:=net
-  CATEGORY:=Network
-  DEPENDS:=+libpcap +libpcre +libncursesw
-  TITLE:=Display and Troubleshoot SIP signaling in CLI
-  URL:=https://github.com/sipcapture/sipgrep
-endef
-
-define Package/sipgrep/description
-  SipGrep is a utility for displaying and troubleshooting SIP signaling.
-endef
-
-CONFIGURE_ARGS += \
-       --enable-ncurses
-
-define Package/sipgrep/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sipgrep $(1)/usr/sbin/
-endef
-
-$(eval $(call BuildPackage,sipgrep))
index 9be39cbacf5c0ba01946a1e1df70d08fb5927fd2..2bc26a3d86afbb2d5740274b4af839ddde2a2ee6 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=https://github.com/credosemi/smartsnmp.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=fb93473d895f058b2d8975d3cfa280ae2a8ae98d
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_MIRROR_MD5SUM:=
+PKG_MIRROR_HASH:=fc7f3eef8341163e21aecf6abf2492fa90362877093baef9987af3c703baa6ea
 
 
 PKG_MAINTAINER:=Xiongfei Guo <xfguo@credosemi.com>
@@ -47,6 +47,7 @@ SCONS_OPTIONS += --transport=uloop
 define Build/Configure
        (cd $(PKG_BUILD_DIR); \
                $(SCONS_VARS) \
+               CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
                scons \
                        prefix=/usr \
                        $(SCONS_OPTIONS) \
diff --git a/net/sngrep/Makefile b/net/sngrep/Makefile
deleted file mode 100644 (file)
index e1b2c9a..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (C) 2016 Daniel Engberg <daniel.engberg.lists@pyret.net>
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=sngrep
-PKG_VERSION=1.4.2
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
-PKG_LICENSE:=GPL-3.0
-PKG_LICENSE_FILES:=COPYING
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=https://github.com/irontec/sngrep
-PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=da791185cabeea5a6fcc7372157340b2d1369df7
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MIRROR_MD5SUM:=2cc640e065f33cae4a3a8e14bdc740e49269cd850eee2ffa9eb821427caaa371
-
-PKG_FIXUP:=autoreconf
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/sngrep
-  SECTION:=net
-  CATEGORY:=Network
-  DEPENDS:=+libpcap +libpthread +libpcre +libncursesw
-  TITLE:=Display SIP calls message flows
-  URL:=https://github.com/irontec/sngrep
-endef
-
-define Package/sngrep/description
-  sngrep is a tool for displaying SIP calls message flows from terminal.
-  It supports live capture to display realtime SIP packets and can also be used as PCAP viewer.
-endef
-
-CONFIGURE_ARGS += \
-       --with-pcre \
-       --enable-unicode \
-
-define Package/sngrep/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sngrep $(1)/usr/sbin/
-endef
-
-$(eval $(call BuildPackage,sngrep))
index d37829ee4b18151fafa2c9a0889e5e0a3b932b4e..33c433d67891560d6faa1662899c2e6edf610947 100644 (file)
@@ -17,7 +17,7 @@ PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.snort.org/downloads/snort/ \
        @SF/$(PKG_NAME)
-PKG_MD5SUM:=b01e9964827394c39194a0147bc15705
+PKG_HASH:=db57c532919d9ababac127f29dbdc05ed832394880e46cad81a5dde713ccb4be
 
 PKG_BUILD_DEPENDS:=librpc
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
index ede942c35c6b5b4e5899e84b90903ed3e52903ea..8a28c792f234d3367c4ce409110a3a134d5cdbf0 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=socat
-PKG_VERSION:=1.7.3.1
-PKG_RELEASE:=1
+PKG_VERSION:=1.7.3.2
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.dest-unreach.org/socat/download
-PKG_MD5SUM:=d2da659540c38139f388e9437bfaae16bb458d174d056cb3228432a8f489fbaa
+PKG_HASH:=e3561f808739383eb10fada1e5d4f26883f0311b34fd0af7837d0c95ef379251
 
-PKG_MAINTAINER:= Ted Hess <thess@kitschensync.net>
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=GPL-2.0 OpenSSL
 PKG_LICENSE_FILES:=COPYING COPYING.OpenSSL
@@ -67,10 +67,8 @@ CONFIGURE_VARS += \
        sc_cv_termios_ispeed="no" \
        sc_cv_sys_crdly_shift=9 \
        sc_cv_sys_tabdly_shift=11 \
-       sc_cv_sys_csize_shift=4
-
-TARGET_CFLAGS += \
-       -include stddef.h
+       sc_cv_sys_csize_shift=4 \
+       BUILD_DATE=$(SOURCE_DATE_EPOCH)
 
 define Package/socat/install
        $(INSTALL_DIR) $(1)/usr/bin
diff --git a/net/socat/patches/110-drop_egd_sslv3_support.patch b/net/socat/patches/110-drop_egd_sslv3_support.patch
deleted file mode 100644 (file)
index f81f2eb..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
---- a/sslcls.c
-+++ b/sslcls.c
-@@ -55,6 +55,7 @@ const SSL_METHOD *sycSSLv2_server_method
- }
- #endif
-+#ifdef HAVE_SSLv3_client_method
- const SSL_METHOD *sycSSLv3_client_method(void) {
-    const SSL_METHOD *result;
-    Debug("SSLv3_client_method()");
-@@ -62,7 +63,9 @@ const SSL_METHOD *sycSSLv3_client_method
-    Debug1("SSLv3_client_method() -> %p", result);
-    return result;
- }
-+#endif
-+#ifdef HAVE_SSLv3_server_method
- const SSL_METHOD *sycSSLv3_server_method(void) {
-    const SSL_METHOD *result;
-    Debug("SSLv3_server_method()");
-@@ -70,6 +73,7 @@ const SSL_METHOD *sycSSLv3_server_method
-    Debug1("SSLv3_server_method() -> %p", result);
-    return result;
- }
-+#endif
- const SSL_METHOD *sycSSLv23_client_method(void) {
-    const SSL_METHOD *result;
-@@ -331,14 +335,6 @@ void sycSSL_free(SSL *ssl) {
-    return;
- }
--int sycRAND_egd(const char *path) {
--   int result;
--   Debug1("RAND_egd(\"%s\")", path);
--   result = RAND_egd(path);
--   Debug1("RAND_egd() -> %d", result);
--   return result;
--}
--
- DH *sycPEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u) {
-    DH *result;
-    Debug4("PEM_read_bio_DHparams(%p, %p, %p, %p)",
-@@ -375,7 +371,7 @@ int sycFIPS_mode_set(int onoff) {
- }
- #endif /* WITH_FIPS */
--#if OPENSSL_VERSION_NUMBER >= 0x00908000L
-+#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) && !defined(OPENSSL_NO_COMP)
- const COMP_METHOD *sycSSL_get_current_compression(SSL *ssl) {
-    const COMP_METHOD *result;
-    Debug1("SSL_get_current_compression(%p)", ssl);
---- a/sslcls.h
-+++ b/sslcls.h
-@@ -47,7 +47,6 @@ X509 *sycSSL_get_peer_certificate(SSL *s
- int sycSSL_shutdown(SSL *ssl);
- void sycSSL_CTX_free(SSL_CTX *ctx);
- void sycSSL_free(SSL *ssl);
--int sycRAND_egd(const char *path);
- DH *sycPEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u);
-@@ -55,7 +54,7 @@ BIO *sycBIO_new_file(const char *filenam
- int sycFIPS_mode_set(int onoff);
--#if OPENSSL_VERSION_NUMBER >= 0x00908000L
-+#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) && !defined(OPENSSL_NO_COMP)
- const COMP_METHOD *sycSSL_get_current_compression(SSL *ssl);
- const COMP_METHOD *sycSSL_get_current_expansion(SSL *ssl);
- const char *sycSSL_COMP_get_name(const COMP_METHOD *comp);
-@@ -98,7 +97,6 @@ const char *sycSSL_COMP_get_name(const C
- #define sycSSL_shutdown(s) SSL_shutdown(s)
- #define sycSSL_CTX_free(c) SSL_CTX_free(c)
- #define sycSSL_free(s) SSL_free(s)
--#define sycRAND_egd(p) RAND_egd(p)
- #define sycPEM_read_bio_DHparams(b,x,p,u) PEM_read_bio_DHparams(b,x,p,u)
---- a/test.sh
-+++ b/test.sh
-@@ -576,9 +576,6 @@ filloptionvalues() {
-     *,dh,*) OPTS=$(echo "$OPTS" |sed "s/,dh,/,dh=/tmp/hugo,/g");;
-     esac
-     case "$OPTS" in
--    *,egd,*) OPTS=$(echo "$OPTS" |sed "s/,egd,/,egd=/tmp/hugo,/g");;
--    esac
--    case "$OPTS" in
-     *,compress,*) OPTS=$(echo "$OPTS" |sed "s/,compress,/,compress=none,/g");;
-     esac
-     # PROXY
---- a/xio-openssl.c
-+++ b/xio-openssl.c
-@@ -108,7 +108,6 @@ const struct optdesc opt_openssl_key
- const struct optdesc opt_openssl_dhparam     = { "openssl-dhparam",     "dh",    OPT_OPENSSL_DHPARAM,     GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
- const struct optdesc opt_openssl_cafile      = { "openssl-cafile",     "cafile", OPT_OPENSSL_CAFILE,      GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
- const struct optdesc opt_openssl_capath      = { "openssl-capath",     "capath", OPT_OPENSSL_CAPATH,      GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
--const struct optdesc opt_openssl_egd         = { "openssl-egd",        "egd",    OPT_OPENSSL_EGD,         GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
- const struct optdesc opt_openssl_pseudo      = { "openssl-pseudo",     "pseudo", OPT_OPENSSL_PSEUDO,      GROUP_OPENSSL, PH_SPEC, TYPE_BOOL,     OFUNC_SPEC };
- #if OPENSSL_VERSION_NUMBER >= 0x00908000L
- const struct optdesc opt_openssl_compress    = { "openssl-compress",   "compress", OPT_OPENSSL_COMPRESS,  GROUP_OPENSSL, PH_SPEC, TYPE_STRING,   OFUNC_SPEC };
-@@ -147,7 +146,7 @@ int xio_reset_fips_mode(void) {
- static void openssl_conn_loginfo(SSL *ssl) {
-    Notice1("SSL connection using %s", SSL_get_cipher(ssl));
--#if OPENSSL_VERSION_NUMBER >= 0x00908000L
-+#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) && !defined(OPENSSL_NO_COMP)
-    {
-       const COMP_METHOD *comp, *expansion;
-@@ -722,7 +721,6 @@ int
-    char *opt_dhparam = NULL;  /* file name of DH params */
-    char *opt_cafile = NULL;   /* certificate authority file */
-    char *opt_capath = NULL;   /* certificate authority directory */
--   char *opt_egd = NULL;      /* entropy gathering daemon socket path */
- #if OPENSSL_VERSION_NUMBER >= 0x00908000L
-    char *opt_compress = NULL; /* compression method */
- #endif
-@@ -741,7 +739,6 @@ int
-    retropt_string(opts, OPT_OPENSSL_CAPATH, &opt_capath);
-    retropt_string(opts, OPT_OPENSSL_KEY, &opt_key);
-    retropt_string(opts, OPT_OPENSSL_DHPARAM, &opt_dhparam);
--   retropt_string(opts, OPT_OPENSSL_EGD, &opt_egd);
-    retropt_bool(opts,OPT_OPENSSL_PSEUDO, &opt_pseudo);
- #if OPENSSL_VERSION_NUMBER >= 0x00908000L
-    retropt_string(opts, OPT_OPENSSL_COMPRESS, &opt_compress);
-@@ -877,10 +874,6 @@ int
-       }
-    }
--   if (opt_egd) {
--      sycRAND_egd(opt_egd);
--   }
--
-    if (opt_pseudo) {
-       long int randdata;
-       /* initialize libc random from actual microseconds */
-@@ -1105,7 +1098,7 @@ static int openssl_SSL_ERROR_SSL(int lev
-       if (e == ((ERR_LIB_RAND<<24)|
-               (RAND_F_SSLEAY_RAND_BYTES<<12)|
-               (RAND_R_PRNG_NOT_SEEDED)) /*0x24064064*/) {
--       Error("too few entropy; use options \"egd\" or \"pseudo\"");
-+       Error("too few entropy; use option \"pseudo\"");
-        stat = STAT_NORETRY;
-       } else {
-        Msg2(level, "%s(): %s", funcname, ERR_error_string(e, buf));
---- a/xio-openssl.h
-+++ b/xio-openssl.h
-@@ -21,7 +21,6 @@ extern const struct optdesc opt_openssl_
- extern const struct optdesc opt_openssl_dhparam;
- extern const struct optdesc opt_openssl_cafile;
- extern const struct optdesc opt_openssl_capath;
--extern const struct optdesc opt_openssl_egd;
- extern const struct optdesc opt_openssl_pseudo;
- #if OPENSSL_VERSION_NUMBER >= 0x00908000L
- extern const struct optdesc opt_openssl_compress;
---- a/xioopts.c
-+++ b/xioopts.c
-@@ -412,7 +412,6 @@ const struct optname optionnames[] = {
- #ifdef ECHOPRT
-       IF_TERMIOS("echoprt",   &opt_echoprt)
- #endif
--      IF_OPENSSL("egd",       &opt_openssl_egd)
-       IF_ANY    ("end-close", &opt_end_close)
-       IF_TERMIOS("eof",       &opt_veof)
-       IF_TERMIOS("eol",       &opt_veol)
-@@ -1102,7 +1101,6 @@ const struct optname optionnames[] = {
-       IF_OPENSSL("openssl-compress",  &opt_openssl_compress)
- #endif
-       IF_OPENSSL("openssl-dhparam",   &opt_openssl_dhparam)
--      IF_OPENSSL("openssl-egd",       &opt_openssl_egd)
- #if WITH_FIPS
-       IF_OPENSSL("openssl-fips",      &opt_openssl_fips)
- #endif
---- a/xioopts.h
-+++ b/xioopts.h
-@@ -478,7 +478,6 @@ enum e_optcode {
-    OPT_OPENSSL_COMPRESS,
- #endif
-    OPT_OPENSSL_DHPARAM,
--   OPT_OPENSSL_EGD,
-    OPT_OPENSSL_FIPS,
-    OPT_OPENSSL_KEY,
-    OPT_OPENSSL_METHOD,
index 189f1f5611f2175f9399a5088576f4f70b354a1a..c896e09293bd29e6339523e2bb7734d9bd701866 100644 (file)
@@ -9,14 +9,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=softethervpn
-PKG_VERSION:=4.22-9634
-PKG_VERREL:=beta
-PKG_VERDATE:=2016.11.27
+PKG_VERSION:=4.25-9656
+PKG_VERREL:=rtm
+PKG_VERDATE:=2018.01.15
 PKG_RELEASE:=1
 
 PKG_SOURCE:=softether-src-v$(PKG_VERSION)-$(PKG_VERREL).tar.gz
 PKG_SOURCE_URL:=http://www.softether-download.com/files/softether/v$(PKG_VERSION)-$(PKG_VERREL)-$(PKG_VERDATE)-tree/Source_Code/
-PKG_MD5SUM:=703d41b34ff49d008ddd329340a5a75e
+PKG_HASH:=b946dec3da5833ad2be69125224784b8a8e2a4149297d0c0a907ba0e1c4535f8
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/v$(PKG_VERSION)
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/v$(PKG_VERSION)
@@ -78,8 +78,8 @@ MAKE_FLAGS += \
        -f src/makefiles/linux_$(if $(CONFIG_ARCH_64BIT),64,32)bit.mak
 
 # Map nonstandard CCFLAGS variable to standard TARGET_CFLAGS
-MAKE_VARS += \
-       CCFLAGS="$(TARGET_CFLAGS)"
+MAKE_FLAGS += \
+       CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)"
 
 define Build/Configure
        # Fetch prebuilt hamcore.se2 from staging dir
index 00e0feaa4b8c26fdde0f23820bbfee479edcc131..e60258031674bde7faa8f9d83812a332e3506c5e 100644 (file)
@@ -1,33 +1,13 @@
-Index: v4.22-9634/src/Mayaqua/Network.c
+Index: v4.25-9656/src/Mayaqua/Network.c
 ===================================================================
---- v4.22-9634.orig/src/Mayaqua/Network.c
-+++ v4.22-9634/src/Mayaqua/Network.c
-@@ -13013,20 +13013,28 @@ bool StartSSLEx(SOCK *sock, X *x, K *pri
-               }\r
-               else\r
+--- v4.25-9656.orig/src/Mayaqua/Network.c
++++ v4.25-9656/src/Mayaqua/Network.c
+@@ -13025,7 +13025,7 @@ bool StartSSLEx(SOCK *sock, X *x, K *pri
                {\r
-+#ifndef       SSL_OP_NO_SSLv3\r
                        if (client_tls == false)\r
                        {\r
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L\r
++#ifndef SSL_OP_NO_SSLv3\r
                                SSL_CTX_set_ssl_version(ssl_ctx, SSLv3_method());\r
-                       }\r
-                       else\r
-                       {\r
-+#endif        // SSL_OP_NO_SSLv3\r
-                               SSL_CTX_set_ssl_version(ssl_ctx, SSLv23_client_method());\r
-+#ifndef       SSL_OP_NO_SSLv3\r
-                       }\r
-+#endif        // SSL_OP_NO_SSLv3\r
-               }\r
-               sock->ssl = SSL_new(ssl_ctx);\r
-               SSL_set_fd(sock->ssl, (int)sock->socket);\r
\r
- #ifdef        SSL_CTRL_SET_TLSEXT_HOSTNAME\r
-+#ifndef       SSL_OP_NO_SSLv3\r
-               if (sock->ServerMode == false && client_tls)\r
-+#else\r
-+              if (sock->ServerMode == false)\r
-+#endif        // SSL_OP_NO_SSLv3\r
-               {\r
-                       if (IsEmptyStr(sni_hostname) == false)\r
-                       {\r
+ #else\r
+                               SSL_CTX_set_ssl_version(ssl_ctx, SSLv23_method());\r
index aa45787f677b9967a96d8b0952797aebb0b33fd1..18ae4eb823e2ce0b3f396b935ce67b0ca30bd38e 100644 (file)
@@ -12,8 +12,8 @@ PKG_VERSION:=0.9.9
 PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://softflowd.googlecode.com/files/
-PKG_MD5SUM:=ba83e2715e6250e6645ebcaa9ae1009d
+PKG_SOURCE_URL:=https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/softflowd
+PKG_HASH:=2313f2c50ea9b3f2db3524e38ec7cd71f9a6e885ac2e3b55ab037bccf8173612
 PKG_MAINTAINER:=Ross Vandegrift <ross@kallisti.us>
 PKG_LICENSE:=BSD-3-Clause
 
index 54c9ab764e719584649d7da353749c69a1ac690d..bfb9cd9e8a0db9367789020fa816e2686abcdf94 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://download.lighttpd.net/spawn-fcgi/releases-1.6.x/
-PKG_MD5SUM:=a67c098a50cd625fd12adf61b5dd4c32
+PKG_HASH:=423b0c317e0084773b483985cc21930c4b8dfcb411f7353d6ee6fc41d9cb9d45
 
 PKG_LICENSE:=BSD-3c
 PKG_LICENSE_FILES:=COPYING
index 3aa81b18fefede22c748250fb6fa2ba7de5a7abf..ed7bde6e929b061a50b5db25201830ff24b53e89 100644 (file)
@@ -10,10 +10,11 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=sqm-scripts
 PKG_SOURCE_VERSION:=8217081f7e52af342c362b29480461575c496387
 PKG_VERSION:=1.1.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPLv2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE).tar.xz
+PKG_MIRROR_HASH:=a287ce3bf68ed76f4fd7ae3df5e0066d99105b5c139c88bce99555dcb1d230a3
 PKG_SOURCE_URL:=https://github.com/tohojo/sqm-scripts.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
@@ -80,7 +81,7 @@ uci -q get ucitrack.@sqm[0] > /dev/null && {
   uci delete ucitrack.@sqm[0]
   uci del_list ucitrack.@firewall[0].affects=sqm
   uci commit
-}
+} || exit 0
 endef
 
 $(eval $(call BuildPackage,sqm-scripts))
index dcf138aaee8d5c7183134994bf073e9b17ec231f..b9cedd7eaebb6d6d9fdf5cc2b3387c59cdc5e3fc 100644 (file)
@@ -8,15 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=squid
-PKG_VERSION:=3.5.12
+PKG_VERSION:=3.5.27
 PKG_RELEASE:=1
 
 PKG_LICENSE:=GPL-2.0
-PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
+PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://www.squid-cache.org/Versions/v3/3.5/
-PKG_MD5SUM:=50016bf6e2d3a3a186a6c7236d251f63
+PKG_SOURCE_URL:=http://www3.us.squid-cache.org/Versions/v3/3.5/ \
+       http://www2.pl.squid-cache.org/Versions/v3/3.5/ \
+       http://www.squid-cache.org/Versions/v3/3.5/
+PKG_HASH:=5ddb4367f2dc635921f9ca7a59d8b87edb0412fa203d1543393ac3c7f9fef0ec
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
@@ -28,11 +30,11 @@ define Package/squid/Default
   CATEGORY:=Network
   SUBMENU:=Web Servers/Proxies
   URL:=http://www.squid-cache.org/
+  MENU:=1
 endef
 
 define Package/squid
   $(call Package/squid/Default)
-  MENU:=1
   DEPENDS:=+libopenssl +libpthread +librt +libltdl +libstdcpp
   TITLE:=full-featured Web proxy cache
 endef
index e7818608ee7ee6a9a37898b8a522be6af137b236..327ecef7c858a9cb9807a3f1df1afb174f5ef09f 100644 (file)
@@ -3,6 +3,7 @@ config squid 'squid'
        option http_port '3128'
        option coredump_dir '/tmp/squid'
        option visible_hostname 'OpenWrt'
+       option mime_table '/etc/squid/mime.conf'
        #option http_port_options 'intercept'
        #option ssldb '/tmp/squid/ssldb'
        #option ssldb_options '-M 4MB'
index 76ec756c49f3e933c93385c1f9219a3054250f6c..711347ba5811b5ae63c8d9000cad4ca0de975a45 100644 (file)
@@ -7,6 +7,7 @@ STOP=10
 USE_PROCD=1
 PROG=/usr/sbin/squid
 CONFIGFILE="/tmp/squid/squid.conf"
+MIMETABLE="/tmp/squid/mime.conf"
 
 validate_squid_section() {
        uci_validate_section squid squid "${1}" \
@@ -17,7 +18,8 @@ validate_squid_section() {
                'ssldb_options:string' \
                'coredump_dir:string' \
                'visible_hostname:string:OpenWrt' \
-               'pinger_enable:string:off'
+               'pinger_enable:string:off' \
+               'mime_table:string:/etc/squid/mime.conf'
 }
 
 start_service() {
@@ -38,6 +40,8 @@ start_service() {
        echo coredump_dir $coredump_dir >> $CONFIGFILE
        echo visible_hostname $visible_hostname >> $CONFIGFILE
        echo pinger_enable $pinger_enable >> $CONFIGFILE
+       cat $mime_table > $MIMETABLE
+       echo mime_table $MIMETABLE >> $CONFIGFILE
        [ "$ssldb" ] && echo sslcrtd_program /usr/lib/squid/ssl_crtd -s $ssldb $ssldb_options >> $CONFIGFILE
        $PROG -s -f $CONFIGFILE -N -z 2>/dev/null
 
index c7493bbceee54959fbe069d5323ad3f86513aaf5..be9fdcd25dc4283934654cd9abf5b2488b15a84f 100644 (file)
@@ -1,24 +1,40 @@
 --- a/src/Makefile.in
 +++ b/src/Makefile.in
-@@ -7761,3 +7761,3 @@ cache_cf.o: cf_parser.cci
+@@ -7984,7 +7984,7 @@ cache_cf.o: cf_parser.cci
+ # cf_gen builds the configuration files.
  cf_gen$(EXEEXT): $(cf_gen_SOURCES) $(cf_gen_DEPENDENCIES) cf_gen_defines.cci
 -      $(BUILDCXX) $(BUILDCXXFLAGS) -o $@ $(srcdir)/cf_gen.cc -I$(srcdir) -I$(top_builddir)/include/ -I$(top_builddir)/src
 +      g++ -o $@ $(srcdir)/cf_gen.cc -I$(srcdir) -I$(top_builddir)/include/ -I$(top_builddir)/src
  
+ # squid.conf.default is built by cf_gen when making cf_parser.cci
+ squid.conf.default squid.conf.documented: cf_parser.cci
 --- a/configure
 +++ b/configure
-@@ -20133,3 +20133,3 @@ if test "$cross_compiling" = yes; then :
+@@ -20842,7 +20842,7 @@ else
+ if test "$cross_compiling" = yes; then :
+   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
  $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 -as_fn_error $? "cannot run test program while cross compiling
 +_as_fn_error $? "cannot run test program while cross compiling
  See \`config.log' for more details" "$LINENO" 5; }
-@@ -28289,3 +28289,3 @@ else
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -29142,7 +29142,7 @@ else
+     if test "$cross_compiling" = yes; then :
+   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
  $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 -as_fn_error $? "cannot run test program while cross compiling
 +_as_fn_error $? "cannot run test program while cross compiling
  See \`config.log' for more details" "$LINENO" 5; }
-@@ -28314,3 +28314,3 @@ else
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -29167,7 +29167,7 @@ else
+     if test "$cross_compiling" = yes; then :
+   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
  $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 -as_fn_error $? "cannot run test program while cross compiling
 +_as_fn_error $? "cannot run test program while cross compiling
  See \`config.log' for more details" "$LINENO" 5; }
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
diff --git a/net/squid/patches/100-mime.patch b/net/squid/patches/100-mime.patch
deleted file mode 100644 (file)
index 1138a41..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
---- a/src/mime.conf.default
-+++ b/src/mime.conf.default
-@@ -1,20 +1,3 @@
--## Copyright (C) 1996-2015 The Squid Software Foundation and contributors
--##
--## Squid software is distributed under GPLv2+ license and includes
--## contributions from numerous individuals and organizations.
--## Please see the COPYING and CONTRIBUTORS files for details.
--##
--#
--# This file associates URL patterns for servers or services
--# that don't automatically include Content-Type (like ftp) with a mime type
--# and a graphical icon.
--#
--# Content-Encodings are taken from section 3.1 of RFC2068 (HTTP/1.1)
--#
--# This file has the format :
--#
--# regexp      content-type                    icon                            encoding mode   actions
--#--------------------------------------------------------------------------------------------------------
- \.gif$                        image/gif               silk/image.png                  -       image   +download
- \.mime$                       www/mime                silk/page_white_text.png        -       ascii   +download
- ^internal-dirup$      -                       silk/arrow_up.png               -       -
-@@ -191,6 +174,4 @@ README             text/plain                      silk/information.pn
- \.xml$                text/xml                        silk/page_world.png             -       ascii   +download
- \.xsl$                text/xml                        silk/layout.png                 -       ascii   +download
- \.xyz$                chemical/x-xyz                  silk/chart_line.png             -       image   +download
--#
--# the default
- .             text/plain                      silk/bullet_red.png             -       image   +download +view
index 44038477f33d45e00b2ac4faf78b8ccb779c63c5..d243bf2c17c375378af62bc0248b3f1dee295f81 100644 (file)
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sshfs
-PKG_VERSION:=2.8
+PKG_VERSION:=2.10
 PKG_RELEASE:=1
 
 PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/libfuse/sshfs/releases/download/$(PKG_NAME)_$(PKG_VERSION)
-PKG_MD5SUM:=0ba25e848ee59e2595d6576c8f6284b6
+PKG_SOURCE_URL:=https://github.com/libfuse/sshfs/releases/download/$(PKG_NAME)-$(PKG_VERSION)
+PKG_HASH:=70845dde2d70606aa207db5edfe878e266f9c193f1956dd10ba1b7e9a3c8d101
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
index d7edfeecbc838ff4f539c338ab08a5b6715c418d..caf58a9014a2d071c77efd8331a76aa7e99bc6c6 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2009-2014 OpenWrt.org
+# Copyright (C) 2009-2018 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sslh
-PKG_VERSION:=v1.17
-PKG_RELEASE:=2
+PKG_VERSION:=v1.19c
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://rutschle.net/tech/
-PKG_MD5SUM:=1fc3ada4bafaca5a9786cc1431f48ed4
+PKG_SOURCE_URL:=https://rutschle.net/tech/sslh/
+PKG_HASH:=bb11dfa88b27ae1ec825a1b8156000c3f17f7e8f042311f19b7a249193c47bf3
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
 
@@ -24,24 +24,18 @@ define Package/sslh
   CATEGORY:=Network
   SUBMENU:=Routing and Redirection
   TITLE:=SSL/SSH multiplexer
-  URL:=http://rutschle.net/tech/sslh.shtml
+  DEPENDS:=+libconfig +USE_UCLIBC:libpcre +USE_MUSL:libpcre
+  URL:=https://rutschle.net/tech/sslh/README.html
   PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
 endef
 
 define Package/sslh/conffiles
 /etc/config/sslh
+/etc/sslh.conf
 endef
 
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               CC="$(TARGET_CC)" \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               LDFLAGS="$(TARGET_LDFLAGS)" \
-               USELIBCONFIG= \
-               USELIBWRAP= \
-               USELIBPCRE= \
-               all
-endef
+MAKE_FLAGS += \
+  $(if $(CONFIG_USE_GLIBC),USELIBPCRE=,USELIBPCRE=1)
 
 define Package/sslh/install
        $(INSTALL_DIR) $(1)/usr/sbin
@@ -50,6 +44,7 @@ define Package/sslh/install
        $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_CONF) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/basic.cfg $(1)/etc/sslh.conf
 endef
 
 $(eval $(call BuildPackage,sslh))
index 07ed02b47c9fb13ff4329c9a6c46363013a41ffb..b9e047dc6d3f3060147a9f87fe08439b7f5db229 100644 (file)
@@ -28,3 +28,5 @@ config 'sslh' 'default'
        # verbose defaults to off
        # -v
        option 'verbose' '0'
+       # use external config file
+       # option configfile '/etc/sslh.conf'
index f7fc647324495cf2b76f21694a54bc27cbd8b172..248ff0d37a19df25ced95ddae0b315259f106ac2 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2009-2012 OpenWrt.org
+# Copyright (C) 2009-2017 OpenWrt.org
 
 START=95
 
@@ -26,12 +26,12 @@ start_instance() {
        config_get val "${section}" ssl
        [ -n "${val}" ] && append args "--ssl ${val}"
        # D) openvpn parameter
-        config_get val "${section}" openvpn
-        [ -n "${val}" ] && append args "--openvpn ${val}"
+       config_get val "${section}" openvpn
+        [ -n "${val}" ] && append args "--openvpn ${val}"
        # E) tinc parameter
-        config_get val "${section}" tinc
-        [ -n "${val}" ] && append args "--tinc ${val}"
-       # F) xmpp parameter
+       config_get val "${section}" tinc
+        [ -n "${val}" ] && append args "--tinc ${val}"
+        # F) xmpp parameter
        config_get val "${section}" xmpp
        [ -n "${val}" ] && append args "--xmpp ${val}"
        # G) timeout (before a connection is considered to be SSH)
@@ -41,6 +41,9 @@ start_instance() {
        local verbosed
        config_get_bool verbosed "${section}" verbose 0
        [ "${verbosed}" -ne 0 ] && append args "-v"
+        # I) sslh config file (cmd line args override file settings)
+       config_get val "${section}" configfile
+       [ -n "${val}" ] && append args "-F${val}"
 
        # Defaults were removed for --user and --pidfile options
        # in sslh 1.11; Define them here instead.
index 2b461f6721e684ab56f6463bb8372865fb5dce64..3f547d2cb228c67377a6307a59fb3feb2c3b170d 100644 (file)
@@ -1,13 +1,15 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -45,16 +45,12 @@ all: sslh $(MAN) echosrv
+@@ -68,7 +68,7 @@ all: sslh $(MAN) echosrv $(CONDITIONAL_T
  version.h:
        ./genver.sh >version.h
  
 -sslh: sslh-fork sslh-select
 +sslh: sslh-fork
  
- sslh-fork: version.h $(OBJS) sslh-fork.o Makefile common.h
+ $(OBJS): version.h
+@@ -76,10 +76,6 @@ sslh-fork: version.h $(OBJS) sslh-fork.o
        $(CC) $(CFLAGS) $(LDFLAGS) -o sslh-fork sslh-fork.o $(OBJS) $(LIBS)
        #strip sslh-fork
  
 -      $(CC) $(CFLAGS) $(LDFLAGS) -o sslh-select sslh-select.o $(OBJS) $(LIBS)
 -      #strip sslh-select
 -
echosrv: $(OBJS) echosrv.o
-       $(CC) $(CFLAGS) $(LDFLAGS) -o echosrv echosrv.o probe.o common.o $(LIBS)
systemd-sslh-generator: systemd-sslh-generator.o
+       $(CC) $(CFLAGS) $(LDFLAGS) -o systemd-sslh-generator systemd-sslh-generator.o -lconfig
  
-@@ -85,7 +81,7 @@ distclean: clean
+@@ -115,7 +111,7 @@ distclean: clean
        rm -f tags cscope.*
  
  clean:
--      rm -f sslh-fork sslh-select echosrv version.h $(MAN) *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info
-+      rm -f sslh-fork echosrv version.h $(MAN) *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info
+-      rm -f sslh-fork sslh-select echosrv version.h $(MAN) systemd-sslh-generator *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info
++      rm -f sslh-fork echosrv version.h $(MAN) systemd-sslh-generator *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info
  
  tags:
        ctags --globals -T *.[ch]
diff --git a/net/sslh/patches/002-configfile-fix.patch b/net/sslh/patches/002-configfile-fix.patch
new file mode 100644 (file)
index 0000000..0c88cc6
--- /dev/null
@@ -0,0 +1,30 @@
+--- a/basic.cfg
++++ b/basic.cfg
+@@ -1,3 +1,7 @@
++# **** Attention OpenWRT/LEDE Users ****
++# sslh command line arguments override arguments defined in this
++# configuration file (UCI uses command line arguments)
++
+ # This is a basic configuration file that should provide
+ # sensible values for "standard" setup.
+@@ -15,15 +19,16 @@ chroot: "/var/empty";
+ # Change hostname with your external address name.
+ listen:
+ (
+-    { host: "thelonious"; port: "443"; }
++    { host: "0.0.0.0"; port: "443"; },
++    { host: "[::]"; port: "443"; }
+ );
+ protocols:
+ (
+      { name: "ssh"; service: "ssh"; host: "localhost"; port: "22"; fork: true; },
+      { name: "openvpn"; host: "localhost"; port: "1194"; },
+-     { name: "xmpp"; host: "localhost"; port: "5222"; },
+-     { name: "http"; host: "localhost"; port: "80"; },
++#     { name: "xmpp"; host: "localhost"; port: "5222"; },
++#     { name: "http"; host: "localhost"; port: "80"; },
+      { name: "ssl"; host: "localhost"; port: "443"; log_level: 0; },
+      { name: "anyprot"; host: "localhost"; port: "443"; }
+ );
diff --git a/net/sslh/patches/002-no_regex_probes.patch b/net/sslh/patches/002-no_regex_probes.patch
deleted file mode 100644 (file)
index 130c311..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-From 3aefaf300478cd6fbc4892d5baaf70521ed323af Mon Sep 17 00:00:00 2001
-From: Yves Rutschle <git1@rutschle.net>
-Date: Thu, 9 Jul 2015 15:31:42 +0200
-Subject: [PATCH] Added Makefile option to build without libpcre
-
----
---- a/Makefile
-+++ b/Makefile
-@@ -2,6 +2,7 @@
- VERSION=$(shell ./genver.sh -r)
- USELIBCONFIG=1        # Use libconfig? (necessary to use configuration files)
-+USELIBPCRE=1  # Use libpcre? (necessary to use regex probe)
- USELIBWRAP?=  # Use libwrap?
- USELIBCAP=    # Use libcap?
- COV_TEST=     # Perform test coverage?
-@@ -27,6 +28,10 @@ ifneq ($(strip $(USELIBWRAP)),)
-       CPPFLAGS+=-DLIBWRAP
- endif
-+ifneq ($(strip $(USELIBPCRE)),)
-+      CPPFLAGS+=-DLIBPCRE
-+endif
-+
- ifneq ($(strip $(USELIBCONFIG)),)
-       LIBS:=$(LIBS) -lconfig
-       CPPFLAGS+=-DLIBCONFIG
---- a/probe.c
-+++ b/probe.c
-@@ -21,7 +21,9 @@
- #define _GNU_SOURCE
- #include <stdio.h>
-+#ifdef LIBPCRE
- #include <regex.h>
-+#endif
- #include <ctype.h>
- #include "probe.h"
-@@ -226,6 +228,7 @@ static int is_tls_protocol(const char *p
- static int regex_probe(const char *p, int len, struct proto *proto)
- {
-+#ifdef LIBPCRE
-     regex_t **probe = proto->data;
-     regmatch_t pos = { 0, len };
-@@ -233,6 +236,11 @@ static int regex_probe(const char *p, in
-         /* try them all */;
-     return (*probe != NULL);
-+#else
-+    /* Should never happen as we check when loading config file */
-+    fprintf(stderr, "FATAL: regex probe called but not built in\n");
-+    exit(5);
-+#endif
- }
- /* 
---- a/sslh-main.c
-+++ b/sslh-main.c
-@@ -25,7 +25,9 @@
- #ifdef LIBCONFIG
- #include <libconfig.h>
- #endif
-+#ifdef LIBPCRE
- #include <regex.h>
-+#endif
- #include "common.h"
- #include "probe.h"
-@@ -174,6 +176,7 @@ static int config_listen(config_t *confi
- #ifdef LIBCONFIG
- static void setup_regex_probe(struct proto *p, config_setting_t* probes)
- {
-+#ifdef LIBPCRE
-     int num_probes, errsize, i, res;
-     char *err;
-     const char * expr;
-@@ -201,6 +204,10 @@ static void setup_regex_probe(struct pro
-             exit(1);
-         }
-     }
-+#else
-+    fprintf(stderr, "line %d: regex probe specified but not compiled in\n", config_setting_source_line(probes));
-+    exit(5);
-+#endif
- }
- #endif
index 081c324ce3c8d4a5c6f181e050ff5efd785ca5d8..6959fd26c817dfe6b9aa6dfab88dc29f56fc97b4 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sstp-client
-PKG_VERSION:=1.0.11
+PKG_VERSION:=1.0.12
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/sstp-client/$(PKG_VERSION)
-PKG_MD5SUM:=4ddbc2fe33eb27d5a4f38d2241005970
+PKG_HASH:=487eb406579689803ce0397f6102b18641e4572ac7bc9b9e5f3027c84dcf67ff
 PKG_LICENSE=GPLv2
 
 include $(INCLUDE_DIR)/package.mk
index 5289d3f9740d062735d76ce2aa9aa56b2f487385..fdfcaf56221b07c78f7a46416b61baf0daa45e0e 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=strongswan
-PKG_VERSION:=5.5.1
+PKG_VERSION:=5.6.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_HASH:=e0a60a30ebf3c534c223559e1686497a21ded709a5d605c5123c2f52bcc22e92
 PKG_SOURCE_URL:=http://download.strongswan.org/ http://download2.strongswan.org/
-PKG_MD5SUM:=4eba9474f7dc6c8c8d7037261358e68d
 PKG_LICENSE:=GPL-2.0+
 PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
 
@@ -32,6 +32,7 @@ PKG_MOD_AVAILABLE:= \
        coupling \
        ctr \
        curl \
+       curve25519 \
        des \
        dhcp \
        dnskey \
@@ -85,6 +86,7 @@ PKG_MOD_AVAILABLE:= \
        unity \
        uci \
        updown \
+       vici \
        whitelist \
        x509 \
        xauth-eap \
@@ -136,6 +138,8 @@ $(call Package/strongswan/Default)
   TITLE+= (full)
   DEPENDS:= +strongswan \
        +strongswan-charon \
+       +strongswan-charon-cmd \
+       +strongswan-ipsec \
        +strongswan-mod-addrblock \
        +strongswan-mod-aes \
        +strongswan-mod-af-alg \
@@ -150,6 +154,7 @@ $(call Package/strongswan/Default)
        +strongswan-mod-coupling \
        +strongswan-mod-ctr \
        +strongswan-mod-curl \
+       +strongswan-mod-curve25519 \
        +strongswan-mod-des \
        +strongswan-mod-dhcp \
        +strongswan-mod-dnskey \
@@ -200,12 +205,15 @@ $(call Package/strongswan/Default)
        +strongswan-mod-uci \
        +strongswan-mod-unity \
        +strongswan-mod-updown \
+       +strongswan-mod-vici \
        +strongswan-mod-whitelist \
        +strongswan-mod-x509 \
        +strongswan-mod-xauth-eap \
        +strongswan-mod-xauth-generic \
        +strongswan-mod-xcbc \
-       +strongswan-utils \
+       +strongswan-pki \
+       +strongswan-scepclient \
+       +strongswan-swanctl \
        @DEVEL
 endef
 
@@ -223,6 +231,7 @@ $(call Package/strongswan/Default)
   TITLE+= (default)
   DEPENDS:= +strongswan \
        +strongswan-charon \
+       +strongswan-ipsec \
        +strongswan-mod-aes \
        +strongswan-mod-attr \
        +strongswan-mod-connmark \
@@ -251,8 +260,7 @@ $(call Package/strongswan/Default)
        +strongswan-mod-updown \
        +strongswan-mod-x509 \
        +strongswan-mod-xauth-generic \
-       +strongswan-mod-xcbc \
-       +strongswan-utils
+       +strongswan-mod-xcbc
 endef
 
 define Package/strongswan-default/description
@@ -266,6 +274,7 @@ $(call Package/strongswan/Default)
   TITLE+= (isakmp)
   DEPENDS:= +strongswan \
        +strongswan-charon \
+       +strongswan-ipsec \
        +strongswan-mod-aes \
        +strongswan-mod-des \
        +strongswan-mod-gmpdh \
@@ -279,8 +288,7 @@ $(call Package/strongswan/Default)
        +strongswan-mod-socket-default \
        +strongswan-mod-stroke \
        +strongswan-mod-uci \
-       +strongswan-mod-updown \
-       +strongswan-utils
+       +strongswan-mod-updown
 endef
 
 define Package/strongswan-isakmp/description
@@ -327,15 +335,59 @@ $(call Package/strongswan/description/Default)
  This package contains charon, an IKEv2 keying daemon.
 endef
 
-define Package/strongswan-utils
+define Package/strongswan-charon-cmd
+$(call Package/strongswan/Default)
+  TITLE+= charon-cmd utility
+  DEPENDS:= +strongswan +strongswan-charon
+endef
+
+define Package/strongswan-charon-cmd/description
+$(call Package/strongswan/description/Default)
+ This package contains the charon-cmd utility.
+endef
+
+define Package/strongswan-ipsec
 $(call Package/strongswan/Default)
   TITLE+= utilities
   DEPENDS:= +strongswan
 endef
 
-define Package/strongswan-utils/description
+define Package/strongswan-ipsec/description
+$(call Package/strongswan/description/Default)
+ This package contains the ipsec utility.
+endef
+
+define Package/strongswan-pki
+$(call Package/strongswan/Default)
+  TITLE+= PKI tool
+  DEPENDS:= +strongswan
+endef
+
+define Package/strongswan-pki/description
+$(call Package/strongswan/description/Default)
+ This package contains the pki tool.
+endef
+
+define Package/strongswan-scepclient
+$(call Package/strongswan/Default)
+  TITLE+= SCEP client
+  DEPENDS:= +strongswan
+endef
+
+define Package/strongswan-scepclient/description
 $(call Package/strongswan/description/Default)
- This package contains the pki & scepclient utilities.
+ This package contains the SCEP client.
+endef
+
+define Package/strongswan-swanctl
+$(call Package/strongswan/Default)
+  TITLE+= swanctl utility
+  DEPENDS:= +strongswan +strongswan-mod-vici
+endef
+
+define Package/strongswan-swanctl/description
+$(call Package/strongswan/description/Default)
+ This package contains the swanctl utility.
 endef
 
 define Package/strongswan-libtls
@@ -376,7 +428,9 @@ CONFIGURE_ARGS+= \
        --disable-fast \
        --enable-mediation \
        --with-systemdsystemunitdir=no \
-       $(if $(CONFIG_PACKAGE_strongswan-utils),--enable-pki --enable-scepclient,--disable-pki --disable-scepclient) \
+       $(if $(CONFIG_PACKAGE_strongswan-charon-cmd),--enable-cmd,--disable-cmd) \
+       $(if $(CONFIG_PACKAGE_strongswan-pki),--enable-pki,--disable-pki) \
+       $(if $(CONFIG_PACKAGE_strongswan-scepclient),--enable-scepclient,--disable-scepclient) \
        --with-random-device=/dev/random \
        --with-urandom-device=/dev/urandom \
        --with-routing-table="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE))" \
@@ -426,20 +480,46 @@ define Package/strongswan-minimal/install
 endef
 
 define Package/strongswan-charon/install
+       $(INSTALL_DIR) $(1)/etc/strongswan.d
+       $(CP) $(PKG_INSTALL_DIR)/etc/strongswan.d/charon.conf $(1)/etc/strongswan.d
+       $(CP) $(PKG_INSTALL_DIR)/etc/strongswan.d/charon-logging.conf $(1)/etc/strongswan.d
        $(INSTALL_DIR) $(1)/usr/lib/ipsec
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/charon $(1)/usr/lib/ipsec/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libcharon.so.* $(1)/usr/lib/ipsec/
 endef
 
-define Package/strongswan-utils/install
+define Package/strongswan-charon-cmd/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/charon-cmd $(1)/usr/sbin/
+endef
+
+define Package/strongswan-ipsec/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipsec $(1)/usr/sbin/
+endef
+
+define Package/strongswan-pki/install
+       $(INSTALL_DIR) $(1)/etc/strongswan.d
+       $(CP) $(PKG_INSTALL_DIR)/etc/strongswan.d/pki.conf $(1)/etc/strongswan.d/
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pki $(1)/usr/bin/
+endef
+
+define Package/strongswan-scepclient/install
+       $(INSTALL_DIR) $(1)/etc/strongswan.d
+       $(CP) $(PKG_INSTALL_DIR)/etc/strongswan.d/scepclient.conf $(1)/etc/strongswan.d/
        $(INSTALL_DIR) $(1)/usr/lib/ipsec
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/scepclient $(1)/usr/lib/ipsec/
 endef
 
+define Package/strongswan-swanctl/install
+       $(INSTALL_DIR) $(1)/etc/swanctl/{bliss,ecdsa,pkcs{12,8},private,pubkey,rsa}
+       $(INSTALL_DIR) $(1)/etc/swanctl/x509{,aa,ac,ca,crl,ocsp}
+       $(CP) $(PKG_INSTALL_DIR)/etc/swanctl/swanctl.conf $(1)/etc/swanctl/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/swanctl $(1)/usr/sbin/
+endef
+
 define Package/strongswan-libtls/install
        $(INSTALL_DIR) $(1)/usr/lib/ipsec
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libtls.so.* $(1)/usr/lib/ipsec/
@@ -484,6 +564,12 @@ define Plugin/updown/install
        $(INSTALL_DIR) $(1)/etc
 endef
 
+define Plugin/vici/install
+       $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libvici.so.* $(1)/usr/lib/ipsec/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-vici.so $(1)/usr/lib/ipsec/plugins/
+endef
+
 define Plugin/whitelist/install
        $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/whitelist $(1)/usr/lib/ipsec/
@@ -501,7 +587,11 @@ $(eval $(call BuildPackage,strongswan-full))
 $(eval $(call BuildPackage,strongswan-minimal))
 $(eval $(call BuildPackage,strongswan-isakmp))
 $(eval $(call BuildPackage,strongswan-charon))
-$(eval $(call BuildPackage,strongswan-utils))
+$(eval $(call BuildPackage,strongswan-charon-cmd))
+$(eval $(call BuildPackage,strongswan-ipsec))
+$(eval $(call BuildPackage,strongswan-pki))
+$(eval $(call BuildPackage,strongswan-scepclient))
+$(eval $(call BuildPackage,strongswan-swanctl))
 $(eval $(call BuildPackage,strongswan-libtls))
 $(eval $(call BuildPlugin,addrblock,RFC 3779 address block constraint support,))
 $(eval $(call BuildPlugin,aes,AES crypto,))
@@ -517,6 +607,7 @@ $(eval $(call BuildPlugin,constraints,advanced X509 constraint checking,))
 $(eval $(call BuildPlugin,coupling,IKEv2 plugin to couple peer certificates permanently to authentication,))
 $(eval $(call BuildPlugin,ctr,Counter Mode wrapper crypto,))
 $(eval $(call BuildPlugin,curl,cURL fetcher plugin,+PACKAGE_strongswan-mod-curl:libcurl))
+$(eval $(call BuildPlugin,curve25519,Curve25519 Diffie-Hellman,))
 $(eval $(call BuildPlugin,des,DES crypto,))
 $(eval $(call BuildPlugin,dhcp,DHCP based attribute provider,))
 $(eval $(call BuildPlugin,dnskey,DNS RR key decoding,))
@@ -565,11 +656,12 @@ $(eval $(call BuildPlugin,socket-dynamic,dynamic socket implementation for charo
 $(eval $(call BuildPlugin,sql,SQL database interface,))
 $(eval $(call BuildPlugin,sqlite,SQLite database interface,+strongswan-mod-sql +PACKAGE_strongswan-mod-sqlite:libsqlite3))
 $(eval $(call BuildPlugin,sshkey,SSH key decoding,))
-$(eval $(call BuildPlugin,stroke,Stroke,+strongswan-charon +strongswan-utils))
+$(eval $(call BuildPlugin,stroke,Stroke,+strongswan-charon +strongswan-ipsec))
 $(eval $(call BuildPlugin,test-vectors,crypto test vectors,))
 $(eval $(call BuildPlugin,uci,UCI config interface,+PACKAGE_strongswan-mod-uci:libuci))
 $(eval $(call BuildPlugin,unity,Cisco Unity extension,))
 $(eval $(call BuildPlugin,updown,updown firewall,))
+$(eval $(call BuildPlugin,vici,Versatile IKE Configuration Interface,))
 $(eval $(call BuildPlugin,whitelist,peer identity whitelisting,))
 $(eval $(call BuildPlugin,x509,x509 certificate,))
 $(eval $(call BuildPlugin,xauth-eap,EAP XAuth backend,))
index 391a2ae8c712d617914c363611baba64df8d46ff..07ccffd2e5ac421428a957efee683257131c40a9 100644 (file)
 START=90
 STOP=10
 
-start() {
-       ipsec start
+USE_PROCD=1
+PROG=/usr/lib/ipsec/starter
+
+. $IPKG_INSTROOT/lib/functions.sh
+. $IPKG_INSTROOT/lib/functions/network.sh
+
+IPSEC_SECRETS_FILE=/etc/ipsec.secrets
+IPSEC_CONN_FILE=/etc/ipsec.conf
+STRONGSWAN_CONF_FILE=/etc/strongswan.conf
+
+IPSEC_VAR_SECRETS_FILE=/var/ipsec/ipsec.secrets
+IPSEC_VAR_CONN_FILE=/var/ipsec/ipsec.conf
+STRONGSWAN_VAR_CONF_FILE=/var/ipsec/strongswan.conf
+
+WAIT_FOR_INTF=0
+
+file_reset() {
+       : > "$1"
+}
+
+xappend() {
+       local file="$1"
+       shift
+
+       echo "${@}" >> "${file}"
+}
+
+remove_include() {
+       local file="$1"
+       local include="$2"
+
+       sed -i "\_${include}_d" "${file}"
+}
+
+remove_includes() {
+       remove_include "${IPSEC_CONN_FILE}" "${IPSEC_VAR_CONN_FILE}"
+       remove_include "${IPSEC_SECRETS_FILE}" "${IPSEC_VAR_SECRETS_FILE}"
+       remove_include "${STRONGSWAN_CONF_FILE}" "${STRONGSWAN_VAR_CONF_FILE}"
 }
 
-stop() {
-       ipsec stop
+do_include() {
+       local conf="$1"
+       local uciconf="$2"
+       local backup=`mktemp -t -p /tmp/ ipsec-init-XXXXXX`
+
+       [ ! -f "${conf}" ] && rm -rf "${conf}"
+       touch "${conf}"
+
+       cat "${conf}" | grep -v "${uciconf}" > "${backup}"
+       mv "${backup}" "${conf}"
+       xappend "${conf}" "include ${uciconf}"
+       file_reset "${uciconf}"
+}
+
+ipsec_reset() {
+       do_include "${IPSEC_CONN_FILE}" "${IPSEC_VAR_CONN_FILE}"
 }
 
-restart() {
-       ipsec restart
+ipsec_xappend() {
+       xappend "${IPSEC_VAR_CONN_FILE}" "$@"
 }
 
-reload() {
-       ipsec update
+swan_reset() {
+       do_include "${STRONGSWAN_CONF_FILE}" "${STRONGSWAN_VAR_CONF_FILE}"
+}
+
+swan_xappend() {
+       xappend "${STRONGSWAN_VAR_CONF_FILE}" "$@"
+}
+
+secret_reset() {
+       do_include "${IPSEC_SECRETS_FILE}" "${IPSEC_VAR_SECRETS_FILE}"
+}
+
+secret_xappend() {
+       xappend "${IPSEC_VAR_SECRETS_FILE}" "$@"
+}
+
+warning() {
+       echo "WARNING: $@" >&2
+}
+
+add_crypto_proposal() {
+       local encryption_algorithm
+       local hash_algorithm
+       local dh_group
+
+       config_get encryption_algorithm  "$1" encryption_algorithm
+       config_get hash_algorithm        "$1" hash_algorithm
+       config_get dh_group              "$1" dh_group
+
+       [ -n "${encryption_algorithm}" ] && \
+               crypto="${crypto:+${crypto},}${encryption_algorithm}${hash_algorithm:+-${hash_algorithm}}${dh_group:+-${dh_group}}"
+}
+
+set_crypto_proposal() {
+       local conf="$1"
+       local proposal
+
+       crypto=""
+
+       config_get crypto_proposal "$conf" crypto_proposal ""
+       for proposal in $crypto_proposal; do
+               add_crypto_proposal "$proposal"
+       done
+
+       [ -n "${crypto}" ] && {
+               local force_crypto_proposal
+
+               config_get_bool force_crypto_proposal "$conf" force_crypto_proposal
+
+               [ "${force_crypto_proposal}" = "1" ] && crypto="${crypto}!"
+       }
+
+       crypto_proposal="${crypto}"
+}
+
+config_conn() {
+       # Generic ipsec conn section shared by tunnel and transport
+       local mode
+       local local_subnet
+       local local_nat
+       local local_sourceip
+       local local_updown
+       local local_firewall
+       local remote_subnet
+       local remote_sourceip
+       local remote_updown
+       local remote_firewall
+       local ikelifetime
+       local lifetime
+       local margintime
+       local keyingtries
+       local dpdaction
+       local dpddelay
+       local inactivity
+       local keyexchange
+
+       config_get mode                     "$1"           mode "route"
+       config_get local_subnet             "$1"           local_subnet ""
+       config_get local_nat                "$1"           local_nat ""
+       config_get local_sourceip           "$1"           local_sourceip ""
+       config_get local_updown             "$1"           local_updown ""
+       config_get local_firewall           "$1"           local_firewall ""
+       config_get remote_subnet            "$1"           remote_subnet ""
+       config_get remote_sourceip          "$1"           remote_sourceip ""
+       config_get remote_updown            "$1"           remote_updown ""
+       config_get remote_firewall          "$1"           remote_firewall ""
+       config_get ikelifetime              "$1"           ikelifetime "3h"
+       config_get lifetime                 "$1"           lifetime "1h"
+       config_get margintime               "$1"           margintime "9m"
+       config_get keyingtries              "$1"           keyingtries "3"
+       config_get dpdaction                "$1"           dpdaction "none"
+       config_get dpddelay                 "$1"           dpddelay "30s"
+       config_get inactivity               "$1"           inactivity
+       config_get keyexchange              "$1"           keyexchange "ikev2"
+
+       [ -n "$local_nat" ] && local_subnet=$local_nat
+
+       ipsec_xappend "conn $config_name-$1"
+       ipsec_xappend "  left=%any"
+       ipsec_xappend "  right=$remote_gateway"
+
+       [ -n "$local_sourceip" ] && ipsec_xappend "  leftsourceip=$local_sourceip"
+       [ -n "$local_subnet" ] && ipsec_xappend "  leftsubnet=$local_subnet"
+
+       [ -n "$local_firewall" ] && ipsec_xappend "  leftfirewall=$local_firewall"
+       [ -n "$remote_firewall" ] && ipsec_xappend "  rightfirewall=$remote_firewall"
+
+       ipsec_xappend "  ikelifetime=$ikelifetime"
+       ipsec_xappend "  lifetime=$lifetime"
+       ipsec_xappend "  margintime=$margintime"
+       ipsec_xappend "  keyingtries=$keyingtries"
+       ipsec_xappend "  dpdaction=$dpdaction"
+       ipsec_xappend "  dpddelay=$dpddelay"
+
+       [ -n "$inactivity" ] && ipsec_xappend "  inactivity=$inactivity"
+
+       if [ "$auth_method" = "psk" ]; then
+               ipsec_xappend "  leftauth=psk"
+               ipsec_xappend "  rightauth=psk"
+
+               [ "$remote_sourceip" != "" ] && ipsec_xappend "  rightsourceip=$remote_sourceip"
+               [ "$remote_subnet" != "" ] && ipsec_xappend "  rightsubnet=$remote_subnet"
+
+               ipsec_xappend "  auto=$mode"
+       else
+               warning "AuthenticationMethod $auth_method not supported"
+       fi
+
+       [ -n "$local_identifier" ] && ipsec_xappend "  leftid=$local_identifier"
+       [ -n "$remote_identifier" ] && ipsec_xappend "  rightid=$remote_identifier"
+       [ -n "$local_updown" ] && ipsec_xappend "  leftupdown=$local_updown"
+       [ -n "$remote_updown" ] && ipsec_xappend "  rightupdown=$remote_updown"
+       ipsec_xappend "  keyexchange=$keyexchange"
+
+       set_crypto_proposal "$1"
+       [ -n "${crypto_proposal}" ] && ipsec_xappend "  esp=$crypto_proposal"
+       [ -n "${ike_proposal}" ] && ipsec_xappend "  ike=$ike_proposal"
+}
+
+config_tunnel() {
+       config_conn "$1"
+
+       # Specific for the tunnel part
+       ipsec_xappend "  type=tunnel"
+}
+
+config_transport() {
+       config_conn "$1"
+
+       # Specific for the transport part
+       ipsec_xappend "  type=transport"
+}
+
+config_remote() {
+       local enabled
+       local gateway
+       local pre_shared_key
+       local auth_method
+
+       config_name=$1
+
+       config_get_bool enabled "$1" enabled 0
+       [ $enabled -eq 0 ] && return
+
+       config_get gateway           "$1" gateway
+       config_get pre_shared_key    "$1" pre_shared_key
+       config_get auth_method       "$1" authentication_method
+       config_get local_identifier  "$1" local_identifier ""
+       config_get remote_identifier "$1" remote_identifier ""
+
+       [ "$gateway" = "any" ] && remote_gateway="%any" || remote_gateway="$gateway"
+
+       [ -z "$local_identifier" ] && {
+               local ipdest
+
+               [ "$remote_gateway" = "%any" ] && ipdest="1.1.1.1" || ipdest="$remote_gateway"
+               local_gateway=`ip route get $ipdest | awk -F"src" '/src/{gsub(/ /,"");print $2}'`
+       }
+
+       [ -n "$local_identifier" ] && secret_xappend -n "$local_identifier " || secret_xappend -n "$local_gateway "
+       [ -n "$remote_identifier" ] && secret_xappend -n "$remote_identifier " || secret_xappend -n "$remote_gateway "
+
+       secret_xappend ": PSK \"$pre_shared_key\""
+
+       set_crypto_proposal "$1"
+       ike_proposal="$crypto_proposal"
+
+       config_list_foreach "$1" tunnel config_tunnel
+
+       config_list_foreach "$1" transport config_transport
+
+       ipsec_xappend ""
+}
+
+config_ipsec() {
+       local debug
+       local rtinstall_enabled
+       local routing_tables_ignored
+       local routing_table
+       local routing_table_id
+       local interface
+       local device_list
+
+       ipsec_reset
+       secret_reset
+       swan_reset
+
+       ipsec_xappend "# generated by /etc/init.d/ipsec"
+       ipsec_xappend "version 2"
+       ipsec_xappend ""
+
+       secret_xappend "# generated by /etc/init.d/ipsec"
+
+       config_get debug "$1" debug 0
+       config_get_bool rtinstall_enabled "$1" rtinstall_enabled 1
+       [ $rtinstall_enabled -eq 1 ] && install_routes=yes || install_routes=no
+
+       # prepare extra charon config option ignore_routing_tables
+       for routing_table in $(config_get "$1" "ignore_routing_tables"); do
+               if [ "$routing_table" -ge 0 ] 2>/dev/null; then
+                       routing_table_id=$routing_table
+               else
+                       routing_table_id=$(sed -n '/[ \t]*[0-9]\+[ \t]\+'$routing_table'[ \t]*$/s/[ \t]*\([0-9]\+\).*/\1/p' /etc/iproute2/rt_tables)
+               fi
+
+               [ -n "$routing_table_id" ] && append routing_tables_ignored "$routing_table_id"
+       done
+
+       local interface_list=$(config_get "$1" "interface")
+       if [ -z "$interface_list" ]; then
+               WAIT_FOR_INTF=0
+       else
+               for interface in $interface_list; do
+                       network_get_device device $interface
+                       [ -n "$device" ] && append device_list "$device" ","
+               done
+               [ -n "$device_list" ] && WAIT_FOR_INTF=0 || WAIT_FOR_INTF=1
+       fi
+
+       swan_xappend "# generated by /etc/init.d/ipsec"
+       swan_xappend "charon {"
+       swan_xappend "  load_modular = yes"
+       swan_xappend "  install_routes = $install_routes"
+       [ -n "$routing_tables_ignored" ] && swan_xappend "  ignore_routing_tables = $routing_tables_ignored"
+       [ -n "$device_list" ] && swan_xappend "  interfaces_use = $device_list"
+       swan_xappend "    plugins {"
+       swan_xappend "      include /etc/strongswan.d/charon/*.conf"
+       swan_xappend "    }"
+       swan_xappend "  syslog {"
+       swan_xappend "    identifier = ipsec"
+       swan_xappend "    daemon {"
+       swan_xappend "      default = $debug"
+       swan_xappend "    }"
+       swan_xappend "    auth {"
+       swan_xappend "      default = $debug"
+       swan_xappend "    }"
+       swan_xappend "  }"
+       swan_xappend "}"
+}
+
+prepare_env() {
+       mkdir -p /var/ipsec
+       remove_includes
+       config_load ipsec
+       config_foreach config_ipsec ipsec
+       config_foreach config_remote remote
+}
+
+service_running() {
+       ipsec status > /dev/null 2>&1
+}
+
+reload_service() {
+       running && {
+               prepare_env
+               [ $WAIT_FOR_INTF -eq 0 ] && {
+                       ipsec rereadall
+                       ipsec reload
+                       return
+               }
+       }
+
+       start
+}
+
+check_ipsec_interface() {
+       local intf
+
+       for intf in $(config_get "$1" interface); do
+               procd_add_interface_trigger "interface.*" "$intf" /etc/init.d/ipsec reload
+       done
+}
+
+service_triggers() {
+       procd_add_reload_trigger "ipsec"
+       config load "ipsec"
+       config_foreach check_ipsec_interface ipsec
+}
+
+start_service() {
+       prepare_env
+
+       [ $WAIT_FOR_INTF -eq 1 ] && return
+
+       procd_open_instance
+
+       procd_set_param command $PROG --daemon charon --nofork
+
+       procd_set_param file $IPSEC_CONN_FILE
+       procd_append_param file $IPSEC_SECRETS_FILE
+       procd_append_param file $STRONGSWAN_CONF_FILE
+       procd_append_param file /etc/strongswan.d/*.conf
+       procd_append_param file /etc/strongswan.d/charon/*.conf
+
+       procd_set_param respawn
+
+       procd_close_instance
 }
index e48d22b41d77bac1e88a50d8a93e6bd6ba81f93b..753bd8e8d68421423d25a17b9d6c86c6f721dc65 100644 (file)
@@ -72,8 +72,8 @@
  #include <linux/netlink.h>
 --- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c
 +++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c
-@@ -15,6 +15,8 @@
-  * for more details.
+@@ -38,6 +38,8 @@
+  * THE SOFTWARE.
   */
  
 +#include "musl.h"
index 274ea8694225bd1ba0a3ff8336b9e0014279a8bf..21ae848bf17f23d8ab6f3cb8da6e7b3e314b0add 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/libcharon/plugins/uci/uci_parser.c
 +++ b/src/libcharon/plugins/uci/uci_parser.c
-@@ -78,7 +78,7 @@ METHOD(enumerator_t, section_enumerator_
+@@ -75,7 +75,7 @@ METHOD(enumerator_t, section_enumerator_
                if (uci_lookup(this->ctx, &element, this->package,
                                           this->current->name, "name") == UCI_OK)
                {       /* use "name" attribute as config name if available ... */
@@ -9,7 +9,7 @@
                }
                else
                {       /* ... or the section name becomes config name */
-@@ -93,7 +93,7 @@ METHOD(enumerator_t, section_enumerator_
+@@ -90,7 +90,7 @@ METHOD(enumerator_t, section_enumerator_
                if (value && uci_lookup(this->ctx, &element, this->package,
                                                  this->current->name, this->keywords[i]) == UCI_OK)
                {
@@ -17,4 +17,4 @@
 +                      *value = uci_to_option(element)->v.string;
                }
        }
-       va_end(args);
index d8adec3d0510634363cf467cd03297bd9d8566df..d8f2f3be25b06cdae89dc6c1f12aaf542a5b3d11 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/ipsec/_ipsec.in
 +++ b/src/ipsec/_ipsec.in
-@@ -259,7 +259,7 @@ stop)
+@@ -257,7 +257,7 @@ stop)
                        loop=110
                        while [ $loop -gt 0 ] ; do
                                kill -0 $spid 2>/dev/null || break
index 597510f19049a81b6ce002ba3a3748801122e3a8..eb8d83c4a3b7aaa0f5a99162c0bbf3ea7871d346 100644 (file)
@@ -1,40 +1,40 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -133,6 +133,7 @@ ARG_DISBL_SET([fips-prf],       [disable
+@@ -135,6 +135,7 @@ ARG_DISBL_SET([fips-prf],       [disable
  ARG_ENABL_SET([gcm],            [enables the GCM AEAD wrapper crypto plugin.])
  ARG_ENABL_SET([gcrypt],         [enables the libgcrypt plugin.])
  ARG_DISBL_SET([gmp],            [disable GNU MP (libgmp) based crypto implementation plugin.])
 +ARG_DISBL_SET([gmpdh],          [disable GNU MP (libgmp) based static-linked crypto DH minimal implementation plugin.])
+ ARG_DISBL_SET([curve25519],     [disable Curve25519 Diffie-Hellman plugin.])
  ARG_DISBL_SET([hmac],           [disable HMAC crypto implementation plugin.])
  ARG_ENABL_SET([md4],            [enable MD4 software implementation plugin.])
- ARG_DISBL_SET([md5],            [disable MD5 software implementation plugin.])
-@@ -1347,6 +1348,7 @@ ADD_PLUGIN([gcrypt],               [s ch
+@@ -1379,6 +1380,7 @@ ADD_PLUGIN([gcrypt],               [s ch
  ADD_PLUGIN([af-alg],               [s charon scepclient pki scripts medsrv attest nm cmd aikgen])
  ADD_PLUGIN([fips-prf],             [s charon nm cmd])
- ADD_PLUGIN([gmp],                  [s charon scepclient pki scripts manager medsrv attest nm cmd aikgen])
+ ADD_PLUGIN([gmp],                  [s charon scepclient pki scripts manager medsrv attest nm cmd aikgen fuzz])
 +ADD_PLUGIN([gmpdh],                [s charon scepclient pki scripts manager medsrv attest nm cmd aikgen])
+ ADD_PLUGIN([curve25519],           [s charon pki scripts nm cmd])
  ADD_PLUGIN([agent],                [s charon nm cmd])
  ADD_PLUGIN([keychain],             [s charon cmd])
- ADD_PLUGIN([chapoly],              [s charon scripts nm cmd])
-@@ -1480,6 +1482,7 @@ AM_CONDITIONAL(USE_SHA2, test x$sha2 = x
- AM_CONDITIONAL(USE_SHA3, test x$sha3 = xtrue)
+@@ -1516,6 +1518,7 @@ AM_CONDITIONAL(USE_SHA3, test x$sha3 = x
+ AM_CONDITIONAL(USE_MGF1, test x$mgf1 = xtrue)
  AM_CONDITIONAL(USE_FIPS_PRF, test x$fips_prf = xtrue)
  AM_CONDITIONAL(USE_GMP, test x$gmp = xtrue)
 +AM_CONDITIONAL(USE_GMPDH, test x$gmpdh = xtrue)
+ AM_CONDITIONAL(USE_CURVE25519, test x$curve25519 = xtrue)
  AM_CONDITIONAL(USE_RDRAND, test x$rdrand = xtrue)
  AM_CONDITIONAL(USE_AESNI, test x$aesni = xtrue)
- AM_CONDITIONAL(USE_RANDOM, test x$random = xtrue)
-@@ -1733,6 +1736,7 @@ AC_CONFIG_FILES([
-       src/libstrongswan/plugins/sha3/Makefile
+@@ -1783,6 +1786,7 @@ AC_CONFIG_FILES([
+       src/libstrongswan/plugins/mgf1/Makefile
        src/libstrongswan/plugins/fips_prf/Makefile
        src/libstrongswan/plugins/gmp/Makefile
 +      src/libstrongswan/plugins/gmpdh/Makefile
+       src/libstrongswan/plugins/curve25519/Makefile
        src/libstrongswan/plugins/rdrand/Makefile
        src/libstrongswan/plugins/aesni/Makefile
-       src/libstrongswan/plugins/random/Makefile
 --- a/src/libstrongswan/Makefile.am
 +++ b/src/libstrongswan/Makefile.am
-@@ -307,6 +307,13 @@ if MONOLITHIC
+@@ -323,6 +323,13 @@ if MONOLITHIC
  endif
  endif
  
@@ -45,8 +45,8 @@
 +endif
 +endif
 +
- if USE_RDRAND
-   SUBDIRS += plugins/rdrand
+ if USE_CURVE25519
+   SUBDIRS += plugins/curve25519
  if MONOLITHIC
 --- /dev/null
 +++ b/src/libstrongswan/plugins/gmpdh/Makefile.am
diff --git a/net/stubby/Makefile b/net/stubby/Makefile
new file mode 100644 (file)
index 0000000..5bf344c
--- /dev/null
@@ -0,0 +1,63 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=stubby
+PKG_VERSION:=0.2.2
+PKG_RELEASE:=1
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=David Mora <iamperson347+public@gmail.com>
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/getdnsapi/$(PKG_NAME)
+PKG_SOURCE_VERSION:=1a6acd642c7dc9a04cf092e1a3837c5636d4b465
+PKG_MIRROR_HASH:=f5a270a0ef4e7e2f0387b649ed77d66917ba9bd88dee14e3f9edd2573e8d3c3a
+
+PKG_FIXUP:=autoreconf
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/stubby/Default
+       TITLE:=stubby
+       URL:=https://dnsprivacy.org/wiki/display/DP/DNS+Privacy+Daemon+-+Stubby
+endef
+
+define Package/stubby/description
+       This package contains the Stubby daemon (which utilizes the getdns library).
+
+       See https://github.com/openwrt/packages/blob/master/net/stubby/files/README.md for more details.
+endef
+
+define Package/stubby
+       $(call Package/stubby/Default)
+       SECTION:=net
+       CATEGORY:=Network
+       SUBMENU:=IP Addresses and Names
+       TITLE+= - (daemon that uses getdns)
+       USERID:=stubby=410:stubby=410
+       DEPENDS:= +libyaml +getdns
+endef
+
+define Package/stubby/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/stubby $(1)/usr/sbin/stubby
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN)  ./files/stubby.init $(1)/etc/init.d/stubby
+       $(INSTALL_DIR) $(1)/etc/stubby
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/stubby/stubby.yml $(1)/etc/stubby/stubby.yml.default
+       $(INSTALL_DATA) ./files/stubby.yml $(1)/etc/stubby/stubby.yml
+endef
+
+
+define Package/stubby/conffiles
+       /etc/stubby/stubby.yml
+endef
+
+$(eval $(call BuildPackage,stubby))
diff --git a/net/stubby/files/README.md b/net/stubby/files/README.md
new file mode 100644 (file)
index 0000000..ad8cd39
--- /dev/null
@@ -0,0 +1,63 @@
+# Stubby for OpenWRT
+
+## Stubby Description
+[Stubby](https://dnsprivacy.org/wiki/display/DP/DNS+Privacy+Daemon+-+Stubby) is an application that acts as a local DNS Privacy stub resolver (using DNS-over-TLS). Stubby encrypts DNS queries sent from a client machine (desktop or laptop) to a DNS Privacy resolver increasing end user privacy.
+
+Stubby is developed by the [getdns](http://getdnsapi.net/) project.
+
+For more background and FAQ see our [About Stubby](https://dnsprivacy.org/wiki/display/DP/About+Stubby) page. Stubby is in the early stages of development but is suitable for technical/advanced users. A more generally user-friendly version is on the way!
+
+## Prerequisites
+
+You must have a ca cert bundle installed on your device for stubby to make the TLS enabled connections.
+
+- You can install this by running the following: opkg install ca-certificates
+- You can also install this through the LUCI web interface
+
+## Package Overview
+This package has some modifications that makes it differ from the default upstream configuration. They are outlined below.
+
+### General Cleanup
+Comments are removed, etc.
+
+### EDNS Client-Subnet Option Changed to 0
+The value of "edns_client_subnet_private" is '1' in the upstream default config. This informs the upstream resolver to NOT forward your connection's IP to any other upstream servers. This is good for privacy, but could result in sub-optimal routing to CDNs, etc.
+
+To give a more "comparable" DNS experience similar to google/opendns, this package disables this option.
+
+### Default Listening Ports Changed
+The value of "listen_addresses" in the default config does not list port numbers, which will cause stubby to default to port 53. However, Openwrt defaults to dnsmasq as the main name server daemon, which runs on port 53. By setting the listening ports to non-standard values, this allows users to keep the main name server daemon in place (dnsmasq/unbound/etc.) and have that name server forward to stubby.
+
+Additionally, due to the slight overhead involved with DNS-over-TLS, it is recommended to have a caching name server on the network.
+
+### Round Robin Upstream Setting Changed
+
+The default stubby config list multiple upstream resolvers, and because of this, it makes sense to "load balance" between them. However, in this package's default stubby config, the only upstream service listed is quad9. One entry is for ipv6 and one for ipv4.
+
+By setting the "round_robin_upstreams" value to 0, we are simply forcing stubby to try and use ipv6 connectivity to quad9 first, and if not available, simply use the ipv4 service.
+
+quad9 is an Anycast DNS service. This should take care of any needed "failover" in the event that one of quad9's nodes goes down.
+
+### Upstream Resolvers Changed
+
+Most of the default resolvers for stubby are in Europe. To provide a better experience for a larger number of users, this package defaults to using quad9's DNS service.
+
+Note: quad9 has multiple IPs available for their service. The "features" applied are based on the endpoint your DNS client connects to. For this package, the default resolvers are set to the non-filtering, EDNS Client-Subnet capable endpoints.
+
+https://www.quad9.net/faq/#Is_there_a_service_that_Quad9_offers_that_does_not_have_the_blocklist_or_other_security
+
+https://www.quad9.net/faq/#Does_Quad9_support_DNS_over_TLS
+
+``````
+
+# IPv6 addresses 
+# Quad 9 IPv6
+  - address_data: 2620:fe::10
+    tls_auth_name: "dns.quad9.net"
+
+# IPv4 addresses
+# Quad 9 service
+  - address_data: 9.9.9.10
+    tls_auth_name: "dns.quad9.net"
+
+``````
diff --git a/net/stubby/files/stubby.init b/net/stubby/files/stubby.init
new file mode 100644 (file)
index 0000000..1f2ce16
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh /etc/rc.common
+
+USE_PROCD=1
+
+START=50
+STOP=51
+
+PROG=/usr/sbin/stubby
+
+start_service() {
+  procd_open_instance stubby
+  procd_set_param command /usr/sbin/stubby
+
+  procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
+
+  procd_set_param limits core="unlimited"
+
+  procd_set_param file /etc/stubby/stubby.yml
+
+  procd_set_param stdout 1
+  procd_set_param stderr 1
+  procd_set_param user stubby
+  procd_close_instance
+}
+
diff --git a/net/stubby/files/stubby.yml b/net/stubby/files/stubby.yml
new file mode 100644 (file)
index 0000000..382350d
--- /dev/null
@@ -0,0 +1,29 @@
+#NOTE: See '/etc/stubby/stubby.yml.default' for original config file and descriptions
+
+resolution_type: GETDNS_RESOLUTION_STUB
+
+dns_transport_list:
+  - GETDNS_TRANSPORT_TLS
+
+tls_authentication: GETDNS_AUTHENTICATION_REQUIRED
+
+tls_query_padding_blocksize: 128
+
+edns_client_subnet_private : 0
+
+idle_timeout: 10000
+
+listen_addresses:
+  - 127.0.0.1@5453
+  -  0::1@5453
+
+round_robin_upstreams: 0
+
+upstream_recursive_servers:
+# Quad 9 IPv6
+  - address_data: 2620:fe::10
+    tls_auth_name: "dns.quad9.net"
+# IPv4 addresses
+# Quad 9 service
+  - address_data: 9.9.9.10
+    tls_auth_name: "dns.quad9.net"
index 0c4ec19ce87b67319459c223b8348fa6b7877046..e23bd9210610915f732329fe806a727ef4e08af7 100644 (file)
@@ -8,20 +8,22 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=stunnel
-PKG_VERSION:=5.40
-PKG_RELEASE:=1
+PKG_VERSION:=5.44
+PKG_RELEASE:=4
 
 PKG_LICENSE:=GPL-2.0+
-PKG_MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
+PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
 PKG_LICENSE_FILES:=COPYING COPYRIGHT.GPL
 
 PKG_SOURCE_URL:= \
        http://ftp.nluug.nl/pub/networking/stunnel/ \
-       http://www.usenix.org.uk/mirrors/stunnel/
+       http://www.usenix.org.uk/mirrors/stunnel/ \
+       https://www.stunnel.org/downloads/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=23acdb390326ffd507d90f8984ecc90e0d9993f6bd6eac1d0a642456565c45ff
+PKG_HASH:=990a325dbb47d77d88772dd02fbbd27d91b1fea3ece76c9ff4461eca93f12299
 
 PKG_FIXUP:=autoreconf
+PKG_FIXUP:=patch-libtool
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
@@ -44,6 +46,7 @@ endef
 
 define Package/stunnel/conffiles
 /etc/stunnel/stunnel.conf
+/etc/config/stunnel
 endef
 
 
@@ -52,7 +55,8 @@ CONFIGURE_ARGS+= \
        --with-threads=pthread \
        --with-ssl=$(STAGING_DIR)/usr \
        --disable-libwrap \
-       --disable-systemd
+       --disable-systemd \
+       --disable-fips
 
 ifeq ($(CONFIG_IPV6),n)
 CONFIGURE_ARGS+= \
@@ -74,6 +78,8 @@ define Package/stunnel/install
        $(INSTALL_CONF) ./files/stunnel.conf $(1)/etc/stunnel/stunnel.conf
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/stunnel.init $(1)/etc/init.d/stunnel
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/stunnel.uci $(1)/etc/config/stunnel
 endef
 
 $(eval $(call BuildPackage,stunnel))
index e622205b8361e756570450da7af256138303f850..a1772e1593af6c27c5d59bf680c04b18ef3d22f9 100644 (file)
@@ -4,9 +4,177 @@
 START=90
 USE_PROCD=1
 
+PID_FILE="/var/run/stunnel.pid"
+CONF_FILE="/tmp/stunnel.conf"
+BIN="/usr/bin/stunnel"
+SERVICE_SECTION_FOUND=0
+
+global_defs() {
+       local debug compression
+
+       config_get alt_config_file 'globals' alt_config_file
+       [ -z "$alt_config_file" ] || return 0
+
+       # Set default settings
+       printf "foreground = yes\n" >> "$CONF_FILE"
+       printf "pid = %s\n" "$PID_FILE" >> "$CONF_FILE"
+       printf "syslog = yes\n" >> "$CONF_FILE"
+
+       config_get debug 'globals' debug '5'
+       printf "debug = %s\n" "$debug" >> "$CONF_FILE"
+
+       config_get compression 'globals' compression
+       [ -z "$compression" ] || printf "compression = %s\n" "$compression" >> "$CONF_FILE"
+}
+
+print_options() {
+       local config=$1
+       shift
+       for opt in "$@"; do
+               local $opt
+               local value
+               local is_boolean=0
+
+               if [ "${opt:0:5}" == "bool_" ]; then
+                       opt="${opt:5}"
+                       is_boolean=1
+               fi
+
+               config_get "value" "$config" "$opt"
+               [ -z "$value" ] || {
+                       if [ "$value" = '1' ] && [ "$is_boolean" -eq "1" ]; then
+                               value="yes"
+                       elif [ "$value" = '0' ] && [ "$is_boolean" -eq "1" ] ; then
+                               value="no"
+                       fi
+                       printf "%s = %s\n" "$opt" "$value" >> "$CONF_FILE"
+               }
+       done
+}
+
+print_list() {
+       local config=$1
+       shift
+       for opt in "$@"; do
+               local $opt
+               local elements
+               config_get "elements" "$config" "$opt"
+               for element in $elements; do
+                       printf "%s = %s\n" "$opt" "$element" >> "$CONF_FILE"
+               done
+       done
+}
+
+print_list_colon() {
+       local config=$1
+       local value
+       shift
+       for opt in "$@"; do
+               local $opt
+               local elements
+               config_get "elements" "$config" "$opt"
+               for element in $elements; do
+                       value="${value}:${element}"
+               done
+               printf "%s = %s\n" "$opt" "${value#*:}" >> "$CONF_FILE"
+       done
+}
+
+service_section() {
+       local cfg="$1"
+       local accept_host accept_port enabled
+
+       config_get_bool enabled "$cfg" 'enabled' '1'
+       [ ${enabled} -gt 0 ] || return 0
+
+       SERVICE_SECTION_FOUND=1
+       printf "\n" >> "$CONF_FILE"
+       printf "[%s]\n" "$cfg" >> "$CONF_FILE"
+
+       config_get accept_host "$cfg" accept_host 'localhost'
+       config_get accept_port "$cfg" accept_port
+       printf "accept = %s:%s\n" "$accept_host" "$accept_port" >> "$CONF_FILE"
+
+       print_options "$cfg" CApath \
+               CAfile \
+               cert \
+               CRLpath \
+               CRLfile \
+               curve \
+               logId \
+               debug \
+               engineId \
+               engineNum \
+               failover \
+               ident \
+               key \
+               local \
+               PSKidentity \
+               PSKsecrets \
+               sslVersion \
+               TIMEOUTbusy \
+               TIMEOUTclose \
+               TIMEOUTconnect \
+               TIMEOUTidle \
+               bool_delay \
+               bool_libwrap \
+               bool_reset \
+               bool_requireCert \
+               bool_verifyChain \
+               bool_verifyPeer \
+               bool_client
+
+       print_list "$cfg" checkEmail \
+               checkHost \
+               checkIP \
+               connect \
+               options
+
+       print_list_colon "$cfg" ciphers
+}
+
+process_config() {
+       local alt_config_file
+
+       rm -f "$CONF_FILE"
+
+       # First line
+       printf "; STunnel configuration file generated by uci\n" > "$CONF_FILE"
+       printf "; Written %s\n\n" "$(date +'%c')" >> "$CONF_FILE"
+
+       [ -f /etc/config/stunnel ] || return 0
+
+       config_load stunnel
+       global_defs
+
+       # If "alt_config_file" specified, use that instead
+       [ -n "$alt_config_file" ] && [ -f "$alt_config_file" ] && {
+               rm -f "$CONF_FILE"
+               # Symlink "alt_config_file" since it's a bit easier and safer
+               ln -s "$alt_config_file" "$CONF_FILE"
+               # Set section found to start service user hopfully knows what you does
+               SERVICE_SECTION_FOUND=1
+               return 0
+       }
+
+       config_foreach service_section service
+}
+
+service_triggers() {
+       procd_add_reload_trigger "stunnel"
+}
+
 start_service() {
-       procd_open_instance
-       procd_set_param command /usr/bin/stunnel /etc/stunnel/stunnel.conf
-       procd_set_param respawn # respawn automatically if something died
-       procd_close_instance
+       process_config
+
+       if [ "$SERVICE_SECTION_FOUND" = 1 ]; then
+               procd_open_instance
+               procd_set_param command "$BIN"
+               procd_append_param command "$CONF_FILE"
+               procd_set_param respawn
+               procd_set_param file "$CONF_FILE"
+               procd_close_instance
+       else
+               logger -t stunnel -p daemon.info "No uci service section enabled or found!"
+       fi
 }
diff --git a/net/stunnel/files/stunnel.uci b/net/stunnel/files/stunnel.uci
new file mode 100644 (file)
index 0000000..6fad1c6
--- /dev/null
@@ -0,0 +1,10 @@
+config globals 'globals'
+       option alt_config_file '/etc/stunnel/stunnel.conf'
+       option debug '5'
+
+config service 'dummy'
+       option client '1'
+       option accept_host 'localhost'
+       option accept_port '6000'
+       list connect 'localhost:6001'
+
index 976ca3b1142633a8c267affd40066eb6b3481e63..94bc0566382fcf1e8202bb0b7fa1365db913cc1b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2016 OpenWrt.org
+# Copyright (C) 2007-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=subversion
-PKG_RELEASE:=2
+PKG_RELEASE:=1
 PKG_VERSION:=1.9.7
 PKG_SOURCE_URL:=@APACHE/subversion
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_HASH:=c3b118333ce12e501d509e66bb0a47bcc34d053990acab45559431ac3e491623
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=
+PKG_MAINTAINER:=Val Kulkov <val.kulkov@gmail.com>
 
 PKG_FIXUP:=autoreconf
 PKG_MACRO_PATHS:=build/ac-macros
diff --git a/net/sysrepo/Config_libsysrepo.in b/net/sysrepo/Config_libsysrepo.in
new file mode 100644 (file)
index 0000000..42de84a
--- /dev/null
@@ -0,0 +1,23 @@
+config SYSREPO_PYTHON
+       bool "Generate sysrepo Python2 bindings"
+       depends on PACKAGE_libsysrepo
+       select SYSREPO_BINDINGS
+       default n
+       help
+               This option generates the Python2 language bindings.
+               Disabled by default.
+
+config SYSREPO_LUA
+       bool "Generate sysrepo Lua5.1 bindings"
+       depends on PACKAGE_libsysrepo
+       select SYSREPO_BINDINGS
+       default n
+       help
+               This option generates the Lua5.1 language bindings.
+               Disabled by default.
+
+config SYSREPO_BINDINGS
+       bool
+       depends on PACKAGE_libsysrepo
+       default n
+
diff --git a/net/sysrepo/Makefile b/net/sysrepo/Makefile
new file mode 100644 (file)
index 0000000..267abcd
--- /dev/null
@@ -0,0 +1,181 @@
+#
+# Copyright (C) 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_LICENSE:=ASL-2.0
+PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
+
+PKG_NAME:=sysrepo
+PKG_VERSION:=0.7.3
+PKG_RELEASE:=2
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=91e65c6f7d8826197b2806ab6d5466d16882b07f
+PKG_MIRROR_HASH:=1662c158d5eac3e6c9f400517bd02b1967632f3d8b3516523da669bbd1c28c4
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/sysrepo/sysrepo.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
+
+PKG_BUILD_ROOT:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)
+
+CMAKE_INSTALL:=1
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+ifeq ($(CONFIG_SYSREPO_PYTHON),y)
+$(call include_mk, python-package.mk)
+endif
+
+define Package/libsysrepo/config
+       source "$(SOURCE)/Config_libsysrepo.in"
+endef
+
+PKG_BUILD_DEPENDS:=+SYSREPO_BINDINGS:swig/host
+
+define Package/libsysrepo
+  SECTION:=utils
+  CATEGORY:=Utilities
+  URL:=$(PKG_SOURCE_URL)
+  TITLE:=YANG-based data store library
+  DEPENDS:=+libyang +libprotobuf-c +libev +libredblack +librt +SYSREPO_BINDINGS:libstdcpp +SYSREPO_PYTHON:python-base +SYSREPO_LUA:lua
+  MENU:=1
+endef
+
+define Package/sysrepo
+  SECTION:=utils
+  CATEGORY:=Utilities
+  URL:=$(PKG_SOURCE_URL)
+  TITLE:=YANG-based data store daemon and plugin
+  DEPENDS:=+libsysrepo
+endef
+
+define Package/sysrepoctl
+  SECTION:=utils
+  CATEGORY:=Utilities
+  URL:=$(PKG_SOURCE_URL)
+  TITLE:=sysrepo cli tool
+  DEPENDS:=+libsysrepo
+endef
+
+define Package/sysrepocfg
+  SECTION:=utils
+  CATEGORY:=Utilities
+  URL:=$(PKG_SOURCE_URL)
+  TITLE:=sysrepo configuration tool
+  DEPENDS:=+libsysrepo
+endef
+
+define Package/sysrepo/description
+Sysrepo is an YANG-based configuration and operational state data store for Unix/Linux applications.
+endef
+
+CMAKE_OPTIONS += \
+       -DCMAKE_BUILD_TYPE:STRING=Release \
+       -DUSE_AVL_LIB:BOOL=FALSE \
+       -DENABLE_TESTS:BOOL=FALSE \
+       -DBUILD_EXAMPLES:BOOL=FALSE \
+       -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=TRUE \
+       -DGEN_LANGUAGE_BINDINGS:BOOL=FALSE \
+       -DGEN_PYTHON_BINDINGS=0 \
+       -DGEN_LUA_BINDINGS=0 \
+       -DREPOSITORY_LOC:PATH=/etc/sysrepo \
+       -DCMAKE_INSTALL_PREFIX:PATH=/usr \
+       -DENABLE_NACM:BOOL=FALSE \
+       -DREQUEST_TIMEOUT=6 \
+       -DLONG_REQUEST_TIMEOUT=30 \
+       -DCOMMIT_VERIFY_TIMEOUT=20 \
+       -DOPER_DATA_PROVIDE_TIMEOUT=4 \
+       -DNOTIF_AGE_TIMEOUT=120 \
+       -DNOTIF_TIME_WINDOW=20 \
+       -DUSE_SR_MEM_MGMT=0
+
+ifeq ($(CONFIG_SYSREPO_LUA),y)
+CMAKE_OPTIONS += \
+       -DGEN_LUA_BINDINGS:BOOL=TRUE \
+       -DGEN_LUA_VERSION=5.1
+endif
+
+ifeq ($(CONFIG_SYSREPO_PYTHON),y)
+CMAKE_OPTIONS += \
+       -DGEN_PYTHON_BINDINGS:BOOL=TRUE \
+       -DGEN_PYTHON_VERSION=2
+endif
+
+ifeq ($(CONFIG_SYSREPO_BINDINGS),y)
+CMAKE_OPTIONS += \
+       -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=FALSE \
+       -DGEN_LANGUAGE_BINDINGS:BOOL=TRUE \
+       -DSWIG_DIR=$(STAGING_DIR)/host/share/swig
+endif
+
+define Package/libsysrepo/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/src/libsysrepo.so* $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/etc/sysrepo/yang/internal
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-module-dependencies.yang $(1)/etc/sysrepo/yang/internal
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-notification-store.yang $(1)/etc/sysrepo/yang/internal
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/yang/sysrepo-persistent-data.yang $(1)/etc/sysrepo/yang/internal
+
+       $(INSTALL_DIR) $(1)/etc/sysrepo/yang
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-acm@2012-02-22.yang $(1)/etc/sysrepo/yang/ietf-netconf-acm@2012-02-22.yang
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf-notifications.yang $(1)/etc/sysrepo/yang/ietf-netconf-notifications@2012-02-06..yang
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/nc-notifications.yang $(1)/etc/sysrepo/yang/nc-notifications@2008-07-14.yang
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/notifications.yang $(1)/etc/sysrepo/yang/notifications@2008-07-14.yang
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/yang/ietf-netconf@2011-06-01.yang $(1)/etc/sysrepo/yang/ietf-netconf@2011-06-01.yang
+
+       $(INSTALL_DIR) $(1)/etc/sysrepo/data/internal
+       $(INSTALL_DIR) $(1)/etc/sysrepo/data/notifications
+
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo
+
+ifeq ($(CONFIG_SYSREPO_PYTHON),y)
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/swig/libSysrepo-cpp.so* $(1)/usr/lib
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python2/libsysrepoPython2.py $(1)$(PYTHON_PKG_DIR)
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python2/_libsysrepoPython2.so $(1)$(PYTHON_PKG_DIR)
+endif
+
+ifeq ($(CONFIG_SYSREPO_LUA),y)
+       $(INSTALL_DIR) $(1)/usr/lib/lua/
+       $(CP) $(PKG_BUILD_DIR)/swig/lua/libSysrepo_Lua.so* $(1)/usr/lib
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/lua/libsysrepoLua.so $(1)/usr/lib/lua/libsysrepoLua.so
+endif
+endef
+
+define Package/sysrepo/install
+       $(INSTALL_DIR) $(1)/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepod $(1)/bin/
+
+       $(INSTALL_DIR) $(1)/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepo-plugind $(1)/bin/
+
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_BIN) ./files/sysrepo.init $(1)/etc/init.d/sysrepo
+endef
+
+define Package/sysrepoctl/install
+       $(INSTALL_DIR) $(1)/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepoctl $(1)/bin/
+endef
+
+define Package/sysrepocfg/install
+       $(INSTALL_DIR) $(1)/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysrepocfg $(1)/bin/
+endef
+
+$(eval $(call BuildPackage,libsysrepo))
+$(eval $(call BuildPackage,sysrepo))
+$(eval $(call BuildPackage,sysrepoctl))
+$(eval $(call BuildPackage,sysrepocfg))
diff --git a/net/sysrepo/files/libsysrepo.default b/net/sysrepo/files/libsysrepo.default
new file mode 100644 (file)
index 0000000..35b56f6
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# Warning, problems can occur if the device restarts in the middle of this uci-default script
+
+if [ -x /bin/sysrepoctl ]; then
+       match=$(sysrepoctl -l | grep "ietf-netconf-acm ")
+       if [ ! "$match" ]; then
+               sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-acm@2012-02-22.yang -p 644
+       fi
+
+       match=$(sysrepoctl -l | grep "ietf-netconf-notifications ")
+       if [ ! "$match" ]; then
+               sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-notifications@2012-02-06..yang -p 600
+       fi
+
+       match=$(sysrepoctl -l | grep "nc-notifications ")
+       if [ ! "$match" ]; then
+               sysrepoctl --install --yang=/etc/sysrepo/yang/nc-notifications@2008-07-14.yang -p 666
+       fi
+
+       match=$(sysrepoctl -l | grep "notifications ")
+       if [ ! "$match" ]; then
+               sysrepoctl --install --yang=/etc/sysrepo/yang/notifications@2008-07-14.yang -p 666
+       fi
+
+       match=$(sysrepoctl -l | grep "ietf-netconf ")
+       if [ ! "$match" ]; then
+               sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf@2011-06-01.yang -p 600
+       fi
+fi
+
+exit 0
diff --git a/net/sysrepo/files/sysrepo.init b/net/sysrepo/files/sysrepo.init
new file mode 100644 (file)
index 0000000..abfcd66
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh /etc/rc.common
+
+START=60
+STOP=10
+
+USE_PROCD=1
+PROG_DEAMON=/bin/sysrepod
+PROG_PLUGIN=/bin/sysrepo-plugind
+
+start_service() {
+    procd_open_instance
+    procd_set_param command ${PROG_DEAMON}
+    procd_append_param command -d -l 0
+    procd_set_param respawn
+    procd_close_instance
+
+    procd_open_instance
+    procd_set_param command ${PROG_PLUGIN}
+    procd_append_param command -d -l 0
+    procd_set_param respawn
+    procd_close_instance
+}
+
+stop_service()
+{
+    kill -9 `ps | grep netopeer2-server | grep -v grep | awk '{print $1}'` >/dev/null 2>&1
+    service_stop ${PROG_PLUGIN}
+    service_stop ${PROG_DEAMON}
+    rm -rf /var/run/sysrepo-subscriptions/*
+}
diff --git a/net/sysrepo/patches/001-protobuf-remove-protoc-command-from-cmake-file b/net/sysrepo/patches/001-protobuf-remove-protoc-command-from-cmake-file
new file mode 100644 (file)
index 0000000..cb742ce
--- /dev/null
@@ -0,0 +1,14804 @@
+Index: sysrepo-7aa2f18d234267403147df92c0005c871f0aa840/src/CMakeLists.txt
+===================================================================
+--- sysrepo-7aa2f18d234267403147df92c0005c871f0aa840.orig/src/CMakeLists.txt
++++ sysrepo-7aa2f18d234267403147df92c0005c871f0aa840/src/CMakeLists.txt
+@@ -21,14 +21,6 @@ set(GENERATED_PROTO_H "${COMMON_BIN_DIR}
+ set(GENERATED_PROTO_C "${COMMON_BIN_DIR}/${PROTO_NAME}.pb-c.c")
+ get_filename_component(ABS_PATH ${PROTO_FILE} PATH)
+-add_custom_command(
+-    OUTPUT "${GENERATED_PROTO_C}"
+-           "${GENERATED_PROTO_H}"
+-   COMMAND  ${PROTOBUFC_PROTOC_EXECUTABLE}
+-   ARGS --c_out ${COMMON_BIN_DIR} -I ${ABS_PATH} ${PROTO_FILE}
+-   DEPENDS ${PROTO_FILE}
+-   COMMENT "Running C protocol buffer compiler on ${PROTO_FILE}"
+-   VERBATIM )
+ configure_file("${COMMON_DIR}/sr_constants.h.in" "${COMMON_BIN_DIR}/sr_constants.h" ESCAPE_QUOTES @ONLY)
+Index: sysrepo-7aa2f18d234267403147df92c0005c871f0aa840/src/common/sysrepo.pb-c.c
+===================================================================
+--- /dev/null
++++ sysrepo-7aa2f18d234267403147df92c0005c871f0aa840/src/common/sysrepo.pb-c.c
+@@ -0,0 +1,10537 @@
++/* Generated by the protocol buffer compiler.  DO NOT EDIT! */
++/* Generated from: sysrepo.proto */
++
++/* Do not generate deprecated warnings for self */
++#ifndef PROTOBUF_C__NO_DEPRECATED
++#define PROTOBUF_C__NO_DEPRECATED
++#endif
++
++#include "sysrepo.pb-c.h"
++void   sr__value__init
++                     (Sr__Value         *message)
++{
++  static Sr__Value init_value = SR__VALUE__INIT;
++  *message = init_value;
++}
++size_t sr__value__get_packed_size
++                     (const Sr__Value *message)
++{
++  assert(message->base.descriptor == &sr__value__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__value__pack
++                     (const Sr__Value *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__value__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__value__pack_to_buffer
++                     (const Sr__Value *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__value__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__Value *
++       sr__value__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__Value *)
++     protobuf_c_message_unpack (&sr__value__descriptor,
++                                allocator, len, data);
++}
++void   sr__value__free_unpacked
++                     (Sr__Value *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__value__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__node__init
++                     (Sr__Node         *message)
++{
++  static Sr__Node init_value = SR__NODE__INIT;
++  *message = init_value;
++}
++size_t sr__node__get_packed_size
++                     (const Sr__Node *message)
++{
++  assert(message->base.descriptor == &sr__node__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__node__pack
++                     (const Sr__Node *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__node__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__node__pack_to_buffer
++                     (const Sr__Node *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__node__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__Node *
++       sr__node__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__Node *)
++     protobuf_c_message_unpack (&sr__node__descriptor,
++                                allocator, len, data);
++}
++void   sr__node__free_unpacked
++                     (Sr__Node *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__node__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__error__init
++                     (Sr__Error         *message)
++{
++  static Sr__Error init_value = SR__ERROR__INIT;
++  *message = init_value;
++}
++size_t sr__error__get_packed_size
++                     (const Sr__Error *message)
++{
++  assert(message->base.descriptor == &sr__error__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__error__pack
++                     (const Sr__Error *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__error__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__error__pack_to_buffer
++                     (const Sr__Error *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__error__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__Error *
++       sr__error__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__Error *)
++     protobuf_c_message_unpack (&sr__error__descriptor,
++                                allocator, len, data);
++}
++void   sr__error__free_unpacked
++                     (Sr__Error *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__error__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__session_start_req__init
++                     (Sr__SessionStartReq         *message)
++{
++  static Sr__SessionStartReq init_value = SR__SESSION_START_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__session_start_req__get_packed_size
++                     (const Sr__SessionStartReq *message)
++{
++  assert(message->base.descriptor == &sr__session_start_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__session_start_req__pack
++                     (const Sr__SessionStartReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__session_start_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__session_start_req__pack_to_buffer
++                     (const Sr__SessionStartReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__session_start_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SessionStartReq *
++       sr__session_start_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SessionStartReq *)
++     protobuf_c_message_unpack (&sr__session_start_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__session_start_req__free_unpacked
++                     (Sr__SessionStartReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__session_start_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__session_start_resp__init
++                     (Sr__SessionStartResp         *message)
++{
++  static Sr__SessionStartResp init_value = SR__SESSION_START_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__session_start_resp__get_packed_size
++                     (const Sr__SessionStartResp *message)
++{
++  assert(message->base.descriptor == &sr__session_start_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__session_start_resp__pack
++                     (const Sr__SessionStartResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__session_start_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__session_start_resp__pack_to_buffer
++                     (const Sr__SessionStartResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__session_start_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SessionStartResp *
++       sr__session_start_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SessionStartResp *)
++     protobuf_c_message_unpack (&sr__session_start_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__session_start_resp__free_unpacked
++                     (Sr__SessionStartResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__session_start_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__session_stop_req__init
++                     (Sr__SessionStopReq         *message)
++{
++  static Sr__SessionStopReq init_value = SR__SESSION_STOP_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__session_stop_req__get_packed_size
++                     (const Sr__SessionStopReq *message)
++{
++  assert(message->base.descriptor == &sr__session_stop_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__session_stop_req__pack
++                     (const Sr__SessionStopReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__session_stop_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__session_stop_req__pack_to_buffer
++                     (const Sr__SessionStopReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__session_stop_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SessionStopReq *
++       sr__session_stop_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SessionStopReq *)
++     protobuf_c_message_unpack (&sr__session_stop_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__session_stop_req__free_unpacked
++                     (Sr__SessionStopReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__session_stop_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__session_stop_resp__init
++                     (Sr__SessionStopResp         *message)
++{
++  static Sr__SessionStopResp init_value = SR__SESSION_STOP_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__session_stop_resp__get_packed_size
++                     (const Sr__SessionStopResp *message)
++{
++  assert(message->base.descriptor == &sr__session_stop_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__session_stop_resp__pack
++                     (const Sr__SessionStopResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__session_stop_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__session_stop_resp__pack_to_buffer
++                     (const Sr__SessionStopResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__session_stop_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SessionStopResp *
++       sr__session_stop_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SessionStopResp *)
++     protobuf_c_message_unpack (&sr__session_stop_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__session_stop_resp__free_unpacked
++                     (Sr__SessionStopResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__session_stop_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__session_refresh_req__init
++                     (Sr__SessionRefreshReq         *message)
++{
++  static Sr__SessionRefreshReq init_value = SR__SESSION_REFRESH_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__session_refresh_req__get_packed_size
++                     (const Sr__SessionRefreshReq *message)
++{
++  assert(message->base.descriptor == &sr__session_refresh_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__session_refresh_req__pack
++                     (const Sr__SessionRefreshReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__session_refresh_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__session_refresh_req__pack_to_buffer
++                     (const Sr__SessionRefreshReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__session_refresh_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SessionRefreshReq *
++       sr__session_refresh_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SessionRefreshReq *)
++     protobuf_c_message_unpack (&sr__session_refresh_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__session_refresh_req__free_unpacked
++                     (Sr__SessionRefreshReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__session_refresh_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__session_refresh_resp__init
++                     (Sr__SessionRefreshResp         *message)
++{
++  static Sr__SessionRefreshResp init_value = SR__SESSION_REFRESH_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__session_refresh_resp__get_packed_size
++                     (const Sr__SessionRefreshResp *message)
++{
++  assert(message->base.descriptor == &sr__session_refresh_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__session_refresh_resp__pack
++                     (const Sr__SessionRefreshResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__session_refresh_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__session_refresh_resp__pack_to_buffer
++                     (const Sr__SessionRefreshResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__session_refresh_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SessionRefreshResp *
++       sr__session_refresh_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SessionRefreshResp *)
++     protobuf_c_message_unpack (&sr__session_refresh_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__session_refresh_resp__free_unpacked
++                     (Sr__SessionRefreshResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__session_refresh_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__session_check_req__init
++                     (Sr__SessionCheckReq         *message)
++{
++  static Sr__SessionCheckReq init_value = SR__SESSION_CHECK_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__session_check_req__get_packed_size
++                     (const Sr__SessionCheckReq *message)
++{
++  assert(message->base.descriptor == &sr__session_check_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__session_check_req__pack
++                     (const Sr__SessionCheckReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__session_check_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__session_check_req__pack_to_buffer
++                     (const Sr__SessionCheckReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__session_check_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SessionCheckReq *
++       sr__session_check_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SessionCheckReq *)
++     protobuf_c_message_unpack (&sr__session_check_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__session_check_req__free_unpacked
++                     (Sr__SessionCheckReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__session_check_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__session_check_resp__init
++                     (Sr__SessionCheckResp         *message)
++{
++  static Sr__SessionCheckResp init_value = SR__SESSION_CHECK_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__session_check_resp__get_packed_size
++                     (const Sr__SessionCheckResp *message)
++{
++  assert(message->base.descriptor == &sr__session_check_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__session_check_resp__pack
++                     (const Sr__SessionCheckResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__session_check_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__session_check_resp__pack_to_buffer
++                     (const Sr__SessionCheckResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__session_check_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SessionCheckResp *
++       sr__session_check_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SessionCheckResp *)
++     protobuf_c_message_unpack (&sr__session_check_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__session_check_resp__free_unpacked
++                     (Sr__SessionCheckResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__session_check_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__session_switch_ds_req__init
++                     (Sr__SessionSwitchDsReq         *message)
++{
++  static Sr__SessionSwitchDsReq init_value = SR__SESSION_SWITCH_DS_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__session_switch_ds_req__get_packed_size
++                     (const Sr__SessionSwitchDsReq *message)
++{
++  assert(message->base.descriptor == &sr__session_switch_ds_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__session_switch_ds_req__pack
++                     (const Sr__SessionSwitchDsReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__session_switch_ds_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__session_switch_ds_req__pack_to_buffer
++                     (const Sr__SessionSwitchDsReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__session_switch_ds_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SessionSwitchDsReq *
++       sr__session_switch_ds_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SessionSwitchDsReq *)
++     protobuf_c_message_unpack (&sr__session_switch_ds_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__session_switch_ds_req__free_unpacked
++                     (Sr__SessionSwitchDsReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__session_switch_ds_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__session_switch_ds_resp__init
++                     (Sr__SessionSwitchDsResp         *message)
++{
++  static Sr__SessionSwitchDsResp init_value = SR__SESSION_SWITCH_DS_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__session_switch_ds_resp__get_packed_size
++                     (const Sr__SessionSwitchDsResp *message)
++{
++  assert(message->base.descriptor == &sr__session_switch_ds_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__session_switch_ds_resp__pack
++                     (const Sr__SessionSwitchDsResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__session_switch_ds_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__session_switch_ds_resp__pack_to_buffer
++                     (const Sr__SessionSwitchDsResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__session_switch_ds_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SessionSwitchDsResp *
++       sr__session_switch_ds_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SessionSwitchDsResp *)
++     protobuf_c_message_unpack (&sr__session_switch_ds_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__session_switch_ds_resp__free_unpacked
++                     (Sr__SessionSwitchDsResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__session_switch_ds_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__session_set_opts_req__init
++                     (Sr__SessionSetOptsReq         *message)
++{
++  static Sr__SessionSetOptsReq init_value = SR__SESSION_SET_OPTS_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__session_set_opts_req__get_packed_size
++                     (const Sr__SessionSetOptsReq *message)
++{
++  assert(message->base.descriptor == &sr__session_set_opts_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__session_set_opts_req__pack
++                     (const Sr__SessionSetOptsReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__session_set_opts_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__session_set_opts_req__pack_to_buffer
++                     (const Sr__SessionSetOptsReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__session_set_opts_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SessionSetOptsReq *
++       sr__session_set_opts_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SessionSetOptsReq *)
++     protobuf_c_message_unpack (&sr__session_set_opts_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__session_set_opts_req__free_unpacked
++                     (Sr__SessionSetOptsReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__session_set_opts_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__session_set_opts_resp__init
++                     (Sr__SessionSetOptsResp         *message)
++{
++  static Sr__SessionSetOptsResp init_value = SR__SESSION_SET_OPTS_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__session_set_opts_resp__get_packed_size
++                     (const Sr__SessionSetOptsResp *message)
++{
++  assert(message->base.descriptor == &sr__session_set_opts_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__session_set_opts_resp__pack
++                     (const Sr__SessionSetOptsResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__session_set_opts_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__session_set_opts_resp__pack_to_buffer
++                     (const Sr__SessionSetOptsResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__session_set_opts_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SessionSetOptsResp *
++       sr__session_set_opts_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SessionSetOptsResp *)
++     protobuf_c_message_unpack (&sr__session_set_opts_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__session_set_opts_resp__free_unpacked
++                     (Sr__SessionSetOptsResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__session_set_opts_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__version_verify_req__init
++                     (Sr__VersionVerifyReq         *message)
++{
++  static Sr__VersionVerifyReq init_value = SR__VERSION_VERIFY_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__version_verify_req__get_packed_size
++                     (const Sr__VersionVerifyReq *message)
++{
++  assert(message->base.descriptor == &sr__version_verify_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__version_verify_req__pack
++                     (const Sr__VersionVerifyReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__version_verify_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__version_verify_req__pack_to_buffer
++                     (const Sr__VersionVerifyReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__version_verify_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__VersionVerifyReq *
++       sr__version_verify_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__VersionVerifyReq *)
++     protobuf_c_message_unpack (&sr__version_verify_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__version_verify_req__free_unpacked
++                     (Sr__VersionVerifyReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__version_verify_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__version_verify_resp__init
++                     (Sr__VersionVerifyResp         *message)
++{
++  static Sr__VersionVerifyResp init_value = SR__VERSION_VERIFY_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__version_verify_resp__get_packed_size
++                     (const Sr__VersionVerifyResp *message)
++{
++  assert(message->base.descriptor == &sr__version_verify_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__version_verify_resp__pack
++                     (const Sr__VersionVerifyResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__version_verify_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__version_verify_resp__pack_to_buffer
++                     (const Sr__VersionVerifyResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__version_verify_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__VersionVerifyResp *
++       sr__version_verify_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__VersionVerifyResp *)
++     protobuf_c_message_unpack (&sr__version_verify_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__version_verify_resp__free_unpacked
++                     (Sr__VersionVerifyResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__version_verify_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__schema_revision__init
++                     (Sr__SchemaRevision         *message)
++{
++  static Sr__SchemaRevision init_value = SR__SCHEMA_REVISION__INIT;
++  *message = init_value;
++}
++size_t sr__schema_revision__get_packed_size
++                     (const Sr__SchemaRevision *message)
++{
++  assert(message->base.descriptor == &sr__schema_revision__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__schema_revision__pack
++                     (const Sr__SchemaRevision *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__schema_revision__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__schema_revision__pack_to_buffer
++                     (const Sr__SchemaRevision *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__schema_revision__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SchemaRevision *
++       sr__schema_revision__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SchemaRevision *)
++     protobuf_c_message_unpack (&sr__schema_revision__descriptor,
++                                allocator, len, data);
++}
++void   sr__schema_revision__free_unpacked
++                     (Sr__SchemaRevision *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__schema_revision__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__schema_submodule__init
++                     (Sr__SchemaSubmodule         *message)
++{
++  static Sr__SchemaSubmodule init_value = SR__SCHEMA_SUBMODULE__INIT;
++  *message = init_value;
++}
++size_t sr__schema_submodule__get_packed_size
++                     (const Sr__SchemaSubmodule *message)
++{
++  assert(message->base.descriptor == &sr__schema_submodule__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__schema_submodule__pack
++                     (const Sr__SchemaSubmodule *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__schema_submodule__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__schema_submodule__pack_to_buffer
++                     (const Sr__SchemaSubmodule *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__schema_submodule__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SchemaSubmodule *
++       sr__schema_submodule__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SchemaSubmodule *)
++     protobuf_c_message_unpack (&sr__schema_submodule__descriptor,
++                                allocator, len, data);
++}
++void   sr__schema_submodule__free_unpacked
++                     (Sr__SchemaSubmodule *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__schema_submodule__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__schema__init
++                     (Sr__Schema         *message)
++{
++  static Sr__Schema init_value = SR__SCHEMA__INIT;
++  *message = init_value;
++}
++size_t sr__schema__get_packed_size
++                     (const Sr__Schema *message)
++{
++  assert(message->base.descriptor == &sr__schema__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__schema__pack
++                     (const Sr__Schema *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__schema__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__schema__pack_to_buffer
++                     (const Sr__Schema *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__schema__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__Schema *
++       sr__schema__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__Schema *)
++     protobuf_c_message_unpack (&sr__schema__descriptor,
++                                allocator, len, data);
++}
++void   sr__schema__free_unpacked
++                     (Sr__Schema *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__schema__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__list_schemas_req__init
++                     (Sr__ListSchemasReq         *message)
++{
++  static Sr__ListSchemasReq init_value = SR__LIST_SCHEMAS_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__list_schemas_req__get_packed_size
++                     (const Sr__ListSchemasReq *message)
++{
++  assert(message->base.descriptor == &sr__list_schemas_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__list_schemas_req__pack
++                     (const Sr__ListSchemasReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__list_schemas_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__list_schemas_req__pack_to_buffer
++                     (const Sr__ListSchemasReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__list_schemas_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__ListSchemasReq *
++       sr__list_schemas_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__ListSchemasReq *)
++     protobuf_c_message_unpack (&sr__list_schemas_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__list_schemas_req__free_unpacked
++                     (Sr__ListSchemasReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__list_schemas_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__list_schemas_resp__init
++                     (Sr__ListSchemasResp         *message)
++{
++  static Sr__ListSchemasResp init_value = SR__LIST_SCHEMAS_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__list_schemas_resp__get_packed_size
++                     (const Sr__ListSchemasResp *message)
++{
++  assert(message->base.descriptor == &sr__list_schemas_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__list_schemas_resp__pack
++                     (const Sr__ListSchemasResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__list_schemas_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__list_schemas_resp__pack_to_buffer
++                     (const Sr__ListSchemasResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__list_schemas_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__ListSchemasResp *
++       sr__list_schemas_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__ListSchemasResp *)
++     protobuf_c_message_unpack (&sr__list_schemas_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__list_schemas_resp__free_unpacked
++                     (Sr__ListSchemasResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__list_schemas_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_schema_req__init
++                     (Sr__GetSchemaReq         *message)
++{
++  static Sr__GetSchemaReq init_value = SR__GET_SCHEMA_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__get_schema_req__get_packed_size
++                     (const Sr__GetSchemaReq *message)
++{
++  assert(message->base.descriptor == &sr__get_schema_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_schema_req__pack
++                     (const Sr__GetSchemaReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_schema_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_schema_req__pack_to_buffer
++                     (const Sr__GetSchemaReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_schema_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetSchemaReq *
++       sr__get_schema_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetSchemaReq *)
++     protobuf_c_message_unpack (&sr__get_schema_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_schema_req__free_unpacked
++                     (Sr__GetSchemaReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_schema_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_schema_resp__init
++                     (Sr__GetSchemaResp         *message)
++{
++  static Sr__GetSchemaResp init_value = SR__GET_SCHEMA_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__get_schema_resp__get_packed_size
++                     (const Sr__GetSchemaResp *message)
++{
++  assert(message->base.descriptor == &sr__get_schema_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_schema_resp__pack
++                     (const Sr__GetSchemaResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_schema_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_schema_resp__pack_to_buffer
++                     (const Sr__GetSchemaResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_schema_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetSchemaResp *
++       sr__get_schema_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetSchemaResp *)
++     protobuf_c_message_unpack (&sr__get_schema_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_schema_resp__free_unpacked
++                     (Sr__GetSchemaResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_schema_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_item_req__init
++                     (Sr__GetItemReq         *message)
++{
++  static Sr__GetItemReq init_value = SR__GET_ITEM_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__get_item_req__get_packed_size
++                     (const Sr__GetItemReq *message)
++{
++  assert(message->base.descriptor == &sr__get_item_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_item_req__pack
++                     (const Sr__GetItemReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_item_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_item_req__pack_to_buffer
++                     (const Sr__GetItemReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_item_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetItemReq *
++       sr__get_item_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetItemReq *)
++     protobuf_c_message_unpack (&sr__get_item_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_item_req__free_unpacked
++                     (Sr__GetItemReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_item_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_item_resp__init
++                     (Sr__GetItemResp         *message)
++{
++  static Sr__GetItemResp init_value = SR__GET_ITEM_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__get_item_resp__get_packed_size
++                     (const Sr__GetItemResp *message)
++{
++  assert(message->base.descriptor == &sr__get_item_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_item_resp__pack
++                     (const Sr__GetItemResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_item_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_item_resp__pack_to_buffer
++                     (const Sr__GetItemResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_item_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetItemResp *
++       sr__get_item_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetItemResp *)
++     protobuf_c_message_unpack (&sr__get_item_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_item_resp__free_unpacked
++                     (Sr__GetItemResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_item_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_items_req__init
++                     (Sr__GetItemsReq         *message)
++{
++  static Sr__GetItemsReq init_value = SR__GET_ITEMS_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__get_items_req__get_packed_size
++                     (const Sr__GetItemsReq *message)
++{
++  assert(message->base.descriptor == &sr__get_items_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_items_req__pack
++                     (const Sr__GetItemsReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_items_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_items_req__pack_to_buffer
++                     (const Sr__GetItemsReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_items_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetItemsReq *
++       sr__get_items_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetItemsReq *)
++     protobuf_c_message_unpack (&sr__get_items_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_items_req__free_unpacked
++                     (Sr__GetItemsReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_items_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_items_resp__init
++                     (Sr__GetItemsResp         *message)
++{
++  static Sr__GetItemsResp init_value = SR__GET_ITEMS_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__get_items_resp__get_packed_size
++                     (const Sr__GetItemsResp *message)
++{
++  assert(message->base.descriptor == &sr__get_items_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_items_resp__pack
++                     (const Sr__GetItemsResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_items_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_items_resp__pack_to_buffer
++                     (const Sr__GetItemsResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_items_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetItemsResp *
++       sr__get_items_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetItemsResp *)
++     protobuf_c_message_unpack (&sr__get_items_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_items_resp__free_unpacked
++                     (Sr__GetItemsResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_items_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_subtree_req__init
++                     (Sr__GetSubtreeReq         *message)
++{
++  static Sr__GetSubtreeReq init_value = SR__GET_SUBTREE_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__get_subtree_req__get_packed_size
++                     (const Sr__GetSubtreeReq *message)
++{
++  assert(message->base.descriptor == &sr__get_subtree_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_subtree_req__pack
++                     (const Sr__GetSubtreeReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_subtree_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_subtree_req__pack_to_buffer
++                     (const Sr__GetSubtreeReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_subtree_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetSubtreeReq *
++       sr__get_subtree_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetSubtreeReq *)
++     protobuf_c_message_unpack (&sr__get_subtree_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_subtree_req__free_unpacked
++                     (Sr__GetSubtreeReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_subtree_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_subtree_resp__init
++                     (Sr__GetSubtreeResp         *message)
++{
++  static Sr__GetSubtreeResp init_value = SR__GET_SUBTREE_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__get_subtree_resp__get_packed_size
++                     (const Sr__GetSubtreeResp *message)
++{
++  assert(message->base.descriptor == &sr__get_subtree_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_subtree_resp__pack
++                     (const Sr__GetSubtreeResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_subtree_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_subtree_resp__pack_to_buffer
++                     (const Sr__GetSubtreeResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_subtree_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetSubtreeResp *
++       sr__get_subtree_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetSubtreeResp *)
++     protobuf_c_message_unpack (&sr__get_subtree_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_subtree_resp__free_unpacked
++                     (Sr__GetSubtreeResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_subtree_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_subtrees_req__init
++                     (Sr__GetSubtreesReq         *message)
++{
++  static Sr__GetSubtreesReq init_value = SR__GET_SUBTREES_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__get_subtrees_req__get_packed_size
++                     (const Sr__GetSubtreesReq *message)
++{
++  assert(message->base.descriptor == &sr__get_subtrees_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_subtrees_req__pack
++                     (const Sr__GetSubtreesReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_subtrees_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_subtrees_req__pack_to_buffer
++                     (const Sr__GetSubtreesReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_subtrees_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetSubtreesReq *
++       sr__get_subtrees_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetSubtreesReq *)
++     protobuf_c_message_unpack (&sr__get_subtrees_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_subtrees_req__free_unpacked
++                     (Sr__GetSubtreesReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_subtrees_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_subtrees_resp__init
++                     (Sr__GetSubtreesResp         *message)
++{
++  static Sr__GetSubtreesResp init_value = SR__GET_SUBTREES_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__get_subtrees_resp__get_packed_size
++                     (const Sr__GetSubtreesResp *message)
++{
++  assert(message->base.descriptor == &sr__get_subtrees_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_subtrees_resp__pack
++                     (const Sr__GetSubtreesResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_subtrees_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_subtrees_resp__pack_to_buffer
++                     (const Sr__GetSubtreesResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_subtrees_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetSubtreesResp *
++       sr__get_subtrees_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetSubtreesResp *)
++     protobuf_c_message_unpack (&sr__get_subtrees_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_subtrees_resp__free_unpacked
++                     (Sr__GetSubtreesResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_subtrees_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_subtree_chunk_req__init
++                     (Sr__GetSubtreeChunkReq         *message)
++{
++  static Sr__GetSubtreeChunkReq init_value = SR__GET_SUBTREE_CHUNK_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__get_subtree_chunk_req__get_packed_size
++                     (const Sr__GetSubtreeChunkReq *message)
++{
++  assert(message->base.descriptor == &sr__get_subtree_chunk_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_subtree_chunk_req__pack
++                     (const Sr__GetSubtreeChunkReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_subtree_chunk_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_subtree_chunk_req__pack_to_buffer
++                     (const Sr__GetSubtreeChunkReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_subtree_chunk_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetSubtreeChunkReq *
++       sr__get_subtree_chunk_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetSubtreeChunkReq *)
++     protobuf_c_message_unpack (&sr__get_subtree_chunk_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_subtree_chunk_req__free_unpacked
++                     (Sr__GetSubtreeChunkReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_subtree_chunk_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_subtree_chunk_resp__init
++                     (Sr__GetSubtreeChunkResp         *message)
++{
++  static Sr__GetSubtreeChunkResp init_value = SR__GET_SUBTREE_CHUNK_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__get_subtree_chunk_resp__get_packed_size
++                     (const Sr__GetSubtreeChunkResp *message)
++{
++  assert(message->base.descriptor == &sr__get_subtree_chunk_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_subtree_chunk_resp__pack
++                     (const Sr__GetSubtreeChunkResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_subtree_chunk_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_subtree_chunk_resp__pack_to_buffer
++                     (const Sr__GetSubtreeChunkResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_subtree_chunk_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetSubtreeChunkResp *
++       sr__get_subtree_chunk_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetSubtreeChunkResp *)
++     protobuf_c_message_unpack (&sr__get_subtree_chunk_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_subtree_chunk_resp__free_unpacked
++                     (Sr__GetSubtreeChunkResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_subtree_chunk_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__set_item_req__init
++                     (Sr__SetItemReq         *message)
++{
++  static Sr__SetItemReq init_value = SR__SET_ITEM_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__set_item_req__get_packed_size
++                     (const Sr__SetItemReq *message)
++{
++  assert(message->base.descriptor == &sr__set_item_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__set_item_req__pack
++                     (const Sr__SetItemReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__set_item_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__set_item_req__pack_to_buffer
++                     (const Sr__SetItemReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__set_item_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SetItemReq *
++       sr__set_item_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SetItemReq *)
++     protobuf_c_message_unpack (&sr__set_item_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__set_item_req__free_unpacked
++                     (Sr__SetItemReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__set_item_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__set_item_resp__init
++                     (Sr__SetItemResp         *message)
++{
++  static Sr__SetItemResp init_value = SR__SET_ITEM_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__set_item_resp__get_packed_size
++                     (const Sr__SetItemResp *message)
++{
++  assert(message->base.descriptor == &sr__set_item_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__set_item_resp__pack
++                     (const Sr__SetItemResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__set_item_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__set_item_resp__pack_to_buffer
++                     (const Sr__SetItemResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__set_item_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SetItemResp *
++       sr__set_item_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SetItemResp *)
++     protobuf_c_message_unpack (&sr__set_item_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__set_item_resp__free_unpacked
++                     (Sr__SetItemResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__set_item_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__set_item_str_req__init
++                     (Sr__SetItemStrReq         *message)
++{
++  static Sr__SetItemStrReq init_value = SR__SET_ITEM_STR_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__set_item_str_req__get_packed_size
++                     (const Sr__SetItemStrReq *message)
++{
++  assert(message->base.descriptor == &sr__set_item_str_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__set_item_str_req__pack
++                     (const Sr__SetItemStrReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__set_item_str_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__set_item_str_req__pack_to_buffer
++                     (const Sr__SetItemStrReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__set_item_str_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SetItemStrReq *
++       sr__set_item_str_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SetItemStrReq *)
++     protobuf_c_message_unpack (&sr__set_item_str_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__set_item_str_req__free_unpacked
++                     (Sr__SetItemStrReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__set_item_str_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__set_item_str_resp__init
++                     (Sr__SetItemStrResp         *message)
++{
++  static Sr__SetItemStrResp init_value = SR__SET_ITEM_STR_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__set_item_str_resp__get_packed_size
++                     (const Sr__SetItemStrResp *message)
++{
++  assert(message->base.descriptor == &sr__set_item_str_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__set_item_str_resp__pack
++                     (const Sr__SetItemStrResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__set_item_str_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__set_item_str_resp__pack_to_buffer
++                     (const Sr__SetItemStrResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__set_item_str_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SetItemStrResp *
++       sr__set_item_str_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SetItemStrResp *)
++     protobuf_c_message_unpack (&sr__set_item_str_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__set_item_str_resp__free_unpacked
++                     (Sr__SetItemStrResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__set_item_str_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__delete_item_req__init
++                     (Sr__DeleteItemReq         *message)
++{
++  static Sr__DeleteItemReq init_value = SR__DELETE_ITEM_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__delete_item_req__get_packed_size
++                     (const Sr__DeleteItemReq *message)
++{
++  assert(message->base.descriptor == &sr__delete_item_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__delete_item_req__pack
++                     (const Sr__DeleteItemReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__delete_item_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__delete_item_req__pack_to_buffer
++                     (const Sr__DeleteItemReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__delete_item_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__DeleteItemReq *
++       sr__delete_item_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__DeleteItemReq *)
++     protobuf_c_message_unpack (&sr__delete_item_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__delete_item_req__free_unpacked
++                     (Sr__DeleteItemReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__delete_item_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__delete_item_resp__init
++                     (Sr__DeleteItemResp         *message)
++{
++  static Sr__DeleteItemResp init_value = SR__DELETE_ITEM_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__delete_item_resp__get_packed_size
++                     (const Sr__DeleteItemResp *message)
++{
++  assert(message->base.descriptor == &sr__delete_item_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__delete_item_resp__pack
++                     (const Sr__DeleteItemResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__delete_item_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__delete_item_resp__pack_to_buffer
++                     (const Sr__DeleteItemResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__delete_item_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__DeleteItemResp *
++       sr__delete_item_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__DeleteItemResp *)
++     protobuf_c_message_unpack (&sr__delete_item_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__delete_item_resp__free_unpacked
++                     (Sr__DeleteItemResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__delete_item_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__move_item_req__init
++                     (Sr__MoveItemReq         *message)
++{
++  static Sr__MoveItemReq init_value = SR__MOVE_ITEM_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__move_item_req__get_packed_size
++                     (const Sr__MoveItemReq *message)
++{
++  assert(message->base.descriptor == &sr__move_item_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__move_item_req__pack
++                     (const Sr__MoveItemReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__move_item_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__move_item_req__pack_to_buffer
++                     (const Sr__MoveItemReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__move_item_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__MoveItemReq *
++       sr__move_item_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__MoveItemReq *)
++     protobuf_c_message_unpack (&sr__move_item_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__move_item_req__free_unpacked
++                     (Sr__MoveItemReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__move_item_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__move_item_resp__init
++                     (Sr__MoveItemResp         *message)
++{
++  static Sr__MoveItemResp init_value = SR__MOVE_ITEM_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__move_item_resp__get_packed_size
++                     (const Sr__MoveItemResp *message)
++{
++  assert(message->base.descriptor == &sr__move_item_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__move_item_resp__pack
++                     (const Sr__MoveItemResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__move_item_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__move_item_resp__pack_to_buffer
++                     (const Sr__MoveItemResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__move_item_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__MoveItemResp *
++       sr__move_item_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__MoveItemResp *)
++     protobuf_c_message_unpack (&sr__move_item_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__move_item_resp__free_unpacked
++                     (Sr__MoveItemResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__move_item_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__validate_req__init
++                     (Sr__ValidateReq         *message)
++{
++  static Sr__ValidateReq init_value = SR__VALIDATE_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__validate_req__get_packed_size
++                     (const Sr__ValidateReq *message)
++{
++  assert(message->base.descriptor == &sr__validate_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__validate_req__pack
++                     (const Sr__ValidateReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__validate_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__validate_req__pack_to_buffer
++                     (const Sr__ValidateReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__validate_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__ValidateReq *
++       sr__validate_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__ValidateReq *)
++     protobuf_c_message_unpack (&sr__validate_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__validate_req__free_unpacked
++                     (Sr__ValidateReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__validate_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__validate_resp__init
++                     (Sr__ValidateResp         *message)
++{
++  static Sr__ValidateResp init_value = SR__VALIDATE_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__validate_resp__get_packed_size
++                     (const Sr__ValidateResp *message)
++{
++  assert(message->base.descriptor == &sr__validate_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__validate_resp__pack
++                     (const Sr__ValidateResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__validate_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__validate_resp__pack_to_buffer
++                     (const Sr__ValidateResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__validate_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__ValidateResp *
++       sr__validate_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__ValidateResp *)
++     protobuf_c_message_unpack (&sr__validate_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__validate_resp__free_unpacked
++                     (Sr__ValidateResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__validate_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__commit_req__init
++                     (Sr__CommitReq         *message)
++{
++  static Sr__CommitReq init_value = SR__COMMIT_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__commit_req__get_packed_size
++                     (const Sr__CommitReq *message)
++{
++  assert(message->base.descriptor == &sr__commit_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__commit_req__pack
++                     (const Sr__CommitReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__commit_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__commit_req__pack_to_buffer
++                     (const Sr__CommitReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__commit_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__CommitReq *
++       sr__commit_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__CommitReq *)
++     protobuf_c_message_unpack (&sr__commit_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__commit_req__free_unpacked
++                     (Sr__CommitReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__commit_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__commit_resp__init
++                     (Sr__CommitResp         *message)
++{
++  static Sr__CommitResp init_value = SR__COMMIT_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__commit_resp__get_packed_size
++                     (const Sr__CommitResp *message)
++{
++  assert(message->base.descriptor == &sr__commit_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__commit_resp__pack
++                     (const Sr__CommitResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__commit_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__commit_resp__pack_to_buffer
++                     (const Sr__CommitResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__commit_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__CommitResp *
++       sr__commit_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__CommitResp *)
++     protobuf_c_message_unpack (&sr__commit_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__commit_resp__free_unpacked
++                     (Sr__CommitResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__commit_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__discard_changes_req__init
++                     (Sr__DiscardChangesReq         *message)
++{
++  static Sr__DiscardChangesReq init_value = SR__DISCARD_CHANGES_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__discard_changes_req__get_packed_size
++                     (const Sr__DiscardChangesReq *message)
++{
++  assert(message->base.descriptor == &sr__discard_changes_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__discard_changes_req__pack
++                     (const Sr__DiscardChangesReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__discard_changes_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__discard_changes_req__pack_to_buffer
++                     (const Sr__DiscardChangesReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__discard_changes_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__DiscardChangesReq *
++       sr__discard_changes_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__DiscardChangesReq *)
++     protobuf_c_message_unpack (&sr__discard_changes_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__discard_changes_req__free_unpacked
++                     (Sr__DiscardChangesReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__discard_changes_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__discard_changes_resp__init
++                     (Sr__DiscardChangesResp         *message)
++{
++  static Sr__DiscardChangesResp init_value = SR__DISCARD_CHANGES_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__discard_changes_resp__get_packed_size
++                     (const Sr__DiscardChangesResp *message)
++{
++  assert(message->base.descriptor == &sr__discard_changes_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__discard_changes_resp__pack
++                     (const Sr__DiscardChangesResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__discard_changes_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__discard_changes_resp__pack_to_buffer
++                     (const Sr__DiscardChangesResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__discard_changes_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__DiscardChangesResp *
++       sr__discard_changes_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__DiscardChangesResp *)
++     protobuf_c_message_unpack (&sr__discard_changes_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__discard_changes_resp__free_unpacked
++                     (Sr__DiscardChangesResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__discard_changes_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__copy_config_req__init
++                     (Sr__CopyConfigReq         *message)
++{
++  static Sr__CopyConfigReq init_value = SR__COPY_CONFIG_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__copy_config_req__get_packed_size
++                     (const Sr__CopyConfigReq *message)
++{
++  assert(message->base.descriptor == &sr__copy_config_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__copy_config_req__pack
++                     (const Sr__CopyConfigReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__copy_config_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__copy_config_req__pack_to_buffer
++                     (const Sr__CopyConfigReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__copy_config_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__CopyConfigReq *
++       sr__copy_config_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__CopyConfigReq *)
++     protobuf_c_message_unpack (&sr__copy_config_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__copy_config_req__free_unpacked
++                     (Sr__CopyConfigReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__copy_config_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__copy_config_resp__init
++                     (Sr__CopyConfigResp         *message)
++{
++  static Sr__CopyConfigResp init_value = SR__COPY_CONFIG_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__copy_config_resp__get_packed_size
++                     (const Sr__CopyConfigResp *message)
++{
++  assert(message->base.descriptor == &sr__copy_config_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__copy_config_resp__pack
++                     (const Sr__CopyConfigResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__copy_config_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__copy_config_resp__pack_to_buffer
++                     (const Sr__CopyConfigResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__copy_config_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__CopyConfigResp *
++       sr__copy_config_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__CopyConfigResp *)
++     protobuf_c_message_unpack (&sr__copy_config_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__copy_config_resp__free_unpacked
++                     (Sr__CopyConfigResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__copy_config_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__lock_req__init
++                     (Sr__LockReq         *message)
++{
++  static Sr__LockReq init_value = SR__LOCK_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__lock_req__get_packed_size
++                     (const Sr__LockReq *message)
++{
++  assert(message->base.descriptor == &sr__lock_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__lock_req__pack
++                     (const Sr__LockReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__lock_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__lock_req__pack_to_buffer
++                     (const Sr__LockReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__lock_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__LockReq *
++       sr__lock_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__LockReq *)
++     protobuf_c_message_unpack (&sr__lock_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__lock_req__free_unpacked
++                     (Sr__LockReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__lock_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__lock_resp__init
++                     (Sr__LockResp         *message)
++{
++  static Sr__LockResp init_value = SR__LOCK_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__lock_resp__get_packed_size
++                     (const Sr__LockResp *message)
++{
++  assert(message->base.descriptor == &sr__lock_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__lock_resp__pack
++                     (const Sr__LockResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__lock_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__lock_resp__pack_to_buffer
++                     (const Sr__LockResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__lock_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__LockResp *
++       sr__lock_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__LockResp *)
++     protobuf_c_message_unpack (&sr__lock_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__lock_resp__free_unpacked
++                     (Sr__LockResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__lock_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__unlock_req__init
++                     (Sr__UnlockReq         *message)
++{
++  static Sr__UnlockReq init_value = SR__UNLOCK_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__unlock_req__get_packed_size
++                     (const Sr__UnlockReq *message)
++{
++  assert(message->base.descriptor == &sr__unlock_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__unlock_req__pack
++                     (const Sr__UnlockReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__unlock_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__unlock_req__pack_to_buffer
++                     (const Sr__UnlockReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__unlock_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__UnlockReq *
++       sr__unlock_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__UnlockReq *)
++     protobuf_c_message_unpack (&sr__unlock_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__unlock_req__free_unpacked
++                     (Sr__UnlockReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__unlock_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__unlock_resp__init
++                     (Sr__UnlockResp         *message)
++{
++  static Sr__UnlockResp init_value = SR__UNLOCK_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__unlock_resp__get_packed_size
++                     (const Sr__UnlockResp *message)
++{
++  assert(message->base.descriptor == &sr__unlock_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__unlock_resp__pack
++                     (const Sr__UnlockResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__unlock_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__unlock_resp__pack_to_buffer
++                     (const Sr__UnlockResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__unlock_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__UnlockResp *
++       sr__unlock_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__UnlockResp *)
++     protobuf_c_message_unpack (&sr__unlock_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__unlock_resp__free_unpacked
++                     (Sr__UnlockResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__unlock_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__subscribe_req__init
++                     (Sr__SubscribeReq         *message)
++{
++  static Sr__SubscribeReq init_value = SR__SUBSCRIBE_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__subscribe_req__get_packed_size
++                     (const Sr__SubscribeReq *message)
++{
++  assert(message->base.descriptor == &sr__subscribe_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__subscribe_req__pack
++                     (const Sr__SubscribeReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__subscribe_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__subscribe_req__pack_to_buffer
++                     (const Sr__SubscribeReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__subscribe_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SubscribeReq *
++       sr__subscribe_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SubscribeReq *)
++     protobuf_c_message_unpack (&sr__subscribe_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__subscribe_req__free_unpacked
++                     (Sr__SubscribeReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__subscribe_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__subscribe_resp__init
++                     (Sr__SubscribeResp         *message)
++{
++  static Sr__SubscribeResp init_value = SR__SUBSCRIBE_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__subscribe_resp__get_packed_size
++                     (const Sr__SubscribeResp *message)
++{
++  assert(message->base.descriptor == &sr__subscribe_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__subscribe_resp__pack
++                     (const Sr__SubscribeResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__subscribe_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__subscribe_resp__pack_to_buffer
++                     (const Sr__SubscribeResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__subscribe_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SubscribeResp *
++       sr__subscribe_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SubscribeResp *)
++     protobuf_c_message_unpack (&sr__subscribe_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__subscribe_resp__free_unpacked
++                     (Sr__SubscribeResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__subscribe_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__unsubscribe_req__init
++                     (Sr__UnsubscribeReq         *message)
++{
++  static Sr__UnsubscribeReq init_value = SR__UNSUBSCRIBE_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__unsubscribe_req__get_packed_size
++                     (const Sr__UnsubscribeReq *message)
++{
++  assert(message->base.descriptor == &sr__unsubscribe_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__unsubscribe_req__pack
++                     (const Sr__UnsubscribeReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__unsubscribe_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__unsubscribe_req__pack_to_buffer
++                     (const Sr__UnsubscribeReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__unsubscribe_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__UnsubscribeReq *
++       sr__unsubscribe_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__UnsubscribeReq *)
++     protobuf_c_message_unpack (&sr__unsubscribe_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__unsubscribe_req__free_unpacked
++                     (Sr__UnsubscribeReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__unsubscribe_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__unsubscribe_resp__init
++                     (Sr__UnsubscribeResp         *message)
++{
++  static Sr__UnsubscribeResp init_value = SR__UNSUBSCRIBE_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__unsubscribe_resp__get_packed_size
++                     (const Sr__UnsubscribeResp *message)
++{
++  assert(message->base.descriptor == &sr__unsubscribe_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__unsubscribe_resp__pack
++                     (const Sr__UnsubscribeResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__unsubscribe_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__unsubscribe_resp__pack_to_buffer
++                     (const Sr__UnsubscribeResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__unsubscribe_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__UnsubscribeResp *
++       sr__unsubscribe_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__UnsubscribeResp *)
++     protobuf_c_message_unpack (&sr__unsubscribe_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__unsubscribe_resp__free_unpacked
++                     (Sr__UnsubscribeResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__unsubscribe_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__check_enabled_running_req__init
++                     (Sr__CheckEnabledRunningReq         *message)
++{
++  static Sr__CheckEnabledRunningReq init_value = SR__CHECK_ENABLED_RUNNING_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__check_enabled_running_req__get_packed_size
++                     (const Sr__CheckEnabledRunningReq *message)
++{
++  assert(message->base.descriptor == &sr__check_enabled_running_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__check_enabled_running_req__pack
++                     (const Sr__CheckEnabledRunningReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__check_enabled_running_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__check_enabled_running_req__pack_to_buffer
++                     (const Sr__CheckEnabledRunningReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__check_enabled_running_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__CheckEnabledRunningReq *
++       sr__check_enabled_running_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__CheckEnabledRunningReq *)
++     protobuf_c_message_unpack (&sr__check_enabled_running_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__check_enabled_running_req__free_unpacked
++                     (Sr__CheckEnabledRunningReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__check_enabled_running_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__check_enabled_running_resp__init
++                     (Sr__CheckEnabledRunningResp         *message)
++{
++  static Sr__CheckEnabledRunningResp init_value = SR__CHECK_ENABLED_RUNNING_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__check_enabled_running_resp__get_packed_size
++                     (const Sr__CheckEnabledRunningResp *message)
++{
++  assert(message->base.descriptor == &sr__check_enabled_running_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__check_enabled_running_resp__pack
++                     (const Sr__CheckEnabledRunningResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__check_enabled_running_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__check_enabled_running_resp__pack_to_buffer
++                     (const Sr__CheckEnabledRunningResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__check_enabled_running_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__CheckEnabledRunningResp *
++       sr__check_enabled_running_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__CheckEnabledRunningResp *)
++     protobuf_c_message_unpack (&sr__check_enabled_running_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__check_enabled_running_resp__free_unpacked
++                     (Sr__CheckEnabledRunningResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__check_enabled_running_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__module_install_notification__init
++                     (Sr__ModuleInstallNotification         *message)
++{
++  static Sr__ModuleInstallNotification init_value = SR__MODULE_INSTALL_NOTIFICATION__INIT;
++  *message = init_value;
++}
++size_t sr__module_install_notification__get_packed_size
++                     (const Sr__ModuleInstallNotification *message)
++{
++  assert(message->base.descriptor == &sr__module_install_notification__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__module_install_notification__pack
++                     (const Sr__ModuleInstallNotification *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__module_install_notification__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__module_install_notification__pack_to_buffer
++                     (const Sr__ModuleInstallNotification *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__module_install_notification__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__ModuleInstallNotification *
++       sr__module_install_notification__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__ModuleInstallNotification *)
++     protobuf_c_message_unpack (&sr__module_install_notification__descriptor,
++                                allocator, len, data);
++}
++void   sr__module_install_notification__free_unpacked
++                     (Sr__ModuleInstallNotification *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__module_install_notification__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__feature_enable_notification__init
++                     (Sr__FeatureEnableNotification         *message)
++{
++  static Sr__FeatureEnableNotification init_value = SR__FEATURE_ENABLE_NOTIFICATION__INIT;
++  *message = init_value;
++}
++size_t sr__feature_enable_notification__get_packed_size
++                     (const Sr__FeatureEnableNotification *message)
++{
++  assert(message->base.descriptor == &sr__feature_enable_notification__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__feature_enable_notification__pack
++                     (const Sr__FeatureEnableNotification *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__feature_enable_notification__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__feature_enable_notification__pack_to_buffer
++                     (const Sr__FeatureEnableNotification *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__feature_enable_notification__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__FeatureEnableNotification *
++       sr__feature_enable_notification__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__FeatureEnableNotification *)
++     protobuf_c_message_unpack (&sr__feature_enable_notification__descriptor,
++                                allocator, len, data);
++}
++void   sr__feature_enable_notification__free_unpacked
++                     (Sr__FeatureEnableNotification *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__feature_enable_notification__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__module_change_notification__init
++                     (Sr__ModuleChangeNotification         *message)
++{
++  static Sr__ModuleChangeNotification init_value = SR__MODULE_CHANGE_NOTIFICATION__INIT;
++  *message = init_value;
++}
++size_t sr__module_change_notification__get_packed_size
++                     (const Sr__ModuleChangeNotification *message)
++{
++  assert(message->base.descriptor == &sr__module_change_notification__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__module_change_notification__pack
++                     (const Sr__ModuleChangeNotification *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__module_change_notification__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__module_change_notification__pack_to_buffer
++                     (const Sr__ModuleChangeNotification *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__module_change_notification__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__ModuleChangeNotification *
++       sr__module_change_notification__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__ModuleChangeNotification *)
++     protobuf_c_message_unpack (&sr__module_change_notification__descriptor,
++                                allocator, len, data);
++}
++void   sr__module_change_notification__free_unpacked
++                     (Sr__ModuleChangeNotification *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__module_change_notification__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__subtree_change_notification__init
++                     (Sr__SubtreeChangeNotification         *message)
++{
++  static Sr__SubtreeChangeNotification init_value = SR__SUBTREE_CHANGE_NOTIFICATION__INIT;
++  *message = init_value;
++}
++size_t sr__subtree_change_notification__get_packed_size
++                     (const Sr__SubtreeChangeNotification *message)
++{
++  assert(message->base.descriptor == &sr__subtree_change_notification__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__subtree_change_notification__pack
++                     (const Sr__SubtreeChangeNotification *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__subtree_change_notification__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__subtree_change_notification__pack_to_buffer
++                     (const Sr__SubtreeChangeNotification *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__subtree_change_notification__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__SubtreeChangeNotification *
++       sr__subtree_change_notification__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__SubtreeChangeNotification *)
++     protobuf_c_message_unpack (&sr__subtree_change_notification__descriptor,
++                                allocator, len, data);
++}
++void   sr__subtree_change_notification__free_unpacked
++                     (Sr__SubtreeChangeNotification *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__subtree_change_notification__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__change__init
++                     (Sr__Change         *message)
++{
++  static Sr__Change init_value = SR__CHANGE__INIT;
++  *message = init_value;
++}
++size_t sr__change__get_packed_size
++                     (const Sr__Change *message)
++{
++  assert(message->base.descriptor == &sr__change__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__change__pack
++                     (const Sr__Change *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__change__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__change__pack_to_buffer
++                     (const Sr__Change *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__change__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__Change *
++       sr__change__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__Change *)
++     protobuf_c_message_unpack (&sr__change__descriptor,
++                                allocator, len, data);
++}
++void   sr__change__free_unpacked
++                     (Sr__Change *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__change__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_changes_req__init
++                     (Sr__GetChangesReq         *message)
++{
++  static Sr__GetChangesReq init_value = SR__GET_CHANGES_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__get_changes_req__get_packed_size
++                     (const Sr__GetChangesReq *message)
++{
++  assert(message->base.descriptor == &sr__get_changes_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_changes_req__pack
++                     (const Sr__GetChangesReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_changes_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_changes_req__pack_to_buffer
++                     (const Sr__GetChangesReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_changes_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetChangesReq *
++       sr__get_changes_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetChangesReq *)
++     protobuf_c_message_unpack (&sr__get_changes_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_changes_req__free_unpacked
++                     (Sr__GetChangesReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_changes_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__get_changes_resp__init
++                     (Sr__GetChangesResp         *message)
++{
++  static Sr__GetChangesResp init_value = SR__GET_CHANGES_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__get_changes_resp__get_packed_size
++                     (const Sr__GetChangesResp *message)
++{
++  assert(message->base.descriptor == &sr__get_changes_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__get_changes_resp__pack
++                     (const Sr__GetChangesResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__get_changes_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__get_changes_resp__pack_to_buffer
++                     (const Sr__GetChangesResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__get_changes_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__GetChangesResp *
++       sr__get_changes_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__GetChangesResp *)
++     protobuf_c_message_unpack (&sr__get_changes_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__get_changes_resp__free_unpacked
++                     (Sr__GetChangesResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__get_changes_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__check_exec_perm_req__init
++                     (Sr__CheckExecPermReq         *message)
++{
++  static Sr__CheckExecPermReq init_value = SR__CHECK_EXEC_PERM_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__check_exec_perm_req__get_packed_size
++                     (const Sr__CheckExecPermReq *message)
++{
++  assert(message->base.descriptor == &sr__check_exec_perm_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__check_exec_perm_req__pack
++                     (const Sr__CheckExecPermReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__check_exec_perm_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__check_exec_perm_req__pack_to_buffer
++                     (const Sr__CheckExecPermReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__check_exec_perm_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__CheckExecPermReq *
++       sr__check_exec_perm_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__CheckExecPermReq *)
++     protobuf_c_message_unpack (&sr__check_exec_perm_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__check_exec_perm_req__free_unpacked
++                     (Sr__CheckExecPermReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__check_exec_perm_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__check_exec_perm_resp__init
++                     (Sr__CheckExecPermResp         *message)
++{
++  static Sr__CheckExecPermResp init_value = SR__CHECK_EXEC_PERM_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__check_exec_perm_resp__get_packed_size
++                     (const Sr__CheckExecPermResp *message)
++{
++  assert(message->base.descriptor == &sr__check_exec_perm_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__check_exec_perm_resp__pack
++                     (const Sr__CheckExecPermResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__check_exec_perm_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__check_exec_perm_resp__pack_to_buffer
++                     (const Sr__CheckExecPermResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__check_exec_perm_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__CheckExecPermResp *
++       sr__check_exec_perm_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__CheckExecPermResp *)
++     protobuf_c_message_unpack (&sr__check_exec_perm_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__check_exec_perm_resp__free_unpacked
++                     (Sr__CheckExecPermResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__check_exec_perm_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__rpcreq__init
++                     (Sr__RPCReq         *message)
++{
++  static Sr__RPCReq init_value = SR__RPCREQ__INIT;
++  *message = init_value;
++}
++size_t sr__rpcreq__get_packed_size
++                     (const Sr__RPCReq *message)
++{
++  assert(message->base.descriptor == &sr__rpcreq__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__rpcreq__pack
++                     (const Sr__RPCReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__rpcreq__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__rpcreq__pack_to_buffer
++                     (const Sr__RPCReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__rpcreq__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__RPCReq *
++       sr__rpcreq__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__RPCReq *)
++     protobuf_c_message_unpack (&sr__rpcreq__descriptor,
++                                allocator, len, data);
++}
++void   sr__rpcreq__free_unpacked
++                     (Sr__RPCReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__rpcreq__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__rpcresp__init
++                     (Sr__RPCResp         *message)
++{
++  static Sr__RPCResp init_value = SR__RPCRESP__INIT;
++  *message = init_value;
++}
++size_t sr__rpcresp__get_packed_size
++                     (const Sr__RPCResp *message)
++{
++  assert(message->base.descriptor == &sr__rpcresp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__rpcresp__pack
++                     (const Sr__RPCResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__rpcresp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__rpcresp__pack_to_buffer
++                     (const Sr__RPCResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__rpcresp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__RPCResp *
++       sr__rpcresp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__RPCResp *)
++     protobuf_c_message_unpack (&sr__rpcresp__descriptor,
++                                allocator, len, data);
++}
++void   sr__rpcresp__free_unpacked
++                     (Sr__RPCResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__rpcresp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__event_notif_req__init
++                     (Sr__EventNotifReq         *message)
++{
++  static Sr__EventNotifReq init_value = SR__EVENT_NOTIF_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__event_notif_req__get_packed_size
++                     (const Sr__EventNotifReq *message)
++{
++  assert(message->base.descriptor == &sr__event_notif_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__event_notif_req__pack
++                     (const Sr__EventNotifReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__event_notif_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__event_notif_req__pack_to_buffer
++                     (const Sr__EventNotifReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__event_notif_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__EventNotifReq *
++       sr__event_notif_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__EventNotifReq *)
++     protobuf_c_message_unpack (&sr__event_notif_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__event_notif_req__free_unpacked
++                     (Sr__EventNotifReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__event_notif_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__event_notif_resp__init
++                     (Sr__EventNotifResp         *message)
++{
++  static Sr__EventNotifResp init_value = SR__EVENT_NOTIF_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__event_notif_resp__get_packed_size
++                     (const Sr__EventNotifResp *message)
++{
++  assert(message->base.descriptor == &sr__event_notif_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__event_notif_resp__pack
++                     (const Sr__EventNotifResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__event_notif_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__event_notif_resp__pack_to_buffer
++                     (const Sr__EventNotifResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__event_notif_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__EventNotifResp *
++       sr__event_notif_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__EventNotifResp *)
++     protobuf_c_message_unpack (&sr__event_notif_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__event_notif_resp__free_unpacked
++                     (Sr__EventNotifResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__event_notif_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__event_notif_replay_req__init
++                     (Sr__EventNotifReplayReq         *message)
++{
++  static Sr__EventNotifReplayReq init_value = SR__EVENT_NOTIF_REPLAY_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__event_notif_replay_req__get_packed_size
++                     (const Sr__EventNotifReplayReq *message)
++{
++  assert(message->base.descriptor == &sr__event_notif_replay_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__event_notif_replay_req__pack
++                     (const Sr__EventNotifReplayReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__event_notif_replay_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__event_notif_replay_req__pack_to_buffer
++                     (const Sr__EventNotifReplayReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__event_notif_replay_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__EventNotifReplayReq *
++       sr__event_notif_replay_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__EventNotifReplayReq *)
++     protobuf_c_message_unpack (&sr__event_notif_replay_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__event_notif_replay_req__free_unpacked
++                     (Sr__EventNotifReplayReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__event_notif_replay_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__event_notif_replay_resp__init
++                     (Sr__EventNotifReplayResp         *message)
++{
++  static Sr__EventNotifReplayResp init_value = SR__EVENT_NOTIF_REPLAY_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__event_notif_replay_resp__get_packed_size
++                     (const Sr__EventNotifReplayResp *message)
++{
++  assert(message->base.descriptor == &sr__event_notif_replay_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__event_notif_replay_resp__pack
++                     (const Sr__EventNotifReplayResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__event_notif_replay_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__event_notif_replay_resp__pack_to_buffer
++                     (const Sr__EventNotifReplayResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__event_notif_replay_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__EventNotifReplayResp *
++       sr__event_notif_replay_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__EventNotifReplayResp *)
++     protobuf_c_message_unpack (&sr__event_notif_replay_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__event_notif_replay_resp__free_unpacked
++                     (Sr__EventNotifReplayResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__event_notif_replay_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__data_provide_req__init
++                     (Sr__DataProvideReq         *message)
++{
++  static Sr__DataProvideReq init_value = SR__DATA_PROVIDE_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__data_provide_req__get_packed_size
++                     (const Sr__DataProvideReq *message)
++{
++  assert(message->base.descriptor == &sr__data_provide_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__data_provide_req__pack
++                     (const Sr__DataProvideReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__data_provide_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__data_provide_req__pack_to_buffer
++                     (const Sr__DataProvideReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__data_provide_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__DataProvideReq *
++       sr__data_provide_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__DataProvideReq *)
++     protobuf_c_message_unpack (&sr__data_provide_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__data_provide_req__free_unpacked
++                     (Sr__DataProvideReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__data_provide_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__data_provide_resp__init
++                     (Sr__DataProvideResp         *message)
++{
++  static Sr__DataProvideResp init_value = SR__DATA_PROVIDE_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__data_provide_resp__get_packed_size
++                     (const Sr__DataProvideResp *message)
++{
++  assert(message->base.descriptor == &sr__data_provide_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__data_provide_resp__pack
++                     (const Sr__DataProvideResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__data_provide_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__data_provide_resp__pack_to_buffer
++                     (const Sr__DataProvideResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__data_provide_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__DataProvideResp *
++       sr__data_provide_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__DataProvideResp *)
++     protobuf_c_message_unpack (&sr__data_provide_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__data_provide_resp__free_unpacked
++                     (Sr__DataProvideResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__data_provide_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__module_install_req__init
++                     (Sr__ModuleInstallReq         *message)
++{
++  static Sr__ModuleInstallReq init_value = SR__MODULE_INSTALL_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__module_install_req__get_packed_size
++                     (const Sr__ModuleInstallReq *message)
++{
++  assert(message->base.descriptor == &sr__module_install_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__module_install_req__pack
++                     (const Sr__ModuleInstallReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__module_install_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__module_install_req__pack_to_buffer
++                     (const Sr__ModuleInstallReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__module_install_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__ModuleInstallReq *
++       sr__module_install_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__ModuleInstallReq *)
++     protobuf_c_message_unpack (&sr__module_install_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__module_install_req__free_unpacked
++                     (Sr__ModuleInstallReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__module_install_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__module_install_resp__init
++                     (Sr__ModuleInstallResp         *message)
++{
++  static Sr__ModuleInstallResp init_value = SR__MODULE_INSTALL_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__module_install_resp__get_packed_size
++                     (const Sr__ModuleInstallResp *message)
++{
++  assert(message->base.descriptor == &sr__module_install_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__module_install_resp__pack
++                     (const Sr__ModuleInstallResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__module_install_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__module_install_resp__pack_to_buffer
++                     (const Sr__ModuleInstallResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__module_install_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__ModuleInstallResp *
++       sr__module_install_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__ModuleInstallResp *)
++     protobuf_c_message_unpack (&sr__module_install_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__module_install_resp__free_unpacked
++                     (Sr__ModuleInstallResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__module_install_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__feature_enable_req__init
++                     (Sr__FeatureEnableReq         *message)
++{
++  static Sr__FeatureEnableReq init_value = SR__FEATURE_ENABLE_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__feature_enable_req__get_packed_size
++                     (const Sr__FeatureEnableReq *message)
++{
++  assert(message->base.descriptor == &sr__feature_enable_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__feature_enable_req__pack
++                     (const Sr__FeatureEnableReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__feature_enable_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__feature_enable_req__pack_to_buffer
++                     (const Sr__FeatureEnableReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__feature_enable_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__FeatureEnableReq *
++       sr__feature_enable_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__FeatureEnableReq *)
++     protobuf_c_message_unpack (&sr__feature_enable_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__feature_enable_req__free_unpacked
++                     (Sr__FeatureEnableReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__feature_enable_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__feature_enable_resp__init
++                     (Sr__FeatureEnableResp         *message)
++{
++  static Sr__FeatureEnableResp init_value = SR__FEATURE_ENABLE_RESP__INIT;
++  *message = init_value;
++}
++size_t sr__feature_enable_resp__get_packed_size
++                     (const Sr__FeatureEnableResp *message)
++{
++  assert(message->base.descriptor == &sr__feature_enable_resp__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__feature_enable_resp__pack
++                     (const Sr__FeatureEnableResp *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__feature_enable_resp__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__feature_enable_resp__pack_to_buffer
++                     (const Sr__FeatureEnableResp *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__feature_enable_resp__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__FeatureEnableResp *
++       sr__feature_enable_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__FeatureEnableResp *)
++     protobuf_c_message_unpack (&sr__feature_enable_resp__descriptor,
++                                allocator, len, data);
++}
++void   sr__feature_enable_resp__free_unpacked
++                     (Sr__FeatureEnableResp *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__feature_enable_resp__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__unsubscribe_destination_req__init
++                     (Sr__UnsubscribeDestinationReq         *message)
++{
++  static Sr__UnsubscribeDestinationReq init_value = SR__UNSUBSCRIBE_DESTINATION_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__unsubscribe_destination_req__get_packed_size
++                     (const Sr__UnsubscribeDestinationReq *message)
++{
++  assert(message->base.descriptor == &sr__unsubscribe_destination_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__unsubscribe_destination_req__pack
++                     (const Sr__UnsubscribeDestinationReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__unsubscribe_destination_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__unsubscribe_destination_req__pack_to_buffer
++                     (const Sr__UnsubscribeDestinationReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__unsubscribe_destination_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__UnsubscribeDestinationReq *
++       sr__unsubscribe_destination_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__UnsubscribeDestinationReq *)
++     protobuf_c_message_unpack (&sr__unsubscribe_destination_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__unsubscribe_destination_req__free_unpacked
++                     (Sr__UnsubscribeDestinationReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__unsubscribe_destination_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__commit_timeout_req__init
++                     (Sr__CommitTimeoutReq         *message)
++{
++  static Sr__CommitTimeoutReq init_value = SR__COMMIT_TIMEOUT_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__commit_timeout_req__get_packed_size
++                     (const Sr__CommitTimeoutReq *message)
++{
++  assert(message->base.descriptor == &sr__commit_timeout_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__commit_timeout_req__pack
++                     (const Sr__CommitTimeoutReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__commit_timeout_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__commit_timeout_req__pack_to_buffer
++                     (const Sr__CommitTimeoutReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__commit_timeout_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__CommitTimeoutReq *
++       sr__commit_timeout_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__CommitTimeoutReq *)
++     protobuf_c_message_unpack (&sr__commit_timeout_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__commit_timeout_req__free_unpacked
++                     (Sr__CommitTimeoutReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__commit_timeout_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__oper_data_timeout_req__init
++                     (Sr__OperDataTimeoutReq         *message)
++{
++  static Sr__OperDataTimeoutReq init_value = SR__OPER_DATA_TIMEOUT_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__oper_data_timeout_req__get_packed_size
++                     (const Sr__OperDataTimeoutReq *message)
++{
++  assert(message->base.descriptor == &sr__oper_data_timeout_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__oper_data_timeout_req__pack
++                     (const Sr__OperDataTimeoutReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__oper_data_timeout_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__oper_data_timeout_req__pack_to_buffer
++                     (const Sr__OperDataTimeoutReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__oper_data_timeout_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__OperDataTimeoutReq *
++       sr__oper_data_timeout_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__OperDataTimeoutReq *)
++     protobuf_c_message_unpack (&sr__oper_data_timeout_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__oper_data_timeout_req__free_unpacked
++                     (Sr__OperDataTimeoutReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__oper_data_timeout_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__internal_state_data_req__init
++                     (Sr__InternalStateDataReq         *message)
++{
++  static Sr__InternalStateDataReq init_value = SR__INTERNAL_STATE_DATA_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__internal_state_data_req__get_packed_size
++                     (const Sr__InternalStateDataReq *message)
++{
++  assert(message->base.descriptor == &sr__internal_state_data_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__internal_state_data_req__pack
++                     (const Sr__InternalStateDataReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__internal_state_data_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__internal_state_data_req__pack_to_buffer
++                     (const Sr__InternalStateDataReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__internal_state_data_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__InternalStateDataReq *
++       sr__internal_state_data_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__InternalStateDataReq *)
++     protobuf_c_message_unpack (&sr__internal_state_data_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__internal_state_data_req__free_unpacked
++                     (Sr__InternalStateDataReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__internal_state_data_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__notif_store_cleanup_req__init
++                     (Sr__NotifStoreCleanupReq         *message)
++{
++  static Sr__NotifStoreCleanupReq init_value = SR__NOTIF_STORE_CLEANUP_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__notif_store_cleanup_req__get_packed_size
++                     (const Sr__NotifStoreCleanupReq *message)
++{
++  assert(message->base.descriptor == &sr__notif_store_cleanup_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__notif_store_cleanup_req__pack
++                     (const Sr__NotifStoreCleanupReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__notif_store_cleanup_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__notif_store_cleanup_req__pack_to_buffer
++                     (const Sr__NotifStoreCleanupReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__notif_store_cleanup_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__NotifStoreCleanupReq *
++       sr__notif_store_cleanup_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__NotifStoreCleanupReq *)
++     protobuf_c_message_unpack (&sr__notif_store_cleanup_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__notif_store_cleanup_req__free_unpacked
++                     (Sr__NotifStoreCleanupReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__notif_store_cleanup_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__delayed_msg_req__init
++                     (Sr__DelayedMsgReq         *message)
++{
++  static Sr__DelayedMsgReq init_value = SR__DELAYED_MSG_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__delayed_msg_req__get_packed_size
++                     (const Sr__DelayedMsgReq *message)
++{
++  assert(message->base.descriptor == &sr__delayed_msg_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__delayed_msg_req__pack
++                     (const Sr__DelayedMsgReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__delayed_msg_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__delayed_msg_req__pack_to_buffer
++                     (const Sr__DelayedMsgReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__delayed_msg_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__DelayedMsgReq *
++       sr__delayed_msg_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__DelayedMsgReq *)
++     protobuf_c_message_unpack (&sr__delayed_msg_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__delayed_msg_req__free_unpacked
++                     (Sr__DelayedMsgReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__delayed_msg_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__nacm_reload_req__init
++                     (Sr__NacmReloadReq         *message)
++{
++  static Sr__NacmReloadReq init_value = SR__NACM_RELOAD_REQ__INIT;
++  *message = init_value;
++}
++size_t sr__nacm_reload_req__get_packed_size
++                     (const Sr__NacmReloadReq *message)
++{
++  assert(message->base.descriptor == &sr__nacm_reload_req__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__nacm_reload_req__pack
++                     (const Sr__NacmReloadReq *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__nacm_reload_req__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__nacm_reload_req__pack_to_buffer
++                     (const Sr__NacmReloadReq *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__nacm_reload_req__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__NacmReloadReq *
++       sr__nacm_reload_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__NacmReloadReq *)
++     protobuf_c_message_unpack (&sr__nacm_reload_req__descriptor,
++                                allocator, len, data);
++}
++void   sr__nacm_reload_req__free_unpacked
++                     (Sr__NacmReloadReq *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__nacm_reload_req__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__request__init
++                     (Sr__Request         *message)
++{
++  static Sr__Request init_value = SR__REQUEST__INIT;
++  *message = init_value;
++}
++size_t sr__request__get_packed_size
++                     (const Sr__Request *message)
++{
++  assert(message->base.descriptor == &sr__request__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__request__pack
++                     (const Sr__Request *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__request__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__request__pack_to_buffer
++                     (const Sr__Request *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__request__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__Request *
++       sr__request__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__Request *)
++     protobuf_c_message_unpack (&sr__request__descriptor,
++                                allocator, len, data);
++}
++void   sr__request__free_unpacked
++                     (Sr__Request *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__request__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__response__init
++                     (Sr__Response         *message)
++{
++  static Sr__Response init_value = SR__RESPONSE__INIT;
++  *message = init_value;
++}
++size_t sr__response__get_packed_size
++                     (const Sr__Response *message)
++{
++  assert(message->base.descriptor == &sr__response__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__response__pack
++                     (const Sr__Response *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__response__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__response__pack_to_buffer
++                     (const Sr__Response *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__response__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__Response *
++       sr__response__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__Response *)
++     protobuf_c_message_unpack (&sr__response__descriptor,
++                                allocator, len, data);
++}
++void   sr__response__free_unpacked
++                     (Sr__Response *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__response__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__notification__init
++                     (Sr__Notification         *message)
++{
++  static Sr__Notification init_value = SR__NOTIFICATION__INIT;
++  *message = init_value;
++}
++size_t sr__notification__get_packed_size
++                     (const Sr__Notification *message)
++{
++  assert(message->base.descriptor == &sr__notification__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__notification__pack
++                     (const Sr__Notification *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__notification__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__notification__pack_to_buffer
++                     (const Sr__Notification *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__notification__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__Notification *
++       sr__notification__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__Notification *)
++     protobuf_c_message_unpack (&sr__notification__descriptor,
++                                allocator, len, data);
++}
++void   sr__notification__free_unpacked
++                     (Sr__Notification *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__notification__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__notification_ack__init
++                     (Sr__NotificationAck         *message)
++{
++  static Sr__NotificationAck init_value = SR__NOTIFICATION_ACK__INIT;
++  *message = init_value;
++}
++size_t sr__notification_ack__get_packed_size
++                     (const Sr__NotificationAck *message)
++{
++  assert(message->base.descriptor == &sr__notification_ack__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__notification_ack__pack
++                     (const Sr__NotificationAck *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__notification_ack__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__notification_ack__pack_to_buffer
++                     (const Sr__NotificationAck *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__notification_ack__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__NotificationAck *
++       sr__notification_ack__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__NotificationAck *)
++     protobuf_c_message_unpack (&sr__notification_ack__descriptor,
++                                allocator, len, data);
++}
++void   sr__notification_ack__free_unpacked
++                     (Sr__NotificationAck *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__notification_ack__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__internal_request__init
++                     (Sr__InternalRequest         *message)
++{
++  static Sr__InternalRequest init_value = SR__INTERNAL_REQUEST__INIT;
++  *message = init_value;
++}
++size_t sr__internal_request__get_packed_size
++                     (const Sr__InternalRequest *message)
++{
++  assert(message->base.descriptor == &sr__internal_request__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__internal_request__pack
++                     (const Sr__InternalRequest *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__internal_request__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__internal_request__pack_to_buffer
++                     (const Sr__InternalRequest *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__internal_request__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__InternalRequest *
++       sr__internal_request__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__InternalRequest *)
++     protobuf_c_message_unpack (&sr__internal_request__descriptor,
++                                allocator, len, data);
++}
++void   sr__internal_request__free_unpacked
++                     (Sr__InternalRequest *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__internal_request__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++void   sr__msg__init
++                     (Sr__Msg         *message)
++{
++  static Sr__Msg init_value = SR__MSG__INIT;
++  *message = init_value;
++}
++size_t sr__msg__get_packed_size
++                     (const Sr__Msg *message)
++{
++  assert(message->base.descriptor == &sr__msg__descriptor);
++  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
++}
++size_t sr__msg__pack
++                     (const Sr__Msg *message,
++                      uint8_t       *out)
++{
++  assert(message->base.descriptor == &sr__msg__descriptor);
++  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
++}
++size_t sr__msg__pack_to_buffer
++                     (const Sr__Msg *message,
++                      ProtobufCBuffer *buffer)
++{
++  assert(message->base.descriptor == &sr__msg__descriptor);
++  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
++}
++Sr__Msg *
++       sr__msg__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data)
++{
++  return (Sr__Msg *)
++     protobuf_c_message_unpack (&sr__msg__descriptor,
++                                allocator, len, data);
++}
++void   sr__msg__free_unpacked
++                     (Sr__Msg *message,
++                      ProtobufCAllocator *allocator)
++{
++  assert(message->base.descriptor == &sr__msg__descriptor);
++  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
++}
++static const ProtobufCEnumValue sr__value__types__enum_values_by_number[22] =
++{
++  { "LIST", "SR__VALUE__TYPES__LIST", 1 },
++  { "CONTAINER", "SR__VALUE__TYPES__CONTAINER", 2 },
++  { "CONTAINER_PRESENCE", "SR__VALUE__TYPES__CONTAINER_PRESENCE", 3 },
++  { "LEAF_EMPTY", "SR__VALUE__TYPES__LEAF_EMPTY", 4 },
++  { "BINARY", "SR__VALUE__TYPES__BINARY", 10 },
++  { "BITS", "SR__VALUE__TYPES__BITS", 11 },
++  { "BOOL", "SR__VALUE__TYPES__BOOL", 12 },
++  { "DECIMAL64", "SR__VALUE__TYPES__DECIMAL64", 13 },
++  { "ENUM", "SR__VALUE__TYPES__ENUM", 14 },
++  { "IDENTITYREF", "SR__VALUE__TYPES__IDENTITYREF", 15 },
++  { "INSTANCEID", "SR__VALUE__TYPES__INSTANCEID", 16 },
++  { "INT8", "SR__VALUE__TYPES__INT8", 17 },
++  { "INT16", "SR__VALUE__TYPES__INT16", 18 },
++  { "INT32", "SR__VALUE__TYPES__INT32", 19 },
++  { "INT64", "SR__VALUE__TYPES__INT64", 20 },
++  { "STRING", "SR__VALUE__TYPES__STRING", 21 },
++  { "UINT8", "SR__VALUE__TYPES__UINT8", 22 },
++  { "UINT16", "SR__VALUE__TYPES__UINT16", 23 },
++  { "UINT32", "SR__VALUE__TYPES__UINT32", 24 },
++  { "UINT64", "SR__VALUE__TYPES__UINT64", 25 },
++  { "ANYXML", "SR__VALUE__TYPES__ANYXML", 26 },
++  { "ANYDATA", "SR__VALUE__TYPES__ANYDATA", 27 },
++};
++static const ProtobufCIntRange sr__value__types__value_ranges[] = {
++{1, 0},{10, 4},{0, 22}
++};
++static const ProtobufCEnumValueIndex sr__value__types__enum_values_by_name[22] =
++{
++  { "ANYDATA", 21 },
++  { "ANYXML", 20 },
++  { "BINARY", 4 },
++  { "BITS", 5 },
++  { "BOOL", 6 },
++  { "CONTAINER", 1 },
++  { "CONTAINER_PRESENCE", 2 },
++  { "DECIMAL64", 7 },
++  { "ENUM", 8 },
++  { "IDENTITYREF", 9 },
++  { "INSTANCEID", 10 },
++  { "INT16", 12 },
++  { "INT32", 13 },
++  { "INT64", 14 },
++  { "INT8", 11 },
++  { "LEAF_EMPTY", 3 },
++  { "LIST", 0 },
++  { "STRING", 15 },
++  { "UINT16", 17 },
++  { "UINT32", 18 },
++  { "UINT64", 19 },
++  { "UINT8", 16 },
++};
++const ProtobufCEnumDescriptor sr__value__types__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.Value.Types",
++  "Types",
++  "Sr__Value__Types",
++  "sr",
++  22,
++  sr__value__types__enum_values_by_number,
++  22,
++  sr__value__types__enum_values_by_name,
++  2,
++  sr__value__types__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
++static const ProtobufCFieldDescriptor sr__value__field_descriptors[21] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Value, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "type",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Value, type),
++    &sr__value__types__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "dflt",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Value, dflt),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "binary_val",
++    10,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Value, binary_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "bits_val",
++    11,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Value, bits_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "bool_val",
++    12,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_BOOL,
++    offsetof(Sr__Value, has_bool_val),
++    offsetof(Sr__Value, bool_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "decimal64_val",
++    13,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_DOUBLE,
++    offsetof(Sr__Value, has_decimal64_val),
++    offsetof(Sr__Value, decimal64_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "enum_val",
++    14,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Value, enum_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "identityref_val",
++    15,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Value, identityref_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "instanceid_val",
++    16,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Value, instanceid_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "int8_val",
++    17,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_INT32,
++    offsetof(Sr__Value, has_int8_val),
++    offsetof(Sr__Value, int8_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "int16_val",
++    18,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_INT32,
++    offsetof(Sr__Value, has_int16_val),
++    offsetof(Sr__Value, int16_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "int32_val",
++    19,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_INT32,
++    offsetof(Sr__Value, has_int32_val),
++    offsetof(Sr__Value, int32_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "int64_val",
++    20,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_INT64,
++    offsetof(Sr__Value, has_int64_val),
++    offsetof(Sr__Value, int64_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "string_val",
++    21,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Value, string_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "uint8_val",
++    22,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_UINT32,
++    offsetof(Sr__Value, has_uint8_val),
++    offsetof(Sr__Value, uint8_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "uint16_val",
++    23,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_UINT32,
++    offsetof(Sr__Value, has_uint16_val),
++    offsetof(Sr__Value, uint16_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "uint32_val",
++    24,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_UINT32,
++    offsetof(Sr__Value, has_uint32_val),
++    offsetof(Sr__Value, uint32_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "uint64_val",
++    25,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_UINT64,
++    offsetof(Sr__Value, has_uint64_val),
++    offsetof(Sr__Value, uint64_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "anyxml_val",
++    26,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Value, anyxml_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "anydata_val",
++    27,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Value, anydata_val),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__value__field_indices_by_name[] = {
++  20,   /* field[20] = anydata_val */
++  19,   /* field[19] = anyxml_val */
++  3,   /* field[3] = binary_val */
++  4,   /* field[4] = bits_val */
++  5,   /* field[5] = bool_val */
++  6,   /* field[6] = decimal64_val */
++  2,   /* field[2] = dflt */
++  7,   /* field[7] = enum_val */
++  8,   /* field[8] = identityref_val */
++  9,   /* field[9] = instanceid_val */
++  11,   /* field[11] = int16_val */
++  12,   /* field[12] = int32_val */
++  13,   /* field[13] = int64_val */
++  10,   /* field[10] = int8_val */
++  14,   /* field[14] = string_val */
++  1,   /* field[1] = type */
++  16,   /* field[16] = uint16_val */
++  17,   /* field[17] = uint32_val */
++  18,   /* field[18] = uint64_val */
++  15,   /* field[15] = uint8_val */
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__value__number_ranges[2 + 1] =
++{
++  { 1, 0 },
++  { 10, 3 },
++  { 0, 21 }
++};
++const ProtobufCMessageDescriptor sr__value__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.Value",
++  "Value",
++  "Sr__Value",
++  "sr",
++  sizeof(Sr__Value),
++  21,
++  sr__value__field_descriptors,
++  sr__value__field_indices_by_name,
++  2,  sr__value__number_ranges,
++  (ProtobufCMessageInit) sr__value__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__node__field_descriptors[3] =
++{
++  {
++    "value",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Node, value),
++    &sr__value__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "module_name",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Node, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "children",
++    3,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__Node, n_children),
++    offsetof(Sr__Node, children),
++    &sr__node__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__node__field_indices_by_name[] = {
++  2,   /* field[2] = children */
++  1,   /* field[1] = module_name */
++  0,   /* field[0] = value */
++};
++static const ProtobufCIntRange sr__node__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 3 }
++};
++const ProtobufCMessageDescriptor sr__node__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.Node",
++  "Node",
++  "Sr__Node",
++  "sr",
++  sizeof(Sr__Node),
++  3,
++  sr__node__field_descriptors,
++  sr__node__field_indices_by_name,
++  1,  sr__node__number_ranges,
++  (ProtobufCMessageInit) sr__node__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__error__field_descriptors[2] =
++{
++  {
++    "message",
++    1,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Error, message),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "xpath",
++    2,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Error, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__error__field_indices_by_name[] = {
++  0,   /* field[0] = message */
++  1,   /* field[1] = xpath */
++};
++static const ProtobufCIntRange sr__error__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 2 }
++};
++const ProtobufCMessageDescriptor sr__error__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.Error",
++  "Error",
++  "Sr__Error",
++  "sr",
++  sizeof(Sr__Error),
++  2,
++  sr__error__field_descriptors,
++  sr__error__field_indices_by_name,
++  1,  sr__error__number_ranges,
++  (ProtobufCMessageInit) sr__error__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__session_start_req__field_descriptors[4] =
++{
++  {
++    "datastore",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SessionStartReq, datastore),
++    &sr__data_store__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "user_name",
++    2,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SessionStartReq, user_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "options",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SessionStartReq, options),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "commit_id",
++    4,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_UINT32,
++    offsetof(Sr__SessionStartReq, has_commit_id),
++    offsetof(Sr__SessionStartReq, commit_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__session_start_req__field_indices_by_name[] = {
++  3,   /* field[3] = commit_id */
++  0,   /* field[0] = datastore */
++  2,   /* field[2] = options */
++  1,   /* field[1] = user_name */
++};
++static const ProtobufCIntRange sr__session_start_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 4 }
++};
++const ProtobufCMessageDescriptor sr__session_start_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SessionStartReq",
++  "SessionStartReq",
++  "Sr__SessionStartReq",
++  "sr",
++  sizeof(Sr__SessionStartReq),
++  4,
++  sr__session_start_req__field_descriptors,
++  sr__session_start_req__field_indices_by_name,
++  1,  sr__session_start_req__number_ranges,
++  (ProtobufCMessageInit) sr__session_start_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__session_start_resp__field_descriptors[1] =
++{
++  {
++    "session_id",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SessionStartResp, session_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__session_start_resp__field_indices_by_name[] = {
++  0,   /* field[0] = session_id */
++};
++static const ProtobufCIntRange sr__session_start_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__session_start_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SessionStartResp",
++  "SessionStartResp",
++  "Sr__SessionStartResp",
++  "sr",
++  sizeof(Sr__SessionStartResp),
++  1,
++  sr__session_start_resp__field_descriptors,
++  sr__session_start_resp__field_indices_by_name,
++  1,  sr__session_start_resp__number_ranges,
++  (ProtobufCMessageInit) sr__session_start_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__session_stop_req__field_descriptors[1] =
++{
++  {
++    "session_id",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SessionStopReq, session_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__session_stop_req__field_indices_by_name[] = {
++  0,   /* field[0] = session_id */
++};
++static const ProtobufCIntRange sr__session_stop_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__session_stop_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SessionStopReq",
++  "SessionStopReq",
++  "Sr__SessionStopReq",
++  "sr",
++  sizeof(Sr__SessionStopReq),
++  1,
++  sr__session_stop_req__field_descriptors,
++  sr__session_stop_req__field_indices_by_name,
++  1,  sr__session_stop_req__number_ranges,
++  (ProtobufCMessageInit) sr__session_stop_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__session_stop_resp__field_descriptors[1] =
++{
++  {
++    "session_id",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SessionStopResp, session_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__session_stop_resp__field_indices_by_name[] = {
++  0,   /* field[0] = session_id */
++};
++static const ProtobufCIntRange sr__session_stop_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__session_stop_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SessionStopResp",
++  "SessionStopResp",
++  "Sr__SessionStopResp",
++  "sr",
++  sizeof(Sr__SessionStopResp),
++  1,
++  sr__session_stop_resp__field_descriptors,
++  sr__session_stop_resp__field_indices_by_name,
++  1,  sr__session_stop_resp__number_ranges,
++  (ProtobufCMessageInit) sr__session_stop_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__session_refresh_req__field_descriptors NULL
++#define sr__session_refresh_req__field_indices_by_name NULL
++#define sr__session_refresh_req__number_ranges NULL
++const ProtobufCMessageDescriptor sr__session_refresh_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SessionRefreshReq",
++  "SessionRefreshReq",
++  "Sr__SessionRefreshReq",
++  "sr",
++  sizeof(Sr__SessionRefreshReq),
++  0,
++  sr__session_refresh_req__field_descriptors,
++  sr__session_refresh_req__field_indices_by_name,
++  0,  sr__session_refresh_req__number_ranges,
++  (ProtobufCMessageInit) sr__session_refresh_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__session_refresh_resp__field_descriptors[1] =
++{
++  {
++    "errors",
++    1,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__SessionRefreshResp, n_errors),
++    offsetof(Sr__SessionRefreshResp, errors),
++    &sr__error__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__session_refresh_resp__field_indices_by_name[] = {
++  0,   /* field[0] = errors */
++};
++static const ProtobufCIntRange sr__session_refresh_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__session_refresh_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SessionRefreshResp",
++  "SessionRefreshResp",
++  "Sr__SessionRefreshResp",
++  "sr",
++  sizeof(Sr__SessionRefreshResp),
++  1,
++  sr__session_refresh_resp__field_descriptors,
++  sr__session_refresh_resp__field_indices_by_name,
++  1,  sr__session_refresh_resp__number_ranges,
++  (ProtobufCMessageInit) sr__session_refresh_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__session_check_req__field_descriptors NULL
++#define sr__session_check_req__field_indices_by_name NULL
++#define sr__session_check_req__number_ranges NULL
++const ProtobufCMessageDescriptor sr__session_check_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SessionCheckReq",
++  "SessionCheckReq",
++  "Sr__SessionCheckReq",
++  "sr",
++  sizeof(Sr__SessionCheckReq),
++  0,
++  sr__session_check_req__field_descriptors,
++  sr__session_check_req__field_indices_by_name,
++  0,  sr__session_check_req__number_ranges,
++  (ProtobufCMessageInit) sr__session_check_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__session_check_resp__field_descriptors[1] =
++{
++  {
++    "errors",
++    1,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__SessionCheckResp, n_errors),
++    offsetof(Sr__SessionCheckResp, errors),
++    &sr__error__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__session_check_resp__field_indices_by_name[] = {
++  0,   /* field[0] = errors */
++};
++static const ProtobufCIntRange sr__session_check_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__session_check_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SessionCheckResp",
++  "SessionCheckResp",
++  "Sr__SessionCheckResp",
++  "sr",
++  sizeof(Sr__SessionCheckResp),
++  1,
++  sr__session_check_resp__field_descriptors,
++  sr__session_check_resp__field_indices_by_name,
++  1,  sr__session_check_resp__number_ranges,
++  (ProtobufCMessageInit) sr__session_check_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__session_switch_ds_req__field_descriptors[1] =
++{
++  {
++    "datastore",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SessionSwitchDsReq, datastore),
++    &sr__data_store__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__session_switch_ds_req__field_indices_by_name[] = {
++  0,   /* field[0] = datastore */
++};
++static const ProtobufCIntRange sr__session_switch_ds_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__session_switch_ds_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SessionSwitchDsReq",
++  "SessionSwitchDsReq",
++  "Sr__SessionSwitchDsReq",
++  "sr",
++  sizeof(Sr__SessionSwitchDsReq),
++  1,
++  sr__session_switch_ds_req__field_descriptors,
++  sr__session_switch_ds_req__field_indices_by_name,
++  1,  sr__session_switch_ds_req__number_ranges,
++  (ProtobufCMessageInit) sr__session_switch_ds_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__session_switch_ds_resp__field_descriptors NULL
++#define sr__session_switch_ds_resp__field_indices_by_name NULL
++#define sr__session_switch_ds_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__session_switch_ds_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SessionSwitchDsResp",
++  "SessionSwitchDsResp",
++  "Sr__SessionSwitchDsResp",
++  "sr",
++  sizeof(Sr__SessionSwitchDsResp),
++  0,
++  sr__session_switch_ds_resp__field_descriptors,
++  sr__session_switch_ds_resp__field_indices_by_name,
++  0,  sr__session_switch_ds_resp__number_ranges,
++  (ProtobufCMessageInit) sr__session_switch_ds_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__session_set_opts_req__field_descriptors[1] =
++{
++  {
++    "options",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SessionSetOptsReq, options),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__session_set_opts_req__field_indices_by_name[] = {
++  0,   /* field[0] = options */
++};
++static const ProtobufCIntRange sr__session_set_opts_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__session_set_opts_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SessionSetOptsReq",
++  "SessionSetOptsReq",
++  "Sr__SessionSetOptsReq",
++  "sr",
++  sizeof(Sr__SessionSetOptsReq),
++  1,
++  sr__session_set_opts_req__field_descriptors,
++  sr__session_set_opts_req__field_indices_by_name,
++  1,  sr__session_set_opts_req__number_ranges,
++  (ProtobufCMessageInit) sr__session_set_opts_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__session_set_opts_resp__field_descriptors NULL
++#define sr__session_set_opts_resp__field_indices_by_name NULL
++#define sr__session_set_opts_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__session_set_opts_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SessionSetOptsResp",
++  "SessionSetOptsResp",
++  "Sr__SessionSetOptsResp",
++  "sr",
++  sizeof(Sr__SessionSetOptsResp),
++  0,
++  sr__session_set_opts_resp__field_descriptors,
++  sr__session_set_opts_resp__field_indices_by_name,
++  0,  sr__session_set_opts_resp__number_ranges,
++  (ProtobufCMessageInit) sr__session_set_opts_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__version_verify_req__field_descriptors[1] =
++{
++  {
++    "soname",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__VersionVerifyReq, soname),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__version_verify_req__field_indices_by_name[] = {
++  0,   /* field[0] = soname */
++};
++static const ProtobufCIntRange sr__version_verify_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__version_verify_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.VersionVerifyReq",
++  "VersionVerifyReq",
++  "Sr__VersionVerifyReq",
++  "sr",
++  sizeof(Sr__VersionVerifyReq),
++  1,
++  sr__version_verify_req__field_descriptors,
++  sr__version_verify_req__field_indices_by_name,
++  1,  sr__version_verify_req__number_ranges,
++  (ProtobufCMessageInit) sr__version_verify_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__version_verify_resp__field_descriptors[1] =
++{
++  {
++    "soname",
++    1,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__VersionVerifyResp, soname),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__version_verify_resp__field_indices_by_name[] = {
++  0,   /* field[0] = soname */
++};
++static const ProtobufCIntRange sr__version_verify_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__version_verify_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.VersionVerifyResp",
++  "VersionVerifyResp",
++  "Sr__VersionVerifyResp",
++  "sr",
++  sizeof(Sr__VersionVerifyResp),
++  1,
++  sr__version_verify_resp__field_descriptors,
++  sr__version_verify_resp__field_indices_by_name,
++  1,  sr__version_verify_resp__number_ranges,
++  (ProtobufCMessageInit) sr__version_verify_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__schema_revision__field_descriptors[3] =
++{
++  {
++    "revision",
++    1,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SchemaRevision, revision),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "file_path_yang",
++    2,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SchemaRevision, file_path_yang),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "file_path_yin",
++    3,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SchemaRevision, file_path_yin),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__schema_revision__field_indices_by_name[] = {
++  1,   /* field[1] = file_path_yang */
++  2,   /* field[2] = file_path_yin */
++  0,   /* field[0] = revision */
++};
++static const ProtobufCIntRange sr__schema_revision__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 3 }
++};
++const ProtobufCMessageDescriptor sr__schema_revision__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SchemaRevision",
++  "SchemaRevision",
++  "Sr__SchemaRevision",
++  "sr",
++  sizeof(Sr__SchemaRevision),
++  3,
++  sr__schema_revision__field_descriptors,
++  sr__schema_revision__field_indices_by_name,
++  1,  sr__schema_revision__number_ranges,
++  (ProtobufCMessageInit) sr__schema_revision__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__schema_submodule__field_descriptors[2] =
++{
++  {
++    "submodule_name",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SchemaSubmodule, submodule_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "revision",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SchemaSubmodule, revision),
++    &sr__schema_revision__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__schema_submodule__field_indices_by_name[] = {
++  1,   /* field[1] = revision */
++  0,   /* field[0] = submodule_name */
++};
++static const ProtobufCIntRange sr__schema_submodule__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 2 }
++};
++const ProtobufCMessageDescriptor sr__schema_submodule__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SchemaSubmodule",
++  "SchemaSubmodule",
++  "Sr__SchemaSubmodule",
++  "sr",
++  sizeof(Sr__SchemaSubmodule),
++  2,
++  sr__schema_submodule__field_descriptors,
++  sr__schema_submodule__field_indices_by_name,
++  1,  sr__schema_submodule__number_ranges,
++  (ProtobufCMessageInit) sr__schema_submodule__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__schema__field_descriptors[8] =
++{
++  {
++    "module_name",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Schema, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "ns",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Schema, ns),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "prefix",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Schema, prefix),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "installed",
++    4,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Schema, installed),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "implemented",
++    5,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Schema, implemented),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "revision",
++    6,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Schema, revision),
++    &sr__schema_revision__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "submodules",
++    7,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__Schema, n_submodules),
++    offsetof(Sr__Schema, submodules),
++    &sr__schema_submodule__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "enabled_features",
++    8,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_STRING,
++    offsetof(Sr__Schema, n_enabled_features),
++    offsetof(Sr__Schema, enabled_features),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__schema__field_indices_by_name[] = {
++  7,   /* field[7] = enabled_features */
++  4,   /* field[4] = implemented */
++  3,   /* field[3] = installed */
++  0,   /* field[0] = module_name */
++  1,   /* field[1] = ns */
++  2,   /* field[2] = prefix */
++  5,   /* field[5] = revision */
++  6,   /* field[6] = submodules */
++};
++static const ProtobufCIntRange sr__schema__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 8 }
++};
++const ProtobufCMessageDescriptor sr__schema__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.Schema",
++  "Schema",
++  "Sr__Schema",
++  "sr",
++  sizeof(Sr__Schema),
++  8,
++  sr__schema__field_descriptors,
++  sr__schema__field_indices_by_name,
++  1,  sr__schema__number_ranges,
++  (ProtobufCMessageInit) sr__schema__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__list_schemas_req__field_descriptors NULL
++#define sr__list_schemas_req__field_indices_by_name NULL
++#define sr__list_schemas_req__number_ranges NULL
++const ProtobufCMessageDescriptor sr__list_schemas_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.ListSchemasReq",
++  "ListSchemasReq",
++  "Sr__ListSchemasReq",
++  "sr",
++  sizeof(Sr__ListSchemasReq),
++  0,
++  sr__list_schemas_req__field_descriptors,
++  sr__list_schemas_req__field_indices_by_name,
++  0,  sr__list_schemas_req__number_ranges,
++  (ProtobufCMessageInit) sr__list_schemas_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__list_schemas_resp__field_descriptors[1] =
++{
++  {
++    "schemas",
++    1,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__ListSchemasResp, n_schemas),
++    offsetof(Sr__ListSchemasResp, schemas),
++    &sr__schema__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__list_schemas_resp__field_indices_by_name[] = {
++  0,   /* field[0] = schemas */
++};
++static const ProtobufCIntRange sr__list_schemas_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__list_schemas_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.ListSchemasResp",
++  "ListSchemasResp",
++  "Sr__ListSchemasResp",
++  "sr",
++  sizeof(Sr__ListSchemasResp),
++  1,
++  sr__list_schemas_resp__field_descriptors,
++  sr__list_schemas_resp__field_indices_by_name,
++  1,  sr__list_schemas_resp__number_ranges,
++  (ProtobufCMessageInit) sr__list_schemas_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_schema_req__field_descriptors[5] =
++{
++  {
++    "module_name",
++    1,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSchemaReq, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "revision",
++    2,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSchemaReq, revision),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "submodule_name",
++    3,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSchemaReq, submodule_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "submodule_revision",
++    4,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSchemaReq, submodule_revision),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "yang_format",
++    5,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSchemaReq, yang_format),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_schema_req__field_indices_by_name[] = {
++  0,   /* field[0] = module_name */
++  1,   /* field[1] = revision */
++  2,   /* field[2] = submodule_name */
++  3,   /* field[3] = submodule_revision */
++  4,   /* field[4] = yang_format */
++};
++static const ProtobufCIntRange sr__get_schema_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 5 }
++};
++const ProtobufCMessageDescriptor sr__get_schema_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetSchemaReq",
++  "GetSchemaReq",
++  "Sr__GetSchemaReq",
++  "sr",
++  sizeof(Sr__GetSchemaReq),
++  5,
++  sr__get_schema_req__field_descriptors,
++  sr__get_schema_req__field_indices_by_name,
++  1,  sr__get_schema_req__number_ranges,
++  (ProtobufCMessageInit) sr__get_schema_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_schema_resp__field_descriptors[1] =
++{
++  {
++    "schema_content",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSchemaResp, schema_content),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_schema_resp__field_indices_by_name[] = {
++  0,   /* field[0] = schema_content */
++};
++static const ProtobufCIntRange sr__get_schema_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__get_schema_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetSchemaResp",
++  "GetSchemaResp",
++  "Sr__GetSchemaResp",
++  "sr",
++  sizeof(Sr__GetSchemaResp),
++  1,
++  sr__get_schema_resp__field_descriptors,
++  sr__get_schema_resp__field_indices_by_name,
++  1,  sr__get_schema_resp__number_ranges,
++  (ProtobufCMessageInit) sr__get_schema_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_item_req__field_descriptors[1] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetItemReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_item_req__field_indices_by_name[] = {
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__get_item_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__get_item_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetItemReq",
++  "GetItemReq",
++  "Sr__GetItemReq",
++  "sr",
++  sizeof(Sr__GetItemReq),
++  1,
++  sr__get_item_req__field_descriptors,
++  sr__get_item_req__field_indices_by_name,
++  1,  sr__get_item_req__number_ranges,
++  (ProtobufCMessageInit) sr__get_item_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_item_resp__field_descriptors[1] =
++{
++  {
++    "value",
++    1,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetItemResp, value),
++    &sr__value__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_item_resp__field_indices_by_name[] = {
++  0,   /* field[0] = value */
++};
++static const ProtobufCIntRange sr__get_item_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__get_item_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetItemResp",
++  "GetItemResp",
++  "Sr__GetItemResp",
++  "sr",
++  sizeof(Sr__GetItemResp),
++  1,
++  sr__get_item_resp__field_descriptors,
++  sr__get_item_resp__field_indices_by_name,
++  1,  sr__get_item_resp__number_ranges,
++  (ProtobufCMessageInit) sr__get_item_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_items_req__field_descriptors[3] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetItemsReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "limit",
++    2,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_UINT32,
++    offsetof(Sr__GetItemsReq, has_limit),
++    offsetof(Sr__GetItemsReq, limit),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "offset",
++    3,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_UINT32,
++    offsetof(Sr__GetItemsReq, has_offset),
++    offsetof(Sr__GetItemsReq, offset),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_items_req__field_indices_by_name[] = {
++  1,   /* field[1] = limit */
++  2,   /* field[2] = offset */
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__get_items_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 3 }
++};
++const ProtobufCMessageDescriptor sr__get_items_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetItemsReq",
++  "GetItemsReq",
++  "Sr__GetItemsReq",
++  "sr",
++  sizeof(Sr__GetItemsReq),
++  3,
++  sr__get_items_req__field_descriptors,
++  sr__get_items_req__field_indices_by_name,
++  1,  sr__get_items_req__number_ranges,
++  (ProtobufCMessageInit) sr__get_items_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_items_resp__field_descriptors[1] =
++{
++  {
++    "values",
++    1,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__GetItemsResp, n_values),
++    offsetof(Sr__GetItemsResp, values),
++    &sr__value__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_items_resp__field_indices_by_name[] = {
++  0,   /* field[0] = values */
++};
++static const ProtobufCIntRange sr__get_items_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__get_items_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetItemsResp",
++  "GetItemsResp",
++  "Sr__GetItemsResp",
++  "sr",
++  sizeof(Sr__GetItemsResp),
++  1,
++  sr__get_items_resp__field_descriptors,
++  sr__get_items_resp__field_indices_by_name,
++  1,  sr__get_items_resp__number_ranges,
++  (ProtobufCMessageInit) sr__get_items_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_subtree_req__field_descriptors[1] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSubtreeReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_subtree_req__field_indices_by_name[] = {
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__get_subtree_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__get_subtree_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetSubtreeReq",
++  "GetSubtreeReq",
++  "Sr__GetSubtreeReq",
++  "sr",
++  sizeof(Sr__GetSubtreeReq),
++  1,
++  sr__get_subtree_req__field_descriptors,
++  sr__get_subtree_req__field_indices_by_name,
++  1,  sr__get_subtree_req__number_ranges,
++  (ProtobufCMessageInit) sr__get_subtree_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_subtree_resp__field_descriptors[1] =
++{
++  {
++    "tree",
++    1,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSubtreeResp, tree),
++    &sr__node__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_subtree_resp__field_indices_by_name[] = {
++  0,   /* field[0] = tree */
++};
++static const ProtobufCIntRange sr__get_subtree_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__get_subtree_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetSubtreeResp",
++  "GetSubtreeResp",
++  "Sr__GetSubtreeResp",
++  "sr",
++  sizeof(Sr__GetSubtreeResp),
++  1,
++  sr__get_subtree_resp__field_descriptors,
++  sr__get_subtree_resp__field_indices_by_name,
++  1,  sr__get_subtree_resp__number_ranges,
++  (ProtobufCMessageInit) sr__get_subtree_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_subtrees_req__field_descriptors[1] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSubtreesReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_subtrees_req__field_indices_by_name[] = {
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__get_subtrees_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__get_subtrees_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetSubtreesReq",
++  "GetSubtreesReq",
++  "Sr__GetSubtreesReq",
++  "sr",
++  sizeof(Sr__GetSubtreesReq),
++  1,
++  sr__get_subtrees_req__field_descriptors,
++  sr__get_subtrees_req__field_indices_by_name,
++  1,  sr__get_subtrees_req__number_ranges,
++  (ProtobufCMessageInit) sr__get_subtrees_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_subtrees_resp__field_descriptors[1] =
++{
++  {
++    "trees",
++    1,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__GetSubtreesResp, n_trees),
++    offsetof(Sr__GetSubtreesResp, trees),
++    &sr__node__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_subtrees_resp__field_indices_by_name[] = {
++  0,   /* field[0] = trees */
++};
++static const ProtobufCIntRange sr__get_subtrees_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__get_subtrees_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetSubtreesResp",
++  "GetSubtreesResp",
++  "Sr__GetSubtreesResp",
++  "sr",
++  sizeof(Sr__GetSubtreesResp),
++  1,
++  sr__get_subtrees_resp__field_descriptors,
++  sr__get_subtrees_resp__field_indices_by_name,
++  1,  sr__get_subtrees_resp__number_ranges,
++  (ProtobufCMessageInit) sr__get_subtrees_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_subtree_chunk_req__field_descriptors[6] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSubtreeChunkReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "single",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSubtreeChunkReq, single),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "slice_offset",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSubtreeChunkReq, slice_offset),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "slice_width",
++    4,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSubtreeChunkReq, slice_width),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "child_limit",
++    5,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSubtreeChunkReq, child_limit),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "depth_limit",
++    6,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetSubtreeChunkReq, depth_limit),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_subtree_chunk_req__field_indices_by_name[] = {
++  4,   /* field[4] = child_limit */
++  5,   /* field[5] = depth_limit */
++  1,   /* field[1] = single */
++  2,   /* field[2] = slice_offset */
++  3,   /* field[3] = slice_width */
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__get_subtree_chunk_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 6 }
++};
++const ProtobufCMessageDescriptor sr__get_subtree_chunk_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetSubtreeChunkReq",
++  "GetSubtreeChunkReq",
++  "Sr__GetSubtreeChunkReq",
++  "sr",
++  sizeof(Sr__GetSubtreeChunkReq),
++  6,
++  sr__get_subtree_chunk_req__field_descriptors,
++  sr__get_subtree_chunk_req__field_indices_by_name,
++  1,  sr__get_subtree_chunk_req__number_ranges,
++  (ProtobufCMessageInit) sr__get_subtree_chunk_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_subtree_chunk_resp__field_descriptors[2] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_STRING,
++    offsetof(Sr__GetSubtreeChunkResp, n_xpath),
++    offsetof(Sr__GetSubtreeChunkResp, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "chunk",
++    2,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__GetSubtreeChunkResp, n_chunk),
++    offsetof(Sr__GetSubtreeChunkResp, chunk),
++    &sr__node__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_subtree_chunk_resp__field_indices_by_name[] = {
++  1,   /* field[1] = chunk */
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__get_subtree_chunk_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 2 }
++};
++const ProtobufCMessageDescriptor sr__get_subtree_chunk_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetSubtreeChunkResp",
++  "GetSubtreeChunkResp",
++  "Sr__GetSubtreeChunkResp",
++  "sr",
++  sizeof(Sr__GetSubtreeChunkResp),
++  2,
++  sr__get_subtree_chunk_resp__field_descriptors,
++  sr__get_subtree_chunk_resp__field_indices_by_name,
++  1,  sr__get_subtree_chunk_resp__number_ranges,
++  (ProtobufCMessageInit) sr__get_subtree_chunk_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__set_item_req__field_descriptors[3] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SetItemReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "value",
++    2,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SetItemReq, value),
++    &sr__value__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "options",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SetItemReq, options),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__set_item_req__field_indices_by_name[] = {
++  2,   /* field[2] = options */
++  1,   /* field[1] = value */
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__set_item_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 3 }
++};
++const ProtobufCMessageDescriptor sr__set_item_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SetItemReq",
++  "SetItemReq",
++  "Sr__SetItemReq",
++  "sr",
++  sizeof(Sr__SetItemReq),
++  3,
++  sr__set_item_req__field_descriptors,
++  sr__set_item_req__field_indices_by_name,
++  1,  sr__set_item_req__number_ranges,
++  (ProtobufCMessageInit) sr__set_item_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__set_item_resp__field_descriptors NULL
++#define sr__set_item_resp__field_indices_by_name NULL
++#define sr__set_item_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__set_item_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SetItemResp",
++  "SetItemResp",
++  "Sr__SetItemResp",
++  "sr",
++  sizeof(Sr__SetItemResp),
++  0,
++  sr__set_item_resp__field_descriptors,
++  sr__set_item_resp__field_indices_by_name,
++  0,  sr__set_item_resp__number_ranges,
++  (ProtobufCMessageInit) sr__set_item_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__set_item_str_req__field_descriptors[3] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SetItemStrReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "value",
++    2,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SetItemStrReq, value),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "options",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SetItemStrReq, options),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__set_item_str_req__field_indices_by_name[] = {
++  2,   /* field[2] = options */
++  1,   /* field[1] = value */
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__set_item_str_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 3 }
++};
++const ProtobufCMessageDescriptor sr__set_item_str_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SetItemStrReq",
++  "SetItemStrReq",
++  "Sr__SetItemStrReq",
++  "sr",
++  sizeof(Sr__SetItemStrReq),
++  3,
++  sr__set_item_str_req__field_descriptors,
++  sr__set_item_str_req__field_indices_by_name,
++  1,  sr__set_item_str_req__number_ranges,
++  (ProtobufCMessageInit) sr__set_item_str_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__set_item_str_resp__field_descriptors NULL
++#define sr__set_item_str_resp__field_indices_by_name NULL
++#define sr__set_item_str_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__set_item_str_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SetItemStrResp",
++  "SetItemStrResp",
++  "Sr__SetItemStrResp",
++  "sr",
++  sizeof(Sr__SetItemStrResp),
++  0,
++  sr__set_item_str_resp__field_descriptors,
++  sr__set_item_str_resp__field_indices_by_name,
++  0,  sr__set_item_str_resp__number_ranges,
++  (ProtobufCMessageInit) sr__set_item_str_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__delete_item_req__field_descriptors[2] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__DeleteItemReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "options",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__DeleteItemReq, options),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__delete_item_req__field_indices_by_name[] = {
++  1,   /* field[1] = options */
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__delete_item_req__number_ranges[2 + 1] =
++{
++  { 1, 0 },
++  { 3, 1 },
++  { 0, 2 }
++};
++const ProtobufCMessageDescriptor sr__delete_item_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.DeleteItemReq",
++  "DeleteItemReq",
++  "Sr__DeleteItemReq",
++  "sr",
++  sizeof(Sr__DeleteItemReq),
++  2,
++  sr__delete_item_req__field_descriptors,
++  sr__delete_item_req__field_indices_by_name,
++  2,  sr__delete_item_req__number_ranges,
++  (ProtobufCMessageInit) sr__delete_item_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__delete_item_resp__field_descriptors NULL
++#define sr__delete_item_resp__field_indices_by_name NULL
++#define sr__delete_item_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__delete_item_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.DeleteItemResp",
++  "DeleteItemResp",
++  "Sr__DeleteItemResp",
++  "sr",
++  sizeof(Sr__DeleteItemResp),
++  0,
++  sr__delete_item_resp__field_descriptors,
++  sr__delete_item_resp__field_indices_by_name,
++  0,  sr__delete_item_resp__number_ranges,
++  (ProtobufCMessageInit) sr__delete_item_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCEnumValue sr__move_item_req__move_position__enum_values_by_number[4] =
++{
++  { "BEFORE", "SR__MOVE_ITEM_REQ__MOVE_POSITION__BEFORE", 1 },
++  { "AFTER", "SR__MOVE_ITEM_REQ__MOVE_POSITION__AFTER", 2 },
++  { "FIRST", "SR__MOVE_ITEM_REQ__MOVE_POSITION__FIRST", 3 },
++  { "LAST", "SR__MOVE_ITEM_REQ__MOVE_POSITION__LAST", 4 },
++};
++static const ProtobufCIntRange sr__move_item_req__move_position__value_ranges[] = {
++{1, 0},{0, 4}
++};
++static const ProtobufCEnumValueIndex sr__move_item_req__move_position__enum_values_by_name[4] =
++{
++  { "AFTER", 1 },
++  { "BEFORE", 0 },
++  { "FIRST", 2 },
++  { "LAST", 3 },
++};
++const ProtobufCEnumDescriptor sr__move_item_req__move_position__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.MoveItemReq.MovePosition",
++  "MovePosition",
++  "Sr__MoveItemReq__MovePosition",
++  "sr",
++  4,
++  sr__move_item_req__move_position__enum_values_by_number,
++  4,
++  sr__move_item_req__move_position__enum_values_by_name,
++  1,
++  sr__move_item_req__move_position__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
++static const ProtobufCFieldDescriptor sr__move_item_req__field_descriptors[3] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__MoveItemReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "position",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__MoveItemReq, position),
++    &sr__move_item_req__move_position__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "relative_item",
++    3,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__MoveItemReq, relative_item),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__move_item_req__field_indices_by_name[] = {
++  1,   /* field[1] = position */
++  2,   /* field[2] = relative_item */
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__move_item_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 3 }
++};
++const ProtobufCMessageDescriptor sr__move_item_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.MoveItemReq",
++  "MoveItemReq",
++  "Sr__MoveItemReq",
++  "sr",
++  sizeof(Sr__MoveItemReq),
++  3,
++  sr__move_item_req__field_descriptors,
++  sr__move_item_req__field_indices_by_name,
++  1,  sr__move_item_req__number_ranges,
++  (ProtobufCMessageInit) sr__move_item_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__move_item_resp__field_descriptors NULL
++#define sr__move_item_resp__field_indices_by_name NULL
++#define sr__move_item_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__move_item_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.MoveItemResp",
++  "MoveItemResp",
++  "Sr__MoveItemResp",
++  "sr",
++  sizeof(Sr__MoveItemResp),
++  0,
++  sr__move_item_resp__field_descriptors,
++  sr__move_item_resp__field_indices_by_name,
++  0,  sr__move_item_resp__number_ranges,
++  (ProtobufCMessageInit) sr__move_item_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__validate_req__field_descriptors NULL
++#define sr__validate_req__field_indices_by_name NULL
++#define sr__validate_req__number_ranges NULL
++const ProtobufCMessageDescriptor sr__validate_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.ValidateReq",
++  "ValidateReq",
++  "Sr__ValidateReq",
++  "sr",
++  sizeof(Sr__ValidateReq),
++  0,
++  sr__validate_req__field_descriptors,
++  sr__validate_req__field_indices_by_name,
++  0,  sr__validate_req__number_ranges,
++  (ProtobufCMessageInit) sr__validate_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__validate_resp__field_descriptors[1] =
++{
++  {
++    "errors",
++    1,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__ValidateResp, n_errors),
++    offsetof(Sr__ValidateResp, errors),
++    &sr__error__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__validate_resp__field_indices_by_name[] = {
++  0,   /* field[0] = errors */
++};
++static const ProtobufCIntRange sr__validate_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__validate_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.ValidateResp",
++  "ValidateResp",
++  "Sr__ValidateResp",
++  "sr",
++  sizeof(Sr__ValidateResp),
++  1,
++  sr__validate_resp__field_descriptors,
++  sr__validate_resp__field_indices_by_name,
++  1,  sr__validate_resp__number_ranges,
++  (ProtobufCMessageInit) sr__validate_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__commit_req__field_descriptors NULL
++#define sr__commit_req__field_indices_by_name NULL
++#define sr__commit_req__number_ranges NULL
++const ProtobufCMessageDescriptor sr__commit_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.CommitReq",
++  "CommitReq",
++  "Sr__CommitReq",
++  "sr",
++  sizeof(Sr__CommitReq),
++  0,
++  sr__commit_req__field_descriptors,
++  sr__commit_req__field_indices_by_name,
++  0,  sr__commit_req__number_ranges,
++  (ProtobufCMessageInit) sr__commit_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__commit_resp__field_descriptors[1] =
++{
++  {
++    "errors",
++    1,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__CommitResp, n_errors),
++    offsetof(Sr__CommitResp, errors),
++    &sr__error__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__commit_resp__field_indices_by_name[] = {
++  0,   /* field[0] = errors */
++};
++static const ProtobufCIntRange sr__commit_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__commit_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.CommitResp",
++  "CommitResp",
++  "Sr__CommitResp",
++  "sr",
++  sizeof(Sr__CommitResp),
++  1,
++  sr__commit_resp__field_descriptors,
++  sr__commit_resp__field_indices_by_name,
++  1,  sr__commit_resp__number_ranges,
++  (ProtobufCMessageInit) sr__commit_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__discard_changes_req__field_descriptors NULL
++#define sr__discard_changes_req__field_indices_by_name NULL
++#define sr__discard_changes_req__number_ranges NULL
++const ProtobufCMessageDescriptor sr__discard_changes_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.DiscardChangesReq",
++  "DiscardChangesReq",
++  "Sr__DiscardChangesReq",
++  "sr",
++  sizeof(Sr__DiscardChangesReq),
++  0,
++  sr__discard_changes_req__field_descriptors,
++  sr__discard_changes_req__field_indices_by_name,
++  0,  sr__discard_changes_req__number_ranges,
++  (ProtobufCMessageInit) sr__discard_changes_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__discard_changes_resp__field_descriptors NULL
++#define sr__discard_changes_resp__field_indices_by_name NULL
++#define sr__discard_changes_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__discard_changes_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.DiscardChangesResp",
++  "DiscardChangesResp",
++  "Sr__DiscardChangesResp",
++  "sr",
++  sizeof(Sr__DiscardChangesResp),
++  0,
++  sr__discard_changes_resp__field_descriptors,
++  sr__discard_changes_resp__field_indices_by_name,
++  0,  sr__discard_changes_resp__number_ranges,
++  (ProtobufCMessageInit) sr__discard_changes_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__copy_config_req__field_descriptors[3] =
++{
++  {
++    "src_datastore",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__CopyConfigReq, src_datastore),
++    &sr__data_store__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "dst_datastore",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__CopyConfigReq, dst_datastore),
++    &sr__data_store__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "module_name",
++    3,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__CopyConfigReq, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__copy_config_req__field_indices_by_name[] = {
++  1,   /* field[1] = dst_datastore */
++  2,   /* field[2] = module_name */
++  0,   /* field[0] = src_datastore */
++};
++static const ProtobufCIntRange sr__copy_config_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 3 }
++};
++const ProtobufCMessageDescriptor sr__copy_config_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.CopyConfigReq",
++  "CopyConfigReq",
++  "Sr__CopyConfigReq",
++  "sr",
++  sizeof(Sr__CopyConfigReq),
++  3,
++  sr__copy_config_req__field_descriptors,
++  sr__copy_config_req__field_indices_by_name,
++  1,  sr__copy_config_req__number_ranges,
++  (ProtobufCMessageInit) sr__copy_config_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__copy_config_resp__field_descriptors[1] =
++{
++  {
++    "errors",
++    1,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__CopyConfigResp, n_errors),
++    offsetof(Sr__CopyConfigResp, errors),
++    &sr__error__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__copy_config_resp__field_indices_by_name[] = {
++  0,   /* field[0] = errors */
++};
++static const ProtobufCIntRange sr__copy_config_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__copy_config_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.CopyConfigResp",
++  "CopyConfigResp",
++  "Sr__CopyConfigResp",
++  "sr",
++  sizeof(Sr__CopyConfigResp),
++  1,
++  sr__copy_config_resp__field_descriptors,
++  sr__copy_config_resp__field_indices_by_name,
++  1,  sr__copy_config_resp__number_ranges,
++  (ProtobufCMessageInit) sr__copy_config_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__lock_req__field_descriptors[1] =
++{
++  {
++    "module_name",
++    1,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__LockReq, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__lock_req__field_indices_by_name[] = {
++  0,   /* field[0] = module_name */
++};
++static const ProtobufCIntRange sr__lock_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__lock_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.LockReq",
++  "LockReq",
++  "Sr__LockReq",
++  "sr",
++  sizeof(Sr__LockReq),
++  1,
++  sr__lock_req__field_descriptors,
++  sr__lock_req__field_indices_by_name,
++  1,  sr__lock_req__number_ranges,
++  (ProtobufCMessageInit) sr__lock_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__lock_resp__field_descriptors NULL
++#define sr__lock_resp__field_indices_by_name NULL
++#define sr__lock_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__lock_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.LockResp",
++  "LockResp",
++  "Sr__LockResp",
++  "sr",
++  sizeof(Sr__LockResp),
++  0,
++  sr__lock_resp__field_descriptors,
++  sr__lock_resp__field_indices_by_name,
++  0,  sr__lock_resp__number_ranges,
++  (ProtobufCMessageInit) sr__lock_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__unlock_req__field_descriptors[1] =
++{
++  {
++    "module_name",
++    1,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__UnlockReq, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__unlock_req__field_indices_by_name[] = {
++  0,   /* field[0] = module_name */
++};
++static const ProtobufCIntRange sr__unlock_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__unlock_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.UnlockReq",
++  "UnlockReq",
++  "Sr__UnlockReq",
++  "sr",
++  sizeof(Sr__UnlockReq),
++  1,
++  sr__unlock_req__field_descriptors,
++  sr__unlock_req__field_indices_by_name,
++  1,  sr__unlock_req__number_ranges,
++  (ProtobufCMessageInit) sr__unlock_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__unlock_resp__field_descriptors NULL
++#define sr__unlock_resp__field_indices_by_name NULL
++#define sr__unlock_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__unlock_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.UnlockResp",
++  "UnlockResp",
++  "Sr__UnlockResp",
++  "sr",
++  sizeof(Sr__UnlockResp),
++  0,
++  sr__unlock_resp__field_descriptors,
++  sr__unlock_resp__field_indices_by_name,
++  0,  sr__unlock_resp__number_ranges,
++  (ProtobufCMessageInit) sr__unlock_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__subscribe_req__field_descriptors[10] =
++{
++  {
++    "type",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SubscribeReq, type),
++    &sr__subscription_type__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "destination",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SubscribeReq, destination),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subscription_id",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SubscribeReq, subscription_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "module_name",
++    4,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SubscribeReq, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "xpath",
++    5,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SubscribeReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "notif_event",
++    10,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_ENUM,
++    offsetof(Sr__SubscribeReq, has_notif_event),
++    offsetof(Sr__SubscribeReq, notif_event),
++    &sr__notification_event__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "priority",
++    11,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_UINT32,
++    offsetof(Sr__SubscribeReq, has_priority),
++    offsetof(Sr__SubscribeReq, priority),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "enable_running",
++    12,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_BOOL,
++    offsetof(Sr__SubscribeReq, has_enable_running),
++    offsetof(Sr__SubscribeReq, enable_running),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "enable_event",
++    13,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_BOOL,
++    offsetof(Sr__SubscribeReq, has_enable_event),
++    offsetof(Sr__SubscribeReq, enable_event),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "api_variant",
++    20,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SubscribeReq, api_variant),
++    &sr__api_variant__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__subscribe_req__field_indices_by_name[] = {
++  9,   /* field[9] = api_variant */
++  1,   /* field[1] = destination */
++  8,   /* field[8] = enable_event */
++  7,   /* field[7] = enable_running */
++  3,   /* field[3] = module_name */
++  5,   /* field[5] = notif_event */
++  6,   /* field[6] = priority */
++  2,   /* field[2] = subscription_id */
++  0,   /* field[0] = type */
++  4,   /* field[4] = xpath */
++};
++static const ProtobufCIntRange sr__subscribe_req__number_ranges[3 + 1] =
++{
++  { 1, 0 },
++  { 10, 5 },
++  { 20, 9 },
++  { 0, 10 }
++};
++const ProtobufCMessageDescriptor sr__subscribe_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SubscribeReq",
++  "SubscribeReq",
++  "Sr__SubscribeReq",
++  "sr",
++  sizeof(Sr__SubscribeReq),
++  10,
++  sr__subscribe_req__field_descriptors,
++  sr__subscribe_req__field_indices_by_name,
++  3,  sr__subscribe_req__number_ranges,
++  (ProtobufCMessageInit) sr__subscribe_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__subscribe_resp__field_descriptors NULL
++#define sr__subscribe_resp__field_indices_by_name NULL
++#define sr__subscribe_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__subscribe_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SubscribeResp",
++  "SubscribeResp",
++  "Sr__SubscribeResp",
++  "sr",
++  sizeof(Sr__SubscribeResp),
++  0,
++  sr__subscribe_resp__field_descriptors,
++  sr__subscribe_resp__field_indices_by_name,
++  0,  sr__subscribe_resp__number_ranges,
++  (ProtobufCMessageInit) sr__subscribe_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__unsubscribe_req__field_descriptors[4] =
++{
++  {
++    "type",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__UnsubscribeReq, type),
++    &sr__subscription_type__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "destination",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__UnsubscribeReq, destination),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subscription_id",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__UnsubscribeReq, subscription_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "module_name",
++    4,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__UnsubscribeReq, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__unsubscribe_req__field_indices_by_name[] = {
++  1,   /* field[1] = destination */
++  3,   /* field[3] = module_name */
++  2,   /* field[2] = subscription_id */
++  0,   /* field[0] = type */
++};
++static const ProtobufCIntRange sr__unsubscribe_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 4 }
++};
++const ProtobufCMessageDescriptor sr__unsubscribe_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.UnsubscribeReq",
++  "UnsubscribeReq",
++  "Sr__UnsubscribeReq",
++  "sr",
++  sizeof(Sr__UnsubscribeReq),
++  4,
++  sr__unsubscribe_req__field_descriptors,
++  sr__unsubscribe_req__field_indices_by_name,
++  1,  sr__unsubscribe_req__number_ranges,
++  (ProtobufCMessageInit) sr__unsubscribe_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__unsubscribe_resp__field_descriptors NULL
++#define sr__unsubscribe_resp__field_indices_by_name NULL
++#define sr__unsubscribe_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__unsubscribe_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.UnsubscribeResp",
++  "UnsubscribeResp",
++  "Sr__UnsubscribeResp",
++  "sr",
++  sizeof(Sr__UnsubscribeResp),
++  0,
++  sr__unsubscribe_resp__field_descriptors,
++  sr__unsubscribe_resp__field_indices_by_name,
++  0,  sr__unsubscribe_resp__number_ranges,
++  (ProtobufCMessageInit) sr__unsubscribe_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__check_enabled_running_req__field_descriptors[1] =
++{
++  {
++    "module_name",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__CheckEnabledRunningReq, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__check_enabled_running_req__field_indices_by_name[] = {
++  0,   /* field[0] = module_name */
++};
++static const ProtobufCIntRange sr__check_enabled_running_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__check_enabled_running_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.CheckEnabledRunningReq",
++  "CheckEnabledRunningReq",
++  "Sr__CheckEnabledRunningReq",
++  "sr",
++  sizeof(Sr__CheckEnabledRunningReq),
++  1,
++  sr__check_enabled_running_req__field_descriptors,
++  sr__check_enabled_running_req__field_indices_by_name,
++  1,  sr__check_enabled_running_req__number_ranges,
++  (ProtobufCMessageInit) sr__check_enabled_running_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__check_enabled_running_resp__field_descriptors[1] =
++{
++  {
++    "enabled",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__CheckEnabledRunningResp, enabled),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__check_enabled_running_resp__field_indices_by_name[] = {
++  0,   /* field[0] = enabled */
++};
++static const ProtobufCIntRange sr__check_enabled_running_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__check_enabled_running_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.CheckEnabledRunningResp",
++  "CheckEnabledRunningResp",
++  "Sr__CheckEnabledRunningResp",
++  "sr",
++  sizeof(Sr__CheckEnabledRunningResp),
++  1,
++  sr__check_enabled_running_resp__field_descriptors,
++  sr__check_enabled_running_resp__field_indices_by_name,
++  1,  sr__check_enabled_running_resp__number_ranges,
++  (ProtobufCMessageInit) sr__check_enabled_running_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__module_install_notification__field_descriptors[3] =
++{
++  {
++    "module_name",
++    1,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__ModuleInstallNotification, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "revision",
++    2,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__ModuleInstallNotification, revision),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "state",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__ModuleInstallNotification, state),
++    &sr__module_state__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__module_install_notification__field_indices_by_name[] = {
++  0,   /* field[0] = module_name */
++  1,   /* field[1] = revision */
++  2,   /* field[2] = state */
++};
++static const ProtobufCIntRange sr__module_install_notification__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 3 }
++};
++const ProtobufCMessageDescriptor sr__module_install_notification__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.ModuleInstallNotification",
++  "ModuleInstallNotification",
++  "Sr__ModuleInstallNotification",
++  "sr",
++  sizeof(Sr__ModuleInstallNotification),
++  3,
++  sr__module_install_notification__field_descriptors,
++  sr__module_install_notification__field_indices_by_name,
++  1,  sr__module_install_notification__number_ranges,
++  (ProtobufCMessageInit) sr__module_install_notification__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__feature_enable_notification__field_descriptors[3] =
++{
++  {
++    "module_name",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__FeatureEnableNotification, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "feature_name",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__FeatureEnableNotification, feature_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "enabled",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__FeatureEnableNotification, enabled),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__feature_enable_notification__field_indices_by_name[] = {
++  2,   /* field[2] = enabled */
++  1,   /* field[1] = feature_name */
++  0,   /* field[0] = module_name */
++};
++static const ProtobufCIntRange sr__feature_enable_notification__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 3 }
++};
++const ProtobufCMessageDescriptor sr__feature_enable_notification__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.FeatureEnableNotification",
++  "FeatureEnableNotification",
++  "Sr__FeatureEnableNotification",
++  "sr",
++  sizeof(Sr__FeatureEnableNotification),
++  3,
++  sr__feature_enable_notification__field_descriptors,
++  sr__feature_enable_notification__field_indices_by_name,
++  1,  sr__feature_enable_notification__number_ranges,
++  (ProtobufCMessageInit) sr__feature_enable_notification__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__module_change_notification__field_descriptors[2] =
++{
++  {
++    "event",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__ModuleChangeNotification, event),
++    &sr__notification_event__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "module_name",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__ModuleChangeNotification, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__module_change_notification__field_indices_by_name[] = {
++  0,   /* field[0] = event */
++  1,   /* field[1] = module_name */
++};
++static const ProtobufCIntRange sr__module_change_notification__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 2 }
++};
++const ProtobufCMessageDescriptor sr__module_change_notification__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.ModuleChangeNotification",
++  "ModuleChangeNotification",
++  "Sr__ModuleChangeNotification",
++  "sr",
++  sizeof(Sr__ModuleChangeNotification),
++  2,
++  sr__module_change_notification__field_descriptors,
++  sr__module_change_notification__field_indices_by_name,
++  1,  sr__module_change_notification__number_ranges,
++  (ProtobufCMessageInit) sr__module_change_notification__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__subtree_change_notification__field_descriptors[2] =
++{
++  {
++    "event",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SubtreeChangeNotification, event),
++    &sr__notification_event__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "xpath",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__SubtreeChangeNotification, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__subtree_change_notification__field_indices_by_name[] = {
++  0,   /* field[0] = event */
++  1,   /* field[1] = xpath */
++};
++static const ProtobufCIntRange sr__subtree_change_notification__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 2 }
++};
++const ProtobufCMessageDescriptor sr__subtree_change_notification__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.SubtreeChangeNotification",
++  "SubtreeChangeNotification",
++  "Sr__SubtreeChangeNotification",
++  "sr",
++  sizeof(Sr__SubtreeChangeNotification),
++  2,
++  sr__subtree_change_notification__field_descriptors,
++  sr__subtree_change_notification__field_indices_by_name,
++  1,  sr__subtree_change_notification__number_ranges,
++  (ProtobufCMessageInit) sr__subtree_change_notification__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__change__field_descriptors[3] =
++{
++  {
++    "changeOperation",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Change, changeoperation),
++    &sr__change_operation__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "new_value",
++    2,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Change, new_value),
++    &sr__value__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "old_value",
++    3,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Change, old_value),
++    &sr__value__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__change__field_indices_by_name[] = {
++  0,   /* field[0] = changeOperation */
++  1,   /* field[1] = new_value */
++  2,   /* field[2] = old_value */
++};
++static const ProtobufCIntRange sr__change__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 3 }
++};
++const ProtobufCMessageDescriptor sr__change__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.Change",
++  "Change",
++  "Sr__Change",
++  "sr",
++  sizeof(Sr__Change),
++  3,
++  sr__change__field_descriptors,
++  sr__change__field_indices_by_name,
++  1,  sr__change__number_ranges,
++  (ProtobufCMessageInit) sr__change__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_changes_req__field_descriptors[3] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetChangesReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "limit",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetChangesReq, limit),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "offset",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__GetChangesReq, offset),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_changes_req__field_indices_by_name[] = {
++  1,   /* field[1] = limit */
++  2,   /* field[2] = offset */
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__get_changes_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 3 }
++};
++const ProtobufCMessageDescriptor sr__get_changes_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetChangesReq",
++  "GetChangesReq",
++  "Sr__GetChangesReq",
++  "sr",
++  sizeof(Sr__GetChangesReq),
++  3,
++  sr__get_changes_req__field_descriptors,
++  sr__get_changes_req__field_indices_by_name,
++  1,  sr__get_changes_req__number_ranges,
++  (ProtobufCMessageInit) sr__get_changes_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__get_changes_resp__field_descriptors[1] =
++{
++  {
++    "changes",
++    1,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__GetChangesResp, n_changes),
++    offsetof(Sr__GetChangesResp, changes),
++    &sr__change__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__get_changes_resp__field_indices_by_name[] = {
++  0,   /* field[0] = changes */
++};
++static const ProtobufCIntRange sr__get_changes_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__get_changes_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.GetChangesResp",
++  "GetChangesResp",
++  "Sr__GetChangesResp",
++  "sr",
++  sizeof(Sr__GetChangesResp),
++  1,
++  sr__get_changes_resp__field_descriptors,
++  sr__get_changes_resp__field_indices_by_name,
++  1,  sr__get_changes_resp__number_ranges,
++  (ProtobufCMessageInit) sr__get_changes_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__check_exec_perm_req__field_descriptors[1] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__CheckExecPermReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__check_exec_perm_req__field_indices_by_name[] = {
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__check_exec_perm_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__check_exec_perm_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.CheckExecPermReq",
++  "CheckExecPermReq",
++  "Sr__CheckExecPermReq",
++  "sr",
++  sizeof(Sr__CheckExecPermReq),
++  1,
++  sr__check_exec_perm_req__field_descriptors,
++  sr__check_exec_perm_req__field_indices_by_name,
++  1,  sr__check_exec_perm_req__number_ranges,
++  (ProtobufCMessageInit) sr__check_exec_perm_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__check_exec_perm_resp__field_descriptors[1] =
++{
++  {
++    "permitted",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__CheckExecPermResp, permitted),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__check_exec_perm_resp__field_indices_by_name[] = {
++  0,   /* field[0] = permitted */
++};
++static const ProtobufCIntRange sr__check_exec_perm_resp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__check_exec_perm_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.CheckExecPermResp",
++  "CheckExecPermResp",
++  "Sr__CheckExecPermResp",
++  "sr",
++  sizeof(Sr__CheckExecPermResp),
++  1,
++  sr__check_exec_perm_resp__field_descriptors,
++  sr__check_exec_perm_resp__field_indices_by_name,
++  1,  sr__check_exec_perm_resp__number_ranges,
++  (ProtobufCMessageInit) sr__check_exec_perm_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__rpcreq__field_descriptors[7] =
++{
++  {
++    "action",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__RPCReq, action),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "xpath",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__RPCReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "orig_api_variant",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__RPCReq, orig_api_variant),
++    &sr__api_variant__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "input",
++    4,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__RPCReq, n_input),
++    offsetof(Sr__RPCReq, input),
++    &sr__value__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "input_tree",
++    5,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__RPCReq, n_input_tree),
++    offsetof(Sr__RPCReq, input_tree),
++    &sr__node__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subscriber_address",
++    10,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__RPCReq, subscriber_address),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subscription_id",
++    11,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_UINT32,
++    offsetof(Sr__RPCReq, has_subscription_id),
++    offsetof(Sr__RPCReq, subscription_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__rpcreq__field_indices_by_name[] = {
++  0,   /* field[0] = action */
++  3,   /* field[3] = input */
++  4,   /* field[4] = input_tree */
++  2,   /* field[2] = orig_api_variant */
++  5,   /* field[5] = subscriber_address */
++  6,   /* field[6] = subscription_id */
++  1,   /* field[1] = xpath */
++};
++static const ProtobufCIntRange sr__rpcreq__number_ranges[2 + 1] =
++{
++  { 1, 0 },
++  { 10, 5 },
++  { 0, 7 }
++};
++const ProtobufCMessageDescriptor sr__rpcreq__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.RPCReq",
++  "RPCReq",
++  "Sr__RPCReq",
++  "sr",
++  sizeof(Sr__RPCReq),
++  7,
++  sr__rpcreq__field_descriptors,
++  sr__rpcreq__field_indices_by_name,
++  2,  sr__rpcreq__number_ranges,
++  (ProtobufCMessageInit) sr__rpcreq__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__rpcresp__field_descriptors[5] =
++{
++  {
++    "action",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__RPCResp, action),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "xpath",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__RPCResp, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "orig_api_variant",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__RPCResp, orig_api_variant),
++    &sr__api_variant__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "output",
++    4,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__RPCResp, n_output),
++    offsetof(Sr__RPCResp, output),
++    &sr__value__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "output_tree",
++    5,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__RPCResp, n_output_tree),
++    offsetof(Sr__RPCResp, output_tree),
++    &sr__node__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__rpcresp__field_indices_by_name[] = {
++  0,   /* field[0] = action */
++  2,   /* field[2] = orig_api_variant */
++  3,   /* field[3] = output */
++  4,   /* field[4] = output_tree */
++  1,   /* field[1] = xpath */
++};
++static const ProtobufCIntRange sr__rpcresp__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 5 }
++};
++const ProtobufCMessageDescriptor sr__rpcresp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.RPCResp",
++  "RPCResp",
++  "Sr__RPCResp",
++  "sr",
++  sizeof(Sr__RPCResp),
++  5,
++  sr__rpcresp__field_descriptors,
++  sr__rpcresp__field_indices_by_name,
++  1,  sr__rpcresp__number_ranges,
++  (ProtobufCMessageInit) sr__rpcresp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCEnumValue sr__event_notif_req__notif_type__enum_values_by_number[4] =
++{
++  { "REALTIME", "SR__EVENT_NOTIF_REQ__NOTIF_TYPE__REALTIME", 1 },
++  { "REPLAY", "SR__EVENT_NOTIF_REQ__NOTIF_TYPE__REPLAY", 2 },
++  { "REPLAY_COMPLETE", "SR__EVENT_NOTIF_REQ__NOTIF_TYPE__REPLAY_COMPLETE", 3 },
++  { "REPLAY_STOP", "SR__EVENT_NOTIF_REQ__NOTIF_TYPE__REPLAY_STOP", 4 },
++};
++static const ProtobufCIntRange sr__event_notif_req__notif_type__value_ranges[] = {
++{1, 0},{0, 4}
++};
++static const ProtobufCEnumValueIndex sr__event_notif_req__notif_type__enum_values_by_name[4] =
++{
++  { "REALTIME", 0 },
++  { "REPLAY", 1 },
++  { "REPLAY_COMPLETE", 2 },
++  { "REPLAY_STOP", 3 },
++};
++const ProtobufCEnumDescriptor sr__event_notif_req__notif_type__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.EventNotifReq.NotifType",
++  "NotifType",
++  "Sr__EventNotifReq__NotifType",
++  "sr",
++  4,
++  sr__event_notif_req__notif_type__enum_values_by_number,
++  4,
++  sr__event_notif_req__notif_type__enum_values_by_name,
++  1,
++  sr__event_notif_req__notif_type__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
++static const ProtobufCEnumValue sr__event_notif_req__notif_flags__enum_values_by_number[2] =
++{
++  { "DEFAULT", "SR__EVENT_NOTIF_REQ__NOTIF_FLAGS__DEFAULT", 0 },
++  { "EPHEMERAL", "SR__EVENT_NOTIF_REQ__NOTIF_FLAGS__EPHEMERAL", 1 },
++};
++static const ProtobufCIntRange sr__event_notif_req__notif_flags__value_ranges[] = {
++{0, 0},{0, 2}
++};
++static const ProtobufCEnumValueIndex sr__event_notif_req__notif_flags__enum_values_by_name[2] =
++{
++  { "DEFAULT", 0 },
++  { "EPHEMERAL", 1 },
++};
++const ProtobufCEnumDescriptor sr__event_notif_req__notif_flags__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.EventNotifReq.NotifFlags",
++  "NotifFlags",
++  "Sr__EventNotifReq__NotifFlags",
++  "sr",
++  2,
++  sr__event_notif_req__notif_flags__enum_values_by_number,
++  2,
++  sr__event_notif_req__notif_flags__enum_values_by_name,
++  1,
++  sr__event_notif_req__notif_flags__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
++static const ProtobufCFieldDescriptor sr__event_notif_req__field_descriptors[9] =
++{
++  {
++    "type",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__EventNotifReq, type),
++    &sr__event_notif_req__notif_type__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "options",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__EventNotifReq, options),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "xpath",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__EventNotifReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "values",
++    4,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__EventNotifReq, n_values),
++    offsetof(Sr__EventNotifReq, values),
++    &sr__value__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "trees",
++    5,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__EventNotifReq, n_trees),
++    offsetof(Sr__EventNotifReq, trees),
++    &sr__node__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "timestamp",
++    6,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT64,
++    0,   /* quantifier_offset */
++    offsetof(Sr__EventNotifReq, timestamp),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subscriber_address",
++    10,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__EventNotifReq, subscriber_address),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subscription_id",
++    11,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_UINT32,
++    offsetof(Sr__EventNotifReq, has_subscription_id),
++    offsetof(Sr__EventNotifReq, subscription_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "do_not_send_reply",
++    20,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__EventNotifReq, do_not_send_reply),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__event_notif_req__field_indices_by_name[] = {
++  8,   /* field[8] = do_not_send_reply */
++  1,   /* field[1] = options */
++  6,   /* field[6] = subscriber_address */
++  7,   /* field[7] = subscription_id */
++  5,   /* field[5] = timestamp */
++  4,   /* field[4] = trees */
++  0,   /* field[0] = type */
++  3,   /* field[3] = values */
++  2,   /* field[2] = xpath */
++};
++static const ProtobufCIntRange sr__event_notif_req__number_ranges[3 + 1] =
++{
++  { 1, 0 },
++  { 10, 6 },
++  { 20, 8 },
++  { 0, 9 }
++};
++const ProtobufCMessageDescriptor sr__event_notif_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.EventNotifReq",
++  "EventNotifReq",
++  "Sr__EventNotifReq",
++  "sr",
++  sizeof(Sr__EventNotifReq),
++  9,
++  sr__event_notif_req__field_descriptors,
++  sr__event_notif_req__field_indices_by_name,
++  3,  sr__event_notif_req__number_ranges,
++  (ProtobufCMessageInit) sr__event_notif_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__event_notif_resp__field_descriptors NULL
++#define sr__event_notif_resp__field_indices_by_name NULL
++#define sr__event_notif_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__event_notif_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.EventNotifResp",
++  "EventNotifResp",
++  "Sr__EventNotifResp",
++  "sr",
++  sizeof(Sr__EventNotifResp),
++  0,
++  sr__event_notif_resp__field_descriptors,
++  sr__event_notif_resp__field_indices_by_name,
++  0,  sr__event_notif_resp__number_ranges,
++  (ProtobufCMessageInit) sr__event_notif_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__event_notif_replay_req__field_descriptors[6] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__EventNotifReplayReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "start_time",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT64,
++    0,   /* quantifier_offset */
++    offsetof(Sr__EventNotifReplayReq, start_time),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "stop_time",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT64,
++    0,   /* quantifier_offset */
++    offsetof(Sr__EventNotifReplayReq, stop_time),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subscriber_address",
++    10,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__EventNotifReplayReq, subscriber_address),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subscription_id",
++    11,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__EventNotifReplayReq, subscription_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "api_variant",
++    12,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__EventNotifReplayReq, api_variant),
++    &sr__api_variant__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__event_notif_replay_req__field_indices_by_name[] = {
++  5,   /* field[5] = api_variant */
++  1,   /* field[1] = start_time */
++  2,   /* field[2] = stop_time */
++  3,   /* field[3] = subscriber_address */
++  4,   /* field[4] = subscription_id */
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__event_notif_replay_req__number_ranges[2 + 1] =
++{
++  { 1, 0 },
++  { 10, 3 },
++  { 0, 6 }
++};
++const ProtobufCMessageDescriptor sr__event_notif_replay_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.EventNotifReplayReq",
++  "EventNotifReplayReq",
++  "Sr__EventNotifReplayReq",
++  "sr",
++  sizeof(Sr__EventNotifReplayReq),
++  6,
++  sr__event_notif_replay_req__field_descriptors,
++  sr__event_notif_replay_req__field_indices_by_name,
++  2,  sr__event_notif_replay_req__number_ranges,
++  (ProtobufCMessageInit) sr__event_notif_replay_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__event_notif_replay_resp__field_descriptors NULL
++#define sr__event_notif_replay_resp__field_indices_by_name NULL
++#define sr__event_notif_replay_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__event_notif_replay_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.EventNotifReplayResp",
++  "EventNotifReplayResp",
++  "Sr__EventNotifReplayResp",
++  "sr",
++  sizeof(Sr__EventNotifReplayResp),
++  0,
++  sr__event_notif_replay_resp__field_descriptors,
++  sr__event_notif_replay_resp__field_indices_by_name,
++  0,  sr__event_notif_replay_resp__number_ranges,
++  (ProtobufCMessageInit) sr__event_notif_replay_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__data_provide_req__field_descriptors[4] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__DataProvideReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subscriber_address",
++    10,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__DataProvideReq, subscriber_address),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subscription_id",
++    11,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__DataProvideReq, subscription_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "request_id",
++    20,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT64,
++    0,   /* quantifier_offset */
++    offsetof(Sr__DataProvideReq, request_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__data_provide_req__field_indices_by_name[] = {
++  3,   /* field[3] = request_id */
++  1,   /* field[1] = subscriber_address */
++  2,   /* field[2] = subscription_id */
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__data_provide_req__number_ranges[3 + 1] =
++{
++  { 1, 0 },
++  { 10, 1 },
++  { 20, 3 },
++  { 0, 4 }
++};
++const ProtobufCMessageDescriptor sr__data_provide_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.DataProvideReq",
++  "DataProvideReq",
++  "Sr__DataProvideReq",
++  "sr",
++  sizeof(Sr__DataProvideReq),
++  4,
++  sr__data_provide_req__field_descriptors,
++  sr__data_provide_req__field_indices_by_name,
++  3,  sr__data_provide_req__number_ranges,
++  (ProtobufCMessageInit) sr__data_provide_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__data_provide_resp__field_descriptors[3] =
++{
++  {
++    "xpath",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__DataProvideResp, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "values",
++    2,
++    PROTOBUF_C_LABEL_REPEATED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    offsetof(Sr__DataProvideResp, n_values),
++    offsetof(Sr__DataProvideResp, values),
++    &sr__value__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "request_id",
++    10,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT64,
++    0,   /* quantifier_offset */
++    offsetof(Sr__DataProvideResp, request_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__data_provide_resp__field_indices_by_name[] = {
++  2,   /* field[2] = request_id */
++  1,   /* field[1] = values */
++  0,   /* field[0] = xpath */
++};
++static const ProtobufCIntRange sr__data_provide_resp__number_ranges[2 + 1] =
++{
++  { 1, 0 },
++  { 10, 2 },
++  { 0, 3 }
++};
++const ProtobufCMessageDescriptor sr__data_provide_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.DataProvideResp",
++  "DataProvideResp",
++  "Sr__DataProvideResp",
++  "sr",
++  sizeof(Sr__DataProvideResp),
++  3,
++  sr__data_provide_resp__field_descriptors,
++  sr__data_provide_resp__field_indices_by_name,
++  2,  sr__data_provide_resp__number_ranges,
++  (ProtobufCMessageInit) sr__data_provide_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__module_install_req__field_descriptors[4] =
++{
++  {
++    "module_name",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__ModuleInstallReq, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "revision",
++    2,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__ModuleInstallReq, revision),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "file_name",
++    3,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__ModuleInstallReq, file_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "installed",
++    4,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__ModuleInstallReq, installed),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__module_install_req__field_indices_by_name[] = {
++  2,   /* field[2] = file_name */
++  3,   /* field[3] = installed */
++  0,   /* field[0] = module_name */
++  1,   /* field[1] = revision */
++};
++static const ProtobufCIntRange sr__module_install_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 4 }
++};
++const ProtobufCMessageDescriptor sr__module_install_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.ModuleInstallReq",
++  "ModuleInstallReq",
++  "Sr__ModuleInstallReq",
++  "sr",
++  sizeof(Sr__ModuleInstallReq),
++  4,
++  sr__module_install_req__field_descriptors,
++  sr__module_install_req__field_indices_by_name,
++  1,  sr__module_install_req__number_ranges,
++  (ProtobufCMessageInit) sr__module_install_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__module_install_resp__field_descriptors NULL
++#define sr__module_install_resp__field_indices_by_name NULL
++#define sr__module_install_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__module_install_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.ModuleInstallResp",
++  "ModuleInstallResp",
++  "Sr__ModuleInstallResp",
++  "sr",
++  sizeof(Sr__ModuleInstallResp),
++  0,
++  sr__module_install_resp__field_descriptors,
++  sr__module_install_resp__field_indices_by_name,
++  0,  sr__module_install_resp__number_ranges,
++  (ProtobufCMessageInit) sr__module_install_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__feature_enable_req__field_descriptors[3] =
++{
++  {
++    "module_name",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__FeatureEnableReq, module_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "feature_name",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__FeatureEnableReq, feature_name),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "enabled",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__FeatureEnableReq, enabled),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__feature_enable_req__field_indices_by_name[] = {
++  2,   /* field[2] = enabled */
++  1,   /* field[1] = feature_name */
++  0,   /* field[0] = module_name */
++};
++static const ProtobufCIntRange sr__feature_enable_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 3 }
++};
++const ProtobufCMessageDescriptor sr__feature_enable_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.FeatureEnableReq",
++  "FeatureEnableReq",
++  "Sr__FeatureEnableReq",
++  "sr",
++  sizeof(Sr__FeatureEnableReq),
++  3,
++  sr__feature_enable_req__field_descriptors,
++  sr__feature_enable_req__field_indices_by_name,
++  1,  sr__feature_enable_req__number_ranges,
++  (ProtobufCMessageInit) sr__feature_enable_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__feature_enable_resp__field_descriptors NULL
++#define sr__feature_enable_resp__field_indices_by_name NULL
++#define sr__feature_enable_resp__number_ranges NULL
++const ProtobufCMessageDescriptor sr__feature_enable_resp__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.FeatureEnableResp",
++  "FeatureEnableResp",
++  "Sr__FeatureEnableResp",
++  "sr",
++  sizeof(Sr__FeatureEnableResp),
++  0,
++  sr__feature_enable_resp__field_descriptors,
++  sr__feature_enable_resp__field_indices_by_name,
++  0,  sr__feature_enable_resp__number_ranges,
++  (ProtobufCMessageInit) sr__feature_enable_resp__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__unsubscribe_destination_req__field_descriptors[1] =
++{
++  {
++    "destination",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__UnsubscribeDestinationReq, destination),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__unsubscribe_destination_req__field_indices_by_name[] = {
++  0,   /* field[0] = destination */
++};
++static const ProtobufCIntRange sr__unsubscribe_destination_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__unsubscribe_destination_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.UnsubscribeDestinationReq",
++  "UnsubscribeDestinationReq",
++  "Sr__UnsubscribeDestinationReq",
++  "sr",
++  sizeof(Sr__UnsubscribeDestinationReq),
++  1,
++  sr__unsubscribe_destination_req__field_descriptors,
++  sr__unsubscribe_destination_req__field_indices_by_name,
++  1,  sr__unsubscribe_destination_req__number_ranges,
++  (ProtobufCMessageInit) sr__unsubscribe_destination_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__commit_timeout_req__field_descriptors[2] =
++{
++  {
++    "commit_id",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__CommitTimeoutReq, commit_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "expired",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__CommitTimeoutReq, expired),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__commit_timeout_req__field_indices_by_name[] = {
++  0,   /* field[0] = commit_id */
++  1,   /* field[1] = expired */
++};
++static const ProtobufCIntRange sr__commit_timeout_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 2 }
++};
++const ProtobufCMessageDescriptor sr__commit_timeout_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.CommitTimeoutReq",
++  "CommitTimeoutReq",
++  "Sr__CommitTimeoutReq",
++  "sr",
++  sizeof(Sr__CommitTimeoutReq),
++  2,
++  sr__commit_timeout_req__field_descriptors,
++  sr__commit_timeout_req__field_indices_by_name,
++  1,  sr__commit_timeout_req__number_ranges,
++  (ProtobufCMessageInit) sr__commit_timeout_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__oper_data_timeout_req__field_descriptors[1] =
++{
++  {
++    "request_id",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT64,
++    0,   /* quantifier_offset */
++    offsetof(Sr__OperDataTimeoutReq, request_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__oper_data_timeout_req__field_indices_by_name[] = {
++  0,   /* field[0] = request_id */
++};
++static const ProtobufCIntRange sr__oper_data_timeout_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__oper_data_timeout_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.OperDataTimeoutReq",
++  "OperDataTimeoutReq",
++  "Sr__OperDataTimeoutReq",
++  "sr",
++  sizeof(Sr__OperDataTimeoutReq),
++  1,
++  sr__oper_data_timeout_req__field_descriptors,
++  sr__oper_data_timeout_req__field_indices_by_name,
++  1,  sr__oper_data_timeout_req__number_ranges,
++  (ProtobufCMessageInit) sr__oper_data_timeout_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__internal_state_data_req__field_descriptors[2] =
++{
++  {
++    "request_id",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT64,
++    0,   /* quantifier_offset */
++    offsetof(Sr__InternalStateDataReq, request_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "xpath",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__InternalStateDataReq, xpath),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__internal_state_data_req__field_indices_by_name[] = {
++  0,   /* field[0] = request_id */
++  1,   /* field[1] = xpath */
++};
++static const ProtobufCIntRange sr__internal_state_data_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 2 }
++};
++const ProtobufCMessageDescriptor sr__internal_state_data_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.InternalStateDataReq",
++  "InternalStateDataReq",
++  "Sr__InternalStateDataReq",
++  "sr",
++  sizeof(Sr__InternalStateDataReq),
++  2,
++  sr__internal_state_data_req__field_descriptors,
++  sr__internal_state_data_req__field_indices_by_name,
++  1,  sr__internal_state_data_req__number_ranges,
++  (ProtobufCMessageInit) sr__internal_state_data_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__notif_store_cleanup_req__field_descriptors NULL
++#define sr__notif_store_cleanup_req__field_indices_by_name NULL
++#define sr__notif_store_cleanup_req__number_ranges NULL
++const ProtobufCMessageDescriptor sr__notif_store_cleanup_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.NotifStoreCleanupReq",
++  "NotifStoreCleanupReq",
++  "Sr__NotifStoreCleanupReq",
++  "sr",
++  sizeof(Sr__NotifStoreCleanupReq),
++  0,
++  sr__notif_store_cleanup_req__field_descriptors,
++  sr__notif_store_cleanup_req__field_indices_by_name,
++  0,  sr__notif_store_cleanup_req__number_ranges,
++  (ProtobufCMessageInit) sr__notif_store_cleanup_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__delayed_msg_req__field_descriptors[1] =
++{
++  {
++    "message",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__DelayedMsgReq, message),
++    &sr__msg__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__delayed_msg_req__field_indices_by_name[] = {
++  0,   /* field[0] = message */
++};
++static const ProtobufCIntRange sr__delayed_msg_req__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 1 }
++};
++const ProtobufCMessageDescriptor sr__delayed_msg_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.DelayedMsgReq",
++  "DelayedMsgReq",
++  "Sr__DelayedMsgReq",
++  "sr",
++  sizeof(Sr__DelayedMsgReq),
++  1,
++  sr__delayed_msg_req__field_descriptors,
++  sr__delayed_msg_req__field_indices_by_name,
++  1,  sr__delayed_msg_req__number_ranges,
++  (ProtobufCMessageInit) sr__delayed_msg_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++#define sr__nacm_reload_req__field_descriptors NULL
++#define sr__nacm_reload_req__field_indices_by_name NULL
++#define sr__nacm_reload_req__number_ranges NULL
++const ProtobufCMessageDescriptor sr__nacm_reload_req__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.NacmReloadReq",
++  "NacmReloadReq",
++  "Sr__NacmReloadReq",
++  "sr",
++  sizeof(Sr__NacmReloadReq),
++  0,
++  sr__nacm_reload_req__field_descriptors,
++  sr__nacm_reload_req__field_indices_by_name,
++  0,  sr__nacm_reload_req__number_ranges,
++  (ProtobufCMessageInit) sr__nacm_reload_req__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__request__field_descriptors[37] =
++{
++  {
++    "_id",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT64,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, _id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "operation",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, operation),
++    &sr__operation__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "session_start_req",
++    10,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, session_start_req),
++    &sr__session_start_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "session_stop_req",
++    11,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, session_stop_req),
++    &sr__session_stop_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "session_refresh_req",
++    12,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, session_refresh_req),
++    &sr__session_refresh_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "session_check_req",
++    13,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, session_check_req),
++    &sr__session_check_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "session_switch_ds_req",
++    14,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, session_switch_ds_req),
++    &sr__session_switch_ds_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "session_set_opts_req",
++    15,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, session_set_opts_req),
++    &sr__session_set_opts_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "version_verify_req",
++    16,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, version_verify_req),
++    &sr__version_verify_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "list_schemas_req",
++    20,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, list_schemas_req),
++    &sr__list_schemas_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_schema_req",
++    21,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, get_schema_req),
++    &sr__get_schema_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "module_install_req",
++    22,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, module_install_req),
++    &sr__module_install_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "feature_enable_req",
++    23,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, feature_enable_req),
++    &sr__feature_enable_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_item_req",
++    30,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, get_item_req),
++    &sr__get_item_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_items_req",
++    31,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, get_items_req),
++    &sr__get_items_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_subtree_req",
++    32,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, get_subtree_req),
++    &sr__get_subtree_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_subtrees_req",
++    33,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, get_subtrees_req),
++    &sr__get_subtrees_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_subtree_chunk_req",
++    34,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, get_subtree_chunk_req),
++    &sr__get_subtree_chunk_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "set_item_req",
++    40,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, set_item_req),
++    &sr__set_item_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "delete_item_req",
++    41,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, delete_item_req),
++    &sr__delete_item_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "move_item_req",
++    42,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, move_item_req),
++    &sr__move_item_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "set_item_str_req",
++    43,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, set_item_str_req),
++    &sr__set_item_str_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "validate_req",
++    50,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, validate_req),
++    &sr__validate_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "commit_req",
++    51,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, commit_req),
++    &sr__commit_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "discard_changes_req",
++    52,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, discard_changes_req),
++    &sr__discard_changes_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "copy_config_req",
++    53,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, copy_config_req),
++    &sr__copy_config_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "lock_req",
++    60,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, lock_req),
++    &sr__lock_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "unlock_req",
++    61,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, unlock_req),
++    &sr__unlock_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subscribe_req",
++    70,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, subscribe_req),
++    &sr__subscribe_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "unsubscribe_req",
++    71,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, unsubscribe_req),
++    &sr__unsubscribe_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "check_enabled_running_req",
++    72,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, check_enabled_running_req),
++    &sr__check_enabled_running_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_changes_req",
++    73,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, get_changes_req),
++    &sr__get_changes_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "data_provide_req",
++    80,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, data_provide_req),
++    &sr__data_provide_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "check_exec_perm_req",
++    81,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, check_exec_perm_req),
++    &sr__check_exec_perm_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "rpc_req",
++    82,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, rpc_req),
++    &sr__rpcreq__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "event_notif_req",
++    83,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, event_notif_req),
++    &sr__event_notif_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "event_notif_replay_req",
++    84,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Request, event_notif_replay_req),
++    &sr__event_notif_replay_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__request__field_indices_by_name[] = {
++  0,   /* field[0] = _id */
++  30,   /* field[30] = check_enabled_running_req */
++  33,   /* field[33] = check_exec_perm_req */
++  23,   /* field[23] = commit_req */
++  25,   /* field[25] = copy_config_req */
++  32,   /* field[32] = data_provide_req */
++  19,   /* field[19] = delete_item_req */
++  24,   /* field[24] = discard_changes_req */
++  36,   /* field[36] = event_notif_replay_req */
++  35,   /* field[35] = event_notif_req */
++  12,   /* field[12] = feature_enable_req */
++  31,   /* field[31] = get_changes_req */
++  13,   /* field[13] = get_item_req */
++  14,   /* field[14] = get_items_req */
++  10,   /* field[10] = get_schema_req */
++  17,   /* field[17] = get_subtree_chunk_req */
++  15,   /* field[15] = get_subtree_req */
++  16,   /* field[16] = get_subtrees_req */
++  9,   /* field[9] = list_schemas_req */
++  26,   /* field[26] = lock_req */
++  11,   /* field[11] = module_install_req */
++  20,   /* field[20] = move_item_req */
++  1,   /* field[1] = operation */
++  34,   /* field[34] = rpc_req */
++  5,   /* field[5] = session_check_req */
++  4,   /* field[4] = session_refresh_req */
++  7,   /* field[7] = session_set_opts_req */
++  2,   /* field[2] = session_start_req */
++  3,   /* field[3] = session_stop_req */
++  6,   /* field[6] = session_switch_ds_req */
++  18,   /* field[18] = set_item_req */
++  21,   /* field[21] = set_item_str_req */
++  28,   /* field[28] = subscribe_req */
++  27,   /* field[27] = unlock_req */
++  29,   /* field[29] = unsubscribe_req */
++  22,   /* field[22] = validate_req */
++  8,   /* field[8] = version_verify_req */
++};
++static const ProtobufCIntRange sr__request__number_ranges[9 + 1] =
++{
++  { 1, 0 },
++  { 10, 2 },
++  { 20, 9 },
++  { 30, 13 },
++  { 40, 18 },
++  { 50, 22 },
++  { 60, 26 },
++  { 70, 28 },
++  { 80, 32 },
++  { 0, 37 }
++};
++const ProtobufCMessageDescriptor sr__request__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.Request",
++  "Request",
++  "Sr__Request",
++  "sr",
++  sizeof(Sr__Request),
++  37,
++  sr__request__field_descriptors,
++  sr__request__field_indices_by_name,
++  9,  sr__request__number_ranges,
++  (ProtobufCMessageInit) sr__request__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__response__field_descriptors[38] =
++{
++  {
++    "operation",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, operation),
++    &sr__operation__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "result",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, result),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "error",
++    3,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, error),
++    &sr__error__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "session_start_resp",
++    10,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, session_start_resp),
++    &sr__session_start_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "session_stop_resp",
++    11,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, session_stop_resp),
++    &sr__session_stop_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "session_refresh_resp",
++    12,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, session_refresh_resp),
++    &sr__session_refresh_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "session_check_resp",
++    13,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, session_check_resp),
++    &sr__session_check_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "session_switch_ds_resp",
++    14,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, session_switch_ds_resp),
++    &sr__session_switch_ds_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "session_set_opts_resp",
++    15,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, session_set_opts_resp),
++    &sr__session_set_opts_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "version_verify_resp",
++    16,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, version_verify_resp),
++    &sr__version_verify_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "list_schemas_resp",
++    20,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, list_schemas_resp),
++    &sr__list_schemas_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_schema_resp",
++    21,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, get_schema_resp),
++    &sr__get_schema_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "module_install_resp",
++    22,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, module_install_resp),
++    &sr__module_install_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "feature_enable_resp",
++    23,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, feature_enable_resp),
++    &sr__feature_enable_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_item_resp",
++    30,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, get_item_resp),
++    &sr__get_item_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_items_resp",
++    31,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, get_items_resp),
++    &sr__get_items_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_subtree_resp",
++    32,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, get_subtree_resp),
++    &sr__get_subtree_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_subtrees_resp",
++    33,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, get_subtrees_resp),
++    &sr__get_subtrees_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_subtree_chunk_resp",
++    34,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, get_subtree_chunk_resp),
++    &sr__get_subtree_chunk_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "set_item_resp",
++    40,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, set_item_resp),
++    &sr__set_item_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "delete_item_resp",
++    41,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, delete_item_resp),
++    &sr__delete_item_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "move_item_resp",
++    42,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, move_item_resp),
++    &sr__move_item_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "set_item_str_resp",
++    43,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, set_item_str_resp),
++    &sr__set_item_str_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "validate_resp",
++    50,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, validate_resp),
++    &sr__validate_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "commit_resp",
++    51,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, commit_resp),
++    &sr__commit_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "discard_changes_resp",
++    52,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, discard_changes_resp),
++    &sr__discard_changes_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "copy_config_resp",
++    53,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, copy_config_resp),
++    &sr__copy_config_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "lock_resp",
++    60,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, lock_resp),
++    &sr__lock_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "unlock_resp",
++    61,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, unlock_resp),
++    &sr__unlock_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subscribe_resp",
++    70,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, subscribe_resp),
++    &sr__subscribe_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "unsubscribe_resp",
++    71,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, unsubscribe_resp),
++    &sr__unsubscribe_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "check_enabled_running_resp",
++    72,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, check_enabled_running_resp),
++    &sr__check_enabled_running_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "get_changes_resp",
++    73,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, get_changes_resp),
++    &sr__get_changes_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "data_provide_resp",
++    80,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, data_provide_resp),
++    &sr__data_provide_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "check_exec_perm_resp",
++    81,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, check_exec_perm_resp),
++    &sr__check_exec_perm_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "rpc_resp",
++    82,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, rpc_resp),
++    &sr__rpcresp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "event_notif_resp",
++    83,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, event_notif_resp),
++    &sr__event_notif_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "event_notif_replay_resp",
++    84,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Response, event_notif_replay_resp),
++    &sr__event_notif_replay_resp__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__response__field_indices_by_name[] = {
++  31,   /* field[31] = check_enabled_running_resp */
++  34,   /* field[34] = check_exec_perm_resp */
++  24,   /* field[24] = commit_resp */
++  26,   /* field[26] = copy_config_resp */
++  33,   /* field[33] = data_provide_resp */
++  20,   /* field[20] = delete_item_resp */
++  25,   /* field[25] = discard_changes_resp */
++  2,   /* field[2] = error */
++  37,   /* field[37] = event_notif_replay_resp */
++  36,   /* field[36] = event_notif_resp */
++  13,   /* field[13] = feature_enable_resp */
++  32,   /* field[32] = get_changes_resp */
++  14,   /* field[14] = get_item_resp */
++  15,   /* field[15] = get_items_resp */
++  11,   /* field[11] = get_schema_resp */
++  18,   /* field[18] = get_subtree_chunk_resp */
++  16,   /* field[16] = get_subtree_resp */
++  17,   /* field[17] = get_subtrees_resp */
++  10,   /* field[10] = list_schemas_resp */
++  27,   /* field[27] = lock_resp */
++  12,   /* field[12] = module_install_resp */
++  21,   /* field[21] = move_item_resp */
++  0,   /* field[0] = operation */
++  1,   /* field[1] = result */
++  35,   /* field[35] = rpc_resp */
++  6,   /* field[6] = session_check_resp */
++  5,   /* field[5] = session_refresh_resp */
++  8,   /* field[8] = session_set_opts_resp */
++  3,   /* field[3] = session_start_resp */
++  4,   /* field[4] = session_stop_resp */
++  7,   /* field[7] = session_switch_ds_resp */
++  19,   /* field[19] = set_item_resp */
++  22,   /* field[22] = set_item_str_resp */
++  29,   /* field[29] = subscribe_resp */
++  28,   /* field[28] = unlock_resp */
++  30,   /* field[30] = unsubscribe_resp */
++  23,   /* field[23] = validate_resp */
++  9,   /* field[9] = version_verify_resp */
++};
++static const ProtobufCIntRange sr__response__number_ranges[9 + 1] =
++{
++  { 1, 0 },
++  { 10, 3 },
++  { 20, 10 },
++  { 30, 14 },
++  { 40, 19 },
++  { 50, 23 },
++  { 60, 27 },
++  { 70, 29 },
++  { 80, 33 },
++  { 0, 38 }
++};
++const ProtobufCMessageDescriptor sr__response__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.Response",
++  "Response",
++  "Sr__Response",
++  "sr",
++  sizeof(Sr__Response),
++  38,
++  sr__response__field_descriptors,
++  sr__response__field_indices_by_name,
++  9,  sr__response__number_ranges,
++  (ProtobufCMessageInit) sr__response__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__notification__field_descriptors[10] =
++{
++  {
++    "type",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Notification, type),
++    &sr__subscription_type__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "destination_address",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Notification, destination_address),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "source_address",
++    3,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_STRING,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Notification, source_address),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "source_pid",
++    4,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Notification, source_pid),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subscription_id",
++    5,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Notification, subscription_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "commit_id",
++    6,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_UINT32,
++    offsetof(Sr__Notification, has_commit_id),
++    offsetof(Sr__Notification, commit_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "module_install_notif",
++    10,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Notification, module_install_notif),
++    &sr__module_install_notification__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "feature_enable_notif",
++    11,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Notification, feature_enable_notif),
++    &sr__feature_enable_notification__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "module_change_notif",
++    12,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Notification, module_change_notif),
++    &sr__module_change_notification__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "subtree_change_notif",
++    13,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Notification, subtree_change_notif),
++    &sr__subtree_change_notification__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__notification__field_indices_by_name[] = {
++  5,   /* field[5] = commit_id */
++  1,   /* field[1] = destination_address */
++  7,   /* field[7] = feature_enable_notif */
++  8,   /* field[8] = module_change_notif */
++  6,   /* field[6] = module_install_notif */
++  2,   /* field[2] = source_address */
++  3,   /* field[3] = source_pid */
++  4,   /* field[4] = subscription_id */
++  9,   /* field[9] = subtree_change_notif */
++  0,   /* field[0] = type */
++};
++static const ProtobufCIntRange sr__notification__number_ranges[2 + 1] =
++{
++  { 1, 0 },
++  { 10, 6 },
++  { 0, 10 }
++};
++const ProtobufCMessageDescriptor sr__notification__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.Notification",
++  "Notification",
++  "Sr__Notification",
++  "sr",
++  sizeof(Sr__Notification),
++  10,
++  sr__notification__field_descriptors,
++  sr__notification__field_indices_by_name,
++  2,  sr__notification__number_ranges,
++  (ProtobufCMessageInit) sr__notification__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__notification_ack__field_descriptors[4] =
++{
++  {
++    "notif",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__NotificationAck, notif),
++    &sr__notification__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "result",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__NotificationAck, result),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "error",
++    3,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__NotificationAck, error),
++    &sr__error__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "do_not_send_abort",
++    4,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_BOOL,
++    0,   /* quantifier_offset */
++    offsetof(Sr__NotificationAck, do_not_send_abort),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__notification_ack__field_indices_by_name[] = {
++  3,   /* field[3] = do_not_send_abort */
++  2,   /* field[2] = error */
++  0,   /* field[0] = notif */
++  1,   /* field[1] = result */
++};
++static const ProtobufCIntRange sr__notification_ack__number_ranges[1 + 1] =
++{
++  { 1, 0 },
++  { 0, 4 }
++};
++const ProtobufCMessageDescriptor sr__notification_ack__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.NotificationAck",
++  "NotificationAck",
++  "Sr__NotificationAck",
++  "sr",
++  sizeof(Sr__NotificationAck),
++  4,
++  sr__notification_ack__field_descriptors,
++  sr__notification_ack__field_indices_by_name,
++  1,  sr__notification_ack__number_ranges,
++  (ProtobufCMessageInit) sr__notification_ack__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCFieldDescriptor sr__internal_request__field_descriptors[9] =
++{
++  {
++    "operation",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__InternalRequest, operation),
++    &sr__operation__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "postpone_timeout",
++    2,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_UINT32,
++    offsetof(Sr__InternalRequest, has_postpone_timeout),
++    offsetof(Sr__InternalRequest, postpone_timeout),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "unsubscribe_dst_req",
++    10,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__InternalRequest, unsubscribe_dst_req),
++    &sr__unsubscribe_destination_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "commit_timeout_req",
++    11,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__InternalRequest, commit_timeout_req),
++    &sr__commit_timeout_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "oper_data_timeout_req",
++    12,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__InternalRequest, oper_data_timeout_req),
++    &sr__oper_data_timeout_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "internal_state_data_req",
++    13,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__InternalRequest, internal_state_data_req),
++    &sr__internal_state_data_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "notif_store_cleanup_req",
++    14,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__InternalRequest, notif_store_cleanup_req),
++    &sr__notif_store_cleanup_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "delayed_msg_req",
++    15,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__InternalRequest, delayed_msg_req),
++    &sr__delayed_msg_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "nacm_reload_req",
++    16,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__InternalRequest, nacm_reload_req),
++    &sr__nacm_reload_req__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__internal_request__field_indices_by_name[] = {
++  3,   /* field[3] = commit_timeout_req */
++  7,   /* field[7] = delayed_msg_req */
++  5,   /* field[5] = internal_state_data_req */
++  8,   /* field[8] = nacm_reload_req */
++  6,   /* field[6] = notif_store_cleanup_req */
++  4,   /* field[4] = oper_data_timeout_req */
++  0,   /* field[0] = operation */
++  1,   /* field[1] = postpone_timeout */
++  2,   /* field[2] = unsubscribe_dst_req */
++};
++static const ProtobufCIntRange sr__internal_request__number_ranges[2 + 1] =
++{
++  { 1, 0 },
++  { 10, 2 },
++  { 0, 9 }
++};
++const ProtobufCMessageDescriptor sr__internal_request__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.InternalRequest",
++  "InternalRequest",
++  "Sr__InternalRequest",
++  "sr",
++  sizeof(Sr__InternalRequest),
++  9,
++  sr__internal_request__field_descriptors,
++  sr__internal_request__field_indices_by_name,
++  2,  sr__internal_request__number_ranges,
++  (ProtobufCMessageInit) sr__internal_request__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCEnumValue sr__msg__msg_type__enum_values_by_number[5] =
++{
++  { "REQUEST", "SR__MSG__MSG_TYPE__REQUEST", 1 },
++  { "RESPONSE", "SR__MSG__MSG_TYPE__RESPONSE", 2 },
++  { "NOTIFICATION", "SR__MSG__MSG_TYPE__NOTIFICATION", 3 },
++  { "NOTIFICATION_ACK", "SR__MSG__MSG_TYPE__NOTIFICATION_ACK", 4 },
++  { "INTERNAL_REQUEST", "SR__MSG__MSG_TYPE__INTERNAL_REQUEST", 5 },
++};
++static const ProtobufCIntRange sr__msg__msg_type__value_ranges[] = {
++{1, 0},{0, 5}
++};
++static const ProtobufCEnumValueIndex sr__msg__msg_type__enum_values_by_name[5] =
++{
++  { "INTERNAL_REQUEST", 4 },
++  { "NOTIFICATION", 2 },
++  { "NOTIFICATION_ACK", 3 },
++  { "REQUEST", 0 },
++  { "RESPONSE", 1 },
++};
++const ProtobufCEnumDescriptor sr__msg__msg_type__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.Msg.MsgType",
++  "MsgType",
++  "Sr__Msg__MsgType",
++  "sr",
++  5,
++  sr__msg__msg_type__enum_values_by_number,
++  5,
++  sr__msg__msg_type__enum_values_by_name,
++  1,
++  sr__msg__msg_type__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
++static const ProtobufCFieldDescriptor sr__msg__field_descriptors[8] =
++{
++  {
++    "type",
++    1,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_ENUM,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Msg, type),
++    &sr__msg__msg_type__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "session_id",
++    2,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT32,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Msg, session_id),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "request",
++    3,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Msg, request),
++    &sr__request__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "response",
++    4,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Msg, response),
++    &sr__response__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "notification",
++    5,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Msg, notification),
++    &sr__notification__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "notification_ack",
++    6,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Msg, notification_ack),
++    &sr__notification_ack__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "internal_request",
++    7,
++    PROTOBUF_C_LABEL_OPTIONAL,
++    PROTOBUF_C_TYPE_MESSAGE,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Msg, internal_request),
++    &sr__internal_request__descriptor,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++  {
++    "_sysrepo_mem_ctx",
++    20,
++    PROTOBUF_C_LABEL_REQUIRED,
++    PROTOBUF_C_TYPE_UINT64,
++    0,   /* quantifier_offset */
++    offsetof(Sr__Msg, _sysrepo_mem_ctx),
++    NULL,
++    NULL,
++    0,             /* flags */
++    0,NULL,NULL    /* reserved1,reserved2, etc */
++  },
++};
++static const unsigned sr__msg__field_indices_by_name[] = {
++  7,   /* field[7] = _sysrepo_mem_ctx */
++  6,   /* field[6] = internal_request */
++  4,   /* field[4] = notification */
++  5,   /* field[5] = notification_ack */
++  2,   /* field[2] = request */
++  3,   /* field[3] = response */
++  1,   /* field[1] = session_id */
++  0,   /* field[0] = type */
++};
++static const ProtobufCIntRange sr__msg__number_ranges[2 + 1] =
++{
++  { 1, 0 },
++  { 20, 7 },
++  { 0, 8 }
++};
++const ProtobufCMessageDescriptor sr__msg__descriptor =
++{
++  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
++  "sr.Msg",
++  "Msg",
++  "Sr__Msg",
++  "sr",
++  sizeof(Sr__Msg),
++  8,
++  sr__msg__field_descriptors,
++  sr__msg__field_indices_by_name,
++  2,  sr__msg__number_ranges,
++  (ProtobufCMessageInit) sr__msg__init,
++  NULL,NULL,NULL    /* reserved[123] */
++};
++static const ProtobufCEnumValue sr__api_variant__enum_values_by_number[2] =
++{
++  { "VALUES", "SR__API_VARIANT__VALUES", 1 },
++  { "TREES", "SR__API_VARIANT__TREES", 2 },
++};
++static const ProtobufCIntRange sr__api_variant__value_ranges[] = {
++{1, 0},{0, 2}
++};
++static const ProtobufCEnumValueIndex sr__api_variant__enum_values_by_name[2] =
++{
++  { "TREES", 1 },
++  { "VALUES", 0 },
++};
++const ProtobufCEnumDescriptor sr__api_variant__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.ApiVariant",
++  "ApiVariant",
++  "Sr__ApiVariant",
++  "sr",
++  2,
++  sr__api_variant__enum_values_by_number,
++  2,
++  sr__api_variant__enum_values_by_name,
++  1,
++  sr__api_variant__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
++static const ProtobufCEnumValue sr__data_store__enum_values_by_number[3] =
++{
++  { "STARTUP", "SR__DATA_STORE__STARTUP", 1 },
++  { "RUNNING", "SR__DATA_STORE__RUNNING", 2 },
++  { "CANDIDATE", "SR__DATA_STORE__CANDIDATE", 3 },
++};
++static const ProtobufCIntRange sr__data_store__value_ranges[] = {
++{1, 0},{0, 3}
++};
++static const ProtobufCEnumValueIndex sr__data_store__enum_values_by_name[3] =
++{
++  { "CANDIDATE", 2 },
++  { "RUNNING", 1 },
++  { "STARTUP", 0 },
++};
++const ProtobufCEnumDescriptor sr__data_store__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.DataStore",
++  "DataStore",
++  "Sr__DataStore",
++  "sr",
++  3,
++  sr__data_store__enum_values_by_number,
++  3,
++  sr__data_store__enum_values_by_name,
++  1,
++  sr__data_store__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
++static const ProtobufCEnumValue sr__session_flags__enum_values_by_number[4] =
++{
++  { "SESS_DEFAULT", "SR__SESSION_FLAGS__SESS_DEFAULT", 0 },
++  { "SESS_CONFIG_ONLY", "SR__SESSION_FLAGS__SESS_CONFIG_ONLY", 1 },
++  { "SESS_ENABLE_NACM", "SR__SESSION_FLAGS__SESS_ENABLE_NACM", 2 },
++  { "SESS_NOTIFICATION", "SR__SESSION_FLAGS__SESS_NOTIFICATION", 1024 },
++};
++static const ProtobufCIntRange sr__session_flags__value_ranges[] = {
++{0, 0},{1024, 3},{0, 4}
++};
++static const ProtobufCEnumValueIndex sr__session_flags__enum_values_by_name[4] =
++{
++  { "SESS_CONFIG_ONLY", 1 },
++  { "SESS_DEFAULT", 0 },
++  { "SESS_ENABLE_NACM", 2 },
++  { "SESS_NOTIFICATION", 3 },
++};
++const ProtobufCEnumDescriptor sr__session_flags__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.SessionFlags",
++  "SessionFlags",
++  "Sr__SessionFlags",
++  "sr",
++  4,
++  sr__session_flags__enum_values_by_number,
++  4,
++  sr__session_flags__enum_values_by_name,
++  2,
++  sr__session_flags__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
++static const ProtobufCEnumValue sr__edit_flags__enum_values_by_number[3] =
++{
++  { "EDIT_DEFAULT", "SR__EDIT_FLAGS__EDIT_DEFAULT", 0 },
++  { "EDIT_NON_RECURSIVE", "SR__EDIT_FLAGS__EDIT_NON_RECURSIVE", 1 },
++  { "EDIT_STRICT", "SR__EDIT_FLAGS__EDIT_STRICT", 2 },
++};
++static const ProtobufCIntRange sr__edit_flags__value_ranges[] = {
++{0, 0},{0, 3}
++};
++static const ProtobufCEnumValueIndex sr__edit_flags__enum_values_by_name[3] =
++{
++  { "EDIT_DEFAULT", 0 },
++  { "EDIT_NON_RECURSIVE", 1 },
++  { "EDIT_STRICT", 2 },
++};
++const ProtobufCEnumDescriptor sr__edit_flags__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.EditFlags",
++  "EditFlags",
++  "Sr__EditFlags",
++  "sr",
++  3,
++  sr__edit_flags__enum_values_by_number,
++  3,
++  sr__edit_flags__enum_values_by_name,
++  1,
++  sr__edit_flags__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
++static const ProtobufCEnumValue sr__subscription_type__enum_values_by_number[10] =
++{
++  { "MODULE_INSTALL_SUBS", "SR__SUBSCRIPTION_TYPE__MODULE_INSTALL_SUBS", 1 },
++  { "FEATURE_ENABLE_SUBS", "SR__SUBSCRIPTION_TYPE__FEATURE_ENABLE_SUBS", 2 },
++  { "MODULE_CHANGE_SUBS", "SR__SUBSCRIPTION_TYPE__MODULE_CHANGE_SUBS", 10 },
++  { "SUBTREE_CHANGE_SUBS", "SR__SUBSCRIPTION_TYPE__SUBTREE_CHANGE_SUBS", 11 },
++  { "DP_GET_ITEMS_SUBS", "SR__SUBSCRIPTION_TYPE__DP_GET_ITEMS_SUBS", 20 },
++  { "RPC_SUBS", "SR__SUBSCRIPTION_TYPE__RPC_SUBS", 30 },
++  { "ACTION_SUBS", "SR__SUBSCRIPTION_TYPE__ACTION_SUBS", 31 },
++  { "EVENT_NOTIF_SUBS", "SR__SUBSCRIPTION_TYPE__EVENT_NOTIF_SUBS", 40 },
++  { "HELLO_SUBS", "SR__SUBSCRIPTION_TYPE__HELLO_SUBS", 50 },
++  { "COMMIT_END_SUBS", "SR__SUBSCRIPTION_TYPE__COMMIT_END_SUBS", 51 },
++};
++static const ProtobufCIntRange sr__subscription_type__value_ranges[] = {
++{1, 0},{10, 2},{20, 4},{30, 5},{40, 7},{50, 8},{0, 10}
++};
++static const ProtobufCEnumValueIndex sr__subscription_type__enum_values_by_name[10] =
++{
++  { "ACTION_SUBS", 6 },
++  { "COMMIT_END_SUBS", 9 },
++  { "DP_GET_ITEMS_SUBS", 4 },
++  { "EVENT_NOTIF_SUBS", 7 },
++  { "FEATURE_ENABLE_SUBS", 1 },
++  { "HELLO_SUBS", 8 },
++  { "MODULE_CHANGE_SUBS", 2 },
++  { "MODULE_INSTALL_SUBS", 0 },
++  { "RPC_SUBS", 5 },
++  { "SUBTREE_CHANGE_SUBS", 3 },
++};
++const ProtobufCEnumDescriptor sr__subscription_type__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.SubscriptionType",
++  "SubscriptionType",
++  "Sr__SubscriptionType",
++  "sr",
++  10,
++  sr__subscription_type__enum_values_by_number,
++  10,
++  sr__subscription_type__enum_values_by_name,
++  6,
++  sr__subscription_type__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
++static const ProtobufCEnumValue sr__notification_event__enum_values_by_number[4] =
++{
++  { "VERIFY_EV", "SR__NOTIFICATION_EVENT__VERIFY_EV", 1 },
++  { "APPLY_EV", "SR__NOTIFICATION_EVENT__APPLY_EV", 2 },
++  { "ABORT_EV", "SR__NOTIFICATION_EVENT__ABORT_EV", 3 },
++  { "ENABLED_EV", "SR__NOTIFICATION_EVENT__ENABLED_EV", 4 },
++};
++static const ProtobufCIntRange sr__notification_event__value_ranges[] = {
++{1, 0},{0, 4}
++};
++static const ProtobufCEnumValueIndex sr__notification_event__enum_values_by_name[4] =
++{
++  { "ABORT_EV", 2 },
++  { "APPLY_EV", 1 },
++  { "ENABLED_EV", 3 },
++  { "VERIFY_EV", 0 },
++};
++const ProtobufCEnumDescriptor sr__notification_event__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.NotificationEvent",
++  "NotificationEvent",
++  "Sr__NotificationEvent",
++  "sr",
++  4,
++  sr__notification_event__enum_values_by_number,
++  4,
++  sr__notification_event__enum_values_by_name,
++  1,
++  sr__notification_event__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
++static const ProtobufCEnumValue sr__module_state__enum_values_by_number[3] =
++{
++  { "UNINSTALLED", "SR__MODULE_STATE__UNINSTALLED", 1 },
++  { "IMPORTED", "SR__MODULE_STATE__IMPORTED", 2 },
++  { "IMPLEMENTED", "SR__MODULE_STATE__IMPLEMENTED", 3 },
++};
++static const ProtobufCIntRange sr__module_state__value_ranges[] = {
++{1, 0},{0, 3}
++};
++static const ProtobufCEnumValueIndex sr__module_state__enum_values_by_name[3] =
++{
++  { "IMPLEMENTED", 2 },
++  { "IMPORTED", 1 },
++  { "UNINSTALLED", 0 },
++};
++const ProtobufCEnumDescriptor sr__module_state__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.ModuleState",
++  "ModuleState",
++  "Sr__ModuleState",
++  "sr",
++  3,
++  sr__module_state__enum_values_by_number,
++  3,
++  sr__module_state__enum_values_by_name,
++  1,
++  sr__module_state__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
++static const ProtobufCEnumValue sr__change_operation__enum_values_by_number[4] =
++{
++  { "CREATED", "SR__CHANGE_OPERATION__CREATED", 1 },
++  { "MODIFIED", "SR__CHANGE_OPERATION__MODIFIED", 2 },
++  { "DELETED", "SR__CHANGE_OPERATION__DELETED", 3 },
++  { "MOVED", "SR__CHANGE_OPERATION__MOVED", 4 },
++};
++static const ProtobufCIntRange sr__change_operation__value_ranges[] = {
++{1, 0},{0, 4}
++};
++static const ProtobufCEnumValueIndex sr__change_operation__enum_values_by_name[4] =
++{
++  { "CREATED", 0 },
++  { "DELETED", 2 },
++  { "MODIFIED", 1 },
++  { "MOVED", 3 },
++};
++const ProtobufCEnumDescriptor sr__change_operation__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.ChangeOperation",
++  "ChangeOperation",
++  "Sr__ChangeOperation",
++  "sr",
++  4,
++  sr__change_operation__enum_values_by_number,
++  4,
++  sr__change_operation__enum_values_by_name,
++  1,
++  sr__change_operation__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
++static const ProtobufCEnumValue sr__operation__enum_values_by_number[43] =
++{
++  { "SESSION_START", "SR__OPERATION__SESSION_START", 10 },
++  { "SESSION_STOP", "SR__OPERATION__SESSION_STOP", 11 },
++  { "SESSION_REFRESH", "SR__OPERATION__SESSION_REFRESH", 12 },
++  { "SESSION_CHECK", "SR__OPERATION__SESSION_CHECK", 13 },
++  { "SESSION_SWITCH_DS", "SR__OPERATION__SESSION_SWITCH_DS", 14 },
++  { "SESSION_SET_OPTS", "SR__OPERATION__SESSION_SET_OPTS", 15 },
++  { "VERSION_VERIFY", "SR__OPERATION__VERSION_VERIFY", 16 },
++  { "LIST_SCHEMAS", "SR__OPERATION__LIST_SCHEMAS", 20 },
++  { "GET_SCHEMA", "SR__OPERATION__GET_SCHEMA", 21 },
++  { "MODULE_INSTALL", "SR__OPERATION__MODULE_INSTALL", 22 },
++  { "FEATURE_ENABLE", "SR__OPERATION__FEATURE_ENABLE", 23 },
++  { "GET_ITEM", "SR__OPERATION__GET_ITEM", 30 },
++  { "GET_ITEMS", "SR__OPERATION__GET_ITEMS", 31 },
++  { "GET_SUBTREE", "SR__OPERATION__GET_SUBTREE", 32 },
++  { "GET_SUBTREES", "SR__OPERATION__GET_SUBTREES", 33 },
++  { "GET_SUBTREE_CHUNK", "SR__OPERATION__GET_SUBTREE_CHUNK", 34 },
++  { "SET_ITEM", "SR__OPERATION__SET_ITEM", 40 },
++  { "DELETE_ITEM", "SR__OPERATION__DELETE_ITEM", 41 },
++  { "MOVE_ITEM", "SR__OPERATION__MOVE_ITEM", 42 },
++  { "SET_ITEM_STR", "SR__OPERATION__SET_ITEM_STR", 43 },
++  { "VALIDATE", "SR__OPERATION__VALIDATE", 50 },
++  { "COMMIT", "SR__OPERATION__COMMIT", 51 },
++  { "DISCARD_CHANGES", "SR__OPERATION__DISCARD_CHANGES", 52 },
++  { "COPY_CONFIG", "SR__OPERATION__COPY_CONFIG", 53 },
++  { "LOCK", "SR__OPERATION__LOCK", 60 },
++  { "UNLOCK", "SR__OPERATION__UNLOCK", 61 },
++  { "SUBSCRIBE", "SR__OPERATION__SUBSCRIBE", 70 },
++  { "UNSUBSCRIBE", "SR__OPERATION__UNSUBSCRIBE", 71 },
++  { "CHECK_ENABLED_RUNNING", "SR__OPERATION__CHECK_ENABLED_RUNNING", 72 },
++  { "GET_CHANGES", "SR__OPERATION__GET_CHANGES", 73 },
++  { "DATA_PROVIDE", "SR__OPERATION__DATA_PROVIDE", 80 },
++  { "CHECK_EXEC_PERMISSION", "SR__OPERATION__CHECK_EXEC_PERMISSION", 81 },
++  { "RPC", "SR__OPERATION__RPC", 82 },
++  { "ACTION", "SR__OPERATION__ACTION", 83 },
++  { "EVENT_NOTIF", "SR__OPERATION__EVENT_NOTIF", 84 },
++  { "EVENT_NOTIF_REPLAY", "SR__OPERATION__EVENT_NOTIF_REPLAY", 85 },
++  { "UNSUBSCRIBE_DESTINATION", "SR__OPERATION__UNSUBSCRIBE_DESTINATION", 101 },
++  { "COMMIT_TIMEOUT", "SR__OPERATION__COMMIT_TIMEOUT", 102 },
++  { "OPER_DATA_TIMEOUT", "SR__OPERATION__OPER_DATA_TIMEOUT", 103 },
++  { "INTERNAL_STATE_DATA", "SR__OPERATION__INTERNAL_STATE_DATA", 104 },
++  { "NOTIF_STORE_CLEANUP", "SR__OPERATION__NOTIF_STORE_CLEANUP", 105 },
++  { "DELAYED_MSG", "SR__OPERATION__DELAYED_MSG", 106 },
++  { "NACM_RELOAD", "SR__OPERATION__NACM_RELOAD", 107 },
++};
++static const ProtobufCIntRange sr__operation__value_ranges[] = {
++{10, 0},{20, 7},{30, 11},{40, 16},{50, 20},{60, 24},{70, 26},{80, 30},{101, 36},{0, 43}
++};
++static const ProtobufCEnumValueIndex sr__operation__enum_values_by_name[43] =
++{
++  { "ACTION", 33 },
++  { "CHECK_ENABLED_RUNNING", 28 },
++  { "CHECK_EXEC_PERMISSION", 31 },
++  { "COMMIT", 21 },
++  { "COMMIT_TIMEOUT", 37 },
++  { "COPY_CONFIG", 23 },
++  { "DATA_PROVIDE", 30 },
++  { "DELAYED_MSG", 41 },
++  { "DELETE_ITEM", 17 },
++  { "DISCARD_CHANGES", 22 },
++  { "EVENT_NOTIF", 34 },
++  { "EVENT_NOTIF_REPLAY", 35 },
++  { "FEATURE_ENABLE", 10 },
++  { "GET_CHANGES", 29 },
++  { "GET_ITEM", 11 },
++  { "GET_ITEMS", 12 },
++  { "GET_SCHEMA", 8 },
++  { "GET_SUBTREE", 13 },
++  { "GET_SUBTREES", 14 },
++  { "GET_SUBTREE_CHUNK", 15 },
++  { "INTERNAL_STATE_DATA", 39 },
++  { "LIST_SCHEMAS", 7 },
++  { "LOCK", 24 },
++  { "MODULE_INSTALL", 9 },
++  { "MOVE_ITEM", 18 },
++  { "NACM_RELOAD", 42 },
++  { "NOTIF_STORE_CLEANUP", 40 },
++  { "OPER_DATA_TIMEOUT", 38 },
++  { "RPC", 32 },
++  { "SESSION_CHECK", 3 },
++  { "SESSION_REFRESH", 2 },
++  { "SESSION_SET_OPTS", 5 },
++  { "SESSION_START", 0 },
++  { "SESSION_STOP", 1 },
++  { "SESSION_SWITCH_DS", 4 },
++  { "SET_ITEM", 16 },
++  { "SET_ITEM_STR", 19 },
++  { "SUBSCRIBE", 26 },
++  { "UNLOCK", 25 },
++  { "UNSUBSCRIBE", 27 },
++  { "UNSUBSCRIBE_DESTINATION", 36 },
++  { "VALIDATE", 20 },
++  { "VERSION_VERIFY", 6 },
++};
++const ProtobufCEnumDescriptor sr__operation__descriptor =
++{
++  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
++  "sr.Operation",
++  "Operation",
++  "Sr__Operation",
++  "sr",
++  43,
++  sr__operation__enum_values_by_number,
++  43,
++  sr__operation__enum_values_by_name,
++  9,
++  sr__operation__value_ranges,
++  NULL,NULL,NULL,NULL   /* reserved[1234] */
++};
+Index: sysrepo-7aa2f18d234267403147df92c0005c871f0aa840/src/common/sysrepo.pb-c.h
+===================================================================
+--- /dev/null
++++ sysrepo-7aa2f18d234267403147df92c0005c871f0aa840/src/common/sysrepo.pb-c.h
+@@ -0,0 +1,4238 @@
++/* Generated by the protocol buffer compiler.  DO NOT EDIT! */
++/* Generated from: sysrepo.proto */
++
++#ifndef PROTOBUF_C_sysrepo_2eproto__INCLUDED
++#define PROTOBUF_C_sysrepo_2eproto__INCLUDED
++
++#include <protobuf-c/protobuf-c.h>
++
++PROTOBUF_C__BEGIN_DECLS
++
++#if PROTOBUF_C_VERSION_NUMBER < 1000000
++# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
++#elif 1002001 < PROTOBUF_C_MIN_COMPILER_VERSION
++# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
++#endif
++
++
++typedef struct _Sr__Value Sr__Value;
++typedef struct _Sr__Node Sr__Node;
++typedef struct _Sr__Error Sr__Error;
++typedef struct _Sr__SessionStartReq Sr__SessionStartReq;
++typedef struct _Sr__SessionStartResp Sr__SessionStartResp;
++typedef struct _Sr__SessionStopReq Sr__SessionStopReq;
++typedef struct _Sr__SessionStopResp Sr__SessionStopResp;
++typedef struct _Sr__SessionRefreshReq Sr__SessionRefreshReq;
++typedef struct _Sr__SessionRefreshResp Sr__SessionRefreshResp;
++typedef struct _Sr__SessionCheckReq Sr__SessionCheckReq;
++typedef struct _Sr__SessionCheckResp Sr__SessionCheckResp;
++typedef struct _Sr__SessionSwitchDsReq Sr__SessionSwitchDsReq;
++typedef struct _Sr__SessionSwitchDsResp Sr__SessionSwitchDsResp;
++typedef struct _Sr__SessionSetOptsReq Sr__SessionSetOptsReq;
++typedef struct _Sr__SessionSetOptsResp Sr__SessionSetOptsResp;
++typedef struct _Sr__VersionVerifyReq Sr__VersionVerifyReq;
++typedef struct _Sr__VersionVerifyResp Sr__VersionVerifyResp;
++typedef struct _Sr__SchemaRevision Sr__SchemaRevision;
++typedef struct _Sr__SchemaSubmodule Sr__SchemaSubmodule;
++typedef struct _Sr__Schema Sr__Schema;
++typedef struct _Sr__ListSchemasReq Sr__ListSchemasReq;
++typedef struct _Sr__ListSchemasResp Sr__ListSchemasResp;
++typedef struct _Sr__GetSchemaReq Sr__GetSchemaReq;
++typedef struct _Sr__GetSchemaResp Sr__GetSchemaResp;
++typedef struct _Sr__GetItemReq Sr__GetItemReq;
++typedef struct _Sr__GetItemResp Sr__GetItemResp;
++typedef struct _Sr__GetItemsReq Sr__GetItemsReq;
++typedef struct _Sr__GetItemsResp Sr__GetItemsResp;
++typedef struct _Sr__GetSubtreeReq Sr__GetSubtreeReq;
++typedef struct _Sr__GetSubtreeResp Sr__GetSubtreeResp;
++typedef struct _Sr__GetSubtreesReq Sr__GetSubtreesReq;
++typedef struct _Sr__GetSubtreesResp Sr__GetSubtreesResp;
++typedef struct _Sr__GetSubtreeChunkReq Sr__GetSubtreeChunkReq;
++typedef struct _Sr__GetSubtreeChunkResp Sr__GetSubtreeChunkResp;
++typedef struct _Sr__SetItemReq Sr__SetItemReq;
++typedef struct _Sr__SetItemResp Sr__SetItemResp;
++typedef struct _Sr__SetItemStrReq Sr__SetItemStrReq;
++typedef struct _Sr__SetItemStrResp Sr__SetItemStrResp;
++typedef struct _Sr__DeleteItemReq Sr__DeleteItemReq;
++typedef struct _Sr__DeleteItemResp Sr__DeleteItemResp;
++typedef struct _Sr__MoveItemReq Sr__MoveItemReq;
++typedef struct _Sr__MoveItemResp Sr__MoveItemResp;
++typedef struct _Sr__ValidateReq Sr__ValidateReq;
++typedef struct _Sr__ValidateResp Sr__ValidateResp;
++typedef struct _Sr__CommitReq Sr__CommitReq;
++typedef struct _Sr__CommitResp Sr__CommitResp;
++typedef struct _Sr__DiscardChangesReq Sr__DiscardChangesReq;
++typedef struct _Sr__DiscardChangesResp Sr__DiscardChangesResp;
++typedef struct _Sr__CopyConfigReq Sr__CopyConfigReq;
++typedef struct _Sr__CopyConfigResp Sr__CopyConfigResp;
++typedef struct _Sr__LockReq Sr__LockReq;
++typedef struct _Sr__LockResp Sr__LockResp;
++typedef struct _Sr__UnlockReq Sr__UnlockReq;
++typedef struct _Sr__UnlockResp Sr__UnlockResp;
++typedef struct _Sr__SubscribeReq Sr__SubscribeReq;
++typedef struct _Sr__SubscribeResp Sr__SubscribeResp;
++typedef struct _Sr__UnsubscribeReq Sr__UnsubscribeReq;
++typedef struct _Sr__UnsubscribeResp Sr__UnsubscribeResp;
++typedef struct _Sr__CheckEnabledRunningReq Sr__CheckEnabledRunningReq;
++typedef struct _Sr__CheckEnabledRunningResp Sr__CheckEnabledRunningResp;
++typedef struct _Sr__ModuleInstallNotification Sr__ModuleInstallNotification;
++typedef struct _Sr__FeatureEnableNotification Sr__FeatureEnableNotification;
++typedef struct _Sr__ModuleChangeNotification Sr__ModuleChangeNotification;
++typedef struct _Sr__SubtreeChangeNotification Sr__SubtreeChangeNotification;
++typedef struct _Sr__Change Sr__Change;
++typedef struct _Sr__GetChangesReq Sr__GetChangesReq;
++typedef struct _Sr__GetChangesResp Sr__GetChangesResp;
++typedef struct _Sr__CheckExecPermReq Sr__CheckExecPermReq;
++typedef struct _Sr__CheckExecPermResp Sr__CheckExecPermResp;
++typedef struct _Sr__RPCReq Sr__RPCReq;
++typedef struct _Sr__RPCResp Sr__RPCResp;
++typedef struct _Sr__EventNotifReq Sr__EventNotifReq;
++typedef struct _Sr__EventNotifResp Sr__EventNotifResp;
++typedef struct _Sr__EventNotifReplayReq Sr__EventNotifReplayReq;
++typedef struct _Sr__EventNotifReplayResp Sr__EventNotifReplayResp;
++typedef struct _Sr__DataProvideReq Sr__DataProvideReq;
++typedef struct _Sr__DataProvideResp Sr__DataProvideResp;
++typedef struct _Sr__ModuleInstallReq Sr__ModuleInstallReq;
++typedef struct _Sr__ModuleInstallResp Sr__ModuleInstallResp;
++typedef struct _Sr__FeatureEnableReq Sr__FeatureEnableReq;
++typedef struct _Sr__FeatureEnableResp Sr__FeatureEnableResp;
++typedef struct _Sr__UnsubscribeDestinationReq Sr__UnsubscribeDestinationReq;
++typedef struct _Sr__CommitTimeoutReq Sr__CommitTimeoutReq;
++typedef struct _Sr__OperDataTimeoutReq Sr__OperDataTimeoutReq;
++typedef struct _Sr__InternalStateDataReq Sr__InternalStateDataReq;
++typedef struct _Sr__NotifStoreCleanupReq Sr__NotifStoreCleanupReq;
++typedef struct _Sr__DelayedMsgReq Sr__DelayedMsgReq;
++typedef struct _Sr__NacmReloadReq Sr__NacmReloadReq;
++typedef struct _Sr__Request Sr__Request;
++typedef struct _Sr__Response Sr__Response;
++typedef struct _Sr__Notification Sr__Notification;
++typedef struct _Sr__NotificationAck Sr__NotificationAck;
++typedef struct _Sr__InternalRequest Sr__InternalRequest;
++typedef struct _Sr__Msg Sr__Msg;
++
++
++/* --- enums --- */
++
++typedef enum _Sr__Value__Types {
++  SR__VALUE__TYPES__LIST = 1,
++  SR__VALUE__TYPES__CONTAINER = 2,
++  SR__VALUE__TYPES__CONTAINER_PRESENCE = 3,
++  SR__VALUE__TYPES__LEAF_EMPTY = 4,
++  SR__VALUE__TYPES__BINARY = 10,
++  SR__VALUE__TYPES__BITS = 11,
++  SR__VALUE__TYPES__BOOL = 12,
++  SR__VALUE__TYPES__DECIMAL64 = 13,
++  SR__VALUE__TYPES__ENUM = 14,
++  SR__VALUE__TYPES__IDENTITYREF = 15,
++  SR__VALUE__TYPES__INSTANCEID = 16,
++  SR__VALUE__TYPES__INT8 = 17,
++  SR__VALUE__TYPES__INT16 = 18,
++  SR__VALUE__TYPES__INT32 = 19,
++  SR__VALUE__TYPES__INT64 = 20,
++  SR__VALUE__TYPES__STRING = 21,
++  SR__VALUE__TYPES__UINT8 = 22,
++  SR__VALUE__TYPES__UINT16 = 23,
++  SR__VALUE__TYPES__UINT32 = 24,
++  SR__VALUE__TYPES__UINT64 = 25,
++  SR__VALUE__TYPES__ANYXML = 26,
++  SR__VALUE__TYPES__ANYDATA = 27
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__VALUE__TYPES)
++} Sr__Value__Types;
++typedef enum _Sr__MoveItemReq__MovePosition {
++  SR__MOVE_ITEM_REQ__MOVE_POSITION__BEFORE = 1,
++  SR__MOVE_ITEM_REQ__MOVE_POSITION__AFTER = 2,
++  SR__MOVE_ITEM_REQ__MOVE_POSITION__FIRST = 3,
++  SR__MOVE_ITEM_REQ__MOVE_POSITION__LAST = 4
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__MOVE_ITEM_REQ__MOVE_POSITION)
++} Sr__MoveItemReq__MovePosition;
++/*
++ **
++ * @brief Type of the event notification.
++ */
++typedef enum _Sr__EventNotifReq__NotifType {
++  SR__EVENT_NOTIF_REQ__NOTIF_TYPE__REALTIME = 1,
++  SR__EVENT_NOTIF_REQ__NOTIF_TYPE__REPLAY = 2,
++  SR__EVENT_NOTIF_REQ__NOTIF_TYPE__REPLAY_COMPLETE = 3,
++  SR__EVENT_NOTIF_REQ__NOTIF_TYPE__REPLAY_STOP = 4
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__EVENT_NOTIF_REQ__NOTIF_TYPE)
++} Sr__EventNotifReq__NotifType;
++/*
++ **
++ * @brief Flags used to override default session handling.
++ */
++typedef enum _Sr__EventNotifReq__NotifFlags {
++  /*
++   **< Notification will be handled normally. 
++   */
++  SR__EVENT_NOTIF_REQ__NOTIF_FLAGS__DEFAULT = 0,
++  /*
++   **< Notification will not be stored in the notification store. 
++   */
++  SR__EVENT_NOTIF_REQ__NOTIF_FLAGS__EPHEMERAL = 1
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__EVENT_NOTIF_REQ__NOTIF_FLAGS)
++} Sr__EventNotifReq__NotifFlags;
++/*
++ **
++ * @brief Type of the message.
++ */
++typedef enum _Sr__Msg__MsgType {
++  /*
++   **< The message is a request. 
++   */
++  SR__MSG__MSG_TYPE__REQUEST = 1,
++  /*
++   **< The message is a response to the request. 
++   */
++  SR__MSG__MSG_TYPE__RESPONSE = 2,
++  /*
++   **< The message is a notification. 
++   */
++  SR__MSG__MSG_TYPE__NOTIFICATION = 3,
++  /*
++   **< The message is a notification acknowledgment. 
++   */
++  SR__MSG__MSG_TYPE__NOTIFICATION_ACK = 4,
++  /*
++   **< The message is an internal request, should not be used from the public API. 
++   */
++  SR__MSG__MSG_TYPE__INTERNAL_REQUEST = 5
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__MSG__MSG_TYPE)
++} Sr__Msg__MsgType;
++/*
++ **
++ * @brief Variant of the API. Currently only values (sr_val_t) vs. trees (sr_node_t).
++ */
++typedef enum _Sr__ApiVariant {
++  SR__API_VARIANT__VALUES = 1,
++  SR__API_VARIANT__TREES = 2
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__API_VARIANT)
++} Sr__ApiVariant;
++/*
++ **
++ * @brief Datastore on which the configuration session will operate.
++ */
++typedef enum _Sr__DataStore {
++  SR__DATA_STORE__STARTUP = 1,
++  SR__DATA_STORE__RUNNING = 2,
++  SR__DATA_STORE__CANDIDATE = 3
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__DATA_STORE)
++} Sr__DataStore;
++/*
++ **
++ * @brief Flags used to override default session handling.
++ */
++typedef enum _Sr__SessionFlags {
++  /*
++   **< Default (normal) session behavior. 
++   */
++  SR__SESSION_FLAGS__SESS_DEFAULT = 0,
++  /*
++   **< Session will process only configuration data (e.g. sysrepo won't
++   *return any state data by ::sr_get_items / ::sr_get_items_iter calls). 
++   */
++  SR__SESSION_FLAGS__SESS_CONFIG_ONLY = 1,
++  /*
++   **< Enable NETCONF access control for this session. 
++   */
++  SR__SESSION_FLAGS__SESS_ENABLE_NACM = 2,
++  /*
++   **< Notification session (internal type of session). 
++   */
++  SR__SESSION_FLAGS__SESS_NOTIFICATION = 1024
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__SESSION_FLAGS)
++} Sr__SessionFlags;
++/*
++ **
++ * @brief Flags used to override default behavior of data manipulation calls.
++ */
++typedef enum _Sr__EditFlags {
++  /*
++   **< Default behavior - recursive and non-strict. 
++   */
++  SR__EDIT_FLAGS__EDIT_DEFAULT = 0,
++  /*
++   **< Non-recursive behavior:
++   *by ::SetItemReq, all preceding nodes (parents) of the identified element must exist,
++   *by ::DeleteItemReq xpath must not identify an non-empty list or non-empty container. 
++   */
++  SR__EDIT_FLAGS__EDIT_NON_RECURSIVE = 1,
++  /*
++   **< Strict behavior:
++   *by ::SetItemReq the identified element must not exist (similar to netconf create operation),
++   *by ::DeleteItemReq the identified element must exist (similar to netconf delete operation). 
++   */
++  SR__EDIT_FLAGS__EDIT_STRICT = 2
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__EDIT_FLAGS)
++} Sr__EditFlags;
++typedef enum _Sr__SubscriptionType {
++  SR__SUBSCRIPTION_TYPE__MODULE_INSTALL_SUBS = 1,
++  SR__SUBSCRIPTION_TYPE__FEATURE_ENABLE_SUBS = 2,
++  SR__SUBSCRIPTION_TYPE__MODULE_CHANGE_SUBS = 10,
++  SR__SUBSCRIPTION_TYPE__SUBTREE_CHANGE_SUBS = 11,
++  SR__SUBSCRIPTION_TYPE__DP_GET_ITEMS_SUBS = 20,
++  SR__SUBSCRIPTION_TYPE__RPC_SUBS = 30,
++  SR__SUBSCRIPTION_TYPE__ACTION_SUBS = 31,
++  SR__SUBSCRIPTION_TYPE__EVENT_NOTIF_SUBS = 40,
++  /*
++   **< Used only internally to test for inactive notification subscriptions. 
++   */
++  SR__SUBSCRIPTION_TYPE__HELLO_SUBS = 50,
++  /*
++   **< Used only internally to notify about the end of the commit process. 
++   */
++  SR__SUBSCRIPTION_TYPE__COMMIT_END_SUBS = 51
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__SUBSCRIPTION_TYPE)
++} Sr__SubscriptionType;
++typedef enum _Sr__NotificationEvent {
++  SR__NOTIFICATION_EVENT__VERIFY_EV = 1,
++  SR__NOTIFICATION_EVENT__APPLY_EV = 2,
++  SR__NOTIFICATION_EVENT__ABORT_EV = 3,
++  SR__NOTIFICATION_EVENT__ENABLED_EV = 4
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__NOTIFICATION_EVENT)
++} Sr__NotificationEvent;
++typedef enum _Sr__ModuleState {
++  SR__MODULE_STATE__UNINSTALLED = 1,
++  SR__MODULE_STATE__IMPORTED = 2,
++  SR__MODULE_STATE__IMPLEMENTED = 3
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__MODULE_STATE)
++} Sr__ModuleState;
++typedef enum _Sr__ChangeOperation {
++  SR__CHANGE_OPERATION__CREATED = 1,
++  SR__CHANGE_OPERATION__MODIFIED = 2,
++  SR__CHANGE_OPERATION__DELETED = 3,
++  SR__CHANGE_OPERATION__MOVED = 4
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__CHANGE_OPERATION)
++} Sr__ChangeOperation;
++/*
++ **
++ * @brief Requested operation.
++ */
++typedef enum _Sr__Operation {
++  SR__OPERATION__SESSION_START = 10,
++  SR__OPERATION__SESSION_STOP = 11,
++  SR__OPERATION__SESSION_REFRESH = 12,
++  SR__OPERATION__SESSION_CHECK = 13,
++  SR__OPERATION__SESSION_SWITCH_DS = 14,
++  SR__OPERATION__SESSION_SET_OPTS = 15,
++  SR__OPERATION__VERSION_VERIFY = 16,
++  SR__OPERATION__LIST_SCHEMAS = 20,
++  SR__OPERATION__GET_SCHEMA = 21,
++  SR__OPERATION__MODULE_INSTALL = 22,
++  SR__OPERATION__FEATURE_ENABLE = 23,
++  SR__OPERATION__GET_ITEM = 30,
++  SR__OPERATION__GET_ITEMS = 31,
++  SR__OPERATION__GET_SUBTREE = 32,
++  SR__OPERATION__GET_SUBTREES = 33,
++  SR__OPERATION__GET_SUBTREE_CHUNK = 34,
++  SR__OPERATION__SET_ITEM = 40,
++  SR__OPERATION__DELETE_ITEM = 41,
++  SR__OPERATION__MOVE_ITEM = 42,
++  SR__OPERATION__SET_ITEM_STR = 43,
++  SR__OPERATION__VALIDATE = 50,
++  SR__OPERATION__COMMIT = 51,
++  SR__OPERATION__DISCARD_CHANGES = 52,
++  SR__OPERATION__COPY_CONFIG = 53,
++  SR__OPERATION__LOCK = 60,
++  SR__OPERATION__UNLOCK = 61,
++  SR__OPERATION__SUBSCRIBE = 70,
++  SR__OPERATION__UNSUBSCRIBE = 71,
++  SR__OPERATION__CHECK_ENABLED_RUNNING = 72,
++  SR__OPERATION__GET_CHANGES = 73,
++  SR__OPERATION__DATA_PROVIDE = 80,
++  SR__OPERATION__CHECK_EXEC_PERMISSION = 81,
++  SR__OPERATION__RPC = 82,
++  SR__OPERATION__ACTION = 83,
++  SR__OPERATION__EVENT_NOTIF = 84,
++  SR__OPERATION__EVENT_NOTIF_REPLAY = 85,
++  SR__OPERATION__UNSUBSCRIBE_DESTINATION = 101,
++  SR__OPERATION__COMMIT_TIMEOUT = 102,
++  SR__OPERATION__OPER_DATA_TIMEOUT = 103,
++  SR__OPERATION__INTERNAL_STATE_DATA = 104,
++  SR__OPERATION__NOTIF_STORE_CLEANUP = 105,
++  SR__OPERATION__DELAYED_MSG = 106,
++  SR__OPERATION__NACM_RELOAD = 107
++    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SR__OPERATION)
++} Sr__Operation;
++
++/* --- messages --- */
++
++/*
++ **
++ * @brief Value of an item stored (or to be stored) in the datastore.
++ * Can be mapped to sr_val_t data structure from sysrepo library API.
++ */
++struct  _Sr__Value
++{
++  ProtobufCMessage base;
++  char *xpath;
++  Sr__Value__Types type;
++  protobuf_c_boolean dflt;
++  char *binary_val;
++  char *bits_val;
++  protobuf_c_boolean has_bool_val;
++  protobuf_c_boolean bool_val;
++  protobuf_c_boolean has_decimal64_val;
++  double decimal64_val;
++  char *enum_val;
++  char *identityref_val;
++  char *instanceid_val;
++  protobuf_c_boolean has_int8_val;
++  int32_t int8_val;
++  protobuf_c_boolean has_int16_val;
++  int32_t int16_val;
++  protobuf_c_boolean has_int32_val;
++  int32_t int32_val;
++  protobuf_c_boolean has_int64_val;
++  int64_t int64_val;
++  char *string_val;
++  protobuf_c_boolean has_uint8_val;
++  uint32_t uint8_val;
++  protobuf_c_boolean has_uint16_val;
++  uint32_t uint16_val;
++  protobuf_c_boolean has_uint32_val;
++  uint32_t uint32_val;
++  protobuf_c_boolean has_uint64_val;
++  uint64_t uint64_val;
++  char *anyxml_val;
++  char *anydata_val;
++};
++#define SR__VALUE__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__value__descriptor) \
++    , NULL, 0, 0, NULL, NULL, 0,0, 0,0, NULL, NULL, NULL, 0,0, 0,0, 0,0, 0,0, NULL, 0,0, 0,0, 0,0, 0,0, NULL, NULL }
++
++
++/*
++ **
++ * @brief Item stored (or to be stored) in the datastore represented as a tree node
++ * reflecting module schema. Can be mapped to sr_node_t data structure from sysrepo library API.
++ */
++struct  _Sr__Node
++{
++  ProtobufCMessage base;
++  /*
++   **< Value of the node; member *xpath* is used to store node's name. 
++   */
++  Sr__Value *value;
++  /*
++   **< Name of the module that defines scheme of this node. 
++   */
++  char *module_name;
++  /*
++   **< Direct descendands of this node. 
++   */
++  size_t n_children;
++  Sr__Node **children;
++};
++#define SR__NODE__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__node__descriptor) \
++    , NULL, NULL, 0,NULL }
++
++
++/*
++ **
++ * @brief Error message retuned from the Sysrepo Engine.
++ */
++struct  _Sr__Error
++{
++  ProtobufCMessage base;
++  char *message;
++  char *xpath;
++};
++#define SR__ERROR__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__error__descriptor) \
++    , NULL, NULL }
++
++
++/*
++ **
++ * @brief Request for starting a session. Sent by sr_session_start API call.
++ */
++struct  _Sr__SessionStartReq
++{
++  ProtobufCMessage base;
++  Sr__DataStore datastore;
++  char *user_name;
++  /*
++   **< Bitwise OR of SessionFlags. 
++   */
++  uint32_t options;
++  /*
++   **< Applicable if SESS_NOTIFICATION was specified. 
++   */
++  protobuf_c_boolean has_commit_id;
++  uint32_t commit_id;
++};
++#define SR__SESSION_START_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__session_start_req__descriptor) \
++    , 0, NULL, 0, 0,0 }
++
++
++/*
++ **
++ * @brief Response to session_start request.
++ */
++struct  _Sr__SessionStartResp
++{
++  ProtobufCMessage base;
++  uint32_t session_id;
++};
++#define SR__SESSION_START_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__session_start_resp__descriptor) \
++    , 0 }
++
++
++/*
++ **
++ * @brief Request for stopping the session. Sent by sr_session_stop API call.
++ */
++struct  _Sr__SessionStopReq
++{
++  ProtobufCMessage base;
++  uint32_t session_id;
++};
++#define SR__SESSION_STOP_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__session_stop_req__descriptor) \
++    , 0 }
++
++
++/*
++ **
++ * @brief Response to session_stop request.
++ */
++struct  _Sr__SessionStopResp
++{
++  ProtobufCMessage base;
++  uint32_t session_id;
++};
++#define SR__SESSION_STOP_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__session_stop_resp__descriptor) \
++    , 0 }
++
++
++/*
++ **
++ * @brief Refreshes configuration data cached within the session.
++ * Sent by sr_session_refresh API call.
++ */
++struct  _Sr__SessionRefreshReq
++{
++  ProtobufCMessage base;
++};
++#define SR__SESSION_REFRESH_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__session_refresh_req__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Response to sr_session_refresh request.
++ */
++struct  _Sr__SessionRefreshResp
++{
++  ProtobufCMessage base;
++  size_t n_errors;
++  Sr__Error **errors;
++};
++#define SR__SESSION_REFRESH_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__session_refresh_resp__descriptor) \
++    , 0,NULL }
++
++
++/*
++ **
++ * @brief Checks aliveness and validity of the session & connection tied to it.
++ * Sent by sr_session_check API call.
++ */
++struct  _Sr__SessionCheckReq
++{
++  ProtobufCMessage base;
++};
++#define SR__SESSION_CHECK_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__session_check_req__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Response to sr_session_check request.
++ */
++struct  _Sr__SessionCheckResp
++{
++  ProtobufCMessage base;
++  size_t n_errors;
++  Sr__Error **errors;
++};
++#define SR__SESSION_CHECK_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__session_check_resp__descriptor) \
++    , 0,NULL }
++
++
++/*
++ **
++ * @brief Changes the datastore to which the session is tied to.
++ */
++struct  _Sr__SessionSwitchDsReq
++{
++  ProtobufCMessage base;
++  Sr__DataStore datastore;
++};
++#define SR__SESSION_SWITCH_DS_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__session_switch_ds_req__descriptor) \
++    , 0 }
++
++
++/*
++ **
++ * @brief Response to sr_session_switch_ds request.
++ */
++struct  _Sr__SessionSwitchDsResp
++{
++  ProtobufCMessage base;
++};
++#define SR__SESSION_SWITCH_DS_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__session_switch_ds_resp__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Request for modification of session options.
++ */
++struct  _Sr__SessionSetOptsReq
++{
++  ProtobufCMessage base;
++  uint32_t options;
++};
++#define SR__SESSION_SET_OPTS_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__session_set_opts_req__descriptor) \
++    , 0 }
++
++
++/*
++ **
++ * @brief Response to sr_session_set_options.
++ */
++struct  _Sr__SessionSetOptsResp
++{
++  ProtobufCMessage base;
++};
++#define SR__SESSION_SET_OPTS_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__session_set_opts_resp__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Request to verify version compatibility.
++ */
++struct  _Sr__VersionVerifyReq
++{
++  ProtobufCMessage base;
++  char *soname;
++};
++#define SR__VERSION_VERIFY_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__version_verify_req__descriptor) \
++    , NULL }
++
++
++/*
++ **
++ * @brief Response to version verification.
++ */
++struct  _Sr__VersionVerifyResp
++{
++  ProtobufCMessage base;
++  /*
++   **< server-side SONAME version in case of versions incompatibility. 
++   */
++  char *soname;
++};
++#define SR__VERSION_VERIFY_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__version_verify_resp__descriptor) \
++    , NULL }
++
++
++/*
++ **
++ * @brief Schema revision details.
++ */
++struct  _Sr__SchemaRevision
++{
++  ProtobufCMessage base;
++  /*
++   **< Latest revision date of the module. 
++   */
++  char *revision;
++  /*
++   **< Absolute path to file where the schema is stored (YANG format). 
++   */
++  char *file_path_yang;
++  /*
++   **< Absolute path to file where the schema is stored (.yin format). 
++   */
++  char *file_path_yin;
++};
++#define SR__SCHEMA_REVISION__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__schema_revision__descriptor) \
++    , NULL, NULL, NULL }
++
++
++/*
++ **
++ * @brief Schema submodule information.
++ */
++struct  _Sr__SchemaSubmodule
++{
++  ProtobufCMessage base;
++  /*
++   **< Submodule name 
++   */
++  char *submodule_name;
++  /*
++   **< Revision of the submodule 
++   */
++  Sr__SchemaRevision *revision;
++};
++#define SR__SCHEMA_SUBMODULE__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__schema_submodule__descriptor) \
++    , NULL, NULL }
++
++
++/*
++ **
++ * @brief Information about a schema installed in sysrepo datastore.
++ */
++struct  _Sr__Schema
++{
++  ProtobufCMessage base;
++  /*
++   **< Name of the module. 
++   */
++  char *module_name;
++  /*
++   **< Namespace of the module. 
++   */
++  char *ns;
++  /*
++   **< Prefix of he module. 
++   */
++  char *prefix;
++  /*
++   **< TRUE only for explicitly installed modules (those are always implemented). 
++   */
++  protobuf_c_boolean installed;
++  /*
++   **< TRUE for implemented modules (do not have to be installed if they have augments,
++   *deviations or are targets for leafrefs of other implemented modules). 
++   */
++  protobuf_c_boolean implemented;
++  /*
++   **< Revision of the module
++   */
++  Sr__SchemaRevision *revision;
++  /*
++   **< Submodules 
++   */
++  size_t n_submodules;
++  Sr__SchemaSubmodule **submodules;
++  /*
++   **< Features enabled for the module 
++   */
++  size_t n_enabled_features;
++  char **enabled_features;
++};
++#define SR__SCHEMA__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__schema__descriptor) \
++    , NULL, NULL, NULL, 0, 0, NULL, 0,NULL, 0,NULL }
++
++
++/*
++ **
++ * @brief Retrieves an array of schemas installed in the sysrepo datastore.
++ * Sent by sr_list_schemas API call.
++ */
++struct  _Sr__ListSchemasReq
++{
++  ProtobufCMessage base;
++};
++#define SR__LIST_SCHEMAS_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__list_schemas_req__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Response to sr_list_schemas request.
++ */
++struct  _Sr__ListSchemasResp
++{
++  ProtobufCMessage base;
++  size_t n_schemas;
++  Sr__Schema **schemas;
++};
++#define SR__LIST_SCHEMAS_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__list_schemas_resp__descriptor) \
++    , 0,NULL }
++
++
++/*
++ **
++ * @brief Retrieves the content of specified schema file.
++ * Sent by sr_get_schema API call.
++ */
++struct  _Sr__GetSchemaReq
++{
++  ProtobufCMessage base;
++  char *module_name;
++  char *revision;
++  char *submodule_name;
++  char *submodule_revision;
++  protobuf_c_boolean yang_format;
++};
++#define SR__GET_SCHEMA_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_schema_req__descriptor) \
++    , NULL, NULL, NULL, NULL, 0 }
++
++
++/*
++ **
++ * @brief Response to sr_get_schema request.
++ */
++struct  _Sr__GetSchemaResp
++{
++  ProtobufCMessage base;
++  char *schema_content;
++};
++#define SR__GET_SCHEMA_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_schema_resp__descriptor) \
++    , NULL }
++
++
++/*
++ **
++ * @brief Retrieves a single data element stored under provided path.
++ * Sent by sr_get_item API call.
++ */
++struct  _Sr__GetItemReq
++{
++  ProtobufCMessage base;
++  char *xpath;
++};
++#define SR__GET_ITEM_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_item_req__descriptor) \
++    , NULL }
++
++
++/*
++ **
++ * @brief Response to get_item request.
++ */
++struct  _Sr__GetItemResp
++{
++  ProtobufCMessage base;
++  Sr__Value *value;
++};
++#define SR__GET_ITEM_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_item_resp__descriptor) \
++    , NULL }
++
++
++/*
++ **
++ * @brief Retrieves an array of data elements stored under provided path.
++ * Sent by sr_get_items and sr_get_items_iter API calls.
++ */
++struct  _Sr__GetItemsReq
++{
++  ProtobufCMessage base;
++  char *xpath;
++  /*
++   * The options below are applicable only for sr_get_items_iter
++   * (not set by sr_get_items).
++   */
++  protobuf_c_boolean has_limit;
++  uint32_t limit;
++  protobuf_c_boolean has_offset;
++  uint32_t offset;
++};
++#define SR__GET_ITEMS_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_items_req__descriptor) \
++    , NULL, 0,0, 0,0 }
++
++
++/*
++ **
++ * @brief Response to get_items / sr_get_items_iter request.
++ */
++struct  _Sr__GetItemsResp
++{
++  ProtobufCMessage base;
++  size_t n_values;
++  Sr__Value **values;
++};
++#define SR__GET_ITEMS_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_items_resp__descriptor) \
++    , 0,NULL }
++
++
++/*
++ **
++ * @brief Retrieves a single subtree whose root is stored under provided path.
++ * Sent by sr_get_subtree API call.
++ */
++struct  _Sr__GetSubtreeReq
++{
++  ProtobufCMessage base;
++  char *xpath;
++};
++#define SR__GET_SUBTREE_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_subtree_req__descriptor) \
++    , NULL }
++
++
++/*
++ **
++ * @brief Response to sr_get_subtree request.
++ */
++struct  _Sr__GetSubtreeResp
++{
++  ProtobufCMessage base;
++  Sr__Node *tree;
++};
++#define SR__GET_SUBTREE_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_subtree_resp__descriptor) \
++    , NULL }
++
++
++/*
++ **
++ * @brief Retrieves an array of subtrees whose root nodes match provided path.
++ * Sent by sr_get_subtrees API call.
++ */
++struct  _Sr__GetSubtreesReq
++{
++  ProtobufCMessage base;
++  char *xpath;
++};
++#define SR__GET_SUBTREES_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_subtrees_req__descriptor) \
++    , NULL }
++
++
++/*
++ **
++ * @brief Response to sr_get_subtrees request.
++ */
++struct  _Sr__GetSubtreesResp
++{
++  ProtobufCMessage base;
++  size_t n_trees;
++  Sr__Node **trees;
++};
++#define SR__GET_SUBTREES_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_subtrees_resp__descriptor) \
++    , 0,NULL }
++
++
++/*
++ **
++ * @brief Retrieves a chunk of a single or multiple subtrees.
++ * A subtree chunk is also a tree, where the root node is the node referenced by XPath,
++ * the next level consists of its children skipping the first "slice_offset" nodes and including
++ * at most "slice_limit" nodes, while the remaining (depth_limit-2) levels always start with
++ * the first child (slice_offset is ignored) and include at most "child_limit" nodes.
++ * The chunk consists of at most "depth_limit" levels.
++ * @note Order of child nodes depends on the libyang implementation.
++ */
++struct  _Sr__GetSubtreeChunkReq
++{
++  ProtobufCMessage base;
++  char *xpath;
++  protobuf_c_boolean single;
++  uint32_t slice_offset;
++  uint32_t slice_width;
++  uint32_t child_limit;
++  uint32_t depth_limit;
++};
++#define SR__GET_SUBTREE_CHUNK_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_subtree_chunk_req__descriptor) \
++    , NULL, 0, 0, 0, 0, 0 }
++
++
++/*
++ **
++ * @brief Response to sr_get_subtree_chunk request.
++ */
++struct  _Sr__GetSubtreeChunkResp
++{
++  ProtobufCMessage base;
++  /*
++   **< JSON node-id of the root node for each subtree chunk 
++   */
++  size_t n_xpath;
++  char **xpath;
++  /*
++   **< first chunk may carry mutliple trees 
++   */
++  size_t n_chunk;
++  Sr__Node **chunk;
++};
++#define SR__GET_SUBTREE_CHUNK_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_subtree_chunk_resp__descriptor) \
++    , 0,NULL, 0,NULL }
++
++
++/*
++ **
++ * @brief Sets the value of the leaf, leaf-list or presence container.
++ * Sent by sr_set_item API call.
++ */
++struct  _Sr__SetItemReq
++{
++  ProtobufCMessage base;
++  char *xpath;
++  Sr__Value *value;
++  /*
++   **< Bitwise OR of EditFlags 
++   */
++  uint32_t options;
++};
++#define SR__SET_ITEM_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__set_item_req__descriptor) \
++    , NULL, NULL, 0 }
++
++
++/*
++ **
++ * @brief Response to sr_set_item request.
++ */
++struct  _Sr__SetItemResp
++{
++  ProtobufCMessage base;
++};
++#define SR__SET_ITEM_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__set_item_resp__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Sets the value of the leaf, leaf-list or presence container.
++ * The value is transferred as string.
++ * Sent by sr_set_item_str API call.
++ */
++struct  _Sr__SetItemStrReq
++{
++  ProtobufCMessage base;
++  char *xpath;
++  char *value;
++  /*
++   **< Bitwise OR of EditFlags 
++   */
++  uint32_t options;
++};
++#define SR__SET_ITEM_STR_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__set_item_str_req__descriptor) \
++    , NULL, NULL, 0 }
++
++
++/*
++ **
++ * @brief Response to sr_set_item_str request.
++ */
++struct  _Sr__SetItemStrResp
++{
++  ProtobufCMessage base;
++};
++#define SR__SET_ITEM_STR_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__set_item_str_resp__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Deletes the nodes under the specified xpath.
++ * Sent by sr_delete_item API call.
++ */
++struct  _Sr__DeleteItemReq
++{
++  ProtobufCMessage base;
++  char *xpath;
++  /*
++   **< Bitwise OR of EditFlags 
++   */
++  uint32_t options;
++};
++#define SR__DELETE_ITEM_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__delete_item_req__descriptor) \
++    , NULL, 0 }
++
++
++/*
++ **
++ * @brief Response to sr_delete_item request.
++ */
++struct  _Sr__DeleteItemResp
++{
++  ProtobufCMessage base;
++};
++#define SR__DELETE_ITEM_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__delete_item_resp__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Move the instance of an ordered list in specified direction.
++ * Sent by sr_move_item API call.
++ */
++struct  _Sr__MoveItemReq
++{
++  ProtobufCMessage base;
++  char *xpath;
++  Sr__MoveItemReq__MovePosition position;
++  char *relative_item;
++};
++#define SR__MOVE_ITEM_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__move_item_req__descriptor) \
++    , NULL, 0, NULL }
++
++
++/*
++ **
++ * @brief Response to sr_move_item request.
++ */
++struct  _Sr__MoveItemResp
++{
++  ProtobufCMessage base;
++};
++#define SR__MOVE_ITEM_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__move_item_resp__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Perform the validation of changes made in current session, but do not
++ * commit nor discard them. Sent by sr_validate API call.
++ */
++struct  _Sr__ValidateReq
++{
++  ProtobufCMessage base;
++};
++#define SR__VALIDATE_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__validate_req__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Response to sr_validate request.
++ */
++struct  _Sr__ValidateResp
++{
++  ProtobufCMessage base;
++  size_t n_errors;
++  Sr__Error **errors;
++};
++#define SR__VALIDATE_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__validate_resp__descriptor) \
++    , 0,NULL }
++
++
++/*
++ **
++ * @brief Apply changes made in current session.
++ * Sent by sr_commit API call.
++ */
++struct  _Sr__CommitReq
++{
++  ProtobufCMessage base;
++};
++#define SR__COMMIT_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__commit_req__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Response to sr_commit request.
++ */
++struct  _Sr__CommitResp
++{
++  ProtobufCMessage base;
++  size_t n_errors;
++  Sr__Error **errors;
++};
++#define SR__COMMIT_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__commit_resp__descriptor) \
++    , 0,NULL }
++
++
++/*
++ **
++ * @brief Discard non-committed changes made in current session.
++ * Sent by sr_discard_changes API call.
++ */
++struct  _Sr__DiscardChangesReq
++{
++  ProtobufCMessage base;
++};
++#define SR__DISCARD_CHANGES_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__discard_changes_req__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Response to sr_discard_changes request.
++ */
++struct  _Sr__DiscardChangesResp
++{
++  ProtobufCMessage base;
++};
++#define SR__DISCARD_CHANGES_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__discard_changes_resp__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Replaces an entire configuration datastore  with the contents of
++ * another complete configuration datastore. Sent by sr_copy_config request.
++ */
++struct  _Sr__CopyConfigReq
++{
++  ProtobufCMessage base;
++  Sr__DataStore src_datastore;
++  Sr__DataStore dst_datastore;
++  /*
++   **< If not specified, the operation is performed on all
++   *modules that are currently active in the source datastore 
++   */
++  char *module_name;
++};
++#define SR__COPY_CONFIG_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__copy_config_req__descriptor) \
++    , 0, 0, NULL }
++
++
++/*
++ **
++ * @brief Response to sr_copy_config request.
++ */
++struct  _Sr__CopyConfigResp
++{
++  ProtobufCMessage base;
++  size_t n_errors;
++  Sr__Error **errors;
++};
++#define SR__COPY_CONFIG_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__copy_config_resp__descriptor) \
++    , 0,NULL }
++
++
++/*
++ **
++ * @brief Locks specified data model or the datastore which the session is tied to.
++ * Sent by sr_lock_datastore and sr_lock_model API calls.
++ */
++struct  _Sr__LockReq
++{
++  ProtobufCMessage base;
++  /*
++   **< If module name is not set, LockReq locks whole datastore. 
++   */
++  char *module_name;
++};
++#define SR__LOCK_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__lock_req__descriptor) \
++    , NULL }
++
++
++/*
++ **
++ * @brief Response to sr_lock_datastore or sr_lock_model request.
++ */
++struct  _Sr__LockResp
++{
++  ProtobufCMessage base;
++};
++#define SR__LOCK_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__lock_resp__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Unlocks specified data model or the datastore which the session is tied to.
++ * Sent by sr_unlock_datastore and sr_unlock_model API calls.
++ */
++struct  _Sr__UnlockReq
++{
++  ProtobufCMessage base;
++  /*
++   **< If module name is not set, UnlockReq unlocks whole datastore. 
++   */
++  char *module_name;
++};
++#define SR__UNLOCK_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__unlock_req__descriptor) \
++    , NULL }
++
++
++/*
++ **
++ * @brief Response to sr_lock_datastore or sr_lock_model request.
++ */
++struct  _Sr__UnlockResp
++{
++  ProtobufCMessage base;
++};
++#define SR__UNLOCK_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__unlock_resp__descriptor) \
++     }
++
++
++struct  _Sr__SubscribeReq
++{
++  ProtobufCMessage base;
++  Sr__SubscriptionType type;
++  char *destination;
++  uint32_t subscription_id;
++  char *module_name;
++  char *xpath;
++  protobuf_c_boolean has_notif_event;
++  Sr__NotificationEvent notif_event;
++  protobuf_c_boolean has_priority;
++  uint32_t priority;
++  protobuf_c_boolean has_enable_running;
++  protobuf_c_boolean enable_running;
++  protobuf_c_boolean has_enable_event;
++  protobuf_c_boolean enable_event;
++  Sr__ApiVariant api_variant;
++};
++#define SR__SUBSCRIBE_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__subscribe_req__descriptor) \
++    , 0, NULL, 0, NULL, NULL, 0,0, 0,0, 0,0, 0,0, 0 }
++
++
++struct  _Sr__SubscribeResp
++{
++  ProtobufCMessage base;
++};
++#define SR__SUBSCRIBE_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__subscribe_resp__descriptor) \
++     }
++
++
++struct  _Sr__UnsubscribeReq
++{
++  ProtobufCMessage base;
++  Sr__SubscriptionType type;
++  char *destination;
++  uint32_t subscription_id;
++  char *module_name;
++};
++#define SR__UNSUBSCRIBE_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__unsubscribe_req__descriptor) \
++    , 0, NULL, 0, NULL }
++
++
++struct  _Sr__UnsubscribeResp
++{
++  ProtobufCMessage base;
++};
++#define SR__UNSUBSCRIBE_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__unsubscribe_resp__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Checks whether the module has any enabled subtree.
++ * Sent by sr_check_enabled_running.
++ */
++struct  _Sr__CheckEnabledRunningReq
++{
++  ProtobufCMessage base;
++  char *module_name;
++};
++#define SR__CHECK_ENABLED_RUNNING_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__check_enabled_running_req__descriptor) \
++    , NULL }
++
++
++struct  _Sr__CheckEnabledRunningResp
++{
++  ProtobufCMessage base;
++  protobuf_c_boolean enabled;
++};
++#define SR__CHECK_ENABLED_RUNNING_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__check_enabled_running_resp__descriptor) \
++    , 0 }
++
++
++struct  _Sr__ModuleInstallNotification
++{
++  ProtobufCMessage base;
++  char *module_name;
++  char *revision;
++  Sr__ModuleState state;
++};
++#define SR__MODULE_INSTALL_NOTIFICATION__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__module_install_notification__descriptor) \
++    , NULL, NULL, 0 }
++
++
++struct  _Sr__FeatureEnableNotification
++{
++  ProtobufCMessage base;
++  char *module_name;
++  char *feature_name;
++  protobuf_c_boolean enabled;
++};
++#define SR__FEATURE_ENABLE_NOTIFICATION__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__feature_enable_notification__descriptor) \
++    , NULL, NULL, 0 }
++
++
++struct  _Sr__ModuleChangeNotification
++{
++  ProtobufCMessage base;
++  Sr__NotificationEvent event;
++  char *module_name;
++};
++#define SR__MODULE_CHANGE_NOTIFICATION__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__module_change_notification__descriptor) \
++    , 0, NULL }
++
++
++struct  _Sr__SubtreeChangeNotification
++{
++  ProtobufCMessage base;
++  Sr__NotificationEvent event;
++  char *xpath;
++};
++#define SR__SUBTREE_CHANGE_NOTIFICATION__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__subtree_change_notification__descriptor) \
++    , 0, NULL }
++
++
++struct  _Sr__Change
++{
++  ProtobufCMessage base;
++  Sr__ChangeOperation changeoperation;
++  Sr__Value *new_value;
++  Sr__Value *old_value;
++};
++#define SR__CHANGE__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__change__descriptor) \
++    , 0, NULL, NULL }
++
++
++/*
++ **
++ * @brief Retrieves an array of changes made under provided path.
++ * Sent by sr_get_changes_iter or sr_get_change_next API calls.
++ */
++struct  _Sr__GetChangesReq
++{
++  ProtobufCMessage base;
++  char *xpath;
++  uint32_t limit;
++  uint32_t offset;
++};
++#define SR__GET_CHANGES_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_changes_req__descriptor) \
++    , NULL, 0, 0 }
++
++
++/*
++ **
++ * @brief Response to get_changes request.
++ */
++struct  _Sr__GetChangesResp
++{
++  ProtobufCMessage base;
++  size_t n_changes;
++  Sr__Change **changes;
++};
++#define SR__GET_CHANGES_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__get_changes_resp__descriptor) \
++    , 0,NULL }
++
++
++/*
++ **
++ * @brief Sends a request to check if the owner of this session is authorized to invoke
++ * the protocol operation referenced by the xpath.
++ * Sent by sr_check_exec_permission.
++ */
++struct  _Sr__CheckExecPermReq
++{
++  ProtobufCMessage base;
++  char *xpath;
++};
++#define SR__CHECK_EXEC_PERM_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__check_exec_perm_req__descriptor) \
++    , NULL }
++
++
++/*
++ **
++ * @brief Response to sr_check_exec_permission request.
++ */
++struct  _Sr__CheckExecPermResp
++{
++  ProtobufCMessage base;
++  protobuf_c_boolean permitted;
++};
++#define SR__CHECK_EXEC_PERM_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__check_exec_perm_resp__descriptor) \
++    , 0 }
++
++
++/*
++ **
++ * @brief Sends a RPC / action request into the datastore, will be delivered to the RPC subscriber.
++ * Sent by sr_rpc_send / sr_rpc_send_tree and sr_action_send / sr_action_send_tree API calls.
++ */
++struct  _Sr__RPCReq
++{
++  ProtobufCMessage base;
++  protobuf_c_boolean action;
++  char *xpath;
++  /*
++   **< which API variant was used to send RPC req. 
++   */
++  Sr__ApiVariant orig_api_variant;
++  size_t n_input;
++  Sr__Value **input;
++  size_t n_input_tree;
++  Sr__Node **input_tree;
++  char *subscriber_address;
++  protobuf_c_boolean has_subscription_id;
++  uint32_t subscription_id;
++};
++#define SR__RPCREQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__rpcreq__descriptor) \
++    , 0, NULL, 0, 0,NULL, 0,NULL, NULL, 0,0 }
++
++
++/*
++ **
++ * @brief Response to sr_rpc_send / sr_rpc_send_tree or sr_action_send / sr_action_send_tree request.
++ */
++struct  _Sr__RPCResp
++{
++  ProtobufCMessage base;
++  protobuf_c_boolean action;
++  char *xpath;
++  /*
++   **< which API variant was used to send RPC req. 
++   */
++  Sr__ApiVariant orig_api_variant;
++  size_t n_output;
++  Sr__Value **output;
++  size_t n_output_tree;
++  Sr__Node **output_tree;
++};
++#define SR__RPCRESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__rpcresp__descriptor) \
++    , 0, NULL, 0, 0,NULL, 0,NULL }
++
++
++/*
++ **
++ * @brief Sends an event notification into the datastore, will be delivered to all notification subscribers.
++ * Sent by sr_event_notif_send API call.
++ */
++struct  _Sr__EventNotifReq
++{
++  ProtobufCMessage base;
++  Sr__EventNotifReq__NotifType type;
++  /*
++   **< Bitwise OR of NotifFlags. 
++   */
++  uint32_t options;
++  char *xpath;
++  size_t n_values;
++  Sr__Value **values;
++  size_t n_trees;
++  Sr__Node **trees;
++  uint64_t timestamp;
++  char *subscriber_address;
++  protobuf_c_boolean has_subscription_id;
++  uint32_t subscription_id;
++  protobuf_c_boolean do_not_send_reply;
++};
++#define SR__EVENT_NOTIF_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__event_notif_req__descriptor) \
++    , 0, 0, NULL, 0,NULL, 0,NULL, 0, NULL, 0,0, 0 }
++
++
++/*
++ **
++ * @brief Response to sr_event_notif_send request.
++ */
++struct  _Sr__EventNotifResp
++{
++  ProtobufCMessage base;
++};
++#define SR__EVENT_NOTIF_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__event_notif_resp__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Sends a request to replay event notifications stored in the datastore.
++ * Sent by sr_event_notif_replay API call.
++ */
++struct  _Sr__EventNotifReplayReq
++{
++  ProtobufCMessage base;
++  char *xpath;
++  uint64_t start_time;
++  uint64_t stop_time;
++  char *subscriber_address;
++  uint32_t subscription_id;
++  Sr__ApiVariant api_variant;
++};
++#define SR__EVENT_NOTIF_REPLAY_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__event_notif_replay_req__descriptor) \
++    , NULL, 0, 0, NULL, 0, 0 }
++
++
++/*
++ **
++ * @brief Response to sr_event_notif_replay request.
++ */
++struct  _Sr__EventNotifReplayResp
++{
++  ProtobufCMessage base;
++};
++#define SR__EVENT_NOTIF_REPLAY_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__event_notif_replay_resp__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Requests operational data under given path form an operational data
++ * provider.
++ */
++struct  _Sr__DataProvideReq
++{
++  ProtobufCMessage base;
++  char *xpath;
++  char *subscriber_address;
++  uint32_t subscription_id;
++  uint64_t request_id;
++};
++#define SR__DATA_PROVIDE_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__data_provide_req__descriptor) \
++    , NULL, NULL, 0, 0 }
++
++
++/*
++ **
++ * @brief Response to a request of operational data under given path form an
++ * operational data provider.
++ */
++struct  _Sr__DataProvideResp
++{
++  ProtobufCMessage base;
++  char *xpath;
++  size_t n_values;
++  Sr__Value **values;
++  uint64_t request_id;
++};
++#define SR__DATA_PROVIDE_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__data_provide_resp__descriptor) \
++    , NULL, 0,NULL, 0 }
++
++
++/*
++ **
++ * @brief Requests installation / uinstallation of specified YANG model.
++ * Sent by sr_module_install internal API calls.
++ */
++struct  _Sr__ModuleInstallReq
++{
++  ProtobufCMessage base;
++  char *module_name;
++  char *revision;
++  char *file_name;
++  protobuf_c_boolean installed;
++};
++#define SR__MODULE_INSTALL_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__module_install_req__descriptor) \
++    , NULL, NULL, NULL, 0 }
++
++
++/*
++ **
++ * @brief Response to sr_module_install request.
++ */
++struct  _Sr__ModuleInstallResp
++{
++  ProtobufCMessage base;
++};
++#define SR__MODULE_INSTALL_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__module_install_resp__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Requests enabling / disabling of specified YANG feature within the
++ * YANG model. Sent by sr_feature_enable internal API calls.
++ */
++struct  _Sr__FeatureEnableReq
++{
++  ProtobufCMessage base;
++  char *module_name;
++  char *feature_name;
++  protobuf_c_boolean enabled;
++};
++#define SR__FEATURE_ENABLE_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__feature_enable_req__descriptor) \
++    , NULL, NULL, 0 }
++
++
++/*
++ **
++ * @brief Response to sr_feature_enable request.
++ */
++struct  _Sr__FeatureEnableResp
++{
++  ProtobufCMessage base;
++};
++#define SR__FEATURE_ENABLE_RESP__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__feature_enable_resp__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Internal request to unsubscribe all subscriptions of a subscriber on given destination address.
++ */
++struct  _Sr__UnsubscribeDestinationReq
++{
++  ProtobufCMessage base;
++  char *destination;
++};
++#define SR__UNSUBSCRIBE_DESTINATION_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__unsubscribe_destination_req__descriptor) \
++    , NULL }
++
++
++/*
++ **
++ * @brief Internal request to timeout a commit, if it hasn't been terminated yet.
++ */
++struct  _Sr__CommitTimeoutReq
++{
++  ProtobufCMessage base;
++  uint32_t commit_id;
++  protobuf_c_boolean expired;
++};
++#define SR__COMMIT_TIMEOUT_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__commit_timeout_req__descriptor) \
++    , 0, 0 }
++
++
++/*
++ **
++ * @brief Internal request to timeout a request for operational data, if it hasn't been terminated yet.
++ */
++struct  _Sr__OperDataTimeoutReq
++{
++  ProtobufCMessage base;
++  uint64_t request_id;
++};
++#define SR__OPER_DATA_TIMEOUT_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__oper_data_timeout_req__descriptor) \
++    , 0 }
++
++
++/*
++ **
++ * @brief Internal request for internal state data (state data provided by Sysrepo Engine itself).
++ */
++struct  _Sr__InternalStateDataReq
++{
++  ProtobufCMessage base;
++  uint64_t request_id;
++  char *xpath;
++};
++#define SR__INTERNAL_STATE_DATA_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__internal_state_data_req__descriptor) \
++    , 0, NULL }
++
++
++/*
++ **
++ * @brief Internal request to cleanup aged notifications in the Notification Store.
++ */
++struct  _Sr__NotifStoreCleanupReq
++{
++  ProtobufCMessage base;
++};
++#define SR__NOTIF_STORE_CLEANUP_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__notif_store_cleanup_req__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Message to be delivered to the client after some timeout.
++ */
++struct  _Sr__DelayedMsgReq
++{
++  ProtobufCMessage base;
++  Sr__Msg *message;
++};
++#define SR__DELAYED_MSG_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__delayed_msg_req__descriptor) \
++    , NULL }
++
++
++/*
++ **
++ * @brief Internal request to reload NACM configuration from the running datastore.
++ */
++struct  _Sr__NacmReloadReq
++{
++  ProtobufCMessage base;
++};
++#define SR__NACM_RELOAD_REQ__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__nacm_reload_req__descriptor) \
++     }
++
++
++/*
++ **
++ * @brief Request for an operation.
++ */
++struct  _Sr__Request
++{
++  ProtobufCMessage base;
++  /*
++   * Request ID used internally by sysrepo 
++   */
++  uint64_t _id;
++  Sr__Operation operation;
++  Sr__SessionStartReq *session_start_req;
++  Sr__SessionStopReq *session_stop_req;
++  Sr__SessionRefreshReq *session_refresh_req;
++  Sr__SessionCheckReq *session_check_req;
++  Sr__SessionSwitchDsReq *session_switch_ds_req;
++  Sr__SessionSetOptsReq *session_set_opts_req;
++  Sr__VersionVerifyReq *version_verify_req;
++  Sr__ListSchemasReq *list_schemas_req;
++  Sr__GetSchemaReq *get_schema_req;
++  Sr__ModuleInstallReq *module_install_req;
++  Sr__FeatureEnableReq *feature_enable_req;
++  Sr__GetItemReq *get_item_req;
++  Sr__GetItemsReq *get_items_req;
++  Sr__GetSubtreeReq *get_subtree_req;
++  Sr__GetSubtreesReq *get_subtrees_req;
++  Sr__GetSubtreeChunkReq *get_subtree_chunk_req;
++  Sr__SetItemReq *set_item_req;
++  Sr__DeleteItemReq *delete_item_req;
++  Sr__MoveItemReq *move_item_req;
++  Sr__SetItemStrReq *set_item_str_req;
++  Sr__ValidateReq *validate_req;
++  Sr__CommitReq *commit_req;
++  Sr__DiscardChangesReq *discard_changes_req;
++  Sr__CopyConfigReq *copy_config_req;
++  Sr__LockReq *lock_req;
++  Sr__UnlockReq *unlock_req;
++  Sr__SubscribeReq *subscribe_req;
++  Sr__UnsubscribeReq *unsubscribe_req;
++  Sr__CheckEnabledRunningReq *check_enabled_running_req;
++  Sr__GetChangesReq *get_changes_req;
++  Sr__DataProvideReq *data_provide_req;
++  Sr__CheckExecPermReq *check_exec_perm_req;
++  Sr__RPCReq *rpc_req;
++  Sr__EventNotifReq *event_notif_req;
++  Sr__EventNotifReplayReq *event_notif_replay_req;
++};
++#define SR__REQUEST__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__request__descriptor) \
++    , 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
++
++
++/*
++ **
++ * @brief Response to the received request.
++ */
++struct  _Sr__Response
++{
++  ProtobufCMessage base;
++  Sr__Operation operation;
++  /*
++   **< Result of the operation. 0 on success, non-zero values map to sr_error_t enum in sysrepo.h. 
++   */
++  uint32_t result;
++  /*
++   **< Additional error information. 
++   */
++  Sr__Error *error;
++  Sr__SessionStartResp *session_start_resp;
++  Sr__SessionStopResp *session_stop_resp;
++  Sr__SessionRefreshResp *session_refresh_resp;
++  Sr__SessionCheckResp *session_check_resp;
++  Sr__SessionSwitchDsResp *session_switch_ds_resp;
++  Sr__SessionSetOptsResp *session_set_opts_resp;
++  Sr__VersionVerifyResp *version_verify_resp;
++  Sr__ListSchemasResp *list_schemas_resp;
++  Sr__GetSchemaResp *get_schema_resp;
++  Sr__ModuleInstallResp *module_install_resp;
++  Sr__FeatureEnableResp *feature_enable_resp;
++  Sr__GetItemResp *get_item_resp;
++  Sr__GetItemsResp *get_items_resp;
++  Sr__GetSubtreeResp *get_subtree_resp;
++  Sr__GetSubtreesResp *get_subtrees_resp;
++  Sr__GetSubtreeChunkResp *get_subtree_chunk_resp;
++  Sr__SetItemResp *set_item_resp;
++  Sr__DeleteItemResp *delete_item_resp;
++  Sr__MoveItemResp *move_item_resp;
++  Sr__SetItemStrResp *set_item_str_resp;
++  Sr__ValidateResp *validate_resp;
++  Sr__CommitResp *commit_resp;
++  Sr__DiscardChangesResp *discard_changes_resp;
++  Sr__CopyConfigResp *copy_config_resp;
++  Sr__LockResp *lock_resp;
++  Sr__UnlockResp *unlock_resp;
++  Sr__SubscribeResp *subscribe_resp;
++  Sr__UnsubscribeResp *unsubscribe_resp;
++  Sr__CheckEnabledRunningResp *check_enabled_running_resp;
++  Sr__GetChangesResp *get_changes_resp;
++  Sr__DataProvideResp *data_provide_resp;
++  Sr__CheckExecPermResp *check_exec_perm_resp;
++  Sr__RPCResp *rpc_resp;
++  Sr__EventNotifResp *event_notif_resp;
++  Sr__EventNotifReplayResp *event_notif_replay_resp;
++};
++#define SR__RESPONSE__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__response__descriptor) \
++    , 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
++
++
++/*
++ **
++ * @brief Notification about an event that occurred in the datastore.
++ */
++struct  _Sr__Notification
++{
++  ProtobufCMessage base;
++  Sr__SubscriptionType type;
++  char *destination_address;
++  char *source_address;
++  uint32_t source_pid;
++  uint32_t subscription_id;
++  protobuf_c_boolean has_commit_id;
++  uint32_t commit_id;
++  Sr__ModuleInstallNotification *module_install_notif;
++  Sr__FeatureEnableNotification *feature_enable_notif;
++  Sr__ModuleChangeNotification *module_change_notif;
++  Sr__SubtreeChangeNotification *subtree_change_notif;
++};
++#define SR__NOTIFICATION__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__notification__descriptor) \
++    , 0, NULL, NULL, 0, 0, 0,0, NULL, NULL, NULL, NULL }
++
++
++/*
++ **
++ * @brief Notification Acknowledgment.
++ */
++struct  _Sr__NotificationAck
++{
++  ProtobufCMessage base;
++  /*
++   **< Original notification. 
++   */
++  Sr__Notification *notif;
++  /*
++   **< Result of the notification (success / error code). 
++   */
++  uint32_t result;
++  /*
++   **< Additional error information. 
++   */
++  Sr__Error *error;
++  /*
++   **< If the result is error and this flag is set to true abort notification
++   * will not be delivered to this subscriber
++   * (Subscriber doesn't want notification about changes that he refused). 
++   */
++  protobuf_c_boolean do_not_send_abort;
++};
++#define SR__NOTIFICATION_ACK__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__notification_ack__descriptor) \
++    , NULL, 0, NULL, 0 }
++
++
++/*
++ **
++ * @brief Internal request sent by sysrepo. Should not be used from the public API.
++ */
++struct  _Sr__InternalRequest
++{
++  ProtobufCMessage base;
++  Sr__Operation operation;
++  protobuf_c_boolean has_postpone_timeout;
++  uint32_t postpone_timeout;
++  Sr__UnsubscribeDestinationReq *unsubscribe_dst_req;
++  Sr__CommitTimeoutReq *commit_timeout_req;
++  Sr__OperDataTimeoutReq *oper_data_timeout_req;
++  Sr__InternalStateDataReq *internal_state_data_req;
++  Sr__NotifStoreCleanupReq *notif_store_cleanup_req;
++  Sr__DelayedMsgReq *delayed_msg_req;
++  Sr__NacmReloadReq *nacm_reload_req;
++};
++#define SR__INTERNAL_REQUEST__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__internal_request__descriptor) \
++    , 0, 0,0, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
++
++
++/*
++ **
++ * @brief Umbrella sysrepo message used for communication between sysrepo
++ * engine and client library.
++ */
++struct  _Sr__Msg
++{
++  ProtobufCMessage base;
++  /*
++   **< Indicates type of the message. 
++   */
++  Sr__Msg__MsgType type;
++  /*
++   **< Session identifier. Can be 0 (value is ignored) for session_start and version_verify requests. 
++   */
++  uint32_t session_id;
++  /*
++   **< Filled in in case of type == REQUEST. 
++   */
++  Sr__Request *request;
++  /*
++   **< Filled in in case of type == RESPONSE. 
++   */
++  Sr__Response *response;
++  /*
++   **< Filled in in case of type == NOTIFICATION. 
++   */
++  Sr__Notification *notification;
++  /*
++   **< Filled in in case of type == NOTIFICATION_ACK 
++   */
++  Sr__NotificationAck *notification_ack;
++  /*
++   **< Filled in in case of type == INTERNAL. 
++   */
++  Sr__InternalRequest *internal_request;
++  /*
++   **< Not part of the protocol. Used internally by Sysrepo to store a pointer to memory context. 
++   */
++  uint64_t _sysrepo_mem_ctx;
++};
++#define SR__MSG__INIT \
++ { PROTOBUF_C_MESSAGE_INIT (&sr__msg__descriptor) \
++    , 0, 0, NULL, NULL, NULL, NULL, NULL, 0 }
++
++
++/* Sr__Value methods */
++void   sr__value__init
++                     (Sr__Value         *message);
++size_t sr__value__get_packed_size
++                     (const Sr__Value   *message);
++size_t sr__value__pack
++                     (const Sr__Value   *message,
++                      uint8_t             *out);
++size_t sr__value__pack_to_buffer
++                     (const Sr__Value   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__Value *
++       sr__value__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__value__free_unpacked
++                     (Sr__Value *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__Node methods */
++void   sr__node__init
++                     (Sr__Node         *message);
++size_t sr__node__get_packed_size
++                     (const Sr__Node   *message);
++size_t sr__node__pack
++                     (const Sr__Node   *message,
++                      uint8_t             *out);
++size_t sr__node__pack_to_buffer
++                     (const Sr__Node   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__Node *
++       sr__node__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__node__free_unpacked
++                     (Sr__Node *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__Error methods */
++void   sr__error__init
++                     (Sr__Error         *message);
++size_t sr__error__get_packed_size
++                     (const Sr__Error   *message);
++size_t sr__error__pack
++                     (const Sr__Error   *message,
++                      uint8_t             *out);
++size_t sr__error__pack_to_buffer
++                     (const Sr__Error   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__Error *
++       sr__error__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__error__free_unpacked
++                     (Sr__Error *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SessionStartReq methods */
++void   sr__session_start_req__init
++                     (Sr__SessionStartReq         *message);
++size_t sr__session_start_req__get_packed_size
++                     (const Sr__SessionStartReq   *message);
++size_t sr__session_start_req__pack
++                     (const Sr__SessionStartReq   *message,
++                      uint8_t             *out);
++size_t sr__session_start_req__pack_to_buffer
++                     (const Sr__SessionStartReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SessionStartReq *
++       sr__session_start_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__session_start_req__free_unpacked
++                     (Sr__SessionStartReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SessionStartResp methods */
++void   sr__session_start_resp__init
++                     (Sr__SessionStartResp         *message);
++size_t sr__session_start_resp__get_packed_size
++                     (const Sr__SessionStartResp   *message);
++size_t sr__session_start_resp__pack
++                     (const Sr__SessionStartResp   *message,
++                      uint8_t             *out);
++size_t sr__session_start_resp__pack_to_buffer
++                     (const Sr__SessionStartResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SessionStartResp *
++       sr__session_start_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__session_start_resp__free_unpacked
++                     (Sr__SessionStartResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SessionStopReq methods */
++void   sr__session_stop_req__init
++                     (Sr__SessionStopReq         *message);
++size_t sr__session_stop_req__get_packed_size
++                     (const Sr__SessionStopReq   *message);
++size_t sr__session_stop_req__pack
++                     (const Sr__SessionStopReq   *message,
++                      uint8_t             *out);
++size_t sr__session_stop_req__pack_to_buffer
++                     (const Sr__SessionStopReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SessionStopReq *
++       sr__session_stop_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__session_stop_req__free_unpacked
++                     (Sr__SessionStopReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SessionStopResp methods */
++void   sr__session_stop_resp__init
++                     (Sr__SessionStopResp         *message);
++size_t sr__session_stop_resp__get_packed_size
++                     (const Sr__SessionStopResp   *message);
++size_t sr__session_stop_resp__pack
++                     (const Sr__SessionStopResp   *message,
++                      uint8_t             *out);
++size_t sr__session_stop_resp__pack_to_buffer
++                     (const Sr__SessionStopResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SessionStopResp *
++       sr__session_stop_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__session_stop_resp__free_unpacked
++                     (Sr__SessionStopResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SessionRefreshReq methods */
++void   sr__session_refresh_req__init
++                     (Sr__SessionRefreshReq         *message);
++size_t sr__session_refresh_req__get_packed_size
++                     (const Sr__SessionRefreshReq   *message);
++size_t sr__session_refresh_req__pack
++                     (const Sr__SessionRefreshReq   *message,
++                      uint8_t             *out);
++size_t sr__session_refresh_req__pack_to_buffer
++                     (const Sr__SessionRefreshReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SessionRefreshReq *
++       sr__session_refresh_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__session_refresh_req__free_unpacked
++                     (Sr__SessionRefreshReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SessionRefreshResp methods */
++void   sr__session_refresh_resp__init
++                     (Sr__SessionRefreshResp         *message);
++size_t sr__session_refresh_resp__get_packed_size
++                     (const Sr__SessionRefreshResp   *message);
++size_t sr__session_refresh_resp__pack
++                     (const Sr__SessionRefreshResp   *message,
++                      uint8_t             *out);
++size_t sr__session_refresh_resp__pack_to_buffer
++                     (const Sr__SessionRefreshResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SessionRefreshResp *
++       sr__session_refresh_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__session_refresh_resp__free_unpacked
++                     (Sr__SessionRefreshResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SessionCheckReq methods */
++void   sr__session_check_req__init
++                     (Sr__SessionCheckReq         *message);
++size_t sr__session_check_req__get_packed_size
++                     (const Sr__SessionCheckReq   *message);
++size_t sr__session_check_req__pack
++                     (const Sr__SessionCheckReq   *message,
++                      uint8_t             *out);
++size_t sr__session_check_req__pack_to_buffer
++                     (const Sr__SessionCheckReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SessionCheckReq *
++       sr__session_check_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__session_check_req__free_unpacked
++                     (Sr__SessionCheckReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SessionCheckResp methods */
++void   sr__session_check_resp__init
++                     (Sr__SessionCheckResp         *message);
++size_t sr__session_check_resp__get_packed_size
++                     (const Sr__SessionCheckResp   *message);
++size_t sr__session_check_resp__pack
++                     (const Sr__SessionCheckResp   *message,
++                      uint8_t             *out);
++size_t sr__session_check_resp__pack_to_buffer
++                     (const Sr__SessionCheckResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SessionCheckResp *
++       sr__session_check_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__session_check_resp__free_unpacked
++                     (Sr__SessionCheckResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SessionSwitchDsReq methods */
++void   sr__session_switch_ds_req__init
++                     (Sr__SessionSwitchDsReq         *message);
++size_t sr__session_switch_ds_req__get_packed_size
++                     (const Sr__SessionSwitchDsReq   *message);
++size_t sr__session_switch_ds_req__pack
++                     (const Sr__SessionSwitchDsReq   *message,
++                      uint8_t             *out);
++size_t sr__session_switch_ds_req__pack_to_buffer
++                     (const Sr__SessionSwitchDsReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SessionSwitchDsReq *
++       sr__session_switch_ds_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__session_switch_ds_req__free_unpacked
++                     (Sr__SessionSwitchDsReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SessionSwitchDsResp methods */
++void   sr__session_switch_ds_resp__init
++                     (Sr__SessionSwitchDsResp         *message);
++size_t sr__session_switch_ds_resp__get_packed_size
++                     (const Sr__SessionSwitchDsResp   *message);
++size_t sr__session_switch_ds_resp__pack
++                     (const Sr__SessionSwitchDsResp   *message,
++                      uint8_t             *out);
++size_t sr__session_switch_ds_resp__pack_to_buffer
++                     (const Sr__SessionSwitchDsResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SessionSwitchDsResp *
++       sr__session_switch_ds_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__session_switch_ds_resp__free_unpacked
++                     (Sr__SessionSwitchDsResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SessionSetOptsReq methods */
++void   sr__session_set_opts_req__init
++                     (Sr__SessionSetOptsReq         *message);
++size_t sr__session_set_opts_req__get_packed_size
++                     (const Sr__SessionSetOptsReq   *message);
++size_t sr__session_set_opts_req__pack
++                     (const Sr__SessionSetOptsReq   *message,
++                      uint8_t             *out);
++size_t sr__session_set_opts_req__pack_to_buffer
++                     (const Sr__SessionSetOptsReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SessionSetOptsReq *
++       sr__session_set_opts_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__session_set_opts_req__free_unpacked
++                     (Sr__SessionSetOptsReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SessionSetOptsResp methods */
++void   sr__session_set_opts_resp__init
++                     (Sr__SessionSetOptsResp         *message);
++size_t sr__session_set_opts_resp__get_packed_size
++                     (const Sr__SessionSetOptsResp   *message);
++size_t sr__session_set_opts_resp__pack
++                     (const Sr__SessionSetOptsResp   *message,
++                      uint8_t             *out);
++size_t sr__session_set_opts_resp__pack_to_buffer
++                     (const Sr__SessionSetOptsResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SessionSetOptsResp *
++       sr__session_set_opts_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__session_set_opts_resp__free_unpacked
++                     (Sr__SessionSetOptsResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__VersionVerifyReq methods */
++void   sr__version_verify_req__init
++                     (Sr__VersionVerifyReq         *message);
++size_t sr__version_verify_req__get_packed_size
++                     (const Sr__VersionVerifyReq   *message);
++size_t sr__version_verify_req__pack
++                     (const Sr__VersionVerifyReq   *message,
++                      uint8_t             *out);
++size_t sr__version_verify_req__pack_to_buffer
++                     (const Sr__VersionVerifyReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__VersionVerifyReq *
++       sr__version_verify_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__version_verify_req__free_unpacked
++                     (Sr__VersionVerifyReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__VersionVerifyResp methods */
++void   sr__version_verify_resp__init
++                     (Sr__VersionVerifyResp         *message);
++size_t sr__version_verify_resp__get_packed_size
++                     (const Sr__VersionVerifyResp   *message);
++size_t sr__version_verify_resp__pack
++                     (const Sr__VersionVerifyResp   *message,
++                      uint8_t             *out);
++size_t sr__version_verify_resp__pack_to_buffer
++                     (const Sr__VersionVerifyResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__VersionVerifyResp *
++       sr__version_verify_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__version_verify_resp__free_unpacked
++                     (Sr__VersionVerifyResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SchemaRevision methods */
++void   sr__schema_revision__init
++                     (Sr__SchemaRevision         *message);
++size_t sr__schema_revision__get_packed_size
++                     (const Sr__SchemaRevision   *message);
++size_t sr__schema_revision__pack
++                     (const Sr__SchemaRevision   *message,
++                      uint8_t             *out);
++size_t sr__schema_revision__pack_to_buffer
++                     (const Sr__SchemaRevision   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SchemaRevision *
++       sr__schema_revision__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__schema_revision__free_unpacked
++                     (Sr__SchemaRevision *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SchemaSubmodule methods */
++void   sr__schema_submodule__init
++                     (Sr__SchemaSubmodule         *message);
++size_t sr__schema_submodule__get_packed_size
++                     (const Sr__SchemaSubmodule   *message);
++size_t sr__schema_submodule__pack
++                     (const Sr__SchemaSubmodule   *message,
++                      uint8_t             *out);
++size_t sr__schema_submodule__pack_to_buffer
++                     (const Sr__SchemaSubmodule   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SchemaSubmodule *
++       sr__schema_submodule__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__schema_submodule__free_unpacked
++                     (Sr__SchemaSubmodule *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__Schema methods */
++void   sr__schema__init
++                     (Sr__Schema         *message);
++size_t sr__schema__get_packed_size
++                     (const Sr__Schema   *message);
++size_t sr__schema__pack
++                     (const Sr__Schema   *message,
++                      uint8_t             *out);
++size_t sr__schema__pack_to_buffer
++                     (const Sr__Schema   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__Schema *
++       sr__schema__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__schema__free_unpacked
++                     (Sr__Schema *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__ListSchemasReq methods */
++void   sr__list_schemas_req__init
++                     (Sr__ListSchemasReq         *message);
++size_t sr__list_schemas_req__get_packed_size
++                     (const Sr__ListSchemasReq   *message);
++size_t sr__list_schemas_req__pack
++                     (const Sr__ListSchemasReq   *message,
++                      uint8_t             *out);
++size_t sr__list_schemas_req__pack_to_buffer
++                     (const Sr__ListSchemasReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__ListSchemasReq *
++       sr__list_schemas_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__list_schemas_req__free_unpacked
++                     (Sr__ListSchemasReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__ListSchemasResp methods */
++void   sr__list_schemas_resp__init
++                     (Sr__ListSchemasResp         *message);
++size_t sr__list_schemas_resp__get_packed_size
++                     (const Sr__ListSchemasResp   *message);
++size_t sr__list_schemas_resp__pack
++                     (const Sr__ListSchemasResp   *message,
++                      uint8_t             *out);
++size_t sr__list_schemas_resp__pack_to_buffer
++                     (const Sr__ListSchemasResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__ListSchemasResp *
++       sr__list_schemas_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__list_schemas_resp__free_unpacked
++                     (Sr__ListSchemasResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetSchemaReq methods */
++void   sr__get_schema_req__init
++                     (Sr__GetSchemaReq         *message);
++size_t sr__get_schema_req__get_packed_size
++                     (const Sr__GetSchemaReq   *message);
++size_t sr__get_schema_req__pack
++                     (const Sr__GetSchemaReq   *message,
++                      uint8_t             *out);
++size_t sr__get_schema_req__pack_to_buffer
++                     (const Sr__GetSchemaReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetSchemaReq *
++       sr__get_schema_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_schema_req__free_unpacked
++                     (Sr__GetSchemaReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetSchemaResp methods */
++void   sr__get_schema_resp__init
++                     (Sr__GetSchemaResp         *message);
++size_t sr__get_schema_resp__get_packed_size
++                     (const Sr__GetSchemaResp   *message);
++size_t sr__get_schema_resp__pack
++                     (const Sr__GetSchemaResp   *message,
++                      uint8_t             *out);
++size_t sr__get_schema_resp__pack_to_buffer
++                     (const Sr__GetSchemaResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetSchemaResp *
++       sr__get_schema_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_schema_resp__free_unpacked
++                     (Sr__GetSchemaResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetItemReq methods */
++void   sr__get_item_req__init
++                     (Sr__GetItemReq         *message);
++size_t sr__get_item_req__get_packed_size
++                     (const Sr__GetItemReq   *message);
++size_t sr__get_item_req__pack
++                     (const Sr__GetItemReq   *message,
++                      uint8_t             *out);
++size_t sr__get_item_req__pack_to_buffer
++                     (const Sr__GetItemReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetItemReq *
++       sr__get_item_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_item_req__free_unpacked
++                     (Sr__GetItemReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetItemResp methods */
++void   sr__get_item_resp__init
++                     (Sr__GetItemResp         *message);
++size_t sr__get_item_resp__get_packed_size
++                     (const Sr__GetItemResp   *message);
++size_t sr__get_item_resp__pack
++                     (const Sr__GetItemResp   *message,
++                      uint8_t             *out);
++size_t sr__get_item_resp__pack_to_buffer
++                     (const Sr__GetItemResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetItemResp *
++       sr__get_item_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_item_resp__free_unpacked
++                     (Sr__GetItemResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetItemsReq methods */
++void   sr__get_items_req__init
++                     (Sr__GetItemsReq         *message);
++size_t sr__get_items_req__get_packed_size
++                     (const Sr__GetItemsReq   *message);
++size_t sr__get_items_req__pack
++                     (const Sr__GetItemsReq   *message,
++                      uint8_t             *out);
++size_t sr__get_items_req__pack_to_buffer
++                     (const Sr__GetItemsReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetItemsReq *
++       sr__get_items_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_items_req__free_unpacked
++                     (Sr__GetItemsReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetItemsResp methods */
++void   sr__get_items_resp__init
++                     (Sr__GetItemsResp         *message);
++size_t sr__get_items_resp__get_packed_size
++                     (const Sr__GetItemsResp   *message);
++size_t sr__get_items_resp__pack
++                     (const Sr__GetItemsResp   *message,
++                      uint8_t             *out);
++size_t sr__get_items_resp__pack_to_buffer
++                     (const Sr__GetItemsResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetItemsResp *
++       sr__get_items_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_items_resp__free_unpacked
++                     (Sr__GetItemsResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetSubtreeReq methods */
++void   sr__get_subtree_req__init
++                     (Sr__GetSubtreeReq         *message);
++size_t sr__get_subtree_req__get_packed_size
++                     (const Sr__GetSubtreeReq   *message);
++size_t sr__get_subtree_req__pack
++                     (const Sr__GetSubtreeReq   *message,
++                      uint8_t             *out);
++size_t sr__get_subtree_req__pack_to_buffer
++                     (const Sr__GetSubtreeReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetSubtreeReq *
++       sr__get_subtree_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_subtree_req__free_unpacked
++                     (Sr__GetSubtreeReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetSubtreeResp methods */
++void   sr__get_subtree_resp__init
++                     (Sr__GetSubtreeResp         *message);
++size_t sr__get_subtree_resp__get_packed_size
++                     (const Sr__GetSubtreeResp   *message);
++size_t sr__get_subtree_resp__pack
++                     (const Sr__GetSubtreeResp   *message,
++                      uint8_t             *out);
++size_t sr__get_subtree_resp__pack_to_buffer
++                     (const Sr__GetSubtreeResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetSubtreeResp *
++       sr__get_subtree_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_subtree_resp__free_unpacked
++                     (Sr__GetSubtreeResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetSubtreesReq methods */
++void   sr__get_subtrees_req__init
++                     (Sr__GetSubtreesReq         *message);
++size_t sr__get_subtrees_req__get_packed_size
++                     (const Sr__GetSubtreesReq   *message);
++size_t sr__get_subtrees_req__pack
++                     (const Sr__GetSubtreesReq   *message,
++                      uint8_t             *out);
++size_t sr__get_subtrees_req__pack_to_buffer
++                     (const Sr__GetSubtreesReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetSubtreesReq *
++       sr__get_subtrees_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_subtrees_req__free_unpacked
++                     (Sr__GetSubtreesReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetSubtreesResp methods */
++void   sr__get_subtrees_resp__init
++                     (Sr__GetSubtreesResp         *message);
++size_t sr__get_subtrees_resp__get_packed_size
++                     (const Sr__GetSubtreesResp   *message);
++size_t sr__get_subtrees_resp__pack
++                     (const Sr__GetSubtreesResp   *message,
++                      uint8_t             *out);
++size_t sr__get_subtrees_resp__pack_to_buffer
++                     (const Sr__GetSubtreesResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetSubtreesResp *
++       sr__get_subtrees_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_subtrees_resp__free_unpacked
++                     (Sr__GetSubtreesResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetSubtreeChunkReq methods */
++void   sr__get_subtree_chunk_req__init
++                     (Sr__GetSubtreeChunkReq         *message);
++size_t sr__get_subtree_chunk_req__get_packed_size
++                     (const Sr__GetSubtreeChunkReq   *message);
++size_t sr__get_subtree_chunk_req__pack
++                     (const Sr__GetSubtreeChunkReq   *message,
++                      uint8_t             *out);
++size_t sr__get_subtree_chunk_req__pack_to_buffer
++                     (const Sr__GetSubtreeChunkReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetSubtreeChunkReq *
++       sr__get_subtree_chunk_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_subtree_chunk_req__free_unpacked
++                     (Sr__GetSubtreeChunkReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetSubtreeChunkResp methods */
++void   sr__get_subtree_chunk_resp__init
++                     (Sr__GetSubtreeChunkResp         *message);
++size_t sr__get_subtree_chunk_resp__get_packed_size
++                     (const Sr__GetSubtreeChunkResp   *message);
++size_t sr__get_subtree_chunk_resp__pack
++                     (const Sr__GetSubtreeChunkResp   *message,
++                      uint8_t             *out);
++size_t sr__get_subtree_chunk_resp__pack_to_buffer
++                     (const Sr__GetSubtreeChunkResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetSubtreeChunkResp *
++       sr__get_subtree_chunk_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_subtree_chunk_resp__free_unpacked
++                     (Sr__GetSubtreeChunkResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SetItemReq methods */
++void   sr__set_item_req__init
++                     (Sr__SetItemReq         *message);
++size_t sr__set_item_req__get_packed_size
++                     (const Sr__SetItemReq   *message);
++size_t sr__set_item_req__pack
++                     (const Sr__SetItemReq   *message,
++                      uint8_t             *out);
++size_t sr__set_item_req__pack_to_buffer
++                     (const Sr__SetItemReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SetItemReq *
++       sr__set_item_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__set_item_req__free_unpacked
++                     (Sr__SetItemReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SetItemResp methods */
++void   sr__set_item_resp__init
++                     (Sr__SetItemResp         *message);
++size_t sr__set_item_resp__get_packed_size
++                     (const Sr__SetItemResp   *message);
++size_t sr__set_item_resp__pack
++                     (const Sr__SetItemResp   *message,
++                      uint8_t             *out);
++size_t sr__set_item_resp__pack_to_buffer
++                     (const Sr__SetItemResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SetItemResp *
++       sr__set_item_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__set_item_resp__free_unpacked
++                     (Sr__SetItemResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SetItemStrReq methods */
++void   sr__set_item_str_req__init
++                     (Sr__SetItemStrReq         *message);
++size_t sr__set_item_str_req__get_packed_size
++                     (const Sr__SetItemStrReq   *message);
++size_t sr__set_item_str_req__pack
++                     (const Sr__SetItemStrReq   *message,
++                      uint8_t             *out);
++size_t sr__set_item_str_req__pack_to_buffer
++                     (const Sr__SetItemStrReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SetItemStrReq *
++       sr__set_item_str_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__set_item_str_req__free_unpacked
++                     (Sr__SetItemStrReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SetItemStrResp methods */
++void   sr__set_item_str_resp__init
++                     (Sr__SetItemStrResp         *message);
++size_t sr__set_item_str_resp__get_packed_size
++                     (const Sr__SetItemStrResp   *message);
++size_t sr__set_item_str_resp__pack
++                     (const Sr__SetItemStrResp   *message,
++                      uint8_t             *out);
++size_t sr__set_item_str_resp__pack_to_buffer
++                     (const Sr__SetItemStrResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SetItemStrResp *
++       sr__set_item_str_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__set_item_str_resp__free_unpacked
++                     (Sr__SetItemStrResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__DeleteItemReq methods */
++void   sr__delete_item_req__init
++                     (Sr__DeleteItemReq         *message);
++size_t sr__delete_item_req__get_packed_size
++                     (const Sr__DeleteItemReq   *message);
++size_t sr__delete_item_req__pack
++                     (const Sr__DeleteItemReq   *message,
++                      uint8_t             *out);
++size_t sr__delete_item_req__pack_to_buffer
++                     (const Sr__DeleteItemReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__DeleteItemReq *
++       sr__delete_item_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__delete_item_req__free_unpacked
++                     (Sr__DeleteItemReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__DeleteItemResp methods */
++void   sr__delete_item_resp__init
++                     (Sr__DeleteItemResp         *message);
++size_t sr__delete_item_resp__get_packed_size
++                     (const Sr__DeleteItemResp   *message);
++size_t sr__delete_item_resp__pack
++                     (const Sr__DeleteItemResp   *message,
++                      uint8_t             *out);
++size_t sr__delete_item_resp__pack_to_buffer
++                     (const Sr__DeleteItemResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__DeleteItemResp *
++       sr__delete_item_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__delete_item_resp__free_unpacked
++                     (Sr__DeleteItemResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__MoveItemReq methods */
++void   sr__move_item_req__init
++                     (Sr__MoveItemReq         *message);
++size_t sr__move_item_req__get_packed_size
++                     (const Sr__MoveItemReq   *message);
++size_t sr__move_item_req__pack
++                     (const Sr__MoveItemReq   *message,
++                      uint8_t             *out);
++size_t sr__move_item_req__pack_to_buffer
++                     (const Sr__MoveItemReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__MoveItemReq *
++       sr__move_item_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__move_item_req__free_unpacked
++                     (Sr__MoveItemReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__MoveItemResp methods */
++void   sr__move_item_resp__init
++                     (Sr__MoveItemResp         *message);
++size_t sr__move_item_resp__get_packed_size
++                     (const Sr__MoveItemResp   *message);
++size_t sr__move_item_resp__pack
++                     (const Sr__MoveItemResp   *message,
++                      uint8_t             *out);
++size_t sr__move_item_resp__pack_to_buffer
++                     (const Sr__MoveItemResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__MoveItemResp *
++       sr__move_item_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__move_item_resp__free_unpacked
++                     (Sr__MoveItemResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__ValidateReq methods */
++void   sr__validate_req__init
++                     (Sr__ValidateReq         *message);
++size_t sr__validate_req__get_packed_size
++                     (const Sr__ValidateReq   *message);
++size_t sr__validate_req__pack
++                     (const Sr__ValidateReq   *message,
++                      uint8_t             *out);
++size_t sr__validate_req__pack_to_buffer
++                     (const Sr__ValidateReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__ValidateReq *
++       sr__validate_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__validate_req__free_unpacked
++                     (Sr__ValidateReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__ValidateResp methods */
++void   sr__validate_resp__init
++                     (Sr__ValidateResp         *message);
++size_t sr__validate_resp__get_packed_size
++                     (const Sr__ValidateResp   *message);
++size_t sr__validate_resp__pack
++                     (const Sr__ValidateResp   *message,
++                      uint8_t             *out);
++size_t sr__validate_resp__pack_to_buffer
++                     (const Sr__ValidateResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__ValidateResp *
++       sr__validate_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__validate_resp__free_unpacked
++                     (Sr__ValidateResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__CommitReq methods */
++void   sr__commit_req__init
++                     (Sr__CommitReq         *message);
++size_t sr__commit_req__get_packed_size
++                     (const Sr__CommitReq   *message);
++size_t sr__commit_req__pack
++                     (const Sr__CommitReq   *message,
++                      uint8_t             *out);
++size_t sr__commit_req__pack_to_buffer
++                     (const Sr__CommitReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__CommitReq *
++       sr__commit_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__commit_req__free_unpacked
++                     (Sr__CommitReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__CommitResp methods */
++void   sr__commit_resp__init
++                     (Sr__CommitResp         *message);
++size_t sr__commit_resp__get_packed_size
++                     (const Sr__CommitResp   *message);
++size_t sr__commit_resp__pack
++                     (const Sr__CommitResp   *message,
++                      uint8_t             *out);
++size_t sr__commit_resp__pack_to_buffer
++                     (const Sr__CommitResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__CommitResp *
++       sr__commit_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__commit_resp__free_unpacked
++                     (Sr__CommitResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__DiscardChangesReq methods */
++void   sr__discard_changes_req__init
++                     (Sr__DiscardChangesReq         *message);
++size_t sr__discard_changes_req__get_packed_size
++                     (const Sr__DiscardChangesReq   *message);
++size_t sr__discard_changes_req__pack
++                     (const Sr__DiscardChangesReq   *message,
++                      uint8_t             *out);
++size_t sr__discard_changes_req__pack_to_buffer
++                     (const Sr__DiscardChangesReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__DiscardChangesReq *
++       sr__discard_changes_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__discard_changes_req__free_unpacked
++                     (Sr__DiscardChangesReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__DiscardChangesResp methods */
++void   sr__discard_changes_resp__init
++                     (Sr__DiscardChangesResp         *message);
++size_t sr__discard_changes_resp__get_packed_size
++                     (const Sr__DiscardChangesResp   *message);
++size_t sr__discard_changes_resp__pack
++                     (const Sr__DiscardChangesResp   *message,
++                      uint8_t             *out);
++size_t sr__discard_changes_resp__pack_to_buffer
++                     (const Sr__DiscardChangesResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__DiscardChangesResp *
++       sr__discard_changes_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__discard_changes_resp__free_unpacked
++                     (Sr__DiscardChangesResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__CopyConfigReq methods */
++void   sr__copy_config_req__init
++                     (Sr__CopyConfigReq         *message);
++size_t sr__copy_config_req__get_packed_size
++                     (const Sr__CopyConfigReq   *message);
++size_t sr__copy_config_req__pack
++                     (const Sr__CopyConfigReq   *message,
++                      uint8_t             *out);
++size_t sr__copy_config_req__pack_to_buffer
++                     (const Sr__CopyConfigReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__CopyConfigReq *
++       sr__copy_config_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__copy_config_req__free_unpacked
++                     (Sr__CopyConfigReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__CopyConfigResp methods */
++void   sr__copy_config_resp__init
++                     (Sr__CopyConfigResp         *message);
++size_t sr__copy_config_resp__get_packed_size
++                     (const Sr__CopyConfigResp   *message);
++size_t sr__copy_config_resp__pack
++                     (const Sr__CopyConfigResp   *message,
++                      uint8_t             *out);
++size_t sr__copy_config_resp__pack_to_buffer
++                     (const Sr__CopyConfigResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__CopyConfigResp *
++       sr__copy_config_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__copy_config_resp__free_unpacked
++                     (Sr__CopyConfigResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__LockReq methods */
++void   sr__lock_req__init
++                     (Sr__LockReq         *message);
++size_t sr__lock_req__get_packed_size
++                     (const Sr__LockReq   *message);
++size_t sr__lock_req__pack
++                     (const Sr__LockReq   *message,
++                      uint8_t             *out);
++size_t sr__lock_req__pack_to_buffer
++                     (const Sr__LockReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__LockReq *
++       sr__lock_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__lock_req__free_unpacked
++                     (Sr__LockReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__LockResp methods */
++void   sr__lock_resp__init
++                     (Sr__LockResp         *message);
++size_t sr__lock_resp__get_packed_size
++                     (const Sr__LockResp   *message);
++size_t sr__lock_resp__pack
++                     (const Sr__LockResp   *message,
++                      uint8_t             *out);
++size_t sr__lock_resp__pack_to_buffer
++                     (const Sr__LockResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__LockResp *
++       sr__lock_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__lock_resp__free_unpacked
++                     (Sr__LockResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__UnlockReq methods */
++void   sr__unlock_req__init
++                     (Sr__UnlockReq         *message);
++size_t sr__unlock_req__get_packed_size
++                     (const Sr__UnlockReq   *message);
++size_t sr__unlock_req__pack
++                     (const Sr__UnlockReq   *message,
++                      uint8_t             *out);
++size_t sr__unlock_req__pack_to_buffer
++                     (const Sr__UnlockReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__UnlockReq *
++       sr__unlock_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__unlock_req__free_unpacked
++                     (Sr__UnlockReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__UnlockResp methods */
++void   sr__unlock_resp__init
++                     (Sr__UnlockResp         *message);
++size_t sr__unlock_resp__get_packed_size
++                     (const Sr__UnlockResp   *message);
++size_t sr__unlock_resp__pack
++                     (const Sr__UnlockResp   *message,
++                      uint8_t             *out);
++size_t sr__unlock_resp__pack_to_buffer
++                     (const Sr__UnlockResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__UnlockResp *
++       sr__unlock_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__unlock_resp__free_unpacked
++                     (Sr__UnlockResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SubscribeReq methods */
++void   sr__subscribe_req__init
++                     (Sr__SubscribeReq         *message);
++size_t sr__subscribe_req__get_packed_size
++                     (const Sr__SubscribeReq   *message);
++size_t sr__subscribe_req__pack
++                     (const Sr__SubscribeReq   *message,
++                      uint8_t             *out);
++size_t sr__subscribe_req__pack_to_buffer
++                     (const Sr__SubscribeReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SubscribeReq *
++       sr__subscribe_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__subscribe_req__free_unpacked
++                     (Sr__SubscribeReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SubscribeResp methods */
++void   sr__subscribe_resp__init
++                     (Sr__SubscribeResp         *message);
++size_t sr__subscribe_resp__get_packed_size
++                     (const Sr__SubscribeResp   *message);
++size_t sr__subscribe_resp__pack
++                     (const Sr__SubscribeResp   *message,
++                      uint8_t             *out);
++size_t sr__subscribe_resp__pack_to_buffer
++                     (const Sr__SubscribeResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SubscribeResp *
++       sr__subscribe_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__subscribe_resp__free_unpacked
++                     (Sr__SubscribeResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__UnsubscribeReq methods */
++void   sr__unsubscribe_req__init
++                     (Sr__UnsubscribeReq         *message);
++size_t sr__unsubscribe_req__get_packed_size
++                     (const Sr__UnsubscribeReq   *message);
++size_t sr__unsubscribe_req__pack
++                     (const Sr__UnsubscribeReq   *message,
++                      uint8_t             *out);
++size_t sr__unsubscribe_req__pack_to_buffer
++                     (const Sr__UnsubscribeReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__UnsubscribeReq *
++       sr__unsubscribe_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__unsubscribe_req__free_unpacked
++                     (Sr__UnsubscribeReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__UnsubscribeResp methods */
++void   sr__unsubscribe_resp__init
++                     (Sr__UnsubscribeResp         *message);
++size_t sr__unsubscribe_resp__get_packed_size
++                     (const Sr__UnsubscribeResp   *message);
++size_t sr__unsubscribe_resp__pack
++                     (const Sr__UnsubscribeResp   *message,
++                      uint8_t             *out);
++size_t sr__unsubscribe_resp__pack_to_buffer
++                     (const Sr__UnsubscribeResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__UnsubscribeResp *
++       sr__unsubscribe_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__unsubscribe_resp__free_unpacked
++                     (Sr__UnsubscribeResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__CheckEnabledRunningReq methods */
++void   sr__check_enabled_running_req__init
++                     (Sr__CheckEnabledRunningReq         *message);
++size_t sr__check_enabled_running_req__get_packed_size
++                     (const Sr__CheckEnabledRunningReq   *message);
++size_t sr__check_enabled_running_req__pack
++                     (const Sr__CheckEnabledRunningReq   *message,
++                      uint8_t             *out);
++size_t sr__check_enabled_running_req__pack_to_buffer
++                     (const Sr__CheckEnabledRunningReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__CheckEnabledRunningReq *
++       sr__check_enabled_running_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__check_enabled_running_req__free_unpacked
++                     (Sr__CheckEnabledRunningReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__CheckEnabledRunningResp methods */
++void   sr__check_enabled_running_resp__init
++                     (Sr__CheckEnabledRunningResp         *message);
++size_t sr__check_enabled_running_resp__get_packed_size
++                     (const Sr__CheckEnabledRunningResp   *message);
++size_t sr__check_enabled_running_resp__pack
++                     (const Sr__CheckEnabledRunningResp   *message,
++                      uint8_t             *out);
++size_t sr__check_enabled_running_resp__pack_to_buffer
++                     (const Sr__CheckEnabledRunningResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__CheckEnabledRunningResp *
++       sr__check_enabled_running_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__check_enabled_running_resp__free_unpacked
++                     (Sr__CheckEnabledRunningResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__ModuleInstallNotification methods */
++void   sr__module_install_notification__init
++                     (Sr__ModuleInstallNotification         *message);
++size_t sr__module_install_notification__get_packed_size
++                     (const Sr__ModuleInstallNotification   *message);
++size_t sr__module_install_notification__pack
++                     (const Sr__ModuleInstallNotification   *message,
++                      uint8_t             *out);
++size_t sr__module_install_notification__pack_to_buffer
++                     (const Sr__ModuleInstallNotification   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__ModuleInstallNotification *
++       sr__module_install_notification__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__module_install_notification__free_unpacked
++                     (Sr__ModuleInstallNotification *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__FeatureEnableNotification methods */
++void   sr__feature_enable_notification__init
++                     (Sr__FeatureEnableNotification         *message);
++size_t sr__feature_enable_notification__get_packed_size
++                     (const Sr__FeatureEnableNotification   *message);
++size_t sr__feature_enable_notification__pack
++                     (const Sr__FeatureEnableNotification   *message,
++                      uint8_t             *out);
++size_t sr__feature_enable_notification__pack_to_buffer
++                     (const Sr__FeatureEnableNotification   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__FeatureEnableNotification *
++       sr__feature_enable_notification__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__feature_enable_notification__free_unpacked
++                     (Sr__FeatureEnableNotification *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__ModuleChangeNotification methods */
++void   sr__module_change_notification__init
++                     (Sr__ModuleChangeNotification         *message);
++size_t sr__module_change_notification__get_packed_size
++                     (const Sr__ModuleChangeNotification   *message);
++size_t sr__module_change_notification__pack
++                     (const Sr__ModuleChangeNotification   *message,
++                      uint8_t             *out);
++size_t sr__module_change_notification__pack_to_buffer
++                     (const Sr__ModuleChangeNotification   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__ModuleChangeNotification *
++       sr__module_change_notification__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__module_change_notification__free_unpacked
++                     (Sr__ModuleChangeNotification *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__SubtreeChangeNotification methods */
++void   sr__subtree_change_notification__init
++                     (Sr__SubtreeChangeNotification         *message);
++size_t sr__subtree_change_notification__get_packed_size
++                     (const Sr__SubtreeChangeNotification   *message);
++size_t sr__subtree_change_notification__pack
++                     (const Sr__SubtreeChangeNotification   *message,
++                      uint8_t             *out);
++size_t sr__subtree_change_notification__pack_to_buffer
++                     (const Sr__SubtreeChangeNotification   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__SubtreeChangeNotification *
++       sr__subtree_change_notification__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__subtree_change_notification__free_unpacked
++                     (Sr__SubtreeChangeNotification *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__Change methods */
++void   sr__change__init
++                     (Sr__Change         *message);
++size_t sr__change__get_packed_size
++                     (const Sr__Change   *message);
++size_t sr__change__pack
++                     (const Sr__Change   *message,
++                      uint8_t             *out);
++size_t sr__change__pack_to_buffer
++                     (const Sr__Change   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__Change *
++       sr__change__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__change__free_unpacked
++                     (Sr__Change *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetChangesReq methods */
++void   sr__get_changes_req__init
++                     (Sr__GetChangesReq         *message);
++size_t sr__get_changes_req__get_packed_size
++                     (const Sr__GetChangesReq   *message);
++size_t sr__get_changes_req__pack
++                     (const Sr__GetChangesReq   *message,
++                      uint8_t             *out);
++size_t sr__get_changes_req__pack_to_buffer
++                     (const Sr__GetChangesReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetChangesReq *
++       sr__get_changes_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_changes_req__free_unpacked
++                     (Sr__GetChangesReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__GetChangesResp methods */
++void   sr__get_changes_resp__init
++                     (Sr__GetChangesResp         *message);
++size_t sr__get_changes_resp__get_packed_size
++                     (const Sr__GetChangesResp   *message);
++size_t sr__get_changes_resp__pack
++                     (const Sr__GetChangesResp   *message,
++                      uint8_t             *out);
++size_t sr__get_changes_resp__pack_to_buffer
++                     (const Sr__GetChangesResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__GetChangesResp *
++       sr__get_changes_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__get_changes_resp__free_unpacked
++                     (Sr__GetChangesResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__CheckExecPermReq methods */
++void   sr__check_exec_perm_req__init
++                     (Sr__CheckExecPermReq         *message);
++size_t sr__check_exec_perm_req__get_packed_size
++                     (const Sr__CheckExecPermReq   *message);
++size_t sr__check_exec_perm_req__pack
++                     (const Sr__CheckExecPermReq   *message,
++                      uint8_t             *out);
++size_t sr__check_exec_perm_req__pack_to_buffer
++                     (const Sr__CheckExecPermReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__CheckExecPermReq *
++       sr__check_exec_perm_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__check_exec_perm_req__free_unpacked
++                     (Sr__CheckExecPermReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__CheckExecPermResp methods */
++void   sr__check_exec_perm_resp__init
++                     (Sr__CheckExecPermResp         *message);
++size_t sr__check_exec_perm_resp__get_packed_size
++                     (const Sr__CheckExecPermResp   *message);
++size_t sr__check_exec_perm_resp__pack
++                     (const Sr__CheckExecPermResp   *message,
++                      uint8_t             *out);
++size_t sr__check_exec_perm_resp__pack_to_buffer
++                     (const Sr__CheckExecPermResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__CheckExecPermResp *
++       sr__check_exec_perm_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__check_exec_perm_resp__free_unpacked
++                     (Sr__CheckExecPermResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__RPCReq methods */
++void   sr__rpcreq__init
++                     (Sr__RPCReq         *message);
++size_t sr__rpcreq__get_packed_size
++                     (const Sr__RPCReq   *message);
++size_t sr__rpcreq__pack
++                     (const Sr__RPCReq   *message,
++                      uint8_t             *out);
++size_t sr__rpcreq__pack_to_buffer
++                     (const Sr__RPCReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__RPCReq *
++       sr__rpcreq__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__rpcreq__free_unpacked
++                     (Sr__RPCReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__RPCResp methods */
++void   sr__rpcresp__init
++                     (Sr__RPCResp         *message);
++size_t sr__rpcresp__get_packed_size
++                     (const Sr__RPCResp   *message);
++size_t sr__rpcresp__pack
++                     (const Sr__RPCResp   *message,
++                      uint8_t             *out);
++size_t sr__rpcresp__pack_to_buffer
++                     (const Sr__RPCResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__RPCResp *
++       sr__rpcresp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__rpcresp__free_unpacked
++                     (Sr__RPCResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__EventNotifReq methods */
++void   sr__event_notif_req__init
++                     (Sr__EventNotifReq         *message);
++size_t sr__event_notif_req__get_packed_size
++                     (const Sr__EventNotifReq   *message);
++size_t sr__event_notif_req__pack
++                     (const Sr__EventNotifReq   *message,
++                      uint8_t             *out);
++size_t sr__event_notif_req__pack_to_buffer
++                     (const Sr__EventNotifReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__EventNotifReq *
++       sr__event_notif_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__event_notif_req__free_unpacked
++                     (Sr__EventNotifReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__EventNotifResp methods */
++void   sr__event_notif_resp__init
++                     (Sr__EventNotifResp         *message);
++size_t sr__event_notif_resp__get_packed_size
++                     (const Sr__EventNotifResp   *message);
++size_t sr__event_notif_resp__pack
++                     (const Sr__EventNotifResp   *message,
++                      uint8_t             *out);
++size_t sr__event_notif_resp__pack_to_buffer
++                     (const Sr__EventNotifResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__EventNotifResp *
++       sr__event_notif_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__event_notif_resp__free_unpacked
++                     (Sr__EventNotifResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__EventNotifReplayReq methods */
++void   sr__event_notif_replay_req__init
++                     (Sr__EventNotifReplayReq         *message);
++size_t sr__event_notif_replay_req__get_packed_size
++                     (const Sr__EventNotifReplayReq   *message);
++size_t sr__event_notif_replay_req__pack
++                     (const Sr__EventNotifReplayReq   *message,
++                      uint8_t             *out);
++size_t sr__event_notif_replay_req__pack_to_buffer
++                     (const Sr__EventNotifReplayReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__EventNotifReplayReq *
++       sr__event_notif_replay_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__event_notif_replay_req__free_unpacked
++                     (Sr__EventNotifReplayReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__EventNotifReplayResp methods */
++void   sr__event_notif_replay_resp__init
++                     (Sr__EventNotifReplayResp         *message);
++size_t sr__event_notif_replay_resp__get_packed_size
++                     (const Sr__EventNotifReplayResp   *message);
++size_t sr__event_notif_replay_resp__pack
++                     (const Sr__EventNotifReplayResp   *message,
++                      uint8_t             *out);
++size_t sr__event_notif_replay_resp__pack_to_buffer
++                     (const Sr__EventNotifReplayResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__EventNotifReplayResp *
++       sr__event_notif_replay_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__event_notif_replay_resp__free_unpacked
++                     (Sr__EventNotifReplayResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__DataProvideReq methods */
++void   sr__data_provide_req__init
++                     (Sr__DataProvideReq         *message);
++size_t sr__data_provide_req__get_packed_size
++                     (const Sr__DataProvideReq   *message);
++size_t sr__data_provide_req__pack
++                     (const Sr__DataProvideReq   *message,
++                      uint8_t             *out);
++size_t sr__data_provide_req__pack_to_buffer
++                     (const Sr__DataProvideReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__DataProvideReq *
++       sr__data_provide_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__data_provide_req__free_unpacked
++                     (Sr__DataProvideReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__DataProvideResp methods */
++void   sr__data_provide_resp__init
++                     (Sr__DataProvideResp         *message);
++size_t sr__data_provide_resp__get_packed_size
++                     (const Sr__DataProvideResp   *message);
++size_t sr__data_provide_resp__pack
++                     (const Sr__DataProvideResp   *message,
++                      uint8_t             *out);
++size_t sr__data_provide_resp__pack_to_buffer
++                     (const Sr__DataProvideResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__DataProvideResp *
++       sr__data_provide_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__data_provide_resp__free_unpacked
++                     (Sr__DataProvideResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__ModuleInstallReq methods */
++void   sr__module_install_req__init
++                     (Sr__ModuleInstallReq         *message);
++size_t sr__module_install_req__get_packed_size
++                     (const Sr__ModuleInstallReq   *message);
++size_t sr__module_install_req__pack
++                     (const Sr__ModuleInstallReq   *message,
++                      uint8_t             *out);
++size_t sr__module_install_req__pack_to_buffer
++                     (const Sr__ModuleInstallReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__ModuleInstallReq *
++       sr__module_install_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__module_install_req__free_unpacked
++                     (Sr__ModuleInstallReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__ModuleInstallResp methods */
++void   sr__module_install_resp__init
++                     (Sr__ModuleInstallResp         *message);
++size_t sr__module_install_resp__get_packed_size
++                     (const Sr__ModuleInstallResp   *message);
++size_t sr__module_install_resp__pack
++                     (const Sr__ModuleInstallResp   *message,
++                      uint8_t             *out);
++size_t sr__module_install_resp__pack_to_buffer
++                     (const Sr__ModuleInstallResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__ModuleInstallResp *
++       sr__module_install_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__module_install_resp__free_unpacked
++                     (Sr__ModuleInstallResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__FeatureEnableReq methods */
++void   sr__feature_enable_req__init
++                     (Sr__FeatureEnableReq         *message);
++size_t sr__feature_enable_req__get_packed_size
++                     (const Sr__FeatureEnableReq   *message);
++size_t sr__feature_enable_req__pack
++                     (const Sr__FeatureEnableReq   *message,
++                      uint8_t             *out);
++size_t sr__feature_enable_req__pack_to_buffer
++                     (const Sr__FeatureEnableReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__FeatureEnableReq *
++       sr__feature_enable_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__feature_enable_req__free_unpacked
++                     (Sr__FeatureEnableReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__FeatureEnableResp methods */
++void   sr__feature_enable_resp__init
++                     (Sr__FeatureEnableResp         *message);
++size_t sr__feature_enable_resp__get_packed_size
++                     (const Sr__FeatureEnableResp   *message);
++size_t sr__feature_enable_resp__pack
++                     (const Sr__FeatureEnableResp   *message,
++                      uint8_t             *out);
++size_t sr__feature_enable_resp__pack_to_buffer
++                     (const Sr__FeatureEnableResp   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__FeatureEnableResp *
++       sr__feature_enable_resp__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__feature_enable_resp__free_unpacked
++                     (Sr__FeatureEnableResp *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__UnsubscribeDestinationReq methods */
++void   sr__unsubscribe_destination_req__init
++                     (Sr__UnsubscribeDestinationReq         *message);
++size_t sr__unsubscribe_destination_req__get_packed_size
++                     (const Sr__UnsubscribeDestinationReq   *message);
++size_t sr__unsubscribe_destination_req__pack
++                     (const Sr__UnsubscribeDestinationReq   *message,
++                      uint8_t             *out);
++size_t sr__unsubscribe_destination_req__pack_to_buffer
++                     (const Sr__UnsubscribeDestinationReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__UnsubscribeDestinationReq *
++       sr__unsubscribe_destination_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__unsubscribe_destination_req__free_unpacked
++                     (Sr__UnsubscribeDestinationReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__CommitTimeoutReq methods */
++void   sr__commit_timeout_req__init
++                     (Sr__CommitTimeoutReq         *message);
++size_t sr__commit_timeout_req__get_packed_size
++                     (const Sr__CommitTimeoutReq   *message);
++size_t sr__commit_timeout_req__pack
++                     (const Sr__CommitTimeoutReq   *message,
++                      uint8_t             *out);
++size_t sr__commit_timeout_req__pack_to_buffer
++                     (const Sr__CommitTimeoutReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__CommitTimeoutReq *
++       sr__commit_timeout_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__commit_timeout_req__free_unpacked
++                     (Sr__CommitTimeoutReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__OperDataTimeoutReq methods */
++void   sr__oper_data_timeout_req__init
++                     (Sr__OperDataTimeoutReq         *message);
++size_t sr__oper_data_timeout_req__get_packed_size
++                     (const Sr__OperDataTimeoutReq   *message);
++size_t sr__oper_data_timeout_req__pack
++                     (const Sr__OperDataTimeoutReq   *message,
++                      uint8_t             *out);
++size_t sr__oper_data_timeout_req__pack_to_buffer
++                     (const Sr__OperDataTimeoutReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__OperDataTimeoutReq *
++       sr__oper_data_timeout_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__oper_data_timeout_req__free_unpacked
++                     (Sr__OperDataTimeoutReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__InternalStateDataReq methods */
++void   sr__internal_state_data_req__init
++                     (Sr__InternalStateDataReq         *message);
++size_t sr__internal_state_data_req__get_packed_size
++                     (const Sr__InternalStateDataReq   *message);
++size_t sr__internal_state_data_req__pack
++                     (const Sr__InternalStateDataReq   *message,
++                      uint8_t             *out);
++size_t sr__internal_state_data_req__pack_to_buffer
++                     (const Sr__InternalStateDataReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__InternalStateDataReq *
++       sr__internal_state_data_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__internal_state_data_req__free_unpacked
++                     (Sr__InternalStateDataReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__NotifStoreCleanupReq methods */
++void   sr__notif_store_cleanup_req__init
++                     (Sr__NotifStoreCleanupReq         *message);
++size_t sr__notif_store_cleanup_req__get_packed_size
++                     (const Sr__NotifStoreCleanupReq   *message);
++size_t sr__notif_store_cleanup_req__pack
++                     (const Sr__NotifStoreCleanupReq   *message,
++                      uint8_t             *out);
++size_t sr__notif_store_cleanup_req__pack_to_buffer
++                     (const Sr__NotifStoreCleanupReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__NotifStoreCleanupReq *
++       sr__notif_store_cleanup_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__notif_store_cleanup_req__free_unpacked
++                     (Sr__NotifStoreCleanupReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__DelayedMsgReq methods */
++void   sr__delayed_msg_req__init
++                     (Sr__DelayedMsgReq         *message);
++size_t sr__delayed_msg_req__get_packed_size
++                     (const Sr__DelayedMsgReq   *message);
++size_t sr__delayed_msg_req__pack
++                     (const Sr__DelayedMsgReq   *message,
++                      uint8_t             *out);
++size_t sr__delayed_msg_req__pack_to_buffer
++                     (const Sr__DelayedMsgReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__DelayedMsgReq *
++       sr__delayed_msg_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__delayed_msg_req__free_unpacked
++                     (Sr__DelayedMsgReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__NacmReloadReq methods */
++void   sr__nacm_reload_req__init
++                     (Sr__NacmReloadReq         *message);
++size_t sr__nacm_reload_req__get_packed_size
++                     (const Sr__NacmReloadReq   *message);
++size_t sr__nacm_reload_req__pack
++                     (const Sr__NacmReloadReq   *message,
++                      uint8_t             *out);
++size_t sr__nacm_reload_req__pack_to_buffer
++                     (const Sr__NacmReloadReq   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__NacmReloadReq *
++       sr__nacm_reload_req__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__nacm_reload_req__free_unpacked
++                     (Sr__NacmReloadReq *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__Request methods */
++void   sr__request__init
++                     (Sr__Request         *message);
++size_t sr__request__get_packed_size
++                     (const Sr__Request   *message);
++size_t sr__request__pack
++                     (const Sr__Request   *message,
++                      uint8_t             *out);
++size_t sr__request__pack_to_buffer
++                     (const Sr__Request   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__Request *
++       sr__request__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__request__free_unpacked
++                     (Sr__Request *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__Response methods */
++void   sr__response__init
++                     (Sr__Response         *message);
++size_t sr__response__get_packed_size
++                     (const Sr__Response   *message);
++size_t sr__response__pack
++                     (const Sr__Response   *message,
++                      uint8_t             *out);
++size_t sr__response__pack_to_buffer
++                     (const Sr__Response   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__Response *
++       sr__response__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__response__free_unpacked
++                     (Sr__Response *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__Notification methods */
++void   sr__notification__init
++                     (Sr__Notification         *message);
++size_t sr__notification__get_packed_size
++                     (const Sr__Notification   *message);
++size_t sr__notification__pack
++                     (const Sr__Notification   *message,
++                      uint8_t             *out);
++size_t sr__notification__pack_to_buffer
++                     (const Sr__Notification   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__Notification *
++       sr__notification__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__notification__free_unpacked
++                     (Sr__Notification *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__NotificationAck methods */
++void   sr__notification_ack__init
++                     (Sr__NotificationAck         *message);
++size_t sr__notification_ack__get_packed_size
++                     (const Sr__NotificationAck   *message);
++size_t sr__notification_ack__pack
++                     (const Sr__NotificationAck   *message,
++                      uint8_t             *out);
++size_t sr__notification_ack__pack_to_buffer
++                     (const Sr__NotificationAck   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__NotificationAck *
++       sr__notification_ack__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__notification_ack__free_unpacked
++                     (Sr__NotificationAck *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__InternalRequest methods */
++void   sr__internal_request__init
++                     (Sr__InternalRequest         *message);
++size_t sr__internal_request__get_packed_size
++                     (const Sr__InternalRequest   *message);
++size_t sr__internal_request__pack
++                     (const Sr__InternalRequest   *message,
++                      uint8_t             *out);
++size_t sr__internal_request__pack_to_buffer
++                     (const Sr__InternalRequest   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__InternalRequest *
++       sr__internal_request__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__internal_request__free_unpacked
++                     (Sr__InternalRequest *message,
++                      ProtobufCAllocator *allocator);
++/* Sr__Msg methods */
++void   sr__msg__init
++                     (Sr__Msg         *message);
++size_t sr__msg__get_packed_size
++                     (const Sr__Msg   *message);
++size_t sr__msg__pack
++                     (const Sr__Msg   *message,
++                      uint8_t             *out);
++size_t sr__msg__pack_to_buffer
++                     (const Sr__Msg   *message,
++                      ProtobufCBuffer     *buffer);
++Sr__Msg *
++       sr__msg__unpack
++                     (ProtobufCAllocator  *allocator,
++                      size_t               len,
++                      const uint8_t       *data);
++void   sr__msg__free_unpacked
++                     (Sr__Msg *message,
++                      ProtobufCAllocator *allocator);
++/* --- per-message closures --- */
++
++typedef void (*Sr__Value_Closure)
++                 (const Sr__Value *message,
++                  void *closure_data);
++typedef void (*Sr__Node_Closure)
++                 (const Sr__Node *message,
++                  void *closure_data);
++typedef void (*Sr__Error_Closure)
++                 (const Sr__Error *message,
++                  void *closure_data);
++typedef void (*Sr__SessionStartReq_Closure)
++                 (const Sr__SessionStartReq *message,
++                  void *closure_data);
++typedef void (*Sr__SessionStartResp_Closure)
++                 (const Sr__SessionStartResp *message,
++                  void *closure_data);
++typedef void (*Sr__SessionStopReq_Closure)
++                 (const Sr__SessionStopReq *message,
++                  void *closure_data);
++typedef void (*Sr__SessionStopResp_Closure)
++                 (const Sr__SessionStopResp *message,
++                  void *closure_data);
++typedef void (*Sr__SessionRefreshReq_Closure)
++                 (const Sr__SessionRefreshReq *message,
++                  void *closure_data);
++typedef void (*Sr__SessionRefreshResp_Closure)
++                 (const Sr__SessionRefreshResp *message,
++                  void *closure_data);
++typedef void (*Sr__SessionCheckReq_Closure)
++                 (const Sr__SessionCheckReq *message,
++                  void *closure_data);
++typedef void (*Sr__SessionCheckResp_Closure)
++                 (const Sr__SessionCheckResp *message,
++                  void *closure_data);
++typedef void (*Sr__SessionSwitchDsReq_Closure)
++                 (const Sr__SessionSwitchDsReq *message,
++                  void *closure_data);
++typedef void (*Sr__SessionSwitchDsResp_Closure)
++                 (const Sr__SessionSwitchDsResp *message,
++                  void *closure_data);
++typedef void (*Sr__SessionSetOptsReq_Closure)
++                 (const Sr__SessionSetOptsReq *message,
++                  void *closure_data);
++typedef void (*Sr__SessionSetOptsResp_Closure)
++                 (const Sr__SessionSetOptsResp *message,
++                  void *closure_data);
++typedef void (*Sr__VersionVerifyReq_Closure)
++                 (const Sr__VersionVerifyReq *message,
++                  void *closure_data);
++typedef void (*Sr__VersionVerifyResp_Closure)
++                 (const Sr__VersionVerifyResp *message,
++                  void *closure_data);
++typedef void (*Sr__SchemaRevision_Closure)
++                 (const Sr__SchemaRevision *message,
++                  void *closure_data);
++typedef void (*Sr__SchemaSubmodule_Closure)
++                 (const Sr__SchemaSubmodule *message,
++                  void *closure_data);
++typedef void (*Sr__Schema_Closure)
++                 (const Sr__Schema *message,
++                  void *closure_data);
++typedef void (*Sr__ListSchemasReq_Closure)
++                 (const Sr__ListSchemasReq *message,
++                  void *closure_data);
++typedef void (*Sr__ListSchemasResp_Closure)
++                 (const Sr__ListSchemasResp *message,
++                  void *closure_data);
++typedef void (*Sr__GetSchemaReq_Closure)
++                 (const Sr__GetSchemaReq *message,
++                  void *closure_data);
++typedef void (*Sr__GetSchemaResp_Closure)
++                 (const Sr__GetSchemaResp *message,
++                  void *closure_data);
++typedef void (*Sr__GetItemReq_Closure)
++                 (const Sr__GetItemReq *message,
++                  void *closure_data);
++typedef void (*Sr__GetItemResp_Closure)
++                 (const Sr__GetItemResp *message,
++                  void *closure_data);
++typedef void (*Sr__GetItemsReq_Closure)
++                 (const Sr__GetItemsReq *message,
++                  void *closure_data);
++typedef void (*Sr__GetItemsResp_Closure)
++                 (const Sr__GetItemsResp *message,
++                  void *closure_data);
++typedef void (*Sr__GetSubtreeReq_Closure)
++                 (const Sr__GetSubtreeReq *message,
++                  void *closure_data);
++typedef void (*Sr__GetSubtreeResp_Closure)
++                 (const Sr__GetSubtreeResp *message,
++                  void *closure_data);
++typedef void (*Sr__GetSubtreesReq_Closure)
++                 (const Sr__GetSubtreesReq *message,
++                  void *closure_data);
++typedef void (*Sr__GetSubtreesResp_Closure)
++                 (const Sr__GetSubtreesResp *message,
++                  void *closure_data);
++typedef void (*Sr__GetSubtreeChunkReq_Closure)
++                 (const Sr__GetSubtreeChunkReq *message,
++                  void *closure_data);
++typedef void (*Sr__GetSubtreeChunkResp_Closure)
++                 (const Sr__GetSubtreeChunkResp *message,
++                  void *closure_data);
++typedef void (*Sr__SetItemReq_Closure)
++                 (const Sr__SetItemReq *message,
++                  void *closure_data);
++typedef void (*Sr__SetItemResp_Closure)
++                 (const Sr__SetItemResp *message,
++                  void *closure_data);
++typedef void (*Sr__SetItemStrReq_Closure)
++                 (const Sr__SetItemStrReq *message,
++                  void *closure_data);
++typedef void (*Sr__SetItemStrResp_Closure)
++                 (const Sr__SetItemStrResp *message,
++                  void *closure_data);
++typedef void (*Sr__DeleteItemReq_Closure)
++                 (const Sr__DeleteItemReq *message,
++                  void *closure_data);
++typedef void (*Sr__DeleteItemResp_Closure)
++                 (const Sr__DeleteItemResp *message,
++                  void *closure_data);
++typedef void (*Sr__MoveItemReq_Closure)
++                 (const Sr__MoveItemReq *message,
++                  void *closure_data);
++typedef void (*Sr__MoveItemResp_Closure)
++                 (const Sr__MoveItemResp *message,
++                  void *closure_data);
++typedef void (*Sr__ValidateReq_Closure)
++                 (const Sr__ValidateReq *message,
++                  void *closure_data);
++typedef void (*Sr__ValidateResp_Closure)
++                 (const Sr__ValidateResp *message,
++                  void *closure_data);
++typedef void (*Sr__CommitReq_Closure)
++                 (const Sr__CommitReq *message,
++                  void *closure_data);
++typedef void (*Sr__CommitResp_Closure)
++                 (const Sr__CommitResp *message,
++                  void *closure_data);
++typedef void (*Sr__DiscardChangesReq_Closure)
++                 (const Sr__DiscardChangesReq *message,
++                  void *closure_data);
++typedef void (*Sr__DiscardChangesResp_Closure)
++                 (const Sr__DiscardChangesResp *message,
++                  void *closure_data);
++typedef void (*Sr__CopyConfigReq_Closure)
++                 (const Sr__CopyConfigReq *message,
++                  void *closure_data);
++typedef void (*Sr__CopyConfigResp_Closure)
++                 (const Sr__CopyConfigResp *message,
++                  void *closure_data);
++typedef void (*Sr__LockReq_Closure)
++                 (const Sr__LockReq *message,
++                  void *closure_data);
++typedef void (*Sr__LockResp_Closure)
++                 (const Sr__LockResp *message,
++                  void *closure_data);
++typedef void (*Sr__UnlockReq_Closure)
++                 (const Sr__UnlockReq *message,
++                  void *closure_data);
++typedef void (*Sr__UnlockResp_Closure)
++                 (const Sr__UnlockResp *message,
++                  void *closure_data);
++typedef void (*Sr__SubscribeReq_Closure)
++                 (const Sr__SubscribeReq *message,
++                  void *closure_data);
++typedef void (*Sr__SubscribeResp_Closure)
++                 (const Sr__SubscribeResp *message,
++                  void *closure_data);
++typedef void (*Sr__UnsubscribeReq_Closure)
++                 (const Sr__UnsubscribeReq *message,
++                  void *closure_data);
++typedef void (*Sr__UnsubscribeResp_Closure)
++                 (const Sr__UnsubscribeResp *message,
++                  void *closure_data);
++typedef void (*Sr__CheckEnabledRunningReq_Closure)
++                 (const Sr__CheckEnabledRunningReq *message,
++                  void *closure_data);
++typedef void (*Sr__CheckEnabledRunningResp_Closure)
++                 (const Sr__CheckEnabledRunningResp *message,
++                  void *closure_data);
++typedef void (*Sr__ModuleInstallNotification_Closure)
++                 (const Sr__ModuleInstallNotification *message,
++                  void *closure_data);
++typedef void (*Sr__FeatureEnableNotification_Closure)
++                 (const Sr__FeatureEnableNotification *message,
++                  void *closure_data);
++typedef void (*Sr__ModuleChangeNotification_Closure)
++                 (const Sr__ModuleChangeNotification *message,
++                  void *closure_data);
++typedef void (*Sr__SubtreeChangeNotification_Closure)
++                 (const Sr__SubtreeChangeNotification *message,
++                  void *closure_data);
++typedef void (*Sr__Change_Closure)
++                 (const Sr__Change *message,
++                  void *closure_data);
++typedef void (*Sr__GetChangesReq_Closure)
++                 (const Sr__GetChangesReq *message,
++                  void *closure_data);
++typedef void (*Sr__GetChangesResp_Closure)
++                 (const Sr__GetChangesResp *message,
++                  void *closure_data);
++typedef void (*Sr__CheckExecPermReq_Closure)
++                 (const Sr__CheckExecPermReq *message,
++                  void *closure_data);
++typedef void (*Sr__CheckExecPermResp_Closure)
++                 (const Sr__CheckExecPermResp *message,
++                  void *closure_data);
++typedef void (*Sr__RPCReq_Closure)
++                 (const Sr__RPCReq *message,
++                  void *closure_data);
++typedef void (*Sr__RPCResp_Closure)
++                 (const Sr__RPCResp *message,
++                  void *closure_data);
++typedef void (*Sr__EventNotifReq_Closure)
++                 (const Sr__EventNotifReq *message,
++                  void *closure_data);
++typedef void (*Sr__EventNotifResp_Closure)
++                 (const Sr__EventNotifResp *message,
++                  void *closure_data);
++typedef void (*Sr__EventNotifReplayReq_Closure)
++                 (const Sr__EventNotifReplayReq *message,
++                  void *closure_data);
++typedef void (*Sr__EventNotifReplayResp_Closure)
++                 (const Sr__EventNotifReplayResp *message,
++                  void *closure_data);
++typedef void (*Sr__DataProvideReq_Closure)
++                 (const Sr__DataProvideReq *message,
++                  void *closure_data);
++typedef void (*Sr__DataProvideResp_Closure)
++                 (const Sr__DataProvideResp *message,
++                  void *closure_data);
++typedef void (*Sr__ModuleInstallReq_Closure)
++                 (const Sr__ModuleInstallReq *message,
++                  void *closure_data);
++typedef void (*Sr__ModuleInstallResp_Closure)
++                 (const Sr__ModuleInstallResp *message,
++                  void *closure_data);
++typedef void (*Sr__FeatureEnableReq_Closure)
++                 (const Sr__FeatureEnableReq *message,
++                  void *closure_data);
++typedef void (*Sr__FeatureEnableResp_Closure)
++                 (const Sr__FeatureEnableResp *message,
++                  void *closure_data);
++typedef void (*Sr__UnsubscribeDestinationReq_Closure)
++                 (const Sr__UnsubscribeDestinationReq *message,
++                  void *closure_data);
++typedef void (*Sr__CommitTimeoutReq_Closure)
++                 (const Sr__CommitTimeoutReq *message,
++                  void *closure_data);
++typedef void (*Sr__OperDataTimeoutReq_Closure)
++                 (const Sr__OperDataTimeoutReq *message,
++                  void *closure_data);
++typedef void (*Sr__InternalStateDataReq_Closure)
++                 (const Sr__InternalStateDataReq *message,
++                  void *closure_data);
++typedef void (*Sr__NotifStoreCleanupReq_Closure)
++                 (const Sr__NotifStoreCleanupReq *message,
++                  void *closure_data);
++typedef void (*Sr__DelayedMsgReq_Closure)
++                 (const Sr__DelayedMsgReq *message,
++                  void *closure_data);
++typedef void (*Sr__NacmReloadReq_Closure)
++                 (const Sr__NacmReloadReq *message,
++                  void *closure_data);
++typedef void (*Sr__Request_Closure)
++                 (const Sr__Request *message,
++                  void *closure_data);
++typedef void (*Sr__Response_Closure)
++                 (const Sr__Response *message,
++                  void *closure_data);
++typedef void (*Sr__Notification_Closure)
++                 (const Sr__Notification *message,
++                  void *closure_data);
++typedef void (*Sr__NotificationAck_Closure)
++                 (const Sr__NotificationAck *message,
++                  void *closure_data);
++typedef void (*Sr__InternalRequest_Closure)
++                 (const Sr__InternalRequest *message,
++                  void *closure_data);
++typedef void (*Sr__Msg_Closure)
++                 (const Sr__Msg *message,
++                  void *closure_data);
++
++/* --- services --- */
++
++
++/* --- descriptors --- */
++
++extern const ProtobufCEnumDescriptor    sr__api_variant__descriptor;
++extern const ProtobufCEnumDescriptor    sr__data_store__descriptor;
++extern const ProtobufCEnumDescriptor    sr__session_flags__descriptor;
++extern const ProtobufCEnumDescriptor    sr__edit_flags__descriptor;
++extern const ProtobufCEnumDescriptor    sr__subscription_type__descriptor;
++extern const ProtobufCEnumDescriptor    sr__notification_event__descriptor;
++extern const ProtobufCEnumDescriptor    sr__module_state__descriptor;
++extern const ProtobufCEnumDescriptor    sr__change_operation__descriptor;
++extern const ProtobufCEnumDescriptor    sr__operation__descriptor;
++extern const ProtobufCMessageDescriptor sr__value__descriptor;
++extern const ProtobufCEnumDescriptor    sr__value__types__descriptor;
++extern const ProtobufCMessageDescriptor sr__node__descriptor;
++extern const ProtobufCMessageDescriptor sr__error__descriptor;
++extern const ProtobufCMessageDescriptor sr__session_start_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__session_start_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__session_stop_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__session_stop_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__session_refresh_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__session_refresh_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__session_check_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__session_check_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__session_switch_ds_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__session_switch_ds_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__session_set_opts_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__session_set_opts_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__version_verify_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__version_verify_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__schema_revision__descriptor;
++extern const ProtobufCMessageDescriptor sr__schema_submodule__descriptor;
++extern const ProtobufCMessageDescriptor sr__schema__descriptor;
++extern const ProtobufCMessageDescriptor sr__list_schemas_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__list_schemas_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_schema_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_schema_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_item_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_item_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_items_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_items_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_subtree_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_subtree_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_subtrees_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_subtrees_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_subtree_chunk_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_subtree_chunk_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__set_item_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__set_item_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__set_item_str_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__set_item_str_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__delete_item_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__delete_item_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__move_item_req__descriptor;
++extern const ProtobufCEnumDescriptor    sr__move_item_req__move_position__descriptor;
++extern const ProtobufCMessageDescriptor sr__move_item_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__validate_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__validate_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__commit_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__commit_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__discard_changes_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__discard_changes_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__copy_config_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__copy_config_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__lock_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__lock_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__unlock_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__unlock_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__subscribe_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__subscribe_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__unsubscribe_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__unsubscribe_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__check_enabled_running_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__check_enabled_running_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__module_install_notification__descriptor;
++extern const ProtobufCMessageDescriptor sr__feature_enable_notification__descriptor;
++extern const ProtobufCMessageDescriptor sr__module_change_notification__descriptor;
++extern const ProtobufCMessageDescriptor sr__subtree_change_notification__descriptor;
++extern const ProtobufCMessageDescriptor sr__change__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_changes_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__get_changes_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__check_exec_perm_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__check_exec_perm_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__rpcreq__descriptor;
++extern const ProtobufCMessageDescriptor sr__rpcresp__descriptor;
++extern const ProtobufCMessageDescriptor sr__event_notif_req__descriptor;
++extern const ProtobufCEnumDescriptor    sr__event_notif_req__notif_type__descriptor;
++extern const ProtobufCEnumDescriptor    sr__event_notif_req__notif_flags__descriptor;
++extern const ProtobufCMessageDescriptor sr__event_notif_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__event_notif_replay_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__event_notif_replay_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__data_provide_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__data_provide_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__module_install_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__module_install_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__feature_enable_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__feature_enable_resp__descriptor;
++extern const ProtobufCMessageDescriptor sr__unsubscribe_destination_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__commit_timeout_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__oper_data_timeout_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__internal_state_data_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__notif_store_cleanup_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__delayed_msg_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__nacm_reload_req__descriptor;
++extern const ProtobufCMessageDescriptor sr__request__descriptor;
++extern const ProtobufCMessageDescriptor sr__response__descriptor;
++extern const ProtobufCMessageDescriptor sr__notification__descriptor;
++extern const ProtobufCMessageDescriptor sr__notification_ack__descriptor;
++extern const ProtobufCMessageDescriptor sr__internal_request__descriptor;
++extern const ProtobufCMessageDescriptor sr__msg__descriptor;
++extern const ProtobufCEnumDescriptor    sr__msg__msg_type__descriptor;
++
++PROTOBUF_C__END_DECLS
++
++
++#endif  /* PROTOBUF_C_sysrepo_2eproto__INCLUDED */
diff --git a/net/sysrepo/patches/002-remove-buildtime-module-install b/net/sysrepo/patches/002-remove-buildtime-module-install
new file mode 100644 (file)
index 0000000..15bc77c
--- /dev/null
@@ -0,0 +1,26 @@
+Index: sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/CMakeLists.txt
+===================================================================
+--- sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf.orig/CMakeLists.txt
++++ sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/CMakeLists.txt
+@@ -280,7 +280,7 @@ install (FILES ${INTERNAL_YANGS} DESTINA
+ # install NACM YANG module
+ if(ENABLE_NACM)
+-    INSTALL_YANG("ietf-netconf-acm" "@2012-02-22" "644")
++    # INSTALL_YANG("ietf-netconf-acm" "@2012-02-22" "644")
+ endif(ENABLE_NACM)
+ find_package(PkgConfig QUIET)
+@@ -304,9 +304,9 @@ if(WITH_SYSTEMD)
+         FILES_MATCHING PATTERN "*.service")
+ endif()
+-INSTALL_YANG("ietf-netconf-notifications" "" "666")
+-INSTALL_YANG("nc-notifications" "" "666")
+-INSTALL_YANG("notifications" "" "666")
++# INSTALL_YANG("ietf-netconf-notifications" "" "666")
++# INSTALL_YANG("nc-notifications" "" "666")
++# INSTALL_YANG("notifications" "" "666")
+ if(GEN_LANGUAGE_BINDINGS)
+     add_subdirectory(swig)
diff --git a/net/sysrepo/patches/003-missing-time-header b/net/sysrepo/patches/003-missing-time-header
new file mode 100644 (file)
index 0000000..6ce54de
--- /dev/null
@@ -0,0 +1,12 @@
+Index: sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/inc/sysrepo.h
+===================================================================
+--- sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf.orig/inc/sysrepo.h
++++ sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/inc/sysrepo.h
+@@ -51,6 +51,7 @@
+  * @ref xp_page "XPath Addressing" is used for node identification in data-related calls.
+  */
++#include <time.h>
+ #include <stdbool.h>
+ #include <stdint.h>
+ #include <stdlib.h>
diff --git a/net/sysrepo/patches/004-disable-sysrepod-autostart b/net/sysrepo/patches/004-disable-sysrepod-autostart
new file mode 100644 (file)
index 0000000..3261aee
--- /dev/null
@@ -0,0 +1,19 @@
+Index: sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/src/clientlib/client_library.c
+===================================================================
+--- sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf.orig/src/clientlib/client_library.c
++++ sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/src/clientlib/client_library.c
+@@ -405,14 +405,6 @@ sr_connect(const char *app_name, const s
+     if (SR_ERR_OK != rc) {
+         if (opts & SR_CONN_DAEMON_REQUIRED) {
+             if ((opts & SR_CONN_DAEMON_START) && (0 == getuid())) {
+-                /* sysrepo daemon start requested and process is running under root privileges */
+-                SR_LOG_DBG_MSG("Sysrepo daemon not detected, starting it.");
+-                ret = system("sysrepod");
+-                if (0 == ret) {
+-                    SR_LOG_INF_MSG("Sysrepo daemon has been started.");
+-                } else {
+-                    SR_LOG_WRN("Unable to start sysrepo daemon, error code=%d.", ret);
+-                }
+                 /* retry to connect again in any case */
+                 rc = cl_socket_connect(connection, SR_DAEMON_SOCKET);
+                 CHECK_RC_LOG_GOTO(rc, cleanup, "Unable to connect to sysrepod: %s.", sr_strerror(rc));
diff --git a/net/sysrepo/patches/005-fix-struct-ucred-define b/net/sysrepo/patches/005-fix-struct-ucred-define
new file mode 100644 (file)
index 0000000..1547976
--- /dev/null
@@ -0,0 +1,30 @@
+Index: sysrepo-0.7.0-7aa2f18d234267403147df92c0005c871f0aa840/src/common/sr_utils.c
+===================================================================
+--- sysrepo-0.7.0-7aa2f18d234267403147df92c0005c871f0aa840.orig/src/common/sr_utils.c
++++ sysrepo-0.7.0-7aa2f18d234267403147df92c0005c871f0aa840/src/common/sr_utils.c
+@@ -460,14 +460,24 @@ sr_fd_set_nonblock(int fd)
+ #if defined(SO_PEERCRED)
++#if defined(__GLIBC__)
+ #if !defined(SCM_CREDENTIALS)
+-/* struct ucred is ifdefined behind __USE_GNU, but __USE_GNU is not defined */
+ struct ucred {
+     pid_t pid;    /* process ID of the sending process */
+     uid_t uid;    /* user ID of the sending process */
+     gid_t gid;    /* group ID of the sending process */
+ };
+ #endif /* !defined(SCM_CREDENTIALS) */
++#else
++#if !defined(__USE_GNU)
++struct ucred {
++    pid_t pid;    /* process ID of the sending process */
++    uid_t uid;    /* user ID of the sending process */
++    gid_t gid;    /* group ID of the sending process */
++};
++/* struct ucred is ifdefined behind __USE_GNU, but __USE_GNU is not defined */
++#endif /* !defined(__USE_GNU) */
++#endif /* defined(__GLIBC__) */
+ int
+ sr_get_peer_eid(int fd, uid_t *uid, gid_t *gid)
index 77ef8259d09e1353c47e64c5db0a80b1b70b3949..0e97965b8a8f4bfe1bc44d951b0b0093849a068d 100644 (file)
@@ -13,11 +13,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tcpproxy
 PKG_VERSION:=1.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.spreadspace.org/tcpproxy/releases/
-PKG_MD5SUM:=14f734a61350c52556909e2ed5bff361
+PKG_HASH:=446104b3abefda73b1255e5197702acbeb36b3aada251ad39e1e5ab55292683b
 PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=LICENSE
@@ -51,7 +51,6 @@ define Build/Configure
     echo '#define TCPPROXY_config_h_INCLUDED' >> config.h; \
     echo '' >> config.h; \
     echo '#define VERSION_STRING_0 "tcpproxy version '`cat $(PKG_BUILD_DIR)/version`'"' >> config.h; \
-    echo '#define VERSION_STRING_1 "built on '`hostname`', '`date +"%d.%m.%Y %H:%M:%S %Z"`'"' >> config.h; \
     echo '' >> config.h; \
     echo '#define TARGET "linux"' >> config.h; \
     echo '#define PREFIX "/usr"' >> config.h; \
diff --git a/net/tcpproxy/patches/100-remove-build-timestamps-build-hostname.patch b/net/tcpproxy/patches/100-remove-build-timestamps-build-hostname.patch
new file mode 100644 (file)
index 0000000..363ea27
--- /dev/null
@@ -0,0 +1,40 @@
+Index: tcpproxy-1.2/src/configure
+===================================================================
+--- tcpproxy-1.2.orig/src/configure    2017-12-03 13:12:34.483712208 +0100
++++ tcpproxy-1.2/src/configure 2017-12-03 13:13:56.677386919 +0100
+@@ -195,9 +195,6 @@
+     fi
+ fi
+-HOSTNAME=`hostname`
+-DATE=`date +"%d.%m.%Y %H:%M:%S %Z"`
+-
+ cat > config.h <<EOF
+ /*
+  * tcpproxy config header
+@@ -211,7 +208,6 @@
+ #define TCPPROXY_config_h_INCLUDED
+ #define VERSION_STRING_0 "tcpproxy version $VERSION"
+-#define VERSION_STRING_1 "built on $HOSTNAME, $DATE"
+ #define TARGET "$TARGET"
+ #define PREFIX "$PREFIX"
+Index: tcpproxy-1.2/src/options.c
+===================================================================
+--- tcpproxy-1.2.orig/src/options.c    2015-05-14 00:14:22.000000000 +0200
++++ tcpproxy-1.2/src/options.c 2017-12-03 13:14:37.442219952 +0100
+@@ -326,11 +326,9 @@
+ {
+   printf("%s\n", VERSION_STRING_0);
+ #if defined(__clang__)
+-  printf("%s, using CLANG %s\n", VERSION_STRING_1, __clang_version__);
++  printf("using CLANG %s\n", __clang_version__);
+ #elif defined(__GNUC__)
+-  printf("%s, using GCC %d.%d.%d\n", VERSION_STRING_1, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
+-#else
+-  printf("%s\n", VERSION_STRING_1);
++  printf("using GCC %d.%d.%d\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
+ #endif
+ }
index d7dce051c7e14fa64a2cdae8f2c5478e5259db93..d8857affa23a21660a21e3de25fe13aeb774d0a6 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tcpreplay
-PKG_VERSION:=4.1.2
+PKG_VERSION:=4.2.5
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/appneta/tcpreplay/releases/download/v$(PKG_VERSION)
-PKG_MD5SUM:=3105b10b07dbc0b07ce2da07a2368359
+PKG_HASH:=941026be34e1db5101d3d22ebddd6fff76179a1ee81e273338f533ba4eca89d7
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=docs/LICENSE
index 3a0117345f5bfbeb1ac9ee528cf65ef466b50cd7..e6d3aaa76ab6196a9104c43b41e1f46d659d916d 100644 (file)
@@ -7,8 +7,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tgt
-PKG_VERSION:=1.0.65
-PKG_REV:=c8f86393d2ea3f37b64963f66af240f17d88b43d
+PKG_VERSION:=1.0.73
+PKG_REV:=013223dc886a03719ca02db52162056249d99448
+PKG_MIRROR_HASH:=649bd012ab0944644ff83cc2974e7a5c374d568e0f4328d9f8d352d4b59f73bb
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
 
@@ -30,7 +31,7 @@ define Package/tgt
   CATEGORY:=Network
   URL:=http://stgt.sourceforge.net/
   TITLE:=userspace iSCSI target
-  DEPENDS:=+libpthread +libaio @KERNEL_AIO @KERNEL_DIRECT_IO
+  DEPENDS:=+libpthread +libaio @KERNEL_AIO
 endef
 
 define Package/tgt/description
@@ -41,9 +42,11 @@ Note that if you are interested in only iSCSI (probably you are), you need only
 endef
 
 define Build/Compile
-       CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $(PKG_BUILD_DIR) \
+       CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+               $(MAKE) -C $(PKG_BUILD_DIR) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                LD="$(TARGET_CC)" \
+               LDFLAGS="$(TARGET_LDFLAGS)" \
                install-programs
 endef
 
index d8f4c0026577c0fdb648ef1eb195d8e93c0af96b..dcc3a073a3816da2e2c232cb9deadb31a4ff9673 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tinc
-PKG_VERSION:=1.0.30
+PKG_VERSION:=1.0.33
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.tinc-vpn.org/packages
-PKG_MD5SUM:=f3ca1fc1154ed1f2cac408ea06a1c1ca
+PKG_HASH:=7f6f5dc6444bc651ac635c81f4745bcce581bbd1d45ed60cbdc4ee11bebb10f4
 
 PKG_INSTALL:=1
 
index 1aaf5c18e500de0c11b8867a907e29e1133ba7d5..27467a40beb8249c14469198a60cddee0222d8a9 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.banu.com/pub/tinyproxy/1.8/
-PKG_MD5SUM:=292ac51da8ad6ae883d4ebf56908400d
+PKG_HASH:=be559b54eb4772a703ad35239d1cb59d32f7cf8a739966742622d57df88b896e
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 
 PKG_INSTALL:=1
index b6ab886c2a6453f96ec3553ebc2306327695178b..6229132f94ce60db27b093bf8cdb89e56f5e0a82 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tor
-PKG_VERSION:=0.2.9.9
+PKG_VERSION:=0.3.2.10
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://dist.torproject.org/ \
        https://archive.torproject.org/tor-package-archive
-PKG_MD5SUM:=33325d2b250fd047ba2ddc5d11c2190c4e2951f4b03ec48ebd8bf0666e990d43
+PKG_HASH:=60df77c31dcf94fdd686c8ca8c34f3b70243b33a7344ecc0b719d5ca2617cbee
 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
 PKG_LICENSE_FILES:=LICENSE
 
@@ -97,6 +97,7 @@ CONFIGURE_ARGS += \
        --disable-libscrypt \
        --disable-unittests \
        --disable-largefile \
+       --disable-lzma \
        --with-tor-user=tor \
        --with-tor-group=tor
 
index 1a784d2ffaee3080c50425643689533093156ccf..78d4ee978dcd1dc9362a1b65a5655fd0bdc0337e 100644 (file)
@@ -18,8 +18,8 @@
  
  ## The port on which Tor will listen for local connections from Tor
  ## controller applications, as documented in control-spec.txt.
-@@ -204,3 +204,4 @@
- ## address manually to your friends, uncomment this line:
- #PublishServerDescriptor 0
+@@ -227,3 +227,4 @@
+ #%include /etc/torrc.d/
+ #%include /etc/torrc.custom
  
 +User tor
index 596b71e9ed3ed813c3945845457a7499abf060ab..4b7485031ad15e6dc7f0171d30d08403ae470943 100644 (file)
@@ -8,22 +8,22 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=transmission
-PKG_VERSION:=2.92+git
-PKG_RELEASE:=4
+PKG_VERSION:=2.93
+PKG_RELEASE:=6
 
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/transmission/transmission.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=35fea28d1a37875ef7480ac061754df617805b19
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
-PKG_MIRROR_MD5SUM:=aeeb8dfd918bd2cf4fb6fbdf58bd822e9b509df1ba5ec408888edd161123ef8e
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GITHUB/transmission/transmission-releases/master
+PKG_HASH:=8815920e0a4499bcdadbbe89a4115092dab42ce5199f71ff9a926cfd12b9b90b
+PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
 include $(INCLUDE_DIR)/package.mk
 
 define Package/transmission/template
@@ -32,12 +32,11 @@ define Package/transmission/template
   CATEGORY:=Network
   TITLE:=BitTorrent client
   URL:=http://www.transmissionbt.com
-  MAINTAINER:=Cezary Jackiewicz <cezary@eko.one.pl>
+  DEPENDS:=+ca-bundle +libcurl +libevent2 +libminiupnpc +libnatpmp +libpthread +librt +zlib
 endef
 
 define Package/transmission-daemon/Default
   $(call Package/transmission/template)
-  DEPENDS:=+libcurl +libpthread +libevent2 +librt +zlib
   USERID:=transmission=224:transmission=224
 endef
 
@@ -55,39 +54,29 @@ define Package/transmission-daemon-mbedtls
   VARIANT:=mbedtls
 endef
 
-define Package/transmission-cli/Default
-  $(call Package/transmission/template)
-  DEPENDS:=+libcurl +libpthread +libevent2 +librt +zlib
-endef
-
 define Package/transmission-cli-openssl
-  $(call Package/transmission-cli/Default)
+  $(call Package/transmission/template)
   TITLE+= (with OpenSSL)
   DEPENDS+=+libopenssl
   VARIANT:=openssl
 endef
 
 define Package/transmission-cli-mbedtls
-  $(call Package/transmission-cli/Default)
+  $(call Package/transmission/template)
   TITLE+= (with mbed TLS)
   DEPENDS+=+libmbedtls
   VARIANT:=mbedtls
 endef
 
-define Package/transmission-remote/Default
-  $(call Package/transmission/template)
-  DEPENDS:=+libcurl +libpthread +libevent2 +librt +zlib
-endef
-
 define Package/transmission-remote-openssl
-  $(call Package/transmission-remote/Default)
+  $(call Package/transmission/template)
   TITLE+= (with OpenSSL)
   DEPENDS+=+libopenssl
   VARIANT:=openssl
 endef
 
 define Package/transmission-remote-mbedtls
-  $(call Package/transmission-remote/Default)
+  $(call Package/transmission/template)
   TITLE+= (with mbed TLS)
   DEPENDS+=+libmbedtls
   VARIANT:=mbedtls
@@ -131,13 +120,11 @@ endef
 Package/transmission-daemon-mbedtls/conffiles = $(Package/transmission-daemon-openssl/conffiles)
 
 
-CONFIGURE_VARS += \
-       LIBEVENT_LIBS="$(STAGING_DIR)/usr/lib/libevent-2.0.so.5"
-
 CONFIGURE_ARGS += \
        --enable-daemon \
        --enable-cli \
        --without-gtk \
+       --enable-external-natpmp \
        --enable-largefile \
        --enable-lightweight
 
@@ -154,16 +141,6 @@ ifeq ($(BUILD_VARIANT),mbedtls)
        MBEDTLS_LIBS="-lmbedtls -lmbedcrypto"
 endif
 
-MAKE_FLAGS += \
-       CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE"
-
-TARGET_CFLAGS += -std=gnu99
-
-define Build/Configure
-       ( cd $(PKG_BUILD_DIR); ./autogen.sh $(CONFIGURE_ARGS))
-       $(call Build/Configure/Default,$CONFIGURE_ARGS)
-endef
-
 define Package/transmission-daemon-openssl/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-daemon $(1)/usr/bin/
@@ -171,6 +148,8 @@ define Package/transmission-daemon-openssl/install
        $(INSTALL_BIN) files/transmission.init $(1)/etc/init.d/transmission
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_CONF) files/transmission.config $(1)/etc/config/transmission
+       $(INSTALL_DIR) $(1)/etc/sysctl.d/
+       $(INSTALL_CONF) files/transmission.sysctl $(1)/etc/sysctl.d/20-transmission.conf
 endef
 Package/transmission-daemon-mbedtls/install = $(Package/transmission-daemon-openssl/install)
 
index 2ea69d057b6e469256b6170aa37380f3dc137902..a1342ffd5c136317a69b112cc3e131ad0c67642e 100644 (file)
@@ -1,10 +1,10 @@
 config transmission
        option enabled 0
        option config_dir '/tmp/transmission'
-       #option user 'nobody'
+       option config_overwrite '1'
+       option user 'transmission'
        option mem_percentage 50
        option nice 10
-       option ionice_flags '-c 3'
        option alt_speed_down 50
        option alt_speed_enabled false
        option alt_speed_time_begin  540
@@ -49,6 +49,7 @@ config transmission
        option rpc_authentication_required false
        option rpc_bind_address '0.0.0.0'
        option rpc_enabled true
+       option rpc_host_whitelist_enabled false
        option rpc_password ''
        option rpc_port 9091
        option rpc_url '/transmission/'
index f7b1d41e1ef3d1e79a195a2e8a5edd05f6add2b8..36a6748fb8bc9b4811080bc792323f2a81e0053e 100644 (file)
@@ -4,18 +4,17 @@
 START=99
 USE_PROCD=1
 
-
 LIST_SEP="
 "
 
 append_params() {
        local p; local v; local s="$1"; shift
-       for p in $*; do
+       for p in "$@"; do
                config_get v "$s" "$p"
                IFS="$LIST_SEP"
                for v in $v; do
                        [ -n "$v" ] && (
-                               echo "\""$p"\": "$v"," | sed -e 's|_|-|g' >> $config_file
+                               echo "\"$p\": $v," | sed -e 's|_|-|g' >> $config_file
                        )
                done
                unset IFS
@@ -24,13 +23,13 @@ append_params() {
 
 append_params_quotes() {
        local p; local v; local s="$1"; shift
-       for p in $*; do
+       for p in "$@"; do
                config_get v "$s" "$p"
                IFS="$LIST_SEP"
                for v in $v; do
                        [ -n "$v" ] && (
-                               echo -n "\""$p | sed -e 's|/|\\/|g;s|_|-|g' >> $config_file; \
-                               echo "\": \""$v"\"," >> $config_file
+                               echo -n "\"$p" | sed -e 's|/|\\/|g;s|_|-|g' >> $config_file; \
+                               echo "\": \"$v\"," >> $config_file
                        )
                done
                unset IFS
@@ -38,7 +37,7 @@ append_params_quotes() {
 }
 
 section_enabled() {
-       config_get_bool enabled "$1" 'enabled' 0
+       config_get_bool enabled "$1" enabled 0
        [ $enabled -gt 0 ]
 }
 
@@ -47,9 +46,10 @@ transmission() {
        local USE
 
        local user
+       local config_overwrite
        local download_dir config_dir
        local mem_percentage
-       local config_overwrite nice ionice_flags
+       local nice
        local cmdline
 
        section_enabled "$section" || return 1
@@ -60,8 +60,6 @@ transmission() {
        config_get mem_percentage "$cfg" 'mem_percentage' '50'
        config_get config_overwrite "$cfg" config_overwrite 1
        config_get nice "$cfg" nice 0
-       config_get ionice_flags "$cfg" ionice_flags ''
-       which ionice > /dev/null || ionice_flags=''
 
        local MEM=$(sed -ne 's!^MemTotal:[[:space:]]*\([0-9]*\) kB$!\1!p' /proc/meminfo)
        if test "$MEM" -gt 1;then
@@ -70,9 +68,10 @@ transmission() {
 
        config_file="$config_dir/settings.json"
        [ -d $config_dir ] || {
-               mkdir -m 0755 -p "$config_dir"
+               mkdir -p $config_dir
+               chmod 0755 $config_dir
                touch $config_file
-               [ -z "$user" ] || chown -R $user $config_dir
+               [ -z "$user" ] || chown -R "$user:$user" $config_dir
        }
 
        [ "$config_overwrite" == 0 ] || {
@@ -95,26 +94,28 @@ transmission() {
                        speed_limit_down speed_limit_down_enabled speed_limit_up \
                        speed_limit_up_enabled start_added_torrents trash_original_torrent_files \
                        umask upload_slots_per_torrent utp_enabled scrape_paused_torrents \
-                       watch_dir_enabled
+                       watch_dir_enabled rpc_host_whitelist_enabled
 
                append_params_quotes "$cfg" \
                        blocklist_url bind_address_ipv4 bind_address_ipv6 download_dir incomplete_dir \
                        peer_congestion_algorithm peer_socket_tos rpc_bind_address rpc_password rpc_url \
                        rpc_username rpc_whitelist script_torrent_done_filename watch_dir
 
-               echo "\""invalid-key"\": false" >> $config_file
+               echo "\"invalid-key\": false" >> $config_file
                echo "}" >> $config_file
 
        }
 
-       cmdline="/usr/bin/transmission-daemon -g $config_dir -f"
-       [ "$ionice_flags" ] && cmdline="ionice $ionice_flags $cmdline"
+       cmdline="transmission-daemon -g $config_dir -f"
        procd_open_instance
        procd_set_param command $cmdline
+       procd_set_param env CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
+       procd_set_param user $user
+       procd_set_param group $user
+       procd_set_param nice $nice
        procd_set_param respawn retry=60
-       procd_set_param user "$user"
-       procd_set_param nice "$nice"
-       if test -z "$USE";then
+
+       if test -z $USE; then
                procd_set_param limits core="0 0"
        else
                procd_set_param limits core="0 0" as="$USE $USE"
diff --git a/net/transmission/files/transmission.sysctl b/net/transmission/files/transmission.sysctl
new file mode 100644 (file)
index 0000000..bdf0de2
--- /dev/null
@@ -0,0 +1,2 @@
+net.core.rmem_max = 4194304
+net.core.wmem_max = 1048576
diff --git a/net/transmission/patches/010-add-mbedtls-support.patch b/net/transmission/patches/010-add-mbedtls-support.patch
new file mode 100644 (file)
index 0000000..3e67b30
--- /dev/null
@@ -0,0 +1,430 @@
+From bad7f584eb11076ae37fd51cdb21842935c6ea57 Mon Sep 17 00:00:00 2001
+From: Mike Gelfand <mikedld@mikedld.com>
+Date: Wed, 26 Oct 2016 20:37:10 +0300
+Subject: [PATCH] Add support for mbedtls (formely polarssl)
+
+---
+ cmake/FindPolarSSL.cmake                |  37 +++++++----
+ configure.ac                            |  28 ++++----
+ libtransmission/CMakeLists.txt          |   4 ++
+ libtransmission/Makefile.am             |   3 +
+ libtransmission/crypto-utils-polarssl.c | 112 +++++++++++++++++++-------------
+ 5 files changed, 115 insertions(+), 69 deletions(-)
+
+diff --git a/cmake/FindPolarSSL.cmake b/cmake/FindPolarSSL.cmake
+index 0a958e0..e4e1ac6 100644
+--- a/cmake/FindPolarSSL.cmake
++++ b/cmake/FindPolarSSL.cmake
+@@ -8,21 +8,36 @@ if(POLARSSL_PREFER_STATIC_LIB)
+ endif()
+ if(UNIX)
+-  find_package(PkgConfig QUIET)
+-  pkg_check_modules(_POLARSSL QUIET polarssl)
++    find_package(PkgConfig QUIET)
++    pkg_check_modules(_MBEDTLS QUIET mbedtls)
+ endif()
+-find_path(POLARSSL_INCLUDE_DIR NAMES polarssl/version.h HINTS ${_POLARSSL_INCLUDEDIR})
+-find_library(POLARSSL_LIBRARY NAMES polarssl HINTS ${_POLARSSL_LIBDIR})
++find_path(MBEDTLS_INCLUDE_DIR NAMES mbedtls/version.h HINTS ${_MBEDTLS_INCLUDEDIR})
++find_library(MBEDTLS_LIBRARY NAMES mbedtls HINTS ${_MBEDTLS_LIBDIR})
++if(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY)
++    set(POLARSSL_INCLUDE_DIR ${MBEDTLS_INCLUDE_DIR})
++    set(POLARSSL_LIBRARY ${MBEDTLS_LIBRARY})
++    set(POLARSSL_VERSION ${_MBEDTLS_VERSION})
++    set(POLARSSL_IS_MBEDTLS ON)
++else()
++    if(UNIX)
++        pkg_check_modules(_POLARSSL QUIET polarssl)
++    endif()
++
++    find_path(POLARSSL_INCLUDE_DIR NAMES polarssl/version.h HINTS ${_POLARSSL_INCLUDEDIR})
++    find_library(POLARSSL_LIBRARY NAMES polarssl HINTS ${_POLARSSL_LIBDIR})
++    set(POLARSSL_VERSION ${_POLARSSL_VERSION})
++    set(POLARSSL_IS_MBEDTLS OFF)
++endif()
+-if(POLARSSL_INCLUDE_DIR)
+-    if(_POLARSSL_VERSION)
+-        set(POLARSSL_VERSION ${_POLARSSL_VERSION})
++if(NOT POLARSSL_VERSION AND POLARSSL_INCLUDE_DIR)
++    if(POLARSSL_IS_MBEDTLS)
++        file(STRINGS "${POLARSSL_INCLUDE_DIR}/mbedtls/version.h" POLARSSL_VERSION_STR REGEX "^#define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"[^\"]+\"")
+     else()
+         file(STRINGS "${POLARSSL_INCLUDE_DIR}/polarssl/version.h" POLARSSL_VERSION_STR REGEX "^#define[\t ]+POLARSSL_VERSION_STRING[\t ]+\"[^\"]+\"")
+-        if(POLARSSL_VERSION_STR MATCHES "\"([^\"]+)\"")
+-            set(POLARSSL_VERSION "${CMAKE_MATCH_1}")
+-        endif()
++    endif()
++    if(POLARSSL_VERSION_STR MATCHES "\"([^\"]+)\"")
++        set(POLARSSL_VERSION "${CMAKE_MATCH_1}")
+     endif()
+ endif()
+@@ -39,7 +54,7 @@ find_package_handle_standard_args(PolarSSL
+         POLARSSL_VERSION
+ )
+-mark_as_advanced(POLARSSL_INCLUDE_DIR POLARSSL_LIBRARY)
++mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY POLARSSL_INCLUDE_DIR POLARSSL_LIBRARY)
+ if(POLARSSL_PREFER_STATIC_LIB)
+     set(CMAKE_FIND_LIBRARY_SUFFIXES ${POLARSSL_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
+diff --git a/configure.ac b/configure.ac
+index aff673b..cb026df 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -149,23 +149,26 @@ AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xcyassl"], [
+     )
+ ])
+ AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xpolarssl"], [
+-    AC_CHECK_HEADER([polarssl/version.h],
+-        [AC_EGREP_CPP([version_ok], [#include <polarssl/version.h>
+-                                     #if defined (POLARSSL_VERSION_NUMBER) && POLARSSL_VERSION_NUMBER >= $POLARSSL_MINIMUM
+-                                     version_ok
+-                                     #endif],
+-            [AC_CHECK_LIB([polarssl], [dhm_calc_secret],
+-                [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_CFLAGS=""; CRYPTO_LIBS="-lpolarssl"],
++    PKG_CHECK_MODULES(MBEDTLS, [mbedtls >= $POLARSSL_MINIMUM],
++        [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_CFLAGS="$MBEDTLS_CFLAGS"; CRYPTO_LIBS="$MBEDTLS_LIBS"; POLARSSL_IS_MBEDTLS=yes],
++        [AC_CHECK_HEADER([polarssl/version.h],
++            [AC_EGREP_CPP([version_ok], [#include <polarssl/version.h>
++                                         #if defined (POLARSSL_VERSION_NUMBER) && POLARSSL_VERSION_NUMBER >= $POLARSSL_MINIMUM
++                                         version_ok
++                                         #endif],
++                [AC_CHECK_LIB([polarssl], [dhm_calc_secret],
++                    [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_CFLAGS=""; CRYPTO_LIBS="-lpolarssl"],
++                    [AS_IF([test "x$want_crypto" = "xpolarssl"],
++                        [AC_MSG_ERROR([PolarSSL support requested, but library not found.])]
++                    )]
++                )],
+                 [AS_IF([test "x$want_crypto" = "xpolarssl"],
+-                    [AC_MSG_ERROR([PolarSSL support requested, but library not found.])]
++                    [AC_MSG_ERROR([PolarSSL support requested, but version not suitable.])]
+                 )]
+             )],
+             [AS_IF([test "x$want_crypto" = "xpolarssl"],
+-                [AC_MSG_ERROR([PolarSSL support requested, but version not suitable.])]
++                [AC_MSG_ERROR([PolarSSL support requested, but headers not found.])]
+             )]
+-        )],
+-        [AS_IF([test "x$want_crypto" = "xpolarssl"],
+-            [AC_MSG_ERROR([PolarSSL support requested, but headers not found.])]
+         )]
+     )
+ ])
+@@ -180,6 +183,7 @@ AS_IF([test "x$CRYPTO_PKG" = "x"], [
+ AM_CONDITIONAL([CRYPTO_USE_OPENSSL],[test "x$CRYPTO_PKG" = "xopenssl"])
+ AM_CONDITIONAL([CRYPTO_USE_CYASSL],[test "x$CRYPTO_PKG" = "xcyassl"])
+ AM_CONDITIONAL([CRYPTO_USE_POLARSSL],[test "x$CRYPTO_PKG" = "xpolarssl"])
++AM_CONDITIONAL([POLARSSL_IS_MBEDTLS],[test "x$POLARSSL_IS_MBEDTLS" = "xyes"])
+ AC_SUBST(CRYPTO_PKG)
+ AC_SUBST(CRYPTO_CFLAGS)
+ AC_SUBST(CRYPTO_LIBS)
+diff --git a/libtransmission/CMakeLists.txt b/libtransmission/CMakeLists.txt
+index 4865dee..b5230b9 100644
+--- a/libtransmission/CMakeLists.txt
++++ b/libtransmission/CMakeLists.txt
+@@ -194,6 +194,10 @@ if(USE_SYSTEM_B64)
+     add_definitions(-DUSE_SYSTEM_B64)
+ endif()
++if(POLARSSL_IS_MBEDTLS)
++    add_definitions(-DPOLARSSL_IS_MBEDTLS)
++endif()
++
+ include_directories(
+     ${PROJECT_SOURCE_DIR}
+     ${PROJECT_BINARY_DIR}
+diff --git a/libtransmission/Makefile.am b/libtransmission/Makefile.am
+index f91769a..4d7e85a 100644
+--- a/libtransmission/Makefile.am
++++ b/libtransmission/Makefile.am
+@@ -102,6 +102,9 @@ libtransmission_a_SOURCES += crypto-utils-cyassl.c
+ endif
+ if CRYPTO_USE_POLARSSL
+ libtransmission_a_SOURCES += crypto-utils-polarssl.c
++if POLARSSL_IS_MBEDTLS
++AM_CPPFLAGS += -DPOLARSSL_IS_MBEDTLS
++endif
+ endif
+ noinst_HEADERS = \
+diff --git a/libtransmission/crypto-utils-polarssl.c b/libtransmission/crypto-utils-polarssl.c
+index 1c59a7f..e98c13d 100644
+--- a/libtransmission/crypto-utils-polarssl.c
++++ b/libtransmission/crypto-utils-polarssl.c
+@@ -1,5 +1,5 @@
+ /*
+- * This file Copyright (C) 2014-2015 Mnemosyne LLC
++ * This file Copyright (C) 2014-2016 Mnemosyne LLC
+  *
+  * It may be used under the GNU GPL versions 2 or 3
+  * or any future license endorsed by Mnemosyne LLC.
+@@ -7,15 +7,25 @@
+  * $Id$
+  */
++#if defined (POLARSSL_IS_MBEDTLS)
++ #define API_HEADER(x) <mbedtls/x>
++ #define API(x) mbedtls_##x
++ #define API_VERSION_NUMBER MBEDTLS_VERSION_NUMBER
++#else
++ #define API_HEADER(x) <polarssl/x>
++ #define API(x) x
++ #define API_VERSION_NUMBER POLARSSL_VERSION_NUMBER
++#endif
++
+ #include <assert.h>
+-#include <polarssl/arc4.h>
+-#include <polarssl/base64.h>
+-#include <polarssl/ctr_drbg.h>
+-#include <polarssl/dhm.h>
+-#include <polarssl/error.h>
+-#include <polarssl/sha1.h>
+-#include <polarssl/version.h>
++#include API_HEADER (arc4.h)
++#include API_HEADER (base64.h)
++#include API_HEADER (ctr_drbg.h)
++#include API_HEADER (dhm.h)
++#include API_HEADER (error.h)
++#include API_HEADER (sha1.h)
++#include API_HEADER (version.h)
+ #include "transmission.h"
+ #include "crypto-utils.h"
+@@ -41,7 +51,9 @@ log_polarssl_error (int          error_code,
+     {
+       char error_message[256];
+-#if POLARSSL_VERSION_NUMBER >= 0x01030000
++#if defined (POLARSSL_IS_MBEDTLS)
++      mbedtls_strerror (error_code, error_message, sizeof (error_message));
++#elif API_VERSION_NUMBER >= 0x01030000
+       polarssl_strerror (error_code, error_message, sizeof (error_message));
+ #else
+       error_strerror (error_code, error_message, sizeof (error_message));
+@@ -51,7 +63,7 @@ log_polarssl_error (int          error_code,
+     }
+ }
+-#define log_error(error_code) log_polarssl_error(error_code, __FILE__, __LINE__)
++#define log_error(error_code) log_polarssl_error ((error_code), __FILE__, __LINE__)
+ static bool
+ check_polarssl_result (int          result,
+@@ -83,15 +95,20 @@ my_rand (void * context UNUSED, unsigned char * buffer, size_t buffer_size)
+   return 0;
+ }
+-static ctr_drbg_context *
++static API (ctr_drbg_context) *
+ get_rng (void)
+ {
+-  static ctr_drbg_context rng;
++  static API (ctr_drbg_context) rng;
+   static bool rng_initialized = false;
+   if (!rng_initialized)
+     {
+-      if (!check_result (ctr_drbg_init (&rng, &my_rand, NULL, NULL, 0)))
++#if API_VERSION_NUMBER >= 0x02000000
++      API (ctr_drbg_init) (&rng);
++      if (!check_result (API (ctr_drbg_seed) (&rng, &my_rand, NULL, NULL, 0)))
++#else
++      if (!check_result (API (ctr_drbg_init) (&rng, &my_rand, NULL, NULL, 0)))
++#endif
+         return NULL;
+       rng_initialized = true;
+     }
+@@ -117,13 +134,13 @@ get_rng_lock (void)
+ tr_sha1_ctx_t
+ tr_sha1_init (void)
+ {
+-  sha1_context * handle = tr_new0 (sha1_context, 1);
++  API (sha1_context) * handle = tr_new0 (API (sha1_context), 1);
+-#if POLARSSL_VERSION_NUMBER >= 0x01030800
+-  sha1_init (handle);
++#if API_VERSION_NUMBER >= 0x01030800
++  API (sha1_init) (handle);
+ #endif
+-  sha1_starts (handle);
++  API (sha1_starts) (handle);
+   return handle;
+ }
+@@ -139,7 +156,7 @@ tr_sha1_update (tr_sha1_ctx_t   handle,
+   assert (data != NULL);
+-  sha1_update (handle, data, data_length);
++  API (sha1_update) (handle, data, data_length);
+   return true;
+ }
+@@ -151,11 +168,11 @@ tr_sha1_final (tr_sha1_ctx_t   handle,
+     {
+       assert (handle != NULL);
+-      sha1_finish (handle, hash);
++      API (sha1_finish) (handle, hash);
+     }
+-#if POLARSSL_VERSION_NUMBER >= 0x01030800
+-  sha1_free (handle);
++#if API_VERSION_NUMBER >= 0x01030800
++  API (sha1_free) (handle);
+ #endif
+   tr_free (handle);
+@@ -169,10 +186,10 @@ tr_sha1_final (tr_sha1_ctx_t   handle,
+ tr_rc4_ctx_t
+ tr_rc4_new (void)
+ {
+-  arc4_context * handle = tr_new0 (arc4_context, 1);
++  API (arc4_context) * handle = tr_new0 (API (arc4_context), 1);
+-#if POLARSSL_VERSION_NUMBER >= 0x01030800
+-  arc4_init (handle);
++#if API_VERSION_NUMBER >= 0x01030800
++  API (arc4_init) (handle);
+ #endif
+   return handle;
+@@ -181,8 +198,8 @@ tr_rc4_new (void)
+ void
+ tr_rc4_free (tr_rc4_ctx_t handle)
+ {
+-#if POLARSSL_VERSION_NUMBER >= 0x01030800
+-  arc4_free (handle);
++#if API_VERSION_NUMBER >= 0x01030800
++  API (arc4_free) (handle);
+ #endif
+   tr_free (handle);
+@@ -196,7 +213,7 @@ tr_rc4_set_key (tr_rc4_ctx_t    handle,
+   assert (handle != NULL);
+   assert (key != NULL);
+-  arc4_setup (handle, key, key_length);
++  API (arc4_setup) (handle, key, key_length);
+ }
+ void
+@@ -213,7 +230,7 @@ tr_rc4_process (tr_rc4_ctx_t   handle,
+   assert (input != NULL);
+   assert (output != NULL);
+-  arc4_crypt (handle, length, input, output);
++  API (arc4_crypt) (handle, length, input, output);
+ }
+ /***
+@@ -226,19 +243,19 @@ tr_dh_new (const uint8_t * prime_num,
+            const uint8_t * generator_num,
+            size_t          generator_num_length)
+ {
+-  dhm_context * handle = tr_new0 (dhm_context, 1);
++  API (dhm_context) * handle = tr_new0 (API (dhm_context), 1);
+   assert (prime_num != NULL);
+   assert (generator_num != NULL);
+-#if POLARSSL_VERSION_NUMBER >= 0x01030800
+-  dhm_init (handle);
++#if API_VERSION_NUMBER >= 0x01030800
++  API (dhm_init) (handle);
+ #endif
+-  if (!check_result (mpi_read_binary (&handle->P, prime_num, prime_num_length)) ||
+-      !check_result (mpi_read_binary (&handle->G, generator_num, generator_num_length)))
++  if (!check_result (API (mpi_read_binary) (&handle->P, prime_num, prime_num_length)) ||
++      !check_result (API (mpi_read_binary) (&handle->G, generator_num, generator_num_length)))
+     {
+-      dhm_free (handle);
++      API (dhm_free) (handle);
+       return NULL;
+     }
+@@ -253,7 +270,7 @@ tr_dh_free (tr_dh_ctx_t handle)
+   if (handle == NULL)
+     return;
+-  dhm_free (handle);
++  API (dhm_free) (handle);
+ }
+ bool
+@@ -262,7 +279,7 @@ tr_dh_make_key (tr_dh_ctx_t   raw_handle,
+                 uint8_t     * public_key,
+                 size_t      * public_key_length)
+ {
+-  dhm_context * handle = raw_handle;
++  API (dhm_context) * handle = raw_handle;
+   assert (handle != NULL);
+   assert (public_key != NULL);
+@@ -270,8 +287,8 @@ tr_dh_make_key (tr_dh_ctx_t   raw_handle,
+   if (public_key_length != NULL)
+     *public_key_length = handle->len;
+-  return check_result (dhm_make_public (handle, private_key_length, public_key,
+-                                        handle->len, my_rand, NULL));
++  return check_result (API (dhm_make_public) (handle, private_key_length, public_key,
++                                                      handle->len, my_rand, NULL));
+ }
+ tr_dh_secret_t
+@@ -279,26 +296,29 @@ tr_dh_agree (tr_dh_ctx_t     raw_handle,
+              const uint8_t * other_public_key,
+              size_t          other_public_key_length)
+ {
+-  dhm_context * handle = raw_handle;
++  API (dhm_context) * handle = raw_handle;
+   struct tr_dh_secret * ret;
+   size_t secret_key_length;
+   assert (handle != NULL);
+   assert (other_public_key != NULL);
+-  if (!check_result (dhm_read_public (handle, other_public_key,
+-                                      other_public_key_length)))
++  if (!check_result (API (dhm_read_public )(handle, other_public_key,
++                                                    other_public_key_length)))
+     return NULL;
+   ret = tr_dh_secret_new (handle->len);
+   secret_key_length = handle->len;
+-#if POLARSSL_VERSION_NUMBER >= 0x01030000
+-  if (!check_result (dhm_calc_secret (handle, ret->key,
+-                                      &secret_key_length, my_rand, NULL)))
++#if API_VERSION_NUMBER >= 0x02000000
++  if (!check_result (API (dhm_calc_secret) (handle, ret->key, secret_key_length,
++                                                    &secret_key_length, my_rand, NULL)))
++#elif API_VERSION_NUMBER >= 0x01030000
++  if (!check_result (API (dhm_calc_secret) (handle, ret->key,
++                                                    &secret_key_length, my_rand, NULL)))
+ #else
+-  if (!check_result (dhm_calc_secret (handle, ret->key, &secret_key_length)))
++  if (!check_result (API (dhm_calc_secret) (handle, ret->key, &secret_key_length)))
+ #endif
+     {
+       tr_dh_secret_free (ret);
+@@ -324,7 +344,7 @@ tr_rand_buffer (void   * buffer,
+   assert (buffer != NULL);
+   tr_lockLock (rng_lock);
+-  ret = check_result (ctr_drbg_random (get_rng (), buffer, length));
++  ret = check_result (API (ctr_drbg_random) (get_rng (), buffer, length));
+   tr_lockUnlock (rng_lock);
+   return ret;
+-- 
+2.7.4
+
diff --git a/net/transmission/patches/020-fix-external-miniupnpc.patch b/net/transmission/patches/020-fix-external-miniupnpc.patch
new file mode 100644 (file)
index 0000000..64a2fca
--- /dev/null
@@ -0,0 +1,35 @@
+From 94fa0bba88740b9ab58c5805ddb24b05b2635f34 Mon Sep 17 00:00:00 2001
+From: Mike Gelfand <mikedld@mikedld.com>
+Date: Fri, 26 Jan 2018 08:31:16 +0300
+Subject: [PATCH] Fix FTCBFS due to AC_RUN_IFELSE (patch by Helmut Grohne)
+
+Fixes: #475
+---
+ configure.ac | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index cb026df..335f4a7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -390,14 +390,12 @@ dnl Let's hope it's 1.7 or higher, since it provides
+ dnl MINIUPNPC_API_VERSION and we won't have to figure
+ dnl it out on our own
+ if test "x$upnp_version" = "xunknown" ; then
+-  AC_RUN_IFELSE(
++  AC_COMPILE_IFELSE(
+     [AC_LANG_PROGRAM(
+       [#include <stdlib.h>
+        #include <miniupnpc/miniupnpc.h>],
+-      [#ifdef MINIUPNPC_API_VERSION
+-       return EXIT_SUCCESS;
+-       #else
+-       return EXIT_FAILURE;
++      [#ifndef MINIUPNPC_API_VERSION
++       #error MINIUPNPC_API_VERSION undefined
+        #endif]
+     )],
+     [upnp_version=">= 1.7"]
+-- 
+2.7.4
+
diff --git a/net/transmission/patches/020-use-internal-miniupnp.patch b/net/transmission/patches/020-use-internal-miniupnp.patch
deleted file mode 100644 (file)
index d3a2c8e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -386,7 +386,7 @@ dnl See if ANY version of miniupnpc is i
- AC_LINK_IFELSE(
-   [AC_LANG_PROGRAM([#include <miniupnpc/miniupnpc.h>],
-                    [struct UPNPDev dev;])],
--  [upnp_version="unknown"],
-+  [upnp_version="none"],
-   [upnp_version="none"]
- )
diff --git a/net/transmission/patches/030-fix-musl-build.patch b/net/transmission/patches/030-fix-musl-build.patch
deleted file mode 100644 (file)
index f03aebc..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
---- a/libtransmission/bitfield.c
-+++ b/libtransmission/bitfield.c
-@@ -6,6 +6,8 @@
-  *
-  */
-+#define __NEED_ssize_t
-+
- #include <assert.h>
- #include <string.h> /* memset */
-@@ -13,6 +15,7 @@
- #include "bitfield.h"
- #include "utils.h" /* tr_new0 () */
-+
- const tr_bitfield TR_BITFIELD_INIT = { NULL, 0, 0, 0, false, false };
- /****
---- a/libtransmission/fdlimit.h
-+++ b/libtransmission/fdlimit.h
-@@ -10,6 +10,8 @@
-  #error only libtransmission should #include this header.
- #endif
-+#define __NEED_off_t
-+
- #include "transmission.h"
- #include "file.h"
- #include "net.h"
diff --git a/net/transmission/patches/030-fix-port-test.patch b/net/transmission/patches/030-fix-port-test.patch
new file mode 100644 (file)
index 0000000..b980241
--- /dev/null
@@ -0,0 +1,30 @@
+From d6655cca7db1b960456811b8206ce222700e010d Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Tue, 30 Jan 2018 13:19:58 -0800
+Subject: [PATCH] Remove compressed responses from web servers.
+
+While zlib is mandatory for transmission, it is not mandatory for curl.
+
+A libcurl that has been compiled with no support for zlib will return no data if compressed responses are set to on.
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+---
+ libtransmission/web.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libtransmission/web.c b/libtransmission/web.c
+index c7f0627..db34976 100644
+--- a/libtransmission/web.c
++++ b/libtransmission/web.c
+@@ -180,7 +180,7 @@ createEasy (tr_session * s, struct tr_web * web, struct tr_web_task * task)
+   task->timeout_secs = getTimeoutFromURL (task);
+   curl_easy_setopt (e, CURLOPT_AUTOREFERER, 1L);
+-  curl_easy_setopt (e, CURLOPT_ENCODING, "gzip;q=1.0, deflate, identity");
++  curl_easy_setopt (e, CURLOPT_ENCODING, "");
+   curl_easy_setopt (e, CURLOPT_FOLLOWLOCATION, 1L);
+   curl_easy_setopt (e, CURLOPT_MAXREDIRS, -1L);
+   curl_easy_setopt (e, CURLOPT_NOSIGNAL, 1L);
+-- 
+2.7.4
+
diff --git a/net/transmission/patches/040-fix-for-mbedtls.patch b/net/transmission/patches/040-fix-for-mbedtls.patch
deleted file mode 100644 (file)
index c766786..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -154,24 +154,8 @@ AS_IF([test "x$want_crypto" = "xauto" -o
- AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xpolarssl"], [
-     PKG_CHECK_MODULES(MBEDTLS, [mbedtls >= $POLARSSL_MINIMUM],
-         [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_CFLAGS="$MBEDTLS_CFLAGS"; CRYPTO_LIBS="$MBEDTLS_LIBS"; POLARSSL_IS_MBEDTLS=yes],
--        [AC_CHECK_HEADER([polarssl/version.h],
--            [AC_EGREP_CPP([version_ok], [#include <polarssl/version.h>
--                                         #if defined (POLARSSL_VERSION_NUMBER) && POLARSSL_VERSION_NUMBER >= $POLARSSL_MINIMUM
--                                         version_ok
--                                         #endif],
--                [AC_CHECK_LIB([polarssl], [dhm_calc_secret],
--                    [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_CFLAGS=""; CRYPTO_LIBS="-lpolarssl"],
--                    [AS_IF([test "x$want_crypto" = "xpolarssl"],
--                        [AC_MSG_ERROR([PolarSSL support requested, but library not found.])]
--                    )]
--                )],
--                [AS_IF([test "x$want_crypto" = "xpolarssl"],
--                    [AC_MSG_ERROR([PolarSSL support requested, but version not suitable.])]
--                )]
--            )],
--            [AS_IF([test "x$want_crypto" = "xpolarssl"],
--                [AC_MSG_ERROR([PolarSSL support requested, but headers not found.])]
--            )]
-+        [AS_IF([test "x$want_crypto" = "xpolarssl"],
-+            [AC_MSG_ERROR([PolarSSL support requested, but library not found.])]
-         )]
-     )
- ])
diff --git a/net/transmission/patches/040-https-portcheck.patch b/net/transmission/patches/040-https-portcheck.patch
new file mode 100644 (file)
index 0000000..99222d2
--- /dev/null
@@ -0,0 +1,26 @@
+From 6de0a3d7a3cd0b2ca6d1b33b5d4d7f44908c1ac3 Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Thu, 1 Mar 2018 11:21:43 -0800
+Subject: [PATCH] portcheck: Switch to HTTPS.
+
+Useful for OpenWrt.
+---
+ libtransmission/rpcimpl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libtransmission/rpcimpl.c b/libtransmission/rpcimpl.c
+index 46fd3192c..dcd96df59 100644
+--- a/libtransmission/rpcimpl.c
++++ b/libtransmission/rpcimpl.c
+@@ -1455,7 +1455,7 @@ portTest (tr_session               * session,
+           struct tr_rpc_idle_data  * idle_data)
+ {
+   const int port = tr_sessionGetPeerPort (session);
+-  char * url = tr_strdup_printf ("http://portcheck.transmissionbt.com/%d", port);
++  char * url = tr_strdup_printf ("https://portcheck.transmissionbt.com/%d", port);
+   tr_webRun (session, url, portTested, idle_data);
+   tr_free (url);
+   return NULL;
+-- 
+2.14.3
+
diff --git a/net/transmission/patches/050-fix-safari.patch b/net/transmission/patches/050-fix-safari.patch
new file mode 100644 (file)
index 0000000..6feaefe
--- /dev/null
@@ -0,0 +1,26 @@
+From 405d768bfea661c418e2c75686a7bac95e4bb17b Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Thu, 1 Mar 2018 11:25:15 -0800
+Subject: [PATCH] fix web interface with Safari.
+
+Backport of bcfe147e6a41ce7774f569ede6179a7ed2c7f560
+---
+ web/javascript/common.js | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/web/javascript/common.js b/web/javascript/common.js
+index 7162d3f82..77bf96857 100644
+--- a/web/javascript/common.js
++++ b/web/javascript/common.js
+@@ -61,7 +61,7 @@ $(document).ready(function() {
+                       // Fix min height for isMobileDevice when run in full screen mode from home screen
+                       // so the footer appears in the right place
+                       $('body div#torrent_container').css('min-height', '338px');
+-              $("label[for=torrent_upload_url]").text("URL: ");
++              $("label[for=torrent_upload_url]").text = "URL: ";
+       } else {
+               // Fix for non-Safari-3 browsers: dark borders to replace shadows.
+               $('div.dialog_container div.dialog_window').css('border', '1px solid #777');
+-- 
+2.14.3
+
diff --git a/net/transmission/patches/050-mask-as-release.patch b/net/transmission/patches/050-mask-as-release.patch
deleted file mode 100644 (file)
index 7f25535..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -42,8 +42,8 @@ set(TR_NAME ${PROJECT_NAME})
- #         "Z" for unsupported trunk builds,
- #         "0" for stable, supported releases
- # these should be the only two lines you need to change
--set(TR_USER_AGENT_PREFIX "2.92+")
--set(TR_PEER_ID_PREFIX "-TR292Z-")
-+set(TR_USER_AGENT_PREFIX "2.92")
-+set(TR_PEER_ID_PREFIX "-TR2920-")
- string(REGEX MATCH "^([0-9]+)\\.([0-9]+).*" TR_VERSION "${TR_USER_AGENT_PREFIX}")
- set(TR_VERSION_MAJOR "${CMAKE_MATCH_1}")
---- a/configure.ac
-+++ b/configure.ac
-@@ -3,8 +3,8 @@ dnl STATUS: "X" for prerelease beta buil
- dnl         "Z" for unsupported trunk builds,
- dnl         "0" for stable, supported releases
- dnl these should be the only two lines you need to change
--m4_define([user_agent_prefix],[2.92+])
--m4_define([peer_id_prefix],[-TR292Z-])
-+m4_define([user_agent_prefix],[2.92])
-+m4_define([peer_id_prefix],[-TR2920-])
- AC_INIT([transmission],[user_agent_prefix],[https://trac.transmissionbt.com/newticket])
- AC_SUBST(USERAGENT_PREFIX,[user_agent_prefix])
index 6f2d2a0d2cec69562ccd373e3805bdccd0e6e5cb..c04548f4cd684abc727989f5d7ab3ef69f27a59b 100644 (file)
@@ -1,32 +1,33 @@
 #
-# Copyright (c) 2016-2017 Dirk Brenken (dev@brenken.org)
+# Copyright (c) 2016-2018 Dirk Brenken (dev@brenken.org)
 # This is free software, licensed under the GNU General Public License v3.
 #
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=travelmate
-PKG_VERSION:=0.3.2
+PKG_VERSION:=1.1.3
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0+
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/$(PKG_NAME)
+define Package/travelmate
        SECTION:=net
        CATEGORY:=Network
        TITLE:=A wlan connection manager for travel router
+       DEPENDS:=+iwinfo +jshn +jsonfilter +uclient-fetch
        PKGARCH:=all
 endef
 
-define Package/$(PKG_NAME)/description
+define Package/travelmate/description
 A wlan connection manager for travel router.
 Please see https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md for further information.
 
 endef
 
-define Package/$(PKG_NAME)/conffiles
+define Package/travelmate/conffiles
 /etc/config/travelmate
 endef
 
@@ -39,7 +40,7 @@ endef
 define Build/Compile
 endef
 
-define Package/$(PKG_NAME)/install
+define Package/travelmate/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) ./files/travelmate.sh $(1)/usr/bin/
 
@@ -50,4 +51,4 @@ define Package/$(PKG_NAME)/install
        $(INSTALL_CONF) ./files/travelmate.conf $(1)/etc/config/travelmate
 endef
 
-$(eval $(call BuildPackage,$(PKG_NAME)))
+$(eval $(call BuildPackage,travelmate))
index 4cd39d60d285fdbff831b6a9baac6d3fdb414fea..ca9d1c66437c5c7077e8d7b96fda7e78bcc7ba45 100644 (file)
@@ -2,54 +2,73 @@
 
 ## Description
 If you’re planning an upcoming vacation or a business trip, taking your laptop, tablet or smartphone give you the ability to connect with friends or complete work on the go. But many hotels don’t have a secure wireless network setup or you’re limited on using a single device at once. Investing in a portable, mini travel router is a great way to connect all of your devices at once while having total control over your own personalized wireless network.  
-A logical combination of AP+STA mode on one physical radio allows most of OpenWrt/LEDE supported router devices to connect to a wireless hotspot/station (STA) and provide a wireless access point (AP) from that hotspot at the same time. Downside of this solution: whenever the STA interface looses the connection it will go into an active scan cycle which renders the radio unusable for AP mode operation, therefore the AP is taken down if the STA looses its association.  
+A logical combination of AP+STA mode on one physical radio allows most of OpenWrt supported router devices to connect to a wireless hotspot/station (STA) and provide a wireless access point (AP) from that hotspot at the same time. Downside of this solution: whenever the STA interface looses the connection it will go into an active scan cycle which renders the radio unusable for AP mode operation, therefore the AP is taken down if the STA looses its association.  
 To avoid these kind of deadlocks, travelmate set all station interfaces in an "always off" mode and connects automatically to available/configured hotspots.  
 
 ## Main Features
 * STA interfaces operating in an "always off" mode, to make sure that the AP is always accessible
-* easy setup within normal OpenWrt/LEDE environment
+* easy setup within normal OpenWrt environment
+* strong LuCI-Support with builtin interface wizard and a wireless station manager
 * fast uplink connections
-* procd init system support
-* procd based hotplug support, the travelmate start will be triggered by interface triggers
+* support all kinds of uplinks, incl. hidden and enterprise uplinks
+* trigger- or automatic-mode support, the latter one is the default and checks the existing uplink connection regardless of ifdown event trigger actions every n seconds
+* checks continuously the signal quality for conditional uplink (dis-) connections
+* captive portal detection with internet online check and a 'heartbeat' function to keep the uplink connection up & running
+* support of devices with multiple radios
+* procd init and hotplug support
+* runtime information available via LuCI & via 'status' init command
 * status & debug logging to syslog
 
 ## Prerequisites
-* [OpenWrt](https://openwrt.org) or [LEDE](https://www.lede-project.org) trunk
-* iw (default) or iwinfo for wlan scanning
+* [OpenWrt](https://openwrt.org), tested with the stable release series (17.01.x) and with the latest OpenWrt snapshot
+* iwinfo for wlan scanning, uclient-fetch for captive portal detection
 
-## OpenWrt / LEDE trunk Installation & Usage
-* download the package [here](https://downloads.lede-project.org/snapshots/packages/x86_64/packages)
+## Installation & Usage
+* download the package [here](https://downloads.openwrt.org/snapshots/packages/x86_64/packages)
 * install 'travelmate' (_opkg install travelmate_)
-* configure your network to support (multiple) wlan uplinks and set travelmate config options (details see below)
-* set 'trm\_enabled' option in travelmate config to '1'
-* travelmate starts automatically during boot and will be triggered by procd interface triggers
+* configure your network:
+    * recommended: use the LuCI frontend with builtin interface wizard and a wireless station manager
+    * manual: see detailed configure steps below
+    * at least you need one configured AP and one STA interface
 
 ## LuCI travelmate companion package
-* download the package [here](https://downloads.lede-project.org/snapshots/packages/x86_64/luci)
+* download the package [here](https://downloads.openwrt.org/snapshots/packages/x86_64/luci)
 * install 'luci-app-travelmate' (_opkg install luci-app-travelmate_)
 * the application is located in LuCI under 'Services' menu
-* _Thanks to Hannu Nyman for this great LuCI frontend!_
-
-## Chaos Calmer installation notes
-* 'travelmate' and 'luci-app-travelmate' are _not_ available as ipk packages in the Chaos Calmer download repository
-* download the packages from a development snapshot directory (see download links above)
-* manually transfer the packages to your routers temp directory (with tools like _sshfs_ or _winscp_)
-* install the packages as described above
 
 ## Travelmate config options
-* travelmate config options:
-    * trm\_enabled => main switch to enable/disable the travelmate service (default: '0', disabled)
-    * trm\_debug => enable/disable debug logging (default: '0', disabled)
-    * trm\_maxwait => how long (in seconds) should travelmate wait for wlan interface reload action (default: '20')
-    * trm\_maxretry => how many times should travelmate try to find an uplink after a trigger event (default: '3')
-    * trm\_iw => set this option to '0' to use iwinfo for wlan scanning (default: '1', use iw)
-    * trm\_iface => restrict the procd interface trigger to a (list of) certain wan interface(s) or disable it at all (default: not set, disabled)
-
-## Setup
-**1. configure a wwan interface in /etc/config/network:**
+* usually the pre-configured travelmate setup works quite well and no manual config overrides are needed, all listed options apply to the 'global' section:
+    * trm\_enabled => main switch to enable/disable the travelmate service (bool/default: '0', disabled)
+    * trm\_debug => enable/disable debug logging (bool/default: '0', disabled)
+    * trm\_automatic => keep travelmate in an active state (bool/default: '1', enabled)
+    * trm\_captive => enable/disable the captive portal detection (bool/default: '1', enabled)
+    * trm\_minquality => minimum signal quality threshold as percent for conditional uplink (dis-) connections (int/default: '35', valid range: 20-80)
+    * trm\_maxwait => how long (in seconds) should travelmate wait for a successful wlan interface reload action (int/default: '30', valid range: 20-40)
+    * trm\_maxretry => how many times should travelmate try to connect to an uplink (int/default: '3', valid range: 1-10)
+    * trm\_timeout => timeout in seconds for "automatic mode" (int/default: '60', valid range: 30-300)
+    * trm\_radio => limit travelmate to a dedicated radio, e.g. 'radio0' (default: not set, use all radios)
+    * trm\_iface => main uplink / procd trigger network interface (default: trm_wwan)
+    * trm\_triggerdelay => additional trigger delay in seconds before travelmate processing starts (int/default: '2')
+
+## Runtime information
+
+**receive travelmate runtime information:**
+<pre><code>
+::: travelmate runtime information
+  + travelmate_status  : connected (net ok/55)
+  + travelmate_version : 1.1.0
+  + station_id         : Turris/-
+  + station_interface  : trm_wwan
+  + station_radio      : radio1
+  + last_rundate       : 19.02.2018 17:02:25
+  + system             : GL.iNet GL-AR750, OpenWrt SNAPSHOT r5988+25-60e07ffec5
+</code></pre>
+
+## Manual Setup
+**1. configure the travelmate wwan interface in /etc/config/network:**
 <pre><code>
 [...]
-config interface 'wwan'
+config interface 'trm_wwan'
         option proto 'dhcp'
 [...]
 </code></pre>
@@ -59,22 +78,16 @@ config interface 'wwan'
 [...]
 config zone
         option name 'wan'
-        option input 'REJECT'
-        option output 'ACCEPT'
-        option forward 'REJECT'
-        option masq '1'
-        option mtu_fix '1'
-        option network 'wan wan6 wwan'
+        option network 'wan wan6 trm_wwan'
 [...]
 </code></pre>
 
-**3. add required ap and wwan stations to your wireless configuration in etc/config/wireless:**
+**3. at least add one ap and (multiple) wwan stations to your wireless configuration in etc/config/wireless:**
 <pre><code>
 [...]
 config wifi-iface
         option device 'radio0'
         option network 'lan'
-        option ifname 'wlan0'
         option mode 'ap'
         option ssid 'example_ap'
         option encryption 'psk2+ccmp'
@@ -83,41 +96,39 @@ config wifi-iface
 [...]
 config wifi-iface
         option device 'radio0'
-        option network 'wwan'
+        option network 'trm_wwan'
         option mode 'sta'
         option ssid 'example_01'
-        option ifname 'wwan01'
         option encryption 'psk2+ccmp'
         option key 'abc'
         option disabled '1'
+[...]
 config wifi-iface
         option device 'radio0'
-        option network 'wwan'
+        option network 'trm_wwan'
         option mode 'sta'
         option ssid 'example_02'
-        option ifname 'wwan02'
         option encryption 'psk2+ccmp'
         option key 'xyz'
         option disabled '1'
-config wifi-iface
-        option device 'radio0'
-        option network 'wwan'
-        option mode 'sta'
-        option ssid 'example_03'
-        option ifname 'wwan03'
-        option encryption 'none'
-        option disabled '1'
 [...]
 </code></pre>
 
-**4. reload network configuration & start travelmate:**
+**4. start travelmate:**
 <pre><code>
-/etc/init.d/network reload
-/etc/init.d/travelmate start
+edit /etc/config/travelmate and set 'trm_enabled' to '1'
+/etc/init.d/travelmate restart
 </code></pre>
 
+## FAQ
+**Q:** What's about 'trigger' and 'automatic' mode?  
+**A:** In "trigger" mode travelmate will be triggered solely by procd interface down events, whenever an uplink disappears travelmate tries n times (default 3) to find a new uplink or reconnect to the old one. The 'automatic' mode keeps travelmate in an active state and checks every n seconds the connection status / the uplink availability regardless of procd event trigger.  
+
+**Q:** What happen with misconfigured uplinks, e.g. due to outdated wlan passwords?  
+**A:** Travelmate tries n times (default 3) to connect, then the respective uplink SSID will be marked / renamed to '_SSID_\_err'. In this case use the builtin wireless station manager to update your wireless credentials.  
+
 ## Support
-Please join the travelmate discussion in this [forum thread](https://forum.openwrt.org/viewtopic.php?id=67697) or contact me by [mail](mailto:dev@brenken.org)  
+Please join the travelmate discussion in this [forum thread](https://forum.lede-project.org/t/travelmate-support-thread/5155) or contact me by [mail](mailto:dev@brenken.org)  
 
 ## Removal
 * stop the travelmate daemon with _/etc/init.d/travelmate stop_
index c63000f3806b7969a8beab630ea6e23b8ffb4419..6d911356652a1b6b8f5a6bb6b600c585b28b3b12 100644 (file)
@@ -3,7 +3,13 @@
 
 config travelmate 'global'
        option trm_enabled '0'
+       option trm_automatic '1'
+       option trm_captive '1'
+       option trm_iface 'trm_wwan'
+       option trm_triggerdelay '2'
        option trm_debug '0'
-       option trm_maxwait '20'
        option trm_maxretry '3'
-       option trm_iw '1'
+       option trm_minquality '35'
+       option trm_maxwait '30'
+       option trm_timeout '60'
+       option trm_rtfile '/tmp/trm_runtime.json'
index 255a641879611dc136843b21aef8a37f345cb80b..51cc42e9bb3830daf4607804694c90f2f715a33d 100755 (executable)
@@ -1,39 +1,73 @@
 #!/bin/sh /etc/rc.common
 
-START=85
+START=25
 USE_PROCD=1
 
+EXTRA_COMMANDS="status"
+EXTRA_HELP="   status  Print runtime information"
+
+trm_init="/etc/init.d/travelmate"
 trm_script="/usr/bin/travelmate.sh"
 
 boot()
 {
-    ubus -t 30 wait_for network.interface
+    ubus -t 30 wait_for network.interface network.wireless 2>/dev/null
     rc_procd start_service
 }
 
 start_service()
 {
-    procd_open_instance "travelmate"
-    procd_set_param env trm_procd="true"
-    procd_set_param command "${trm_script}" "${@}"
-    procd_set_param stdout 1
-    procd_set_param stderr 1
-    procd_close_instance
+    if [ $("${trm_init}" enabled; printf "%u" ${?}) -eq 0 ]
+    then
+        procd_open_instance "travelmate"
+        procd_set_param command "${trm_script}" "${@}"
+        procd_set_param stdout 1
+        procd_set_param stderr 1
+        procd_close_instance
+    fi
 }
 
-service_triggers()
+stop_service()
+{
+    local rtfile="$(uci_get travelmate global trm_rtfile)"
+
+    rtfile="${rtfile:-"/tmp/trm_runtime.json"}"
+    > "${rtfile}"
+    rc_procd start_service
+}
+
+status()
 {
-    local iface="$(uci -q get travelmate.global.trm_iface)"
+    local key keylist value rtfile="$(uci_get travelmate global trm_rtfile)"
 
-    if [ -z "${iface}" ]
+    rtfile="${rtfile:-"/tmp/trm_runtime.json"}"
+    if [ -s "${rtfile}" ]
     then
-        procd_add_raw_trigger "interface.*.down" 1000 /etc/init.d/travelmate start
-    else
-        for name in ${iface}
+        printf "%s\n" "::: travelmate runtime information"
+        json_load "$(cat "${rtfile}" 2>/dev/null)"
+        json_select data
+        json_get_keys keylist
+        for key in ${keylist}
         do
-            procd_add_interface_trigger "interface.*.down" "${name}" /etc/init.d/travelmate start
+            json_get_var value "${key}"
+            printf "  + %-18s : %s\n" "${key}" "${value}"
         done
+    else
+        printf "%s\n" "::: no travelmate runtime information available"
     fi
+}
 
-    procd_add_config_trigger "config.change" "travelmate" /etc/init.d/travelmate start
+service_triggers()
+{
+    local auto="$(uci_get travelmate global trm_automatic)"
+
+    if [ "${auto}" = "0" ]
+    then
+        local trigger="$(uci_get travelmate global trm_iface)"
+        local delay="$(uci_get travelmate global trm_triggerdelay)"
+
+        PROCD_RELOAD_DELAY=$((${delay:-2} * 1000))
+        procd_add_interface_trigger "interface.*.down" "${trigger}" "${trm_init}" start
+    fi
+    procd_add_reload_trigger "travelmate"
 }
index f626f390c01a85ee343e78427439916904dd5372..35cc2ded62dbf75181b2433d904757488b4acc0b 100755 (executable)
@@ -6,29 +6,56 @@
 # You should have received a copy of the GNU General Public License
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
-# prepare environment
+# set initial defaults
 #
 LC_ALL=C
 PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-trm_ver="0.3.2"
-trm_enabled=1
+trm_ver="1.1.3"
+trm_sysver="unknown"
+trm_enabled=0
 trm_debug=0
-trm_maxwait=20
+trm_automatic=1
+trm_captive=1
+trm_captiveurl="http://captive.apple.com"
+trm_minquality=35
 trm_maxretry=3
-trm_iw=1
+trm_maxwait=30
+trm_timeout=60
+trm_radio=""
+trm_connection=""
+trm_rtfile="/tmp/trm_runtime.json"
+trm_fetch="$(command -v uclient-fetch)"
+trm_iwinfo="$(command -v iwinfo)"
+trm_wpa="$(command -v wpa_supplicant)"
 
+# load travelmate environment
+#
 f_envload()
 {
-    # source required system libraries
+    local sys_call sys_desc sys_model sys_ver
+
+    # get system information
     #
-    if [ -r "/lib/functions.sh" ]
+    sys_call="$(ubus -S call system board 2>/dev/null)"
+    if [ -n "${sys_call}" ]
     then
-        . "/lib/functions.sh"
-    else
-        f_log "error" "status  ::: required system library not found"
+        sys_desc="$(printf '%s' "${sys_call}" | jsonfilter -e '@.release.description')"
+        sys_model="$(printf '%s' "${sys_call}" | jsonfilter -e '@.model')"
+        sys_ver="$(cat /etc/turris-version 2>/dev/null)"
+        if [ -n "${sys_ver}" ]
+        then
+            sys_desc="${sys_desc}/${sys_ver}"
+        fi
+        trm_sysver="${sys_model}, ${sys_desc}"
     fi
 
-    # load uci config and check 'enabled' option
+    # (re-)initialize global list variables
+    #
+    trm_devlist=""
+    trm_stalist=""
+    trm_radiolist=""
+
+    # load config and check 'enabled' option
     #
     option_cb()
     {
@@ -40,72 +67,194 @@ f_envload()
 
     if [ ${trm_enabled} -ne 1 ]
     then
-        f_log "info " "status  ::: travelmate is currently disabled, please set 'trm_enabled' to '1' to use this service"
+        f_log "info" "travelmate is currently disabled, please set 'trm_enabled' to '1' to use this service"
         exit 0
     fi
 
-    # check for preferred wireless tool
+    # validate input ranges
     #
-    if [ ${trm_iw} -eq 1 ]
+    if [ ${trm_minquality} -lt 20 ] || [ ${trm_minquality} -gt 80 ]
     then
-        trm_scanner="$(which iw)"
-    else
-        trm_scanner="$(which iwinfo)"
+        trm_minquality=35
+    fi
+    if [ ${trm_maxretry} -lt 1 ] || [ ${trm_maxretry} -gt 10 ]
+    then
+        trm_maxretry=3
     fi
-    if [ -z "${trm_scanner}" ]
+    if [ ${trm_maxwait} -lt 20 ] || [ ${trm_maxwait} -gt 40 ] || [ ${trm_maxwait} -ge ${trm_timeout} ]
     then
-        f_log "error" "status  ::: no wireless tool for wlan scanning found, please install 'iw' or 'iwinfo'"
+        trm_maxwait=30
+    fi
+    if [ ${trm_timeout} -lt 30 ] || [ ${trm_timeout} -gt 300 ] || [ ${trm_timeout} -le ${trm_maxwait} ]
+    then
+        trm_timeout=60
     fi
 }
 
-# function to bring down all STA interfaces
+# gather radio information & bring down all STA interfaces
 #
-f_prepare()
+f_prep()
 {
-    local config="${1}"
-    local mode="$(uci -q get wireless."${config}".mode)"
-    local network="$(uci -q get wireless."${config}".network)"
-    local disabled="$(uci -q get wireless."${config}".disabled)"
+    local eap_rc=0 config="${1}"
+    local mode="$(uci_get wireless "${config}" mode)"
+    local network="$(uci_get wireless "${config}" network)"
+    local radio="$(uci_get wireless "${config}" device)"
+    local disabled="$(uci_get wireless "${config}" disabled)"
+    local eaptype="$(uci_get wireless "${config}" eap_type)"
 
-    if [ "${mode}" = "sta" ] && [ -n "${network}" ]
+    if ([ -z "${trm_radio}" ] || [ "${trm_radio}" = "${radio}" ]) && \
+        [ -z "$(printf "%s" "${trm_radiolist}" | grep -Fo " ${radio}")" ]
+    then
+        trm_radiolist="${trm_radiolist} ${radio}"
+    fi
+    if [ "${mode}" = "sta" ] && [ "${network}" = "${trm_iface}" ]
     then
-        trm_stalist="${trm_stalist} ${config}_${network}"
         if [ -z "${disabled}" ] || [ "${disabled}" = "0" ]
         then
-            uci -q set wireless."${config}".disabled=1
-            f_log "debug" "prepare ::: config: ${config}, interface: ${network}"
+            uci_set wireless "${config}" disabled 1
+        fi
+        if [ -n "${eaptype}" ]
+        then
+            eap_rc="$("${trm_wpa}" -veap >/dev/null 2>&1; printf "%u" ${?})"
+        fi
+        if [ -z "${eaptype}" ] || [ ${eap_rc} -eq 0 ]
+        then
+            trm_stalist="${trm_stalist} ${config}_${radio}"
         fi
     fi
+    f_log "debug" "f_prep ::: config: ${config}, mode: ${mode}, network: ${network}, eap_rc: ${eap_rc}, radio: ${radio}, trm_radio: ${trm_radio:-"-"}, disabled: ${disabled}"
 }
 
+# check interface status
+#
 f_check()
 {
-    local ifname cnt=1 mode="${1}"
-    trm_ifstatus="false"
+    local ifname radio dev_status config sta_essid sta_bssid result wait=1 mode="${1}" status="${2:-"false"}" IFS=" "
 
-    while [ ${cnt} -le ${trm_maxwait} ]
+    trm_ifquality=0
+    trm_ifstatus="false"
+    if [ "${mode}" != "initial" ]
+    then
+        ubus call network reload
+    fi
+    while [ ${wait} -le ${trm_maxwait} ]
     do
-        if [ "${mode}" = "ap" ]
+        dev_status="$(ubus -S call network.wireless status 2>/dev/null)"
+        if [ -n "${dev_status}" ]
         then
-            trm_ifstatus="$(ubus -S call network.wireless status | jsonfilter -l1 -e '@.*.up')"
-        else
-            ifname="$(ubus -S call network.wireless status | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].ifname')"
-            if [ -n "${ifname}" ]
+            if [ "${mode}" = "dev" ]
+            then
+                if [ "${trm_ifstatus}" != "${status}" ]
+                then
+                    trm_ifstatus="${status}"
+                    f_jsnup
+                fi
+                for radio in ${trm_radiolist}
+                do
+                    result="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e "@.${radio}.up")"
+                    if [ "${result}" = "true" ] && [ -z "$(printf "%s" "${trm_devlist}" | grep -Fo " ${radio}")" ]
+                    then
+                        trm_devlist="${trm_devlist} ${radio}"
+                    fi
+                done
+                if [ "${trm_devlist}" = "${trm_radiolist}" ] || [ ${wait} -eq ${trm_maxwait} ]
+                then
+                    ifname="${trm_devlist}"
+                    break
+                else
+                    trm_devlist=""
+                fi
+            elif [ "${mode}" = "rev" ]
+            then
+                wait=$((${trm_maxwait}/3))
+                sleep ${wait}
+                break
+            else
+                ifname="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].ifname')"
+                if [ -n "${ifname}" ]
+                then
+                    trm_ifquality="$(${trm_iwinfo} ${ifname} info 2>/dev/null | awk -F "[\/| ]" '/Link Quality:/{printf "%i\n", (100 / $NF * $(NF-1)) }')"
+                    if [ ${trm_ifquality} -ge ${trm_minquality} ]
+                    then
+                        trm_ifstatus="$(ubus -S call network.interface dump 2>/dev/null | jsonfilter -l1 -e "@.interface[@.device=\"${ifname}\"].up")"
+                    elif [ "${mode}" = "initial" ] && [ ${trm_ifquality} -lt ${trm_minquality} ]
+                    then
+                        trm_ifstatus="${status}"
+                        sta_essid="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].*.ssid')"
+                        sta_bssid="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].*.bssid')"
+                        f_log "info" "uplink '${sta_essid:-"-"}/${sta_bssid:-"-"}' is out of range (${trm_ifquality}/${trm_minquality}), uplink disconnected (${trm_sysver})"
+                    fi
+                fi
+            fi
+            if [ "${mode}" = "initial" ] || [ "${trm_ifstatus}" = "true" ]
             then
-                trm_ifstatus="$(ubus -S call network.interface dump | jsonfilter -e "@.interface[@.device=\"${ifname}\"].up")"
+                if ([ "${trm_ifstatus}" != "true" ] && [ "${trm_ifstatus}" != "${status}" ]) || [ ${trm_ifquality} -lt ${trm_minquality} ]
+                then
+                    f_jsnup
+                fi
+                if [ "${mode}" = "initial" ] && [ "${trm_captive}" -eq 1 ] && [ "${trm_ifstatus}" = "true" ]
+                then
+                    result="$(${trm_fetch} --timeout=$((${trm_maxwait}/3)) --spider "${trm_captiveurl}" 2>&1 | awk '/^Redirected/{printf "%s" "net cp \047"$NF"\047";exit}/^Download completed/{printf "%s" "net ok";exit}/^Failed|^Connection error/{printf "%s" "net nok";exit}')"
+                    if [ -n "${result}" ] && ([ -z "${trm_connection}" ] || [ "${result}" != "${trm_connection%/*}" ])
+                    then
+                        trm_connection="${result}/${trm_ifquality}"
+                        f_jsnup
+                    fi
+                fi
+                break
             fi
         fi
-        if [ "${mode}" = "initial" ] || [ "${trm_ifstatus}" = "true" ]
-        then
-            break
-        fi
-        cnt=$((cnt+1))
+        wait=$((wait+1))
         sleep 1
     done
-    f_log "debug" "check   ::: mode: ${mode}, name: ${ifname}, status: ${trm_ifstatus}, count: ${cnt}, max-wait: ${trm_maxwait}"
+    f_log "debug" "f_check::: mode: ${mode}, name: ${ifname:-"-"}, status: ${trm_ifstatus}, quality: ${trm_ifquality}, connection: ${trm_connection:-"-"}, wait: ${wait}, max_wait: ${trm_maxwait}, min_quality: ${trm_minquality}, captive: ${trm_captive}, automatic: ${trm_automatic}"
 }
 
-# function to write to syslog
+# update runtime information
+#
+f_jsnup()
+{
+    local config sta_iface sta_radio sta_essid sta_bssid dev_status status="${trm_ifstatus}"
+
+    if [ "${status}" = "true" ]
+    then
+        status="connected (${trm_connection:-"-"})"
+    else
+        trm_connection=""
+        if [ "${status}" = "false" ]
+        then
+            status="not connected"
+        fi
+    fi
+
+    dev_status="$(ubus -S call network.wireless status 2>/dev/null)"
+    if [ -n "${dev_status}" ]
+    then
+        config="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].section')"
+        if [ -n "${config}" ]
+        then
+            sta_iface="$(uci_get wireless "${config}" network)"
+            sta_radio="$(uci_get wireless "${config}" device)"
+            sta_essid="$(uci_get wireless "${config}" ssid)"
+            sta_bssid="$(uci_get wireless "${config}" bssid)"
+        fi
+    fi
+
+    json_init
+    json_add_object "data"
+    json_add_string "travelmate_status" "${status}"
+    json_add_string "travelmate_version" "${trm_ver}"
+    json_add_string "station_id" "${sta_essid:-"-"}/${sta_bssid:-"-"}"
+    json_add_string "station_interface" "${sta_iface:-"-"}"
+    json_add_string "station_radio" "${sta_radio:-"-"}"
+    json_add_string "last_rundate" "$(/bin/date "+%d.%m.%Y %H:%M:%S")"
+    json_add_string "system" "${trm_sysver}"
+    json_close_object
+    json_dump > "${trm_rtfile}"
+    f_log "debug" "f_jsnup::: config: ${config:-"-"}, status: ${status:-"-"}, sta_iface: ${sta_iface:-"-"}, sta_radio: ${sta_radio:-"-"}, sta_essid: ${sta_essid:-"-"}, sta_bssid: ${sta_bssid:-"-"}"
+}
+
+# write to syslog
 #
 f_log()
 {
@@ -114,91 +263,142 @@ f_log()
 
     if [ -n "${log_msg}" ] && ([ "${class}" != "debug" ] || [ ${trm_debug} -eq 1 ])
     then
-        logger -t "travelmate-[${trm_ver}] ${class}" "${log_msg}"
-        if [ "${class}" = "error" ]
+        logger -p "${class}" -t "travelmate-[${trm_ver}]" "${log_msg}"
+        if [ "${class}" = "err" ]
         then
-            exit 255
+            trm_ifstatus="error"
+            f_jsnup
+            logger -p "${class}" -t "travelmate-[${trm_ver}]" "Please check 'https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md' (${trm_sysver})"
+            exit 1
         fi
     fi
 }
 
+# main function for connection handling
+#
 f_main()
 {
-    local ap_list ssid_list config network ssid cnt=1
-    local sysver="$(ubus -S call system board | jsonfilter -e '@.release.description')"
+    local cnt dev config scan scan_list scan_essid scan_bssid scan_quality sta sta_essid sta_bssid sta_radio sta_iface IFS=" "
 
     f_check "initial"
     if [ "${trm_ifstatus}" != "true" ]
     then
         config_load wireless
-        config_foreach f_prepare wifi-iface
-        if [ -n "$(uci -q changes wireless)" ]
-        then
-            uci -q commit wireless
-            ubus call network reload
-        fi
-        f_check "ap"
-        ap_list="$(ubus -S call network.wireless status | jsonfilter -e '@.*.interfaces[@.config.mode="ap"].ifname')"
-        f_log "debug" "main    ::: ap-list: ${ap_list}, sta-list: ${trm_stalist}"
-        if [ -z "${ap_list}" ] || [ -z "${trm_stalist}" ]
-        then
-            f_log "error" "status  ::: no usable AP/STA configuration found"
-        fi
-        for ap in ${ap_list}
+        config_foreach f_prep wifi-iface
+        uci_commit wireless
+        f_check "dev" "running"
+        f_log "debug" "f_main ::: iwinfo: ${trm_iwinfo}, dev_list: ${trm_devlist}, sta_list: ${trm_stalist:0:800}"
+        for dev in ${trm_devlist}
         do
-            while [ ${cnt} -le ${trm_maxretry} ]
+            if [ -z "$(printf "%s" "${trm_stalist}" | grep -Fo "_${dev}")" ]
+            then
+                continue
+            fi
+            cnt=1
+            while [ ${trm_maxretry} -eq 0 ] || [ ${cnt} -le ${trm_maxretry} ]
             do
-                if [ ${trm_iw} -eq 1 ]
-                then
-                    ssid_list="$(${trm_scanner} dev "${ap}" scan 2>/dev/null | \
-                        awk '/SSID: /{if(!seen[$0]++){printf "\"";for(i=2; i<=NF; i++)if(i==2)printf $i;else printf " "$i;printf "\" "}}')"
-                else
-                    ssid_list="$(${trm_scanner} "${ap}" scan | \
-                        awk '/ESSID: ".*"/{ORS=" ";if (!seen[$0]++) for(i=2; i<=NF; i++) print $i}')"
-                fi
-                f_log "debug" "main    ::: scan-tool: ${trm_scanner}, ssidlist: ${ssid_list}"
-                if [ -n "${ssid_list}" ]
+                scan_list="$(${trm_iwinfo} "${dev}" scan 2>/dev/null | awk 'BEGIN{FS="[/ ]"}/Address:/{var1=$NF}/ESSID:/{var2="";for(i=12;i<=NF;i++)if(var2==""){var2=$i}else{var2=var2" "$i}}/Quality:/{printf "%i,%s,%s\n",(100/$NF*$(NF-1)),var1,var2}' | sort -rn | awk '{ORS=",";print $0}')"
+                f_log "debug" "f_main ::: dev: ${dev}, scan_list: ${scan_list:0:800}, cnt: ${cnt}, max_cnt: ${trm_maxretry}"
+                if [ -n "${scan_list}" ]
                 then
                     for sta in ${trm_stalist}
                     do
                         config="${sta%%_*}"
-                        network="${sta##*_}"
-                        ssid="\"$(uci -q get wireless."${config}".ssid)\""
-                        if [ -n "$(printf "${ssid_list}" | grep -Fo "${ssid}")" ]
-                        then
-                            uci -q set wireless."${config}".disabled=0
-                            uci -q commit wireless
-                            ubus call network reload
-                            f_check "sta"
-                            if [ "${trm_ifstatus}" = "true" ]
+                        sta_radio="${sta##*_}"
+                        sta_essid="$(uci_get wireless "${config}" ssid)"
+                        sta_bssid="$(uci_get wireless "${config}" bssid)"
+                        sta_iface="$(uci_get wireless "${config}" network)"
+                        IFS=","
+                        for scan in ${scan_list}
+                        do
+                            if [ -z "${scan_quality}" ]
                             then
-                                f_log "info " "status  ::: wwan interface connected to uplink ${ssid} (${cnt}/${trm_maxretry}, ${sysver})"
-                                sleep 5
-                                return 0
-                            else
-                                uci -q set wireless."${config}".disabled=1
-                                uci -q commit wireless
-                                ubus call network reload
-                                f_log "info " "status  ::: wwan interface can't connect to uplink ${ssid} (${cnt}/${trm_maxretry}, ${sysver})"
+                                scan_quality="${scan}"
+                            elif [ -z "${scan_bssid}" ]
+                            then
+                                scan_bssid="${scan}"
+                            elif [ -z "${scan_essid}" ]
+                            then
+                                scan_essid="${scan}"
                             fi
-                        fi
+                            if [ -n "${scan_quality}" ] && [ -n "${scan_bssid}" ] && [ -n "${scan_essid}" ]
+                            then
+                                if [ ${scan_quality} -ge ${trm_minquality} ]
+                                then
+                                    if (([ "${scan_essid}" = "\"${sta_essid}\"" ] && ([ -z "${sta_bssid}" ] || [ "${scan_bssid}" = "${sta_bssid}" ])) || \
+                                        ([ "${scan_bssid}" = "${sta_bssid}" ] && [ "${scan_essid}" = "unknown" ])) && [ "${dev}" = "${sta_radio}" ]
+                                    then
+                                        f_log "debug" "f_main ::: scan_quality: ${scan_quality}, scan_bssid: ${scan_bssid}, scan_essid: ${scan_essid}"
+                                        uci_set wireless "${config}" disabled 0
+                                        f_check "sta"
+                                        if [ "${trm_ifstatus}" = "true" ]
+                                        then
+                                            uci_commit wireless
+                                            f_log "info" "interface '${sta_iface}' on '${sta_radio}' connected to uplink '${sta_essid:-"-"}/${sta_bssid:-"-"}' (${trm_sysver})"
+                                            f_check "initial"
+                                            return 0
+                                        elif [ ${cnt} -eq ${trm_maxretry} ]
+                                        then
+                                            uci_set wireless "${config}" disabled 1
+                                            if [ -n "${sta_essid}" ]
+                                            then
+                                                uci_set wireless "${config}" ssid "${sta_essid}_err"
+                                            fi
+                                            if [ -n "${sta_bssid}" ]
+                                            then
+                                                uci_set wireless "${config}" bssid "${sta_bssid}_err"
+                                            fi
+                                            uci_commit wireless
+                                            f_log "info" "can't connect to uplink '${sta_essid:-"-"}/${sta_bssid:-"-"}', uplink disabled (${trm_sysver})"
+                                            f_check "rev"
+                                        else
+                                            uci -q revert wireless
+                                            f_log "info" "can't connect to uplink '${sta_essid:-"-"}/${sta_bssid:-"-"}' (${trm_sysver})"
+                                            f_check "rev"
+                                        fi
+                                    fi
+                                fi
+                                scan_quality=""
+                                scan_bssid=""
+                                scan_essid=""
+                            fi
+                        done
+                        IFS=" "
                     done
-                else
-                    f_log "info " "status  ::: empty uplink list (${cnt}/${trm_maxretry}, ${sysver})"
                 fi
                 cnt=$((cnt+1))
-                sleep 5
+                sleep $((${trm_maxwait}/6))
             done
         done
-        f_log "info " "status  ::: no wwan uplink found (${sysver})"
-    else
-        f_log "info " "status  ::: wwan uplink still connected (${sysver})"
+        if [ ! -s "${trm_rtfile}" ]
+        then
+            trm_ifstatus="false"
+            f_jsnup
+        fi
+    elif [ ! -s "${trm_rtfile}" ]
+    then
+        f_jsnup
     fi
 }
 
-if [ "${trm_procd}" = "true" ]
+# source required system libraries
+#
+if [ -r "/lib/functions.sh" ] && [ -r "/usr/share/libubox/jshn.sh" ]
 then
+    . "/lib/functions.sh"
+    . "/usr/share/libubox/jshn.sh"
+else
+    f_log "err" "system libraries not found"
+fi
+
+# control travelmate actions
+#
+f_envload
+f_main
+while [ ${trm_automatic} -eq 1 ]
+do
+    sleep ${trm_timeout}
     f_envload
     f_main
-fi
-exit 0
\ No newline at end of file
+done
+exit 0
index 3f77ba33966e9b11ca104319e0cc39a4c0854cd6..57a3437cfba4131924769abb2c67479e28cd825a 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://github.com/mhei/u2pnpd/releases/download/v$(PKG_VERSION)
-PKG_MD5SUM:=ac6f378590d3e4e38b40e4b13f03b369
+PKG_HASH:=73010be7ec523e3c3a9849a9783026627ecb3bc18d8195a9bed450e98a055ac2
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index d9b8c987db53042eb32466453568501f8fb6ce06..ef7b3914d6af1a74090521eb3444c321530013a9 100644 (file)
@@ -13,11 +13,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uanytun
 PKG_VERSION:=0.3.5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.anytun.org/download/
-PKG_MD5SUM:=ce47ad45003ff1d84eaf5276941b9ddf
+PKG_HASH:=8edeed2ce185cc1add8a53de9f9192dfa65a48b559cccae6393faf2a1cd6f093
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
 PKG_LICENSE:=GPL-3.0+
@@ -137,7 +137,7 @@ define Build/Compile
     $(TARGET_CONFIGURE_OPTS) \
     $(VARIANT_MAKE_OPTS) \
     TARGET=Linux \
-    CFLAGS="$(TARGET_CFLAGS) $(VARIANT_CFLAGS)" \
+    CFLAGS="$(TARGET_CFLAGS) $(VARIANT_CFLAGS) $(TARGET_CPPFLAGS)" \
     LDFLAGS="$(TARGET_LDFLAGS) $(VARIANT_LDFLAGS)"
        $(STRIP) $(PKG_BUILD_DIR)/src/uanytun
 endef
diff --git a/net/uanytun/patches/100-reproducible-builds.patch b/net/uanytun/patches/100-reproducible-builds.patch
new file mode 100644 (file)
index 0000000..a5aa864
--- /dev/null
@@ -0,0 +1,12 @@
+Index: uanytun-0.3.5/src/options.c
+===================================================================
+--- uanytun-0.3.5.orig/src/options.c
++++ uanytun-0.3.5/src/options.c
+@@ -481,7 +481,6 @@ void options_print_usage()
+ void options_print_version()
+ {
+   printf("%s\n", VERSION_STRING_0);
+-  printf("%s\n", VERSION_STRING_1);
+ }
+ void options_print(options_t* opt)
index 6bb57480bb3ddd275cfb521c21af6b8f0a7e5523..a9fc6311de117d89141998456a40f739e7a55907 100644 (file)
@@ -16,6 +16,7 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/pcherenkov/udpxy.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=bb6ca16706b011cc473d296ebc6d6e57fe5cfc2a0fc46e81399fba01d6484b3e
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=GPL-3.0
index 2fa9f6c780075a0017c21cb1ef1f67d728b22839..f82d57bf2b799221eead771cb16d0decf208e50b 100644 (file)
@@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ulogd
 PKG_VERSION:=2.0.5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.netfilter.org/pub/ulogd/ \
        ftp://ftp.be.netfilter.org/pub/netfilter/ulogd/ \
        ftp://ftp.de.netfilter.org/pub/netfilter/ulogd/ \
        ftp://ftp.no.netfilter.org/pub/netfilter/ulogd/
-PKG_MD5SUM:=f0f8fe1371fa28b5e06cb16aaa0111dd
+PKG_HASH:=a221cb9f77347c0ca00d0937e27c1b90e3291a553cc62a4139b788e2e420e8c0
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
@@ -46,55 +46,55 @@ endef
 
 define Package/ulogd-mod-dbi
   $(call Package/ulogd/Default)
-  DEPENDS:=ulogd +libdbi
+  DEPENDS:=ulogd +PACKAGE_ulogd-mod-dbi:libdbi
   TITLE:=Output plugin for logging to a database using libdbi
 endef
 
 define Package/ulogd-mod-json
   $(call Package/ulogd/Default)
-  DEPENDS:=ulogd +jansson
+  DEPENDS:=ulogd +PACKAGE_ulogd-mod-json:jansson
   TITLE:=JSON output plugin
 endef
 
 define Package/ulogd-mod-mysql
   $(call Package/ulogd/Default)
-  DEPENDS:=ulogd +libmysqlclient
+  DEPENDS:=ulogd +PACKAGE_ulogd-mod-mysql:libmysqlclient
   TITLE:=Output plugin for logging to a MySQL database
 endef
 
 define Package/ulogd-mod-nfacct
   $(call Package/ulogd/Default)
-  DEPENDS:=ulogd +libnetfilter-acct
+  DEPENDS:=ulogd +PACKAGE_ulogd-mod-nfacct:libnetfilter-acct
   TITLE:=Input plugin for flow-based logging (accounting)
 endef
 
 define Package/ulogd-mod-nfct
   $(call Package/ulogd/Default)
-  DEPENDS:=ulogd +libnetfilter-conntrack
+  DEPENDS:=ulogd +PACKAGE_ulogd-mod-nfct:libnetfilter-conntrack
   TITLE:=Input plugin for flow-based logging (conntracking)
 endef
 
 define Package/ulogd-mod-nflog
   $(call Package/ulogd/Default)
-  DEPENDS:=ulogd +libnetfilter-log
+  DEPENDS:=ulogd +PACKAGE_ulogd-mod-nflog:libnetfilter-log
   TITLE:=Input plugin using NFLOG
 endef
 
 define Package/ulogd-mod-pcap
   $(call Package/ulogd/Default)
-  DEPENDS:=ulogd +libpcap
+  DEPENDS:=ulogd +PACKAGE_ulogd-mod-pcap:libpcap
   TITLE:=Output plugin for logging in pcap format
 endef
 
 define Package/ulogd-mod-pgsql
   $(call Package/ulogd/Default)
-  DEPENDS:=ulogd +libpq
+  DEPENDS:=ulogd +PACKAGE_ulogd-mod-pgsql:libpq
   TITLE:=Output plugin for logging to a PostgreSQL database
 endef
 
 define Package/ulogd-mod-sqlite
   $(call Package/ulogd/Default)
-  DEPENDS:=ulogd +libsqlite3
+  DEPENDS:=ulogd +PACKAGE_ulogd-mod-sqlite:libsqlite3
   TITLE:=Output plugin for logging to an SQLite database
 endef
 
@@ -106,7 +106,7 @@ endef
 
 define Package/ulogd-mod-xml
   $(call Package/ulogd/Default)
-  DEPENDS:=ulogd +libnetfilter-acct +libnetfilter-conntrack +libnetfilter-log
+  DEPENDS:=ulogd +PACKAGE_ulogd-mod-xml:libnetfilter-acct +PACKAGE_ulogd-mod-xml:libnetfilter-conntrack +PACKAGE_ulogd-mod-xml:libnetfilter-log
   TITLE:=XML output plugin
 endef
 
diff --git a/net/ulogd/patches/101-ulogd-use-strncpy-instead-of-memcpy.patch b/net/ulogd/patches/101-ulogd-use-strncpy-instead-of-memcpy.patch
new file mode 100644 (file)
index 0000000..3671a95
--- /dev/null
@@ -0,0 +1,31 @@
+From e0c75c9d20b76ff3d496a776ce43341c752914c3 Mon Sep 17 00:00:00 2001
+From: Eric Leblond <eric@regit.org>
+Date: Tue, 21 Mar 2017 21:49:46 +0100
+Subject: [PATCH] ulogd: use strncpy instead of memcpy
+
+On some architecture, ulogd is not starting due to a
+crash in memcpy. This patch switches to strncpy to
+avoid the problem.
+
+Reported-by: Alexandru Ardelean <ardeleanalex@gmail.com>
+Signed-off-by: Eric Leblond <eric@regit.org>
+---
+ src/ulogd.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ulogd.c b/src/ulogd.c
+index 5b9a586..919a317 100644
+--- a/src/ulogd.c
++++ b/src/ulogd.c
+@@ -668,7 +668,7 @@ pluginstance_alloc_init(struct ulogd_plugin *pl, char *pi_id,
+       INIT_LLIST_HEAD(&pi->plist);
+       pi->plugin = pl;
+       pi->stack = stack;
+-      memcpy(pi->id, pi_id, sizeof(pi->id));
++      strncpy(pi->id, pi_id, ULOGD_MAX_KEYLEN);
+       ptr = (void *)pi + sizeof(*pi);
+-- 
+2.7.4
+
index 1dc5dc2af9c73dcf1ca216f3ba9d6576a9035955..a7ba1c5ae933703c25b4c2de7fa658d38220fe2f 100644 (file)
@@ -13,7 +13,6 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/umurmur/umurmur.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=fac630135664fda26338d403041b6b6e558a2d6b
-PKG_MIRROR_MD5SUM:=0e031baa5cebcdb4eb39a0cde572014f
 PKG_MIRROR_HASH:=6773aebea9aea355a41425e946291bb47bc399f85483bd6532cf26dfc7c801e5
 
 PKG_INSTALL:=1
index d8db017a4b365517447a8248ec7300a5f5f5dab9..3e59c4c6e46185a5918f36b444645dd9432cb5aa 100644 (file)
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=unbound
-PKG_VERSION:=1.6.1
-PKG_RELEASE:=6
+PKG_VERSION:=1.7.0
+PKG_RELEASE:=2
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
@@ -17,9 +17,8 @@ PKG_MAINTAINER:=Eric Luehrsen <ericluehrsen@hotmail.com>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.unbound.net/downloads
-PKG_HASH:=42df63f743c0fe8424aeafcf003ad4b880b46c14149d696057313f5c1ef51400
+PKG_HASH:=94dd9071fb13d8ccd122a3ac67c4524a3324d0e771fc7a8a7c49af8abfb926a2
 
-PKG_BUILD_DEPENDS:=libexpat
 PKG_BUILD_PARALLEL:=1
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
@@ -153,10 +152,11 @@ define Package/unbound/install
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN)  ./files/unbound.init $(1)/etc/init.d/unbound
        $(INSTALL_DIR) $(1)/usr/lib/unbound
-       $(INSTALL_BIN)  ./files/odhcpd.sh $(1)/usr/lib/unbound/odhcpd.sh
-       $(INSTALL_DATA) ./files/odhcpd.awk $(1)/usr/lib/unbound/odhcpd.awk
+       $(INSTALL_DATA) ./files/defaults.sh $(1)/usr/lib/unbound/defaults.sh
        $(INSTALL_DATA) ./files/dnsmasq.sh $(1)/usr/lib/unbound/dnsmasq.sh
        $(INSTALL_DATA) ./files/iptools.sh $(1)/usr/lib/unbound/iptools.sh
+       $(INSTALL_BIN)  ./files/odhcpd.sh $(1)/usr/lib/unbound/odhcpd.sh
+       $(INSTALL_DATA) ./files/odhcpd.awk $(1)/usr/lib/unbound/odhcpd.awk
        $(INSTALL_DATA) ./files/rootzone.sh $(1)/usr/lib/unbound/rootzone.sh
        $(INSTALL_DATA) ./files/unbound.sh $(1)/usr/lib/unbound/unbound.sh
 endef
index d8bdf958fbc1ef31fcadeb16dac1907981f839c3..c4bf1b210f68e3504746eea46bf7c1ff53379e0d 100644 (file)
@@ -6,16 +6,16 @@
 ## Package Overview
 Unbound may be useful on consumer grade embedded hardware. It is _intended_ to be a recursive resolver only. [NLnet Labs NSD](https://www.nlnetlabs.nl/projects/nsd/) is _intended_ for the authoritative task. This is different than [ISC Bind](https://www.isc.org/downloads/bind/) and its inclusive functions. Unbound configuration effort and memory consumption may be easier to control. A consumer could have their own recursive resolver with 8/64 MB router, and remove potential issues from forwarding resolvers outside of their control.
 
-This package builds on Unbounds capabilities with OpenWrt UCI. Not every Unbound option is in UCI, but rather, UCI simplifies the combination of related options. Unbounds native options are bundled and balanced within a smaller set of choices. Options include resources, DNSSEC, access control, and some TTL tweaking. The UCI also provides an escape option and work at the raw "unbound.conf" level.
+This package builds on Unbounds capabilities with OpenWrt UCI. Not every Unbound option is in UCI, but rather, UCI simplifies the combination of related options. Unbounds native options are bundled and balanced within a smaller set of choices. Options include resources, DNSSEC, access control, and some TTL tweaking. The UCI also provides an escape option and works at the raw "unbound.conf" level.
 
-## HOW TO Adblocking
+## HOW TO Ad Blocking
 The UCI scripts will work with [net/adblock 2.3+](https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md), if it is installed and enabled. Its all detected and integrated automatically. In brief, the adblock scripts create distinct local-zone files that are simply included in the unbound conf file during UCI generation. If you don't want this, then disable adblock or reconfigure adblock to not send these files to Unbound.
 
 ## HOW TO Integrate with DHCP
 Some UCI options and scripts help Unbound to work with DHCP servers to load the local DNS. The examples provided here are serial dnsmasq-unbound, parallel dnsmasq-unbound, and unbound scripted with odhcpd.
 
 ### Serial dnsmasq
-In this case, dnsmasq is not changed *much* with respect to the default OpenWRT/LEDE configuration. Here dnsmasq is forced to use the local Unbound instance as the lone upstream DNS server, instead of your ISP. This may be the easiest implementation, but performance degradation can occur in high volume networks. dnsmasq and Unbound effectively have the same information in memory, and all transfers are double handled.
+In this case, dnsmasq is not changed *much* with respect to the default OpenWrt/LEDE configuration. Here dnsmasq is forced to use the local Unbound instance as the lone upstream DNS server, instead of your ISP. This may be the easiest implementation, but performance degradation can occur in high volume networks. dnsmasq and Unbound effectively have the same information in memory, and all transfers are double handled.
 
 **/etc/config/unbound**:
 
@@ -73,9 +73,12 @@ config dhcp 'lan'
 ```
 
 ### Unbound and odhcpd
-You may ask can Unbound replace dnsmasq? You can have DHCP-DNS records with Unbound and odhcpd only. The UCI scripts will allow Unbound to act like dnsmasq. When odhcpd configures each DHCP lease, it will call a script. The script provided with Unbound will read the lease file for DHCP-DNS records. You **must install** `unbound-control`, because the lease records are added and removed without starting, stopping, flushing cache, or re-writing conf files. (_restart overhead can be excessive with even a few mobile devices._)
-
-Don't forget to disable or uninstall dnsmasq when you don't intend to use it. Strange results may occur. If you want to use default dnsmasq+odhcpd and add Unbound on top, then use the dnsmasq-serial or dnsmasq-parallel methods above.
+You may ask, "can Unbound replace dnsmasq?" You can have DHCP-DNS records with Unbound and odhcpd only. The UCI scripts will allow Unbound to act like dnsmasq. When odhcpd configures each DHCP lease, it will call a script. The script provided with Unbound will read the lease file for DHCP-DNS records. The unbound-control application is required, because simply rewriting conf-files and restarting unbound is too much overhead.
+- Default OpenWrt has dnsmasq+odhcpd with `odhcpd-ipv6only` limited to DHCPv6.
+- If you use dnsmasq+odhcpd together, then use dnsmasq serial or parallel methods above.
+- You must install package `odhcpd` (full) to use odhcpd alone.
+- You must install package `unbound-control` to load and unload leases.
+- Remember to uninstall (or disable) dnsmasq when you won't use it.
 
 **/etc/config/unbound**:
 
@@ -106,8 +109,7 @@ config dhcp 'lan'
   option leasetime '12h'
   option ra 'server'
   option ra_management '1'
-  # issue your ULA and avoid default [fe80::]
-  list dns 'fdxx:xxxx:xxxx::1'
+  # odhcpd should issue ULA [fd00::/8] by default
   ...
 
 config odhcpd 'odhcpd'
@@ -146,6 +148,14 @@ The former will be added to the end of the `server:` clause. The later will be a
 config unbound
   Currently only one instance is supported.
 
+  option add_extra_dns '0'
+    Level. Execute traditional DNS overrides found in `/etc/config/dhcp`.
+    Optional so you may use other Unbound conf or redirect to NSD instance.
+    0 - Ignore `/etc/config/dhcp`
+    1 - Use only 'domain' clause (host records)
+    2 - Use 'domain', 'mxhost', and 'srvhost' clauses
+    3 - Use all of 'domain', 'mxhost', 'srvhost', and 'cname' clauses
+
   option add_local_fqdn '0'
     Level. This puts your routers host name in the LAN (local) DNS.
     Each level is more detailed and comprehensive.
@@ -193,6 +203,13 @@ config unbound
     Bytes. Extended DNS is necessary for DNSSEC. However, it can run
     into MTU issues. Use this size in bytes to manage drop outs.
 
+  option extended_luci '0'
+    Boolean. Extends a tab hierarchy in LuCI for advanced congfiguration.
+
+  option extended_stats '0'
+    Boolean. extended statistics are printed from unbound-control.
+    Keeping track of more statistics takes time.
+
   option hide_binddata '1'
     Boolean. If enabled version.server, version.bind, id.server, and
     hostname.bind queries are refused.
@@ -231,9 +248,13 @@ config unbound
     also can be used to for bad purposes.
 
   option rebind_protection '1'
-    Boolean. Prevent RFC 1918 Reponses from global DNS. Example a
-    poisoned reponse within "192.168.0.0/24" could be used to turn a
-    local browser into an external attack proxy server.
+    Level. Block your local address responses from global DNS. A poisoned
+    reponse within "192.168.0.0/24" or "fd00::/8" could turn a local browser
+    into an external attack proxy server. IP6 GLA may be vulnerable also.
+    0 - Off
+    1 - Only RFC 1918 and 4193 responses blocked
+    2 - Plus GLA /64 on designated interface(s)
+    3 - Plus DHCP-PD range passed down interfaces (not implemented)
 
   option recursion 'passive'
     Unbound has numerous options for how it recurses. This UCI combines
@@ -259,8 +280,12 @@ config unbound
     Typical to configure maybe 0~300, but 1800 is the maximum accepted.
 
   option unbound_control '0'
-    Boolean. Enables unbound-control application access ports. Enabling
-    this without the unbound-control package installed is robust.
+    Level. Enables unbound-control application access ports.
+    0 - No unbound-control Access, or add your own in 'unbound_ext.conf'
+    1 - Unencrypted Local Host Access
+    2 - SSL Local Host Access; auto unbound-control-setup if available
+    3 - SSL Network Access; auto unbound-control-setup if available
+    4 - SSL Network Access; static key/pem files must already exist
 
   option validator '0'
     Boolean. Enable DNSSEC. Unbound names this the "validator" module.
@@ -271,9 +296,24 @@ config unbound
     embedded devices don't have a real time power off clock. NTP needs
     DNS to resolve servers. This works around the chicken-and-egg.
 
-  list domain_insecure
-    List. Domains or pointers that you wish to skip DNSSEC. Your DHCP
-    domains and pointers in dnsmasq will get this automatically.
+  list domain_forward 'mail.my-isp.com'
+    Domain. Do not recurse, but rather forward the domains to given DNS
+    servers found in resolve.conf.auto from WAN DHCP client. This may
+    provide better access to mirror servers in 'your neigborhood.' This
+    may be useful in keeping local organization lookups on local subnets.
+
+  list domain_insecure 'ntp.somewhere.org'
+    Domain. Domains that you wish to skip DNSSEC. It is one way around NTP
+    chicken and egg. Your DHCP servered domains are automatically included.
+
+  list rebind_interface 'lan'
+    Interface (logical). Works with 'rebind_protection' options 2 and 3.
+
+  list trigger_interface 'lan' 'wan'
+    Interface (logical). This option is a work around for netifd/procd
+    interaction with WAN DHCPv6. Minor RA or DHCP changes in IP6 can
+    cause netifd to execute procd interface reload. Limit Unbound procd
+    triggers to LAN and WAN (IP4 only) to prevent restart @2-3 minutes.
 ```
 
 
diff --git a/net/unbound/files/defaults.sh b/net/unbound/files/defaults.sh
new file mode 100644 (file)
index 0000000..e362b95
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/sh
+##############################################################################
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# 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.
+#
+# Copyright (C) 2016 Eric Luehrsen
+#
+##############################################################################
+
+UNBOUND_LIBDIR=/usr/lib/unbound
+UNBOUND_VARDIR=/var/lib/unbound
+
+UNBOUND_PIDFILE=/var/run/unbound.pid
+
+UNBOUND_SRV_CONF=$UNBOUND_VARDIR/unbound_srv.conf
+UNBOUND_EXT_CONF=$UNBOUND_VARDIR/unbound_ext.conf
+UNBOUND_DHCP_CONF=$UNBOUND_VARDIR/unbound_dhcp.conf
+UNBOUND_CONFFILE=$UNBOUND_VARDIR/unbound.conf
+
+UNBOUND_KEYFILE=$UNBOUND_VARDIR/root.key
+UNBOUND_HINTFILE=$UNBOUND_VARDIR/root.hints
+UNBOUND_TIMEFILE=$UNBOUND_VARDIR/hotplug.time
+
+UNBOUND_CTLKEY_FILE=$UNBOUND_VARDIR/unbound_control.key
+UNBOUND_CTLPEM_FILE=$UNBOUND_VARDIR/unbound_control.pem
+UNBOUND_SRVKEY_FILE=$UNBOUND_VARDIR/unbound_server.key
+UNBOUND_SRVPEM_FILE=$UNBOUND_VARDIR/unbound_server.pem
+
+##############################################################################
+
+UNBOUND_ANCHOR=/usr/sbin/unbound-anchor
+UNBOUND_CONTROL=/usr/sbin/unbound-control
+UNBOUND_CONTROL_CFG="$UNBOUND_CONTROL -c $UNBOUND_CONFFILE"
+
+##############################################################################
+
index 079208613eb280fa634db853d6f741ee857fece5..32e5f235592383b1fa616e8a7f1b3d864bb18d8c 100644 (file)
@@ -37,8 +37,7 @@ dnsmasq_local_zone() {
     UNBOUND_D_WAN_FQDN=$wan_fqdn
   fi
 
-
-  if [ -n "$fwd_domain" -a -n "$fwd_port" -a ! "$fwd_port" -eq 53 ] ; then
+  if [ -n "$fwd_domain" -a -n "$fwd_port" -a ! "${fwd_port:-53}" -eq 53 ] ; then
     # dnsmasq localhost listening ports (possible multiple instances)
     UNBOUND_N_FWD_PORTS="$UNBOUND_N_FWD_PORTS $fwd_port"
     UNBOUND_TXT_FWD_ZONE="$UNBOUND_TXT_FWD_ZONE $fwd_domain"
index 160950884e39e077946e1cdd0f61abc552b9f8e1..363f413de327f8f3ed850adec89465c68a560592 100644 (file)
@@ -68,7 +68,7 @@
       if ( bconf == 1 ) {
         x = ( "local-data: \"" fqdn ". 120 IN A " adr "\"" ) ;
         y = ( "local-data-ptr: \"" adr " 120 " fqdn "\"" ) ;
-        print ( x "\n" y ) > hostfile ;
+        print ( x "\n" y "\n" ) > hostfile ;
       }
 
       else {
 
 
         while ( ( cmd | getline adr ) > 0 ) {
-          if (( substr( adr, 1, 5 ) <= "fd00:" ) \
+          if (( substr( adr, 1, 5 ) <= "fdff:" ) \
+          && ( index( adr, "anycast" ) == 0 ) \
           && ( index( adr, "via" ) == 0 )) {
             # GA or ULA routed addresses only (not LL or MC)
             sub( /\/.*/, "", adr ) ;
             adr = ( adr slaac ) ;
-            
-            
-            if ( split( adr, tmp0, ":" ) >= 8 ) { 
-              sub( "::", ":", adr ) ; 
+
+
+            if ( split( adr, tmp0, ":" ) > 8 ) {
+              sub( "::", ":", adr ) ;
             }
 
 
             if ( bconf == 1 ) {
               x = ( "local-data: \"" fqdn ". 120 IN AAAA " adr "\"" ) ;
               y = ( "local-data-ptr: \"" adr " 120 " fqdn "\"" ) ;
-              print ( x "\n" y ) > hostfile ;
+              print ( x "\n" y "\n" ) > hostfile ;
             }
 
             else {
       if ( bconf == 1 ) {
         x = ( "local-data: \"" fqdn ". 120 IN AAAA " adr "\"" ) ;
         y = ( "local-data-ptr: \"" adr " 120 " fqdn "\"" ) ;
-        print ( x "\n" y ) > hostfile ;
+        print ( x "\n" y "\n" ) > hostfile ;
       }
 
       else {
         print ( x "\n" y ) > hostfile ;
       }
     }
-    
+
     if (( cdr2 == 128 ) && ( hst != "-" )) {
       if ( bconf == 1 ) {
         x = ( "local-data: \"" fqdn ". 120 IN AAAA " adr2 "\"" ) ;
         y = ( "local-data-ptr: \"" adr2 " 120 " fqdn "\"" ) ;
-        print ( x "\n" y ) > hostfile ;
+        print ( x "\n" y "\n" ) > hostfile ;
       }
 
       else {
index 22a470b4cd6f2c970c42d2d3a09a95f82690c337..9c01dc6f6eee066c765b25db4cb2c0e5a41ed1e0 100644 (file)
 #
 ##############################################################################
 
-# Common file location definitions
-. /usr/lib/unbound/unbound.sh
-
-##############################################################################
-
-odhcpd_settings() {
-  # This trigger is out of normal init context, so we need to read some UCI.
-  local cfg="$1"
-  config_get UNBOUND_D_DHCP_LINK  "$cfg" dhcp_link none
-  config_get_bool UNBOUND_B_SLAAC6_MAC "$cfg" dhcp4_slaac6 0
-  config_get UNBOUND_TXT_DOMAIN "$cfg" domain lan
-}
+. /lib/functions.sh
+. /usr/lib/unbound/defaults.sh
 
 ##############################################################################
 
 odhcpd_zonedata() {
+  local longconf dateconf
   local dns_ls_add=$UNBOUND_VARDIR/dhcp_dns.add
   local dns_ls_del=$UNBOUND_VARDIR/dhcp_dns.del
   local dhcp_ls_new=$UNBOUND_VARDIR/dhcp_lease.new
   local dhcp_ls_old=$UNBOUND_VARDIR/dhcp_lease.old
   local dhcp_ls_add=$UNBOUND_VARDIR/dhcp_lease.add
   local dhcp_ls_del=$UNBOUND_VARDIR/dhcp_lease.del
-  local dhcp_origin=$( uci get dhcp.@odhcpd[0].leasefile )
 
-  config_load unbound
-  config_foreach odhcpd_settings unbound
+  local dhcp_link=$( uci_get unbound.@unbound[0].dhcp_link )
+  local dhcp4_slaac6=$( uci_get unbound.@unbound[0].dhcp4_slaac6 )
+  local dhcp_domain=$( uci_get unbound.@unbound[0].domain )
+  local dhcp_origin=$( uci_get dhcp.@odhcpd[0].leasefile )
 
 
-  if [ "$UNBOUND_D_DHCP_LINK" = "odhcpd" -a -f "$dhcp_origin" ] ; then
+  if [ "$dhcp_link" = "odhcpd" -a -f "$dhcp_origin" ] ; then
     # Capture the lease file which could be changing often
-    cat $dhcp_origin | sort > $dhcp_ls_new
-    touch $dhcp_ls_old
-    sort $dhcp_ls_new $dhcp_ls_old $dhcp_ls_old | uniq -u > $dhcp_ls_add
-    sort $dhcp_ls_old $dhcp_ls_new $dhcp_ls_new | uniq -u > $dhcp_ls_del
-
-    # Go through the messy business of coding up A, AAAA, and PTR records
-    # This static conf will be available if Unbound restarts asynchronously
-    awk -v hostfile=$UNBOUND_DHCP_CONF -v domain=$UNBOUND_TXT_DOMAIN \
-        -v bslaac=$UNBOUND_B_SLAAC6_MAC -v bisolt=0 -v bconf=1 \
-        -f /usr/lib/unbound/odhcpd.awk $dhcp_ls_new
-
-    # Deleting and adding all records into Unbound can be a burden in a
-    # high density environment. Use unbound-control incrementally.
-    awk -v hostfile=$dns_ls_del -v domain=$UNBOUND_TXT_DOMAIN \
-        -v bslaac=$UNBOUND_B_SLAAC6_MAC -v bisolt=0 -v bconf=0 \
-        -f /usr/lib/unbound/odhcpd.awk $dhcp_ls_del
-
-    awk -v hostfile=$dns_ls_add -v domain=$UNBOUND_TXT_DOMAIN \
-        -v bslaac=$UNBOUND_B_SLAAC6_MAC -v bisolt=0 -v bconf=0 \
-        -f /usr/lib/unbound/odhcpd.awk $dhcp_ls_add
+    sort $dhcp_origin > $dhcp_ls_new
+
+
+    if [ ! -f $UNBOUND_DHCP_CONF -o ! -f $dhcp_ls_old ] ; then
+      longconf=2
+
+    else
+      dateconf=$(( $( date +%s ) - $( date -r $UNBOUND_DHCP_CONF +%s ) ))
+
+
+      if [ $dateconf > 150 ] ; then
+        longconf=1
+      else
+        longconf=0
+      fi
+    fi
+
+
+    if [ $longconf -gt 0 ] ; then
+      # Go through the messy business of coding up A, AAAA, and PTR records
+      # This static conf will be available if Unbound restarts asynchronously
+      awk -v hostfile=$UNBOUND_DHCP_CONF -v domain=$dhcp_domain \
+          -v bslaac=$dhcp4_slaac6 -v bisolt=0 -v bconf=1 \
+          -f /usr/lib/unbound/odhcpd.awk $dhcp_ls_new
+    fi
+
+
+    if [ $longconf -lt 2 ] ; then
+      # Deleting and adding all records into Unbound can be a burden in a
+      # high density environment. Use unbound-control incrementally.
+      sort $dhcp_ls_old $dhcp_ls_new $dhcp_ls_new | uniq -u > $dhcp_ls_del
+      awk -v hostfile=$dns_ls_del -v domain=$dhcp_domain \
+          -v bslaac=$dhcp4_slaac6 -v bisolt=0 -v bconf=0 \
+          -f /usr/lib/unbound/odhcpd.awk $dhcp_ls_del
+
+      sort $dhcp_ls_new $dhcp_ls_old $dhcp_ls_old | uniq -u > $dhcp_ls_add
+      awk -v hostfile=$dns_ls_add -v domain=$dhcp_domain \
+          -v bslaac=$dhcp4_slaac6 -v bisolt=0 -v bconf=0 \
+          -f /usr/lib/unbound/odhcpd.awk $dhcp_ls_add
+
+    else
+      awk -v hostfile=$dns_ls_add -v domain=$dhcp_domain \
+          -v bslaac=$dhcp4_slaac6 -v bisolt=0 -v bconf=0 \
+          -f /usr/lib/unbound/odhcpd.awk $dhcp_ls_new
+    fi
 
 
     if [ -f "$dns_ls_del" ] ; then
index d085fed4eafcc8ff7c3109ef0bfdec65d9b4662a..cc2edf69588ff774dfecaeeae15937a7b9fade69 100644 (file)
 #
 ##############################################################################
 #
-# This component needs to be used within the unbound.sh as an include. It uses
-# defaults and UCI scope variables defined there. It will copy root.key back
-# to /etc/unbound/ periodically, but avoid ROM flash abuse (UCI option).
+# This component will copy root.key back to /etc/unbound/ periodically, but
+# avoid ROM flash abuse (UCI option).
 #
 ##############################################################################
 
-rootzone_uci() {
-  local cfg=$1
-
-  # This will likely be called outside of "start_service()" context
-  config_get_bool UNBOUND_B_DNSSEC "$cfg" validator 0
-  config_get_bool UNBOUND_B_NTP_BOOT "$cfg" validator_ntp 1
-  config_get UNBOUND_N_ROOT_AGE "$cfg" root_age 9
-}
-
-##############################################################################
-
 roothints_update() {
   # TODO: Might not be implemented. Unbound doesn't natively update hints.
   # Unbound philosophy is built in root hints are good for machine life.
@@ -42,12 +30,16 @@ roothints_update() {
 rootkey_update() {
   local basekey_date rootkey_date rootkey_age filestuff
 
+  local dnssec=$( uci_get unbound.@unbound[0].validator )
+  local dnssec_ntp=$( uci_get unbound.@unbound[0].validator_ntp )
+  local dnssec_age=$( uci_get unbound.@unbound[0].root_age )
+
 
-  if [ "$UNBOUND_N_ROOT_AGE" -gt 90 -o "$UNBOUND_B_DNSSEC" -lt 1 ] ; then
+  if [ "$dnssec_age" -gt 90 -o "$dnssec" -lt 1 ] ; then
     # Feature disabled
     return 0
 
-  elif [ "$UNBOUND_B_NTP_BOOT" -gt 0 -a ! -f "$UNBOUND_TIMEFILE" ] ; then
+  elif [ "$dnssec_ntp" -gt 0 -a ! -f "$UNBOUND_TIMEFILE" ] ; then
     # We don't have time yet
     return 0
   fi
@@ -79,7 +71,7 @@ rootkey_update() {
   fi
 
 
-  if [ "$rootkey_age" -gt "$UNBOUND_N_ROOT_AGE" ] ; then
+  if [ "$rootkey_age" -gt "$dnssec_age" ] ; then
     filestuff=$( cat $UNBOUND_KEYFILE )
 
 
@@ -106,11 +98,6 @@ rootkey_update() {
 ##############################################################################
 
 rootzone_update() {
-  # Partial UCI fetch for this functional group
-  config_load unbound
-  config_foreach rootzone_uci unbound
-
-  # You need root.hints and root.key to boot strap recursion
   roothints_update
   rootkey_update
 }
index 1edf9ef80d8804366f5c1323201d0b0010fee26a..ac0dd580653744b878755513b98ee8da6505cdcb 100755 (executable)
@@ -47,7 +47,7 @@ start_service() {
 
 stop_service() {
   unbound_stop
-  
+
   # Wait! on restart Unbound may take time writing closure stats to syslog
   pidof $PROG && sleep 1
 }
@@ -55,9 +55,23 @@ stop_service() {
 ##############################################################################
 
 service_triggers() {
-  # use soft reload to prevent continuous stop-start and cache flush
+  local trigger
+  local legacy=$( uci_get unbound.@unbound[0].trigger )
+  local triggers=$( uci_get unbound.@unbound[0].trigger_interface )
+
+  triggers="$triggers $legacy"
+  PROCD_RELOAD_DELAY=2000
   procd_add_reload_trigger "unbound"
-  procd_add_raw_trigger "interface.*.up" 2000 /etc/init.d/unbound reload
+
+
+  if [ -n "$triggers" ] ; then
+    for trigger in $triggers ; do
+      # due to some netifd/procd interactions with IP6, limit interfaces
+      procd_add_reload_interface_trigger "$trigger"
+    done
+  else
+    procd_add_raw_trigger "interface.*.up" 2000 /etc/init.d/unbound reload
+  fi
 }
 
 ##############################################################################
index 4daefda4d1138c49f6b12742e22fd8ecf32be036..4b472ec3416dd1fe8cf8d0faeb5cefe40d4c7ded 100644 (file)
 #
 ##############################################################################
 #
-# This builds the basic UCI components currently supported for Unbound. It is
-# intentionally NOT comprehensive and bundles a lot of options. The UCI is to
-# be a simpler presentation of the total Unbound conf set.
+# Unbound is a full featured recursive server with many options. The UCI
+# provided tries to simplify and bundle options. This should make Unbound
+# easier to deploy. Even light duty routers may resolve recursively instead of
+# depending on a stub with the ISP. The UCI also attempts to replicate dnsmasq
+# features as used in base LEDE/OpenWrt. If there is a desire for more
+# detailed tuning, then manual conf file overrides are also made available.
 #
 ##############################################################################
 
-UNBOUND_B_CONTROL=0
 UNBOUND_B_SLAAC6_MAC=0
 UNBOUND_B_DNSSEC=0
 UNBOUND_B_DNS64=0
+UNBOUND_B_EXT_STATS=0
 UNBOUND_B_GATE_NAME=0
 UNBOUND_B_HIDE_BIND=1
 UNBOUND_B_LOCL_BLCK=0
 UNBOUND_B_LOCL_SERV=1
 UNBOUND_B_MAN_CONF=0
 UNBOUND_B_NTP_BOOT=1
-UNBOUND_B_PRIV_BLCK=1
 UNBOUND_B_QUERY_MIN=0
 UNBOUND_B_QRY_MINST=0
 
+UNBOUND_D_CONTROL=0
 UNBOUND_D_DOMAIN_TYPE=static
 UNBOUND_D_DHCP_LINK=none
+UNBOUND_D_EXTRA_DNS=0
 UNBOUND_D_LAN_FQDN=0
+UNBOUND_D_PRIV_BLCK=1
 UNBOUND_D_PROTOCOL=mixed
 UNBOUND_D_RESOURCE=small
 UNBOUND_D_RECURSION=passive
@@ -55,36 +60,24 @@ UNBOUND_TXT_DOMAIN=lan
 UNBOUND_TXT_FWD_ZONE=""
 UNBOUND_TXT_HOSTNAME=thisrouter
 
-##############################################################################
-
-UNBOUND_LIBDIR=/usr/lib/unbound
-UNBOUND_VARDIR=/var/lib/unbound
-
-UNBOUND_PIDFILE=/var/run/unbound.pid
-
-UNBOUND_SRV_CONF=$UNBOUND_VARDIR/unbound_srv.conf
-UNBOUND_EXT_CONF=$UNBOUND_VARDIR/unbound_ext.conf
-UNBOUND_DHCP_CONF=$UNBOUND_VARDIR/unbound_dhcp.conf
-UNBOUND_CONFFILE=$UNBOUND_VARDIR/unbound.conf
-
-UNBOUND_KEYFILE=$UNBOUND_VARDIR/root.key
-UNBOUND_HINTFILE=$UNBOUND_VARDIR/root.hints
-UNBOUND_TIMEFILE=$UNBOUND_VARDIR/unbound.time
+UNBOUND_LIST_FORWARD=""
+UNBOUND_LIST_INSECURE=""
+UNBOUND_LIST_PRV_SUBNET=""
 
 ##############################################################################
 
-UNBOUND_ANCHOR=/usr/sbin/unbound-anchor
-UNBOUND_CONTROL=/usr/sbin/unbound-control
-UNBOUND_CONTROL_CFG="$UNBOUND_CONTROL -c $UNBOUND_CONFFILE"
+# keep track of local-domain: assignments during inserted resource records
+UNBOUND_LIST_DOMAINS=""
 
 ##############################################################################
 
 . /lib/functions.sh
 . /lib/functions/network.sh
 
-. $UNBOUND_LIBDIR/dnsmasq.sh
-. $UNBOUND_LIBDIR/iptools.sh
-. $UNBOUND_LIBDIR/rootzone.sh
+. /usr/lib/unbound/defaults.sh
+. /usr/lib/unbound/dnsmasq.sh
+. /usr/lib/unbound/iptools.sh
+. /usr/lib/unbound/rootzone.sh
 
 ##############################################################################
 
@@ -124,8 +117,8 @@ create_interface_dns() {
 
   ifdashname="${ifname//./-}"
   ipcommand="ip -o address show $ifname"
-  addresses="$($ipcommand | awk '/inet/{sub(/\/.*/,"",$4); print $4}')"
-  ulaprefix="$(uci_get network @globals[0] ula_prefix)"
+  addresses=$( $ipcommand | awk '/inet/{sub(/\/.*/,"",$4); print $4}' )
+  ulaprefix=$( uci_get network.@globals[0].ula_prefix )
   host_fqdn="$UNBOUND_TXT_HOSTNAME.$UNBOUND_TXT_DOMAIN"
   if_fqdn="$ifdashname.$host_fqdn"
 
@@ -223,6 +216,135 @@ create_interface_dns() {
 
 ##############################################################################
 
+create_local_zone() {
+  local target="$1"
+  local partial domain found
+
+
+  if [ -n "$UNBOUND_LIST_DOMAINS" ] ; then
+    for domain in $UNBOUND_LIST_DOMAINS ; do
+      case $target in
+      *"${domain}")
+        found=1
+        break
+        ;;
+
+      [A-Za-z0-9]*.[A-Za-z0-9]*)
+        found=0
+        ;;
+
+      *) # no dots
+        found=1
+        break
+        ;;
+      esac
+    done
+  else
+    found=0
+  fi
+
+
+  if [ $found -eq 0 ] ; then
+    # New Zone! Bundle local-zones: by first two name tiers "abcd.tld."
+    partial=$( echo "$target" | awk -F. '{ j=NF ; i=j-1; print $i"."$j }' )
+    UNBOUND_LIST_DOMAINS="$UNBOUND_LIST_DOMAINS $partial"
+    echo "  local-zone: $partial. transparent" >> $UNBOUND_CONFFILE
+  fi
+}
+
+##############################################################################
+
+create_host_record() {
+  local cfg="$1"
+  local ip name
+
+  # basefiles dhcp "domain" clause which means host A, AAAA, and PRT record
+  config_get ip   "$cfg" ip
+  config_get name "$cfg" name
+
+
+  if [ -n "$name" -a -n "$ip" ] ; then
+    create_local_zone "$name"
+
+    {
+      case $ip in
+      fe80:*|169.254.*)
+        echo "  # note link address $ip for host $name"
+        ;;
+
+      [1-9a-f]*:*[0-9a-f])
+        echo "  local-data: \"$name. 120 IN AAAA $ip\""
+        echo "  local-data-ptr: \"$ip 120 $name\""
+        ;;
+
+      [1-9]*.*[0-9])
+        echo "  local-data: \"$name. 120 IN A $ip\""
+        echo "  local-data-ptr: \"$ip 120 $name\""
+        ;;
+      esac
+    } >> $UNBOUND_CONFFILE
+  fi
+}
+
+##############################################################################
+
+create_mx_record() {
+  local cfg="$1"
+  local domain relay pref
+
+  # Insert a static MX record
+  config_get domain "$cfg" domain
+  config_get relay  "$cfg" relay
+  config_get pref   "$cfg" pref 10
+
+
+  if [ -n "$domain" -a -n "$relay" ] ; then
+    create_local_zone "$domain"
+    echo "  local-data: \"$domain. 120 IN MX $pref $relay.\"" \
+          >> $UNBOUND_CONFFILE
+  fi
+}
+
+##############################################################################
+
+create_srv_record() {
+  local cfg="$1"
+  local srv target port class weight
+
+  # Insert a static SRV record such as SIP server
+  config_get srv    "$cfg" srv
+  config_get target "$cfg" target
+  config_get port   "$cfg" port
+  config_get class  "$cfg" class 10
+  config_get weight "$cfg" weight 10
+
+
+  if [ -n "$srv" -a -n "$target" -a -n "$port" ] ; then
+    create_local_zone "$srv"
+    echo "  local-data: \"$srv. 120 IN SRV $class $weight $port $target.\"" \
+          >> $UNBOUND_CONFFILE
+  fi
+}
+
+##############################################################################
+
+create_cname_record() {
+  local cfg="$1"
+  local cname target
+
+  # Insert static CNAME record
+  config_get cname  "$cfg" cname
+  config_get target "$cfg" target
+
+
+  if [ -n "$cname" -a -n "$target" ] ; then
+    create_local_zone "$cname"
+    echo "  local-data: \"$cname. 120 IN CNAME $target.\"" >> $UNBOUND_CONFFILE
+  fi
+}
+
+##############################################################################
+
 create_access_control() {
   local cfg="$1"
   local subnets subnets4 subnets6
@@ -249,37 +371,46 @@ create_access_control() {
 
 ##############################################################################
 
-create_domain_insecure() {
-  echo "  domain-insecure: \"$1\"" >> $UNBOUND_CONFFILE
+bundle_domain_forward() {
+  UNBOUND_LIST_FORWARD="$UNBOUND_LIST_FORWARD $1"
 }
 
 ##############################################################################
 
-unbound_mkdir() {
-  local resolvsym=0
-  local dhcp_origin=$( uci get dhcp.@odhcpd[0].leasefile )
-  local dhcp_dir=$( dirname "$dhcp_origin" )
-  local filestuff
+bundle_domain_insecure() {
+  UNBOUND_LIST_INSECURE="$UNBOUND_LIST_INSECURE $1"
+}
 
+##############################################################################
 
-  if [ ! -x /usr/sbin/dnsmasq -o ! -x /etc/init.d/dnsmasq ] ; then
-    resolvsym=1
-  else
-    /etc/init.d/dnsmasq enabled || resolvsym=1
-  fi
+bundle_private_interface() {
+  local ipcommand ifsubnet ifsubnets ifname
 
+  network_get_device ifname $1
 
-  if [ "$resolvsym" -gt 0 ] ; then
-    rm -f /tmp/resolv.conf
+  if [ -n "$ifname" ] ; then
+    ipcommand="ip -6 -o address show $ifname"
+    ifsubnets=$( $ipcommand | awk '/inet6/{ print $4 }' )
 
 
-    {
-      # Set resolver file to local but not if /etc/init.d/dnsmasq will do it.
-      echo "nameserver 127.0.0.1"
-      echo "nameserver ::1"
-      echo "search $UNBOUND_TXT_DOMAIN"
-    } > /tmp/resolv.conf
+    if [ -n "$ifsubnets" ] ; then
+      for ifsubnet in $ifsubnets ; do
+        case $ifsubnet in
+        [1-9]*:*[0-9a-f])
+          # Special GLA protection for local block; ULA protected as a catagory
+          UNBOUND_LIST_PRV_SUBNET="$UNBOUND_LIST_PRV_SUBNET $ifsubnet" ;;
+        esac
+      done
+    fi
   fi
+}
+
+##############################################################################
+
+unbound_mkdir() {
+  local dhcp_origin=$( uci_get dhcp.@odhcpd[0].leasefile )
+  local dhcp_dir=$( dirname $dhcp_origin )
+  local filestuff
 
 
   if [ "$UNBOUND_D_DHCP_LINK" = "odhcpd" -a ! -d "$dhcp_dir" ] ; then
@@ -340,17 +471,54 @@ unbound_mkdir() {
 
   # Ensure access and prepare to jail
   chown -R unbound:unbound $UNBOUND_VARDIR
-  chmod 775 $UNBOUND_VARDIR
-  chmod 664 $UNBOUND_VARDIR/*
+  chmod 755 $UNBOUND_VARDIR
+  chmod 644 $UNBOUND_VARDIR/*
+
+
+  if [ -f $UNBOUND_CTLKEY_FILE -o -f $UNBOUND_CTLPEM_FILE \
+    -o -f $UNBOUND_SRVKEY_FILE -o -f $UNBOUND_SRVPEM_FILE ] ; then
+    # Keys (some) exist already; do not create new ones
+    chmod 640 $UNBOUND_CTLKEY_FILE $UNBOUND_CTLPEM_FILE \
+              $UNBOUND_SRVKEY_FILE $UNBOUND_SRVPEM_FILE
+
+  elif [ -x /usr/sbin/unbound-control-setup ] ; then
+    case "$UNBOUND_D_CONTROL" in
+    [2-3])
+      # unbound-control-setup for encrypt opt. 2 and 3, but not 4 "static"
+      /usr/sbin/unbound-control-setup -d $UNBOUND_VARDIR
+
+      chown -R unbound:unbound  $UNBOUND_CTLKEY_FILE $UNBOUND_CTLPEM_FILE \
+                                $UNBOUND_SRVKEY_FILE $UNBOUND_SRVPEM_FILE
+
+      chmod 640 $UNBOUND_CTLKEY_FILE $UNBOUND_CTLPEM_FILE \
+                $UNBOUND_SRVKEY_FILE $UNBOUND_SRVPEM_FILE
+
+      cp -p $UNBOUND_CTLKEY_FILE /etc/unbound/unbound_control.key
+      cp -p $UNBOUND_CTLPEM_FILE /etc/unbound/unbound_control.pem
+      cp -p $UNBOUND_SRVKEY_FILE /etc/unbound/unbound_server.key
+      cp -p $UNBOUND_SRVPEM_FILE /etc/unbound/unbound_server.pem
+      ;;
+    esac
+  fi
 }
 
 ##############################################################################
 
 unbound_control() {
-  if [ "$UNBOUND_B_CONTROL" -gt 0 ] ; then
+  if [ "$UNBOUND_D_CONTROL" -gt 1 ] ; then
+    if [ ! -f $UNBOUND_CTLKEY_FILE -o ! -f $UNBOUND_CTLPEM_FILE \
+      -o ! -f $UNBOUND_SRVKEY_FILE -o ! -f $UNBOUND_SRVPEM_FILE ] ; then
+      # Key files need to be present; if unbound-control-setup was found, then
+      # they might have been made during unbound_makedir() above.
+      UNBOUND_D_CONTROL=0
+    fi
+  fi
+
+
+  case "$UNBOUND_D_CONTROL" in
+  1)
     {
-      # Enable remote control tool, but only at local host for security
-      # You can hand write fancier encrypted access with /etc/..._ext.conf
+      # Local Host Only Unencrypted Remote Control
       echo "remote-control:"
       echo "  control-enable: yes"
       echo "  control-use-cert: no"
@@ -358,7 +526,42 @@ unbound_control() {
       echo "  control-interface: ::1"
       echo
     } >> $UNBOUND_CONFFILE
-  fi
+    ;;
+
+  2)
+    {
+      # Local Host Only Encrypted Remote Control
+      echo "remote-control:"
+      echo "  control-enable: yes"
+      echo "  control-use-cert: yes"
+      echo "  control-interface: 127.0.0.1"
+      echo "  control-interface: ::1"
+      echo "  server-key-file: \"$UNBOUND_SRVKEY_FILE\""
+      echo "  server-cert-file: \"$UNBOUND_SRVPEM_FILE\""
+      echo "  control-key-file: \"$UNBOUND_CTLKEY_FILE\""
+      echo "  control-cert-file: \"$UNBOUND_CTLPEM_FILE\""
+      echo
+    } >> $UNBOUND_CONFFILE
+    ;;
+
+  [3-4])
+    {
+      # Network Encrypted Remote Control
+      # (3) may auto setup and (4) must have static key/pem files
+      # TODO: add UCI list for interfaces to bind
+      echo "remote-control:"
+      echo "  control-enable: yes"
+      echo "  control-use-cert: yes"
+      echo "  control-interface: 0.0.0.0"
+      echo "  control-interface: ::0"
+      echo "  server-key-file: \"$UNBOUND_SRVKEY_FILE\""
+      echo "  server-cert-file: \"$UNBOUND_SRVPEM_FILE\""
+      echo "  control-key-file: \"$UNBOUND_CTLKEY_FILE\""
+      echo "  control-cert-file: \"$UNBOUND_CTLPEM_FILE\""
+      echo
+    } >> $UNBOUND_CONFFILE
+    ;;
+  esac
 
 
   {
@@ -372,19 +575,45 @@ unbound_control() {
 
 ##############################################################################
 
+unbound_forward() {
+  local fdomain fresolver resolvers
+  # Forward selected domains to the upstream (WAN) stub resolver. This may be
+  # faster or local pool addresses to ISP service login page. This may keep
+  # internal organization lookups, well, internal to the organization.
+
+
+  if [ -n "$UNBOUND_LIST_FORWARD" ] ; then
+    resolvers=$( grep nameserver /tmp/resolv.conf.auto | sed "s/nameserver//g" )
+
+
+    if [ -n "$resolvers" ] ; then
+      for fdomain in $UNBOUND_LIST_FORWARD ; do
+        {
+          echo "forward-zone:"
+          echo "  name: \"$fdomain.\""
+          for fresolver in $resolvers ; do
+          echo "  forward-addr: $fresolver"
+          done
+          echo
+        } >> $UNBOUND_CONFFILE
+      done
+    fi
+  fi
+}
+
+##############################################################################
+
 unbound_conf() {
-  local cfg="$1"
-  local rt_mem rt_conn modulestring
+  local rt_mem rt_conn modulestring domain ifsubnet
+
+  # Make fresh conf file
+  echo > $UNBOUND_CONFFILE
 
 
   {
     # Make fresh conf file
     echo "# $UNBOUND_CONFFILE generated by UCI $( date )"
     echo
-  } > $UNBOUND_CONFFILE
-
-
-  {
     # No threading
     echo "server:"
     echo "  username: unbound"
@@ -394,27 +623,33 @@ unbound_conf() {
     echo "  infra-cache-slabs: 1"
     echo "  key-cache-slabs: 1"
     echo
-  } >> $UNBOUND_CONFFILE
-
-
-  {
+    # Interface Wildcard (access contol handled by "option local_service")
+    echo "  interface: 0.0.0.0"
+    echo "  interface: ::0"
+    echo "  outgoing-interface: 0.0.0.0"
+    echo "  outgoing-interface: ::0"
+    echo
     # Logging
     echo "  verbosity: 1"
     echo "  statistics-interval: 0"
     echo "  statistics-cumulative: no"
-    echo "  extended-statistics: no"
-    echo
   } >> $UNBOUND_CONFFILE
 
 
-  {
-    # Interfaces (access contol "option local_service")
-    echo "  interface: 0.0.0.0"
-    echo "  interface: ::0"
-    echo "  outgoing-interface: 0.0.0.0"
-    echo "  outgoing-interface: ::0"
-    echo
-  } >> $UNBOUND_CONFFILE
+  if [ "$UNBOUND_B_EXT_STATS" -gt 0 ] ; then
+    {
+      # Log More
+      echo "  extended-statistics: yes"
+      echo
+    } >> $UNBOUND_CONFFILE
+
+  else
+    {
+      # Log Less
+      echo "  extended-statistics: no"
+      echo
+    } >> $UNBOUND_CONFFILE
+  fi
 
 
   case "$UNBOUND_D_PROTOCOL" in
@@ -631,7 +866,7 @@ unbound_conf() {
   fi
 
 
-  if [ "$UNBOUND_B_PRIV_BLCK" -gt 0 ] ; then
+  if [ "$UNBOUND_D_PRIV_BLCK" -gt 0 ] ; then
     {
       # Remove _upstream_ or global reponses with private addresses.
       # Unbounds own "local zone" and "forward zone" may still use these.
@@ -641,13 +876,24 @@ unbound_conf() {
       echo "  private-address: 169.254.0.0/16"
       echo "  private-address: 172.16.0.0/12"
       echo "  private-address: 192.168.0.0/16"
-      echo "  private-address: fc00::/8"
-      echo "  private-address: fd00::/8"
+      echo "  private-address: fc00::/7"
       echo "  private-address: fe80::/10"
+      echo
     } >> $UNBOUND_CONFFILE
   fi
 
 
+  if  [ -n "$UNBOUND_LIST_PRV_SUBNET" -a "$UNBOUND_D_PRIV_BLCK" -gt 1 ] ; then
+    for ifsubnet in $UNBOUND_LIST_PRV_SUBNET ; do
+      # Remove global DNS responses with your local network IP6 GLA
+      echo "  private-address: $ifsubnet" >> $UNBOUND_CONFFILE
+    done
+
+
+    echo >> $UNBOUND_CONFFILE
+  fi
+
+
   if [ "$UNBOUND_B_LOCL_BLCK" -gt 0 ] ; then
     {
       # Remove DNS reponses from upstream with loopback IP
@@ -656,15 +902,18 @@ unbound_conf() {
       echo "  private-address: ::1/128"
       echo
     } >> $UNBOUND_CONFFILE
-
-  else
-    echo >> $UNBOUND_CONFFILE
   fi
 
 
-  # Except and accept domains as insecure (DNSSEC); work around broken domains
-  config_list_foreach "$cfg" "domain_insecure" create_domain_insecure
-  echo >> $UNBOUND_CONFFILE
+  if  [ -n "$UNBOUND_LIST_INSECURE" ] ; then
+    for domain in $UNBOUND_LIST_INSECURE ; do
+      # Except and accept domains without (DNSSEC); work around broken domains
+      echo "  domain-insecure: \"$domain\"" >> $UNBOUND_CONFFILE
+    done
+
+
+    echo >> $UNBOUND_CONFFILE
+  fi
 }
 
 ##############################################################################
@@ -780,23 +1029,46 @@ unbound_hostname() {
 
 ##############################################################################
 
+unbound_records() {
+  if [ "$UNBOUND_D_EXTRA_DNS" -gt 0 ] ; then
+    # Parasite from the uci.dhcp.domain clauses
+    config_load dhcp
+    config_foreach create_host_record domain
+  fi
+
+
+  if [ "$UNBOUND_D_EXTRA_DNS" -gt 1 ] ; then
+    config_foreach create_srv_record srvhost
+    config_foreach create_mx_record mxhost
+  fi
+
+
+  if [ "$UNBOUND_D_EXTRA_DNS" -gt 2 ] ; then
+    config_foreach create_cname_record cname
+  fi
+
+
+  echo >> $UNBOUND_CONFFILE
+}
+
+##############################################################################
+
 unbound_uci() {
   local cfg="$1"
   local dnsmasqpath hostnm
 
-  hostnm="$(uci_get system.@system[0].hostname | awk '{print tolower($0)}')"
+  hostnm=$( uci_get system.@system[0].hostname | awk '{print tolower($0)}' )
   UNBOUND_TXT_HOSTNAME=${hostnm:-thisrouter}
 
   config_get_bool UNBOUND_B_SLAAC6_MAC "$cfg" dhcp4_slaac6 0
   config_get_bool UNBOUND_B_DNS64      "$cfg" dns64 0
+  config_get_bool UNBOUND_B_EXT_STATS  "$cfg" extended_stats 0
   config_get_bool UNBOUND_B_HIDE_BIND  "$cfg" hide_binddata 1
   config_get_bool UNBOUND_B_LOCL_SERV  "$cfg" localservice 1
   config_get_bool UNBOUND_B_MAN_CONF   "$cfg" manual_conf 0
   config_get_bool UNBOUND_B_QUERY_MIN  "$cfg" query_minimize 0
   config_get_bool UNBOUND_B_QRY_MINST  "$cfg" query_min_strict 0
-  config_get_bool UNBOUND_B_PRIV_BLCK  "$cfg" rebind_protection 1
   config_get_bool UNBOUND_B_LOCL_BLCK  "$cfg" rebind_localhost 0
-  config_get_bool UNBOUND_B_CONTROL    "$cfg" unbound_control 0
   config_get_bool UNBOUND_B_DNSSEC     "$cfg" validator 0
   config_get_bool UNBOUND_B_NTP_BOOT   "$cfg" validator_ntp 1
 
@@ -806,9 +1078,12 @@ unbound_uci() {
   config_get UNBOUND_N_RX_PORT   "$cfg" listen_port 53
   config_get UNBOUND_N_ROOT_AGE  "$cfg" root_age 9
 
+  config_get UNBOUND_D_CONTROL     "$cfg" unbound_control 0
   config_get UNBOUND_D_DOMAIN_TYPE "$cfg" domain_type static
   config_get UNBOUND_D_DHCP_LINK   "$cfg" dhcp_link none
+  config_get UNBOUND_D_EXTRA_DNS   "$cfg" add_extra_dns 0
   config_get UNBOUND_D_LAN_FQDN    "$cfg" add_local_fqdn 0
+  config_get UNBOUND_D_PRIV_BLCK   "$cfg" rebind_protection 1
   config_get UNBOUND_D_PROTOCOL    "$cfg" protocol mixed
   config_get UNBOUND_D_RECURSION   "$cfg" recursion passive
   config_get UNBOUND_D_RESOURCE    "$cfg" resource small
@@ -817,6 +1092,11 @@ unbound_uci() {
   config_get UNBOUND_TTL_MIN     "$cfg" ttl_min 120
   config_get UNBOUND_TXT_DOMAIN  "$cfg" domain lan
 
+  config_list_foreach "$cfg" "domain_forward"   bundle_domain_forward
+  config_list_foreach "$cfg" "domain_insecure"  bundle_domain_insecure
+  config_list_foreach "$cfg" "rebind_interface" bundle_private_interface
+
+  UNBOUND_LIST_DOMAINS="nowhere $UNBOUND_TXT_DOMAIN"
 
   if [ "$UNBOUND_D_DHCP_LINK" = "none" ] ; then
     config_get_bool UNBOUND_B_DNSMASQ   "$cfg" dnsmasq_link_dns 0
@@ -824,8 +1104,8 @@ unbound_uci() {
 
     if [ "$UNBOUND_B_DNSMASQ" -gt 0 ] ; then
       UNBOUND_D_DHCP_LINK=dnsmasq
-      
-      
+
+
       if [ ! -f "$UNBOUND_TIMEFILE" ] ; then
         logger -t unbound -s "Please use 'dhcp_link' selector instead"
       fi
@@ -863,29 +1143,72 @@ unbound_uci() {
 
   if [ "$UNBOUND_N_EDNS_SIZE" -lt 512 \
     -o 4096 -lt "$UNBOUND_N_EDNS_SIZE" ] ; then
-    # exceeds range, back to default
+    logger -t unbound -s "edns_size exceeds range, using default"
     UNBOUND_N_EDNS_SIZE=1280
   fi
 
 
-  if [ "$UNBOUND_N_RX_PORT" -lt 1024 \
-    -o 10240 -lt "$UNBOUND_N_RX_PORT" ] ; then
-    # special port or in 5 digits, back to default
+  if [ "$UNBOUND_N_RX_PORT" -ne 53 ] \
+  && [ "$UNBOUND_N_RX_PORT" -lt 1024 -o 10240 -lt "$UNBOUND_N_RX_PORT" ] ; then
+    logger -t unbound -s "privileged port or in 5 digits, using default"
     UNBOUND_N_RX_PORT=53
   fi
 
 
   if [ "$UNBOUND_TTL_MIN" -gt 1800 ] ; then
-    # that could have had awful side effects
+    logger -t unbound -s "ttl_min could have had awful side effects, using 300"
     UNBOUND_TTL_MIN=300
   fi
 }
 
 ##############################################################################
 
+_resolv_setup() {
+  if [ "$UNBOUND_N_RX_PORT" != "53" ] ; then
+    return
+  fi
+
+  if [ -x /etc/init.d/dnsmasq ] && /etc/init.d/dnsmasq enabled \
+  && nslookup localhost 127.0.0.1#53 >/dev/null 2>&1 ; then
+    # unbound is configured for port 53, but dnsmasq is enabled and a resolver
+    #   listens on localhost:53, lets assume dnsmasq manages the resolver file.
+    # TODO:
+    #   really check if dnsmasq runs a local (main) resolver in stead of using
+    #   nslookup that times out when no resolver listens on localhost:53.
+    return
+  fi
+
+  # unbound is designated to listen on 127.0.0.1#53,
+  #   set resolver file to local.
+  rm -f /tmp/resolv.conf
+
+  {
+    echo "# /tmp/resolv.conf generated by Unbound UCI $( date )"
+    echo "nameserver 127.0.0.1"
+    echo "nameserver ::1"
+    echo "search $UNBOUND_TXT_DOMAIN."
+  } > /tmp/resolv.conf
+}
+
+##############################################################################
+
+_resolv_teardown() {
+  case $( cat /tmp/resolv.conf ) in
+  *"generated by Unbound UCI"*)
+    # our resolver file, reset to auto resolver file.
+    rm -f /tmp/resolv.conf
+    ln -s /tmp/resolv.conf.auto /tmp/resolv.conf
+    ;;
+  esac
+}
+
+##############################################################################
+
 unbound_start() {
   config_load unbound
   config_foreach unbound_uci unbound
+
+
   unbound_mkdir
 
 
@@ -894,36 +1217,30 @@ unbound_start() {
     unbound_access
     unbound_adblock
 
+
     if [ "$UNBOUND_D_DHCP_LINK" = "dnsmasq" ] ; then
       dnsmasq_link
     else
       unbound_hostname
+      unbound_records
     fi
 
+
+    unbound_forward
     unbound_control
   fi
+
+
+  _resolv_setup
 }
 
 ##############################################################################
 
 unbound_stop() {
-  local resolvsym=0
-
-  rootzone_update
-
+  _resolv_teardown
 
-  if [ ! -x /usr/sbin/dnsmasq -o ! -x /etc/init.d/dnsmasq ] ; then
-    resolvsym=1
-  else
-    /etc/init.d/dnsmasq enabled || resolvsym=1
-  fi
 
-
-  if [ "$resolvsym" -gt 0 ] ; then
-    # set resolver file to normal, but don't stomp on dnsmasq
-    rm -f /tmp/resolv.conf
-    ln -s /tmp/resolv.conf.auto /tmp/resolv.conf
-  fi
+  rootzone_update
 }
 
 ##############################################################################
index 9e58ac799bb69c72f17f61d97b828a89057ceea2..45034085a1fea499ea78b27c772a4be53bd4b61d 100644 (file)
@@ -1,4 +1,5 @@
 config unbound
+       option add_extra_dns '0'
        option add_local_fqdn '1'
        option add_wan_fqdn '0'
        option dhcp_link 'none'
@@ -8,6 +9,8 @@ config unbound
        option domain 'lan'
        option domain_type 'static'
        option edns_size '1280'
+       option extended_luci '0'
+       option extended_stats '0'
        option hide_binddata '1'
        option listen_port '53'
        option localservice '1'
@@ -24,5 +27,9 @@ config unbound
        option unbound_control '0'
        option validator '0'
        option validator_ntp '1'
-       #list domain_insecure ''
+       list trigger_interface 'lan'
+       list trigger_interface 'wan'
+       #list rebind_interface 'lan'
+       #list domain_insecure 'ntp.example.com'
+       #list domain_forward 'mail.example.com'
 
index 5a4398bf0e479c914928b0ad6ff414e4c2f008a4..a44213b6a11ac02d1b209a7562ef54081709c714 100644 (file)
@@ -1,8 +1,9 @@
 ##############################################################################
-# UNBOUND UCI USER ADDED CLAUSES
+# Extended user clauses added to the end of the UCI generated 'unbound.conf'
 #
-# Put your own forward:, view:, stub:, and control: clauses here. This file is
-# appended to the end of UCI auto generated 'unbound.conf'. This is done with
-# include: statement. Notice, it is outside of the server: clause.
+# Put your own forward:, view:, stub:, or remote-control: clauses here. This
+# file is appended to the end of 'unbound.conf' with an include: statement.
+# Notice that it is not part of the server: clause. Use 'unbound_srv.conf' to
+# place custom option statements in the server: clause.
 ##############################################################################
 
index 01ba54414dc3ca868eb262063c0451ad3e6fe5d4..03eb48abcd8c5a7df2a57f3d8a26b457f2f25d5b 100644 (file)
@@ -1,8 +1,9 @@
 ##############################################################################
-# UNBOUND UCI USER ADDED SERVER OPTIONS
+# User custom options added in the server: clause part of UCI 'unbound.conf'
 #
-# Put your own choice options here when not covered by UCI. These are all part
-# of the server: clause only. Most likely are hardening options or local-zone:
-# This is in an include: statement towards the end of the server: cluase. 
+# Add your own option statements here when they are not covered by UCI. This
+# file is placed _inside_ the server: clause with an include: statement. Do
+# not start other clauses here, because that would brake the server: clause.
+# Use 'unbound_ext.conf' to start new clauses at the end of 'unbound.conf'.
 ##############################################################################
 
index 8aa0502024aa70fef632b32996e04d7bf431bed9..cd85ccdf6367e5ed2f14d724aa4a6d52108b659d 100644 (file)
@@ -1,12 +1,12 @@
 diff --git a/doc/example.conf.in b/doc/example.conf.in
-index 83e7c5c..3ea2b28 100644
+index 5396029..cbb51ec 100644
 --- a/doc/example.conf.in
 +++ b/doc/example.conf.in
 @@ -1,9 +1,10 @@
 -#
 -# Example configuration file.
 -#
--# See unbound.conf(5) man page, version 1.6.1.
+-# See unbound.conf(5) man page, version 1.7.0.
 -#
 -# this is a comment.
 +##############################################################################
@@ -16,17 +16,17 @@ index 83e7c5c..3ea2b28 100644
 +# no longer supported ... are exceptional for the DNS.
 +# (http://unbound.net/documentation/unbound.conf.html)
 +##############################################################################
+
  #Use this to include other text into the file.
  #include: "otherfile.conf"
 @@ -12,9 +13,71 @@
  server:
        # whitespace is not necessary, but looks cleaner.
+
 -      # verbosity number, 0 is least verbose. 1 is default.
 +      # verbosity 1 is default
        verbosity: 1
+
 +      # Self jail Unbound with user "unbound" to /var/lib/unbound
 +      # The script /etc/init.d/unbound will setup the location
 +      username: "unbound"
index 3148514fa821d326b3b853496a938fede30541c3..fb52e7d72c8aa6179fa06ded0a1894df2dca7fb7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2010-2015 OpenWrt.org
+# Copyright (C) 2010-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=usbip
-PKG_RELEASE:=5
+PKG_RELEASE:=9
 PKG_LICENSE:=GPL-2.0
 
 # Since kernel 2.6.39.1 userspace tools are inside the kernel tree
@@ -30,7 +30,6 @@ define prepare_source_directory
 endef
 Hooks/Prepare/Pre += prepare_source_directory
 
-PKG_BUILD_DEPENDS:=eudev
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_FLAGS:=nonshared
@@ -53,7 +52,7 @@ endef
 define Package/usbip
   $(call Package/usbip/Default)
   TITLE+= (common)
-  DEPENDS+= +libwrap +kmod-usbip +eudev
+  DEPENDS+= +libwrap +kmod-usbip +libudev-fbsd
 endef
 
 define Package/usbip-client
@@ -80,17 +79,20 @@ endef
 
 CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
 
+USB_IDS_REV:=0a6be488b4c1485d30c9efee1cc895af5d4a1383
+USB_IDS_FILE:=usb.ids.$(USB_IDS_REV)
 define Download/usb.ids
-  URL:=http://www.linux-usb.org/
-  FILE:=usb.ids
-  MD5SUM:=
+  FILE:=$(USB_IDS_FILE)
+  URL_FILE:=usb.ids
+  URL:=@GITHUB/gentoo/hwids/$(USB_IDS_REV)
+  HASH:=2d0403ffccc0ff7150e32c0bf8e2878816b76ba08d2c3bb1059f33627a3da30f
 endef
 
 define Package/usbip/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/share/hwdata
-       $(CP) $(DL_DIR)/usb.ids $(1)/usr/share/hwdata/
+       $(CP) $(DL_DIR)/usb.ids.$(USB_IDS_REV) $(1)/usr/share/hwdata/usb.ids
 endef
 
 define Package/usbip-client/install
diff --git a/net/vallumd/Makefile b/net/vallumd/Makefile
new file mode 100644 (file)
index 0000000..c9e5531
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2017 Stijn Tintel <stijn@linux-ipv6.be>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=vallumd
+PKG_VERSION:=0.1.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/stintel/vallumd/archive/$(PKG_VERSION)/
+PKG_HASH:=b40bede34ea321daf799276111e0e804007dc7c10eb031a0a654982957dcfb25
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/vallumd
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Centralized or distributed blacklist
+  DEPENDS:=+ipset +libmosquitto
+endef
+
+define Package/vallumd/description
+  Centralized or distributed blacklist
+endef
+
+define Package/vallumd/conffiles
+/etc/config/vallumd
+endef
+
+define Package/vallumd/install
+       $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d $(1)/usr/sbin
+       $(INSTALL_CONF) ./files/vallumd.conf $(1)/etc/config/vallumd
+       $(INSTALL_BIN) ./files/vallumd.init $(1)/etc/init.d/vallumd
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/vallumd $(1)/usr/sbin/vallumd
+endef
+
+
+$(eval $(call BuildPackage,vallumd))
diff --git a/net/vallumd/files/vallumd.conf b/net/vallumd/files/vallumd.conf
new file mode 100644 (file)
index 0000000..75703ab
--- /dev/null
@@ -0,0 +1,6 @@
+config vallumd mqtt
+       option host 127.0.0.1
+       option port 1883
+       list topics blacklist4
+       list topics blacklist6
+       option enabled 0
diff --git a/net/vallumd/files/vallumd.init b/net/vallumd/files/vallumd.init
new file mode 100644 (file)
index 0000000..d0cb781
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh /etc/rc.common
+
+START=99
+USE_PROCD=1
+PROG=/usr/sbin/vallumd
+
+add_topic() {
+       procd_append_param command -t "$1"
+}
+
+start_service() {
+       local enabled
+       local mqtt_host
+       local mqtt_port
+
+       config_load "vallumd"
+       config_get_bool enabled "mqtt" "enabled" 1
+       [ "$enabled" -gt 0 ] || return 1
+
+       config_get mqtt_host "mqtt" "host"
+       config_get mqtt_port "mqtt" "port"
+
+       procd_open_instance
+
+       procd_set_param command $PROG
+
+       [ -n "$mqtt_host" ] && procd_append_param command -h "$mqtt_host"
+       [ -n "$mqtt_port" ] && procd_append_param command -p "$mqtt_port"
+       config_list_foreach mqtt topics add_topic
+
+       procd_set_param respawn
+
+       procd_close_instance
+}
index b9c28849b1f51e40bc0c0517429d81552c5115fe..e53c54ee9dce9dd58d6df357f43510a5ccdf3470 100644 (file)
@@ -16,7 +16,7 @@ PKG_LICENSE:=GPL-2.0
 
 PKG_SOURCE:=repeater014.zip
 PKG_SOURCE_URL:=http://jtko.mbnet.fi/uvncrepeater
-PKG_MD5SUM:=3005ebbb2f9442cbea4cbcaa71925dbf
+PKG_HASH:=79178e9baa9cac05f26e43f742933958707cb5c0632c51a5706b13922f3bb5b0
 
 PKG_BUILD_PARALLEL:=1
 
index 921597dcf1512277e44c74b6f745d16c0fc3ca00..d02fbf864ee8b435f6ac5eb6449d31a4ef0e084a 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=vnstat
-PKG_VERSION:=1.12
+PKG_VERSION:=1.17
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://humdi.net/vnstat
-PKG_MD5SUM:=a154b2196771e06a8accd1c24374009c
+PKG_HASH:=18e4c53576ca9e1ef2f0e063a6d83b0c44e3b1cf008560d658745df5c9aa7971
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 
 PKG_INSTALL:=1
@@ -86,7 +86,7 @@ define Package/vnstat/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/vnstatd $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/etc
-       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/vnstat.conf $(1)/etc/
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/cfg/vnstat.conf $(1)/etc/
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_CONF) ./files/vnstat.config $(1)/etc/config/vnstat
        $(INSTALL_DIR) $(1)/etc/init.d
diff --git a/net/vnstat/patches/001-conf.patch b/net/vnstat/patches/001-conf.patch
deleted file mode 100644 (file)
index 5fb24c3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
---- a/cfg/vnstat.conf
-+++ b/cfg/vnstat.conf
-@@ -78,13 +78,13 @@ DaemonUser ""
- DaemonGroup ""
- # how often (in seconds) interface data is updated
--UpdateInterval 30
-+UpdateInterval 60
- # how often (in seconds) interface status changes are checked
--PollInterval 5
-+PollInterval 30
- # how often (in minutes) data is saved to file
--SaveInterval 5
-+SaveInterval 30
- # how often (in minutes) data is saved when all interface are offline
- OfflineSaveInterval 30
diff --git a/net/vnstat/patches/002-no_install_strip.patch b/net/vnstat/patches/002-no_install_strip.patch
deleted file mode 100644 (file)
index 8f11de6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -66,11 +66,11 @@ install:
- # install everything else
-       install -d -m 755 $(BIN) $(SBIN) $(MAN)/man1 $(MAN)/man5
--      install -s -m 755 src/vnstat $(BIN)
--      install -s -m 755 src/vnstatd $(SBIN)
-+      install -m 755 src/vnstat $(BIN)
-+      install -m 755 src/vnstatd $(SBIN)
-       @if [ -f "src/vnstati" ]; \
--      then echo install -s -m 755 src/vnstati $(BIN); \
--      install -s -m 755 src/vnstati $(BIN); \
-+      then echo install -m 755 src/vnstati $(BIN); \
-+      install -m 755 src/vnstati $(BIN); \
-       fi
- # update man pages, gzip it if previous version was done so   
-@@ -139,12 +139,12 @@ bsdinstall:
- # install binaries
-       install -d -m 755 $(DESTDIR)/var/db/vnstat
--      install -s -m 755 src/vnstat $(BIN_BSD)
--      install -s -m 755 src/vnstatd $(SBIN_BSD)
-+      install -m 755 src/vnstat $(BIN_BSD)
-+      install -m 755 src/vnstatd $(SBIN_BSD)
-       @if [ -f "src/vnstati" ]; \
--      then echo install -s -m 755 src/vnstati $(BIN_BSD); \
--      install -s -m 755 src/vnstati $(BIN_BSD); \
-+      then echo install -m 755 src/vnstati $(BIN_BSD); \
-+      install -m 755 src/vnstati $(BIN_BSD); \
-       fi
- # install default config if such doesn't exist
diff --git a/net/vnstat/patches/003-no_install_uname.patch b/net/vnstat/patches/003-no_install_uname.patch
deleted file mode 100644 (file)
index 14c17d5..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -33,12 +33,6 @@ debug:
- install:
-       @echo "Installing vnStat..."
--# check that system is really Linux
--      @if [ `uname` != "Linux" ]; \
--      then echo "This isn't a Linux system. Maybe 'make bsdinstall' is what you need?"; \
--      false; \
--      fi
--
- # check that there's something to install
-       @if [ ! -f "src/vnstat" ] || [ ! -f "src/vnstatd" ]; \
-       then echo "Nothing to install, run make first."; \
diff --git a/net/vnstat/patches/100-musl-compat.patch b/net/vnstat/patches/100-musl-compat.patch
deleted file mode 100644 (file)
index 0512389..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/src/common.h
-+++ b/src/common.h
-@@ -22,6 +22,7 @@
- #include <pwd.h>
- #include <grp.h>
- #include <libgen.h>
-+#include <fcntl.h>
- #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
- #include <sys/param.h>
diff --git a/net/vnstat/patches/990-adjust-configuration-defaults.patch b/net/vnstat/patches/990-adjust-configuration-defaults.patch
new file mode 100644 (file)
index 0000000..1627b4d
--- /dev/null
@@ -0,0 +1,28 @@
+From: Jo-Philipp Wich <jo@mein.io>
+Date: Thu, 26 Jan 2017 15:30:00 +0100
+Subject: [PATCH] config: adjust default values
+
+Adjust the default interval settings to be better suited for slower embedded
+devices.
+
+Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+
+--- a/cfg/vnstat.conf
++++ b/cfg/vnstat.conf
+@@ -87,13 +87,13 @@ DaemonUser ""
+ DaemonGroup ""
+ # how often (in seconds) interface data is updated
+-UpdateInterval 30
++UpdateInterval 60
+ # how often (in seconds) interface status changes are checked
+-PollInterval 5
++PollInterval 30
+ # how often (in minutes) data is saved to file
+-SaveInterval 5
++SaveInterval 30
+ # how often (in minutes) data is saved when all interface are offline
+ OfflineSaveInterval 30
diff --git a/net/vpnbypass/Makefile b/net/vpnbypass/Makefile
new file mode 100644 (file)
index 0000000..2c0b545
--- /dev/null
@@ -0,0 +1,98 @@
+# Copyright (c) 2017 Stan Grishin (stangri@melmac.net)
+# This is free software, licensed under the GNU General Public License v3.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=vpnbypass
+PKG_VERSION:=1.3.1
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-3.0+
+PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/vpnbypass
+       SECTION:=net
+       CATEGORY:=Network
+       DEPENDS:=+ipset +iptables
+       CONFLICTS:=vpn-policy-routing
+       TITLE:=VPN Bypass Service
+       PKGARCH:=all
+endef
+
+define Package/vpnbypass/description
+This service can be used to enable simple VPN split tunnelling.
+Supports accessing domains, IP ranges outside of your VPN tunnel.
+Also supports dedicating local ports/IP ranges for direct
+internet access (outside of your VPN tunnel).
+Please see the README for further information.
+endef
+
+define Package/vpnbypass/conffiles
+/etc/config/vpnbypass
+endef
+
+define Build/Prepare
+       mkdir -p $(PKG_BUILD_DIR)/files/
+       $(CP) ./files/vpnbypass.init $(PKG_BUILD_DIR)/files/vpnbypass.init
+       sed -i "s|^\(PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(PKG_BUILD_DIR)/files/vpnbypass.init
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/vpnbypass/install
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/vpnbypass.init $(1)/etc/init.d/vpnbypass
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/vpnbypass.conf $(1)/etc/config/vpnbypass
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/firewall
+       $(INSTALL_DATA) ./files/vpnbypass.hotplug $(1)/etc/hotplug.d/firewall/94-vpnbypass
+endef
+
+
+define Package/$(PKG_NAME)/postinst
+       #!/bin/sh
+       # check if we are on real system
+       if [ -z "$${IPKG_INSTROOT}" ]; then
+               while [ ! -z "$(uci -q get ucitrack.@vpnbypass[-1] 2>/dev/null)" ] ; do
+                       uci -q delete ucitrack.@vpnbypass[-1]
+               done
+
+               while [ ! -z "$(uci -q get ucitrack.@firewall[-1].affects 2>/dev/null | awk '/vpnbypass/')" ] ; do
+                       uci -q del_list ucitrack.@firewall[-1].affects='vpnbypass'
+               done
+
+               uci -q batch <<-EOF >/dev/null
+                       add ucitrack vpnbypass
+                       set ucitrack.@vpnbypass[-1].init='vpnbypass'
+                       add_list ucitrack.@firewall[-1].affects='vpnbypass'
+                       commit ucitrack
+       EOF
+       fi
+       exit 0
+endef
+
+define Package/$(PKG_NAME)/prerm
+       #!/bin/sh
+       # check if we are on real system
+       if [ -z "$${IPKG_INSTROOT}" ]; then
+               echo "Stopping service and removing rc.d symlink for vpnbypass"
+               /etc/init.d/vpnbypass stop || true
+               /etc/init.d/vpnbypass disable
+
+               while [ ! -z "$(uci -q get ucitrack.@vpnbypass[-1] 2>/dev/null)" ] ; do
+                       uci -q delete ucitrack.@vpnbypass[-1]
+               done
+
+               while [ ! -z "$(uci -q get ucitrack.@firewall[-1].affects 2>/dev/null | awk '/vpnbypass/')" ] ; do
+                       uci -q del_list ucitrack.@firewall[-1].affects='vpnbypass'
+               done
+       fi
+       exit 0
+endef
+
+$(eval $(call BuildPackage,vpnbypass))
diff --git a/net/vpnbypass/files/README.md b/net/vpnbypass/files/README.md
new file mode 100644 (file)
index 0000000..eaccd2c
--- /dev/null
@@ -0,0 +1,119 @@
+# VPN Bypass
+A simple PROCD-based ```vpnbypass``` service for OpenWrt/LEDE Project. Useful if your router accesses internet thru VPN client/tunnel, but you want specific traffic (ports, IP ranges, domains or local IP ranges) to be routed outside of this tunnel.
+
+## Features
+- Allows to define local ports so that traffic to them is routed outside of the VPN tunnel (by default routes Plex Media Server traffic (port 32400) outside of the VPN tunnel).
+- Allows to define IPs/subnets in local network so that their traffic is routed outside of the VPN tunnel (by default routes traffic from 192.168.1.81-192.168.1.87 outside of the VPN tunnel).
+- Allows to define remote IPs/ranges that they are accessed outside of the VPN tunnel (by default routes LogmeIn Hamachi traffic (25.0.0.0/8) outside of the VPN tunnel).
+- Allows to define list of domain names which are accessed outside of the VPN tunnel (useful for Netflix, Hulu, etc).
+- Doesn't stay in memory -- creates the iptables rules which are automatically updated on WAN up/down.
+- Has a companion package (luci-app-vpnbypass) so everything can be configured with Web UI.
+- Proudly made in Canada, using locally-sourced electrons.
+
+## Screenshot (luci-app-vpnbypass)
+![screenshot](https://raw.githubusercontent.com/stangri/screenshots/master/vpnbypass/screenshot02.png "screenshot")
+
+## Requirements
+This service requires following packages to be installed on your router: ```ipset``` and ```iptables```. Additionally, if you want to use Domain Bypass feature, you need to install ```dnsmasq-full``` (```dnsmasq-full``` requires you uninstall ```dnsmasq``` first).
+
+To fully satisfy the requirements for both IP/Port VPN Bypass and Domain Bypass features connect to your router via ssh and run the following commands:
+```sh
+opkg update; opkg remove dnsmasq; opkg install ipset iptables dnsmasq-full
+```
+
+To satisfy the requirements for just IP/Port VPN Bypass connect to your router via ssh and run the following commands:
+```sh
+opkg update; opkg install ipset iptables
+```
+
+#### Unmet dependencies
+If you are running a development (trunk/snapshot) build of OpenWrt/LEDE Project on your router and your build is outdated (meaning that packages of the same revision/commit hash are no longer available and when you try to satisfy the [requirements](#requirements) you get errors), please flash either current LEDE release image or current development/snapshot image.
+
+## How to install
+<!---
+#### From Web UI/Luci
+Navigate to System->Software page on your router and then perform the following actions:
+1. Click "Update Lists"
+2. Wait for the update process to finish.
+3. In the "Download and install package:" field type ```vpnbypass luci-app-vpnbypass```
+4. Click "OK" to install ```vpnbypass``` and ```luci-app-vpnbypass```
+
+If you get an ```Unknown package 'vpnbypass'``` error, your router is not set up with the access to repository containing these packages and you need to add custom repository to your router first.
+
+#### From console/ssh
+--->
+Please make sure that the [requirements](#requirements) are satisfied and install ```vpnbypass``` and ```luci-app-vpnbypass``` from Web UI or connect to your router via ssh and run the following commands:
+```sh
+opkg update
+opkg install vpnbypass luci-app-vpnbypass
+```
+If these packages are not found in the official feed/repo for your version of OpenWrt/LEDE Project, you will need to [add a custom repo to your router](#add-custom-repo-to-your-router) first.
+
+#### Add custom repo to your router
+If your router is not set up with the access to repository containing these packages you will need to add custom repository to your router by connecting to your router via ssh and running the following commands:
+
+###### OpenWrt 15.05.1
+```sh
+opkg update; opkg install ca-certificates wget libopenssl
+echo -e -n 'untrusted comment: public key 7ffc7517c4cc0c56\nRWR//HUXxMwMVnx7fESOKO7x8XoW4/dRidJPjt91hAAU2L59mYvHy0Fa\n' > /tmp/stangri-repo.pub && opkg-key add /tmp/stangri-repo.pub
+! grep -q 'stangri_repo' /etc/opkg/customfeeds.conf && echo 'src/gz stangri_repo https://raw.githubusercontent.com/stangri/openwrt-repo/master' >> /etc/opkg/customfeeds.conf
+opkg update
+```
+
+###### LEDE Project 17.01.x and OpenWrt 18.xx or later
+```sh
+opkg update; opkg install uclient-fetch libustream-mbedtls
+echo -e -n 'untrusted comment: public key 7ffc7517c4cc0c56\nRWR//HUXxMwMVnx7fESOKO7x8XoW4/dRidJPjt91hAAU2L59mYvHy0Fa\n' > /tmp/stangri-repo.pub && opkg-key add /tmp/stangri-repo.pub
+! grep -q 'stangri_repo' /etc/opkg/customfeeds.conf && echo 'src/gz stangri_repo https://raw.githubusercontent.com/stangri/openwrt-repo/master' >> /etc/opkg/customfeeds.conf
+opkg update
+```
+
+## Default Settings
+Default configuration has service disabled (use Web UI to enable/start service or run ```uci set vpnbypass.config.enabled=1```) and routes Plex Media Server traffic (port 32400) outside of the VPN tunnel, routes LogmeIn Hamachi traffic (25.0.0.0/8) outside of the VPN tunnel and also routes internet traffic from local IPs 192.168.1.81-192.168.1.87 outside of the VPN tunnel. You can safely delete these example rules if they do not apply to you.
+
+## Documentation / Discussion
+Please head to [LEDE Project Forum](https://forum.lede-project.org/t/vpn-bypass-split-tunneling-service-luci-ui/1106) for discussions of this service.
+
+#### Bypass Domains Format/Syntax
+Domain lists should be in following format/syntax: ```/domain1.com/domain2.com/vpnbypass```. Please don't forget the leading ```/``` and trailing ```/vpnbypass```. There's no validation if you enter something incorrectly -- it just won't work. Please see [Notes/Known Issues](#notesknown-issues) if you want to edit this setting manually, without Web UI.
+
+## What's New
+1.3.0
+- No longer depends on hardcoded WAN interface name (```wan```) works with other interface names (like ```wwan```).
+- Table ID, IPSET name and FW_MARK as well as FW_MASK can be defined in config file.
+- Uses iptables, not ip rules for handling local IPs/ranges.
+- More reliable creation/destruction of VPNBYPASS iptables chain.
+- Updated Web UI enables/start and stops service.
+- Beautified output.
+
+1.2.0
+- More elegant handling of iptables (thanks [@hnyman](https://github.com/hnyman) and [@tohojo](https://github.com/tohojo)!).
+
+1.1.1
+- More reliable way of obtaining WAN gateway on boot (thanks [@dibdot](https://github.com/dibdot) for the hint!).
+
+1.1.0:
+- Detects individual IP addresses in the config and converts them to subnet automatically.
+- Proper implementation of reload on vpnbypass config change.
+
+1.0.0:
+- Hotplug script created during install.
+
+0.1.0:
+- Package built.
+- Support for user-defined ports implemented.
+- Support for user-defined routes implemented.
+- Support for user-defined local ranges implemented.
+
+0.0.1:
+- Initial release.
+
+## Notes/Known Issues
+1. Domains to be accessed outside of VPN tunnel are handled by dnsmasq and thus are not defined in ```/etc/config/vpnpass```, but rather in ```/etc/config/dhcp```. To add/delete/edit domains you can use VPN Bypass Web UI or you can edit ```/etc/config/dhcp``` manually or run following commands:
+```sh
+uci add_list dhcp.@dnsmasq[-1].ipset='/github.com/plex.tv/google.com/vpnbypass'
+uci add_list dhcp.@dnsmasq[-1].ipset='/hulu.com/netflix.com/nhl.com/vpnbypass'
+uci commit dhcp
+/etc/init.d/dnsmasq restart
+```
+This feature requires ```dnsmasq-full``` to work. See [Requirements](#requirements) paragraph for more details.
diff --git a/net/vpnbypass/files/vpnbypass.conf b/net/vpnbypass/files/vpnbypass.conf
new file mode 100644 (file)
index 0000000..0768e86
--- /dev/null
@@ -0,0 +1,5 @@
+config vpnbypass 'config'
+       option enabled          '0'
+       list localport          '32400'
+       list localsubnet        '192.168.1.81/29'
+       list remotesubnet       '25.0.0.0/8'
diff --git a/net/vpnbypass/files/vpnbypass.hotplug b/net/vpnbypass/files/vpnbypass.hotplug
new file mode 100644 (file)
index 0000000..a2874f9
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+[ "$ACTION" = "reload" ] && /etc/init.d/vpnbypass reload
diff --git a/net/vpnbypass/files/vpnbypass.init b/net/vpnbypass/files/vpnbypass.init
new file mode 100644 (file)
index 0000000..de7ff5a
--- /dev/null
@@ -0,0 +1,102 @@
+#!/bin/sh /etc/rc.common
+PKG_VERSION=
+
+export START=94
+export USE_PROCD=1
+
+readonly _OK_='\033[0;32m\xe2\x9c\x93\033[0m'
+readonly _FAIL_='\033[0;31m\xe2\x9c\x97\033[0m'
+readonly __OK__='\033[0;32m[\xe2\x9c\x93]\033[0m'
+readonly __FAIL__='\033[0;31m[\xe2\x9c\x97]\033[0m'
+readonly __PASS__='\033[0;33m[-]\033[0m'
+readonly _ERROR_='\033[0;31mERROR\033[0m'
+
+export serviceEnabled verbosity=2 TID='200' IPSET='vpnbypass' FW_MARK='0x010000' FW_MASK='0xff0000' wan_if4 wan_gw
+
+output() { [[ $# -ne 1 ]] && { [[ ! $((verbosity & $1)) -gt 0 ]] && return 0 || shift; }; local msg; msg=$(echo -n "${1/$serviceName /service }" | sed 's|\\033\[[0-9]\?;\?[0-9]\?[0-9]\?m||g'); [[ -t 1 ]] && echo -e -n "$1"; [[ $(echo -e -n "$msg" | wc -l) -gt 0 ]] && logger -t "${packageName:-service} [$$]" "$(echo -e -n ${logmsg}${msg})" && logmsg='' || logmsg=${logmsg}${msg}; }
+readonly packageName='vpnbypass'
+readonly serviceName="$packageName $PKG_VERSION"
+
+load_package_config() {
+       config_load "$packageName"
+       config_get_bool serviceEnabled 'config' 'enabled' 1
+       config_get verbosity           'config' 'verbosity' '2'
+       source  /lib/functions/network.sh
+}
+
+is_enabled() {
+       local sleepCount=1
+       load_package_config
+       while : ; do
+               network_find_wan wan_if4
+               [ $serviceEnabled -gt 0 ] || return 1
+               [ -n "$wan_if4" ] && network_get_gateway wan_gw $wan_if4
+               [[ $sleepCount -ge 25 || -n "$wan_gw" ]] && break
+               output "$serviceName waiting for wan gateway...\n"
+               sleep 2; network_flush_cache; let "sleepCount+=1";
+       done
+       [ -n "$wan_gw" ] && return 0
+       output "$__ERROR__: $serviceName failed to discover WAN gateway.\n"; return 1;
+}
+
+is_ovpn() { local dev; dev=$(uci -q get network.$1.ifname); if [[ "${dev:0:3}" == "tun" || "${dev:0:3}" == "tap" || -f "/sys/devices/virtual/net/${dev}/tun_flags" ]]; then return 0; else return 1; fi; }
+is_wan() { if [ -n "$wan_if4" ] && [ "$1" == "$wan_if4" ]; then return 0; else return 1; fi; }
+is_supported_interface() { if is_wan "$1" || is_ovpn "$1"; then return 0; else return 1; fi; }
+
+ipt() {
+    local d; d=$(echo "$*" | sed s/-A/-D/g);
+    [ "$d" != "$*" ] && iptables $d >/dev/null 2>&1
+    d=$(echo "$*" | sed s/-I/-D/g)
+    [ "$d" != "$*" ] && iptables $d >/dev/null 2>&1
+               d=$(echo "$*" | sed s/-N/-F/g)
+    [ "$d" != "$*" ] && iptables $d >/dev/null 2>&1
+               d=$(echo "$*" | sed s/-N/-X/g)
+    [ "$d" != "$*" ] && iptables $d >/dev/null 2>&1
+               d="$*"
+               iptables $d >/dev/null 2>&1 || output "\n$__ERROR__: iptables $d\n"
+}
+
+start_service() {
+       local ll lports rports routes ranges
+  is_enabled || return 1
+  config_get lports   'config' 'localport'
+  config_get rports   'config' 'remoteport'
+  config_get routes   'config' 'remotesubnet'
+  config_get ranges   'config' 'localsubnet'
+
+       iptables -t mangle -D PREROUTING -m mark --mark 0x00/${FW_MASK} -g VPNBYPASS >/dev/null 2>&1
+       ipt -t mangle -N VPNBYPASS; ipt -t mangle -A PREROUTING -m mark --mark 0x00/${FW_MASK} -g VPNBYPASS;
+       ipt -t mangle -A VPNBYPASS -m set --match-set $IPSET dst -j MARK --set-mark ${FW_MARK}/${FW_MASK}
+       ip rule del fwmark "$FW_MARK" table "$TID" >/dev/null 2>&1; ipset -q flush "$IPSET"; ipset -q destroy "$IPSET";
+       ip route flush table "$TID"; ip route flush cache;
+       ip route add default via "$wan_gw" table "$TID"; ip route flush cache;
+       ipset -q -exist create "$IPSET" hash:ip; ipset -q flush "$IPSET"
+       ip rule add fwmark "$FW_MARK" table "$TID"
+       { modprobe xt_set; modprobe ip_set; modprobe ip_set_hash_ip; } >/dev/null 2>&1
+       for ll in ${ranges}; do ipt -t mangle -I VPNBYPASS 1 -j MARK --set-mark ${FW_MARK}/${FW_MASK} -s "$ll"; done
+       for ll in ${lports}; do ipt -t mangle -I VPNBYPASS 1 -j MARK --set-mark ${FW_MARK}/${FW_MASK} -p tcp -m multiport --sport "${ll//-/:}"; done
+       for ll in ${routes}; do ipt -t mangle -I VPNBYPASS 1 -j MARK --set-mark ${FW_MARK}/${FW_MASK} -d "$ll"; done
+       for ll in ${rports}; do ipt -t mangle -I VPNBYPASS 1 -j MARK --set-mark ${FW_MARK}/${FW_MASK} -p tcp -m multiport --dport "${ll//-/:}"; done
+       output "$serviceName started with TID: $TID; FW_MARK: $FW_MARK\n"
+}
+
+stop_service() {
+  load_package_config
+       ip rule del fwmark "$FW_MARK" table "$TID" >/dev/null 2>&1; ipset -q flush "$IPSET"; ipset -q destroy "$IPSET";
+       ip route flush table "$TID"; ip route flush cache;
+       ipt -t mangle -D PREROUTING -m mark --mark 0x00/${FW_MASK} -g VPNBYPASS
+       ipt -t mangle -F VPNBYPASS; ipt -t mangle -X VPNBYPASS;
+       output "$serviceName stopped\n"
+}
+
+service_triggers_load_interface() { is_supported_interface "$1" && ifaces="${ifaces}${1} "; }
+service_triggers() {
+               local ifaces n
+               config_load network; config_foreach service_triggers_load_interface 'interface';
+               procd_add_reload_trigger 'firewall'
+               procd_add_reload_trigger 'openvpn'
+               procd_open_trigger
+                       for n in $ifaces; do procd_add_reload_interface_trigger "$n"; procd_add_interface_trigger "interface.*" "$n" /etc/init.d/${packageName} reload; done;
+                       output 2 "$serviceName monitoring interfaces: $ifaces $_OK_\n"
+               procd_close_trigger
+}
index 147bca93ff09e675d5b9ac02da75d8d87b086aa9..2941aecd5b98f8434e336671a4873fd78f69bc43 100644 (file)
@@ -10,13 +10,14 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=vpnc
 PKG_REV:=550
 PKG_VERSION:=0.5.3.r$(PKG_REV)
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://svn.unix-ag.uni-kl.de/vpnc/trunk/
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_SOURCE_PROTO:=svn
+PKG_MIRROR_HASH:=f95e2ac4e7e55c06553e0fed016a908b0f2695cee988bc70c9994c03e2f588c4
 
 PKG_MAINTAINER:=Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
 PKG_LICENSE:=VARIOUS
index 971b823b8d668fb07436fc78a3eb0849c197876d..bc3f912b36c83ce5683f9f1daed1ddb4697fe24c 100755 (executable)
@@ -43,7 +43,7 @@ proto_vpnc_setup() {
        logger -t vpnc "initializing..."
        serv_addr=
        for ip in $(resolveip -t 10 "$server"); do
-               ( proto_add_host_dependency "vpn-$config" "$ip" $interface )
+               ( proto_add_host_dependency "$config" "$ip" $interface )
                serv_addr=1
        done
        [ -n "$serv_addr" ] || {
index e41cf220f21dd81b77e957773440b57075107c42..fdd045e296c691b5da96d973935ff657ebe1472a 100644 (file)
@@ -63,7 +63,7 @@ ifeq ($(BUILD_VARIANT),notls)
        $(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                CC="$(TARGET_CC)" \
-               CFLAGS="$(TARGET_CFLAGS)" \
+               CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
                LDFLAGS="$(TARGET_LDFLAGS)" \
                vsftpd
  endef
@@ -76,7 +76,7 @@ ifeq ($(BUILD_VARIANT),tls)
        $(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                CC="$(TARGET_CC)" \
-               CFLAGS="$(TARGET_CFLAGS)" \
+               CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
                LDFLAGS="$(TARGET_LDFLAGS)" \
                vsftpd
  endef
diff --git a/net/wakeonlan/Makefile b/net/wakeonlan/Makefile
new file mode 100644 (file)
index 0000000..5e1bc2f
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2016 Nikil Mehta <nikil.mehta@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=wakeonlan
+PKG_VERSION:=0.41
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
+PKG_SOURCE_URL:=http://http.debian.net/debian/pool/main/w/wakeonlan/
+PKG_HASH:=581b1b27a7e810ab72668cce4bd9aa9b3e0cea34b2db24dd1a44c09d63ddda98
+
+PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
+PKG_LICENSE:=Artistic-1.0-Perl
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/wakeonlan
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Sends 'magic packets' to wake-on-LAN enabled ethernet adapters
+  URL:=http://gsd.di.uminho.pt/jpo/software/wakeonlan/
+  DEPENDS:=+perl +perlbase-getopt +perlbase-net +perlbase-socket
+endef
+
+define Package/wakeonlan/description
+       With this package you can remotely wake up and power on machines which have
+       motherboards or network cards that support 'Wake-on-Lan' packets.
+       .
+       The tool allows you to wake up a single machine, or a group of machines.
+       .
+       You need the MAC addresses of machines to construct the WOL packets, but,
+       in contrast to 'etherwake', you do not need root privileges to use the
+       program itself as UDP packets are used.
+endef
+
+define Build/Compile
+endef
+
+define Package/wakeonlan/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/wakeonlan $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,wakeonlan))
index 327a12f6cbd206fdc8e1950a1961e66c788589cd..b99d391991272653180667e9138d4f3ab7cf6abe 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008-2015 OpenWrt.org
+# Copyright (C) 2008-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,10 +8,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wavemon
-PKG_VERSION:=0.8.0
+PKG_VERSION:=0.8.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=4199e2ad11a036f4289f5ad42a8b0fe518f2b5ff77447f4c366dbcf3f23e91d5
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/uoaerg/wavemon.git
@@ -43,7 +44,8 @@ define Package/wavemon/description
 endef
 
 CONFIGURE_VARS += \
-       ac_cv_lib_cap_cap_get_flag=no
+       ac_cv_lib_cap_cap_get_flag=no \
+       BUILD_DATE=$(SOURCE_DATE_EPOCH)
 
 TARGET_CFLAGS += -pthread -I$(STAGING_DIR)/usr/include/libnl3
 
diff --git a/net/wavemon/patches/musl-fix.patch b/net/wavemon/patches/musl-fix.patch
deleted file mode 100644 (file)
index a0a7866..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/wavemon.h b/wavemon.h
-index e7584f7..8c76d11 100644
---- a/wavemon.h
-+++ b/wavemon.h
-@@ -19,6 +19,7 @@
-  * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
- #include <stdio.h>
-+#include <stdint.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <signal.h>
-@@ -33,7 +34,7 @@
- #include <ctype.h>
- #include <math.h>
- #include <stdbool.h>
--#include <ncurses.h>
-+#include <curses.h>
- #include "llist.h"
index 514ad1832131f1d40223363734b5865f9797c1bd..cee7a0e55e0ca9c613903bc9c6160b3d91666f17 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2016 OpenWrt.org
+# Copyright (C) 2016-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,14 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=webui-aria2
-PKG_VERSION:=2016-10-11
+PKG_SOURCE_DATE:=2017-05-21
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/ziahamza/webui-aria2.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=6a29c1b1d0224e1daa88906e88bc2e177ca2ad76
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/ziahamza/webui-aria2
+PKG_SOURCE_VERSION:=d1ce5b992680f4d03eeee899ed8280cbcab8961a
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE
@@ -41,16 +39,18 @@ define Build/Compile
 endef
 
 define Package/webui-aria2/install
-       $(INSTALL_DIR) $(1)/www/webui-aria2
-
-       $(CP) $(PKG_BUILD_DIR)/fonts $(1)/www/webui-aria2
-       $(CP) $(PKG_BUILD_DIR)/flags $(1)/www/webui-aria2
-       $(CP) $(PKG_BUILD_DIR)/js $(1)/www/webui-aria2
-       $(CP) $(PKG_BUILD_DIR)/img $(1)/www/webui-aria2
-       $(CP) $(PKG_BUILD_DIR)/css $(1)/www/webui-aria2
-       $(CP) $(PKG_BUILD_DIR)/index.html $(1)/www/webui-aria2
-       $(CP) $(PKG_BUILD_DIR)/favicon.ico $(1)/www/webui-aria2
-       $(CP) $(PKG_BUILD_DIR)/configuration.js $(1)/www/webui-aria2
+       $(INSTALL_DIR) \
+               $(1)/www/webui-aria2 \
+               $(1)/www/webui-aria2/flags/4x3
+
+       $(CP) \
+               $(PKG_BUILD_DIR)/{css,fonts,js} \
+               $(PKG_BUILD_DIR)/{LICENSE,configuration.js,favicon.ico,index.html} \
+               $(1)/www/webui-aria2
+
+       $(CP) \
+               $(PKG_BUILD_DIR)/flags/4x3/{cn,cz,de,es,fr,it,nl,pl,ru,th,tr,tw,us}.svg \
+               $(1)/www/webui-aria2/flags/4x3
 endef
 
 $(eval $(call BuildPackage,webui-aria2))
diff --git a/net/webui-aria2/patches/001-simplify-flag-icon-css.patch b/net/webui-aria2/patches/001-simplify-flag-icon-css.patch
new file mode 100644 (file)
index 0000000..a7532f0
--- /dev/null
@@ -0,0 +1,9 @@
+diff --git a/css/flag-icon.min.css b/css/flag-icon.min.css
+index 9480741..00ee213 100644
+--- a/css/flag-icon.min.css
++++ b/css/flag-icon.min.css
+@@ -1 +1 @@
+-.flag-icon,.flag-icon-background{background-repeat:no-repeat;background-size:contain;background-position:50%}.flag-icon{position:relative;display:inline-block;width:1.33333333em;line-height:1em}.flag-icon:before{content:"\00a0"}.flag-icon.flag-icon-squared{width:1em}.flag-icon-ad{background-image:url(../flags/4x3/ad.svg)}.flag-icon-ad.flag-icon-squared{background-image:url(../flags/1x1/ad.svg)}.flag-icon-ae{background-image:url(../flags/4x3/ae.svg)}.flag-icon-ae.flag-icon-squared{background-image:url(../flags/1x1/ae.svg)}.flag-icon-af{background-image:url(../flags/4x3/af.svg)}.flag-icon-af.flag-icon-squared{background-image:url(../flags/1x1/af.svg)}.flag-icon-ag{background-image:url(../flags/4x3/ag.svg)}.flag-icon-ag.flag-icon-squared{background-image:url(../flags/1x1/ag.svg)}.flag-icon-ai{background-image:url(../flags/4x3/ai.svg)}.flag-icon-ai.flag-icon-squared{background-image:url(../flags/1x1/ai.svg)}.flag-icon-al{background-image:url(../flags/4x3/al.svg)}.flag-icon-al.flag-icon-squared{background-image:url(../flags/1x1/al.svg)}.flag-icon-am{background-image:url(../flags/4x3/am.svg)}.flag-icon-am.flag-icon-squared{background-image:url(../flags/1x1/am.svg)}.flag-icon-ao{background-image:url(../flags/4x3/ao.svg)}.flag-icon-ao.flag-icon-squared{background-image:url(../flags/1x1/ao.svg)}.flag-icon-aq{background-image:url(../flags/4x3/aq.svg)}.flag-icon-aq.flag-icon-squared{background-image:url(../flags/1x1/aq.svg)}.flag-icon-ar{background-image:url(../flags/4x3/ar.svg)}.flag-icon-ar.flag-icon-squared{background-image:url(../flags/1x1/ar.svg)}.flag-icon-as{background-image:url(../flags/4x3/as.svg)}.flag-icon-as.flag-icon-squared{background-image:url(../flags/1x1/as.svg)}.flag-icon-at{background-image:url(../flags/4x3/at.svg)}.flag-icon-at.flag-icon-squared{background-image:url(../flags/1x1/at.svg)}.flag-icon-au{background-image:url(../flags/4x3/au.svg)}.flag-icon-au.flag-icon-squared{background-image:url(../flags/1x1/au.svg)}.flag-icon-aw{background-image:url(../flags/4x3/aw.svg)}.flag-icon-aw.flag-icon-squared{background-image:url(../flags/1x1/aw.svg)}.flag-icon-ax{background-image:url(../flags/4x3/ax.svg)}.flag-icon-ax.flag-icon-squared{background-image:url(../flags/1x1/ax.svg)}.flag-icon-az{background-image:url(../flags/4x3/az.svg)}.flag-icon-az.flag-icon-squared{background-image:url(../flags/1x1/az.svg)}.flag-icon-ba{background-image:url(../flags/4x3/ba.svg)}.flag-icon-ba.flag-icon-squared{background-image:url(../flags/1x1/ba.svg)}.flag-icon-bb{background-image:url(../flags/4x3/bb.svg)}.flag-icon-bb.flag-icon-squared{background-image:url(../flags/1x1/bb.svg)}.flag-icon-bd{background-image:url(../flags/4x3/bd.svg)}.flag-icon-bd.flag-icon-squared{background-image:url(../flags/1x1/bd.svg)}.flag-icon-be{background-image:url(../flags/4x3/be.svg)}.flag-icon-be.flag-icon-squared{background-image:url(../flags/1x1/be.svg)}.flag-icon-bf{background-image:url(../flags/4x3/bf.svg)}.flag-icon-bf.flag-icon-squared{background-image:url(../flags/1x1/bf.svg)}.flag-icon-bg{background-image:url(../flags/4x3/bg.svg)}.flag-icon-bg.flag-icon-squared{background-image:url(../flags/1x1/bg.svg)}.flag-icon-bh{background-image:url(../flags/4x3/bh.svg)}.flag-icon-bh.flag-icon-squared{background-image:url(../flags/1x1/bh.svg)}.flag-icon-bi{background-image:url(../flags/4x3/bi.svg)}.flag-icon-bi.flag-icon-squared{background-image:url(../flags/1x1/bi.svg)}.flag-icon-bj{background-image:url(../flags/4x3/bj.svg)}.flag-icon-bj.flag-icon-squared{background-image:url(../flags/1x1/bj.svg)}.flag-icon-bl{background-image:url(../flags/4x3/bl.svg)}.flag-icon-bl.flag-icon-squared{background-image:url(../flags/1x1/bl.svg)}.flag-icon-bm{background-image:url(../flags/4x3/bm.svg)}.flag-icon-bm.flag-icon-squared{background-image:url(../flags/1x1/bm.svg)}.flag-icon-bn{background-image:url(../flags/4x3/bn.svg)}.flag-icon-bn.flag-icon-squared{background-image:url(../flags/1x1/bn.svg)}.flag-icon-bo{background-image:url(../flags/4x3/bo.svg)}.flag-icon-bo.flag-icon-squared{background-image:url(../flags/1x1/bo.svg)}.flag-icon-bq{background-image:url(../flags/4x3/bq.svg)}.flag-icon-bq.flag-icon-squared{background-image:url(../flags/1x1/bq.svg)}.flag-icon-br{background-image:url(../flags/4x3/br.svg)}.flag-icon-br.flag-icon-squared{background-image:url(../flags/1x1/br.svg)}.flag-icon-bs{background-image:url(../flags/4x3/bs.svg)}.flag-icon-bs.flag-icon-squared{background-image:url(../flags/1x1/bs.svg)}.flag-icon-bt{background-image:url(../flags/4x3/bt.svg)}.flag-icon-bt.flag-icon-squared{background-image:url(../flags/1x1/bt.svg)}.flag-icon-bv{background-image:url(../flags/4x3/bv.svg)}.flag-icon-bv.flag-icon-squared{background-image:url(../flags/1x1/bv.svg)}.flag-icon-bw{background-image:url(../flags/4x3/bw.svg)}.flag-icon-bw.flag-icon-squared{background-image:url(../flags/1x1/bw.svg)}.flag-icon-by{background-image:url(../flags/4x3/by.svg)}.flag-icon-by.flag-icon-squared{background-image:url(../flags/1x1/by.svg)}.flag-icon-bz{background-image:url(../flags/4x3/bz.svg)}.flag-icon-bz.flag-icon-squared{background-image:url(../flags/1x1/bz.svg)}.flag-icon-ca{background-image:url(../flags/4x3/ca.svg)}.flag-icon-ca.flag-icon-squared{background-image:url(../flags/1x1/ca.svg)}.flag-icon-cc{background-image:url(../flags/4x3/cc.svg)}.flag-icon-cc.flag-icon-squared{background-image:url(../flags/1x1/cc.svg)}.flag-icon-cd{background-image:url(../flags/4x3/cd.svg)}.flag-icon-cd.flag-icon-squared{background-image:url(../flags/1x1/cd.svg)}.flag-icon-cf{background-image:url(../flags/4x3/cf.svg)}.flag-icon-cf.flag-icon-squared{background-image:url(../flags/1x1/cf.svg)}.flag-icon-cg{background-image:url(../flags/4x3/cg.svg)}.flag-icon-cg.flag-icon-squared{background-image:url(../flags/1x1/cg.svg)}.flag-icon-ch{background-image:url(../flags/4x3/ch.svg)}.flag-icon-ch.flag-icon-squared{background-image:url(../flags/1x1/ch.svg)}.flag-icon-ci{background-image:url(../flags/4x3/ci.svg)}.flag-icon-ci.flag-icon-squared{background-image:url(../flags/1x1/ci.svg)}.flag-icon-ck{background-image:url(../flags/4x3/ck.svg)}.flag-icon-ck.flag-icon-squared{background-image:url(../flags/1x1/ck.svg)}.flag-icon-cl{background-image:url(../flags/4x3/cl.svg)}.flag-icon-cl.flag-icon-squared{background-image:url(../flags/1x1/cl.svg)}.flag-icon-cm{background-image:url(../flags/4x3/cm.svg)}.flag-icon-cm.flag-icon-squared{background-image:url(../flags/1x1/cm.svg)}.flag-icon-cn{background-image:url(../flags/4x3/cn.svg)}.flag-icon-cn.flag-icon-squared{background-image:url(../flags/1x1/cn.svg)}.flag-icon-co{background-image:url(../flags/4x3/co.svg)}.flag-icon-co.flag-icon-squared{background-image:url(../flags/1x1/co.svg)}.flag-icon-cr{background-image:url(../flags/4x3/cr.svg)}.flag-icon-cr.flag-icon-squared{background-image:url(../flags/1x1/cr.svg)}.flag-icon-cu{background-image:url(../flags/4x3/cu.svg)}.flag-icon-cu.flag-icon-squared{background-image:url(../flags/1x1/cu.svg)}.flag-icon-cv{background-image:url(../flags/4x3/cv.svg)}.flag-icon-cv.flag-icon-squared{background-image:url(../flags/1x1/cv.svg)}.flag-icon-cw{background-image:url(../flags/4x3/cw.svg)}.flag-icon-cw.flag-icon-squared{background-image:url(../flags/1x1/cw.svg)}.flag-icon-cx{background-image:url(../flags/4x3/cx.svg)}.flag-icon-cx.flag-icon-squared{background-image:url(../flags/1x1/cx.svg)}.flag-icon-cy{background-image:url(../flags/4x3/cy.svg)}.flag-icon-cy.flag-icon-squared{background-image:url(../flags/1x1/cy.svg)}.flag-icon-cz{background-image:url(../flags/4x3/cz.svg)}.flag-icon-cz.flag-icon-squared{background-image:url(../flags/1x1/cz.svg)}.flag-icon-de{background-image:url(../flags/4x3/de.svg)}.flag-icon-de.flag-icon-squared{background-image:url(../flags/1x1/de.svg)}.flag-icon-dj{background-image:url(../flags/4x3/dj.svg)}.flag-icon-dj.flag-icon-squared{background-image:url(../flags/1x1/dj.svg)}.flag-icon-dk{background-image:url(../flags/4x3/dk.svg)}.flag-icon-dk.flag-icon-squared{background-image:url(../flags/1x1/dk.svg)}.flag-icon-dm{background-image:url(../flags/4x3/dm.svg)}.flag-icon-dm.flag-icon-squared{background-image:url(../flags/1x1/dm.svg)}.flag-icon-do{background-image:url(../flags/4x3/do.svg)}.flag-icon-do.flag-icon-squared{background-image:url(../flags/1x1/do.svg)}.flag-icon-dz{background-image:url(../flags/4x3/dz.svg)}.flag-icon-dz.flag-icon-squared{background-image:url(../flags/1x1/dz.svg)}.flag-icon-ec{background-image:url(../flags/4x3/ec.svg)}.flag-icon-ec.flag-icon-squared{background-image:url(../flags/1x1/ec.svg)}.flag-icon-ee{background-image:url(../flags/4x3/ee.svg)}.flag-icon-ee.flag-icon-squared{background-image:url(../flags/1x1/ee.svg)}.flag-icon-eg{background-image:url(../flags/4x3/eg.svg)}.flag-icon-eg.flag-icon-squared{background-image:url(../flags/1x1/eg.svg)}.flag-icon-eh{background-image:url(../flags/4x3/eh.svg)}.flag-icon-eh.flag-icon-squared{background-image:url(../flags/1x1/eh.svg)}.flag-icon-er{background-image:url(../flags/4x3/er.svg)}.flag-icon-er.flag-icon-squared{background-image:url(../flags/1x1/er.svg)}.flag-icon-es{background-image:url(../flags/4x3/es.svg)}.flag-icon-es.flag-icon-squared{background-image:url(../flags/1x1/es.svg)}.flag-icon-et{background-image:url(../flags/4x3/et.svg)}.flag-icon-et.flag-icon-squared{background-image:url(../flags/1x1/et.svg)}.flag-icon-fi{background-image:url(../flags/4x3/fi.svg)}.flag-icon-fi.flag-icon-squared{background-image:url(../flags/1x1/fi.svg)}.flag-icon-fj{background-image:url(../flags/4x3/fj.svg)}.flag-icon-fj.flag-icon-squared{background-image:url(../flags/1x1/fj.svg)}.flag-icon-fk{background-image:url(../flags/4x3/fk.svg)}.flag-icon-fk.flag-icon-squared{background-image:url(../flags/1x1/fk.svg)}.flag-icon-fm{background-image:url(../flags/4x3/fm.svg)}.flag-icon-fm.flag-icon-squared{background-image:url(../flags/1x1/fm.svg)}.flag-icon-fo{background-image:url(../flags/4x3/fo.svg)}.flag-icon-fo.flag-icon-squared{background-image:url(../flags/1x1/fo.svg)}.flag-icon-fr{background-image:url(../flags/4x3/fr.svg)}.flag-icon-fr.flag-icon-squared{background-image:url(../flags/1x1/fr.svg)}.flag-icon-ga{background-image:url(../flags/4x3/ga.svg)}.flag-icon-ga.flag-icon-squared{background-image:url(../flags/1x1/ga.svg)}.flag-icon-gb{background-image:url(../flags/4x3/gb.svg)}.flag-icon-gb.flag-icon-squared{background-image:url(../flags/1x1/gb.svg)}.flag-icon-gd{background-image:url(../flags/4x3/gd.svg)}.flag-icon-gd.flag-icon-squared{background-image:url(../flags/1x1/gd.svg)}.flag-icon-ge{background-image:url(../flags/4x3/ge.svg)}.flag-icon-ge.flag-icon-squared{background-image:url(../flags/1x1/ge.svg)}.flag-icon-gf{background-image:url(../flags/4x3/gf.svg)}.flag-icon-gf.flag-icon-squared{background-image:url(../flags/1x1/gf.svg)}.flag-icon-gg{background-image:url(../flags/4x3/gg.svg)}.flag-icon-gg.flag-icon-squared{background-image:url(../flags/1x1/gg.svg)}.flag-icon-gh{background-image:url(../flags/4x3/gh.svg)}.flag-icon-gh.flag-icon-squared{background-image:url(../flags/1x1/gh.svg)}.flag-icon-gi{background-image:url(../flags/4x3/gi.svg)}.flag-icon-gi.flag-icon-squared{background-image:url(../flags/1x1/gi.svg)}.flag-icon-gl{background-image:url(../flags/4x3/gl.svg)}.flag-icon-gl.flag-icon-squared{background-image:url(../flags/1x1/gl.svg)}.flag-icon-gm{background-image:url(../flags/4x3/gm.svg)}.flag-icon-gm.flag-icon-squared{background-image:url(../flags/1x1/gm.svg)}.flag-icon-gn{background-image:url(../flags/4x3/gn.svg)}.flag-icon-gn.flag-icon-squared{background-image:url(../flags/1x1/gn.svg)}.flag-icon-gp{background-image:url(../flags/4x3/gp.svg)}.flag-icon-gp.flag-icon-squared{background-image:url(../flags/1x1/gp.svg)}.flag-icon-gq{background-image:url(../flags/4x3/gq.svg)}.flag-icon-gq.flag-icon-squared{background-image:url(../flags/1x1/gq.svg)}.flag-icon-gr{background-image:url(../flags/4x3/gr.svg)}.flag-icon-gr.flag-icon-squared{background-image:url(../flags/1x1/gr.svg)}.flag-icon-gs{background-image:url(../flags/4x3/gs.svg)}.flag-icon-gs.flag-icon-squared{background-image:url(../flags/1x1/gs.svg)}.flag-icon-gt{background-image:url(../flags/4x3/gt.svg)}.flag-icon-gt.flag-icon-squared{background-image:url(../flags/1x1/gt.svg)}.flag-icon-gu{background-image:url(../flags/4x3/gu.svg)}.flag-icon-gu.flag-icon-squared{background-image:url(../flags/1x1/gu.svg)}.flag-icon-gw{background-image:url(../flags/4x3/gw.svg)}.flag-icon-gw.flag-icon-squared{background-image:url(../flags/1x1/gw.svg)}.flag-icon-gy{background-image:url(../flags/4x3/gy.svg)}.flag-icon-gy.flag-icon-squared{background-image:url(../flags/1x1/gy.svg)}.flag-icon-hk{background-image:url(../flags/4x3/hk.svg)}.flag-icon-hk.flag-icon-squared{background-image:url(../flags/1x1/hk.svg)}.flag-icon-hm{background-image:url(../flags/4x3/hm.svg)}.flag-icon-hm.flag-icon-squared{background-image:url(../flags/1x1/hm.svg)}.flag-icon-hn{background-image:url(../flags/4x3/hn.svg)}.flag-icon-hn.flag-icon-squared{background-image:url(../flags/1x1/hn.svg)}.flag-icon-hr{background-image:url(../flags/4x3/hr.svg)}.flag-icon-hr.flag-icon-squared{background-image:url(../flags/1x1/hr.svg)}.flag-icon-ht{background-image:url(../flags/4x3/ht.svg)}.flag-icon-ht.flag-icon-squared{background-image:url(../flags/1x1/ht.svg)}.flag-icon-hu{background-image:url(../flags/4x3/hu.svg)}.flag-icon-hu.flag-icon-squared{background-image:url(../flags/1x1/hu.svg)}.flag-icon-id{background-image:url(../flags/4x3/id.svg)}.flag-icon-id.flag-icon-squared{background-image:url(../flags/1x1/id.svg)}.flag-icon-ie{background-image:url(../flags/4x3/ie.svg)}.flag-icon-ie.flag-icon-squared{background-image:url(../flags/1x1/ie.svg)}.flag-icon-il{background-image:url(../flags/4x3/il.svg)}.flag-icon-il.flag-icon-squared{background-image:url(../flags/1x1/il.svg)}.flag-icon-im{background-image:url(../flags/4x3/im.svg)}.flag-icon-im.flag-icon-squared{background-image:url(../flags/1x1/im.svg)}.flag-icon-in{background-image:url(../flags/4x3/in.svg)}.flag-icon-in.flag-icon-squared{background-image:url(../flags/1x1/in.svg)}.flag-icon-io{background-image:url(../flags/4x3/io.svg)}.flag-icon-io.flag-icon-squared{background-image:url(../flags/1x1/io.svg)}.flag-icon-iq{background-image:url(../flags/4x3/iq.svg)}.flag-icon-iq.flag-icon-squared{background-image:url(../flags/1x1/iq.svg)}.flag-icon-ir{background-image:url(../flags/4x3/ir.svg)}.flag-icon-ir.flag-icon-squared{background-image:url(../flags/1x1/ir.svg)}.flag-icon-is{background-image:url(../flags/4x3/is.svg)}.flag-icon-is.flag-icon-squared{background-image:url(../flags/1x1/is.svg)}.flag-icon-it{background-image:url(../flags/4x3/it.svg)}.flag-icon-it.flag-icon-squared{background-image:url(../flags/1x1/it.svg)}.flag-icon-je{background-image:url(../flags/4x3/je.svg)}.flag-icon-je.flag-icon-squared{background-image:url(../flags/1x1/je.svg)}.flag-icon-jm{background-image:url(../flags/4x3/jm.svg)}.flag-icon-jm.flag-icon-squared{background-image:url(../flags/1x1/jm.svg)}.flag-icon-jo{background-image:url(../flags/4x3/jo.svg)}.flag-icon-jo.flag-icon-squared{background-image:url(../flags/1x1/jo.svg)}.flag-icon-jp{background-image:url(../flags/4x3/jp.svg)}.flag-icon-jp.flag-icon-squared{background-image:url(../flags/1x1/jp.svg)}.flag-icon-ke{background-image:url(../flags/4x3/ke.svg)}.flag-icon-ke.flag-icon-squared{background-image:url(../flags/1x1/ke.svg)}.flag-icon-kg{background-image:url(../flags/4x3/kg.svg)}.flag-icon-kg.flag-icon-squared{background-image:url(../flags/1x1/kg.svg)}.flag-icon-kh{background-image:url(../flags/4x3/kh.svg)}.flag-icon-kh.flag-icon-squared{background-image:url(../flags/1x1/kh.svg)}.flag-icon-ki{background-image:url(../flags/4x3/ki.svg)}.flag-icon-ki.flag-icon-squared{background-image:url(../flags/1x1/ki.svg)}.flag-icon-km{background-image:url(../flags/4x3/km.svg)}.flag-icon-km.flag-icon-squared{background-image:url(../flags/1x1/km.svg)}.flag-icon-kn{background-image:url(../flags/4x3/kn.svg)}.flag-icon-kn.flag-icon-squared{background-image:url(../flags/1x1/kn.svg)}.flag-icon-kp{background-image:url(../flags/4x3/kp.svg)}.flag-icon-kp.flag-icon-squared{background-image:url(../flags/1x1/kp.svg)}.flag-icon-kr{background-image:url(../flags/4x3/kr.svg)}.flag-icon-kr.flag-icon-squared{background-image:url(../flags/1x1/kr.svg)}.flag-icon-kw{background-image:url(../flags/4x3/kw.svg)}.flag-icon-kw.flag-icon-squared{background-image:url(../flags/1x1/kw.svg)}.flag-icon-ky{background-image:url(../flags/4x3/ky.svg)}.flag-icon-ky.flag-icon-squared{background-image:url(../flags/1x1/ky.svg)}.flag-icon-kz{background-image:url(../flags/4x3/kz.svg)}.flag-icon-kz.flag-icon-squared{background-image:url(../flags/1x1/kz.svg)}.flag-icon-la{background-image:url(../flags/4x3/la.svg)}.flag-icon-la.flag-icon-squared{background-image:url(../flags/1x1/la.svg)}.flag-icon-lb{background-image:url(../flags/4x3/lb.svg)}.flag-icon-lb.flag-icon-squared{background-image:url(../flags/1x1/lb.svg)}.flag-icon-lc{background-image:url(../flags/4x3/lc.svg)}.flag-icon-lc.flag-icon-squared{background-image:url(../flags/1x1/lc.svg)}.flag-icon-li{background-image:url(../flags/4x3/li.svg)}.flag-icon-li.flag-icon-squared{background-image:url(../flags/1x1/li.svg)}.flag-icon-lk{background-image:url(../flags/4x3/lk.svg)}.flag-icon-lk.flag-icon-squared{background-image:url(../flags/1x1/lk.svg)}.flag-icon-lr{background-image:url(../flags/4x3/lr.svg)}.flag-icon-lr.flag-icon-squared{background-image:url(../flags/1x1/lr.svg)}.flag-icon-ls{background-image:url(../flags/4x3/ls.svg)}.flag-icon-ls.flag-icon-squared{background-image:url(../flags/1x1/ls.svg)}.flag-icon-lt{background-image:url(../flags/4x3/lt.svg)}.flag-icon-lt.flag-icon-squared{background-image:url(../flags/1x1/lt.svg)}.flag-icon-lu{background-image:url(../flags/4x3/lu.svg)}.flag-icon-lu.flag-icon-squared{background-image:url(../flags/1x1/lu.svg)}.flag-icon-lv{background-image:url(../flags/4x3/lv.svg)}.flag-icon-lv.flag-icon-squared{background-image:url(../flags/1x1/lv.svg)}.flag-icon-ly{background-image:url(../flags/4x3/ly.svg)}.flag-icon-ly.flag-icon-squared{background-image:url(../flags/1x1/ly.svg)}.flag-icon-ma{background-image:url(../flags/4x3/ma.svg)}.flag-icon-ma.flag-icon-squared{background-image:url(../flags/1x1/ma.svg)}.flag-icon-mc{background-image:url(../flags/4x3/mc.svg)}.flag-icon-mc.flag-icon-squared{background-image:url(../flags/1x1/mc.svg)}.flag-icon-md{background-image:url(../flags/4x3/md.svg)}.flag-icon-md.flag-icon-squared{background-image:url(../flags/1x1/md.svg)}.flag-icon-me{background-image:url(../flags/4x3/me.svg)}.flag-icon-me.flag-icon-squared{background-image:url(../flags/1x1/me.svg)}.flag-icon-mf{background-image:url(../flags/4x3/mf.svg)}.flag-icon-mf.flag-icon-squared{background-image:url(../flags/1x1/mf.svg)}.flag-icon-mg{background-image:url(../flags/4x3/mg.svg)}.flag-icon-mg.flag-icon-squared{background-image:url(../flags/1x1/mg.svg)}.flag-icon-mh{background-image:url(../flags/4x3/mh.svg)}.flag-icon-mh.flag-icon-squared{background-image:url(../flags/1x1/mh.svg)}.flag-icon-mk{background-image:url(../flags/4x3/mk.svg)}.flag-icon-mk.flag-icon-squared{background-image:url(../flags/1x1/mk.svg)}.flag-icon-ml{background-image:url(../flags/4x3/ml.svg)}.flag-icon-ml.flag-icon-squared{background-image:url(../flags/1x1/ml.svg)}.flag-icon-mm{background-image:url(../flags/4x3/mm.svg)}.flag-icon-mm.flag-icon-squared{background-image:url(../flags/1x1/mm.svg)}.flag-icon-mn{background-image:url(../flags/4x3/mn.svg)}.flag-icon-mn.flag-icon-squared{background-image:url(../flags/1x1/mn.svg)}.flag-icon-mo{background-image:url(../flags/4x3/mo.svg)}.flag-icon-mo.flag-icon-squared{background-image:url(../flags/1x1/mo.svg)}.flag-icon-mp{background-image:url(../flags/4x3/mp.svg)}.flag-icon-mp.flag-icon-squared{background-image:url(../flags/1x1/mp.svg)}.flag-icon-mq{background-image:url(../flags/4x3/mq.svg)}.flag-icon-mq.flag-icon-squared{background-image:url(../flags/1x1/mq.svg)}.flag-icon-mr{background-image:url(../flags/4x3/mr.svg)}.flag-icon-mr.flag-icon-squared{background-image:url(../flags/1x1/mr.svg)}.flag-icon-ms{background-image:url(../flags/4x3/ms.svg)}.flag-icon-ms.flag-icon-squared{background-image:url(../flags/1x1/ms.svg)}.flag-icon-mt{background-image:url(../flags/4x3/mt.svg)}.flag-icon-mt.flag-icon-squared{background-image:url(../flags/1x1/mt.svg)}.flag-icon-mu{background-image:url(../flags/4x3/mu.svg)}.flag-icon-mu.flag-icon-squared{background-image:url(../flags/1x1/mu.svg)}.flag-icon-mv{background-image:url(../flags/4x3/mv.svg)}.flag-icon-mv.flag-icon-squared{background-image:url(../flags/1x1/mv.svg)}.flag-icon-mw{background-image:url(../flags/4x3/mw.svg)}.flag-icon-mw.flag-icon-squared{background-image:url(../flags/1x1/mw.svg)}.flag-icon-mx{background-image:url(../flags/4x3/mx.svg)}.flag-icon-mx.flag-icon-squared{background-image:url(../flags/1x1/mx.svg)}.flag-icon-my{background-image:url(../flags/4x3/my.svg)}.flag-icon-my.flag-icon-squared{background-image:url(../flags/1x1/my.svg)}.flag-icon-mz{background-image:url(../flags/4x3/mz.svg)}.flag-icon-mz.flag-icon-squared{background-image:url(../flags/1x1/mz.svg)}.flag-icon-na{background-image:url(../flags/4x3/na.svg)}.flag-icon-na.flag-icon-squared{background-image:url(../flags/1x1/na.svg)}.flag-icon-nc{background-image:url(../flags/4x3/nc.svg)}.flag-icon-nc.flag-icon-squared{background-image:url(../flags/1x1/nc.svg)}.flag-icon-ne{background-image:url(../flags/4x3/ne.svg)}.flag-icon-ne.flag-icon-squared{background-image:url(../flags/1x1/ne.svg)}.flag-icon-nf{background-image:url(../flags/4x3/nf.svg)}.flag-icon-nf.flag-icon-squared{background-image:url(../flags/1x1/nf.svg)}.flag-icon-ng{background-image:url(../flags/4x3/ng.svg)}.flag-icon-ng.flag-icon-squared{background-image:url(../flags/1x1/ng.svg)}.flag-icon-ni{background-image:url(../flags/4x3/ni.svg)}.flag-icon-ni.flag-icon-squared{background-image:url(../flags/1x1/ni.svg)}.flag-icon-nl{background-image:url(../flags/4x3/nl.svg)}.flag-icon-nl.flag-icon-squared{background-image:url(../flags/1x1/nl.svg)}.flag-icon-no{background-image:url(../flags/4x3/no.svg)}.flag-icon-no.flag-icon-squared{background-image:url(../flags/1x1/no.svg)}.flag-icon-np{background-image:url(../flags/4x3/np.svg)}.flag-icon-np.flag-icon-squared{background-image:url(../flags/1x1/np.svg)}.flag-icon-nr{background-image:url(../flags/4x3/nr.svg)}.flag-icon-nr.flag-icon-squared{background-image:url(../flags/1x1/nr.svg)}.flag-icon-nu{background-image:url(../flags/4x3/nu.svg)}.flag-icon-nu.flag-icon-squared{background-image:url(../flags/1x1/nu.svg)}.flag-icon-nz{background-image:url(../flags/4x3/nz.svg)}.flag-icon-nz.flag-icon-squared{background-image:url(../flags/1x1/nz.svg)}.flag-icon-om{background-image:url(../flags/4x3/om.svg)}.flag-icon-om.flag-icon-squared{background-image:url(../flags/1x1/om.svg)}.flag-icon-pa{background-image:url(../flags/4x3/pa.svg)}.flag-icon-pa.flag-icon-squared{background-image:url(../flags/1x1/pa.svg)}.flag-icon-pe{background-image:url(../flags/4x3/pe.svg)}.flag-icon-pe.flag-icon-squared{background-image:url(../flags/1x1/pe.svg)}.flag-icon-pf{background-image:url(../flags/4x3/pf.svg)}.flag-icon-pf.flag-icon-squared{background-image:url(../flags/1x1/pf.svg)}.flag-icon-pg{background-image:url(../flags/4x3/pg.svg)}.flag-icon-pg.flag-icon-squared{background-image:url(../flags/1x1/pg.svg)}.flag-icon-ph{background-image:url(../flags/4x3/ph.svg)}.flag-icon-ph.flag-icon-squared{background-image:url(../flags/1x1/ph.svg)}.flag-icon-pk{background-image:url(../flags/4x3/pk.svg)}.flag-icon-pk.flag-icon-squared{background-image:url(../flags/1x1/pk.svg)}.flag-icon-pl{background-image:url(../flags/4x3/pl.svg)}.flag-icon-pl.flag-icon-squared{background-image:url(../flags/1x1/pl.svg)}.flag-icon-pm{background-image:url(../flags/4x3/pm.svg)}.flag-icon-pm.flag-icon-squared{background-image:url(../flags/1x1/pm.svg)}.flag-icon-pn{background-image:url(../flags/4x3/pn.svg)}.flag-icon-pn.flag-icon-squared{background-image:url(../flags/1x1/pn.svg)}.flag-icon-pr{background-image:url(../flags/4x3/pr.svg)}.flag-icon-pr.flag-icon-squared{background-image:url(../flags/1x1/pr.svg)}.flag-icon-ps{background-image:url(../flags/4x3/ps.svg)}.flag-icon-ps.flag-icon-squared{background-image:url(../flags/1x1/ps.svg)}.flag-icon-pt{background-image:url(../flags/4x3/pt.svg)}.flag-icon-pt.flag-icon-squared{background-image:url(../flags/1x1/pt.svg)}.flag-icon-pw{background-image:url(../flags/4x3/pw.svg)}.flag-icon-pw.flag-icon-squared{background-image:url(../flags/1x1/pw.svg)}.flag-icon-py{background-image:url(../flags/4x3/py.svg)}.flag-icon-py.flag-icon-squared{background-image:url(../flags/1x1/py.svg)}.flag-icon-qa{background-image:url(../flags/4x3/qa.svg)}.flag-icon-qa.flag-icon-squared{background-image:url(../flags/1x1/qa.svg)}.flag-icon-re{background-image:url(../flags/4x3/re.svg)}.flag-icon-re.flag-icon-squared{background-image:url(../flags/1x1/re.svg)}.flag-icon-ro{background-image:url(../flags/4x3/ro.svg)}.flag-icon-ro.flag-icon-squared{background-image:url(../flags/1x1/ro.svg)}.flag-icon-rs{background-image:url(../flags/4x3/rs.svg)}.flag-icon-rs.flag-icon-squared{background-image:url(../flags/1x1/rs.svg)}.flag-icon-ru{background-image:url(../flags/4x3/ru.svg)}.flag-icon-ru.flag-icon-squared{background-image:url(../flags/1x1/ru.svg)}.flag-icon-rw{background-image:url(../flags/4x3/rw.svg)}.flag-icon-rw.flag-icon-squared{background-image:url(../flags/1x1/rw.svg)}.flag-icon-sa{background-image:url(../flags/4x3/sa.svg)}.flag-icon-sa.flag-icon-squared{background-image:url(../flags/1x1/sa.svg)}.flag-icon-sb{background-image:url(../flags/4x3/sb.svg)}.flag-icon-sb.flag-icon-squared{background-image:url(../flags/1x1/sb.svg)}.flag-icon-sc{background-image:url(../flags/4x3/sc.svg)}.flag-icon-sc.flag-icon-squared{background-image:url(../flags/1x1/sc.svg)}.flag-icon-sd{background-image:url(../flags/4x3/sd.svg)}.flag-icon-sd.flag-icon-squared{background-image:url(../flags/1x1/sd.svg)}.flag-icon-se{background-image:url(../flags/4x3/se.svg)}.flag-icon-se.flag-icon-squared{background-image:url(../flags/1x1/se.svg)}.flag-icon-sg{background-image:url(../flags/4x3/sg.svg)}.flag-icon-sg.flag-icon-squared{background-image:url(../flags/1x1/sg.svg)}.flag-icon-sh{background-image:url(../flags/4x3/sh.svg)}.flag-icon-sh.flag-icon-squared{background-image:url(../flags/1x1/sh.svg)}.flag-icon-si{background-image:url(../flags/4x3/si.svg)}.flag-icon-si.flag-icon-squared{background-image:url(../flags/1x1/si.svg)}.flag-icon-sj{background-image:url(../flags/4x3/sj.svg)}.flag-icon-sj.flag-icon-squared{background-image:url(../flags/1x1/sj.svg)}.flag-icon-sk{background-image:url(../flags/4x3/sk.svg)}.flag-icon-sk.flag-icon-squared{background-image:url(../flags/1x1/sk.svg)}.flag-icon-sl{background-image:url(../flags/4x3/sl.svg)}.flag-icon-sl.flag-icon-squared{background-image:url(../flags/1x1/sl.svg)}.flag-icon-sm{background-image:url(../flags/4x3/sm.svg)}.flag-icon-sm.flag-icon-squared{background-image:url(../flags/1x1/sm.svg)}.flag-icon-sn{background-image:url(../flags/4x3/sn.svg)}.flag-icon-sn.flag-icon-squared{background-image:url(../flags/1x1/sn.svg)}.flag-icon-so{background-image:url(../flags/4x3/so.svg)}.flag-icon-so.flag-icon-squared{background-image:url(../flags/1x1/so.svg)}.flag-icon-sr{background-image:url(../flags/4x3/sr.svg)}.flag-icon-sr.flag-icon-squared{background-image:url(../flags/1x1/sr.svg)}.flag-icon-ss{background-image:url(../flags/4x3/ss.svg)}.flag-icon-ss.flag-icon-squared{background-image:url(../flags/1x1/ss.svg)}.flag-icon-st{background-image:url(../flags/4x3/st.svg)}.flag-icon-st.flag-icon-squared{background-image:url(../flags/1x1/st.svg)}.flag-icon-sv{background-image:url(../flags/4x3/sv.svg)}.flag-icon-sv.flag-icon-squared{background-image:url(../flags/1x1/sv.svg)}.flag-icon-sx{background-image:url(../flags/4x3/sx.svg)}.flag-icon-sx.flag-icon-squared{background-image:url(../flags/1x1/sx.svg)}.flag-icon-sy{background-image:url(../flags/4x3/sy.svg)}.flag-icon-sy.flag-icon-squared{background-image:url(../flags/1x1/sy.svg)}.flag-icon-sz{background-image:url(../flags/4x3/sz.svg)}.flag-icon-sz.flag-icon-squared{background-image:url(../flags/1x1/sz.svg)}.flag-icon-tc{background-image:url(../flags/4x3/tc.svg)}.flag-icon-tc.flag-icon-squared{background-image:url(../flags/1x1/tc.svg)}.flag-icon-td{background-image:url(../flags/4x3/td.svg)}.flag-icon-td.flag-icon-squared{background-image:url(../flags/1x1/td.svg)}.flag-icon-tf{background-image:url(../flags/4x3/tf.svg)}.flag-icon-tf.flag-icon-squared{background-image:url(../flags/1x1/tf.svg)}.flag-icon-tg{background-image:url(../flags/4x3/tg.svg)}.flag-icon-tg.flag-icon-squared{background-image:url(../flags/1x1/tg.svg)}.flag-icon-th{background-image:url(../flags/4x3/th.svg)}.flag-icon-th.flag-icon-squared{background-image:url(../flags/1x1/th.svg)}.flag-icon-tj{background-image:url(../flags/4x3/tj.svg)}.flag-icon-tj.flag-icon-squared{background-image:url(../flags/1x1/tj.svg)}.flag-icon-tk{background-image:url(../flags/4x3/tk.svg)}.flag-icon-tk.flag-icon-squared{background-image:url(../flags/1x1/tk.svg)}.flag-icon-tl{background-image:url(../flags/4x3/tl.svg)}.flag-icon-tl.flag-icon-squared{background-image:url(../flags/1x1/tl.svg)}.flag-icon-tm{background-image:url(../flags/4x3/tm.svg)}.flag-icon-tm.flag-icon-squared{background-image:url(../flags/1x1/tm.svg)}.flag-icon-tn{background-image:url(../flags/4x3/tn.svg)}.flag-icon-tn.flag-icon-squared{background-image:url(../flags/1x1/tn.svg)}.flag-icon-to{background-image:url(../flags/4x3/to.svg)}.flag-icon-to.flag-icon-squared{background-image:url(../flags/1x1/to.svg)}.flag-icon-tr{background-image:url(../flags/4x3/tr.svg)}.flag-icon-tr.flag-icon-squared{background-image:url(../flags/1x1/tr.svg)}.flag-icon-tt{background-image:url(../flags/4x3/tt.svg)}.flag-icon-tt.flag-icon-squared{background-image:url(../flags/1x1/tt.svg)}.flag-icon-tv{background-image:url(../flags/4x3/tv.svg)}.flag-icon-tv.flag-icon-squared{background-image:url(../flags/1x1/tv.svg)}.flag-icon-tw{background-image:url(../flags/4x3/tw.svg)}.flag-icon-tw.flag-icon-squared{background-image:url(../flags/1x1/tw.svg)}.flag-icon-tz{background-image:url(../flags/4x3/tz.svg)}.flag-icon-tz.flag-icon-squared{background-image:url(../flags/1x1/tz.svg)}.flag-icon-ua{background-image:url(../flags/4x3/ua.svg)}.flag-icon-ua.flag-icon-squared{background-image:url(../flags/1x1/ua.svg)}.flag-icon-ug{background-image:url(../flags/4x3/ug.svg)}.flag-icon-ug.flag-icon-squared{background-image:url(../flags/1x1/ug.svg)}.flag-icon-um{background-image:url(../flags/4x3/um.svg)}.flag-icon-um.flag-icon-squared{background-image:url(../flags/1x1/um.svg)}.flag-icon-us{background-image:url(../flags/4x3/us.svg)}.flag-icon-us.flag-icon-squared{background-image:url(../flags/1x1/us.svg)}.flag-icon-uy{background-image:url(../flags/4x3/uy.svg)}.flag-icon-uy.flag-icon-squared{background-image:url(../flags/1x1/uy.svg)}.flag-icon-uz{background-image:url(../flags/4x3/uz.svg)}.flag-icon-uz.flag-icon-squared{background-image:url(../flags/1x1/uz.svg)}.flag-icon-va{background-image:url(../flags/4x3/va.svg)}.flag-icon-va.flag-icon-squared{background-image:url(../flags/1x1/va.svg)}.flag-icon-vc{background-image:url(../flags/4x3/vc.svg)}.flag-icon-vc.flag-icon-squared{background-image:url(../flags/1x1/vc.svg)}.flag-icon-ve{background-image:url(../flags/4x3/ve.svg)}.flag-icon-ve.flag-icon-squared{background-image:url(../flags/1x1/ve.svg)}.flag-icon-vg{background-image:url(../flags/4x3/vg.svg)}.flag-icon-vg.flag-icon-squared{background-image:url(../flags/1x1/vg.svg)}.flag-icon-vi{background-image:url(../flags/4x3/vi.svg)}.flag-icon-vi.flag-icon-squared{background-image:url(../flags/1x1/vi.svg)}.flag-icon-vn{background-image:url(../flags/4x3/vn.svg)}.flag-icon-vn.flag-icon-squared{background-image:url(../flags/1x1/vn.svg)}.flag-icon-vu{background-image:url(../flags/4x3/vu.svg)}.flag-icon-vu.flag-icon-squared{background-image:url(../flags/1x1/vu.svg)}.flag-icon-wf{background-image:url(../flags/4x3/wf.svg)}.flag-icon-wf.flag-icon-squared{background-image:url(../flags/1x1/wf.svg)}.flag-icon-ws{background-image:url(../flags/4x3/ws.svg)}.flag-icon-ws.flag-icon-squared{background-image:url(../flags/1x1/ws.svg)}.flag-icon-ye{background-image:url(../flags/4x3/ye.svg)}.flag-icon-ye.flag-icon-squared{background-image:url(../flags/1x1/ye.svg)}.flag-icon-yt{background-image:url(../flags/4x3/yt.svg)}.flag-icon-yt.flag-icon-squared{background-image:url(../flags/1x1/yt.svg)}.flag-icon-za{background-image:url(../flags/4x3/za.svg)}.flag-icon-za.flag-icon-squared{background-image:url(../flags/1x1/za.svg)}.flag-icon-zm{background-image:url(../flags/4x3/zm.svg)}.flag-icon-zm.flag-icon-squared{background-image:url(../flags/1x1/zm.svg)}.flag-icon-zw{background-image:url(../flags/4x3/zw.svg)}.flag-icon-zw.flag-icon-squared{background-image:url(../flags/1x1/zw.svg)}
+\ No newline at end of file
++.flag-icon,.flag-icon-background{background-repeat:no-repeat;background-size:contain;background-position:50%}.flag-icon{position:relative;display:inline-block;width:1.33333333em;line-height:1em}.flag-icon:before{content:"\00a0"}.flag-icon-cn{background-image:url(../flags/4x3/cn.svg)}.flag-icon-cz{background-image:url(../flags/4x3/cz.svg)}.flag-icon-de{background-image:url(../flags/4x3/de.svg)}.flag-icon-es{background-image:url(../flags/4x3/es.svg)}.flag-icon-fr{background-image:url(../flags/4x3/fr.svg)}.flag-icon-it{background-image:url(../flags/4x3/it.svg)}.flag-icon-nl{background-image:url(../flags/4x3/nl.svg)}.flag-icon-pl{background-image:url(../flags/4x3/pl.svg)}.flag-icon-ru{background-image:url(../flags/4x3/ru.svg)}.flag-icon-th{background-image:url(../flags/4x3/th.svg)}.flag-icon-tr{background-image:url(../flags/4x3/tr.svg)}.flag-icon-tw{background-image:url(../flags/4x3/tw.svg)}.flag-icon-us{background-image:url(../flags/4x3/us.svg)}
+\ No newline at end of file
index 052f2d81e8cd4f9c3a1b5b37cbb5082813c55507..3fcd321bbcd0ee36acc754f2192db8dcd78a7232 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wget
-PKG_VERSION:=1.18
+PKG_VERSION:=1.19.2
 PKG_RELEASE:=2
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=af9ca95a4bb8ac4a9bf10aeae66fa5ec
-PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
+PKG_HASH:=4f4a673b6d466efa50fbfba796bd84a46ae24e370fa562ede5b21ab53c11a920
+PKG_MAINTAINER:=Peter Wagner <tripolar@gmx.at>
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
 
@@ -66,6 +66,7 @@ endef
 CONFIGURE_ARGS+= \
        --disable-rpath \
        --disable-iri \
+       --with-included-libunistring \
        --without-libuuid
 
 CONFIGURE_VARS += \
diff --git a/net/wifidog-ng/Makefile b/net/wifidog-ng/Makefile
new file mode 100644 (file)
index 0000000..f95d596
--- /dev/null
@@ -0,0 +1,103 @@
+#
+# Copyright (C) 2014-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:=wifidog-ng
+PKG_VERSION:=1.2.4
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+PKG_SOURCE_URL=https://github.com/zhaojh329/wifidog-ng.git
+PKG_MIRROR_HASH:=e437366d73f3becb61701560d88740fb097b8060b636febe3ad872831c83b598
+
+PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_MAINTAINER:=Jianhui Zhao <jianhuizhao329@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/wifidog-ng/default
+  SUBMENU:=Captive Portals
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Next generation WifiDog
+  DEPENDS:=+kmod-wifidog-ng +libuci +libuclient +libblobmsg-json +libubus +libcares
+endef
+
+define Package/wifidog-ng-nossl
+  $(Package/wifidog-ng/default)
+  TITLE += (NO SSL)
+  DEPENDS += +libuhttpd-nossl
+  VARIANT:=nossl
+  CONFLICTS:=wifidog-ng-openssl wifidog-ng-wolfssl wifidog-ng-mbedtls
+endef
+
+define Package/wifidog-ng-openssl
+  $(Package/wifidog-ng/default)
+  TITLE += (openssl)
+  DEPENDS += +libuhttpd-openssl
+  VARIANT:=openssl
+  CONFLICTS:=wifidog-ng-wolfssl wifidog-ng-mbedtls
+endef
+
+define Package/wifidog-ng-wolfssl
+  $(Package/wifidog-ng/default)
+  TITLE += (wolfssl)
+  DEPENDS += +libuhttpd-wolfssl
+  VARIANT:=wolfssl
+  CONFLICTS:=wifidog-ng-mbedtls
+endef
+
+define Package/wifidog-ng-mbedtls
+  $(Package/wifidog-ng/default)
+  TITLE += (mbedtls)
+  DEPENDS += +libuhttpd-mbedtls
+  VARIANT:=mbedtls
+endef
+
+define Package/wifidog-ng/default/install
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d $(1)/etc/config $(1)/etc/wifidog-ng
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wifidog-ng $(1)/usr/bin
+       $(INSTALL_BIN) ./files/wifidog-ng.init $(1)/etc/init.d/wifidog-ng
+       $(INSTALL_CONF) ./files/wifidog-ng.config $(1)/etc/config/wifidog-ng
+       $(INSTALL_CONF) ./files/wifidog-ng.key $(1)/etc/wifidog-ng
+       $(INSTALL_CONF) ./files/wifidog-ng.crt $(1)/etc/wifidog-ng
+endef
+
+Package/wifidog-ng-nossl/install = $(Package/wifidog-ng/default/install)
+Package/wifidog-ng-openssl/install = $(Package/wifidog-ng/default/install)
+Package/wifidog-ng-wolfssl/install = $(Package/wifidog-ng/default/install)
+Package/wifidog-ng-mbedtls/install = $(Package/wifidog-ng/default/install)
+
+include $(INCLUDE_DIR)/kernel.mk
+
+define KernelPackage/wifidog-ng
+  SUBMENU:=Other modules
+  TITLE:=Kernel module for wifidog-ng
+  DEPENDS:=+kmod-nf-nat
+  FILES:=$(PKG_BUILD_DIR)/kmod/wifidog-ng.ko
+endef
+
+include $(INCLUDE_DIR)/kernel-defaults.mk
+
+define Build/Compile
+       $(call Build/Compile/Default)
+       $(MAKE) $(KERNEL_MAKEOPTS) SUBDIRS="$(PKG_BUILD_DIR)"/kmod modules
+endef
+
+$(eval $(call BuildPackage,wifidog-ng-nossl))
+$(eval $(call BuildPackage,wifidog-ng-mbedtls))
+$(eval $(call BuildPackage,wifidog-ng-wolfssl))
+$(eval $(call BuildPackage,wifidog-ng-openssl))
+
+$(eval $(call KernelPackage,wifidog-ng))
diff --git a/net/wifidog-ng/files/wifidog-ng.config b/net/wifidog-ng/files/wifidog-ng.config
new file mode 100644 (file)
index 0000000..42b95ee
--- /dev/null
@@ -0,0 +1,24 @@
+config gateway
+    option enabled 1
+    option ifname 'br-lan'
+    option port 2060
+    option ssl_port 8443
+    option checkinterval 30
+    option client_timeout 5
+    option temppass_time 30
+config authserver
+    option host 'authserver.com'
+    option port 80
+    option path '/wifidog/'
+    option login_path 'login'
+    option portal_path 'portal'
+    option msg_path 'gw_message.php'
+    option ping_path 'ping'
+    option auth_path 'auth'
+
+config popularserver
+    list server www.baidu.com
+    list server www.qq.com
+
+config whitelist
diff --git a/net/wifidog-ng/files/wifidog-ng.crt b/net/wifidog-ng/files/wifidog-ng.crt
new file mode 100644 (file)
index 0000000..9fb965b
--- /dev/null
@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIID8TCCAtmgAwIBAgICCCUwDQYJKoZIhvcNAQELBQAwczELMAkGA1UEBhMCQ04x
+EDAOBgNVBAgMB1RpYW5qaW4xEDAOBgNVBAcMB1RpYW5qaW4xFTATBgNVBAoMDENI
+SU5BU1NMIEluYzEpMCcGA1UEAwwgQ0hJTkFTU0wgQ2VydGlmaWNhdGlvbiBBdXRo
+b3JpdHkwHhcNMTgwMzAzMTQyODQ2WhcNMTkwMzAzMTQyODQ2WjCBgzELMAkGA1UE
+BhMCQ04xEDAOBgNVBAgMB3NpY2h1YW4xEjAQBgNVBAoMCXpoYW9qaDMyOTETMBEG
+A1UECwwKd2lmaWRvZy1uZzEQMA4GA1UEAwwHd2lmaWRvZzEnMCUGCSqGSIb3DQEJ
+ARYYamlhbmh1aXpoYW8zMjlAZ21haWwuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOC
+AQ8AMIIBCgKCAQEAyD8gd3XIJvkYeySP2q0toYsfvhlA+lceUPiMi16U1nR3TD5U
+uTNGsvYBDMiR7vG0NKClFT73u/d8HBcYcTBgbhHfBkz4v9S5aMdUYQsUMQEITBdE
+hPEeXVqqj796Lu6iEkNUFrtam2h3t+kYODjbszk2woBtohaRWfNyOB/AJH6Stv4l
+jkPYwt9NHcKQSm9kjcGsAqQwkgVd4UfHX2G20gaTijimeHlJL2wv61uLBUvYux0E
++98KIcEIYu3BVAfoO2Omg/o73cwH+sFTswEXPuXirwrOzmJ850WBLScLkSKSATrY
+1YdU6CRaJuP/POFfSqAhn/mPRNQFU5fAaDcfEwIDAQABo34wfDAJBgNVHRMEAjAA
+MC8GCWCGSAGG+EIBDQQiFiBDSElOQVNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0
+eTAdBgNVHQ4EFgQU9XS4dW6j1r1lEOIHWkoJx3zSqqgwHwYDVR0jBBgwFoAUXB8j
++sjhITHC2Df2iPzSb8JUQzMwDQYJKoZIhvcNAQELBQADggEBAFsaq5qehwp0zMqY
+cb0IX5/f4ZnscX587SM/NhORODa0p/bT3EwG3grtljHhRW+s/4c4gPgilrzV0Fxn
+Y5FodLfFdbNVjhgeSrDCRmwIvKSe81LYOe+rbfTBF0g3YYWDwcwc8tFvcwWBxqWn
+4F+u9aIKgHU7HXQokqCxEOTFjrAHVJf1OqtRMTXlBBb6ypVdHn0glfSxOIC/Vp2T
+5UR7oVdD4E8ASqe7Q7MmTeY377CRagfd0WD9XK7o+cbKkLLW1QWc8ht1rHjGp+/2
+gmkxEmpX2Xhpv1FX/b6sj1dTmOc2bXBzpvV6yonRMu5dYsOrdDwbH/T05X+hCFW9
+G86ZLFY=
+-----END CERTIFICATE-----
diff --git a/net/wifidog-ng/files/wifidog-ng.init b/net/wifidog-ng/files/wifidog-ng.init
new file mode 100755 (executable)
index 0000000..1a9be3d
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh /etc/rc.common
+
+USE_PROCD=1
+START=95
+
+BIN=/usr/bin/wifidog-ng
+
+parse_whitelist() {
+    local cfg="$1"
+    local domain mac
+
+    uci_validate_section wifidog-ng whitelist "${1}" \
+        'domain:list(host)' \
+        'mac:list(macaddr)'
+
+    [ $? -ne 0 ] && {
+        echo "validation failed" >&2
+        exit 1
+    }
+
+    for m in $mac; do
+        echo "!$m" > /proc/wifidog-ng/term
+    done
+}
+
+start_service() {
+    modprobe wifidog-ng
+
+    config_load wifidog-ng
+    config_foreach parse_whitelist whitelist
+
+    procd_open_instance
+    procd_set_param command $BIN
+    procd_set_param respawn
+    procd_close_instance
+}
+
+stop_service() {
+    rmmod wifidog-ng
+}
diff --git a/net/wifidog-ng/files/wifidog-ng.key b/net/wifidog-ng/files/wifidog-ng.key
new file mode 100644 (file)
index 0000000..6f56d74
--- /dev/null
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDIPyB3dcgm+Rh7
+JI/arS2hix++GUD6Vx5Q+IyLXpTWdHdMPlS5M0ay9gEMyJHu8bQ0oKUVPve793wc
+FxhxMGBuEd8GTPi/1Llox1RhCxQxAQhMF0SE8R5dWqqPv3ou7qISQ1QWu1qbaHe3
+6Rg4ONuzOTbCgG2iFpFZ83I4H8AkfpK2/iWOQ9jC300dwpBKb2SNwawCpDCSBV3h
+R8dfYbbSBpOKOKZ4eUkvbC/rW4sFS9i7HQT73wohwQhi7cFUB+g7Y6aD+jvdzAf6
+wVOzARc+5eKvCs7OYnznRYEtJwuRIpIBOtjVh1ToJFom4/884V9KoCGf+Y9E1AVT
+l8BoNx8TAgMBAAECggEAK/JmvrDzt1HtxIDWrWhaXly5H7BNKWPbPGv/9EpSoeo3
+kF0RnP+a4YXJ3zNZi7YyFWa4NDx4hCEhdMzAyX6TezSi3LAh23/lHRC5/P5AdSzD
+1Gc6225LerN+QUQFna0zlox+NOrzTK4VsCAQ963K0b+ZvAARj4QibDpYc+bL9XYK
+fVrZSnGJhNY3S6YjTF4oyMejKxk+HPhgCVEcZCHiC0RmXVqfETe6Cu0UtDPTTK5Q
+IXYYZ0HLsqaGWwGCWm/ji6HjNCG1dUhUp/yZR+7X45Utok3Rd3wo0kxZGJ7LHH4N
+541qcFbaT3rX39uPypuK5dSc5lb98FAOl79jL/wnUQKBgQDjEycf6VKZYf8d/MMV
+4+0YrFV7sdi0k4TC+lFmfJZVFHqcPn99q3cO2b9npgLDpQpwpcyBGMh6hWufVXXA
+ctrxg8vjKBHG8MT70Lulvi+G3Fldw7EHVVQGEHRqPaSzA035JyVanDs6lgoqjj9b
+BuMQidIeaj2t28pEhc0rYstW6wKBgQDhwRzoCirKrtJDWclDkjbzkGUfoAKMz2p2
+mSAs2xCdrx8vtFzUXcCLsvlXa+hIEe4O5cUZg+WLPfXiV4gtF74PTkmYADXRTUBl
+dHzfjVWQINEYFsWOEP5eYB0VWiA52JUaCuHuHILt6CSy3h8xPtnq+/oEFTeqh/2C
+XoN+seKeeQKBgQDUE1c/HpLeXf/+6crp7u3JVWqhFADo5b3gvBi6NzHQVEgPFO/N
+Vw7i98sj6pA6WTHe83qEN7lFdMaHETHgg2SonAcYKJwxyTywUspuiampsrJkOBhm
+WPMYltWjQ99GsZdpU343miJXHTpxdFkHku8OyylK7r6cWeIXDUAJfUOb8QKBgFbk
+ZoTljOzwdxvXTkFE4QPEmzed9f1OxHKbo6fANdgLlJxe9rAC2d6rZ49/iCtdQ1zW
+kZOtkceTdLXG7TI2BkCL6IWp5w0Fh/jE6l99XeaYywJTmXyCC/Y1VlxmkSrSsykP
+8UAeF0MM7DswhZ8FywjILcYuiHuJ1ki8qi40t745AoGAT/5imiro59cHMbbGEQb+
+42oBY7RxeHkk6+8WTJA6kqv8tuOK3gvDFm5cRJVCduVF/Jf+276IMoTMEb8kBGQA
+R3CRsYwLPrpdWu2q9Ho1KtH+azt/d+3uglT9g3fhvFieNIwkRgaNNJQC6wmddDeG
+MEYv4HO1LykipsDVsFadVCk=
+-----END PRIVATE KEY-----
index 591f29107b294ed5c67c69f40fbad91f588b032e..3cf0c2208b51e33c67ac87c7f6d21a23fac40396 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wifidog
 PKG_VERSION:=1.3.0
-PKG_RELEASE=1
+PKG_RELEASE:=2
 
 
 PKG_LICENSE:=GPL-2.0
@@ -20,10 +20,11 @@ PKG_LICENSE_FILES:=COPYING
 
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://github.com/wifidog/wifidog-gateway.git
+PKG_SOURCE_URL:=https://github.com/wifidog/wifidog-gateway
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=1.3.0
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=9ffd9f3ae54baceb723abb7a04e27a9b6a3ff1479f8a3bfda9b8a496e8b4050f
 
 PKG_FIXUP:=autoreconf
 # do not run make install
index a9dd3f7fc14a2a168717f642efad306e13b72e52..893b7749bf0e203eeef2fefb7ef3c7374aca4ced 100644 (file)
@@ -16,7 +16,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wifischedule
 PKG_VERSION:=1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=PRPL
 
 PKG_MAINTAINER:=Nils Koenig <openwrt@newk.it> 
@@ -28,6 +28,7 @@ define Package/wifischedule
   TITLE:=Turns WiFi on and off according to a schedule
   SECTION:=net
   CATEGORY:=Network
+  PKGARCH:=all
 endef
 
 define Package/wifischedule/description
@@ -38,6 +39,12 @@ define Package/wifischedule/conffiles
 /etc/config/wifi_schedule
 endef
 
+define Build/Prepare
+endef
+
+define Build/Configure
+endef
+
 define Build/Compile
 endef
 
diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile
deleted file mode 100644 (file)
index 8dacfeb..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-#
-# Copyright (C) 2016 Jason A. Donenfeld <Jason@zx2c4.com>
-# Copyright (C) 2016 Baptiste Jonglez <openwrt@bitsofnetworks.org>
-# Copyright (C) 2016-2017 Dan Luedtke <mail@danrl.com>
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-
-include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/kernel.mk
-
-PKG_NAME:=wireguard
-
-PKG_VERSION:=0.0.20170115
-PKG_RELEASE:=1
-
-PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/
-PKG_MD5SUM:=7e5f9f4699a2d4ace90d0df5d81bf0f67205ee08c45b95e0acc379bedef5ffe8
-
-PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILES:=COPYING
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/WireGuard-$(PKG_VERSION)
-PKG_BUILD_PARALLEL:=1
-PKG_USE_MIPS16:=0
-
-# Wireguard's makefile needs this to know where to build the kernel module
-export KERNELDIR:=$(LINUX_DIR)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/wireguard/Default
-  SECTION:=net
-  CATEGORY:=Network
-  URL:=https://www.wireguard.io
-  MAINTAINER:=Baptiste Jonglez <openwrt@bitsofnetworks.org>, \
-              Dan Luedtke <mail@danrl.com>
-endef
-
-define Package/wireguard/Default/description
-  WireGuard is a novel VPN that runs inside the Linux Kernel and utilizes
-  state-of-the-art cryptography. It aims to be faster, simpler, leaner, and
-  more useful than IPSec, while avoiding the massive headache. It intends to
-  be considerably more performant than OpenVPN.  WireGuard is designed as a
-  general purpose VPN for running on embedded interfaces and super computers
-  alike, fit for many different circumstances.
-  It runs over UDP.
-endef
-
-define Package/wireguard
-  $(call Package/wireguard/Default)
-  TITLE:=Wireguard meta-package
-  DEPENDS:=+wireguard-tools +kmod-wireguard
-endef
-
-include $(INCLUDE_DIR)/kernel-defaults.mk
-include $(INCLUDE_DIR)/package-defaults.mk
-
-# Used by Build/Compile/Default
-MAKE_PATH:=src/tools
-
-define Build/Compile
-       $(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)/src" modules
-       $(call Build/Compile/Default)
-endef
-
-define Package/wireguard/description
-  $(call Package/wireguard/Default/description)
-endef
-
-define Package/wireguard-tools
-  $(call Package/wireguard/Default)
-  TITLE:=Wireguard userspace control program (wg)
-  DEPENDS:=+libmnl
-endef
-
-define Package/wireguard-tools/description
-  $(call Package/wireguard/Default/description)
-
-  This package provides the userspace control program for wireguard, `wg`,
-  and a netifd protocol helper.
-endef
-
-define Package/wireguard-tools/install
-       $(INSTALL_DIR) $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tools/wg $(1)/usr/bin/
-       $(INSTALL_DIR) $(1)/lib/netifd/proto/
-       $(INSTALL_BIN) ./files/wireguard.sh $(1)/lib/netifd/proto/
-endef
-
-define KernelPackage/wireguard
-  SECTION:=kernel
-  CATEGORY:=Kernel modules
-  SUBMENU:=Network Support
-  TITLE:=Wireguard kernel module
-  DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4 +kmod-ipt-hashlimit
-  FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX)
-  AUTOLOAD:=$(call AutoProbe,wireguard)
-endef
-
-define KernelPackage/wireguard/description
-  $(call Package/wireguard/Default/description)
-
-  This package provides the kernel module for wireguard.
-endef
-
-$(eval $(call BuildPackage,wireguard))
-$(eval $(call BuildPackage,wireguard-tools))
-$(eval $(call KernelPackage,wireguard))
diff --git a/net/wireguard/files/wireguard.sh b/net/wireguard/files/wireguard.sh
deleted file mode 100644 (file)
index 2eb3024..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-#!/bin/sh
-# Copyright 2016-2017 Dan Luedtke <mail@danrl.com>
-# Licensed to the public under the Apache License 2.0.
-
-
-WG=/usr/bin/wg
-if [ ! -x $WG ]; then
-  logger -t "wireguard" "error: missing wireguard-tools (${WG})"
-  exit 0
-fi
-
-
-[ -n "$INCLUDE_ONLY" ] || {
-  . /lib/functions.sh
-  . ../netifd-proto.sh
-  init_proto "$@"
-}
-
-
-proto_wireguard_init_config() {
-  proto_config_add_string "private_key"
-  proto_config_add_int    "listen_port"
-  proto_config_add_int    "mtu"
-  proto_config_add_string "preshared_key"
-  available=1
-  no_proto_task=1
-}
-
-
-proto_wireguard_setup_peer() {
-  local peer_config="$1"
-
-  local public_key
-  local allowed_ips
-  local route_allowed_ips
-  local endpoint_host
-  local endpoint_port
-  local persistent_keepalive
-
-  config_get      public_key           "${peer_config}" "public_key"
-  config_get      allowed_ips          "${peer_config}" "allowed_ips"
-  config_get_bool route_allowed_ips    "${peer_config}" "route_allowed_ips" 0
-  config_get      endpoint_host        "${peer_config}" "endpoint_host"
-  config_get      endpoint_port        "${peer_config}" "endpoint_port"
-  config_get      persistent_keepalive "${peer_config}" "persistent_keepalive"
-
-  # peer configuration
-  echo "[Peer]"                                         >> "${wg_cfg}"
-  echo "PublicKey=${public_key}"                        >> "${wg_cfg}"
-  for allowed_ip in $allowed_ips; do
-    echo "AllowedIPs=${allowed_ip}"                     >> "${wg_cfg}"
-  done
-  if [ "${endpoint_host}" ]; then
-    case "${endpoint_host}" in
-      *:*)
-        endpoint="[${endpoint_host}]"
-      ;;
-      *)
-        endpoint="${endpoint_host}"
-      ;;
-    esac
-    if [ "${endpoint_port}" ]; then
-      endpoint="${endpoint}:${endpoint_port}"
-    else
-      endpoint="${endpoint}:51820"
-    fi
-    echo "Endpoint=${endpoint}"                         >> "${wg_cfg}"
-  fi
-  if [ "${persistent_keepalive}" ]; then
-    echo "PersistentKeepalive=${persistent_keepalive}"  >> "${wg_cfg}"
-  fi
-
-  # add routes for allowed ips
-  if [ ${route_allowed_ips} -ne 0 ]; then
-    for allowed_ip in ${allowed_ips}; do
-      case "${allowed_ip}" in
-        *:*/*)
-          proto_add_ipv6_route "${allowed_ip%%/*}" "${allowed_ip##*/}"
-        ;;
-        */*)
-          proto_add_ipv4_route "${allowed_ip%%/*}" "${allowed_ip##*/}"
-        ;;
-      esac
-    done
-  fi
-}
-
-
-proto_wireguard_setup() {
-  local config="$1"
-  local wg_dir="/tmp/wireguard"
-  local wg_cfg="${wg_dir}/${config}"
-
-  local private_key
-  local listen_port
-  local mtu
-  local preshared_key
-
-  # load configuration
-  config_load network
-  config_get private_key   "${config}" "private_key"
-  config_get listen_port   "${config}" "listen_port"
-  config_get addresses     "${config}" "addresses"
-  config_get mtu           "${config}" "mtu"
-  config_get preshared_key "${config}" "preshared_key"
-
-  # create interface
-  ip link del dev "${config}" 2>/dev/null
-  ip link add dev "${config}" type wireguard
-
-  if [ "${mtu}" ]; then
-    ip link set mtu "${mtu}" dev "${config}"
-  fi
-
-  proto_init_update "${config}" 1
-
-  # generate configuration file
-  umask 077
-  mkdir -p "${wg_dir}"
-  echo "[Interface]"                     >  "${wg_cfg}"
-  echo "PrivateKey=${private_key}"       >> "${wg_cfg}"
-  if [ "${listen_port}" ]; then
-    echo "ListenPort=${listen_port}"     >> "${wg_cfg}"
-  fi
-  if [ "${preshared_key}" ]; then
-    echo "PresharedKey=${preshared_key}" >> "${wg_cfg}"
-  fi
-  config_foreach proto_wireguard_setup_peer "wireguard_${config}"
-
-  # apply configuration file
-  ${WG} setconf ${config} "${wg_cfg}"
-  WG_RETURN=$?
-
-  # delete configuration file
-  rm -f "${wg_cfg}"
-
-  # check status
-  if [ ${WG_RETURN} -ne 0 ]; then
-    sleep 5
-    proto_setup_failed "${config}"
-    exit 1
-  fi
-
-  # add ip addresses
-  for address in ${addresses}; do
-    case "${address}" in
-      *:*/*)
-        proto_add_ipv6_address "${address%%/*}" "${address##*/}"
-      ;;
-      *.*/*)
-        proto_add_ipv4_address "${address%%/*}" "${address##*/}"
-      ;;
-      *:*)
-        proto_add_ipv6_address "${address%%/*}" "128"
-      ;;
-      *.*)
-        proto_add_ipv4_address "${address%%/*}" "32"
-      ;;
-    esac
-  done
-
-  # endpoint dependency
-  wg show "${config}" endpoints | \
-    sed -E 's/\[?([0-9.:a-f]+)\]?:([0-9]+)/\1 \2/' | \
-    while IFS=$'\t ' read -r key address port; do
-    [ -n "${port}" ] || continue
-    echo "adding host depedency for ${address} at ${config}"
-    proto_add_host_dependency "${config}" "${address}"
-  done
-
-  proto_send_update "${config}"
-}
-
-
-proto_wireguard_teardown() {
-  local config="$1"
-  ip link del dev "${config}" >/dev/null 2>&1
-}
-
-
-[ -n "$INCLUDE_ONLY" ] || {
-  add_protocol wireguard
-}
diff --git a/net/wshaper/Makefile b/net/wshaper/Makefile
deleted file mode 100644 (file)
index d897464..0000000
+++ /dev/null
@@ -1,58 +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:=wshaper
-PKG_VERSION:=1.1a
-PKG_RELEASE:=1
-
-PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/wshaper
-  SECTION:=net
-  CATEGORY:=Network
-  DEPENDS:=+kmod-sched +tc
-  TITLE:=wshaper
-  URL:=http://lartc.org/wondershaper/
-  PKGARCH:=all
-endef
-
-define Package/wshaper/description
- A script to do traffing shaping with the HTB algorithm.
- Wshaper attempts to:
- * Maintain low latency for interfactive traffic at all times
- * Allow 'surfing' at reasonable speeds while up or downloading
- * Make sure uploads don't harm downloads, and the other way around
-endef
-
-define Build/Prepare
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/wshaper/install
-       $(INSTALL_DIR) $(1)/usr/sbin/ $(1)/etc/init.d $(1)/etc/config $(1)/etc/hotplug.d/iface
-       $(INSTALL_BIN) ./files/wshaper.htb $(1)/usr/sbin/
-       $(INSTALL_BIN) ./files/wshaper.init $(1)/etc/init.d/wshaper
-       $(INSTALL_BIN) ./files/wshaper.iface $(1)/etc/hotplug.d/iface/10-wshaper
-       $(INSTALL_DATA) ./files/wshaper.config $(1)/etc/config/wshaper
-endef
-
-define Package/wshaper/conffiles
-/etc/config/wshaper
-endef
-
-$(eval $(call BuildPackage,wshaper))
diff --git a/net/wshaper/files/wshaper.config b/net/wshaper/files/wshaper.config
deleted file mode 100644 (file)
index ed857c5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-config 'wshaper' 'settings'
-       option 'network' 'wan'
-       option 'downlink' '2000'
-       option 'uplink' '240'
diff --git a/net/wshaper/files/wshaper.htb b/net/wshaper/files/wshaper.htb
deleted file mode 100755 (executable)
index 4b63eee..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-#!/bin/sh
-# Wonder Shaper
-# please read the README before filling out these values 
-#
-# Set the following values to somewhat less than your actual download
-# and uplink speed. In kilobits. Also set the device that is to be shaped.
-
-# All config needs to be done in /etc/config/wshaper
-
-. /lib/functions.sh
-. /lib/functions/network.sh
-
-config_load wshaper
-for s in downlink uplink network nopriohostdst nopriohostsrc noprioportdst noprioportsrc; do
-       config_get $s settings $s
-done
-
-if ! network_get_device device "$network"; then
-       logger -t wondershaper "Error: Could not find the device for network $network, aborting."
-       exit 1
-fi
-
-[ -z "$downlink" ] && logger -t wondershaper "Error: Downlink speed not set, aborting." && exit 1
-[ -z "$uplink" ] && logger -t wondershaper "Error: Uplink speed not set, aborting." && exit 1
-
-MODULES='sch_ingress sch_sfq sch_htb cls_u32 act_police'
-DOWNLINK="$downlink"
-UPLINK="$uplink"
-DEV="$device"
-
-# low priority OUTGOING traffic - you can leave this blank if you want
-# low priority source netmasks
-NOPRIOHOSTSRC="$nopriohostsrc"
-
-# low priority destination netmasks
-NOPRIOHOSTDST="$nopriohostdst"
-
-# low priority source ports
-NOPRIOPORTSRC="$noprioportsrc"
-
-# low priority destination ports
-NOPRIOPORTDST="$noprioportdst"
-
-if [ "$1" = "status" ]
-then
-       tc -s qdisc ls dev $DEV
-       tc -s class ls dev $DEV
-       exit
-fi
-
-
-# clean existing down- and uplink qdiscs, hide errors
-tc qdisc del dev $DEV root    2> /dev/null > /dev/null
-tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null
-
-if [ "$1" = "stop" ] 
-then 
-       for i in $MODULES ; do
-               rmmod $i
-       done
-       exit
-fi
-
-for i in $MODULES ; do
-        insmod $i
-done
-
-###### uplink
-
-# install root HTB, point default traffic to 1:20:
-
-tc qdisc add dev $DEV root handle 1: htb default 20
-
-# shape everything at $UPLINK speed - this prevents huge queues in your
-# DSL modem which destroy latency:
-
-tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst 6k
-
-# high prio class 1:10:
-
-tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit \
-   burst 6k prio 1
-
-# bulk & default class 1:20 - gets slightly less traffic, 
-# and a lower priority:
-
-tc class add dev $DEV parent 1:1 classid 1:20 htb rate $((9*$UPLINK/10))kbit \
-   burst 6k prio 2
-
-tc class add dev $DEV parent 1:1 classid 1:30 htb rate $((8*$UPLINK/10))kbit \
-   burst 6k prio 2
-
-# all get Stochastic Fairness:
-tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
-tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
-tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
-
-# TOS Minimum Delay (ssh, NOT scp) in 1:10:
-
-tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
-      match ip tos 0x10 0xff  flowid 1:10
-
-# ICMP (ip protocol 1) in the interactive class 1:10 so we 
-# can do measurements & impress our friends:
-tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
-        match ip protocol 1 0xff flowid 1:10
-
-# To speed up downloads while an upload is going on, put ACK packets in
-# the interactive class:
-
-tc filter add dev $DEV parent 1: protocol ip prio 10 u32 \
-   match ip protocol 6 0xff \
-   match u8 0x05 0x0f at 0 \
-   match u16 0x0000 0xffc0 at 2 \
-   match u8 0x10 0xff at 33 \
-   flowid 1:10
-
-# rest is 'non-interactive' ie 'bulk' and ends up in 1:20
-
-# some traffic however suffers a worse fate
-for a in $NOPRIOPORTDST
-do
-       tc filter add dev $DEV parent 1: protocol ip prio 14 u32 \
-          match ip dport $a 0xffff flowid 1:30
-done
-
-for a in $NOPRIOPORTSRC
-do
-       tc filter add dev $DEV parent 1: protocol ip prio 15 u32 \
-          match ip sport $a 0xffff flowid 1:30
-done
-
-for a in $NOPRIOHOSTSRC
-do
-       tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \
-          match ip src $a flowid 1:30
-done
-
-for a in $NOPRIOHOSTDST
-do
-       tc filter add dev $DEV parent 1: protocol ip prio 17 u32 \
-          match ip dst $a flowid 1:30
-done
-
-# rest is 'non-interactive' ie 'bulk' and ends up in 1:20
-
-tc filter add dev $DEV parent 1: protocol ip prio 18 u32 \
-   match ip dst 0.0.0.0/0 flowid 1:20
-
-
-########## downlink #############
-# slow downloads down to somewhat less than the real speed  to prevent 
-# queuing at our ISP. Tune to see how high you can set it.
-# ISPs tend to have *huge* queues to make sure big downloads are fast
-#
-# attach ingress policer:
-
-tc qdisc add dev $DEV handle ffff: ingress
-
-# filter *everything* to it (0.0.0.0/0), drop everything that's
-# coming in too fast:
-
-tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
-   0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1
-
-logger -t wondershaper "Wondershaper was started on device $device."
diff --git a/net/wshaper/files/wshaper.iface b/net/wshaper/files/wshaper.iface
deleted file mode 100644 (file)
index 2964005..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-[ "$ACTION" = ifup ] && /etc/init.d/wshaper enabled && /etc/init.d/wshaper start || exit 0
diff --git a/net/wshaper/files/wshaper.init b/net/wshaper/files/wshaper.init
deleted file mode 100644 (file)
index 638cef2..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh /etc/rc.common
-
-START=45
-start() {
-       wshaper.htb
-}
-
-stop() {
-       wshaper.htb stop
-}
index c1586b725b0c1dcb83a2f83d23cd97bb55c5af3b..3f8dc0cbd5305cec07bc0f7b16ada1d76932883d 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xinetd
 PKG_VERSION:=2.3.15
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.xinetd.org
-PKG_MD5SUM:=77358478fd58efa6366accae99b8b04c
+PKG_HASH:=bf4e060411c75605e4dcbdf2ac57c6bd9e1904470a2f91e01ba31b50a80a5be3
 PKG_LICENSE:=xinetd
 PKG_LICENSE_FILES:=COPYRIGHT
 
@@ -39,6 +39,7 @@ endef
 
 define Package/xinetd/conffiles
 /etc/xinetd.conf
+/etc/xinetd.d/
 endef
 
 TARGET_CFLAGS += -DNO_RPC
index 50be12e87b23e04f3b82261cc5896c01525cf990..20160422600b9afec3fdd48395b0f00460c4db54 100644 (file)
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xl2tpd
-PKG_VERSION:=devel-20151125
-PKG_RELEASE:=3
+PKG_VERSION:=1.3.11
+PKG_RELEASE:=1
 PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=LICENSE
@@ -17,8 +17,11 @@ PKG_LICENSE_FILES:=LICENSE
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/xelerance/xl2tpd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=e2065bf0fc22ba33001ad503c01bba01648024a8
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=fdb5b28ea698515abe5b996460ee8ad3fa6c76f6eed1c26949938543d7f02994
+
+PKG_BUILD_DEPENDS:=libpcap
 
 PKG_INSTALL:=1
 
@@ -39,9 +42,6 @@ It does implement both LAC and LNS role in a L2TP networking architecture. The
 main goal of this protocol is to tunnel PPP frame trough an IP network.
 endef
 
-# Use optimization options from OpenWrt build system
-MAKE_FLAGS += OFLAGS=""
-
 ifneq (0,0)
   # debugging options from Makefile of xl2tpd package
   EXTRA_CFLAGS += \
diff --git a/net/xl2tpd/README b/net/xl2tpd/README
deleted file mode 100644 (file)
index aadc26e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-OpenWRT Package for xl2tpd
-
-xl2tpd is a development from the original l2tpd package originally written by
-Mark Spencer, subsequently forked by Scott Balmos and David Stipp, inherited
-by Jeff McAdams, modified substantially by Jacco de Leeuw and then forked 
-again by Xelerance (after it was abandoned by l2tpd.org).
-
-Rationale for inclusion in OpenWRT:
-
-l2tpd has some serious alignment problems on RISC platforms. It also runs 
-purely in userspace.
-
-Some of the features added in this fork include:
-
-1. IPSec SA reference tracking inconjunction with openswan's IPSec transport
-   mode, which adds support for multiple clients behind the same NAT router
-        and multiple clients on the same internal IP behind different NAT routers.
-
-2. Support for the pppol2tp kernel mode L2TP.
-
-3. Alignment and endian problems resolved.
-
-hcg
diff --git a/net/xl2tpd/README.md b/net/xl2tpd/README.md
new file mode 100644 (file)
index 0000000..ea8a6e2
--- /dev/null
@@ -0,0 +1,45 @@
+# OpenWrt Package for xl2tpd
+
+xl2tpd is a development from the original l2tpd package originally written by
+Mark Spencer, subsequently forked by Scott Balmos and David Stipp, inherited
+by Jeff McAdams, modified substantially by Jacco de Leeuw and then forked
+again by Xelerance (after it was abandoned by l2tpd.org).
+
+## Rationale for inclusion in OpenWrt
+
+l2tpd has some serious alignment problems on RISC platforms. It also runs
+purely in userspace.
+
+Some of the features added in this fork include:
+
+1. IPSec SA reference tracking inconjunction with openswan's IPSec transport
+   mode, which adds support for multiple clients behind the same NAT router
+   and multiple clients on the same internal IP behind different NAT routers.
+
+2. Support for the pppol2tp kernel mode L2TP.
+
+3. Alignment and endian problems resolved.
+
+hcg
+
+## UCI options
+
+`server` takes the form `host[:port]` with port defaults to `1701`.  It
+specifies the l2tp server's address.
+
+`checkup_interval` tells netifd to check after that many seconds since last
+setup attempt to see if the interface is up.  If not it should issue another
+teardown/setup round to retry the negotiation.  This option defaults to 0 and
+netifd will not do the check and retry.
+
+The following are generic ppp options and should have the same format and
+semantics as with other ppp-related protocols.  See
+[uci/network#protocol_ppp](https://wiki.openwrt.org/doc/uci/network#protocol_ppp_ppp_over_modem)
+for details.
+
+       username
+       password
+       keepalive
+       ipv6
+       mtu
+       pppd_options
index 38c80256bbf7a4a14eec0b2fbbacac9064ecd6d4..c565d6baa90096ee4260aacf353fedafa386c913 100644 (file)
@@ -14,7 +14,6 @@ proto_l2tp_init_config() {
        proto_config_add_string "keepalive"
        proto_config_add_string "pppd_options"
        proto_config_add_boolean "ipv6"
-       proto_config_add_int "demand"
        proto_config_add_int "mtu"
        proto_config_add_int "checkup_interval"
        proto_config_add_string "server"
@@ -58,14 +57,9 @@ proto_l2tp_setup() {
                done
        fi
 
-       local ipv6 demand keepalive username password pppd_options mtu
-       json_get_vars ipv6 demand keepalive username password pppd_options mtu
+       local ipv6 keepalive username password pppd_options mtu
+       json_get_vars ipv6 keepalive username password pppd_options mtu
        [ "$ipv6" = 1 ] || ipv6=""
-       if [ "${demand:-0}" -gt 0 ]; then
-               demand="precompiled-active-filter /etc/ppp/filter demand idle $demand"
-       else
-               demand="persist"
-       fi
 
        local interval="${keepalive##*[, ]}"
        [ "$interval" != "$keepalive" ] || interval=5
index f0fc4f40eb63ffaf9a883830de2f5961cea85dea..5ef0d94414ecf5f38c21dc8184cb9348c4b21ad3 100644 (file)
@@ -1,6 +1,4 @@
 #
-
-lock
 noauth
 debug
 dump
@@ -11,3 +9,12 @@ novj
 novjccomp
 nopcomp
 noaccomp
+mtu 1400
+mru 1400
+require-mschap-v2
+lcp-echo-interval 20
+lcp-echo-failure 5
+connect-delay 5000
+nodefaultroute
+noipdefault
+proxyarp
diff --git a/net/xl2tpd/patches/100-makefile_opt_flags.patch b/net/xl2tpd/patches/100-makefile_opt_flags.patch
deleted file mode 100644 (file)
index f945d94..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -97,7 +97,8 @@ OSFLAGS+= -DUSE_KERNEL
- IPFLAGS?= -DIP_ALLOCATION
--CFLAGS+= $(DFLAGS) -Os -fno-builtin -Wall -DSANITY $(OSFLAGS) $(IPFLAGS)
-+OFLAGS=-Os
-+CFLAGS+= $(DFLAGS) $(OFLAGS) -fno-builtin -Wall -DSANITY $(OSFLAGS) $(IPFLAGS)
- HDRS=l2tp.h avp.h misc.h control.h call.h scheduler.h file.h aaa.h md5.h
- OBJS=xl2tpd.o pty.o misc.o control.o avp.o call.o network.o avpsend.o scheduler.o file.o aaa.o md5.o
- SRCS=${OBJS:.o=.c} ${HDRS}
diff --git a/net/xl2tpd/patches/110-makefile_dont_build_pfc.patch b/net/xl2tpd/patches/110-makefile_dont_build_pfc.patch
deleted file mode 100644 (file)
index f76364f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -113,10 +113,10 @@ BINDIR?=$(DESTDIR)${PREFIX}/bin
- MANDIR?=$(DESTDIR)${PREFIX}/share/man
--all: $(EXEC) pfc $(CONTROL_EXEC)
-+all: $(EXEC) $(CONTROL_EXEC)
- clean:
--      rm -f $(OBJS) $(EXEC) pfc.o pfc $(CONTROL_EXEC)
-+      rm -f $(OBJS) $(EXEC) $(CONTROL_EXEC)
- $(EXEC): $(OBJS) $(HDRS)
-       $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
-@@ -124,14 +124,10 @@ $(EXEC): $(OBJS) $(HDRS)
- $(CONTROL_EXEC): $(CONTROL_SRCS)
-       $(CC) $(CFLAGS) $(LDFLAGS) $(CONTROL_SRCS) -o $@
--pfc:
--      $(CC) $(CFLAGS) -c contrib/pfc.c
--      $(CC) $(LDFLAGS) -o pfc pfc.o -lpcap $(LDLIBS)
--
- romfs:
-       $(ROMFSINST) /bin/$(EXEC)
--install: ${EXEC} pfc ${CONTROL_EXEC}
-+install: ${EXEC} ${CONTROL_EXEC}
-       install -d -m 0755 ${SBINDIR}
-       install -m 0755 $(EXEC) ${SBINDIR}/$(EXEC)
-       install -d -m 0755 ${MANDIR}/man5
-@@ -139,11 +135,6 @@ install: ${EXEC} pfc ${CONTROL_EXEC}
-       install -m 0644 doc/xl2tpd.8 ${MANDIR}/man8/
-       install -m 0644 doc/xl2tpd.conf.5 doc/l2tp-secrets.5 \
-                ${MANDIR}/man5/
--      # pfc
--      install -d -m 0755 ${BINDIR}
--      install -m 0755 pfc ${BINDIR}/pfc
--      install -d -m 0755 ${MANDIR}/man1
--      install -m 0644 contrib/pfc.1 ${MANDIR}/man1/
-       # control exec
-       install -d -m 0755 ${SBINDIR}
-       install -m 0755 $(CONTROL_EXEC) ${SBINDIR}/$(CONTROL_EXEC)
diff --git a/net/xl2tpd/patches/120-no-bsd-signal-in-musl.patch b/net/xl2tpd/patches/120-no-bsd-signal-in-musl.patch
deleted file mode 100644 (file)
index c8c4a7d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/xl2tpd.c
-+++ b/xl2tpd.c
-@@ -30,7 +30,7 @@
- #include <errno.h>
- #include <unistd.h>
- #include <time.h>
--#if (__GLIBC__ < 2)
-+#if defined (__GLIBC__) && (__GLIBC__ < 2)
- # if defined(FREEBSD) || defined(OPENBSD)
- #  include <sys/signal.h>
- # elif defined(LINUX)
diff --git a/net/xl2tpd/patches/200-xl2tpd-control-fix-xl2tpd-hanged-up-in-fopen.patch b/net/xl2tpd/patches/200-xl2tpd-control-fix-xl2tpd-hanged-up-in-fopen.patch
deleted file mode 100644 (file)
index 8fa0fd3..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-From 97adf987cf230e47a4800c2f0a0940a1d0d98109 Mon Sep 17 00:00:00 2001
-From: wendy2001011 <wendy2001011@163.com>
-Date: Thu, 9 Feb 2017 17:32:14 +0800
-Subject: [PATCH] xl2tpd-control: fix xl2tpd hanged up in "fopen"
-
-This is a fix for xl2tpd hanged up in "fopen" result fifo while working
-on xl2tpd with OpenWrt.
-
-Root cause is as followings,
-1. xl2tpd-control open result fifo    ##fifo readers=1
-2. xl2tpd-control read result fifo
-3. xl2tpd-control close result fifo     ##fifo readers=0
-4. xl2tpd fopen result fifo                 ##xl2tpd is hanged up here to wait readers
-5.  xl2tpd-control unlink result fifo
-
-The fix replaces the order of "unlink" and "close" when cleaning up to
-avoid hang up issue in fopen, and add the retry waiting when reading
-result fifo.
-
-[Yousong Zhou: 2s as the timeout and 10ms as the check interval]
----
- xl2tpd-control.c | 23 +++++++++++++++++++++--
- 1 file changed, 21 insertions(+), 2 deletions(-)
-
-diff --git a/xl2tpd-control.c b/xl2tpd-control.c
-index 9fcab76..b8bf822 100644
---- a/xl2tpd-control.c
-+++ b/xl2tpd-control.c
-@@ -35,6 +35,7 @@
- #define TUNNEL_REQUIRED 1
- #define TUNNEL_NOT_REQUIRED 0
-+#define TIMEOUT 2000000  //timeout is 2s
- char result_filename[128];
- int result_fd = -1;
-@@ -149,9 +150,9 @@ void help()
- void cleanup(void)
- {
-     /* cleaning up */
--    if (result_fd >= 0)
--          close (result_fd);
-     unlink (result_filename);
-+    if (result_fd >= 0)
-+        close (result_fd);
- }
- int main (int argc, char *argv[])
-@@ -340,6 +341,7 @@ void print_error (int level, const char *fmt, ...)
-     va_end (args);
- }
-+
- int read_result(int result_fd, char* buf, ssize_t size)
- {
-     /* read result from result_fd */
-@@ -348,6 +350,11 @@ int read_result(int result_fd, char* buf, ssize_t size)
-      */
-     ssize_t readed = 0;
-     ssize_t len;
-+    int write_pipe = 0;
-+    struct timeval tvs;
-+    struct timeval tve;
-+    unsigned long diff;
-+    gettimeofday(&tvs, NULL);
-     do
-     {
-@@ -360,8 +367,20 @@ int read_result(int result_fd, char* buf, ssize_t size)
-                 "error: can't read command result: %s\n", strerror (errno));
-             break;
-         } else if (len == 0) {
-+            if(!write_pipe) {
-+                 gettimeofday(&tve, NULL);
-+                 diff = (tve.tv_sec - tvs.tv_sec) * 1000000 + (tve.tv_usec - tvs.tv_usec);
-+                 if (diff >= TIMEOUT) {
-+                     print_error (DEBUG_LEVEL, "error: read timout\n");
-+                     break;
-+                 } else {
-+                     usleep(10000);
-+                     continue;
-+                 }
-+            }
-             break;
-         } else {
-+            write_pipe = 1;
-             readed += len;
-             if ((size - readed) <= 0)
-                 break;
--- 
-2.6.4
-
diff --git a/net/xtables-addons/Makefile b/net/xtables-addons/Makefile
new file mode 100644 (file)
index 0000000..b8d8abe
--- /dev/null
@@ -0,0 +1,169 @@
+#
+# Copyright (C) 2009-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=xtables-addons
+PKG_VERSION:=2.14
+PKG_RELEASE:=3
+PKG_HASH:=d215a9a8b8e66aae04b982fa2e1228e8a71e7dfe42320df99e34e5000cbdf152
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@SF/xtables-addons
+PKG_BUILD_DEPENDS:=iptables
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_CHECK_FORMAT_SECURITY:=0
+
+PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
+PKG_LICENSE:=GPL-2.0
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/xtables-addons
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Firewall
+  TITLE:=Extensions not distributed in the main Xtables
+  URL:=http://xtables-addons.sourceforge.net/
+endef
+
+# uses GNU configure
+
+CONFIGURE_ARGS+= \
+       --with-kbuild="$(LINUX_DIR)" \
+       --with-xtlibdir="/usr/lib/iptables" \
+
+define Build/Compile
+       +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               $(KERNEL_MAKE_FLAGS) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               DEPMOD="/bin/true" \
+               all
+endef
+
+define Build/Install
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(KERNEL_MAKE_FLAGS) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               DEPMOD="/bin/true" \
+               install
+endef
+
+# 1: extension/module suffix used in package name
+# 2: extension/module display name used in package title/description
+# 3: list of extensions to package
+# 4: list of modules to package
+# 5: module load priority
+# 6: module depends
+define BuildTemplate
+
+ ifneq ($(3),)
+  define Package/iptables-mod-$(1)
+    $$(call Package/xtables-addons)
+    CATEGORY:=Network
+    TITLE:=$(2) iptables extension
+    DEPENDS:=iptables $(if $(4),+kmod-ipt-$(1))
+  endef
+
+  define Package/iptables-mod-$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/lib/iptables
+       for m in $(3); do \
+               $(CP) \
+                       $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so \
+                       $$(1)/usr/lib/iptables/ ; \
+       done
+  endef
+
+  $$(eval $$(call BuildPackage,iptables-mod-$(1)))
+ endif
+
+ ifneq ($(4),)
+  define KernelPackage/ipt-$(1)
+    SUBMENU:=Netfilter Extensions
+    TITLE:=$(2) netfilter module
+    DEPENDS:=+kmod-ipt-core $(5)
+    FILES:=$(foreach mod,$(4),$(PKG_BUILD_DIR)/extensions/$(mod).$(LINUX_KMOD_SUFFIX))
+    AUTOLOAD:=$(call AutoProbe,$(notdir $(4)))
+  endef
+
+  $$(eval $$(call KernelPackage,ipt-$(1)))
+ endif
+
+endef
+
+
+define Package/iptaccount
+  $(call Package/xtables-addons)
+  CATEGORY:=Network
+  TITLE:=iptables-mod-account control utility
+  DEPENDS:=iptables +iptables-mod-account
+endef
+
+define Package/iptaccount/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libxt_ACCOUNT_cl.so* \
+               $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/sbin/iptaccount \
+               $(1)/usr/sbin/
+endef
+
+
+define Package/iptgeoip
+  $(call Package/xtables-addons)
+  CATEGORY:=Network
+  TITLE:=iptables-mod-geoip support scripts for MaxMind GeoIP databases
+  # we could also use wget-nossl but that's more complicated than our
+  # syntax of dependencies permits...
+  DEPENDS:=iptables +iptables-mod-geoip \
+               +perl +perlbase-getopt +perlbase-io +perl-text-csv_xs \
+               +!BUSYBOX_CONFIG_WGET:wget +!BUSYBOX_CONFIG_GZIP:gzip +!BUSYBOX_CONFIG_UNZIP:unzip
+endef
+
+define Package/iptgeoip/install
+       $(INSTALL_DIR) $(1)/usr/lib/xtables-addons
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/xtables-addons/xt_geoip_{build,dl} \
+               $(1)/usr/lib/xtables-addons/
+       $(INSTALL_DIR) $(1)/usr/share/xt_geoip
+endef
+
+
+#$(eval $(call BuildTemplate,SUFFIX,DESCRIPTION,EXTENSION,MODULE,PRIORITY,DEPENDS))
+
+$(eval $(call BuildTemplate,compat-xtables,API compatibilty layer,,compat_xtables,+IPV6:kmod-ip6tables))
+$(eval $(call BuildTemplate,nathelper-rtsp,RTSP Conntrack and NAT,,rtsp/nf_conntrack_rtsp rtsp/nf_nat_rtsp,+kmod-ipt-conntrack-extra +kmod-ipt-nat))
+
+$(eval $(call BuildTemplate,account,ACCOUNT,xt_ACCOUNT,ACCOUNT/xt_ACCOUNT,+kmod-ipt-compat-xtables))
+$(eval $(call BuildTemplate,chaos,CHAOS,xt_CHAOS,xt_CHAOS,+kmod-ipt-compat-xtables +kmod-ipt-delude +kmod-ipt-tarpit))
+$(eval $(call BuildTemplate,condition,Condition,xt_condition,xt_condition,))
+$(eval $(call BuildTemplate,delude,DELUDE,xt_DELUDE,xt_DELUDE,+kmod-ipt-compat-xtables))
+$(eval $(call BuildTemplate,dhcpmac,DHCPMAC,xt_DHCPMAC,xt_DHCPMAC,+kmod-ipt-compat-xtables))
+$(eval $(call BuildTemplate,dnetmap,DNETMAP,xt_DNETMAP,xt_DNETMAP,+kmod-ipt-compat-xtables +kmod-ipt-nat))
+$(eval $(call BuildTemplate,fuzzy,fuzzy,xt_fuzzy,xt_fuzzy,))
+$(eval $(call BuildTemplate,geoip,geoip,xt_geoip,xt_geoip,))
+$(eval $(call BuildTemplate,iface,iface,xt_iface,xt_iface,))
+$(eval $(call BuildTemplate,ipmark,IPMARK,xt_IPMARK,xt_IPMARK,+kmod-ipt-compat-xtables))
+$(eval $(call BuildTemplate,ipp2p,IPP2P,xt_ipp2p,xt_ipp2p,+kmod-ipt-compat-xtables))
+$(eval $(call BuildTemplate,ipv4options,ipv4options,xt_ipv4options,xt_ipv4options,))
+$(eval $(call BuildTemplate,length2,length2,xt_length2,xt_length2,+kmod-ipt-compat-xtables))
+$(eval $(call BuildTemplate,logmark,LOGMARK,xt_LOGMARK,xt_LOGMARK,+kmod-ipt-compat-xtables))
+$(eval $(call BuildTemplate,lscan,lscan,xt_lscan,xt_lscan,))
+$(eval $(call BuildTemplate,lua,Lua PacketScript,xt_LUA,LUA/xt_LUA,+kmod-ipt-conntrack-extra))
+$(eval $(call BuildTemplate,psd,psd,xt_psd,xt_psd,))
+$(eval $(call BuildTemplate,quota2,quota2,xt_quota2,xt_quota2,))
+$(eval $(call BuildTemplate,sysrq,SYSRQ,xt_SYSRQ,xt_SYSRQ,+kmod-ipt-compat-xtables +kmod-crypto-hash))
+$(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,xt_TARPIT,+kmod-ipt-compat-xtables))
+
+$(eval $(call BuildPackage,iptaccount))
+$(eval $(call BuildPackage,iptgeoip))
diff --git a/net/xtables-addons/patches/002-fix-kernel-version-detection.patch b/net/xtables-addons/patches/002-fix-kernel-version-detection.patch
new file mode 100644 (file)
index 0000000..775ccf6
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -44,7 +44,7 @@ regular_CFLAGS="-Wall -Waggregate-return
+ if test -n "$kbuilddir"; then
+       AC_MSG_CHECKING([kernel version that we will build against])
+-      krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease | $AWK -v 'FS=[[^0-9.]]' '{print $1; exit}')"
++      krel="$(make -sC "$kbuilddir" M=$PWD kernelversion | $AWK -v 'FS=[[^0-9.]]' '{print $1; exit}')"
+       save_IFS="$IFS"
+       IFS='.'
+       set x $krel
diff --git a/net/xtables-addons/patches/100-add-rtsp-conntrack.patch b/net/xtables-addons/patches/100-add-rtsp-conntrack.patch
new file mode 100644 (file)
index 0000000..bd49d92
--- /dev/null
@@ -0,0 +1,1526 @@
+--- /dev/null
++++ b/extensions/rtsp/Kbuild
+@@ -0,0 +1,4 @@
++# -*- Makefile -*-
++
++obj-m += nf_nat_rtsp.o
++obj-m += nf_conntrack_rtsp.o
+--- /dev/null
++++ b/extensions/rtsp/netfilter_helpers.h
+@@ -0,0 +1,133 @@
++/*
++ * Helpers for netfiler modules.  This file provides implementations for basic
++ * functions such as strncasecmp(), etc.
++ *
++ * gcc will warn for defined but unused functions, so we only include the
++ * functions requested.  The following macros are used:
++ *   NF_NEED_STRNCASECMP        nf_strncasecmp()
++ *   NF_NEED_STRTOU16           nf_strtou16()
++ *   NF_NEED_STRTOU32           nf_strtou32()
++ */
++#ifndef _NETFILTER_HELPERS_H
++#define _NETFILTER_HELPERS_H
++
++/* Only include these functions for kernel code. */
++#ifdef __KERNEL__
++
++#include <linux/ctype.h>
++#define iseol(c) ( (c) == '\r' || (c) == '\n' )
++
++/*
++ * The standard strncasecmp()
++ */
++#ifdef NF_NEED_STRNCASECMP
++static int
++nf_strncasecmp(const char* s1, const char* s2, u_int32_t len)
++{
++    if (s1 == NULL || s2 == NULL)
++    {
++        if (s1 == NULL && s2 == NULL)
++        {
++            return 0;
++        }
++        return (s1 == NULL) ? -1 : 1;
++    }
++    while (len > 0 && tolower(*s1) == tolower(*s2))
++    {
++        len--;
++        s1++;
++        s2++;
++    }
++    return ( (len == 0) ? 0 : (tolower(*s1) - tolower(*s2)) );
++}
++#endif /* NF_NEED_STRNCASECMP */
++
++/*
++ * Parse a string containing a 16-bit unsigned integer.
++ * Returns the number of chars used, or zero if no number is found.
++ */
++#ifdef NF_NEED_STRTOU16
++static int
++nf_strtou16(const char* pbuf, u_int16_t* pval)
++{
++    int n = 0;
++
++    *pval = 0;
++    while (isdigit(pbuf[n]))
++    {
++        *pval = (*pval * 10) + (pbuf[n] - '0');
++        n++;
++    }
++
++    return n;
++}
++#endif /* NF_NEED_STRTOU16 */
++
++/*
++ * Parse a string containing a 32-bit unsigned integer.
++ * Returns the number of chars used, or zero if no number is found.
++ */
++#ifdef NF_NEED_STRTOU32
++static int
++nf_strtou32(const char* pbuf, u_int32_t* pval)
++{
++    int n = 0;
++
++    *pval = 0;
++    while (pbuf[n] >= '0' && pbuf[n] <= '9')
++    {
++        *pval = (*pval * 10) + (pbuf[n] - '0');
++        n++;
++    }
++
++    return n;
++}
++#endif /* NF_NEED_STRTOU32 */
++
++/*
++ * Given a buffer and length, advance to the next line and mark the current
++ * line.
++ */
++#ifdef NF_NEED_NEXTLINE
++static int
++nf_nextline(char* p, uint len, uint* poff, uint* plineoff, uint* plinelen)
++{
++    uint    off = *poff;
++    uint    physlen = 0;
++
++    if (off >= len)
++    {
++        return 0;
++    }
++
++    while (p[off] != '\n')
++    {
++        if (len-off <= 1)
++        {
++            return 0;
++        }
++
++        physlen++;
++        off++;
++    }
++
++    /* if we saw a crlf, physlen needs adjusted */
++    if (physlen > 0 && p[off] == '\n' && p[off-1] == '\r')
++    {
++        physlen--;
++    }
++
++    /* advance past the newline */
++    off++;
++
++    *plineoff = *poff;
++    *plinelen = physlen;
++    *poff = off;
++
++    return 1;
++}
++#endif /* NF_NEED_NEXTLINE */
++
++#endif /* __KERNEL__ */
++
++#endif /* _NETFILTER_HELPERS_H */
+--- /dev/null
++++ b/extensions/rtsp/netfilter_mime.h
+@@ -0,0 +1,89 @@
++/*
++ * MIME functions for netfilter modules.  This file provides implementations
++ * for basic MIME parsing.  MIME headers are used in many protocols, such as
++ * HTTP, RTSP, SIP, etc.
++ *
++ * gcc will warn for defined but unused functions, so we only include the
++ * functions requested.  The following macros are used:
++ *   NF_NEED_MIME_NEXTLINE      nf_mime_nextline()
++ */
++#ifndef _NETFILTER_MIME_H
++#define _NETFILTER_MIME_H
++
++/* Only include these functions for kernel code. */
++#ifdef __KERNEL__
++
++#include <linux/ctype.h>
++
++/*
++ * Given a buffer and length, advance to the next line and mark the current
++ * line.  If the current line is empty, *plinelen will be set to zero.  If
++ * not, it will be set to the actual line length (including CRLF).
++ *
++ * 'line' in this context means logical line (includes LWS continuations).
++ * Returns 1 on success, 0 on failure.
++ */
++#ifdef NF_NEED_MIME_NEXTLINE
++static int
++nf_mime_nextline(char* p, uint len, uint* poff, uint* plineoff, uint* plinelen)
++{
++    uint    off = *poff;
++    uint    physlen = 0;
++    int     is_first_line = 1;
++
++    if (off >= len)
++    {
++        return 0;
++    }
++
++    do
++    {
++        while (p[off] != '\n')
++        {
++            if (len-off <= 1)
++            {
++                return 0;
++            }
++
++            physlen++;
++            off++;
++        }
++
++        /* if we saw a crlf, physlen needs adjusted */
++        if (physlen > 0 && p[off] == '\n' && p[off-1] == '\r')
++        {
++            physlen--;
++        }
++
++        /* advance past the newline */
++        off++;
++
++        /* check for an empty line */
++        if (physlen == 0)
++        {
++            break;
++        }
++
++        /* check for colon on the first physical line */
++        if (is_first_line)
++        {
++            is_first_line = 0;
++            if (memchr(p+(*poff), ':', physlen) == NULL)
++            {
++                return 0;
++            }
++        }
++    }
++    while (p[off] == ' ' || p[off] == '\t');
++
++    *plineoff = *poff;
++    *plinelen = (physlen == 0) ? 0 : (off - *poff);
++    *poff = off;
++
++    return 1;
++}
++#endif /* NF_NEED_MIME_NEXTLINE */
++
++#endif /* __KERNEL__ */
++
++#endif /* _NETFILTER_MIME_H */
+--- /dev/null
++++ b/extensions/rtsp/nf_conntrack_rtsp.c
+@@ -0,0 +1,576 @@
++/*
++ * RTSP extension for IP connection tracking
++ * (C) 2003 by Tom Marshall <tmarshall at real.com>
++ *
++ * 2005-02-13: Harald Welte <laforge at netfilter.org>
++ *    - port to 2.6
++ *    - update to recent post-2.6.11 api changes
++ * 2006-09-14: Steven Van Acker <deepstar at singularity.be>
++ *    - removed calls to NAT code from conntrack helper: NAT no longer needed to use rtsp-conntrack
++ * 2007-04-18: Michael Guntsche <mike at it-loops.com>
++ *                    - Port to new NF API
++ * 2013-03-04: Il'inykh Sergey <sergeyi at inango-sw.com>. Inango Systems Ltd
++ *    - fixed rtcp nat mapping and other port mapping fixes
++ *    - simple TEARDOWN request handling
++ *    - codestyle fixes and other less significant bug fixes 
++ *
++ * based on ip_conntrack_irc.c
++ *
++ *      This program is free software; you can redistribute it and/or
++ *      modify it under the terms of the GNU General Public License
++ *      as published by the Free Software Foundation; either version
++ *      2 of the License, or (at your option) any later version.
++ *
++ * Module load syntax:
++ *   insmod nf_conntrack_rtsp.o ports=port1,port2,...port<MAX_PORTS>
++ *                              max_outstanding=n setup_timeout=secs
++ *
++ * If no ports are specified, the default will be port 554.
++ *
++ * With max_outstanding you can define the maximum number of not yet
++ * answered SETUP requests per RTSP session (default 8).
++ * With setup_timeout you can specify how long the system waits for
++ * an expected data channel (default 300 seconds).
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/netfilter.h>
++#include <linux/ip.h>
++#include <linux/inet.h>
++#include <net/tcp.h>
++
++#include <net/netfilter/nf_conntrack.h>
++#include <net/netfilter/nf_conntrack_expect.h>
++#include <net/netfilter/nf_conntrack_helper.h>
++#include "nf_conntrack_rtsp.h"
++
++#define NF_NEED_STRNCASECMP
++#define NF_NEED_STRTOU16
++#define NF_NEED_STRTOU32
++#define NF_NEED_NEXTLINE
++#include "netfilter_helpers.h"
++#define NF_NEED_MIME_NEXTLINE
++#include "netfilter_mime.h"
++
++#include <linux/ctype.h>
++
++#define MAX_PORTS 8
++static int ports[MAX_PORTS];
++static int num_ports = 0;
++static int max_outstanding = 8;
++static unsigned int setup_timeout = 300;
++
++MODULE_AUTHOR("Tom Marshall <tmarshall at real.com>");
++MODULE_DESCRIPTION("RTSP connection tracking module");
++MODULE_LICENSE("GPL");
++module_param_array(ports, int, &num_ports, 0400);
++MODULE_PARM_DESC(ports, "port numbers of RTSP servers");
++module_param(max_outstanding, int, 0400);
++MODULE_PARM_DESC(max_outstanding, "max number of outstanding SETUP requests per RTSP session");
++module_param(setup_timeout, int, 0400);
++MODULE_PARM_DESC(setup_timeout, "timeout on for unestablished data channels");
++
++static char *rtsp_buffer;
++static DEFINE_SPINLOCK(rtsp_buffer_lock);
++
++static struct nf_conntrack_expect_policy rtsp_exp_policy;
++
++unsigned int (*nf_nat_rtsp_hook)(struct sk_buff *skb,
++                               enum ip_conntrack_info ctinfo,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++                               unsigned int protoff,
++#endif
++                               unsigned int matchoff, unsigned int matchlen,
++                               struct ip_ct_rtsp_expect* prtspexp,
++                               struct nf_conntrack_expect *rtp_exp,
++                               struct nf_conntrack_expect *rtcp_exp);
++
++EXPORT_SYMBOL_GPL(nf_nat_rtsp_hook);
++
++/*
++ * Max mappings we will allow for one RTSP connection (for RTP, the number
++ * of allocated ports is twice this value).  Note that SMIL burns a lot of
++ * ports so keep this reasonably high.  If this is too low, you will see a
++ * lot of "no free client map entries" messages.
++ */
++#define MAX_PORT_MAPS 16
++
++/*** default port list was here in the masq code: 554, 3030, 4040 ***/
++
++#define SKIP_WSPACE(ptr,len,off) while(off < len && isspace(*(ptr+off))) { off++; }
++
++/*
++ * Parse an RTSP packet.
++ *
++ * Returns zero if parsing failed.
++ *
++ * Parameters:
++ *  IN      ptcp        tcp data pointer
++ *  IN      tcplen      tcp data len
++ *  IN/OUT  ptcpoff     points to current tcp offset
++ *  OUT     phdrsoff    set to offset of rtsp headers
++ *  OUT     phdrslen    set to length of rtsp headers
++ *  OUT     pcseqoff    set to offset of CSeq header
++ *  OUT     pcseqlen    set to length of CSeq header
++ */
++static int
++rtsp_parse_message(char* ptcp, uint tcplen, uint* ptcpoff,
++                 uint* phdrsoff, uint* phdrslen,
++                 uint* pcseqoff, uint* pcseqlen,
++                 uint* transoff, uint* translen)
++{
++      uint    entitylen = 0;
++      uint    lineoff;
++      uint    linelen;
++      
++      if (!nf_nextline(ptcp, tcplen, ptcpoff, &lineoff, &linelen))
++              return 0;
++      
++      *phdrsoff = *ptcpoff;
++      while (nf_mime_nextline(ptcp, tcplen, ptcpoff, &lineoff, &linelen)) {
++              if (linelen == 0) {
++                      if (entitylen > 0)
++                              *ptcpoff += min(entitylen, tcplen - *ptcpoff);
++                      break;
++              }
++              if (lineoff+linelen > tcplen) {
++                      pr_info("!! overrun !!\n");
++                      break;
++              }
++
++              if (nf_strncasecmp(ptcp+lineoff, "CSeq:", 5) == 0) {
++                      *pcseqoff = lineoff;
++                      *pcseqlen = linelen;
++              } 
++
++              if (nf_strncasecmp(ptcp+lineoff, "Transport:", 10) == 0) {
++                      *transoff = lineoff;
++                      *translen = linelen;
++              }
++              
++              if (nf_strncasecmp(ptcp+lineoff, "Content-Length:", 15) == 0) {
++                      uint off = lineoff+15;
++                      SKIP_WSPACE(ptcp+lineoff, linelen, off);
++                      nf_strtou32(ptcp+off, &entitylen);
++              }
++      }
++      *phdrslen = (*ptcpoff) - (*phdrsoff);
++      
++      return 1;
++}
++
++/*
++ * Find lo/hi client ports (if any) in transport header
++ * In:
++ *   ptcp, tcplen = packet
++ *   tranoff, tranlen = buffer to search
++ *
++ * Out:
++ *   pport_lo, pport_hi = lo/hi ports (host endian)
++ *
++ * Returns nonzero if any client ports found
++ *
++ * Note: it is valid (and expected) for the client to request multiple
++ * transports, so we need to parse the entire line.
++ */
++static int
++rtsp_parse_transport(char* ptran, uint tranlen,
++                   struct ip_ct_rtsp_expect* prtspexp)
++{
++      int  rc = 0;
++      uint off = 0;
++      
++      if (tranlen < 10 || !iseol(ptran[tranlen-1]) ||
++          nf_strncasecmp(ptran, "Transport:", 10) != 0) {
++              pr_info("sanity check failed\n");
++              return 0;
++      }
++      
++      pr_debug("tran='%.*s'\n", (int)tranlen, ptran);
++      off += 10;
++      SKIP_WSPACE(ptran, tranlen, off);
++      
++      /* Transport: tran;field;field=val,tran;field;field=val,... */
++      while (off < tranlen) {
++              const char* pparamend;
++              uint        nextparamoff;
++              
++              pparamend = memchr(ptran+off, ',', tranlen-off);
++              pparamend = (pparamend == NULL) ? ptran+tranlen : pparamend+1;
++              nextparamoff = pparamend-ptran;
++              
++              while (off < nextparamoff) {
++                      const char* pfieldend;
++                      uint        nextfieldoff;
++                      
++                      pfieldend = memchr(ptran+off, ';', nextparamoff-off);
++                      nextfieldoff = (pfieldend == NULL) ? nextparamoff : pfieldend-ptran+1;
++                 
++                      if (strncmp(ptran+off, "client_port=", 12) == 0) {
++                              u_int16_t   port;
++                              uint        numlen;
++
++                              off += 12;
++                              numlen = nf_strtou16(ptran+off, &port);
++                              off += numlen;
++                              if (prtspexp->loport != 0 && prtspexp->loport != port)
++                                      pr_debug("multiple ports found, port %hu ignored\n", port);
++                              else {
++                                      pr_debug("lo port found : %hu\n", port);
++                                      prtspexp->loport = prtspexp->hiport = port;
++                                      if (ptran[off] == '-') {
++                                              off++;
++                                              numlen = nf_strtou16(ptran+off, &port);
++                                              off += numlen;
++                                              prtspexp->pbtype = pb_range;
++                                              prtspexp->hiport = port;
++                                              
++                                              // If we have a range, assume rtp:
++                                              // loport must be even, hiport must be loport+1
++                                              if ((prtspexp->loport & 0x0001) != 0 ||
++                                                  prtspexp->hiport != prtspexp->loport+1) {
++                                                      pr_debug("incorrect range: %hu-%hu, correcting\n",
++                                                             prtspexp->loport, prtspexp->hiport);
++                                                      prtspexp->loport &= 0xfffe;
++                                                      prtspexp->hiport = prtspexp->loport+1;
++                                              }
++                                      } else if (ptran[off] == '/') {
++                                              off++;
++                                              numlen = nf_strtou16(ptran+off, &port);
++                                              off += numlen;
++                                              prtspexp->pbtype = pb_discon;
++                                              prtspexp->hiport = port;
++                                      }
++                                      rc = 1;
++                              }
++                      }
++                      
++                      /*
++                       * Note we don't look for the destination parameter here.
++                       * If we are using NAT, the NAT module will handle it.  If not,
++                       * and the client is sending packets elsewhere, the expectation
++                       * will quietly time out.
++                       */
++                      
++                      off = nextfieldoff;
++              }
++              
++              off = nextparamoff;
++      }
++      
++      return rc;
++}
++
++
++/*** conntrack functions ***/
++
++/* outbound packet: client->server */
++
++static inline int
++help_out(struct sk_buff *skb, unsigned char *rb_ptr, unsigned int datalen,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++       struct nf_conn *ct, enum ip_conntrack_info ctinfo,
++       unsigned int protoff)
++#else
++       struct nf_conn *ct, enum ip_conntrack_info ctinfo)
++#endif
++{
++      struct ip_ct_rtsp_expect expinfo;
++      
++      int dir = CTINFO2DIR(ctinfo);   /* = IP_CT_DIR_ORIGINAL */
++      //struct  tcphdr* tcph = (void*)iph + iph->ihl * 4;
++      //uint    tcplen = pktlen - iph->ihl * 4;
++      char*   pdata = rb_ptr;
++      //uint    datalen = tcplen - tcph->doff * 4;
++      uint    dataoff = 0;
++      int ret = NF_ACCEPT;
++      
++      struct nf_conntrack_expect *rtp_exp;
++      struct nf_conntrack_expect *rtcp_exp = NULL;
++      
++      __be16 be_loport;
++      __be16 be_hiport;
++      
++      typeof(nf_nat_rtsp_hook) nf_nat_rtsp;
++
++      memset(&expinfo, 0, sizeof(expinfo));
++      
++      while (dataoff < datalen) {
++              uint cmdoff = dataoff;
++              uint hdrsoff = 0;
++              uint hdrslen = 0;
++              uint cseqoff = 0;
++              uint cseqlen = 0;
++              uint transoff = 0;
++              uint translen = 0;
++              uint off;
++              
++              if (!rtsp_parse_message(pdata, datalen, &dataoff,
++                                      &hdrsoff, &hdrslen,
++                                      &cseqoff, &cseqlen,
++                                      &transoff, &translen))
++                      break;      /* not a valid message */
++
++              if (strncmp(pdata+cmdoff, "TEARDOWN ", 9) == 0) {
++                      pr_debug("teardown handled\n");
++                      nf_ct_remove_expectations(ct); /* FIXME must be session id aware */
++                      break;
++              }
++
++              if (strncmp(pdata+cmdoff, "SETUP ", 6) != 0)
++                      continue;   /* not a SETUP message */
++
++              pr_debug("found a setup message\n");
++
++              off = 0;
++              if(translen)
++                      rtsp_parse_transport(pdata+transoff, translen, &expinfo);
++
++              if (expinfo.loport == 0) {
++                      pr_debug("no udp transports found\n");
++                      continue;   /* no udp transports found */
++              }
++
++              pr_debug("udp transport found, ports=(%d,%hu,%hu)\n",
++                       (int)expinfo.pbtype, expinfo.loport, expinfo.hiport);
++
++
++              be_loport = htons(expinfo.loport);
++
++              rtp_exp = nf_ct_expect_alloc(ct);
++              if (rtp_exp == NULL) {
++                      ret = NF_DROP;
++                      goto out;
++              }
++
++              nf_ct_expect_init(rtp_exp, NF_CT_EXPECT_CLASS_DEFAULT,
++                                nf_ct_l3num(ct),
++                                NULL, /* &ct->tuplehash[!dir].tuple.src.u3, */
++                                &ct->tuplehash[!dir].tuple.dst.u3,
++                                IPPROTO_UDP, NULL, &be_loport);
++
++              rtp_exp->flags = 0;
++
++              if (expinfo.pbtype == pb_range) {
++                      pr_debug("setup expectation for rtcp\n");
++
++                      be_hiport = htons(expinfo.hiport);
++                      rtcp_exp = nf_ct_expect_alloc(ct);
++                      if (rtcp_exp == NULL) {
++                              ret = NF_DROP;
++                              goto out1;
++                      }
++
++                      nf_ct_expect_init(rtcp_exp, NF_CT_EXPECT_CLASS_DEFAULT,
++                                        nf_ct_l3num(ct),
++                                        NULL, /* &ct->tuplehash[!dir].tuple.src.u3, */
++                                        &ct->tuplehash[!dir].tuple.dst.u3,
++                                        IPPROTO_UDP, NULL, &be_hiport);
++
++                      rtcp_exp->flags = 0;
++
++                      pr_debug("expect_related %pI4:%u-%u-%pI4:%u-%u\n",
++                                 &rtp_exp->tuple.src.u3.ip,
++                                 ntohs(rtp_exp->tuple.src.u.udp.port),
++                                 ntohs(rtcp_exp->tuple.src.u.udp.port),
++                                 &rtp_exp->tuple.dst.u3.ip,
++                                 ntohs(rtp_exp->tuple.dst.u.udp.port),
++                                 ntohs(rtcp_exp->tuple.dst.u.udp.port));
++              } else {
++                      pr_debug("expect_related %pI4:%u-%pI4:%u\n",
++                                      &rtp_exp->tuple.src.u3.ip,
++                                      ntohs(rtp_exp->tuple.src.u.udp.port),
++                                      &rtp_exp->tuple.dst.u3.ip,
++                                      ntohs(rtp_exp->tuple.dst.u.udp.port));
++              }
++
++              nf_nat_rtsp = rcu_dereference(nf_nat_rtsp_hook);
++              if (nf_nat_rtsp && ct->status & IPS_NAT_MASK)
++                      /* pass the request off to the nat helper */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++                      ret = nf_nat_rtsp(skb, ctinfo, protoff, hdrsoff, hdrslen,
++                                        &expinfo, rtp_exp, rtcp_exp);
++#else
++                      ret = nf_nat_rtsp(skb, ctinfo, hdrsoff, hdrslen,
++                                        &expinfo, rtp_exp, rtcp_exp);
++#endif
++              else {
++                      if (nf_ct_expect_related(rtp_exp) == 0) {
++                              if (rtcp_exp && nf_ct_expect_related(rtcp_exp) != 0) {
++                                      nf_ct_unexpect_related(rtp_exp);
++                                      pr_info("nf_conntrack_expect_related failed for rtcp\n");
++                                      ret = NF_DROP;
++                              }
++                      } else {
++                              pr_info("nf_conntrack_expect_related failed for rtp\n");
++                              ret = NF_DROP;
++                      }
++              }
++              if (rtcp_exp) {
++                      nf_ct_expect_put(rtcp_exp);
++              }
++out1:
++              nf_ct_expect_put(rtp_exp);
++              goto out;
++      }
++out:
++
++      return ret;
++}
++
++
++static inline int
++help_in(struct sk_buff *skb, size_t pktlen,
++      struct nf_conn* ct, enum ip_conntrack_info ctinfo)
++{
++      return NF_ACCEPT;
++}
++
++static int help(struct sk_buff *skb, unsigned int protoff,
++              struct nf_conn *ct, enum ip_conntrack_info ctinfo) 
++{
++      struct tcphdr _tcph, *th;
++      unsigned int dataoff, datalen;
++      char *rb_ptr;
++      int ret = NF_DROP;
++
++      /* Until there's been traffic both ways, don't look in packets. */
++      if (ctinfo != IP_CT_ESTABLISHED && 
++          ctinfo != IP_CT_ESTABLISHED + IP_CT_IS_REPLY) {
++              pr_debug("conntrackinfo = %u\n", ctinfo);
++              return NF_ACCEPT;
++      } 
++
++      /* Not whole TCP header? */
++      th = skb_header_pointer(skb, protoff, sizeof(_tcph), &_tcph);
++
++      if (!th)
++              return NF_ACCEPT;
++   
++      /* No data ? */
++      dataoff = protoff + th->doff*4;
++      datalen = skb->len - dataoff;
++      if (dataoff >= skb->len)
++              return NF_ACCEPT;
++
++      spin_lock_bh(&rtsp_buffer_lock);
++      rb_ptr = skb_header_pointer(skb, dataoff,
++                                  skb->len - dataoff, rtsp_buffer);
++      BUG_ON(rb_ptr == NULL);
++
++#if 0
++      /* Checksum invalid?  Ignore. */
++      /* FIXME: Source route IP option packets --RR */
++      if (tcp_v4_check(tcph, tcplen, iph->saddr, iph->daddr,
++                       csum_partial((char*)tcph, tcplen, 0)))
++      {
++              DEBUGP("bad csum: %p %u %u.%u.%u.%u %u.%u.%u.%u\n",
++                     tcph, tcplen, NIPQUAD(iph->saddr), NIPQUAD(iph->daddr));
++              return NF_ACCEPT;
++      }
++#endif
++
++      switch (CTINFO2DIR(ctinfo)) {
++      case IP_CT_DIR_ORIGINAL:
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++              ret = help_out(skb, rb_ptr, datalen, ct, ctinfo, protoff);
++#else
++              ret = help_out(skb, rb_ptr, datalen, ct, ctinfo);
++#endif
++              break;
++      case IP_CT_DIR_REPLY:
++              pr_debug("IP_CT_DIR_REPLY\n");
++              /* inbound packet: server->client */
++              ret = NF_ACCEPT;
++              break;
++      }
++
++      spin_unlock_bh(&rtsp_buffer_lock);
++
++      return ret;
++}
++
++static struct nf_conntrack_helper rtsp_helpers[MAX_PORTS];
++static char rtsp_names[MAX_PORTS][10];
++
++/* This function is intentionally _NOT_ defined as __exit */
++static void
++fini(void)
++{
++      int i;
++      for (i = 0; i < num_ports; i++) {
++              pr_debug("unregistering port %d\n", ports[i]);
++              nf_conntrack_helper_unregister(&rtsp_helpers[i]);
++      }
++      kfree(rtsp_buffer);
++}
++
++static int __init
++init(void)
++{
++      int i, ret;
++      struct nf_conntrack_helper *hlpr;
++      char *tmpname;
++
++      printk("nf_conntrack_rtsp v" IP_NF_RTSP_VERSION " loading\n");
++
++      if (max_outstanding < 1) {
++              printk("nf_conntrack_rtsp: max_outstanding must be a positive integer\n");
++              return -EBUSY;
++      }
++      if (setup_timeout < 0) {
++              printk("nf_conntrack_rtsp: setup_timeout must be a positive integer\n");
++              return -EBUSY;
++      }
++
++      rtsp_exp_policy.max_expected = max_outstanding;
++      rtsp_exp_policy.timeout = setup_timeout;
++      
++      rtsp_buffer = kmalloc(65536, GFP_KERNEL);
++      if (!rtsp_buffer) 
++              return -ENOMEM;
++
++      /* If no port given, default to standard rtsp port */
++      if (ports[0] == 0) {
++              ports[0] = RTSP_PORT;
++              num_ports = 1;
++      }
++
++      for (i = 0; (i < MAX_PORTS) && ports[i]; i++) {
++              hlpr = &rtsp_helpers[i];
++              memset(hlpr, 0, sizeof(struct nf_conntrack_helper));
++              hlpr->tuple.src.l3num = AF_INET;
++              hlpr->tuple.src.u.tcp.port = htons(ports[i]);
++              hlpr->tuple.dst.protonum = IPPROTO_TCP;
++              hlpr->expect_policy = &rtsp_exp_policy;
++              hlpr->me = THIS_MODULE;
++              hlpr->help = help;
++
++              tmpname = &rtsp_names[i][0];
++              if (ports[i] == RTSP_PORT) {
++                      sprintf(tmpname, "rtsp");
++              } else {
++                      sprintf(tmpname, "rtsp-%d", i);
++              }
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
++              strlcpy(hlpr->name, tmpname, sizeof(hlpr->name));
++#else
++              hlpr->name = tmpname;
++#endif
++              pr_debug("port #%d: %d\n", i, ports[i]);
++
++              ret = nf_conntrack_helper_register(hlpr);
++
++              if (ret) {
++                      printk("nf_conntrack_rtsp: ERROR registering port %d\n", ports[i]);
++                      fini();
++                      return -EBUSY;
++              }
++      }
++      return 0;
++}
++
++module_init(init);
++module_exit(fini);
+--- /dev/null
++++ b/extensions/rtsp/nf_conntrack_rtsp.h
+@@ -0,0 +1,72 @@
++/*
++ * RTSP extension for IP connection tracking.
++ * (C) 2003 by Tom Marshall <tmarshall at real.com>
++ * based on ip_conntrack_irc.h
++ *
++ *      This program is free software; you can redistribute it and/or
++ *      modify it under the terms of the GNU General Public License
++ *      as published by the Free Software Foundation; either version
++ *      2 of the License, or (at your option) any later version.
++ *
++ * 2013-03-04: Il'inykh Sergey <sergeyi at inango-sw.com>. Inango Systems Ltd
++ *    - conditional compilation for kernel 3.7
++ *    - port mapping improvements
++*/
++#ifndef _IP_CONNTRACK_RTSP_H
++#define _IP_CONNTRACK_RTSP_H
++
++#include <linux/version.h>
++
++//#define IP_NF_RTSP_DEBUG 1
++#define IP_NF_RTSP_VERSION "0.7"
++
++#ifdef __KERNEL__
++/* port block types */
++typedef enum {
++    pb_single,  /* client_port=x */
++    pb_range,   /* client_port=x-y */
++    pb_discon   /* client_port=x/y (rtspbis) */
++} portblock_t;
++
++/* We record seq number and length of rtsp headers here, all in host order. */
++
++/*
++ * This structure is per expected connection.  It is a member of struct
++ * ip_conntrack_expect.  The TCP SEQ for the conntrack expect is stored
++ * there and we are expected to only store the length of the data which
++ * needs replaced.  If a packet contains multiple RTSP messages, we create
++ * one expected connection per message.
++ *
++ * We use these variables to mark the entire header block.  This may seem
++ * like overkill, but the nature of RTSP requires it.  A header may appear
++ * multiple times in a message.  We must treat two Transport headers the
++ * same as one Transport header with two entries.
++ */
++struct ip_ct_rtsp_expect
++{
++    u_int32_t   len;        /* length of header block */
++    portblock_t pbtype;     /* Type of port block that was requested */
++    u_int16_t   loport;     /* Port that was requested, low or first */
++    u_int16_t   hiport;     /* Port that was requested, high or second */
++#if 0
++    uint        method;     /* RTSP method */
++    uint        cseq;       /* CSeq from request */
++#endif
++};
++
++extern unsigned int (*nf_nat_rtsp_hook)(struct sk_buff *skb,
++                                      enum ip_conntrack_info ctinfo,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++                                      unsigned int protoff,
++#endif
++                                      unsigned int matchoff,
++                                      unsigned int matchlen,
++                                      struct ip_ct_rtsp_expect *prtspexp,
++                                      struct nf_conntrack_expect *rtp_exp,
++                                      struct nf_conntrack_expect *rtcp_exp);
++
++#define RTSP_PORT   554
++
++#endif /* __KERNEL__ */
++
++#endif /* _IP_CONNTRACK_RTSP_H */
+--- /dev/null
++++ b/extensions/rtsp/nf_nat_rtsp.c
+@@ -0,0 +1,617 @@
++/*
++ * RTSP extension for TCP NAT alteration
++ * (C) 2003 by Tom Marshall <tmarshall at real.com>
++ *
++ * 2013-03-04: Il'inykh Sergey <sergeyi at inango-sw.com>. Inango Systems Ltd
++ *    - fixed rtcp nat mapping and other port mapping fixes
++ *    - fixed system hard lock because of bug in the parser
++ *    - codestyle fixes and less significant fixes
++ *
++ * based on ip_nat_irc.c
++ *
++ *    This program is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU General Public License
++ *    as published by the Free Software Foundation; either version
++ *    2 of the License, or (at your option) any later version.
++ *
++ * Module load syntax:
++ *    insmod nf_nat_rtsp.o ports=port1,port2,...port<MAX_PORTS>
++ *                         stunaddr=<address>
++ *                         destaction=[auto|strip|none]
++ *
++ * If no ports are specified, the default will be port 554 only.
++ *
++ * stunaddr specifies the address used to detect that a client is using STUN.
++ * If this address is seen in the destination parameter, it is assumed that
++ * the client has already punched a UDP hole in the firewall, so we don't
++ * mangle the client_port.  If none is specified, it is autodetected.  It
++ * only needs to be set if you have multiple levels of NAT.  It should be
++ * set to the external address that the STUN clients detect.  Note that in
++ * this case, it will not be possible for clients to use UDP with servers
++ * between the NATs.
++ *
++ * If no destaction is specified, auto is used.
++ *   destaction=auto:  strip destination parameter if it is not stunaddr.
++ *   destaction=strip: always strip destination parameter (not recommended).
++ *   destaction=none:  do not touch destination parameter (not recommended).
++ */
++
++#include <linux/module.h>
++#include <linux/version.h>
++#include <net/tcp.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++# include <net/netfilter/nf_nat.h>
++#else
++# include <net/netfilter/nf_nat_rule.h>
++#endif
++#include <net/netfilter/nf_nat_helper.h>
++#include "nf_conntrack_rtsp.h"
++#include <net/netfilter/nf_conntrack_expect.h>
++
++#include <linux/inet.h>
++#include <linux/ctype.h>
++#define NF_NEED_STRNCASECMP
++#define NF_NEED_STRTOU16
++#include "netfilter_helpers.h"
++#define NF_NEED_MIME_NEXTLINE
++#include "netfilter_mime.h"
++
++#define MAX_PORTS     8
++#define DSTACT_AUTO   0
++#define DSTACT_STRIP  1
++#define DSTACT_NONE   2
++
++static char* stunaddr = NULL;
++static char* destaction = NULL;
++
++static u_int32_t extip = 0;
++static int       dstact = 0;
++
++static void nf_nat_rtsp_expected(struct nf_conn* ct, struct nf_conntrack_expect *exp);
++
++MODULE_AUTHOR("Tom Marshall <tmarshall at real.com>");
++MODULE_DESCRIPTION("RTSP network address translation module");
++MODULE_LICENSE("GPL");
++module_param(stunaddr, charp, 0644);
++MODULE_PARM_DESC(stunaddr, "Address for detecting STUN");
++module_param(destaction, charp, 0644);
++MODULE_PARM_DESC(destaction, "Action for destination parameter (auto/strip/none)");
++
++#define SKIP_WSPACE(ptr,len,off) while(off < len && isspace(*(ptr+off))) { off++; }
++
++/*** helper functions ***/
++
++static void
++get_skb_tcpdata(struct sk_buff* skb, char** pptcpdata, uint* ptcpdatalen)
++{
++      struct iphdr*   iph  = ip_hdr(skb);
++      struct tcphdr*  tcph = (void *)iph + ip_hdrlen(skb);
++
++      *pptcpdata = (char*)tcph +  tcph->doff*4;
++      *ptcpdatalen = ((char*)skb_transport_header(skb) + skb->len) - *pptcpdata;
++}
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++/* copy of sip_sprintf_addr */
++static int rtsp_sprintf_addr(const struct nf_conn *ct, char *buffer,
++                           const union nf_inet_addr *addr, bool delim)
++{
++      if (nf_ct_l3num(ct) == NFPROTO_IPV4) {
++              return sprintf(buffer, "%pI4", &addr->ip);
++      } else {
++              if (delim)
++                      return sprintf(buffer, "[%pI6c]", &addr->ip6);
++              else
++                      return sprintf(buffer, "%pI6c", &addr->ip6);
++      }
++}
++#endif
++
++/*** nat functions ***/
++
++/*
++ * Mangle the "Transport:" header:
++ *   - Replace all occurences of "client_port=<spec>"
++ *   - Handle destination parameter
++ *
++ * In:
++ *   ct, ctinfo = conntrack context
++ *   skb        = packet
++ *   tranoff    = Transport header offset from TCP data
++ *   tranlen    = Transport header length (incl. CRLF)
++ *   rport_lo   = replacement low  port (host endian)
++ *   rport_hi   = replacement high port (host endian)
++ *
++ * Returns packet size difference.
++ *
++ * Assumes that a complete transport header is present, ending with CR or LF
++ */
++static int
++rtsp_mangle_tran(enum ip_conntrack_info ctinfo,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++               unsigned int protoff,
++#endif
++               struct nf_conntrack_expect* rtp_exp,
++               struct nf_conntrack_expect* rtcp_exp,
++               struct ip_ct_rtsp_expect* prtspexp,
++               struct sk_buff* skb, uint tranoff, uint tranlen)
++{
++      char*  ptcp;
++      uint   tcplen;
++      char*  ptran;
++      char   rbuf1[16];         /* Replacement buffer (one port) */
++      uint   rbuf1len;          /* Replacement len (one port) */
++      char   rbufa[16];         /* Replacement buffer (all ports) */
++      uint   rbufalen;          /* Replacement len (all ports) */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++      union nf_inet_addr newip;
++#else
++      u_int32_t  newip;
++#endif
++      u_int16_t loport, hiport;
++      uint      off = 0;
++      uint      diff;            /* Number of bytes we removed */
++
++      struct nf_conn *ct = rtp_exp->master;
++      /* struct nf_conn *ct = nf_ct_get(skb, &ctinfo); */
++      struct nf_conntrack_tuple *rtp_t;
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++      char szextaddr[INET6_ADDRSTRLEN];
++#else
++      char szextaddr[INET_ADDRSTRLEN];
++#endif
++      uint extaddrlen;
++      int  is_stun;
++
++      get_skb_tcpdata(skb, &ptcp, &tcplen);
++      ptran = ptcp+tranoff;
++
++      if (tranoff+tranlen > tcplen || tcplen-tranoff < tranlen ||
++          tranlen < 10 || !iseol(ptran[tranlen-1]) ||
++          nf_strncasecmp(ptran, "Transport:", 10) != 0) {
++              pr_info("sanity check failed\n");
++              return 0;
++      }
++      off += 10;
++      SKIP_WSPACE(ptcp+tranoff, tranlen, off);
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++      newip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3;
++      rtp_t = &rtp_exp->tuple;
++      rtp_t->dst.u3 = newip;
++      if (rtcp_exp) {
++              rtcp_exp->tuple.dst.u3 = newip;
++      }
++      extaddrlen = rtsp_sprintf_addr(ct, szextaddr, &newip, true); // FIXME handle extip
++      pr_debug("stunaddr=%s (auto)\n", szextaddr);
++#else
++      newip = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip;
++      rtp_t = &rtp_exp->tuple;
++      rtp_t->dst.u3.ip = newip;
++      if (rtcp_exp) {
++              rtcp_exp->tuple.dst.u3.ip = newip;
++      }
++      extaddrlen = extip ? sprintf(szextaddr, "%pI4", &extip)
++                         : sprintf(szextaddr, "%pI4", &newip);
++      pr_debug("stunaddr=%s (%s)\n", szextaddr, (extip?"forced":"auto"));
++#endif
++      hiport = 0;
++      rbuf1len = rbufalen = 0;
++      switch (prtspexp->pbtype) {
++      case pb_single:
++              for (loport = prtspexp->loport; loport != 0; loport++) { /* XXX: improper wrap? */
++                      rtp_t->dst.u.udp.port = htons(loport);
++                      if (nf_ct_expect_related(rtp_exp) == 0) {
++                              pr_debug("using port %hu\n", loport);
++                              break;
++                      }
++              }
++              if (loport != 0) {
++                      rbuf1len = sprintf(rbuf1, "%hu", loport);
++                      rbufalen = sprintf(rbufa, "%hu", loport);
++              }
++              break;
++      case pb_range:
++              for (loport = prtspexp->loport; loport != 0; loport += 2) { /* XXX: improper wrap? */
++                      rtp_t->dst.u.udp.port = htons(loport);
++                      if (nf_ct_expect_related(rtp_exp) != 0) {
++                              continue;
++                      }
++                      hiport = loport + 1;
++                      rtcp_exp->tuple.dst.u.udp.port = htons(hiport);
++                      if (nf_ct_expect_related(rtcp_exp) != 0) {
++                              nf_ct_unexpect_related(rtp_exp);
++                              continue;
++                      }
++
++                      /* FIXME: invalid print in case of ipv6 */
++                      pr_debug("nat expect_related %pI4:%u-%u-%pI4:%u-%u\n",
++                               &rtp_exp->tuple.src.u3.ip,
++                               ntohs(rtp_exp->tuple.src.u.udp.port),
++                               ntohs(rtcp_exp->tuple.src.u.udp.port),
++                               &rtp_exp->tuple.dst.u3.ip,
++                               ntohs(rtp_exp->tuple.dst.u.udp.port),
++                               ntohs(rtcp_exp->tuple.dst.u.udp.port));
++                      break;
++              }
++              if (loport != 0) {
++                      rbuf1len = sprintf(rbuf1, "%hu", loport);
++                      rbufalen = sprintf(rbufa, "%hu-%hu", loport, hiport);
++              }
++              break;
++      case pb_discon:
++              for (loport = prtspexp->loport; loport != 0; loport++) { /* XXX: improper wrap? */
++                      rtp_t->dst.u.udp.port = htons(loport);
++                      if (nf_ct_expect_related(rtp_exp) == 0) {
++                              pr_debug("using port %hu (1 of 2)\n", loport);
++                              break;
++                      }
++              }
++              for (hiport = prtspexp->hiport; hiport != 0; hiport++) { /* XXX: improper wrap? */
++                      rtp_t->dst.u.udp.port = htons(hiport);
++                      if (nf_ct_expect_related(rtp_exp) == 0) {
++                              pr_debug("using port %hu (2 of 2)\n", hiport);
++                              break;
++                      }
++              }
++              if (loport != 0 && hiport != 0) {
++                      rbuf1len = sprintf(rbuf1, "%hu", loport);
++                      rbufalen = sprintf(rbufa, hiport == loport+1 ?
++                                         "%hu-%hu":"%hu/%hu", loport, hiport);
++              }
++              break;
++      }
++
++      if (rbuf1len == 0)
++              return 0;   /* cannot get replacement port(s) */
++
++      /* Transport: tran;field;field=val,tran;field;field=val,...
++         `off` is set to the start of Transport value from start of line
++      */
++      while (off < tranlen) {
++              uint        saveoff;
++              const char* pparamend;
++              uint        nextparamoff;
++
++              pparamend = memchr(ptran+off, ',', tranlen-off);
++              pparamend = (pparamend == NULL) ? ptran+tranlen : pparamend+1;
++              nextparamoff = pparamend-ptran;
++
++              /*
++               * We pass over each param twice.  On the first pass, we look for a
++               * destination= field.  It is handled by the security policy.  If it
++               * is present, allowed, and equal to our external address, we assume
++               * that STUN is being used and we leave the client_port= field alone.
++               */
++              is_stun = 0;
++              saveoff = off;
++              while (off < nextparamoff) {
++                      const char* pfieldend;
++                      uint        nextfieldoff;
++
++                      pfieldend = memchr(ptran+off, ';', nextparamoff-off);
++                      nextfieldoff = (pfieldend == NULL) ? nextparamoff : pfieldend-ptran+1;
++
++                      if (dstact != DSTACT_NONE && strncmp(ptran+off, "destination=", 12) == 0) {
++                              if (strncmp(ptran+off+12, szextaddr, extaddrlen) == 0)
++                                      is_stun = 1;
++
++                              if (dstact == DSTACT_STRIP || (dstact == DSTACT_AUTO && !is_stun)) {
++                                      uint dstoff = (ptran-ptcp)+off;
++                                      uint dstlen = nextfieldoff-off;
++                                      char* pdstrep = NULL;
++                                      uint dstreplen = 0;
++                                      diff = dstlen;
++                                      if (dstact == DSTACT_AUTO && !is_stun) {
++                                              pr_debug("RTSP: replace dst addr\n");
++                                              dstoff += 12;
++                                              dstlen -= 13;
++                                              pdstrep = szextaddr;
++                                              dstreplen = extaddrlen;
++                                              diff = nextfieldoff-off-13-extaddrlen;
++                                      }
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++                                      if (!nf_nat_mangle_tcp_packet(skb, ct, ctinfo, protoff,
++                                                                    dstoff, dstlen, pdstrep, dstreplen)) {
++#else
++                                      if (!nf_nat_mangle_tcp_packet(skb, ct, ctinfo,
++                                                                    dstoff, dstlen, pdstrep, dstreplen)) {
++#endif
++                                              /* mangle failed, all we can do is bail */
++                                              nf_ct_unexpect_related(rtp_exp);
++                                              if (rtcp_exp)
++                                                      nf_ct_unexpect_related(rtcp_exp);
++                                              return 0;
++                                      }
++                                      get_skb_tcpdata(skb, &ptcp, &tcplen);
++                                      ptran = ptcp+tranoff;
++                                      tranlen -= diff;
++                                      nextparamoff -= diff;
++                                      nextfieldoff -= diff;
++                              }
++                      }
++
++                      off = nextfieldoff;
++              }
++
++              if (is_stun)
++                      continue;
++
++              off = saveoff;
++              while (off < nextparamoff) {
++                      const char* pfieldend;
++                      uint        nextfieldoff;
++
++                      pfieldend = memchr(ptran+off, ';', nextparamoff-off);
++                      nextfieldoff = (pfieldend == NULL) ? nextparamoff : pfieldend-ptran+1;
++
++                      if (strncmp(ptran+off, "client_port=", 12) == 0) {
++                              u_int16_t port;
++                              uint      numlen;
++                              uint      origoff;
++                              uint      origlen;
++                              char*     rbuf = rbuf1;
++                              uint      rbuflen = rbuf1len;
++
++                              off += 12;
++                              origoff = (ptran-ptcp)+off;
++                              origlen = 0;
++                              numlen = nf_strtou16(ptran+off, &port);
++                              off += numlen;
++                              origlen += numlen;
++                              if (port != prtspexp->loport) {
++                                      pr_debug("multiple ports found, port %hu ignored\n", port);
++                              } else {
++                                      if (ptran[off] == '-' || ptran[off] == '/') {
++                                              off++;
++                                              origlen++;
++                                              numlen = nf_strtou16(ptran+off, &port);
++                                              off += numlen;
++                                              origlen += numlen;
++                                              rbuf = rbufa;
++                                              rbuflen = rbufalen;
++                                      }
++
++                                      /*
++                                       * note we cannot just memcpy() if the sizes are the same.
++                                       * the mangle function does skb resizing, checks for a
++                                       * cloned skb, and updates the checksums.
++                                       *
++                                       * parameter 4 below is offset from start of tcp data.
++                                       */
++                                      diff = origlen-rbuflen;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++                                      if (!nf_nat_mangle_tcp_packet(skb, ct, ctinfo, protoff,
++                                                                    origoff, origlen, rbuf, rbuflen)) {
++#else
++                                      if (!nf_nat_mangle_tcp_packet(skb, ct, ctinfo,
++                                                                    origoff, origlen, rbuf, rbuflen)) {
++#endif
++                                              /* mangle failed, all we can do is bail */
++                                              nf_ct_unexpect_related(rtp_exp);
++                                              if (rtcp_exp)
++                                                      nf_ct_unexpect_related(rtcp_exp);
++                                              return 0;
++                                      }
++                                      get_skb_tcpdata(skb, &ptcp, &tcplen);
++                                      ptran = ptcp+tranoff;
++                                      tranlen -= diff;
++                                      nextparamoff -= diff;
++                                      nextfieldoff -= diff;
++                              }
++                      }
++
++                      off = nextfieldoff;
++              }
++
++              off = nextparamoff;
++      }
++
++      return 1;
++}
++
++static uint
++help_out(struct sk_buff *skb, enum ip_conntrack_info ctinfo,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++       unsigned int protoff,
++#endif
++       unsigned int matchoff, unsigned int matchlen,
++       struct ip_ct_rtsp_expect* prtspexp,
++       struct nf_conntrack_expect* rtp_exp,
++       struct nf_conntrack_expect* rtcp_exp)
++{
++      char* ptcp;
++      uint  tcplen;
++      uint  hdrsoff;
++      uint  hdrslen;
++      uint  lineoff;
++      uint  linelen;
++      uint  off;
++      int   dir = CTINFO2DIR(ctinfo);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++      union nf_inet_addr saddr = rtp_exp->master->tuplehash[dir].tuple.src.u3;
++#else
++      __be32 saddr = rtp_exp->master->tuplehash[dir].tuple.src.u3.ip;
++#endif
++
++      //struct iphdr* iph = (struct iphdr*)(*pskb)->nh.iph;
++      //struct tcphdr* tcph = (struct tcphdr*)((void*)iph + iph->ihl*4);
++
++      get_skb_tcpdata(skb, &ptcp, &tcplen);
++      hdrsoff = matchoff;//exp->seq - ntohl(tcph->seq);
++      hdrslen = matchlen;
++      off = hdrsoff;
++      pr_debug("NAT rtsp help_out\n");
++
++      while (nf_mime_nextline(ptcp, hdrsoff+hdrslen, &off, &lineoff, &linelen)) {
++              if (linelen == 0)
++                      break;
++
++              if (off > hdrsoff+hdrslen) {
++                      pr_info("!! overrun !!");
++                      break;
++              }
++              pr_debug("hdr: len=%u, %.*s", linelen, (int)linelen, ptcp+lineoff);
++
++              if (nf_strncasecmp(ptcp+lineoff, "Transport:", 10) == 0) {
++                      uint oldtcplen = tcplen;
++                      pr_debug("hdr: Transport\n");
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++                      if (!rtsp_mangle_tran(ctinfo, protoff, rtp_exp, rtcp_exp,
++                                            prtspexp, skb, lineoff, linelen)) {
++#else
++                      if (!rtsp_mangle_tran(ctinfo, rtp_exp, rtcp_exp, prtspexp,
++                                            skb, lineoff, linelen)) {
++#endif
++                              pr_debug("hdr: Transport mangle failed");
++                              break;
++                      }
++                      rtp_exp->expectfn = nf_nat_rtsp_expected;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++                      rtp_exp->saved_addr = saddr;
++#else
++                      rtp_exp->saved_ip = saddr;
++#endif
++                      rtp_exp->saved_proto.udp.port = htons(prtspexp->loport);
++                      rtp_exp->dir = !dir;
++                      if (rtcp_exp) {
++                              rtcp_exp->expectfn = nf_nat_rtsp_expected;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++                              rtcp_exp->saved_addr = saddr;
++#else
++                              rtcp_exp->saved_ip = saddr;
++#endif
++                              rtcp_exp->saved_proto.udp.port = htons(prtspexp->hiport);
++                              rtcp_exp->dir = !dir;
++                      }
++                      get_skb_tcpdata(skb, &ptcp, &tcplen);
++                      hdrslen -= (oldtcplen-tcplen);
++                      off -= (oldtcplen-tcplen);
++                      lineoff -= (oldtcplen-tcplen);
++                      linelen -= (oldtcplen-tcplen);
++                      pr_debug("rep: len=%u, %.*s", linelen, (int)linelen, ptcp+lineoff);
++              }
++      }
++
++      return NF_ACCEPT;
++}
++
++static unsigned int
++nf_nat_rtsp(struct sk_buff *skb, enum ip_conntrack_info ctinfo,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++          unsigned int protoff,
++#endif
++          unsigned int matchoff, unsigned int matchlen,
++          struct ip_ct_rtsp_expect* prtspexp,
++          struct nf_conntrack_expect* rtp_exp,
++          struct nf_conntrack_expect* rtcp_exp)
++{
++      int dir = CTINFO2DIR(ctinfo);
++      int rc = NF_ACCEPT;
++
++      switch (dir) {
++      case IP_CT_DIR_ORIGINAL:
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++              rc = help_out(skb, ctinfo, protoff, matchoff, matchlen, prtspexp,
++                            rtp_exp, rtcp_exp);
++#else
++              rc = help_out(skb, ctinfo, matchoff, matchlen, prtspexp,
++                            rtp_exp, rtcp_exp);
++#endif
++              break;
++      case IP_CT_DIR_REPLY:
++              pr_debug("unmangle ! %u\n", ctinfo);
++              /* XXX: unmangle */
++              rc = NF_ACCEPT;
++              break;
++      }
++      //UNLOCK_BH(&ip_rtsp_lock);
++
++      return rc;
++}
++
++static void nf_nat_rtsp_expected(struct nf_conn* ct, struct nf_conntrack_expect *exp)
++{
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++      struct nf_nat_range range;
++#else
++      struct nf_nat_ipv4_range range;
++#endif
++
++      /* This must be a fresh one. */
++      BUG_ON(ct->status & IPS_NAT_DONE_MASK);
++
++      /* For DST manip, map port here to where it's expected. */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++      range.min_proto = range.max_proto = exp->saved_proto;
++      range.min_addr = range.max_addr = exp->saved_addr;
++#else
++      range.min = range.max = exp->saved_proto;
++      range.min_ip = range.max_ip = exp->saved_ip;
++#endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
++      range.flags = (NF_NAT_RANGE_MAP_IPS | NF_NAT_RANGE_PROTO_SPECIFIED);
++      nf_nat_setup_info(ct, &range, NF_NAT_MANIP_DST);
++#else
++      range.flags = (IP_NAT_RANGE_MAP_IPS | IP_NAT_RANGE_PROTO_SPECIFIED);
++      nf_nat_setup_info(ct, &range, IP_NAT_MANIP_DST);
++#endif
++
++      /* Change src to where master sends to, but only if the connection
++       * actually came from the same source. */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++      if (nf_inet_addr_cmp(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3,
++                           &ct->master->tuplehash[exp->dir].tuple.src.u3)) {
++              range.min_addr = range.max_addr
++                      = ct->master->tuplehash[!exp->dir].tuple.dst.u3;
++#else
++      if (ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip ==
++          ct->master->tuplehash[exp->dir].tuple.src.u3.ip) {
++              range.min_ip = range.max_ip
++                      = ct->master->tuplehash[!exp->dir].tuple.dst.u3.ip;
++#endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
++              range.flags = NF_NAT_RANGE_MAP_IPS;
++              nf_nat_setup_info(ct, &range, NF_NAT_MANIP_SRC);
++#else
++              range.flags = IP_NAT_RANGE_MAP_IPS;
++              nf_nat_setup_info(ct, &range, IP_NAT_MANIP_SRC);
++#endif
++      }
++}
++
++
++static void __exit fini(void)
++{
++      rcu_assign_pointer(nf_nat_rtsp_hook, NULL);
++      synchronize_net();
++}
++
++static int __init init(void)
++{
++      printk("nf_nat_rtsp v" IP_NF_RTSP_VERSION " loading\n");
++
++      BUG_ON(nf_nat_rtsp_hook);
++      rcu_assign_pointer(nf_nat_rtsp_hook, nf_nat_rtsp);
++
++      if (stunaddr != NULL)
++              extip = in_aton(stunaddr);
++
++      if (destaction != NULL) {
++              if (strcmp(destaction, "auto") == 0)
++                      dstact = DSTACT_AUTO;
++
++              if (strcmp(destaction, "strip") == 0)
++                      dstact = DSTACT_STRIP;
++
++              if (strcmp(destaction, "none") == 0)
++                      dstact = DSTACT_NONE;
++      }
++
++      return 0;
++}
++
++module_init(init);
++module_exit(fini);
+--- a/extensions/Kbuild
++++ b/extensions/Kbuild
+@@ -26,6 +26,7 @@ obj-${build_lscan}       += xt_lscan.o
+ obj-${build_pknock}      += pknock/
+ obj-${build_psd}         += xt_psd.o
+ obj-${build_quota2}      += xt_quota2.o
++obj-${build_rtsp}        += rtsp/
+ -include ${M}/*.Kbuild
+ -include ${M}/Kbuild.*
+--- a/mconfig
++++ b/mconfig
+@@ -22,3 +22,4 @@ build_lscan=m
+ build_pknock=m
+ build_psd=m
+ build_quota2=m
++build_rtsp=m
diff --git a/net/xtables-addons/patches/200-add-lua-packetscript.patch b/net/xtables-addons/patches/200-add-lua-packetscript.patch
new file mode 100644 (file)
index 0000000..33d0d74
--- /dev/null
@@ -0,0 +1,18158 @@
+--- /dev/null
++++ b/extensions/LUA/byte_array.c
+@@ -0,0 +1,145 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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 "controller.h"
++
++/* Initialization helper function. This function should be used whenever
++ * a new byte array need to be initialized. Depending on the arguments it
++ * initializes the array in a different way. Have a look at the inline
++ * comments */
++lua_packet_segment * init_byte_array(lua_State *L, unsigned char * start, int length, int do_copy)
++{
++      lua_packet_segment *array;
++
++      if (length < 0)
++              luaL_error(L, "init_byte_array, requested size < 0");
++
++      if (start && do_copy) {
++              /* we have a start address where we copy from */
++              array = lua_newuserdata(L, sizeof(lua_packet_segment) + length);
++              array->start = (unsigned char *)array + sizeof(lua_packet_segment); /* aligning pointer */
++              memcpy(array->start, start, length);
++      }else if (start && !do_copy) {
++              /* just link the start pointer, in this case you have to free the memory yourself */
++              array = lua_newuserdata(L, sizeof(lua_packet_segment));
++              array->start = start;
++      }else{
++              /* create an empty array, fully managed by Lua */
++              array = lua_newuserdata(L, sizeof(lua_packet_segment) + length);
++              array->start = (unsigned char *)array + sizeof(lua_packet_segment); /* aligning pointer */
++              memset(array->start, 0, length);
++      }
++
++      array->length = length;
++      array->offset = 0;
++      array->changes = NULL;
++
++      luaL_getmetatable(L, LUA_BYTE_ARRAY);
++      lua_setmetatable(L, -2);
++
++      return array;
++}
++
++
++
++/* LUA_API: get one byte of the given byte array 
++ * access-pattern: array[<index>] */
++static int32_t get_byte_array(lua_State *L)
++{
++      lua_packet_segment * array = checkbytearray(L, 1);
++      int32_t index = luaL_checkinteger(L, 2); /* array starts with index 0 (not 1 as usual in Lua) */
++
++      luaL_argcheck(L, 0 <= index && index < array->length, 1, "index out of range");
++      lua_pushinteger(L, (array->start + array->offset)[index]);
++
++      return 1;
++}
++
++/* LUA_API: set one byte of the given byte array
++ * access-pattern: array[<index>]= 0xFF */
++static int32_t set_byte_array(lua_State *L)
++{
++      lua_packet_segment * array = checkbytearray(L, 1);
++      uint8_t byte;
++      int32_t index = luaL_checkinteger(L, 2);    /* array starts with index 0 (not 1 as usual in Lua) */
++      int32_t val = luaL_checkinteger(L, 3);
++      uint32_t  nob = 1 << CHAR_BIT;               /* we should use something like 1 << CHAR_BIT */
++
++      luaL_argcheck(L, 0 <= index && index < array->length, 1, "index out of range");
++      luaL_argcheck(L, 0 <= val && val < nob, 2, "cannot cast value to char");
++
++      byte = (uint8_t)val;
++
++      (array->start + array->offset)[index] = byte;
++
++      return 0;
++}
++
++/* LUA_API: get size of the given byte array
++ * access-pattern: #array (__length meta-method) */
++static int32_t get_byte_array_size(lua_State *L)
++{
++      lua_packet_segment * array = checkbytearray(L, 1);
++
++      lua_pushnumber(L, array->length);
++
++      return 1;
++}
++
++
++/* LUA_API: converts a given byte array to a string. 
++ * access-pattern: implicit through functions calling the
++ * __to_string() metamethod , e.g. print32_t */
++static int32_t byte_array_to_string(lua_State *L)
++{
++      lua_packet_segment * array = checkbytearray(L, 1);
++      uint8_t buf[(array->length * 3) + 255];
++      uint8_t hexval[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
++      char res[255 + (array->length * 3)]; /* make sure the buffer is big enough*/
++      int32_t i, n;
++      uint8_t *ptr = array->start + array->offset;
++
++      for (i = 0; i < array->length; i++) {
++              buf[i * 3] = hexval[(ptr[i] >> 4) & 0xF];
++              buf[(i * 3) + 1] = hexval[ptr[i] & 0x0F];
++              buf[(i * 3) + 2] = ' '; /* seperator */
++      }
++
++      buf[array->length * 3] = '\0';
++      n = sprintf(res, "byte_array: length: %d  value: %s", array->length, buf);
++
++      lua_pushlstring(L, res, n);
++
++      return 1;
++}
++
++static const struct luaL_Reg bytearray_lib_m [] = {
++      { "__len",      get_byte_array_size  },
++      { "__newindex", set_byte_array       },
++      { "__index",    get_byte_array       },
++      { "__tostring", byte_array_to_string },
++      { NULL,         NULL                 }
++};
++
++void luaopen_bytearraylib(lua_State *L)
++{
++      luaL_newmetatable(L, LUA_BYTE_ARRAY);
++      luaL_register(L, NULL, bytearray_lib_m);
++      lua_pop(L, 1);
++}
++
++
+--- /dev/null
++++ b/extensions/LUA/controller.c
+@@ -0,0 +1,604 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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/>.
++ */
++
++#if defined(__KERNEL__)
++      #include <linux/mm.h>
++#endif
++#include "controller.h"
++
++/* the array 'supported_protocols' holds all pointers to the 
++ * static and dynamic protocol buffers. It is filled by the 
++ * call to register_protbuf */
++static struct protocol_buf * supported_protocols[MAX_NR_OF_PROTOCOLS];
++
++/* C_API: the function 'get_protocol_buf' returns the pointer 
++ * to the protocol buffer of a given protocol id. */
++struct protocol_buf * get_protocol_buf(uint32_t  protocol_id)
++{
++      return (struct protocol_buf *)supported_protocols[protocol_id];
++}
++
++
++/* LUA_INT: the function 'gc_packet_segment' is triggered by the 
++ * garbage collector whenever a userdata annotated with one of 
++ * the protocol buffer metatable should be collected. */
++static int32_t gc_packet_segment(lua_State *L)
++{
++      lua_packet_segment * seg = (lua_packet_segment *)lua_touserdata(L, 1);
++      if (seg && seg->changes) {
++              seg->changes->ref_count--;
++              if (seg->changes->ref_count <= 0) {
++                      kfree(seg->changes->field_length_changes);
++                      kfree(seg->changes->field_offset_changes);
++                      kfree(seg->changes);
++                      seg->changes = NULL;
++              }
++      }
++      return 0;
++}
++
++
++/* LUA_API: the function 'set_raw' is used to set the bytes of a segment 
++ * in 'raw' mode. The function is per default available in each protocol 
++ * buffer until it gets overridden by a specific setter function inside 
++ * a protocol buffer.
++ * 
++ * Parameters:
++ * 1. lua_packet_segment (implicit)
++ * 2. int32_t byte_value
++ *
++ * Upvalues:
++ * 1.  struct protocol_buf*
++ * 2.  int32_t field index, not used in this function
++ *
++ * Return: void
++ */
++static int32_t set_raw(lua_State *L)
++{
++      int32_t i;
++      uint32_t  nob;
++      uint8_t byte;
++      uint8_t *ptr;
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      int32_t val = luaL_checkinteger(L, 2);
++
++      nob = 1 << CHAR_BIT;
++
++      luaL_argcheck(L, 0 <= val && val < nob, 2, "cannot cast value to char");
++
++      byte = (uint8_t)val;
++      ptr = seg->start + seg->offset;
++
++      for (i = 0; i < seg->length; i++)
++              ptr[i] = byte;
++
++      return 0;
++}
++
++/* LUA_API: the function 'get_raw' is used to get the bytes of a segment 
++ * in 'raw' mode. The function is per default available in each protocol 
++ * buffer until it gets overridden by a specific getter function inside 
++ * a protocol buffer.
++ *
++ * Parameters:
++ * 1. lua_packet_segment (implicit)
++ * 2. uint32_t  offset
++ * 3. uint32_t  length 
++ *
++ * Upvalues:
++ * 1.  struct protocol_buf*
++ * 2.  int32_t field index, not used in this function
++ *
++ * Return: 
++ * the byte array representing the given array
++ */
++static int32_t get_raw(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      init_byte_array(L, seg->start + seg->offset,  seg->length, 1);
++
++      return 1;
++}
++/* LUA_API: The function 'get_segment' is used to get a new segment in 'raw' mode. 
++ * Typically this function is applied on another raw segment in order 
++ * to extract a part of the segment as new segment.
++ *
++ * Parameters:
++ * 1.  lua_packet_segment, implicit through object oriented access seg:raw(..)
++ * 2.  uint32_t  offset, this indicates where to start the new segment, see e.g below.
++ * 3.  uint32_t  length, this indicates the size of the new segment
++ *
++ * Upvalues:
++ * 1.  struct protocol_buf*
++ * 2.  int32_t field index, not used in this function
++ *
++ * Return:
++ * 1.  A lua_packet_segment annotated with the according metatable or False in
++ *     case the input data is not valid
++ *
++ * Example:
++ *
++ * +------------------------+---------------------------------------+
++ * | function call          | resulting lua_packet_segment          |
++ * +========================+===+===+===+===+===+===+===+===+===+===+
++ * | seg = packet:raw(0,10) | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
++ * +------------------------+---+---+---+---+---+---+---+---+---+---+
++ * | 1st_half = seg:raw(0,5)| 0 | 1 | 2 | 3 | 4 |                   |
++ * +------------------------+---+---+---+---+---+---+---+---+---+---+
++ * | 2nd_half = seg:raw(5,5)|                   | 5 | 6 | 7 | 8 | 9 |
++ * +------------------------+-------------------+---+---+---+---+---+
++ */
++static int32_t get_segment(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++      uint32_t  offset = luaL_checkinteger(L, 2);
++      uint32_t  length = luaL_checkinteger(L, 3);
++      lua_packet_segment * new = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment));
++
++      new->start = seg->start;
++      new->offset = seg->offset + offset;
++      new->changes = NULL;
++      /* we allow a seg->length == 0 , this enables processing packets where the packetsize is not fixed (0 = not fixed)*/
++      if (seg->length != 0 && length > seg->length) {
++              lua_pushboolean(L, 0);
++              return 1;
++      }
++
++      new->length = length;
++      luaL_getmetatable(L, prot_buf->name);
++      lua_setmetatable(L, -2);
++
++      return 1;
++}
++
++/* LUA_API: the function 'get_segment_size' is used to get the size of a segment.
++ * 
++ * Parameters:
++ * 1.  lua_packet_segment, implicit through object oriented access seg:raw(..)
++ *
++ * Upvalues:
++ * 1.  struct protocol_buf*
++ * 2.  int32_t field index, not used in this function
++ *
++ * Return:
++ * 1.  Size as lua_Number
++ */
++static int32_t get_segment_size(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      lua_pushnumber(L, seg->length);
++      return 1;
++}
++
++/* LUA_API: the function 'get_segment_offset' is used to get the real offset 
++ * of a segment. This function returns the offset of the segment to the start
++ * of the buffer. This means the following
++ *     seg1 = packet:raw(2,10)
++ *     seg2 = seg1:raw(3,5)
++ *   offset = seg2:get_offset()
++ *
++ * will give an offset of 5, since the seg1 starts at offset 2, and seg2 starts
++ * at offset (seg1:get_offset() + 3).
++ * 
++ * Parameters:
++ * 1.  lua_packet_segment, implicit through object oriented access seg:raw(..)
++ *
++ * Upvalues:
++ * 1.  struct protocol_buf*
++ * 2.  int32_t field index, not used in this function
++ *
++ * Return:
++ * 1.  Offset as lua_Number
++ */
++static int32_t get_segment_offset(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      lua_pushnumber(L, seg->offset);
++      return 1;
++}
++
++/* LUA_API: overwrites the __tostring function of a lua_packet_segment.
++ * this will print32_t a nicely formated string, including length,
++ * offset and name of the protocol buffer.
++ *
++ * Parameters:
++ * 1. lua_packet_segment (implicit)
++ *
++ * Returns:
++ * 1. the representing string
++ */
++static int32_t packet_segment_tostring(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++      int32_t n;
++      char buf[128];
++
++      n = sprintf(buf, "type: %s, offset: %d, length: %d", prot_buf->name, seg->offset, seg->length);
++      lua_pushlstring(L, buf, n);
++
++      return 1;
++}
++
++
++static const struct luaL_Reg seg_access_functions [] = {
++      { "set",        set_raw                 },
++      { "get",        get_raw                 },
++      { "raw",        get_segment             },
++      { "get_offset", get_segment_offset      },
++      { "get_size",   get_segment_size        },
++      { "to_bytes",   get_raw                 },
++      { "__tostring", packet_segment_tostring },
++      { "__gc",       gc_packet_segment       },
++      { NULL,         NULL                    }
++};
++
++/* C_API: the function 'get_metatable_from_protocol_type' is a helper
++ * used in controller.c as well as it may find usage in the static 
++ * protocol buffers and byte array implementation. */
++void get_metatable_from_protocol_type(lua_State *L, int32_t type)
++{
++      char * table;
++      lua_getglobal(L, SUPPORTED_PROTOCOL_TABLE);
++      lua_rawgeti(L, -1, type);
++      table = (char *)luaL_checkstring(L, -1);
++      lua_pop(L, 2); /* pop the table SUPPORTED_PROTOCOL_TABLE and the string pushed by lua_gettable */
++      luaL_getmetatable(L, table);
++      return;
++}
++
++/* C_INT: the function 'payload_contains_protocol' is used internally. 
++ * Depending if static or dynamic protocol buffer it calls the right
++ * validation function. */
++static int32_t payload_contains_protocol(lua_State *L, struct protocol_buf *prot_buf, lua_packet_segment *seg, uint32_t  prot_type)
++{
++      if (prot_buf->is_dynamic)
++              return has_protocol_dynamic(L, prot_buf, seg, prot_type);
++      else
++              return prot_buf->has_protocol(L, prot_buf, seg, prot_type);
++}
++
++/* C_INT: the function 'protocol_get_field_changes' is used interally. 
++ * It requests the field_changes struct calling the protocol buffers
++ * 'get_field_changes' function. This funciton is called, whenever
++ * the payload field with a given protocol type is requested inside 
++ * the function 'get_protocol_field' */
++static struct field_changes * protocol_get_field_changes(lua_State *L, struct protocol_buf *prot_buf, lua_packet_segment * seg)
++{
++      struct field_changes * changes = NULL;
++
++      if (prot_buf->get_field_changes) {
++              if (prot_buf->is_dynamic)
++                      changes = get_field_changes_dynamic(L, prot_buf, seg);
++              else
++                      changes = prot_buf->get_field_changes(L, seg);
++               /* is already 1 when set by helper 'get_allocated_field_changes,
++                * since not every prot_buf may use this function we enforce it. */
++              changes->ref_count = 1;
++      }
++      return changes;
++}
++
++/* C_INT: the function 'get_field_offset_in_bytes' wrapps the logic of 
++ * calculating the new length with considering the optional field_changes. */
++static int32_t get_field_offset_in_bytes(struct protocol_field * field, lua_packet_segment * seg, int32_t field_index)
++{
++      uint32_t  nr_of_bits, nr_of_bytes, field_offset;
++
++      field_offset = field->offset;
++      /* do we need to manipulate the default values stored inside the protocol buffer ?? */
++      if (seg->changes)
++              field_offset += seg->changes->field_offset_changes[field_index];
++      /* how many bits remain */
++      nr_of_bits = field_offset & (CHAR_BIT - 1);
++      /* assuming CHAR_BIT == 2 ^ 3 */
++      nr_of_bytes = (field_offset - nr_of_bits) >> 3;
++
++      return seg->offset + nr_of_bytes;
++}
++
++/* C_INT: the function 'get_field_length_in_bytes' wrapps the logic of 
++ * calculating the new offset with considering the optional field_changes. */
++static int32_t get_field_length_in_bytes(struct protocol_field * field, lua_packet_segment * seg, int32_t field_index)
++{
++      uint32_t  nr_of_bits, nr_of_bytes, field_length;
++
++      field_length = field->length;
++      /* if the field length is smaller than 1 byte, we take the size of one byte
++       * we treat the case where field_length == 0 in a special way ...*/
++      if (field_length < CHAR_BIT && field_length > 0)
++              field_length = CHAR_BIT;
++
++      /* do we need to manipulate the default values stored inside the protocol buffer ?? */
++      if (seg->changes)
++              field_length += seg->changes->field_length_changes[field_index];
++      /* how many bits remain */
++      nr_of_bits = field_length & (CHAR_BIT - 1);
++      /* assuming CHAR_BIT == 2 ^ 3 */
++      nr_of_bytes = (field_length - nr_of_bits) >> 3;
++      return nr_of_bytes;
++}
++
++/* C_INT: the function 'initialize_field_getter_and_setter' initializes 
++ * the setter and getter function of the field, considering the optional
++ * field manipulator functions defined inside the protocol buffers. */
++static void initialize_field_getter_and_setter(lua_State *L, struct protocol_buf *prot_buf, int32_t field_index)
++{
++      /* lets check if there is a metatable on top of the stack */
++      struct protocol_field * f = (struct protocol_field *)&prot_buf->protocol_fields[field_index];
++
++      if (!lua_istable(L, -1)) luaL_error(L, "cannot initialize getter and setter for field %s->%s, "
++                                          "not a table on top of the stack, is '%s'", prot_buf->name, f->name, lua_typename(L, lua_type(L, -1)));
++
++      /* is there a 'getter' to initialize ? */
++      lua_pushlightuserdata(L, prot_buf);     /* push upvalue 1 */
++      lua_pushinteger(L, field_index);        /* push upvalue 2 */
++      if (f->get) {
++              if (prot_buf->is_dynamic)
++                      lua_pushcclosure(L, field_dynamic_getter, 2);
++              else
++                      lua_pushcclosure(L, f->get, 2);
++      }else
++              /* there is no specific getter defined - fall back to 'get_raw'  */
++              lua_pushcclosure(L, get_raw, 2);
++       /* set the metatable field 'get' */
++      lua_setfield(L, -2, "get");
++
++      /* is there a 'setter' to initialize ? */
++      lua_pushlightuserdata(L, prot_buf);     /* push upvalue 1 */
++      lua_pushinteger(L, field_index);        /* push upvalue 2 */
++      if (f->set) {
++              if (prot_buf->is_dynamic)
++                      lua_pushcclosure(L, field_dynamic_setter, 2);
++              else
++                      lua_pushcclosure(L, f->set, 2);
++      }else
++              /* there is no specific setter defined - fall back to 'set_raw'  */
++              lua_pushcclosure(L, set_raw, 2);
++       /* set the metatable field 'set' */
++      lua_setfield(L, -2, "set");
++}
++
++/* LUA_API: 'get_protocol_field' is used in Lua as a closure for each field of a protocol
++ * buffer. E.g a call to ip = packet:data(packet_ip) will go to this function,
++ * and trigger the conversion of the raw packet to a ip packet. Each call
++ * to a field function of an IP packet, like ip:daddr() uses this function
++ * to to return the right data. In each case you will end up either with a
++ * new packet segment (annotated with the proper metatable) or a boolean
++ * value (False) if something went wrong. In the case everything went fine,
++ * the newly created lua_packet_segment is annotated with the proper
++ * metatable where the fields get and set also contain the specific getter
++ * and setter functions given by the protocol buffer. E.g. the function call
++ * ip:daddr():get() or ip:daddr():set(...) will call the proper function
++ * defined inside the corresponding field definition.
++ *
++ * Parameters:
++ * 1.  lua_packet_segment, implicit through object oriented access seg:raw(..)
++ * 2.  type of the protocol buffer, optional, and only used if the accessed
++ *     field is the payload field. If a type is provided for the access of the
++ *     payload field, the function tries to convert the data pointed to by the
++ *     payload field to the given type. To check if such a conversion is
++ *     possible, it calls the function pointed to by the protocol buffer member
++ *     has_protocol. If this function returns True, the conversion takes place.
++ *
++ * Upvalues:
++ * 1.  struct protocol_buf*
++ * 2.  int32_t field index
++ *
++ * Return:
++ * 1.  A lua_packet_segment annotated with the according metatable or False in
++ *     case the input data is not valid
++ */
++static int32_t get_protocol_field(lua_State *L)
++{
++      int32_t prot_type;
++      lua_packet_segment * seg, *new;
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      int32_t field_index = lua_tointeger(L, lua_upvalueindex(2));
++      struct protocol_field * field = &prot_buf->protocol_fields[field_index];
++
++      /* get the current packet segment */
++      seg = checkpacketseg(L, 1, prot_buf->name);
++
++      /* initialize the new packet segment */
++      new = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment));
++      new->start = seg->start;         /* the start is unchanged */
++      new->offset = get_field_offset_in_bytes(field, seg, field_index);
++      new->length = get_field_length_in_bytes(field, seg, field_index);
++
++      /* if new->length == 0 then no configuration was done, we guess the size by subtracting the
++       * new offset from the packet length. since the old length is getting initialized by the
++       * netfilter extension this assumption holds for the very last field of the protocol.
++       * this 'feature' should be used by protocol buffers containing a payload, whereas the
++       * payload field is the last field of the buffer. However, at compile-time unknown field
++       * sizes (and offsets) of fields not being placed at the end of the protocol should be
++       * initialized using the 'get_field_changes' hook system. */
++      if (new->length == 0)
++              new->length = (seg->length + seg->offset) - (new->offset);
++               /*
++                               printf("%s->%s:: seg->offset %i, seg->length %i, new->offset %i, new->length %i\n",
++                                               prot_buf->name, field->name, seg->offset, seg->length, new->offset, new->length);
++                */
++      /* special care for packet payload requests */
++      if (prot_buf->payload_field != NULL && strcmp(prot_buf->payload_field, field->name) == 0) {
++              /* we know the payload field is requested */
++              /* the requested payload can be delivered either as a common segment or as
++               * an other packet type, such a conversion needs an extra protocol parameter
++               * ... so lets check */
++
++              if (lua_isnumber(L, 2)) {
++                      /* we have an extra parameter, ... lets see if it is a valid protocol
++                       * the parameter is the index of the 'supported_protocols'-array member */
++                      prot_type = lua_tointeger(L, 2);
++                      if (prot_type >= 0 && prot_type < PACKET_SENTINEL) {
++                              /* we are sure the purpose of the request is to get the payload data,
++                               * converted to the given protocol.  lets check if the payload contains
++                               * data of the given protocol */
++                              if (payload_contains_protocol(L, prot_buf, seg, prot_type)) {
++                                      /* success, we can  push the metatable for the given protocol */
++                                      get_metatable_from_protocol_type(L, prot_type);
++                                      if (!lua_isnil(L, -1))  /* check if the metatable was found */
++                                              /* perhaps the field offsets and lengths of the containing protocol
++                                               * are not set correctly. request the optional 'field_changes' structure
++                                               * holding the changes for lengths and offsets. */
++                                              new->changes = protocol_get_field_changes(L, get_protocol_buf(prot_type), new);
++                                      else{
++                                              /* failed, the requested protocol is not available
++                                               * we push false and return */
++                                              lua_pop(L, 1); /* pop the userdata */
++                                              lua_pushboolean(L, 0);
++                                              return 1;
++                                      }
++                              }else{
++                                      /* payload does not carry the provided protocol */
++                                      /* we push false and return */
++                                      lua_pop(L, 1); /* pop the userdata */
++                                      lua_pushboolean(L, 0);
++                                      return 1;
++                              }
++                      }else{
++                              /* unknown protocol */
++                              lua_pop(L, 1); /* pop the userdata */
++                              luaL_error(L, "provided protocol is unknown");
++                      }
++              }
++      }
++
++      /* if there is still the 'new' userdata on the top, we push our own metatable */
++      if (lua_isuserdata(L, -1)) {
++              luaL_getmetatable(L, prot_buf->name);
++              new->changes = seg->changes;
++              if (seg->changes)
++                      new->changes->ref_count++;
++      }
++
++      /* a new packet segment is at index -2 , and the proper metatable at index -1 of the stack
++       * lets set the propper setter and getter function for the requested field */
++      initialize_field_getter_and_setter(L, prot_buf, field_index);
++
++      lua_setmetatable(L, -2);
++      return 1;
++}
++
++/* C_API: 'register_protbuf' is only used internally. This function takes a
++ * pointer to a fully initialized protocol buffer struct and registers it
++ * inside the Lua state. Registering means:
++ *
++ * 1.  it creates a new metatable with the name of the protocol buffer.
++ * 2.  it registers the default functions which are stored in the luaL_Reg
++ *     array seg_access_functions.
++ * 3.  it loops over the protocol fields stored at prot_buf->protocol_fields
++ *     and registers a new function (using the field name) inside the
++ *     metatable. Each field points to the function 'get_protocol_field'
++ *     which acts as a closure taking a pointer to the protocol buffer as
++ *     well as the index of the field as upvalues.
++ * 4.  The protocol index, serves as numerical identifier of this protocol
++ *     buffer or even of the protocol itself. This index is stored as a
++ *     global value inside the Lua state as well as inside the Lua table
++ *     'supported_protocols'. Assuming the name of a procotol buffer is
++ *     "packet_ip" the following statements are true:
++ * 
++ *       supported_protocols[protocol_index] == "packet_ip"
++ *                                 packet_ip == protocol_index
++ *
++ *     This allows you to get all registered protocols from within Lua. This
++ *     is especially usefull for the dynamic protocol buffers where you have
++ *     to provide your own "has_protocol"-function, which probably needs the
++ *     information on which protocols it is able to contain.
++ */
++void register_protbuf(lua_State *L, struct protocol_buf * prot_buf, uint32_t  protocol_index)
++{
++      int32_t field_index;
++      luaL_Reg *reg = (struct luaL_Reg *)seg_access_functions;
++      struct protocol_field * field = prot_buf->protocol_fields;
++
++      luaL_newmetatable(L, prot_buf->name);
++
++      /* metatable.__index = metatable */
++      lua_pushvalue(L, -1);   /* duplicates the metatable */
++      lua_setfield(L, -2, "__index");
++
++      /* pushing default functions */
++      for (; reg->name; reg++) {
++              lua_pushlightuserdata(L, (void *)prot_buf);
++              lua_pushcclosure(L, reg->func, 1);
++              lua_setfield(L, -2, reg->name);
++      }
++
++      /* pushing functions specific to the protocol buffer */
++      for (field_index = 0; field->name; field++, field_index++) {
++              lua_pushlightuserdata(L, (void *)prot_buf);             /* upvalue: prot_buf */
++              lua_pushinteger(L, field_index);                        /* upvalue: index of protocol field */
++              lua_pushcclosure(L, get_protocol_field, 2);
++              lua_setfield(L, -2, field->name);
++      }
++      /* pop the metatable */
++      lua_pop(L, 1);
++
++      /* registering the array-index as the protocol_id*/
++      lua_getglobal(L, "_G");
++      lua_pushinteger(L, protocol_index);
++      lua_setfield(L, -2, prot_buf->name);
++      lua_pop(L, 1); /* pop _G */
++
++      lua_getglobal(L, SUPPORTED_PROTOCOL_TABLE);
++      lua_pushstring(L, prot_buf->name);
++      lua_rawseti(L, -2, protocol_index);
++
++      lua_pop(L, 1);  /* pop SUPPORTED_PROTOCOL_TABLE */
++
++      supported_protocols[protocol_index] = prot_buf;
++}
++
++void luaopen_controller(lua_State *L)
++{
++      /* registering a table inside the _G with table[protocol_index] = prot_buf->name */
++      lua_getglobal(L, "_G");
++      lua_newtable(L);
++      lua_setfield(L, -2, SUPPORTED_PROTOCOL_TABLE);
++      lua_pop(L, 1); /* pop _G */                   
++      
++      luaopen_protbuf_raw(L);
++      luaopen_protbuf_eth(L);
++      luaopen_protbuf_ip(L);
++      luaopen_protbuf_icmp(L);
++      luaopen_protbuf_tcp(L);
++      luaopen_protbuf_tcp_options(L);
++      luaopen_protbuf_udp(L);
++      luaopen_protbuf_tftp(L);
++      luaopen_protbuf_dynamic(L);
++      /* should follow all other static buffers */
++#if defined(__KERNEL__)
++      luaopen_nflib(L);
++#endif
++
++      luaopen_bytearraylib(L);
++}
++
++
++
++
+--- /dev/null
++++ b/extensions/LUA/controller.h
+@@ -0,0 +1,264 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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/>.
++ */
++
++#ifndef CONTROLLER_H_
++#define CONTROLLER_H_
++
++#include "stdlib.h"     /* wrapper */
++#include "string.h"     /* wrapper */
++#include "lua.h"
++#include "lualib.h"
++#include "lauxlib.h"
++
++#if defined(__KERNEL__)
++#include <linux/skbuff.h>
++#include <linux/slab.h>
++#include <linux/vmalloc.h>
++#endif
++
++
++/* to compile the stuff in userspace (for testing)*/
++#if !defined(__KERNEL__)
++#include <stdint.h>
++#define pr_debug printf;
++
++#define kmalloc(size, type) malloc(size)
++#define kfree(ptr) free(ptr)
++
++#endif
++
++
++/**********************************************************************/
++/* nf Lua configuration                                               */
++/**********************************************************************/
++#define MAX_NR_OF_PROTOCOLS 16
++#define SUPPORTED_PROTOCOL_TABLE "supported_protocols"
++
++#define MAX_NR_OF_FIELDS_IN_DYN_PROT_BUF 32
++
++
++/**********************************************************************/
++/* Static Protocol Buffer configuration                               */
++/**********************************************************************/
++
++/* the definitions of the stringified expression of the prot_bufs...
++ * make sure all static prot_bufs are listed and are unique */
++#define LUA_PACKET_SEG_RAW "packet_raw"
++#define LUA_PACKET_SEG_ETH "packet_eth"
++#define LUA_PACKET_SEG_ICMP "packet_icmp"
++#define LUA_PACKET_SEG_IP "packet_ip"
++#define LUA_PACKET_SEG_TCP "packet_tcp"
++#define LUA_PACKET_SEG_TCP_OPT "packet_tcp_opt"
++#define LUA_PACKET_SEG_UDP "packet_udp"
++#define LUA_PACKET_SEG_TFTP "packet_tftp"
++
++/* the enum holding all static prot_bufs... make sure it contains all
++ * static prot_bufs */
++enum PROT_BUF {
++      PACKET_RAW,
++      PACKET_ETH,
++      PACKET_IP,
++      PACKET_ICMP,
++      PACKET_TCP,
++      PACKET_TCP_OPTIONS,
++      PACKET_UDP,
++      PACKET_TFTP,
++      PACKET_DYNAMIC,
++      PACKET_SENTINEL
++};
++
++/* the luaopen-function of the prot_bufs... make sure it is called
++ * inside luaopen_controller */
++void luaopen_protbuf_raw(lua_State *L);
++void luaopen_protbuf_eth(lua_State *L);
++void luaopen_protbuf_ip(lua_State *L);
++void luaopen_protbuf_icmp(lua_State *L);
++void luaopen_protbuf_tcp(lua_State *L);
++void luaopen_protbuf_tcp_options(lua_State *L);
++void luaopen_protbuf_udp(lua_State *L);
++void luaopen_protbuf_tftp(lua_State *L);
++void luaopen_protbuf_dynamic(lua_State *L);
++
++/**********************************************************************/
++/* field changes                                                      */
++/**********************************************************************/
++struct field_changes {
++      int ref_count;
++      int *field_length_changes;
++      int *field_offset_changes;
++};
++
++/**********************************************************************/
++/* lua packet segment                                                                                           */
++/* ------------------                                                 */
++/* The struct lua_packet_segment is the integral part of a Lua packet.*/
++/* At the very beginning, when a new packet arrives in `lua_tg`_ such */
++/* a struct is initialized. The field start then points to the lowest */
++/* available header inside the sk_buff structure. During packet       */
++/* processing the start pointer remains the same, only the offset and */
++/* length value change.                                               */
++/**********************************************************************/
++#define checkpacketseg(L, i, seg_type) \
++      (lua_packet_segment *)luaL_checkudata(L, i, seg_type)
++
++typedef struct lua_packet_segment {
++      unsigned int offset;
++      unsigned int length;
++      struct field_changes * changes;
++      unsigned char * start;  /* need to be at the end because of the memory alignment */
++} lua_packet_segment;
++
++/**********************************************************************/
++/* protocol field                                                     */
++/* --------------                                                                                                       */
++/* This structure is a container for the field definitions used by the*/
++/* protocol buffer. Each protocol field is expressed using this struct*/
++/* Have a look at the protocol buffers to see how the struct gets     */
++/* initialized.                                                                                                                 */
++/*                                                                                                                                      */
++/* name:                                                                                                                    */
++/*   This member expresses the name of the field, ending                        */
++/*   in its own Lua function to access the field.                                       */
++/* offset / length:                                                                                                     */
++/*   These members do specify the position inside the protocol header */
++/*   in bits (not bytes!).                                                                                      */
++/* get / set:                                                                                                           */
++/*   The get and set functions take a function pointer pointing to the*/
++/*   specific getter and setter function for this field.                        */
++/**********************************************************************/
++struct protocol_field {
++      const char * name;
++      uint32_t offset;
++      uint32_t length;
++      lua_CFunction get;
++      lua_CFunction set;
++};
++#define PROT_FIELD_SENTINEL { NULL, 0, 0, NULL, NULL }
++
++
++/**********************************************************************/
++/* protocol_buf                                                       */
++/**********************************************************************/
++/* This structure is a container for all the information needed for a
++ * protocol buffer. It gets initialized in each protocol buffer header
++ * file or for the dynamic protocol buffers on runtime using the
++ * 'register_dynamic_protocol_buffer' function.
++ *
++ * name:
++ *   This member is used throughout the system. It is also exported
++ *   to Lua as a variable name holding the index of the 'supported_protocols'
++ *   array. The name is also used as the name of the generated Lua
++ *   metatable, that is why inside the macro checkpacketseg_ it
++ *   is always the name of a protocol buffer that is passed as the
++ *   second parameter.
++ * payload_field:
++ *   This member holds the string of the field responsible for payload
++ *   data. The payload field of a protocol has an extra property, since
++ *   it can be used to invoke another protocol buffer that is applied to
++ *   the payload content.
++ * has_protocol:
++ *   This member is used together with the payload_field. Since we must
++ *   be sure that the payload content does really contain a protocol
++ *   of type X. The function pointed to by has_protocol checks if the
++ *   protocol buffer X can be applied on the payload_data.
++ * protocol_fields:
++ *   This member points to the array of 'protocol_field' structures
++ * get_field_changes:
++ *   This member is optional. It is used to return a pointer to an initialized
++ *   field_changes struct. The function is called, whenever the payload field
++ *   is requested with a given protocol type. Usually this function will
++ *   initialize the field_changes struct depending on the content of the 
++ *   payload data. e.g.
++ *     tcp = ip:data(packet_tcp)
++ *   such a request will call the 'get_field_changes' function of the tcp
++ *   protocol buffer. This enables, that the tcp options field have the proper
++ *   length as well as the tcp data start at the right offset. 
++ */
++struct protocol_buf {
++      int is_dynamic;
++      const char * name;
++      char * payload_field;
++      int (*has_protocol)(lua_State *L, struct protocol_buf *prot_buf, lua_packet_segment * seg, int type);
++      struct protocol_field * protocol_fields;
++      struct field_changes * (*get_field_changes)(lua_State *L, lua_packet_segment * seg);
++};
++
++/**********************************************************************/
++/* lua byte array library                                             */
++/**********************************************************************/
++#define LUA_BYTE_ARRAY "byte_array"
++#define checkbytearray(L, i) \
++      (lua_packet_segment *)luaL_checkudata(L, i, LUA_BYTE_ARRAY)
++lua_packet_segment * init_byte_array(lua_State *L, unsigned char * start, int length, int do_copy);
++void luaopen_bytearraylib(lua_State *L);
++
++
++/**********************************************************************/
++/* lua netfilter environment library                                  */
++/**********************************************************************/
++#define NETFILTER_LIB "nf"
++#if defined(__KERNEL__)
++      struct lua_env {
++              lua_State *L;
++              /* perhaps more to come here (e.g. a state per CPU) */
++      }; 
++      #define LUA_ENV "lua_env"
++      #define checkluaenv(L, i) \
++      (struct lua_env *)luaL_checkudata(L, i, LUA_ENV)
++
++      void luaopen_nflib(lua_State *L);
++#endif
++
++void cleanup_dynamic_prot_bufs(void); /* freeing all dynamic prot bufs */
++/**********************************************************************/
++/* lua protbuf helpers                                                */
++/**********************************************************************/
++int get_1_bit_generic(lua_State *L);
++int set_1_bit_generic(lua_State *L);
++int get_lower_4_bit_generic(lua_State *L);
++int set_lower_4_bit_generic(lua_State *L);
++int get_upper_4_bit_generic(lua_State *L);
++int set_upper_4_bit_generic(lua_State *L);
++int get_8_bit_generic(lua_State *L);
++int set_8_bit_generic(lua_State *L);
++int get_16_bit_generic(lua_State *L);
++int set_16_bit_generic(lua_State *L);
++int get_32_bit_generic(lua_State *L);
++int set_32_bit_generic(lua_State *L);
++int set_data_generic(lua_State *L);
++int get_string_generic(lua_State *L);
++int get_byte_generic_str(lua_State *L);
++struct field_changes * get_allocated_field_changes(lua_State *L, int nr_of_fields);
++
++/* only used by the dynamic prot buf subsystem */
++#define MAX_NR_OF_DYN_PROT_BUFS 16
++int field_dynamic_setter(lua_State *L);
++int field_dynamic_getter(lua_State *L);
++int has_protocol_dynamic(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int type);
++struct field_changes * get_field_changes_dynamic(lua_State *L, struct protocol_buf *prot_buf, lua_packet_segment * seg);
++
++/**********************************************************************/
++/* lua controller API                                                 */
++/**********************************************************************/
++void luaopen_controller(lua_State *L);
++struct protocol_buf * get_protocol_buf(unsigned int protocol_id);
++void get_metatable_from_protocol_type(lua_State *L, int type);
++void register_protbuf(lua_State *L, struct protocol_buf * prot_buf, unsigned int protocol_index);
++
++
++#endif /* CONTROLLER_H_ */
+--- /dev/null
++++ b/extensions/LUA/Kbuild
+@@ -0,0 +1,49 @@
++# -*- Makefile -*-
++
++# Adding debug options
++EXTRA_CFLAGS += -DDEBUG
++
++obj-m += xt_LUA.o
++
++EXTRA_CFLAGS += -I$(src)/prot_buf_new
++xt_LUA-y += xt_LUA_target.o \
++
++xt_LUA-y += nf_lua.o \
++                      prot_buf_helpers.o \
++                      byte_array.o \
++                      controller.o \
++                      prot_buf_ethernet.o \
++                      prot_buf_icmp.o \
++                      prot_buf_ip.o \
++                      prot_buf_raw.o \
++                      prot_buf_tcp.o \
++                      prot_buf_udp.o \
++                      prot_buf_tftp.o \
++                      prot_buf_dynamic.o \
++
++
++# Adding Lua Support
++EXTRA_CFLAGS += -I$(src)/lua -I$(src)/lua/include 
++xt_LUA-y += lua/lapi.o \
++                      lua/lbaselib.o \
++                      lua/lcode.o \
++                      lua/ldebug.o \
++                      lua/ldo.o \
++                      lua/ldump.o \
++                      lua/lfunc.o \
++                      lua/lgc.o \
++                      lua/llex.o \
++                      lua/lmem.o \
++                      lua/lobject.o \
++                      lua/lopcodes.o \
++                      lua/lparser.o \
++                      lua/lstate.o \
++                      lua/lstring.o \
++                      lua/lstrlib.o \
++                      lua/ltable.o \
++                      lua/ltablib.o \
++                      lua/ltm.o \
++                      lua/lundump.o \
++                      lua/lvm.o \
++                      lua/lzio.o \
++                      lua/lauxlib.o \
+--- /dev/null
++++ b/extensions/LUA/libxt_LUA.c
+@@ -0,0 +1,191 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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 <getopt.h>
++#include <stdio.h>
++#include <stdbool.h>
++#include <stdlib.h>
++#include <string.h>
++#include <xtables.h>
++#include <linux/netfilter.h>
++#include <linux/netfilter/x_tables.h>
++#include "xt_LUA.h"
++
++enum {
++      FLAG_SCRIPT   = 1 << 0,
++      FLAG_STATE    = 1 << 1,
++      FLAG_FUNCTION = 1 << 2,
++};
++
++static const struct option lua_tg_opts[] = {
++      { .name = "script",   .has_arg = true, .val = 's' },
++      { .name = "state",    .has_arg = true, .val = 'l' },
++      { .name = "function", .has_arg = true, .val = 'f' },
++      { NULL },
++};
++
++
++static void lua_tg_help(void)
++{
++      printf(
++              "LUA target options:\n"
++              "  --script SCRIPT      Process packet with the Lua script given by SCRIPT\n"
++              "                                                                       \n"
++              "  --state ID           Process packet within the Lua state given by ID.\n"
++              "                       Omitting --state infers the ID 0, which can be\n"
++              "                       refered to the 'global' state.\n"
++              "                                                                       \n"
++              "  --function FUNCTION  Name of the function that processes the Lua packet\n"
++              "\n");
++}
++
++static void
++lua_tg_init(struct xt_entry_target *target)
++{
++      struct xt_lua_tginfo *info = (void *)target->data;
++
++      info->state_id = 0;
++      strncpy(info->function, "process_packet\0", sizeof("process_packet\0"));
++}
++
++static int
++lua_tg_parse(int32_t c, char **argv, int32_t invert, uint32_t  *flags,
++           const void *entry, struct xt_entry_target **target)
++{
++      struct xt_lua_tginfo *info = (void *)(*target)->data;
++      char buf[MAX_SCRIPT_SIZE];
++      long script_size;
++      uint32_t  state_id;
++      FILE *file;
++
++      switch (c) {
++      case 's':
++              if (*flags & FLAG_SCRIPT)
++                      xtables_error(PARAMETER_PROBLEM,
++                                    "LUA: Cannot specify --script more than once");
++
++              if (strlen(optarg) > sizeof(info->filename))
++                      xtables_error(PARAMETER_PROBLEM,
++                                    "LUA: Maximum script length is %zu",
++                                    sizeof(info->filename));
++
++              if (strchr(optarg, '\n'))
++                      xtables_error(PARAMETER_PROBLEM,
++                                    "LUA: Newlines not allowed in script name");
++              file = fopen(optarg, "rb");
++              if (file != NULL) {
++                      fseek(file, 0, SEEK_END);
++                      script_size = ftell(file);
++                      if (script_size > MAX_SCRIPT_SIZE)
++                              xtables_error(PARAMETER_PROBLEM,
++                                            "LUA: The size of the script is too big");
++
++                      fseek(file, 0, SEEK_SET);
++                      fread(buf, script_size, 1, file);
++                      fclose(file);
++              } else
++                      xtables_error(PARAMETER_PROBLEM,
++                                    "LUA: Cannot open script %s", optarg);
++
++              strncpy(info->filename, optarg, sizeof(info->filename));
++              strncpy(info->buf, buf, sizeof(info->buf));
++              info->script_size = script_size;
++
++              *flags |= FLAG_SCRIPT;
++              return true;
++
++      case 'l':
++              if (*flags & FLAG_STATE)
++                      xtables_error(PARAMETER_PROBLEM,
++                                    "LUA: Cannot specify --state more than once");
++
++              if (!xtables_strtoui(optarg, NULL, &state_id, 0, 8))
++                      xtables_error(PARAMETER_PROBLEM,
++                                    "LUA: Invalid --state %s", optarg);
++
++              info->state_id = state_id;
++              *flags |= FLAG_STATE;
++              return true;
++
++      case 'f':
++              if (*flags & FLAG_FUNCTION)
++                      xtables_error(PARAMETER_PROBLEM,
++                                    "LUA: Cannot specify --function more than once");
++              if (strlen(optarg) > sizeof(info->function))
++                      xtables_error(PARAMETER_PROBLEM,
++                                    "LUA: Maximum function length is %zu",
++                                    sizeof(info->function));
++
++              if (strchr(optarg, '\n'))
++                      xtables_error(PARAMETER_PROBLEM,
++                                    "LUA: Newlines not allowed in function name");
++
++              strncpy(info->function, optarg, sizeof(info->function));
++
++              *flags |= FLAG_FUNCTION;
++              return true;
++      }
++
++      return false;
++}
++
++static void
++lua_tg_check(uint32_t  flags)
++{
++      if (flags == 0)
++              xtables_error(PARAMETER_PROBLEM, "LUA: --script parameter required");
++}
++
++static void
++lua_tg_print(const void *entry, const struct xt_entry_target *target,
++           int32_t numeric)
++{
++      const struct xt_lua_tginfo *info = (const void *)target->data;
++
++      printf("LUA script: %s ", info->filename);
++}
++
++static void
++lua_tg_save(const void *entry, const struct xt_entry_target *target)
++{
++      const struct xt_lua_tginfo *info = (const void *)target->data;
++
++      printf("--script %s ", info->filename);
++}
++
++static struct xtables_target lua_tg_reg = {
++      .name                   = "LUA",
++      .version                = XTABLES_VERSION,
++      .revision               = 0,
++      .family                 = NFPROTO_UNSPEC,
++      .size                   = XT_ALIGN(sizeof(struct xt_lua_tginfo)),
++      .userspacesize          = XT_ALIGN(sizeof(struct xt_lua_tginfo)),
++      .help                   = lua_tg_help,
++      .init                   = lua_tg_init,
++      .parse                  = lua_tg_parse,
++      .final_check            = lua_tg_check,
++      .print                  = lua_tg_print,
++      .save                   = lua_tg_save,
++      .extra_opts             = lua_tg_opts,
++};
++
++static __attribute__((constructor)) void lua_tg_ldr(void)
++{
++      xtables_register_target(&lua_tg_reg);
++}
++
+--- /dev/null
++++ b/extensions/LUA/libxt_LUA.man
+@@ -0,0 +1 @@
++Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+--- /dev/null
++++ b/extensions/LUA/lua/include/ctype.h
+@@ -0,0 +1,11 @@
++#include <linux/ctype.h>
++#undef  isalnum
++#define isalnum(c)      (((__ismask(c)&(_U|_L|_D)) != 0) && (c > 0))
++#undef  isalpha
++#define isalpha(c)      (((__ismask(c)&(_U|_L)) != 0) && (c > 0))
++#undef  iscntrl
++#define iscntrl(c)      (((__ismask(c)&(_C)) != 0) && (c > 0))
++#undef  isdigit
++#define isdigit(c)      (((__ismask(c)&(_D)) != 0) && (c > 0))
++#undef  isspace
++#define isspace(c)      (((__ismask(c)&(_S)) != 0) && (c > 0))
+--- /dev/null
++++ b/extensions/LUA/lua/include/errno.h
+@@ -0,0 +1 @@
++#include <linux/errno.h>
+--- /dev/null
++++ b/extensions/LUA/lua/include/locale.h
+@@ -0,0 +1,5 @@
++struct lconv {
++   char * decimal_point ;
++} ;
++
++#define localeconv()          NULL
+--- /dev/null
++++ b/extensions/LUA/lua/include/setjmp.h
+@@ -0,0 +1,26 @@
++/*
++ * arch/um/include/sysdep-i386/archsetjmp.h
++ */
++
++#ifndef _KLIBC_ARCHSETJMP_H
++#define _KLIBC_ARCHSETJMP_H
++
++struct __jmp_buf {
++      unsigned int __ebx;
++      unsigned int __esp;
++      unsigned int __ebp;
++      unsigned int __esi;
++      unsigned int __edi;
++      unsigned int __eip;
++};
++
++typedef struct __jmp_buf jmp_buf[1];
++
++#define JB_IP __eip
++#define JB_SP __esp
++
++int setjmp(jmp_buf);
++void longjmp(jmp_buf, int);
++
++#endif                                /* _SETJMP_H */
++
+--- /dev/null
++++ b/extensions/LUA/lua/include/stdio.h
+@@ -0,0 +1 @@
++#include <linux/kernel.h>
+--- /dev/null
++++ b/extensions/LUA/lua/include/stdlib.h
+@@ -0,0 +1,7 @@
++#include <linux/kernel.h>
++
++#define exit(E)         return
++#define strtoul               simple_strtoul
++#define strcoll               strcmp
++
++#define CHAR_BIT 8
+--- /dev/null
++++ b/extensions/LUA/lua/include/string.h
+@@ -0,0 +1 @@
++#include <linux/string.h>
+--- /dev/null
++++ b/extensions/LUA/lua/lapi.c
+@@ -0,0 +1,1086 @@
++/*
++** $Id: lapi.c,v 2.55.1.5 2008/07/04 18:41:18 roberto Exp $
++** Lua API
++** See Copyright Notice in lua.h
++*/
++
++#include <stdarg.h>
++#include <math.h>
++#include <assert.h>
++#include <string.h>
++
++#define lapi_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "lapi.h"
++#include "ldebug.h"
++#include "ldo.h"
++#include "lfunc.h"
++#include "lgc.h"
++#include "lmem.h"
++#include "lobject.h"
++#include "lstate.h"
++#include "lstring.h"
++#include "ltable.h"
++#include "ltm.h"
++#include "lundump.h"
++#include "lvm.h"
++
++
++
++const char lua_ident[] =
++  "$Lua: " LUA_RELEASE " " LUA_COPYRIGHT " $\n"
++  "$Authors: " LUA_AUTHORS " $\n"
++  "$URL: www.lua.org $\n";
++
++
++
++#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->base))
++
++#define api_checkvalidindex(L, i)     api_check(L, (i) != luaO_nilobject)
++
++#define api_incr_top(L)   {api_check(L, L->top < L->ci->top); L->top++;}
++
++
++
++static TValue *index2adr (lua_State *L, int idx) {
++  if (idx > 0) {
++    TValue *o = L->base + (idx - 1);
++    api_check(L, idx <= L->ci->top - L->base);
++    if (o >= L->top) return cast(TValue *, luaO_nilobject);
++    else return o;
++  }
++  else if (idx > LUA_REGISTRYINDEX) {
++    api_check(L, idx != 0 && -idx <= L->top - L->base);
++    return L->top + idx;
++  }
++  else switch (idx) {  /* pseudo-indices */
++    case LUA_REGISTRYINDEX: return registry(L);
++    case LUA_ENVIRONINDEX: {
++      Closure *func = curr_func(L);
++      sethvalue(L, &L->env, func->c.env);
++      return &L->env;
++    }
++    case LUA_GLOBALSINDEX: return gt(L);
++    default: {
++      Closure *func = curr_func(L);
++      idx = LUA_GLOBALSINDEX - idx;
++      return (idx <= func->c.nupvalues)
++                ? &func->c.upvalue[idx-1]
++                : cast(TValue *, luaO_nilobject);
++    }
++  }
++}
++
++
++static Table *getcurrenv (lua_State *L) {
++  if (L->ci == L->base_ci)  /* no enclosing function? */
++    return hvalue(gt(L));  /* use global table as environment */
++  else {
++    Closure *func = curr_func(L);
++    return func->c.env;
++  }
++}
++
++
++void luaA_pushobject (lua_State *L, const TValue *o) {
++  setobj2s(L, L->top, o);
++  api_incr_top(L);
++}
++
++
++LUA_API int lua_checkstack (lua_State *L, int size) {
++  int res = 1;
++  lua_lock(L);
++  if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK)
++    res = 0;  /* stack overflow */
++  else if (size > 0) {
++    luaD_checkstack(L, size);
++    if (L->ci->top < L->top + size)
++      L->ci->top = L->top + size;
++  }
++  lua_unlock(L);
++  return res;
++}
++
++
++LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) {
++  int i;
++  if (from == to) return;
++  lua_lock(to);
++  api_checknelems(from, n);
++  api_check(from, G(from) == G(to));
++  api_check(from, to->ci->top - to->top >= n);
++  from->top -= n;
++  for (i = 0; i < n; i++) {
++    setobj2s(to, to->top++, from->top + i);
++  }
++  lua_unlock(to);
++}
++
++
++LUA_API void lua_setlevel (lua_State *from, lua_State *to) {
++  to->nCcalls = from->nCcalls;
++}
++
++
++LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) {
++  lua_CFunction old;
++  lua_lock(L);
++  old = G(L)->panic;
++  G(L)->panic = panicf;
++  lua_unlock(L);
++  return old;
++}
++
++
++LUA_API lua_State *lua_newthread (lua_State *L) {
++  lua_State *L1;
++  lua_lock(L);
++  luaC_checkGC(L);
++  L1 = luaE_newthread(L);
++  setthvalue(L, L->top, L1);
++  api_incr_top(L);
++  lua_unlock(L);
++  luai_userstatethread(L, L1);
++  return L1;
++}
++
++
++
++/*
++** basic stack manipulation
++*/
++
++
++LUA_API int lua_gettop (lua_State *L) {
++  return cast_int(L->top - L->base);
++}
++
++
++LUA_API void lua_settop (lua_State *L, int idx) {
++  lua_lock(L);
++  if (idx >= 0) {
++    api_check(L, idx <= L->stack_last - L->base);
++    while (L->top < L->base + idx)
++      setnilvalue(L->top++);
++    L->top = L->base + idx;
++  }
++  else {
++    api_check(L, -(idx+1) <= (L->top - L->base));
++    L->top += idx+1;  /* `subtract' index (index is negative) */
++  }
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_remove (lua_State *L, int idx) {
++  StkId p;
++  lua_lock(L);
++  p = index2adr(L, idx);
++  api_checkvalidindex(L, p);
++  while (++p < L->top) setobjs2s(L, p-1, p);
++  L->top--;
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_insert (lua_State *L, int idx) {
++  StkId p;
++  StkId q;
++  lua_lock(L);
++  p = index2adr(L, idx);
++  api_checkvalidindex(L, p);
++  for (q = L->top; q>p; q--) setobjs2s(L, q, q-1);
++  setobjs2s(L, p, L->top);
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_replace (lua_State *L, int idx) {
++  StkId o;
++  lua_lock(L);
++  /* explicit test for incompatible code */
++  if (idx == LUA_ENVIRONINDEX && L->ci == L->base_ci)
++    luaG_runerror(L, "no calling environment");
++  api_checknelems(L, 1);
++  o = index2adr(L, idx);
++  api_checkvalidindex(L, o);
++  if (idx == LUA_ENVIRONINDEX) {
++    Closure *func = curr_func(L);
++    api_check(L, ttistable(L->top - 1)); 
++    func->c.env = hvalue(L->top - 1);
++    luaC_barrier(L, func, L->top - 1);
++  }
++  else {
++    setobj(L, o, L->top - 1);
++    if (idx < LUA_GLOBALSINDEX)  /* function upvalue? */
++      luaC_barrier(L, curr_func(L), L->top - 1);
++  }
++  L->top--;
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_pushvalue (lua_State *L, int idx) {
++  lua_lock(L);
++  setobj2s(L, L->top, index2adr(L, idx));
++  api_incr_top(L);
++  lua_unlock(L);
++}
++
++
++
++/*
++** access functions (stack -> C)
++*/
++
++
++LUA_API int lua_type (lua_State *L, int idx) {
++  StkId o = index2adr(L, idx);
++  return (o == luaO_nilobject) ? LUA_TNONE : ttype(o);
++}
++
++
++LUA_API const char *lua_typename (lua_State *L, int t) {
++  UNUSED(L);
++  return (t == LUA_TNONE) ? "no value" : luaT_typenames[t];
++}
++
++
++LUA_API int lua_iscfunction (lua_State *L, int idx) {
++  StkId o = index2adr(L, idx);
++  return iscfunction(o);
++}
++
++
++LUA_API int lua_isnumber (lua_State *L, int idx) {
++  TValue n;
++  const TValue *o = index2adr(L, idx);
++  return tonumber(o, &n);
++}
++
++
++LUA_API int lua_isstring (lua_State *L, int idx) {
++  int t = lua_type(L, idx);
++  return (t == LUA_TSTRING || t == LUA_TNUMBER);
++}
++
++
++LUA_API int lua_isuserdata (lua_State *L, int idx) {
++  const TValue *o = index2adr(L, idx);
++  return (ttisuserdata(o) || ttislightuserdata(o));
++}
++
++
++LUA_API int lua_rawequal (lua_State *L, int index1, int index2) {
++  StkId o1 = index2adr(L, index1);
++  StkId o2 = index2adr(L, index2);
++  return (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0
++         : luaO_rawequalObj(o1, o2);
++}
++
++
++LUA_API int lua_equal (lua_State *L, int index1, int index2) {
++  StkId o1, o2;
++  int i;
++  lua_lock(L);  /* may call tag method */
++  o1 = index2adr(L, index1);
++  o2 = index2adr(L, index2);
++  i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 : equalobj(L, o1, o2);
++  lua_unlock(L);
++  return i;
++}
++
++
++LUA_API int lua_lessthan (lua_State *L, int index1, int index2) {
++  StkId o1, o2;
++  int i;
++  lua_lock(L);  /* may call tag method */
++  o1 = index2adr(L, index1);
++  o2 = index2adr(L, index2);
++  i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0
++       : luaV_lessthan(L, o1, o2);
++  lua_unlock(L);
++  return i;
++}
++
++
++
++LUA_API lua_Number lua_tonumber (lua_State *L, int idx) {
++  TValue n;
++  const TValue *o = index2adr(L, idx);
++  if (tonumber(o, &n))
++    return nvalue(o);
++  else
++    return 0;
++}
++
++
++LUA_API lua_Integer lua_tointeger (lua_State *L, int idx) {
++  TValue n;
++  const TValue *o = index2adr(L, idx);
++  if (tonumber(o, &n)) {
++    lua_Integer res;
++    lua_Number num = nvalue(o);
++    lua_number2integer(res, num);
++    return res;
++  }
++  else
++    return 0;
++}
++
++
++LUA_API int lua_toboolean (lua_State *L, int idx) {
++  const TValue *o = index2adr(L, idx);
++  return !l_isfalse(o);
++}
++
++
++LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
++  StkId o = index2adr(L, idx);
++  if (!ttisstring(o)) {
++    lua_lock(L);  /* `luaV_tostring' may create a new string */
++    if (!luaV_tostring(L, o)) {  /* conversion failed? */
++      if (len != NULL) *len = 0;
++      lua_unlock(L);
++      return NULL;
++    }
++    luaC_checkGC(L);
++    o = index2adr(L, idx);  /* previous call may reallocate the stack */
++    lua_unlock(L);
++  }
++  if (len != NULL) *len = tsvalue(o)->len;
++  return svalue(o);
++}
++
++
++LUA_API size_t lua_objlen (lua_State *L, int idx) {
++  StkId o = index2adr(L, idx);
++  switch (ttype(o)) {
++    case LUA_TSTRING: return tsvalue(o)->len;
++    case LUA_TUSERDATA: return uvalue(o)->len;
++    case LUA_TTABLE: return luaH_getn(hvalue(o));
++    case LUA_TNUMBER: {
++      size_t l;
++      lua_lock(L);  /* `luaV_tostring' may create a new string */
++      l = (luaV_tostring(L, o) ? tsvalue(o)->len : 0);
++      lua_unlock(L);
++      return l;
++    }
++    default: return 0;
++  }
++}
++
++
++LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) {
++  StkId o = index2adr(L, idx);
++  return (!iscfunction(o)) ? NULL : clvalue(o)->c.f;
++}
++
++
++LUA_API void *lua_touserdata (lua_State *L, int idx) {
++  StkId o = index2adr(L, idx);
++  switch (ttype(o)) {
++    case LUA_TUSERDATA: return (rawuvalue(o) + 1);
++    case LUA_TLIGHTUSERDATA: return pvalue(o);
++    default: return NULL;
++  }
++}
++
++
++LUA_API lua_State *lua_tothread (lua_State *L, int idx) {
++  StkId o = index2adr(L, idx);
++  return (!ttisthread(o)) ? NULL : thvalue(o);
++}
++
++
++LUA_API const void *lua_topointer (lua_State *L, int idx) {
++  StkId o = index2adr(L, idx);
++  switch (ttype(o)) {
++    case LUA_TTABLE: return hvalue(o);
++    case LUA_TFUNCTION: return clvalue(o);
++    case LUA_TTHREAD: return thvalue(o);
++    case LUA_TUSERDATA:
++    case LUA_TLIGHTUSERDATA:
++      return lua_touserdata(L, idx);
++    default: return NULL;
++  }
++}
++
++
++
++/*
++** push functions (C -> stack)
++*/
++
++
++LUA_API void lua_pushnil (lua_State *L) {
++  lua_lock(L);
++  setnilvalue(L->top);
++  api_incr_top(L);
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_pushnumber (lua_State *L, lua_Number n) {
++  lua_lock(L);
++  setnvalue(L->top, n);
++  api_incr_top(L);
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) {
++  lua_lock(L);
++  setnvalue(L->top, cast_num(n));
++  api_incr_top(L);
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) {
++  lua_lock(L);
++  luaC_checkGC(L);
++  setsvalue2s(L, L->top, luaS_newlstr(L, s, len));
++  api_incr_top(L);
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_pushstring (lua_State *L, const char *s) {
++  if (s == NULL)
++    lua_pushnil(L);
++  else
++    lua_pushlstring(L, s, strlen(s));
++}
++
++
++LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt,
++                                      va_list argp) {
++  const char *ret;
++  lua_lock(L);
++  luaC_checkGC(L);
++  ret = luaO_pushvfstring(L, fmt, argp);
++  lua_unlock(L);
++  return ret;
++}
++
++
++LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) {
++  const char *ret;
++  va_list argp;
++  lua_lock(L);
++  luaC_checkGC(L);
++  va_start(argp, fmt);
++  ret = luaO_pushvfstring(L, fmt, argp);
++  va_end(argp);
++  lua_unlock(L);
++  return ret;
++}
++
++
++LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
++  Closure *cl;
++  lua_lock(L);
++  luaC_checkGC(L);
++  api_checknelems(L, n);
++  cl = luaF_newCclosure(L, n, getcurrenv(L));
++  cl->c.f = fn;
++  L->top -= n;
++  while (n--)
++    setobj2n(L, &cl->c.upvalue[n], L->top+n);
++  setclvalue(L, L->top, cl);
++  lua_assert(iswhite(obj2gco(cl)));
++  api_incr_top(L);
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_pushboolean (lua_State *L, int b) {
++  lua_lock(L);
++  setbvalue(L->top, (b != 0));  /* ensure that true is 1 */
++  api_incr_top(L);
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_pushlightuserdata (lua_State *L, void *p) {
++  lua_lock(L);
++  setpvalue(L->top, p);
++  api_incr_top(L);
++  lua_unlock(L);
++}
++
++
++LUA_API int lua_pushthread (lua_State *L) {
++  lua_lock(L);
++  setthvalue(L, L->top, L);
++  api_incr_top(L);
++  lua_unlock(L);
++  return (G(L)->mainthread == L);
++}
++
++
++
++/*
++** get functions (Lua -> stack)
++*/
++
++
++LUA_API void lua_gettable (lua_State *L, int idx) {
++  StkId t;
++  lua_lock(L);
++  t = index2adr(L, idx);
++  api_checkvalidindex(L, t);
++  luaV_gettable(L, t, L->top - 1, L->top - 1);
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_getfield (lua_State *L, int idx, const char *k) {
++  StkId t;
++  TValue key;
++  lua_lock(L);
++  t = index2adr(L, idx);
++  api_checkvalidindex(L, t);
++  setsvalue(L, &key, luaS_new(L, k));
++  luaV_gettable(L, t, &key, L->top);
++  api_incr_top(L);
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_rawget (lua_State *L, int idx) {
++  StkId t;
++  lua_lock(L);
++  t = index2adr(L, idx);
++  api_check(L, ttistable(t));
++  setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1));
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_rawgeti (lua_State *L, int idx, int n) {
++  StkId o;
++  lua_lock(L);
++  o = index2adr(L, idx);
++  api_check(L, ttistable(o));
++  setobj2s(L, L->top, luaH_getnum(hvalue(o), n));
++  api_incr_top(L);
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_createtable (lua_State *L, int narray, int nrec) {
++  lua_lock(L);
++  luaC_checkGC(L);
++  sethvalue(L, L->top, luaH_new(L, narray, nrec));
++  api_incr_top(L);
++  lua_unlock(L);
++}
++
++
++LUA_API int lua_getmetatable (lua_State *L, int objindex) {
++  const TValue *obj;
++  Table *mt = NULL;
++  int res;
++  lua_lock(L);
++  obj = index2adr(L, objindex);
++  switch (ttype(obj)) {
++    case LUA_TTABLE:
++      mt = hvalue(obj)->metatable;
++      break;
++    case LUA_TUSERDATA:
++      mt = uvalue(obj)->metatable;
++      break;
++    default:
++      mt = G(L)->mt[ttype(obj)];
++      break;
++  }
++  if (mt == NULL)
++    res = 0;
++  else {
++    sethvalue(L, L->top, mt);
++    api_incr_top(L);
++    res = 1;
++  }
++  lua_unlock(L);
++  return res;
++}
++
++
++LUA_API void lua_getfenv (lua_State *L, int idx) {
++  StkId o;
++  lua_lock(L);
++  o = index2adr(L, idx);
++  api_checkvalidindex(L, o);
++  switch (ttype(o)) {
++    case LUA_TFUNCTION:
++      sethvalue(L, L->top, clvalue(o)->c.env);
++      break;
++    case LUA_TUSERDATA:
++      sethvalue(L, L->top, uvalue(o)->env);
++      break;
++    case LUA_TTHREAD:
++      setobj2s(L, L->top,  gt(thvalue(o)));
++      break;
++    default:
++      setnilvalue(L->top);
++      break;
++  }
++  api_incr_top(L);
++  lua_unlock(L);
++}
++
++
++/*
++** set functions (stack -> Lua)
++*/
++
++
++LUA_API void lua_settable (lua_State *L, int idx) {
++  StkId t;
++  lua_lock(L);
++  api_checknelems(L, 2);
++  t = index2adr(L, idx);
++  api_checkvalidindex(L, t);
++  luaV_settable(L, t, L->top - 2, L->top - 1);
++  L->top -= 2;  /* pop index and value */
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_setfield (lua_State *L, int idx, const char *k) {
++  StkId t;
++  TValue key;
++  lua_lock(L);
++  api_checknelems(L, 1);
++  t = index2adr(L, idx);
++  api_checkvalidindex(L, t);
++  setsvalue(L, &key, luaS_new(L, k));
++  luaV_settable(L, t, &key, L->top - 1);
++  L->top--;  /* pop value */
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_rawset (lua_State *L, int idx) {
++  StkId t;
++  lua_lock(L);
++  api_checknelems(L, 2);
++  t = index2adr(L, idx);
++  api_check(L, ttistable(t));
++  setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1);
++  luaC_barriert(L, hvalue(t), L->top-1);
++  L->top -= 2;
++  lua_unlock(L);
++}
++
++
++LUA_API void lua_rawseti (lua_State *L, int idx, int n) {
++  StkId o;
++  lua_lock(L);
++  api_checknelems(L, 1);
++  o = index2adr(L, idx);
++  api_check(L, ttistable(o));
++  setobj2t(L, luaH_setnum(L, hvalue(o), n), L->top-1);
++  luaC_barriert(L, hvalue(o), L->top-1);
++  L->top--;
++  lua_unlock(L);
++}
++
++
++LUA_API int lua_setmetatable (lua_State *L, int objindex) {
++  TValue *obj;
++  Table *mt;
++  lua_lock(L);
++  api_checknelems(L, 1);
++  obj = index2adr(L, objindex);
++  api_checkvalidindex(L, obj);
++  if (ttisnil(L->top - 1))
++    mt = NULL;
++  else {
++    api_check(L, ttistable(L->top - 1));
++    mt = hvalue(L->top - 1);
++  }
++  switch (ttype(obj)) {
++    case LUA_TTABLE: {
++      hvalue(obj)->metatable = mt;
++      if (mt)
++        luaC_objbarriert(L, hvalue(obj), mt);
++      break;
++    }
++    case LUA_TUSERDATA: {
++      uvalue(obj)->metatable = mt;
++      if (mt)
++        luaC_objbarrier(L, rawuvalue(obj), mt);
++      break;
++    }
++    default: {
++      G(L)->mt[ttype(obj)] = mt;
++      break;
++    }
++  }
++  L->top--;
++  lua_unlock(L);
++  return 1;
++}
++
++
++LUA_API int lua_setfenv (lua_State *L, int idx) {
++  StkId o;
++  int res = 1;
++  lua_lock(L);
++  api_checknelems(L, 1);
++  o = index2adr(L, idx);
++  api_checkvalidindex(L, o);
++  api_check(L, ttistable(L->top - 1));
++  switch (ttype(o)) {
++    case LUA_TFUNCTION:
++      clvalue(o)->c.env = hvalue(L->top - 1);
++      break;
++    case LUA_TUSERDATA:
++      uvalue(o)->env = hvalue(L->top - 1);
++      break;
++    case LUA_TTHREAD:
++      sethvalue(L, gt(thvalue(o)), hvalue(L->top - 1));
++      break;
++    default:
++      res = 0;
++      break;
++  }
++  if (res) luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1));
++  L->top--;
++  lua_unlock(L);
++  return res;
++}
++
++
++/*
++** `load' and `call' functions (run Lua code)
++*/
++
++
++#define adjustresults(L,nres) \
++    { if (nres == LUA_MULTRET && L->top >= L->ci->top) L->ci->top = L->top; }
++
++
++#define checkresults(L,na,nr) \
++     api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)))
++      
++
++LUA_API void lua_call (lua_State *L, int nargs, int nresults) {
++  StkId func;
++  lua_lock(L);
++  api_checknelems(L, nargs+1);
++  checkresults(L, nargs, nresults);
++  func = L->top - (nargs+1);
++  luaD_call(L, func, nresults);
++  adjustresults(L, nresults);
++  lua_unlock(L);
++}
++
++
++
++/*
++** Execute a protected call.
++*/
++struct CallS {  /* data to `f_call' */
++  StkId func;
++  int nresults;
++};
++
++
++static void f_call (lua_State *L, void *ud) {
++  struct CallS *c = cast(struct CallS *, ud);
++  luaD_call(L, c->func, c->nresults);
++}
++
++
++
++LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errfunc) {
++  struct CallS c;
++  int status;
++  ptrdiff_t func;
++  lua_lock(L);
++  api_checknelems(L, nargs+1);
++  checkresults(L, nargs, nresults);
++  if (errfunc == 0)
++    func = 0;
++  else {
++    StkId o = index2adr(L, errfunc);
++    api_checkvalidindex(L, o);
++    func = savestack(L, o);
++  }
++  c.func = L->top - (nargs+1);  /* function to be called */
++  c.nresults = nresults;
++  status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func);
++  adjustresults(L, nresults);
++  lua_unlock(L);
++  return status;
++}
++
++
++/*
++** Execute a protected C call.
++*/
++struct CCallS {  /* data to `f_Ccall' */
++  lua_CFunction func;
++  void *ud;
++};
++
++
++static void f_Ccall (lua_State *L, void *ud) {
++  struct CCallS *c = cast(struct CCallS *, ud);
++  Closure *cl;
++  cl = luaF_newCclosure(L, 0, getcurrenv(L));
++  cl->c.f = c->func;
++  setclvalue(L, L->top, cl);  /* push function */
++  api_incr_top(L);
++  setpvalue(L->top, c->ud);  /* push only argument */
++  api_incr_top(L);
++  luaD_call(L, L->top - 2, 0);
++}
++
++
++LUA_API int lua_cpcall (lua_State *L, lua_CFunction func, void *ud) {
++  struct CCallS c;
++  int status;
++  lua_lock(L);
++  c.func = func;
++  c.ud = ud;
++  status = luaD_pcall(L, f_Ccall, &c, savestack(L, L->top), 0);
++  lua_unlock(L);
++  return status;
++}
++
++
++LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
++                      const char *chunkname) {
++  ZIO z;
++  int status;
++  lua_lock(L);
++  if (!chunkname) chunkname = "?";
++  luaZ_init(L, &z, reader, data);
++  status = luaD_protectedparser(L, &z, chunkname);
++  lua_unlock(L);
++  return status;
++}
++
++
++LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) {
++  int status;
++  TValue *o;
++  lua_lock(L);
++  api_checknelems(L, 1);
++  o = L->top - 1;
++  if (isLfunction(o))
++    status = luaU_dump(L, clvalue(o)->l.p, writer, data, 0);
++  else
++    status = 1;
++  lua_unlock(L);
++  return status;
++}
++
++
++LUA_API int  lua_status (lua_State *L) {
++  return L->status;
++}
++
++
++/*
++** Garbage-collection function
++*/
++
++LUA_API int lua_gc (lua_State *L, int what, int data) {
++  int res = 0;
++  global_State *g;
++  lua_lock(L);
++  g = G(L);
++  switch (what) {
++    case LUA_GCSTOP: {
++      g->GCthreshold = MAX_LUMEM;
++      break;
++    }
++    case LUA_GCRESTART: {
++      g->GCthreshold = g->totalbytes;
++      break;
++    }
++    case LUA_GCCOLLECT: {
++      luaC_fullgc(L);
++      break;
++    }
++    case LUA_GCCOUNT: {
++      /* GC values are expressed in Kbytes: #bytes/2^10 */
++      res = cast_int(g->totalbytes >> 10);
++      break;
++    }
++    case LUA_GCCOUNTB: {
++      res = cast_int(g->totalbytes & 0x3ff);
++      break;
++    }
++    case LUA_GCSTEP: {
++      lu_mem a = (cast(lu_mem, data) << 10);
++      if (a <= g->totalbytes)
++        g->GCthreshold = g->totalbytes - a;
++      else
++        g->GCthreshold = 0;
++      while (g->GCthreshold <= g->totalbytes) {
++        luaC_step(L);
++        if (g->gcstate == GCSpause) {  /* end of cycle? */
++          res = 1;  /* signal it */
++          break;
++        }
++      }
++      break;
++    }
++    case LUA_GCSETPAUSE: {
++      res = g->gcpause;
++      g->gcpause = data;
++      break;
++    }
++    case LUA_GCSETSTEPMUL: {
++      res = g->gcstepmul;
++      g->gcstepmul = data;
++      break;
++    }
++    default: res = -1;  /* invalid option */
++  }
++  lua_unlock(L);
++  return res;
++}
++
++
++
++/*
++** miscellaneous functions
++*/
++
++
++LUA_API int lua_error (lua_State *L) {
++  lua_lock(L);
++  api_checknelems(L, 1);
++  luaG_errormsg(L);
++  lua_unlock(L);
++  return 0;  /* to avoid warnings */
++}
++
++
++LUA_API int lua_next (lua_State *L, int idx) {
++  StkId t;
++  int more;
++  lua_lock(L);
++  t = index2adr(L, idx);
++  api_check(L, ttistable(t));
++  more = luaH_next(L, hvalue(t), L->top - 1);
++  if (more) {
++    api_incr_top(L);
++  }
++  else  /* no more elements */
++    L->top -= 1;  /* remove key */
++  lua_unlock(L);
++  return more;
++}
++
++
++LUA_API void lua_concat (lua_State *L, int n) {
++  lua_lock(L);
++  api_checknelems(L, n);
++  if (n >= 2) {
++    luaC_checkGC(L);
++    luaV_concat(L, n, cast_int(L->top - L->base) - 1);
++    L->top -= (n-1);
++  }
++  else if (n == 0) {  /* push empty string */
++    setsvalue2s(L, L->top, luaS_newlstr(L, "", 0));
++    api_incr_top(L);
++  }
++  /* else n == 1; nothing to do */
++  lua_unlock(L);
++}
++
++
++LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud) {
++  lua_Alloc f;
++  lua_lock(L);
++  if (ud) *ud = G(L)->ud;
++  f = G(L)->frealloc;
++  lua_unlock(L);
++  return f;
++}
++
++
++LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud) {
++  lua_lock(L);
++  G(L)->ud = ud;
++  G(L)->frealloc = f;
++  lua_unlock(L);
++}
++
++
++LUA_API void *lua_newuserdata (lua_State *L, size_t size) {
++  Udata *u;
++  lua_lock(L);
++  luaC_checkGC(L);
++  u = luaS_newudata(L, size, getcurrenv(L));
++  setuvalue(L, L->top, u);
++  api_incr_top(L);
++  lua_unlock(L);
++  return u + 1;
++}
++
++
++
++
++static const char *aux_upvalue (StkId fi, int n, TValue **val) {
++  Closure *f;
++  if (!ttisfunction(fi)) return NULL;
++  f = clvalue(fi);
++  if (f->c.isC) {
++    if (!(1 <= n && n <= f->c.nupvalues)) return NULL;
++    *val = &f->c.upvalue[n-1];
++    return "";
++  }
++  else {
++    Proto *p = f->l.p;
++    if (!(1 <= n && n <= p->sizeupvalues)) return NULL;
++    *val = f->l.upvals[n-1]->v;
++    return getstr(p->upvalues[n-1]);
++  }
++}
++
++
++LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) {
++  const char *name;
++  TValue *val;
++  lua_lock(L);
++  name = aux_upvalue(index2adr(L, funcindex), n, &val);
++  if (name) {
++    setobj2s(L, L->top, val);
++    api_incr_top(L);
++  }
++  lua_unlock(L);
++  return name;
++}
++
++
++LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) {
++  const char *name;
++  TValue *val;
++  StkId fi;
++  lua_lock(L);
++  fi = index2adr(L, funcindex);
++  api_checknelems(L, 1);
++  name = aux_upvalue(fi, n, &val);
++  if (name) {
++    L->top--;
++    setobj(L, val, L->top);
++    luaC_barrier(L, clvalue(fi), L->top);
++  }
++  lua_unlock(L);
++  return name;
++}
++
+--- /dev/null
++++ b/extensions/LUA/lua/lapi.h
+@@ -0,0 +1,16 @@
++/*
++** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $
++** Auxiliary functions from Lua API
++** See Copyright Notice in lua.h
++*/
++
++#ifndef lapi_h
++#define lapi_h
++
++
++#include "lobject.h"
++
++
++LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o);
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/lauxlib.c
+@@ -0,0 +1,674 @@
++/*
++** $Id: lauxlib.c,v 1.159.1.3 2008/01/21 13:20:51 roberto Exp $
++** Auxiliary functions for building Lua libraries
++** See Copyright Notice in lua.h
++*/
++
++#include <stdarg.h>
++
++#if !defined(__KERNEL__)
++#include <ctype.h>
++#include <errno.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#else
++#include <linux/ctype.h>
++#include <linux/errno.h>
++#include <linux/kernel.h>
++#include <linux/slab.h>
++#include <linux/string.h>
++#endif
++
++/* This file uses only the official API of Lua.
++** Any function declared here could be written as an application function.
++*/
++
++#define lauxlib_c
++#define LUA_LIB
++
++#include "lua.h"
++
++#include "lauxlib.h"
++
++
++#define FREELIST_REF  0       /* free list of references */
++
++
++/* convert a stack index to positive */
++#define abs_index(L, i)               ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : \
++                                      lua_gettop(L) + (i) + 1)
++
++
++/*
++** {======================================================
++** Error-report functions
++** =======================================================
++*/
++
++
++LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) {
++  lua_Debug ar;
++  if (!lua_getstack(L, 0, &ar))  /* no stack frame? */
++    return luaL_error(L, "bad argument #%d (%s)", narg, extramsg);
++  lua_getinfo(L, "n", &ar);
++  if (strcmp(ar.namewhat, "method") == 0) {
++    narg--;  /* do not count `self' */
++    if (narg == 0)  /* error is in the self argument itself? */
++      return luaL_error(L, "calling " LUA_QS " on bad self (%s)",
++                           ar.name, extramsg);
++  }
++  if (ar.name == NULL)
++    ar.name = "?";
++  return luaL_error(L, "bad argument #%d to " LUA_QS " (%s)",
++                        narg, ar.name, extramsg);
++}
++
++
++LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname) {
++  const char *msg = lua_pushfstring(L, "%s expected, got %s",
++                                    tname, luaL_typename(L, narg));
++  return luaL_argerror(L, narg, msg);
++}
++
++
++static void tag_error (lua_State *L, int narg, int tag) {
++  luaL_typerror(L, narg, lua_typename(L, tag));
++}
++
++
++LUALIB_API void luaL_where (lua_State *L, int level) {
++  lua_Debug ar;
++  if (lua_getstack(L, level, &ar)) {  /* check function at level */
++    lua_getinfo(L, "Sl", &ar);  /* get info about it */
++    if (ar.currentline > 0) {  /* is there info? */
++      lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline);
++      return;
++    }
++  }
++  lua_pushliteral(L, "");  /* else, no information available... */
++}
++
++
++LUALIB_API int luaL_error (lua_State *L, const char *fmt, ...) {
++  va_list argp;
++  va_start(argp, fmt);
++  luaL_where(L, 1);
++  lua_pushvfstring(L, fmt, argp);
++  va_end(argp);
++  lua_concat(L, 2);
++  return lua_error(L);
++}
++
++/* }====================================================== */
++
++
++LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def,
++                                 const char *const lst[]) {
++  const char *name = (def) ? luaL_optstring(L, narg, def) :
++                             luaL_checkstring(L, narg);
++  int i;
++  for (i=0; lst[i]; i++)
++    if (strcmp(lst[i], name) == 0)
++      return i;
++  return luaL_argerror(L, narg,
++                       lua_pushfstring(L, "invalid option " LUA_QS, name));
++}
++
++
++LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) {
++  lua_getfield(L, LUA_REGISTRYINDEX, tname);  /* get registry.name */
++  if (!lua_isnil(L, -1))  /* name already in use? */
++    return 0;  /* leave previous value on top, but return 0 */
++  lua_pop(L, 1);
++  lua_newtable(L);  /* create metatable */
++  lua_pushvalue(L, -1);
++  lua_setfield(L, LUA_REGISTRYINDEX, tname);  /* registry.name = metatable */
++  return 1;
++}
++
++
++LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) {
++  void *p = lua_touserdata(L, ud);
++  if (p != NULL) {  /* value is a userdata? */
++    if (lua_getmetatable(L, ud)) {  /* does it have a metatable? */
++      lua_getfield(L, LUA_REGISTRYINDEX, tname);  /* get correct metatable */
++      if (lua_rawequal(L, -1, -2)) {  /* does it have the correct mt? */
++        lua_pop(L, 2);  /* remove both metatables */
++        return p;
++      }
++    }
++  }
++  luaL_typerror(L, ud, tname);  /* else error */
++  return NULL;  /* to avoid warnings */
++}
++
++
++LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *mes) {
++  if (!lua_checkstack(L, space))
++    luaL_error(L, "stack overflow (%s)", mes);
++}
++
++
++LUALIB_API void luaL_checktype (lua_State *L, int narg, int t) {
++  if (lua_type(L, narg) != t)
++    tag_error(L, narg, t);
++}
++
++
++LUALIB_API void luaL_checkany (lua_State *L, int narg) {
++  if (lua_type(L, narg) == LUA_TNONE)
++    luaL_argerror(L, narg, "value expected");
++}
++
++
++LUALIB_API const char *luaL_checklstring (lua_State *L, int narg, size_t *len) {
++  const char *s = lua_tolstring(L, narg, len);
++  if (!s) tag_error(L, narg, LUA_TSTRING);
++  return s;
++}
++
++
++LUALIB_API const char *luaL_optlstring (lua_State *L, int narg,
++                                        const char *def, size_t *len) {
++  if (lua_isnoneornil(L, narg)) {
++    if (len)
++      *len = (def ? strlen(def) : 0);
++    return def;
++  }
++  else return luaL_checklstring(L, narg, len);
++}
++
++
++LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) {
++  lua_Number d = lua_tonumber(L, narg);
++  if (d == 0 && !lua_isnumber(L, narg))  /* avoid extra test when d is not 0 */
++    tag_error(L, narg, LUA_TNUMBER);
++  return d;
++}
++
++
++LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) {
++  return luaL_opt(L, luaL_checknumber, narg, def);
++}
++
++
++LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int narg) {
++  lua_Integer d = lua_tointeger(L, narg);
++  if (d == 0 && !lua_isnumber(L, narg))  /* avoid extra test when d is not 0 */
++    tag_error(L, narg, LUA_TNUMBER);
++  return d;
++}
++
++
++LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg,
++                                                      lua_Integer def) {
++  return luaL_opt(L, luaL_checkinteger, narg, def);
++}
++
++
++LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
++  if (!lua_getmetatable(L, obj))  /* no metatable? */
++    return 0;
++  lua_pushstring(L, event);
++  lua_rawget(L, -2);
++  if (lua_isnil(L, -1)) {
++    lua_pop(L, 2);  /* remove metatable and metafield */
++    return 0;
++  }
++  else {
++    lua_remove(L, -2);  /* remove only metatable */
++    return 1;
++  }
++}
++
++
++LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {
++  obj = abs_index(L, obj);
++  if (!luaL_getmetafield(L, obj, event))  /* no metafield? */
++    return 0;
++  lua_pushvalue(L, obj);
++  lua_call(L, 1, 1);
++  return 1;
++}
++
++
++LUALIB_API void (luaL_register) (lua_State *L, const char *libname,
++                                const luaL_Reg *l) {
++  luaI_openlib(L, libname, l, 0);
++}
++
++
++static int libsize (const luaL_Reg *l) {
++  int size = 0;
++  for (; l->name; l++) size++;
++  return size;
++}
++
++
++LUALIB_API void luaI_openlib (lua_State *L, const char *libname,
++                              const luaL_Reg *l, int nup) {
++  if (libname) {
++    int size = libsize(l);
++    /* check whether lib already exists */
++    luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1);
++    lua_getfield(L, -1, libname);  /* get _LOADED[libname] */
++    if (!lua_istable(L, -1)) {  /* not found? */
++      lua_pop(L, 1);  /* remove previous result */
++      /* try global variable (and create one if it does not exist) */
++      if (luaL_findtable(L, LUA_GLOBALSINDEX, libname, size) != NULL)
++        luaL_error(L, "name conflict for module " LUA_QS, libname);
++      lua_pushvalue(L, -1);
++      lua_setfield(L, -3, libname);  /* _LOADED[libname] = new table */
++    }
++    lua_remove(L, -2);  /* remove _LOADED table */
++    lua_insert(L, -(nup+1));  /* move library table to below upvalues */
++  }
++  for (; l->name; l++) {
++    int i;
++    for (i=0; i<nup; i++)  /* copy upvalues to the top */
++      lua_pushvalue(L, -nup);
++    lua_pushcclosure(L, l->func, nup);
++    lua_setfield(L, -(nup+2), l->name);
++  }
++  lua_pop(L, nup);  /* remove upvalues */
++}
++
++
++
++/*
++** {======================================================
++** getn-setn: size for arrays
++** =======================================================
++*/
++
++#if defined(LUA_COMPAT_GETN)
++
++static int checkint (lua_State *L, int topop) {
++  int n = (lua_type(L, -1) == LUA_TNUMBER) ? lua_tointeger(L, -1) : -1;
++  lua_pop(L, topop);
++  return n;
++}
++
++
++static void getsizes (lua_State *L) {
++  lua_getfield(L, LUA_REGISTRYINDEX, "LUA_SIZES");
++  if (lua_isnil(L, -1)) {  /* no `size' table? */
++    lua_pop(L, 1);  /* remove nil */
++    lua_newtable(L);  /* create it */
++    lua_pushvalue(L, -1);  /* `size' will be its own metatable */
++    lua_setmetatable(L, -2);
++    lua_pushliteral(L, "kv");
++    lua_setfield(L, -2, "__mode");  /* metatable(N).__mode = "kv" */
++    lua_pushvalue(L, -1);
++    lua_setfield(L, LUA_REGISTRYINDEX, "LUA_SIZES");  /* store in register */
++  }
++}
++
++
++LUALIB_API void luaL_setn (lua_State *L, int t, int n) {
++  t = abs_index(L, t);
++  lua_pushliteral(L, "n");
++  lua_rawget(L, t);
++  if (checkint(L, 1) >= 0) {  /* is there a numeric field `n'? */
++    lua_pushliteral(L, "n");  /* use it */
++    lua_pushinteger(L, n);
++    lua_rawset(L, t);
++  }
++  else {  /* use `sizes' */
++    getsizes(L);
++    lua_pushvalue(L, t);
++    lua_pushinteger(L, n);
++    lua_rawset(L, -3);  /* sizes[t] = n */
++    lua_pop(L, 1);  /* remove `sizes' */
++  }
++}
++
++
++LUALIB_API int luaL_getn (lua_State *L, int t) {
++  int n;
++  t = abs_index(L, t);
++  lua_pushliteral(L, "n");  /* try t.n */
++  lua_rawget(L, t);
++  if ((n = checkint(L, 1)) >= 0) return n;
++  getsizes(L);  /* else try sizes[t] */
++  lua_pushvalue(L, t);
++  lua_rawget(L, -2);
++  if ((n = checkint(L, 2)) >= 0) return n;
++  return (int)lua_objlen(L, t);
++}
++
++#endif
++
++/* }====================================================== */
++
++
++
++LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p,
++                                                               const char *r) {
++  const char *wild;
++  size_t l = strlen(p);
++  luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC);
++  if(!b) luaL_error(L, "luaL_gsub: cannot allocate memory");
++  luaL_buffinit(L, b);
++  while ((wild = strstr(s, p)) != NULL) {
++    luaL_addlstring(b, s, wild - s);  /* push prefix */
++    luaL_addstring(b, r);  /* push replacement in place of pattern */
++    s = wild + l;  /* continue after `p' */
++  }
++  luaL_addstring(b, s);  /* push last suffix */
++  luaL_pushresult(b);
++  kfree(b);
++  return lua_tostring(L, -1);
++}
++
++
++LUALIB_API const char *luaL_findtable (lua_State *L, int idx,
++                                       const char *fname, int szhint) {
++  const char *e;
++  lua_pushvalue(L, idx);
++  do {
++    e = strchr(fname, '.');
++    if (e == NULL) e = fname + strlen(fname);
++    lua_pushlstring(L, fname, e - fname);
++    lua_rawget(L, -2);
++    if (lua_isnil(L, -1)) {  /* no such field? */
++      lua_pop(L, 1);  /* remove this nil */
++      lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */
++      lua_pushlstring(L, fname, e - fname);
++      lua_pushvalue(L, -2);
++      lua_settable(L, -4);  /* set new table into field */
++    }
++    else if (!lua_istable(L, -1)) {  /* field has a non-table value? */
++      lua_pop(L, 2);  /* remove table and value */
++      return fname;  /* return problematic part of the name */
++    }
++    lua_remove(L, -2);  /* remove previous table */
++    fname = e + 1;
++  } while (*e == '.');
++  return NULL;
++}
++
++
++
++/*
++** {======================================================
++** Generic Buffer manipulation
++** =======================================================
++*/
++
++
++#define bufflen(B)    ((B)->p - (B)->buffer)
++#define bufffree(B)   ((size_t)(LUAL_BUFFERSIZE - bufflen(B)))
++
++#define LIMIT (LUA_MINSTACK/2)
++
++
++static int emptybuffer (luaL_Buffer *B) {
++  size_t l = bufflen(B);
++  if (l == 0) return 0;  /* put nothing on stack */
++  else {
++    lua_pushlstring(B->L, B->buffer, l);
++    B->p = B->buffer;
++    B->lvl++;
++    return 1;
++  }
++}
++
++
++static void adjuststack (luaL_Buffer *B) {
++  if (B->lvl > 1) {
++    lua_State *L = B->L;
++    int toget = 1;  /* number of levels to concat */
++    size_t toplen = lua_strlen(L, -1);
++    do {
++      size_t l = lua_strlen(L, -(toget+1));
++      if (B->lvl - toget + 1 >= LIMIT || toplen > l) {
++        toplen += l;
++        toget++;
++      }
++      else break;
++    } while (toget < B->lvl);
++    lua_concat(L, toget);
++    B->lvl = B->lvl - toget + 1;
++  }
++}
++
++
++LUALIB_API char *luaL_prepbuffer (luaL_Buffer *B) {
++  if (emptybuffer(B))
++    adjuststack(B);
++  return B->buffer;
++}
++
++
++LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) {
++  while (l--)
++    luaL_addchar(B, *s++);
++}
++
++
++LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s) {
++  luaL_addlstring(B, s, strlen(s));
++}
++
++
++LUALIB_API void luaL_pushresult (luaL_Buffer *B) {
++  emptybuffer(B);
++  lua_concat(B->L, B->lvl);
++  B->lvl = 1;
++}
++
++
++LUALIB_API void luaL_addvalue (luaL_Buffer *B) {
++  lua_State *L = B->L;
++  size_t vl;
++  const char *s = lua_tolstring(L, -1, &vl);
++  if (vl <= bufffree(B)) {  /* fit into buffer? */
++    memcpy(B->p, s, vl);  /* put it there */
++    B->p += vl;
++    lua_pop(L, 1);  /* remove from stack */
++  }
++  else {
++    if (emptybuffer(B))
++      lua_insert(L, -2);  /* put buffer before new value */
++    B->lvl++;  /* add new value into B stack */
++    adjuststack(B);
++  }
++}
++
++
++LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B) {
++  B->L = L;
++  B->p = B->buffer;
++  B->lvl = 0;
++}
++
++/* }====================================================== */
++
++
++LUALIB_API int luaL_ref (lua_State *L, int t) {
++  int ref;
++  t = abs_index(L, t);
++  if (lua_isnil(L, -1)) {
++    lua_pop(L, 1);  /* remove from stack */
++    return LUA_REFNIL;  /* `nil' has a unique fixed reference */
++  }
++  lua_rawgeti(L, t, FREELIST_REF);  /* get first free element */
++  ref = (int)lua_tointeger(L, -1);  /* ref = t[FREELIST_REF] */
++  lua_pop(L, 1);  /* remove it from stack */
++  if (ref != 0) {  /* any free element? */
++    lua_rawgeti(L, t, ref);  /* remove it from list */
++    lua_rawseti(L, t, FREELIST_REF);  /* (t[FREELIST_REF] = t[ref]) */
++  }
++  else {  /* no free elements */
++    ref = (int)lua_objlen(L, t);
++    ref++;  /* create new reference */
++  }
++  lua_rawseti(L, t, ref);
++  return ref;
++}
++
++
++LUALIB_API void luaL_unref (lua_State *L, int t, int ref) {
++  if (ref >= 0) {
++    t = abs_index(L, t);
++    lua_rawgeti(L, t, FREELIST_REF);
++    lua_rawseti(L, t, ref);  /* t[ref] = t[FREELIST_REF] */
++    lua_pushinteger(L, ref);
++    lua_rawseti(L, t, FREELIST_REF);  /* t[FREELIST_REF] = ref */
++  }
++}
++
++
++
++/*
++** {======================================================
++** Load functions
++** =======================================================
++*/
++
++#if !defined(__KERNEL__)
++typedef struct LoadF {
++  int extraline;
++  FILE *f;
++  char buff[LUAL_BUFFERSIZE];
++} LoadF;
++
++
++static const char *getF (lua_State *L, void *ud, size_t *size) {
++  LoadF *lf = (LoadF *)ud;
++  (void)L;
++  if (lf->extraline) {
++    lf->extraline = 0;
++    *size = 1;
++    return "\n";
++  }
++  if (feof(lf->f)) return NULL;
++  *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f);
++  return (*size > 0) ? lf->buff : NULL;
++}
++
++
++static int errfile (lua_State *L, const char *what, int fnameindex) {
++  const char *serr = strerror(errno);
++  const char *filename = lua_tostring(L, fnameindex) + 1;
++  lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr);
++  lua_remove(L, fnameindex);
++  return LUA_ERRFILE;
++}
++
++
++LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) {
++  LoadF lf;
++  int status, readstatus;
++  int c;
++  int fnameindex = lua_gettop(L) + 1;  /* index of filename on the stack */
++  lf.extraline = 0;
++  if (filename == NULL) {
++    lua_pushliteral(L, "=stdin");
++    lf.f = stdin;
++  }
++  else {
++    lua_pushfstring(L, "@%s", filename);
++    lf.f = fopen(filename, "r");
++    if (lf.f == NULL) return errfile(L, "open", fnameindex);
++  }
++  c = getc(lf.f);
++  if (c == '#') {  /* Unix exec. file? */
++    lf.extraline = 1;
++    while ((c = getc(lf.f)) != EOF && c != '\n') ;  /* skip first line */
++    if (c == '\n') c = getc(lf.f);
++  }
++  if (c == LUA_SIGNATURE[0] && filename) {  /* binary file? */
++    lf.f = freopen(filename, "rb", lf.f);  /* reopen in binary mode */
++    if (lf.f == NULL) return errfile(L, "reopen", fnameindex);
++    /* skip eventual `#!...' */
++   while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ;
++    lf.extraline = 0;
++  }
++  ungetc(c, lf.f);
++  status = lua_load(L, getF, &lf, lua_tostring(L, -1));
++  readstatus = ferror(lf.f);
++  if (filename) fclose(lf.f);  /* close file (even in case of errors) */
++  if (readstatus) {
++    lua_settop(L, fnameindex);  /* ignore results from `lua_load' */
++    return errfile(L, "read", fnameindex);
++  }
++  lua_remove(L, fnameindex);
++  return status;
++}
++#endif
++
++typedef struct LoadS {
++  const char *s;
++  size_t size;
++} LoadS;
++
++
++static const char *getS (lua_State *L, void *ud, size_t *size) {
++  LoadS *ls = (LoadS *)ud;
++  (void)L;
++  if (ls->size == 0) return NULL;
++  *size = ls->size;
++  ls->size = 0;
++  return ls->s;
++}
++
++
++LUALIB_API int luaL_loadbuffer (lua_State *L, const char *buff, size_t size,
++                                const char *name) {
++  LoadS ls;
++  ls.s = buff;
++  ls.size = size;
++  return lua_load(L, getS, &ls, name);
++}
++
++
++LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s) {
++  return luaL_loadbuffer(L, s, strlen(s), s);
++}
++
++
++
++/* }====================================================== */
++
++
++static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
++  (void)ud;
++  (void)osize;
++  if (nsize == 0) {
++#if !defined(__KERNEL__)
++    free(ptr);
++#else
++    kfree(ptr);
++#endif
++    return NULL;
++  }
++  else
++#if !defined(__KERNEL__)
++    return realloc(ptr, nsize);
++#else
++    return krealloc(ptr, nsize, GFP_ATOMIC);
++#endif
++}
++
++
++static int lpanic (lua_State *L) {
++  (void)L;  /* to avoid warnings */
++#if !defined(__KERNEL__)
++  fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n",
++#else
++  printk( "PANIC: unprotected error in call to Lua API (%s)\n",
++#endif
++                   lua_tostring(L, -1));
++  return 0;
++}
++
++
++LUALIB_API lua_State *luaL_newstate (void) {
++  lua_State *L = lua_newstate(l_alloc, NULL);
++  if (L) lua_atpanic(L, &lpanic);
++  return L;
++}
++
+--- /dev/null
++++ b/extensions/LUA/lua/lauxlib.h
+@@ -0,0 +1,184 @@
++/*
++** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $
++** Auxiliary functions for building Lua libraries
++** See Copyright Notice in lua.h
++*/
++
++
++#ifndef lauxlib_h
++#define lauxlib_h
++
++
++#include <stddef.h>
++#include <linux/slab.h>       /* for kmalloc and kfree when allocating luaL_Buffer */
++
++#if !defined(__KERNEL__)
++#include <stdio.h>
++#endif
++
++#include "lua.h"
++
++
++#if defined(LUA_COMPAT_GETN)
++LUALIB_API int (luaL_getn) (lua_State *L, int t);
++LUALIB_API void (luaL_setn) (lua_State *L, int t, int n);
++#else
++#define luaL_getn(L,i)          ((int)lua_objlen(L, i))
++#define luaL_setn(L,i,j)        ((void)0)  /* no op! */
++#endif
++
++#if defined(LUA_COMPAT_OPENLIB)
++#define luaI_openlib  luaL_openlib
++#endif
++
++
++/* extra error code for `luaL_load' */
++#define LUA_ERRFILE     (LUA_ERRERR+1)
++
++
++typedef struct luaL_Reg {
++  const char *name;
++  lua_CFunction func;
++} luaL_Reg;
++
++
++
++LUALIB_API void (luaI_openlib) (lua_State *L, const char *libname,
++                                const luaL_Reg *l, int nup);
++LUALIB_API void (luaL_register) (lua_State *L, const char *libname,
++                                const luaL_Reg *l);
++LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);
++LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);
++LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);
++LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg);
++LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg,
++                                                          size_t *l);
++LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg,
++                                          const char *def, size_t *l);
++LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg);
++LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def);
++
++LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg);
++LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg,
++                                          lua_Integer def);
++
++LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg);
++LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t);
++LUALIB_API void (luaL_checkany) (lua_State *L, int narg);
++
++LUALIB_API int   (luaL_newmetatable) (lua_State *L, const char *tname);
++LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);
++
++LUALIB_API void (luaL_where) (lua_State *L, int lvl);
++LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
++
++LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,
++                                   const char *const lst[]);
++
++LUALIB_API int (luaL_ref) (lua_State *L, int t);
++LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);
++
++#if !defined(__KERNEL__)
++LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename);
++#endif
++
++LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz,
++                                  const char *name);
++LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s);
++
++LUALIB_API lua_State *(luaL_newstate) (void);
++
++
++LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,
++                                                  const char *r);
++
++LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx,
++                                         const char *fname, int szhint);
++
++
++
++
++/*
++** ===============================================================
++** some useful macros
++** ===============================================================
++*/
++
++#define luaL_argcheck(L, cond,numarg,extramsg)        \
++              ((void)((cond) || luaL_argerror(L, (numarg), (extramsg))))
++#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
++#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))
++#define luaL_checkint(L,n)    ((int)luaL_checkinteger(L, (n)))
++#define luaL_optint(L,n,d)    ((int)luaL_optinteger(L, (n), (d)))
++#define luaL_checklong(L,n)   ((long)luaL_checkinteger(L, (n)))
++#define luaL_optlong(L,n,d)   ((long)luaL_optinteger(L, (n), (d)))
++
++#define luaL_typename(L,i)    lua_typename(L, lua_type(L,(i)))
++
++#if !defined(__KERNEL__)
++#define luaL_dofile(L, fn) \
++      (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))
++#endif
++
++#define luaL_dostring(L, s) \
++      (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))
++
++#define luaL_getmetatable(L,n)        (lua_getfield(L, LUA_REGISTRYINDEX, (n)))
++
++#define luaL_opt(L,f,n,d)     (lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
++
++/*
++** {======================================================
++** Generic Buffer manipulation
++** =======================================================
++*/
++
++
++
++typedef struct luaL_Buffer {
++  char *p;                    /* current position in buffer */
++  int lvl;  /* number of strings in the stack (level) */
++  lua_State *L;
++  char buffer[LUAL_BUFFERSIZE];
++} luaL_Buffer;
++
++#define luaL_addchar(B,c) \
++  ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \
++   (*(B)->p++ = (char)(c)))
++
++/* compatibility only */
++#define luaL_putchar(B,c)     luaL_addchar(B,c)
++
++#define luaL_addsize(B,n)     ((B)->p += (n))
++
++
++LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B);
++LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B);
++LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l);
++LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s);
++LUALIB_API void (luaL_addvalue) (luaL_Buffer *B);
++LUALIB_API void (luaL_pushresult) (luaL_Buffer *B);
++
++
++/* }====================================================== */
++
++
++/* compatibility with ref system */
++
++/* pre-defined references */
++#define LUA_NOREF       (-2)
++#define LUA_REFNIL      (-1)
++
++#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \
++      (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0))
++
++#define lua_unref(L,ref)        luaL_unref(L, LUA_REGISTRYINDEX, (ref))
++
++#define lua_getref(L,ref)       lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))
++
++
++#define luaL_reg      luaL_Reg
++
++#endif
++
++
+--- /dev/null
++++ b/extensions/LUA/lua/lbaselib.c
+@@ -0,0 +1,647 @@
++/*
++** $Id: lbaselib.c,v 1.191.1.6 2008/02/14 16:46:22 roberto Exp $
++** Basic library
++** See Copyright Notice in lua.h
++*/
++
++
++#include <linux/kernel.h>
++#include <linux/ctype.h>
++#include <linux/string.h>
++
++#define lbaselib_c
++#define LUA_LIB
++
++#include "lua.h"
++
++#include "lauxlib.h"
++#include "lualib.h"
++
++
++
++
++/*
++** If your system does not support `stdout', you can just remove this function.
++** If you need, you can define your own `print' function, following this
++** model but changing `fputs' to put the strings at a proper place
++** (a console window or a log file, for instance).
++*/
++static int luaB_print (lua_State *L) {
++  int n = lua_gettop(L);  /* number of arguments */
++  int i;
++  lua_getglobal(L, "tostring");
++  for (i=1; i<=n; i++) {
++    const char *s;
++    lua_pushvalue(L, -1);  /* function to be called */
++    lua_pushvalue(L, i);   /* value to print */
++    lua_call(L, 1, 1);
++    s = lua_tostring(L, -1);  /* get result */
++    if (s == NULL)
++      return luaL_error(L, LUA_QL("tostring") " must return a string to "
++                           LUA_QL("print"));
++    printk(KERN_INFO "LUA[print]: %s", s);
++    lua_pop(L, 1);  /* pop result */
++  }
++  return 0;
++}
++
++
++static int luaB_tonumber (lua_State *L) {
++  int base = luaL_optint(L, 2, 10);
++  if (base == 10) {  /* standard conversion */
++    luaL_checkany(L, 1);
++    if (lua_isnumber(L, 1)) {
++      lua_pushnumber(L, lua_tonumber(L, 1));
++      return 1;
++    }
++  }
++  else {
++    const char *s1 = luaL_checkstring(L, 1);
++    char *s2;
++    unsigned long n;
++    luaL_argcheck(L, 2 <= base && base <= 36, 2, "base out of range");
++    n = simple_strtoul(s1, &s2, base);
++    if (s1 != s2) {  /* at least one valid digit? */
++      while (isspace((unsigned char)(*s2))) s2++;  /* skip trailing spaces */
++      if (*s2 == '\0') {  /* no invalid trailing characters? */
++        lua_pushnumber(L, (lua_Number)n);
++        return 1;
++      }
++    }
++  }
++  lua_pushnil(L);  /* else not a number */
++  return 1;
++}
++
++
++static int luaB_error (lua_State *L) {
++  int level = luaL_optint(L, 2, 1);
++  lua_settop(L, 1);
++  if (lua_isstring(L, 1) && level > 0) {  /* add extra information? */
++    luaL_where(L, level);
++    lua_pushvalue(L, 1);
++    lua_concat(L, 2);
++  }
++  return lua_error(L);
++}
++
++
++static int luaB_getmetatable (lua_State *L) {
++  luaL_checkany(L, 1);
++  if (!lua_getmetatable(L, 1)) {
++    lua_pushnil(L);
++    return 1;  /* no metatable */
++  }
++  luaL_getmetafield(L, 1, "__metatable");
++  return 1;  /* returns either __metatable field (if present) or metatable */
++}
++
++
++static int luaB_setmetatable (lua_State *L) {
++  int t = lua_type(L, 2);
++  luaL_checktype(L, 1, LUA_TTABLE);
++  luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2,
++                    "nil or table expected");
++  if (luaL_getmetafield(L, 1, "__metatable"))
++    luaL_error(L, "cannot change a protected metatable");
++  lua_settop(L, 2);
++  lua_setmetatable(L, 1);
++  return 1;
++}
++
++
++static void getfunc (lua_State *L, int opt) {
++  if (lua_isfunction(L, 1)) lua_pushvalue(L, 1);
++  else {
++    lua_Debug ar;
++    int level = opt ? luaL_optint(L, 1, 1) : luaL_checkint(L, 1);
++    luaL_argcheck(L, level >= 0, 1, "level must be non-negative");
++    if (lua_getstack(L, level, &ar) == 0)
++      luaL_argerror(L, 1, "invalid level");
++    lua_getinfo(L, "f", &ar);
++    if (lua_isnil(L, -1))
++      luaL_error(L, "no function environment for tail call at level %d",
++                    level);
++  }
++}
++
++
++static int luaB_getfenv (lua_State *L) {
++  getfunc(L, 1);
++  if (lua_iscfunction(L, -1))  /* is a C function? */
++    lua_pushvalue(L, LUA_GLOBALSINDEX);  /* return the thread's global env. */
++  else
++    lua_getfenv(L, -1);
++  return 1;
++}
++
++
++static int luaB_setfenv (lua_State *L) {
++  luaL_checktype(L, 2, LUA_TTABLE);
++  getfunc(L, 0);
++  lua_pushvalue(L, 2);
++  if (lua_isnumber(L, 1) && lua_tonumber(L, 1) == 0) {
++    /* change environment of current thread */
++    lua_pushthread(L);
++    lua_insert(L, -2);
++    lua_setfenv(L, -2);
++    return 0;
++  }
++  else if (lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0)
++    luaL_error(L,
++          LUA_QL("setfenv") " cannot change environment of given object");
++  return 1;
++}
++
++
++static int luaB_rawequal (lua_State *L) {
++  luaL_checkany(L, 1);
++  luaL_checkany(L, 2);
++  lua_pushboolean(L, lua_rawequal(L, 1, 2));
++  return 1;
++}
++
++
++static int luaB_rawget (lua_State *L) {
++  luaL_checktype(L, 1, LUA_TTABLE);
++  luaL_checkany(L, 2);
++  lua_settop(L, 2);
++  lua_rawget(L, 1);
++  return 1;
++}
++
++static int luaB_rawset (lua_State *L) {
++  luaL_checktype(L, 1, LUA_TTABLE);
++  luaL_checkany(L, 2);
++  luaL_checkany(L, 3);
++  lua_settop(L, 3);
++  lua_rawset(L, 1);
++  return 1;
++}
++
++
++static int luaB_gcinfo (lua_State *L) {
++  lua_pushinteger(L, lua_getgccount(L));
++  return 1;
++}
++
++static int luaB_collectgarbage (lua_State *L) {
++  static const char *const opts[] = {"stop", "restart", "collect",
++    "count", "step", "setpause", "setstepmul", NULL};
++  static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT,
++    LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL};
++  int o = luaL_checkoption(L, 1, "collect", opts);
++  int ex = luaL_optint(L, 2, 0);
++  int res = lua_gc(L, optsnum[o], ex);
++  switch (optsnum[o]) {
++    case LUA_GCCOUNT: {
++      int b = lua_gc(L, LUA_GCCOUNTB, 0);
++      lua_pushnumber(L, res + ((lua_Number)b/1024));
++      return 1;
++    }
++    case LUA_GCSTEP: {
++      lua_pushboolean(L, res);
++      return 1;
++    }
++    default: {
++      lua_pushnumber(L, res);
++      return 1;
++    }
++  }
++}
++
++
++static int luaB_type (lua_State *L) {
++  luaL_checkany(L, 1);
++  lua_pushstring(L, luaL_typename(L, 1));
++  return 1;
++}
++
++
++static int luaB_next (lua_State *L) {
++  luaL_checktype(L, 1, LUA_TTABLE);
++  lua_settop(L, 2);  /* create a 2nd argument if there isn't one */
++  if (lua_next(L, 1))
++    return 2;
++  else {
++    lua_pushnil(L);
++    return 1;
++  }
++}
++
++
++static int luaB_pairs (lua_State *L) {
++  luaL_checktype(L, 1, LUA_TTABLE);
++  lua_pushvalue(L, lua_upvalueindex(1));  /* return generator, */
++  lua_pushvalue(L, 1);  /* state, */
++  lua_pushnil(L);  /* and initial value */
++  return 3;
++}
++
++
++static int ipairsaux (lua_State *L) {
++  int i = luaL_checkint(L, 2);
++  luaL_checktype(L, 1, LUA_TTABLE);
++  i++;  /* next value */
++  lua_pushinteger(L, i);
++  lua_rawgeti(L, 1, i);
++  return (lua_isnil(L, -1)) ? 0 : 2;
++}
++
++
++static int luaB_ipairs (lua_State *L) {
++  luaL_checktype(L, 1, LUA_TTABLE);
++  lua_pushvalue(L, lua_upvalueindex(1));  /* return generator, */
++  lua_pushvalue(L, 1);  /* state, */
++  lua_pushinteger(L, 0);  /* and initial value */
++  return 3;
++}
++
++
++static int load_aux (lua_State *L, int status) {
++  if (status == 0)  /* OK? */
++    return 1;
++  else {
++    lua_pushnil(L);
++    lua_insert(L, -2);  /* put before error message */
++    return 2;  /* return nil plus error message */
++  }
++}
++
++
++static int luaB_loadstring (lua_State *L) {
++  size_t l;
++  const char *s = luaL_checklstring(L, 1, &l);
++  const char *chunkname = luaL_optstring(L, 2, s);
++  return load_aux(L, luaL_loadbuffer(L, s, l, chunkname));
++}
++
++/*
++static int luaB_loadfile (lua_State *L) {
++  const char *fname = luaL_optstring(L, 1, NULL);
++  return load_aux(L, luaL_loadfile(L, fname));
++}
++*/
++
++/*
++** Reader for generic `load' function: `lua_load' uses the
++** stack for internal stuff, so the reader cannot change the
++** stack top. Instead, it keeps its resulting string in a
++** reserved slot inside the stack.
++*/
++static const char *generic_reader (lua_State *L, void *ud, size_t *size) {
++  (void)ud;  /* to avoid warnings */
++  luaL_checkstack(L, 2, "too many nested functions");
++  lua_pushvalue(L, 1);  /* get function */
++  lua_call(L, 0, 1);  /* call it */
++  if (lua_isnil(L, -1)) {
++    *size = 0;
++    return NULL;
++  }
++  else if (lua_isstring(L, -1)) {
++    lua_replace(L, 3);  /* save string in a reserved stack slot */
++    return lua_tolstring(L, 3, size);
++  }
++  else luaL_error(L, "reader function must return a string");
++  return NULL;  /* to avoid warnings */
++}
++
++
++static int luaB_load (lua_State *L) {
++  int status;
++  const char *cname = luaL_optstring(L, 2, "=(load)");
++  luaL_checktype(L, 1, LUA_TFUNCTION);
++  lua_settop(L, 3);  /* function, eventual name, plus one reserved slot */
++  status = lua_load(L, generic_reader, NULL, cname);
++  return load_aux(L, status);
++}
++
++/*
++static int luaB_dofile (lua_State *L) {
++  const char *fname = luaL_optstring(L, 1, NULL);
++  int n = lua_gettop(L);
++  if (luaL_loadfile(L, fname) != 0) lua_error(L);
++  lua_call(L, 0, LUA_MULTRET);
++  return lua_gettop(L) - n;
++}
++*/
++
++static int luaB_assert (lua_State *L) {
++  luaL_checkany(L, 1);
++  if (!lua_toboolean(L, 1))
++    return luaL_error(L, "%s", luaL_optstring(L, 2, "assertion failed!"));
++  return lua_gettop(L);
++}
++
++
++static int luaB_unpack (lua_State *L) {
++  int i, e, n;
++  luaL_checktype(L, 1, LUA_TTABLE);
++  i = luaL_optint(L, 2, 1);
++  e = luaL_opt(L, luaL_checkint, 3, luaL_getn(L, 1));
++  if (i > e) return 0;  /* empty range */
++  n = e - i + 1;  /* number of elements */
++  if (n <= 0 || !lua_checkstack(L, n))  /* n <= 0 means arith. overflow */
++    return luaL_error(L, "too many results to unpack");
++  lua_rawgeti(L, 1, i);  /* push arg[i] (avoiding overflow problems) */
++  while (i++ < e)  /* push arg[i + 1...e] */
++    lua_rawgeti(L, 1, i);
++  return n;
++}
++
++
++static int luaB_select (lua_State *L) {
++  int n = lua_gettop(L);
++  if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') {
++    lua_pushinteger(L, n-1);
++    return 1;
++  }
++  else {
++    int i = luaL_checkint(L, 1);
++    if (i < 0) i = n + i;
++    else if (i > n) i = n;
++    luaL_argcheck(L, 1 <= i, 1, "index out of range");
++    return n - i;
++  }
++}
++
++
++static int luaB_pcall (lua_State *L) {
++  int status;
++  luaL_checkany(L, 1);
++  status = lua_pcall(L, lua_gettop(L) - 1, LUA_MULTRET, 0);
++  lua_pushboolean(L, (status == 0));
++  lua_insert(L, 1);
++  return lua_gettop(L);  /* return status + all results */
++}
++
++
++static int luaB_xpcall (lua_State *L) {
++  int status;
++  luaL_checkany(L, 2);
++  lua_settop(L, 2);
++  lua_insert(L, 1);  /* put error function under function to be called */
++  status = lua_pcall(L, 0, LUA_MULTRET, 1);
++  lua_pushboolean(L, (status == 0));
++  lua_replace(L, 1);
++  return lua_gettop(L);  /* return status + all results */
++}
++
++
++static int luaB_tostring (lua_State *L) {
++  luaL_checkany(L, 1);
++  if (luaL_callmeta(L, 1, "__tostring"))  /* is there a metafield? */
++    return 1;  /* use its value */
++  switch (lua_type(L, 1)) {
++    case LUA_TNUMBER:
++      lua_pushstring(L, lua_tostring(L, 1));
++      break;
++    case LUA_TSTRING:
++      lua_pushvalue(L, 1);
++      break;
++    case LUA_TBOOLEAN:
++      lua_pushstring(L, (lua_toboolean(L, 1) ? "true" : "false"));
++      break;
++    case LUA_TNIL:
++      lua_pushliteral(L, "nil");
++      break;
++    default:
++      lua_pushfstring(L, "%s: %p", luaL_typename(L, 1), lua_topointer(L, 1));
++      break;
++  }
++  return 1;
++}
++
++
++static int luaB_newproxy (lua_State *L) {
++  lua_settop(L, 1);
++  lua_newuserdata(L, 0);  /* create proxy */
++  if (lua_toboolean(L, 1) == 0)
++    return 1;  /* no metatable */
++  else if (lua_isboolean(L, 1)) {
++    lua_newtable(L);  /* create a new metatable `m' ... */
++    lua_pushvalue(L, -1);  /* ... and mark `m' as a valid metatable */
++    lua_pushboolean(L, 1);
++    lua_rawset(L, lua_upvalueindex(1));  /* weaktable[m] = true */
++  }
++  else {
++    int validproxy = 0;  /* to check if weaktable[metatable(u)] == true */
++    if (lua_getmetatable(L, 1)) {
++      lua_rawget(L, lua_upvalueindex(1));
++      validproxy = lua_toboolean(L, -1);
++      lua_pop(L, 1);  /* remove value */
++    }
++    luaL_argcheck(L, validproxy, 1, "boolean or proxy expected");
++    lua_getmetatable(L, 1);  /* metatable is valid; get it */
++  }
++  lua_setmetatable(L, 2);
++  return 1;
++}
++
++
++static const luaL_Reg base_funcs[] = {
++  {"assert", luaB_assert},
++  {"collectgarbage", luaB_collectgarbage},
++//  {"dofile", luaB_dofile},
++  {"error", luaB_error},
++  {"gcinfo", luaB_gcinfo},
++  {"getfenv", luaB_getfenv},
++  {"getmetatable", luaB_getmetatable},
++//  {"loadfile", luaB_loadfile},
++  {"load", luaB_load},
++  {"loadstring", luaB_loadstring},
++  {"next", luaB_next},
++  {"pcall", luaB_pcall},
++  {"print", luaB_print},
++  {"rawequal", luaB_rawequal},
++  {"rawget", luaB_rawget},
++  {"rawset", luaB_rawset},
++  {"select", luaB_select},
++  {"setfenv", luaB_setfenv},
++  {"setmetatable", luaB_setmetatable},
++  {"tonumber", luaB_tonumber},
++  {"tostring", luaB_tostring},
++  {"type", luaB_type},
++  {"unpack", luaB_unpack},
++  {"xpcall", luaB_xpcall},
++  {NULL, NULL}
++};
++
++
++/*
++** {======================================================
++** Coroutine library
++** =======================================================
++*/
++
++#define CO_RUN        0       /* running */
++#define CO_SUS        1       /* suspended */
++#define CO_NOR        2       /* 'normal' (it resumed another coroutine) */
++#define CO_DEAD       3
++
++static const char *const statnames[] =
++    {"running", "suspended", "normal", "dead"};
++
++static int costatus (lua_State *L, lua_State *co) {
++  if (L == co) return CO_RUN;
++  switch (lua_status(co)) {
++    case LUA_YIELD:
++      return CO_SUS;
++    case 0: {
++      lua_Debug ar;
++      if (lua_getstack(co, 0, &ar) > 0)  /* does it have frames? */
++        return CO_NOR;  /* it is running */
++      else if (lua_gettop(co) == 0)
++          return CO_DEAD;
++      else
++        return CO_SUS;  /* initial state */
++    }
++    default:  /* some error occured */
++      return CO_DEAD;
++  }
++}
++
++
++static int luaB_costatus (lua_State *L) {
++  lua_State *co = lua_tothread(L, 1);
++  luaL_argcheck(L, co, 1, "coroutine expected");
++  lua_pushstring(L, statnames[costatus(L, co)]);
++  return 1;
++}
++
++
++static int auxresume (lua_State *L, lua_State *co, int narg) {
++  int status = costatus(L, co);
++  if (!lua_checkstack(co, narg))
++    luaL_error(L, "too many arguments to resume");
++  if (status != CO_SUS) {
++    lua_pushfstring(L, "cannot resume %s coroutine", statnames[status]);
++    return -1;  /* error flag */
++  }
++  lua_xmove(L, co, narg);
++  lua_setlevel(L, co);
++  status = lua_resume(co, narg);
++  if (status == 0 || status == LUA_YIELD) {
++    int nres = lua_gettop(co);
++    if (!lua_checkstack(L, nres + 1))
++      luaL_error(L, "too many results to resume");
++    lua_xmove(co, L, nres);  /* move yielded values */
++    return nres;
++  }
++  else {
++    lua_xmove(co, L, 1);  /* move error message */
++    return -1;  /* error flag */
++  }
++}
++
++
++static int luaB_coresume (lua_State *L) {
++  lua_State *co = lua_tothread(L, 1);
++  int r;
++  luaL_argcheck(L, co, 1, "coroutine expected");
++  r = auxresume(L, co, lua_gettop(L) - 1);
++  if (r < 0) {
++    lua_pushboolean(L, 0);
++    lua_insert(L, -2);
++    return 2;  /* return false + error message */
++  }
++  else {
++    lua_pushboolean(L, 1);
++    lua_insert(L, -(r + 1));
++    return r + 1;  /* return true + `resume' returns */
++  }
++}
++
++
++static int luaB_auxwrap (lua_State *L) {
++  lua_State *co = lua_tothread(L, lua_upvalueindex(1));
++  int r = auxresume(L, co, lua_gettop(L));
++  if (r < 0) {
++    if (lua_isstring(L, -1)) {  /* error object is a string? */
++      luaL_where(L, 1);  /* add extra info */
++      lua_insert(L, -2);
++      lua_concat(L, 2);
++    }
++    lua_error(L);  /* propagate error */
++  }
++  return r;
++}
++
++
++static int luaB_cocreate (lua_State *L) {
++  lua_State *NL = lua_newthread(L);
++  luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1,
++    "Lua function expected");
++  lua_pushvalue(L, 1);  /* move function to top */
++  lua_xmove(L, NL, 1);  /* move function from L to NL */
++  return 1;
++}
++
++
++static int luaB_cowrap (lua_State *L) {
++  luaB_cocreate(L);
++  lua_pushcclosure(L, luaB_auxwrap, 1);
++  return 1;
++}
++
++
++static int luaB_yield (lua_State *L) {
++  return lua_yield(L, lua_gettop(L));
++}
++
++
++static int luaB_corunning (lua_State *L) {
++  if (lua_pushthread(L))
++    lua_pushnil(L);  /* main thread is not a coroutine */
++  return 1;
++}
++
++
++static const luaL_Reg co_funcs[] = {
++  {"create", luaB_cocreate},
++  {"resume", luaB_coresume},
++  {"running", luaB_corunning},
++  {"status", luaB_costatus},
++  {"wrap", luaB_cowrap},
++  {"yield", luaB_yield},
++  {NULL, NULL}
++};
++
++/* }====================================================== */
++
++
++static void auxopen (lua_State *L, const char *name,
++                     lua_CFunction f, lua_CFunction u) {
++  lua_pushcfunction(L, u);
++  lua_pushcclosure(L, f, 1);
++  lua_setfield(L, -2, name);
++}
++
++
++static void base_open (lua_State *L) {
++  /* set global _G */
++  lua_pushvalue(L, LUA_GLOBALSINDEX);
++  lua_setglobal(L, "_G");
++  /* open lib into global table */
++  luaL_register(L, "_G", base_funcs);
++  lua_pushliteral(L, LUA_VERSION);
++  lua_setglobal(L, "_VERSION");  /* set global _VERSION */
++  /* `ipairs' and `pairs' need auxliliary functions as upvalues */
++  auxopen(L, "ipairs", luaB_ipairs, ipairsaux);
++  auxopen(L, "pairs", luaB_pairs, luaB_next);
++  /* `newproxy' needs a weaktable as upvalue */
++  lua_createtable(L, 0, 1);  /* new table `w' */
++  lua_pushvalue(L, -1);  /* `w' will be its own metatable */
++  lua_setmetatable(L, -2);
++  lua_pushliteral(L, "kv");
++  lua_setfield(L, -2, "__mode");  /* metatable(w).__mode = "kv" */
++  lua_pushcclosure(L, luaB_newproxy, 1);
++  lua_setglobal(L, "newproxy");  /* set global `newproxy' */
++}
++
++
++LUALIB_API int luaopen_base (lua_State *L) {
++  base_open(L);
++  luaL_register(L, LUA_COLIBNAME, co_funcs);
++  return 2;
++}
+--- /dev/null
++++ b/extensions/LUA/lua/lcode.c
+@@ -0,0 +1,838 @@
++/*
++** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $
++** Code generator for Lua
++** See Copyright Notice in lua.h
++*/
++
++#include <stdlib.h>
++
++#define lcode_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "lcode.h"
++#include "ldebug.h"
++#include "ldo.h"
++#include "lgc.h"
++#include "llex.h"
++#include "lmem.h"
++#include "lobject.h"
++#include "lopcodes.h"
++#include "lparser.h"
++#include "ltable.h"
++
++
++#define hasjumps(e)   ((e)->t != (e)->f)
++
++
++static int isnumeral(expdesc *e) {
++  return (e->k == VKNUM && e->t == NO_JUMP && e->f == NO_JUMP);
++}
++
++
++void luaK_nil (FuncState *fs, int from, int n) {
++  Instruction *previous;
++  if (fs->pc > fs->lasttarget) {  /* no jumps to current position? */
++    if (fs->pc == 0) {  /* function start? */
++      if (from >= fs->nactvar)
++        return;  /* positions are already clean */
++    }
++    else {
++      previous = &fs->f->code[fs->pc-1];
++      if (GET_OPCODE(*previous) == OP_LOADNIL) {
++        int pfrom = GETARG_A(*previous);
++        int pto = GETARG_B(*previous);
++        if (pfrom <= from && from <= pto+1) {  /* can connect both? */
++          if (from+n-1 > pto)
++            SETARG_B(*previous, from+n-1);
++          return;
++        }
++      }
++    }
++  }
++  luaK_codeABC(fs, OP_LOADNIL, from, from+n-1, 0);  /* else no optimization */
++}
++
++
++int luaK_jump (FuncState *fs) {
++  int jpc = fs->jpc;  /* save list of jumps to here */
++  int j;
++  fs->jpc = NO_JUMP;
++  j = luaK_codeAsBx(fs, OP_JMP, 0, NO_JUMP);
++  luaK_concat(fs, &j, jpc);  /* keep them on hold */
++  return j;
++}
++
++
++void luaK_ret (FuncState *fs, int first, int nret) {
++  luaK_codeABC(fs, OP_RETURN, first, nret+1, 0);
++}
++
++
++static int condjump (FuncState *fs, OpCode op, int A, int B, int C) {
++  luaK_codeABC(fs, op, A, B, C);
++  return luaK_jump(fs);
++}
++
++
++static void fixjump (FuncState *fs, int pc, int dest) {
++  Instruction *jmp = &fs->f->code[pc];
++  int offset = dest-(pc+1);
++  lua_assert(dest != NO_JUMP);
++  if (abs(offset) > MAXARG_sBx)
++    luaX_syntaxerror(fs->ls, "control structure too long");
++  SETARG_sBx(*jmp, offset);
++}
++
++
++/*
++** returns current `pc' and marks it as a jump target (to avoid wrong
++** optimizations with consecutive instructions not in the same basic block).
++*/
++int luaK_getlabel (FuncState *fs) {
++  fs->lasttarget = fs->pc;
++  return fs->pc;
++}
++
++
++static int getjump (FuncState *fs, int pc) {
++  int offset = GETARG_sBx(fs->f->code[pc]);
++  if (offset == NO_JUMP)  /* point to itself represents end of list */
++    return NO_JUMP;  /* end of list */
++  else
++    return (pc+1)+offset;  /* turn offset into absolute position */
++}
++
++
++static Instruction *getjumpcontrol (FuncState *fs, int pc) {
++  Instruction *pi = &fs->f->code[pc];
++  if (pc >= 1 && testTMode(GET_OPCODE(*(pi-1))))
++    return pi-1;
++  else
++    return pi;
++}
++
++
++/*
++** check whether list has any jump that do not produce a value
++** (or produce an inverted value)
++*/
++static int need_value (FuncState *fs, int list) {
++  for (; list != NO_JUMP; list = getjump(fs, list)) {
++    Instruction i = *getjumpcontrol(fs, list);
++    if (GET_OPCODE(i) != OP_TESTSET) return 1;
++  }
++  return 0;  /* not found */
++}
++
++
++static int patchtestreg (FuncState *fs, int node, int reg) {
++  Instruction *i = getjumpcontrol(fs, node);
++  if (GET_OPCODE(*i) != OP_TESTSET)
++    return 0;  /* cannot patch other instructions */
++  if (reg != NO_REG && reg != GETARG_B(*i))
++    SETARG_A(*i, reg);
++  else  /* no register to put value or register already has the value */
++    *i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i));
++
++  return 1;
++}
++
++
++static void removevalues (FuncState *fs, int list) {
++  for (; list != NO_JUMP; list = getjump(fs, list))
++      patchtestreg(fs, list, NO_REG);
++}
++
++
++static void patchlistaux (FuncState *fs, int list, int vtarget, int reg,
++                          int dtarget) {
++  while (list != NO_JUMP) {
++    int next = getjump(fs, list);
++    if (patchtestreg(fs, list, reg))
++      fixjump(fs, list, vtarget);
++    else
++      fixjump(fs, list, dtarget);  /* jump to default target */
++    list = next;
++  }
++}
++
++
++static void dischargejpc (FuncState *fs) {
++  patchlistaux(fs, fs->jpc, fs->pc, NO_REG, fs->pc);
++  fs->jpc = NO_JUMP;
++}
++
++
++void luaK_patchlist (FuncState *fs, int list, int target) {
++  if (target == fs->pc)
++    luaK_patchtohere(fs, list);
++  else {
++    lua_assert(target < fs->pc);
++    patchlistaux(fs, list, target, NO_REG, target);
++  }
++}
++
++
++void luaK_patchtohere (FuncState *fs, int list) {
++  luaK_getlabel(fs);
++  luaK_concat(fs, &fs->jpc, list);
++}
++
++
++void luaK_concat (FuncState *fs, int *l1, int l2) {
++  if (l2 == NO_JUMP) return;
++  else if (*l1 == NO_JUMP)
++    *l1 = l2;
++  else {
++    int list = *l1;
++    int next;
++    while ((next = getjump(fs, list)) != NO_JUMP)  /* find last element */
++      list = next;
++    fixjump(fs, list, l2);
++  }
++}
++
++
++void luaK_checkstack (FuncState *fs, int n) {
++  int newstack = fs->freereg + n;
++  if (newstack > fs->f->maxstacksize) {
++    if (newstack >= MAXSTACK)
++      luaX_syntaxerror(fs->ls, "function or expression too complex");
++    fs->f->maxstacksize = cast_byte(newstack);
++  }
++}
++
++
++void luaK_reserveregs (FuncState *fs, int n) {
++  luaK_checkstack(fs, n);
++  fs->freereg += n;
++}
++
++
++static void freereg (FuncState *fs, int reg) {
++  if (!ISK(reg) && reg >= fs->nactvar) {
++    fs->freereg--;
++    lua_assert(reg == fs->freereg);
++  }
++}
++
++
++static void freeexp (FuncState *fs, expdesc *e) {
++  if (e->k == VNONRELOC)
++    freereg(fs, e->u.s.info);
++}
++
++
++static int addk (FuncState *fs, TValue *k, TValue *v) {
++  lua_State *L = fs->L;
++  TValue *idx = luaH_set(L, fs->h, k);
++  Proto *f = fs->f;
++  int oldsize = f->sizek;
++  if (ttisnumber(idx)) {
++    lua_assert(luaO_rawequalObj(&fs->f->k[cast_int(nvalue(idx))], v));
++    return cast_int(nvalue(idx));
++  }
++  else {  /* constant not found; create a new entry */
++    setnvalue(idx, cast_num(fs->nk));
++    luaM_growvector(L, f->k, fs->nk, f->sizek, TValue,
++                    MAXARG_Bx, "constant table overflow");
++    while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]);
++    setobj(L, &f->k[fs->nk], v);
++    luaC_barrier(L, f, v);
++    return fs->nk++;
++  }
++}
++
++
++int luaK_stringK (FuncState *fs, TString *s) {
++  TValue o;
++  setsvalue(fs->L, &o, s);
++  return addk(fs, &o, &o);
++}
++
++
++int luaK_numberK (FuncState *fs, lua_Number r) {
++  TValue o;
++  setnvalue(&o, r);
++  return addk(fs, &o, &o);
++}
++
++
++static int boolK (FuncState *fs, int b) {
++  TValue o;
++  setbvalue(&o, b);
++  return addk(fs, &o, &o);
++}
++
++
++static int nilK (FuncState *fs) {
++  TValue k, v;
++  setnilvalue(&v);
++  /* cannot use nil as key; instead use table itself to represent nil */
++  sethvalue(fs->L, &k, fs->h);
++  return addk(fs, &k, &v);
++}
++
++
++void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) {
++  if (e->k == VCALL) {  /* expression is an open function call? */
++    SETARG_C(getcode(fs, e), nresults+1);
++  }
++  else if (e->k == VVARARG) {
++    SETARG_B(getcode(fs, e), nresults+1);
++    SETARG_A(getcode(fs, e), fs->freereg);
++    luaK_reserveregs(fs, 1);
++  }
++}
++
++
++void luaK_setoneret (FuncState *fs, expdesc *e) {
++  if (e->k == VCALL) {  /* expression is an open function call? */
++    e->k = VNONRELOC;
++    e->u.s.info = GETARG_A(getcode(fs, e));
++  }
++  else if (e->k == VVARARG) {
++    SETARG_B(getcode(fs, e), 2);
++    e->k = VRELOCABLE;  /* can relocate its simple result */
++  }
++}
++
++
++void luaK_dischargevars (FuncState *fs, expdesc *e) {
++  switch (e->k) {
++    case VLOCAL: {
++      e->k = VNONRELOC;
++      break;
++    }
++    case VUPVAL: {
++      e->u.s.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.s.info, 0);
++      e->k = VRELOCABLE;
++      break;
++    }
++    case VGLOBAL: {
++      e->u.s.info = luaK_codeABx(fs, OP_GETGLOBAL, 0, e->u.s.info);
++      e->k = VRELOCABLE;
++      break;
++    }
++    case VINDEXED: {
++      freereg(fs, e->u.s.aux);
++      freereg(fs, e->u.s.info);
++      e->u.s.info = luaK_codeABC(fs, OP_GETTABLE, 0, e->u.s.info, e->u.s.aux);
++      e->k = VRELOCABLE;
++      break;
++    }
++    case VVARARG:
++    case VCALL: {
++      luaK_setoneret(fs, e);
++      break;
++    }
++    default: break;  /* there is one value available (somewhere) */
++  }
++}
++
++
++static int code_label (FuncState *fs, int A, int b, int jump) {
++  luaK_getlabel(fs);  /* those instructions may be jump targets */
++  return luaK_codeABC(fs, OP_LOADBOOL, A, b, jump);
++}
++
++
++static void discharge2reg (FuncState *fs, expdesc *e, int reg) {
++  luaK_dischargevars(fs, e);
++  switch (e->k) {
++    case VNIL: {
++      luaK_nil(fs, reg, 1);
++      break;
++    }
++    case VFALSE:  case VTRUE: {
++      luaK_codeABC(fs, OP_LOADBOOL, reg, e->k == VTRUE, 0);
++      break;
++    }
++    case VK: {
++      luaK_codeABx(fs, OP_LOADK, reg, e->u.s.info);
++      break;
++    }
++    case VKNUM: {
++      luaK_codeABx(fs, OP_LOADK, reg, luaK_numberK(fs, e->u.nval));
++      break;
++    }
++    case VRELOCABLE: {
++      Instruction *pc = &getcode(fs, e);
++      SETARG_A(*pc, reg);
++      break;
++    }
++    case VNONRELOC: {
++      if (reg != e->u.s.info)
++        luaK_codeABC(fs, OP_MOVE, reg, e->u.s.info, 0);
++      break;
++    }
++    default: {
++      lua_assert(e->k == VVOID || e->k == VJMP);
++      return;  /* nothing to do... */
++    }
++  }
++  e->u.s.info = reg;
++  e->k = VNONRELOC;
++}
++
++
++static void discharge2anyreg (FuncState *fs, expdesc *e) {
++  if (e->k != VNONRELOC) {
++    luaK_reserveregs(fs, 1);
++    discharge2reg(fs, e, fs->freereg-1);
++  }
++}
++
++
++static void exp2reg (FuncState *fs, expdesc *e, int reg) {
++  discharge2reg(fs, e, reg);
++  if (e->k == VJMP)
++    luaK_concat(fs, &e->t, e->u.s.info);  /* put this jump in `t' list */
++  if (hasjumps(e)) {
++    int final;  /* position after whole expression */
++    int p_f = NO_JUMP;  /* position of an eventual LOAD false */
++    int p_t = NO_JUMP;  /* position of an eventual LOAD true */
++    if (need_value(fs, e->t) || need_value(fs, e->f)) {
++      int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs);
++      p_f = code_label(fs, reg, 0, 1);
++      p_t = code_label(fs, reg, 1, 0);
++      luaK_patchtohere(fs, fj);
++    }
++    final = luaK_getlabel(fs);
++    patchlistaux(fs, e->f, final, reg, p_f);
++    patchlistaux(fs, e->t, final, reg, p_t);
++  }
++  e->f = e->t = NO_JUMP;
++  e->u.s.info = reg;
++  e->k = VNONRELOC;
++}
++
++
++void luaK_exp2nextreg (FuncState *fs, expdesc *e) {
++  luaK_dischargevars(fs, e);
++  freeexp(fs, e);
++  luaK_reserveregs(fs, 1);
++  exp2reg(fs, e, fs->freereg - 1);
++}
++
++
++int luaK_exp2anyreg (FuncState *fs, expdesc *e) {
++  luaK_dischargevars(fs, e);
++  if (e->k == VNONRELOC) {
++    if (!hasjumps(e)) return e->u.s.info;  /* exp is already in a register */
++    if (e->u.s.info >= fs->nactvar) {  /* reg. is not a local? */
++      exp2reg(fs, e, e->u.s.info);  /* put value on it */
++      return e->u.s.info;
++    }
++  }
++  luaK_exp2nextreg(fs, e);  /* default */
++  return e->u.s.info;
++}
++
++
++void luaK_exp2val (FuncState *fs, expdesc *e) {
++  if (hasjumps(e))
++    luaK_exp2anyreg(fs, e);
++  else
++    luaK_dischargevars(fs, e);
++}
++
++
++int luaK_exp2RK (FuncState *fs, expdesc *e) {
++  luaK_exp2val(fs, e);
++  switch (e->k) {
++    case VKNUM:
++    case VTRUE:
++    case VFALSE:
++    case VNIL: {
++      if (fs->nk <= MAXINDEXRK) {  /* constant fit in RK operand? */
++        e->u.s.info = (e->k == VNIL)  ? nilK(fs) :
++                      (e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) :
++                                        boolK(fs, (e->k == VTRUE));
++        e->k = VK;
++        return RKASK(e->u.s.info);
++      }
++      else break;
++    }
++    case VK: {
++      if (e->u.s.info <= MAXINDEXRK)  /* constant fit in argC? */
++        return RKASK(e->u.s.info);
++      else break;
++    }
++    default: break;
++  }
++  /* not a constant in the right range: put it in a register */
++  return luaK_exp2anyreg(fs, e);
++}
++
++
++void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) {
++  switch (var->k) {
++    case VLOCAL: {
++      freeexp(fs, ex);
++      exp2reg(fs, ex, var->u.s.info);
++      return;
++    }
++    case VUPVAL: {
++      int e = luaK_exp2anyreg(fs, ex);
++      luaK_codeABC(fs, OP_SETUPVAL, e, var->u.s.info, 0);
++      break;
++    }
++    case VGLOBAL: {
++      int e = luaK_exp2anyreg(fs, ex);
++      luaK_codeABx(fs, OP_SETGLOBAL, e, var->u.s.info);
++      break;
++    }
++    case VINDEXED: {
++      int e = luaK_exp2RK(fs, ex);
++      luaK_codeABC(fs, OP_SETTABLE, var->u.s.info, var->u.s.aux, e);
++      break;
++    }
++    default: {
++      lua_assert(0);  /* invalid var kind to store */
++      break;
++    }
++  }
++  freeexp(fs, ex);
++}
++
++
++void luaK_self (FuncState *fs, expdesc *e, expdesc *key) {
++  int func;
++  luaK_exp2anyreg(fs, e);
++  freeexp(fs, e);
++  func = fs->freereg;
++  luaK_reserveregs(fs, 2);
++  luaK_codeABC(fs, OP_SELF, func, e->u.s.info, luaK_exp2RK(fs, key));
++  freeexp(fs, key);
++  e->u.s.info = func;
++  e->k = VNONRELOC;
++}
++
++
++static void invertjump (FuncState *fs, expdesc *e) {
++  Instruction *pc = getjumpcontrol(fs, e->u.s.info);
++  lua_assert(testTMode(GET_OPCODE(*pc)) && GET_OPCODE(*pc) != OP_TESTSET &&
++                                           GET_OPCODE(*pc) != OP_TEST);
++  SETARG_A(*pc, !(GETARG_A(*pc)));
++}
++
++
++static int jumponcond (FuncState *fs, expdesc *e, int cond) {
++  if (e->k == VRELOCABLE) {
++    Instruction ie = getcode(fs, e);
++    if (GET_OPCODE(ie) == OP_NOT) {
++      fs->pc--;  /* remove previous OP_NOT */
++      return condjump(fs, OP_TEST, GETARG_B(ie), 0, !cond);
++    }
++    /* else go through */
++  }
++  discharge2anyreg(fs, e);
++  freeexp(fs, e);
++  return condjump(fs, OP_TESTSET, NO_REG, e->u.s.info, cond);
++}
++
++
++void luaK_goiftrue (FuncState *fs, expdesc *e) {
++  int pc;  /* pc of last jump */
++  luaK_dischargevars(fs, e);
++  switch (e->k) {
++    case VK: case VKNUM: case VTRUE: {
++      pc = NO_JUMP;  /* always true; do nothing */
++      break;
++    }
++    case VFALSE: {
++      pc = luaK_jump(fs);  /* always jump */
++      break;
++    }
++    case VJMP: {
++      invertjump(fs, e);
++      pc = e->u.s.info;
++      break;
++    }
++    default: {
++      pc = jumponcond(fs, e, 0);
++      break;
++    }
++  }
++  luaK_concat(fs, &e->f, pc);  /* insert last jump in `f' list */
++  luaK_patchtohere(fs, e->t);
++  e->t = NO_JUMP;
++}
++
++
++static void luaK_goiffalse (FuncState *fs, expdesc *e) {
++  int pc;  /* pc of last jump */
++  luaK_dischargevars(fs, e);
++  switch (e->k) {
++    case VNIL: case VFALSE: {
++      pc = NO_JUMP;  /* always false; do nothing */
++      break;
++    }
++    case VTRUE: {
++      pc = luaK_jump(fs);  /* always jump */
++      break;
++    }
++    case VJMP: {
++      pc = e->u.s.info;
++      break;
++    }
++    default: {
++      pc = jumponcond(fs, e, 1);
++      break;
++    }
++  }
++  luaK_concat(fs, &e->t, pc);  /* insert last jump in `t' list */
++  luaK_patchtohere(fs, e->f);
++  e->f = NO_JUMP;
++}
++
++
++static void codenot (FuncState *fs, expdesc *e) {
++  luaK_dischargevars(fs, e);
++  switch (e->k) {
++    case VNIL: case VFALSE: {
++      e->k = VTRUE;
++      break;
++    }
++    case VK: case VKNUM: case VTRUE: {
++      e->k = VFALSE;
++      break;
++    }
++    case VJMP: {
++      invertjump(fs, e);
++      break;
++    }
++    case VRELOCABLE:
++    case VNONRELOC: {
++      discharge2anyreg(fs, e);
++      freeexp(fs, e);
++      e->u.s.info = luaK_codeABC(fs, OP_NOT, 0, e->u.s.info, 0);
++      e->k = VRELOCABLE;
++      break;
++    }
++    default: {
++      lua_assert(0);  /* cannot happen */
++      break;
++    }
++  }
++  /* interchange true and false lists */
++  { int temp = e->f; e->f = e->t; e->t = temp; }
++  removevalues(fs, e->f);
++  removevalues(fs, e->t);
++}
++
++
++void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) {
++  t->u.s.aux = luaK_exp2RK(fs, k);
++  t->k = VINDEXED;
++}
++
++
++static int constfolding (OpCode op, expdesc *e1, expdesc *e2) {
++  lua_Number v1, v2, r;
++  if (!isnumeral(e1) || !isnumeral(e2)) return 0;
++  v1 = e1->u.nval;
++  v2 = e2->u.nval;
++  switch (op) {
++    case OP_ADD: r = luai_numadd(v1, v2); break;
++    case OP_SUB: r = luai_numsub(v1, v2); break;
++    case OP_MUL: r = luai_nummul(v1, v2); break;
++    case OP_DIV:
++      if (v2 == 0) return 0;  /* do not attempt to divide by 0 */
++      r = luai_numdiv(v1, v2); break;
++    case OP_MOD:
++      if (v2 == 0) return 0;  /* do not attempt to divide by 0 */
++      r = luai_nummod(v1, v2); break;
++    case OP_POW: r = luai_numpow(v1, v2); break;
++    case OP_UNM: r = luai_numunm(v1); break;
++    case OP_LEN: return 0;  /* no constant folding for 'len' */
++    default: lua_assert(0); r = 0; break;
++  }
++  if (luai_numisnan(r)) return 0;  /* do not attempt to produce NaN */
++  e1->u.nval = r;
++  return 1;
++}
++
++
++static void codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) {
++  if (constfolding(op, e1, e2))
++    return;
++  else {
++    int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0;
++    int o1 = luaK_exp2RK(fs, e1);
++    if (o1 > o2) {
++      freeexp(fs, e1);
++      freeexp(fs, e2);
++    }
++    else {
++      freeexp(fs, e2);
++      freeexp(fs, e1);
++    }
++    e1->u.s.info = luaK_codeABC(fs, op, 0, o1, o2);
++    e1->k = VRELOCABLE;
++  }
++}
++
++
++static void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1,
++                                                          expdesc *e2) {
++  int o1 = luaK_exp2RK(fs, e1);
++  int o2 = luaK_exp2RK(fs, e2);
++  freeexp(fs, e2);
++  freeexp(fs, e1);
++  if (cond == 0 && op != OP_EQ) {
++    int temp;  /* exchange args to replace by `<' or `<=' */
++    temp = o1; o1 = o2; o2 = temp;  /* o1 <==> o2 */
++    cond = 1;
++  }
++  e1->u.s.info = condjump(fs, op, cond, o1, o2);
++  e1->k = VJMP;
++}
++
++
++void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) {
++  expdesc e2;
++  e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0;
++  switch (op) {
++    case OPR_MINUS: {
++      if (!isnumeral(e))
++        luaK_exp2anyreg(fs, e);  /* cannot operate on non-numeric constants */
++      codearith(fs, OP_UNM, e, &e2);
++      break;
++    }
++    case OPR_NOT: codenot(fs, e); break;
++    case OPR_LEN: {
++      luaK_exp2anyreg(fs, e);  /* cannot operate on constants */
++      codearith(fs, OP_LEN, e, &e2);
++      break;
++    }
++    default: lua_assert(0);
++  }
++}
++
++
++void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) {
++  switch (op) {
++    case OPR_AND: {
++      luaK_goiftrue(fs, v);
++      break;
++    }
++    case OPR_OR: {
++      luaK_goiffalse(fs, v);
++      break;
++    }
++    case OPR_CONCAT: {
++      luaK_exp2nextreg(fs, v);  /* operand must be on the `stack' */
++      break;
++    }
++    case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV:
++    case OPR_MOD: case OPR_POW: {
++      if (!isnumeral(v)) luaK_exp2RK(fs, v);
++      break;
++    }
++    default: {
++      luaK_exp2RK(fs, v);
++      break;
++    }
++  }
++}
++
++
++void luaK_posfix (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2) {
++  switch (op) {
++    case OPR_AND: {
++      lua_assert(e1->t == NO_JUMP);  /* list must be closed */
++      luaK_dischargevars(fs, e2);
++      luaK_concat(fs, &e2->f, e1->f);
++      *e1 = *e2;
++      break;
++    }
++    case OPR_OR: {
++      lua_assert(e1->f == NO_JUMP);  /* list must be closed */
++      luaK_dischargevars(fs, e2);
++      luaK_concat(fs, &e2->t, e1->t);
++      *e1 = *e2;
++      break;
++    }
++    case OPR_CONCAT: {
++      luaK_exp2val(fs, e2);
++      if (e2->k == VRELOCABLE && GET_OPCODE(getcode(fs, e2)) == OP_CONCAT) {
++        lua_assert(e1->u.s.info == GETARG_B(getcode(fs, e2))-1);
++        freeexp(fs, e1);
++        SETARG_B(getcode(fs, e2), e1->u.s.info);
++        e1->k = VRELOCABLE; e1->u.s.info = e2->u.s.info;
++      }
++      else {
++        luaK_exp2nextreg(fs, e2);  /* operand must be on the 'stack' */
++        codearith(fs, OP_CONCAT, e1, e2);
++      }
++      break;
++    }
++    case OPR_ADD: codearith(fs, OP_ADD, e1, e2); break;
++    case OPR_SUB: codearith(fs, OP_SUB, e1, e2); break;
++    case OPR_MUL: codearith(fs, OP_MUL, e1, e2); break;
++    case OPR_DIV: codearith(fs, OP_DIV, e1, e2); break;
++    case OPR_MOD: codearith(fs, OP_MOD, e1, e2); break;
++    case OPR_POW: codearith(fs, OP_POW, e1, e2); break;
++    case OPR_EQ: codecomp(fs, OP_EQ, 1, e1, e2); break;
++    case OPR_NE: codecomp(fs, OP_EQ, 0, e1, e2); break;
++    case OPR_LT: codecomp(fs, OP_LT, 1, e1, e2); break;
++    case OPR_LE: codecomp(fs, OP_LE, 1, e1, e2); break;
++    case OPR_GT: codecomp(fs, OP_LT, 0, e1, e2); break;
++    case OPR_GE: codecomp(fs, OP_LE, 0, e1, e2); break;
++    default: lua_assert(0);
++  }
++}
++
++
++void luaK_fixline (FuncState *fs, int line) {
++  fs->f->lineinfo[fs->pc - 1] = line;
++}
++
++
++static int luaK_code (FuncState *fs, Instruction i, int line) {
++  Proto *f = fs->f;
++  dischargejpc(fs);  /* `pc' will change */
++  /* put new instruction in code array */
++  luaM_growvector(fs->L, f->code, fs->pc, f->sizecode, Instruction,
++                  MAX_INT, "code size overflow");
++  f->code[fs->pc] = i;
++  /* save corresponding line information */
++  luaM_growvector(fs->L, f->lineinfo, fs->pc, f->sizelineinfo, int,
++                  MAX_INT, "code size overflow");
++  f->lineinfo[fs->pc] = line;
++  return fs->pc++;
++}
++
++
++int luaK_codeABC (FuncState *fs, OpCode o, int a, int b, int c) {
++  lua_assert(getOpMode(o) == iABC);
++  lua_assert(getBMode(o) != OpArgN || b == 0);
++  lua_assert(getCMode(o) != OpArgN || c == 0);
++  return luaK_code(fs, CREATE_ABC(o, a, b, c), fs->ls->lastline);
++}
++
++
++int luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc) {
++  lua_assert(getOpMode(o) == iABx || getOpMode(o) == iAsBx);
++  lua_assert(getCMode(o) == OpArgN);
++  return luaK_code(fs, CREATE_ABx(o, a, bc), fs->ls->lastline);
++}
++
++
++void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) {
++  int c =  (nelems - 1)/LFIELDS_PER_FLUSH + 1;
++  int b = (tostore == LUA_MULTRET) ? 0 : tostore;
++  lua_assert(tostore != 0);
++  if (c <= MAXARG_C)
++    luaK_codeABC(fs, OP_SETLIST, base, b, c);
++  else {
++    luaK_codeABC(fs, OP_SETLIST, base, b, 0);
++    luaK_code(fs, cast(Instruction, c), fs->ls->lastline);
++  }
++  fs->freereg = base + 1;  /* free registers with list values */
++}
++
+--- /dev/null
++++ b/extensions/LUA/lua/lcode.h
+@@ -0,0 +1,76 @@
++/*
++** $Id: lcode.h,v 1.48.1.1 2007/12/27 13:02:25 roberto Exp $
++** Code generator for Lua
++** See Copyright Notice in lua.h
++*/
++
++#ifndef lcode_h
++#define lcode_h
++
++#include "llex.h"
++#include "lobject.h"
++#include "lopcodes.h"
++#include "lparser.h"
++
++
++/*
++** Marks the end of a patch list. It is an invalid value both as an absolute
++** address, and as a list link (would link an element to itself).
++*/
++#define NO_JUMP (-1)
++
++
++/*
++** grep "ORDER OPR" if you change these enums
++*/
++typedef enum BinOpr {
++  OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW,
++  OPR_CONCAT,
++  OPR_NE, OPR_EQ,
++  OPR_LT, OPR_LE, OPR_GT, OPR_GE,
++  OPR_AND, OPR_OR,
++  OPR_NOBINOPR
++} BinOpr;
++
++
++typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr;
++
++
++#define getcode(fs,e) ((fs)->f->code[(e)->u.s.info])
++
++#define luaK_codeAsBx(fs,o,A,sBx)     luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx)
++
++#define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET)
++
++LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx);
++LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C);
++LUAI_FUNC void luaK_fixline (FuncState *fs, int line);
++LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n);
++LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n);
++LUAI_FUNC void luaK_checkstack (FuncState *fs, int n);
++LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s);
++LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r);
++LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e);
++LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e);
++LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e);
++LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e);
++LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e);
++LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key);
++LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k);
++LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e);
++LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e);
++LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults);
++LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e);
++LUAI_FUNC int luaK_jump (FuncState *fs);
++LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret);
++LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target);
++LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list);
++LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2);
++LUAI_FUNC int luaK_getlabel (FuncState *fs);
++LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v);
++LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v);
++LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2);
++LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore);
++
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/ldebug.c
+@@ -0,0 +1,637 @@
++/*
++** $Id: ldebug.c,v 2.29.1.6 2008/05/08 16:56:26 roberto Exp $
++** Debug Interface
++** See Copyright Notice in lua.h
++*/
++
++
++#include <stdarg.h>
++#include <stddef.h>
++#include <string.h>
++
++#define ldebug_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "lapi.h"
++#include "lcode.h"
++#include "ldebug.h"
++#include "ldo.h"
++#include "lfunc.h"
++#include "lobject.h"
++#include "lopcodes.h"
++#include "lstate.h"
++#include "lstring.h"
++#include "ltable.h"
++#include "ltm.h"
++#include "lvm.h"
++
++
++
++static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name);
++
++
++static int currentpc (lua_State *L, CallInfo *ci) {
++  if (!isLua(ci)) return -1;  /* function is not a Lua function? */
++  if (ci == L->ci)
++    ci->savedpc = L->savedpc;
++  return pcRel(ci->savedpc, ci_func(ci)->l.p);
++}
++
++
++static int currentline (lua_State *L, CallInfo *ci) {
++  int pc = currentpc(L, ci);
++  if (pc < 0)
++    return -1;  /* only active lua functions have current-line information */
++  else
++    return getline(ci_func(ci)->l.p, pc);
++}
++
++
++/*
++** this function can be called asynchronous (e.g. during a signal)
++*/
++LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) {
++  if (func == NULL || mask == 0) {  /* turn off hooks? */
++    mask = 0;
++    func = NULL;
++  }
++  L->hook = func;
++  L->basehookcount = count;
++  resethookcount(L);
++  L->hookmask = cast_byte(mask);
++  return 1;
++}
++
++
++LUA_API lua_Hook lua_gethook (lua_State *L) {
++  return L->hook;
++}
++
++
++LUA_API int lua_gethookmask (lua_State *L) {
++  return L->hookmask;
++}
++
++
++LUA_API int lua_gethookcount (lua_State *L) {
++  return L->basehookcount;
++}
++
++
++LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) {
++  int status;
++  CallInfo *ci;
++  lua_lock(L);
++  for (ci = L->ci; level > 0 && ci > L->base_ci; ci--) {
++    level--;
++    if (f_isLua(ci))  /* Lua function? */
++      level -= ci->tailcalls;  /* skip lost tail calls */
++  }
++  if (level == 0 && ci > L->base_ci) {  /* level found? */
++    status = 1;
++    ar->i_ci = cast_int(ci - L->base_ci);
++  }
++  else if (level < 0) {  /* level is of a lost tail call? */
++    status = 1;
++    ar->i_ci = 0;
++  }
++  else status = 0;  /* no such level */
++  lua_unlock(L);
++  return status;
++}
++
++
++static Proto *getluaproto (CallInfo *ci) {
++  return (isLua(ci) ? ci_func(ci)->l.p : NULL);
++}
++
++
++static const char *findlocal (lua_State *L, CallInfo *ci, int n) {
++  const char *name;
++  Proto *fp = getluaproto(ci);
++  if (fp && (name = luaF_getlocalname(fp, n, currentpc(L, ci))) != NULL)
++    return name;  /* is a local variable in a Lua function */
++  else {
++    StkId limit = (ci == L->ci) ? L->top : (ci+1)->func;
++    if (limit - ci->base >= n && n > 0)  /* is 'n' inside 'ci' stack? */
++      return "(*temporary)";
++    else
++      return NULL;
++  }
++}
++
++
++LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) {
++  CallInfo *ci = L->base_ci + ar->i_ci;
++  const char *name = findlocal(L, ci, n);
++  lua_lock(L);
++  if (name)
++      luaA_pushobject(L, ci->base + (n - 1));
++  lua_unlock(L);
++  return name;
++}
++
++
++LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) {
++  CallInfo *ci = L->base_ci + ar->i_ci;
++  const char *name = findlocal(L, ci, n);
++  lua_lock(L);
++  if (name)
++      setobjs2s(L, ci->base + (n - 1), L->top - 1);
++  L->top--;  /* pop value */
++  lua_unlock(L);
++  return name;
++}
++
++
++static void funcinfo (lua_Debug *ar, Closure *cl) {
++  if (cl->c.isC) {
++    ar->source = "=[C]";
++    ar->linedefined = -1;
++    ar->lastlinedefined = -1;
++    ar->what = "C";
++  }
++  else {
++    ar->source = getstr(cl->l.p->source);
++    ar->linedefined = cl->l.p->linedefined;
++    ar->lastlinedefined = cl->l.p->lastlinedefined;
++    ar->what = (ar->linedefined == 0) ? "main" : "Lua";
++  }
++  luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE);
++}
++
++
++static void info_tailcall (lua_Debug *ar) {
++  ar->name = ar->namewhat = "";
++  ar->what = "tail";
++  ar->lastlinedefined = ar->linedefined = ar->currentline = -1;
++  ar->source = "=(tail call)";
++  luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE);
++  ar->nups = 0;
++}
++
++
++static void collectvalidlines (lua_State *L, Closure *f) {
++  if (f == NULL || f->c.isC) {
++    setnilvalue(L->top);
++  }
++  else {
++    Table *t = luaH_new(L, 0, 0);
++    int *lineinfo = f->l.p->lineinfo;
++    int i;
++    for (i=0; i<f->l.p->sizelineinfo; i++)
++      setbvalue(luaH_setnum(L, t, lineinfo[i]), 1);
++    sethvalue(L, L->top, t); 
++  }
++  incr_top(L);
++}
++
++
++static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar,
++                    Closure *f, CallInfo *ci) {
++  int status = 1;
++  if (f == NULL) {
++    info_tailcall(ar);
++    return status;
++  }
++  for (; *what; what++) {
++    switch (*what) {
++      case 'S': {
++        funcinfo(ar, f);
++        break;
++      }
++      case 'l': {
++        ar->currentline = (ci) ? currentline(L, ci) : -1;
++        break;
++      }
++      case 'u': {
++        ar->nups = f->c.nupvalues;
++        break;
++      }
++      case 'n': {
++        ar->namewhat = (ci) ? getfuncname(L, ci, &ar->name) : NULL;
++        if (ar->namewhat == NULL) {
++          ar->namewhat = "";  /* not found */
++          ar->name = NULL;
++        }
++        break;
++      }
++      case 'L':
++      case 'f':  /* handled by lua_getinfo */
++        break;
++      default: status = 0;  /* invalid option */
++    }
++  }
++  return status;
++}
++
++
++LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
++  int status;
++  Closure *f = NULL;
++  CallInfo *ci = NULL;
++  lua_lock(L);
++  if (*what == '>') {
++    StkId func = L->top - 1;
++    luai_apicheck(L, ttisfunction(func));
++    what++;  /* skip the '>' */
++    f = clvalue(func);
++    L->top--;  /* pop function */
++  }
++  else if (ar->i_ci != 0) {  /* no tail call? */
++    ci = L->base_ci + ar->i_ci;
++    lua_assert(ttisfunction(ci->func));
++    f = clvalue(ci->func);
++  }
++  status = auxgetinfo(L, what, ar, f, ci);
++  if (strchr(what, 'f')) {
++    if (f == NULL) setnilvalue(L->top);
++    else setclvalue(L, L->top, f);
++    incr_top(L);
++  }
++  if (strchr(what, 'L'))
++    collectvalidlines(L, f);
++  lua_unlock(L);
++  return status;
++}
++
++
++/*
++** {======================================================
++** Symbolic Execution and code checker
++** =======================================================
++*/
++
++#define check(x)              if (!(x)) return 0;
++
++#define checkjump(pt,pc)      check(0 <= pc && pc < pt->sizecode)
++
++#define checkreg(pt,reg)      check((reg) < (pt)->maxstacksize)
++
++
++
++static int precheck (const Proto *pt) {
++  check(pt->maxstacksize <= MAXSTACK);
++  check(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize);
++  check(!(pt->is_vararg & VARARG_NEEDSARG) ||
++              (pt->is_vararg & VARARG_HASARG));
++  check(pt->sizeupvalues <= pt->nups);
++  check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0);
++  check(pt->sizecode > 0 && GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN);
++  return 1;
++}
++
++
++#define checkopenop(pt,pc)    luaG_checkopenop((pt)->code[(pc)+1])
++
++int luaG_checkopenop (Instruction i) {
++  switch (GET_OPCODE(i)) {
++    case OP_CALL:
++    case OP_TAILCALL:
++    case OP_RETURN:
++    case OP_SETLIST: {
++      check(GETARG_B(i) == 0);
++      return 1;
++    }
++    default: return 0;  /* invalid instruction after an open call */
++  }
++}
++
++
++static int checkArgMode (const Proto *pt, int r, enum OpArgMask mode) {
++  switch (mode) {
++    case OpArgN: check(r == 0); break;
++    case OpArgU: break;
++    case OpArgR: checkreg(pt, r); break;
++    case OpArgK:
++      check(ISK(r) ? INDEXK(r) < pt->sizek : r < pt->maxstacksize);
++      break;
++  }
++  return 1;
++}
++
++
++static Instruction symbexec (const Proto *pt, int lastpc, int reg) {
++  int pc;
++  int last;  /* stores position of last instruction that changed `reg' */
++  last = pt->sizecode-1;  /* points to final return (a `neutral' instruction) */
++  check(precheck(pt));
++  for (pc = 0; pc < lastpc; pc++) {
++    Instruction i = pt->code[pc];
++    OpCode op = GET_OPCODE(i);
++    int a = GETARG_A(i);
++    int b = 0;
++    int c = 0;
++    check(op < NUM_OPCODES);
++    checkreg(pt, a);
++    switch (getOpMode(op)) {
++      case iABC: {
++        b = GETARG_B(i);
++        c = GETARG_C(i);
++        check(checkArgMode(pt, b, getBMode(op)));
++        check(checkArgMode(pt, c, getCMode(op)));
++        break;
++      }
++      case iABx: {
++        b = GETARG_Bx(i);
++        if (getBMode(op) == OpArgK) check(b < pt->sizek);
++        break;
++      }
++      case iAsBx: {
++        b = GETARG_sBx(i);
++        if (getBMode(op) == OpArgR) {
++          int dest = pc+1+b;
++          check(0 <= dest && dest < pt->sizecode);
++          if (dest > 0) {
++            int j;
++            /* check that it does not jump to a setlist count; this
++               is tricky, because the count from a previous setlist may
++               have the same value of an invalid setlist; so, we must
++               go all the way back to the first of them (if any) */
++            for (j = 0; j < dest; j++) {
++              Instruction d = pt->code[dest-1-j];
++              if (!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0)) break;
++            }
++            /* if 'j' is even, previous value is not a setlist (even if
++               it looks like one) */
++            check((j&1) == 0);
++          }
++        }
++        break;
++      }
++    }
++    if (testAMode(op)) {
++      if (a == reg) last = pc;  /* change register `a' */
++    }
++    if (testTMode(op)) {
++      check(pc+2 < pt->sizecode);  /* check skip */
++      check(GET_OPCODE(pt->code[pc+1]) == OP_JMP);
++    }
++    switch (op) {
++      case OP_LOADBOOL: {
++        if (c == 1) {  /* does it jump? */
++          check(pc+2 < pt->sizecode);  /* check its jump */
++          check(GET_OPCODE(pt->code[pc+1]) != OP_SETLIST ||
++                GETARG_C(pt->code[pc+1]) != 0);
++        }
++        break;
++      }
++      case OP_LOADNIL: {
++        if (a <= reg && reg <= b)
++          last = pc;  /* set registers from `a' to `b' */
++        break;
++      }
++      case OP_GETUPVAL:
++      case OP_SETUPVAL: {
++        check(b < pt->nups);
++        break;
++      }
++      case OP_GETGLOBAL:
++      case OP_SETGLOBAL: {
++        check(ttisstring(&pt->k[b]));
++        break;
++      }
++      case OP_SELF: {
++        checkreg(pt, a+1);
++        if (reg == a+1) last = pc;
++        break;
++      }
++      case OP_CONCAT: {
++        check(b < c);  /* at least two operands */
++        break;
++      }
++      case OP_TFORLOOP: {
++        check(c >= 1);  /* at least one result (control variable) */
++        checkreg(pt, a+2+c);  /* space for results */
++        if (reg >= a+2) last = pc;  /* affect all regs above its base */
++        break;
++      }
++      case OP_FORLOOP:
++      case OP_FORPREP:
++        checkreg(pt, a+3);
++        /* go through */
++      case OP_JMP: {
++        int dest = pc+1+b;
++        /* not full check and jump is forward and do not skip `lastpc'? */
++        if (reg != NO_REG && pc < dest && dest <= lastpc)
++          pc += b;  /* do the jump */
++        break;
++      }
++      case OP_CALL:
++      case OP_TAILCALL: {
++        if (b != 0) {
++          checkreg(pt, a+b-1);
++        }
++        c--;  /* c = num. returns */
++        if (c == LUA_MULTRET) {
++          check(checkopenop(pt, pc));
++        }
++        else if (c != 0)
++          checkreg(pt, a+c-1);
++        if (reg >= a) last = pc;  /* affect all registers above base */
++        break;
++      }
++      case OP_RETURN: {
++        b--;  /* b = num. returns */
++        if (b > 0) checkreg(pt, a+b-1);
++        break;
++      }
++      case OP_SETLIST: {
++        if (b > 0) checkreg(pt, a + b);
++        if (c == 0) {
++          pc++;
++          check(pc < pt->sizecode - 1);
++        }
++        break;
++      }
++      case OP_CLOSURE: {
++        int nup, j;
++        check(b < pt->sizep);
++        nup = pt->p[b]->nups;
++        check(pc + nup < pt->sizecode);
++        for (j = 1; j <= nup; j++) {
++          OpCode op1 = GET_OPCODE(pt->code[pc + j]);
++          check(op1 == OP_GETUPVAL || op1 == OP_MOVE);
++        }
++        if (reg != NO_REG)  /* tracing? */
++          pc += nup;  /* do not 'execute' these pseudo-instructions */
++        break;
++      }
++      case OP_VARARG: {
++        check((pt->is_vararg & VARARG_ISVARARG) &&
++             !(pt->is_vararg & VARARG_NEEDSARG));
++        b--;
++        if (b == LUA_MULTRET) check(checkopenop(pt, pc));
++        checkreg(pt, a+b-1);
++        break;
++      }
++      default: break;
++    }
++  }
++  return pt->code[last];
++}
++
++#undef check
++#undef checkjump
++#undef checkreg
++
++/* }====================================================== */
++
++
++int luaG_checkcode (const Proto *pt) {
++  return (symbexec(pt, pt->sizecode, NO_REG) != 0);
++}
++
++
++static const char *kname (Proto *p, int c) {
++  if (ISK(c) && ttisstring(&p->k[INDEXK(c)]))
++    return svalue(&p->k[INDEXK(c)]);
++  else
++    return "?";
++}
++
++
++static const char *getobjname (lua_State *L, CallInfo *ci, int stackpos,
++                               const char **name) {
++  if (isLua(ci)) {  /* a Lua function? */
++    Proto *p = ci_func(ci)->l.p;
++    int pc = currentpc(L, ci);
++    Instruction i;
++    *name = luaF_getlocalname(p, stackpos+1, pc);
++    if (*name)  /* is a local? */
++      return "local";
++    i = symbexec(p, pc, stackpos);  /* try symbolic execution */
++    lua_assert(pc != -1);
++    switch (GET_OPCODE(i)) {
++      case OP_GETGLOBAL: {
++        int g = GETARG_Bx(i);  /* global index */
++        lua_assert(ttisstring(&p->k[g]));
++        *name = svalue(&p->k[g]);
++        return "global";
++      }
++      case OP_MOVE: {
++        int a = GETARG_A(i);
++        int b = GETARG_B(i);  /* move from `b' to `a' */
++        if (b < a)
++          return getobjname(L, ci, b, name);  /* get name for `b' */
++        break;
++      }
++      case OP_GETTABLE: {
++        int k = GETARG_C(i);  /* key index */
++        *name = kname(p, k);
++        return "field";
++      }
++      case OP_GETUPVAL: {
++        int u = GETARG_B(i);  /* upvalue index */
++        *name = p->upvalues ? getstr(p->upvalues[u]) : "?";
++        return "upvalue";
++      }
++      case OP_SELF: {
++        int k = GETARG_C(i);  /* key index */
++        *name = kname(p, k);
++        return "method";
++      }
++      default: break;
++    }
++  }
++  return NULL;  /* no useful name found */
++}
++
++
++static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) {
++  Instruction i;
++  if ((isLua(ci) && ci->tailcalls > 0) || !isLua(ci - 1))
++    return NULL;  /* calling function is not Lua (or is unknown) */
++  ci--;  /* calling function */
++  i = ci_func(ci)->l.p->code[currentpc(L, ci)];
++  if (GET_OPCODE(i) == OP_CALL || GET_OPCODE(i) == OP_TAILCALL ||
++      GET_OPCODE(i) == OP_TFORLOOP)
++    return getobjname(L, ci, GETARG_A(i), name);
++  else
++    return NULL;  /* no useful name can be found */
++}
++
++
++/* only ANSI way to check whether a pointer points to an array */
++static int isinstack (CallInfo *ci, const TValue *o) {
++  StkId p;
++  for (p = ci->base; p < ci->top; p++)
++    if (o == p) return 1;
++  return 0;
++}
++
++
++void luaG_typeerror (lua_State *L, const TValue *o, const char *op) {
++  const char *name = NULL;
++  const char *t = luaT_typenames[ttype(o)];
++  const char *kind = (isinstack(L->ci, o)) ?
++                         getobjname(L, L->ci, cast_int(o - L->base), &name) :
++                         NULL;
++  if (kind)
++    luaG_runerror(L, "attempt to %s %s " LUA_QS " (a %s value)",
++                op, kind, name, t);
++  else
++    luaG_runerror(L, "attempt to %s a %s value", op, t);
++}
++
++
++void luaG_concaterror (lua_State *L, StkId p1, StkId p2) {
++  if (ttisstring(p1) || ttisnumber(p1)) p1 = p2;
++  lua_assert(!ttisstring(p1) && !ttisnumber(p1));
++  luaG_typeerror(L, p1, "concatenate");
++}
++
++
++void luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2) {
++  TValue temp;
++  if (luaV_tonumber(p1, &temp) == NULL)
++    p2 = p1;  /* first operand is wrong */
++  luaG_typeerror(L, p2, "perform arithmetic on");
++}
++
++
++int luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2) {
++  const char *t1 = luaT_typenames[ttype(p1)];
++  const char *t2 = luaT_typenames[ttype(p2)];
++  if (t1[2] == t2[2])
++    luaG_runerror(L, "attempt to compare two %s values", t1);
++  else
++    luaG_runerror(L, "attempt to compare %s with %s", t1, t2);
++  return 0;
++}
++
++
++static void addinfo (lua_State *L, const char *msg) {
++  CallInfo *ci = L->ci;
++  if (isLua(ci)) {  /* is Lua code? */
++    char buff[LUA_IDSIZE];  /* add file:line information */
++    int line = currentline(L, ci);
++    luaO_chunkid(buff, getstr(getluaproto(ci)->source), LUA_IDSIZE);
++    luaO_pushfstring(L, "%s:%d: %s", buff, line, msg);
++  }
++}
++
++
++void luaG_errormsg (lua_State *L) {
++  if (L->errfunc != 0) {  /* is there an error handling function? */
++    StkId errfunc = restorestack(L, L->errfunc);
++    if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR);
++    setobjs2s(L, L->top, L->top - 1);  /* move argument */
++    setobjs2s(L, L->top - 1, errfunc);  /* push function */
++    incr_top(L);
++    luaD_call(L, L->top - 2, 1);  /* call it */
++  }
++  luaD_throw(L, LUA_ERRRUN);
++}
++
++
++void luaG_runerror (lua_State *L, const char *fmt, ...) {
++  va_list argp;
++  va_start(argp, fmt);
++  addinfo(L, luaO_pushvfstring(L, fmt, argp));
++  va_end(argp);
++  luaG_errormsg(L);
++}
++
+--- /dev/null
++++ b/extensions/LUA/lua/ldebug.h
+@@ -0,0 +1,33 @@
++/*
++** $Id: ldebug.h,v 2.3.1.1 2007/12/27 13:02:25 roberto Exp $
++** Auxiliary functions from Debug Interface module
++** See Copyright Notice in lua.h
++*/
++
++#ifndef ldebug_h
++#define ldebug_h
++
++
++#include "lstate.h"
++
++
++#define pcRel(pc, p)  (cast(int, (pc) - (p)->code) - 1)
++
++#define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
++
++#define resethookcount(L)     (L->hookcount = L->basehookcount)
++
++
++LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o,
++                                             const char *opname);
++LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2);
++LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1,
++                                              const TValue *p2);
++LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1,
++                                             const TValue *p2);
++LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...);
++LUAI_FUNC void luaG_errormsg (lua_State *L);
++LUAI_FUNC int luaG_checkcode (const Proto *pt);
++LUAI_FUNC int luaG_checkopenop (Instruction i);
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/ldo.c
+@@ -0,0 +1,515 @@
++/*
++** $Id: ldo.c,v 2.38.1.3 2008/01/18 22:31:22 roberto Exp $
++** Stack and Call structure of Lua
++** See Copyright Notice in lua.h
++*/
++
++#include <setjmp.h>
++#include <stdlib.h>
++#include <string.h>
++
++#define ldo_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "ldebug.h"
++#include "ldo.h"
++#include "lfunc.h"
++#include "lgc.h"
++#include "lmem.h"
++#include "lobject.h"
++#include "lopcodes.h"
++#include "lparser.h"
++#include "lstate.h"
++#include "lstring.h"
++#include "ltable.h"
++#include "ltm.h"
++#include "lundump.h"
++#include "lvm.h"
++#include "lzio.h"
++
++
++
++/*
++** {======================================================
++** Error-recovery functions
++** =======================================================
++*/
++
++
++/* chain list of long jump buffers */
++struct lua_longjmp {
++  struct lua_longjmp *previous;
++  luai_jmpbuf b;
++  volatile int status;  /* error code */
++};
++
++
++void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) {
++  switch (errcode) {
++    case LUA_ERRMEM: {
++      setsvalue2s(L, oldtop, luaS_newliteral(L, MEMERRMSG));
++      break;
++    }
++    case LUA_ERRERR: {
++      setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling"));
++      break;
++    }
++    case LUA_ERRSYNTAX:
++    case LUA_ERRRUN: {
++      setobjs2s(L, oldtop, L->top - 1);  /* error message on current top */
++      break;
++    }
++  }
++  L->top = oldtop + 1;
++}
++
++
++static void restore_stack_limit (lua_State *L) {
++  lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1);
++  if (L->size_ci > LUAI_MAXCALLS) {  /* there was an overflow? */
++    int inuse = cast_int(L->ci - L->base_ci);
++    if (inuse + 1 < LUAI_MAXCALLS)  /* can `undo' overflow? */
++      luaD_reallocCI(L, LUAI_MAXCALLS);
++  }
++}
++
++
++static void resetstack (lua_State *L, int status) {
++  L->ci = L->base_ci;
++  L->base = L->ci->base;
++  luaF_close(L, L->base);  /* close eventual pending closures */
++  luaD_seterrorobj(L, status, L->base);
++  L->nCcalls = L->baseCcalls;
++  L->allowhook = 1;
++  restore_stack_limit(L);
++  L->errfunc = 0;
++  L->errorJmp = NULL;
++}
++
++
++void luaD_throw (lua_State *L, int errcode) {
++  if (L->errorJmp) {
++    L->errorJmp->status = errcode;
++    LUAI_THROW(L, L->errorJmp);
++  }
++  else {
++    L->status = cast_byte(errcode);
++    if (G(L)->panic) {
++      resetstack(L, errcode);
++      lua_unlock(L);
++      G(L)->panic(L);
++    }
++    exit(EXIT_FAILURE);
++  }
++}
++
++
++int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {
++  struct lua_longjmp lj;
++  lj.status = 0;
++  lj.previous = L->errorJmp;  /* chain new error handler */
++  L->errorJmp = &lj;
++  LUAI_TRY(L, &lj,
++    (*f)(L, ud);
++  );
++  L->errorJmp = lj.previous;  /* restore old error handler */
++  return lj.status;
++}
++
++/* }====================================================== */
++
++
++static void correctstack (lua_State *L, TValue *oldstack) {
++  CallInfo *ci;
++  GCObject *up;
++  L->top = (L->top - oldstack) + L->stack;
++  for (up = L->openupval; up != NULL; up = up->gch.next)
++    gco2uv(up)->v = (gco2uv(up)->v - oldstack) + L->stack;
++  for (ci = L->base_ci; ci <= L->ci; ci++) {
++    ci->top = (ci->top - oldstack) + L->stack;
++    ci->base = (ci->base - oldstack) + L->stack;
++    ci->func = (ci->func - oldstack) + L->stack;
++  }
++  L->base = (L->base - oldstack) + L->stack;
++}
++
++
++void luaD_reallocstack (lua_State *L, int newsize) {
++  TValue *oldstack = L->stack;
++  int realsize = newsize + 1 + EXTRA_STACK;
++  lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1);
++  luaM_reallocvector(L, L->stack, L->stacksize, realsize, TValue);
++  L->stacksize = realsize;
++  L->stack_last = L->stack+newsize;
++  correctstack(L, oldstack);
++}
++
++
++void luaD_reallocCI (lua_State *L, int newsize) {
++  CallInfo *oldci = L->base_ci;
++  luaM_reallocvector(L, L->base_ci, L->size_ci, newsize, CallInfo);
++  L->size_ci = newsize;
++  L->ci = (L->ci - oldci) + L->base_ci;
++  L->end_ci = L->base_ci + L->size_ci - 1;
++}
++
++
++void luaD_growstack (lua_State *L, int n) {
++  if (n <= L->stacksize)  /* double size is enough? */
++    luaD_reallocstack(L, 2*L->stacksize);
++  else
++    luaD_reallocstack(L, L->stacksize + n);
++}
++
++
++static CallInfo *growCI (lua_State *L) {
++  if (L->size_ci > LUAI_MAXCALLS)  /* overflow while handling overflow? */
++    luaD_throw(L, LUA_ERRERR);
++  else {
++    luaD_reallocCI(L, 2*L->size_ci);
++    if (L->size_ci > LUAI_MAXCALLS)
++      luaG_runerror(L, "stack overflow");
++  }
++  return ++L->ci;
++}
++
++
++void luaD_callhook (lua_State *L, int event, int line) {
++  lua_Hook hook = L->hook;
++  if (hook && L->allowhook) {
++    ptrdiff_t top = savestack(L, L->top);
++    ptrdiff_t ci_top = savestack(L, L->ci->top);
++    lua_Debug ar;
++    ar.event = event;
++    ar.currentline = line;
++    if (event == LUA_HOOKTAILRET)
++      ar.i_ci = 0;  /* tail call; no debug information about it */
++    else
++      ar.i_ci = cast_int(L->ci - L->base_ci);
++    luaD_checkstack(L, LUA_MINSTACK);  /* ensure minimum stack size */
++    L->ci->top = L->top + LUA_MINSTACK;
++    lua_assert(L->ci->top <= L->stack_last);
++    L->allowhook = 0;  /* cannot call hooks inside a hook */
++    lua_unlock(L);
++    (*hook)(L, &ar);
++    lua_lock(L);
++    lua_assert(!L->allowhook);
++    L->allowhook = 1;
++    L->ci->top = restorestack(L, ci_top);
++    L->top = restorestack(L, top);
++  }
++}
++
++
++static StkId adjust_varargs (lua_State *L, Proto *p, int actual) {
++  int i;
++  int nfixargs = p->numparams;
++  Table *htab = NULL;
++  StkId base, fixed;
++  for (; actual < nfixargs; ++actual)
++    setnilvalue(L->top++);
++#if defined(LUA_COMPAT_VARARG)
++  if (p->is_vararg & VARARG_NEEDSARG) { /* compat. with old-style vararg? */
++    int nvar = actual - nfixargs;  /* number of extra arguments */
++    lua_assert(p->is_vararg & VARARG_HASARG);
++    luaC_checkGC(L);
++    htab = luaH_new(L, nvar, 1);  /* create `arg' table */
++    for (i=0; i<nvar; i++)  /* put extra arguments into `arg' table */
++      setobj2n(L, luaH_setnum(L, htab, i+1), L->top - nvar + i);
++    /* store counter in field `n' */
++    setnvalue(luaH_setstr(L, htab, luaS_newliteral(L, "n")), cast_num(nvar));
++  }
++#endif
++  /* move fixed parameters to final position */
++  fixed = L->top - actual;  /* first fixed argument */
++  base = L->top;  /* final position of first argument */
++  for (i=0; i<nfixargs; i++) {
++    setobjs2s(L, L->top++, fixed+i);
++    setnilvalue(fixed+i);
++  }
++  /* add `arg' parameter */
++  if (htab) {
++    sethvalue(L, L->top++, htab);
++    lua_assert(iswhite(obj2gco(htab)));
++  }
++  return base;
++}
++
++
++static StkId tryfuncTM (lua_State *L, StkId func) {
++  const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL);
++  StkId p;
++  ptrdiff_t funcr = savestack(L, func);
++  if (!ttisfunction(tm))
++    luaG_typeerror(L, func, "call");
++  /* Open a hole inside the stack at `func' */
++  for (p = L->top; p > func; p--) setobjs2s(L, p, p-1);
++  incr_top(L);
++  func = restorestack(L, funcr);  /* previous call may change stack */
++  setobj2s(L, func, tm);  /* tag method is the new function to be called */
++  return func;
++}
++
++
++
++#define inc_ci(L) \
++  ((L->ci == L->end_ci) ? growCI(L) : \
++   (condhardstacktests(luaD_reallocCI(L, L->size_ci)), ++L->ci))
++
++
++int luaD_precall (lua_State *L, StkId func, int nresults) {
++  LClosure *cl;
++  ptrdiff_t funcr;
++  if (!ttisfunction(func)) /* `func' is not a function? */
++    func = tryfuncTM(L, func);  /* check the `function' tag method */
++  funcr = savestack(L, func);
++  cl = &clvalue(func)->l;
++  L->ci->savedpc = L->savedpc;
++  if (!cl->isC) {  /* Lua function? prepare its call */
++    CallInfo *ci;
++    StkId st, base;
++    Proto *p = cl->p;
++    luaD_checkstack(L, p->maxstacksize);
++    func = restorestack(L, funcr);
++    if (!p->is_vararg) {  /* no varargs? */
++      base = func + 1;
++      if (L->top > base + p->numparams)
++        L->top = base + p->numparams;
++    }
++    else {  /* vararg function */
++      int nargs = cast_int(L->top - func) - 1;
++      base = adjust_varargs(L, p, nargs);
++      func = restorestack(L, funcr);  /* previous call may change the stack */
++    }
++    ci = inc_ci(L);  /* now `enter' new function */
++    ci->func = func;
++    L->base = ci->base = base;
++    ci->top = L->base + p->maxstacksize;
++    lua_assert(ci->top <= L->stack_last);
++    L->savedpc = p->code;  /* starting point */
++    ci->tailcalls = 0;
++    ci->nresults = nresults;
++    for (st = L->top; st < ci->top; st++)
++      setnilvalue(st);
++    L->top = ci->top;
++    if (L->hookmask & LUA_MASKCALL) {
++      L->savedpc++;  /* hooks assume 'pc' is already incremented */
++      luaD_callhook(L, LUA_HOOKCALL, -1);
++      L->savedpc--;  /* correct 'pc' */
++    }
++    return PCRLUA;
++  }
++  else {  /* if is a C function, call it */
++    CallInfo *ci;
++    int n;
++    luaD_checkstack(L, LUA_MINSTACK);  /* ensure minimum stack size */
++    ci = inc_ci(L);  /* now `enter' new function */
++    ci->func = restorestack(L, funcr);
++    L->base = ci->base = ci->func + 1;
++    ci->top = L->top + LUA_MINSTACK;
++    lua_assert(ci->top <= L->stack_last);
++    ci->nresults = nresults;
++    if (L->hookmask & LUA_MASKCALL)
++      luaD_callhook(L, LUA_HOOKCALL, -1);
++    lua_unlock(L);
++    n = (*curr_func(L)->c.f)(L);  /* do the actual call */
++    lua_lock(L);
++    if (n < 0)  /* yielding? */
++      return PCRYIELD;
++    else {
++      luaD_poscall(L, L->top - n);
++      return PCRC;
++    }
++  }
++}
++
++
++static StkId callrethooks (lua_State *L, StkId firstResult) {
++  ptrdiff_t fr = savestack(L, firstResult);  /* next call may change stack */
++  luaD_callhook(L, LUA_HOOKRET, -1);
++  if (f_isLua(L->ci)) {  /* Lua function? */
++    while ((L->hookmask & LUA_MASKRET) && L->ci->tailcalls--) /* tail calls */
++      luaD_callhook(L, LUA_HOOKTAILRET, -1);
++  }
++  return restorestack(L, fr);
++}
++
++
++int luaD_poscall (lua_State *L, StkId firstResult) {
++  StkId res;
++  int wanted, i;
++  CallInfo *ci;
++  if (L->hookmask & LUA_MASKRET)
++    firstResult = callrethooks(L, firstResult);
++  ci = L->ci--;
++  res = ci->func;  /* res == final position of 1st result */
++  wanted = ci->nresults;
++  L->base = (ci - 1)->base;  /* restore base */
++  L->savedpc = (ci - 1)->savedpc;  /* restore savedpc */
++  /* move results to correct place */
++  for (i = wanted; i != 0 && firstResult < L->top; i--)
++    setobjs2s(L, res++, firstResult++);
++  while (i-- > 0)
++    setnilvalue(res++);
++  L->top = res;
++  return (wanted - LUA_MULTRET);  /* 0 iff wanted == LUA_MULTRET */
++}
++
++
++/*
++** Call a function (C or Lua). The function to be called is at *func.
++** The arguments are on the stack, right after the function.
++** When returns, all the results are on the stack, starting at the original
++** function position.
++*/
++void luaD_call (lua_State *L, StkId func, int nResults) {
++  if (++L->nCcalls >= LUAI_MAXCCALLS) {
++    if (L->nCcalls == LUAI_MAXCCALLS)
++      luaG_runerror(L, "C stack overflow");
++    else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3)))
++      luaD_throw(L, LUA_ERRERR);  /* error while handing stack error */
++  }
++  if (luaD_precall(L, func, nResults) == PCRLUA)  /* is a Lua function? */
++    luaV_execute(L, 1);  /* call it */
++  L->nCcalls--;
++  luaC_checkGC(L);
++}
++
++
++static void resume (lua_State *L, void *ud) {
++  StkId firstArg = cast(StkId, ud);
++  CallInfo *ci = L->ci;
++  if (L->status == 0) {  /* start coroutine? */
++    lua_assert(ci == L->base_ci && firstArg > L->base);
++    if (luaD_precall(L, firstArg - 1, LUA_MULTRET) != PCRLUA)
++      return;
++  }
++  else {  /* resuming from previous yield */
++    lua_assert(L->status == LUA_YIELD);
++    L->status = 0;
++    if (!f_isLua(ci)) {  /* `common' yield? */
++      /* finish interrupted execution of `OP_CALL' */
++      lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL ||
++                 GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_TAILCALL);
++      if (luaD_poscall(L, firstArg))  /* complete it... */
++        L->top = L->ci->top;  /* and correct top if not multiple results */
++    }
++    else  /* yielded inside a hook: just continue its execution */
++      L->base = L->ci->base;
++  }
++  luaV_execute(L, cast_int(L->ci - L->base_ci));
++}
++
++
++static int resume_error (lua_State *L, const char *msg) {
++  L->top = L->ci->base;
++  setsvalue2s(L, L->top, luaS_new(L, msg));
++  incr_top(L);
++  lua_unlock(L);
++  return LUA_ERRRUN;
++}
++
++
++LUA_API int lua_resume (lua_State *L, int nargs) {
++  int status;
++  lua_lock(L);
++  if (L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci))
++      return resume_error(L, "cannot resume non-suspended coroutine");
++  if (L->nCcalls >= LUAI_MAXCCALLS)
++    return resume_error(L, "C stack overflow");
++  luai_userstateresume(L, nargs);
++  lua_assert(L->errfunc == 0);
++  L->baseCcalls = ++L->nCcalls;
++  status = luaD_rawrunprotected(L, resume, L->top - nargs);
++  if (status != 0) {  /* error? */
++    L->status = cast_byte(status);  /* mark thread as `dead' */
++    luaD_seterrorobj(L, status, L->top);
++    L->ci->top = L->top;
++  }
++  else {
++    lua_assert(L->nCcalls == L->baseCcalls);
++    status = L->status;
++  }
++  --L->nCcalls;
++  lua_unlock(L);
++  return status;
++}
++
++
++LUA_API int lua_yield (lua_State *L, int nresults) {
++  luai_userstateyield(L, nresults);
++  lua_lock(L);
++  if (L->nCcalls > L->baseCcalls)
++    luaG_runerror(L, "attempt to yield across metamethod/C-call boundary");
++  L->base = L->top - nresults;  /* protect stack slots below */
++  L->status = LUA_YIELD;
++  lua_unlock(L);
++  return -1;
++}
++
++
++int luaD_pcall (lua_State *L, Pfunc func, void *u,
++                ptrdiff_t old_top, ptrdiff_t ef) {
++  int status;
++  unsigned short oldnCcalls = L->nCcalls;
++  ptrdiff_t old_ci = saveci(L, L->ci);
++  lu_byte old_allowhooks = L->allowhook;
++  ptrdiff_t old_errfunc = L->errfunc;
++  L->errfunc = ef;
++  status = luaD_rawrunprotected(L, func, u);
++  if (status != 0) {  /* an error occurred? */
++    StkId oldtop = restorestack(L, old_top);
++    luaF_close(L, oldtop);  /* close eventual pending closures */
++    luaD_seterrorobj(L, status, oldtop);
++    L->nCcalls = oldnCcalls;
++    L->ci = restoreci(L, old_ci);
++    L->base = L->ci->base;
++    L->savedpc = L->ci->savedpc;
++    L->allowhook = old_allowhooks;
++    restore_stack_limit(L);
++  }
++  L->errfunc = old_errfunc;
++  return status;
++}
++
++
++
++/*
++** Execute a protected parser.
++*/
++struct SParser {  /* data to `f_parser' */
++  ZIO *z;
++  Mbuffer buff;  /* buffer to be used by the scanner */
++  const char *name;
++};
++
++static void f_parser (lua_State *L, void *ud) {
++  int i;
++  Proto *tf;
++  Closure *cl;
++  struct SParser *p = cast(struct SParser *, ud);
++  int c = luaZ_lookahead(p->z);
++  luaC_checkGC(L);
++  tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z,
++                                                             &p->buff, p->name);
++  cl = luaF_newLclosure(L, tf->nups, hvalue(gt(L)));
++  cl->l.p = tf;
++  for (i = 0; i < tf->nups; i++)  /* initialize eventual upvalues */
++    cl->l.upvals[i] = luaF_newupval(L);
++  setclvalue(L, L->top, cl);
++  incr_top(L);
++}
++
++
++int luaD_protectedparser (lua_State *L, ZIO *z, const char *name) {
++  struct SParser p;
++  int status;
++  p.z = z; p.name = name;
++  luaZ_initbuffer(L, &p.buff);
++  status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc);
++  luaZ_freebuffer(L, &p.buff);
++  return status;
++}
++
+--- /dev/null
++++ b/extensions/LUA/lua/ldo.h
+@@ -0,0 +1,57 @@
++/*
++** $Id: ldo.h,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $
++** Stack and Call structure of Lua
++** See Copyright Notice in lua.h
++*/
++
++#ifndef ldo_h
++#define ldo_h
++
++
++#include "lobject.h"
++#include "lstate.h"
++#include "lzio.h"
++
++
++#define luaD_checkstack(L,n)  \
++  if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \
++    luaD_growstack(L, n); \
++  else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1));
++
++
++#define incr_top(L) {luaD_checkstack(L,1); L->top++;}
++
++#define savestack(L,p)                ((char *)(p) - (char *)L->stack)
++#define restorestack(L,n)     ((TValue *)((char *)L->stack + (n)))
++
++#define saveci(L,p)           ((char *)(p) - (char *)L->base_ci)
++#define restoreci(L,n)                ((CallInfo *)((char *)L->base_ci + (n)))
++
++
++/* results from luaD_precall */
++#define PCRLUA                0       /* initiated a call to a Lua function */
++#define PCRC          1       /* did a call to a C function */
++#define PCRYIELD      2       /* C funtion yielded */
++
++
++/* type of protected functions, to be ran by `runprotected' */
++typedef void (*Pfunc) (lua_State *L, void *ud);
++
++LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name);
++LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line);
++LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);
++LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);
++LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
++                                        ptrdiff_t oldtop, ptrdiff_t ef);
++LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);
++LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
++LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
++LUAI_FUNC void luaD_growstack (lua_State *L, int n);
++
++LUAI_FUNC void luaD_throw (lua_State *L, int errcode);
++LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
++
++LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop);
++
++#endif
++
+--- /dev/null
++++ b/extensions/LUA/lua/ldump.c
+@@ -0,0 +1,164 @@
++/*
++** $Id: ldump.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $
++** save precompiled Lua chunks
++** See Copyright Notice in lua.h
++*/
++
++#include <stddef.h>
++
++#define ldump_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "lobject.h"
++#include "lstate.h"
++#include "lundump.h"
++
++typedef struct {
++ lua_State* L;
++ lua_Writer writer;
++ void* data;
++ int strip;
++ int status;
++} DumpState;
++
++#define DumpMem(b,n,size,D)   DumpBlock(b,(n)*(size),D)
++#define DumpVar(x,D)          DumpMem(&x,1,sizeof(x),D)
++
++static void DumpBlock(const void* b, size_t size, DumpState* D)
++{
++ if (D->status==0)
++ {
++  lua_unlock(D->L);
++  D->status=(*D->writer)(D->L,b,size,D->data);
++  lua_lock(D->L);
++ }
++}
++
++static void DumpChar(int y, DumpState* D)
++{
++ char x=(char)y;
++ DumpVar(x,D);
++}
++
++static void DumpInt(int x, DumpState* D)
++{
++ DumpVar(x,D);
++}
++
++static void DumpNumber(lua_Number x, DumpState* D)
++{
++ DumpVar(x,D);
++}
++
++static void DumpVector(const void* b, int n, size_t size, DumpState* D)
++{
++ DumpInt(n,D);
++ DumpMem(b,n,size,D);
++}
++
++static void DumpString(const TString* s, DumpState* D)
++{
++ if (s==NULL || getstr(s)==NULL)
++ {
++  size_t size=0;
++  DumpVar(size,D);
++ }
++ else
++ {
++  size_t size=s->tsv.len+1;           /* include trailing '\0' */
++  DumpVar(size,D);
++  DumpBlock(getstr(s),size,D);
++ }
++}
++
++#define DumpCode(f,D)  DumpVector(f->code,f->sizecode,sizeof(Instruction),D)
++
++static void DumpFunction(const Proto* f, const TString* p, DumpState* D);
++
++static void DumpConstants(const Proto* f, DumpState* D)
++{
++ int i,n=f->sizek;
++ DumpInt(n,D);
++ for (i=0; i<n; i++)
++ {
++  const TValue* o=&f->k[i];
++  DumpChar(ttype(o),D);
++  switch (ttype(o))
++  {
++   case LUA_TNIL:
++      break;
++   case LUA_TBOOLEAN:
++      DumpChar(bvalue(o),D);
++      break;
++   case LUA_TNUMBER:
++      DumpNumber(nvalue(o),D);
++      break;
++   case LUA_TSTRING:
++      DumpString(rawtsvalue(o),D);
++      break;
++   default:
++      lua_assert(0);                  /* cannot happen */
++      break;
++  }
++ }
++ n=f->sizep;
++ DumpInt(n,D);
++ for (i=0; i<n; i++) DumpFunction(f->p[i],f->source,D);
++}
++
++static void DumpDebug(const Proto* f, DumpState* D)
++{
++ int i,n;
++ n= (D->strip) ? 0 : f->sizelineinfo;
++ DumpVector(f->lineinfo,n,sizeof(int),D);
++ n= (D->strip) ? 0 : f->sizelocvars;
++ DumpInt(n,D);
++ for (i=0; i<n; i++)
++ {
++  DumpString(f->locvars[i].varname,D);
++  DumpInt(f->locvars[i].startpc,D);
++  DumpInt(f->locvars[i].endpc,D);
++ }
++ n= (D->strip) ? 0 : f->sizeupvalues;
++ DumpInt(n,D);
++ for (i=0; i<n; i++) DumpString(f->upvalues[i],D);
++}
++
++static void DumpFunction(const Proto* f, const TString* p, DumpState* D)
++{
++ DumpString((f->source==p || D->strip) ? NULL : f->source,D);
++ DumpInt(f->linedefined,D);
++ DumpInt(f->lastlinedefined,D);
++ DumpChar(f->nups,D);
++ DumpChar(f->numparams,D);
++ DumpChar(f->is_vararg,D);
++ DumpChar(f->maxstacksize,D);
++ DumpCode(f,D);
++ DumpConstants(f,D);
++ DumpDebug(f,D);
++}
++
++static void DumpHeader(DumpState* D)
++{
++ char h[LUAC_HEADERSIZE];
++ luaU_header(h);
++ DumpBlock(h,LUAC_HEADERSIZE,D);
++}
++
++/*
++** dump Lua function as precompiled chunk
++*/
++int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip)
++{
++ DumpState D;
++ D.L=L;
++ D.writer=w;
++ D.data=data;
++ D.strip=strip;
++ D.status=0;
++ DumpHeader(&D);
++ DumpFunction(f,NULL,&D);
++ return D.status;
++}
+--- /dev/null
++++ b/extensions/LUA/lua/lfunc.c
+@@ -0,0 +1,174 @@
++/*
++** $Id: lfunc.c,v 2.12.1.2 2007/12/28 14:58:43 roberto Exp $
++** Auxiliary functions to manipulate prototypes and closures
++** See Copyright Notice in lua.h
++*/
++
++
++#include <stddef.h>
++
++#define lfunc_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "lfunc.h"
++#include "lgc.h"
++#include "lmem.h"
++#include "lobject.h"
++#include "lstate.h"
++
++
++
++Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e) {
++  Closure *c = cast(Closure *, luaM_malloc(L, sizeCclosure(nelems)));
++  luaC_link(L, obj2gco(c), LUA_TFUNCTION);
++  c->c.isC = 1;
++  c->c.env = e;
++  c->c.nupvalues = cast_byte(nelems);
++  return c;
++}
++
++
++Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e) {
++  Closure *c = cast(Closure *, luaM_malloc(L, sizeLclosure(nelems)));
++  luaC_link(L, obj2gco(c), LUA_TFUNCTION);
++  c->l.isC = 0;
++  c->l.env = e;
++  c->l.nupvalues = cast_byte(nelems);
++  while (nelems--) c->l.upvals[nelems] = NULL;
++  return c;
++}
++
++
++UpVal *luaF_newupval (lua_State *L) {
++  UpVal *uv = luaM_new(L, UpVal);
++  luaC_link(L, obj2gco(uv), LUA_TUPVAL);
++  uv->v = &uv->u.value;
++  setnilvalue(uv->v);
++  return uv;
++}
++
++
++UpVal *luaF_findupval (lua_State *L, StkId level) {
++  global_State *g = G(L);
++  GCObject **pp = &L->openupval;
++  UpVal *p;
++  UpVal *uv;
++  while (*pp != NULL && (p = ngcotouv(*pp))->v >= level) {
++    lua_assert(p->v != &p->u.value);
++    if (p->v == level) {  /* found a corresponding upvalue? */
++      if (isdead(g, obj2gco(p)))  /* is it dead? */
++        changewhite(obj2gco(p));  /* ressurect it */
++      return p;
++    }
++    pp = &p->next;
++  }
++  uv = luaM_new(L, UpVal);  /* not found: create a new one */
++  uv->tt = LUA_TUPVAL;
++  uv->marked = luaC_white(g);
++  uv->v = level;  /* current value lives in the stack */
++  uv->next = *pp;  /* chain it in the proper position */
++  *pp = obj2gco(uv);
++  uv->u.l.prev = &g->uvhead;  /* double link it in `uvhead' list */
++  uv->u.l.next = g->uvhead.u.l.next;
++  uv->u.l.next->u.l.prev = uv;
++  g->uvhead.u.l.next = uv;
++  lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv);
++  return uv;
++}
++
++
++static void unlinkupval (UpVal *uv) {
++  lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv);
++  uv->u.l.next->u.l.prev = uv->u.l.prev;  /* remove from `uvhead' list */
++  uv->u.l.prev->u.l.next = uv->u.l.next;
++}
++
++
++void luaF_freeupval (lua_State *L, UpVal *uv) {
++  if (uv->v != &uv->u.value)  /* is it open? */
++    unlinkupval(uv);  /* remove from open list */
++  luaM_free(L, uv);  /* free upvalue */
++}
++
++
++void luaF_close (lua_State *L, StkId level) {
++  UpVal *uv;
++  global_State *g = G(L);
++  while (L->openupval != NULL && (uv = ngcotouv(L->openupval))->v >= level) {
++    GCObject *o = obj2gco(uv);
++    lua_assert(!isblack(o) && uv->v != &uv->u.value);
++    L->openupval = uv->next;  /* remove from `open' list */
++    if (isdead(g, o))
++      luaF_freeupval(L, uv);  /* free upvalue */
++    else {
++      unlinkupval(uv);
++      setobj(L, &uv->u.value, uv->v);
++      uv->v = &uv->u.value;  /* now current value lives here */
++      luaC_linkupval(L, uv);  /* link upvalue into `gcroot' list */
++    }
++  }
++}
++
++
++Proto *luaF_newproto (lua_State *L) {
++  Proto *f = luaM_new(L, Proto);
++  luaC_link(L, obj2gco(f), LUA_TPROTO);
++  f->k = NULL;
++  f->sizek = 0;
++  f->p = NULL;
++  f->sizep = 0;
++  f->code = NULL;
++  f->sizecode = 0;
++  f->sizelineinfo = 0;
++  f->sizeupvalues = 0;
++  f->nups = 0;
++  f->upvalues = NULL;
++  f->numparams = 0;
++  f->is_vararg = 0;
++  f->maxstacksize = 0;
++  f->lineinfo = NULL;
++  f->sizelocvars = 0;
++  f->locvars = NULL;
++  f->linedefined = 0;
++  f->lastlinedefined = 0;
++  f->source = NULL;
++  return f;
++}
++
++
++void luaF_freeproto (lua_State *L, Proto *f) {
++  luaM_freearray(L, f->code, f->sizecode, Instruction);
++  luaM_freearray(L, f->p, f->sizep, Proto *);
++  luaM_freearray(L, f->k, f->sizek, TValue);
++  luaM_freearray(L, f->lineinfo, f->sizelineinfo, int);
++  luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar);
++  luaM_freearray(L, f->upvalues, f->sizeupvalues, TString *);
++  luaM_free(L, f);
++}
++
++
++void luaF_freeclosure (lua_State *L, Closure *c) {
++  int size = (c->c.isC) ? sizeCclosure(c->c.nupvalues) :
++                          sizeLclosure(c->l.nupvalues);
++  luaM_freemem(L, c, size);
++}
++
++
++/*
++** Look for n-th local variable at line `line' in function `func'.
++** Returns NULL if not found.
++*/
++const char *luaF_getlocalname (const Proto *f, int local_number, int pc) {
++  int i;
++  for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) {
++    if (pc < f->locvars[i].endpc) {  /* is variable active? */
++      local_number--;
++      if (local_number == 0)
++        return getstr(f->locvars[i].varname);
++    }
++  }
++  return NULL;  /* not found */
++}
++
+--- /dev/null
++++ b/extensions/LUA/lua/lfunc.h
+@@ -0,0 +1,34 @@
++/*
++** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $
++** Auxiliary functions to manipulate prototypes and closures
++** See Copyright Notice in lua.h
++*/
++
++#ifndef lfunc_h
++#define lfunc_h
++
++
++#include "lobject.h"
++
++
++#define sizeCclosure(n)       (cast(int, sizeof(CClosure)) + \
++                         cast(int, sizeof(TValue)*((n)-1)))
++
++#define sizeLclosure(n)       (cast(int, sizeof(LClosure)) + \
++                         cast(int, sizeof(TValue *)*((n)-1)))
++
++
++LUAI_FUNC Proto *luaF_newproto (lua_State *L);
++LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e);
++LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e);
++LUAI_FUNC UpVal *luaF_newupval (lua_State *L);
++LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
++LUAI_FUNC void luaF_close (lua_State *L, StkId level);
++LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
++LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c);
++LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);
++LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
++                                         int pc);
++
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/lgc.c
+@@ -0,0 +1,711 @@
++/*
++** $Id: lgc.c,v 2.38.1.1 2007/12/27 13:02:25 roberto Exp $
++** Garbage Collector
++** See Copyright Notice in lua.h
++*/
++
++#include <string.h>
++
++#define lgc_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "ldebug.h"
++#include "ldo.h"
++#include "lfunc.h"
++#include "lgc.h"
++#include "lmem.h"
++#include "lobject.h"
++#include "lstate.h"
++#include "lstring.h"
++#include "ltable.h"
++#include "ltm.h"
++
++
++#define GCSTEPSIZE    1024u
++#define GCSWEEPMAX    40
++#define GCSWEEPCOST   10
++#define GCFINALIZECOST        100
++
++
++#define maskmarks     cast_byte(~(bitmask(BLACKBIT)|WHITEBITS))
++
++#define makewhite(g,x)        \
++   ((x)->gch.marked = cast_byte(((x)->gch.marked & maskmarks) | luaC_white(g)))
++
++#define white2gray(x) reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)
++#define black2gray(x) resetbit((x)->gch.marked, BLACKBIT)
++
++#define stringmark(s) reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT)
++
++
++#define isfinalized(u)                testbit((u)->marked, FINALIZEDBIT)
++#define markfinalized(u)      l_setbit((u)->marked, FINALIZEDBIT)
++
++
++#define KEYWEAK         bitmask(KEYWEAKBIT)
++#define VALUEWEAK       bitmask(VALUEWEAKBIT)
++
++
++
++#define markvalue(g,o) { checkconsistency(o); \
++  if (iscollectable(o) && iswhite(gcvalue(o))) reallymarkobject(g,gcvalue(o)); }
++
++#define markobject(g,t) { if (iswhite(obj2gco(t))) \
++              reallymarkobject(g, obj2gco(t)); }
++
++
++#define setthreshold(g)  (g->GCthreshold = (g->estimate/100) * g->gcpause)
++
++
++static void removeentry (Node *n) {
++  lua_assert(ttisnil(gval(n)));
++  if (iscollectable(gkey(n)))
++    setttype(gkey(n), LUA_TDEADKEY);  /* dead key; remove it */
++}
++
++
++static void reallymarkobject (global_State *g, GCObject *o) {
++  lua_assert(iswhite(o) && !isdead(g, o));
++  white2gray(o);
++  switch (o->gch.tt) {
++    case LUA_TSTRING: {
++      return;
++    }
++    case LUA_TUSERDATA: {
++      Table *mt = gco2u(o)->metatable;
++      gray2black(o);  /* udata are never gray */
++      if (mt) markobject(g, mt);
++      markobject(g, gco2u(o)->env);
++      return;
++    }
++    case LUA_TUPVAL: {
++      UpVal *uv = gco2uv(o);
++      markvalue(g, uv->v);
++      if (uv->v == &uv->u.value)  /* closed? */
++        gray2black(o);  /* open upvalues are never black */
++      return;
++    }
++    case LUA_TFUNCTION: {
++      gco2cl(o)->c.gclist = g->gray;
++      g->gray = o;
++      break;
++    }
++    case LUA_TTABLE: {
++      gco2h(o)->gclist = g->gray;
++      g->gray = o;
++      break;
++    }
++    case LUA_TTHREAD: {
++      gco2th(o)->gclist = g->gray;
++      g->gray = o;
++      break;
++    }
++    case LUA_TPROTO: {
++      gco2p(o)->gclist = g->gray;
++      g->gray = o;
++      break;
++    }
++    default: lua_assert(0);
++  }
++}
++
++
++static void marktmu (global_State *g) {
++  GCObject *u = g->tmudata;
++  if (u) {
++    do {
++      u = u->gch.next;
++      makewhite(g, u);  /* may be marked, if left from previous GC */
++      reallymarkobject(g, u);
++    } while (u != g->tmudata);
++  }
++}
++
++
++/* move `dead' udata that need finalization to list `tmudata' */
++size_t luaC_separateudata (lua_State *L, int all) {
++  global_State *g = G(L);
++  size_t deadmem = 0;
++  GCObject **p = &g->mainthread->next;
++  GCObject *curr;
++  while ((curr = *p) != NULL) {
++    if (!(iswhite(curr) || all) || isfinalized(gco2u(curr)))
++      p = &curr->gch.next;  /* don't bother with them */
++    else if (fasttm(L, gco2u(curr)->metatable, TM_GC) == NULL) {
++      markfinalized(gco2u(curr));  /* don't need finalization */
++      p = &curr->gch.next;
++    }
++    else {  /* must call its gc method */
++      deadmem += sizeudata(gco2u(curr));
++      markfinalized(gco2u(curr));
++      *p = curr->gch.next;
++      /* link `curr' at the end of `tmudata' list */
++      if (g->tmudata == NULL)  /* list is empty? */
++        g->tmudata = curr->gch.next = curr;  /* creates a circular list */
++      else {
++        curr->gch.next = g->tmudata->gch.next;
++        g->tmudata->gch.next = curr;
++        g->tmudata = curr;
++      }
++    }
++  }
++  return deadmem;
++}
++
++
++static int traversetable (global_State *g, Table *h) {
++  int i;
++  int weakkey = 0;
++  int weakvalue = 0;
++  const TValue *mode;
++  if (h->metatable)
++    markobject(g, h->metatable);
++  mode = gfasttm(g, h->metatable, TM_MODE);
++  if (mode && ttisstring(mode)) {  /* is there a weak mode? */
++    weakkey = (strchr(svalue(mode), 'k') != NULL);
++    weakvalue = (strchr(svalue(mode), 'v') != NULL);
++    if (weakkey || weakvalue) {  /* is really weak? */
++      h->marked &= ~(KEYWEAK | VALUEWEAK);  /* clear bits */
++      h->marked |= cast_byte((weakkey << KEYWEAKBIT) |
++                             (weakvalue << VALUEWEAKBIT));
++      h->gclist = g->weak;  /* must be cleared after GC, ... */
++      g->weak = obj2gco(h);  /* ... so put in the appropriate list */
++    }
++  }
++  if (weakkey && weakvalue) return 1;
++  if (!weakvalue) {
++    i = h->sizearray;
++    while (i--)
++      markvalue(g, &h->array[i]);
++  }
++  i = sizenode(h);
++  while (i--) {
++    Node *n = gnode(h, i);
++    lua_assert(ttype(gkey(n)) != LUA_TDEADKEY || ttisnil(gval(n)));
++    if (ttisnil(gval(n)))
++      removeentry(n);  /* remove empty entries */
++    else {
++      lua_assert(!ttisnil(gkey(n)));
++      if (!weakkey) markvalue(g, gkey(n));
++      if (!weakvalue) markvalue(g, gval(n));
++    }
++  }
++  return weakkey || weakvalue;
++}
++
++
++/*
++** All marks are conditional because a GC may happen while the
++** prototype is still being created
++*/
++static void traverseproto (global_State *g, Proto *f) {
++  int i;
++  if (f->source) stringmark(f->source);
++  for (i=0; i<f->sizek; i++)  /* mark literals */
++    markvalue(g, &f->k[i]);
++  for (i=0; i<f->sizeupvalues; i++) {  /* mark upvalue names */
++    if (f->upvalues[i])
++      stringmark(f->upvalues[i]);
++  }
++  for (i=0; i<f->sizep; i++) {  /* mark nested protos */
++    if (f->p[i])
++      markobject(g, f->p[i]);
++  }
++  for (i=0; i<f->sizelocvars; i++) {  /* mark local-variable names */
++    if (f->locvars[i].varname)
++      stringmark(f->locvars[i].varname);
++  }
++}
++
++
++
++static void traverseclosure (global_State *g, Closure *cl) {
++  markobject(g, cl->c.env);
++  if (cl->c.isC) {
++    int i;
++    for (i=0; i<cl->c.nupvalues; i++)  /* mark its upvalues */
++      markvalue(g, &cl->c.upvalue[i]);
++  }
++  else {
++    int i;
++    lua_assert(cl->l.nupvalues == cl->l.p->nups);
++    markobject(g, cl->l.p);
++    for (i=0; i<cl->l.nupvalues; i++)  /* mark its upvalues */
++      markobject(g, cl->l.upvals[i]);
++  }
++}
++
++
++static void checkstacksizes (lua_State *L, StkId max) {
++  int ci_used = cast_int(L->ci - L->base_ci);  /* number of `ci' in use */
++  int s_used = cast_int(max - L->stack);  /* part of stack in use */
++  if (L->size_ci > LUAI_MAXCALLS)  /* handling overflow? */
++    return;  /* do not touch the stacks */
++  if (4*ci_used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci)
++    luaD_reallocCI(L, L->size_ci/2);  /* still big enough... */
++  condhardstacktests(luaD_reallocCI(L, ci_used + 1));
++  if (4*s_used < L->stacksize &&
++      2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->stacksize)
++    luaD_reallocstack(L, L->stacksize/2);  /* still big enough... */
++  condhardstacktests(luaD_reallocstack(L, s_used));
++}
++
++
++static void traversestack (global_State *g, lua_State *l) {
++  StkId o, lim;
++  CallInfo *ci;
++  markvalue(g, gt(l));
++  lim = l->top;
++  for (ci = l->base_ci; ci <= l->ci; ci++) {
++    lua_assert(ci->top <= l->stack_last);
++    if (lim < ci->top) lim = ci->top;
++  }
++  for (o = l->stack; o < l->top; o++)
++    markvalue(g, o);
++  for (; o <= lim; o++)
++    setnilvalue(o);
++  checkstacksizes(l, lim);
++}
++
++
++/*
++** traverse one gray object, turning it to black.
++** Returns `quantity' traversed.
++*/
++static l_mem propagatemark (global_State *g) {
++  GCObject *o = g->gray;
++  lua_assert(isgray(o));
++  gray2black(o);
++  switch (o->gch.tt) {
++    case LUA_TTABLE: {
++      Table *h = gco2h(o);
++      g->gray = h->gclist;
++      if (traversetable(g, h))  /* table is weak? */
++        black2gray(o);  /* keep it gray */
++      return sizeof(Table) + sizeof(TValue) * h->sizearray +
++                             sizeof(Node) * sizenode(h);
++    }
++    case LUA_TFUNCTION: {
++      Closure *cl = gco2cl(o);
++      g->gray = cl->c.gclist;
++      traverseclosure(g, cl);
++      return (cl->c.isC) ? sizeCclosure(cl->c.nupvalues) :
++                           sizeLclosure(cl->l.nupvalues);
++    }
++    case LUA_TTHREAD: {
++      lua_State *th = gco2th(o);
++      g->gray = th->gclist;
++      th->gclist = g->grayagain;
++      g->grayagain = o;
++      black2gray(o);
++      traversestack(g, th);
++      return sizeof(lua_State) + sizeof(TValue) * th->stacksize +
++                                 sizeof(CallInfo) * th->size_ci;
++    }
++    case LUA_TPROTO: {
++      Proto *p = gco2p(o);
++      g->gray = p->gclist;
++      traverseproto(g, p);
++      return sizeof(Proto) + sizeof(Instruction) * p->sizecode +
++                             sizeof(Proto *) * p->sizep +
++                             sizeof(TValue) * p->sizek + 
++                             sizeof(int) * p->sizelineinfo +
++                             sizeof(LocVar) * p->sizelocvars +
++                             sizeof(TString *) * p->sizeupvalues;
++    }
++    default: lua_assert(0); return 0;
++  }
++}
++
++
++static size_t propagateall (global_State *g) {
++  size_t m = 0;
++  while (g->gray) m += propagatemark(g);
++  return m;
++}
++
++
++/*
++** The next function tells whether a key or value can be cleared from
++** a weak table. Non-collectable objects are never removed from weak
++** tables. Strings behave as `values', so are never removed too. for
++** other objects: if really collected, cannot keep them; for userdata
++** being finalized, keep them in keys, but not in values
++*/
++static int iscleared (const TValue *o, int iskey) {
++  if (!iscollectable(o)) return 0;
++  if (ttisstring(o)) {
++    stringmark(rawtsvalue(o));  /* strings are `values', so are never weak */
++    return 0;
++  }
++  return iswhite(gcvalue(o)) ||
++    (ttisuserdata(o) && (!iskey && isfinalized(uvalue(o))));
++}
++
++
++/*
++** clear collected entries from weaktables
++*/
++static void cleartable (GCObject *l) {
++  while (l) {
++    Table *h = gco2h(l);
++    int i = h->sizearray;
++    lua_assert(testbit(h->marked, VALUEWEAKBIT) ||
++               testbit(h->marked, KEYWEAKBIT));
++    if (testbit(h->marked, VALUEWEAKBIT)) {
++      while (i--) {
++        TValue *o = &h->array[i];
++        if (iscleared(o, 0))  /* value was collected? */
++          setnilvalue(o);  /* remove value */
++      }
++    }
++    i = sizenode(h);
++    while (i--) {
++      Node *n = gnode(h, i);
++      if (!ttisnil(gval(n)) &&  /* non-empty entry? */
++          (iscleared(key2tval(n), 1) || iscleared(gval(n), 0))) {
++        setnilvalue(gval(n));  /* remove value ... */
++        removeentry(n);  /* remove entry from table */
++      }
++    }
++    l = h->gclist;
++  }
++}
++
++
++static void freeobj (lua_State *L, GCObject *o) {
++  switch (o->gch.tt) {
++    case LUA_TPROTO: luaF_freeproto(L, gco2p(o)); break;
++    case LUA_TFUNCTION: luaF_freeclosure(L, gco2cl(o)); break;
++    case LUA_TUPVAL: luaF_freeupval(L, gco2uv(o)); break;
++    case LUA_TTABLE: luaH_free(L, gco2h(o)); break;
++    case LUA_TTHREAD: {
++      lua_assert(gco2th(o) != L && gco2th(o) != G(L)->mainthread);
++      luaE_freethread(L, gco2th(o));
++      break;
++    }
++    case LUA_TSTRING: {
++      G(L)->strt.nuse--;
++      luaM_freemem(L, o, sizestring(gco2ts(o)));
++      break;
++    }
++    case LUA_TUSERDATA: {
++      luaM_freemem(L, o, sizeudata(gco2u(o)));
++      break;
++    }
++    default: lua_assert(0);
++  }
++}
++
++
++
++#define sweepwholelist(L,p)   sweeplist(L,p,MAX_LUMEM)
++
++
++static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) {
++  GCObject *curr;
++  global_State *g = G(L);
++  int deadmask = otherwhite(g);
++  while ((curr = *p) != NULL && count-- > 0) {
++    if (curr->gch.tt == LUA_TTHREAD)  /* sweep open upvalues of each thread */
++      sweepwholelist(L, &gco2th(curr)->openupval);
++    if ((curr->gch.marked ^ WHITEBITS) & deadmask) {  /* not dead? */
++      lua_assert(!isdead(g, curr) || testbit(curr->gch.marked, FIXEDBIT));
++      makewhite(g, curr);  /* make it white (for next cycle) */
++      p = &curr->gch.next;
++    }
++    else {  /* must erase `curr' */
++      lua_assert(isdead(g, curr) || deadmask == bitmask(SFIXEDBIT));
++      *p = curr->gch.next;
++      if (curr == g->rootgc)  /* is the first element of the list? */
++        g->rootgc = curr->gch.next;  /* adjust first */
++      freeobj(L, curr);
++    }
++  }
++  return p;
++}
++
++
++static void checkSizes (lua_State *L) {
++  global_State *g = G(L);
++  /* check size of string hash */
++  if (g->strt.nuse < cast(lu_int32, g->strt.size/4) &&
++      g->strt.size > MINSTRTABSIZE*2)
++    luaS_resize(L, g->strt.size/2);  /* table is too big */
++  /* check size of buffer */
++  if (luaZ_sizebuffer(&g->buff) > LUA_MINBUFFER*2) {  /* buffer too big? */
++    size_t newsize = luaZ_sizebuffer(&g->buff) / 2;
++    luaZ_resizebuffer(L, &g->buff, newsize);
++  }
++}
++
++
++static void GCTM (lua_State *L) {
++  global_State *g = G(L);
++  GCObject *o = g->tmudata->gch.next;  /* get first element */
++  Udata *udata = rawgco2u(o);
++  const TValue *tm;
++  /* remove udata from `tmudata' */
++  if (o == g->tmudata)  /* last element? */
++    g->tmudata = NULL;
++  else
++    g->tmudata->gch.next = udata->uv.next;
++  udata->uv.next = g->mainthread->next;  /* return it to `root' list */
++  g->mainthread->next = o;
++  makewhite(g, o);
++  tm = fasttm(L, udata->uv.metatable, TM_GC);
++  if (tm != NULL) {
++    lu_byte oldah = L->allowhook;
++    lu_mem oldt = g->GCthreshold;
++    L->allowhook = 0;  /* stop debug hooks during GC tag method */
++    g->GCthreshold = 2*g->totalbytes;  /* avoid GC steps */
++    setobj2s(L, L->top, tm);
++    setuvalue(L, L->top+1, udata);
++    L->top += 2;
++    luaD_call(L, L->top - 2, 0);
++    L->allowhook = oldah;  /* restore hooks */
++    g->GCthreshold = oldt;  /* restore threshold */
++  }
++}
++
++
++/*
++** Call all GC tag methods
++*/
++void luaC_callGCTM (lua_State *L) {
++  while (G(L)->tmudata)
++    GCTM(L);
++}
++
++
++void luaC_freeall (lua_State *L) {
++  global_State *g = G(L);
++  int i;
++  g->currentwhite = WHITEBITS | bitmask(SFIXEDBIT);  /* mask to collect all elements */
++  sweepwholelist(L, &g->rootgc);
++  for (i = 0; i < g->strt.size; i++)  /* free all string lists */
++    sweepwholelist(L, &g->strt.hash[i]);
++}
++
++
++static void markmt (global_State *g) {
++  int i;
++  for (i=0; i<NUM_TAGS; i++)
++    if (g->mt[i]) markobject(g, g->mt[i]);
++}
++
++
++/* mark root set */
++static void markroot (lua_State *L) {
++  global_State *g = G(L);
++  g->gray = NULL;
++  g->grayagain = NULL;
++  g->weak = NULL;
++  markobject(g, g->mainthread);
++  /* make global table be traversed before main stack */
++  markvalue(g, gt(g->mainthread));
++  markvalue(g, registry(L));
++  markmt(g);
++  g->gcstate = GCSpropagate;
++}
++
++
++static void remarkupvals (global_State *g) {
++  UpVal *uv;
++  for (uv = g->uvhead.u.l.next; uv != &g->uvhead; uv = uv->u.l.next) {
++    lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv);
++    if (isgray(obj2gco(uv)))
++      markvalue(g, uv->v);
++  }
++}
++
++
++static void atomic (lua_State *L) {
++  global_State *g = G(L);
++  size_t udsize;  /* total size of userdata to be finalized */
++  /* remark occasional upvalues of (maybe) dead threads */
++  remarkupvals(g);
++  /* traverse objects cautch by write barrier and by 'remarkupvals' */
++  propagateall(g);
++  /* remark weak tables */
++  g->gray = g->weak;
++  g->weak = NULL;
++  lua_assert(!iswhite(obj2gco(g->mainthread)));
++  markobject(g, L);  /* mark running thread */
++  markmt(g);  /* mark basic metatables (again) */
++  propagateall(g);
++  /* remark gray again */
++  g->gray = g->grayagain;
++  g->grayagain = NULL;
++  propagateall(g);
++  udsize = luaC_separateudata(L, 0);  /* separate userdata to be finalized */
++  marktmu(g);  /* mark `preserved' userdata */
++  udsize += propagateall(g);  /* remark, to propagate `preserveness' */
++  cleartable(g->weak);  /* remove collected objects from weak tables */
++  /* flip current white */
++  g->currentwhite = cast_byte(otherwhite(g));
++  g->sweepstrgc = 0;
++  g->sweepgc = &g->rootgc;
++  g->gcstate = GCSsweepstring;
++  g->estimate = g->totalbytes - udsize;  /* first estimate */
++}
++
++
++static l_mem singlestep (lua_State *L) {
++  global_State *g = G(L);
++  /*lua_checkmemory(L);*/
++  switch (g->gcstate) {
++    case GCSpause: {
++      markroot(L);  /* start a new collection */
++      return 0;
++    }
++    case GCSpropagate: {
++      if (g->gray)
++        return propagatemark(g);
++      else {  /* no more `gray' objects */
++        atomic(L);  /* finish mark phase */
++        return 0;
++      }
++    }
++    case GCSsweepstring: {
++      lu_mem old = g->totalbytes;
++      sweepwholelist(L, &g->strt.hash[g->sweepstrgc++]);
++      if (g->sweepstrgc >= g->strt.size)  /* nothing more to sweep? */
++        g->gcstate = GCSsweep;  /* end sweep-string phase */
++      lua_assert(old >= g->totalbytes);
++      g->estimate -= old - g->totalbytes;
++      return GCSWEEPCOST;
++    }
++    case GCSsweep: {
++      lu_mem old = g->totalbytes;
++      g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX);
++      if (*g->sweepgc == NULL) {  /* nothing more to sweep? */
++        checkSizes(L);
++        g->gcstate = GCSfinalize;  /* end sweep phase */
++      }
++      lua_assert(old >= g->totalbytes);
++      g->estimate -= old - g->totalbytes;
++      return GCSWEEPMAX*GCSWEEPCOST;
++    }
++    case GCSfinalize: {
++      if (g->tmudata) {
++        GCTM(L);
++        if (g->estimate > GCFINALIZECOST)
++          g->estimate -= GCFINALIZECOST;
++        return GCFINALIZECOST;
++      }
++      else {
++        g->gcstate = GCSpause;  /* end collection */
++        g->gcdept = 0;
++        return 0;
++      }
++    }
++    default: lua_assert(0); return 0;
++  }
++}
++
++
++void luaC_step (lua_State *L) {
++  global_State *g = G(L);
++  l_mem lim = (GCSTEPSIZE/100) * g->gcstepmul;
++  if (lim == 0)
++    lim = (MAX_LUMEM-1)/2;  /* no limit */
++  g->gcdept += g->totalbytes - g->GCthreshold;
++  do {
++    lim -= singlestep(L);
++    if (g->gcstate == GCSpause)
++      break;
++  } while (lim > 0);
++  if (g->gcstate != GCSpause) {
++    if (g->gcdept < GCSTEPSIZE)
++      g->GCthreshold = g->totalbytes + GCSTEPSIZE;  /* - lim/g->gcstepmul;*/
++    else {
++      g->gcdept -= GCSTEPSIZE;
++      g->GCthreshold = g->totalbytes;
++    }
++  }
++  else {
++    lua_assert(g->totalbytes >= g->estimate);
++    setthreshold(g);
++  }
++}
++
++
++void luaC_fullgc (lua_State *L) {
++  global_State *g = G(L);
++  if (g->gcstate <= GCSpropagate) {
++    /* reset sweep marks to sweep all elements (returning them to white) */
++    g->sweepstrgc = 0;
++    g->sweepgc = &g->rootgc;
++    /* reset other collector lists */
++    g->gray = NULL;
++    g->grayagain = NULL;
++    g->weak = NULL;
++    g->gcstate = GCSsweepstring;
++  }
++  lua_assert(g->gcstate != GCSpause && g->gcstate != GCSpropagate);
++  /* finish any pending sweep phase */
++  while (g->gcstate != GCSfinalize) {
++    lua_assert(g->gcstate == GCSsweepstring || g->gcstate == GCSsweep);
++    singlestep(L);
++  }
++  markroot(L);
++  while (g->gcstate != GCSpause) {
++    singlestep(L);
++  }
++  setthreshold(g);
++}
++
++
++void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v) {
++  global_State *g = G(L);
++  lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o));
++  lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause);
++  lua_assert(ttype(&o->gch) != LUA_TTABLE);
++  /* must keep invariant? */
++  if (g->gcstate == GCSpropagate)
++    reallymarkobject(g, v);  /* restore invariant */
++  else  /* don't mind */
++    makewhite(g, o);  /* mark as white just to avoid other barriers */
++}
++
++
++void luaC_barrierback (lua_State *L, Table *t) {
++  global_State *g = G(L);
++  GCObject *o = obj2gco(t);
++  lua_assert(isblack(o) && !isdead(g, o));
++  lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause);
++  black2gray(o);  /* make table gray (again) */
++  t->gclist = g->grayagain;
++  g->grayagain = o;
++}
++
++
++void luaC_link (lua_State *L, GCObject *o, lu_byte tt) {
++  global_State *g = G(L);
++  o->gch.next = g->rootgc;
++  g->rootgc = o;
++  o->gch.marked = luaC_white(g);
++  o->gch.tt = tt;
++}
++
++
++void luaC_linkupval (lua_State *L, UpVal *uv) {
++  global_State *g = G(L);
++  GCObject *o = obj2gco(uv);
++  o->gch.next = g->rootgc;  /* link upvalue into `rootgc' list */
++  g->rootgc = o;
++  if (isgray(o)) { 
++    if (g->gcstate == GCSpropagate) {
++      gray2black(o);  /* closed upvalues need barrier */
++      luaC_barrier(L, uv, uv->v);
++    }
++    else {  /* sweep phase: sweep it (turning it into white) */
++      makewhite(g, o);
++      lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause);
++    }
++  }
++}
++
+--- /dev/null
++++ b/extensions/LUA/lua/lgc.h
+@@ -0,0 +1,110 @@
++/*
++** $Id: lgc.h,v 2.15.1.1 2007/12/27 13:02:25 roberto Exp $
++** Garbage Collector
++** See Copyright Notice in lua.h
++*/
++
++#ifndef lgc_h
++#define lgc_h
++
++
++#include "lobject.h"
++
++
++/*
++** Possible states of the Garbage Collector
++*/
++#define GCSpause      0
++#define GCSpropagate  1
++#define GCSsweepstring        2
++#define GCSsweep      3
++#define GCSfinalize   4
++
++
++/*
++** some userful bit tricks
++*/
++#define resetbits(x,m)        ((x) &= cast(lu_byte, ~(m)))
++#define setbits(x,m)  ((x) |= (m))
++#define testbits(x,m) ((x) & (m))
++#define bitmask(b)    (1<<(b))
++#define bit2mask(b1,b2)       (bitmask(b1) | bitmask(b2))
++#define l_setbit(x,b) setbits(x, bitmask(b))
++#define resetbit(x,b) resetbits(x, bitmask(b))
++#define testbit(x,b)  testbits(x, bitmask(b))
++#define set2bits(x,b1,b2)     setbits(x, (bit2mask(b1, b2)))
++#define reset2bits(x,b1,b2)   resetbits(x, (bit2mask(b1, b2)))
++#define test2bits(x,b1,b2)    testbits(x, (bit2mask(b1, b2)))
++
++
++
++/*
++** Layout for bit use in `marked' field:
++** bit 0 - object is white (type 0)
++** bit 1 - object is white (type 1)
++** bit 2 - object is black
++** bit 3 - for userdata: has been finalized
++** bit 3 - for tables: has weak keys
++** bit 4 - for tables: has weak values
++** bit 5 - object is fixed (should not be collected)
++** bit 6 - object is "super" fixed (only the main thread)
++*/
++
++
++#define WHITE0BIT     0
++#define WHITE1BIT     1
++#define BLACKBIT      2
++#define FINALIZEDBIT  3
++#define KEYWEAKBIT    3
++#define VALUEWEAKBIT  4
++#define FIXEDBIT      5
++#define SFIXEDBIT     6
++#define WHITEBITS     bit2mask(WHITE0BIT, WHITE1BIT)
++
++
++#define iswhite(x)      test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)
++#define isblack(x)      testbit((x)->gch.marked, BLACKBIT)
++#define isgray(x)     (!isblack(x) && !iswhite(x))
++
++#define otherwhite(g) (g->currentwhite ^ WHITEBITS)
++#define isdead(g,v)   ((v)->gch.marked & otherwhite(g) & WHITEBITS)
++
++#define changewhite(x)        ((x)->gch.marked ^= WHITEBITS)
++#define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT)
++
++#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x)))
++
++#define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS)
++
++
++#define luaC_checkGC(L) { \
++  condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \
++  if (G(L)->totalbytes >= G(L)->GCthreshold) \
++      luaC_step(L); }
++
++
++#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p)))  \
++      luaC_barrierf(L,obj2gco(p),gcvalue(v)); }
++
++#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t)))  \
++      luaC_barrierback(L,t); }
++
++#define luaC_objbarrier(L,p,o)  \
++      { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
++              luaC_barrierf(L,obj2gco(p),obj2gco(o)); }
++
++#define luaC_objbarriert(L,t,o)  \
++   { if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); }
++
++LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all);
++LUAI_FUNC void luaC_callGCTM (lua_State *L);
++LUAI_FUNC void luaC_freeall (lua_State *L);
++LUAI_FUNC void luaC_step (lua_State *L);
++LUAI_FUNC void luaC_fullgc (lua_State *L);
++LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt);
++LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv);
++LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v);
++LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t);
++
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/llex.c
+@@ -0,0 +1,460 @@
++/*
++** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
++** Lexical Analyzer
++** See Copyright Notice in lua.h
++*/
++
++#include <ctype.h>
++#include <locale.h>
++#include <string.h>
++
++#define llex_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "ldo.h"
++#include "llex.h"
++#include "lobject.h"
++#include "lparser.h"
++#include "lstate.h"
++#include "lstring.h"
++#include "ltable.h"
++#include "lzio.h"
++
++
++
++#define next(ls) (ls->current = zgetc(ls->z))
++
++
++
++
++#define currIsNewline(ls)     (ls->current == '\n' || ls->current == '\r')
++
++
++/* ORDER RESERVED */
++const char *const luaX_tokens [] = {
++    "and", "break", "do", "else", "elseif",
++    "end", "false", "for", "function", "if",
++    "in", "local", "nil", "not", "or", "repeat",
++    "return", "then", "true", "until", "while",
++    "..", "...", "==", ">=", "<=", "~=",
++    "<number>", "<name>", "<string>", "<eof>",
++    NULL
++};
++
++
++#define save_and_next(ls) (save(ls, ls->current), next(ls))
++
++
++static void save (LexState *ls, int c) {
++  Mbuffer *b = ls->buff;
++  if (b->n + 1 > b->buffsize) {
++    size_t newsize;
++    if (b->buffsize >= MAX_SIZET/2)
++      luaX_lexerror(ls, "lexical element too long", 0);
++    newsize = b->buffsize * 2;
++    luaZ_resizebuffer(ls->L, b, newsize);
++  }
++  b->buffer[b->n++] = cast(char, c);
++}
++
++
++void luaX_init (lua_State *L) {
++  int i;
++  for (i=0; i<NUM_RESERVED; i++) {
++    TString *ts = luaS_new(L, luaX_tokens[i]);
++    luaS_fix(ts);  /* reserved words are never collected */
++    lua_assert(strlen(luaX_tokens[i])+1 <= TOKEN_LEN);
++    ts->tsv.reserved = cast_byte(i+1);  /* reserved word */
++  }
++}
++
++
++#define MAXSRC          80
++
++
++const char *luaX_token2str (LexState *ls, int token) {
++  if (token < FIRST_RESERVED) {
++    lua_assert(token == cast(unsigned char, token));
++    return (iscntrl(token)) ? luaO_pushfstring(ls->L, "char(%d)", token) :
++                              luaO_pushfstring(ls->L, "%c", token);
++  }
++  else
++    return luaX_tokens[token-FIRST_RESERVED];
++}
++
++
++static const char *txtToken (LexState *ls, int token) {
++  switch (token) {
++    case TK_NAME:
++    case TK_STRING:
++    case TK_NUMBER:
++      save(ls, '\0');
++      return luaZ_buffer(ls->buff);
++    default:
++      return luaX_token2str(ls, token);
++  }
++}
++
++
++void luaX_lexerror (LexState *ls, const char *msg, int token) {
++  char buff[MAXSRC];
++  luaO_chunkid(buff, getstr(ls->source), MAXSRC);
++  msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg);
++  if (token)
++    luaO_pushfstring(ls->L, "%s near " LUA_QS, msg, txtToken(ls, token));
++  luaD_throw(ls->L, LUA_ERRSYNTAX);
++}
++
++
++void luaX_syntaxerror (LexState *ls, const char *msg) {
++  luaX_lexerror(ls, msg, ls->t.token);
++}
++
++
++TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
++  lua_State *L = ls->L;
++  TString *ts = luaS_newlstr(L, str, l);
++  TValue *o = luaH_setstr(L, ls->fs->h, ts);  /* entry for `str' */
++  if (ttisnil(o))
++    setbvalue(o, 1);  /* make sure `str' will not be collected */
++  return ts;
++}
++
++
++static void inclinenumber (LexState *ls) {
++  int old = ls->current;
++  lua_assert(currIsNewline(ls));
++  next(ls);  /* skip `\n' or `\r' */
++  if (currIsNewline(ls) && ls->current != old)
++    next(ls);  /* skip `\n\r' or `\r\n' */
++  if (++ls->linenumber >= MAX_INT)
++    luaX_syntaxerror(ls, "chunk has too many lines");
++}
++
++
++void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source) {
++  ls->decpoint = '.';
++  ls->L = L;
++  ls->lookahead.token = TK_EOS;  /* no look-ahead token */
++  ls->z = z;
++  ls->fs = NULL;
++  ls->linenumber = 1;
++  ls->lastline = 1;
++  ls->source = source;
++  luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER);  /* initialize buffer */
++  next(ls);  /* read first char */
++}
++
++
++
++/*
++** =======================================================
++** LEXICAL ANALYZER
++** =======================================================
++*/
++
++
++
++static int check_next (LexState *ls, const char *set) {
++  if (!strchr(set, ls->current))
++    return 0;
++  save_and_next(ls);
++  return 1;
++}
++
++
++static void buffreplace (LexState *ls, char from, char to) {
++  size_t n = luaZ_bufflen(ls->buff);
++  char *p = luaZ_buffer(ls->buff);
++  while (n--)
++    if (p[n] == from) p[n] = to;
++}
++
++
++static void trydecpoint (LexState *ls, SemInfo *seminfo) {
++  /* format error: try to update decimal point separator */
++  char old = ls->decpoint;
++  struct lconv *cv = localeconv();
++  ls->decpoint = (cv ? cv->decimal_point[0] : '.');
++  buffreplace(ls, old, ls->decpoint);  /* try updated decimal separator */
++  if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
++    /* format error with correct decimal point: no more options */
++    buffreplace(ls, ls->decpoint, '.');  /* undo change (for error message) */
++    luaX_lexerror(ls, "malformed number", TK_NUMBER);
++  }
++}
++
++
++/* LUA_NUMBER */
++static void read_numeral (LexState *ls, SemInfo *seminfo) {
++  lua_assert(isdigit(ls->current));
++  do {
++    save_and_next(ls);
++  } while (isdigit(ls->current) || ls->current == '.');
++  if (check_next(ls, "Ee"))  /* `E'? */
++    check_next(ls, "+-");  /* optional exponent sign */
++  while (isalnum(ls->current) || ls->current == '_')
++    save_and_next(ls);
++  save(ls, '\0');
++  buffreplace(ls, '.', ls->decpoint);  /* follow locale for decimal point */
++  if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r))  /* format error? */
++    trydecpoint(ls, seminfo); /* try to update decimal point separator */
++}
++
++
++static int skip_sep (LexState *ls) {
++  int count = 0;
++  int s = ls->current;
++  lua_assert(s == '[' || s == ']');
++  save_and_next(ls);
++  while (ls->current == '=') {
++    save_and_next(ls);
++    count++;
++  }
++  return (ls->current == s) ? count : (-count) - 1;
++}
++
++
++static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) {
++  int cont = 0;
++  (void)(cont);  /* avoid warnings when `cont' is not used */
++  save_and_next(ls);  /* skip 2nd `[' */
++  if (currIsNewline(ls))  /* string starts with a newline? */
++    inclinenumber(ls);  /* skip it */
++  for (;;) {
++    switch (ls->current) {
++      case EOZ:
++        luaX_lexerror(ls, (seminfo) ? "unfinished long string" :
++                                   "unfinished long comment", TK_EOS);
++        break;  /* to avoid warnings */
++#if defined(LUA_COMPAT_LSTR)
++      case '[': {
++        if (skip_sep(ls) == sep) {
++          save_and_next(ls);  /* skip 2nd `[' */
++          cont++;
++#if LUA_COMPAT_LSTR == 1
++          if (sep == 0)
++            luaX_lexerror(ls, "nesting of [[...]] is deprecated", '[');
++#endif
++        }
++        break;
++      }
++#endif
++      case ']': {
++        if (skip_sep(ls) == sep) {
++          save_and_next(ls);  /* skip 2nd `]' */
++#if defined(LUA_COMPAT_LSTR) && LUA_COMPAT_LSTR == 2
++          cont--;
++          if (sep == 0 && cont >= 0) break;
++#endif
++          goto endloop;
++        }
++        break;
++      }
++      case '\n':
++      case '\r': {
++        save(ls, '\n');
++        inclinenumber(ls);
++        if (!seminfo) luaZ_resetbuffer(ls->buff);  /* avoid wasting space */
++        break;
++      }
++      default: {
++        if (seminfo) save_and_next(ls);
++        else next(ls);
++      }
++    }
++  } endloop:
++  if (seminfo)
++    seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + (2 + sep),
++                                     luaZ_bufflen(ls->buff) - 2*(2 + sep));
++}
++
++
++static void read_string (LexState *ls, int del, SemInfo *seminfo) {
++  save_and_next(ls);
++  while (ls->current != del) {
++    switch (ls->current) {
++      case EOZ:
++        luaX_lexerror(ls, "unfinished string", TK_EOS);
++        continue;  /* to avoid warnings */
++      case '\n':
++      case '\r':
++        luaX_lexerror(ls, "unfinished string", TK_STRING);
++        continue;  /* to avoid warnings */
++      case '\\': {
++        int c;
++        next(ls);  /* do not save the `\' */
++        switch (ls->current) {
++          case 'a': c = '\a'; break;
++          case 'b': c = '\b'; break;
++          case 'f': c = '\f'; break;
++          case 'n': c = '\n'; break;
++          case 'r': c = '\r'; break;
++          case 't': c = '\t'; break;
++          case 'v': c = '\v'; break;
++          case '\n':  /* go through */
++          case '\r': save(ls, '\n'); inclinenumber(ls); continue;
++          case EOZ: continue;  /* will raise an error next loop */
++          default: {
++            if (!isdigit(ls->current))
++              save_and_next(ls);  /* handles \\, \", \', and \? */
++            else {  /* \xxx */
++              int i = 0;
++              c = 0;
++              do {
++                c = 10*c + (ls->current-'0');
++                next(ls);
++              } while (++i<3 && isdigit(ls->current));
++              if (c > UCHAR_MAX)
++                luaX_lexerror(ls, "escape sequence too large", TK_STRING);
++              save(ls, c);
++            }
++            continue;
++          }
++        }
++        save(ls, c);
++        next(ls);
++        continue;
++      }
++      default:
++        save_and_next(ls);
++    }
++  }
++  save_and_next(ls);  /* skip delimiter */
++  seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + 1,
++                                   luaZ_bufflen(ls->buff) - 2);
++}
++
++
++static int llex (LexState *ls, SemInfo *seminfo) {
++  luaZ_resetbuffer(ls->buff);
++  for (;;) {
++    switch (ls->current) {
++      case '\n':
++      case '\r': {
++        inclinenumber(ls);
++        continue;
++      }
++      case '-': {
++        next(ls);
++        if (ls->current != '-') return '-';
++        /* else is a comment */
++        next(ls);
++        if (ls->current == '[') {
++          int sep = skip_sep(ls);
++          luaZ_resetbuffer(ls->buff);  /* `skip_sep' may dirty the buffer */
++          if (sep >= 0) {
++            read_long_string(ls, NULL, sep);  /* long comment */
++            luaZ_resetbuffer(ls->buff);
++            continue;
++          }
++        }
++        /* else short comment */
++        while (!currIsNewline(ls) && ls->current != EOZ)
++          next(ls);
++        continue;
++      }
++      case '[': {
++        int sep = skip_sep(ls);
++        if (sep >= 0) {
++          read_long_string(ls, seminfo, sep);
++          return TK_STRING;
++        }
++        else if (sep == -1) return '[';
++        else luaX_lexerror(ls, "invalid long string delimiter", TK_STRING);
++      }
++      case '=': {
++        next(ls);
++        if (ls->current != '=') return '=';
++        else { next(ls); return TK_EQ; }
++      }
++      case '<': {
++        next(ls);
++        if (ls->current != '=') return '<';
++        else { next(ls); return TK_LE; }
++      }
++      case '>': {
++        next(ls);
++        if (ls->current != '=') return '>';
++        else { next(ls); return TK_GE; }
++      }
++      case '~': {
++        next(ls);
++        if (ls->current != '=') return '~';
++        else { next(ls); return TK_NE; }
++      }
++      case '"':
++      case '\'': {
++        read_string(ls, ls->current, seminfo);
++        return TK_STRING;
++      }
++      case '.': {
++        save_and_next(ls);
++        if (check_next(ls, ".")) {
++          if (check_next(ls, "."))
++            return TK_DOTS;   /* ... */
++          else return TK_CONCAT;   /* .. */
++        }
++        else if (!isdigit(ls->current)) return '.';
++        else {
++          read_numeral(ls, seminfo);
++          return TK_NUMBER;
++        }
++      }
++      case EOZ: {
++        return TK_EOS;
++      }
++      default: {
++        if (isspace(ls->current)) {
++          lua_assert(!currIsNewline(ls));
++          next(ls);
++          continue;
++        }
++        else if (isdigit(ls->current)) {
++          read_numeral(ls, seminfo);
++          return TK_NUMBER;
++        }
++        else if (isalpha(ls->current) || ls->current == '_') {
++          /* identifier or reserved word */
++          TString *ts;
++          do {
++            save_and_next(ls);
++          } while (isalnum(ls->current) || ls->current == '_');
++          ts = luaX_newstring(ls, luaZ_buffer(ls->buff),
++                                  luaZ_bufflen(ls->buff));
++          if (ts->tsv.reserved > 0)  /* reserved word? */
++            return ts->tsv.reserved - 1 + FIRST_RESERVED;
++          else {
++            seminfo->ts = ts;
++            return TK_NAME;
++          }
++        }
++        else {
++          int c = ls->current;
++          next(ls);
++          return c;  /* single-char tokens (+ - / ...) */
++        }
++      }
++    }
++  }
++}
++
++
++void luaX_next (LexState *ls) {
++  ls->lastline = ls->linenumber;
++  if (ls->lookahead.token != TK_EOS) {  /* is there a look-ahead token? */
++    ls->t = ls->lookahead;  /* use this one */
++    ls->lookahead.token = TK_EOS;  /* and discharge it */
++  }
++  else
++    ls->t.token = llex(ls, &ls->t.seminfo);  /* read next token */
++}
++
++
++void luaX_lookahead (LexState *ls) {
++  lua_assert(ls->lookahead.token == TK_EOS);
++  ls->lookahead.token = llex(ls, &ls->lookahead.seminfo);
++}
++
+--- /dev/null
++++ b/extensions/LUA/lua/llex.h
+@@ -0,0 +1,81 @@
++/*
++** $Id: llex.h,v 1.58.1.1 2007/12/27 13:02:25 roberto Exp $
++** Lexical Analyzer
++** See Copyright Notice in lua.h
++*/
++
++#ifndef llex_h
++#define llex_h
++
++#include "lobject.h"
++#include "lzio.h"
++
++
++#define FIRST_RESERVED        257
++
++/* maximum length of a reserved word */
++#define TOKEN_LEN     (sizeof("function")/sizeof(char))
++
++
++/*
++* WARNING: if you change the order of this enumeration,
++* grep "ORDER RESERVED"
++*/
++enum RESERVED {
++  /* terminal symbols denoted by reserved words */
++  TK_AND = FIRST_RESERVED, TK_BREAK,
++  TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION,
++  TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT,
++  TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE,
++  /* other terminal symbols */
++  TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_NUMBER,
++  TK_NAME, TK_STRING, TK_EOS
++};
++
++/* number of reserved words */
++#define NUM_RESERVED  (cast(int, TK_WHILE-FIRST_RESERVED+1))
++
++
++/* array with token `names' */
++LUAI_DATA const char *const luaX_tokens [];
++
++
++typedef union {
++  lua_Number r;
++  TString *ts;
++} SemInfo;  /* semantics information */
++
++
++typedef struct Token {
++  int token;
++  SemInfo seminfo;
++} Token;
++
++
++typedef struct LexState {
++  int current;  /* current character (charint) */
++  int linenumber;  /* input line counter */
++  int lastline;  /* line of last token `consumed' */
++  Token t;  /* current token */
++  Token lookahead;  /* look ahead token */
++  struct FuncState *fs;  /* `FuncState' is private to the parser */
++  struct lua_State *L;
++  ZIO *z;  /* input stream */
++  Mbuffer *buff;  /* buffer for tokens */
++  TString *source;  /* current source name */
++  char decpoint;  /* locale decimal point */
++} LexState;
++
++
++LUAI_FUNC void luaX_init (lua_State *L);
++LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z,
++                              TString *source);
++LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l);
++LUAI_FUNC void luaX_next (LexState *ls);
++LUAI_FUNC void luaX_lookahead (LexState *ls);
++LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token);
++LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s);
++LUAI_FUNC const char *luaX_token2str (LexState *ls, int token);
++
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/llimits.h
+@@ -0,0 +1,125 @@
++/*
++** $Id: llimits.h,v 1.69.1.1 2007/12/27 13:02:25 roberto Exp $
++** Limits, basic types, and some other `installation-dependent' definitions
++** See Copyright Notice in lua.h
++*/
++
++#ifndef llimits_h
++#define llimits_h
++
++#include <stddef.h>
++#include <limits.h>
++
++#include "lua.h"
++
++typedef LUAI_UINT32 lu_int32;
++
++typedef LUAI_UMEM lu_mem;
++
++typedef LUAI_MEM l_mem;
++
++
++
++/* chars used as small naturals (so that `char' is reserved for characters) */
++typedef unsigned char lu_byte;
++
++
++#define MAX_SIZET     ((size_t)(~(size_t)0)-2)
++
++#define MAX_LUMEM     ((lu_mem)(~(lu_mem)0)-2)
++
++
++#define MAX_INT (LUA_INT_MAX-2)  /* maximum value of an int (-2 for safety) */
++
++/*
++** conversion of pointer to integer
++** this is for hashing only; there is no problem if the integer
++** cannot hold the whole pointer value
++*/
++#define IntPoint(p)  ((unsigned int)(lu_mem)(p))
++
++
++
++/* type to ensure maximum alignment */
++typedef LUAI_USER_ALIGNMENT_T L_Umaxalign;
++
++
++/* result of a `usual argument conversion' over lua_Number */
++typedef LUAI_UACNUMBER l_uacNumber;
++
++
++/* internal assertions for in-house debugging */
++#ifdef lua_assert
++
++#define check_exp(c,e)                (lua_assert(c), (e))
++#define api_check(l,e)                lua_assert(e)
++
++#else
++
++#define lua_assert(c)         ((void)0)
++#define check_exp(c,e)                (e)
++#define api_check             luai_apicheck
++
++#endif
++
++
++#ifndef UNUSED
++#define UNUSED(x)     ((void)(x))     /* to avoid warnings */
++#endif
++
++
++#ifndef cast
++#define cast(t, exp)  ((t)(exp))
++#endif
++
++#define cast_byte(i)  cast(lu_byte, (i))
++#define cast_num(i)   cast(lua_Number, (i))
++#define cast_int(i)   cast(int, (i))
++
++
++
++/*
++** type for virtual-machine instructions
++** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h)
++*/
++typedef lu_int32 Instruction;
++
++
++
++/* maximum stack for a Lua function */
++#define MAXSTACK      250
++
++
++
++/* minimum size for the string table (must be power of 2) */
++#ifndef MINSTRTABSIZE
++#define MINSTRTABSIZE 32
++#endif
++
++
++/* minimum size for string buffer */
++#ifndef LUA_MINBUFFER
++#define LUA_MINBUFFER 32
++#endif
++
++
++#ifndef lua_lock
++#define lua_lock(L)     ((void) 0) 
++#define lua_unlock(L)   ((void) 0)
++#endif
++
++#ifndef luai_threadyield
++#define luai_threadyield(L)     {lua_unlock(L); lua_lock(L);}
++#endif
++
++
++/*
++** macro to control inclusion of some hard tests on stack reallocation
++*/ 
++#ifndef HARDSTACKTESTS
++#define condhardstacktests(x) ((void)0)
++#else
++#define condhardstacktests(x) x
++#endif
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/lmem.c
+@@ -0,0 +1,86 @@
++/*
++** $Id: lmem.c,v 1.70.1.1 2007/12/27 13:02:25 roberto Exp $
++** Interface to Memory Manager
++** See Copyright Notice in lua.h
++*/
++
++
++#include <stddef.h>
++
++#define lmem_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "ldebug.h"
++#include "ldo.h"
++#include "lmem.h"
++#include "lobject.h"
++#include "lstate.h"
++
++
++
++/*
++** About the realloc function:
++** void * frealloc (void *ud, void *ptr, size_t osize, size_t nsize);
++** (`osize' is the old size, `nsize' is the new size)
++**
++** Lua ensures that (ptr == NULL) iff (osize == 0).
++**
++** * frealloc(ud, NULL, 0, x) creates a new block of size `x'
++**
++** * frealloc(ud, p, x, 0) frees the block `p'
++** (in this specific case, frealloc must return NULL).
++** particularly, frealloc(ud, NULL, 0, 0) does nothing
++** (which is equivalent to free(NULL) in ANSI C)
++**
++** frealloc returns NULL if it cannot create or reallocate the area
++** (any reallocation to an equal or smaller size cannot fail!)
++*/
++
++
++
++#define MINSIZEARRAY  4
++
++
++void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems,
++                     int limit, const char *errormsg) {
++  void *newblock;
++  int newsize;
++  if (*size >= limit/2) {  /* cannot double it? */
++    if (*size >= limit)  /* cannot grow even a little? */
++      luaG_runerror(L, errormsg);
++    newsize = limit;  /* still have at least one free place */
++  }
++  else {
++    newsize = (*size)*2;
++    if (newsize < MINSIZEARRAY)
++      newsize = MINSIZEARRAY;  /* minimum size */
++  }
++  newblock = luaM_reallocv(L, block, *size, newsize, size_elems);
++  *size = newsize;  /* update only when everything else is OK */
++  return newblock;
++}
++
++
++void *luaM_toobig (lua_State *L) {
++  luaG_runerror(L, "memory allocation error: block too big");
++  return NULL;  /* to avoid warnings */
++}
++
++
++
++/*
++** generic allocation routine.
++*/
++void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) {
++  global_State *g = G(L);
++  lua_assert((osize == 0) == (block == NULL));
++  block = (*g->frealloc)(g->ud, block, osize, nsize);
++  if (block == NULL && nsize > 0)
++    luaD_throw(L, LUA_ERRMEM);
++  lua_assert((nsize == 0) == (block == NULL));
++  g->totalbytes = (g->totalbytes - osize) + nsize;
++  return block;
++}
++
+--- /dev/null
++++ b/extensions/LUA/lua/lmem.h
+@@ -0,0 +1,49 @@
++/*
++** $Id: lmem.h,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $
++** Interface to Memory Manager
++** See Copyright Notice in lua.h
++*/
++
++#ifndef lmem_h
++#define lmem_h
++
++
++#include <stddef.h>
++
++#include "llimits.h"
++#include "lua.h"
++
++#define MEMERRMSG     "not enough memory"
++
++
++#define luaM_reallocv(L,b,on,n,e) \
++      ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ?  /* +1 to avoid warnings */ \
++              luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
++              luaM_toobig(L))
++
++#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0)
++#define luaM_free(L, b)               luaM_realloc_(L, (b), sizeof(*(b)), 0)
++#define luaM_freearray(L, b, n, t)   luaM_reallocv(L, (b), n, 0, sizeof(t))
++
++#define luaM_malloc(L,t)      luaM_realloc_(L, NULL, 0, (t))
++#define luaM_new(L,t)         cast(t *, luaM_malloc(L, sizeof(t)))
++#define luaM_newvector(L,n,t) \
++              cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
++
++#define luaM_growvector(L,v,nelems,size,t,limit,e) \
++          if ((nelems)+1 > (size)) \
++            ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e)))
++
++#define luaM_reallocvector(L, v,oldn,n,t) \
++   ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t))))
++
++
++LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize,
++                                                          size_t size);
++LUAI_FUNC void *luaM_toobig (lua_State *L);
++LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size,
++                               size_t size_elem, int limit,
++                               const char *errormsg);
++
++#endif
++
+--- /dev/null
++++ b/extensions/LUA/lua/lobject.c
+@@ -0,0 +1,215 @@
++/*
++** $Id: lobject.c,v 2.22.1.1 2007/12/27 13:02:25 roberto Exp $
++** Some generic functions over Lua objects
++** See Copyright Notice in lua.h
++*/
++
++#include <stdarg.h>
++
++#include <ctype.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#define lobject_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "ldo.h"
++#include "lmem.h"
++#include "lobject.h"
++#include "lstate.h"
++#include "lstring.h"
++#include "lvm.h"
++
++
++
++const TValue luaO_nilobject_ = {{NULL}, LUA_TNIL};
++
++
++/*
++** converts an integer to a "floating point byte", represented as
++** (eeeeexxx), where the real value is (1xxx) * 2^(eeeee - 1) if
++** eeeee != 0 and (xxx) otherwise.
++*/
++int luaO_int2fb (unsigned int x) {
++  int e = 0;  /* expoent */
++  while (x >= 16) {
++    x = (x+1) >> 1;
++    e++;
++  }
++  if (x < 8) return x;
++  else return ((e+1) << 3) | (cast_int(x) - 8);
++}
++
++
++/* converts back */
++int luaO_fb2int (int x) {
++  int e = (x >> 3) & 31;
++  if (e == 0) return x;
++  else return ((x & 7)+8) << (e - 1);
++}
++
++
++int luaO_log2 (unsigned int x) {
++  static const lu_byte log_2[256] = {
++    0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
++    6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
++    7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
++    7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
++    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
++    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
++    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
++    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
++  };
++  int l = -1;
++  while (x >= 256) { l += 8; x >>= 8; }
++  return l + log_2[x];
++
++}
++
++
++int luaO_rawequalObj (const TValue *t1, const TValue *t2) {
++  if (ttype(t1) != ttype(t2)) return 0;
++  else switch (ttype(t1)) {
++    case LUA_TNIL:
++      return 1;
++    case LUA_TNUMBER:
++      return luai_numeq(nvalue(t1), nvalue(t2));
++    case LUA_TBOOLEAN:
++      return bvalue(t1) == bvalue(t2);  /* boolean true must be 1 !! */
++    case LUA_TLIGHTUSERDATA:
++      return pvalue(t1) == pvalue(t2);
++    default:
++      lua_assert(iscollectable(t1));
++      return gcvalue(t1) == gcvalue(t2);
++  }
++}
++
++
++int luaO_str2d (const char *s, lua_Number *result) {
++  char *endptr;
++  *result = lua_str2number(s, &endptr);
++  if (endptr == s) return 0;  /* conversion failed */
++  if (*endptr == 'x' || *endptr == 'X')  /* maybe an hexadecimal constant? */
++    *result = cast_num(strtoul(s, &endptr, 16));
++  if (*endptr == '\0') return 1;  /* most common case */
++  while (isspace(cast(unsigned char, *endptr))) endptr++;
++  if (*endptr != '\0') return 0;  /* invalid trailing characters? */
++  return 1;
++}
++
++
++
++static void pushstr (lua_State *L, const char *str) {
++  setsvalue2s(L, L->top, luaS_new(L, str));
++  incr_top(L);
++}
++
++
++/* this function handles only `%d', `%c', %f, %p, and `%s' formats */
++const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) {
++  int n = 1;
++  pushstr(L, "");
++  for (;;) {
++    const char *e = strchr(fmt, '%');
++    if (e == NULL) break;
++    setsvalue2s(L, L->top, luaS_newlstr(L, fmt, e-fmt));
++    incr_top(L);
++    switch (*(e+1)) {
++      case 's': {
++        const char *s = va_arg(argp, char *);
++        if (s == NULL) s = "(null)";
++        pushstr(L, s);
++        break;
++      }
++      case 'c': {
++        char buff[2];
++        buff[0] = cast(char, va_arg(argp, int));
++        buff[1] = '\0';
++        pushstr(L, buff);
++        break;
++      }
++      case 'd': {
++        setnvalue(L->top, cast_num(va_arg(argp, int)));
++        incr_top(L);
++        break;
++      }
++      case 'f': {
++        setnvalue(L->top, cast_num(va_arg(argp, l_uacNumber)));
++        incr_top(L);
++        break;
++      }
++      case 'p': {
++        char buff[4*sizeof(void *) + 8]; /* should be enough space for a `%p' */
++        sprintf(buff, "%p", va_arg(argp, void *));
++        pushstr(L, buff);
++        break;
++      }
++      case '%': {
++        pushstr(L, "%");
++        break;
++      }
++      default: {
++        char buff[3];
++        buff[0] = '%';
++        buff[1] = *(e+1);
++        buff[2] = '\0';
++        pushstr(L, buff);
++        break;
++      }
++    }
++    n += 2;
++    fmt = e+2;
++  }
++  pushstr(L, fmt);
++  luaV_concat(L, n+1, cast_int(L->top - L->base) - 1);
++  L->top -= n;
++  return svalue(L->top - 1);
++}
++
++
++const char *luaO_pushfstring (lua_State *L, const char *fmt, ...) {
++  const char *msg;
++  va_list argp;
++  va_start(argp, fmt);
++  msg = luaO_pushvfstring(L, fmt, argp);
++  va_end(argp);
++  return msg;
++}
++
++
++void luaO_chunkid (char *out, const char *source, size_t bufflen) {
++  if (*source == '=') {
++    strncpy(out, source+1, bufflen);  /* remove first char */
++    out[bufflen-1] = '\0';  /* ensures null termination */
++  }
++  else {  /* out = "source", or "...source" */
++    if (*source == '@') {
++      size_t l;
++      source++;  /* skip the `@' */
++      bufflen -= sizeof(" '...' ");
++      l = strlen(source);
++      strcpy(out, "");
++      if (l > bufflen) {
++        source += (l-bufflen);  /* get last part of file name */
++        strcat(out, "...");
++      }
++      strcat(out, source);
++    }
++    else {  /* out = [string "string"] */
++      size_t len = strcspn(source, "\n\r");  /* stop at first newline */
++      bufflen -= sizeof(" [string \"...\"] ");
++      if (len > bufflen) len = bufflen;
++      strcpy(out, "[string \"");
++      if (source[len] != '\0') {  /* must truncate? */
++        strncat(out, source, len);
++        strcat(out, "...");
++      }
++      else
++        strcat(out, source);
++      strcat(out, "\"]");
++    }
++  }
++}
+--- /dev/null
++++ b/extensions/LUA/lua/lobject.h
+@@ -0,0 +1,381 @@
++/*
++** $Id: lobject.h,v 2.20.1.2 2008/08/06 13:29:48 roberto Exp $
++** Type definitions for Lua objects
++** See Copyright Notice in lua.h
++*/
++
++
++#ifndef lobject_h
++#define lobject_h
++
++
++#include <stdarg.h>
++
++
++#include "llimits.h"
++#include "lua.h"
++
++
++/* tags for values visible from Lua */
++#define LAST_TAG      LUA_TTHREAD
++
++#define NUM_TAGS      (LAST_TAG+1)
++
++
++/*
++** Extra tags for non-values
++*/
++#define LUA_TPROTO    (LAST_TAG+1)
++#define LUA_TUPVAL    (LAST_TAG+2)
++#define LUA_TDEADKEY  (LAST_TAG+3)
++
++
++/*
++** Union of all collectable objects
++*/
++typedef union GCObject GCObject;
++
++
++/*
++** Common Header for all collectable objects (in macro form, to be
++** included in other objects)
++*/
++#define CommonHeader  GCObject *next; lu_byte tt; lu_byte marked
++
++
++/*
++** Common header in struct form
++*/
++typedef struct GCheader {
++  CommonHeader;
++} GCheader;
++
++
++
++
++/*
++** Union of all Lua values
++*/
++typedef union {
++  GCObject *gc;
++  void *p;
++  lua_Number n;
++  int b;
++} Value;
++
++
++/*
++** Tagged Values
++*/
++
++#define TValuefields  Value value; int tt
++
++typedef struct lua_TValue {
++  TValuefields;
++} TValue;
++
++
++/* Macros to test type */
++#define ttisnil(o)    (ttype(o) == LUA_TNIL)
++#define ttisnumber(o) (ttype(o) == LUA_TNUMBER)
++#define ttisstring(o) (ttype(o) == LUA_TSTRING)
++#define ttistable(o)  (ttype(o) == LUA_TTABLE)
++#define ttisfunction(o)       (ttype(o) == LUA_TFUNCTION)
++#define ttisboolean(o)        (ttype(o) == LUA_TBOOLEAN)
++#define ttisuserdata(o)       (ttype(o) == LUA_TUSERDATA)
++#define ttisthread(o) (ttype(o) == LUA_TTHREAD)
++#define ttislightuserdata(o)  (ttype(o) == LUA_TLIGHTUSERDATA)
++
++/* Macros to access values */
++#define ttype(o)      ((o)->tt)
++#define gcvalue(o)    check_exp(iscollectable(o), (o)->value.gc)
++#define pvalue(o)     check_exp(ttislightuserdata(o), (o)->value.p)
++#define nvalue(o)     check_exp(ttisnumber(o), (o)->value.n)
++#define rawtsvalue(o) check_exp(ttisstring(o), &(o)->value.gc->ts)
++#define tsvalue(o)    (&rawtsvalue(o)->tsv)
++#define rawuvalue(o)  check_exp(ttisuserdata(o), &(o)->value.gc->u)
++#define uvalue(o)     (&rawuvalue(o)->uv)
++#define clvalue(o)    check_exp(ttisfunction(o), &(o)->value.gc->cl)
++#define hvalue(o)     check_exp(ttistable(o), &(o)->value.gc->h)
++#define bvalue(o)     check_exp(ttisboolean(o), (o)->value.b)
++#define thvalue(o)    check_exp(ttisthread(o), &(o)->value.gc->th)
++
++#define l_isfalse(o)  (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0))
++
++/*
++** for internal debug only
++*/
++#define checkconsistency(obj) \
++  lua_assert(!iscollectable(obj) || (ttype(obj) == (obj)->value.gc->gch.tt))
++
++#define checkliveness(g,obj) \
++  lua_assert(!iscollectable(obj) || \
++  ((ttype(obj) == (obj)->value.gc->gch.tt) && !isdead(g, (obj)->value.gc)))
++
++
++/* Macros to set values */
++#define setnilvalue(obj) ((obj)->tt=LUA_TNIL)
++
++#define setnvalue(obj,x) \
++  { TValue *i_o=(obj); i_o->value.n=(x); i_o->tt=LUA_TNUMBER; }
++
++#define setpvalue(obj,x) \
++  { TValue *i_o=(obj); i_o->value.p=(x); i_o->tt=LUA_TLIGHTUSERDATA; }
++
++#define setbvalue(obj,x) \
++  { TValue *i_o=(obj); i_o->value.b=(x); i_o->tt=LUA_TBOOLEAN; }
++
++#define setsvalue(L,obj,x) \
++  { TValue *i_o=(obj); \
++    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TSTRING; \
++    checkliveness(G(L),i_o); }
++
++#define setuvalue(L,obj,x) \
++  { TValue *i_o=(obj); \
++    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TUSERDATA; \
++    checkliveness(G(L),i_o); }
++
++#define setthvalue(L,obj,x) \
++  { TValue *i_o=(obj); \
++    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTHREAD; \
++    checkliveness(G(L),i_o); }
++
++#define setclvalue(L,obj,x) \
++  { TValue *i_o=(obj); \
++    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TFUNCTION; \
++    checkliveness(G(L),i_o); }
++
++#define sethvalue(L,obj,x) \
++  { TValue *i_o=(obj); \
++    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTABLE; \
++    checkliveness(G(L),i_o); }
++
++#define setptvalue(L,obj,x) \
++  { TValue *i_o=(obj); \
++    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TPROTO; \
++    checkliveness(G(L),i_o); }
++
++
++
++
++#define setobj(L,obj1,obj2) \
++  { const TValue *o2=(obj2); TValue *o1=(obj1); \
++    o1->value = o2->value; o1->tt=o2->tt; \
++    checkliveness(G(L),o1); }
++
++
++/*
++** different types of sets, according to destination
++*/
++
++/* from stack to (same) stack */
++#define setobjs2s     setobj
++/* to stack (not from same stack) */
++#define setobj2s      setobj
++#define setsvalue2s   setsvalue
++#define sethvalue2s   sethvalue
++#define setptvalue2s  setptvalue
++/* from table to same table */
++#define setobjt2t     setobj
++/* to table */
++#define setobj2t      setobj
++/* to new object */
++#define setobj2n      setobj
++#define setsvalue2n   setsvalue
++
++#define setttype(obj, tt) (ttype(obj) = (tt))
++
++
++#define iscollectable(o)      (ttype(o) >= LUA_TSTRING)
++
++
++
++typedef TValue *StkId;  /* index to stack elements */
++
++
++/*
++** String headers for string table
++*/
++typedef union TString {
++  L_Umaxalign dummy;  /* ensures maximum alignment for strings */
++  struct {
++    CommonHeader;
++    lu_byte reserved;
++    unsigned int hash;
++    size_t len;
++  } tsv;
++} TString;
++
++
++#define getstr(ts)    cast(const char *, (ts) + 1)
++#define svalue(o)       getstr(rawtsvalue(o))
++
++
++
++typedef union Udata {
++  L_Umaxalign dummy;  /* ensures maximum alignment for `local' udata */
++  struct {
++    CommonHeader;
++    struct Table *metatable;
++    struct Table *env;
++    size_t len;
++  } uv;
++} Udata;
++
++
++
++
++/*
++** Function Prototypes
++*/
++typedef struct Proto {
++  CommonHeader;
++  TValue *k;  /* constants used by the function */
++  Instruction *code;
++  struct Proto **p;  /* functions defined inside the function */
++  int *lineinfo;  /* map from opcodes to source lines */
++  struct LocVar *locvars;  /* information about local variables */
++  TString **upvalues;  /* upvalue names */
++  TString  *source;
++  int sizeupvalues;
++  int sizek;  /* size of `k' */
++  int sizecode;
++  int sizelineinfo;
++  int sizep;  /* size of `p' */
++  int sizelocvars;
++  int linedefined;
++  int lastlinedefined;
++  GCObject *gclist;
++  lu_byte nups;  /* number of upvalues */
++  lu_byte numparams;
++  lu_byte is_vararg;
++  lu_byte maxstacksize;
++} Proto;
++
++
++/* masks for new-style vararg */
++#define VARARG_HASARG         1
++#define VARARG_ISVARARG               2
++#define VARARG_NEEDSARG               4
++
++
++typedef struct LocVar {
++  TString *varname;
++  int startpc;  /* first point where variable is active */
++  int endpc;    /* first point where variable is dead */
++} LocVar;
++
++
++
++/*
++** Upvalues
++*/
++
++typedef struct UpVal {
++  CommonHeader;
++  TValue *v;  /* points to stack or to its own value */
++  union {
++    TValue value;  /* the value (when closed) */
++    struct {  /* double linked list (when open) */
++      struct UpVal *prev;
++      struct UpVal *next;
++    } l;
++  } u;
++} UpVal;
++
++
++/*
++** Closures
++*/
++
++#define ClosureHeader \
++      CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist; \
++      struct Table *env
++
++typedef struct CClosure {
++  ClosureHeader;
++  lua_CFunction f;
++  TValue upvalue[1];
++} CClosure;
++
++
++typedef struct LClosure {
++  ClosureHeader;
++  struct Proto *p;
++  UpVal *upvals[1];
++} LClosure;
++
++
++typedef union Closure {
++  CClosure c;
++  LClosure l;
++} Closure;
++
++
++#define iscfunction(o)        (ttype(o) == LUA_TFUNCTION && clvalue(o)->c.isC)
++#define isLfunction(o)        (ttype(o) == LUA_TFUNCTION && !clvalue(o)->c.isC)
++
++
++/*
++** Tables
++*/
++
++typedef union TKey {
++  struct {
++    TValuefields;
++    struct Node *next;  /* for chaining */
++  } nk;
++  TValue tvk;
++} TKey;
++
++
++typedef struct Node {
++  TValue i_val;
++  TKey i_key;
++} Node;
++
++
++typedef struct Table {
++  CommonHeader;
++  lu_byte flags;  /* 1<<p means tagmethod(p) is not present */ 
++  lu_byte lsizenode;  /* log2 of size of `node' array */
++  struct Table *metatable;
++  TValue *array;  /* array part */
++  Node *node;
++  Node *lastfree;  /* any free position is before this position */
++  GCObject *gclist;
++  int sizearray;  /* size of `array' array */
++} Table;
++
++
++
++/*
++** `module' operation for hashing (size is always a power of 2)
++*/
++#define lmod(s,size) \
++      (check_exp((size&(size-1))==0, (cast(int, (s) & ((size)-1)))))
++
++
++#define twoto(x)      (1<<(x))
++#define sizenode(t)   (twoto((t)->lsizenode))
++
++
++#define luaO_nilobject                (&luaO_nilobject_)
++
++LUAI_DATA const TValue luaO_nilobject_;
++
++#define ceillog2(x)   (luaO_log2((x)-1) + 1)
++
++LUAI_FUNC int luaO_log2 (unsigned int x);
++LUAI_FUNC int luaO_int2fb (unsigned int x);
++LUAI_FUNC int luaO_fb2int (int x);
++LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2);
++LUAI_FUNC int luaO_str2d (const char *s, lua_Number *result);
++LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt,
++                                                       va_list argp);
++LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...);
++LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len);
++
++
++#endif
++
+--- /dev/null
++++ b/extensions/LUA/lua/lopcodes.c
+@@ -0,0 +1,102 @@
++/*
++** $Id: lopcodes.c,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $
++** See Copyright Notice in lua.h
++*/
++
++
++#define lopcodes_c
++#define LUA_CORE
++
++
++#include "lopcodes.h"
++
++
++/* ORDER OP */
++
++const char *const luaP_opnames[NUM_OPCODES+1] = {
++  "MOVE",
++  "LOADK",
++  "LOADBOOL",
++  "LOADNIL",
++  "GETUPVAL",
++  "GETGLOBAL",
++  "GETTABLE",
++  "SETGLOBAL",
++  "SETUPVAL",
++  "SETTABLE",
++  "NEWTABLE",
++  "SELF",
++  "ADD",
++  "SUB",
++  "MUL",
++  "DIV",
++  "MOD",
++  "POW",
++  "UNM",
++  "NOT",
++  "LEN",
++  "CONCAT",
++  "JMP",
++  "EQ",
++  "LT",
++  "LE",
++  "TEST",
++  "TESTSET",
++  "CALL",
++  "TAILCALL",
++  "RETURN",
++  "FORLOOP",
++  "FORPREP",
++  "TFORLOOP",
++  "SETLIST",
++  "CLOSE",
++  "CLOSURE",
++  "VARARG",
++  NULL
++};
++
++
++#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m))
++
++const lu_byte luaP_opmodes[NUM_OPCODES] = {
++/*       T  A    B       C     mode              opcode       */
++  opmode(0, 1, OpArgR, OpArgN, iABC)          /* OP_MOVE */
++ ,opmode(0, 1, OpArgK, OpArgN, iABx)          /* OP_LOADK */
++ ,opmode(0, 1, OpArgU, OpArgU, iABC)          /* OP_LOADBOOL */
++ ,opmode(0, 1, OpArgR, OpArgN, iABC)          /* OP_LOADNIL */
++ ,opmode(0, 1, OpArgU, OpArgN, iABC)          /* OP_GETUPVAL */
++ ,opmode(0, 1, OpArgK, OpArgN, iABx)          /* OP_GETGLOBAL */
++ ,opmode(0, 1, OpArgR, OpArgK, iABC)          /* OP_GETTABLE */
++ ,opmode(0, 0, OpArgK, OpArgN, iABx)          /* OP_SETGLOBAL */
++ ,opmode(0, 0, OpArgU, OpArgN, iABC)          /* OP_SETUPVAL */
++ ,opmode(0, 0, OpArgK, OpArgK, iABC)          /* OP_SETTABLE */
++ ,opmode(0, 1, OpArgU, OpArgU, iABC)          /* OP_NEWTABLE */
++ ,opmode(0, 1, OpArgR, OpArgK, iABC)          /* OP_SELF */
++ ,opmode(0, 1, OpArgK, OpArgK, iABC)          /* OP_ADD */
++ ,opmode(0, 1, OpArgK, OpArgK, iABC)          /* OP_SUB */
++ ,opmode(0, 1, OpArgK, OpArgK, iABC)          /* OP_MUL */
++ ,opmode(0, 1, OpArgK, OpArgK, iABC)          /* OP_DIV */
++ ,opmode(0, 1, OpArgK, OpArgK, iABC)          /* OP_MOD */
++ ,opmode(0, 1, OpArgK, OpArgK, iABC)          /* OP_POW */
++ ,opmode(0, 1, OpArgR, OpArgN, iABC)          /* OP_UNM */
++ ,opmode(0, 1, OpArgR, OpArgN, iABC)          /* OP_NOT */
++ ,opmode(0, 1, OpArgR, OpArgN, iABC)          /* OP_LEN */
++ ,opmode(0, 1, OpArgR, OpArgR, iABC)          /* OP_CONCAT */
++ ,opmode(0, 0, OpArgR, OpArgN, iAsBx)         /* OP_JMP */
++ ,opmode(1, 0, OpArgK, OpArgK, iABC)          /* OP_EQ */
++ ,opmode(1, 0, OpArgK, OpArgK, iABC)          /* OP_LT */
++ ,opmode(1, 0, OpArgK, OpArgK, iABC)          /* OP_LE */
++ ,opmode(1, 1, OpArgR, OpArgU, iABC)          /* OP_TEST */
++ ,opmode(1, 1, OpArgR, OpArgU, iABC)          /* OP_TESTSET */
++ ,opmode(0, 1, OpArgU, OpArgU, iABC)          /* OP_CALL */
++ ,opmode(0, 1, OpArgU, OpArgU, iABC)          /* OP_TAILCALL */
++ ,opmode(0, 0, OpArgU, OpArgN, iABC)          /* OP_RETURN */
++ ,opmode(0, 1, OpArgR, OpArgN, iAsBx)         /* OP_FORLOOP */
++ ,opmode(0, 1, OpArgR, OpArgN, iAsBx)         /* OP_FORPREP */
++ ,opmode(1, 0, OpArgN, OpArgU, iABC)          /* OP_TFORLOOP */
++ ,opmode(0, 0, OpArgU, OpArgU, iABC)          /* OP_SETLIST */
++ ,opmode(0, 0, OpArgN, OpArgN, iABC)          /* OP_CLOSE */
++ ,opmode(0, 1, OpArgU, OpArgN, iABx)          /* OP_CLOSURE */
++ ,opmode(0, 1, OpArgU, OpArgN, iABC)          /* OP_VARARG */
++};
++
+--- /dev/null
++++ b/extensions/LUA/lua/lopcodes.h
+@@ -0,0 +1,268 @@
++/*
++** $Id: lopcodes.h,v 1.125.1.1 2007/12/27 13:02:25 roberto Exp $
++** Opcodes for Lua virtual machine
++** See Copyright Notice in lua.h
++*/
++
++#ifndef lopcodes_h
++#define lopcodes_h
++
++#include "llimits.h"
++
++
++/*===========================================================================
++  We assume that instructions are unsigned numbers.
++  All instructions have an opcode in the first 6 bits.
++  Instructions can have the following fields:
++      `A' : 8 bits
++      `B' : 9 bits
++      `C' : 9 bits
++      `Bx' : 18 bits (`B' and `C' together)
++      `sBx' : signed Bx
++
++  A signed argument is represented in excess K; that is, the number
++  value is the unsigned value minus K. K is exactly the maximum value
++  for that argument (so that -max is represented by 0, and +max is
++  represented by 2*max), which is half the maximum for the corresponding
++  unsigned argument.
++===========================================================================*/
++
++
++enum OpMode {iABC, iABx, iAsBx};  /* basic instruction format */
++
++
++/*
++** size and position of opcode arguments.
++*/
++#define SIZE_C                9
++#define SIZE_B                9
++#define SIZE_Bx               (SIZE_C + SIZE_B)
++#define SIZE_A                8
++
++#define SIZE_OP               6
++
++#define POS_OP                0
++#define POS_A         (POS_OP + SIZE_OP)
++#define POS_C         (POS_A + SIZE_A)
++#define POS_B         (POS_C + SIZE_C)
++#define POS_Bx                POS_C
++
++
++/*
++** limits for opcode arguments.
++** we use (signed) int to manipulate most arguments,
++** so they must fit in LUAI_BITSINT-1 bits (-1 for sign)
++*/
++#if SIZE_Bx < LUAI_BITSINT-1
++#define MAXARG_Bx        ((1<<SIZE_Bx)-1)
++#define MAXARG_sBx        (MAXARG_Bx>>1)         /* `sBx' is signed */
++#else
++#define MAXARG_Bx        MAX_INT
++#define MAXARG_sBx        MAX_INT
++#endif
++
++
++#define MAXARG_A        ((1<<SIZE_A)-1)
++#define MAXARG_B        ((1<<SIZE_B)-1)
++#define MAXARG_C        ((1<<SIZE_C)-1)
++
++
++/* creates a mask with `n' 1 bits at position `p' */
++#define MASK1(n,p)    ((~((~(Instruction)0)<<n))<<p)
++
++/* creates a mask with `n' 0 bits at position `p' */
++#define MASK0(n,p)    (~MASK1(n,p))
++
++/*
++** the following macros help to manipulate instructions
++*/
++
++#define GET_OPCODE(i) (cast(OpCode, ((i)>>POS_OP) & MASK1(SIZE_OP,0)))
++#define SET_OPCODE(i,o)       ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \
++              ((cast(Instruction, o)<<POS_OP)&MASK1(SIZE_OP,POS_OP))))
++
++#define GETARG_A(i)   (cast(int, ((i)>>POS_A) & MASK1(SIZE_A,0)))
++#define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \
++              ((cast(Instruction, u)<<POS_A)&MASK1(SIZE_A,POS_A))))
++
++#define GETARG_B(i)   (cast(int, ((i)>>POS_B) & MASK1(SIZE_B,0)))
++#define SETARG_B(i,b) ((i) = (((i)&MASK0(SIZE_B,POS_B)) | \
++              ((cast(Instruction, b)<<POS_B)&MASK1(SIZE_B,POS_B))))
++
++#define GETARG_C(i)   (cast(int, ((i)>>POS_C) & MASK1(SIZE_C,0)))
++#define SETARG_C(i,b) ((i) = (((i)&MASK0(SIZE_C,POS_C)) | \
++              ((cast(Instruction, b)<<POS_C)&MASK1(SIZE_C,POS_C))))
++
++#define GETARG_Bx(i)  (cast(int, ((i)>>POS_Bx) & MASK1(SIZE_Bx,0)))
++#define SETARG_Bx(i,b)        ((i) = (((i)&MASK0(SIZE_Bx,POS_Bx)) | \
++              ((cast(Instruction, b)<<POS_Bx)&MASK1(SIZE_Bx,POS_Bx))))
++
++#define GETARG_sBx(i) (GETARG_Bx(i)-MAXARG_sBx)
++#define SETARG_sBx(i,b)       SETARG_Bx((i),cast(unsigned int, (b)+MAXARG_sBx))
++
++
++#define CREATE_ABC(o,a,b,c)   ((cast(Instruction, o)<<POS_OP) \
++                      | (cast(Instruction, a)<<POS_A) \
++                      | (cast(Instruction, b)<<POS_B) \
++                      | (cast(Instruction, c)<<POS_C))
++
++#define CREATE_ABx(o,a,bc)    ((cast(Instruction, o)<<POS_OP) \
++                      | (cast(Instruction, a)<<POS_A) \
++                      | (cast(Instruction, bc)<<POS_Bx))
++
++
++/*
++** Macros to operate RK indices
++*/
++
++/* this bit 1 means constant (0 means register) */
++#define BITRK         (1 << (SIZE_B - 1))
++
++/* test whether value is a constant */
++#define ISK(x)                ((x) & BITRK)
++
++/* gets the index of the constant */
++#define INDEXK(r)     ((int)(r) & ~BITRK)
++
++#define MAXINDEXRK    (BITRK - 1)
++
++/* code a constant index as a RK value */
++#define RKASK(x)      ((x) | BITRK)
++
++
++/*
++** invalid register that fits in 8 bits
++*/
++#define NO_REG                MAXARG_A
++
++
++/*
++** R(x) - register
++** Kst(x) - constant (in constant table)
++** RK(x) == if ISK(x) then Kst(INDEXK(x)) else R(x)
++*/
++
++
++/*
++** grep "ORDER OP" if you change these enums
++*/
++
++typedef enum {
++/*----------------------------------------------------------------------
++name          args    description
++------------------------------------------------------------------------*/
++OP_MOVE,/*    A B     R(A) := R(B)                                    */
++OP_LOADK,/*   A Bx    R(A) := Kst(Bx)                                 */
++OP_LOADBOOL,/*        A B C   R(A) := (Bool)B; if (C) pc++                    */
++OP_LOADNIL,/* A B     R(A) := ... := R(B) := nil                      */
++OP_GETUPVAL,/*        A B     R(A) := UpValue[B]                              */
++
++OP_GETGLOBAL,/*       A Bx    R(A) := Gbl[Kst(Bx)]                            */
++OP_GETTABLE,/*        A B C   R(A) := R(B)[RK(C)]                             */
++
++OP_SETGLOBAL,/*       A Bx    Gbl[Kst(Bx)] := R(A)                            */
++OP_SETUPVAL,/*        A B     UpValue[B] := R(A)                              */
++OP_SETTABLE,/*        A B C   R(A)[RK(B)] := RK(C)                            */
++
++OP_NEWTABLE,/*        A B C   R(A) := {} (size = B,C)                         */
++
++OP_SELF,/*    A B C   R(A+1) := R(B); R(A) := R(B)[RK(C)]             */
++
++OP_ADD,/*     A B C   R(A) := RK(B) + RK(C)                           */
++OP_SUB,/*     A B C   R(A) := RK(B) - RK(C)                           */
++OP_MUL,/*     A B C   R(A) := RK(B) * RK(C)                           */
++OP_DIV,/*     A B C   R(A) := RK(B) / RK(C)                           */
++OP_MOD,/*     A B C   R(A) := RK(B) % RK(C)                           */
++OP_POW,/*     A B C   R(A) := RK(B) ^ RK(C)                           */
++OP_UNM,/*     A B     R(A) := -R(B)                                   */
++OP_NOT,/*     A B     R(A) := not R(B)                                */
++OP_LEN,/*     A B     R(A) := length of R(B)                          */
++
++OP_CONCAT,/*  A B C   R(A) := R(B).. ... ..R(C)                       */
++
++OP_JMP,/*     sBx     pc+=sBx                                 */
++
++OP_EQ,/*      A B C   if ((RK(B) == RK(C)) ~= A) then pc++            */
++OP_LT,/*      A B C   if ((RK(B) <  RK(C)) ~= A) then pc++            */
++OP_LE,/*      A B C   if ((RK(B) <= RK(C)) ~= A) then pc++            */
++
++OP_TEST,/*    A C     if not (R(A) <=> C) then pc++                   */ 
++OP_TESTSET,/* A B C   if (R(B) <=> C) then R(A) := R(B) else pc++     */ 
++
++OP_CALL,/*    A B C   R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */
++OP_TAILCALL,/*        A B C   return R(A)(R(A+1), ... ,R(A+B-1))              */
++OP_RETURN,/*  A B     return R(A), ... ,R(A+B-2)      (see note)      */
++
++OP_FORLOOP,/* A sBx   R(A)+=R(A+2);
++                      if R(A) <?= R(A+1) then { pc+=sBx; R(A+3)=R(A) }*/
++OP_FORPREP,/* A sBx   R(A)-=R(A+2); pc+=sBx                           */
++
++OP_TFORLOOP,/*        A C     R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2)); 
++                        if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++ */ 
++OP_SETLIST,/* A B C   R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B        */
++
++OP_CLOSE,/*   A       close all variables in the stack up to (>=) R(A)*/
++OP_CLOSURE,/* A Bx    R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n))  */
++
++OP_VARARG/*   A B     R(A), R(A+1), ..., R(A+B-1) = vararg            */
++} OpCode;
++
++
++#define NUM_OPCODES   (cast(int, OP_VARARG) + 1)
++
++
++
++/*===========================================================================
++  Notes:
++  (*) In OP_CALL, if (B == 0) then B = top. C is the number of returns - 1,
++      and can be 0: OP_CALL then sets `top' to last_result+1, so
++      next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'.
++
++  (*) In OP_VARARG, if (B == 0) then use actual number of varargs and
++      set top (like in OP_CALL with C == 0).
++
++  (*) In OP_RETURN, if (B == 0) then return up to `top'
++
++  (*) In OP_SETLIST, if (B == 0) then B = `top';
++      if (C == 0) then next `instruction' is real C
++
++  (*) For comparisons, A specifies what condition the test should accept
++      (true or false).
++
++  (*) All `skips' (pc++) assume that next instruction is a jump
++===========================================================================*/
++
++
++/*
++** masks for instruction properties. The format is:
++** bits 0-1: op mode
++** bits 2-3: C arg mode
++** bits 4-5: B arg mode
++** bit 6: instruction set register A
++** bit 7: operator is a test
++*/  
++
++enum OpArgMask {
++  OpArgN,  /* argument is not used */
++  OpArgU,  /* argument is used */
++  OpArgR,  /* argument is a register or a jump offset */
++  OpArgK   /* argument is a constant or register/constant */
++};
++
++LUAI_DATA const lu_byte luaP_opmodes[NUM_OPCODES];
++
++#define getOpMode(m)  (cast(enum OpMode, luaP_opmodes[m] & 3))
++#define getBMode(m)   (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3))
++#define getCMode(m)   (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3))
++#define testAMode(m)  (luaP_opmodes[m] & (1 << 6))
++#define testTMode(m)  (luaP_opmodes[m] & (1 << 7))
++
++
++LUAI_DATA const char *const luaP_opnames[NUM_OPCODES+1];  /* opcode names */
++
++
++/* number of list items to accumulate before a SETLIST instruction */
++#define LFIELDS_PER_FLUSH     50
++
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/lparser.c
+@@ -0,0 +1,1339 @@
++/*
++** $Id: lparser.c,v 2.42.1.3 2007/12/28 15:32:23 roberto Exp $
++** Lua Parser
++** See Copyright Notice in lua.h
++*/
++
++
++#include <string.h>
++
++#define lparser_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "lcode.h"
++#include "ldebug.h"
++#include "ldo.h"
++#include "lfunc.h"
++#include "llex.h"
++#include "lmem.h"
++#include "lobject.h"
++#include "lopcodes.h"
++#include "lparser.h"
++#include "lstate.h"
++#include "lstring.h"
++#include "ltable.h"
++
++
++
++#define hasmultret(k)         ((k) == VCALL || (k) == VVARARG)
++
++#define getlocvar(fs, i)      ((fs)->f->locvars[(fs)->actvar[i]])
++
++#define luaY_checklimit(fs,v,l,m)     if ((v)>(l)) errorlimit(fs,l,m)
++
++
++/*
++** nodes for block list (list of active blocks)
++*/
++typedef struct BlockCnt {
++  struct BlockCnt *previous;  /* chain */
++  int breaklist;  /* list of jumps out of this loop */
++  lu_byte nactvar;  /* # active locals outside the breakable structure */
++  lu_byte upval;  /* true if some variable in the block is an upvalue */
++  lu_byte isbreakable;  /* true if `block' is a loop */
++} BlockCnt;
++
++
++
++/*
++** prototypes for recursive non-terminal functions
++*/
++static void chunk (LexState *ls);
++static void expr (LexState *ls, expdesc *v);
++
++
++static void anchor_token (LexState *ls) {
++  if (ls->t.token == TK_NAME || ls->t.token == TK_STRING) {
++    TString *ts = ls->t.seminfo.ts;
++    luaX_newstring(ls, getstr(ts), ts->tsv.len);
++  }
++}
++
++
++static void error_expected (LexState *ls, int token) {
++  luaX_syntaxerror(ls,
++      luaO_pushfstring(ls->L, LUA_QS " expected", luaX_token2str(ls, token)));
++}
++
++
++static void errorlimit (FuncState *fs, int limit, const char *what) {
++  const char *msg = (fs->f->linedefined == 0) ?
++    luaO_pushfstring(fs->L, "main function has more than %d %s", limit, what) :
++    luaO_pushfstring(fs->L, "function at line %d has more than %d %s",
++                            fs->f->linedefined, limit, what);
++  luaX_lexerror(fs->ls, msg, 0);
++}
++
++
++static int testnext (LexState *ls, int c) {
++  if (ls->t.token == c) {
++    luaX_next(ls);
++    return 1;
++  }
++  else return 0;
++}
++
++
++static void check (LexState *ls, int c) {
++  if (ls->t.token != c)
++    error_expected(ls, c);
++}
++
++static void checknext (LexState *ls, int c) {
++  check(ls, c);
++  luaX_next(ls);
++}
++
++
++#define check_condition(ls,c,msg)     { if (!(c)) luaX_syntaxerror(ls, msg); }
++
++
++
++static void check_match (LexState *ls, int what, int who, int where) {
++  if (!testnext(ls, what)) {
++    if (where == ls->linenumber)
++      error_expected(ls, what);
++    else {
++      luaX_syntaxerror(ls, luaO_pushfstring(ls->L,
++             LUA_QS " expected (to close " LUA_QS " at line %d)",
++              luaX_token2str(ls, what), luaX_token2str(ls, who), where));
++    }
++  }
++}
++
++
++static TString *str_checkname (LexState *ls) {
++  TString *ts;
++  check(ls, TK_NAME);
++  ts = ls->t.seminfo.ts;
++  luaX_next(ls);
++  return ts;
++}
++
++
++static void init_exp (expdesc *e, expkind k, int i) {
++  e->f = e->t = NO_JUMP;
++  e->k = k;
++  e->u.s.info = i;
++}
++
++
++static void codestring (LexState *ls, expdesc *e, TString *s) {
++  init_exp(e, VK, luaK_stringK(ls->fs, s));
++}
++
++
++static void checkname(LexState *ls, expdesc *e) {
++  codestring(ls, e, str_checkname(ls));
++}
++
++
++static int registerlocalvar (LexState *ls, TString *varname) {
++  FuncState *fs = ls->fs;
++  Proto *f = fs->f;
++  int oldsize = f->sizelocvars;
++  luaM_growvector(ls->L, f->locvars, fs->nlocvars, f->sizelocvars,
++                  LocVar, SHRT_MAX, "too many local variables");
++  while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL;
++  f->locvars[fs->nlocvars].varname = varname;
++  luaC_objbarrier(ls->L, f, varname);
++  return fs->nlocvars++;
++}
++
++
++#define new_localvarliteral(ls,v,n) \
++  new_localvar(ls, luaX_newstring(ls, "" v, (sizeof(v)/sizeof(char))-1), n)
++
++
++static void new_localvar (LexState *ls, TString *name, int n) {
++  FuncState *fs = ls->fs;
++  luaY_checklimit(fs, fs->nactvar+n+1, LUAI_MAXVARS, "local variables");
++  fs->actvar[fs->nactvar+n] = cast(unsigned short, registerlocalvar(ls, name));
++}
++
++
++static void adjustlocalvars (LexState *ls, int nvars) {
++  FuncState *fs = ls->fs;
++  fs->nactvar = cast_byte(fs->nactvar + nvars);
++  for (; nvars; nvars--) {
++    getlocvar(fs, fs->nactvar - nvars).startpc = fs->pc;
++  }
++}
++
++
++static void removevars (LexState *ls, int tolevel) {
++  FuncState *fs = ls->fs;
++  while (fs->nactvar > tolevel)
++    getlocvar(fs, --fs->nactvar).endpc = fs->pc;
++}
++
++
++static int indexupvalue (FuncState *fs, TString *name, expdesc *v) {
++  int i;
++  Proto *f = fs->f;
++  int oldsize = f->sizeupvalues;
++  for (i=0; i<f->nups; i++) {
++    if (fs->upvalues[i].k == v->k && fs->upvalues[i].info == v->u.s.info) {
++      lua_assert(f->upvalues[i] == name);
++      return i;
++    }
++  }
++  /* new one */
++  luaY_checklimit(fs, f->nups + 1, LUAI_MAXUPVALUES, "upvalues");
++  luaM_growvector(fs->L, f->upvalues, f->nups, f->sizeupvalues,
++                  TString *, MAX_INT, "");
++  while (oldsize < f->sizeupvalues) f->upvalues[oldsize++] = NULL;
++  f->upvalues[f->nups] = name;
++  luaC_objbarrier(fs->L, f, name);
++  lua_assert(v->k == VLOCAL || v->k == VUPVAL);
++  fs->upvalues[f->nups].k = cast_byte(v->k);
++  fs->upvalues[f->nups].info = cast_byte(v->u.s.info);
++  return f->nups++;
++}
++
++
++static int searchvar (FuncState *fs, TString *n) {
++  int i;
++  for (i=fs->nactvar-1; i >= 0; i--) {
++    if (n == getlocvar(fs, i).varname)
++      return i;
++  }
++  return -1;  /* not found */
++}
++
++
++static void markupval (FuncState *fs, int level) {
++  BlockCnt *bl = fs->bl;
++  while (bl && bl->nactvar > level) bl = bl->previous;
++  if (bl) bl->upval = 1;
++}
++
++
++static int singlevaraux (FuncState *fs, TString *n, expdesc *var, int base) {
++  if (fs == NULL) {  /* no more levels? */
++    init_exp(var, VGLOBAL, NO_REG);  /* default is global variable */
++    return VGLOBAL;
++  }
++  else {
++    int v = searchvar(fs, n);  /* look up at current level */
++    if (v >= 0) {
++      init_exp(var, VLOCAL, v);
++      if (!base)
++        markupval(fs, v);  /* local will be used as an upval */
++      return VLOCAL;
++    }
++    else {  /* not found at current level; try upper one */
++      if (singlevaraux(fs->prev, n, var, 0) == VGLOBAL)
++        return VGLOBAL;
++      var->u.s.info = indexupvalue(fs, n, var);  /* else was LOCAL or UPVAL */
++      var->k = VUPVAL;  /* upvalue in this level */
++      return VUPVAL;
++    }
++  }
++}
++
++
++static void singlevar (LexState *ls, expdesc *var) {
++  TString *varname = str_checkname(ls);
++  FuncState *fs = ls->fs;
++  if (singlevaraux(fs, varname, var, 1) == VGLOBAL)
++    var->u.s.info = luaK_stringK(fs, varname);  /* info points to global name */
++}
++
++
++static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) {
++  FuncState *fs = ls->fs;
++  int extra = nvars - nexps;
++  if (hasmultret(e->k)) {
++    extra++;  /* includes call itself */
++    if (extra < 0) extra = 0;
++    luaK_setreturns(fs, e, extra);  /* last exp. provides the difference */
++    if (extra > 1) luaK_reserveregs(fs, extra-1);
++  }
++  else {
++    if (e->k != VVOID) luaK_exp2nextreg(fs, e);  /* close last expression */
++    if (extra > 0) {
++      int reg = fs->freereg;
++      luaK_reserveregs(fs, extra);
++      luaK_nil(fs, reg, extra);
++    }
++  }
++}
++
++
++static void enterlevel (LexState *ls) {
++  if (++ls->L->nCcalls > LUAI_MAXCCALLS)
++      luaX_lexerror(ls, "chunk has too many syntax levels", 0);
++}
++
++
++#define leavelevel(ls)        ((ls)->L->nCcalls--)
++
++
++static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isbreakable) {
++  bl->breaklist = NO_JUMP;
++  bl->isbreakable = isbreakable;
++  bl->nactvar = fs->nactvar;
++  bl->upval = 0;
++  bl->previous = fs->bl;
++  fs->bl = bl;
++  lua_assert(fs->freereg == fs->nactvar);
++}
++
++
++static void leaveblock (FuncState *fs) {
++  BlockCnt *bl = fs->bl;
++  fs->bl = bl->previous;
++  removevars(fs->ls, bl->nactvar);
++  if (bl->upval)
++    luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0);
++  /* a block either controls scope or breaks (never both) */
++  lua_assert(!bl->isbreakable || !bl->upval);
++  lua_assert(bl->nactvar == fs->nactvar);
++  fs->freereg = fs->nactvar;  /* free registers */
++  luaK_patchtohere(fs, bl->breaklist);
++}
++
++
++static void pushclosure (LexState *ls, FuncState *func, expdesc *v) {
++  FuncState *fs = ls->fs;
++  Proto *f = fs->f;
++  int oldsize = f->sizep;
++  int i;
++  luaM_growvector(ls->L, f->p, fs->np, f->sizep, Proto *,
++                  MAXARG_Bx, "constant table overflow");
++  while (oldsize < f->sizep) f->p[oldsize++] = NULL;
++  f->p[fs->np++] = func->f;
++  luaC_objbarrier(ls->L, f, func->f);
++  init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np-1));
++  for (i=0; i<func->f->nups; i++) {
++    OpCode o = (func->upvalues[i].k == VLOCAL) ? OP_MOVE : OP_GETUPVAL;
++    luaK_codeABC(fs, o, 0, func->upvalues[i].info, 0);
++  }
++}
++
++
++static void open_func (LexState *ls, FuncState *fs) {
++  lua_State *L = ls->L;
++  Proto *f = luaF_newproto(L);
++  fs->f = f;
++  fs->prev = ls->fs;  /* linked list of funcstates */
++  fs->ls = ls;
++  fs->L = L;
++  ls->fs = fs;
++  fs->pc = 0;
++  fs->lasttarget = -1;
++  fs->jpc = NO_JUMP;
++  fs->freereg = 0;
++  fs->nk = 0;
++  fs->np = 0;
++  fs->nlocvars = 0;
++  fs->nactvar = 0;
++  fs->bl = NULL;
++  f->source = ls->source;
++  f->maxstacksize = 2;  /* registers 0/1 are always valid */
++  fs->h = luaH_new(L, 0, 0);
++  /* anchor table of constants and prototype (to avoid being collected) */
++  sethvalue2s(L, L->top, fs->h);
++  incr_top(L);
++  setptvalue2s(L, L->top, f);
++  incr_top(L);
++}
++
++
++static void close_func (LexState *ls) {
++  lua_State *L = ls->L;
++  FuncState *fs = ls->fs;
++  Proto *f = fs->f;
++  removevars(ls, 0);
++  luaK_ret(fs, 0, 0);  /* final return */
++  luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction);
++  f->sizecode = fs->pc;
++  luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int);
++  f->sizelineinfo = fs->pc;
++  luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue);
++  f->sizek = fs->nk;
++  luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *);
++  f->sizep = fs->np;
++  luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar);
++  f->sizelocvars = fs->nlocvars;
++  luaM_reallocvector(L, f->upvalues, f->sizeupvalues, f->nups, TString *);
++  f->sizeupvalues = f->nups;
++  lua_assert(luaG_checkcode(f));
++  lua_assert(fs->bl == NULL);
++  ls->fs = fs->prev;
++  L->top -= 2;  /* remove table and prototype from the stack */
++  /* last token read was anchored in defunct function; must reanchor it */
++  if (fs) anchor_token(ls);
++}
++
++
++Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) {
++  struct LexState lexstate;
++  struct FuncState funcstate;
++  lexstate.buff = buff;
++  luaX_setinput(L, &lexstate, z, luaS_new(L, name));
++  open_func(&lexstate, &funcstate);
++  funcstate.f->is_vararg = VARARG_ISVARARG;  /* main func. is always vararg */
++  luaX_next(&lexstate);  /* read first token */
++  chunk(&lexstate);
++  check(&lexstate, TK_EOS);
++  close_func(&lexstate);
++  lua_assert(funcstate.prev == NULL);
++  lua_assert(funcstate.f->nups == 0);
++  lua_assert(lexstate.fs == NULL);
++  return funcstate.f;
++}
++
++
++
++/*============================================================*/
++/* GRAMMAR RULES */
++/*============================================================*/
++
++
++static void field (LexState *ls, expdesc *v) {
++  /* field -> ['.' | ':'] NAME */
++  FuncState *fs = ls->fs;
++  expdesc key;
++  luaK_exp2anyreg(fs, v);
++  luaX_next(ls);  /* skip the dot or colon */
++  checkname(ls, &key);
++  luaK_indexed(fs, v, &key);
++}
++
++
++static void yindex (LexState *ls, expdesc *v) {
++  /* index -> '[' expr ']' */
++  luaX_next(ls);  /* skip the '[' */
++  expr(ls, v);
++  luaK_exp2val(ls->fs, v);
++  checknext(ls, ']');
++}
++
++
++/*
++** {======================================================================
++** Rules for Constructors
++** =======================================================================
++*/
++
++
++struct ConsControl {
++  expdesc v;  /* last list item read */
++  expdesc *t;  /* table descriptor */
++  int nh;  /* total number of `record' elements */
++  int na;  /* total number of array elements */
++  int tostore;  /* number of array elements pending to be stored */
++};
++
++
++static void recfield (LexState *ls, struct ConsControl *cc) {
++  /* recfield -> (NAME | `['exp1`]') = exp1 */
++  FuncState *fs = ls->fs;
++  int reg = ls->fs->freereg;
++  expdesc key, val;
++  int rkkey;
++  if (ls->t.token == TK_NAME) {
++    luaY_checklimit(fs, cc->nh, MAX_INT, "items in a constructor");
++    checkname(ls, &key);
++  }
++  else  /* ls->t.token == '[' */
++    yindex(ls, &key);
++  cc->nh++;
++  checknext(ls, '=');
++  rkkey = luaK_exp2RK(fs, &key);
++  expr(ls, &val);
++  luaK_codeABC(fs, OP_SETTABLE, cc->t->u.s.info, rkkey, luaK_exp2RK(fs, &val));
++  fs->freereg = reg;  /* free registers */
++}
++
++
++static void closelistfield (FuncState *fs, struct ConsControl *cc) {
++  if (cc->v.k == VVOID) return;  /* there is no list item */
++  luaK_exp2nextreg(fs, &cc->v);
++  cc->v.k = VVOID;
++  if (cc->tostore == LFIELDS_PER_FLUSH) {
++    luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore);  /* flush */
++    cc->tostore = 0;  /* no more items pending */
++  }
++}
++
++
++static void lastlistfield (FuncState *fs, struct ConsControl *cc) {
++  if (cc->tostore == 0) return;
++  if (hasmultret(cc->v.k)) {
++    luaK_setmultret(fs, &cc->v);
++    luaK_setlist(fs, cc->t->u.s.info, cc->na, LUA_MULTRET);
++    cc->na--;  /* do not count last expression (unknown number of elements) */
++  }
++  else {
++    if (cc->v.k != VVOID)
++      luaK_exp2nextreg(fs, &cc->v);
++    luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore);
++  }
++}
++
++
++static void listfield (LexState *ls, struct ConsControl *cc) {
++  expr(ls, &cc->v);
++  luaY_checklimit(ls->fs, cc->na, MAX_INT, "items in a constructor");
++  cc->na++;
++  cc->tostore++;
++}
++
++
++static void constructor (LexState *ls, expdesc *t) {
++  /* constructor -> ?? */
++  FuncState *fs = ls->fs;
++  int line = ls->linenumber;
++  int pc = luaK_codeABC(fs, OP_NEWTABLE, 0, 0, 0);
++  struct ConsControl cc;
++  cc.na = cc.nh = cc.tostore = 0;
++  cc.t = t;
++  init_exp(t, VRELOCABLE, pc);
++  init_exp(&cc.v, VVOID, 0);  /* no value (yet) */
++  luaK_exp2nextreg(ls->fs, t);  /* fix it at stack top (for gc) */
++  checknext(ls, '{');
++  do {
++    lua_assert(cc.v.k == VVOID || cc.tostore > 0);
++    if (ls->t.token == '}') break;
++    closelistfield(fs, &cc);
++    switch(ls->t.token) {
++      case TK_NAME: {  /* may be listfields or recfields */
++        luaX_lookahead(ls);
++        if (ls->lookahead.token != '=')  /* expression? */
++          listfield(ls, &cc);
++        else
++          recfield(ls, &cc);
++        break;
++      }
++      case '[': {  /* constructor_item -> recfield */
++        recfield(ls, &cc);
++        break;
++      }
++      default: {  /* constructor_part -> listfield */
++        listfield(ls, &cc);
++        break;
++      }
++    }
++  } while (testnext(ls, ',') || testnext(ls, ';'));
++  check_match(ls, '}', '{', line);
++  lastlistfield(fs, &cc);
++  SETARG_B(fs->f->code[pc], luaO_int2fb(cc.na)); /* set initial array size */
++  SETARG_C(fs->f->code[pc], luaO_int2fb(cc.nh));  /* set initial table size */
++}
++
++/* }====================================================================== */
++
++
++
++static void parlist (LexState *ls) {
++  /* parlist -> [ param { `,' param } ] */
++  FuncState *fs = ls->fs;
++  Proto *f = fs->f;
++  int nparams = 0;
++  f->is_vararg = 0;
++  if (ls->t.token != ')') {  /* is `parlist' not empty? */
++    do {
++      switch (ls->t.token) {
++        case TK_NAME: {  /* param -> NAME */
++          new_localvar(ls, str_checkname(ls), nparams++);
++          break;
++        }
++        case TK_DOTS: {  /* param -> `...' */
++          luaX_next(ls);
++#if defined(LUA_COMPAT_VARARG)
++          /* use `arg' as default name */
++          new_localvarliteral(ls, "arg", nparams++);
++          f->is_vararg = VARARG_HASARG | VARARG_NEEDSARG;
++#endif
++          f->is_vararg |= VARARG_ISVARARG;
++          break;
++        }
++        default: luaX_syntaxerror(ls, "<name> or " LUA_QL("...") " expected");
++      }
++    } while (!f->is_vararg && testnext(ls, ','));
++  }
++  adjustlocalvars(ls, nparams);
++  f->numparams = cast_byte(fs->nactvar - (f->is_vararg & VARARG_HASARG));
++  luaK_reserveregs(fs, fs->nactvar);  /* reserve register for parameters */
++}
++
++
++static void body (LexState *ls, expdesc *e, int needself, int line) {
++  /* body ->  `(' parlist `)' chunk END */
++  FuncState new_fs;
++  open_func(ls, &new_fs);
++  new_fs.f->linedefined = line;
++  checknext(ls, '(');
++  if (needself) {
++    new_localvarliteral(ls, "self", 0);
++    adjustlocalvars(ls, 1);
++  }
++  parlist(ls);
++  checknext(ls, ')');
++  chunk(ls);
++  new_fs.f->lastlinedefined = ls->linenumber;
++  check_match(ls, TK_END, TK_FUNCTION, line);
++  close_func(ls);
++  pushclosure(ls, &new_fs, e);
++}
++
++
++static int explist1 (LexState *ls, expdesc *v) {
++  /* explist1 -> expr { `,' expr } */
++  int n = 1;  /* at least one expression */
++  expr(ls, v);
++  while (testnext(ls, ',')) {
++    luaK_exp2nextreg(ls->fs, v);
++    expr(ls, v);
++    n++;
++  }
++  return n;
++}
++
++
++static void funcargs (LexState *ls, expdesc *f) {
++  FuncState *fs = ls->fs;
++  expdesc args;
++  int base, nparams;
++  int line = ls->linenumber;
++  switch (ls->t.token) {
++    case '(': {  /* funcargs -> `(' [ explist1 ] `)' */
++      if (line != ls->lastline)
++        luaX_syntaxerror(ls,"ambiguous syntax (function call x new statement)");
++      luaX_next(ls);
++      if (ls->t.token == ')')  /* arg list is empty? */
++        args.k = VVOID;
++      else {
++        explist1(ls, &args);
++        luaK_setmultret(fs, &args);
++      }
++      check_match(ls, ')', '(', line);
++      break;
++    }
++    case '{': {  /* funcargs -> constructor */
++      constructor(ls, &args);
++      break;
++    }
++    case TK_STRING: {  /* funcargs -> STRING */
++      codestring(ls, &args, ls->t.seminfo.ts);
++      luaX_next(ls);  /* must use `seminfo' before `next' */
++      break;
++    }
++    default: {
++      luaX_syntaxerror(ls, "function arguments expected");
++      return;
++    }
++  }
++  lua_assert(f->k == VNONRELOC);
++  base = f->u.s.info;  /* base register for call */
++  if (hasmultret(args.k))
++    nparams = LUA_MULTRET;  /* open call */
++  else {
++    if (args.k != VVOID)
++      luaK_exp2nextreg(fs, &args);  /* close last argument */
++    nparams = fs->freereg - (base+1);
++  }
++  init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2));
++  luaK_fixline(fs, line);
++  fs->freereg = base+1;  /* call remove function and arguments and leaves
++                            (unless changed) one result */
++}
++
++
++
++
++/*
++** {======================================================================
++** Expression parsing
++** =======================================================================
++*/
++
++
++static void prefixexp (LexState *ls, expdesc *v) {
++  /* prefixexp -> NAME | '(' expr ')' */
++  switch (ls->t.token) {
++    case '(': {
++      int line = ls->linenumber;
++      luaX_next(ls);
++      expr(ls, v);
++      check_match(ls, ')', '(', line);
++      luaK_dischargevars(ls->fs, v);
++      return;
++    }
++    case TK_NAME: {
++      singlevar(ls, v);
++      return;
++    }
++    default: {
++      luaX_syntaxerror(ls, "unexpected symbol");
++      return;
++    }
++  }
++}
++
++
++static void primaryexp (LexState *ls, expdesc *v) {
++  /* primaryexp ->
++        prefixexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs } */
++  FuncState *fs = ls->fs;
++  prefixexp(ls, v);
++  for (;;) {
++    switch (ls->t.token) {
++      case '.': {  /* field */
++        field(ls, v);
++        break;
++      }
++      case '[': {  /* `[' exp1 `]' */
++        expdesc key;
++        luaK_exp2anyreg(fs, v);
++        yindex(ls, &key);
++        luaK_indexed(fs, v, &key);
++        break;
++      }
++      case ':': {  /* `:' NAME funcargs */
++        expdesc key;
++        luaX_next(ls);
++        checkname(ls, &key);
++        luaK_self(fs, v, &key);
++        funcargs(ls, v);
++        break;
++      }
++      case '(': case TK_STRING: case '{': {  /* funcargs */
++        luaK_exp2nextreg(fs, v);
++        funcargs(ls, v);
++        break;
++      }
++      default: return;
++    }
++  }
++}
++
++
++static void simpleexp (LexState *ls, expdesc *v) {
++  /* simpleexp -> NUMBER | STRING | NIL | true | false | ... |
++                  constructor | FUNCTION body | primaryexp */
++  switch (ls->t.token) {
++    case TK_NUMBER: {
++      init_exp(v, VKNUM, 0);
++      v->u.nval = ls->t.seminfo.r;
++      break;
++    }
++    case TK_STRING: {
++      codestring(ls, v, ls->t.seminfo.ts);
++      break;
++    }
++    case TK_NIL: {
++      init_exp(v, VNIL, 0);
++      break;
++    }
++    case TK_TRUE: {
++      init_exp(v, VTRUE, 0);
++      break;
++    }
++    case TK_FALSE: {
++      init_exp(v, VFALSE, 0);
++      break;
++    }
++    case TK_DOTS: {  /* vararg */
++      FuncState *fs = ls->fs;
++      check_condition(ls, fs->f->is_vararg,
++                      "cannot use " LUA_QL("...") " outside a vararg function");
++      fs->f->is_vararg &= ~VARARG_NEEDSARG;  /* don't need 'arg' */
++      init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0));
++      break;
++    }
++    case '{': {  /* constructor */
++      constructor(ls, v);
++      return;
++    }
++    case TK_FUNCTION: {
++      luaX_next(ls);
++      body(ls, v, 0, ls->linenumber);
++      return;
++    }
++    default: {
++      primaryexp(ls, v);
++      return;
++    }
++  }
++  luaX_next(ls);
++}
++
++
++static UnOpr getunopr (int op) {
++  switch (op) {
++    case TK_NOT: return OPR_NOT;
++    case '-': return OPR_MINUS;
++    case '#': return OPR_LEN;
++    default: return OPR_NOUNOPR;
++  }
++}
++
++
++static BinOpr getbinopr (int op) {
++  switch (op) {
++    case '+': return OPR_ADD;
++    case '-': return OPR_SUB;
++    case '*': return OPR_MUL;
++    case '/': return OPR_DIV;
++    case '%': return OPR_MOD;
++    case '^': return OPR_POW;
++    case TK_CONCAT: return OPR_CONCAT;
++    case TK_NE: return OPR_NE;
++    case TK_EQ: return OPR_EQ;
++    case '<': return OPR_LT;
++    case TK_LE: return OPR_LE;
++    case '>': return OPR_GT;
++    case TK_GE: return OPR_GE;
++    case TK_AND: return OPR_AND;
++    case TK_OR: return OPR_OR;
++    default: return OPR_NOBINOPR;
++  }
++}
++
++
++static const struct {
++  lu_byte left;  /* left priority for each binary operator */
++  lu_byte right; /* right priority */
++} priority[] = {  /* ORDER OPR */
++   {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7},  /* `+' `-' `/' `%' */
++   {10, 9}, {5, 4},                 /* power and concat (right associative) */
++   {3, 3}, {3, 3},                  /* equality and inequality */
++   {3, 3}, {3, 3}, {3, 3}, {3, 3},  /* order */
++   {2, 2}, {1, 1}                   /* logical (and/or) */
++};
++
++#define UNARY_PRIORITY        8  /* priority for unary operators */
++
++
++/*
++** subexpr -> (simpleexp | unop subexpr) { binop subexpr }
++** where `binop' is any binary operator with a priority higher than `limit'
++*/
++static BinOpr subexpr (LexState *ls, expdesc *v, unsigned int limit) {
++  BinOpr op;
++  UnOpr uop;
++  enterlevel(ls);
++  uop = getunopr(ls->t.token);
++  if (uop != OPR_NOUNOPR) {
++    luaX_next(ls);
++    subexpr(ls, v, UNARY_PRIORITY);
++    luaK_prefix(ls->fs, uop, v);
++  }
++  else simpleexp(ls, v);
++  /* expand while operators have priorities higher than `limit' */
++  op = getbinopr(ls->t.token);
++  while (op != OPR_NOBINOPR && priority[op].left > limit) {
++    expdesc v2;
++    BinOpr nextop;
++    luaX_next(ls);
++    luaK_infix(ls->fs, op, v);
++    /* read sub-expression with higher priority */
++    nextop = subexpr(ls, &v2, priority[op].right);
++    luaK_posfix(ls->fs, op, v, &v2);
++    op = nextop;
++  }
++  leavelevel(ls);
++  return op;  /* return first untreated operator */
++}
++
++
++static void expr (LexState *ls, expdesc *v) {
++  subexpr(ls, v, 0);
++}
++
++/* }==================================================================== */
++
++
++
++/*
++** {======================================================================
++** Rules for Statements
++** =======================================================================
++*/
++
++
++static int block_follow (int token) {
++  switch (token) {
++    case TK_ELSE: case TK_ELSEIF: case TK_END:
++    case TK_UNTIL: case TK_EOS:
++      return 1;
++    default: return 0;
++  }
++}
++
++
++static void block (LexState *ls) {
++  /* block -> chunk */
++  FuncState *fs = ls->fs;
++  BlockCnt bl;
++  enterblock(fs, &bl, 0);
++  chunk(ls);
++  lua_assert(bl.breaklist == NO_JUMP);
++  leaveblock(fs);
++}
++
++
++/*
++** structure to chain all variables in the left-hand side of an
++** assignment
++*/
++struct LHS_assign {
++  struct LHS_assign *prev;
++  expdesc v;  /* variable (global, local, upvalue, or indexed) */
++};
++
++
++/*
++** check whether, in an assignment to a local variable, the local variable
++** is needed in a previous assignment (to a table). If so, save original
++** local value in a safe place and use this safe copy in the previous
++** assignment.
++*/
++static void check_conflict (LexState *ls, struct LHS_assign *lh, expdesc *v) {
++  FuncState *fs = ls->fs;
++  int extra = fs->freereg;  /* eventual position to save local variable */
++  int conflict = 0;
++  for (; lh; lh = lh->prev) {
++    if (lh->v.k == VINDEXED) {
++      if (lh->v.u.s.info == v->u.s.info) {  /* conflict? */
++        conflict = 1;
++        lh->v.u.s.info = extra;  /* previous assignment will use safe copy */
++      }
++      if (lh->v.u.s.aux == v->u.s.info) {  /* conflict? */
++        conflict = 1;
++        lh->v.u.s.aux = extra;  /* previous assignment will use safe copy */
++      }
++    }
++  }
++  if (conflict) {
++    luaK_codeABC(fs, OP_MOVE, fs->freereg, v->u.s.info, 0);  /* make copy */
++    luaK_reserveregs(fs, 1);
++  }
++}
++
++
++static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) {
++  expdesc e;
++  check_condition(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED,
++                      "syntax error");
++  if (testnext(ls, ',')) {  /* assignment -> `,' primaryexp assignment */
++    struct LHS_assign nv;
++    nv.prev = lh;
++    primaryexp(ls, &nv.v);
++    if (nv.v.k == VLOCAL)
++      check_conflict(ls, lh, &nv.v);
++    luaY_checklimit(ls->fs, nvars, LUAI_MAXCCALLS - ls->L->nCcalls,
++                    "variables in assignment");
++    assignment(ls, &nv, nvars+1);
++  }
++  else {  /* assignment -> `=' explist1 */
++    int nexps;
++    checknext(ls, '=');
++    nexps = explist1(ls, &e);
++    if (nexps != nvars) {
++      adjust_assign(ls, nvars, nexps, &e);
++      if (nexps > nvars)
++        ls->fs->freereg -= nexps - nvars;  /* remove extra values */
++    }
++    else {
++      luaK_setoneret(ls->fs, &e);  /* close last expression */
++      luaK_storevar(ls->fs, &lh->v, &e);
++      return;  /* avoid default */
++    }
++  }
++  init_exp(&e, VNONRELOC, ls->fs->freereg-1);  /* default assignment */
++  luaK_storevar(ls->fs, &lh->v, &e);
++}
++
++
++static int cond (LexState *ls) {
++  /* cond -> exp */
++  expdesc v;
++  expr(ls, &v);  /* read condition */
++  if (v.k == VNIL) v.k = VFALSE;  /* `falses' are all equal here */
++  luaK_goiftrue(ls->fs, &v);
++  return v.f;
++}
++
++
++static void breakstat (LexState *ls) {
++  FuncState *fs = ls->fs;
++  BlockCnt *bl = fs->bl;
++  int upval = 0;
++  while (bl && !bl->isbreakable) {
++    upval |= bl->upval;
++    bl = bl->previous;
++  }
++  if (!bl)
++    luaX_syntaxerror(ls, "no loop to break");
++  if (upval)
++    luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0);
++  luaK_concat(fs, &bl->breaklist, luaK_jump(fs));
++}
++
++
++static void whilestat (LexState *ls, int line) {
++  /* whilestat -> WHILE cond DO block END */
++  FuncState *fs = ls->fs;
++  int whileinit;
++  int condexit;
++  BlockCnt bl;
++  luaX_next(ls);  /* skip WHILE */
++  whileinit = luaK_getlabel(fs);
++  condexit = cond(ls);
++  enterblock(fs, &bl, 1);
++  checknext(ls, TK_DO);
++  block(ls);
++  luaK_patchlist(fs, luaK_jump(fs), whileinit);
++  check_match(ls, TK_END, TK_WHILE, line);
++  leaveblock(fs);
++  luaK_patchtohere(fs, condexit);  /* false conditions finish the loop */
++}
++
++
++static void repeatstat (LexState *ls, int line) {
++  /* repeatstat -> REPEAT block UNTIL cond */
++  int condexit;
++  FuncState *fs = ls->fs;
++  int repeat_init = luaK_getlabel(fs);
++  BlockCnt bl1, bl2;
++  enterblock(fs, &bl1, 1);  /* loop block */
++  enterblock(fs, &bl2, 0);  /* scope block */
++  luaX_next(ls);  /* skip REPEAT */
++  chunk(ls);
++  check_match(ls, TK_UNTIL, TK_REPEAT, line);
++  condexit = cond(ls);  /* read condition (inside scope block) */
++  if (!bl2.upval) {  /* no upvalues? */
++    leaveblock(fs);  /* finish scope */
++    luaK_patchlist(ls->fs, condexit, repeat_init);  /* close the loop */
++  }
++  else {  /* complete semantics when there are upvalues */
++    breakstat(ls);  /* if condition then break */
++    luaK_patchtohere(ls->fs, condexit);  /* else... */
++    leaveblock(fs);  /* finish scope... */
++    luaK_patchlist(ls->fs, luaK_jump(fs), repeat_init);  /* and repeat */
++  }
++  leaveblock(fs);  /* finish loop */
++}
++
++
++static int exp1 (LexState *ls) {
++  expdesc e;
++  int k;
++  expr(ls, &e);
++  k = e.k;
++  luaK_exp2nextreg(ls->fs, &e);
++  return k;
++}
++
++
++static void forbody (LexState *ls, int base, int line, int nvars, int isnum) {
++  /* forbody -> DO block */
++  BlockCnt bl;
++  FuncState *fs = ls->fs;
++  int prep, endfor;
++  adjustlocalvars(ls, 3);  /* control variables */
++  checknext(ls, TK_DO);
++  prep = isnum ? luaK_codeAsBx(fs, OP_FORPREP, base, NO_JUMP) : luaK_jump(fs);
++  enterblock(fs, &bl, 0);  /* scope for declared variables */
++  adjustlocalvars(ls, nvars);
++  luaK_reserveregs(fs, nvars);
++  block(ls);
++  leaveblock(fs);  /* end of scope for declared variables */
++  luaK_patchtohere(fs, prep);
++  endfor = (isnum) ? luaK_codeAsBx(fs, OP_FORLOOP, base, NO_JUMP) :
++                     luaK_codeABC(fs, OP_TFORLOOP, base, 0, nvars);
++  luaK_fixline(fs, line);  /* pretend that `OP_FOR' starts the loop */
++  luaK_patchlist(fs, (isnum ? endfor : luaK_jump(fs)), prep + 1);
++}
++
++
++static void fornum (LexState *ls, TString *varname, int line) {
++  /* fornum -> NAME = exp1,exp1[,exp1] forbody */
++  FuncState *fs = ls->fs;
++  int base = fs->freereg;
++  new_localvarliteral(ls, "(for index)", 0);
++  new_localvarliteral(ls, "(for limit)", 1);
++  new_localvarliteral(ls, "(for step)", 2);
++  new_localvar(ls, varname, 3);
++  checknext(ls, '=');
++  exp1(ls);  /* initial value */
++  checknext(ls, ',');
++  exp1(ls);  /* limit */
++  if (testnext(ls, ','))
++    exp1(ls);  /* optional step */
++  else {  /* default step = 1 */
++    luaK_codeABx(fs, OP_LOADK, fs->freereg, luaK_numberK(fs, 1));
++    luaK_reserveregs(fs, 1);
++  }
++  forbody(ls, base, line, 1, 1);
++}
++
++
++static void forlist (LexState *ls, TString *indexname) {
++  /* forlist -> NAME {,NAME} IN explist1 forbody */
++  FuncState *fs = ls->fs;
++  expdesc e;
++  int nvars = 0;
++  int line;
++  int base = fs->freereg;
++  /* create control variables */
++  new_localvarliteral(ls, "(for generator)", nvars++);
++  new_localvarliteral(ls, "(for state)", nvars++);
++  new_localvarliteral(ls, "(for control)", nvars++);
++  /* create declared variables */
++  new_localvar(ls, indexname, nvars++);
++  while (testnext(ls, ','))
++    new_localvar(ls, str_checkname(ls), nvars++);
++  checknext(ls, TK_IN);
++  line = ls->linenumber;
++  adjust_assign(ls, 3, explist1(ls, &e), &e);
++  luaK_checkstack(fs, 3);  /* extra space to call generator */
++  forbody(ls, base, line, nvars - 3, 0);
++}
++
++
++static void forstat (LexState *ls, int line) {
++  /* forstat -> FOR (fornum | forlist) END */
++  FuncState *fs = ls->fs;
++  TString *varname;
++  BlockCnt bl;
++  enterblock(fs, &bl, 1);  /* scope for loop and control variables */
++  luaX_next(ls);  /* skip `for' */
++  varname = str_checkname(ls);  /* first variable name */
++  switch (ls->t.token) {
++    case '=': fornum(ls, varname, line); break;
++    case ',': case TK_IN: forlist(ls, varname); break;
++    default: luaX_syntaxerror(ls, LUA_QL("=") " or " LUA_QL("in") " expected");
++  }
++  check_match(ls, TK_END, TK_FOR, line);
++  leaveblock(fs);  /* loop scope (`break' jumps to this point) */
++}
++
++
++static int test_then_block (LexState *ls) {
++  /* test_then_block -> [IF | ELSEIF] cond THEN block */
++  int condexit;
++  luaX_next(ls);  /* skip IF or ELSEIF */
++  condexit = cond(ls);
++  checknext(ls, TK_THEN);
++  block(ls);  /* `then' part */
++  return condexit;
++}
++
++
++static void ifstat (LexState *ls, int line) {
++  /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */
++  FuncState *fs = ls->fs;
++  int flist;
++  int escapelist = NO_JUMP;
++  flist = test_then_block(ls);  /* IF cond THEN block */
++  while (ls->t.token == TK_ELSEIF) {
++    luaK_concat(fs, &escapelist, luaK_jump(fs));
++    luaK_patchtohere(fs, flist);
++    flist = test_then_block(ls);  /* ELSEIF cond THEN block */
++  }
++  if (ls->t.token == TK_ELSE) {
++    luaK_concat(fs, &escapelist, luaK_jump(fs));
++    luaK_patchtohere(fs, flist);
++    luaX_next(ls);  /* skip ELSE (after patch, for correct line info) */
++    block(ls);  /* `else' part */
++  }
++  else
++    luaK_concat(fs, &escapelist, flist);
++  luaK_patchtohere(fs, escapelist);
++  check_match(ls, TK_END, TK_IF, line);
++}
++
++
++static void localfunc (LexState *ls) {
++  expdesc v, b;
++  FuncState *fs = ls->fs;
++  new_localvar(ls, str_checkname(ls), 0);
++  init_exp(&v, VLOCAL, fs->freereg);
++  luaK_reserveregs(fs, 1);
++  adjustlocalvars(ls, 1);
++  body(ls, &b, 0, ls->linenumber);
++  luaK_storevar(fs, &v, &b);
++  /* debug information will only see the variable after this point! */
++  getlocvar(fs, fs->nactvar - 1).startpc = fs->pc;
++}
++
++
++static void localstat (LexState *ls) {
++  /* stat -> LOCAL NAME {`,' NAME} [`=' explist1] */
++  int nvars = 0;
++  int nexps;
++  expdesc e;
++  do {
++    new_localvar(ls, str_checkname(ls), nvars++);
++  } while (testnext(ls, ','));
++  if (testnext(ls, '='))
++    nexps = explist1(ls, &e);
++  else {
++    e.k = VVOID;
++    nexps = 0;
++  }
++  adjust_assign(ls, nvars, nexps, &e);
++  adjustlocalvars(ls, nvars);
++}
++
++
++static int funcname (LexState *ls, expdesc *v) {
++  /* funcname -> NAME {field} [`:' NAME] */
++  int needself = 0;
++  singlevar(ls, v);
++  while (ls->t.token == '.')
++    field(ls, v);
++  if (ls->t.token == ':') {
++    needself = 1;
++    field(ls, v);
++  }
++  return needself;
++}
++
++
++static void funcstat (LexState *ls, int line) {
++  /* funcstat -> FUNCTION funcname body */
++  int needself;
++  expdesc v, b;
++  luaX_next(ls);  /* skip FUNCTION */
++  needself = funcname(ls, &v);
++  body(ls, &b, needself, line);
++  luaK_storevar(ls->fs, &v, &b);
++  luaK_fixline(ls->fs, line);  /* definition `happens' in the first line */
++}
++
++
++static void exprstat (LexState *ls) {
++  /* stat -> func | assignment */
++  FuncState *fs = ls->fs;
++  struct LHS_assign v;
++  primaryexp(ls, &v.v);
++  if (v.v.k == VCALL)  /* stat -> func */
++    SETARG_C(getcode(fs, &v.v), 1);  /* call statement uses no results */
++  else {  /* stat -> assignment */
++    v.prev = NULL;
++    assignment(ls, &v, 1);
++  }
++}
++
++
++static void retstat (LexState *ls) {
++  /* stat -> RETURN explist */
++  FuncState *fs = ls->fs;
++  expdesc e;
++  int first, nret;  /* registers with returned values */
++  luaX_next(ls);  /* skip RETURN */
++  if (block_follow(ls->t.token) || ls->t.token == ';')
++    first = nret = 0;  /* return no values */
++  else {
++    nret = explist1(ls, &e);  /* optional return values */
++    if (hasmultret(e.k)) {
++      luaK_setmultret(fs, &e);
++      if (e.k == VCALL && nret == 1) {  /* tail call? */
++        SET_OPCODE(getcode(fs,&e), OP_TAILCALL);
++        lua_assert(GETARG_A(getcode(fs,&e)) == fs->nactvar);
++      }
++      first = fs->nactvar;
++      nret = LUA_MULTRET;  /* return all values */
++    }
++    else {
++      if (nret == 1)  /* only one single value? */
++        first = luaK_exp2anyreg(fs, &e);
++      else {
++        luaK_exp2nextreg(fs, &e);  /* values must go to the `stack' */
++        first = fs->nactvar;  /* return all `active' values */
++        lua_assert(nret == fs->freereg - first);
++      }
++    }
++  }
++  luaK_ret(fs, first, nret);
++}
++
++
++static int statement (LexState *ls) {
++  int line = ls->linenumber;  /* may be needed for error messages */
++  switch (ls->t.token) {
++    case TK_IF: {  /* stat -> ifstat */
++      ifstat(ls, line);
++      return 0;
++    }
++    case TK_WHILE: {  /* stat -> whilestat */
++      whilestat(ls, line);
++      return 0;
++    }
++    case TK_DO: {  /* stat -> DO block END */
++      luaX_next(ls);  /* skip DO */
++      block(ls);
++      check_match(ls, TK_END, TK_DO, line);
++      return 0;
++    }
++    case TK_FOR: {  /* stat -> forstat */
++      forstat(ls, line);
++      return 0;
++    }
++    case TK_REPEAT: {  /* stat -> repeatstat */
++      repeatstat(ls, line);
++      return 0;
++    }
++    case TK_FUNCTION: {
++      funcstat(ls, line);  /* stat -> funcstat */
++      return 0;
++    }
++    case TK_LOCAL: {  /* stat -> localstat */
++      luaX_next(ls);  /* skip LOCAL */
++      if (testnext(ls, TK_FUNCTION))  /* local function? */
++        localfunc(ls);
++      else
++        localstat(ls);
++      return 0;
++    }
++    case TK_RETURN: {  /* stat -> retstat */
++      retstat(ls);
++      return 1;  /* must be last statement */
++    }
++    case TK_BREAK: {  /* stat -> breakstat */
++      luaX_next(ls);  /* skip BREAK */
++      breakstat(ls);
++      return 1;  /* must be last statement */
++    }
++    default: {
++      exprstat(ls);
++      return 0;  /* to avoid warnings */
++    }
++  }
++}
++
++
++static void chunk (LexState *ls) {
++  /* chunk -> { stat [`;'] } */
++  int islast = 0;
++  enterlevel(ls);
++  while (!islast && !block_follow(ls->t.token)) {
++    islast = statement(ls);
++    testnext(ls, ';');
++    lua_assert(ls->fs->f->maxstacksize >= ls->fs->freereg &&
++               ls->fs->freereg >= ls->fs->nactvar);
++    ls->fs->freereg = ls->fs->nactvar;  /* free registers */
++  }
++  leavelevel(ls);
++}
++
++/* }====================================================================== */
+--- /dev/null
++++ b/extensions/LUA/lua/lparser.h
+@@ -0,0 +1,82 @@
++/*
++** $Id: lparser.h,v 1.57.1.1 2007/12/27 13:02:25 roberto Exp $
++** Lua Parser
++** See Copyright Notice in lua.h
++*/
++
++#ifndef lparser_h
++#define lparser_h
++
++#include "llimits.h"
++#include "lobject.h"
++#include "lzio.h"
++
++
++/*
++** Expression descriptor
++*/
++
++typedef enum {
++  VVOID,      /* no value */
++  VNIL,
++  VTRUE,
++  VFALSE,
++  VK,         /* info = index of constant in `k' */
++  VKNUM,      /* nval = numerical value */
++  VLOCAL,     /* info = local register */
++  VUPVAL,       /* info = index of upvalue in `upvalues' */
++  VGLOBAL,    /* info = index of table; aux = index of global name in `k' */
++  VINDEXED,   /* info = table register; aux = index register (or `k') */
++  VJMP,               /* info = instruction pc */
++  VRELOCABLE, /* info = instruction pc */
++  VNONRELOC,  /* info = result register */
++  VCALL,      /* info = instruction pc */
++  VVARARG     /* info = instruction pc */
++} expkind;
++
++typedef struct expdesc {
++  expkind k;
++  union {
++    struct { int info, aux; } s;
++    lua_Number nval;
++  } u;
++  int t;  /* patch list of `exit when true' */
++  int f;  /* patch list of `exit when false' */
++} expdesc;
++
++
++typedef struct upvaldesc {
++  lu_byte k;
++  lu_byte info;
++} upvaldesc;
++
++
++struct BlockCnt;  /* defined in lparser.c */
++
++
++/* state needed to generate code for a given function */
++typedef struct FuncState {
++  Proto *f;  /* current function header */
++  Table *h;  /* table to find (and reuse) elements in `k' */
++  struct FuncState *prev;  /* enclosing function */
++  struct LexState *ls;  /* lexical state */
++  struct lua_State *L;  /* copy of the Lua state */
++  struct BlockCnt *bl;  /* chain of current blocks */
++  int pc;  /* next position to code (equivalent to `ncode') */
++  int lasttarget;   /* `pc' of last `jump target' */
++  int jpc;  /* list of pending jumps to `pc' */
++  int freereg;  /* first free register */
++  int nk;  /* number of elements in `k' */
++  int np;  /* number of elements in `p' */
++  short nlocvars;  /* number of elements in `locvars' */
++  lu_byte nactvar;  /* number of active local variables */
++  upvaldesc upvalues[LUAI_MAXUPVALUES];  /* upvalues */
++  unsigned short actvar[LUAI_MAXVARS];  /* declared-variable stack */
++} FuncState;
++
++
++LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
++                                            const char *name);
++
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/lstate.c
+@@ -0,0 +1,214 @@
++/*
++** $Id: lstate.c,v 2.36.1.2 2008/01/03 15:20:39 roberto Exp $
++** Global State
++** See Copyright Notice in lua.h
++*/
++
++
++#include <stddef.h>
++
++#define lstate_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "ldebug.h"
++#include "ldo.h"
++#include "lfunc.h"
++#include "lgc.h"
++#include "llex.h"
++#include "lmem.h"
++#include "lstate.h"
++#include "lstring.h"
++#include "ltable.h"
++#include "ltm.h"
++
++
++#define state_size(x) (sizeof(x) + LUAI_EXTRASPACE)
++#define fromstate(l)  (cast(lu_byte *, (l)) - LUAI_EXTRASPACE)
++#define tostate(l)   (cast(lua_State *, cast(lu_byte *, l) + LUAI_EXTRASPACE))
++
++
++/*
++** Main thread combines a thread state and the global state
++*/
++typedef struct LG {
++  lua_State l;
++  global_State g;
++} LG;
++  
++
++
++static void stack_init (lua_State *L1, lua_State *L) {
++  /* initialize CallInfo array */
++  L1->base_ci = luaM_newvector(L, BASIC_CI_SIZE, CallInfo);
++  L1->ci = L1->base_ci;
++  L1->size_ci = BASIC_CI_SIZE;
++  L1->end_ci = L1->base_ci + L1->size_ci - 1;
++  /* initialize stack array */
++  L1->stack = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, TValue);
++  L1->stacksize = BASIC_STACK_SIZE + EXTRA_STACK;
++  L1->top = L1->stack;
++  L1->stack_last = L1->stack+(L1->stacksize - EXTRA_STACK)-1;
++  /* initialize first ci */
++  L1->ci->func = L1->top;
++  setnilvalue(L1->top++);  /* `function' entry for this `ci' */
++  L1->base = L1->ci->base = L1->top;
++  L1->ci->top = L1->top + LUA_MINSTACK;
++}
++
++
++static void freestack (lua_State *L, lua_State *L1) {
++  luaM_freearray(L, L1->base_ci, L1->size_ci, CallInfo);
++  luaM_freearray(L, L1->stack, L1->stacksize, TValue);
++}
++
++
++/*
++** open parts that may cause memory-allocation errors
++*/
++static void f_luaopen (lua_State *L, void *ud) {
++  global_State *g = G(L);
++  UNUSED(ud);
++  stack_init(L, L);  /* init stack */
++  sethvalue(L, gt(L), luaH_new(L, 0, 2));  /* table of globals */
++  sethvalue(L, registry(L), luaH_new(L, 0, 2));  /* registry */
++  luaS_resize(L, MINSTRTABSIZE);  /* initial size of string table */
++  luaT_init(L);
++  luaX_init(L);
++  luaS_fix(luaS_newliteral(L, MEMERRMSG));
++  g->GCthreshold = 4*g->totalbytes;
++}
++
++
++static void preinit_state (lua_State *L, global_State *g) {
++  G(L) = g;
++  L->stack = NULL;
++  L->stacksize = 0;
++  L->errorJmp = NULL;
++  L->hook = NULL;
++  L->hookmask = 0;
++  L->basehookcount = 0;
++  L->allowhook = 1;
++  resethookcount(L);
++  L->openupval = NULL;
++  L->size_ci = 0;
++  L->nCcalls = L->baseCcalls = 0;
++  L->status = 0;
++  L->base_ci = L->ci = NULL;
++  L->savedpc = NULL;
++  L->errfunc = 0;
++  setnilvalue(gt(L));
++}
++
++
++static void close_state (lua_State *L) {
++  global_State *g = G(L);
++  luaF_close(L, L->stack);  /* close all upvalues for this thread */
++  luaC_freeall(L);  /* collect all objects */
++  lua_assert(g->rootgc == obj2gco(L));
++  lua_assert(g->strt.nuse == 0);
++  luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size, TString *);
++  luaZ_freebuffer(L, &g->buff);
++  freestack(L, L);
++  lua_assert(g->totalbytes == sizeof(LG));
++  (*g->frealloc)(g->ud, fromstate(L), state_size(LG), 0);
++}
++
++
++lua_State *luaE_newthread (lua_State *L) {
++  lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State)));
++  luaC_link(L, obj2gco(L1), LUA_TTHREAD);
++  preinit_state(L1, G(L));
++  stack_init(L1, L);  /* init stack */
++  setobj2n(L, gt(L1), gt(L));  /* share table of globals */
++  L1->hookmask = L->hookmask;
++  L1->basehookcount = L->basehookcount;
++  L1->hook = L->hook;
++  resethookcount(L1);
++  lua_assert(iswhite(obj2gco(L1)));
++  return L1;
++}
++
++
++void luaE_freethread (lua_State *L, lua_State *L1) {
++  luaF_close(L1, L1->stack);  /* close all upvalues for this thread */
++  lua_assert(L1->openupval == NULL);
++  luai_userstatefree(L1);
++  freestack(L, L1);
++  luaM_freemem(L, fromstate(L1), state_size(lua_State));
++}
++
++
++LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
++  int i;
++  lua_State *L;
++  global_State *g;
++  void *l = (*f)(ud, NULL, 0, state_size(LG));
++  if (l == NULL) return NULL;
++  L = tostate(l);
++  g = &((LG *)L)->g;
++  L->next = NULL;
++  L->tt = LUA_TTHREAD;
++  g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT);
++  L->marked = luaC_white(g);
++  set2bits(L->marked, FIXEDBIT, SFIXEDBIT);
++  preinit_state(L, g);
++  g->frealloc = f;
++  g->ud = ud;
++  g->mainthread = L;
++  g->uvhead.u.l.prev = &g->uvhead;
++  g->uvhead.u.l.next = &g->uvhead;
++  g->GCthreshold = 0;  /* mark it as unfinished state */
++  g->strt.size = 0;
++  g->strt.nuse = 0;
++  g->strt.hash = NULL;
++  setnilvalue(registry(L));
++  luaZ_initbuffer(L, &g->buff);
++  g->panic = NULL;
++  g->gcstate = GCSpause;
++  g->rootgc = obj2gco(L);
++  g->sweepstrgc = 0;
++  g->sweepgc = &g->rootgc;
++  g->gray = NULL;
++  g->grayagain = NULL;
++  g->weak = NULL;
++  g->tmudata = NULL;
++  g->totalbytes = sizeof(LG);
++  g->gcpause = LUAI_GCPAUSE;
++  g->gcstepmul = LUAI_GCMUL;
++  g->gcdept = 0;
++  for (i=0; i<NUM_TAGS; i++) g->mt[i] = NULL;
++  if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) {
++    /* memory allocation error: free partial state */
++    close_state(L);
++    L = NULL;
++  }
++  else
++    luai_userstateopen(L);
++  return L;
++}
++
++
++static void callallgcTM (lua_State *L, void *ud) {
++  UNUSED(ud);
++  luaC_callGCTM(L);  /* call GC metamethods for all udata */
++}
++
++
++LUA_API void lua_close (lua_State *L) {
++  L = G(L)->mainthread;  /* only the main thread can be closed */
++  lua_lock(L);
++  luaF_close(L, L->stack);  /* close all upvalues for this thread */
++  luaC_separateudata(L, 1);  /* separate udata that have GC metamethods */
++  L->errfunc = 0;  /* no error function during GC metamethods */
++  do {  /* repeat until no more errors */
++    L->ci = L->base_ci;
++    L->base = L->top = L->ci->base;
++    L->nCcalls = L->baseCcalls = 0;
++  } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0);
++  lua_assert(G(L)->tmudata == NULL);
++  luai_userstateclose(L);
++  close_state(L);
++}
++
+--- /dev/null
++++ b/extensions/LUA/lua/lstate.h
+@@ -0,0 +1,169 @@
++/*
++** $Id: lstate.h,v 2.24.1.2 2008/01/03 15:20:39 roberto Exp $
++** Global State
++** See Copyright Notice in lua.h
++*/
++
++#ifndef lstate_h
++#define lstate_h
++
++#include "lua.h"
++
++#include "lobject.h"
++#include "ltm.h"
++#include "lzio.h"
++
++
++
++struct lua_longjmp;  /* defined in ldo.c */
++
++
++/* table of globals */
++#define gt(L) (&L->l_gt)
++
++/* registry */
++#define registry(L)   (&G(L)->l_registry)
++
++
++/* extra stack space to handle TM calls and some other extras */
++#define EXTRA_STACK   5
++
++
++#define BASIC_CI_SIZE           8
++
++#define BASIC_STACK_SIZE        (2*LUA_MINSTACK)
++
++
++
++typedef struct stringtable {
++  GCObject **hash;
++  lu_int32 nuse;  /* number of elements */
++  int size;
++} stringtable;
++
++
++/*
++** informations about a call
++*/
++typedef struct CallInfo {
++  StkId base;  /* base for this function */
++  StkId func;  /* function index in the stack */
++  StkId       top;  /* top for this function */
++  const Instruction *savedpc;
++  int nresults;  /* expected number of results from this function */
++  int tailcalls;  /* number of tail calls lost under this entry */
++} CallInfo;
++
++
++
++#define curr_func(L)  (clvalue(L->ci->func))
++#define ci_func(ci)   (clvalue((ci)->func))
++#define f_isLua(ci)   (!ci_func(ci)->c.isC)
++#define isLua(ci)     (ttisfunction((ci)->func) && f_isLua(ci))
++
++
++/*
++** `global state', shared by all threads of this state
++*/
++typedef struct global_State {
++  stringtable strt;  /* hash table for strings */
++  lua_Alloc frealloc;  /* function to reallocate memory */
++  void *ud;         /* auxiliary data to `frealloc' */
++  lu_byte currentwhite;
++  lu_byte gcstate;  /* state of garbage collector */
++  int sweepstrgc;  /* position of sweep in `strt' */
++  GCObject *rootgc;  /* list of all collectable objects */
++  GCObject **sweepgc;  /* position of sweep in `rootgc' */
++  GCObject *gray;  /* list of gray objects */
++  GCObject *grayagain;  /* list of objects to be traversed atomically */
++  GCObject *weak;  /* list of weak tables (to be cleared) */
++  GCObject *tmudata;  /* last element of list of userdata to be GC */
++  Mbuffer buff;  /* temporary buffer for string concatentation */
++  lu_mem GCthreshold;
++  lu_mem totalbytes;  /* number of bytes currently allocated */
++  lu_mem estimate;  /* an estimate of number of bytes actually in use */
++  lu_mem gcdept;  /* how much GC is `behind schedule' */
++  int gcpause;  /* size of pause between successive GCs */
++  int gcstepmul;  /* GC `granularity' */
++  lua_CFunction panic;  /* to be called in unprotected errors */
++  TValue l_registry;
++  struct lua_State *mainthread;
++  UpVal uvhead;  /* head of double-linked list of all open upvalues */
++  struct Table *mt[NUM_TAGS];  /* metatables for basic types */
++  TString *tmname[TM_N];  /* array with tag-method names */
++} global_State;
++
++
++/*
++** `per thread' state
++*/
++struct lua_State {
++  CommonHeader;
++  lu_byte status;
++  StkId top;  /* first free slot in the stack */
++  StkId base;  /* base of current function */
++  global_State *l_G;
++  CallInfo *ci;  /* call info for current function */
++  const Instruction *savedpc;  /* `savedpc' of current function */
++  StkId stack_last;  /* last free slot in the stack */
++  StkId stack;  /* stack base */
++  CallInfo *end_ci;  /* points after end of ci array*/
++  CallInfo *base_ci;  /* array of CallInfo's */
++  int stacksize;
++  int size_ci;  /* size of array `base_ci' */
++  unsigned short nCcalls;  /* number of nested C calls */
++  unsigned short baseCcalls;  /* nested C calls when resuming coroutine */
++  lu_byte hookmask;
++  lu_byte allowhook;
++  int basehookcount;
++  int hookcount;
++  lua_Hook hook;
++  TValue l_gt;  /* table of globals */
++  TValue env;  /* temporary place for environments */
++  GCObject *openupval;  /* list of open upvalues in this stack */
++  GCObject *gclist;
++  struct lua_longjmp *errorJmp;  /* current error recover point */
++  ptrdiff_t errfunc;  /* current error handling function (stack index) */
++};
++
++
++#define G(L)  (L->l_G)
++
++
++/*
++** Union of all collectable objects
++*/
++union GCObject {
++  GCheader gch;
++  union TString ts;
++  union Udata u;
++  union Closure cl;
++  struct Table h;
++  struct Proto p;
++  struct UpVal uv;
++  struct lua_State th;  /* thread */
++};
++
++
++/* macros to convert a GCObject into a specific value */
++#define rawgco2ts(o)  check_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts))
++#define gco2ts(o)     (&rawgco2ts(o)->tsv)
++#define rawgco2u(o)   check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u))
++#define gco2u(o)      (&rawgco2u(o)->uv)
++#define gco2cl(o)     check_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl))
++#define gco2h(o)      check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h))
++#define gco2p(o)      check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p))
++#define gco2uv(o)     check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv))
++#define ngcotouv(o) \
++      check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv))
++#define gco2th(o)     check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th))
++
++/* macro to convert any Lua object into a GCObject */
++#define obj2gco(v)    (cast(GCObject *, (v)))
++
++
++LUAI_FUNC lua_State *luaE_newthread (lua_State *L);
++LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1);
++
++#endif
++
+--- /dev/null
++++ b/extensions/LUA/lua/lstring.c
+@@ -0,0 +1,110 @@
++/*
++** $Id: lstring.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $
++** String table (keeps all strings handled by Lua)
++** See Copyright Notice in lua.h
++*/
++
++#include <string.h>
++
++#define lstring_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "lmem.h"
++#include "lobject.h"
++#include "lstate.h"
++#include "lstring.h"
++
++
++
++void luaS_resize (lua_State *L, int newsize) {
++  GCObject **newhash;
++  stringtable *tb;
++  int i;
++  if (G(L)->gcstate == GCSsweepstring)
++    return;  /* cannot resize during GC traverse */
++  newhash = luaM_newvector(L, newsize, GCObject *);
++  tb = &G(L)->strt;
++  for (i=0; i<newsize; i++) newhash[i] = NULL;
++  /* rehash */
++  for (i=0; i<tb->size; i++) {
++    GCObject *p = tb->hash[i];
++    while (p) {  /* for each node in the list */
++      GCObject *next = p->gch.next;  /* save next */
++      unsigned int h = gco2ts(p)->hash;
++      int h1 = lmod(h, newsize);  /* new position */
++      lua_assert(cast_int(h%newsize) == lmod(h, newsize));
++      p->gch.next = newhash[h1];  /* chain it */
++      newhash[h1] = p;
++      p = next;
++    }
++  }
++  luaM_freearray(L, tb->hash, tb->size, TString *);
++  tb->size = newsize;
++  tb->hash = newhash;
++}
++
++
++static TString *newlstr (lua_State *L, const char *str, size_t l,
++                                       unsigned int h) {
++  TString *ts;
++  stringtable *tb;
++  if (l+1 > (MAX_SIZET - sizeof(TString))/sizeof(char))
++    luaM_toobig(L);
++  ts = cast(TString *, luaM_malloc(L, (l+1)*sizeof(char)+sizeof(TString)));
++  ts->tsv.len = l;
++  ts->tsv.hash = h;
++  ts->tsv.marked = luaC_white(G(L));
++  ts->tsv.tt = LUA_TSTRING;
++  ts->tsv.reserved = 0;
++  memcpy(ts+1, str, l*sizeof(char));
++  ((char *)(ts+1))[l] = '\0';  /* ending 0 */
++  tb = &G(L)->strt;
++  h = lmod(h, tb->size);
++  ts->tsv.next = tb->hash[h];  /* chain new entry */
++  tb->hash[h] = obj2gco(ts);
++  tb->nuse++;
++  if (tb->nuse > cast(lu_int32, tb->size) && tb->size <= MAX_INT/2)
++    luaS_resize(L, tb->size*2);  /* too crowded */
++  return ts;
++}
++
++
++TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
++  GCObject *o;
++  unsigned int h = cast(unsigned int, l);  /* seed */
++  size_t step = (l>>5)+1;  /* if string is too long, don't hash all its chars */
++  size_t l1;
++  for (l1=l; l1>=step; l1-=step)  /* compute hash */
++    h = h ^ ((h<<5)+(h>>2)+cast(unsigned char, str[l1-1]));
++  for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)];
++       o != NULL;
++       o = o->gch.next) {
++    TString *ts = rawgco2ts(o);
++    if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) {
++      /* string may be dead */
++      if (isdead(G(L), o)) changewhite(o);
++      return ts;
++    }
++  }
++  return newlstr(L, str, l, h);  /* not found */
++}
++
++
++Udata *luaS_newudata (lua_State *L, size_t s, Table *e) {
++  Udata *u;
++  if (s > MAX_SIZET - sizeof(Udata))
++    luaM_toobig(L);
++  u = cast(Udata *, luaM_malloc(L, s + sizeof(Udata)));
++  u->uv.marked = luaC_white(G(L));  /* is not finalized */
++  u->uv.tt = LUA_TUSERDATA;
++  u->uv.len = s;
++  u->uv.metatable = NULL;
++  u->uv.env = e;
++  /* chain it on udata list (after main thread) */
++  u->uv.next = G(L)->mainthread->next;
++  G(L)->mainthread->next = obj2gco(u);
++  return u;
++}
++
+--- /dev/null
++++ b/extensions/LUA/lua/lstring.h
+@@ -0,0 +1,31 @@
++/*
++** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $
++** String table (keep all strings handled by Lua)
++** See Copyright Notice in lua.h
++*/
++
++#ifndef lstring_h
++#define lstring_h
++
++
++#include "lgc.h"
++#include "lobject.h"
++#include "lstate.h"
++
++
++#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
++
++#define sizeudata(u)  (sizeof(union Udata)+(u)->len)
++
++#define luaS_new(L, s)        (luaS_newlstr(L, s, strlen(s)))
++#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
++                                 (sizeof(s)/sizeof(char))-1))
++
++#define luaS_fix(s)   l_setbit((s)->tsv.marked, FIXEDBIT)
++
++LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
++LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
++LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
++
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/lstrlib.c
+@@ -0,0 +1,883 @@
++/*
++** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $
++** Standard library for string operations and pattern-matching
++** See Copyright Notice in lua.h
++*/
++
++
++#include <ctype.h>
++#include <stddef.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#define lstrlib_c
++#define LUA_LIB
++
++#include "lua.h"
++
++#include "lauxlib.h"
++#include "lualib.h"
++
++
++/* macro to `unsign' a character */
++#define uchar(c)        ((unsigned char)(c))
++
++
++
++static int str_len (lua_State *L) {
++  size_t l;
++  luaL_checklstring(L, 1, &l);
++  lua_pushinteger(L, l);
++  return 1;
++}
++
++
++static ptrdiff_t posrelat (ptrdiff_t pos, size_t len) {
++  /* relative string position: negative means back from end */
++  if (pos < 0) pos += (ptrdiff_t)len + 1;
++  return (pos >= 0) ? pos : 0;
++}
++
++
++static int str_sub (lua_State *L) {
++  size_t l;
++  const char *s = luaL_checklstring(L, 1, &l);
++  ptrdiff_t start = posrelat(luaL_checkinteger(L, 2), l);
++  ptrdiff_t end = posrelat(luaL_optinteger(L, 3, -1), l);
++  if (start < 1) start = 1;
++  if (end > (ptrdiff_t)l) end = (ptrdiff_t)l;
++  if (start <= end)
++    lua_pushlstring(L, s+start-1, end-start+1);
++  else lua_pushliteral(L, "");
++  return 1;
++}
++
++
++static int str_reverse (lua_State *L) {
++  size_t l;
++  const char *s = luaL_checklstring(L, 1, &l);
++  luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC);
++  if(!b) luaL_error(L, "str_reverse: cannot allocate memory");
++  luaL_buffinit(L, b);
++  while (l--) luaL_addchar(b, s[l]);
++  luaL_pushresult(b);
++  kfree(b);
++  return 1;
++}
++
++
++static int str_lower (lua_State *L) {
++  size_t l;
++  size_t i;
++  const char *s = luaL_checklstring(L, 1, &l);
++  luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC);
++  if(!b) luaL_error(L, "str_lower: cannot allocate memory");
++  luaL_buffinit(L, b);
++  for (i=0; i<l; i++)
++    luaL_addchar(b, tolower(uchar(s[i])));
++  luaL_pushresult(b);
++  kfree(b);
++  return 1;
++}
++
++
++static int str_upper (lua_State *L) {
++  size_t l;
++  size_t i;
++  const char *s = luaL_checklstring(L, 1, &l);
++  luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC);
++  if(!b) luaL_error(L, "str_upper: cannot allocate memory");
++  luaL_buffinit(L, b);
++  for (i=0; i<l; i++)
++    luaL_addchar(b, toupper(uchar(s[i])));
++  luaL_pushresult(b);
++  kfree(b);
++  return 1;
++}
++
++static int str_rep (lua_State *L) {
++  size_t l;
++  const char *s = luaL_checklstring(L, 1, &l);
++  int n = luaL_checkint(L, 2);
++  luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC);
++  if(!b) luaL_error(L, "str_rep: cannot allocate memory");
++  luaL_buffinit(L, b);
++  while (n-- > 0)
++    luaL_addlstring(b, s, l);
++  luaL_pushresult(b);
++  kfree(b);
++  return 1;
++}
++
++
++static int str_byte (lua_State *L) {
++  size_t l;
++  const char *s = luaL_checklstring(L, 1, &l);
++  ptrdiff_t posi = posrelat(luaL_optinteger(L, 2, 1), l);
++  ptrdiff_t pose = posrelat(luaL_optinteger(L, 3, posi), l);
++  int n, i;
++  if (posi <= 0) posi = 1;
++  if ((size_t)pose > l) pose = l;
++  if (posi > pose) return 0;  /* empty interval; return no values */
++  n = (int)(pose -  posi + 1);
++  if (posi + n <= pose)  /* overflow? */
++    luaL_error(L, "string slice too long");
++  luaL_checkstack(L, n, "string slice too long");
++  for (i=0; i<n; i++)
++    lua_pushinteger(L, uchar(s[posi+i-1]));
++  return n;
++}
++
++
++static int str_char (lua_State *L) {
++  int n = lua_gettop(L);  /* number of arguments */
++  int i;
++  luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC);
++  if(!b) luaL_error(L, "str_char: cannot allocate memory");
++  luaL_buffinit(L, b);
++  for (i=1; i<=n; i++) {
++    int c = luaL_checkint(L, i);
++    luaL_argcheck(L, uchar(c) == c, i, "invalid value");
++    luaL_addchar(b, uchar(c));
++  }
++  luaL_pushresult(b);
++  kfree(b);
++  return 1;
++}
++
++
++static int writer (lua_State *L, const void* b, size_t size, void* B) {
++  (void)L;
++  luaL_addlstring((luaL_Buffer*) B, (const char *)b, size);
++  return 0;
++}
++
++
++static int str_dump (lua_State *L) {
++  luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC);
++  if(!b) luaL_error(L, "str_dump: cannot allocate memory");
++  luaL_checktype(L, 1, LUA_TFUNCTION);
++  lua_settop(L, 1);
++  luaL_buffinit(L,b);
++  if (lua_dump(L, writer, b) != 0){
++        kfree(b);
++        luaL_error(L, "unable to dump given function");
++  }
++
++  luaL_pushresult(b);
++  kfree(b);
++  return 1;
++}
++
++
++
++/*
++** {======================================================
++** PATTERN MATCHING
++** =======================================================
++*/
++
++
++#define CAP_UNFINISHED        (-1)
++#define CAP_POSITION  (-2)
++
++typedef struct MatchState {
++  const char *src_init;  /* init of source string */
++  const char *src_end;  /* end (`\0') of source string */
++  lua_State *L;
++  int level;  /* total number of captures (finished or unfinished) */
++  struct {
++    const char *init;
++    ptrdiff_t len;
++  } capture[LUA_MAXCAPTURES];
++} MatchState;
++
++
++#define L_ESC         '%'
++#define SPECIALS      "^$*+?.([%-"
++
++
++static int check_capture (MatchState *ms, int l) {
++  l -= '1';
++  if (l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED)
++    return luaL_error(ms->L, "invalid capture index");
++  return l;
++}
++
++
++static int capture_to_close (MatchState *ms) {
++  int level = ms->level;
++  for (level--; level>=0; level--)
++    if (ms->capture[level].len == CAP_UNFINISHED) return level;
++  return luaL_error(ms->L, "invalid pattern capture");
++}
++
++
++static const char *classend (MatchState *ms, const char *p) {
++  switch (*p++) {
++    case L_ESC: {
++      if (*p == '\0')
++        luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")");
++      return p+1;
++    }
++    case '[': {
++      if (*p == '^') p++;
++      do {  /* look for a `]' */
++        if (*p == '\0')
++          luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")");
++        if (*(p++) == L_ESC && *p != '\0')
++          p++;  /* skip escapes (e.g. `%]') */
++      } while (*p != ']');
++      return p+1;
++    }
++    default: {
++      return p;
++    }
++  }
++}
++
++
++static int match_class (int c, int cl) {
++  int res;
++  switch (tolower(cl)) {
++    case 'a' : res = isalpha(c); break;
++    case 'c' : res = iscntrl(c); break;
++    case 'd' : res = isdigit(c); break;
++    case 'l' : res = islower(c); break;
++    case 'p' : res = ispunct(c); break;
++    case 's' : res = isspace(c); break;
++    case 'u' : res = isupper(c); break;
++    case 'w' : res = isalnum(c); break;
++    case 'x' : res = isxdigit(c); break;
++    case 'z' : res = (c == 0); break;
++    default: return (cl == c);
++  }
++  return (islower(cl) ? res : !res);
++}
++
++
++static int matchbracketclass (int c, const char *p, const char *ec) {
++  int sig = 1;
++  if (*(p+1) == '^') {
++    sig = 0;
++    p++;  /* skip the `^' */
++  }
++  while (++p < ec) {
++    if (*p == L_ESC) {
++      p++;
++      if (match_class(c, uchar(*p)))
++        return sig;
++    }
++    else if ((*(p+1) == '-') && (p+2 < ec)) {
++      p+=2;
++      if (uchar(*(p-2)) <= c && c <= uchar(*p))
++        return sig;
++    }
++    else if (uchar(*p) == c) return sig;
++  }
++  return !sig;
++}
++
++
++static int singlematch (int c, const char *p, const char *ep) {
++  switch (*p) {
++    case '.': return 1;  /* matches any char */
++    case L_ESC: return match_class(c, uchar(*(p+1)));
++    case '[': return matchbracketclass(c, p, ep-1);
++    default:  return (uchar(*p) == c);
++  }
++}
++
++
++static const char *match (MatchState *ms, const char *s, const char *p);
++
++
++static const char *matchbalance (MatchState *ms, const char *s,
++                                   const char *p) {
++  if (*p == 0 || *(p+1) == 0)
++    luaL_error(ms->L, "unbalanced pattern");
++  if (*s != *p) return NULL;
++  else {
++    int b = *p;
++    int e = *(p+1);
++    int cont = 1;
++    while (++s < ms->src_end) {
++      if (*s == e) {
++        if (--cont == 0) return s+1;
++      }
++      else if (*s == b) cont++;
++    }
++  }
++  return NULL;  /* string ends out of balance */
++}
++
++
++static const char *max_expand (MatchState *ms, const char *s,
++                                 const char *p, const char *ep) {
++  ptrdiff_t i = 0;  /* counts maximum expand for item */
++  while ((s+i)<ms->src_end && singlematch(uchar(*(s+i)), p, ep))
++    i++;
++  /* keeps trying to match with the maximum repetitions */
++  while (i>=0) {
++    const char *res = match(ms, (s+i), ep+1);
++    if (res) return res;
++    i--;  /* else didn't match; reduce 1 repetition to try again */
++  }
++  return NULL;
++}
++
++
++static const char *min_expand (MatchState *ms, const char *s,
++                                 const char *p, const char *ep) {
++  for (;;) {
++    const char *res = match(ms, s, ep+1);
++    if (res != NULL)
++      return res;
++    else if (s<ms->src_end && singlematch(uchar(*s), p, ep))
++      s++;  /* try with one more repetition */
++    else return NULL;
++  }
++}
++
++
++static const char *start_capture (MatchState *ms, const char *s,
++                                    const char *p, int what) {
++  const char *res;
++  int level = ms->level;
++  if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures");
++  ms->capture[level].init = s;
++  ms->capture[level].len = what;
++  ms->level = level+1;
++  if ((res=match(ms, s, p)) == NULL)  /* match failed? */
++    ms->level--;  /* undo capture */
++  return res;
++}
++
++
++static const char *end_capture (MatchState *ms, const char *s,
++                                  const char *p) {
++  int l = capture_to_close(ms);
++  const char *res;
++  ms->capture[l].len = s - ms->capture[l].init;  /* close capture */
++  if ((res = match(ms, s, p)) == NULL)  /* match failed? */
++    ms->capture[l].len = CAP_UNFINISHED;  /* undo capture */
++  return res;
++}
++
++
++static const char *match_capture (MatchState *ms, const char *s, int l) {
++  size_t len;
++  l = check_capture(ms, l);
++  len = ms->capture[l].len;
++  if ((size_t)(ms->src_end-s) >= len &&
++      memcmp(ms->capture[l].init, s, len) == 0)
++    return s+len;
++  else return NULL;
++}
++
++
++static const char *match (MatchState *ms, const char *s, const char *p) {
++  init: /* using goto's to optimize tail recursion */
++  switch (*p) {
++    case '(': {  /* start capture */
++      if (*(p+1) == ')')  /* position capture? */
++        return start_capture(ms, s, p+2, CAP_POSITION);
++      else
++        return start_capture(ms, s, p+1, CAP_UNFINISHED);
++    }
++    case ')': {  /* end capture */
++      return end_capture(ms, s, p+1);
++    }
++    case L_ESC: {
++      switch (*(p+1)) {
++        case 'b': {  /* balanced string? */
++          s = matchbalance(ms, s, p+2);
++          if (s == NULL) return NULL;
++          p+=4; goto init;  /* else return match(ms, s, p+4); */
++        }
++        case 'f': {  /* frontier? */
++          const char *ep; char previous;
++          p += 2;
++          if (*p != '[')
++            luaL_error(ms->L, "missing " LUA_QL("[") " after "
++                               LUA_QL("%%f") " in pattern");
++          ep = classend(ms, p);  /* points to what is next */
++          previous = (s == ms->src_init) ? '\0' : *(s-1);
++          if (matchbracketclass(uchar(previous), p, ep-1) ||
++             !matchbracketclass(uchar(*s), p, ep-1)) return NULL;
++          p=ep; goto init;  /* else return match(ms, s, ep); */
++        }
++        default: {
++          if (isdigit(uchar(*(p+1)))) {  /* capture results (%0-%9)? */
++            s = match_capture(ms, s, uchar(*(p+1)));
++            if (s == NULL) return NULL;
++            p+=2; goto init;  /* else return match(ms, s, p+2) */
++          }
++          goto dflt;  /* case default */
++        }
++      }
++    }
++    case '\0': {  /* end of pattern */
++      return s;  /* match succeeded */
++    }
++    case '$': {
++      if (*(p+1) == '\0')  /* is the `$' the last char in pattern? */
++        return (s == ms->src_end) ? s : NULL;  /* check end of string */
++      else goto dflt;
++    }
++    default: dflt: {  /* it is a pattern item */
++      const char *ep = classend(ms, p);  /* points to what is next */
++      int m = s<ms->src_end && singlematch(uchar(*s), p, ep);
++      switch (*ep) {
++        case '?': {  /* optional */
++          const char *res;
++          if (m && ((res=match(ms, s+1, ep+1)) != NULL))
++            return res;
++          p=ep+1; goto init;  /* else return match(ms, s, ep+1); */
++        }
++        case '*': {  /* 0 or more repetitions */
++          return max_expand(ms, s, p, ep);
++        }
++        case '+': {  /* 1 or more repetitions */
++          return (m ? max_expand(ms, s+1, p, ep) : NULL);
++        }
++        case '-': {  /* 0 or more repetitions (minimum) */
++          return min_expand(ms, s, p, ep);
++        }
++        default: {
++          if (!m) return NULL;
++          s++; p=ep; goto init;  /* else return match(ms, s+1, ep); */
++        }
++      }
++    }
++  }
++}
++
++
++
++static const char *lmemfind (const char *s1, size_t l1,
++                               const char *s2, size_t l2) {
++  if (l2 == 0) return s1;  /* empty strings are everywhere */
++  else if (l2 > l1) return NULL;  /* avoids a negative `l1' */
++  else {
++    const char *init;  /* to search for a `*s2' inside `s1' */
++    l2--;  /* 1st char will be checked by `memchr' */
++    l1 = l1-l2;  /* `s2' cannot be found after that */
++    while (l1 > 0 && (init = (const char *)memchr(s1, *s2, l1)) != NULL) {
++      init++;   /* 1st char is already checked */
++      if (memcmp(init, s2+1, l2) == 0)
++        return init-1;
++      else {  /* correct `l1' and `s1' to try again */
++        l1 -= init-s1;
++        s1 = init;
++      }
++    }
++    return NULL;  /* not found */
++  }
++}
++
++
++static void push_onecapture (MatchState *ms, int i, const char *s,
++                                                    const char *e) {
++  if (i >= ms->level) {
++    if (i == 0)  /* ms->level == 0, too */
++      lua_pushlstring(ms->L, s, e - s);  /* add whole match */
++    else
++      luaL_error(ms->L, "invalid capture index");
++  }
++  else {
++    ptrdiff_t l = ms->capture[i].len;
++    if (l == CAP_UNFINISHED) luaL_error(ms->L, "unfinished capture");
++    if (l == CAP_POSITION)
++      lua_pushinteger(ms->L, ms->capture[i].init - ms->src_init + 1);
++    else
++      lua_pushlstring(ms->L, ms->capture[i].init, l);
++  }
++}
++
++
++static int push_captures (MatchState *ms, const char *s, const char *e) {
++  int i;
++  int nlevels = (ms->level == 0 && s) ? 1 : ms->level;
++  luaL_checkstack(ms->L, nlevels, "too many captures");
++  for (i = 0; i < nlevels; i++)
++    push_onecapture(ms, i, s, e);
++  return nlevels;  /* number of strings pushed */
++}
++
++
++static int str_find_aux (lua_State *L, int find) {
++  size_t l1, l2;
++  const char *s = luaL_checklstring(L, 1, &l1);
++  const char *p = luaL_checklstring(L, 2, &l2);
++  ptrdiff_t init = posrelat(luaL_optinteger(L, 3, 1), l1) - 1;
++  if (init < 0) init = 0;
++  else if ((size_t)(init) > l1) init = (ptrdiff_t)l1;
++  if (find && (lua_toboolean(L, 4) ||  /* explicit request? */
++      strpbrk(p, SPECIALS) == NULL)) {  /* or no special characters? */
++    /* do a plain search */
++    const char *s2 = lmemfind(s+init, l1-init, p, l2);
++    if (s2) {
++      lua_pushinteger(L, s2-s+1);
++      lua_pushinteger(L, s2-s+l2);
++      return 2;
++    }
++  }
++  else {
++    MatchState ms;
++    int anchor = (*p == '^') ? (p++, 1) : 0;
++    const char *s1=s+init;
++    ms.L = L;
++    ms.src_init = s;
++    ms.src_end = s+l1;
++    do {
++      const char *res;
++      ms.level = 0;
++      if ((res=match(&ms, s1, p)) != NULL) {
++        if (find) {
++          lua_pushinteger(L, s1-s+1);  /* start */
++          lua_pushinteger(L, res-s);   /* end */
++          return push_captures(&ms, NULL, 0) + 2;
++        }
++        else
++          return push_captures(&ms, s1, res);
++      }
++    } while (s1++ < ms.src_end && !anchor);
++  }
++  lua_pushnil(L);  /* not found */
++  return 1;
++}
++
++
++static int str_find (lua_State *L) {
++  return str_find_aux(L, 1);
++}
++
++
++static int str_match (lua_State *L) {
++  return str_find_aux(L, 0);
++}
++
++
++static int gmatch_aux (lua_State *L) {
++  MatchState ms;
++  size_t ls;
++  const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls);
++  const char *p = lua_tostring(L, lua_upvalueindex(2));
++  const char *src;
++  ms.L = L;
++  ms.src_init = s;
++  ms.src_end = s+ls;
++  for (src = s + (size_t)lua_tointeger(L, lua_upvalueindex(3));
++       src <= ms.src_end;
++       src++) {
++    const char *e;
++    ms.level = 0;
++    if ((e = match(&ms, src, p)) != NULL) {
++      lua_Integer newstart = e-s;
++      if (e == src) newstart++;  /* empty match? go at least one position */
++      lua_pushinteger(L, newstart);
++      lua_replace(L, lua_upvalueindex(3));
++      return push_captures(&ms, src, e);
++    }
++  }
++  return 0;  /* not found */
++}
++
++
++static int gmatch (lua_State *L) {
++  luaL_checkstring(L, 1);
++  luaL_checkstring(L, 2);
++  lua_settop(L, 2);
++  lua_pushinteger(L, 0);
++  lua_pushcclosure(L, gmatch_aux, 3);
++  return 1;
++}
++
++
++static int gfind_nodef (lua_State *L) {
++  return luaL_error(L, LUA_QL("string.gfind") " was renamed to "
++                       LUA_QL("string.gmatch"));
++}
++
++
++static void add_s (MatchState *ms, luaL_Buffer *b, const char *s,
++                                                   const char *e) {
++  size_t l, i;
++  const char *news = lua_tolstring(ms->L, 3, &l);
++  for (i = 0; i < l; i++) {
++    if (news[i] != L_ESC)
++      luaL_addchar(b, news[i]);
++    else {
++      i++;  /* skip ESC */
++      if (!isdigit(uchar(news[i])))
++        luaL_addchar(b, news[i]);
++      else if (news[i] == '0')
++          luaL_addlstring(b, s, e - s);
++      else {
++        push_onecapture(ms, news[i] - '1', s, e);
++        luaL_addvalue(b);  /* add capture to accumulated result */
++      }
++    }
++  }
++}
++
++
++static void add_value (MatchState *ms, luaL_Buffer *b, const char *s,
++                                                       const char *e) {
++  lua_State *L = ms->L;
++  switch (lua_type(L, 3)) {
++    case LUA_TNUMBER:
++    case LUA_TSTRING: {
++      add_s(ms, b, s, e);
++      return;
++    }
++    case LUA_TFUNCTION: {
++      int n;
++      lua_pushvalue(L, 3);
++      n = push_captures(ms, s, e);
++      lua_call(L, n, 1);
++      break;
++    }
++    case LUA_TTABLE: {
++      push_onecapture(ms, 0, s, e);
++      lua_gettable(L, 3);
++      break;
++    }
++  }
++  if (!lua_toboolean(L, -1)) {  /* nil or false? */
++    lua_pop(L, 1);
++    lua_pushlstring(L, s, e - s);  /* keep original text */
++  }
++  else if (!lua_isstring(L, -1))
++    luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1));
++  luaL_addvalue(b);  /* add result to accumulator */
++}
++
++
++static int str_gsub (lua_State *L) {
++  size_t srcl;
++  const char *src = luaL_checklstring(L, 1, &srcl);
++  const char *p = luaL_checkstring(L, 2);
++  int  tr = lua_type(L, 3);
++  int max_s = luaL_optint(L, 4, srcl+1);
++  int anchor = (*p == '^') ? (p++, 1) : 0;
++  int n = 0;
++  MatchState ms;
++  luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC);
++  if(!b) luaL_error(L, "str_gsub: cannot allocate memory");
++  luaL_argcheck(L, tr == LUA_TNUMBER || tr == LUA_TSTRING ||
++                   tr == LUA_TFUNCTION || tr == LUA_TTABLE, 3,
++                      "string/function/table expected");
++  luaL_buffinit(L, b);
++  ms.L = L;
++  ms.src_init = src;
++  ms.src_end = src+srcl;
++  while (n < max_s) {
++    const char *e;
++    ms.level = 0;
++    e = match(&ms, src, p);
++    if (e) {
++      n++;
++      add_value(&ms, b, src, e);
++    }
++    if (e && e>src) /* non empty match? */
++      src = e;  /* skip it */
++    else if (src < ms.src_end)
++      luaL_addchar(b, *src++);
++    else break;
++    if (anchor) break;
++  }
++  luaL_addlstring(b, src, ms.src_end-src);
++  luaL_pushresult(b);
++  lua_pushinteger(L, n);  /* number of substitutions */
++  kfree(b);
++  return 2;
++}
++
++/* }====================================================== */
++
++
++/* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */
++#define MAX_ITEM      512
++/* valid flags in a format specification */
++#define FLAGS "-+ #0"
++/*
++** maximum size of each format specification (such as '%-099.99d')
++** (+10 accounts for %99.99x plus margin of error)
++*/
++#define MAX_FORMAT    (sizeof(FLAGS) + sizeof(LUA_INTFRMLEN) + 10)
++
++
++static void addquoted (lua_State *L, luaL_Buffer *b, int arg) {
++  size_t l;
++  const char *s = luaL_checklstring(L, arg, &l);
++  luaL_addchar(b, '"');
++  while (l--) {
++    switch (*s) {
++      case '"': case '\\': case '\n': {
++        luaL_addchar(b, '\\');
++        luaL_addchar(b, *s);
++        break;
++      }
++      case '\r': {
++        luaL_addlstring(b, "\\r", 2);
++        break;
++      }
++      case '\0': {
++        luaL_addlstring(b, "\\000", 4);
++        break;
++      }
++      default: {
++        luaL_addchar(b, *s);
++        break;
++      }
++    }
++    s++;
++  }
++  luaL_addchar(b, '"');
++}
++
++static const char *scanformat (lua_State *L, const char *strfrmt, char *form) {
++  const char *p = strfrmt;
++  while (*p != '\0' && strchr(FLAGS, *p) != NULL) p++;  /* skip flags */
++  if ((size_t)(p - strfrmt) >= sizeof(FLAGS))
++    luaL_error(L, "invalid format (repeated flags)");
++  if (isdigit(uchar(*p))) p++;  /* skip width */
++  if (isdigit(uchar(*p))) p++;  /* (2 digits at most) */
++  if (*p == '.') {
++    p++;
++    if (isdigit(uchar(*p))) p++;  /* skip precision */
++    if (isdigit(uchar(*p))) p++;  /* (2 digits at most) */
++  }
++  if (isdigit(uchar(*p)))
++    luaL_error(L, "invalid format (width or precision too long)");
++  *(form++) = '%';
++  strncpy(form, strfrmt, p - strfrmt + 1);
++  form += p - strfrmt + 1;
++  *form = '\0';
++  return p;
++}
++
++
++static void addintlen (char *form) {
++  size_t l = strlen(form);
++  char spec = form[l - 1];
++  strcpy(form + l - 1, LUA_INTFRMLEN);
++  form[l + sizeof(LUA_INTFRMLEN) - 2] = spec;
++  form[l + sizeof(LUA_INTFRMLEN) - 1] = '\0';
++}
++
++
++static int str_format (lua_State *L) {
++  int arg = 1;
++  size_t sfl;
++  const char *strfrmt = luaL_checklstring(L, arg, &sfl);
++  const char *strfrmt_end = strfrmt+sfl;
++  luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC);
++  if(!b) luaL_error(L, "str_format: cannot allocate memory");
++  luaL_buffinit(L, b);
++  while (strfrmt < strfrmt_end) {
++    if (*strfrmt != L_ESC)
++      luaL_addchar(b, *strfrmt++);
++    else if (*++strfrmt == L_ESC)
++      luaL_addchar(b, *strfrmt++);  /* %% */
++    else { /* format item */
++      char form[MAX_FORMAT];  /* to store the format (`%...') */
++      char buff[MAX_ITEM];  /* to store the formatted item */
++      arg++;
++      strfrmt = scanformat(L, strfrmt, form);
++      switch (*strfrmt++) {
++        case 'c': {
++          sprintf(buff, form, (int)luaL_checknumber(L, arg));
++          break;
++        }
++        case 'd':  case 'i': {
++          addintlen(form);
++          sprintf(buff, form, (LUA_INTFRM_T)luaL_checknumber(L, arg));
++          break;
++        }
++        case 'o':  case 'u':  case 'x':  case 'X': {
++          addintlen(form);
++          sprintf(buff, form, (unsigned LUA_INTFRM_T)luaL_checknumber(L, arg));
++          break;
++        }
++        case 'q': {
++          addquoted(L, b, arg);
++          continue;  /* skip the 'addsize' at the end */
++        }
++        case 's': {
++          size_t l;
++          const char *s = luaL_checklstring(L, arg, &l);
++          if (!strchr(form, '.') && l >= 100) {
++            /* no precision and string is too long to be formatted;
++               keep original string */
++            lua_pushvalue(L, arg);
++            luaL_addvalue(b);
++            continue;  /* skip the `addsize' at the end */
++          }
++          else {
++            sprintf(buff, form, s);
++            break;
++          }
++        }
++        default: {  /* also treat cases `pnLlh' */
++          kfree(b);
++          return luaL_error(L, "invalid option " LUA_QL("%%%c") " to "
++                               LUA_QL("format"), *(strfrmt - 1));
++        }
++      }
++      luaL_addlstring(b, buff, strlen(buff));
++    }
++  }
++  luaL_pushresult(b);
++  kfree(b);
++  return 1;
++}
++
++
++static const luaL_Reg strlib[] = {
++  {"byte", str_byte},
++  {"char", str_char},
++  {"dump", str_dump},
++  {"find", str_find},
++  {"format", str_format},
++  {"gfind", gfind_nodef},
++  {"gmatch", gmatch},
++  {"gsub", str_gsub},
++  {"len", str_len},
++  {"lower", str_lower},
++  {"match", str_match},
++  {"rep", str_rep},
++  {"reverse", str_reverse},
++  {"sub", str_sub},
++  {"upper", str_upper},
++  {NULL, NULL}
++};
++
++
++static void createmetatable (lua_State *L) {
++  lua_createtable(L, 0, 1);  /* create metatable for strings */
++  lua_pushliteral(L, "");  /* dummy string */
++  lua_pushvalue(L, -2);
++  lua_setmetatable(L, -2);  /* set string metatable */
++  lua_pop(L, 1);  /* pop dummy string */
++  lua_pushvalue(L, -2);  /* string library... */
++  lua_setfield(L, -2, "__index");  /* ...is the __index metamethod */
++  lua_pop(L, 1);  /* pop metatable */
++}
++
++
++/*
++** Open string library
++*/
++LUALIB_API int luaopen_string (lua_State *L) {
++  luaL_register(L, LUA_STRLIBNAME, strlib);
++#if defined(LUA_COMPAT_GFIND)
++  lua_getfield(L, -1, "gmatch");
++  lua_setfield(L, -2, "gfind");
++#endif
++  createmetatable(L);
++  return 1;
++}
+--- /dev/null
++++ b/extensions/LUA/lua/ltable.c
+@@ -0,0 +1,588 @@
++/*
++** $Id: ltable.c,v 2.32.1.2 2007/12/28 15:32:23 roberto Exp $
++** Lua tables (hash)
++** See Copyright Notice in lua.h
++*/
++
++
++/*
++** Implementation of tables (aka arrays, objects, or hash tables).
++** Tables keep its elements in two parts: an array part and a hash part.
++** Non-negative integer keys are all candidates to be kept in the array
++** part. The actual size of the array is the largest `n' such that at
++** least half the slots between 0 and n are in use.
++** Hash uses a mix of chained scatter table with Brent's variation.
++** A main invariant of these tables is that, if an element is not
++** in its main position (i.e. the `original' position that its hash gives
++** to it), then the colliding element is in its own main position.
++** Hence even when the load factor reaches 100%, performance remains good.
++*/
++
++#include <math.h>
++#include <string.h>
++
++#define ltable_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "ldebug.h"
++#include "ldo.h"
++#include "lgc.h"
++#include "lmem.h"
++#include "lobject.h"
++#include "lstate.h"
++#include "ltable.h"
++
++
++/*
++** max size of array part is 2^MAXBITS
++*/
++#if LUAI_BITSINT > 26
++#define MAXBITS               26
++#else
++#define MAXBITS               (LUAI_BITSINT-2)
++#endif
++
++#define MAXASIZE      (1 << MAXBITS)
++
++
++#define hashpow2(t,n)      (gnode(t, lmod((n), sizenode(t))))
++  
++#define hashstr(t,str)  hashpow2(t, (str)->tsv.hash)
++#define hashboolean(t,p)        hashpow2(t, p)
++
++
++/*
++** for some types, it is better to avoid modulus by power of 2, as
++** they tend to have many 2 factors.
++*/
++#define hashmod(t,n)  (gnode(t, ((n) % ((sizenode(t)-1)|1))))
++
++
++#define hashpointer(t,p)      hashmod(t, IntPoint(p))
++
++
++/*
++** number of ints inside a lua_Number
++*/
++#define numints               cast_int(sizeof(lua_Number)/sizeof(int))
++
++
++
++#define dummynode             (&dummynode_)
++
++static const Node dummynode_ = {
++  {{NULL}, LUA_TNIL},  /* value */
++  {{{NULL}, LUA_TNIL, NULL}}  /* key */
++};
++
++
++/*
++** hash for lua_Numbers
++*/
++static Node *hashnum (const Table *t, lua_Number n) {
++  unsigned int a[numints];
++  int i;
++  if (luai_numeq(n, 0))  /* avoid problems with -0 */
++    return gnode(t, 0);
++  memcpy(a, &n, sizeof(a));
++  for (i = 1; i < numints; i++) a[0] += a[i];
++  return hashmod(t, a[0]);
++}
++
++
++
++/*
++** returns the `main' position of an element in a table (that is, the index
++** of its hash value)
++*/
++static Node *mainposition (const Table *t, const TValue *key) {
++  switch (ttype(key)) {
++    case LUA_TNUMBER:
++      return hashnum(t, nvalue(key));
++    case LUA_TSTRING:
++      return hashstr(t, rawtsvalue(key));
++    case LUA_TBOOLEAN:
++      return hashboolean(t, bvalue(key));
++    case LUA_TLIGHTUSERDATA:
++      return hashpointer(t, pvalue(key));
++    default:
++      return hashpointer(t, gcvalue(key));
++  }
++}
++
++
++/*
++** returns the index for `key' if `key' is an appropriate key to live in
++** the array part of the table, -1 otherwise.
++*/
++static int arrayindex (const TValue *key) {
++  if (ttisnumber(key)) {
++    lua_Number n = nvalue(key);
++    int k;
++    lua_number2int(k, n);
++    if (luai_numeq(cast_num(k), n))
++      return k;
++  }
++  return -1;  /* `key' did not match some condition */
++}
++
++
++/*
++** returns the index of a `key' for table traversals. First goes all
++** elements in the array part, then elements in the hash part. The
++** beginning of a traversal is signalled by -1.
++*/
++static int findindex (lua_State *L, Table *t, StkId key) {
++  int i;
++  if (ttisnil(key)) return -1;  /* first iteration */
++  i = arrayindex(key);
++  if (0 < i && i <= t->sizearray)  /* is `key' inside array part? */
++    return i-1;  /* yes; that's the index (corrected to C) */
++  else {
++    Node *n = mainposition(t, key);
++    do {  /* check whether `key' is somewhere in the chain */
++      /* key may be dead already, but it is ok to use it in `next' */
++      if (luaO_rawequalObj(key2tval(n), key) ||
++            (ttype(gkey(n)) == LUA_TDEADKEY && iscollectable(key) &&
++             gcvalue(gkey(n)) == gcvalue(key))) {
++        i = cast_int(n - gnode(t, 0));  /* key index in hash table */
++        /* hash elements are numbered after array ones */
++        return i + t->sizearray;
++      }
++      else n = gnext(n);
++    } while (n);
++    luaG_runerror(L, "invalid key to " LUA_QL("next"));  /* key not found */
++    return 0;  /* to avoid warnings */
++  }
++}
++
++
++int luaH_next (lua_State *L, Table *t, StkId key) {
++  int i = findindex(L, t, key);  /* find original element */
++  for (i++; i < t->sizearray; i++) {  /* try first array part */
++    if (!ttisnil(&t->array[i])) {  /* a non-nil value? */
++      setnvalue(key, cast_num(i+1));
++      setobj2s(L, key+1, &t->array[i]);
++      return 1;
++    }
++  }
++  for (i -= t->sizearray; i < sizenode(t); i++) {  /* then hash part */
++    if (!ttisnil(gval(gnode(t, i)))) {  /* a non-nil value? */
++      setobj2s(L, key, key2tval(gnode(t, i)));
++      setobj2s(L, key+1, gval(gnode(t, i)));
++      return 1;
++    }
++  }
++  return 0;  /* no more elements */
++}
++
++
++/*
++** {=============================================================
++** Rehash
++** ==============================================================
++*/
++
++
++static int computesizes (int nums[], int *narray) {
++  int i;
++  int twotoi;  /* 2^i */
++  int a = 0;  /* number of elements smaller than 2^i */
++  int na = 0;  /* number of elements to go to array part */
++  int n = 0;  /* optimal size for array part */
++  for (i = 0, twotoi = 1; twotoi/2 < *narray; i++, twotoi *= 2) {
++    if (nums[i] > 0) {
++      a += nums[i];
++      if (a > twotoi/2) {  /* more than half elements present? */
++        n = twotoi;  /* optimal size (till now) */
++        na = a;  /* all elements smaller than n will go to array part */
++      }
++    }
++    if (a == *narray) break;  /* all elements already counted */
++  }
++  *narray = n;
++  lua_assert(*narray/2 <= na && na <= *narray);
++  return na;
++}
++
++
++static int countint (const TValue *key, int *nums) {
++  int k = arrayindex(key);
++  if (0 < k && k <= MAXASIZE) {  /* is `key' an appropriate array index? */
++    nums[ceillog2(k)]++;  /* count as such */
++    return 1;
++  }
++  else
++    return 0;
++}
++
++
++static int numusearray (const Table *t, int *nums) {
++  int lg;
++  int ttlg;  /* 2^lg */
++  int ause = 0;  /* summation of `nums' */
++  int i = 1;  /* count to traverse all array keys */
++  for (lg=0, ttlg=1; lg<=MAXBITS; lg++, ttlg*=2) {  /* for each slice */
++    int lc = 0;  /* counter */
++    int lim = ttlg;
++    if (lim > t->sizearray) {
++      lim = t->sizearray;  /* adjust upper limit */
++      if (i > lim)
++        break;  /* no more elements to count */
++    }
++    /* count elements in range (2^(lg-1), 2^lg] */
++    for (; i <= lim; i++) {
++      if (!ttisnil(&t->array[i-1]))
++        lc++;
++    }
++    nums[lg] += lc;
++    ause += lc;
++  }
++  return ause;
++}
++
++
++static int numusehash (const Table *t, int *nums, int *pnasize) {
++  int totaluse = 0;  /* total number of elements */
++  int ause = 0;  /* summation of `nums' */
++  int i = sizenode(t);
++  while (i--) {
++    Node *n = &t->node[i];
++    if (!ttisnil(gval(n))) {
++      ause += countint(key2tval(n), nums);
++      totaluse++;
++    }
++  }
++  *pnasize += ause;
++  return totaluse;
++}
++
++
++static void setarrayvector (lua_State *L, Table *t, int size) {
++  int i;
++  luaM_reallocvector(L, t->array, t->sizearray, size, TValue);
++  for (i=t->sizearray; i<size; i++)
++     setnilvalue(&t->array[i]);
++  t->sizearray = size;
++}
++
++
++static void setnodevector (lua_State *L, Table *t, int size) {
++  int lsize;
++  if (size == 0) {  /* no elements to hash part? */
++    t->node = cast(Node *, dummynode);  /* use common `dummynode' */
++    lsize = 0;
++  }
++  else {
++    int i;
++    lsize = ceillog2(size);
++    if (lsize > MAXBITS)
++      luaG_runerror(L, "table overflow");
++    size = twoto(lsize);
++    t->node = luaM_newvector(L, size, Node);
++    for (i=0; i<size; i++) {
++      Node *n = gnode(t, i);
++      gnext(n) = NULL;
++      setnilvalue(gkey(n));
++      setnilvalue(gval(n));
++    }
++  }
++  t->lsizenode = cast_byte(lsize);
++  t->lastfree = gnode(t, size);  /* all positions are free */
++}
++
++
++static void resize (lua_State *L, Table *t, int nasize, int nhsize) {
++  int i;
++  int oldasize = t->sizearray;
++  int oldhsize = t->lsizenode;
++  Node *nold = t->node;  /* save old hash ... */
++  if (nasize > oldasize)  /* array part must grow? */
++    setarrayvector(L, t, nasize);
++  /* create new hash part with appropriate size */
++  setnodevector(L, t, nhsize);  
++  if (nasize < oldasize) {  /* array part must shrink? */
++    t->sizearray = nasize;
++    /* re-insert elements from vanishing slice */
++    for (i=nasize; i<oldasize; i++) {
++      if (!ttisnil(&t->array[i]))
++        setobjt2t(L, luaH_setnum(L, t, i+1), &t->array[i]);
++    }
++    /* shrink array */
++    luaM_reallocvector(L, t->array, oldasize, nasize, TValue);
++  }
++  /* re-insert elements from hash part */
++  for (i = twoto(oldhsize) - 1; i >= 0; i--) {
++    Node *old = nold+i;
++    if (!ttisnil(gval(old)))
++      setobjt2t(L, luaH_set(L, t, key2tval(old)), gval(old));
++  }
++  if (nold != dummynode)
++    luaM_freearray(L, nold, twoto(oldhsize), Node);  /* free old array */
++}
++
++
++void luaH_resizearray (lua_State *L, Table *t, int nasize) {
++  int nsize = (t->node == dummynode) ? 0 : sizenode(t);
++  resize(L, t, nasize, nsize);
++}
++
++
++static void rehash (lua_State *L, Table *t, const TValue *ek) {
++  int nasize, na;
++  int nums[MAXBITS+1];  /* nums[i] = number of keys between 2^(i-1) and 2^i */
++  int i;
++  int totaluse;
++  for (i=0; i<=MAXBITS; i++) nums[i] = 0;  /* reset counts */
++  nasize = numusearray(t, nums);  /* count keys in array part */
++  totaluse = nasize;  /* all those keys are integer keys */
++  totaluse += numusehash(t, nums, &nasize);  /* count keys in hash part */
++  /* count extra key */
++  nasize += countint(ek, nums);
++  totaluse++;
++  /* compute new size for array part */
++  na = computesizes(nums, &nasize);
++  /* resize the table to new computed sizes */
++  resize(L, t, nasize, totaluse - na);
++}
++
++
++
++/*
++** }=============================================================
++*/
++
++
++Table *luaH_new (lua_State *L, int narray, int nhash) {
++  Table *t = luaM_new(L, Table);
++  luaC_link(L, obj2gco(t), LUA_TTABLE);
++  t->metatable = NULL;
++  t->flags = cast_byte(~0);
++  /* temporary values (kept only if some malloc fails) */
++  t->array = NULL;
++  t->sizearray = 0;
++  t->lsizenode = 0;
++  t->node = cast(Node *, dummynode);
++  setarrayvector(L, t, narray);
++  setnodevector(L, t, nhash);
++  return t;
++}
++
++
++void luaH_free (lua_State *L, Table *t) {
++  if (t->node != dummynode)
++    luaM_freearray(L, t->node, sizenode(t), Node);
++  luaM_freearray(L, t->array, t->sizearray, TValue);
++  luaM_free(L, t);
++}
++
++
++static Node *getfreepos (Table *t) {
++  while (t->lastfree-- > t->node) {
++    if (ttisnil(gkey(t->lastfree)))
++      return t->lastfree;
++  }
++  return NULL;  /* could not find a free place */
++}
++
++
++
++/*
++** inserts a new key into a hash table; first, check whether key's main 
++** position is free. If not, check whether colliding node is in its main 
++** position or not: if it is not, move colliding node to an empty place and 
++** put new key in its main position; otherwise (colliding node is in its main 
++** position), new key goes to an empty position. 
++*/
++static TValue *newkey (lua_State *L, Table *t, const TValue *key) {
++  Node *mp = mainposition(t, key);
++  if (!ttisnil(gval(mp)) || mp == dummynode) {
++    Node *othern;
++    Node *n = getfreepos(t);  /* get a free place */
++    if (n == NULL) {  /* cannot find a free place? */
++      rehash(L, t, key);  /* grow table */
++      return luaH_set(L, t, key);  /* re-insert key into grown table */
++    }
++    lua_assert(n != dummynode);
++    othern = mainposition(t, key2tval(mp));
++    if (othern != mp) {  /* is colliding node out of its main position? */
++      /* yes; move colliding node into free position */
++      while (gnext(othern) != mp) othern = gnext(othern);  /* find previous */
++      gnext(othern) = n;  /* redo the chain with `n' in place of `mp' */
++      *n = *mp;  /* copy colliding node into free pos. (mp->next also goes) */
++      gnext(mp) = NULL;  /* now `mp' is free */
++      setnilvalue(gval(mp));
++    }
++    else {  /* colliding node is in its own main position */
++      /* new node will go into free position */
++      gnext(n) = gnext(mp);  /* chain new position */
++      gnext(mp) = n;
++      mp = n;
++    }
++  }
++  gkey(mp)->value = key->value; gkey(mp)->tt = key->tt;
++  luaC_barriert(L, t, key);
++  lua_assert(ttisnil(gval(mp)));
++  return gval(mp);
++}
++
++
++/*
++** search function for integers
++*/
++const TValue *luaH_getnum (Table *t, int key) {
++  /* (1 <= key && key <= t->sizearray) */
++  if (cast(unsigned int, key-1) < cast(unsigned int, t->sizearray))
++    return &t->array[key-1];
++  else {
++    lua_Number nk = cast_num(key);
++    Node *n = hashnum(t, nk);
++    do {  /* check whether `key' is somewhere in the chain */
++      if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk))
++        return gval(n);  /* that's it */
++      else n = gnext(n);
++    } while (n);
++    return luaO_nilobject;
++  }
++}
++
++
++/*
++** search function for strings
++*/
++const TValue *luaH_getstr (Table *t, TString *key) {
++  Node *n = hashstr(t, key);
++  do {  /* check whether `key' is somewhere in the chain */
++    if (ttisstring(gkey(n)) && rawtsvalue(gkey(n)) == key)
++      return gval(n);  /* that's it */
++    else n = gnext(n);
++  } while (n);
++  return luaO_nilobject;
++}
++
++
++/*
++** main search function
++*/
++const TValue *luaH_get (Table *t, const TValue *key) {
++  switch (ttype(key)) {
++    case LUA_TNIL: return luaO_nilobject;
++    case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key));
++    case LUA_TNUMBER: {
++      int k;
++      lua_Number n = nvalue(key);
++      lua_number2int(k, n);
++      if (luai_numeq(cast_num(k), nvalue(key))) /* index is int? */
++        return luaH_getnum(t, k);  /* use specialized version */
++      /* else go through */
++    }
++    default: {
++      Node *n = mainposition(t, key);
++      do {  /* check whether `key' is somewhere in the chain */
++        if (luaO_rawequalObj(key2tval(n), key))
++          return gval(n);  /* that's it */
++        else n = gnext(n);
++      } while (n);
++      return luaO_nilobject;
++    }
++  }
++}
++
++
++TValue *luaH_set (lua_State *L, Table *t, const TValue *key) {
++  const TValue *p = luaH_get(t, key);
++  t->flags = 0;
++  if (p != luaO_nilobject)
++    return cast(TValue *, p);
++  else {
++    if (ttisnil(key)) luaG_runerror(L, "table index is nil");
++    else if (ttisnumber(key) && luai_numisnan(nvalue(key)))
++      luaG_runerror(L, "table index is NaN");
++    return newkey(L, t, key);
++  }
++}
++
++
++TValue *luaH_setnum (lua_State *L, Table *t, int key) {
++  const TValue *p = luaH_getnum(t, key);
++  if (p != luaO_nilobject)
++    return cast(TValue *, p);
++  else {
++    TValue k;
++    setnvalue(&k, cast_num(key));
++    return newkey(L, t, &k);
++  }
++}
++
++
++TValue *luaH_setstr (lua_State *L, Table *t, TString *key) {
++  const TValue *p = luaH_getstr(t, key);
++  if (p != luaO_nilobject)
++    return cast(TValue *, p);
++  else {
++    TValue k;
++    setsvalue(L, &k, key);
++    return newkey(L, t, &k);
++  }
++}
++
++
++static int unbound_search (Table *t, unsigned int j) {
++  unsigned int i = j;  /* i is zero or a present index */
++  j++;
++  /* find `i' and `j' such that i is present and j is not */
++  while (!ttisnil(luaH_getnum(t, j))) {
++    i = j;
++    j *= 2;
++    if (j > cast(unsigned int, MAX_INT)) {  /* overflow? */
++      /* table was built with bad purposes: resort to linear search */
++      i = 1;
++      while (!ttisnil(luaH_getnum(t, i))) i++;
++      return i - 1;
++    }
++  }
++  /* now do a binary search between them */
++  while (j - i > 1) {
++    unsigned int m = (i+j)/2;
++    if (ttisnil(luaH_getnum(t, m))) j = m;
++    else i = m;
++  }
++  return i;
++}
++
++
++/*
++** Try to find a boundary in table `t'. A `boundary' is an integer index
++** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil).
++*/
++int luaH_getn (Table *t) {
++  unsigned int j = t->sizearray;
++  if (j > 0 && ttisnil(&t->array[j - 1])) {
++    /* there is a boundary in the array part: (binary) search for it */
++    unsigned int i = 0;
++    while (j - i > 1) {
++      unsigned int m = (i+j)/2;
++      if (ttisnil(&t->array[m - 1])) j = m;
++      else i = m;
++    }
++    return i;
++  }
++  /* else must find a boundary in hash part */
++  else if (t->node == dummynode)  /* hash part is empty? */
++    return j;  /* that is easy... */
++  else return unbound_search(t, j);
++}
++
++
++
++#if defined(LUA_DEBUG)
++
++Node *luaH_mainposition (const Table *t, const TValue *key) {
++  return mainposition(t, key);
++}
++
++int luaH_isdummy (Node *n) { return n == dummynode; }
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/ltable.h
+@@ -0,0 +1,40 @@
++/*
++** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $
++** Lua tables (hash)
++** See Copyright Notice in lua.h
++*/
++
++#ifndef ltable_h
++#define ltable_h
++
++#include "lobject.h"
++
++
++#define gnode(t,i)    (&(t)->node[i])
++#define gkey(n)               (&(n)->i_key.nk)
++#define gval(n)               (&(n)->i_val)
++#define gnext(n)      ((n)->i_key.nk.next)
++
++#define key2tval(n)   (&(n)->i_key.tvk)
++
++
++LUAI_FUNC const TValue *luaH_getnum (Table *t, int key);
++LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key);
++LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
++LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key);
++LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
++LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
++LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash);
++LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);
++LUAI_FUNC void luaH_free (lua_State *L, Table *t);
++LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
++LUAI_FUNC int luaH_getn (Table *t);
++
++
++#if defined(LUA_DEBUG)
++LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
++LUAI_FUNC int luaH_isdummy (Node *n);
++#endif
++
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/ltablib.c
+@@ -0,0 +1,288 @@
++/*
++** $Id: ltablib.c,v 1.38.1.3 2008/02/14 16:46:58 roberto Exp $
++** Library for Table Manipulation
++** See Copyright Notice in lua.h
++*/
++
++
++#include <stddef.h>
++
++#define ltablib_c
++#define LUA_LIB
++
++#include "lua.h"
++
++#include "lauxlib.h"
++#include "lualib.h"
++
++
++#define aux_getn(L,n) (luaL_checktype(L, n, LUA_TTABLE), luaL_getn(L, n))
++
++
++static int foreachi (lua_State *L) {
++  int i;
++  int n = aux_getn(L, 1);
++  luaL_checktype(L, 2, LUA_TFUNCTION);
++  for (i=1; i <= n; i++) {
++    lua_pushvalue(L, 2);  /* function */
++    lua_pushinteger(L, i);  /* 1st argument */
++    lua_rawgeti(L, 1, i);  /* 2nd argument */
++    lua_call(L, 2, 1);
++    if (!lua_isnil(L, -1))
++      return 1;
++    lua_pop(L, 1);  /* remove nil result */
++  }
++  return 0;
++}
++
++
++static int foreach (lua_State *L) {
++  luaL_checktype(L, 1, LUA_TTABLE);
++  luaL_checktype(L, 2, LUA_TFUNCTION);
++  lua_pushnil(L);  /* first key */
++  while (lua_next(L, 1)) {
++    lua_pushvalue(L, 2);  /* function */
++    lua_pushvalue(L, -3);  /* key */
++    lua_pushvalue(L, -3);  /* value */
++    lua_call(L, 2, 1);
++    if (!lua_isnil(L, -1))
++      return 1;
++    lua_pop(L, 2);  /* remove value and result */
++  }
++  return 0;
++}
++
++
++static int maxn (lua_State *L) {
++  lua_Number max = 0;
++  luaL_checktype(L, 1, LUA_TTABLE);
++  lua_pushnil(L);  /* first key */
++  while (lua_next(L, 1)) {
++    lua_pop(L, 1);  /* remove value */
++    if (lua_type(L, -1) == LUA_TNUMBER) {
++      lua_Number v = lua_tonumber(L, -1);
++      if (v > max) max = v;
++    }
++  }
++  lua_pushnumber(L, max);
++  return 1;
++}
++
++
++static int getn (lua_State *L) {
++  lua_pushinteger(L, aux_getn(L, 1));
++  return 1;
++}
++
++
++static int setn (lua_State *L) {
++  luaL_checktype(L, 1, LUA_TTABLE);
++#ifndef luaL_setn
++  luaL_setn(L, 1, luaL_checkint(L, 2));
++#else
++  luaL_error(L, LUA_QL("setn") " is obsolete");
++#endif
++  lua_pushvalue(L, 1);
++  return 1;
++}
++
++
++static int tinsert (lua_State *L) {
++  int e = aux_getn(L, 1) + 1;  /* first empty element */
++  int pos;  /* where to insert new element */
++  switch (lua_gettop(L)) {
++    case 2: {  /* called with only 2 arguments */
++      pos = e;  /* insert new element at the end */
++      break;
++    }
++    case 3: {
++      int i;
++      pos = luaL_checkint(L, 2);  /* 2nd argument is the position */
++      if (pos > e) e = pos;  /* `grow' array if necessary */
++      for (i = e; i > pos; i--) {  /* move up elements */
++        lua_rawgeti(L, 1, i-1);
++        lua_rawseti(L, 1, i);  /* t[i] = t[i-1] */
++      }
++      break;
++    }
++    default: {
++      return luaL_error(L, "wrong number of arguments to " LUA_QL("insert"));
++    }
++  }
++  luaL_setn(L, 1, e);  /* new size */
++  lua_rawseti(L, 1, pos);  /* t[pos] = v */
++  return 0;
++}
++
++
++static int tremove (lua_State *L) {
++  int e = aux_getn(L, 1);
++  int pos = luaL_optint(L, 2, e);
++  if (!(1 <= pos && pos <= e))  /* position is outside bounds? */
++   return 0;  /* nothing to remove */
++  luaL_setn(L, 1, e - 1);  /* t.n = n-1 */
++  lua_rawgeti(L, 1, pos);  /* result = t[pos] */
++  for ( ;pos<e; pos++) {
++    lua_rawgeti(L, 1, pos+1);
++    lua_rawseti(L, 1, pos);  /* t[pos] = t[pos+1] */
++  }
++  lua_pushnil(L);
++  lua_rawseti(L, 1, e);  /* t[e] = nil */
++  return 1;
++}
++
++
++static void addfield (lua_State *L, luaL_Buffer *b, int i) {
++  lua_rawgeti(L, 1, i);
++  if (!lua_isstring(L, -1))
++    luaL_error(L, "invalid value (%s) at index %d in table for "
++                  LUA_QL("concat"), luaL_typename(L, -1), i);
++    luaL_addvalue(b);
++}
++
++
++static int tconcat (lua_State *L) {
++  size_t lsep;
++  int i, last;
++  const char *sep = luaL_optlstring(L, 2, "", &lsep);
++  luaL_Buffer *b = (luaL_Buffer *)kmalloc(sizeof(luaL_Buffer) + BUFSIZ, GFP_ATOMIC);
++  if(!b) luaL_error(L, "tconcat: cannot allocate memory");
++  luaL_checktype(L, 1, LUA_TTABLE);
++  i = luaL_optint(L, 3, 1);
++  last = luaL_opt(L, luaL_checkint, 4, luaL_getn(L, 1));
++  luaL_buffinit(L, b);
++  for (; i < last; i++) {
++    addfield(L, b, i);
++    luaL_addlstring(b, sep, lsep);
++  }
++  if (i == last)  /* add last value (if interval was not empty) */
++    addfield(L, b, i);
++  luaL_pushresult(b);
++  kfree(b);
++  return 1;
++}
++
++
++
++/*
++** {======================================================
++** Quicksort
++** (based on `Algorithms in MODULA-3', Robert Sedgewick;
++**  Addison-Wesley, 1993.)
++*/
++
++
++static void set2 (lua_State *L, int i, int j) {
++  lua_rawseti(L, 1, i);
++  lua_rawseti(L, 1, j);
++}
++
++static int sort_comp (lua_State *L, int a, int b) {
++  if (!lua_isnil(L, 2)) {  /* function? */
++    int res;
++    lua_pushvalue(L, 2);
++    lua_pushvalue(L, a-1);  /* -1 to compensate function */
++    lua_pushvalue(L, b-2);  /* -2 to compensate function and `a' */
++    lua_call(L, 2, 1);
++    res = lua_toboolean(L, -1);
++    lua_pop(L, 1);
++    return res;
++  }
++  else  /* a < b? */
++    return lua_lessthan(L, a, b);
++}
++
++static void auxsort (lua_State *L, int l, int u) {
++  while (l < u) {  /* for tail recursion */
++    int i, j;
++    /* sort elements a[l], a[(l+u)/2] and a[u] */
++    lua_rawgeti(L, 1, l);
++    lua_rawgeti(L, 1, u);
++    if (sort_comp(L, -1, -2))  /* a[u] < a[l]? */
++      set2(L, l, u);  /* swap a[l] - a[u] */
++    else
++      lua_pop(L, 2);
++    if (u-l == 1) break;  /* only 2 elements */
++    i = (l+u)/2;
++    lua_rawgeti(L, 1, i);
++    lua_rawgeti(L, 1, l);
++    if (sort_comp(L, -2, -1))  /* a[i]<a[l]? */
++      set2(L, i, l);
++    else {
++      lua_pop(L, 1);  /* remove a[l] */
++      lua_rawgeti(L, 1, u);
++      if (sort_comp(L, -1, -2))  /* a[u]<a[i]? */
++        set2(L, i, u);
++      else
++        lua_pop(L, 2);
++    }
++    if (u-l == 2) break;  /* only 3 elements */
++    lua_rawgeti(L, 1, i);  /* Pivot */
++    lua_pushvalue(L, -1);
++    lua_rawgeti(L, 1, u-1);
++    set2(L, i, u-1);
++    /* a[l] <= P == a[u-1] <= a[u], only need to sort from l+1 to u-2 */
++    i = l; j = u-1;
++    for (;;) {  /* invariant: a[l..i] <= P <= a[j..u] */
++      /* repeat ++i until a[i] >= P */
++      while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) {
++        if (i>u) luaL_error(L, "invalid order function for sorting");
++        lua_pop(L, 1);  /* remove a[i] */
++      }
++      /* repeat --j until a[j] <= P */
++      while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) {
++        if (j<l) luaL_error(L, "invalid order function for sorting");
++        lua_pop(L, 1);  /* remove a[j] */
++      }
++      if (j<i) {
++        lua_pop(L, 3);  /* pop pivot, a[i], a[j] */
++        break;
++      }
++      set2(L, i, j);
++    }
++    lua_rawgeti(L, 1, u-1);
++    lua_rawgeti(L, 1, i);
++    set2(L, u-1, i);  /* swap pivot (a[u-1]) with a[i] */
++    /* a[l..i-1] <= a[i] == P <= a[i+1..u] */
++    /* adjust so that smaller half is in [j..i] and larger one in [l..u] */
++    if (i-l < u-i) {
++      j=l; i=i-1; l=i+2;
++    }
++    else {
++      j=i+1; i=u; u=j-2;
++    }
++    auxsort(L, j, i);  /* call recursively the smaller one */
++  }  /* repeat the routine for the larger one */
++}
++
++static int sort (lua_State *L) {
++  int n = aux_getn(L, 1);
++  luaL_checkstack(L, 40, "");  /* assume array is smaller than 2^40 */
++  if (!lua_isnoneornil(L, 2))  /* is there a 2nd argument? */
++    luaL_checktype(L, 2, LUA_TFUNCTION);
++  lua_settop(L, 2);  /* make sure there is two arguments */
++  auxsort(L, 1, n);
++  return 0;
++}
++
++/* }====================================================== */
++
++
++static const luaL_Reg tab_funcs[] = {
++  {"concat", tconcat},
++  {"foreach", foreach},
++  {"foreachi", foreachi},
++  {"getn", getn},
++  {"maxn", maxn},
++  {"insert", tinsert},
++  {"remove", tremove},
++  {"setn", setn},
++  {"sort", sort},
++  {NULL, NULL}
++};
++
++
++LUALIB_API int luaopen_table (lua_State *L) {
++  luaL_register(L, LUA_TABLIBNAME, tab_funcs);
++  return 1;
++}
+--- /dev/null
++++ b/extensions/LUA/lua/ltm.c
+@@ -0,0 +1,74 @@
++/*
++** $Id: ltm.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $
++** Tag methods
++** See Copyright Notice in lua.h
++*/
++
++#include <string.h>
++
++#define ltm_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "lobject.h"
++#include "lstate.h"
++#include "lstring.h"
++#include "ltable.h"
++#include "ltm.h"
++
++
++
++const char *const luaT_typenames[] = {
++  "nil", "boolean", "userdata", "number",
++  "string", "table", "function", "userdata", "thread",
++  "proto", "upval"
++};
++
++
++void luaT_init (lua_State *L) {
++  static const char *const luaT_eventname[] = {  /* ORDER TM */
++    "__index", "__newindex",
++    "__gc", "__mode", "__eq",
++    "__add", "__sub", "__mul", "__div", "__mod",
++    "__pow", "__unm", "__len", "__lt", "__le",
++    "__concat", "__call"
++  };
++  int i;
++  for (i=0; i<TM_N; i++) {
++    G(L)->tmname[i] = luaS_new(L, luaT_eventname[i]);
++    luaS_fix(G(L)->tmname[i]);  /* never collect these names */
++  }
++}
++
++
++/*
++** function to be used with macro "fasttm": optimized for absence of
++** tag methods
++*/
++const TValue *luaT_gettm (Table *events, TMS event, TString *ename) {
++  const TValue *tm = luaH_getstr(events, ename);
++  lua_assert(event <= TM_EQ);
++  if (ttisnil(tm)) {  /* no tag method? */
++    events->flags |= cast_byte(1u<<event);  /* cache this fact */
++    return NULL;
++  }
++  else return tm;
++}
++
++
++const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) {
++  Table *mt;
++  switch (ttype(o)) {
++    case LUA_TTABLE:
++      mt = hvalue(o)->metatable;
++      break;
++    case LUA_TUSERDATA:
++      mt = uvalue(o)->metatable;
++      break;
++    default:
++      mt = G(L)->mt[ttype(o)];
++  }
++  return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject);
++}
++
+--- /dev/null
++++ b/extensions/LUA/lua/ltm.h
+@@ -0,0 +1,54 @@
++/*
++** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $
++** Tag methods
++** See Copyright Notice in lua.h
++*/
++
++#ifndef ltm_h
++#define ltm_h
++
++
++#include "lobject.h"
++
++
++/*
++* WARNING: if you change the order of this enumeration,
++* grep "ORDER TM"
++*/
++typedef enum {
++  TM_INDEX,
++  TM_NEWINDEX,
++  TM_GC,
++  TM_MODE,
++  TM_EQ,  /* last tag method with `fast' access */
++  TM_ADD,
++  TM_SUB,
++  TM_MUL,
++  TM_DIV,
++  TM_MOD,
++  TM_POW,
++  TM_UNM,
++  TM_LEN,
++  TM_LT,
++  TM_LE,
++  TM_CONCAT,
++  TM_CALL,
++  TM_N                /* number of elements in the enum */
++} TMS;
++
++
++
++#define gfasttm(g,et,e) ((et) == NULL ? NULL : \
++  ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
++
++#define fasttm(l,et,e)        gfasttm(G(l), et, e)
++
++LUAI_DATA const char *const luaT_typenames[];
++
++
++LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
++LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
++                                                       TMS event);
++LUAI_FUNC void luaT_init (lua_State *L);
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/luaconf.h
+@@ -0,0 +1,797 @@
++/*
++** $Id: luaconf.h,v 1.82.1.7 2008/02/11 16:25:08 roberto Exp $
++** Configuration file for Lua
++** See Copyright Notice in lua.h
++*/
++
++
++#ifndef lconfig_h
++#define lconfig_h
++
++#include <stddef.h>
++
++#if !defined(__KERNEL__)
++#include <limits.h>
++#else
++#define UCHAR_MAX     255
++#define SHRT_MAX        32767
++#define BUFSIZ                8192
++#define NO_FPU
++#endif
++
++/*
++** ==================================================================
++** Search for "@@" to find all configurable definitions.
++** ===================================================================
++*/
++
++
++/*
++@@ LUA_ANSI controls the use of non-ansi features.
++** CHANGE it (define it) if you want Lua to avoid the use of any
++** non-ansi feature or library.
++*/
++#if defined(__STRICT_ANSI__)
++#define LUA_ANSI
++#endif
++
++
++#if !defined(LUA_ANSI) && defined(_WIN32)
++#define LUA_WIN
++#endif
++
++#if defined(LUA_USE_LINUX)
++#define LUA_USE_POSIX
++#define LUA_USE_DLOPEN                /* needs an extra library: -ldl */
++#define LUA_USE_READLINE      /* needs some extra libraries */
++#endif
++
++#if defined(LUA_USE_MACOSX)
++#define LUA_USE_POSIX
++#define LUA_DL_DYLD           /* does not need extra library */
++#endif
++
++
++
++/*
++@@ LUA_USE_POSIX includes all functionallity listed as X/Open System
++@* Interfaces Extension (XSI).
++** CHANGE it (define it) if your system is XSI compatible.
++*/
++#if defined(LUA_USE_POSIX)
++#define LUA_USE_MKSTEMP
++#define LUA_USE_ISATTY
++#define LUA_USE_POPEN
++#define LUA_USE_ULONGJMP
++#endif
++
++
++/*
++@@ LUA_PATH and LUA_CPATH are the names of the environment variables that
++@* Lua check to set its paths.
++@@ LUA_INIT is the name of the environment variable that Lua
++@* checks for initialization code.
++** CHANGE them if you want different names.
++*/
++#define LUA_PATH        "LUA_PATH"
++#define LUA_CPATH       "LUA_CPATH"
++#define LUA_INIT      "LUA_INIT"
++
++
++/*
++@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for
++@* Lua libraries.
++@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for
++@* C libraries.
++** CHANGE them if your machine has a non-conventional directory
++** hierarchy or if you want to install your libraries in
++** non-conventional directories.
++*/
++#if defined(_WIN32)
++/*
++** In Windows, any exclamation mark ('!') in the path is replaced by the
++** path of the directory of the executable file of the current process.
++*/
++#define LUA_LDIR      "!\\lua\\"
++#define LUA_CDIR      "!\\"
++#define LUA_PATH_DEFAULT  \
++              ".\\?.lua;"  LUA_LDIR"?.lua;"  LUA_LDIR"?\\init.lua;" \
++                           LUA_CDIR"?.lua;"  LUA_CDIR"?\\init.lua"
++#define LUA_CPATH_DEFAULT \
++      ".\\?.dll;"  LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
++
++#else
++#define LUA_ROOT      "/usr/local/"
++#define LUA_LDIR      LUA_ROOT "share/lua/5.1/"
++#define LUA_CDIR      LUA_ROOT "lib/lua/5.1/"
++#define LUA_PATH_DEFAULT  \
++              "./?.lua;"  LUA_LDIR"?.lua;"  LUA_LDIR"?/init.lua;" \
++                          LUA_CDIR"?.lua;"  LUA_CDIR"?/init.lua"
++#define LUA_CPATH_DEFAULT \
++      "./?.so;"  LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
++#endif
++
++
++/*
++@@ LUA_DIRSEP is the directory separator (for submodules).
++** CHANGE it if your machine does not use "/" as the directory separator
++** and is not Windows. (On Windows Lua automatically uses "\".)
++*/
++#if defined(_WIN32)
++#define LUA_DIRSEP    "\\"
++#else
++#define LUA_DIRSEP    "/"
++#endif
++
++
++/*
++@@ LUA_PATHSEP is the character that separates templates in a path.
++@@ LUA_PATH_MARK is the string that marks the substitution points in a
++@* template.
++@@ LUA_EXECDIR in a Windows path is replaced by the executable's
++@* directory.
++@@ LUA_IGMARK is a mark to ignore all before it when bulding the
++@* luaopen_ function name.
++** CHANGE them if for some reason your system cannot use those
++** characters. (E.g., if one of those characters is a common character
++** in file/directory names.) Probably you do not need to change them.
++*/
++#define LUA_PATHSEP   ";"
++#define LUA_PATH_MARK "?"
++#define LUA_EXECDIR   "!"
++#define LUA_IGMARK    "-"
++
++
++/*
++@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger.
++** CHANGE that if ptrdiff_t is not adequate on your machine. (On most
++** machines, ptrdiff_t gives a good choice between int or long.)
++*/
++#define LUA_INTEGER   ptrdiff_t
++
++
++/*
++@@ LUA_API is a mark for all core API functions.
++@@ LUALIB_API is a mark for all standard library functions.
++** CHANGE them if you need to define those functions in some special way.
++** For instance, if you want to create one Windows DLL with the core and
++** the libraries, you may want to use the following definition (define
++** LUA_BUILD_AS_DLL to get it).
++*/
++#if defined(LUA_BUILD_AS_DLL)
++
++#if defined(LUA_CORE) || defined(LUA_LIB)
++#define LUA_API __declspec(dllexport)
++#else
++#define LUA_API __declspec(dllimport)
++#endif
++
++#else
++
++#define LUA_API               extern
++
++#endif
++
++/* more often than not the libs go together with the core */
++#define LUALIB_API    LUA_API
++
++
++/*
++@@ LUAI_FUNC is a mark for all extern functions that are not to be
++@* exported to outside modules.
++@@ LUAI_DATA is a mark for all extern (const) variables that are not to
++@* be exported to outside modules.
++** CHANGE them if you need to mark them in some special way. Elf/gcc
++** (versions 3.2 and later) mark them as "hidden" to optimize access
++** when Lua is compiled as a shared library.
++*/
++#if defined(luaall_c)
++#define LUAI_FUNC     static
++#define LUAI_DATA     /* empty */
++
++#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
++      defined(__ELF__)
++#define LUAI_FUNC     __attribute__((visibility("hidden"))) extern
++#define LUAI_DATA     LUAI_FUNC
++
++#else
++#define LUAI_FUNC     extern
++#define LUAI_DATA     extern
++#endif
++
++
++
++/*
++@@ LUA_QL describes how error messages quote program elements.
++** CHANGE it if you want a different appearance.
++*/
++#define LUA_QL(x)     "'" x "'"
++#define LUA_QS                LUA_QL("%s")
++
++
++/*
++@@ LUA_IDSIZE gives the maximum size for the description of the source
++@* of a function in debug information.
++** CHANGE it if you want a different size.
++*/
++#define LUA_IDSIZE    60
++
++
++/*
++** {==================================================================
++** Stand-alone configuration
++** ===================================================================
++*/
++
++#if defined(lua_c) || defined(luaall_c)
++
++/*
++@@ lua_stdin_is_tty detects whether the standard input is a 'tty' (that
++@* is, whether we're running lua interactively).
++** CHANGE it if you have a better definition for non-POSIX/non-Windows
++** systems.
++*/
++#if defined(LUA_USE_ISATTY)
++#include <unistd.h>
++#define lua_stdin_is_tty()    isatty(0)
++#elif defined(LUA_WIN)
++#include <io.h>
++#include <stdio.h>
++#define lua_stdin_is_tty()    _isatty(_fileno(stdin))
++#else
++#define lua_stdin_is_tty()    1  /* assume stdin is a tty */
++#endif
++
++
++/*
++@@ LUA_PROMPT is the default prompt used by stand-alone Lua.
++@@ LUA_PROMPT2 is the default continuation prompt used by stand-alone Lua.
++** CHANGE them if you want different prompts. (You can also change the
++** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.)
++*/
++#define LUA_PROMPT            "> "
++#define LUA_PROMPT2           ">> "
++
++
++/*
++@@ LUA_PROGNAME is the default name for the stand-alone Lua program.
++** CHANGE it if your stand-alone interpreter has a different name and
++** your system is not able to detect that name automatically.
++*/
++#define LUA_PROGNAME          "lua"
++
++
++/*
++@@ LUA_MAXINPUT is the maximum length for an input line in the
++@* stand-alone interpreter.
++** CHANGE it if you need longer lines.
++*/
++#define LUA_MAXINPUT  512
++
++
++/*
++@@ lua_readline defines how to show a prompt and then read a line from
++@* the standard input.
++@@ lua_saveline defines how to "save" a read line in a "history".
++@@ lua_freeline defines how to free a line read by lua_readline.
++** CHANGE them if you want to improve this functionality (e.g., by using
++** GNU readline and history facilities).
++*/
++#if defined(LUA_USE_READLINE)
++#include <stdio.h>
++#include <readline/readline.h>
++#include <readline/history.h>
++#define lua_readline(L,b,p)   ((void)L, ((b)=readline(p)) != NULL)
++#define lua_saveline(L,idx) \
++      if (lua_strlen(L,idx) > 0)  /* non-empty line? */ \
++        add_history(lua_tostring(L, idx));  /* add it to history */
++#define lua_freeline(L,b)     ((void)L, free(b))
++#else
++#define lua_readline(L,b,p)   \
++      ((void)L, fputs(p, stdout), fflush(stdout),  /* show prompt */ \
++      fgets(b, LUA_MAXINPUT, stdin) != NULL)  /* get line */
++#define lua_saveline(L,idx)   { (void)L; (void)idx; }
++#define lua_freeline(L,b)     { (void)L; (void)b; }
++#endif
++
++#endif
++
++/* }================================================================== */
++
++
++/*
++@@ LUAI_GCPAUSE defines the default pause between garbage-collector cycles
++@* as a percentage.
++** CHANGE it if you want the GC to run faster or slower (higher values
++** mean larger pauses which mean slower collection.) You can also change
++** this value dynamically.
++*/
++#define LUAI_GCPAUSE  200  /* 200% (wait memory to double before next GC) */
++
++
++/*
++@@ LUAI_GCMUL defines the default speed of garbage collection relative to
++@* memory allocation as a percentage.
++** CHANGE it if you want to change the granularity of the garbage
++** collection. (Higher values mean coarser collections. 0 represents
++** infinity, where each step performs a full collection.) You can also
++** change this value dynamically.
++*/
++#define LUAI_GCMUL    200 /* GC runs 'twice the speed' of memory allocation */
++
++
++
++/*
++@@ LUA_COMPAT_GETN controls compatibility with old getn behavior.
++** CHANGE it (define it) if you want exact compatibility with the
++** behavior of setn/getn in Lua 5.0.
++*/
++#undef LUA_COMPAT_GETN
++
++/*
++@@ LUA_COMPAT_LOADLIB controls compatibility about global loadlib.
++** CHANGE it to undefined as soon as you do not need a global 'loadlib'
++** function (the function is still available as 'package.loadlib').
++*/
++#undef LUA_COMPAT_LOADLIB
++
++/*
++@@ LUA_COMPAT_VARARG controls compatibility with old vararg feature.
++** CHANGE it to undefined as soon as your programs use only '...' to
++** access vararg parameters (instead of the old 'arg' table).
++*/
++#define LUA_COMPAT_VARARG
++
++/*
++@@ LUA_COMPAT_MOD controls compatibility with old math.mod function.
++** CHANGE it to undefined as soon as your programs use 'math.fmod' or
++** the new '%' operator instead of 'math.mod'.
++*/
++#define LUA_COMPAT_MOD
++
++/*
++@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting
++@* facility.
++** CHANGE it to 2 if you want the old behaviour, or undefine it to turn
++** off the advisory error when nesting [[...]].
++*/
++#define LUA_COMPAT_LSTR               1
++
++/*
++@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.
++** CHANGE it to undefined as soon as you rename 'string.gfind' to
++** 'string.gmatch'.
++*/
++#define LUA_COMPAT_GFIND
++
++/*
++@@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib'
++@* behavior.
++** CHANGE it to undefined as soon as you replace to 'luaL_register'
++** your uses of 'luaL_openlib'
++*/
++#define LUA_COMPAT_OPENLIB
++
++
++
++/*
++@@ luai_apicheck is the assert macro used by the Lua-C API.
++** CHANGE luai_apicheck if you want Lua to perform some checks in the
++** parameters it gets from API calls. This may slow down the interpreter
++** a bit, but may be quite useful when debugging C code that interfaces
++** with Lua. A useful redefinition is to use assert.h.
++*/
++#if defined(LUA_USE_APICHECK)
++#include <assert.h>
++#define luai_apicheck(L,o)    { (void)L; assert(o); }
++#else
++#define luai_apicheck(L,o)    { (void)L; }
++#endif
++
++
++/*
++@@ LUAI_BITSINT defines the number of bits in an int.
++** CHANGE here if Lua cannot automatically detect the number of bits of
++** your machine. Probably you do not need to change this.
++*/
++/* avoid overflows in comparison */
++#if !defined(__KERNEL__)
++#include <limits.h>
++#define LUA_INT_MAX INT_MAX
++#else
++#define LUA_INT_MAX (~0U>>1)
++#endif
++
++#if LUA_INT_MAX-20 < 32760
++#define LUAI_BITSINT  16
++#elif LUA_INT_MAX > 2147483640L
++/* int has at least 32 bits */
++#define LUAI_BITSINT  32
++#else
++#error "you must define LUA_BITSINT with number of bits in an integer"
++#endif
++
++
++/*
++@@ LUAI_UINT32 is an unsigned integer with at least 32 bits.
++@@ LUAI_INT32 is an signed integer with at least 32 bits.
++@@ LUAI_UMEM is an unsigned integer big enough to count the total
++@* memory used by Lua.
++@@ LUAI_MEM is a signed integer big enough to count the total memory
++@* used by Lua.
++** CHANGE here if for some weird reason the default definitions are not
++** good enough for your machine. (The definitions in the 'else'
++** part always works, but may waste space on machines with 64-bit
++** longs.) Probably you do not need to change this.
++*/
++#if LUAI_BITSINT >= 32
++#define LUAI_UINT32   unsigned int
++#define LUAI_INT32    int
++#define LUAI_MAXINT32 INT_MAX
++#define LUAI_UMEM     size_t
++#define LUAI_MEM      ptrdiff_t
++#else
++/* 16-bit ints */
++#define LUAI_UINT32   unsigned long
++#define LUAI_INT32    long
++#define LUAI_MAXINT32 LONG_MAX
++#define LUAI_UMEM     unsigned long
++#define LUAI_MEM      long
++#endif
++
++
++/*
++@@ LUAI_MAXCALLS limits the number of nested calls.
++** CHANGE it if you need really deep recursive calls. This limit is
++** arbitrary; its only purpose is to stop infinite recursion before
++** exhausting memory.
++*/
++#define LUAI_MAXCALLS 20000
++
++
++/*
++@@ LUAI_MAXCSTACK limits the number of Lua stack slots that a C function
++@* can use.
++** CHANGE it if you need lots of (Lua) stack space for your C
++** functions. This limit is arbitrary; its only purpose is to stop C
++** functions to consume unlimited stack space. (must be smaller than
++** -LUA_REGISTRYINDEX)
++*/
++#define LUAI_MAXCSTACK        8000
++
++
++
++/*
++** {==================================================================
++** CHANGE (to smaller values) the following definitions if your system
++** has a small C stack. (Or you may want to change them to larger
++** values if your system has a large C stack and these limits are
++** too rigid for you.) Some of these constants control the size of
++** stack-allocated arrays used by the compiler or the interpreter, while
++** others limit the maximum number of recursive calls that the compiler
++** or the interpreter can perform. Values too large may cause a C stack
++** overflow for some forms of deep constructs.
++** ===================================================================
++*/
++
++
++/*
++@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and
++@* syntactical nested non-terminals in a program.
++*/
++#define LUAI_MAXCCALLS                200
++
++
++/*
++@@ LUAI_MAXVARS is the maximum number of local variables per function
++@* (must be smaller than 250).
++*/
++#define LUAI_MAXVARS          200
++
++
++/*
++@@ LUAI_MAXUPVALUES is the maximum number of upvalues per function
++@* (must be smaller than 250).
++*/
++#define LUAI_MAXUPVALUES      60
++
++
++/*
++@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
++*/
++#define LUAL_BUFFERSIZE               BUFSIZ
++
++/* }================================================================== */
++
++
++
++
++/*
++** {==================================================================
++@@ LUA_NUMBER is the type of numbers in Lua.
++** CHANGE the following definitions only if you want to build Lua
++** with a number type different from double. You may also need to
++** change lua_number2int & lua_number2integer.
++** ===================================================================
++*/
++#if !defined(NO_FPU)
++#define LUA_NUMBER_DOUBLE
++#define LUA_NUMBER    double
++#else
++#define LUA_NUMBER    long
++#endif
++
++/*
++@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
++@* over a number.
++*/
++#define LUAI_UACNUMBER        LUA_NUMBER
++
++
++/*
++@@ LUA_NUMBER_SCAN is the format for reading numbers.
++@@ LUA_NUMBER_FMT is the format for writing numbers.
++@@ lua_number2str converts a number to a string.
++@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion.
++@@ lua_str2number converts a string to a number.
++*/
++#if !defined(NO_FPU)
++#define LUA_NUMBER_SCAN               "%lf"
++#define LUA_NUMBER_FMT                "%.14g"
++#define lua_str2number(s,p)   strtod((s), (p))
++#else
++#define LUA_NUMBER_SCAN               "%ld"
++#define LUA_NUMBER_FMT                "%ld"
++#if !defined(__KERNEL__)
++#define lua_str2number(s,p)   strtol((s), (p), 10)
++#else
++#define lua_str2number(s,p)   simple_strtol((s), (p), 10)
++#endif
++#endif
++
++#define LUAI_MAXNUMBER2STR    32 /* 16 digits, sign, point, and \0 */
++#define lua_number2str(s,n)   sprintf((s), LUA_NUMBER_FMT, (n))
++
++/*
++@@ The luai_num* macros define the primitive operations over numbers.
++*/
++#if defined(LUA_CORE)
++#define luai_numadd(a,b)      ((a)+(b))
++#define luai_numsub(a,b)      ((a)-(b))
++#define luai_nummul(a,b)      ((a)*(b))
++#define luai_numdiv(a,b)      ((a)/(b))
++#define luai_numunm(a)                (-(a))
++#define luai_numeq(a,b)               ((a)==(b))
++#define luai_numlt(a,b)               ((a)<(b))
++#define luai_numle(a,b)               ((a)<=(b))
++#define luai_numisnan(a)      (!luai_numeq((a), (a)))
++#if !defined(NO_FPU)
++#include <math.h>
++#define luai_nummod(a,b)      ((a) - floor((a)/(b))*(b))
++#define luai_numpow(a,b)      (pow(a,b))
++#else
++#define luai_nummod(a,b)      ((a)%(b))
++#define luai_numpow(a,b)      luai_nummul(a,b)
++#endif
++#endif
++
++
++/*
++@@ lua_number2int is a macro to convert lua_Number to int.
++@@ lua_number2integer is a macro to convert lua_Number to lua_Integer.
++** CHANGE them if you know a faster way to convert a lua_Number to
++** int (with any rounding method and without throwing errors) in your
++** system. In Pentium machines, a naive typecast from double to int
++** in C is extremely slow, so any alternative is worth trying.
++*/
++
++/* On a Pentium, resort to a trick */
++#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \
++    (defined(__i386) || defined (_M_IX86) || defined(__i386__))
++
++/* On a Microsoft compiler, use assembler */
++#if defined(_MSC_VER)
++
++#define lua_number2int(i,d)   __asm fld d   __asm fistp i
++#define lua_number2integer(i,n)               lua_number2int(i, n)
++
++/* the next trick should work on any Pentium, but sometimes clashes
++   with a DirectX idiosyncrasy */
++#else
++
++union luai_Cast { double l_d; long l_l; };
++#define lua_number2int(i,d) \
++  { volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; }
++#define lua_number2integer(i,n)               lua_number2int(i, n)
++
++#endif
++
++
++/* this option always works, but may be slow */
++#else
++#define lua_number2int(i,d)   ((i)=(int)(d))
++#define lua_number2integer(i,d)       ((i)=(lua_Integer)(d))
++
++#endif
++
++/* }================================================================== */
++
++
++/*
++@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment.
++** CHANGE it if your system requires alignments larger than double. (For
++** instance, if your system supports long doubles and they must be
++** aligned in 16-byte boundaries, then you should add long double in the
++** union.) Probably you do not need to change this.
++*/
++#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; }
++
++
++/*
++@@ LUAI_THROW/LUAI_TRY define how Lua does exception handling.
++** CHANGE them if you prefer to use longjmp/setjmp even with C++
++** or if want/don't to use _longjmp/_setjmp instead of regular
++** longjmp/setjmp. By default, Lua handles errors with exceptions when
++** compiling as C++ code, with _longjmp/_setjmp when asked to use them,
++** and with longjmp/setjmp otherwise.
++*/
++#if defined(__KERNEL__)
++#undef LUA_USE_ULONGJMP
++#endif
++
++#if defined(__cplusplus)
++/* C++ exceptions */
++#define LUAI_THROW(L,c)       throw(c)
++#define LUAI_TRY(L,c,a)       try { a } catch(...) \
++      { if ((c)->status == 0) (c)->status = -1; }
++#define luai_jmpbuf   int  /* dummy variable */
++
++#elif defined(LUA_USE_ULONGJMP)
++/* in Unix, try _longjmp/_setjmp (more efficient) */
++#define LUAI_THROW(L,c)       _longjmp((c)->b, 1)
++#define LUAI_TRY(L,c,a)       if (_setjmp((c)->b) == 0) { a }
++#define luai_jmpbuf   jmp_buf
++
++#else
++/* default handling with long jumps */
++#define LUAI_THROW(L,c)       longjmp((c)->b, 1)
++#define LUAI_TRY(L,c,a)       if (setjmp((c)->b) == 0) { a }
++#define luai_jmpbuf   jmp_buf
++
++#endif
++
++
++/*
++@@ LUA_MAXCAPTURES is the maximum number of captures that a pattern
++@* can do during pattern-matching.
++** CHANGE it if you need more captures. This limit is arbitrary.
++*/
++#define LUA_MAXCAPTURES               32
++
++
++/*
++@@ lua_tmpnam is the function that the OS library uses to create a
++@* temporary name.
++@@ LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam.
++** CHANGE them if you have an alternative to tmpnam (which is considered
++** insecure) or if you want the original tmpnam anyway.  By default, Lua
++** uses tmpnam except when POSIX is available, where it uses mkstemp.
++*/
++#if defined(loslib_c) || defined(luaall_c)
++
++#if defined(LUA_USE_MKSTEMP)
++#include <unistd.h>
++#define LUA_TMPNAMBUFSIZE     32
++#define lua_tmpnam(b,e)       { \
++      strcpy(b, "/tmp/lua_XXXXXX"); \
++      e = mkstemp(b); \
++      if (e != -1) close(e); \
++      e = (e == -1); }
++
++#else
++#define LUA_TMPNAMBUFSIZE     L_tmpnam
++#define lua_tmpnam(b,e)               { e = (tmpnam(b) == NULL); }
++#endif
++
++#endif
++
++
++/*
++@@ lua_popen spawns a new process connected to the current one through
++@* the file streams.
++** CHANGE it if you have a way to implement it in your system.
++*/
++#if defined(LUA_USE_POPEN)
++
++#define lua_popen(L,c,m)      ((void)L, fflush(NULL), popen(c,m))
++#define lua_pclose(L,file)    ((void)L, (pclose(file) != -1))
++
++#elif defined(LUA_WIN)
++
++#define lua_popen(L,c,m)      ((void)L, _popen(c,m))
++#define lua_pclose(L,file)    ((void)L, (_pclose(file) != -1))
++
++#else
++
++#define lua_popen(L,c,m)      ((void)((void)c, m),  \
++              luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
++#define lua_pclose(L,file)            ((void)((void)L, file), 0)
++
++#endif
++
++/*
++@@ LUA_DL_* define which dynamic-library system Lua should use.
++** CHANGE here if Lua has problems choosing the appropriate
++** dynamic-library system for your platform (either Windows' DLL, Mac's
++** dyld, or Unix's dlopen). If your system is some kind of Unix, there
++** is a good chance that it has dlopen, so LUA_DL_DLOPEN will work for
++** it.  To use dlopen you also need to adapt the src/Makefile (probably
++** adding -ldl to the linker options), so Lua does not select it
++** automatically.  (When you change the makefile to add -ldl, you must
++** also add -DLUA_USE_DLOPEN.)
++** If you do not want any kind of dynamic library, undefine all these
++** options.
++** By default, _WIN32 gets LUA_DL_DLL and MAC OS X gets LUA_DL_DYLD.
++*/
++#if defined(LUA_USE_DLOPEN)
++#define LUA_DL_DLOPEN
++#endif
++
++#if defined(LUA_WIN)
++#define LUA_DL_DLL
++#endif
++
++
++/*
++@@ LUAI_EXTRASPACE allows you to add user-specific data in a lua_State
++@* (the data goes just *before* the lua_State pointer).
++** CHANGE (define) this if you really need that. This value must be
++** a multiple of the maximum alignment required for your machine.
++*/
++#define LUAI_EXTRASPACE               0
++
++
++/*
++@@ luai_userstate* allow user-specific actions on threads.
++** CHANGE them if you defined LUAI_EXTRASPACE and need to do something
++** extra when a thread is created/deleted/resumed/yielded.
++*/
++#define luai_userstateopen(L)         ((void)L)
++#define luai_userstateclose(L)                ((void)L)
++#define luai_userstatethread(L,L1)    ((void)L)
++#define luai_userstatefree(L)         ((void)L)
++#define luai_userstateresume(L,n)     ((void)L)
++#define luai_userstateyield(L,n)      ((void)L)
++
++
++/*
++@@ LUA_INTFRMLEN is the length modifier for integer conversions
++@* in 'string.format'.
++@@ LUA_INTFRM_T is the integer type correspoding to the previous length
++@* modifier.
++** CHANGE them if your system supports long long or does not support long.
++*/
++
++#if defined(LUA_USELONGLONG)
++
++#define LUA_INTFRMLEN         "ll"
++#define LUA_INTFRM_T          long long
++
++#else
++
++#define LUA_INTFRMLEN         "l"
++#define LUA_INTFRM_T          long
++
++#endif
++
++/* =================================================================== */
++
++/*
++** Local configuration. You can use this space to add your redefinitions
++** without modifying the main part of the file.
++*/
++
++
++
++#endif
++
+--- /dev/null
++++ b/extensions/LUA/lua/lua.h
+@@ -0,0 +1,387 @@
++/*
++** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $
++** Lua - An Extensible Extension Language
++** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
++** See Copyright Notice at the end of this file
++*/
++
++
++#ifndef lua_h
++#define lua_h
++
++#include <stdarg.h>
++#include <stddef.h>
++
++#include "luaconf.h"
++
++
++#define LUA_VERSION   "Lua 5.1"
++#define LUA_RELEASE   "Lua 5.1.4"
++#define LUA_VERSION_NUM       501
++#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio"
++#define LUA_AUTHORS   "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
++
++
++/* mark for precompiled code (`<esc>Lua') */
++#define       LUA_SIGNATURE   "\033Lua"
++
++/* option for multiple returns in `lua_pcall' and `lua_call' */
++#define LUA_MULTRET   (-1)
++
++
++/*
++** pseudo-indices
++*/
++#define LUA_REGISTRYINDEX     (-10000)
++#define LUA_ENVIRONINDEX      (-10001)
++#define LUA_GLOBALSINDEX      (-10002)
++#define lua_upvalueindex(i)   (LUA_GLOBALSINDEX-(i))
++
++
++/* thread status; 0 is OK */
++#define LUA_YIELD     1
++#define LUA_ERRRUN    2
++#define LUA_ERRSYNTAX 3
++#define LUA_ERRMEM    4
++#define LUA_ERRERR    5
++
++
++typedef struct lua_State lua_State;
++
++typedef int (*lua_CFunction) (lua_State *L);
++
++
++/*
++** functions that read/write blocks when loading/dumping Lua chunks
++*/
++typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz);
++
++typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud);
++
++
++/*
++** prototype for memory-allocation functions
++*/
++typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);
++
++
++/*
++** basic types
++*/
++#define LUA_TNONE             (-1)
++
++#define LUA_TNIL              0
++#define LUA_TBOOLEAN          1
++#define LUA_TLIGHTUSERDATA    2
++#define LUA_TNUMBER           3
++#define LUA_TSTRING           4
++#define LUA_TTABLE            5
++#define LUA_TFUNCTION         6
++#define LUA_TUSERDATA         7
++#define LUA_TTHREAD           8
++
++
++
++/* minimum Lua stack available to a C function */
++#define LUA_MINSTACK  20
++
++
++/*
++** generic extra include file
++*/
++#if defined(LUA_USER_H)
++#include LUA_USER_H
++#endif
++
++
++/* type of numbers in Lua */
++typedef LUA_NUMBER lua_Number;
++
++
++/* type for integer functions */
++typedef LUA_INTEGER lua_Integer;
++
++
++
++/*
++** state manipulation
++*/
++LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);
++LUA_API void       (lua_close) (lua_State *L);
++LUA_API lua_State *(lua_newthread) (lua_State *L);
++
++LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);
++
++
++/*
++** basic stack manipulation
++*/
++LUA_API int   (lua_gettop) (lua_State *L);
++LUA_API void  (lua_settop) (lua_State *L, int idx);
++LUA_API void  (lua_pushvalue) (lua_State *L, int idx);
++LUA_API void  (lua_remove) (lua_State *L, int idx);
++LUA_API void  (lua_insert) (lua_State *L, int idx);
++LUA_API void  (lua_replace) (lua_State *L, int idx);
++LUA_API int   (lua_checkstack) (lua_State *L, int sz);
++
++LUA_API void  (lua_xmove) (lua_State *from, lua_State *to, int n);
++
++
++/*
++** access functions (stack -> C)
++*/
++
++LUA_API int             (lua_isnumber) (lua_State *L, int idx);
++LUA_API int             (lua_isstring) (lua_State *L, int idx);
++LUA_API int             (lua_iscfunction) (lua_State *L, int idx);
++LUA_API int             (lua_isuserdata) (lua_State *L, int idx);
++LUA_API int             (lua_type) (lua_State *L, int idx);
++LUA_API const char     *(lua_typename) (lua_State *L, int tp);
++
++LUA_API int            (lua_equal) (lua_State *L, int idx1, int idx2);
++LUA_API int            (lua_rawequal) (lua_State *L, int idx1, int idx2);
++LUA_API int            (lua_lessthan) (lua_State *L, int idx1, int idx2);
++
++LUA_API lua_Number      (lua_tonumber) (lua_State *L, int idx);
++LUA_API lua_Integer     (lua_tointeger) (lua_State *L, int idx);
++LUA_API int             (lua_toboolean) (lua_State *L, int idx);
++LUA_API const char     *(lua_tolstring) (lua_State *L, int idx, size_t *len);
++LUA_API size_t          (lua_objlen) (lua_State *L, int idx);
++LUA_API lua_CFunction   (lua_tocfunction) (lua_State *L, int idx);
++LUA_API void         *(lua_touserdata) (lua_State *L, int idx);
++LUA_API lua_State      *(lua_tothread) (lua_State *L, int idx);
++LUA_API const void     *(lua_topointer) (lua_State *L, int idx);
++
++
++/*
++** push functions (C -> stack)
++*/
++LUA_API void  (lua_pushnil) (lua_State *L);
++LUA_API void  (lua_pushnumber) (lua_State *L, lua_Number n);
++LUA_API void  (lua_pushinteger) (lua_State *L, lua_Integer n);
++LUA_API void  (lua_pushlstring) (lua_State *L, const char *s, size_t l);
++LUA_API void  (lua_pushstring) (lua_State *L, const char *s);
++LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,
++                                                      va_list argp);
++LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...);
++LUA_API void  (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);
++LUA_API void  (lua_pushboolean) (lua_State *L, int b);
++LUA_API void  (lua_pushlightuserdata) (lua_State *L, void *p);
++LUA_API int   (lua_pushthread) (lua_State *L);
++
++
++/*
++** get functions (Lua -> stack)
++*/
++LUA_API void  (lua_gettable) (lua_State *L, int idx);
++LUA_API void  (lua_getfield) (lua_State *L, int idx, const char *k);
++LUA_API void  (lua_rawget) (lua_State *L, int idx);
++LUA_API void  (lua_rawgeti) (lua_State *L, int idx, int n);
++LUA_API void  (lua_createtable) (lua_State *L, int narr, int nrec);
++LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);
++LUA_API int   (lua_getmetatable) (lua_State *L, int objindex);
++LUA_API void  (lua_getfenv) (lua_State *L, int idx);
++
++
++/*
++** set functions (stack -> Lua)
++*/
++LUA_API void  (lua_settable) (lua_State *L, int idx);
++LUA_API void  (lua_setfield) (lua_State *L, int idx, const char *k);
++LUA_API void  (lua_rawset) (lua_State *L, int idx);
++LUA_API void  (lua_rawseti) (lua_State *L, int idx, int n);
++LUA_API int   (lua_setmetatable) (lua_State *L, int objindex);
++LUA_API int   (lua_setfenv) (lua_State *L, int idx);
++
++
++/*
++** `load' and `call' functions (load and run Lua code)
++*/
++LUA_API void  (lua_call) (lua_State *L, int nargs, int nresults);
++LUA_API int   (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);
++LUA_API int   (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud);
++LUA_API int   (lua_load) (lua_State *L, lua_Reader reader, void *dt,
++                                        const char *chunkname);
++
++LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data);
++
++
++/*
++** coroutine functions
++*/
++LUA_API int  (lua_yield) (lua_State *L, int nresults);
++LUA_API int  (lua_resume) (lua_State *L, int narg);
++LUA_API int  (lua_status) (lua_State *L);
++
++/*
++** garbage-collection function and options
++*/
++
++#define LUA_GCSTOP            0
++#define LUA_GCRESTART         1
++#define LUA_GCCOLLECT         2
++#define LUA_GCCOUNT           3
++#define LUA_GCCOUNTB          4
++#define LUA_GCSTEP            5
++#define LUA_GCSETPAUSE                6
++#define LUA_GCSETSTEPMUL      7
++
++LUA_API int (lua_gc) (lua_State *L, int what, int data);
++
++
++/*
++** miscellaneous functions
++*/
++
++LUA_API int   (lua_error) (lua_State *L);
++
++LUA_API int   (lua_next) (lua_State *L, int idx);
++
++LUA_API void  (lua_concat) (lua_State *L, int n);
++
++LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);
++LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);
++
++
++
++/* 
++** ===============================================================
++** some useful macros
++** ===============================================================
++*/
++
++#define lua_pop(L,n)          lua_settop(L, -(n)-1)
++
++#define lua_newtable(L)               lua_createtable(L, 0, 0)
++
++#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))
++
++#define lua_pushcfunction(L,f)        lua_pushcclosure(L, (f), 0)
++
++#define lua_strlen(L,i)               lua_objlen(L, (i))
++
++#define lua_isfunction(L,n)   (lua_type(L, (n)) == LUA_TFUNCTION)
++#define lua_istable(L,n)      (lua_type(L, (n)) == LUA_TTABLE)
++#define lua_islightuserdata(L,n)      (lua_type(L, (n)) == LUA_TLIGHTUSERDATA)
++#define lua_isnil(L,n)                (lua_type(L, (n)) == LUA_TNIL)
++#define lua_isboolean(L,n)    (lua_type(L, (n)) == LUA_TBOOLEAN)
++#define lua_isthread(L,n)     (lua_type(L, (n)) == LUA_TTHREAD)
++#define lua_isnone(L,n)               (lua_type(L, (n)) == LUA_TNONE)
++#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0)
++
++#define lua_pushliteral(L, s) \
++      lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1)
++
++#define lua_setglobal(L,s)    lua_setfield(L, LUA_GLOBALSINDEX, (s))
++#define lua_getglobal(L,s)    lua_getfield(L, LUA_GLOBALSINDEX, (s))
++
++#define lua_tostring(L,i)     lua_tolstring(L, (i), NULL)
++
++
++
++/*
++** compatibility macros and functions
++*/
++
++#define lua_open()    luaL_newstate()
++
++#define lua_getregistry(L)    lua_pushvalue(L, LUA_REGISTRYINDEX)
++
++#define lua_getgccount(L)     lua_gc(L, LUA_GCCOUNT, 0)
++
++#define lua_Chunkreader               lua_Reader
++#define lua_Chunkwriter               lua_Writer
++
++
++/* hack */
++LUA_API void lua_setlevel     (lua_State *from, lua_State *to);
++
++
++/*
++** {======================================================================
++** Debug API
++** =======================================================================
++*/
++
++
++/*
++** Event codes
++*/
++#define LUA_HOOKCALL  0
++#define LUA_HOOKRET   1
++#define LUA_HOOKLINE  2
++#define LUA_HOOKCOUNT 3
++#define LUA_HOOKTAILRET 4
++
++
++/*
++** Event masks
++*/
++#define LUA_MASKCALL  (1 << LUA_HOOKCALL)
++#define LUA_MASKRET   (1 << LUA_HOOKRET)
++#define LUA_MASKLINE  (1 << LUA_HOOKLINE)
++#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT)
++
++typedef struct lua_Debug lua_Debug;  /* activation record */
++
++
++/* Functions to be called by the debuger in specific events */
++typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
++
++
++LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);
++LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
++LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);
++LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);
++LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n);
++LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n);
++
++LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count);
++LUA_API lua_Hook lua_gethook (lua_State *L);
++LUA_API int lua_gethookmask (lua_State *L);
++LUA_API int lua_gethookcount (lua_State *L);
++
++
++struct lua_Debug {
++  int event;
++  const char *name;   /* (n) */
++  const char *namewhat;       /* (n) `global', `local', `field', `method' */
++  const char *what;   /* (S) `Lua', `C', `main', `tail' */
++  const char *source; /* (S) */
++  int currentline;    /* (l) */
++  int nups;           /* (u) number of upvalues */
++  int linedefined;    /* (S) */
++  int lastlinedefined;        /* (S) */
++  char short_src[LUA_IDSIZE]; /* (S) */
++  /* private part */
++  int i_ci;  /* active function */
++};
++
++/* }====================================================================== */
++
++
++/******************************************************************************
++* Copyright (C) 1994-2008 Lua.org, PUC-Rio.  All rights reserved.
++*
++* Permission is hereby granted, free of charge, to any person obtaining
++* a copy of this software and associated documentation files (the
++* "Software"), to deal in the Software without restriction, including
++* without limitation the rights to use, copy, modify, merge, publish,
++* distribute, sublicense, and/or sell copies of the Software, and to
++* permit persons to whom the Software is furnished to do so, subject to
++* the following conditions:
++*
++* The above copyright notice and this permission notice shall be
++* included in all copies or substantial portions of the Software.
++*
++* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
++* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
++* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
++* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++******************************************************************************/
++
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/lualib.h
+@@ -0,0 +1,55 @@
++/*
++** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $
++** Lua standard libraries
++** See Copyright Notice in lua.h
++*/
++
++
++#ifndef lualib_h
++#define lualib_h
++
++#include "lua.h"
++
++
++/* Key to file-handle type */
++#define LUA_FILEHANDLE                "FILE*"
++
++
++#define LUA_COLIBNAME "coroutine"
++LUALIB_API int (luaopen_base) (lua_State *L);
++
++#define LUA_TABLIBNAME        "table"
++LUALIB_API int (luaopen_table) (lua_State *L);
++/*
++#define LUA_IOLIBNAME "io"
++LUALIB_API int (luaopen_io) (lua_State *L);
++
++#define LUA_OSLIBNAME "os"
++LUALIB_API int (luaopen_os) (lua_State *L);
++*/
++
++#define LUA_STRLIBNAME        "string"
++LUALIB_API int (luaopen_string) (lua_State *L);
++
++/*
++#define LUA_MATHLIBNAME       "math"
++LUALIB_API int (luaopen_math) (lua_State *L);
++
++#define LUA_DBLIBNAME "debug"
++LUALIB_API int (luaopen_debug) (lua_State *L);
++
++#define LUA_LOADLIBNAME       "package"
++LUALIB_API int (luaopen_package) (lua_State *L);
++*/
++
++/* open all previous libraries */
++LUALIB_API void (luaL_openlibs) (lua_State *L);
++
++
++
++#ifndef lua_assert
++#define lua_assert(x) ((void)0)
++#endif
++
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/lundump.c
+@@ -0,0 +1,227 @@
++/*
++** $Id: lundump.c,v 2.7.1.4 2008/04/04 19:51:41 roberto Exp $
++** load precompiled Lua chunks
++** See Copyright Notice in lua.h
++*/
++
++#include <string.h>
++
++#define lundump_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "ldebug.h"
++#include "ldo.h"
++#include "lfunc.h"
++#include "lmem.h"
++#include "lobject.h"
++#include "lstring.h"
++#include "lundump.h"
++#include "lzio.h"
++
++typedef struct {
++ lua_State* L;
++ ZIO* Z;
++ Mbuffer* b;
++ const char* name;
++} LoadState;
++
++#ifdef LUAC_TRUST_BINARIES
++#define IF(c,s)
++#define error(S,s)
++#else
++#define IF(c,s)               if (c) error(S,s)
++
++static void error(LoadState* S, const char* why)
++{
++ luaO_pushfstring(S->L,"%s: %s in precompiled chunk",S->name,why);
++ luaD_throw(S->L,LUA_ERRSYNTAX);
++}
++#endif
++
++#define LoadMem(S,b,n,size)   LoadBlock(S,b,(n)*(size))
++#define       LoadByte(S)             (lu_byte)LoadChar(S)
++#define LoadVar(S,x)          LoadMem(S,&x,1,sizeof(x))
++#define LoadVector(S,b,n,size)        LoadMem(S,b,n,size)
++
++static void LoadBlock(LoadState* S, void* b, size_t size)
++{
++ size_t r=luaZ_read(S->Z,b,size);
++ IF (r!=0, "unexpected end");
++}
++
++static int LoadChar(LoadState* S)
++{
++ char x;
++ LoadVar(S,x);
++ return x;
++}
++
++static int LoadInt(LoadState* S)
++{
++ int x;
++ LoadVar(S,x);
++ IF (x<0, "bad integer");
++ return x;
++}
++
++static lua_Number LoadNumber(LoadState* S)
++{
++ lua_Number x;
++ LoadVar(S,x);
++ return x;
++}
++
++static TString* LoadString(LoadState* S)
++{
++ size_t size;
++ LoadVar(S,size);
++ if (size==0)
++  return NULL;
++ else
++ {
++  char* s=luaZ_openspace(S->L,S->b,size);
++  LoadBlock(S,s,size);
++  return luaS_newlstr(S->L,s,size-1);         /* remove trailing '\0' */
++ }
++}
++
++static void LoadCode(LoadState* S, Proto* f)
++{
++ int n=LoadInt(S);
++ f->code=luaM_newvector(S->L,n,Instruction);
++ f->sizecode=n;
++ LoadVector(S,f->code,n,sizeof(Instruction));
++}
++
++static Proto* LoadFunction(LoadState* S, TString* p);
++
++static void LoadConstants(LoadState* S, Proto* f)
++{
++ int i,n;
++ n=LoadInt(S);
++ f->k=luaM_newvector(S->L,n,TValue);
++ f->sizek=n;
++ for (i=0; i<n; i++) setnilvalue(&f->k[i]);
++ for (i=0; i<n; i++)
++ {
++  TValue* o=&f->k[i];
++  int t=LoadChar(S);
++  switch (t)
++  {
++   case LUA_TNIL:
++      setnilvalue(o);
++      break;
++   case LUA_TBOOLEAN:
++      setbvalue(o,LoadChar(S)!=0);
++      break;
++   case LUA_TNUMBER:
++      setnvalue(o,LoadNumber(S));
++      break;
++   case LUA_TSTRING:
++      setsvalue2n(S->L,o,LoadString(S));
++      break;
++   default:
++      error(S,"bad constant");
++      break;
++  }
++ }
++ n=LoadInt(S);
++ f->p=luaM_newvector(S->L,n,Proto*);
++ f->sizep=n;
++ for (i=0; i<n; i++) f->p[i]=NULL;
++ for (i=0; i<n; i++) f->p[i]=LoadFunction(S,f->source);
++}
++
++static void LoadDebug(LoadState* S, Proto* f)
++{
++ int i,n;
++ n=LoadInt(S);
++ f->lineinfo=luaM_newvector(S->L,n,int);
++ f->sizelineinfo=n;
++ LoadVector(S,f->lineinfo,n,sizeof(int));
++ n=LoadInt(S);
++ f->locvars=luaM_newvector(S->L,n,LocVar);
++ f->sizelocvars=n;
++ for (i=0; i<n; i++) f->locvars[i].varname=NULL;
++ for (i=0; i<n; i++)
++ {
++  f->locvars[i].varname=LoadString(S);
++  f->locvars[i].startpc=LoadInt(S);
++  f->locvars[i].endpc=LoadInt(S);
++ }
++ n=LoadInt(S);
++ f->upvalues=luaM_newvector(S->L,n,TString*);
++ f->sizeupvalues=n;
++ for (i=0; i<n; i++) f->upvalues[i]=NULL;
++ for (i=0; i<n; i++) f->upvalues[i]=LoadString(S);
++}
++
++static Proto* LoadFunction(LoadState* S, TString* p)
++{
++ Proto* f;
++ if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep");
++ f=luaF_newproto(S->L);
++ setptvalue2s(S->L,S->L->top,f); incr_top(S->L);
++ f->source=LoadString(S); if (f->source==NULL) f->source=p;
++ f->linedefined=LoadInt(S);
++ f->lastlinedefined=LoadInt(S);
++ f->nups=LoadByte(S);
++ f->numparams=LoadByte(S);
++ f->is_vararg=LoadByte(S);
++ f->maxstacksize=LoadByte(S);
++ LoadCode(S,f);
++ LoadConstants(S,f);
++ LoadDebug(S,f);
++ IF (!luaG_checkcode(f), "bad code");
++ S->L->top--;
++ S->L->nCcalls--;
++ return f;
++}
++
++static void LoadHeader(LoadState* S)
++{
++ char h[LUAC_HEADERSIZE];
++ char s[LUAC_HEADERSIZE];
++ luaU_header(h);
++ LoadBlock(S,s,LUAC_HEADERSIZE);
++ IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header");
++}
++
++/*
++** load precompiled chunk
++*/
++Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name)
++{
++ LoadState S;
++ if (*name=='@' || *name=='=')
++  S.name=name+1;
++ else if (*name==LUA_SIGNATURE[0])
++  S.name="binary string";
++ else
++  S.name=name;
++ S.L=L;
++ S.Z=Z;
++ S.b=buff;
++ LoadHeader(&S);
++ return LoadFunction(&S,luaS_newliteral(L,"=?"));
++}
++
++/*
++* make header
++*/
++void luaU_header (char* h)
++{
++ int x=1;
++ memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1);
++ h+=sizeof(LUA_SIGNATURE)-1;
++ *h++=(char)LUAC_VERSION;
++ *h++=(char)LUAC_FORMAT;
++ *h++=(char)*(char*)&x;                               /* endianness */
++ *h++=(char)sizeof(int);
++ *h++=(char)sizeof(size_t);
++ *h++=(char)sizeof(Instruction);
++ *h++=(char)sizeof(lua_Number);
++ *h++=(char)(((lua_Number)0.5)==0);           /* is lua_Number integral? */
++}
+--- /dev/null
++++ b/extensions/LUA/lua/lundump.h
+@@ -0,0 +1,36 @@
++/*
++** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $
++** load precompiled Lua chunks
++** See Copyright Notice in lua.h
++*/
++
++#ifndef lundump_h
++#define lundump_h
++
++#include "lobject.h"
++#include "lzio.h"
++
++/* load one chunk; from lundump.c */
++LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name);
++
++/* make header; from lundump.c */
++LUAI_FUNC void luaU_header (char* h);
++
++/* dump one chunk; from ldump.c */
++LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);
++
++#ifdef luac_c
++/* print one chunk; from print.c */
++LUAI_FUNC void luaU_print (const Proto* f, int full);
++#endif
++
++/* for header of binary files -- this is Lua 5.1 */
++#define LUAC_VERSION          0x51
++
++/* for header of binary files -- this is the official format */
++#define LUAC_FORMAT           0
++
++/* size of header of binary files */
++#define LUAC_HEADERSIZE               12
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/lvm.c
+@@ -0,0 +1,762 @@
++/*
++** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $
++** Lua virtual machine
++** See Copyright Notice in lua.h
++*/
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#define lvm_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "ldebug.h"
++#include "ldo.h"
++#include "lfunc.h"
++#include "lgc.h"
++#include "lobject.h"
++#include "lopcodes.h"
++#include "lstate.h"
++#include "lstring.h"
++#include "ltable.h"
++#include "ltm.h"
++#include "lvm.h"
++
++
++
++/* limit for table tag-method chains (to avoid loops) */
++#define MAXTAGLOOP    100
++
++
++const TValue *luaV_tonumber (const TValue *obj, TValue *n) {
++  lua_Number num;
++  if (ttisnumber(obj)) return obj;
++  if (ttisstring(obj) && luaO_str2d(svalue(obj), &num)) {
++    setnvalue(n, num);
++    return n;
++  }
++  else
++    return NULL;
++}
++
++
++int luaV_tostring (lua_State *L, StkId obj) {
++  if (!ttisnumber(obj))
++    return 0;
++  else {
++    char s[LUAI_MAXNUMBER2STR];
++    lua_Number n = nvalue(obj);
++    lua_number2str(s, n);
++    setsvalue2s(L, obj, luaS_new(L, s));
++    return 1;
++  }
++}
++
++
++static void traceexec (lua_State *L, const Instruction *pc) {
++  lu_byte mask = L->hookmask;
++  const Instruction *oldpc = L->savedpc;
++  L->savedpc = pc;
++  if ((mask & LUA_MASKCOUNT) && L->hookcount == 0) {
++    resethookcount(L);
++    luaD_callhook(L, LUA_HOOKCOUNT, -1);
++  }
++  if (mask & LUA_MASKLINE) {
++    Proto *p = ci_func(L->ci)->l.p;
++    int npc = pcRel(pc, p);
++    int newline = getline(p, npc);
++    /* call linehook when enter a new function, when jump back (loop),
++       or when enter a new line */
++    if (npc == 0 || pc <= oldpc || newline != getline(p, pcRel(oldpc, p)))
++      luaD_callhook(L, LUA_HOOKLINE, newline);
++  }
++}
++
++
++static void callTMres (lua_State *L, StkId res, const TValue *f,
++                        const TValue *p1, const TValue *p2) {
++  ptrdiff_t result = savestack(L, res);
++  setobj2s(L, L->top, f);  /* push function */
++  setobj2s(L, L->top+1, p1);  /* 1st argument */
++  setobj2s(L, L->top+2, p2);  /* 2nd argument */
++  luaD_checkstack(L, 3);
++  L->top += 3;
++  luaD_call(L, L->top - 3, 1);
++  res = restorestack(L, result);
++  L->top--;
++  setobjs2s(L, res, L->top);
++}
++
++
++
++static void callTM (lua_State *L, const TValue *f, const TValue *p1,
++                    const TValue *p2, const TValue *p3) {
++  setobj2s(L, L->top, f);  /* push function */
++  setobj2s(L, L->top+1, p1);  /* 1st argument */
++  setobj2s(L, L->top+2, p2);  /* 2nd argument */
++  setobj2s(L, L->top+3, p3);  /* 3th argument */
++  luaD_checkstack(L, 4);
++  L->top += 4;
++  luaD_call(L, L->top - 4, 0);
++}
++
++
++void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {
++  int loop;
++  for (loop = 0; loop < MAXTAGLOOP; loop++) {
++    const TValue *tm;
++    if (ttistable(t)) {  /* `t' is a table? */
++      Table *h = hvalue(t);
++      const TValue *res = luaH_get(h, key); /* do a primitive get */
++      if (!ttisnil(res) ||  /* result is no nil? */
++          (tm = fasttm(L, h->metatable, TM_INDEX)) == NULL) { /* or no TM? */
++        setobj2s(L, val, res);
++        return;
++      }
++      /* else will try the tag method */
++    }
++    else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX)))
++      luaG_typeerror(L, t, "index");
++    if (ttisfunction(tm)) {
++      callTMres(L, val, tm, t, key);
++      return;
++    }
++    t = tm;  /* else repeat with `tm' */ 
++  }
++  luaG_runerror(L, "loop in gettable");
++}
++
++
++void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
++  int loop;
++  for (loop = 0; loop < MAXTAGLOOP; loop++) {
++    const TValue *tm;
++    if (ttistable(t)) {  /* `t' is a table? */
++      Table *h = hvalue(t);
++      TValue *oldval = luaH_set(L, h, key); /* do a primitive set */
++      if (!ttisnil(oldval) ||  /* result is no nil? */
++          (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */
++        setobj2t(L, oldval, val);
++        luaC_barriert(L, h, val);
++        return;
++      }
++      /* else will try the tag method */
++    }
++    else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX)))
++      luaG_typeerror(L, t, "index");
++    if (ttisfunction(tm)) {
++      callTM(L, tm, t, key, val);
++      return;
++    }
++    t = tm;  /* else repeat with `tm' */ 
++  }
++  luaG_runerror(L, "loop in settable");
++}
++
++
++static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2,
++                       StkId res, TMS event) {
++  const TValue *tm = luaT_gettmbyobj(L, p1, event);  /* try first operand */
++  if (ttisnil(tm))
++    tm = luaT_gettmbyobj(L, p2, event);  /* try second operand */
++  if (ttisnil(tm)) return 0;
++  callTMres(L, res, tm, p1, p2);
++  return 1;
++}
++
++
++static const TValue *get_compTM (lua_State *L, Table *mt1, Table *mt2,
++                                  TMS event) {
++  const TValue *tm1 = fasttm(L, mt1, event);
++  const TValue *tm2;
++  if (tm1 == NULL) return NULL;  /* no metamethod */
++  if (mt1 == mt2) return tm1;  /* same metatables => same metamethods */
++  tm2 = fasttm(L, mt2, event);
++  if (tm2 == NULL) return NULL;  /* no metamethod */
++  if (luaO_rawequalObj(tm1, tm2))  /* same metamethods? */
++    return tm1;
++  return NULL;
++}
++
++
++static int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2,
++                         TMS event) {
++  const TValue *tm1 = luaT_gettmbyobj(L, p1, event);
++  const TValue *tm2;
++  if (ttisnil(tm1)) return -1;  /* no metamethod? */
++  tm2 = luaT_gettmbyobj(L, p2, event);
++  if (!luaO_rawequalObj(tm1, tm2))  /* different metamethods? */
++    return -1;
++  callTMres(L, L->top, tm1, p1, p2);
++  return !l_isfalse(L->top);
++}
++
++
++static int l_strcmp (const TString *ls, const TString *rs) {
++  const char *l = getstr(ls);
++  size_t ll = ls->tsv.len;
++  const char *r = getstr(rs);
++  size_t lr = rs->tsv.len;
++  for (;;) {
++    int temp = strcoll(l, r);
++    if (temp != 0) return temp;
++    else {  /* strings are equal up to a `\0' */
++      size_t len = strlen(l);  /* index of first `\0' in both strings */
++      if (len == lr)  /* r is finished? */
++        return (len == ll) ? 0 : 1;
++      else if (len == ll)  /* l is finished? */
++        return -1;  /* l is smaller than r (because r is not finished) */
++      /* both strings longer than `len'; go on comparing (after the `\0') */
++      len++;
++      l += len; ll -= len; r += len; lr -= len;
++    }
++  }
++}
++
++
++int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) {
++  int res;
++  if (ttype(l) != ttype(r))
++    return luaG_ordererror(L, l, r);
++  else if (ttisnumber(l))
++    return luai_numlt(nvalue(l), nvalue(r));
++  else if (ttisstring(l))
++    return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0;
++  else if ((res = call_orderTM(L, l, r, TM_LT)) != -1)
++    return res;
++  return luaG_ordererror(L, l, r);
++}
++
++
++static int lessequal (lua_State *L, const TValue *l, const TValue *r) {
++  int res;
++  if (ttype(l) != ttype(r))
++    return luaG_ordererror(L, l, r);
++  else if (ttisnumber(l))
++    return luai_numle(nvalue(l), nvalue(r));
++  else if (ttisstring(l))
++    return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0;
++  else if ((res = call_orderTM(L, l, r, TM_LE)) != -1)  /* first try `le' */
++    return res;
++  else if ((res = call_orderTM(L, r, l, TM_LT)) != -1)  /* else try `lt' */
++    return !res;
++  return luaG_ordererror(L, l, r);
++}
++
++
++int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) {
++  const TValue *tm;
++  lua_assert(ttype(t1) == ttype(t2));
++  switch (ttype(t1)) {
++    case LUA_TNIL: return 1;
++    case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2));
++    case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2);  /* true must be 1 !! */
++    case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2);
++    case LUA_TUSERDATA: {
++      if (uvalue(t1) == uvalue(t2)) return 1;
++      tm = get_compTM(L, uvalue(t1)->metatable, uvalue(t2)->metatable,
++                         TM_EQ);
++      break;  /* will try TM */
++    }
++    case LUA_TTABLE: {
++      if (hvalue(t1) == hvalue(t2)) return 1;
++      tm = get_compTM(L, hvalue(t1)->metatable, hvalue(t2)->metatable, TM_EQ);
++      break;  /* will try TM */
++    }
++    default: return gcvalue(t1) == gcvalue(t2);
++  }
++  if (tm == NULL) return 0;  /* no TM? */
++  callTMres(L, L->top, tm, t1, t2);  /* call TM */
++  return !l_isfalse(L->top);
++}
++
++
++void luaV_concat (lua_State *L, int total, int last) {
++  do {
++    StkId top = L->base + last + 1;
++    int n = 2;  /* number of elements handled in this pass (at least 2) */
++    if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) {
++      if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT))
++        luaG_concaterror(L, top-2, top-1);
++    } else if (tsvalue(top-1)->len == 0)  /* second op is empty? */
++      (void)tostring(L, top - 2);  /* result is first op (as string) */
++    else {
++      /* at least two string values; get as many as possible */
++      size_t tl = tsvalue(top-1)->len;
++      char *buffer;
++      int i;
++      /* collect total length */
++      for (n = 1; n < total && tostring(L, top-n-1); n++) {
++        size_t l = tsvalue(top-n-1)->len;
++        if (l >= MAX_SIZET - tl) luaG_runerror(L, "string length overflow");
++        tl += l;
++      }
++      buffer = luaZ_openspace(L, &G(L)->buff, tl);
++      tl = 0;
++      for (i=n; i>0; i--) {  /* concat all strings */
++        size_t l = tsvalue(top-i)->len;
++        memcpy(buffer+tl, svalue(top-i), l);
++        tl += l;
++      }
++      setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl));
++    }
++    total -= n-1;  /* got `n' strings to create 1 new */
++    last -= n-1;
++  } while (total > 1);  /* repeat until only 1 result left */
++}
++
++
++static void Arith (lua_State *L, StkId ra, const TValue *rb,
++                   const TValue *rc, TMS op) {
++  TValue tempb, tempc;
++  const TValue *b, *c;
++  if ((b = luaV_tonumber(rb, &tempb)) != NULL &&
++      (c = luaV_tonumber(rc, &tempc)) != NULL) {
++    lua_Number nb = nvalue(b), nc = nvalue(c);
++    switch (op) {
++      case TM_ADD: setnvalue(ra, luai_numadd(nb, nc)); break;
++      case TM_SUB: setnvalue(ra, luai_numsub(nb, nc)); break;
++      case TM_MUL: setnvalue(ra, luai_nummul(nb, nc)); break;
++      case TM_DIV: setnvalue(ra, luai_numdiv(nb, nc)); break;
++      case TM_MOD: setnvalue(ra, luai_nummod(nb, nc)); break;
++      case TM_POW: setnvalue(ra, luai_numpow(nb, nc)); break;
++      case TM_UNM: setnvalue(ra, luai_numunm(nb)); break;
++      default: lua_assert(0); break;
++    }
++  }
++  else if (!call_binTM(L, rb, rc, ra, op))
++    luaG_aritherror(L, rb, rc);
++}
++
++
++
++/*
++** some macros for common tasks in `luaV_execute'
++*/
++
++#define runtime_check(L, c)   { if (!(c)) break; }
++
++#define RA(i) (base+GETARG_A(i))
++/* to be used after possible stack reallocation */
++#define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i))
++#define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i))
++#define RKB(i)        check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \
++      ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i))
++#define RKC(i)        check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \
++      ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i))
++#define KBx(i)        check_exp(getBMode(GET_OPCODE(i)) == OpArgK, k+GETARG_Bx(i))
++
++
++#define dojump(L,pc,i)        {(pc) += (i); luai_threadyield(L);}
++
++
++#define Protect(x)    { L->savedpc = pc; {x;}; base = L->base; }
++
++
++#define arith_op(op,tm) { \
++        TValue *rb = RKB(i); \
++        TValue *rc = RKC(i); \
++        if (ttisnumber(rb) && ttisnumber(rc)) { \
++          lua_Number nb = nvalue(rb), nc = nvalue(rc); \
++          setnvalue(ra, op(nb, nc)); \
++        } \
++        else \
++          Protect(Arith(L, ra, rb, rc, tm)); \
++      }
++
++
++
++void luaV_execute (lua_State *L, int nexeccalls) {
++  LClosure *cl;
++  StkId base;
++  TValue *k;
++  const Instruction *pc;
++ reentry:  /* entry point */
++  lua_assert(isLua(L->ci));
++  pc = L->savedpc;
++  cl = &clvalue(L->ci->func)->l;
++  base = L->base;
++  k = cl->p->k;
++  /* main loop of interpreter */
++  for (;;) {
++    const Instruction i = *pc++;
++    StkId ra;
++    if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) &&
++        (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) {
++      traceexec(L, pc);
++      if (L->status == LUA_YIELD) {  /* did hook yield? */
++        L->savedpc = pc - 1;
++        return;
++      }
++      base = L->base;
++    }
++    /* warning!! several calls may realloc the stack and invalidate `ra' */
++    ra = RA(i);
++    lua_assert(base == L->base && L->base == L->ci->base);
++    lua_assert(base <= L->top && L->top <= L->stack + L->stacksize);
++    lua_assert(L->top == L->ci->top || luaG_checkopenop(i));
++    switch (GET_OPCODE(i)) {
++      case OP_MOVE: {
++        setobjs2s(L, ra, RB(i));
++        continue;
++      }
++      case OP_LOADK: {
++        setobj2s(L, ra, KBx(i));
++        continue;
++      }
++      case OP_LOADBOOL: {
++        setbvalue(ra, GETARG_B(i));
++        if (GETARG_C(i)) pc++;  /* skip next instruction (if C) */
++        continue;
++      }
++      case OP_LOADNIL: {
++        TValue *rb = RB(i);
++        do {
++          setnilvalue(rb--);
++        } while (rb >= ra);
++        continue;
++      }
++      case OP_GETUPVAL: {
++        int b = GETARG_B(i);
++        setobj2s(L, ra, cl->upvals[b]->v);
++        continue;
++      }
++      case OP_GETGLOBAL: {
++        TValue g;
++        TValue *rb = KBx(i);
++        sethvalue(L, &g, cl->env);
++        lua_assert(ttisstring(rb));
++        Protect(luaV_gettable(L, &g, rb, ra));
++        continue;
++      }
++      case OP_GETTABLE: {
++        Protect(luaV_gettable(L, RB(i), RKC(i), ra));
++        continue;
++      }
++      case OP_SETGLOBAL: {
++        TValue g;
++        sethvalue(L, &g, cl->env);
++        lua_assert(ttisstring(KBx(i)));
++        Protect(luaV_settable(L, &g, KBx(i), ra));
++        continue;
++      }
++      case OP_SETUPVAL: {
++        UpVal *uv = cl->upvals[GETARG_B(i)];
++        setobj(L, uv->v, ra);
++        luaC_barrier(L, uv, ra);
++        continue;
++      }
++      case OP_SETTABLE: {
++        Protect(luaV_settable(L, ra, RKB(i), RKC(i)));
++        continue;
++      }
++      case OP_NEWTABLE: {
++        int b = GETARG_B(i);
++        int c = GETARG_C(i);
++        sethvalue(L, ra, luaH_new(L, luaO_fb2int(b), luaO_fb2int(c)));
++        Protect(luaC_checkGC(L));
++        continue;
++      }
++      case OP_SELF: {
++        StkId rb = RB(i);
++        setobjs2s(L, ra+1, rb);
++        Protect(luaV_gettable(L, rb, RKC(i), ra));
++        continue;
++      }
++      case OP_ADD: {
++        arith_op(luai_numadd, TM_ADD);
++        continue;
++      }
++      case OP_SUB: {
++        arith_op(luai_numsub, TM_SUB);
++        continue;
++      }
++      case OP_MUL: {
++        arith_op(luai_nummul, TM_MUL);
++        continue;
++      }
++      case OP_DIV: {
++        arith_op(luai_numdiv, TM_DIV);
++        continue;
++      }
++      case OP_MOD: {
++        arith_op(luai_nummod, TM_MOD);
++        continue;
++      }
++      case OP_POW: {
++        arith_op(luai_numpow, TM_POW);
++        continue;
++      }
++      case OP_UNM: {
++        TValue *rb = RB(i);
++        if (ttisnumber(rb)) {
++          lua_Number nb = nvalue(rb);
++          setnvalue(ra, luai_numunm(nb));
++        }
++        else {
++          Protect(Arith(L, ra, rb, rb, TM_UNM));
++        }
++        continue;
++      }
++      case OP_NOT: {
++        int res = l_isfalse(RB(i));  /* next assignment may change this value */
++        setbvalue(ra, res);
++        continue;
++      }
++      case OP_LEN: {
++        const TValue *rb = RB(i);
++        switch (ttype(rb)) {
++          case LUA_TTABLE: {
++            setnvalue(ra, cast_num(luaH_getn(hvalue(rb))));
++            break;
++          }
++          case LUA_TSTRING: {
++            setnvalue(ra, cast_num(tsvalue(rb)->len));
++            break;
++          }
++          default: {  /* try metamethod */
++            Protect(
++              if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN))
++                luaG_typeerror(L, rb, "get length of");
++            )
++          }
++        }
++        continue;
++      }
++      case OP_CONCAT: {
++        int b = GETARG_B(i);
++        int c = GETARG_C(i);
++        Protect(luaV_concat(L, c-b+1, c); luaC_checkGC(L));
++        setobjs2s(L, RA(i), base+b);
++        continue;
++      }
++      case OP_JMP: {
++        dojump(L, pc, GETARG_sBx(i));
++        continue;
++      }
++      case OP_EQ: {
++        TValue *rb = RKB(i);
++        TValue *rc = RKC(i);
++        Protect(
++          if (equalobj(L, rb, rc) == GETARG_A(i))
++            dojump(L, pc, GETARG_sBx(*pc));
++        )
++        pc++;
++        continue;
++      }
++      case OP_LT: {
++        Protect(
++          if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i))
++            dojump(L, pc, GETARG_sBx(*pc));
++        )
++        pc++;
++        continue;
++      }
++      case OP_LE: {
++        Protect(
++          if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i))
++            dojump(L, pc, GETARG_sBx(*pc));
++        )
++        pc++;
++        continue;
++      }
++      case OP_TEST: {
++        if (l_isfalse(ra) != GETARG_C(i))
++          dojump(L, pc, GETARG_sBx(*pc));
++        pc++;
++        continue;
++      }
++      case OP_TESTSET: {
++        TValue *rb = RB(i);
++        if (l_isfalse(rb) != GETARG_C(i)) {
++          setobjs2s(L, ra, rb);
++          dojump(L, pc, GETARG_sBx(*pc));
++        }
++        pc++;
++        continue;
++      }
++      case OP_CALL: {
++        int b = GETARG_B(i);
++        int nresults = GETARG_C(i) - 1;
++        if (b != 0) L->top = ra+b;  /* else previous instruction set top */
++        L->savedpc = pc;
++        switch (luaD_precall(L, ra, nresults)) {
++          case PCRLUA: {
++            nexeccalls++;
++            goto reentry;  /* restart luaV_execute over new Lua function */
++          }
++          case PCRC: {
++            /* it was a C function (`precall' called it); adjust results */
++            if (nresults >= 0) L->top = L->ci->top;
++            base = L->base;
++            continue;
++          }
++          default: {
++            return;  /* yield */
++          }
++        }
++      }
++      case OP_TAILCALL: {
++        int b = GETARG_B(i);
++        if (b != 0) L->top = ra+b;  /* else previous instruction set top */
++        L->savedpc = pc;
++        lua_assert(GETARG_C(i) - 1 == LUA_MULTRET);
++        switch (luaD_precall(L, ra, LUA_MULTRET)) {
++          case PCRLUA: {
++            /* tail call: put new frame in place of previous one */
++            CallInfo *ci = L->ci - 1;  /* previous frame */
++            int aux;
++            StkId func = ci->func;
++            StkId pfunc = (ci+1)->func;  /* previous function index */
++            if (L->openupval) luaF_close(L, ci->base);
++            L->base = ci->base = ci->func + ((ci+1)->base - pfunc);
++            for (aux = 0; pfunc+aux < L->top; aux++)  /* move frame down */
++              setobjs2s(L, func+aux, pfunc+aux);
++            ci->top = L->top = func+aux;  /* correct top */
++            lua_assert(L->top == L->base + clvalue(func)->l.p->maxstacksize);
++            ci->savedpc = L->savedpc;
++            ci->tailcalls++;  /* one more call lost */
++            L->ci--;  /* remove new frame */
++            goto reentry;
++          }
++          case PCRC: {  /* it was a C function (`precall' called it) */
++            base = L->base;
++            continue;
++          }
++          default: {
++            return;  /* yield */
++          }
++        }
++      }
++      case OP_RETURN: {
++        int b = GETARG_B(i);
++        if (b != 0) L->top = ra+b-1;
++        if (L->openupval) luaF_close(L, base);
++        L->savedpc = pc;
++        b = luaD_poscall(L, ra);
++        if (--nexeccalls == 0)  /* was previous function running `here'? */
++          return;  /* no: return */
++        else {  /* yes: continue its execution */
++          if (b) L->top = L->ci->top;
++          lua_assert(isLua(L->ci));
++          lua_assert(GET_OPCODE(*((L->ci)->savedpc - 1)) == OP_CALL);
++          goto reentry;
++        }
++      }
++      case OP_FORLOOP: {
++        lua_Number step = nvalue(ra+2);
++        lua_Number idx = luai_numadd(nvalue(ra), step); /* increment index */
++        lua_Number limit = nvalue(ra+1);
++        if (luai_numlt(0, step) ? luai_numle(idx, limit)
++                                : luai_numle(limit, idx)) {
++          dojump(L, pc, GETARG_sBx(i));  /* jump back */
++          setnvalue(ra, idx);  /* update internal index... */
++          setnvalue(ra+3, idx);  /* ...and external index */
++        }
++        continue;
++      }
++      case OP_FORPREP: {
++        const TValue *init = ra;
++        const TValue *plimit = ra+1;
++        const TValue *pstep = ra+2;
++        L->savedpc = pc;  /* next steps may throw errors */
++        if (!tonumber(init, ra))
++          luaG_runerror(L, LUA_QL("for") " initial value must be a number");
++        else if (!tonumber(plimit, ra+1))
++          luaG_runerror(L, LUA_QL("for") " limit must be a number");
++        else if (!tonumber(pstep, ra+2))
++          luaG_runerror(L, LUA_QL("for") " step must be a number");
++        setnvalue(ra, luai_numsub(nvalue(ra), nvalue(pstep)));
++        dojump(L, pc, GETARG_sBx(i));
++        continue;
++      }
++      case OP_TFORLOOP: {
++        StkId cb = ra + 3;  /* call base */
++        setobjs2s(L, cb+2, ra+2);
++        setobjs2s(L, cb+1, ra+1);
++        setobjs2s(L, cb, ra);
++        L->top = cb+3;  /* func. + 2 args (state and index) */
++        Protect(luaD_call(L, cb, GETARG_C(i)));
++        L->top = L->ci->top;
++        cb = RA(i) + 3;  /* previous call may change the stack */
++        if (!ttisnil(cb)) {  /* continue loop? */
++          setobjs2s(L, cb-1, cb);  /* save control variable */
++          dojump(L, pc, GETARG_sBx(*pc));  /* jump back */
++        }
++        pc++;
++        continue;
++      }
++      case OP_SETLIST: {
++        int n = GETARG_B(i);
++        int c = GETARG_C(i);
++        int last;
++        Table *h;
++        if (n == 0) {
++          n = cast_int(L->top - ra) - 1;
++          L->top = L->ci->top;
++        }
++        if (c == 0) c = cast_int(*pc++);
++        runtime_check(L, ttistable(ra));
++        h = hvalue(ra);
++        last = ((c-1)*LFIELDS_PER_FLUSH) + n;
++        if (last > h->sizearray)  /* needs more space? */
++          luaH_resizearray(L, h, last);  /* pre-alloc it at once */
++        for (; n > 0; n--) {
++          TValue *val = ra+n;
++          setobj2t(L, luaH_setnum(L, h, last--), val);
++          luaC_barriert(L, h, val);
++        }
++        continue;
++      }
++      case OP_CLOSE: {
++        luaF_close(L, ra);
++        continue;
++      }
++      case OP_CLOSURE: {
++        Proto *p;
++        Closure *ncl;
++        int nup, j;
++        p = cl->p->p[GETARG_Bx(i)];
++        nup = p->nups;
++        ncl = luaF_newLclosure(L, nup, cl->env);
++        ncl->l.p = p;
++        for (j=0; j<nup; j++, pc++) {
++          if (GET_OPCODE(*pc) == OP_GETUPVAL)
++            ncl->l.upvals[j] = cl->upvals[GETARG_B(*pc)];
++          else {
++            lua_assert(GET_OPCODE(*pc) == OP_MOVE);
++            ncl->l.upvals[j] = luaF_findupval(L, base + GETARG_B(*pc));
++          }
++        }
++        setclvalue(L, ra, ncl);
++        Protect(luaC_checkGC(L));
++        continue;
++      }
++      case OP_VARARG: {
++        int b = GETARG_B(i) - 1;
++        int j;
++        CallInfo *ci = L->ci;
++        int n = cast_int(ci->base - ci->func) - cl->p->numparams - 1;
++        if (b == LUA_MULTRET) {
++          Protect(luaD_checkstack(L, n));
++          ra = RA(i);  /* previous call may change the stack */
++          b = n;
++          L->top = ra + n;
++        }
++        for (j = 0; j < b; j++) {
++          if (j < n) {
++            setobjs2s(L, ra + j, ci->base - n + j);
++          }
++          else {
++            setnilvalue(ra + j);
++          }
++        }
++        continue;
++      }
++    }
++  }
++}
++
+--- /dev/null
++++ b/extensions/LUA/lua/lvm.h
+@@ -0,0 +1,36 @@
++/*
++** $Id: lvm.h,v 2.5.1.1 2007/12/27 13:02:25 roberto Exp $
++** Lua virtual machine
++** See Copyright Notice in lua.h
++*/
++
++#ifndef lvm_h
++#define lvm_h
++
++
++#include "ldo.h"
++#include "lobject.h"
++#include "ltm.h"
++
++
++#define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o)))
++
++#define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \
++                         (((o) = luaV_tonumber(o,n)) != NULL))
++
++#define equalobj(L,o1,o2) \
++      (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2))
++
++
++LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r);
++LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2);
++LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n);
++LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj);
++LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key,
++                                            StkId val);
++LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key,
++                                            StkId val);
++LUAI_FUNC void luaV_execute (lua_State *L, int nexeccalls);
++LUAI_FUNC void luaV_concat (lua_State *L, int total, int last);
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/lua/lzio.c
+@@ -0,0 +1,81 @@
++/*
++** $Id: lzio.c,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $
++** a generic input stream interface
++** See Copyright Notice in lua.h
++*/
++
++#include <string.h>
++
++#define lzio_c
++#define LUA_CORE
++
++#include "lua.h"
++
++#include "llimits.h"
++#include "lmem.h"
++#include "lstate.h"
++#include "lzio.h"
++
++
++int luaZ_fill (ZIO *z) {
++  size_t size;
++  lua_State *L = z->L;
++  const char *buff;
++  lua_unlock(L);
++  buff = z->reader(L, z->data, &size);
++  lua_lock(L);
++  if (buff == NULL || size == 0) return EOZ;
++  z->n = size - 1;
++  z->p = buff;
++  return char2int(*(z->p++));
++}
++
++
++int luaZ_lookahead (ZIO *z) {
++  if (z->n == 0) {
++    if (luaZ_fill(z) == EOZ)
++      return EOZ;
++    else {
++      z->n++;  /* luaZ_fill removed first byte; put back it */
++      z->p--;
++    }
++  }
++  return char2int(*z->p);
++}
++
++
++void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) {
++  z->L = L;
++  z->reader = reader;
++  z->data = data;
++  z->n = 0;
++  z->p = NULL;
++}
++
++
++/* --------------------------------------------------------------- read --- */
++size_t luaZ_read (ZIO *z, void *b, size_t n) {
++  while (n) {
++    size_t m;
++    if (luaZ_lookahead(z) == EOZ)
++      return n;  /* return number of missing bytes */
++    m = (n <= z->n) ? n : z->n;  /* min. between n and z->n */
++    memcpy(b, z->p, m);
++    z->n -= m;
++    z->p += m;
++    b = (char *)b + m;
++    n -= m;
++  }
++  return 0;
++}
++
++/* ------------------------------------------------------------------------ */
++char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) {
++  if (n > buff->buffsize) {
++    if (n < LUA_MINBUFFER) n = LUA_MINBUFFER;
++    luaZ_resizebuffer(L, buff, n);
++  }
++  return buff->buffer;
++}
++
++
+--- /dev/null
++++ b/extensions/LUA/lua/lzio.h
+@@ -0,0 +1,67 @@
++/*
++** $Id: lzio.h,v 1.21.1.1 2007/12/27 13:02:25 roberto Exp $
++** Buffered streams
++** See Copyright Notice in lua.h
++*/
++
++
++#ifndef lzio_h
++#define lzio_h
++
++#include "lua.h"
++
++#include "lmem.h"
++
++
++#define EOZ   (-1)                    /* end of stream */
++
++typedef struct Zio ZIO;
++
++#define char2int(c)   cast(int, cast(unsigned char, (c)))
++
++#define zgetc(z)  (((z)->n--)>0 ?  char2int(*(z)->p++) : luaZ_fill(z))
++
++typedef struct Mbuffer {
++  char *buffer;
++  size_t n;
++  size_t buffsize;
++} Mbuffer;
++
++#define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0)
++
++#define luaZ_buffer(buff)     ((buff)->buffer)
++#define luaZ_sizebuffer(buff) ((buff)->buffsize)
++#define luaZ_bufflen(buff)    ((buff)->n)
++
++#define luaZ_resetbuffer(buff) ((buff)->n = 0)
++
++
++#define luaZ_resizebuffer(L, buff, size) \
++      (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \
++      (buff)->buffsize = size)
++
++#define luaZ_freebuffer(L, buff)      luaZ_resizebuffer(L, buff, 0)
++
++
++LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);
++LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
++                                        void *data);
++LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n);       /* read next n bytes */
++LUAI_FUNC int luaZ_lookahead (ZIO *z);
++
++
++
++/* --------- Private Part ------------------ */
++
++struct Zio {
++  size_t n;                   /* bytes still unread */
++  const char *p;              /* current position in buffer */
++  lua_Reader reader;
++  void* data;                 /* additional data */
++  lua_State *L;                       /* Lua state (for reader) */
++};
++
++
++LUAI_FUNC int luaZ_fill (ZIO *z);
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/Makefile
+@@ -0,0 +1,389 @@
++# Makefile.in generated by automake 1.11.1 from Makefile.am.
++# extensions/LUA/Makefile.  Generated from Makefile.in by configure.
++
++# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
++# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
++# Inc.
++# This Makefile.in is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
++# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
++# PARTICULAR PURPOSE.
++
++
++
++# -*- Makefile -*-
++# AUTOMAKE
++
++pkgdatadir = $(datadir)/xtables-addons
++pkgincludedir = $(includedir)/xtables-addons
++pkglibdir = $(libdir)/xtables-addons
++pkglibexecdir = $(libexecdir)/xtables-addons
++am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
++install_sh_DATA = $(install_sh) -c -m 644
++install_sh_PROGRAM = $(install_sh) -c
++install_sh_SCRIPT = $(install_sh) -c
++INSTALL_HEADER = $(INSTALL_DATA)
++transform = $(program_transform_name)
++NORMAL_INSTALL = :
++PRE_INSTALL = :
++POST_INSTALL = :
++NORMAL_UNINSTALL = :
++PRE_UNINSTALL = :
++POST_UNINSTALL = :
++build_triplet = i686-pc-linux-gnu
++host_triplet = i686-pc-linux-gnu
++DIST_COMMON = $(srcdir)/../../Makefile.extra $(srcdir)/Makefile.am \
++      $(srcdir)/Makefile.in
++subdir = extensions/LUA
++ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
++am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
++      $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
++      $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
++      $(top_srcdir)/configure.ac
++am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
++      $(ACLOCAL_M4)
++mkinstalldirs = $(install_sh) -d
++CONFIG_HEADER = $(top_builddir)/config.h
++CONFIG_CLEAN_FILES =
++CONFIG_CLEAN_VPATH_FILES =
++SOURCES =
++DIST_SOURCES =
++DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
++ACLOCAL = ${SHELL} /home/andre/Dropbox/xtables-addons/missing --run aclocal-1.11
++AMTAR = ${SHELL} /home/andre/Dropbox/xtables-addons/missing --run tar
++AR = ar
++AUTOCONF = ${SHELL} /home/andre/Dropbox/xtables-addons/missing --run autoconf
++AUTOHEADER = ${SHELL} /home/andre/Dropbox/xtables-addons/missing --run autoheader
++AUTOMAKE = ${SHELL} /home/andre/Dropbox/xtables-addons/missing --run automake-1.11
++AWK = mawk
++CC = gcc
++CCDEPMODE = depmode=gcc3
++CFLAGS = -g -O2
++CPP = gcc -E
++CPPFLAGS = 
++CYGPATH_W = echo
++DEFS = -DHAVE_CONFIG_H
++DEPDIR = .deps
++DSYMUTIL = 
++DUMPBIN = 
++ECHO_C = 
++ECHO_N = -n
++ECHO_T = 
++EGREP = /bin/grep -E
++EXEEXT = 
++FGREP = /bin/grep -F
++GREP = /bin/grep
++INSTALL = /usr/bin/install -c
++INSTALL_DATA = ${INSTALL} -m 644
++INSTALL_PROGRAM = ${INSTALL}
++INSTALL_SCRIPT = ${INSTALL}
++INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
++LD = /usr/bin/ld
++LDFLAGS = 
++LIBOBJS = 
++LIBS = 
++LIBTOOL = $(SHELL) $(top_builddir)/libtool
++LIPO = 
++LN_S = ln -s
++LTLIBOBJS = 
++MAKEINFO = ${SHELL} /home/andre/Dropbox/xtables-addons/missing --run makeinfo
++MKDIR_P = /bin/mkdir -p
++NM = /usr/bin/nm -B
++NMEDIT = 
++OBJDUMP = objdump
++OBJEXT = o
++OTOOL = 
++OTOOL64 = 
++PACKAGE = xtables-addons
++PACKAGE_BUGREPORT = 
++PACKAGE_NAME = xtables-addons
++PACKAGE_STRING = xtables-addons 1.21
++PACKAGE_TARNAME = xtables-addons
++PACKAGE_URL = 
++PACKAGE_VERSION = 1.21
++PATH_SEPARATOR = :
++PKG_CONFIG = /usr/bin/pkg-config
++RANLIB = ranlib
++SED = /bin/sed
++SET_MAKE = 
++SHELL = /bin/bash
++STRIP = strip
++VERSION = 1.21
++abs_builddir = /home/andre/Dropbox/xtables-addons/extensions/LUA
++abs_srcdir = /home/andre/Dropbox/xtables-addons/extensions/LUA
++abs_top_builddir = /home/andre/Dropbox/xtables-addons
++abs_top_srcdir = /home/andre/Dropbox/xtables-addons
++ac_ct_CC = gcc
++ac_ct_DUMPBIN = 
++am__include = include
++am__leading_dot = .
++am__quote = 
++am__tar = ${AMTAR} chof - "$$tardir"
++am__untar = ${AMTAR} xf -
++bindir = ${exec_prefix}/bin
++build = i686-pc-linux-gnu
++build_alias = 
++build_cpu = i686
++build_os = linux-gnu
++build_vendor = pc
++builddir = .
++datadir = ${datarootdir}
++datarootdir = ${prefix}/share
++docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
++dvidir = ${docdir}
++exec_prefix = ${prefix}
++host = i686-pc-linux-gnu
++host_alias = 
++host_cpu = i686
++host_os = linux-gnu
++host_vendor = pc
++htmldir = ${docdir}
++includedir = ${prefix}/include
++infodir = ${datarootdir}/info
++install_sh = ${SHELL} /home/andre/Dropbox/xtables-addons/install-sh
++kbuilddir = /lib/modules/2.6.33-020633-generic/build
++kinclude_CFLAGS =  -I /lib/modules/2.6.33-020633-generic/build/include
++ksourcedir = 
++libdir = ${exec_prefix}/lib
++libexecdir = ${exec_prefix}/libexec
++libxtables_CFLAGS =  
++libxtables_LIBS = -L/lib -lxtables  
++localedir = ${datarootdir}/locale
++localstatedir = ${prefix}/var
++lt_ECHO = echo
++mandir = ${datarootdir}/man
++mkdir_p = /bin/mkdir -p
++oldincludedir = /usr/include
++pdfdir = ${docdir}
++prefix = /usr/local
++program_transform_name = s,x,x,
++psdir = ${docdir}
++regular_CFLAGS = -D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64  -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations    -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes     -Winline -pipe -DXTABLES_LIBDIR=\"${xtlibdir}\"
++sbindir = ${exec_prefix}/sbin
++sharedstatedir = ${prefix}/com
++srcdir = .
++sysconfdir = ${prefix}/etc
++target_alias = 
++top_build_prefix = ../../
++top_builddir = ../..
++top_srcdir = ../..
++xtlibdir = ${libexecdir}/xtables
++XA_SRCDIR = ${srcdir}
++XA_TOPSRCDIR = ${top_srcdir}
++XA_ABSTOPSRCDIR = ${abs_top_srcdir}
++_mcall = -f ${top_builddir}/Makefile.iptrules
++all: all-am
++
++.SUFFIXES:
++$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../../Makefile.extra $(am__configure_deps)
++      @for dep in $?; do \
++        case '$(am__configure_deps)' in \
++          *$$dep*) \
++            ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
++              && { if test -f $@; then exit 0; else break; fi; }; \
++            exit 1;; \
++        esac; \
++      done; \
++      echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign extensions/LUA/Makefile'; \
++      $(am__cd) $(top_srcdir) && \
++        $(AUTOMAKE) --foreign extensions/LUA/Makefile
++.PRECIOUS: Makefile
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++      @case '$?' in \
++        *config.status*) \
++          cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
++        *) \
++          echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
++          cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
++      esac;
++
++$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
++      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++
++$(top_srcdir)/configure:  $(am__configure_deps)
++      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
++      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++$(am__aclocal_m4_deps):
++
++mostlyclean-libtool:
++      -rm -f *.lo
++
++clean-libtool:
++      -rm -rf .libs _libs
++tags: TAGS
++TAGS:
++
++ctags: CTAGS
++CTAGS:
++
++
++distdir: $(DISTFILES)
++      @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
++      topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
++      list='$(DISTFILES)'; \
++        dist_files=`for file in $$list; do echo $$file; done | \
++        sed -e "s|^$$srcdirstrip/||;t" \
++            -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
++      case $$dist_files in \
++        */*) $(MKDIR_P) `echo "$$dist_files" | \
++                         sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
++                         sort -u` ;; \
++      esac; \
++      for file in $$dist_files; do \
++        if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
++        if test -d $$d/$$file; then \
++          dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
++          if test -d "$(distdir)/$$file"; then \
++            find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
++          fi; \
++          if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
++            cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
++            find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
++          fi; \
++          cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
++        else \
++          test -f "$(distdir)/$$file" \
++          || cp -p $$d/$$file "$(distdir)/$$file" \
++          || exit 1; \
++        fi; \
++      done
++check-am: all-am
++check: check-am
++all-am: Makefile all-local
++installdirs:
++install: install-am
++install-exec: install-exec-am
++install-data: install-data-am
++uninstall: uninstall-am
++
++install-am: all-am
++      @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
++
++installcheck: installcheck-am
++install-strip:
++      $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
++        install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
++        `test -z '$(STRIP)' || \
++          echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
++mostlyclean-generic:
++
++clean-generic:
++
++distclean-generic:
++      -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
++      -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
++
++maintainer-clean-generic:
++      @echo "This command is intended for maintainers to use"
++      @echo "it deletes files that may require special tools to rebuild."
++clean: clean-am
++
++clean-am: clean-generic clean-libtool clean-local mostlyclean-am
++
++distclean: distclean-am
++      -rm -f Makefile
++distclean-am: clean-am distclean-generic
++
++dvi: dvi-am
++
++dvi-am:
++
++html: html-am
++
++html-am:
++
++info: info-am
++
++info-am:
++
++install-data-am:
++
++install-dvi: install-dvi-am
++
++install-dvi-am:
++
++install-exec-am: install-exec-local
++
++install-html: install-html-am
++
++install-html-am:
++
++install-info: install-info-am
++
++install-info-am:
++
++install-man:
++
++install-pdf: install-pdf-am
++
++install-pdf-am:
++
++install-ps: install-ps-am
++
++install-ps-am:
++
++installcheck-am:
++
++maintainer-clean: maintainer-clean-am
++      -rm -f Makefile
++maintainer-clean-am: distclean-am maintainer-clean-generic
++
++mostlyclean: mostlyclean-am
++
++mostlyclean-am: mostlyclean-generic mostlyclean-libtool
++
++pdf: pdf-am
++
++pdf-am:
++
++ps: ps-am
++
++ps-am:
++
++uninstall-am:
++
++.MAKE: install-am install-strip
++
++.PHONY: all all-am all-local check check-am clean clean-generic \
++      clean-libtool clean-local distclean distclean-generic \
++      distclean-libtool distdir dvi dvi-am html html-am info info-am \
++      install install-am install-data install-data-am install-dvi \
++      install-dvi-am install-exec install-exec-am install-exec-local \
++      install-html install-html-am install-info install-info-am \
++      install-man install-pdf install-pdf-am install-ps \
++      install-ps-am install-strip installcheck installcheck-am \
++      installdirs maintainer-clean maintainer-clean-generic \
++      mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
++      ps ps-am uninstall uninstall-am
++
++export XA_SRCDIR
++export XA_TOPSRCDIR
++export XA_ABSTOPSRCDIR
++
++all-local: user-all-local
++
++install-exec-local: user-install-local
++
++clean-local: user-clean-local
++
++user-all-local:
++      ${MAKE} ${_mcall} all;
++
++# Have no user-install-data-local ATM
++user-install-local: user-install-exec-local
++
++user-install-exec-local:
++      ${MAKE} ${_mcall} install;
++
++user-clean-local:
++      ${MAKE} ${_mcall} clean;
++
++# Tell versions [3.59,3.63) of GNU make to not export all variables.
++# Otherwise a system limit (for SysV at least) may be exceeded.
++.NOEXPORT:
++
+--- /dev/null
++++ b/extensions/LUA/Makefile.am
+@@ -0,0 +1 @@
++include ../../Makefile.extra
+--- /dev/null
++++ b/extensions/LUA/Makefile.in
+@@ -0,0 +1,389 @@
++# Makefile.in generated by automake 1.11.1 from Makefile.am.
++# @configure_input@
++
++# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
++# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
++# Inc.
++# This Makefile.in is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
++# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
++# PARTICULAR PURPOSE.
++
++@SET_MAKE@
++
++# -*- Makefile -*-
++# AUTOMAKE
++VPATH = @srcdir@
++pkgdatadir = $(datadir)/@PACKAGE@
++pkgincludedir = $(includedir)/@PACKAGE@
++pkglibdir = $(libdir)/@PACKAGE@
++pkglibexecdir = $(libexecdir)/@PACKAGE@
++am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
++install_sh_DATA = $(install_sh) -c -m 644
++install_sh_PROGRAM = $(install_sh) -c
++install_sh_SCRIPT = $(install_sh) -c
++INSTALL_HEADER = $(INSTALL_DATA)
++transform = $(program_transform_name)
++NORMAL_INSTALL = :
++PRE_INSTALL = :
++POST_INSTALL = :
++NORMAL_UNINSTALL = :
++PRE_UNINSTALL = :
++POST_UNINSTALL = :
++build_triplet = @build@
++host_triplet = @host@
++DIST_COMMON = $(srcdir)/../../Makefile.extra $(srcdir)/Makefile.am \
++      $(srcdir)/Makefile.in
++subdir = extensions/LUA
++ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
++am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
++      $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
++      $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
++      $(top_srcdir)/configure.ac
++am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
++      $(ACLOCAL_M4)
++mkinstalldirs = $(install_sh) -d
++CONFIG_HEADER = $(top_builddir)/config.h
++CONFIG_CLEAN_FILES =
++CONFIG_CLEAN_VPATH_FILES =
++SOURCES =
++DIST_SOURCES =
++DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
++ACLOCAL = @ACLOCAL@
++AMTAR = @AMTAR@
++AR = @AR@
++AUTOCONF = @AUTOCONF@
++AUTOHEADER = @AUTOHEADER@
++AUTOMAKE = @AUTOMAKE@
++AWK = @AWK@
++CC = @CC@
++CCDEPMODE = @CCDEPMODE@
++CFLAGS = @CFLAGS@
++CPP = @CPP@
++CPPFLAGS = @CPPFLAGS@
++CYGPATH_W = @CYGPATH_W@
++DEFS = @DEFS@
++DEPDIR = @DEPDIR@
++DSYMUTIL = @DSYMUTIL@
++DUMPBIN = @DUMPBIN@
++ECHO_C = @ECHO_C@
++ECHO_N = @ECHO_N@
++ECHO_T = @ECHO_T@
++EGREP = @EGREP@
++EXEEXT = @EXEEXT@
++FGREP = @FGREP@
++GREP = @GREP@
++INSTALL = @INSTALL@
++INSTALL_DATA = @INSTALL_DATA@
++INSTALL_PROGRAM = @INSTALL_PROGRAM@
++INSTALL_SCRIPT = @INSTALL_SCRIPT@
++INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
++LD = @LD@
++LDFLAGS = @LDFLAGS@
++LIBOBJS = @LIBOBJS@
++LIBS = @LIBS@
++LIBTOOL = @LIBTOOL@
++LIPO = @LIPO@
++LN_S = @LN_S@
++LTLIBOBJS = @LTLIBOBJS@
++MAKEINFO = @MAKEINFO@
++MKDIR_P = @MKDIR_P@
++NM = @NM@
++NMEDIT = @NMEDIT@
++OBJDUMP = @OBJDUMP@
++OBJEXT = @OBJEXT@
++OTOOL = @OTOOL@
++OTOOL64 = @OTOOL64@
++PACKAGE = @PACKAGE@
++PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
++PACKAGE_NAME = @PACKAGE_NAME@
++PACKAGE_STRING = @PACKAGE_STRING@
++PACKAGE_TARNAME = @PACKAGE_TARNAME@
++PACKAGE_URL = @PACKAGE_URL@
++PACKAGE_VERSION = @PACKAGE_VERSION@
++PATH_SEPARATOR = @PATH_SEPARATOR@
++PKG_CONFIG = @PKG_CONFIG@
++RANLIB = @RANLIB@
++SED = @SED@
++SET_MAKE = @SET_MAKE@
++SHELL = @SHELL@
++STRIP = @STRIP@
++VERSION = @VERSION@
++abs_builddir = @abs_builddir@
++abs_srcdir = @abs_srcdir@
++abs_top_builddir = @abs_top_builddir@
++abs_top_srcdir = @abs_top_srcdir@
++ac_ct_CC = @ac_ct_CC@
++ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
++am__include = @am__include@
++am__leading_dot = @am__leading_dot@
++am__quote = @am__quote@
++am__tar = @am__tar@
++am__untar = @am__untar@
++bindir = @bindir@
++build = @build@
++build_alias = @build_alias@
++build_cpu = @build_cpu@
++build_os = @build_os@
++build_vendor = @build_vendor@
++builddir = @builddir@
++datadir = @datadir@
++datarootdir = @datarootdir@
++docdir = @docdir@
++dvidir = @dvidir@
++exec_prefix = @exec_prefix@
++host = @host@
++host_alias = @host_alias@
++host_cpu = @host_cpu@
++host_os = @host_os@
++host_vendor = @host_vendor@
++htmldir = @htmldir@
++includedir = @includedir@
++infodir = @infodir@
++install_sh = @install_sh@
++kbuilddir = @kbuilddir@
++kinclude_CFLAGS = @kinclude_CFLAGS@
++ksourcedir = @ksourcedir@
++libdir = @libdir@
++libexecdir = @libexecdir@
++libxtables_CFLAGS = @libxtables_CFLAGS@
++libxtables_LIBS = @libxtables_LIBS@
++localedir = @localedir@
++localstatedir = @localstatedir@
++lt_ECHO = @lt_ECHO@
++mandir = @mandir@
++mkdir_p = @mkdir_p@
++oldincludedir = @oldincludedir@
++pdfdir = @pdfdir@
++prefix = @prefix@
++program_transform_name = @program_transform_name@
++psdir = @psdir@
++regular_CFLAGS = @regular_CFLAGS@
++sbindir = @sbindir@
++sharedstatedir = @sharedstatedir@
++srcdir = @srcdir@
++sysconfdir = @sysconfdir@
++target_alias = @target_alias@
++top_build_prefix = @top_build_prefix@
++top_builddir = @top_builddir@
++top_srcdir = @top_srcdir@
++xtlibdir = @xtlibdir@
++XA_SRCDIR = ${srcdir}
++XA_TOPSRCDIR = ${top_srcdir}
++XA_ABSTOPSRCDIR = ${abs_top_srcdir}
++_mcall = -f ${top_builddir}/Makefile.iptrules
++all: all-am
++
++.SUFFIXES:
++$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/../../Makefile.extra $(am__configure_deps)
++      @for dep in $?; do \
++        case '$(am__configure_deps)' in \
++          *$$dep*) \
++            ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
++              && { if test -f $@; then exit 0; else break; fi; }; \
++            exit 1;; \
++        esac; \
++      done; \
++      echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign extensions/LUA/Makefile'; \
++      $(am__cd) $(top_srcdir) && \
++        $(AUTOMAKE) --foreign extensions/LUA/Makefile
++.PRECIOUS: Makefile
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++      @case '$?' in \
++        *config.status*) \
++          cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
++        *) \
++          echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
++          cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
++      esac;
++
++$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
++      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++
++$(top_srcdir)/configure:  $(am__configure_deps)
++      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
++      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++$(am__aclocal_m4_deps):
++
++mostlyclean-libtool:
++      -rm -f *.lo
++
++clean-libtool:
++      -rm -rf .libs _libs
++tags: TAGS
++TAGS:
++
++ctags: CTAGS
++CTAGS:
++
++
++distdir: $(DISTFILES)
++      @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
++      topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
++      list='$(DISTFILES)'; \
++        dist_files=`for file in $$list; do echo $$file; done | \
++        sed -e "s|^$$srcdirstrip/||;t" \
++            -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
++      case $$dist_files in \
++        */*) $(MKDIR_P) `echo "$$dist_files" | \
++                         sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
++                         sort -u` ;; \
++      esac; \
++      for file in $$dist_files; do \
++        if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
++        if test -d $$d/$$file; then \
++          dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
++          if test -d "$(distdir)/$$file"; then \
++            find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
++          fi; \
++          if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
++            cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
++            find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
++          fi; \
++          cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
++        else \
++          test -f "$(distdir)/$$file" \
++          || cp -p $$d/$$file "$(distdir)/$$file" \
++          || exit 1; \
++        fi; \
++      done
++check-am: all-am
++check: check-am
++all-am: Makefile all-local
++installdirs:
++install: install-am
++install-exec: install-exec-am
++install-data: install-data-am
++uninstall: uninstall-am
++
++install-am: all-am
++      @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
++
++installcheck: installcheck-am
++install-strip:
++      $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
++        install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
++        `test -z '$(STRIP)' || \
++          echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
++mostlyclean-generic:
++
++clean-generic:
++
++distclean-generic:
++      -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
++      -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
++
++maintainer-clean-generic:
++      @echo "This command is intended for maintainers to use"
++      @echo "it deletes files that may require special tools to rebuild."
++clean: clean-am
++
++clean-am: clean-generic clean-libtool clean-local mostlyclean-am
++
++distclean: distclean-am
++      -rm -f Makefile
++distclean-am: clean-am distclean-generic
++
++dvi: dvi-am
++
++dvi-am:
++
++html: html-am
++
++html-am:
++
++info: info-am
++
++info-am:
++
++install-data-am:
++
++install-dvi: install-dvi-am
++
++install-dvi-am:
++
++install-exec-am: install-exec-local
++
++install-html: install-html-am
++
++install-html-am:
++
++install-info: install-info-am
++
++install-info-am:
++
++install-man:
++
++install-pdf: install-pdf-am
++
++install-pdf-am:
++
++install-ps: install-ps-am
++
++install-ps-am:
++
++installcheck-am:
++
++maintainer-clean: maintainer-clean-am
++      -rm -f Makefile
++maintainer-clean-am: distclean-am maintainer-clean-generic
++
++mostlyclean: mostlyclean-am
++
++mostlyclean-am: mostlyclean-generic mostlyclean-libtool
++
++pdf: pdf-am
++
++pdf-am:
++
++ps: ps-am
++
++ps-am:
++
++uninstall-am:
++
++.MAKE: install-am install-strip
++
++.PHONY: all all-am all-local check check-am clean clean-generic \
++      clean-libtool clean-local distclean distclean-generic \
++      distclean-libtool distdir dvi dvi-am html html-am info info-am \
++      install install-am install-data install-data-am install-dvi \
++      install-dvi-am install-exec install-exec-am install-exec-local \
++      install-html install-html-am install-info install-info-am \
++      install-man install-pdf install-pdf-am install-ps \
++      install-ps-am install-strip installcheck installcheck-am \
++      installdirs maintainer-clean maintainer-clean-generic \
++      mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
++      ps ps-am uninstall uninstall-am
++
++export XA_SRCDIR
++export XA_TOPSRCDIR
++export XA_ABSTOPSRCDIR
++
++all-local: user-all-local
++
++install-exec-local: user-install-local
++
++clean-local: user-clean-local
++
++user-all-local:
++      ${MAKE} ${_mcall} all;
++
++# Have no user-install-data-local ATM
++user-install-local: user-install-exec-local
++
++user-install-exec-local:
++      ${MAKE} ${_mcall} install;
++
++user-clean-local:
++      ${MAKE} ${_mcall} clean;
++
++# Tell versions [3.59,3.63) of GNU make to not export all variables.
++# Otherwise a system limit (for SysV at least) may be exceeded.
++.NOEXPORT:
++
+--- /dev/null
++++ b/extensions/LUA/Mbuild
+@@ -0,0 +1,3 @@
++# -*- Makefile -*-
++
++obj-${build_LUA}     += libxt_LUA.so
+--- /dev/null
++++ b/extensions/LUA/nf_lua.c
+@@ -0,0 +1,64 @@
++#if defined(__KERNEL__)
++
++#include <linux/kernel.h>
++#include <linux/slab.h>
++#include <linux/string.h>
++#include <linux/timer.h>
++#include <linux/random.h>
++#include <linux/netfilter/x_tables.h>
++
++#endif
++
++#include "lua.h"
++#include "lobject.h" /*sizeof(udata) */
++#include "lauxlib.h"
++#include "controller.h"
++
++#if defined(__KERNEL__) /* reachs until luaopen_nflib */
++
++
++static int32_t nf_get_random(lua_State *L)
++{
++      uint32_t  rand = 0;
++
++      get_random_bytes(&rand, sizeof(uint32_t ));
++      lua_pushnumber(L, rand);
++      return 1;
++}
++
++static int32_t nf_get_time(lua_State *L)
++{
++      lua_pushnumber(L, jiffies_to_msecs(jiffies_64));
++      return 1;
++}
++
++static const struct luaL_Reg nf_lua_lib_f [] = {
++      { "get_random",    nf_get_random    },
++      { "get_time",      nf_get_time      },
++      { NULL,            NULL             }
++};
++
++void luaopen_nflib(lua_State *L)
++{
++      int32_t top;
++
++      luaL_register(L, NETFILTER_LIB, nf_lua_lib_f);
++      lua_pop(L, 1);
++
++      /* registering verdicts inside the _G */
++      lua_getglobal(L, "_G");
++      top = lua_gettop(L);
++
++      lua_pushinteger(L, XT_CONTINUE);
++      lua_setfield(L, top, "XT_CONTINUE");    /* continiue with next rule */
++
++      lua_pushinteger(L, NF_DROP);
++      lua_setfield(L, top, "NF_DROP");        /* stop traversal in the current table hook and drop packet */
++
++      lua_pushinteger(L, NF_ACCEPT);
++      lua_setfield(L, top, "NF_ACCEPT");      /* stop traversal in the current table hook and accept packet */
++
++      lua_pop(L, 1);                          /* pop _G */
++}
++
++#endif
+--- /dev/null
++++ b/extensions/LUA/prot_buf_dynamic.c
+@@ -0,0 +1,486 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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 "controller.h"
++
++
++
++struct protocol_buf * dyn_prot_buf_array[MAX_NR_OF_DYN_PROT_BUFS] = { NULL }; 
++
++
++/* LUA_API: the function 'field_dynamic_setter' acts as a wrapper around
++ * a given Lua field setter function of a dynamic protocol buffer. The 
++ * string containing the lua function name was piggybacked in the 'set'
++ * member of the protocol_field. We call this function passing the actual
++ * segment as byte array and the set value.
++ * 
++ * Paramters:
++ * 1.  lua_packet_segment (implicit)
++ * 2.  some lua value 
++ *
++ * Upvalues:
++ * 1.  pointer to the protocol buffer 
++ * 2.  field index 
++ *
++ * Returns:
++ * 1.  true or false if the 'set' was successful
++ */
++int32_t field_dynamic_setter(lua_State *L)
++{
++      size_t nbytes;
++      lua_packet_segment * array;
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      int32_t field_index = lua_tointeger(L, lua_upvalueindex(2));
++    
++      /* the function name is piggybacked as a string */
++      lua_getglobal(L, (char *)prot_buf->protocol_fields[field_index].set);
++      if (!lua_isfunction(L, -1)) {
++              lua_pushboolean(L, 0);
++              return 1;
++      }
++
++      nbytes = sizeof(lua_packet_segment) + seg->length * sizeof(uint8_t);
++      array = (lua_packet_segment *)lua_newuserdata(L, nbytes);
++      array->length = seg->length;
++      array->start = seg->start + seg->offset;
++      array->changes = NULL;
++
++      luaL_getmetatable(L, LUA_BYTE_ARRAY);
++      lua_setmetatable(L, -2);
++      lua_pushvalue(L, 2); /* push value to set */
++      if (lua_pcall(L, 2, 1, 0) != 0) {
++              pr_debug("Error: %s \n", lua_tostring(L, -1));
++              lua_pop(L, 1);
++              lua_pushboolean(L, 0);
++      }
++      return 1;
++}
++
++/* LUA_API: the function 'field_dynamic_getter' acts as a wrapper around
++ * a given Lua field getter function of a dynamic protocol buffer. The 
++ * string containing the lua function name was piggybacked in the 'get'
++ * member of the protocol_field. We call this function passing the actual
++ * segment as byte array.
++ * 
++ * Paramters:
++ * 1.  lua_packet_segment (implicit)
++ *
++ * Upvalues:
++ * 1.  pointer to the protocol buffer 
++ * 2.  field index 
++ *
++ * Returns:
++ * 1.  true or false if the 'get' was successful
++ */
++int32_t field_dynamic_getter(lua_State *L)
++{
++      size_t nbytes;
++      lua_packet_segment * array;
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      int32_t field_index = lua_tointeger(L, lua_upvalueindex(2));
++    
++      /* the function name is piggybacked as a string */
++      lua_getglobal(L, (char *)prot_buf->protocol_fields[field_index].get);
++      if (!lua_isfunction(L, -1)) {
++              lua_pushboolean(L, 0);
++              return 1;
++      }
++
++      nbytes = sizeof(lua_packet_segment) + seg->length * sizeof(uint8_t);
++      array = (lua_packet_segment *)lua_newuserdata(L, nbytes);
++      array->length = seg->length;
++      array->start = seg->start + seg->offset;
++      array->changes = NULL;
++
++      luaL_getmetatable(L, LUA_BYTE_ARRAY);
++      lua_setmetatable(L, -2);
++      if (lua_pcall(L, 1, 1, 0) != 0) {
++              pr_debug("Error: %s \n", luaL_checkstring(L, -1));
++              lua_pop(L, 1);
++              lua_pushboolean(L, 0);
++      }
++      return 1;
++}
++
++/* LUA_API: the function 'has_protocol_dynamic' acts as a wrapper around 
++ * a given lua has_protocol function of a dynamic protocol buffer. The 
++ * string containing the lua function name was piggybacked in the 'has_protocol'
++ * member of the protocol_buffer. We call this function passing the actual
++ * segment.
++ * 
++ * Paramters:
++ * 1.  lua_packet_segment
++ * 2.  protocol type 
++ *
++ * Returns:
++ * 1.  true or false if the payload field contains the given protocol 
++ */
++int32_t has_protocol_dynamic(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t type)
++{
++      lua_packet_segment *seg_new;
++      int32_t res = 0;                                      
++      
++    /* the function name is piggybacked as a string */
++      lua_getglobal(L, (char *)prot_buf->has_protocol);
++      seg_new = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment));
++      seg_new->start = seg->start;
++      seg_new->offset = seg->offset;
++      seg_new->length = seg->length;
++      seg_new->changes = NULL;
++      luaL_getmetatable(L, prot_buf->name);
++      lua_setmetatable(L, -2);
++      lua_pushinteger(L, type);  /* push the protocol type */
++      if (lua_pcall(L, 2, 1, 0) != 0) {
++              pr_debug("Error: %s \n", luaL_checkstring(L, -1));
++              lua_pop(L, 1);
++              return 0;
++      }
++      res = lua_toboolean(L, -1);
++      lua_pop(L, 1);
++
++      return res;
++}
++
++/* LUA_API: the function 'get_field_changes_dynamic' acts as a wrapper around 
++ * a given lua get_field_changes function of a dynamic protocol buffer. The 
++ * string containing the lua function name was piggybacked in the 'get_field_changes'
++ * member of the protocol_buffer. We call this function passing the actual
++ * segment. The lua function must return two lua table containing the offset 
++ * and length changes (in bits). 
++ * 
++ * Paramters:
++ * 1.  lua_packet_segment 
++ *
++ * Returns:
++ * 1.  new allocated field_changes struct 
++ */
++struct field_changes * get_field_changes_dynamic(lua_State *L, struct protocol_buf *prot_buf, lua_packet_segment * seg)
++{
++      lua_packet_segment *seg_new;
++      struct field_changes * changes;
++      int32_t nr_of_changes, i;
++
++      lua_getglobal(L, (char *)prot_buf->get_field_changes);
++
++      seg_new = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment));
++      seg_new->start = seg->start;
++      seg_new->offset = seg->offset;
++      seg_new->length = seg->length;
++      seg_new->changes = NULL;
++      luaL_getmetatable(L, prot_buf->name);
++      lua_setmetatable(L, -2);
++
++      if (lua_pcall(L, 1, 2, 0) != 0)
++              luaL_error(L, "inside get_field_changes_dynamic. %s\n", lua_tostring(L, -1));
++
++      /* the function call must return a table containing length changes */
++      luaL_checktype(L, -1, LUA_TTABLE);
++      /* the function call must return a table containing offset changes */
++      luaL_checktype(L, -2, LUA_TTABLE);
++      /* both tables have to be of same size */
++      if (lua_objlen(L, -1) != lua_objlen(L, -2))
++              luaL_error(L, "the provided tables are not of equal size");
++
++      nr_of_changes = lua_objlen(L, -1);
++      changes = get_allocated_field_changes(L, nr_of_changes);
++
++      /* loop over the tables */
++      for (i = 1; i < nr_of_changes; i++) {
++              lua_rawgeti(L, -1, i);  /* push length value of field at index i */
++              changes->field_length_changes[i - 1] = luaL_checkinteger(L, -1);
++              lua_pop(L, 1);          /* pop offset value */
++
++              lua_rawgeti(L, -2, i);  /* push offset value of field at index i */
++              changes->field_offset_changes[i - 1] = luaL_checkinteger(L, -1);
++              lua_pop(L, 1);          /* pop length value */
++      }
++
++      /* pop both tables */
++      lua_pop(L, 2);
++
++      return changes;
++}
++
++/* C_INT: 'get_free_protocol_index' is only used internally. This function
++ * gets a free slot inside the array holding all the  protocol buffers.
++ * There are several ways to get to this information. In this case I take
++ * the way over the reflected array SUPPORTED_PROTOCOL_TABLE inside the
++ * Lua state. Since this function is called at laodtime, we do not have
++ * to care about performance.
++ */
++static int32_t get_free_protocol_index(lua_State *L)
++{
++      int32_t protocol_index;
++
++      lua_getglobal(L, SUPPORTED_PROTOCOL_TABLE);
++      protocol_index = lua_objlen(L, -1) + 1;
++      lua_pop(L, 1);
++      return protocol_index;
++}
++
++/* C_API: 'free_dynamic_prot_buf' frees the allocated memory of a given
++ * dynamic protocol buffer. this function is normally called inside a 
++ * cleanup routine. Be aware, before running this function you must be 
++ * sure that no references to the dynamic protocol buffers were available.
++ * It's recomended to close the Lua state before calling the function. */
++void free_dynamic_prot_buf(struct protocol_buf * prot_buf)
++{
++      struct protocol_field * field = prot_buf->protocol_fields;
++
++      for (; field->name != NULL; field++) {
++              if (field->get) kfree(field->get);
++              if (field->set) kfree(field->set);
++              if (field->name) kfree((char *)field->name);
++      }
++
++      if (prot_buf->payload_field) kfree(prot_buf->payload_field);
++      if (prot_buf->has_protocol) kfree(prot_buf->has_protocol);
++
++      if (prot_buf->get_field_changes) kfree(prot_buf->get_field_changes);
++      kfree((char *)prot_buf->name);
++      kfree(prot_buf);
++      return;
++}
++
++void cleanup_dynamic_prot_bufs(void)
++{
++      int32_t i;
++
++      for (i = 0; i < MAX_NR_OF_DYN_PROT_BUFS; i++) {
++              if (dyn_prot_buf_array[i]) {
++                      free_dynamic_prot_buf(dyn_prot_buf_array[i]);
++                      dyn_prot_buf_array[i] = NULL;
++              }
++      }
++      return;
++}
++
++
++/* C_INT: 'free_protocol_fields' is used internally as a helper function for
++ * 'register_dynamic_protbuf'. It is used when durin registration an error
++ * occurs and the afore allocated fields needed to be freed. */
++static inline void free_protocol_fields(struct protocol_field * prot_fields, int32_t i)
++{
++      struct protocol_field * f;
++
++      while (i >= 0) {
++              f = &prot_fields[i];
++              if (f->name) kfree((void *)f->name);
++              if (f->get) kfree((void *)f->get);
++              if (f->set) kfree((void *)f->set);
++              kfree((void *)f);
++              i--;
++      }
++}
++
++/* LUA_API: 'register_dynamic_protbuf' is called from within the Lua script.
++ * it takes a Lua table representing the dynamic protocol buffer as parameter.
++ * e.g.:
++ *    eth_prot_buf = {
++ *            name = "packet_eth_dyn",
++ *            payload_field = "data",
++ *            protocol_fields = {
++ *                    {"dmac",                0,              48,             nil,    nil     },
++ *                    {"smac",                48,     48,             nil,    nil     },
++ *                    {"type",                96,     16,             nil,    nil     },
++ *                    {"data",                112,    0,              nil,    nil },
++ *            },
++ *            has_protocol = "eth_dyn_has_protocol",
++ *            get_field_changes = "eth_dyn_get_field_changes"
++ *    }
++ * register_dynamic_protbuf(eth_prot_buf)
++ * 
++ * the table gets parsed and a new protocol_buf struct is allocated and 
++ * initialized using 'register_protbuf', which is also used for the static
++ * protocol buffers. This enables an identical behavior like the static
++ * protocol buffers. The dynamic protocol buffers are not garbage collected,
++ * use 'free_dynamic_protbuf' to free them after closing the Lua state. 
++ */
++static int32_t register_dynamic_protbuf(lua_State *L)
++{
++      struct protocol_buf *prot_buf;
++      struct protocol_field *field, sentinel = PROT_FIELD_SENTINEL;
++      int32_t nr_of_fields, i;
++
++      prot_buf = (struct protocol_buf *)kmalloc(sizeof(struct protocol_buf), GFP_KERNEL);
++      prot_buf->is_dynamic = 1;
++
++      /* check if parameter is a table */
++      luaL_checktype(L, 1, LUA_TTABLE);
++
++      /* initialize prot_buf.name */
++      lua_getfield(L, 1, "name");
++      prot_buf->name = kmalloc(lua_objlen(L, -1), GFP_KERNEL);
++      strcpy((char *)prot_buf->name, luaL_checkstring(L, -1));
++      lua_pop(L, 1);  /* pop res from lua_getfield */
++
++      /* check if protocol buffer is already registered */
++      lua_getglobal(L, prot_buf->name);
++      if (!lua_isnil(L, -1)) {
++              lua_pop(L, 1); /* pop res from lua_getglobal */
++              pr_debug("protocol_buf '%s' already registered.\n", prot_buf->name);
++              goto free_prot_buf;
++      }
++      lua_pop(L, 1); /* pop res from lua_getglobal */
++
++      /* initialize payload field */
++      lua_getfield(L, 1, "payload_field");
++      if (lua_isstring(L, -1)) {
++              prot_buf->payload_field = kmalloc(lua_objlen(L, -1), GFP_KERNEL);
++              strcpy(prot_buf->payload_field, lua_tostring(L, -1));
++      }else
++              prot_buf->payload_field = NULL;
++      lua_pop(L, 1); /* pop res from lua_getfield */
++
++      /* initialize protocol_fields field*/
++      lua_getfield(L, 1, "protocol_fields");
++      if (!lua_istable(L, -1)) {
++              pr_debug("invalid protocol_fields table.\n");
++              goto err2;
++
++      }
++
++      nr_of_fields = lua_objlen(L, -1);
++      prot_buf->protocol_fields = (struct protocol_field *)kmalloc((nr_of_fields + 1) * sizeof(struct protocol_field), GFP_KERNEL);
++
++      for (i = 1; i <= nr_of_fields; i++) {
++              field = &prot_buf->protocol_fields[i - 1];
++              /* initialize protocol field */
++              lua_rawgeti(L, -1, i);  /* push field-table */
++              if (!lua_istable(L, -1)) {
++                      free_protocol_fields(prot_buf->protocol_fields, i);
++                      pr_debug("invalid protocol_field at %i.\n", i);
++                      goto err;
++              }
++
++              /* initialize protocol field name */
++              lua_rawgeti(L, -1, 1);
++              if (!lua_isstring(L, -1)) {
++                      free_protocol_fields(prot_buf->protocol_fields, i);
++                      pr_debug("invalid protocol_field name at %i.\n", i);
++                      goto err;
++              }
++
++              field->name = kmalloc(lua_objlen(L, -1), GFP_KERNEL);
++              strcpy((char*)field->name, lua_tostring(L, -1));
++              lua_pop(L, 1); /* pop field name */
++
++              /* initialize protocol field offset */
++              lua_rawgeti(L, -1, 2);
++              if (!lua_isnumber(L, -1)) {
++                      free_protocol_fields(prot_buf->protocol_fields, i);
++                      pr_debug("invalid protocol_field offset at %i.\n", i);
++                      goto err;
++              }
++              field->offset = lua_tointeger(L, -1);
++              lua_pop(L, 1); /* pop field offset */
++
++              /* initialize protocol field length */
++              lua_rawgeti(L, -1, 3);
++              if (!lua_isnumber(L, -1)) {
++                      free_protocol_fields(prot_buf->protocol_fields, i);
++                      pr_debug("invalid protocol_field length at %i.\n", i);
++                      goto err;
++              }
++              field->length = lua_tointeger(L, -1);
++              lua_pop(L, 1); /* pop field length */
++
++              /* initialize protocol field getter */
++              lua_rawgeti(L, -1, 4);
++              if (lua_isstring(L, -1)) {
++                      field->get = kmalloc(lua_objlen(L, -1), GFP_KERNEL);
++                      strcpy((char *)field->get, lua_tostring(L, -1)); /* the get-wrapper knows about the piggybacked string */
++              }else
++                      field->get = NULL;
++              lua_pop(L, 1); /* pop field getter */
++
++              /* initialize protocol field setter */
++              lua_rawgeti(L, -1, 5);
++              if (lua_isstring(L, -1)) {
++                      field->set = kmalloc(lua_objlen(L, -1), GFP_KERNEL);
++                      strcpy((char *)field->set, lua_tostring(L, -1)); /* the set-wrapper knows about the piggybacked string */
++              }else
++                      field->set = NULL;
++              lua_pop(L, 1); /* pop field setter */
++
++              /* field initialization completed */
++              lua_pop(L, 1); /* pop field-table */
++      }
++
++      /* put sentinel at the end of protocol_fields */
++      memcpy(&prot_buf->protocol_fields[nr_of_fields], &sentinel, sizeof(sentinel));
++      lua_pop(L, 1); /* pop protocol-fields-table */
++
++      /* initialize has_protocol field */
++      lua_getfield(L, 1, "has_protocol");
++      if (lua_isstring(L, -1)) {
++              prot_buf->has_protocol = kmalloc(lua_objlen(L, -1), GFP_KERNEL);
++              strcpy((char *)prot_buf->has_protocol, lua_tostring(L, -1)); /* the has_protocol-wrapper knows about the piggybacked string */
++      }else
++              prot_buf->has_protocol = NULL;
++      lua_pop(L, 1); /* pop has_protocol */
++
++      /* initialize get_field_changes field */
++      lua_getfield(L, 1, "get_field_changes");
++      if (lua_isstring(L, -1)) {
++              prot_buf->get_field_changes = kmalloc(lua_objlen(L, -1), GFP_KERNEL);
++              strcpy((char *)prot_buf->get_field_changes, lua_tostring(L, -1)); /* the get_field_changes-wrapper knows about the piggybacked string */
++      }else
++              prot_buf->get_field_changes = NULL;
++      lua_pop(L, 1);                                                  /* pop get_field_changes */
++
++      /* Storing the pointer to the DYNAMIC protbuf within dyn_prot_buf_array, in order to free it at cleanup */
++      for (i = 0; i < MAX_NR_OF_DYN_PROT_BUFS; i++) {
++              if (!dyn_prot_buf_array[i]) {
++                      dyn_prot_buf_array[i] = prot_buf;
++                      break;
++              }else
++                      goto err;
++      }
++      
++      /* call the "common" register_protbuf */
++      register_protbuf(L, prot_buf, get_free_protocol_index(L));      /* register prot_buf as it is done with the static ones */
++
++      return 0;
++
++err:
++      kfree(prot_buf->protocol_fields);
++err2:
++      if (prot_buf->payload_field) kfree(prot_buf->payload_field);
++free_prot_buf:
++      kfree((void *)prot_buf->name);
++      kfree(prot_buf);
++
++      luaL_error(L, "one or more error happend while registering a dynamic protocol buffer, please consult the debug log");
++
++      return 0;
++
++}
++
++void luaopen_protbuf_dynamic(lua_State *L)
++{
++      lua_getglobal(L, "_G");
++      lua_pushcclosure(L, register_dynamic_protbuf, 0);
++      lua_setfield(L, -2, "register_dynamic_protbuf");
++      lua_pop(L, 1); /* pop _G */
++      return;
++}
+--- /dev/null
++++ b/extensions/LUA/prot_buf_ethernet.c
+@@ -0,0 +1,60 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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 "controller.h"
++
++
++static int32_t eth_has_protocol(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t protocol_type)
++{
++      uint8_t *embedded_protocol = seg->start + seg->offset + 12 /*bytes*/;
++      unsigned short res = (unsigned short)((embedded_protocol[1] << CHAR_BIT) | (embedded_protocol[0] << CHAR_BIT));
++
++      switch (res) {
++      case 0x0800:    /* 1: Internet Protocol (IP) */
++              if (protocol_type == PACKET_IP) return 1;
++              break;
++      default:
++              return 0;
++      }
++
++      return 0;
++}
++
++static const struct protocol_field eth_protocol_fields[] = {
++      /*       field name    offset  length  getter  setter  */
++      { "dmac", 0,                  48,              NULL,              NULL              },
++      { "smac", 48,                 48,              NULL,              NULL              },
++      { "type", 96,                 16,              NULL,              NULL              },
++      { "data", 112,                0,               NULL,              NULL              },
++      PROT_FIELD_SENTINEL,
++};
++
++static const struct protocol_buf eth_protocol_buf = {
++      .is_dynamic                     = 0,
++      .name                           = LUA_PACKET_SEG_ETH,
++      .payload_field                  = "data",
++      .protocol_fields                = (struct protocol_field *)&eth_protocol_fields,
++      .has_protocol                   = &eth_has_protocol,
++      .get_field_changes              = NULL,
++};
++
++
++void luaopen_protbuf_eth(lua_State *L)
++{
++      register_protbuf(L, (struct protocol_buf *)&eth_protocol_buf, PACKET_ETH);
++}
+--- /dev/null
++++ b/extensions/LUA/prot_buf_helpers.c
+@@ -0,0 +1,216 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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/>.
++ */
++
++#if defined(__KERNEL__)
++#include <linux/netfilter_ipv4.h>
++#include <linux/slab.h>         /* kmalloc */
++#endif
++
++#include "controller.h"
++
++int32_t get_header_size(struct protocol_buf * prot_buf)
++{
++      int32_t bit_counter = 0;
++      struct protocol_field * field = prot_buf->protocol_fields;
++
++      for (; field->name; field++)
++              bit_counter += field->length;
++
++      return bit_counter >> 3;
++}
++
++
++int32_t set_32_bit_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      *(uint32_t  *)(seg->start + seg->offset) = (uint32_t  )htonl(luaL_checkinteger(L, 2));
++      return 0;
++}
++int32_t get_32_bit_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      lua_pushinteger(L, ntohl(*((uint32_t  *)(seg->start + seg->offset))));
++      return 1;
++}
++
++int32_t set_16_bit_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      *(uint16_t *)(seg->start + seg->offset) = (uint16_t)htons(luaL_checkinteger(L, 2));
++      return 0;
++}
++int32_t get_16_bit_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      lua_pushinteger(L, ntohs(*((uint16_t *)(seg->start + seg->offset))));
++      return 1;
++}
++
++int32_t set_lower_4_bit_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++      uint8_t b = (uint8_t)luaL_checkinteger(L, 2) << 4;
++      uint8_t * pos = (uint8_t *)(seg->start + seg->offset);
++
++      *pos &= 0x0F; /* reset lower 4 bits*/
++      *pos |= b;
++
++      return 0;
++}
++
++int32_t get_lower_4_bit_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      lua_pushinteger(L, (*(uint8_t *)(seg->start + seg->offset)) >> 4);
++      return 1;
++}
++
++int32_t set_upper_4_bit_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++      uint8_t b = (uint8_t)luaL_checkinteger(L, 2) << 4;
++      uint8_t * pos = (uint8_t *)(seg->start + seg->offset);
++
++      *pos &= 0xF0; /* reset upper 4 bits*/
++      *pos |= (b >> 4);
++
++      return 0;
++}
++
++int32_t get_upper_4_bit_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      lua_pushinteger(L, (*(uint8_t *)(seg->start + seg->offset)) & 0x0F);
++      return 1;
++}
++
++
++int32_t set_8_bit_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      *(uint8_t *)(seg->start + seg->offset) = (uint8_t)luaL_checkinteger(L, 2);
++      return 0;
++}
++
++int32_t get_8_bit_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++      lua_pushinteger(L, *(uint8_t *)(seg->start + seg->offset));
++      return 1;
++}
++
++int32_t set_1_bit_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++      unsigned long l = 0;
++
++      memcpy(&l, (seg->start + seg->offset), seg->length);
++      l |= (1 << ((CHAR_BIT * seg->length) - luaL_checkinteger(L, 2)));
++      memcpy((seg->start + seg->offset), &l, seg->length);
++
++      return 0;
++}
++
++int32_t get_1_bit_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++      unsigned long l = 0;
++      uint32_t  bit = 0;
++
++      memcpy(&l, (seg->start + seg->offset), seg->length);
++      bit = l & (1 << ((CHAR_BIT * seg->length) - luaL_checkinteger(L, 2)));
++
++      lua_pushboolean(L, bit);
++      return 1;
++}
++
++int32_t get_string_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++    
++      /* Warning we cast from uchar to char */
++      lua_pushlstring(L, (char *)seg->start + seg->offset, seg->length);
++      return 1;
++}
++
++int32_t set_data_generic(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++      lua_packet_segment * data = checkbytearray(L, 2);
++
++      pr_debug("seg->length %u, data->length %u\n", seg->length, data->length);
++
++      if (seg->length >= data->length)
++              memcpy((seg->start + seg->offset), data->start, data->length);
++      else
++              luaL_error(L, "provided byte array too big for given packet segment");
++      return 0;
++}
++
++struct field_changes * get_allocated_field_changes(lua_State *L, int32_t nr_of_fields)
++{
++      struct field_changes * changes;
++
++      changes = kmalloc(sizeof(struct field_changes), GFP_ATOMIC);
++
++      if (!changes)
++              goto failure;
++
++      changes->field_length_changes = kmalloc(nr_of_fields * sizeof(int), GFP_ATOMIC);
++      if (!changes->field_length_changes)
++              goto free1;
++
++      changes->field_offset_changes = kmalloc(nr_of_fields * sizeof(int), GFP_ATOMIC);
++      if (!changes->field_offset_changes)
++              goto free2;
++
++      memset(changes->field_length_changes, 0, nr_of_fields * sizeof(int));
++      memset(changes->field_offset_changes, 0, nr_of_fields * sizeof(int));
++
++      changes->ref_count = 1;
++
++      return changes;
++
++free2: kfree(changes->field_length_changes);
++free1: kfree(changes);
++failure:
++      if (!changes) luaL_error(L, "couldnt allocate memory inside 'get_allocated_field_changes'");
++      return NULL; /* only to omit warnings */
++}
+\ No newline at end of file
+--- /dev/null
++++ b/extensions/LUA/prot_buf_icmp.c
+@@ -0,0 +1,49 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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 "controller.h"
++
++static int32_t icmp_has_protocol(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t protocol_type)
++{
++      return 0;
++}
++
++static const struct protocol_field icmp_protocol_fields[] = {
++      /*       field name    offset  length  getter  setter  */
++      { "type",     0,                   8,              NULL,              NULL      },
++      { "code",     8,                   8,              NULL,              NULL      },
++      { "checksum", 16,                  16,             NULL,              NULL      },
++      { "id",       32,                  16,             NULL,              NULL      },
++      { "sequence", 48,                  16,             NULL,              NULL      },
++      PROT_FIELD_SENTINEL,
++};
++
++static const struct protocol_buf icmp_protocol_buf = {
++      .is_dynamic                     = 0,
++      .name                           = LUA_PACKET_SEG_ICMP,
++      .payload_field                  = NULL,
++      .protocol_fields                = (struct protocol_field *)&icmp_protocol_fields,
++      .has_protocol                   = &icmp_has_protocol,
++      .get_field_changes              = NULL,
++};
++
++void luaopen_protbuf_icmp(lua_State *L)
++{
++      register_protbuf(L, (struct protocol_buf *)&icmp_protocol_buf, PACKET_ICMP);
++}
++
+--- /dev/null
++++ b/extensions/LUA/prot_buf_ip.c
+@@ -0,0 +1,209 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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/>.
++ */
++
++#if defined(__KERNEL__)
++      #include <net/checksum.h>
++      #include <net/tcp.h>
++#endif
++
++#include "controller.h"
++
++
++#define IP_FMT "%u.%u.%u.%u"
++#define IP_ACC(buf) buf[0], buf[1], buf[2], buf[3]
++
++
++static int32_t ip_version_set(lua_State *L)
++{
++      uint8_t version_checked;
++      lua_packet_segment * seg = checkpacketseg(L, 1, LUA_PACKET_SEG_IP);
++      uint8_t *version_seg = seg->start + seg->offset;
++      int32_t version = luaL_checkinteger(L, 2);
++
++      luaL_argcheck(L, version >= 0 && version <= 15, 1, "version number invalid");
++
++      version_checked = (uint8_t)version;
++
++      version_seg[0] &= (uint8_t)0x0F;  /* reset version bits */
++      version_seg[0] |= version_checked << 4;
++
++      return 0;
++}
++static int32_t ip_version_get(lua_State *L)
++{
++      lua_packet_segment * seg = checkpacketseg(L, 1, LUA_PACKET_SEG_IP);
++      uint8_t *version_seg = seg->start + seg->offset;
++      uint8_t v = version_seg[0] & 0xF0;
++
++      v >>= 4;
++
++      lua_pushinteger(L, v);
++      return 1;
++}
++
++static int32_t ip_ihl_set(lua_State *L)
++{
++      uint8_t ihl_checked;
++      lua_packet_segment * seg = checkpacketseg(L, 1, LUA_PACKET_SEG_IP);
++      uint8_t *ihl_seg = seg->start + seg->offset;
++      int32_t ihl = luaL_checkinteger(L, 2);
++
++      luaL_argcheck(L, ihl >= 5 && ihl <= 15, 1, "ip header length invalid");         // RFC 791 5x32 = 160 bits
++
++      ihl_checked = (uint8_t)ihl;
++
++      ihl_seg[0] &= (uint8_t)0xF0;      /* reset ihl bits */
++      ihl_seg[0] |= ihl_checked;
++
++      return 0;
++}
++static int32_t ip_ihl_get(lua_State *L)
++{
++      lua_packet_segment * seg = checkpacketseg(L, 1, LUA_PACKET_SEG_IP);
++      uint8_t *ihl_seg = seg->start + seg->offset;
++      uint8_t v = ihl_seg[0] & 0x0F;
++
++      lua_pushinteger(L, v);
++      return 1;
++}
++
++static int32_t ip_addr_set(lua_State *L)
++{
++      int32_t field_id = lua_tointeger(L, lua_upvalueindex(2));
++      lua_packet_segment * seg = checkpacketseg(L, 1, LUA_PACKET_SEG_IP);
++      uint8_t *addr_seg = seg->start + seg->offset;
++      uint32_t  old_addr;
++      char *ip = (char *)luaL_checkstring(L, 2);
++      uint32_t  a, b, c, d;
++      struct sk_buff * skb = (struct sk_buff *)lua_touserdata(L, 3);
++
++      /* for tcp / udp checksumming*/
++      uint32_t  prot_offset;
++      uint8_t *check, *protocol_seg;
++
++      /* end */
++
++      sscanf(ip, IP_FMT, &a, &b, &c, &d);
++
++      luaL_argcheck(L, a < 256 && b < 256 && c < 256 && d < 256, 1, "invalid ip addr");
++
++      old_addr = *((uint32_t  *)addr_seg);
++      addr_seg[0] = (uint8_t)a;
++      addr_seg[1] = (uint8_t)b;
++      addr_seg[2] = (uint8_t)c;
++      addr_seg[3] = (uint8_t)d;
++
++#if defined(__KERNEL__)
++      if (old_addr != *(uint32_t  *)addr_seg) {
++              int32_t offset = (field_id == 10) ? -2 : -6;         /* offset from saddr or daddr */
++
++              csum_replace4((uint16_t *)(addr_seg + offset), old_addr, *(uint32_t  *)addr_seg);
++
++              prot_offset = (field_id == 10) ? -3 : -7;         /* offset from saddr or daddr */
++              protocol_seg = seg->start + seg->offset + prot_offset;
++
++              if (skb && (protocol_seg[0] == 0x06 || protocol_seg[0] == 0x11)) {               /* is payload TCP or UDP ? */
++
++                      check = seg->start + seg->offset;                       /* tmp res */
++                      check += (field_id == 10) ? 8 : 16;                     /* the start of the payload, depending saddr or daddr */
++                      check += (protocol_seg[0] == 0x06) ? 16 : 6;            /* the start of the checksum, depending on TCP or UDP */
++
++                      inet_proto_csum_replace4((__sum16 *)check, skb, old_addr, *(uint32_t  *)addr_seg, 1);
++
++                      lua_pop(L, 1);
++              }
++      }
++#endif
++      return 0;
++}
++
++
++
++
++
++static int32_t ip_addr_get(lua_State *L)
++{
++      lua_packet_segment * seg = checkpacketseg(L, 1, LUA_PACKET_SEG_IP);
++      uint8_t *addr_seg = seg->start + seg->offset;
++
++      char buf[16]; /*max: 255.255.255.255\0 --> 16 chars */
++
++      sprintf(buf, IP_FMT, IP_ACC(addr_seg));
++      lua_pushstring(L, buf);
++      return 1;
++}
++
++static int32_t ip_has_protocol(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t protocol_type)
++{
++      uint8_t * embedded_protocol = seg->start + seg->offset + 9 /*bytes*/;
++
++      switch (embedded_protocol[0]) {
++      case 0x01:      /* 1: Internet Control Message Protocol (ICMP) */
++              if (protocol_type == PACKET_ICMP) return 1;
++              break;
++      case 0x02:      /* 2: Internet Group Management Protocol (IGMP) */
++              break;
++      case 0x06:      /* 6: Transmission Control Protocol (TCP) */
++              if (protocol_type == PACKET_TCP) return 1;
++              break;
++      case 0x11:      /* 17: User Datagram Protocol (UDP) */
++              if (protocol_type == PACKET_UDP) return 1;
++              break;
++      case 0x59:      /* 89: Open Shortest Path First (OSPF) */
++              break;
++      case 0x84:      /* 132: Stream Control Transmission Protocol (SCTP) */
++              break;
++      default:
++              break;
++      }
++
++      return 0;
++}
++
++static const struct protocol_field ip_protocol_fields[] = {
++      /*       field name    offset  length  getter  setter  */
++      { "version",  0,                   4,              ip_version_get,                 ip_version_set               },
++      { "ihl",      4,                   4,              ip_ihl_get,                     ip_ihl_set                   },
++      { "tos",      8,                   8,              get_8_bit_generic,              set_8_bit_generic            },
++      { "tot_len",  16,                  16,             get_16_bit_generic,             set_16_bit_generic           },
++      { "id",       32,                  16,             get_16_bit_generic,             set_16_bit_generic           },
++      { "flags",    48,                  3,              get_1_bit_generic,              set_1_bit_generic            },
++      { "frag_off", 51,                  13,             NULL,                           NULL                         },
++      { "ttl",      64,                  8,              get_8_bit_generic,              set_8_bit_generic            },
++      { "protocol", 72,                  8,              get_8_bit_generic,              set_8_bit_generic            },
++      { "check",    80,                  16,             get_16_bit_generic,             set_16_bit_generic           },
++      { "saddr",    96,                  32,             ip_addr_get,                    ip_addr_set                  },
++      { "daddr",    128,                 32,             ip_addr_get,                    ip_addr_set                  },
++      { "data",     160,                 0,              NULL,                           set_data_generic             },
++      PROT_FIELD_SENTINEL,
++};
++
++static const struct protocol_buf ip_protocol_buf = {
++      .is_dynamic                     = 0,
++      .name                           = LUA_PACKET_SEG_IP,
++      .payload_field                  = "data",
++      .protocol_fields                = (struct protocol_field *)&ip_protocol_fields,
++      .has_protocol                   = &ip_has_protocol,
++      .get_field_changes              = NULL,
++};
++
++void luaopen_protbuf_ip(lua_State *L)
++{
++      register_protbuf(L, (struct protocol_buf *)&ip_protocol_buf, PACKET_IP);
++}
++
+--- /dev/null
++++ b/extensions/LUA/prot_buf_raw.c
+@@ -0,0 +1,43 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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 "controller.h"
++static int32_t raw_has_protocol(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t protocol_type)
++{
++      return 1;
++}
++
++static const struct protocol_field raw_protocol_fields[] = {
++      /*       field name    offset  length  getter  setter  */
++      { "data", 0,                0,              NULL,              NULL      },
++      PROT_FIELD_SENTINEL,
++};
++
++static const struct protocol_buf raw_protocol_buf = {
++      .is_dynamic                     = 0,
++      .name                           = LUA_PACKET_SEG_RAW,
++      .payload_field                  = "data",
++      .protocol_fields                = (struct protocol_field *)&raw_protocol_fields,
++      .has_protocol                   = &raw_has_protocol,
++      .get_field_changes              = NULL,
++};
++
++void luaopen_protbuf_raw(lua_State *L)
++{
++      register_protbuf(L, (struct protocol_buf *)&raw_protocol_buf, PACKET_RAW);
++}
+--- /dev/null
++++ b/extensions/LUA/prot_buf_tcp.c
+@@ -0,0 +1,188 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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/>.
++ */
++
++#if defined(__KERNEL__)
++      #include <net/checksum.h>
++      #include <net/tcp.h>
++#endif
++#include "controller.h"
++
++
++static int32_t tcp_has_protocol(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t protocol_type)
++{
++      return 1;
++}
++
++static int32_t tcp_set_checksum(lua_State *L)
++{
++      struct protocol_buf * prot_buf = (struct protocol_buf *)lua_topointer(L, lua_upvalueindex(1));
++      lua_packet_segment * seg = checkpacketseg(L, 1, prot_buf->name);
++
++#if defined(__KERNEL__)
++      uint8_t * check_seg = seg->start + seg->offset;
++      uint8_t * tcp_hdr = check_seg - 16;
++      uint8_t * saddr = tcp_hdr - 8;
++      uint8_t * daddr = saddr + 4;
++      uint32_t  len = 20 + (seg->changes->field_length_changes[11] / 8) + (seg->changes->field_length_changes[10] / 8);
++      unsigned short checksum = tcp_v4_check(len, *(uint32_t  *)saddr, *(uint32_t  *)daddr,
++                                             csum_partial(tcp_hdr, len, 0));
++
++      memcpy(check_seg, &checksum, sizeof(unsigned short));
++#endif
++      return 0;
++}
++
++
++static const struct protocol_field tcp_protocol_fields[] = {
++      /*       field name    offset  length  getter  setter  */
++      { "sport",       0,                          16,              get_16_bit_generic,                   set_16_bit_generic             },
++      { "dport",       16,                         16,              get_16_bit_generic,                   set_16_bit_generic             },
++      { "seq",         32,                         32,              get_32_bit_generic,                   set_32_bit_generic             },
++      { "ack",         64,                         32,              get_32_bit_generic,                   set_32_bit_generic             },
++      { "data_off",    96,                         4,               get_lower_4_bit_generic,              set_lower_4_bit_generic        },
++      { "reserved",    100,                        4,               get_upper_4_bit_generic,              set_upper_4_bit_generic        },
++      { "flags",       104,                        8,               get_1_bit_generic,                    set_1_bit_generic              },
++      { "window_size", 112,                        16,              get_16_bit_generic,                   set_16_bit_generic             },
++      { "check",       128,                        16,              get_16_bit_generic,                   tcp_set_checksum               },
++      { "urgent",      144,                        16,              NULL,                                 NULL                           },
++      { "options",     160,                        0,               NULL,                                 set_data_generic               },
++      { "data",        160,                        0,               NULL,                                 set_data_generic               }, /* begin of data depends on options */
++      PROT_FIELD_SENTINEL,
++};
++
++
++static const struct protocol_field tcp_options_and_data[] = {
++      /*       field name    offset  length  getter  setter  */
++      { "MSS",   0,                          16,              get_16_bit_generic,             set_16_bit_generic           },
++      { "WS",    0,                          8,               get_8_bit_generic,              set_8_bit_generic            },
++      { "SACK",  0,                          16,              get_16_bit_generic,             set_16_bit_generic           },
++      { "TSVAL", 0,                          32,              get_32_bit_generic,             set_32_bit_generic           },
++      { "TSER",  0,                          32,              get_32_bit_generic,             set_32_bit_generic           },
++      PROT_FIELD_SENTINEL,
++};
++
++
++static struct field_changes * tcp_get_field_changes(lua_State *L, lua_packet_segment * seg);
++
++static const struct protocol_buf tcp_protocol_buf = {
++      .is_dynamic                     = 0,
++      .name                           = LUA_PACKET_SEG_TCP,
++      .payload_field                  = "data",
++      .protocol_fields                = (struct protocol_field *)&tcp_protocol_fields,
++      .has_protocol                   = &tcp_has_protocol,
++      .get_field_changes              = &tcp_get_field_changes,
++};
++
++
++static struct field_changes * tcp_options_get_field_changes(lua_State *L, lua_packet_segment * seg);
++
++static const struct protocol_buf tcp_options_and_data_buf = {
++      .is_dynamic                     = 0,
++      .name                           = LUA_PACKET_SEG_TCP_OPT,
++      .payload_field                  = NULL,
++      .protocol_fields                = (struct protocol_field *)&tcp_options_and_data,
++      .has_protocol                   = NULL,
++      .get_field_changes              = &tcp_options_get_field_changes,
++};
++
++struct field_changes * tcp_get_field_changes(lua_State *L, lua_packet_segment * seg)
++{
++      /* depending on the value stored inside the 'data_off'-field, the length of
++       * the 'options' field has to be changed, as well as the length and offset
++       * of the 'data' field */
++      uint8_t *tcp_hdr = seg->start + seg->offset;
++
++      /* get the pointer to the 'data_off' field */
++      uint8_t * data_off_field = tcp_hdr + 12; /* 12 bytes offset */
++      /* extract the stored header length in bits */
++      uint32_t  tcp_hdr_len = ((*(uint8_t *)data_off_field) >> 4) * 32;
++
++      /* get an allocated 'field_changes' structure */
++      struct field_changes * changes = get_allocated_field_changes(L, 12);
++
++      /* depending on the tcp header length, change the length of the options*/
++      changes->field_length_changes[10] = tcp_hdr_len - 160;
++      /* depending on the options length, change the offset of the data */
++      changes->field_offset_changes[11] = changes->field_length_changes[10];
++      changes->field_length_changes[11] = (seg->length * 8) - tcp_hdr_len;
++
++      return changes;
++
++}
++
++struct field_changes * tcp_options_get_field_changes(lua_State *L, lua_packet_segment * seg)
++{
++      /* depending on the value stored inside the 'data_off'-field, the length of
++       * the 'options' field has to be changed, as well as the length and offset
++       * of the 'data' field */
++      uint8_t *tcp_opt_hdr = seg->start + seg->offset;
++
++      /* get an allocated 'field_changes' structure */
++      struct field_changes * changes = get_allocated_field_changes(L, 5);
++
++      int32_t MSS = 0, WS = 0, SACK = 0, TS = 0, i;
++
++      uint8_t b1, b2;
++
++      for (i = 0; i < seg->length; i++) {
++              b1 = tcp_opt_hdr[i];
++              b2 = tcp_opt_hdr[i + 1];
++
++              if (b1 == 0x00)
++                      break;
++
++              /* test for MSS */
++              if (!MSS && (b1 == 0x02 && b2 == 0x04)) {
++                      changes->field_offset_changes[0] = (i + 2) * CHAR_BIT;
++                      MSS = 1;
++              }
++
++              /* test for WS --- yet buggy somehow */
++              if (!WS && (b1 == 0x03 && b2 == 0x03)) {
++                      changes->field_offset_changes[1] = (i + 2) * CHAR_BIT;
++                      WS = 1;
++              }
++
++              /* test for SACK*/
++              if (!SACK && (b1 == 0x04 && b2 == 0x02)) {
++                      changes->field_offset_changes[2] = i * CHAR_BIT;        /* has no value */
++                      SACK = 1;
++              }
++
++              /* test for TS */
++              if (!TS && (b1 == 0x08 && b2 == 0x0A)) {
++                      changes->field_offset_changes[3] = (i + 2) * CHAR_BIT;
++                      changes->field_offset_changes[4] = (i + 2 + 4) * CHAR_BIT;
++                      TS = 1;
++              }
++      }
++
++      return changes;
++
++}
++
++void luaopen_protbuf_tcp(lua_State *L)
++{
++      register_protbuf(L, (struct protocol_buf *)&tcp_protocol_buf, PACKET_TCP);
++}
++void luaopen_protbuf_tcp_options(lua_State *L)
++{
++      register_protbuf(L, (struct protocol_buf *)&tcp_options_and_data_buf, PACKET_TCP_OPTIONS);
++}
++
++
+--- /dev/null
++++ b/extensions/LUA/prot_buf_tftp.c
+@@ -0,0 +1,87 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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 "controller.h"
++
++static const struct protocol_field tftp_protocol_fields[] = {
++      /*       field name    offset  length  getter  setter  */
++      { "opcode",             0,              16,             get_16_bit_generic,     NULL},
++      { "filename",           0,              0,              get_string_generic,     NULL},
++      { "mode",                       0,              0,              get_string_generic, NULL},
++      { "block_nr",           0,              16,             get_16_bit_generic, NULL},
++      { "data",                       0,              0,              NULL, NULL},
++      PROT_FIELD_SENTINEL,
++};
++
++struct field_changes * tftp_get_field_changes(lua_State *L, lua_packet_segment * seg)
++{
++      /* depending on the value stored inside the 'opcode'-field we have to change
++       * offsets and lengths */
++      uint8_t *tftp_hdr = seg->start + seg->offset;
++      short opcode = ntohs(*((uint16_t *)tftp_hdr));
++      /* get an allocated 'field_changes' structure */
++      struct field_changes * changes = get_allocated_field_changes(L, 5);
++      switch (opcode) {
++              case 1: /* Read Request (RRQ) */
++                      /* setting offset and length of field 'filename' */
++                      changes->field_offset_changes[1] = sizeof(unsigned short) << 3;
++                      changes->field_length_changes[1] = strlen((char *)tftp_hdr + sizeof(unsigned short)) << 3;
++                      /* setting offset and length of field 'mode' */
++                      changes->field_offset_changes[2] = changes->field_offset_changes[1] + changes->field_length_changes[1];
++                      changes->field_length_changes[2] = strlen((char *)tftp_hdr + (changes->field_offset_changes[2] >> 3));
++                      break;
++              case 2: /* Write Request (WRQ) */
++                      /* setting offset and length of field 'filename' */
++                      changes->field_offset_changes[1] = sizeof(unsigned short) << 3;
++                      changes->field_length_changes[1] = strlen((char *)tftp_hdr + sizeof(unsigned short)) << 3;
++                      /* setting offset and length of field 'mode' */
++                      changes->field_offset_changes[2] = changes->field_offset_changes[1] + changes->field_length_changes[1];
++                      changes->field_length_changes[2] = strlen((char *)tftp_hdr + (changes->field_offset_changes[2] >> 3));
++                      break;
++              case 3: /* Data (DATA) */
++                      /* setting offset of field 'block_nr' */
++                      changes->field_offset_changes[3] = sizeof(unsigned short) << 3;
++                      /* setting offset of field 'data' */
++                      changes->field_offset_changes[4] = changes->field_offset_changes[3] + (sizeof(unsigned short) << 3);
++                      break;
++              case 4: /* Acknowledgment (ACK) */
++                      /* setting offset of field 'block_nr' */
++                      changes->field_offset_changes[3] = sizeof(unsigned short) << 3;
++                      break;
++              case 5: /* Error (ERROR) */
++                      /* we don't care ... yet */
++                      break;
++              default:
++                      break;
++      }
++
++      return changes;
++}
++
++static const struct protocol_buf tftp_protocol_buf = {
++      .is_dynamic                     = 0,
++      .name                           = LUA_PACKET_SEG_TFTP,
++      .payload_field          = NULL,
++      .protocol_fields        = (struct protocol_field *)&tftp_protocol_fields,
++      .has_protocol           = NULL, /* we don't need it, since we don't provide a payload field */
++      .get_field_changes      = tftp_get_field_changes,
++};
++
++void luaopen_protbuf_tftp(lua_State *L)
++{
++      register_protbuf(L, (struct protocol_buf *)&tftp_protocol_buf, PACKET_TFTP);
++}
+--- /dev/null
++++ b/extensions/LUA/prot_buf_udp.c
+@@ -0,0 +1,53 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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/>.
++ */
++
++#if defined(__KERNEL__)
++      #include <net/checksum.h>
++#endif
++
++#include "controller.h"
++
++
++static int32_t udp_has_protocol(lua_State *L, struct protocol_buf * prot_buf, lua_packet_segment * seg, int32_t protocol_type)
++{
++      return 1;
++}
++
++static const struct protocol_field udp_protocol_fields[] = {
++      /*       field name    offset  length  getter  setter  */
++      { "sport",  0,                         16,              get_16_bit_generic,             set_16_bit_generic      },
++      { "dport",  16,                        16,              get_16_bit_generic,             set_16_bit_generic      },
++      { "length", 32,                        16,              get_16_bit_generic,             set_16_bit_generic      },
++      { "check",  48,                        16,              get_16_bit_generic,             set_16_bit_generic      },
++      { "data",   64,                        0,               NULL,                     NULL              },
++      PROT_FIELD_SENTINEL,
++};
++
++static const struct protocol_buf udp_protocol_buf = {
++      .is_dynamic                     = 0,
++      .name                           = LUA_PACKET_SEG_UDP,
++      .payload_field                  = "data",
++      .protocol_fields                = (struct protocol_field *)&udp_protocol_fields,
++      .has_protocol                   = &udp_has_protocol,
++      .get_field_changes              = NULL,
++};
++
++void luaopen_protbuf_udp(lua_State *L)
++{
++      register_protbuf(L, (struct protocol_buf *)&udp_protocol_buf, PACKET_UDP);
++}
+--- /dev/null
++++ b/extensions/LUA/xt_LUA.h
+@@ -0,0 +1,36 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre.graf@stud.unibas.ch>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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/>.
++ */
++
++#ifndef XT_LUA_H_
++#define XT_LUA_H_
++
++#define MAX_FILENAME_SIZE  256
++#define MAX_FUNCTION_SIZE  256
++#define MAX_SCRIPT_SIZE 32768
++#define LUA_STATE_ARRAY_SIZE 128
++
++/* the targetsize is stored in a u16, so max size of the xt_lua_tginfo cannot exceed 64K*/
++struct xt_lua_tginfo {
++      char buf[MAX_SCRIPT_SIZE];
++      char filename[MAX_FILENAME_SIZE];
++      char function[MAX_FUNCTION_SIZE];
++      __u64 script_size;
++      __u32 state_id;
++};
++
++#endif /* XT_LUA_H_ */
+--- /dev/null
++++ b/extensions/LUA/xt_LUA_target.c
+@@ -0,0 +1,286 @@
++/*
++ *    Copyright (C) 2010 University of Basel <http://cn.cs.unibas.ch/>
++ *    by Andre Graf <andre@dergraf.org>
++ *
++ *    This program is free software; you can redistribute it and/or modify
++ *    it under the terms of the GNU General Public License as published by
++ *    the Free Software Foundation; either version 2 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 <linux/kernel.h>
++#include <linux/slab.h>
++#include <linux/module.h>
++#include <asm/uaccess.h>
++#include <net/ip.h>
++#include <linux/netfilter/x_tables.h>
++#include "xt_LUA.h"
++
++#include "controller.h"
++
++/*::*
++ * lua_envs
++ * ----------
++ * This array holds a defined number of `lua_envs`_ structures.
++ * The used array index is also used as the Lua state identifier.
++ * The size of the array is defined in `LUA_STATE_ARRAY_SIZE`_.
++ */
++struct lua_env * lua_envs[LUA_STATE_ARRAY_SIZE];
++
++/*::*
++ * lua_state_refs
++ * --------------
++ * This array holds the reference counts of the several `lua_nf_state`_s
++ * which are stored inside the array `lua_states`_.
++ */
++uint32_t  lua_state_refs[LUA_STATE_ARRAY_SIZE] = { 0 };
++
++/*::*
++ * lua_tg
++ * ------
++ * This function is called whenever a packet matches all matching conditions
++ * inside a rule. It is the target. It extracts the state identifier comming
++ * inside the *xt_target_param* structure and uses it to access the proper
++ * Lua state inside the `lua_states`_ array.
++ *
++ * It then constructs a new Lua userdata of type *lua_packet_segment* and
++ * initializes it with the lowest network header available. This userdata
++ * is annotated with the Lua metatable `LUA_PACKET_SEG_RAW`_ which converts
++ * the userdata to a raw lua packet having all raw functions available.
++ * This raw packet is the single parameter to the Lua function *process_packet*
++ * which must be defined inside the Lua script provided by the user. So far
++ * hardcoded, may be later configured by Lua - subject to change.
++ *
++ * The process_packet function must return an integer value, the verdict. For
++ * convenience reasons xt_LUA exports the verdicts NF_ACCEPT, NF_DROP and
++ * XT_CONTINUE inside the *register_lua_packet_lib* function.
++ */
++
++spinlock_t lock = SPIN_LOCK_UNLOCKED;
++
++static uint32_t 
++lua_tg(struct sk_buff *pskb, const struct xt_target_param *par)
++{
++      uint32_t  verdict;
++      lua_packet_segment *p;
++      const struct xt_lua_tginfo *info = par->targinfo;
++      lua_State * L;
++
++      /* START critical section on SMP, PacketScript is on the sequential trail at the moment TODO*/
++      spin_lock_irq(&lock);
++
++      L = lua_envs[info->state_id]->L;
++
++      if (!skb_make_writable(pskb, pskb->len))
++              return NF_DROP;
++
++      /* call the function provided by --function parameter or the default 'process_packet' defined in Lua */
++      lua_getglobal(L, info->function);
++
++      /* push the lua_packet_segment as a parameter */
++      p = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment));
++      if (pskb->mac_header)
++              p->start = pskb->mac_header;
++      else if (pskb->network_header)
++              p->start = pskb->network_header;
++      else if (pskb->transport_header)
++              p->start = pskb->transport_header;
++      p->offset = 0;
++      p->length = (unsigned long)pskb->tail - (unsigned long)p->start;
++      p->changes = NULL;
++
++      /* marking userdata 'lua_packet_seg' with the corresponding metatable */
++      luaL_getmetatable(L, LUA_PACKET_SEG_RAW);
++      lua_setmetatable(L, -2);
++
++      /* push a reference to the skb as a parameter, needed at the moment for calculating TCP checksum, but I am not happy with it*/
++      lua_pushlightuserdata(L, (void *)skb_get(pskb));
++
++      /* do the function call (2 argument, 1 result) */
++      if (lua_pcall(L, 2, 1, 0) != 0) {
++              printk(KERN_ERR "LUA [%d]: pcall '%s' failed: %s\n", info->state_id, info->function, lua_tostring(L, -1));
++              lua_pop(L, 1);
++              return NF_DROP;
++      }
++
++      if (!lua_isnumber(L, -1)) {
++              printk(KERN_ERR "LUA [%d]: function '%s' must return a verdict\n", info->state_id, info->function);
++              lua_pop(L, 1);
++              return NF_DROP;
++      }
++
++      verdict = lua_tonumber(L, -1);
++      lua_pop(L, 1);
++
++      kfree_skb(pskb);
++
++      /* END critical section on SMP */
++      spin_unlock_irq(&lock);
++
++
++      return verdict;
++
++} 
++/* Helper for checkentry */
++static bool load_script_into_state(uint32_t  state_id, unsigned long script_size, char *script_buf)
++{
++      char *buf = kmalloc(script_size, GFP_KERNEL);
++      int32_t ret;
++      struct lua_env * env = kmalloc(sizeof(struct lua_env), GFP_KERNEL);
++
++      if (!script_size > 0) {
++              pr_debug("LUA [%d]: script_size %lu < 0\n", state_id, script_size);
++              return false;
++      }
++
++      env->L = lua_open();
++      luaopen_base(env->L);
++      luaopen_controller(env->L);
++
++      lua_getglobal(env->L, "_G");
++      lua_pushinteger(env->L, state_id);
++      lua_setfield(env->L, -2, "STATE_ID");
++      lua_pop(env->L, 1); /* pop _G */
++
++      strncpy(buf, script_buf, script_size);
++      ret = luaL_loadbuffer(env->L, buf, script_size, "PacketScript, loadbuffer") ||
++            lua_pcall(env->L, 0, 1, 0);
++
++      if (ret != 0) {
++              printk(KERN_ERR "LUA [%d]: failure loading script, error %s \n", state_id, lua_tostring(env->L, -1));
++              lua_pop(env->L, 1);
++              kfree(buf);
++              kfree(env);
++              return false;
++      }
++
++      lua_envs[state_id] = env;
++
++      kfree(buf);
++
++      return true;
++}
++/*::*
++ * lua_tg_checkentry
++ * -----------------
++ * This function is used as a kernel-side sanity check of the data comming
++ * from the iptables userspace program. Since this is the function which is
++ * called everytime a new rule (with -j xt_LUA) is injected, this function
++ * is used to do the bookkeeping work, such as counting the reference of
++ * several Lua states and the initialization of new states if needed. As an
++ * extra initialization step it loads the provided Lua script into the Lua
++ * state.
++ *
++ * Lua state initialization
++ * ~~~~~~~~~~~~~~~~~~~~~~~~
++ * 1. If a new rule is inserted and there is no existing state for the given
++ *    state identifier (default state identifier is 0) a new Lua state is
++ *    initialized using *lua_open*.
++ * 2. The Lua base library is registered inside the newly initialized state.
++ *    Have a look at *lua/lbaselib.c* to see what functions of the Lua base
++ *    library are available inside Lua.
++ * 3. The Lua packet library is registered inside the Lua state using the
++ *    function *register_lua_packet_lib*. So far this function only registers
++ *    the Netfilter verdicts NF_ACCEPT, NF_DROP and XT_CONTINUE inside the
++ *    global environment of the given Lua state.
++ * 4. All the protocol Buffers, and the functions for accessing the bytes are
++ *    registered using *register_protocols*.
++ *
++ * Lua state reference counting
++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++ * Bookkeeping of the Lua states inside the *lua_state_refs* array. The
++ * state identifier is mapped to the array index, which holds an integer
++ * counting the several initialized states.
++ *
++ * Loading the Lua script
++ * ~~~~~~~~~~~~~~~~~~~~~~
++ * Copying the buffer which was initialized by the userspace program to a
++ * buffer with the proper size. The script is then loaded by the function
++ * xt_LUA_loadcode, which wrapps the *luaL_loadbuffer* function and does
++ * some workqueue initialization. So far this is done each time this function
++ * is called, subject to change.
++ */
++static bool
++lua_tg_checkentry(const struct xt_tgchk_param *par)
++{
++      const struct xt_lua_tginfo *info = par->targinfo;
++
++      if (load_script_into_state(info->state_id, info->script_size, (char *)info->buf)) {
++              lua_state_refs[info->state_id]++;
++              return true;
++      }
++      return false;
++}
++
++/*::*
++ * lua_tg_destroy
++ * --------------
++ * This function is the counterpart of the `lua_tg_checkentry`_ function. It is
++ * responsible to free all the resources alocated inside the checkentry process.
++ * To be more specific it frees the Lua state using *lua_close* and kfree on all
++ * the dynamically allocated pointers to the registered dynamic protocol buffers.
++ *
++ * Additionally the function cares about decrementing the reference counters
++ * inside the array `lua_states`_.
++ */
++static void
++lua_tg_destroy(const struct xt_tgdtor_param *par)
++{
++      const struct xt_lua_tginfo *info = par->targinfo;
++      struct lua_env * env = lua_envs[info->state_id];
++
++      if (lua_state_refs[info->state_id] == 1) {
++              lua_close(env->L);
++              cleanup_dynamic_prot_bufs();  /* clean memory allocated by protocols defined in Lua */
++              kfree(env);
++              pr_debug("LUA [%d]: Rule removed, close Lua state\n", info->state_id);
++      } else
++              pr_debug("LUA [%d]: Rule removed, Lua state stays open, referenced %d time(s)\n",
++                       info->state_id, lua_state_refs[info->state_id] - 1);
++      
++      lua_state_refs[info->state_id]--;
++}
++
++static struct xt_target lua_tg_reg __read_mostly = {
++      .name                   = "LUA",
++      .revision               = 0,
++      .family                 = NFPROTO_UNSPEC,
++      .targetsize             = XT_ALIGN(sizeof(struct xt_lua_tginfo)),
++      .target                 = lua_tg,
++      .checkentry             = lua_tg_checkentry,
++      .destroy                = lua_tg_destroy,
++      .me                     = THIS_MODULE,
++};
++
++
++static int32_t lua_tg_init(void)
++{
++      return xt_register_target(&lua_tg_reg);
++}
++
++static void lua_tg_exit(void)
++{
++      xt_unregister_target(&lua_tg_reg);
++}
++
++module_init(lua_tg_init);
++module_exit(lua_tg_exit);
++
++MODULE_AUTHOR("Andre Graf <andre@dergraf.org>");
++MODULE_DESCRIPTION("Xtables: Processing of matched packets using the Lua scripting environment");
++MODULE_ALIAS("ipt_LUA");
++MODULE_ALIAS("ipt6t_LUA");
++MODULE_ALIAS("arpt_LUA");
++MODULE_ALIAS("ebt_LUA");
++MODULE_LICENSE("GPL");
++
++
++
+--- a/extensions/Kbuild
++++ b/extensions/Kbuild
+@@ -27,6 +27,7 @@ obj-${build_pknock}      += pknock/
+ obj-${build_psd}         += xt_psd.o
+ obj-${build_quota2}      += xt_quota2.o
+ obj-${build_rtsp}        += rtsp/
++obj-${build_LUA}         += LUA/
+ -include ${M}/*.Kbuild
+ -include ${M}/Kbuild.*
+--- a/extensions/Mbuild
++++ b/extensions/Mbuild
+@@ -22,3 +22,4 @@ obj-${build_pknock}      += pknock/
+ obj-${build_psd}         += libxt_psd.so
+ obj-${build_quota2}      += libxt_quota2.so
+ obj-${build_gradm}       += libxt_gradm.so
++obj-${build_LUA}         += LUA/
+--- a/mconfig
++++ b/mconfig
+@@ -23,3 +23,4 @@ build_pknock=m
+ build_psd=m
+ build_quota2=m
+ build_rtsp=m
++build_LUA=m
diff --git a/net/xtables-addons/patches/201-fix-lua-packetscript.patch b/net/xtables-addons/patches/201-fix-lua-packetscript.patch
new file mode 100644 (file)
index 0000000..a9fb796
--- /dev/null
@@ -0,0 +1,127 @@
+--- a/extensions/LUA/xt_LUA_target.c
++++ b/extensions/LUA/xt_LUA_target.c
+@@ -19,7 +19,7 @@
+ #include <linux/kernel.h>
+ #include <linux/slab.h>
+ #include <linux/module.h>
+-#include <asm/uaccess.h>
++#include <linux/uaccess.h>
+ #include <net/ip.h>
+ #include <linux/netfilter/x_tables.h>
+ #include "xt_LUA.h"
+@@ -64,10 +64,10 @@ uint32_t  lua_state_refs[LUA_STATE_ARRAY
+  * XT_CONTINUE inside the *register_lua_packet_lib* function.
+  */
+-spinlock_t lock = SPIN_LOCK_UNLOCKED;
++DEFINE_SPINLOCK(lock);
+ static uint32_t 
+-lua_tg(struct sk_buff *pskb, const struct xt_target_param *par)
++lua_tg(struct sk_buff *pskb, const struct xt_action_param *par)
+ {
+       uint32_t  verdict;
+       lua_packet_segment *p;
+@@ -88,11 +88,11 @@ lua_tg(struct sk_buff *pskb, const struc
+       /* push the lua_packet_segment as a parameter */
+       p = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment));
+       if (pskb->mac_header)
+-              p->start = pskb->mac_header;
++              p->start = skb_mac_header(pskb);
+       else if (pskb->network_header)
+-              p->start = pskb->network_header;
++              p->start = skb_network_header(pskb);
+       else if (pskb->transport_header)
+-              p->start = pskb->transport_header;
++              p->start = skb_transport_header(pskb);
+       p->offset = 0;
+       p->length = (unsigned long)pskb->tail - (unsigned long)p->start;
+       p->changes = NULL;
+@@ -208,16 +208,16 @@ static bool load_script_into_state(uint3
+  * some workqueue initialization. So far this is done each time this function
+  * is called, subject to change.
+  */
+-static bool
++static int
+ lua_tg_checkentry(const struct xt_tgchk_param *par)
+ {
+       const struct xt_lua_tginfo *info = par->targinfo;
+       if (load_script_into_state(info->state_id, info->script_size, (char *)info->buf)) {
+               lua_state_refs[info->state_id]++;
+-              return true;
++              return 0;
+       }
+-      return false;
++      return -EINVAL;
+ }
+ /*::*
+--- a/extensions/LUA/lua/llimits.h
++++ b/extensions/LUA/lua/llimits.h
+@@ -8,7 +8,6 @@
+ #define llimits_h
+ #include <stddef.h>
+-#include <limits.h>
+ #include "lua.h"
+--- a/extensions/LUA/lua/lapi.c
++++ b/extensions/LUA/lua/lapi.c
+@@ -4,9 +4,6 @@
+ ** See Copyright Notice in lua.h
+ */
+-#include <stdarg.h>
+-#include <math.h>
+-#include <assert.h>
+ #include <string.h>
+ #define lapi_c
+--- a/extensions/LUA/lua/ltable.c
++++ b/extensions/LUA/lua/ltable.c
+@@ -18,7 +18,6 @@
+ ** Hence even when the load factor reaches 100%, performance remains good.
+ */
+-#include <math.h>
+ #include <string.h>
+ #define ltable_c
+--- a/extensions/LUA/lua/luaconf.h
++++ b/extensions/LUA/lua/luaconf.h
+@@ -13,8 +13,12 @@
+ #if !defined(__KERNEL__)
+ #include <limits.h>
+ #else
++#include <linux/kernel.h>
++
++#undef UCHAR_MAX
++#undef BUFSIZ
++#undef NO_FPU
+ #define UCHAR_MAX     255
+-#define SHRT_MAX        32767
+ #define BUFSIZ                8192
+ #define NO_FPU
+ #endif
+@@ -637,6 +641,8 @@ union luai_Cast { double l_d; long l_l;
+ */
+ #if defined(__KERNEL__)
+ #undef LUA_USE_ULONGJMP
++#define setjmp __builtin_setjmp
++#define longjmp __builtin_longjmp
+ #endif
+ #if defined(__cplusplus)
+--- a/extensions/LUA/lua/llex.h
++++ b/extensions/LUA/lua/llex.h
+@@ -10,6 +10,8 @@
+ #include "lobject.h"
+ #include "lzio.h"
++/* prevent conflict with definition from asm/current.h */
++#undef current
+ #define FIRST_RESERVED        257
diff --git a/net/xtables-addons/patches/300-geoip-endian-detection.patch b/net/xtables-addons/patches/300-geoip-endian-detection.patch
new file mode 100644 (file)
index 0000000..842e7af
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/extensions/libxt_geoip.c
++++ b/extensions/libxt_geoip.c
+@@ -59,13 +59,13 @@ geoip_get_subnets(const char *code, uint
+       /* Use simple integer vector files */
+       if (nfproto == NFPROTO_IPV6) {
+-#if __BYTE_ORDER == _BIG_ENDIAN
++#if BYTE_ORDER == BIG_ENDIAN
+               snprintf(buf, sizeof(buf), GEOIP_DB_DIR "/BE/%s.iv6", code);
+ #else
+               snprintf(buf, sizeof(buf), GEOIP_DB_DIR "/LE/%s.iv6", code);
+ #endif
+       } else {
+-#if __BYTE_ORDER == _BIG_ENDIAN
++#if BYTE_ORDER == BIG_ENDIAN
+               snprintf(buf, sizeof(buf), GEOIP_DB_DIR "/BE/%s.iv4", code);
+ #else
+               snprintf(buf, sizeof(buf), GEOIP_DB_DIR "/LE/%s.iv4", code);
index e78a7d693492f6fc97dfab7e4d3bc92ee5c7bcf9..c7800846492a90c288dd7c4c2b71b31aff8aae77 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2016 OpenWrt.org
+# Copyright (C) 2016-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,17 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=yaaw
-PKG_VERSION:=2016-05-28
+PKG_VERSION:=2017-04-11
 PKG_RELEASE:=1
-PKG_MAINTAINER:=Hsing-Wang Liao <kuoruan@gmail.com>
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/binux/yaaw.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=c28cde2252b707fe0661693f78c5e5e3beee09a1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE_VERSION:=d3a8346c5b9c2c1875dc79e1db2533b584fc8def
 
 PKG_LICENSE:=LGPL-3.0
+PKG_MAINTAINER:=Hsing-Wang Liao <kuoruan@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -41,11 +39,12 @@ endef
 
 define Package/yaaw/install
        $(INSTALL_DIR) $(1)/www/yaaw
-       $(CP) $(PKG_BUILD_DIR)/js $(1)/www/yaaw
-       $(CP) $(PKG_BUILD_DIR)/img $(1)/www/yaaw
-       $(CP) $(PKG_BUILD_DIR)/css $(1)/www/yaaw
-       $(CP) $(PKG_BUILD_DIR)/index.html $(1)/www/yaaw
-       $(CP) $(PKG_BUILD_DIR)/offline.appcache $(1)/www/yaaw
+       $(CP) \
+               $(PKG_BUILD_DIR)/{css,img,js} \
+               $(1)/www/yaaw
+       $(CP) \
+               $(PKG_BUILD_DIR)/{index.html,offline.appcache} \
+               $(1)/www/yaaw
 endef
 
 $(eval $(call BuildPackage,yaaw))
index dd6f2caab14965e34d708987e023d7c3f0cc4d50..e08ec7570abbe27cacfbdcdb4c10d6d94249edf2 100644 (file)
@@ -6,16 +6,6 @@ config ZEROTIER_ENABLE_DEBUG
        depends on PACKAGE_zerotier
        default n
 
-config ZEROTIER_USE_MINIUPNPC
-       bool "Build with MiniUPnPc"
-       depends on PACKAGE_zerotier
-       default n
-
-config ZEROTIER_ENABLE_NETWORK_CONTROLLER
-       bool "Build with network controller"
-       depends on PACKAGE_zerotier
-       default n
-
 config ZEROTIER_ENABLE_SELFTEST
        bool "Build a self test program"
        depends on PACKAGE_zerotier
index f838ffc061d0bfe6d5fc0238a6b51967a5233b26..4731e0b4dc37ec11b3901f3c7383f82ec6895607 100644 (file)
@@ -6,27 +6,26 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zerotier
-PKG_VERSION:=1.1.14
-PKG_RELEASE:=4
+PKG_VERSION:=1.2.4
+PKG_RELEASE:=3
 
 PKG_LICENSE:=GPL-3.0
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/zerotier/ZeroTierOne
 PKG_SOURCE_SUBDIR:=ZeroTierOne-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=ae491c277e6f35d1acbdcbf700e2b834957295ae
+PKG_SOURCE_VERSION:=fe5257df81c4ec4b5d48f707eb794de0748b7ac0
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MIRROR_MD5SUM:=c8c3219c995a59161832d580a194f6280de7a4eef75cebece6f38400b64f003e
+PKG_MIRROR_HASH:=131436529d26f8eb975a0a8705b489cc22a1139c323755895c1776db579003bc
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 
-PKG_BUILD_DEPENDS:=uclibcxx
 PKG_BUILD_PARALLEL:=1
 include $(INCLUDE_DIR)/package.mk
 
 define Package/zerotier
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+libpthread +kmod-tun +ip +ZEROTIER_ENABLE_NETWORK_CONTROLLER:libsqlite3 +ZEROTIER_USE_MINIUPNPC:libminiupnpc +ZEROTIER_USE_MINIUPNPC:libnatpmp
+  DEPENDS:=+libpthread +libstdcpp +kmod-tun +ip +libminiupnpc +libnatpmp
   TITLE:=Create flat virtual Ethernet networks of almost unlimited size
   URL:=https://www.zerotier.com
   SUBMENU:=VPN
@@ -41,24 +40,12 @@ define Package/zerotier/config
        source "$(SOURCE)/Config.in"
 endef
 
-ifeq ($(CONFIG_ZEROTIER_ENABLE_NETWORK_CONTROLLER),y)
-MAKE_FLAGS += ZT_ENABLE_NETWORK_CONTROLLER=1
-MAKE_FLAGS += LDLIBS+=" -lsqlite3 "
-endif
-
-ifeq ($(CONFIG_ZEROTIER_USE_MINIUPNPC),y)
-MAKE_FLAGS += ZT_USE_MINIUPNPC=1
-endif
-
 ifeq ($(CONFIG_ZEROTIER_ENABLE_DEBUG),y)
-TARGET_CXXFLAGS += -DZT_TRACE -ggdb3
+MAKE_FLAGS += ZT_DEBUG=1
 endif
 
 MAKE_FLAGS += \
        DEFS="" \
-       LDFLAGS+=" -L$(STAGING_DIR)/usr/lib/uClibc++ -pthread " \
-       LDLIBS+=" -fno-builtin -nodefaultlibs -Wl,-Bstatic -luClibc++ -Wl,-Bdynamic -lpthread -lm -lc -lsupc++ -lc -lgcc -lgcc_eh -lgcc_s -lssp_nonshared " \
-       CXXFLAGS+=" -fno-builtin -nostdinc++ -I$(STAGING_DIR)/usr/include/uClibc++ -DGCC_HASCLASSVISIBILITY -Wall -fPIE -fvisibility=hidden "
 
 define Build/Compile
        $(call Build/Compile/Default,one)
@@ -71,7 +58,7 @@ define Package/zerotier/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-one $(1)/usr/bin/
        $(LN) zerotier-one $(1)/usr/bin/zerotier-cli
-       $(LN) zerotier-one $(1)/usr/bin//zerotier-idtool
+       $(LN) zerotier-one $(1)/usr/bin/zerotier-idtool
 
 ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-selftest $(1)/usr/bin/
index d9c33de27de5f36aecc4429aa4c03e601acc771a..9d49490e3bffb58850c510265160bd421a350137 100644 (file)
@@ -1,7 +1,17 @@
 
 config zerotier sample_config
-       option enabled 1
-       option interface 'wan' # restart ZT when wan status changed
+       option enabled 0
+
+       # persistent configuration folder (for ZT controller mode)
+       #option config_path '/etc/zerotier'
+
+       # restart ZT when wan status changed
+       option interface 'wan'
+
        #option port '9993'
-       option secret 'generate' # generate secret on first start
-       list join '8056c2e21c000001' # a public network called Earth
+
+       # Generate secret on first start
+       option secret 'generate'
+
+       # Join a public network called Earth
+       list join '8056c2e21c000001'
index dd183277142203385d943a99837786b0f5af8a75..13aff5bf0abda516d13a40409e54e4976c8949f6 100644 (file)
@@ -4,9 +4,8 @@ START=90
 
 USE_PROCD=1
 
-LIST_SEP="
-"
-ZT_COMMAND=/usr/bin/zerotier-one
+PROG=/usr/bin/zerotier-one
+CONFIG_PATH=/var/lib/zerotier-one
 
 section_enabled() {
        config_get_bool enabled "$1" 'enabled' 0
@@ -15,17 +14,31 @@ section_enabled() {
 
 start_instance() {
        local cfg="$1"
-       local port secret interface
+       local port secret interface config_path
        local ARGS=""
 
        section_enabled "$cfg" || return 1
 
-       mkdir -p /var/lib/zerotier-one/networks.d/
-
+       config_get config_path $cfg 'config_path'
        config_get_bool port $cfg 'port'
        config_get secret $cfg 'secret'
        config_get interface $cfg 'interface'
 
+       # Remove existing link or folder
+       rm -rf $CONFIG_PATH
+
+       # Create link from CONFIG_PATH to config_path
+       if [ -n "$config_path" -a $config_path != $CONFIG_PATH ]; then
+               if [ ! -d "$config_path" ]; then
+                       echo "ZeroTier config_path does not exist: $config_path"
+                       return
+               fi
+
+               ln -s $config_path $CONFIG_PATH
+       fi
+
+       mkdir -p $CONFIG_PATH/networks.d
+
        if [ -n "$port" ]; then
                ARGS="$ARGS -p$port"
        fi
@@ -42,22 +55,21 @@ start_instance() {
        fi
 
        if [ -n "$secret" ]; then
-               echo "$secret" > /var/lib/zerotier-one/identity.secret
-               #make sure there is not previous dentity.public
-               rm -f /var/lib/zerotier-one/identity.public
+               echo "$secret" > $CONFIG_PATH/identity.secret
+               # make sure there is not previous identity.public
+               rm -f $CONFIG_PATH/identity.public
        fi
 
        add_join() {
-               #an (empty) config file will cause ZT to join a network
-               touch /var/lib/zerotier-one/networks.d/$1.conf
+               # an (empty) config file will cause ZT to join a network
+               touch $CONFIG_PATH/networks.d/$1.conf
        }
 
        config_list_foreach $cfg 'join' add_join
 
        procd_open_instance
        procd_add_reload_interface_trigger "$interface"
-       procd_set_param command $ZT_COMMAND $ARGS
-       procd_set_param nice -10
+       procd_set_param command $PROG $ARGS $CONFIG_PATH
        procd_close_instance
 }
 
@@ -69,3 +81,15 @@ start_service() {
        config_load 'zerotier'
        config_foreach start_instance 'zerotier'
 }
+
+stop_instance() {
+       local cfg="$1"
+
+       # Remove existing link or folder
+       rm -rf $CONFIG_PATH
+}
+
+stop_service() {
+       config_load 'zerotier'
+       config_foreach stop_instance 'zerotier'
+}
diff --git a/net/zerotier/patches/0001-Fix-for-running-under-MUSL-libc-e.g.-Alpine-Linux.patch b/net/zerotier/patches/0001-Fix-for-running-under-MUSL-libc-e.g.-Alpine-Linux.patch
deleted file mode 100644 (file)
index 119491f..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-From 830250759cd4c14ca2ae5ddf24f0a0427f258622 Mon Sep 17 00:00:00 2001
-From: Adam Ierymenko <adam.ierymenko@gmail.com>
-Date: Tue, 26 Jul 2016 16:36:20 -0700
-Subject: [PATCH 1/2] Fix for running under MUSL libc (e.g. Alpine Linux)
-
----
- osdep/Thread.hpp | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/osdep/Thread.hpp b/osdep/Thread.hpp
-index 7fb38d8..4f90dc0 100644
---- a/osdep/Thread.hpp
-+++ b/osdep/Thread.hpp
-@@ -125,6 +125,10 @@ public:
-               throw()\r
-       {\r
-               memset(&_tid,0,sizeof(_tid));\r
-+              pthread_attr_init(&_tattr);\r
-+#ifdef __LINUX__\r
-+              pthread_attr_setstacksize(&_tattr,8388608); // for MUSL libc and others, has no effect in normal glibc environments\r
-+#endif\r
-               _started = false;\r
-       }\r
\r
-@@ -157,7 +161,7 @@ public:
-       {\r
-               Thread t;\r
-               t._started = true;\r
--              if (pthread_create(&t._tid,(const pthread_attr_t *)0,&___zt_threadMain<C>,instance))\r
-+              if (pthread_create(&t._tid,&t._tattr,&___zt_threadMain<C>,instance))\r
-                       throw std::runtime_error("pthread_create() failed, unable to create thread");\r
-               return t;\r
-       }\r
-@@ -184,6 +188,7 @@ public:
\r
- private:\r
-       pthread_t _tid;\r
-+      pthread_attr_t _tattr;\r
-       volatile bool _started;\r
- };\r
\r
--- 
-2.9.0
-
diff --git a/net/zerotier/patches/0001-use-external-libminiupnpc-and-libnatpmp.patch b/net/zerotier/patches/0001-use-external-libminiupnpc-and-libnatpmp.patch
new file mode 100644 (file)
index 0000000..e65d7ec
--- /dev/null
@@ -0,0 +1,47 @@
+From 61b69f74fecf3c34c0fd2003897c92790ca5a9f5 Mon Sep 17 00:00:00 2001
+From: Moritz Warning <moritzwarning@web.de>
+Date: Thu, 4 May 2017 22:13:55 +0200
+Subject: [PATCH 1/2] use external libminiupnpc and libnatpmp
+
+---
+ make-linux.mk | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/make-linux.mk b/make-linux.mk
+index 87d29af..f5b3d8d 100644
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -22,20 +22,20 @@ OBJS+=ext/http-parser/http_parser.o
+ # otherwise build into binary as done on Mac and Windows.
+ OBJS+=osdep/PortMapper.o
+ DEFS+=-DZT_USE_MINIUPNPC
+-MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' /usr/include/miniupnpc/miniupnpc.h && echo 1)
+-ifeq ($(MINIUPNPC_IS_NEW_ENOUGH),1)
++#MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' /usr/include/miniupnpc/miniupnpc.h && echo 1)
++#ifeq ($(MINIUPNPC_IS_NEW_ENOUGH),1)
+       DEFS+=-DZT_USE_SYSTEM_MINIUPNPC
+       LDLIBS+=-lminiupnpc
+-else
+-      DEFS+=-DMINIUPNP_STATICLIB -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DOS_STRING=\"Linux\" -DMINIUPNPC_VERSION_STRING=\"2.0\" -DUPNP_VERSION_STRING=\"UPnP/1.1\" -DENABLE_STRNATPMPERR
+-      OBJS+=ext/miniupnpc/connecthostport.o ext/miniupnpc/igd_desc_parse.o ext/miniupnpc/minisoap.o ext/miniupnpc/minissdpc.o ext/miniupnpc/miniupnpc.o ext/miniupnpc/miniwget.o ext/miniupnpc/minixml.o ext/miniupnpc/portlistingparse.o ext/miniupnpc/receivedata.o ext/miniupnpc/upnpcommands.o ext/miniupnpc/upnpdev.o ext/miniupnpc/upnperrors.o ext/miniupnpc/upnpreplyparse.o
+-endif
+-ifeq ($(wildcard /usr/include/natpmp.h),)
+-      OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
+-else
++#else
++#     DEFS+=-DMINIUPNP_STATICLIB -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DOS_STRING=\"Linux\" -DMINIUPNPC_VERSION_STRING=\"2.0\" -DUPNP_VERSION_STRING=\"UPnP/1.1\" -DENABLE_STRNATPMPERR
++#     OBJS+=ext/miniupnpc/connecthostport.o ext/miniupnpc/igd_desc_parse.o ext/miniupnpc/minisoap.o ext/miniupnpc/minissdpc.o ext/miniupnpc/miniupnpc.o ext/miniupnpc/miniwget.o ext/miniupnpc/minixml.o ext/miniupnpc/portlistingparse.o ext/miniupnpc/receivedata.o ext/miniupnpc/upnpcommands.o ext/miniupnpc/upnpdev.o ext/miniupnpc/upnperrors.o ext/miniupnpc/upnpreplyparse.o
++#endif
++#ifeq ($(wildcard /usr/include/natpmp.h),)
++#     OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
++#else
+       LDLIBS+=-lnatpmp
+       DEFS+=-DZT_USE_SYSTEM_NATPMP
+-endif
++#endif
+ ifeq ($(ZT_ENABLE_CLUSTER),1)
+       DEFS+=-DZT_ENABLE_CLUSTER
+-- 
+2.1.4
+
diff --git a/net/zerotier/patches/0002-fix-build.patch b/net/zerotier/patches/0002-fix-build.patch
deleted file mode 100644 (file)
index 34088c8..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-From 333bbabc6dfad0553fb63d560ab6442a50cc9e52 Mon Sep 17 00:00:00 2001
-From: Moritz Warning <moritzwarning@web.de>
-Date: Fri, 22 Jul 2016 23:27:31 +0200
-Subject: [PATCH 2/2] fix build
-
----
- make-linux.mk | 30 +++++++++++++++---------------
- 1 file changed, 15 insertions(+), 15 deletions(-)
-
---- a/make-linux.mk
-+++ b/make-linux.mk
-@@ -39,24 +39,24 @@ include objects.mk
- # On Linux we auto-detect the presence of some libraries and if present we
- # link against the system version. This works with our package build images.
--ifeq ($(wildcard /usr/include/lz4.h),)
-+#ifeq ($(wildcard $(STAGING_DIR)/usr/include/lz4.h),)
-       OBJS+=ext/lz4/lz4.o
--else
--      LDLIBS+=-llz4
--      DEFS+=-DZT_USE_SYSTEM_LZ4
--endif
--ifeq ($(wildcard /usr/include/http_parser.h),)
-+#else
-+#     LDLIBS+=-llz4
-+#     DEFS+=-DZT_USE_SYSTEM_LZ4
-+#endif
-+#ifeq ($(wildcard $(STAGING_DIR)/usr/include/http_parser.h),)
-       OBJS+=ext/http-parser/http_parser.o
--else
--      LDLIBS+=-lhttp_parser
--      DEFS+=-DZT_USE_SYSTEM_HTTP_PARSER
--endif
--ifeq ($(wildcard /usr/include/json-parser/json.h),)
-+#else
-+#     LDLIBS+=-lhttp_parser
-+#     DEFS+=-DZT_USE_SYSTEM_HTTP_PARSER
-+#endif
-+#ifeq ($(wildcard $(STAGING_DIR)/usr/include/json-parser/json.h),)
-       OBJS+=ext/json-parser/json.o
--else
--      LDLIBS+=-ljsonparser
--      DEFS+=-DZT_USE_SYSTEM_JSON_PARSER
--endif
-+#else
-+#     LDLIBS+=-ljsonparser
-+#     DEFS+=-DZT_USE_SYSTEM_JSON_PARSER
-+#endif
- ifeq ($(ZT_USE_MINIUPNPC),1)
-       OBJS+=osdep/PortMapper.o
diff --git a/net/zerotier/patches/0002-pin-target-to-linux.patch b/net/zerotier/patches/0002-pin-target-to-linux.patch
new file mode 100644 (file)
index 0000000..48459dd
--- /dev/null
@@ -0,0 +1,24 @@
+From b8a0598002fd08618d20cd1bbfb03559435241a8 Mon Sep 17 00:00:00 2001
+From: Moritz Warning <moritzwarning@web.de>
+Date: Thu, 4 May 2017 22:35:58 +0200
+Subject: [PATCH 2/2] pin target to linux
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 9511862..d5b0dfc 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,6 @@
+ # Common makefile -- loads make rules for each platform
+-OSTYPE=$(shell uname -s)
++OSTYPE=Linux
+ ifeq ($(OSTYPE),Darwin)
+       include make-mac.mk
+-- 
+2.1.4
+
diff --git a/net/zerotier/patches/0003-gcc48.patch b/net/zerotier/patches/0003-gcc48.patch
new file mode 100644 (file)
index 0000000..766dd57
--- /dev/null
@@ -0,0 +1,13 @@
+Index: ZeroTierOne-1.2.4/ext/json/json.hpp
+===================================================================
+--- ZeroTierOne-1.2.4.orig/ext/json/json.hpp
++++ ZeroTierOne-1.2.4/ext/json/json.hpp
+@@ -64,7 +64,7 @@ SOFTWARE.
+     #endif
+ #elif defined(__GNUC__)
+     #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+-    #if GCC_VERSION < 40900
++    #if GCC_VERSION < 40800
+         #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
+     #endif
+ #endif
diff --git a/net/zerotier/patches/0003-workaround_to_avoid_seg_faults.patch b/net/zerotier/patches/0003-workaround_to_avoid_seg_faults.patch
deleted file mode 100644 (file)
index e27f872..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-From 21f4958bd48cae59b478b1b3445e00fa4fb18991 Mon Sep 17 00:00:00 2001
-From: muebau <muebau@gmail.com>
-Date: Fri, 5 Aug 2016 19:22:45 +0200
-Subject: [PATCH] OpenWRT workaround to avoid seg faults
-
----
- service/OneService.cpp | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/service/OneService.cpp b/service/OneService.cpp
-index 13820f5..9ba3238 100644
---- a/service/OneService.cpp
-+++ b/service/OneService.cpp
-@@ -862,8 +862,8 @@ public:
-                       }
-                       // Start two background threads to handle expensive ops out of line
--                      Thread::start(_node);
--                      Thread::start(_node);
-+                      //Thread::start(_node);
-+                      //Thread::start(_node);
-                       _nextBackgroundTaskDeadline = 0;
-                       uint64_t clockShouldBe = OSUtils::now();
--- 
-2.7.4
-
diff --git a/net/zerotier/patches/0004-Revert-Do-not-serve-controller-requests-until-init-i.patch b/net/zerotier/patches/0004-Revert-Do-not-serve-controller-requests-until-init-i.patch
new file mode 100644 (file)
index 0000000..1c2e4e7
--- /dev/null
@@ -0,0 +1,138 @@
+From ab8ececbe70f7c83667d6ebb592fc1df17ad26a4 Mon Sep 17 00:00:00 2001
+From: Moritz Warning <moritzwarning@web.de>
+Date: Sat, 20 Jan 2018 21:55:52 +0100
+Subject: [PATCH] Revert "Do not serve controller requests until init is done."
+
+This reverts commit f4feccc6265cc480b84c85f897b225714072d4ec.
+---
+ controller/JSONDB.cpp | 20 +++++++-------------
+ controller/JSONDB.hpp | 15 +++++++--------
+ 2 files changed, 14 insertions(+), 21 deletions(-)
+
+diff --git a/controller/JSONDB.cpp b/controller/JSONDB.cpp
+index d3e76fc1..007e0fec 100644
+--- a/controller/JSONDB.cpp
++++ b/controller/JSONDB.cpp
+@@ -26,8 +26,7 @@ static const nlohmann::json _EMPTY_JSON(nlohmann::json::object());
+ static const std::map<std::string,std::string> _ZT_JSONDB_GET_HEADERS;
+ JSONDB::JSONDB(const std::string &basePath) :
+-      _basePath(basePath),
+-      _ready(false)
++      _basePath(basePath)
+ {
+       if ((_basePath.length() > 7)&&(_basePath.substr(0,7) == "http://")) {
+               // TODO: this doesn't yet support IPv6 since bracketed address notiation isn't supported.
+@@ -50,7 +49,7 @@ JSONDB::JSONDB(const std::string &basePath) :
+               OSUtils::mkdir(_basePath.c_str());
+               OSUtils::lockDownFile(_basePath.c_str(),true); // networks might contain auth tokens, etc., so restrict directory permissions
+       }
+-      _ready = _reload(_basePath,std::string());
++      _reload(_basePath,std::string());
+ }
+ bool JSONDB::writeRaw(const std::string &n,const std::string &obj)
+@@ -84,13 +83,9 @@ bool JSONDB::put(const std::string &n,const nlohmann::json &obj)
+ const nlohmann::json &JSONDB::get(const std::string &n)
+ {
+-      while (!_ready) {
+-              Thread::sleep(250);
+-              _ready = _reload(_basePath,std::string());
+-      }
+-
+       if (!_isValidObjectName(n))
+               return _EMPTY_JSON;
++
+       std::map<std::string,_E>::iterator e(_db.find(n));
+       if (e != _db.end())
+               return e->second.obj;
+@@ -138,7 +133,7 @@ void JSONDB::erase(const std::string &n)
+       _db.erase(n);
+ }
+-bool JSONDB::_reload(const std::string &p,const std::string &b)
++void JSONDB::_reload(const std::string &p,const std::string &b)
+ {
+       if (_httpAddr) {
+               std::string body;
+@@ -155,11 +150,11 @@ bool JSONDB::_reload(const std::string &p,const std::string &b)
+                                                       _db[tmp].obj = i.value();
+                                               }
+                                       }
+-                                      return true;
+                               }
+-                      } catch ( ... ) {} // invalid JSON, so maybe incomplete request
++                      } catch ( ... ) {
++                              // TODO: report error?
++                      }
+               }
+-              return false;
+       } else {
+               std::vector<std::string> dl(OSUtils::listDirectory(p.c_str(),true));
+               for(std::vector<std::string>::const_iterator di(dl.begin());di!=dl.end();++di) {
+@@ -169,7 +164,6 @@ bool JSONDB::_reload(const std::string &p,const std::string &b)
+                               this->_reload((p + ZT_PATH_SEPARATOR + *di),(b + *di + ZT_PATH_SEPARATOR));
+                       }
+               }
+-              return true;
+       }
+ }
+diff --git a/controller/JSONDB.hpp b/controller/JSONDB.hpp
+index beafbaf5..c19112ed 100644
+--- a/controller/JSONDB.hpp
++++ b/controller/JSONDB.hpp
+@@ -36,7 +36,6 @@
+ #include "../ext/json/json.hpp"
+ #include "../osdep/OSUtils.hpp"
+ #include "../osdep/Http.hpp"
+-#include "../osdep/Thread.hpp"
+ namespace ZeroTier {
+@@ -48,6 +47,12 @@ class JSONDB
+ public:
+       JSONDB(const std::string &basePath);
++      inline void reload()
++      {
++              _db.clear();
++              _reload(_basePath,std::string());
++      }
++
+       bool writeRaw(const std::string &n,const std::string &obj);
+       bool put(const std::string &n,const nlohmann::json &obj);
+@@ -74,11 +79,6 @@ public:
+       template<typename F>
+       inline void filter(const std::string &prefix,F func)
+       {
+-              while (!_ready) {
+-                      Thread::sleep(250);
+-                      _ready = _reload(_basePath,std::string());
+-              }
+-
+               for(std::map<std::string,_E>::iterator i(_db.lower_bound(prefix));i!=_db.end();) {
+                       if ((i->first.length() >= prefix.length())&&(!memcmp(i->first.data(),prefix.data(),prefix.length()))) {
+                               if (!func(i->first,get(i->first))) {
+@@ -94,7 +94,7 @@ public:
+       inline bool operator!=(const JSONDB &db) const { return (!(*this == db)); }
+ private:
+-      bool _reload(const std::string &p,const std::string &b);
++      void _reload(const std::string &p,const std::string &b);
+       bool _isValidObjectName(const std::string &n);
+       std::string _genPath(const std::string &n,bool create);
+@@ -108,7 +108,6 @@ private:
+       InetAddress _httpAddr;
+       std::string _basePath;
+       std::map<std::string,_E> _db;
+-      volatile bool _ready;
+ };
+ } // namespace ZeroTier
+-- 
+2.15.1
+
diff --git a/net/zerotier/patches/0005-use-external-miniupnpc-and-natpmp.patch b/net/zerotier/patches/0005-use-external-miniupnpc-and-natpmp.patch
deleted file mode 100644 (file)
index 377abef..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
---- a/make-linux.mk
-+++ b/make-linux.mk
-@@ -64,7 +64,8 @@ ifeq ($(ZT_USE_MINIUPNPC),1)
-       DEFS+=-DZT_USE_MINIUPNPC
-       # Auto-detect libminiupnpc at least v2.0
--      MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' /usr/include/miniupnpc/miniupnpc.h && echo 1)
-+      #MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' $(STAGING_DIR)/usr/include/miniupnpc/miniupnpc.h && echo 1)
-+      MINIUPNPC_IS_NEW_ENOUGH=1
-       ifeq ($(MINIUPNPC_IS_NEW_ENOUGH),1)
-               DEFS+=-DZT_USE_SYSTEM_MINIUPNPC
-               LDLIBS+=-lminiupnpc
-@@ -74,7 +75,7 @@ ifeq ($(ZT_USE_MINIUPNPC),1)
-       endif
-       # Auto-detect libnatpmp
--      ifeq ($(wildcard /usr/include/natpmp.h),)
-+      ifeq ($(wildcard $(STAGING_DIR)/usr/include/natpmp.h),)
-               OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
-       else
-               LDLIBS+=-lnatpmp
---- a/osdep/PortMapper.cpp
-+++ b/osdep/PortMapper.cpp
-@@ -180,7 +180,7 @@ public:
-                               struct IGDdatas data;
-                               int upnpError = 0;
--                              UPNPDev *devlist = upnpDiscoverAll(5000,(const char *)0,(const char *)0,0,0,2,&upnpError);
-+                              UPNPDev *devlist = upnpDiscoverAll(5000,(const char *)0,(const char *)0,0,0,&upnpError);
-                               if (devlist) {
- #ifdef ZT_PORTMAPPER_TRACE
index 2d0c34d197e74a8df58667c4ba0d9e39753d2553..43b8a4471307eb6346d5bea31590c27dbddfb6ce 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=znc
-PKG_VERSION:=1.6.3
-PKG_RELEASE:=5
+PKG_VERSION:=1.6.5
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://znc.in/releases \
                http://znc.in/releases/archive
-PKG_MD5SUM:=0dad0307e2faea26b9e304e308f7ec63
+PKG_HASH:=2f0225d49c53a01f8d94feea4619a6fe92857792bb3401a4eb1edd65f0342aca
 
 PKG_MAINTAINER:=Jonas Gorski <jogo@openwrt.org>
 PKG_LICENSE:=Apache-2.0
index 6ef66303808dce9fa29ca9f8a90017cdb4cefa80..15ecdca4728ad0f87c03a4437594b06d2de295d8 100644 (file)
@@ -9,7 +9,7 @@ Subject: [PATCH] Move the root check to after config parsing
 
 --- a/src/main.cpp
 +++ b/src/main.cpp
-@@ -304,19 +304,6 @@ int main(int argc, char** argv) {
+@@ -312,19 +312,6 @@ int main(int argc, char** argv) {
                CUtils::PrintStatus(true, "");
        }
  
@@ -29,7 +29,7 @@ Subject: [PATCH] Move the root check to after config parsing
        if (bMakeConf) {
                if (!pZNC->WriteNewConfig(sConfig)) {
                        CZNC::DestroyInstance();
-@@ -338,6 +325,20 @@ int main(int argc, char** argv) {
+@@ -346,6 +333,20 @@ int main(int argc, char** argv) {
                return 1;
        }
  
diff --git a/net/znc/patches/103-Csocket-Add-some-ifdef-feature-checks.patch b/net/znc/patches/103-Csocket-Add-some-ifdef-feature-checks.patch
deleted file mode 100644 (file)
index a0dbe01..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-From d81a18d87d15bbf54ddbd675bfa829cf7dfdce9e Mon Sep 17 00:00:00 2001
-From: Edoardo Spadolini <kerio00@gmail.com>
-Date: Mon, 8 Feb 2016 14:01:51 +0100
-Subject: [PATCH] Add some #ifdef feature checks to fix compilation with
- BoringSSL
-
----
- Csocket.cc | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
---- a/src/Csocket.cpp
-+++ b/src/Csocket.cpp
-@@ -45,9 +45,12 @@
- #ifdef HAVE_LIBSSL
- #include <stdio.h>
-+#include <openssl/ssl.h>
- #include <openssl/conf.h>
- #include <openssl/engine.h>
-+#ifndef OPENSSL_NO_COMP
- #include <openssl/comp.h>
-+#endif
- #endif /* HAVE_LIBSSL */
- #ifdef HAVE_ICU
-@@ -531,8 +534,12 @@ void ShutdownCsocket()
- {
- #ifdef HAVE_LIBSSL
-       ERR_remove_state( 0 );
-+#ifndef OPENSSL_NO_ENGINE
-       ENGINE_cleanup();
-+#endif
-+#ifndef OPENSSL_IS_BORINGSSL
-       CONF_modules_unload( 1 );
-+#endif
-       ERR_free_strings();
-       EVP_cleanup();
-       CRYPTO_cleanup_all_ex_data();
-@@ -573,6 +580,7 @@ bool InitSSL( ECompType eCompressionType
-       }
- #endif /* _WIN32 */
-+#ifndef OPENSSL_NO_COMP
-       COMP_METHOD *cm = NULL;
-       if( CT_ZLIB & eCompressionType )
-@@ -588,6 +596,7 @@ bool InitSSL( ECompType eCompressionType
-               if( cm )
-                       SSL_COMP_add_compression_method( CT_RLE, cm );
-       }
-+#endif
-       // setting this up once in the begining
-       s_iCsockSSLIdx = SSL_get_ex_new_index( 0, NULL, NULL, NULL, NULL );
-@@ -1724,6 +1733,8 @@ SSL_CTX * Csock::SetupServerCTX()
- #ifndef OPENSSL_NO_ECDH
-       // Errors for the following block are non-fatal (ECDHE is nice to have
-       // but not a requirement)
-+#ifndef OPENSSL_IS_BORINGSSL
-+      // BoringSSL does this thing automatically
- #if defined( SSL_CTX_set_ecdh_auto )
-       // Auto-select sensible curve
-       if( !SSL_CTX_set_ecdh_auto( pCTX , 1 ) )
-@@ -1742,6 +1753,7 @@ SSL_CTX * Csock::SetupServerCTX()
-               ERR_clear_error();
-       }
- #endif /* SSL_CTX_set_tmp_ecdh */
-+#endif /* !OPENSSL_IS_BORINGSSL */
- #endif /* OPENSSL_NO_ECDH */
-       if( !ConfigureCTXOptions( pCTX ) )
index 22b5c38f71ad12052f80ce490a0bacb8fa09b810..d92deeea3437f1093983b8028e09b712a4f60010 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/main.cpp
 +++ b/src/main.cpp
-@@ -296,10 +296,12 @@ int main(int argc, char** argv) {
+@@ -304,10 +304,12 @@ int main(int argc, char** argv) {
                        CUtils::PrintStatus(false, "");
                        CUtils::PrintError("No modules found. Perhaps you didn't install ZNC properly?");
                        CUtils::PrintError("Read http://wiki.znc.in/Installation for instructions.");
index 0c01a6e4fa43b3b3b8935ca83f7730a65a3e21dd..9fa478bf73ad4981c9e0de09d703cc294d4b78cb 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/utils/ \
                http://alsa.cybermirror.org/utils/
-PKG_MD5SUM:=b9d6102fbbd0b68040bb77023ed30c0c
+PKG_HASH:=3b1c3135b76e14532d3dd23fb15759ddd7daf9ffbc183f7a9a0a3a86374748f1
 PKG_INSTALL:=1
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
index fd06c6efc15574bbddd514972581fa4dc38a719d..8cb3572d056d5cb88febf3de1c0aa1a696b2a9c6 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-source.zip
 PKG_SOURCE_URL:=@SF/espeak
-PKG_MD5SUM:=cadd7482eaafe9239546bdc09fa244c3
+PKG_HASH:=bf9a17673adffcc28ff7ea18764f06136547e97bbd9edf2ec612f09b207f0659
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=License.txt
diff --git a/sound/fdk-aac/Config.in b/sound/fdk-aac/Config.in
new file mode 100644 (file)
index 0000000..252b290
--- /dev/null
@@ -0,0 +1,12 @@
+menu "Configuration"
+       depends on PACKAGE_fdk-aac
+
+config FDK-AAC_OPTIMIZE_SPEED
+       bool "Optimize for speed"
+       default n
+       help
+               This enables additional optmization and 
+               increases performance considerably at 
+               the expense of binary size.
+
+endmenu
diff --git a/sound/fdk-aac/Makefile b/sound/fdk-aac/Makefile
new file mode 100644 (file)
index 0000000..6d1b005
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fdk-aac
+PKG_VERSION:=0.1.5-20171220
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+PKG_LICENSE:=Fraunhofer-FDK-AAC-for-Android
+PKG_LICENSE_FILES:=NOTICE
+
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL=https://github.com/mstorsjo/fdk-aac/
+PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=89aeea5f292306c429550e4c9fe55d865c903600
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=ef3c368dfd9c97ea2243103556354c40c1160db5f11c7f0c0162e659b33323cf
+
+PKG_FIXUP:=autoreconf
+
+PKG_CONFIG_DEPENDS:= CONFIG_FDK-AAC_OPTIMIZE_SPEED
+
+ifeq ($(CONFIG_FDK-AAC_OPTIMIZE_SPEED),y)
+       TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
+       TARGET_CFLAGS += $(TARGET_CFLAGS) -O2 -flto
+       TARGET_CXXFLAGS := $(filter-out -O%,$(TARGET_CXXFLAGS))
+       TARGET_CXXFLAGS += $(TARGET_CXXFLAGS) -O2 -flto
+       TARGET_LDFLAGS += $(TARGET_LDFLAGS) -flto
+endif
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fdk-aac
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=@BUILD_PATENTED
+  TITLE:=Fraunhofer FDK AAC Codec Library
+  URL:=https://sourceforge.net/projects/opencore-amr/
+endef
+
+define Package/fdk-aac/description
+  Port of the Fraunhofer FDK AAC Codec Library for Android
+endef
+
+define Package/fdk-aac/config
+       source "$(SOURCE)/Config.in"
+endef
+
+define Package/fdk-aac/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/.libs/*.so* $(1)/usr/lib/
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/fdk-aac
+       $(CP) $(PKG_BUILD_DIR)/libAACdec/include/aacdecoder_lib.h $(1)/usr/include/fdk-aac
+       $(CP) $(PKG_BUILD_DIR)/libAACenc/include/aacenc_lib.h $(1)/usr/include/fdk-aac
+       $(CP) $(PKG_BUILD_DIR)/libSYS/include/FDK_audio.h $(1)/usr/include/fdk-aac
+       $(CP) $(PKG_BUILD_DIR)/libSYS/include/genericStds.h $(1)/usr/include/fdk-aac
+       $(CP) $(PKG_BUILD_DIR)/libSYS/include/machine_type.h $(1)/usr/include/fdk-aac
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/.libs/*.{la,so*} $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,fdk-aac))
index b33bb44fbf40914a2e889d51250c0e2637069bd4..da371a717e0d93af9224b1260893648e52d13ac1 100644 (file)
@@ -8,15 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=forked-daapd
-PKG_VERSION:=24.2
+PKG_VERSION:=25.0
 PKG_RELEASE:=1
-PKG_REV:=1b6283752ed0b790a6658bed1f05946e1af193da
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://github.com/ejurgensen/forked-daapd.git
-PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/ejurgensen/$(PKG_NAME)/releases/download/$(PKG_VERSION)/
+PKG_HASH:=5741a64d8f54e11e89dfa2fbfae693b2837e1e19a0c4980a20f8ff56bce4456e
 
 PKG_BUILD_DEPENDS:=gperf/host
 PKG_FIXUP:=autoreconf
@@ -38,7 +35,7 @@ URL:=https://github.com/ejurgensen/forked-daapd
 DEPENDS:=+libgpg-error +libgcrypt +libgdbm +zlib +libexpat +libunistring \
        +libevent2 +libdaemon +libantlr3c +confuse +alsa-lib +libffmpeg-full \
        +mxml +libavahi-client +sqlite3-cli +libplist +libcurl +libjson-c \
-       +libprotobuf-c +libgnutls $(ICONV_DEPENDS)
+       +libprotobuf-c +libgnutls +libsodium $(ICONV_DEPENDS)
 endef
 
 define Package/forked-daapd/description
@@ -56,7 +53,11 @@ CONFIGURE_ARGS += \
        --enable-itunes \
        --enable-lastfm \
        --enable-mpd \
-       --enable-chromecast
+       --enable-chromecast \
+       --enable-verification \
+       --disable-spotify \
+       --without-pulseaudio \
+       --without-libevent_pthreads
 
 TARGET_CFLAGS += $(FPIC)
 TARGET_LDFLAGS += -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
diff --git a/sound/forked-daapd/patches/010-include_pregen.patch b/sound/forked-daapd/patches/010-include_pregen.patch
deleted file mode 100644 (file)
index 762f625..0000000
+++ /dev/null
@@ -1,23739 +0,0 @@
-diff --git a/src/pregen/DAAP.u b/src/pregen/DAAP.u
-new file mode 100644
-index 0000000..3de527b
---- /dev/null
-+++ b/src/pregen/DAAP.u
-@@ -0,0 +1,6 @@
-+DAAPParser.c : DAAP.g
-+./DAAP.tokens : DAAP.g
-+DAAPParser.h : DAAP.g
-+DAAPLexer.c : DAAP.g
-+DAAPLexer.h : DAAP.g
-+ANTLR_PRODUCTS += DAAPParser.c ./DAAP.tokens DAAPParser.h DAAPLexer.c DAAPLexer.h 
-\ No newline at end of file
-diff --git a/src/pregen/DAAP2SQL.c b/src/pregen/DAAP2SQL.c
-new file mode 100644
-index 0000000..04d6153
---- /dev/null
-+++ b/src/pregen/DAAP2SQL.c
-@@ -0,0 +1,975 @@
-+/** \file
-+ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : DAAP2SQL.g
-+ *     -                            On : 2016-01-01 12:23:43
-+ *     -           for the tree parser : DAAP2SQLTreeParser *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+
-+/* =============================================================================
-+ * This is what the grammar programmer asked us to put at the top of every file.
-+ */
-+
-+      #include <stdio.h>
-+      #include <stdlib.h>
-+      #include <string.h>
-+      #include <limits.h>
-+      #include <errno.h>
-+
-+      #include "logger.h"
-+      #include "db.h"
-+      #include "daap_query.h"
-+
-+/* End of Header action.
-+ * =============================================================================
-+ */
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include    "DAAP2SQL.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+ 
-+#define               CTX     ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef        SCOPE_TYPE
-+#undef        SCOPE_STACK
-+#undef        SCOPE_TOP
-+#define       SCOPE_TYPE(scope)   pDAAP2SQL_##scope##_SCOPE
-+#define SCOPE_STACK(scope)  pDAAP2SQL_##scope##Stack
-+#define       SCOPE_TOP(scope)    ctx->pDAAP2SQL_##scope##Top
-+#define       SCOPE_SIZE(scope)               ctx->pDAAP2SQL_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+/* Macros for accessing things in the parser
-+ */
-+ 
-+#undef            PARSER
-+#undef            RECOGNIZER              
-+#undef            HAVEPARSEDRULE
-+#undef            INPUT
-+#undef            STRSTREAM
-+#undef            HASEXCEPTION
-+#undef            EXCEPTION
-+#undef            MATCHT
-+#undef            MATCHANYT
-+#undef            FOLLOWSTACK
-+#undef            FOLLOWPUSH
-+#undef            FOLLOWPOP
-+#undef            PRECOVER
-+#undef            PREPORTERROR
-+#undef            LA
-+#undef            LT
-+#undef            CONSTRUCTEX
-+#undef            CONSUME
-+#undef            MARK
-+#undef            REWIND
-+#undef            REWINDLAST
-+#undef            PERRORRECOVERY
-+#undef            HASFAILED
-+#undef            FAILEDFLAG
-+#undef            RECOVERFROMMISMATCHEDSET
-+#undef            RECOVERFROMMISMATCHEDELEMENT
-+#undef            BACKTRACKING
-+#undef      ADAPTOR
-+#undef            RULEMEMO            
-+#undef                SEEK    
-+#undef                INDEX
-+#undef                DBG
-+
-+#define           PARSER                                                      ctx->pTreeParser  
-+#define           RECOGNIZER                                          PARSER->rec
-+#define               PSRSTATE                                                RECOGNIZER->state
-+#define           HAVEPARSEDRULE(r)                           RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define           INPUT                                                       PARSER->ctnstream
-+#define               ISTREAM                                                 INPUT->tnstream->istream
-+#define           STRSTREAM                                           INPUT->tnstream
-+#define           HASEXCEPTION()                                      (PSRSTATE->error == ANTLR3_TRUE)
-+#define           EXCEPTION                                           PSRSTATE->exception
-+#define           MATCHT(t, fs)                                       RECOGNIZER->match(RECOGNIZER, t, fs)
-+#define           MATCHANYT()                                         RECOGNIZER->matchAny(RECOGNIZER)
-+#define           FOLLOWSTACK                                     PSRSTATE->following
-+#define           FOLLOWPUSH(x)                                       FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
-+#define           FOLLOWPOP()                                         FOLLOWSTACK->pop(FOLLOWSTACK)
-+#define           PRECOVER()                                          RECOGNIZER->recover(RECOGNIZER)
-+#define           PREPORTERROR()                                      RECOGNIZER->reportError(RECOGNIZER)
-+#define           LA(n)                                                       ISTREAM->_LA(ISTREAM, n)
-+#define           LT(n)                                                       INPUT->tnstream->_LT(INPUT->tnstream, n)
-+#define           CONSTRUCTEX()                                       RECOGNIZER->exConstruct(RECOGNIZER)
-+#define           CONSUME()                                           ISTREAM->consume(ISTREAM)
-+#define           MARK()                                                      ISTREAM->mark(ISTREAM)
-+#define           REWIND(m)                                           ISTREAM->rewind(ISTREAM, m)
-+#define           REWINDLAST()                                        ISTREAM->rewindLast(ISTREAM)
-+#define           PERRORRECOVERY                                      PSRSTATE->errorRecovery
-+#define           FAILEDFLAG                                          PSRSTATE->failed
-+#define           HASFAILED()                                         (FAILEDFLAG == ANTLR3_TRUE)
-+#define           BACKTRACKING                                        PSRSTATE->backtracking
-+#define           RECOVERFROMMISMATCHEDSET(s)         RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
-+#define           RECOVERFROMMISMATCHEDELEMENT(e)     RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
-+#define     ADAPTOR                         INPUT->adaptor
-+#define               RULEMEMO                                                PSRSTATE->ruleMemo
-+#define               SEEK(n)                                                 ISTREAM->seek(ISTREAM, n)
-+#define               INDEX()                                                 ISTREAM->index(ISTREAM)
-+#define               DBG                                                             RECOGNIZER->debugger
-+
-+
-+#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define           UP      ANTLR3_TOKEN_UP
-+#define           DOWN    ANTLR3_TOKEN_DOWN
-+#define           EOR     ANTLR3_TOKEN_EOR
-+#define           INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+
-+/** \brief Table of all token names in symbolic order, mainly used for
-+ *         error reporting.
-+ */
-+pANTLR3_UINT8   DAAP2SQLTokenNames[8+4]
-+     = {
-+        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
-+        (pANTLR3_UINT8) "<EOR>",
-+        (pANTLR3_UINT8) "<DOWN>", 
-+        (pANTLR3_UINT8) "<UP>", 
-+        (pANTLR3_UINT8) "NEWLINE",
-+        (pANTLR3_UINT8) "OPOR",
-+        (pANTLR3_UINT8) "OPAND",
-+        (pANTLR3_UINT8) "LPAR",
-+        (pANTLR3_UINT8) "RPAR",
-+        (pANTLR3_UINT8) "STR",
-+        (pANTLR3_UINT8) "QUOTE",
-+        (pANTLR3_UINT8) "ESCAPED"
-+       };
-+
-+        
-+
-+// Forward declare the locally static matching functions we have generated.
-+//
-+static pANTLR3_STRING query    (pDAAP2SQL ctx);
-+static DAAP2SQL_expr_return   expr    (pDAAP2SQL ctx);
-+static void   DAAP2SQLFree(pDAAP2SQL ctx);
-+/* For use in tree output where we are accumulating rule labels via label += ruleRef
-+ * we need a function that knows how to free a return scope when the list is destroyed. 
-+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
-+ */
-+static        void ANTLR3_CDECL freeScope(void * scope)
-+{
-+    ANTLR3_FREE(scope);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "DAAP2SQL.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+      return fileName;
-+}
-+/** \brief Create a new DAAP2SQL parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pDAAP2SQL
-+DAAP2SQLNew   (pANTLR3_COMMON_TREE_NODE_STREAM instream)
-+{
-+      // See if we can create a new parser with the standard constructor
-+      //
-+      return DAAP2SQLNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new DAAP2SQL parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pDAAP2SQL
-+DAAP2SQLNewSSD   (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+    pDAAP2SQL ctx;        /* Context structure we will build and return   */
-+    
-+    ctx       = (pDAAP2SQL) ANTLR3_CALLOC(1, sizeof(DAAP2SQL));
-+    
-+    if        (ctx == NULL)
-+    {
-+              // Failed to allocate memory for parser context
-+              //
-+        return  NULL;
-+    }
-+    
-+    /* -------------------------------------------------------------------
-+     * Memory for basic structure is allocated, now to fill in
-+     * the base ANTLR3 structures. We initialize the function pointers
-+     * for the standard ANTLR3 parser function set, but upon return
-+     * from here, the programmer may set the pointers to provide custom
-+     * implementations of each function. 
-+     *
-+     * We don't use the macros defined in DAAP2SQL.h here, in order that you can get a sense
-+     * of what goes where.
-+     */
-+
-+    /* Create a base Tree parser/recognizer, using the supplied tree node stream
-+     */
-+    ctx->pTreeParser          = antlr3TreeParserNewStream(ANTLR3_SIZE_HINT, instream, state);
-+    /* Install the implementation of our DAAP2SQL interface
-+     */
-+    ctx->query        = query;
-+    ctx->expr = expr;
-+    ctx->free                 = DAAP2SQLFree;
-+    ctx->getGrammarFileName   = getGrammarFileName;
-+    
-+    /* Install the scope pushing methods.
-+     */
-+
-+        
-+    
-+
-+      
-+    /* Install the token table
-+     */
-+    PSRSTATE->tokenNames   = DAAP2SQLTokenNames;
-+    
-+    
-+    /* Return the newly built parser to the caller
-+     */
-+    return  ctx;
-+}
-+
-+/** Free the parser resources
-+ */
-+ static void
-+ DAAP2SQLFree(pDAAP2SQL ctx)
-+ {
-+    /* Free any scope memory
-+     */
-+    
-+        
-+      // Free this parser
-+      //
-+    ctx->pTreeParser->free(ctx->pTreeParser);
-+    ANTLR3_FREE(ctx);
-+
-+    /* Everything is released, so we can return
-+     */
-+    return;
-+ }
-+ 
-+/** Return token names used by this tree parser
-+ *
-+ * The returned pointer is used as an index into the token names table (using the token 
-+ * number as the index).
-+ * 
-+ * \return Pointer to first char * in the table.
-+ */
-+static pANTLR3_UINT8    *getTokenNames() 
-+{
-+        return DAAP2SQLTokenNames; 
-+}
-+
-+
-+      struct dmap_query_field_map {
-+        char *dmap_field;
-+        char *db_col;
-+        int as_int;
-+      };
-+
-+      /* gperf static hash, daap_query.gperf */
-+      #include "daap_query_hash.c"
-+
-+    
-+/* Declare the bitsets
-+ */
-+
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_query70  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_query70_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_query70     = { FOLLOW_expr_in_query70_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OPAND_in_expr95  */
-+static        ANTLR3_BITWORD FOLLOW_OPAND_in_expr95_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static  ANTLR3_BITSET_LIST FOLLOW_OPAND_in_expr95     = { FOLLOW_OPAND_in_expr95_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr101  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_expr101_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000260) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr101     = { FOLLOW_expr_in_expr101_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr107  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_expr107_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr107     = { FOLLOW_expr_in_expr107_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OPOR_in_expr118  */
-+static        ANTLR3_BITWORD FOLLOW_OPOR_in_expr118_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static  ANTLR3_BITSET_LIST FOLLOW_OPOR_in_expr118     = { FOLLOW_OPOR_in_expr118_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr124  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_expr124_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000260) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr124     = { FOLLOW_expr_in_expr124_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr130  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_expr130_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr130     = { FOLLOW_expr_in_expr130_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_expr140  */
-+static        ANTLR3_BITWORD FOLLOW_STR_in_expr140_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STR_in_expr140      = { FOLLOW_STR_in_expr140_bits, 1       };
-+     
-+
-+ 
-+ 
-+/* ==============================================
-+ * Parsing rules
-+ */
-+/** 
-+ * $ANTLR start query
-+ * DAAP2SQL.g:50:1: query returns [ pANTLR3_STRING result ] : e= expr ;
-+ */
-+static pANTLR3_STRING
-+query(pDAAP2SQL ctx)
-+{   
-+    pANTLR3_STRING result = NULL;
-+
-+    DAAP2SQL_expr_return e;
-+    #undef    RETURN_TYPE_e
-+    #define   RETURN_TYPE_e DAAP2SQL_expr_return
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     result= NULL; 
-+    {
-+        // DAAP2SQL.g:52:2: (e= expr )
-+        // DAAP2SQL.g:52:4: e= expr
-+        {
-+            FOLLOWPUSH(FOLLOW_expr_in_query70);
-+            e=expr(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto rulequeryEx;
-+            }
-+
-+            {
-+
-+                                      if (!e.valid)
-+                                      {
-+                                              result= NULL;
-+                                      }
-+                                      else
-+                                      {
-+                                              result= e.result->factory->newRaw(e.result->factory);
-+                                              result->append8(result, "(");
-+                                              result->appendS(result, e.result);
-+                                              result->append8(result, ")");
-+                                      }
-+                              
-+            }
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto rulequeryEx; /* Prevent compiler warnings */
-+    rulequeryEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return result;
-+}
-+/* $ANTLR end query */
-+
-+/** 
-+ * $ANTLR start expr
-+ * DAAP2SQL.g:68:1: expr returns [ pANTLR3_STRING result, int valid ] : ( ^( OPAND a= expr b= expr ) | ^( OPOR a= expr b= expr ) | STR );
-+ */
-+static DAAP2SQL_expr_return
-+expr(pDAAP2SQL ctx)
-+{   
-+    DAAP2SQL_expr_return retval;
-+
-+    pANTLR3_BASE_TREE    STR1;
-+    DAAP2SQL_expr_return a;
-+    #undef    RETURN_TYPE_a
-+    #define   RETURN_TYPE_a DAAP2SQL_expr_return
-+
-+    DAAP2SQL_expr_return b;
-+    #undef    RETURN_TYPE_b
-+    #define   RETURN_TYPE_b DAAP2SQL_expr_return
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     retval.result= NULL; retval.valid= 1; 
-+    STR1       = NULL;
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    {
-+        {
-+            //  DAAP2SQL.g:70:2: ( ^( OPAND a= expr b= expr ) | ^( OPOR a= expr b= expr ) | STR )
-+            
-+            ANTLR3_UINT32 alt1;
-+
-+            alt1=3;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case OPAND:
-+              {
-+                      alt1=1;
-+              }
-+                break;
-+            case OPOR:
-+              {
-+                      alt1=2;
-+              }
-+                break;
-+            case STR:
-+              {
-+                      alt1=3;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 1;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruleexprEx;
-+            }
-+
-+            switch (alt1) 
-+            {
-+              case 1:
-+                  // DAAP2SQL.g:70:4: ^( OPAND a= expr b= expr )
-+                  {
-+                       MATCHT(OPAND, &FOLLOW_OPAND_in_expr95); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_expr_in_expr101);
-+                      a=expr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_expr_in_expr107);
-+                      b=expr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      {
-+
-+                                              if (a.valid && b.valid)
-+                                              {
-+                                                      retval.result= a.result->factory->newRaw(a.result->factory);
-+                                                      retval.result->append8(retval.result, "(");
-+                                                      retval.result->appendS(retval.result, a.result);
-+                                                      retval.result->append8(retval.result, " AND ");
-+                                                      retval.result->appendS(retval.result, b.result);
-+                                                      retval.result->append8(retval.result, ")");
-+                                              }
-+                                              else if (a.valid)
-+                                              {
-+                                                      retval.result= a.result->factory->newRaw(a.result->factory);
-+                                                      retval.result->appendS(retval.result, a.result);
-+                                              }
-+                                              else if (b.valid)
-+                                              {
-+                                                      retval.result= b.result->factory->newRaw(b.result->factory);
-+                                                      retval.result->appendS(retval.result, b.result);
-+                                              }
-+                                              else
-+                                              {
-+                                                      retval.valid= 0;
-+                                              }
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // DAAP2SQL.g:96:4: ^( OPOR a= expr b= expr )
-+                  {
-+                       MATCHT(OPOR, &FOLLOW_OPOR_in_expr118); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_expr_in_expr124);
-+                      a=expr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_expr_in_expr130);
-+                      b=expr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      {
-+
-+                                              if (a.valid && b.valid)
-+                                              {
-+                                                      retval.result= a.result->factory->newRaw(a.result->factory);
-+                                                      retval.result->append8(retval.result, "(");
-+                                                      retval.result->appendS(retval.result, a.result);
-+                                                      retval.result->append8(retval.result, " OR ");
-+                                                      retval.result->appendS(retval.result, b.result);
-+                                                      retval.result->append8(retval.result, ")");
-+                                              }
-+                                              else if (a.valid)
-+                                              {
-+                                                      retval.result= a.result->factory->newRaw(a.result->factory);
-+                                                      retval.result->appendS(retval.result, a.result);
-+                                              }
-+                                              else if (b.valid)
-+                                              {
-+                                                      retval.result= b.result->factory->newRaw(b.result->factory);
-+                                                      retval.result->appendS(retval.result, b.result);
-+                                              }
-+                                              else
-+                                              {
-+                                                      retval.valid= 0;
-+                                              }
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // DAAP2SQL.g:122:4: STR
-+                  {
-+                      STR1 = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_expr140); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      {
-+
-+                                              pANTLR3_STRING str;
-+                                              pANTLR3_UINT8 field;
-+                                              pANTLR3_UINT8 val;
-+                                              pANTLR3_UINT8 escaped;
-+                                              ANTLR3_UINT8 op;
-+                                              int neg_op;
-+                                              const struct dmap_query_field_map *dqfm;
-+                                              char *end;
-+                                              long long llval;
-+
-+                                              escaped = NULL;
-+
-+                                              retval.result= (STR1->getText(STR1))->factory->newRaw((STR1->getText(STR1))->factory);
-+
-+                                              str = (STR1->getText(STR1))->toUTF8((STR1->getText(STR1)));
-+
-+                                              /* NOTE: the lexer delivers the string without quotes
-+                                              which may not be obvious from the grammar due to embedded code
-+                                              */
-+
-+                                              /* Make daap.songalbumid:0 a no-op */
-+                                              if (strcmp((char *)str->chars, "daap.songalbumid:0") == 0)
-+                                              {
-+                                                      retval.result->append8(retval.result, "1 = 1");
-+
-+                                                      goto STR_out;
-+                                              }
-+
-+                                              field = str->chars;
-+
-+                                              val = field;
-+                                              while ((*val != '\0') && ((*val == '.')
-+                                                      || (*val == '-')
-+                                                      || ((*val >= 'a') && (*val <= 'z'))
-+                                                      || ((*val >= 'A') && (*val <= 'Z'))
-+                                                      || ((*val >= '0') && (*val <= '9'))))
-+                                              {
-+                                                      val++;
-+                                              }
-+
-+                                              if (*field == '\0')
-+                                              {
-+                                                      DPRINTF(E_LOG, L_DAAP, "No field name found in clause '%s'\n", field);
-+                                                      retval.valid= 0;
-+                                                      goto STR_result_valid_0; /* ABORT */
-+                                              }
-+
-+                                              if (*val == '\0')
-+                                              {
-+                                                      DPRINTF(E_LOG, L_DAAP, "No operator found in clause '%s'\n", field);
-+                                                      retval.valid= 0;
-+                                                      goto STR_result_valid_0; /* ABORT */
-+                                              }
-+
-+                                              op = *val;
-+                                              *val = '\0';
-+                                              val++;
-+
-+                                              if (op == '!')
-+                                              {
-+                                                      if (*val == '\0')
-+                                                      {
-+                                                              DPRINTF(E_LOG, L_DAAP, "Negation found but operator missing in clause '%s%c'\n", field, op);
-+                                                              retval.valid= 0;
-+                                                              goto STR_result_valid_0; /* ABORT */
-+                                                      }
-+
-+                                                      neg_op = 1;
-+                                                      op = *val;
-+                                                      val++;
-+                                              }
-+                                              else
-+                                                      neg_op = 0;
-+
-+                                              /* Lookup DMAP field in the query field map */
-+                                              dqfm = daap_query_field_lookup((char *)field, strlen((char *)field));
-+                                              if (!dqfm)
-+                                              {
-+                                                      DPRINTF(E_LOG, L_DAAP, "DMAP field '%s' is not a valid field in queries\n", field);
-+                                                      retval.valid= 0;
-+                                                      goto STR_result_valid_0; /* ABORT */
-+                                              }
-+
-+                                              /* Empty values OK for string fields, NOK for integer */
-+                                              if (*val == '\0')
-+                                              {
-+                                                      if (dqfm->as_int)
-+                                                      {
-+                                                              DPRINTF(E_LOG, L_DAAP, "No value given in clause '%s%s%c'\n", field, (neg_op) ? "!" : "", op);
-+                                                              retval.valid= 0;
-+                                                              goto STR_result_valid_0; /* ABORT */
-+                                                      }
-+
-+                                                      /* No need to exclude empty artist and album, as forked-daapd makes sure there always exists an artist/album. */
-+                                                      if (neg_op && op == ':'
-+                                                              && (strcmp((char *)field, "daap.songalbumartist") == 0 
-+                                                                      || strcmp((char *)field, "daap.songartist") == 0 
-+                                                                      || strcmp((char *)field, "daap.songalbum") == 0))
-+                                                      {
-+                                                              DPRINTF(E_DBG, L_DAAP, "Ignoring clause '%s%s%c'\n", field, (neg_op) ? "!" : "", op);
-+                                                              retval.valid= 0;
-+                                                              goto STR_result_valid_0;
-+                                                      }
-+                                                      
-+                                                      /* Need to check against NULL too */
-+                                                      if (op == ':')
-+                                                              retval.result->append8(retval.result, "(");
-+                                              }
-+
-+                                              /* Int field: check integer conversion */
-+                                              if (dqfm->as_int)
-+                                              {
-+                                                      errno = 0;
-+                                                      llval = strtoll((const char *)val, &end, 10);
-+
-+                                                      if (((errno == ERANGE) && ((llval == LLONG_MAX) || (llval == LLONG_MIN)))
-+                                                              || ((errno != 0) && (llval == 0)))
-+                                                      {
-+                                                              DPRINTF(E_LOG, L_DAAP, "Value '%s' in clause '%s%s%c%s' does not convert to an integer type\n",
-+                                                              val, field, (neg_op) ? "!" : "", op, val);
-+                                                              retval.valid= 0;
-+                                                              goto STR_result_valid_0; /* ABORT */
-+                                                      }
-+
-+                                                      if (end == (char *)val)
-+                                                      {
-+                                                              DPRINTF(E_LOG, L_DAAP, "Value '%s' in clause '%s%s%c%s' does not represent an integer value\n",
-+                                                              val, field, (neg_op) ? "!" : "", op, val);
-+                                                              retval.valid= 0;
-+                                                              goto STR_result_valid_0; /* ABORT */
-+                                                      }
-+
-+                                                      *end = '\0'; /* Cut out potential garbage - we're being kind */
-+
-+                                                      /* forked-daapd only has media_kind = 1 for music - so remove media_kind = 32 to imporve select query performance. */
-+                                                      if (llval == 32
-+                                                              && (strcmp((char *)field, "com.apple.itunes.mediakind") == 0 
-+                                                                      || strcmp((char *)field, "com.apple.itunes.extended-media-kind") == 0))
-+                                                      {
-+                                                              DPRINTF(E_DBG, L_DAAP, "Ignoring clause '%s%s%c%s'\n", field, (neg_op) ? "!" : "", op, val);
-+                                                              
-+                                                              if (neg_op)
-+                                                                      retval.result->append8(retval.result, "1 = 1");
-+                                                              else
-+                                                                      retval.result->append8(retval.result, "1 = 0");
-+                                                              
-+                                                              goto STR_out;
-+                                                      }
-+                                              }
-+                                              /* String field: escape string, check for '*' */
-+                                              else
-+                                              {
-+                                                      if (op != ':')
-+                                                      {
-+                                                              DPRINTF(E_LOG, L_DAAP, "Operation '%c' not valid for string values\n", op);
-+                                                              retval.valid= 0;
-+                                                              goto STR_result_valid_0; /* ABORT */
-+                                                      }
-+
-+                                                      escaped = (pANTLR3_UINT8)db_escape_string((char *)val);
-+                                                      if (!escaped)
-+                                                      {
-+                                                              DPRINTF(E_LOG, L_DAAP, "Could not escape value\n");
-+                                                              retval.valid= 0;
-+                                                              goto STR_result_valid_0; /* ABORT */
-+                                                      }
-+
-+                                                      val = escaped;
-+
-+                                                      if (val[0] == '*')
-+                                                      {
-+                                                              op = '%';
-+                                                              val[0] = '%';
-+                                                      }
-+
-+                                                      if (val[0] && val[1] && val[strlen((char *)val) - 1] == '*')
-+                                                      {
-+                                                              op = '%';
-+                                                              val[strlen((char *)val) - 1] = '%';
-+                                                      }
-+                                              }
-+                                              
-+                                              retval.result->append8(retval.result, dqfm->db_col);
-+
-+                                              switch(op)
-+                                              {
-+                                                      case ':':
-+                                                              if (neg_op)
-+                                                                      retval.result->append8(retval.result, " <> ");
-+                                                              else
-+                                                                      retval.result->append8(retval.result, " = ");
-+                                                              break;
-+
-+                                                      case '+':
-+                                                              if (neg_op)
-+                                                                      retval.result->append8(retval.result, " <= ");
-+                                                              else
-+                                                                      retval.result->append8(retval.result, " > ");
-+                                                              break;
-+
-+                                                      case '-':
-+                                                              if (neg_op)
-+                                                                      retval.result->append8(retval.result, " >= ");
-+                                                              else
-+                                                                      retval.result->append8(retval.result, " < ");
-+                                                              break;
-+
-+                                                      case '%':
-+                                                              retval.result->append8(retval.result, " LIKE ");
-+                                                              break;
-+
-+                                                      default:
-+                                                              if (neg_op)
-+                                                                      DPRINTF(E_LOG, L_DAAP, "Missing or unknown operator '%c' in clause '%s!%c%s'\n", op, field, op, val);
-+                                                              else
-+                                                                      DPRINTF(E_LOG, L_DAAP, "Unknown operator '%c' in clause '%s%c%s'\n", op, field, op, val);
-+                                                              retval.valid= 0;
-+                                                              goto STR_result_valid_0; /* ABORT */
-+                                                              break;
-+                                              }
-+
-+                                              if (!dqfm->as_int)
-+                                                      retval.result->append8(retval.result, "'");
-+                              
-+                                              retval.result->append8(retval.result, (const char *)val);
-+                              
-+                                              if (!dqfm->as_int)
-+                                                      retval.result->append8(retval.result, "'");
-+
-+                                              /* For empty string value, we need to check against NULL too */
-+                                              if ((*val == '\0') && (op == ':'))
-+                                              {
-+                                                      if (neg_op)
-+                                                              retval.result->append8(retval.result, " AND ");
-+                                                      else
-+                                                              retval.result->append8(retval.result, " OR ");
-+
-+                                                      retval.result->append8(retval.result, dqfm->db_col);
-+
-+                                                      if (neg_op)
-+                                                              retval.result->append8(retval.result, " IS NOT NULL");
-+                                                      else
-+                                                              retval.result->append8(retval.result, " IS NULL");
-+
-+                                                      retval.result->append8(retval.result, ")");
-+                                              }
-+
-+                                              STR_result_valid_0: /* bail out label */
-+                                                      ;
-+
-+                                              if (escaped)
-+                                                      free(escaped);
-+
-+                                              STR_out: /* get out of here */
-+                                                      ;
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleexprEx; /* Prevent compiler warnings */
-+    ruleexprEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end expr */
-+/* End of parsing rules
-+ * ==============================================
-+ */
-+
-+/* ==============================================
-+ * Syntactic predicates
-+ */
-+/* End of syntactic predicates
-+ * ==============================================
-+ */
-+
-+ 
-+ 
-+
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/DAAP2SQL.h b/src/pregen/DAAP2SQL.h
-new file mode 100644
-index 0000000..e829049
---- /dev/null
-+++ b/src/pregen/DAAP2SQL.h
-@@ -0,0 +1,195 @@
-+/** \file
-+ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : DAAP2SQL.g
-+ *     -                            On : 2016-01-01 12:23:43
-+ *     -           for the tree parser : DAAP2SQLTreeParser *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The tree parser DAAP2SQL has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ * 
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pDAAP2SQL, which is returned from a call to DAAP2SQLNew().
-+ *
-+ * The methods in pDAAP2SQL are  as follows:
-+ *
-+ *  - pANTLR3_STRING      pDAAP2SQL->query(pDAAP2SQL)
-+ *  - DAAP2SQL_expr_return      pDAAP2SQL->expr(pDAAP2SQL)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+#ifndef       _DAAP2SQL_H
-+#define _DAAP2SQL_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include    <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+ 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct DAAP2SQL_Ctx_struct DAAP2SQL, * pDAAP2SQL;
-+
-+
-+
-+      #include <stdio.h>
-+      #include <stdlib.h>
-+      #include <string.h>
-+      #include <limits.h>
-+      #include <errno.h>
-+
-+      #include "logger.h"
-+      #include "db.h"
-+      #include "daap_query.h"
-+
-+
-+#ifdef        ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
-+//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
-+//          initialized but unused variable                                   - tree rewrite variables declared but not needed
-+//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
-+//          potentially unitialized variable used                     - retval always returned from a rule 
-+//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+typedef struct DAAP2SQL_expr_return_struct
-+{
-+    pANTLR3_BASE_TREE       start;
-+    pANTLR3_BASE_TREE       stop;   
-+    pANTLR3_STRING result;
-+    int valid;
-+}
-+    DAAP2SQL_expr_return;
-+
-+
-+
-+/** Context tracking structure for DAAP2SQL
-+ */
-+struct DAAP2SQL_Ctx_struct
-+{
-+    /** Built in ANTLR3 context tracker contains all the generic elements
-+     *  required for context tracking.
-+     */
-+    pANTLR3_TREE_PARSER           pTreeParser;
-+
-+
-+     pANTLR3_STRING (*query)  (struct DAAP2SQL_Ctx_struct * ctx);
-+     DAAP2SQL_expr_return (*expr)     (struct DAAP2SQL_Ctx_struct * ctx);
-+    // Delegated rules
-+    const char * (*getGrammarFileName)();
-+    void          (*free)   (struct DAAP2SQL_Ctx_struct * ctx);
-+        
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pDAAP2SQL DAAP2SQLNew         (pANTLR3_COMMON_TREE_NODE_STREAM instream);
-+ANTLR3_API pDAAP2SQL DAAP2SQLNewSSD      (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the tree parser will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef        EOF
-+#undef        EOF
-+#endif
-+#ifdef        Tokens
-+#undef        Tokens
-+#endif 
-+#define STR      9
-+#define QUOTE      10
-+#define NEWLINE      4
-+#define LPAR      7
-+#define OPOR      5
-+#define RPAR      8
-+#define ESCAPED      11
-+#define OPAND      6
-+#define EOF      -1
-+#ifdef        EOF
-+#undef        EOF
-+#define       EOF     ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for DAAP2SQL
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/DAAP2SQL.u b/src/pregen/DAAP2SQL.u
-new file mode 100644
-index 0000000..385d80b
---- /dev/null
-+++ b/src/pregen/DAAP2SQL.u
-@@ -0,0 +1,5 @@
-+DAAP2SQL.g: DAAP.tokens
-+DAAP2SQL.c : DAAP2SQL.g
-+./DAAP2SQL.tokens : DAAP2SQL.g
-+DAAP2SQL.h : DAAP2SQL.g
-+ANTLR_PRODUCTS += DAAP2SQL.c ./DAAP2SQL.tokens DAAP2SQL.h 
-\ No newline at end of file
-diff --git a/src/pregen/DAAPLexer.c b/src/pregen/DAAPLexer.c
-new file mode 100644
-index 0000000..eab3ff4
---- /dev/null
-+++ b/src/pregen/DAAPLexer.c
-@@ -0,0 +1,1101 @@
-+/** \file
-+ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : DAAP.g
-+ *     -                            On : 2016-01-01 12:23:41
-+ *     -                 for the lexer : DAAPLexerLexer *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include    "DAAPLexer.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+ 
-+#define               CTX     ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef        SCOPE_TYPE
-+#undef        SCOPE_STACK
-+#undef        SCOPE_TOP
-+#define       SCOPE_TYPE(scope)   pDAAPLexer_##scope##_SCOPE
-+#define SCOPE_STACK(scope)  pDAAPLexer_##scope##Stack
-+#define       SCOPE_TOP(scope)    ctx->pDAAPLexer_##scope##Top
-+#define       SCOPE_SIZE(scope)               ctx->pDAAPLexer_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+ 
-+/* Macros for accessing things in a lexer
-+ */
-+#undef            LEXER
-+#undef            RECOGNIZER              
-+#undef            RULEMEMO                
-+#undef            GETCHARINDEX
-+#undef            GETLINE
-+#undef            GETCHARPOSITIONINLINE
-+#undef            EMIT
-+#undef            EMITNEW
-+#undef            MATCHC
-+#undef            MATCHS
-+#undef            MATCHRANGE
-+#undef            LTOKEN
-+#undef            HASFAILED
-+#undef            FAILEDFLAG
-+#undef            INPUT
-+#undef            STRSTREAM
-+#undef            LA
-+#undef            HASEXCEPTION
-+#undef            EXCEPTION
-+#undef            CONSTRUCTEX
-+#undef            CONSUME
-+#undef            LRECOVER
-+#undef            MARK
-+#undef            REWIND
-+#undef            REWINDLAST
-+#undef            BACKTRACKING
-+#undef                MATCHANY
-+#undef                MEMOIZE
-+#undef                HAVEPARSEDRULE
-+#undef                GETTEXT
-+#undef                INDEX
-+#undef                SEEK
-+#undef                PUSHSTREAM
-+#undef                POPSTREAM
-+#undef                SETTEXT
-+#undef                SETTEXT8
-+
-+#define           LEXER                                       ctx->pLexer
-+#define           RECOGNIZER                      LEXER->rec
-+#define               LEXSTATE                                RECOGNIZER->state
-+#define               TOKSOURCE                               LEXSTATE->tokSource
-+#define           GETCHARINDEX()                      LEXER->getCharIndex(LEXER)
-+#define           GETLINE()                           LEXER->getLine(LEXER)
-+#define           GETTEXT()                           LEXER->getText(LEXER)
-+#define           GETCHARPOSITIONINLINE() LEXER->getCharPositionInLine(LEXER)
-+#define           EMIT()                                      LEXSTATE->type = _type; LEXER->emit(LEXER)
-+#define           EMITNEW(t)                          LEXER->emitNew(LEXER, t)
-+#define           MATCHC(c)                           LEXER->matchc(LEXER, c)
-+#define           MATCHS(s)                           LEXER->matchs(LEXER, s)
-+#define           MATCHRANGE(c1,c2)       LEXER->matchRange(LEXER, c1, c2)
-+#define           MATCHANY()                          LEXER->matchAny(LEXER)
-+#define           LTOKEN                              LEXSTATE->token
-+#define           HASFAILED()                         (LEXSTATE->failed == ANTLR3_TRUE)
-+#define           BACKTRACKING                        LEXSTATE->backtracking
-+#define           FAILEDFLAG                          LEXSTATE->failed
-+#define           INPUT                                       LEXER->input
-+#define           STRSTREAM                           INPUT
-+#define               ISTREAM                                 INPUT->istream
-+#define               INDEX()                                 ISTREAM->index(ISTREAM)
-+#define               SEEK(n)                                 ISTREAM->seek(ISTREAM, n)
-+#define           EOF_TOKEN                           &(LEXSTATE->tokSource->eofToken)
-+#define           HASEXCEPTION()                      (LEXSTATE->error == ANTLR3_TRUE)
-+#define           EXCEPTION                           LEXSTATE->exception
-+#define           CONSTRUCTEX()                       RECOGNIZER->exConstruct(RECOGNIZER)
-+#define           LRECOVER()                          LEXER->recover(LEXER)
-+#define           MARK()                                      ISTREAM->mark(ISTREAM)
-+#define           REWIND(m)                           ISTREAM->rewind(ISTREAM, m)
-+#define           REWINDLAST()                        ISTREAM->rewindLast(ISTREAM)
-+#define               MEMOIZE(ri,si)                  RECOGNIZER->memoize(RECOGNIZER, ri, si)
-+#define               HAVEPARSEDRULE(r)               RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define               PUSHSTREAM(str)                 LEXER->pushCharStream(LEXER, str)
-+#define               POPSTREAM()                             LEXER->popCharStream(LEXER)
-+#define               SETTEXT(str)                    LEXSTATE->text = str
-+#define               SKIP()                                  LEXSTATE->token = &(TOKSOURCE->skipToken)
-+#define               USER1                                   LEXSTATE->user1
-+#define               USER2                                   LEXSTATE->user2
-+#define               USER3                                   LEXSTATE->user3
-+#define               CUSTOM                                  LEXSTATE->custom
-+#define               RULEMEMO                                LEXSTATE->ruleMemo
-+#define               DBG                                             RECOGNIZER->debugger
-+
-+/* If we have been told we can rely on the standard 8 bit or 16 bit input
-+ * stream, then we can define our macros to use the direct pointers
-+ * in the input object, which is much faster than indirect calls. This
-+ * is really only significant to lexers with a lot of fragment rules (which
-+ * do not place LA(1) in a temporary at the moment) and even then
-+ * only if there is a lot of input (order of say 1M or so).
-+ */
-+#if   defined(ANTLR3_INLINE_INPUT_ASCII) || defined(ANTLR3_INLINE_INPUT_UTF16)
-+
-+# ifdef       ANTLR3_INLINE_INPUT_ASCII
-+
-+/* 8 bit "ASCII" (actually any 8 bit character set) */
-+
-+#  define         NEXTCHAR                    ((pANTLR3_UINT8)(INPUT->nextChar))
-+#  define         DATAP                               ((pANTLR3_UINT8)(INPUT->data))
-+
-+# else
-+
-+#  define         NEXTCHAR                    ((pANTLR3_UINT16)(INPUT->nextChar)) 
-+#  define         DATAP                               ((pANTLR3_UINT16)(INPUT->data))
-+
-+# endif
-+
-+# define          LA(n) ((NEXTCHAR + n) > (DATAP + INPUT->sizeBuf) ? ANTLR3_CHARSTREAM_EOF : (ANTLR3_UCHAR)(*(NEXTCHAR + n - 1)))
-+# define          CONSUME()                                                                                   \
-+{                                                                                                                                     \
-+    if        (NEXTCHAR < (DATAP + INPUT->sizeBuf))                                           \
-+    {                                                                                                                         \
-+              INPUT->charPositionInLine++;                                                            \
-+              if  ((ANTLR3_UCHAR)(*NEXTCHAR) == INPUT->newlineChar)           \
-+              {                                                                                                                       \
-+                      INPUT->line++;                                                                                  \
-+                      INPUT->charPositionInLine       = 0;                                            \
-+                      INPUT->currentLine              = (void *)(NEXTCHAR + 1);               \
-+              }                                                                                                                       \
-+              INPUT->nextChar = (void *)(NEXTCHAR + 1);                                       \
-+    }                                                                                                                         \
-+}
-+
-+#else
-+
-+// Pick up the input character by calling the input stream implementation.
-+//
-+#define           CONSUME()                           INPUT->istream->consume(INPUT->istream)
-+#define           LA(n)                                       INPUT->istream->_LA(INPUT->istream, n)
-+
-+#endif
-+#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define           UP      ANTLR3_TOKEN_UP
-+#define           DOWN    ANTLR3_TOKEN_DOWN
-+#define           EOR     ANTLR3_TOKEN_EOR
-+#define           INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+/* Forward declare the locally static matching functions we have generated and any predicate functions.
-+ */
-+static ANTLR3_INLINE  void    mQUOTE    (pDAAPLexer ctx);
-+static ANTLR3_INLINE  void    mLPAR    (pDAAPLexer ctx);
-+static ANTLR3_INLINE  void    mRPAR    (pDAAPLexer ctx);
-+static ANTLR3_INLINE  void    mOPAND    (pDAAPLexer ctx);
-+static ANTLR3_INLINE  void    mOPOR    (pDAAPLexer ctx);
-+static ANTLR3_INLINE  void    mNEWLINE    (pDAAPLexer ctx);
-+static ANTLR3_INLINE  void    mSTR    (pDAAPLexer ctx);
-+static ANTLR3_INLINE  void    mESCAPED    (pDAAPLexer ctx);
-+static ANTLR3_INLINE  void    mTokens    (pDAAPLexer ctx);
-+static void   DAAPLexerFree(pDAAPLexer ctx);
-+
-+/* =========================================================================
-+ * Lexer matching rules end.
-+ * =========================================================================
-+ */
-+
-+
-+
-+static void
-+DAAPLexerFree  (pDAAPLexer ctx)
-+{
-+    LEXER->free(LEXER);
-+    
-+    ANTLR3_FREE(ctx);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "DAAP.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+      return fileName;
-+}
-+
-+/** \brief Create a new lexer called DAAPLexer
-+ *
-+ * \param[in]    instream Pointer to an initialized input stream
-+ * \return 
-+ *     - Success pDAAPLexer initialized for the lex start
-+ *     - Fail NULL
-+ */
-+ANTLR3_API pDAAPLexer DAAPLexerNew         
-+(pANTLR3_INPUT_STREAM instream)
-+{
-+      // See if we can create a new lexer with the standard constructor
-+      //
-+      return DAAPLexerNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new lexer called DAAPLexer
-+ *
-+ * \param[in]    instream Pointer to an initialized input stream
-+ * \param[state] state Previously created shared recognizer stat
-+ * \return 
-+ *     - Success pDAAPLexer initialized for the lex start
-+ *     - Fail NULL
-+ */
-+ANTLR3_API pDAAPLexer DAAPLexerNewSSD         
-+(pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+    pDAAPLexer ctx; // Context structure we will build and return
-+
-+    ctx = (pDAAPLexer) ANTLR3_CALLOC(1, sizeof(DAAPLexer));
-+
-+    if  (ctx == NULL)
-+    {
-+        // Failed to allocate memory for lexer context
-+        return  NULL;
-+    }
-+
-+    /* -------------------------------------------------------------------
-+     * Memory for basic structure is allocated, now to fill in
-+     * in base ANTLR3 structures. We initialize the function pointers
-+     * for the standard ANTLR3 lexer function set, but upon return
-+     * from here, the programmer may set the pointers to provide custom
-+     * implementations of each function. 
-+     *
-+     * We don't use the macros defined in DAAPLexer.h here so you can get a sense
-+     * of what goes where.
-+     */
-+    
-+    /* Create a base lexer, using the supplied input stream
-+     */
-+    ctx->pLexer       = antlr3LexerNewStream(ANTLR3_SIZE_HINT, instream, state);
-+    
-+    /* Check that we allocated the memory correctly
-+     */
-+    if        (ctx->pLexer == NULL)
-+    {
-+              ANTLR3_FREE(ctx);
-+              return  NULL;
-+    }
-+    /* Install the implementation of our DAAPLexer interface
-+     */
-+    ctx->mQUOTE       = mQUOTE;
-+    ctx->mLPAR        = mLPAR;
-+    ctx->mRPAR        = mRPAR;
-+    ctx->mOPAND       = mOPAND;
-+    ctx->mOPOR        = mOPOR;
-+    ctx->mNEWLINE     = mNEWLINE;
-+    ctx->mSTR = mSTR;
-+    ctx->mESCAPED     = mESCAPED;
-+    ctx->mTokens      = mTokens;
-+    
-+    /** When the nextToken() call is made to this lexer's pANTLR3_TOKEN_SOURCE
-+     *  it will call mTokens() in this generated code, and will pass it the ctx
-+     * pointer of this lexer, not the context of the base lexer, so store that now.
-+     */
-+    ctx->pLexer->ctx      = ctx;
-+    
-+    /**Install the token matching function
-+     */
-+    ctx->pLexer->mTokens = (void (*) (void *))(mTokens);
-+    
-+    ctx->getGrammarFileName   = getGrammarFileName;
-+    ctx->free         = DAAPLexerFree;
-+
-+    
-+    
-+
-+
-+    /* Return the newly built lexer to the caller
-+     */
-+    return  ctx;
-+}
-+ 
-+
-+/* =========================================================================
-+ * Functions to match the lexer grammar defined tokens from the input stream
-+ */
-+
-+//   Comes from: 40:7: ( '\\'' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start QUOTE
-+ *
-+ * Looks to match the characters the constitute the token QUOTE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mQUOTE(pDAAPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = QUOTE;
-+       
-+    
-+    // DAAP.g:40:7: ( '\\'' )
-+    // DAAP.g:40:9: '\\''
-+    {
-+        MATCHC('\''); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleQUOTEEx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleQUOTEEx; /* Prevent compiler warnings */
-+    ruleQUOTEEx: ;
-+
-+}
-+// $ANTLR end QUOTE
-+
-+//   Comes from: 41:6: ( '(' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LPAR
-+ *
-+ * Looks to match the characters the constitute the token LPAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLPAR(pDAAPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = LPAR;
-+       
-+    
-+    // DAAP.g:41:6: ( '(' )
-+    // DAAP.g:41:8: '('
-+    {
-+        MATCHC('('); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleLPAREx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleLPAREx; /* Prevent compiler warnings */
-+    ruleLPAREx: ;
-+
-+}
-+// $ANTLR end LPAR
-+
-+//   Comes from: 42:6: ( ')' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start RPAR
-+ *
-+ * Looks to match the characters the constitute the token RPAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mRPAR(pDAAPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = RPAR;
-+       
-+    
-+    // DAAP.g:42:6: ( ')' )
-+    // DAAP.g:42:8: ')'
-+    {
-+        MATCHC(')'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleRPAREx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleRPAREx; /* Prevent compiler warnings */
-+    ruleRPAREx: ;
-+
-+}
-+// $ANTLR end RPAR
-+
-+//   Comes from: 44:7: ( '+' | ' ' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start OPAND
-+ *
-+ * Looks to match the characters the constitute the token OPAND
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mOPAND(pDAAPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = OPAND;
-+       
-+    
-+    // DAAP.g:44:7: ( '+' | ' ' )
-+    // DAAP.g:
-+    {
-+        if ( LA(1) == ' ' || LA(1) == '+' )
-+        {
-+            CONSUME();
-+
-+        }
-+        else 
-+        {
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+            EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+            LRECOVER();    goto ruleOPANDEx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleOPANDEx; /* Prevent compiler warnings */
-+    ruleOPANDEx: ;
-+
-+}
-+// $ANTLR end OPAND
-+
-+//   Comes from: 45:6: ( ',' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start OPOR
-+ *
-+ * Looks to match the characters the constitute the token OPOR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mOPOR(pDAAPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = OPOR;
-+       
-+    
-+    // DAAP.g:45:6: ( ',' )
-+    // DAAP.g:45:8: ','
-+    {
-+        MATCHC(','); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleOPOREx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleOPOREx; /* Prevent compiler warnings */
-+    ruleOPOREx: ;
-+
-+}
-+// $ANTLR end OPOR
-+
-+//   Comes from: 47:9: ( ( '\\r' )? '\\n' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start NEWLINE
-+ *
-+ * Looks to match the characters the constitute the token NEWLINE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mNEWLINE(pDAAPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = NEWLINE;
-+       
-+    
-+    // DAAP.g:47:9: ( ( '\\r' )? '\\n' )
-+    // DAAP.g:47:11: ( '\\r' )? '\\n'
-+    {
-+
-+        // DAAP.g:47:11: ( '\\r' )?
-+        {
-+            int alt1=2;
-+            switch ( LA(1) ) 
-+            {
-+                case '\r':
-+                      {
-+                              alt1=1;
-+                      }
-+                    break;
-+            }
-+
-+            switch (alt1) 
-+            {
-+              case 1:
-+                  // DAAP.g:47:11: '\\r'
-+                  {
-+                      MATCHC('\r'); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleNEWLINEEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+        MATCHC('\n'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleNEWLINEEx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleNEWLINEEx; /* Prevent compiler warnings */
-+    ruleNEWLINEEx: ;
-+
-+}
-+// $ANTLR end NEWLINE
-+
-+//   Comes from: 55:2: ( QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start STR
-+ *
-+ * Looks to match the characters the constitute the token STR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mSTR(pDAAPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+    pANTLR3_COMMON_TOKEN esc;
-+    ANTLR3_UINT32 reg;
-+
-+
-+    esc = NULL;
-+
-+    _type         = STR;
-+       
-+     pANTLR3_STRING unesc = GETTEXT()->factory->newRaw(GETTEXT()->factory); 
-+    
-+    // DAAP.g:55:2: ( QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE )
-+    // DAAP.g:55:4: QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE
-+    {
-+        /* 55:4: QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE */
-+        mQUOTE(ctx ); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleSTREx;
-+        }
-+
-+        // DAAP.g:55:10: (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+
-+        {
-+            int cnt2=0;
-+
-+            for (;;)
-+            {
-+                int alt2=3;
-+              {
-+                 /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
-+                  */
-+                  int LA2_0 = LA(1);
-+                  if ( (((LA2_0 >= 0x0000) && (LA2_0 <= '&')) || ((LA2_0 >= '(') && (LA2_0 <= '[')) || ((LA2_0 >= ']') && (LA2_0 <= 0xFFFF))) ) 
-+                  {
-+                      alt2=1;
-+                  }
-+                  else if ( (LA2_0 == '\\') ) 
-+                  {
-+                      alt2=2;
-+                  }
-+
-+              }
-+              switch (alt2) 
-+              {
-+                  case 1:
-+                      // DAAP.g:55:12: reg=~ ( '\\\\' | '\\'' )
-+                      {
-+                          reg= LA(1);
-+                          if ( ((LA(1) >= 0x0000) && (LA(1) <= '&')) || ((LA(1) >= '(') && (LA(1) <= '[')) || ((LA(1) >= ']') && (LA(1) <= 0xFFFF)) )
-+                          {
-+                              CONSUME();
-+
-+                          }
-+                          else 
-+                          {
-+                              CONSTRUCTEX();
-+                              EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+                              EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+                              LRECOVER();    goto ruleSTREx;
-+                          }
-+
-+                          {
-+                               unesc->addc(unesc, reg); 
-+                          }
-+
-+                      }
-+                      break;
-+                  case 2:
-+                      // DAAP.g:56:6: esc= ESCAPED
-+                      {
-+                          /* 56:6: esc= ESCAPED */
-+                          {
-+                              ANTLR3_MARKER escStart118 = GETCHARINDEX();
-+                          mESCAPED(ctx ); 
-+                              if  (HASEXCEPTION())
-+                              {
-+                                  goto ruleSTREx;
-+                              }
-+
-+                              esc = LEXSTATE->tokFactory->newToken(LEXSTATE->tokFactory);
-+                              esc->setType(esc, ANTLR3_TOKEN_INVALID);
-+                              esc->setStartIndex(esc, escStart118);
-+                              esc->setStopIndex(esc, GETCHARINDEX()-1);
-+                              esc->input = INPUT;
-+                          }
-+                          {
-+                               unesc->appendS(unesc, GETTEXT()); 
-+                          }
-+
-+                      }
-+                      break;
-+
-+                  default:
-+                  
-+                      if ( cnt2 >= 1 )
-+                      {
-+                          goto loop2;
-+                      }
-+                      /* mismatchedSetEx()
-+                       */
-+                      CONSTRUCTEX();
-+                      EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
-+                      EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
-+
-+
-+                      goto ruleSTREx;
-+              }
-+              cnt2++;
-+            }
-+            loop2: ;  /* Jump to here if this rule does not match */
-+        }
-+        /* 55:4: QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE */
-+        mQUOTE(ctx ); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleSTREx;
-+        }
-+
-+        {
-+             SETTEXT(unesc); 
-+        }
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleSTREx; /* Prevent compiler warnings */
-+    ruleSTREx: ;
-+
-+    esc = NULL;
-+
-+}
-+// $ANTLR end STR
-+
-+//   Comes from: 59:9: ( '\\\\' ( '\\\\' | '\\'' ) )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start ESCAPED
-+ *
-+ * Looks to match the characters the constitute the token ESCAPED
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mESCAPED(pDAAPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+        
-+    // DAAP.g:59:9: ( '\\\\' ( '\\\\' | '\\'' ) )
-+    // DAAP.g:59:11: '\\\\' ( '\\\\' | '\\'' )
-+    {
-+        MATCHC('\\'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleESCAPEDEx;
-+        }
-+
-+
-+        // DAAP.g:60:3: ( '\\\\' | '\\'' )
-+        {
-+            int alt3=2;
-+            switch ( LA(1) ) 
-+            {
-+            case '\\':
-+              {
-+                      alt3=1;
-+              }
-+                break;
-+            case '\'':
-+              {
-+                      alt3=2;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 3;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruleESCAPEDEx;
-+            }
-+
-+            switch (alt3) 
-+            {
-+              case 1:
-+                  // DAAP.g:60:5: '\\\\'
-+                  {
-+                      MATCHC('\\'); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleESCAPEDEx;
-+                      }
-+
-+                      {
-+                           SETTEXT(GETTEXT()->factory->newStr8(GETTEXT()->factory, (pANTLR3_UINT8)"\\")); 
-+                      }
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // DAAP.g:61:5: '\\''
-+                  {
-+                      MATCHC('\''); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleESCAPEDEx;
-+                      }
-+
-+                      {
-+                           SETTEXT(GETTEXT()->factory->newStr8(GETTEXT()->factory, (pANTLR3_UINT8)"\'")); 
-+                      }
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+
-+    }
-+
-+
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleESCAPEDEx; /* Prevent compiler warnings */
-+    ruleESCAPEDEx: ;
-+
-+}
-+// $ANTLR end ESCAPED
-+
-+/** This is the entry point in to the lexer from an object that
-+ *  wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
-+ */
-+static void 
-+mTokens(pDAAPLexer ctx)
-+{
-+    {
-+        //  DAAP.g:1:8: ( QUOTE | LPAR | RPAR | OPAND | OPOR | NEWLINE | STR )
-+        
-+        ANTLR3_UINT32 alt4;
-+
-+        alt4=7;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case '\'':
-+              {
-+
-+                      {
-+                          int LA4_1 = LA(2);
-+                          if ( (((LA4_1 >= 0x0000) && (LA4_1 <= '&')) || ((LA4_1 >= '(') && (LA4_1 <= 0xFFFF))) ) 
-+                          {
-+                              alt4=7;
-+                          }
-+                          else 
-+                          {
-+                              alt4=1;    }
-+                      }
-+              }
-+            break;
-+        case '(':
-+              {
-+                      alt4=2;
-+              }
-+            break;
-+        case ')':
-+              {
-+                      alt4=3;
-+              }
-+            break;
-+        case ' ':
-+        case '+':
-+              {
-+                      alt4=4;
-+              }
-+            break;
-+        case ',':
-+              {
-+                      alt4=5;
-+              }
-+            break;
-+        case '\n':
-+        case '\r':
-+              {
-+                      alt4=6;
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 4;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleTokensEx;
-+        }
-+
-+        switch (alt4) 
-+        {
-+      case 1:
-+          // DAAP.g:1:10: QUOTE
-+          {
-+              /* 1:10: QUOTE */
-+              mQUOTE(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // DAAP.g:1:16: LPAR
-+          {
-+              /* 1:16: LPAR */
-+              mLPAR(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 3:
-+          // DAAP.g:1:21: RPAR
-+          {
-+              /* 1:21: RPAR */
-+              mRPAR(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 4:
-+          // DAAP.g:1:26: OPAND
-+          {
-+              /* 1:26: OPAND */
-+              mOPAND(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 5:
-+          // DAAP.g:1:32: OPOR
-+          {
-+              /* 1:32: OPOR */
-+              mOPOR(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 6:
-+          // DAAP.g:1:37: NEWLINE
-+          {
-+              /* 1:37: NEWLINE */
-+              mNEWLINE(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 7:
-+          // DAAP.g:1:45: STR
-+          {
-+              /* 1:45: STR */
-+              mSTR(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+
-+    
-+    goto ruleTokensEx; /* Prevent compiler warnings */
-+ruleTokensEx: ;
-+}
-+
-+/* =========================================================================
-+ * Lexer matching rules end.
-+ * =========================================================================
-+ */
-+/* End of Lexer code
-+ * ================================================
-+ * ================================================
-+ */ 
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/DAAPLexer.h b/src/pregen/DAAPLexer.h
-new file mode 100644
-index 0000000..685a0bc
---- /dev/null
-+++ b/src/pregen/DAAPLexer.h
-@@ -0,0 +1,188 @@
-+/** \file
-+ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : DAAP.g
-+ *     -                            On : 2016-01-01 12:23:41
-+ *     -                 for the lexer : DAAPLexerLexer *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The lexer DAAPLexer has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ * 
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pDAAPLexer, which is returned from a call to DAAPLexerNew().
-+ *
-+ * As this is a generated lexer, it is unlikely you will call it 'manually'. However
-+ * the methods are provided anyway.
-+ * * The methods in pDAAPLexer are  as follows:
-+ *
-+ *  -  void      pDAAPLexer->QUOTE(pDAAPLexer)
-+ *  -  void      pDAAPLexer->LPAR(pDAAPLexer)
-+ *  -  void      pDAAPLexer->RPAR(pDAAPLexer)
-+ *  -  void      pDAAPLexer->OPAND(pDAAPLexer)
-+ *  -  void      pDAAPLexer->OPOR(pDAAPLexer)
-+ *  -  void      pDAAPLexer->NEWLINE(pDAAPLexer)
-+ *  -  void      pDAAPLexer->STR(pDAAPLexer)
-+ *  -  void      pDAAPLexer->ESCAPED(pDAAPLexer)
-+ *  -  void      pDAAPLexer->Tokens(pDAAPLexer)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+#ifndef       _DAAPLexer_H
-+#define _DAAPLexer_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include    <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+ 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct DAAPLexer_Ctx_struct DAAPLexer, * pDAAPLexer;
-+
-+
-+
-+#ifdef        ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
-+//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
-+//          initialized but unused variable                                   - tree rewrite variables declared but not needed
-+//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
-+//          potentially unitialized variable used                     - retval always returned from a rule 
-+//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+
-+/** Context tracking structure for DAAPLexer
-+ */
-+struct DAAPLexer_Ctx_struct
-+{
-+    /** Built in ANTLR3 context tracker contains all the generic elements
-+     *  required for context tracking.
-+     */
-+    pANTLR3_LEXER    pLexer;
-+
-+
-+     void (*mQUOTE)   (struct DAAPLexer_Ctx_struct * ctx);
-+     void (*mLPAR)    (struct DAAPLexer_Ctx_struct * ctx);
-+     void (*mRPAR)    (struct DAAPLexer_Ctx_struct * ctx);
-+     void (*mOPAND)   (struct DAAPLexer_Ctx_struct * ctx);
-+     void (*mOPOR)    (struct DAAPLexer_Ctx_struct * ctx);
-+     void (*mNEWLINE) (struct DAAPLexer_Ctx_struct * ctx);
-+     void (*mSTR)     (struct DAAPLexer_Ctx_struct * ctx);
-+     void (*mESCAPED) (struct DAAPLexer_Ctx_struct * ctx);
-+     void (*mTokens)  (struct DAAPLexer_Ctx_struct * ctx);    const char * (*getGrammarFileName)();
-+    void          (*free)   (struct DAAPLexer_Ctx_struct * ctx);
-+        
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pDAAPLexer DAAPLexerNew         (pANTLR3_INPUT_STREAM instream);
-+ANTLR3_API pDAAPLexer DAAPLexerNewSSD      (pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the lexer will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef        EOF
-+#undef        EOF
-+#endif
-+#ifdef        Tokens
-+#undef        Tokens
-+#endif 
-+#define STR      9
-+#define QUOTE      10
-+#define NEWLINE      4
-+#define LPAR      7
-+#define OPOR      5
-+#define RPAR      8
-+#define ESCAPED      11
-+#define OPAND      6
-+#define EOF      -1
-+#ifdef        EOF
-+#undef        EOF
-+#define       EOF     ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for DAAPLexer
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/DAAPParser.c b/src/pregen/DAAPParser.c
-new file mode 100644
-index 0000000..1091f05
---- /dev/null
-+++ b/src/pregen/DAAPParser.c
-@@ -0,0 +1,1014 @@
-+/** \file
-+ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : DAAP.g
-+ *     -                            On : 2016-01-01 12:23:41
-+ *     -                for the parser : DAAPParserParser *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include    "DAAPParser.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+ 
-+#define               CTX     ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef        SCOPE_TYPE
-+#undef        SCOPE_STACK
-+#undef        SCOPE_TOP
-+#define       SCOPE_TYPE(scope)   pDAAPParser_##scope##_SCOPE
-+#define SCOPE_STACK(scope)  pDAAPParser_##scope##Stack
-+#define       SCOPE_TOP(scope)    ctx->pDAAPParser_##scope##Top
-+#define       SCOPE_SIZE(scope)               ctx->pDAAPParser_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+/* Macros for accessing things in the parser
-+ */
-+ 
-+#undef            PARSER                  
-+#undef            RECOGNIZER              
-+#undef            HAVEPARSEDRULE
-+#undef                MEMOIZE
-+#undef            INPUT
-+#undef            STRSTREAM
-+#undef            HASEXCEPTION
-+#undef            EXCEPTION
-+#undef            MATCHT
-+#undef            MATCHANYT
-+#undef            FOLLOWSTACK
-+#undef            FOLLOWPUSH
-+#undef            FOLLOWPOP
-+#undef            PRECOVER
-+#undef            PREPORTERROR
-+#undef            LA
-+#undef            LT
-+#undef            CONSTRUCTEX
-+#undef            CONSUME
-+#undef            MARK
-+#undef            REWIND
-+#undef            REWINDLAST
-+#undef            PERRORRECOVERY
-+#undef            HASFAILED
-+#undef            FAILEDFLAG
-+#undef            RECOVERFROMMISMATCHEDSET
-+#undef            RECOVERFROMMISMATCHEDELEMENT
-+#undef                INDEX
-+#undef      ADAPTOR
-+#undef                SEEK
-+#undef            RULEMEMO                
-+#undef                DBG
-+
-+#define           PARSER                                                      ctx->pParser  
-+#define           RECOGNIZER                                          PARSER->rec
-+#define               PSRSTATE                                                RECOGNIZER->state
-+#define           HAVEPARSEDRULE(r)                           RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define               MEMOIZE(ri,si)                                  RECOGNIZER->memoize(RECOGNIZER, ri, si)
-+#define           INPUT                                                       PARSER->tstream
-+#define           STRSTREAM                                           INPUT
-+#define               ISTREAM                                                 INPUT->istream
-+#define               INDEX()                                                 ISTREAM->index(INPUT->istream)
-+#define           HASEXCEPTION()                                      (PSRSTATE->error == ANTLR3_TRUE)
-+#define           EXCEPTION                                           PSRSTATE->exception
-+#define           MATCHT(t, fs)                                       RECOGNIZER->match(RECOGNIZER, t, fs)
-+#define           MATCHANYT()                                         RECOGNIZER->matchAny(RECOGNIZER)
-+#define           FOLLOWSTACK                                     PSRSTATE->following
-+#define           FOLLOWPUSH(x)                                       FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
-+#define           FOLLOWPOP()                                         FOLLOWSTACK->pop(FOLLOWSTACK)
-+#define           PRECOVER()                                          RECOGNIZER->recover(RECOGNIZER)
-+#define           PREPORTERROR()                                      RECOGNIZER->reportError(RECOGNIZER)
-+#define           LA(n)                                                       INPUT->istream->_LA(ISTREAM, n)
-+#define           LT(n)                                                       INPUT->_LT(INPUT, n)
-+#define           CONSTRUCTEX()                                       RECOGNIZER->exConstruct(RECOGNIZER)
-+#define           CONSUME()                                           ISTREAM->consume(ISTREAM)
-+#define           MARK()                                                      ISTREAM->mark(ISTREAM)
-+#define           REWIND(m)                                           ISTREAM->rewind(ISTREAM, m)
-+#define           REWINDLAST()                                        ISTREAM->rewindLast(ISTREAM)
-+#define               SEEK(n)                                                 ISTREAM->seek(ISTREAM, n)
-+#define           PERRORRECOVERY                                      PSRSTATE->errorRecovery
-+#define           FAILEDFLAG                                          PSRSTATE->failed
-+#define           HASFAILED()                                         (FAILEDFLAG == ANTLR3_TRUE)
-+#define           BACKTRACKING                                        PSRSTATE->backtracking
-+#define           RECOVERFROMMISMATCHEDSET(s)         RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
-+#define           RECOVERFROMMISMATCHEDELEMENT(e)     RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
-+#define     ADAPTOR                         ctx->adaptor
-+#define               RULEMEMO                                                PSRSTATE->ruleMemo
-+#define               DBG                                                             RECOGNIZER->debugger
-+
-+#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define           UP      ANTLR3_TOKEN_UP
-+#define           DOWN    ANTLR3_TOKEN_DOWN
-+#define           EOR     ANTLR3_TOKEN_EOR
-+#define           INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+
-+/** \brief Table of all token names in symbolic order, mainly used for
-+ *         error reporting.
-+ */
-+pANTLR3_UINT8   DAAPParserTokenNames[8+4]
-+     = {
-+        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
-+        (pANTLR3_UINT8) "<EOR>",
-+        (pANTLR3_UINT8) "<DOWN>", 
-+        (pANTLR3_UINT8) "<UP>", 
-+        (pANTLR3_UINT8) "NEWLINE",
-+        (pANTLR3_UINT8) "OPOR",
-+        (pANTLR3_UINT8) "OPAND",
-+        (pANTLR3_UINT8) "LPAR",
-+        (pANTLR3_UINT8) "RPAR",
-+        (pANTLR3_UINT8) "STR",
-+        (pANTLR3_UINT8) "QUOTE",
-+        (pANTLR3_UINT8) "ESCAPED"
-+       };
-+
-+        
-+
-+// Forward declare the locally static matching functions we have generated.
-+//
-+static DAAPParser_query_return        query    (pDAAPParser ctx);
-+static DAAPParser_expr_return expr    (pDAAPParser ctx);
-+static DAAPParser_aexpr_return        aexpr    (pDAAPParser ctx);
-+static DAAPParser_crit_return crit    (pDAAPParser ctx);
-+static void   DAAPParserFree(pDAAPParser ctx);
-+/* For use in tree output where we are accumulating rule labels via label += ruleRef
-+ * we need a function that knows how to free a return scope when the list is destroyed. 
-+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
-+ */
-+static        void ANTLR3_CDECL freeScope(void * scope)
-+{
-+    ANTLR3_FREE(scope);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "DAAP.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+      return fileName;
-+}
-+/** \brief Create a new DAAPParser parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pDAAPParser
-+DAAPParserNew   (pANTLR3_COMMON_TOKEN_STREAM instream)
-+{
-+      // See if we can create a new parser with the standard constructor
-+      //
-+      return DAAPParserNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new DAAPParser parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pDAAPParser
-+DAAPParserNewSSD   (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+    pDAAPParser ctx;      /* Context structure we will build and return   */
-+    
-+    ctx       = (pDAAPParser) ANTLR3_CALLOC(1, sizeof(DAAPParser));
-+    
-+    if        (ctx == NULL)
-+    {
-+              // Failed to allocate memory for parser context
-+              //
-+        return  NULL;
-+    }
-+    
-+    /* -------------------------------------------------------------------
-+     * Memory for basic structure is allocated, now to fill in
-+     * the base ANTLR3 structures. We initialize the function pointers
-+     * for the standard ANTLR3 parser function set, but upon return
-+     * from here, the programmer may set the pointers to provide custom
-+     * implementations of each function. 
-+     *
-+     * We don't use the macros defined in DAAPParser.h here, in order that you can get a sense
-+     * of what goes where.
-+     */
-+
-+    /* Create a base parser/recognizer, using the supplied token stream
-+     */
-+    ctx->pParser          = antlr3ParserNewStream(ANTLR3_SIZE_HINT, instream->tstream, state);
-+    /* Install the implementation of our DAAPParser interface
-+     */
-+    ctx->query        = query;
-+    ctx->expr = expr;
-+    ctx->aexpr        = aexpr;
-+    ctx->crit = crit;
-+    ctx->free                 = DAAPParserFree;
-+    ctx->getGrammarFileName   = getGrammarFileName;
-+    
-+    /* Install the scope pushing methods.
-+     */
-+    ADAPTOR   = ANTLR3_TREE_ADAPTORNew(instream->tstream->tokenSource->strFactory);
-+    ctx->vectors      = antlr3VectorFactoryNew(0);
-+    
-+
-+      
-+    /* Install the token table
-+     */
-+    PSRSTATE->tokenNames   = DAAPParserTokenNames;
-+    
-+    
-+    /* Return the newly built parser to the caller
-+     */
-+    return  ctx;
-+}
-+
-+/** Free the parser resources
-+ */
-+ static void
-+ DAAPParserFree(pDAAPParser ctx)
-+ {
-+    /* Free any scope memory
-+     */
-+    
-+    ctx->vectors->close(ctx->vectors);
-+    /* We created the adaptor so we must free it
-+     */
-+    ADAPTOR->free(ADAPTOR);
-+      // Free this parser
-+      //
-+    ctx->pParser->free(ctx->pParser);
-+    ANTLR3_FREE(ctx);
-+
-+    /* Everything is released, so we can return
-+     */
-+    return;
-+ }
-+ 
-+/** Return token names used by this parser
-+ *
-+ * The returned pointer is used as an index into the token names table (using the token 
-+ * number as the index).
-+ * 
-+ * \return Pointer to first char * in the table.
-+ */
-+static pANTLR3_UINT8    *getTokenNames() 
-+{
-+        return DAAPParserTokenNames; 
-+}
-+
-+    
-+/* Declare the bitsets
-+ */
-+
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_query42  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_query42_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000010) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_query42     = { FOLLOW_expr_in_query42_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NEWLINE_in_query44  */
-+static        ANTLR3_BITWORD FOLLOW_NEWLINE_in_query44_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_NEWLINE_in_query44  = { FOLLOW_NEWLINE_in_query44_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_query47  */
-+static        ANTLR3_BITWORD FOLLOW_EOF_in_query47_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_EOF_in_query47      = { FOLLOW_EOF_in_query47_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expr62  */
-+static        ANTLR3_BITWORD FOLLOW_aexpr_in_expr62_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000022) };
-+static  ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expr62     = { FOLLOW_aexpr_in_expr62_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OPOR_in_expr65  */
-+static        ANTLR3_BITWORD FOLLOW_OPOR_in_expr65_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000280) };
-+static  ANTLR3_BITSET_LIST FOLLOW_OPOR_in_expr65      = { FOLLOW_OPOR_in_expr65_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expr68  */
-+static        ANTLR3_BITWORD FOLLOW_aexpr_in_expr68_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000022) };
-+static  ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expr68     = { FOLLOW_aexpr_in_expr68_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_aexpr80  */
-+static        ANTLR3_BITWORD FOLLOW_crit_in_aexpr80_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000042) };
-+static  ANTLR3_BITSET_LIST FOLLOW_crit_in_aexpr80     = { FOLLOW_crit_in_aexpr80_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OPAND_in_aexpr83  */
-+static        ANTLR3_BITWORD FOLLOW_OPAND_in_aexpr83_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000280) };
-+static  ANTLR3_BITSET_LIST FOLLOW_OPAND_in_aexpr83    = { FOLLOW_OPAND_in_aexpr83_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_aexpr86  */
-+static        ANTLR3_BITWORD FOLLOW_crit_in_aexpr86_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000042) };
-+static  ANTLR3_BITSET_LIST FOLLOW_crit_in_aexpr86     = { FOLLOW_crit_in_aexpr86_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAR_in_crit98  */
-+static        ANTLR3_BITWORD FOLLOW_LPAR_in_crit98_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000280) };
-+static  ANTLR3_BITSET_LIST FOLLOW_LPAR_in_crit98      = { FOLLOW_LPAR_in_crit98_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_crit100  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_crit100_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000100) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_crit100     = { FOLLOW_expr_in_crit100_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAR_in_crit102  */
-+static        ANTLR3_BITWORD FOLLOW_RPAR_in_crit102_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_RPAR_in_crit102     = { FOLLOW_RPAR_in_crit102_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_crit112  */
-+static        ANTLR3_BITWORD FOLLOW_STR_in_crit112_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STR_in_crit112      = { FOLLOW_STR_in_crit112_bits, 1       };
-+     
-+
-+ 
-+ 
-+/* ==============================================
-+ * Parsing rules
-+ */
-+/** 
-+ * $ANTLR start query
-+ * DAAP.g:27:1: query : expr ( NEWLINE )? EOF -> expr ;
-+ */
-+static DAAPParser_query_return
-+query(pDAAPParser ctx)
-+{   
-+    DAAPParser_query_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    NEWLINE2;
-+    pANTLR3_COMMON_TOKEN    EOF3;
-+    DAAPParser_expr_return expr1;
-+    #undef    RETURN_TYPE_expr1
-+    #define   RETURN_TYPE_expr1 DAAPParser_expr_return
-+
-+    pANTLR3_BASE_TREE NEWLINE2_tree;
-+    pANTLR3_BASE_TREE EOF3_tree;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_NEWLINE;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_EOF;
-+    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expr;
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    NEWLINE2       = NULL;
-+    EOF3       = NULL;
-+    expr1.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    NEWLINE2_tree   = NULL;
-+    EOF3_tree   = NULL;
-+
-+    stream_NEWLINE   = NULL;
-+    #define CREATE_stream_NEWLINE  if (stream_NEWLINE == NULL) {stream_NEWLINE = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token NEWLINE"); } 
-+    stream_EOF   = NULL;
-+    #define CREATE_stream_EOF  if (stream_EOF == NULL) {stream_EOF = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token EOF"); } 
-+    stream_expr   = NULL;
-+    #define CREATE_stream_expr  if (stream_expr == NULL) {stream_expr = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expr"); }
-+
-+    retval.tree  = NULL;
-+    {
-+        // DAAP.g:27:7: ( expr ( NEWLINE )? EOF -> expr )
-+        // DAAP.g:27:9: expr ( NEWLINE )? EOF
-+        {
-+            FOLLOWPUSH(FOLLOW_expr_in_query42);
-+            expr1=expr(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto rulequeryEx;
-+            }
-+
-+            CREATE_stream_expr; stream_expr->add(stream_expr, expr1.tree, NULL);
-+
-+            // DAAP.g:27:14: ( NEWLINE )?
-+            {
-+                int alt1=2;
-+                switch ( LA(1) ) 
-+                {
-+                    case NEWLINE:
-+                      {
-+                              alt1=1;
-+                      }
-+                        break;
-+                }
-+
-+                switch (alt1) 
-+                {
-+              case 1:
-+                  // DAAP.g:27:14: NEWLINE
-+                  {
-+                      NEWLINE2 = (pANTLR3_COMMON_TOKEN) MATCHT(NEWLINE, &FOLLOW_NEWLINE_in_query44); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulequeryEx;
-+                      }
-+                       
-+                      CREATE_stream_NEWLINE; stream_NEWLINE->add(stream_NEWLINE, NEWLINE2, NULL);
-+
-+
-+                  }
-+                  break;
-+
-+                }
-+            }
-+            EOF3 = (pANTLR3_COMMON_TOKEN) MATCHT(EOF, &FOLLOW_EOF_in_query47); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto rulequeryEx;
-+            }
-+             
-+            CREATE_stream_EOF; stream_EOF->add(stream_EOF, EOF3, NULL);
-+
-+
-+             
-+            /* AST REWRITE
-+             * elements          : expr
-+             * token labels      : 
-+             * rule labels       : retval
-+             * token list labels : 
-+             * rule list labels  : 
-+             */
-+            {
-+              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+              retval.tree    = root_0;
-+              // 27:27: -> expr
-+              {
-+                  ADAPTOR->addChild(ADAPTOR, root_0, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
-+
-+              }
-+
-+              retval.tree = root_0; // set result root
-+              if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+            }
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto rulequeryEx; /* Prevent compiler warnings */
-+    rulequeryEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+        if (stream_NEWLINE != NULL) stream_NEWLINE->free(stream_NEWLINE);
-+        if (stream_EOF != NULL) stream_EOF->free(stream_EOF);
-+        if (stream_expr != NULL) stream_expr->free(stream_expr);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end query */
-+
-+/** 
-+ * $ANTLR start expr
-+ * DAAP.g:30:1: expr : aexpr ( OPOR aexpr )* ;
-+ */
-+static DAAPParser_expr_return
-+expr(pDAAPParser ctx)
-+{   
-+    DAAPParser_expr_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    OPOR5;
-+    DAAPParser_aexpr_return aexpr4;
-+    #undef    RETURN_TYPE_aexpr4
-+    #define   RETURN_TYPE_aexpr4 DAAPParser_aexpr_return
-+
-+    DAAPParser_aexpr_return aexpr6;
-+    #undef    RETURN_TYPE_aexpr6
-+    #define   RETURN_TYPE_aexpr6 DAAPParser_aexpr_return
-+
-+    pANTLR3_BASE_TREE OPOR5_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    OPOR5       = NULL;
-+    aexpr4.tree = NULL;
-+
-+    aexpr6.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    OPOR5_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        // DAAP.g:30:6: ( aexpr ( OPOR aexpr )* )
-+        // DAAP.g:30:8: aexpr ( OPOR aexpr )*
-+        {
-+            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+            FOLLOWPUSH(FOLLOW_aexpr_in_expr62);
-+            aexpr4=aexpr(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleexprEx;
-+            }
-+
-+            ADAPTOR->addChild(ADAPTOR, root_0, aexpr4.tree);
-+
-+            // DAAP.g:30:14: ( OPOR aexpr )*
-+
-+            for (;;)
-+            {
-+                int alt2=2;
-+                switch ( LA(1) ) 
-+                {
-+                case OPOR:
-+                      {
-+                              alt2=1;
-+                      }
-+                    break;
-+
-+                }
-+
-+                switch (alt2) 
-+                {
-+              case 1:
-+                  // DAAP.g:30:15: OPOR aexpr
-+                  {
-+                      OPOR5 = (pANTLR3_COMMON_TOKEN) MATCHT(OPOR, &FOLLOW_OPOR_in_expr65); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      OPOR5_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, OPOR5));
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, OPOR5_tree, root_0));
-+
-+                      FOLLOWPUSH(FOLLOW_aexpr_in_expr68);
-+                      aexpr6=aexpr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, aexpr6.tree);
-+
-+                  }
-+                  break;
-+
-+              default:
-+                  goto loop2; /* break out of the loop */
-+                  break;
-+                }
-+            }
-+            loop2: ; /* Jump out to here if this rule does not match */
-+
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleexprEx; /* Prevent compiler warnings */
-+    ruleexprEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end expr */
-+
-+/** 
-+ * $ANTLR start aexpr
-+ * DAAP.g:33:1: aexpr : crit ( OPAND crit )* ;
-+ */
-+static DAAPParser_aexpr_return
-+aexpr(pDAAPParser ctx)
-+{   
-+    DAAPParser_aexpr_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    OPAND8;
-+    DAAPParser_crit_return crit7;
-+    #undef    RETURN_TYPE_crit7
-+    #define   RETURN_TYPE_crit7 DAAPParser_crit_return
-+
-+    DAAPParser_crit_return crit9;
-+    #undef    RETURN_TYPE_crit9
-+    #define   RETURN_TYPE_crit9 DAAPParser_crit_return
-+
-+    pANTLR3_BASE_TREE OPAND8_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    OPAND8       = NULL;
-+    crit7.tree = NULL;
-+
-+    crit9.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    OPAND8_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        // DAAP.g:33:7: ( crit ( OPAND crit )* )
-+        // DAAP.g:33:9: crit ( OPAND crit )*
-+        {
-+            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+            FOLLOWPUSH(FOLLOW_crit_in_aexpr80);
-+            crit7=crit(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleaexprEx;
-+            }
-+
-+            ADAPTOR->addChild(ADAPTOR, root_0, crit7.tree);
-+
-+            // DAAP.g:33:14: ( OPAND crit )*
-+
-+            for (;;)
-+            {
-+                int alt3=2;
-+                switch ( LA(1) ) 
-+                {
-+                case OPAND:
-+                      {
-+                              alt3=1;
-+                      }
-+                    break;
-+
-+                }
-+
-+                switch (alt3) 
-+                {
-+              case 1:
-+                  // DAAP.g:33:15: OPAND crit
-+                  {
-+                      OPAND8 = (pANTLR3_COMMON_TOKEN) MATCHT(OPAND, &FOLLOW_OPAND_in_aexpr83); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleaexprEx;
-+                      }
-+
-+                      OPAND8_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, OPAND8));
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, OPAND8_tree, root_0));
-+
-+                      FOLLOWPUSH(FOLLOW_crit_in_aexpr86);
-+                      crit9=crit(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleaexprEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, crit9.tree);
-+
-+                  }
-+                  break;
-+
-+              default:
-+                  goto loop3; /* break out of the loop */
-+                  break;
-+                }
-+            }
-+            loop3: ; /* Jump out to here if this rule does not match */
-+
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleaexprEx; /* Prevent compiler warnings */
-+    ruleaexprEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end aexpr */
-+
-+/** 
-+ * $ANTLR start crit
-+ * DAAP.g:36:1: crit : ( LPAR expr RPAR -> expr | STR );
-+ */
-+static DAAPParser_crit_return
-+crit(pDAAPParser ctx)
-+{   
-+    DAAPParser_crit_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    LPAR10;
-+    pANTLR3_COMMON_TOKEN    RPAR12;
-+    pANTLR3_COMMON_TOKEN    STR13;
-+    DAAPParser_expr_return expr11;
-+    #undef    RETURN_TYPE_expr11
-+    #define   RETURN_TYPE_expr11 DAAPParser_expr_return
-+
-+    pANTLR3_BASE_TREE LPAR10_tree;
-+    pANTLR3_BASE_TREE RPAR12_tree;
-+    pANTLR3_BASE_TREE STR13_tree;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_RPAR;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LPAR;
-+    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expr;
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    LPAR10       = NULL;
-+    RPAR12       = NULL;
-+    STR13       = NULL;
-+    expr11.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    LPAR10_tree   = NULL;
-+    RPAR12_tree   = NULL;
-+    STR13_tree   = NULL;
-+
-+    stream_RPAR   = NULL;
-+    #define CREATE_stream_RPAR  if (stream_RPAR == NULL) {stream_RPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token RPAR"); } 
-+    stream_LPAR   = NULL;
-+    #define CREATE_stream_LPAR  if (stream_LPAR == NULL) {stream_LPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LPAR"); } 
-+    stream_expr   = NULL;
-+    #define CREATE_stream_expr  if (stream_expr == NULL) {stream_expr = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expr"); }
-+
-+    retval.tree  = NULL;
-+    {
-+        {
-+            //  DAAP.g:36:6: ( LPAR expr RPAR -> expr | STR )
-+            
-+            ANTLR3_UINT32 alt4;
-+
-+            alt4=2;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case LPAR:
-+              {
-+                      alt4=1;
-+              }
-+                break;
-+            case STR:
-+              {
-+                      alt4=2;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 4;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto rulecritEx;
-+            }
-+
-+            switch (alt4) 
-+            {
-+              case 1:
-+                  // DAAP.g:36:8: LPAR expr RPAR
-+                  {
-+                      LPAR10 = (pANTLR3_COMMON_TOKEN) MATCHT(LPAR, &FOLLOW_LPAR_in_crit98); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+                       
-+                      CREATE_stream_LPAR; stream_LPAR->add(stream_LPAR, LPAR10, NULL);
-+
-+                      FOLLOWPUSH(FOLLOW_expr_in_crit100);
-+                      expr11=expr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      CREATE_stream_expr; stream_expr->add(stream_expr, expr11.tree, NULL);
-+                      RPAR12 = (pANTLR3_COMMON_TOKEN) MATCHT(RPAR, &FOLLOW_RPAR_in_crit102); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+                       
-+                      CREATE_stream_RPAR; stream_RPAR->add(stream_RPAR, RPAR12, NULL);
-+
-+
-+                       
-+                      /* AST REWRITE
-+                       * elements          : expr
-+                       * token labels      : 
-+                       * rule labels       : retval
-+                       * token list labels : 
-+                       * rule list labels  : 
-+                       */
-+                      {
-+                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                              retval.tree    = root_0;
-+                              // 36:24: -> expr
-+                              {
-+                                  ADAPTOR->addChild(ADAPTOR, root_0, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
-+
-+                              }
-+
-+                              retval.tree = root_0; // set result root
-+                              if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+                      }
-+                  }
-+                  break;
-+              case 2:
-+                  // DAAP.g:37:4: STR
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      STR13 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_crit112); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      STR13_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STR13));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, STR13_tree);
-+
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto rulecritEx; /* Prevent compiler warnings */
-+    rulecritEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+        if (stream_RPAR != NULL) stream_RPAR->free(stream_RPAR);
-+        if (stream_LPAR != NULL) stream_LPAR->free(stream_LPAR);
-+        if (stream_expr != NULL) stream_expr->free(stream_expr);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end crit */
-+/* End of parsing rules
-+ * ==============================================
-+ */
-+
-+/* ==============================================
-+ * Syntactic predicates
-+ */
-+/* End of syntactic predicates
-+ * ==============================================
-+ */
-+
-+ 
-+ 
-+
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/DAAPParser.h b/src/pregen/DAAPParser.h
-new file mode 100644
-index 0000000..e206694
---- /dev/null
-+++ b/src/pregen/DAAPParser.h
-@@ -0,0 +1,226 @@
-+/** \file
-+ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : DAAP.g
-+ *     -                            On : 2016-01-01 12:23:41
-+ *     -                for the parser : DAAPParserParser *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The parser DAAPParser has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ * 
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pDAAPParser, which is returned from a call to DAAPParserNew().
-+ *
-+ * The methods in pDAAPParser are  as follows:
-+ *
-+ *  - DAAPParser_query_return      pDAAPParser->query(pDAAPParser)
-+ *  - DAAPParser_expr_return      pDAAPParser->expr(pDAAPParser)
-+ *  - DAAPParser_aexpr_return      pDAAPParser->aexpr(pDAAPParser)
-+ *  - DAAPParser_crit_return      pDAAPParser->crit(pDAAPParser)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+#ifndef       _DAAPParser_H
-+#define _DAAPParser_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include    <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+ 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct DAAPParser_Ctx_struct DAAPParser, * pDAAPParser;
-+
-+
-+
-+#ifdef        ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
-+//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
-+//          initialized but unused variable                                   - tree rewrite variables declared but not needed
-+//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
-+//          potentially unitialized variable used                     - retval always returned from a rule 
-+//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+typedef struct DAAPParser_query_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    DAAPParser_query_return;
-+
-+typedef struct DAAPParser_expr_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    DAAPParser_expr_return;
-+
-+typedef struct DAAPParser_aexpr_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    DAAPParser_aexpr_return;
-+
-+typedef struct DAAPParser_crit_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    DAAPParser_crit_return;
-+
-+
-+
-+/** Context tracking structure for DAAPParser
-+ */
-+struct DAAPParser_Ctx_struct
-+{
-+    /** Built in ANTLR3 context tracker contains all the generic elements
-+     *  required for context tracking.
-+     */
-+    pANTLR3_PARSER   pParser;
-+
-+
-+     DAAPParser_query_return (*query) (struct DAAPParser_Ctx_struct * ctx);
-+     DAAPParser_expr_return (*expr)   (struct DAAPParser_Ctx_struct * ctx);
-+     DAAPParser_aexpr_return (*aexpr) (struct DAAPParser_Ctx_struct * ctx);
-+     DAAPParser_crit_return (*crit)   (struct DAAPParser_Ctx_struct * ctx);
-+    // Delegated rules
-+    const char * (*getGrammarFileName)();
-+    void          (*free)   (struct DAAPParser_Ctx_struct * ctx);
-+    /* @headerFile.members() */
-+    pANTLR3_BASE_TREE_ADAPTOR adaptor;
-+    pANTLR3_VECTOR_FACTORY            vectors;
-+    /* End @headerFile.members() */
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pDAAPParser DAAPParserNew         (pANTLR3_COMMON_TOKEN_STREAM instream);
-+ANTLR3_API pDAAPParser DAAPParserNewSSD      (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the parser will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef        EOF
-+#undef        EOF
-+#endif
-+#ifdef        Tokens
-+#undef        Tokens
-+#endif 
-+#define STR      9
-+#define QUOTE      10
-+#define LPAR      7
-+#define NEWLINE      4
-+#define OPOR      5
-+#define RPAR      8
-+#define ESCAPED      11
-+#define OPAND      6
-+#define EOF      -1
-+#ifdef        EOF
-+#undef        EOF
-+#define       EOF     ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for DAAPParser
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/RSP.u b/src/pregen/RSP.u
-new file mode 100644
-index 0000000..89256ff
---- /dev/null
-+++ b/src/pregen/RSP.u
-@@ -0,0 +1,6 @@
-+RSPParser.c : RSP.g
-+./RSP.tokens : RSP.g
-+RSPParser.h : RSP.g
-+RSPLexer.c : RSP.g
-+RSPLexer.h : RSP.g
-+ANTLR_PRODUCTS += RSPParser.c ./RSP.tokens RSPParser.h RSPLexer.c RSPLexer.h 
-\ No newline at end of file
-diff --git a/src/pregen/RSP2SQL.c b/src/pregen/RSP2SQL.c
-new file mode 100644
-index 0000000..40958f9
---- /dev/null
-+++ b/src/pregen/RSP2SQL.c
-@@ -0,0 +1,2546 @@
-+/** \file
-+ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : RSP2SQL.g
-+ *     -                            On : 2016-01-01 12:23:43
-+ *     -           for the tree parser : RSP2SQLTreeParser *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+
-+/* =============================================================================
-+ * This is what the grammar programmer asked us to put at the top of every file.
-+ */
-+
-+      /* Needs #define _GNU_SOURCE for strptime() */
-+
-+      #include <stdio.h>
-+      #include <string.h>
-+      #include <time.h>
-+      #include <stdint.h>
-+
-+      #include "logger.h"
-+      #include "db.h"
-+      #include "misc.h"
-+      #include "rsp_query.h"
-+
-+/* End of Header action.
-+ * =============================================================================
-+ */
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include    "RSP2SQL.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+ 
-+#define               CTX     ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef        SCOPE_TYPE
-+#undef        SCOPE_STACK
-+#undef        SCOPE_TOP
-+#define       SCOPE_TYPE(scope)   pRSP2SQL_##scope##_SCOPE
-+#define SCOPE_STACK(scope)  pRSP2SQL_##scope##Stack
-+#define       SCOPE_TOP(scope)    ctx->pRSP2SQL_##scope##Top
-+#define       SCOPE_SIZE(scope)               ctx->pRSP2SQL_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+/* Macros for accessing things in the parser
-+ */
-+ 
-+#undef            PARSER
-+#undef            RECOGNIZER              
-+#undef            HAVEPARSEDRULE
-+#undef            INPUT
-+#undef            STRSTREAM
-+#undef            HASEXCEPTION
-+#undef            EXCEPTION
-+#undef            MATCHT
-+#undef            MATCHANYT
-+#undef            FOLLOWSTACK
-+#undef            FOLLOWPUSH
-+#undef            FOLLOWPOP
-+#undef            PRECOVER
-+#undef            PREPORTERROR
-+#undef            LA
-+#undef            LT
-+#undef            CONSTRUCTEX
-+#undef            CONSUME
-+#undef            MARK
-+#undef            REWIND
-+#undef            REWINDLAST
-+#undef            PERRORRECOVERY
-+#undef            HASFAILED
-+#undef            FAILEDFLAG
-+#undef            RECOVERFROMMISMATCHEDSET
-+#undef            RECOVERFROMMISMATCHEDELEMENT
-+#undef            BACKTRACKING
-+#undef      ADAPTOR
-+#undef            RULEMEMO            
-+#undef                SEEK    
-+#undef                INDEX
-+#undef                DBG
-+
-+#define           PARSER                                                      ctx->pTreeParser  
-+#define           RECOGNIZER                                          PARSER->rec
-+#define               PSRSTATE                                                RECOGNIZER->state
-+#define           HAVEPARSEDRULE(r)                           RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define           INPUT                                                       PARSER->ctnstream
-+#define               ISTREAM                                                 INPUT->tnstream->istream
-+#define           STRSTREAM                                           INPUT->tnstream
-+#define           HASEXCEPTION()                                      (PSRSTATE->error == ANTLR3_TRUE)
-+#define           EXCEPTION                                           PSRSTATE->exception
-+#define           MATCHT(t, fs)                                       RECOGNIZER->match(RECOGNIZER, t, fs)
-+#define           MATCHANYT()                                         RECOGNIZER->matchAny(RECOGNIZER)
-+#define           FOLLOWSTACK                                     PSRSTATE->following
-+#define           FOLLOWPUSH(x)                                       FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
-+#define           FOLLOWPOP()                                         FOLLOWSTACK->pop(FOLLOWSTACK)
-+#define           PRECOVER()                                          RECOGNIZER->recover(RECOGNIZER)
-+#define           PREPORTERROR()                                      RECOGNIZER->reportError(RECOGNIZER)
-+#define           LA(n)                                                       ISTREAM->_LA(ISTREAM, n)
-+#define           LT(n)                                                       INPUT->tnstream->_LT(INPUT->tnstream, n)
-+#define           CONSTRUCTEX()                                       RECOGNIZER->exConstruct(RECOGNIZER)
-+#define           CONSUME()                                           ISTREAM->consume(ISTREAM)
-+#define           MARK()                                                      ISTREAM->mark(ISTREAM)
-+#define           REWIND(m)                                           ISTREAM->rewind(ISTREAM, m)
-+#define           REWINDLAST()                                        ISTREAM->rewindLast(ISTREAM)
-+#define           PERRORRECOVERY                                      PSRSTATE->errorRecovery
-+#define           FAILEDFLAG                                          PSRSTATE->failed
-+#define           HASFAILED()                                         (FAILEDFLAG == ANTLR3_TRUE)
-+#define           BACKTRACKING                                        PSRSTATE->backtracking
-+#define           RECOVERFROMMISMATCHEDSET(s)         RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
-+#define           RECOVERFROMMISMATCHEDELEMENT(e)     RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
-+#define     ADAPTOR                         INPUT->adaptor
-+#define               RULEMEMO                                                PSRSTATE->ruleMemo
-+#define               SEEK(n)                                                 ISTREAM->seek(ISTREAM, n)
-+#define               INDEX()                                                 ISTREAM->index(ISTREAM)
-+#define               DBG                                                             RECOGNIZER->debugger
-+
-+
-+#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define           UP      ANTLR3_TOKEN_UP
-+#define           DOWN    ANTLR3_TOKEN_DOWN
-+#define           EOR     ANTLR3_TOKEN_EOR
-+#define           INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+
-+/** \brief Table of all token names in symbolic order, mainly used for
-+ *         error reporting.
-+ */
-+pANTLR3_UINT8   RSP2SQLTokenNames[30+4]
-+     = {
-+        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
-+        (pANTLR3_UINT8) "<EOR>",
-+        (pANTLR3_UINT8) "<DOWN>", 
-+        (pANTLR3_UINT8) "<UP>", 
-+        (pANTLR3_UINT8) "NEWLINE",
-+        (pANTLR3_UINT8) "OR",
-+        (pANTLR3_UINT8) "AND",
-+        (pANTLR3_UINT8) "LPAR",
-+        (pANTLR3_UINT8) "RPAR",
-+        (pANTLR3_UINT8) "FIELD",
-+        (pANTLR3_UINT8) "STR",
-+        (pANTLR3_UINT8) "NOT",
-+        (pANTLR3_UINT8) "EQUAL",
-+        (pANTLR3_UINT8) "INCLUDES",
-+        (pANTLR3_UINT8) "STARTSW",
-+        (pANTLR3_UINT8) "ENDSW",
-+        (pANTLR3_UINT8) "INT",
-+        (pANTLR3_UINT8) "LESS",
-+        (pANTLR3_UINT8) "GREATER",
-+        (pANTLR3_UINT8) "LTE",
-+        (pANTLR3_UINT8) "GTE",
-+        (pANTLR3_UINT8) "BEFORE",
-+        (pANTLR3_UINT8) "AFTER",
-+        (pANTLR3_UINT8) "DATE",
-+        (pANTLR3_UINT8) "TODAY",
-+        (pANTLR3_UINT8) "DAY",
-+        (pANTLR3_UINT8) "WEEK",
-+        (pANTLR3_UINT8) "MONTH",
-+        (pANTLR3_UINT8) "YEAR",
-+        (pANTLR3_UINT8) "QUOTE",
-+        (pANTLR3_UINT8) "WS",
-+        (pANTLR3_UINT8) "DIGIT19",
-+        (pANTLR3_UINT8) "DIGIT09",
-+        (pANTLR3_UINT8) "ESCAPED"
-+       };
-+
-+        
-+
-+// Forward declare the locally static matching functions we have generated.
-+//
-+static pANTLR3_STRING query    (pRSP2SQL ctx);
-+static RSP2SQL_expr_return    expr    (pRSP2SQL ctx);
-+static RSP2SQL_strcrit_return strcrit    (pRSP2SQL ctx);
-+static pANTLR3_COMMON_TOKEN   strop    (pRSP2SQL ctx);
-+static RSP2SQL_intcrit_return intcrit    (pRSP2SQL ctx);
-+static pANTLR3_COMMON_TOKEN   intop    (pRSP2SQL ctx);
-+static RSP2SQL_datecrit_return        datecrit    (pRSP2SQL ctx);
-+static pANTLR3_COMMON_TOKEN   dateop    (pRSP2SQL ctx);
-+static RSP2SQL_datespec_return        datespec    (pRSP2SQL ctx);
-+static RSP2SQL_dateref_return dateref    (pRSP2SQL ctx);
-+static RSP2SQL_dateintval_return      dateintval    (pRSP2SQL ctx);
-+static void   RSP2SQLFree(pRSP2SQL ctx);
-+/* For use in tree output where we are accumulating rule labels via label += ruleRef
-+ * we need a function that knows how to free a return scope when the list is destroyed. 
-+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
-+ */
-+static        void ANTLR3_CDECL freeScope(void * scope)
-+{
-+    ANTLR3_FREE(scope);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "RSP2SQL.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+      return fileName;
-+}
-+/** \brief Create a new RSP2SQL parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pRSP2SQL
-+RSP2SQLNew   (pANTLR3_COMMON_TREE_NODE_STREAM instream)
-+{
-+      // See if we can create a new parser with the standard constructor
-+      //
-+      return RSP2SQLNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new RSP2SQL parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pRSP2SQL
-+RSP2SQLNewSSD   (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+    pRSP2SQL ctx;         /* Context structure we will build and return   */
-+    
-+    ctx       = (pRSP2SQL) ANTLR3_CALLOC(1, sizeof(RSP2SQL));
-+    
-+    if        (ctx == NULL)
-+    {
-+              // Failed to allocate memory for parser context
-+              //
-+        return  NULL;
-+    }
-+    
-+    /* -------------------------------------------------------------------
-+     * Memory for basic structure is allocated, now to fill in
-+     * the base ANTLR3 structures. We initialize the function pointers
-+     * for the standard ANTLR3 parser function set, but upon return
-+     * from here, the programmer may set the pointers to provide custom
-+     * implementations of each function. 
-+     *
-+     * We don't use the macros defined in RSP2SQL.h here, in order that you can get a sense
-+     * of what goes where.
-+     */
-+
-+    /* Create a base Tree parser/recognizer, using the supplied tree node stream
-+     */
-+    ctx->pTreeParser          = antlr3TreeParserNewStream(ANTLR3_SIZE_HINT, instream, state);
-+    /* Install the implementation of our RSP2SQL interface
-+     */
-+    ctx->query        = query;
-+    ctx->expr = expr;
-+    ctx->strcrit      = strcrit;
-+    ctx->strop        = strop;
-+    ctx->intcrit      = intcrit;
-+    ctx->intop        = intop;
-+    ctx->datecrit     = datecrit;
-+    ctx->dateop       = dateop;
-+    ctx->datespec     = datespec;
-+    ctx->dateref      = dateref;
-+    ctx->dateintval   = dateintval;
-+    ctx->free                 = RSP2SQLFree;
-+    ctx->getGrammarFileName   = getGrammarFileName;
-+    
-+    /* Install the scope pushing methods.
-+     */
-+
-+        
-+    
-+
-+      
-+    /* Install the token table
-+     */
-+    PSRSTATE->tokenNames   = RSP2SQLTokenNames;
-+    
-+    
-+    /* Return the newly built parser to the caller
-+     */
-+    return  ctx;
-+}
-+
-+/** Free the parser resources
-+ */
-+ static void
-+ RSP2SQLFree(pRSP2SQL ctx)
-+ {
-+    /* Free any scope memory
-+     */
-+    
-+        
-+      // Free this parser
-+      //
-+    ctx->pTreeParser->free(ctx->pTreeParser);
-+    ANTLR3_FREE(ctx);
-+
-+    /* Everything is released, so we can return
-+     */
-+    return;
-+ }
-+ 
-+/** Return token names used by this tree parser
-+ *
-+ * The returned pointer is used as an index into the token names table (using the token 
-+ * number as the index).
-+ * 
-+ * \return Pointer to first char * in the table.
-+ */
-+static pANTLR3_UINT8    *getTokenNames() 
-+{
-+        return RSP2SQLTokenNames; 
-+}
-+
-+
-+      #define RSP_TYPE_STRING 0
-+      #define RSP_TYPE_INT    1
-+      #define RSP_TYPE_DATE   2
-+
-+      struct rsp_query_field_map {
-+        char *rsp_field;
-+        int field_type;
-+        /* RSP fields are named after the DB columns - or vice versa */
-+      };
-+
-+      /* gperf static hash, rsp_query.gperf */
-+      #include "rsp_query_hash.c"
-+
-+    
-+/* Declare the bitsets
-+ */
-+
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_query70  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_query70_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_query70     = { FOLLOW_expr_in_query70_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AND_in_expr95  */
-+static        ANTLR3_BITWORD FOLLOW_AND_in_expr95_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static  ANTLR3_BITSET_LIST FOLLOW_AND_in_expr95       = { FOLLOW_AND_in_expr95_bits, 1        };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr101  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_expr101_bits[]    = { ANTLR3_UINT64_LIT(0x00000000007EF860) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr101     = { FOLLOW_expr_in_expr101_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr107  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_expr107_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr107     = { FOLLOW_expr_in_expr107_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OR_in_expr118  */
-+static        ANTLR3_BITWORD FOLLOW_OR_in_expr118_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static  ANTLR3_BITSET_LIST FOLLOW_OR_in_expr118       = { FOLLOW_OR_in_expr118_bits, 1        };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr124  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_expr124_bits[]    = { ANTLR3_UINT64_LIT(0x00000000007EF860) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr124     = { FOLLOW_expr_in_expr124_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr130  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_expr130_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr130     = { FOLLOW_expr_in_expr130_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_strcrit_in_expr144  */
-+static        ANTLR3_BITWORD FOLLOW_strcrit_in_expr144_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_strcrit_in_expr144  = { FOLLOW_strcrit_in_expr144_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_expr154  */
-+static        ANTLR3_BITWORD FOLLOW_NOT_in_expr154_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static  ANTLR3_BITSET_LIST FOLLOW_NOT_in_expr154      = { FOLLOW_NOT_in_expr154_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_strcrit_in_expr160  */
-+static        ANTLR3_BITWORD FOLLOW_strcrit_in_expr160_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static  ANTLR3_BITSET_LIST FOLLOW_strcrit_in_expr160  = { FOLLOW_strcrit_in_expr160_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_intcrit_in_expr174  */
-+static        ANTLR3_BITWORD FOLLOW_intcrit_in_expr174_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_intcrit_in_expr174  = { FOLLOW_intcrit_in_expr174_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_expr184  */
-+static        ANTLR3_BITWORD FOLLOW_NOT_in_expr184_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static  ANTLR3_BITSET_LIST FOLLOW_NOT_in_expr184      = { FOLLOW_NOT_in_expr184_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_intcrit_in_expr190  */
-+static        ANTLR3_BITWORD FOLLOW_intcrit_in_expr190_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static  ANTLR3_BITSET_LIST FOLLOW_intcrit_in_expr190  = { FOLLOW_intcrit_in_expr190_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_datecrit_in_expr204  */
-+static        ANTLR3_BITWORD FOLLOW_datecrit_in_expr204_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_datecrit_in_expr204 = { FOLLOW_datecrit_in_expr204_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_strop_in_strcrit233  */
-+static        ANTLR3_BITWORD FOLLOW_strop_in_strcrit233_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static  ANTLR3_BITSET_LIST FOLLOW_strop_in_strcrit233 = { FOLLOW_strop_in_strcrit233_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_strcrit239  */
-+static        ANTLR3_BITWORD FOLLOW_FIELD_in_strcrit239_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000400) };
-+static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_strcrit239 = { FOLLOW_FIELD_in_strcrit239_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_strcrit245  */
-+static        ANTLR3_BITWORD FOLLOW_STR_in_strcrit245_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STR_in_strcrit245   = { FOLLOW_STR_in_strcrit245_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQUAL_in_strop274  */
-+static        ANTLR3_BITWORD FOLLOW_EQUAL_in_strop274_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_EQUAL_in_strop274   = { FOLLOW_EQUAL_in_strop274_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCLUDES_in_strop287  */
-+static        ANTLR3_BITWORD FOLLOW_INCLUDES_in_strop287_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INCLUDES_in_strop287        = { FOLLOW_INCLUDES_in_strop287_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STARTSW_in_strop300  */
-+static        ANTLR3_BITWORD FOLLOW_STARTSW_in_strop300_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STARTSW_in_strop300 = { FOLLOW_STARTSW_in_strop300_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENDSW_in_strop313  */
-+static        ANTLR3_BITWORD FOLLOW_ENDSW_in_strop313_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_ENDSW_in_strop313   = { FOLLOW_ENDSW_in_strop313_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_intop_in_intcrit342  */
-+static        ANTLR3_BITWORD FOLLOW_intop_in_intcrit342_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static  ANTLR3_BITSET_LIST FOLLOW_intop_in_intcrit342 = { FOLLOW_intop_in_intcrit342_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_intcrit348  */
-+static        ANTLR3_BITWORD FOLLOW_FIELD_in_intcrit348_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000010000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_intcrit348 = { FOLLOW_FIELD_in_intcrit348_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_intcrit354  */
-+static        ANTLR3_BITWORD FOLLOW_INT_in_intcrit354_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INT_in_intcrit354   = { FOLLOW_INT_in_intcrit354_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQUAL_in_intop383  */
-+static        ANTLR3_BITWORD FOLLOW_EQUAL_in_intop383_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_EQUAL_in_intop383   = { FOLLOW_EQUAL_in_intop383_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LESS_in_intop396  */
-+static        ANTLR3_BITWORD FOLLOW_LESS_in_intop396_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_LESS_in_intop396    = { FOLLOW_LESS_in_intop396_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GREATER_in_intop409  */
-+static        ANTLR3_BITWORD FOLLOW_GREATER_in_intop409_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_GREATER_in_intop409 = { FOLLOW_GREATER_in_intop409_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LTE_in_intop422  */
-+static        ANTLR3_BITWORD FOLLOW_LTE_in_intop422_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_LTE_in_intop422     = { FOLLOW_LTE_in_intop422_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GTE_in_intop435  */
-+static        ANTLR3_BITWORD FOLLOW_GTE_in_intop435_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_GTE_in_intop435     = { FOLLOW_GTE_in_intop435_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateop_in_datecrit464  */
-+static        ANTLR3_BITWORD FOLLOW_dateop_in_datecrit464_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static  ANTLR3_BITSET_LIST FOLLOW_dateop_in_datecrit464       = { FOLLOW_dateop_in_datecrit464_bits, 1        };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_datecrit470  */
-+static        ANTLR3_BITWORD FOLLOW_FIELD_in_datecrit470_bits[]       = { ANTLR3_UINT64_LIT(0x0000000001FEF860) };
-+static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_datecrit470        = { FOLLOW_FIELD_in_datecrit470_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_datespec_in_datecrit476  */
-+static        ANTLR3_BITWORD FOLLOW_datespec_in_datecrit476_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static  ANTLR3_BITSET_LIST FOLLOW_datespec_in_datecrit476     = { FOLLOW_datespec_in_datecrit476_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_dateop505  */
-+static        ANTLR3_BITWORD FOLLOW_BEFORE_in_dateop505_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_dateop505 = { FOLLOW_BEFORE_in_dateop505_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_dateop518  */
-+static        ANTLR3_BITWORD FOLLOW_AFTER_in_dateop518_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_AFTER_in_dateop518  = { FOLLOW_AFTER_in_dateop518_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateref_in_datespec546  */
-+static        ANTLR3_BITWORD FOLLOW_dateref_in_datespec546_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_dateref_in_datespec546      = { FOLLOW_dateref_in_datespec546_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateop_in_datespec560  */
-+static        ANTLR3_BITWORD FOLLOW_dateop_in_datespec560_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static  ANTLR3_BITSET_LIST FOLLOW_dateop_in_datespec560       = { FOLLOW_dateop_in_datespec560_bits, 1        };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateref_in_datespec566  */
-+static        ANTLR3_BITWORD FOLLOW_dateref_in_datespec566_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000010000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_dateref_in_datespec566      = { FOLLOW_dateref_in_datespec566_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_datespec572  */
-+static        ANTLR3_BITWORD FOLLOW_INT_in_datespec572_bits[] = { ANTLR3_UINT64_LIT(0x000000001E000000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INT_in_datespec572  = { FOLLOW_INT_in_datespec572_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateintval_in_datespec578  */
-+static        ANTLR3_BITWORD FOLLOW_dateintval_in_datespec578_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static  ANTLR3_BITSET_LIST FOLLOW_dateintval_in_datespec578   = { FOLLOW_dateintval_in_datespec578_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateref607  */
-+static        ANTLR3_BITWORD FOLLOW_DATE_in_dateref607_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateref607  = { FOLLOW_DATE_in_dateref607_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_TODAY_in_dateref616  */
-+static        ANTLR3_BITWORD FOLLOW_TODAY_in_dateref616_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_TODAY_in_dateref616 = { FOLLOW_TODAY_in_dateref616_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DAY_in_dateintval640  */
-+static        ANTLR3_BITWORD FOLLOW_DAY_in_dateintval640_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DAY_in_dateintval640        = { FOLLOW_DAY_in_dateintval640_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_WEEK_in_dateintval649  */
-+static        ANTLR3_BITWORD FOLLOW_WEEK_in_dateintval649_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_WEEK_in_dateintval649       = { FOLLOW_WEEK_in_dateintval649_bits, 1        };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MONTH_in_dateintval658  */
-+static        ANTLR3_BITWORD FOLLOW_MONTH_in_dateintval658_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_MONTH_in_dateintval658      = { FOLLOW_MONTH_in_dateintval658_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_YEAR_in_dateintval667  */
-+static        ANTLR3_BITWORD FOLLOW_YEAR_in_dateintval667_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_YEAR_in_dateintval667       = { FOLLOW_YEAR_in_dateintval667_bits, 1        };
-+     
-+
-+ 
-+ 
-+/* ==============================================
-+ * Parsing rules
-+ */
-+/** 
-+ * $ANTLR start query
-+ * RSP2SQL.g:56:1: query returns [ pANTLR3_STRING result ] : e= expr ;
-+ */
-+static pANTLR3_STRING
-+query(pRSP2SQL ctx)
-+{   
-+    pANTLR3_STRING result = NULL;
-+
-+    RSP2SQL_expr_return e;
-+    #undef    RETURN_TYPE_e
-+    #define   RETURN_TYPE_e RSP2SQL_expr_return
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     result= NULL; 
-+    {
-+        // RSP2SQL.g:58:2: (e= expr )
-+        // RSP2SQL.g:58:4: e= expr
-+        {
-+            FOLLOWPUSH(FOLLOW_expr_in_query70);
-+            e=expr(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto rulequeryEx;
-+            }
-+
-+            {
-+
-+                                      if (!e.valid)
-+                                      {
-+                                              result= NULL;
-+                                      }
-+                                      else
-+                                      {
-+                                              result= e.result->factory->newRaw(e.result->factory);
-+                                              result->append8(result, "(");
-+                                              result->appendS(result, e.result);
-+                                              result->append8(result, ")");
-+                                      }
-+                              
-+            }
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto rulequeryEx; /* Prevent compiler warnings */
-+    rulequeryEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return result;
-+}
-+/* $ANTLR end query */
-+
-+/** 
-+ * $ANTLR start expr
-+ * RSP2SQL.g:74:1: expr returns [ pANTLR3_STRING result, int valid ] : ( ^( AND a= expr b= expr ) | ^( OR a= expr b= expr ) | c= strcrit | ^( NOT c= strcrit ) | i= intcrit | ^( NOT i= intcrit ) | d= datecrit );
-+ */
-+static RSP2SQL_expr_return
-+expr(pRSP2SQL ctx)
-+{   
-+    RSP2SQL_expr_return retval;
-+
-+    RSP2SQL_expr_return a;
-+    #undef    RETURN_TYPE_a
-+    #define   RETURN_TYPE_a RSP2SQL_expr_return
-+
-+    RSP2SQL_expr_return b;
-+    #undef    RETURN_TYPE_b
-+    #define   RETURN_TYPE_b RSP2SQL_expr_return
-+
-+    RSP2SQL_strcrit_return c;
-+    #undef    RETURN_TYPE_c
-+    #define   RETURN_TYPE_c RSP2SQL_strcrit_return
-+
-+    RSP2SQL_intcrit_return i;
-+    #undef    RETURN_TYPE_i
-+    #define   RETURN_TYPE_i RSP2SQL_intcrit_return
-+
-+    RSP2SQL_datecrit_return d;
-+    #undef    RETURN_TYPE_d
-+    #define   RETURN_TYPE_d RSP2SQL_datecrit_return
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     retval.result= NULL; retval.valid= 1; 
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    {
-+        {
-+            //  RSP2SQL.g:76:2: ( ^( AND a= expr b= expr ) | ^( OR a= expr b= expr ) | c= strcrit | ^( NOT c= strcrit ) | i= intcrit | ^( NOT i= intcrit ) | d= datecrit )
-+            
-+            ANTLR3_UINT32 alt1;
-+
-+            alt1=7;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case AND:
-+              {
-+                      alt1=1;
-+              }
-+                break;
-+            case OR:
-+              {
-+                      alt1=2;
-+              }
-+                break;
-+            case EQUAL:
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case DOWN:
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case FIELD:
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case INT:
-+                                                              {
-+                                                                      alt1=5;
-+                                                              }
-+                                                          break;
-+                                                      case STR:
-+                                                              {
-+                                                                      alt1=3;
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          CONSTRUCTEX();
-+                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                          EXCEPTION->message      = (void *)"";
-+                                                          EXCEPTION->decisionNum  = 1;
-+                                                          EXCEPTION->state        = 10;
-+
-+
-+                                                          goto ruleexprEx;
-+                                                      }
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 1;
-+                                          EXCEPTION->state        = 8;
-+
-+
-+                                          goto ruleexprEx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 1;
-+                          EXCEPTION->state        = 3;
-+
-+
-+                          goto ruleexprEx;
-+                      }
-+
-+              }
-+                break;
-+            case INCLUDES:
-+            case STARTSW:
-+            case ENDSW:
-+              {
-+                      alt1=3;
-+              }
-+                break;
-+            case NOT:
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case DOWN:
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case EQUAL:
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case DOWN:
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case FIELD:
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case STR:
-+                                                                                              {
-+                                                                                                      alt1=4;
-+                                                                                              }
-+                                                                                          break;
-+                                                                                      case INT:
-+                                                                                              {
-+                                                                                                      alt1=6;
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          CONSTRUCTEX();
-+                                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                                                          EXCEPTION->message      = (void *)"";
-+                                                                                          EXCEPTION->decisionNum  = 1;
-+                                                                                          EXCEPTION->state        = 15;
-+
-+
-+                                                                                          goto ruleexprEx;
-+                                                                                      }
-+
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          CONSTRUCTEX();
-+                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                                          EXCEPTION->message      = (void *)"";
-+                                                                          EXCEPTION->decisionNum  = 1;
-+                                                                          EXCEPTION->state        = 14;
-+
-+
-+                                                                          goto ruleexprEx;
-+                                                                      }
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          CONSTRUCTEX();
-+                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                          EXCEPTION->message      = (void *)"";
-+                                                          EXCEPTION->decisionNum  = 1;
-+                                                          EXCEPTION->state        = 11;
-+
-+
-+                                                          goto ruleexprEx;
-+                                                      }
-+
-+                                              }
-+                                          break;
-+                                      case LESS:
-+                                      case GREATER:
-+                                      case LTE:
-+                                      case GTE:
-+                                              {
-+                                                      alt1=6;
-+                                              }
-+                                          break;
-+                                      case INCLUDES:
-+                                      case STARTSW:
-+                                      case ENDSW:
-+                                              {
-+                                                      alt1=4;
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 1;
-+                                          EXCEPTION->state        = 9;
-+
-+
-+                                          goto ruleexprEx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 1;
-+                          EXCEPTION->state        = 5;
-+
-+
-+                          goto ruleexprEx;
-+                      }
-+
-+              }
-+                break;
-+            case LESS:
-+            case GREATER:
-+            case LTE:
-+            case GTE:
-+              {
-+                      alt1=5;
-+              }
-+                break;
-+            case BEFORE:
-+            case AFTER:
-+              {
-+                      alt1=7;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 1;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruleexprEx;
-+            }
-+
-+            switch (alt1) 
-+            {
-+              case 1:
-+                  // RSP2SQL.g:76:4: ^( AND a= expr b= expr )
-+                  {
-+                       MATCHT(AND, &FOLLOW_AND_in_expr95); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_expr_in_expr101);
-+                      a=expr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_expr_in_expr107);
-+                      b=expr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      {
-+
-+                                              if (!a.valid || !b.valid)
-+                                              {
-+                                                      retval.valid= 0;
-+                                              }
-+                                              else
-+                                              {
-+                                                      retval.result= a.result->factory->newRaw(a.result->factory);
-+                                                      retval.result->append8(retval.result, "(");
-+                                                      retval.result->appendS(retval.result, a.result);
-+                                                      retval.result->append8(retval.result, " AND ");
-+                                                      retval.result->appendS(retval.result, b.result);
-+                                                      retval.result->append8(retval.result, ")");
-+                                              }
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP2SQL.g:92:4: ^( OR a= expr b= expr )
-+                  {
-+                       MATCHT(OR, &FOLLOW_OR_in_expr118); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_expr_in_expr124);
-+                      a=expr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_expr_in_expr130);
-+                      b=expr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      {
-+
-+                                              if (!a.valid || !b.valid)
-+                                              {
-+                                                      retval.valid= 0;
-+                                              }
-+                                              else
-+                                              {
-+                                                      retval.result= a.result->factory->newRaw(a.result->factory);
-+                                                      retval.result->append8(retval.result, "(");
-+                                                      retval.result->appendS(retval.result, a.result);
-+                                                      retval.result->append8(retval.result, " OR ");
-+                                                      retval.result->appendS(retval.result, b.result);
-+                                                      retval.result->append8(retval.result, ")");
-+                                              }
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // RSP2SQL.g:108:4: c= strcrit
-+                  {
-+                      FOLLOWPUSH(FOLLOW_strcrit_in_expr144);
-+                      c=strcrit(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      {
-+
-+                                              retval.valid= c.valid;
-+                                              retval.result= c.result;
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 4:
-+                  // RSP2SQL.g:113:4: ^( NOT c= strcrit )
-+                  {
-+                       MATCHT(NOT, &FOLLOW_NOT_in_expr154); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_strcrit_in_expr160);
-+                      c=strcrit(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      {
-+
-+                                              if (!c.valid)
-+                                              {
-+                                                      retval.valid= 0;
-+                                              }
-+                                              else
-+                                              {
-+                                                      retval.result= c.result->factory->newRaw(c.result->factory);
-+                                                      retval.result->append8(retval.result, "(NOT ");
-+                                                      retval.result->appendS(retval.result, c.result);
-+                                                      retval.result->append8(retval.result, ")");
-+                                              }
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 5:
-+                  // RSP2SQL.g:127:4: i= intcrit
-+                  {
-+                      FOLLOWPUSH(FOLLOW_intcrit_in_expr174);
-+                      i=intcrit(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      {
-+
-+                                              retval.valid= i.valid;
-+                                              retval.result= i.result;
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 6:
-+                  // RSP2SQL.g:132:4: ^( NOT i= intcrit )
-+                  {
-+                       MATCHT(NOT, &FOLLOW_NOT_in_expr184); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_intcrit_in_expr190);
-+                      i=intcrit(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      {
-+
-+                                              if (!i.valid)
-+                                              {
-+                                                      retval.valid= 0;
-+                                              }
-+                                              else
-+                                              {
-+                                                      retval.result= i.result->factory->newRaw(i.result->factory);
-+                                                      retval.result->append8(retval.result, "(NOT ");
-+                                                      retval.result->appendS(retval.result, i.result);
-+                                                      retval.result->append8(retval.result, ")");
-+                                              }
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 7:
-+                  // RSP2SQL.g:146:4: d= datecrit
-+                  {
-+                      FOLLOWPUSH(FOLLOW_datecrit_in_expr204);
-+                      d=datecrit(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      {
-+
-+                                              retval.valid= d.valid;
-+                                              retval.result= d.result;
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleexprEx; /* Prevent compiler warnings */
-+    ruleexprEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end expr */
-+
-+/** 
-+ * $ANTLR start strcrit
-+ * RSP2SQL.g:153:1: strcrit returns [ pANTLR3_STRING result, int valid ] : ^(o= strop f= FIELD s= STR ) ;
-+ */
-+static RSP2SQL_strcrit_return
-+strcrit(pRSP2SQL ctx)
-+{   
-+    RSP2SQL_strcrit_return retval;
-+
-+    pANTLR3_BASE_TREE    f;
-+    pANTLR3_BASE_TREE    s;
-+    pANTLR3_COMMON_TOKEN o;
-+    #undef    RETURN_TYPE_o
-+    #define   RETURN_TYPE_o pANTLR3_COMMON_TOKEN
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     retval.result= NULL; retval.valid= 1; 
-+    f       = NULL;
-+    s       = NULL;
-+    o = NULL;
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    {
-+        // RSP2SQL.g:155:2: ( ^(o= strop f= FIELD s= STR ) )
-+        // RSP2SQL.g:155:4: ^(o= strop f= FIELD s= STR )
-+        {
-+            FOLLOWPUSH(FOLLOW_strop_in_strcrit233);
-+            o=strop(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto rulestrcritEx;
-+            }
-+
-+
-+            MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto rulestrcritEx;
-+            }
-+
-+            f = (pANTLR3_BASE_TREE) MATCHT(FIELD, &FOLLOW_FIELD_in_strcrit239); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto rulestrcritEx;
-+            }
-+
-+            s = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_strcrit245); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto rulestrcritEx;
-+            }
-+
-+
-+            MATCHT(ANTLR3_TOKEN_UP, NULL); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto rulestrcritEx;
-+            }
-+
-+            {
-+
-+                                      char *op;
-+                                      const struct rsp_query_field_map *rqfp;
-+                                      pANTLR3_STRING field;
-+                                      char *escaped;
-+                                      ANTLR3_UINT32 optok;
-+
-+                                      escaped = NULL;
-+
-+                                      op = NULL;
-+                                      optok = o->getType(o);
-+                                      switch (optok)
-+                                      {
-+                                              case EQUAL:
-+                                                      op = " = ";
-+                                                      break;
-+
-+                                              case INCLUDES:
-+                                              case STARTSW:
-+                                              case ENDSW:
-+                                                      op = " LIKE ";
-+                                                      break;
-+                                      }
-+
-+                                      field = f->getText(f);
-+
-+                                      /* Field lookup */
-+                                      rqfp = rsp_query_field_lookup((char *)field->chars, strlen((char *)field->chars));
-+                                      if (!rqfp)
-+                                      {
-+                                              DPRINTF(E_LOG, L_RSP, "Field '%s' is not a valid field in queries\n", field->chars);
-+                                              retval.valid= 0;
-+                                              goto strcrit_valid_0; /* ABORT */
-+                                      }
-+
-+                                      /* Check field type */
-+                                      if (rqfp->field_type != RSP_TYPE_STRING)
-+                                      {
-+                                              DPRINTF(E_LOG, L_RSP, "Field '%s' is not a string field\n", field->chars);
-+                                              retval.valid= 0;
-+                                              goto strcrit_valid_0; /* ABORT */
-+                                      }
-+
-+                                      escaped = db_escape_string((char *)s->getText(s)->chars);
-+                                      if (!escaped)
-+                                      {
-+                                              DPRINTF(E_LOG, L_RSP, "Could not escape value\n");
-+                                              retval.valid= 0;
-+                                              goto strcrit_valid_0; /* ABORT */
-+                                      }
-+
-+                                      retval.result= field->factory->newRaw(field->factory);
-+                                      retval.result->append8(retval.result, "f.");
-+                                      retval.result->appendS(retval.result, field);
-+                                      retval.result->append8(retval.result, op);
-+                                      retval.result->append8(retval.result, "'");
-+                                      if ((optok == INCLUDES) || (optok == STARTSW))
-+                                              retval.result->append8(retval.result, "%");
-+
-+                                      retval.result->append8(retval.result, escaped);
-+
-+                                      if ((optok == INCLUDES) || (optok == ENDSW))
-+                                              retval.result->append8(retval.result, "%");
-+                                      retval.result->append8(retval.result, "'");
-+
-+                                      strcrit_valid_0:
-+                                              ;
-+
-+                                      if (escaped)
-+                                              free(escaped);
-+                              
-+            }
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto rulestrcritEx; /* Prevent compiler warnings */
-+    rulestrcritEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end strcrit */
-+
-+/** 
-+ * $ANTLR start strop
-+ * RSP2SQL.g:229:1: strop returns [ pANTLR3_COMMON_TOKEN op ] : (n= EQUAL | n= INCLUDES | n= STARTSW | n= ENDSW );
-+ */
-+static pANTLR3_COMMON_TOKEN
-+strop(pRSP2SQL ctx)
-+{   
-+    pANTLR3_COMMON_TOKEN op = NULL;
-+
-+    pANTLR3_BASE_TREE    n;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     op= NULL; 
-+    n       = NULL;
-+
-+    {
-+        {
-+            //  RSP2SQL.g:231:2: (n= EQUAL | n= INCLUDES | n= STARTSW | n= ENDSW )
-+            
-+            ANTLR3_UINT32 alt2;
-+
-+            alt2=4;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case EQUAL:
-+              {
-+                      alt2=1;
-+              }
-+                break;
-+            case INCLUDES:
-+              {
-+                      alt2=2;
-+              }
-+                break;
-+            case STARTSW:
-+              {
-+                      alt2=3;
-+              }
-+                break;
-+            case ENDSW:
-+              {
-+                      alt2=4;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 2;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto rulestropEx;
-+            }
-+
-+            switch (alt2) 
-+            {
-+              case 1:
-+                  // RSP2SQL.g:231:4: n= EQUAL
-+                  {
-+                      n = (pANTLR3_BASE_TREE) MATCHT(EQUAL, &FOLLOW_EQUAL_in_strop274); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestropEx;
-+                      }
-+
-+                      {
-+                           op= n->getToken(n); 
-+                      }
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP2SQL.g:233:4: n= INCLUDES
-+                  {
-+                      n = (pANTLR3_BASE_TREE) MATCHT(INCLUDES, &FOLLOW_INCLUDES_in_strop287); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestropEx;
-+                      }
-+
-+                      {
-+                           op= n->getToken(n); 
-+                      }
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // RSP2SQL.g:235:4: n= STARTSW
-+                  {
-+                      n = (pANTLR3_BASE_TREE) MATCHT(STARTSW, &FOLLOW_STARTSW_in_strop300); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestropEx;
-+                      }
-+
-+                      {
-+                           op= n->getToken(n); 
-+                      }
-+
-+                  }
-+                  break;
-+              case 4:
-+                  // RSP2SQL.g:237:4: n= ENDSW
-+                  {
-+                      n = (pANTLR3_BASE_TREE) MATCHT(ENDSW, &FOLLOW_ENDSW_in_strop313); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestropEx;
-+                      }
-+
-+                      {
-+                           op= n->getToken(n); 
-+                      }
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto rulestropEx; /* Prevent compiler warnings */
-+    rulestropEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return op;
-+}
-+/* $ANTLR end strop */
-+
-+/** 
-+ * $ANTLR start intcrit
-+ * RSP2SQL.g:241:1: intcrit returns [ pANTLR3_STRING result, int valid ] : ^(o= intop f= FIELD i= INT ) ;
-+ */
-+static RSP2SQL_intcrit_return
-+intcrit(pRSP2SQL ctx)
-+{   
-+    RSP2SQL_intcrit_return retval;
-+
-+    pANTLR3_BASE_TREE    f;
-+    pANTLR3_BASE_TREE    i;
-+    pANTLR3_COMMON_TOKEN o;
-+    #undef    RETURN_TYPE_o
-+    #define   RETURN_TYPE_o pANTLR3_COMMON_TOKEN
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     retval.result= NULL; retval.valid= 1; 
-+    f       = NULL;
-+    i       = NULL;
-+    o = NULL;
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    {
-+        // RSP2SQL.g:243:2: ( ^(o= intop f= FIELD i= INT ) )
-+        // RSP2SQL.g:243:4: ^(o= intop f= FIELD i= INT )
-+        {
-+            FOLLOWPUSH(FOLLOW_intop_in_intcrit342);
-+            o=intop(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleintcritEx;
-+            }
-+
-+
-+            MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleintcritEx;
-+            }
-+
-+            f = (pANTLR3_BASE_TREE) MATCHT(FIELD, &FOLLOW_FIELD_in_intcrit348); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleintcritEx;
-+            }
-+
-+            i = (pANTLR3_BASE_TREE) MATCHT(INT, &FOLLOW_INT_in_intcrit354); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleintcritEx;
-+            }
-+
-+
-+            MATCHT(ANTLR3_TOKEN_UP, NULL); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleintcritEx;
-+            }
-+
-+            {
-+
-+                                      char *op;
-+                                      const struct rsp_query_field_map *rqfp;
-+                                      pANTLR3_STRING field;
-+
-+                                      op = NULL;
-+                                      switch (o->getType(o))
-+                                      {
-+                                              case EQUAL:
-+                                                      op = " = ";
-+                                                      break;
-+
-+                                              case LESS:
-+                                                      op = " < ";
-+                                                      break;
-+
-+                                              case GREATER:
-+                                                      op = " > ";
-+                                                      break;
-+
-+                                              case LTE:
-+                                                      op = " <= ";
-+                                                      break;
-+
-+                                              case GTE:
-+                                                      op = " >= ";
-+                                                      break;
-+                                      }
-+
-+                                      field = f->getText(f);
-+
-+                                      /* Field lookup */
-+                                      rqfp = rsp_query_field_lookup((char *)field->chars, strlen((char *)field->chars));
-+                                      if (!rqfp)
-+                                      {
-+                                              DPRINTF(E_LOG, L_RSP, "Field '%s' is not a valid field in queries\n", field->chars);
-+                                              retval.valid= 0;
-+                                              goto intcrit_valid_0; /* ABORT */
-+                                      }
-+
-+                                      /* Check field type */
-+                                      if (rqfp->field_type != RSP_TYPE_INT)
-+                                      {
-+                                              DPRINTF(E_LOG, L_RSP, "Field '%s' is not an integer field\n", field->chars);
-+                                              retval.valid= 0;
-+                                              goto intcrit_valid_0; /* ABORT */
-+                                      }
-+
-+                                      retval.result= field->factory->newRaw(field->factory);
-+                                      retval.result->append8(retval.result, "f.");
-+                                      retval.result->appendS(retval.result, field);
-+                                      retval.result->append8(retval.result, op);
-+                                      retval.result->appendS(retval.result, i->getText(i));
-+
-+                                      intcrit_valid_0:
-+                                              ;
-+                              
-+            }
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleintcritEx; /* Prevent compiler warnings */
-+    ruleintcritEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end intcrit */
-+
-+/** 
-+ * $ANTLR start intop
-+ * RSP2SQL.g:303:1: intop returns [ pANTLR3_COMMON_TOKEN op ] : (n= EQUAL | n= LESS | n= GREATER | n= LTE | n= GTE );
-+ */
-+static pANTLR3_COMMON_TOKEN
-+intop(pRSP2SQL ctx)
-+{   
-+    pANTLR3_COMMON_TOKEN op = NULL;
-+
-+    pANTLR3_BASE_TREE    n;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     op= NULL; 
-+    n       = NULL;
-+
-+    {
-+        {
-+            //  RSP2SQL.g:305:2: (n= EQUAL | n= LESS | n= GREATER | n= LTE | n= GTE )
-+            
-+            ANTLR3_UINT32 alt3;
-+
-+            alt3=5;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case EQUAL:
-+              {
-+                      alt3=1;
-+              }
-+                break;
-+            case LESS:
-+              {
-+                      alt3=2;
-+              }
-+                break;
-+            case GREATER:
-+              {
-+                      alt3=3;
-+              }
-+                break;
-+            case LTE:
-+              {
-+                      alt3=4;
-+              }
-+                break;
-+            case GTE:
-+              {
-+                      alt3=5;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 3;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruleintopEx;
-+            }
-+
-+            switch (alt3) 
-+            {
-+              case 1:
-+                  // RSP2SQL.g:305:4: n= EQUAL
-+                  {
-+                      n = (pANTLR3_BASE_TREE) MATCHT(EQUAL, &FOLLOW_EQUAL_in_intop383); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintopEx;
-+                      }
-+
-+                      {
-+                           op= n->getToken(n); 
-+                      }
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP2SQL.g:307:4: n= LESS
-+                  {
-+                      n = (pANTLR3_BASE_TREE) MATCHT(LESS, &FOLLOW_LESS_in_intop396); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintopEx;
-+                      }
-+
-+                      {
-+                           op= n->getToken(n); 
-+                      }
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // RSP2SQL.g:309:4: n= GREATER
-+                  {
-+                      n = (pANTLR3_BASE_TREE) MATCHT(GREATER, &FOLLOW_GREATER_in_intop409); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintopEx;
-+                      }
-+
-+                      {
-+                           op= n->getToken(n); 
-+                      }
-+
-+                  }
-+                  break;
-+              case 4:
-+                  // RSP2SQL.g:311:4: n= LTE
-+                  {
-+                      n = (pANTLR3_BASE_TREE) MATCHT(LTE, &FOLLOW_LTE_in_intop422); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintopEx;
-+                      }
-+
-+                      {
-+                           op= n->getToken(n); 
-+                      }
-+
-+                  }
-+                  break;
-+              case 5:
-+                  // RSP2SQL.g:313:4: n= GTE
-+                  {
-+                      n = (pANTLR3_BASE_TREE) MATCHT(GTE, &FOLLOW_GTE_in_intop435); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintopEx;
-+                      }
-+
-+                      {
-+                           op= n->getToken(n); 
-+                      }
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleintopEx; /* Prevent compiler warnings */
-+    ruleintopEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return op;
-+}
-+/* $ANTLR end intop */
-+
-+/** 
-+ * $ANTLR start datecrit
-+ * RSP2SQL.g:317:1: datecrit returns [ pANTLR3_STRING result, int valid ] : ^(o= dateop f= FIELD d= datespec ) ;
-+ */
-+static RSP2SQL_datecrit_return
-+datecrit(pRSP2SQL ctx)
-+{   
-+    RSP2SQL_datecrit_return retval;
-+
-+    pANTLR3_BASE_TREE    f;
-+    pANTLR3_COMMON_TOKEN o;
-+    #undef    RETURN_TYPE_o
-+    #define   RETURN_TYPE_o pANTLR3_COMMON_TOKEN
-+
-+    RSP2SQL_datespec_return d;
-+    #undef    RETURN_TYPE_d
-+    #define   RETURN_TYPE_d RSP2SQL_datespec_return
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     retval.result= NULL; retval.valid= 1; 
-+    f       = NULL;
-+    o = NULL;
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    {
-+        // RSP2SQL.g:319:2: ( ^(o= dateop f= FIELD d= datespec ) )
-+        // RSP2SQL.g:319:4: ^(o= dateop f= FIELD d= datespec )
-+        {
-+            FOLLOWPUSH(FOLLOW_dateop_in_datecrit464);
-+            o=dateop(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruledatecritEx;
-+            }
-+
-+
-+            MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruledatecritEx;
-+            }
-+
-+            f = (pANTLR3_BASE_TREE) MATCHT(FIELD, &FOLLOW_FIELD_in_datecrit470); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruledatecritEx;
-+            }
-+
-+            FOLLOWPUSH(FOLLOW_datespec_in_datecrit476);
-+            d=datespec(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruledatecritEx;
-+            }
-+
-+
-+            MATCHT(ANTLR3_TOKEN_UP, NULL); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruledatecritEx;
-+            }
-+
-+            {
-+
-+                                      char *op;
-+                                      const struct rsp_query_field_map *rqfp;
-+                                      pANTLR3_STRING field;
-+                                      char buf[32];
-+                                      int ret;
-+
-+                                      op = NULL;
-+                                      switch (o->getType(o))
-+                                      {
-+                                              case BEFORE:
-+                                                      op = " < ";
-+                                                      break;
-+
-+                                              case AFTER:
-+                                                      op = " > ";
-+                                                      break;
-+                                      }
-+
-+                                      field = f->getText(f);
-+
-+                                      /* Field lookup */
-+                                      rqfp = rsp_query_field_lookup((char *)field->chars, strlen((char *)field->chars));
-+                                      if (!rqfp)
-+                                      {
-+                                              DPRINTF(E_LOG, L_RSP, "Field '%s' is not a valid field in queries\n", field->chars);
-+                                              retval.valid= 0;
-+                                              goto datecrit_valid_0; /* ABORT */
-+                                      }
-+
-+                                      /* Check field type */
-+                                      if (rqfp->field_type != RSP_TYPE_DATE)
-+                                      {
-+                                              DPRINTF(E_LOG, L_RSP, "Field '%s' is not a date field\n", field->chars);
-+                                              retval.valid= 0;
-+                                              goto datecrit_valid_0; /* ABORT */
-+                                      }
-+
-+                                      ret = snprintf(buf, sizeof(buf), "%ld", d.date);
-+                                      if ((ret < 0) || (ret >= sizeof(buf)))
-+                                      {
-+                                              DPRINTF(E_LOG, L_RSP, "Date %ld too large for buffer, oops!\n", d.date);
-+                                              retval.valid= 0;
-+                                              goto datecrit_valid_0; /* ABORT */
-+                                      }
-+
-+                                      retval.result= field->factory->newRaw(field->factory);
-+                                      retval.result->append8(retval.result, "f.");
-+                                      retval.result->appendS(retval.result, field);
-+                                      retval.result->append8(retval.result, op);
-+                                      retval.result->append8(retval.result, buf);
-+
-+                                      datecrit_valid_0:
-+                                              ;
-+                              
-+            }
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruledatecritEx; /* Prevent compiler warnings */
-+    ruledatecritEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end datecrit */
-+
-+/** 
-+ * $ANTLR start dateop
-+ * RSP2SQL.g:377:1: dateop returns [ pANTLR3_COMMON_TOKEN op ] : (n= BEFORE | n= AFTER );
-+ */
-+static pANTLR3_COMMON_TOKEN
-+dateop(pRSP2SQL ctx)
-+{   
-+    pANTLR3_COMMON_TOKEN op = NULL;
-+
-+    pANTLR3_BASE_TREE    n;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     op= NULL; 
-+    n       = NULL;
-+
-+    {
-+        {
-+            //  RSP2SQL.g:379:2: (n= BEFORE | n= AFTER )
-+            
-+            ANTLR3_UINT32 alt4;
-+
-+            alt4=2;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case BEFORE:
-+              {
-+                      alt4=1;
-+              }
-+                break;
-+            case AFTER:
-+              {
-+                      alt4=2;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 4;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruledateopEx;
-+            }
-+
-+            switch (alt4) 
-+            {
-+              case 1:
-+                  // RSP2SQL.g:379:4: n= BEFORE
-+                  {
-+                      n = (pANTLR3_BASE_TREE) MATCHT(BEFORE, &FOLLOW_BEFORE_in_dateop505); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledateopEx;
-+                      }
-+
-+                      {
-+                           op= n->getToken(n); 
-+                      }
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP2SQL.g:381:4: n= AFTER
-+                  {
-+                      n = (pANTLR3_BASE_TREE) MATCHT(AFTER, &FOLLOW_AFTER_in_dateop518); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledateopEx;
-+                      }
-+
-+                      {
-+                           op= n->getToken(n); 
-+                      }
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruledateopEx; /* Prevent compiler warnings */
-+    ruledateopEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return op;
-+}
-+/* $ANTLR end dateop */
-+
-+/** 
-+ * $ANTLR start datespec
-+ * RSP2SQL.g:385:1: datespec returns [ time_t date, int valid ] : (r= dateref | ^(o= dateop r= dateref m= INT i= dateintval ) );
-+ */
-+static RSP2SQL_datespec_return
-+datespec(pRSP2SQL ctx)
-+{   
-+    RSP2SQL_datespec_return retval;
-+
-+    pANTLR3_BASE_TREE    m;
-+    RSP2SQL_dateref_return r;
-+    #undef    RETURN_TYPE_r
-+    #define   RETURN_TYPE_r RSP2SQL_dateref_return
-+
-+    pANTLR3_COMMON_TOKEN o;
-+    #undef    RETURN_TYPE_o
-+    #define   RETURN_TYPE_o pANTLR3_COMMON_TOKEN
-+
-+    RSP2SQL_dateintval_return i;
-+    #undef    RETURN_TYPE_i
-+    #define   RETURN_TYPE_i RSP2SQL_dateintval_return
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     retval.date= 0; retval.valid= 1; 
-+    m       = NULL;
-+    o = NULL;
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    {
-+        {
-+            //  RSP2SQL.g:387:2: (r= dateref | ^(o= dateop r= dateref m= INT i= dateintval ) )
-+            
-+            ANTLR3_UINT32 alt5;
-+
-+            alt5=2;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case DATE:
-+            case TODAY:
-+              {
-+                      alt5=1;
-+              }
-+                break;
-+            case BEFORE:
-+            case AFTER:
-+              {
-+                      alt5=2;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 5;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruledatespecEx;
-+            }
-+
-+            switch (alt5) 
-+            {
-+              case 1:
-+                  // RSP2SQL.g:387:4: r= dateref
-+                  {
-+                      FOLLOWPUSH(FOLLOW_dateref_in_datespec546);
-+                      r=dateref(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatespecEx;
-+                      }
-+
-+                      {
-+
-+                                              if (!r.valid)
-+                                                      retval.valid= 0;
-+                                              else
-+                                                      retval.date= r.date;
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP2SQL.g:394:4: ^(o= dateop r= dateref m= INT i= dateintval )
-+                  {
-+                      FOLLOWPUSH(FOLLOW_dateop_in_datespec560);
-+                      o=dateop(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatespecEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatespecEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_dateref_in_datespec566);
-+                      r=dateref(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatespecEx;
-+                      }
-+
-+                      m = (pANTLR3_BASE_TREE) MATCHT(INT, &FOLLOW_INT_in_datespec572); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatespecEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_dateintval_in_datespec578);
-+                      i=dateintval(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatespecEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatespecEx;
-+                      }
-+
-+                      {
-+
-+                                              int32_t val;
-+                                              int ret;
-+
-+                                              if (!r.valid || !i.valid)
-+                                              {
-+                                                      retval.valid= 0;
-+                                                      goto datespec_valid_0; /* ABORT */
-+                                              }
-+
-+                                              ret = safe_atoi32((char *)m->getText(m)->chars, &val);
-+                                              if (ret < 0)
-+                                              {
-+                                                      DPRINTF(E_LOG, L_RSP, "Could not convert '%s' to integer\n", (char *)m->getText(m));
-+                                                      retval.valid= 0;
-+                                                      goto datespec_valid_0; /* ABORT */
-+                                              }
-+
-+                                              switch (o->getType(o))
-+                                              {
-+                                                      case BEFORE:
-+                                                              retval.date= r.date - (val * i.period);
-+                                                              break;
-+
-+                                                      case AFTER:
-+                                                              retval.date= r.date + (val * i.period);
-+                                                              break;
-+                                              }
-+
-+                                              datespec_valid_0:
-+                                                      ;
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruledatespecEx; /* Prevent compiler warnings */
-+    ruledatespecEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end datespec */
-+
-+/** 
-+ * $ANTLR start dateref
-+ * RSP2SQL.g:429:1: dateref returns [ time_t date, int valid ] : (n= DATE | TODAY );
-+ */
-+static RSP2SQL_dateref_return
-+dateref(pRSP2SQL ctx)
-+{   
-+    RSP2SQL_dateref_return retval;
-+
-+    pANTLR3_BASE_TREE    n;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     retval.date= 0; retval.valid= 1; 
-+    n       = NULL;
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    {
-+        {
-+            //  RSP2SQL.g:431:2: (n= DATE | TODAY )
-+            
-+            ANTLR3_UINT32 alt6;
-+
-+            alt6=2;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case DATE:
-+              {
-+                      alt6=1;
-+              }
-+                break;
-+            case TODAY:
-+              {
-+                      alt6=2;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 6;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruledaterefEx;
-+            }
-+
-+            switch (alt6) 
-+            {
-+              case 1:
-+                  // RSP2SQL.g:431:4: n= DATE
-+                  {
-+                      n = (pANTLR3_BASE_TREE) MATCHT(DATE, &FOLLOW_DATE_in_dateref607); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledaterefEx;
-+                      }
-+
-+                      {
-+
-+                                              struct tm tm;
-+                                              char *ret;
-+
-+                                              ret = strptime((char *)n->getText(n), "%Y-%m-%d", &tm);
-+                                              if (!ret)
-+                                              {
-+                                                      DPRINTF(E_LOG, L_RSP, "Date '%s' could not be interpreted\n", (char *)n->getText(n));
-+                                                      retval.valid= 0;
-+                                                      goto dateref_valid_0; /* ABORT */
-+                                              }
-+                                              else
-+                                              {
-+                                                      if (*ret != '\0')
-+                                                              DPRINTF(E_LOG, L_RSP, "Garbage at end of date '%s' ?!\n", (char *)n->getText(n));
-+
-+                                                      retval.date= mktime(&tm);
-+                                                      if (retval.date == (time_t) -1)
-+                                                      {
-+                                                              DPRINTF(E_LOG, L_RSP, "Date '%s' could not be converted to an epoch\n", (char *)n->getText(n));
-+                                                              retval.valid= 0;
-+                                                              goto dateref_valid_0; /* ABORT */
-+                                                      }
-+                                              }
-+
-+                                              dateref_valid_0:
-+                                                      ;
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP2SQL.g:460:4: TODAY
-+                  {
-+                       MATCHT(TODAY, &FOLLOW_TODAY_in_dateref616); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledaterefEx;
-+                      }
-+
-+                      {
-+                           retval.date= time(NULL); 
-+                      }
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruledaterefEx; /* Prevent compiler warnings */
-+    ruledaterefEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end dateref */
-+
-+/** 
-+ * $ANTLR start dateintval
-+ * RSP2SQL.g:464:1: dateintval returns [ time_t period, int valid ] : ( DAY | WEEK | MONTH | YEAR );
-+ */
-+static RSP2SQL_dateintval_return
-+dateintval(pRSP2SQL ctx)
-+{   
-+    RSP2SQL_dateintval_return retval;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     retval.period= 0; retval.valid= 1; 
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    {
-+        {
-+            //  RSP2SQL.g:466:2: ( DAY | WEEK | MONTH | YEAR )
-+            
-+            ANTLR3_UINT32 alt7;
-+
-+            alt7=4;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case DAY:
-+              {
-+                      alt7=1;
-+              }
-+                break;
-+            case WEEK:
-+              {
-+                      alt7=2;
-+              }
-+                break;
-+            case MONTH:
-+              {
-+                      alt7=3;
-+              }
-+                break;
-+            case YEAR:
-+              {
-+                      alt7=4;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 7;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruledateintvalEx;
-+            }
-+
-+            switch (alt7) 
-+            {
-+              case 1:
-+                  // RSP2SQL.g:466:4: DAY
-+                  {
-+                       MATCHT(DAY, &FOLLOW_DAY_in_dateintval640); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledateintvalEx;
-+                      }
-+
-+                      {
-+                           retval.period= 24 * 60 * 60; 
-+                      }
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP2SQL.g:468:4: WEEK
-+                  {
-+                       MATCHT(WEEK, &FOLLOW_WEEK_in_dateintval649); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledateintvalEx;
-+                      }
-+
-+                      {
-+                           retval.period= 7 * 24 * 60 * 60; 
-+                      }
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // RSP2SQL.g:470:4: MONTH
-+                  {
-+                       MATCHT(MONTH, &FOLLOW_MONTH_in_dateintval658); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledateintvalEx;
-+                      }
-+
-+                      {
-+                           retval.period= 30 * 24 * 60 * 60; 
-+                      }
-+
-+                  }
-+                  break;
-+              case 4:
-+                  // RSP2SQL.g:472:4: YEAR
-+                  {
-+                       MATCHT(YEAR, &FOLLOW_YEAR_in_dateintval667); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledateintvalEx;
-+                      }
-+
-+                      {
-+                           retval.period= 365 * 24 * 60 * 60; 
-+                      }
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruledateintvalEx; /* Prevent compiler warnings */
-+    ruledateintvalEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end dateintval */
-+/* End of parsing rules
-+ * ==============================================
-+ */
-+
-+/* ==============================================
-+ * Syntactic predicates
-+ */
-+/* End of syntactic predicates
-+ * ==============================================
-+ */
-+
-+ 
-+ 
-+
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/RSP2SQL.h b/src/pregen/RSP2SQL.h
-new file mode 100644
-index 0000000..08ac7bb
---- /dev/null
-+++ b/src/pregen/RSP2SQL.h
-@@ -0,0 +1,291 @@
-+/** \file
-+ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : RSP2SQL.g
-+ *     -                            On : 2016-01-01 12:23:43
-+ *     -           for the tree parser : RSP2SQLTreeParser *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The tree parser RSP2SQL has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ * 
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pRSP2SQL, which is returned from a call to RSP2SQLNew().
-+ *
-+ * The methods in pRSP2SQL are  as follows:
-+ *
-+ *  - pANTLR3_STRING      pRSP2SQL->query(pRSP2SQL)
-+ *  - RSP2SQL_expr_return      pRSP2SQL->expr(pRSP2SQL)
-+ *  - RSP2SQL_strcrit_return      pRSP2SQL->strcrit(pRSP2SQL)
-+ *  - pANTLR3_COMMON_TOKEN      pRSP2SQL->strop(pRSP2SQL)
-+ *  - RSP2SQL_intcrit_return      pRSP2SQL->intcrit(pRSP2SQL)
-+ *  - pANTLR3_COMMON_TOKEN      pRSP2SQL->intop(pRSP2SQL)
-+ *  - RSP2SQL_datecrit_return      pRSP2SQL->datecrit(pRSP2SQL)
-+ *  - pANTLR3_COMMON_TOKEN      pRSP2SQL->dateop(pRSP2SQL)
-+ *  - RSP2SQL_datespec_return      pRSP2SQL->datespec(pRSP2SQL)
-+ *  - RSP2SQL_dateref_return      pRSP2SQL->dateref(pRSP2SQL)
-+ *  - RSP2SQL_dateintval_return      pRSP2SQL->dateintval(pRSP2SQL)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+#ifndef       _RSP2SQL_H
-+#define _RSP2SQL_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include    <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+ 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct RSP2SQL_Ctx_struct RSP2SQL, * pRSP2SQL;
-+
-+
-+
-+      /* Needs #define _GNU_SOURCE for strptime() */
-+
-+      #include <stdio.h>
-+      #include <string.h>
-+      #include <time.h>
-+      #include <stdint.h>
-+
-+      #include "logger.h"
-+      #include "db.h"
-+      #include "misc.h"
-+      #include "rsp_query.h"
-+
-+
-+#ifdef        ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
-+//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
-+//          initialized but unused variable                                   - tree rewrite variables declared but not needed
-+//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
-+//          potentially unitialized variable used                     - retval always returned from a rule 
-+//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+typedef struct RSP2SQL_expr_return_struct
-+{
-+    pANTLR3_BASE_TREE       start;
-+    pANTLR3_BASE_TREE       stop;   
-+    pANTLR3_STRING result;
-+    int valid;
-+}
-+    RSP2SQL_expr_return;
-+
-+typedef struct RSP2SQL_strcrit_return_struct
-+{
-+    pANTLR3_BASE_TREE       start;
-+    pANTLR3_BASE_TREE       stop;   
-+    pANTLR3_STRING result;
-+    int valid;
-+}
-+    RSP2SQL_strcrit_return;
-+
-+typedef struct RSP2SQL_intcrit_return_struct
-+{
-+    pANTLR3_BASE_TREE       start;
-+    pANTLR3_BASE_TREE       stop;   
-+    pANTLR3_STRING result;
-+    int valid;
-+}
-+    RSP2SQL_intcrit_return;
-+
-+typedef struct RSP2SQL_datecrit_return_struct
-+{
-+    pANTLR3_BASE_TREE       start;
-+    pANTLR3_BASE_TREE       stop;   
-+    pANTLR3_STRING result;
-+    int valid;
-+}
-+    RSP2SQL_datecrit_return;
-+
-+typedef struct RSP2SQL_datespec_return_struct
-+{
-+    pANTLR3_BASE_TREE       start;
-+    pANTLR3_BASE_TREE       stop;   
-+    time_t date;
-+    int valid;
-+}
-+    RSP2SQL_datespec_return;
-+
-+typedef struct RSP2SQL_dateref_return_struct
-+{
-+    pANTLR3_BASE_TREE       start;
-+    pANTLR3_BASE_TREE       stop;   
-+    time_t date;
-+    int valid;
-+}
-+    RSP2SQL_dateref_return;
-+
-+typedef struct RSP2SQL_dateintval_return_struct
-+{
-+    pANTLR3_BASE_TREE       start;
-+    pANTLR3_BASE_TREE       stop;   
-+    time_t period;
-+    int valid;
-+}
-+    RSP2SQL_dateintval_return;
-+
-+
-+
-+/** Context tracking structure for RSP2SQL
-+ */
-+struct RSP2SQL_Ctx_struct
-+{
-+    /** Built in ANTLR3 context tracker contains all the generic elements
-+     *  required for context tracking.
-+     */
-+    pANTLR3_TREE_PARSER           pTreeParser;
-+
-+
-+     pANTLR3_STRING (*query)  (struct RSP2SQL_Ctx_struct * ctx);
-+     RSP2SQL_expr_return (*expr)      (struct RSP2SQL_Ctx_struct * ctx);
-+     RSP2SQL_strcrit_return (*strcrit)        (struct RSP2SQL_Ctx_struct * ctx);
-+     pANTLR3_COMMON_TOKEN (*strop)    (struct RSP2SQL_Ctx_struct * ctx);
-+     RSP2SQL_intcrit_return (*intcrit)        (struct RSP2SQL_Ctx_struct * ctx);
-+     pANTLR3_COMMON_TOKEN (*intop)    (struct RSP2SQL_Ctx_struct * ctx);
-+     RSP2SQL_datecrit_return (*datecrit)      (struct RSP2SQL_Ctx_struct * ctx);
-+     pANTLR3_COMMON_TOKEN (*dateop)   (struct RSP2SQL_Ctx_struct * ctx);
-+     RSP2SQL_datespec_return (*datespec)      (struct RSP2SQL_Ctx_struct * ctx);
-+     RSP2SQL_dateref_return (*dateref)        (struct RSP2SQL_Ctx_struct * ctx);
-+     RSP2SQL_dateintval_return (*dateintval)  (struct RSP2SQL_Ctx_struct * ctx);
-+    // Delegated rules
-+    const char * (*getGrammarFileName)();
-+    void          (*free)   (struct RSP2SQL_Ctx_struct * ctx);
-+        
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pRSP2SQL RSP2SQLNew         (pANTLR3_COMMON_TREE_NODE_STREAM instream);
-+ANTLR3_API pRSP2SQL RSP2SQLNewSSD      (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the tree parser will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef        EOF
-+#undef        EOF
-+#endif
-+#ifdef        Tokens
-+#undef        Tokens
-+#endif 
-+#define STARTSW      14
-+#define WEEK      26
-+#define TODAY      24
-+#define YEAR      28
-+#define ENDSW      15
-+#define GTE      20
-+#define BEFORE      21
-+#define DAY      25
-+#define INT      16
-+#define NOT      11
-+#define AFTER      22
-+#define AND      6
-+#define EOF      -1
-+#define LTE      19
-+#define MONTH      27
-+#define DIGIT19      31
-+#define INCLUDES      13
-+#define STR      10
-+#define QUOTE      29
-+#define GREATER      18
-+#define WS      30
-+#define LPAR      7
-+#define NEWLINE      4
-+#define EQUAL      12
-+#define OR      5
-+#define LESS      17
-+#define FIELD      9
-+#define RPAR      8
-+#define ESCAPED      33
-+#define DATE      23
-+#define DIGIT09      32
-+#ifdef        EOF
-+#undef        EOF
-+#define       EOF     ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for RSP2SQL
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/RSP2SQL.u b/src/pregen/RSP2SQL.u
-new file mode 100644
-index 0000000..53d8cda
---- /dev/null
-+++ b/src/pregen/RSP2SQL.u
-@@ -0,0 +1,5 @@
-+RSP2SQL.g: RSP.tokens
-+RSP2SQL.c : RSP2SQL.g
-+./RSP2SQL.tokens : RSP2SQL.g
-+RSP2SQL.h : RSP2SQL.g
-+ANTLR_PRODUCTS += RSP2SQL.c ./RSP2SQL.tokens RSP2SQL.h 
-\ No newline at end of file
-diff --git a/src/pregen/RSPLexer.c b/src/pregen/RSPLexer.c
-new file mode 100644
-index 0000000..2e3faae
---- /dev/null
-+++ b/src/pregen/RSPLexer.c
-@@ -0,0 +1,4867 @@
-+/** \file
-+ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : RSP.g
-+ *     -                            On : 2016-01-01 12:23:42
-+ *     -                 for the lexer : RSPLexerLexer *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include    "RSPLexer.h"
-+/* ----------------------------------------- */
-+
-+
-+/** String literals used by RSPLexer that we must do things like MATCHS() with.
-+ *  C will normally just lay down 8 bit characters, and you can use L"xxx" to
-+ *  get wchar_t, but wchar_t is 16 bits on Windows, which is not UTF32 and so
-+ *  we perform this little trick of defining the literals as arrays of UINT32
-+ *  and passing in the address of these.
-+ */
-+static ANTLR3_UCHAR   lit_1[]  = { 0x61, 0x6E, 0x64,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_2[]  = { 0x6F, 0x72,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_3[]  = { 0x69, 0x6E, 0x63, 0x6C, 0x75, 0x64, 0x65, 0x73,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_4[]  = { 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x77, 0x69, 0x74, 0x68,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_5[]  = { 0x65, 0x6E, 0x64, 0x73, 0x77, 0x69, 0x74, 0x68,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_6[]  = { 0x3E, 0x3D,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_7[]  = { 0x3C, 0x3D,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_8[]  = { 0x62, 0x65, 0x66, 0x6F, 0x72, 0x65,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_9[]  = { 0x61, 0x66, 0x74, 0x65, 0x72,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_10[]  = { 0x64, 0x61, 0x79,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_11[]  = { 0x64, 0x61, 0x79, 0x73,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_12[]  = { 0x77, 0x65, 0x65, 0x6B,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_13[]  = { 0x77, 0x65, 0x65, 0x6B, 0x73,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_14[]  = { 0x6D, 0x6F, 0x6E, 0x74, 0x68,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_15[]  = { 0x6D, 0x6F, 0x6E, 0x74, 0x68, 0x73,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_16[]  = { 0x79, 0x65, 0x61, 0x72,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_17[]  = { 0x79, 0x65, 0x61, 0x72, 0x73,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_18[]  = { 0x74, 0x6F, 0x64, 0x61, 0x79,  ANTLR3_STRING_TERMINATOR};
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+ 
-+#define               CTX     ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef        SCOPE_TYPE
-+#undef        SCOPE_STACK
-+#undef        SCOPE_TOP
-+#define       SCOPE_TYPE(scope)   pRSPLexer_##scope##_SCOPE
-+#define SCOPE_STACK(scope)  pRSPLexer_##scope##Stack
-+#define       SCOPE_TOP(scope)    ctx->pRSPLexer_##scope##Top
-+#define       SCOPE_SIZE(scope)               ctx->pRSPLexer_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+ 
-+/* Macros for accessing things in a lexer
-+ */
-+#undef            LEXER
-+#undef            RECOGNIZER              
-+#undef            RULEMEMO                
-+#undef            GETCHARINDEX
-+#undef            GETLINE
-+#undef            GETCHARPOSITIONINLINE
-+#undef            EMIT
-+#undef            EMITNEW
-+#undef            MATCHC
-+#undef            MATCHS
-+#undef            MATCHRANGE
-+#undef            LTOKEN
-+#undef            HASFAILED
-+#undef            FAILEDFLAG
-+#undef            INPUT
-+#undef            STRSTREAM
-+#undef            LA
-+#undef            HASEXCEPTION
-+#undef            EXCEPTION
-+#undef            CONSTRUCTEX
-+#undef            CONSUME
-+#undef            LRECOVER
-+#undef            MARK
-+#undef            REWIND
-+#undef            REWINDLAST
-+#undef            BACKTRACKING
-+#undef                MATCHANY
-+#undef                MEMOIZE
-+#undef                HAVEPARSEDRULE
-+#undef                GETTEXT
-+#undef                INDEX
-+#undef                SEEK
-+#undef                PUSHSTREAM
-+#undef                POPSTREAM
-+#undef                SETTEXT
-+#undef                SETTEXT8
-+
-+#define           LEXER                                       ctx->pLexer
-+#define           RECOGNIZER                      LEXER->rec
-+#define               LEXSTATE                                RECOGNIZER->state
-+#define               TOKSOURCE                               LEXSTATE->tokSource
-+#define           GETCHARINDEX()                      LEXER->getCharIndex(LEXER)
-+#define           GETLINE()                           LEXER->getLine(LEXER)
-+#define           GETTEXT()                           LEXER->getText(LEXER)
-+#define           GETCHARPOSITIONINLINE() LEXER->getCharPositionInLine(LEXER)
-+#define           EMIT()                                      LEXSTATE->type = _type; LEXER->emit(LEXER)
-+#define           EMITNEW(t)                          LEXER->emitNew(LEXER, t)
-+#define           MATCHC(c)                           LEXER->matchc(LEXER, c)
-+#define           MATCHS(s)                           LEXER->matchs(LEXER, s)
-+#define           MATCHRANGE(c1,c2)       LEXER->matchRange(LEXER, c1, c2)
-+#define           MATCHANY()                          LEXER->matchAny(LEXER)
-+#define           LTOKEN                              LEXSTATE->token
-+#define           HASFAILED()                         (LEXSTATE->failed == ANTLR3_TRUE)
-+#define           BACKTRACKING                        LEXSTATE->backtracking
-+#define           FAILEDFLAG                          LEXSTATE->failed
-+#define           INPUT                                       LEXER->input
-+#define           STRSTREAM                           INPUT
-+#define               ISTREAM                                 INPUT->istream
-+#define               INDEX()                                 ISTREAM->index(ISTREAM)
-+#define               SEEK(n)                                 ISTREAM->seek(ISTREAM, n)
-+#define           EOF_TOKEN                           &(LEXSTATE->tokSource->eofToken)
-+#define           HASEXCEPTION()                      (LEXSTATE->error == ANTLR3_TRUE)
-+#define           EXCEPTION                           LEXSTATE->exception
-+#define           CONSTRUCTEX()                       RECOGNIZER->exConstruct(RECOGNIZER)
-+#define           LRECOVER()                          LEXER->recover(LEXER)
-+#define           MARK()                                      ISTREAM->mark(ISTREAM)
-+#define           REWIND(m)                           ISTREAM->rewind(ISTREAM, m)
-+#define           REWINDLAST()                        ISTREAM->rewindLast(ISTREAM)
-+#define               MEMOIZE(ri,si)                  RECOGNIZER->memoize(RECOGNIZER, ri, si)
-+#define               HAVEPARSEDRULE(r)               RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define               PUSHSTREAM(str)                 LEXER->pushCharStream(LEXER, str)
-+#define               POPSTREAM()                             LEXER->popCharStream(LEXER)
-+#define               SETTEXT(str)                    LEXSTATE->text = str
-+#define               SKIP()                                  LEXSTATE->token = &(TOKSOURCE->skipToken)
-+#define               USER1                                   LEXSTATE->user1
-+#define               USER2                                   LEXSTATE->user2
-+#define               USER3                                   LEXSTATE->user3
-+#define               CUSTOM                                  LEXSTATE->custom
-+#define               RULEMEMO                                LEXSTATE->ruleMemo
-+#define               DBG                                             RECOGNIZER->debugger
-+
-+/* If we have been told we can rely on the standard 8 bit or 16 bit input
-+ * stream, then we can define our macros to use the direct pointers
-+ * in the input object, which is much faster than indirect calls. This
-+ * is really only significant to lexers with a lot of fragment rules (which
-+ * do not place LA(1) in a temporary at the moment) and even then
-+ * only if there is a lot of input (order of say 1M or so).
-+ */
-+#if   defined(ANTLR3_INLINE_INPUT_ASCII) || defined(ANTLR3_INLINE_INPUT_UTF16)
-+
-+# ifdef       ANTLR3_INLINE_INPUT_ASCII
-+
-+/* 8 bit "ASCII" (actually any 8 bit character set) */
-+
-+#  define         NEXTCHAR                    ((pANTLR3_UINT8)(INPUT->nextChar))
-+#  define         DATAP                               ((pANTLR3_UINT8)(INPUT->data))
-+
-+# else
-+
-+#  define         NEXTCHAR                    ((pANTLR3_UINT16)(INPUT->nextChar)) 
-+#  define         DATAP                               ((pANTLR3_UINT16)(INPUT->data))
-+
-+# endif
-+
-+# define          LA(n) ((NEXTCHAR + n) > (DATAP + INPUT->sizeBuf) ? ANTLR3_CHARSTREAM_EOF : (ANTLR3_UCHAR)(*(NEXTCHAR + n - 1)))
-+# define          CONSUME()                                                                                   \
-+{                                                                                                                                     \
-+    if        (NEXTCHAR < (DATAP + INPUT->sizeBuf))                                           \
-+    {                                                                                                                         \
-+              INPUT->charPositionInLine++;                                                            \
-+              if  ((ANTLR3_UCHAR)(*NEXTCHAR) == INPUT->newlineChar)           \
-+              {                                                                                                                       \
-+                      INPUT->line++;                                                                                  \
-+                      INPUT->charPositionInLine       = 0;                                            \
-+                      INPUT->currentLine              = (void *)(NEXTCHAR + 1);               \
-+              }                                                                                                                       \
-+              INPUT->nextChar = (void *)(NEXTCHAR + 1);                                       \
-+    }                                                                                                                         \
-+}
-+
-+#else
-+
-+// Pick up the input character by calling the input stream implementation.
-+//
-+#define           CONSUME()                           INPUT->istream->consume(INPUT->istream)
-+#define           LA(n)                                       INPUT->istream->_LA(INPUT->istream, n)
-+
-+#endif
-+#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define           UP      ANTLR3_TOKEN_UP
-+#define           DOWN    ANTLR3_TOKEN_DOWN
-+#define           EOR     ANTLR3_TOKEN_EOR
-+#define           INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+/* Forward declare the locally static matching functions we have generated and any predicate functions.
-+ */
-+static ANTLR3_INLINE  void    mQUOTE    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mLPAR    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mRPAR    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mAND    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mOR    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mNOT    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mEQUAL    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mINCLUDES    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mSTARTSW    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mENDSW    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mGREATER    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mLESS    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mGTE    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mLTE    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mBEFORE    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mAFTER    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mDAY    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mWEEK    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mMONTH    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mYEAR    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mTODAY    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mNEWLINE    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mWS    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mFIELD    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mINT    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mDATE    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mSTR    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mESCAPED    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mDIGIT09    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mDIGIT19    (pRSPLexer ctx);
-+static ANTLR3_INLINE  void    mTokens    (pRSPLexer ctx);
-+static void   RSPLexerFree(pRSPLexer ctx);
-+
-+/* =========================================================================
-+ * Lexer matching rules end.
-+ * =========================================================================
-+ */
-+
-+
-+
-+static void
-+RSPLexerFree  (pRSPLexer ctx)
-+{
-+    LEXER->free(LEXER);
-+    
-+    ANTLR3_FREE(ctx);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "RSP.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+      return fileName;
-+}
-+
-+/** \brief Create a new lexer called RSPLexer
-+ *
-+ * \param[in]    instream Pointer to an initialized input stream
-+ * \return 
-+ *     - Success pRSPLexer initialized for the lex start
-+ *     - Fail NULL
-+ */
-+ANTLR3_API pRSPLexer RSPLexerNew         
-+(pANTLR3_INPUT_STREAM instream)
-+{
-+      // See if we can create a new lexer with the standard constructor
-+      //
-+      return RSPLexerNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new lexer called RSPLexer
-+ *
-+ * \param[in]    instream Pointer to an initialized input stream
-+ * \param[state] state Previously created shared recognizer stat
-+ * \return 
-+ *     - Success pRSPLexer initialized for the lex start
-+ *     - Fail NULL
-+ */
-+ANTLR3_API pRSPLexer RSPLexerNewSSD         
-+(pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+    pRSPLexer ctx; // Context structure we will build and return
-+
-+    ctx = (pRSPLexer) ANTLR3_CALLOC(1, sizeof(RSPLexer));
-+
-+    if  (ctx == NULL)
-+    {
-+        // Failed to allocate memory for lexer context
-+        return  NULL;
-+    }
-+
-+    /* -------------------------------------------------------------------
-+     * Memory for basic structure is allocated, now to fill in
-+     * in base ANTLR3 structures. We initialize the function pointers
-+     * for the standard ANTLR3 lexer function set, but upon return
-+     * from here, the programmer may set the pointers to provide custom
-+     * implementations of each function. 
-+     *
-+     * We don't use the macros defined in RSPLexer.h here so you can get a sense
-+     * of what goes where.
-+     */
-+    
-+    /* Create a base lexer, using the supplied input stream
-+     */
-+    ctx->pLexer       = antlr3LexerNewStream(ANTLR3_SIZE_HINT, instream, state);
-+    
-+    /* Check that we allocated the memory correctly
-+     */
-+    if        (ctx->pLexer == NULL)
-+    {
-+              ANTLR3_FREE(ctx);
-+              return  NULL;
-+    }
-+    /* Install the implementation of our RSPLexer interface
-+     */
-+    ctx->mQUOTE       = mQUOTE;
-+    ctx->mLPAR        = mLPAR;
-+    ctx->mRPAR        = mRPAR;
-+    ctx->mAND = mAND;
-+    ctx->mOR  = mOR;
-+    ctx->mNOT = mNOT;
-+    ctx->mEQUAL       = mEQUAL;
-+    ctx->mINCLUDES    = mINCLUDES;
-+    ctx->mSTARTSW     = mSTARTSW;
-+    ctx->mENDSW       = mENDSW;
-+    ctx->mGREATER     = mGREATER;
-+    ctx->mLESS        = mLESS;
-+    ctx->mGTE = mGTE;
-+    ctx->mLTE = mLTE;
-+    ctx->mBEFORE      = mBEFORE;
-+    ctx->mAFTER       = mAFTER;
-+    ctx->mDAY = mDAY;
-+    ctx->mWEEK        = mWEEK;
-+    ctx->mMONTH       = mMONTH;
-+    ctx->mYEAR        = mYEAR;
-+    ctx->mTODAY       = mTODAY;
-+    ctx->mNEWLINE     = mNEWLINE;
-+    ctx->mWS  = mWS;
-+    ctx->mFIELD       = mFIELD;
-+    ctx->mINT = mINT;
-+    ctx->mDATE        = mDATE;
-+    ctx->mSTR = mSTR;
-+    ctx->mESCAPED     = mESCAPED;
-+    ctx->mDIGIT09     = mDIGIT09;
-+    ctx->mDIGIT19     = mDIGIT19;
-+    ctx->mTokens      = mTokens;
-+    
-+    /** When the nextToken() call is made to this lexer's pANTLR3_TOKEN_SOURCE
-+     *  it will call mTokens() in this generated code, and will pass it the ctx
-+     * pointer of this lexer, not the context of the base lexer, so store that now.
-+     */
-+    ctx->pLexer->ctx      = ctx;
-+    
-+    /**Install the token matching function
-+     */
-+    ctx->pLexer->mTokens = (void (*) (void *))(mTokens);
-+    
-+    ctx->getGrammarFileName   = getGrammarFileName;
-+    ctx->free         = RSPLexerFree;
-+
-+    
-+    
-+
-+
-+    /* Return the newly built lexer to the caller
-+     */
-+    return  ctx;
-+}
-+ 
-+
-+/* =========================================================================
-+ * Functions to match the lexer grammar defined tokens from the input stream
-+ */
-+
-+//   Comes from: 85:7: ( '\"' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start QUOTE
-+ *
-+ * Looks to match the characters the constitute the token QUOTE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mQUOTE(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = QUOTE;
-+       
-+    
-+    // RSP.g:85:7: ( '\"' )
-+    // RSP.g:85:9: '\"'
-+    {
-+        MATCHC('"'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleQUOTEEx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleQUOTEEx; /* Prevent compiler warnings */
-+    ruleQUOTEEx: ;
-+
-+}
-+// $ANTLR end QUOTE
-+
-+//   Comes from: 86:6: ( '(' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LPAR
-+ *
-+ * Looks to match the characters the constitute the token LPAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLPAR(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = LPAR;
-+       
-+    
-+    // RSP.g:86:6: ( '(' )
-+    // RSP.g:86:8: '('
-+    {
-+        MATCHC('('); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleLPAREx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleLPAREx; /* Prevent compiler warnings */
-+    ruleLPAREx: ;
-+
-+}
-+// $ANTLR end LPAR
-+
-+//   Comes from: 87:6: ( ')' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start RPAR
-+ *
-+ * Looks to match the characters the constitute the token RPAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mRPAR(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = RPAR;
-+       
-+    
-+    // RSP.g:87:6: ( ')' )
-+    // RSP.g:87:8: ')'
-+    {
-+        MATCHC(')'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleRPAREx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleRPAREx; /* Prevent compiler warnings */
-+    ruleRPAREx: ;
-+
-+}
-+// $ANTLR end RPAR
-+
-+//   Comes from: 89:5: ( 'and' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start AND
-+ *
-+ * Looks to match the characters the constitute the token AND
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mAND(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = AND;
-+       
-+    
-+    // RSP.g:89:5: ( 'and' )
-+    // RSP.g:89:7: 'and'
-+    {
-+        MATCHS(lit_1); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleANDEx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleANDEx; /* Prevent compiler warnings */
-+    ruleANDEx: ;
-+
-+}
-+// $ANTLR end AND
-+
-+//   Comes from: 90:4: ( 'or' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start OR
-+ *
-+ * Looks to match the characters the constitute the token OR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mOR(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = OR;
-+       
-+    
-+    // RSP.g:90:4: ( 'or' )
-+    // RSP.g:90:6: 'or'
-+    {
-+        MATCHS(lit_2); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleOREx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleOREx; /* Prevent compiler warnings */
-+    ruleOREx: ;
-+
-+}
-+// $ANTLR end OR
-+
-+//   Comes from: 91:5: ( '!' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start NOT
-+ *
-+ * Looks to match the characters the constitute the token NOT
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mNOT(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = NOT;
-+       
-+    
-+    // RSP.g:91:5: ( '!' )
-+    // RSP.g:91:7: '!'
-+    {
-+        MATCHC('!'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleNOTEx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleNOTEx; /* Prevent compiler warnings */
-+    ruleNOTEx: ;
-+
-+}
-+// $ANTLR end NOT
-+
-+//   Comes from: 94:7: ( '=' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start EQUAL
-+ *
-+ * Looks to match the characters the constitute the token EQUAL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mEQUAL(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = EQUAL;
-+       
-+    
-+    // RSP.g:94:7: ( '=' )
-+    // RSP.g:94:9: '='
-+    {
-+        MATCHC('='); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleEQUALEx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleEQUALEx; /* Prevent compiler warnings */
-+    ruleEQUALEx: ;
-+
-+}
-+// $ANTLR end EQUAL
-+
-+//   Comes from: 97:9: ( 'includes' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start INCLUDES
-+ *
-+ * Looks to match the characters the constitute the token INCLUDES
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mINCLUDES(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = INCLUDES;
-+       
-+    
-+    // RSP.g:97:9: ( 'includes' )
-+    // RSP.g:97:11: 'includes'
-+    {
-+        MATCHS(lit_3); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleINCLUDESEx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleINCLUDESEx; /* Prevent compiler warnings */
-+    ruleINCLUDESEx: ;
-+
-+}
-+// $ANTLR end INCLUDES
-+
-+//   Comes from: 98:9: ( 'startswith' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start STARTSW
-+ *
-+ * Looks to match the characters the constitute the token STARTSW
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mSTARTSW(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = STARTSW;
-+       
-+    
-+    // RSP.g:98:9: ( 'startswith' )
-+    // RSP.g:98:11: 'startswith'
-+    {
-+        MATCHS(lit_4); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleSTARTSWEx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleSTARTSWEx; /* Prevent compiler warnings */
-+    ruleSTARTSWEx: ;
-+
-+}
-+// $ANTLR end STARTSW
-+
-+//   Comes from: 99:7: ( 'endswith' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start ENDSW
-+ *
-+ * Looks to match the characters the constitute the token ENDSW
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mENDSW(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = ENDSW;
-+       
-+    
-+    // RSP.g:99:7: ( 'endswith' )
-+    // RSP.g:99:9: 'endswith'
-+    {
-+        MATCHS(lit_5); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleENDSWEx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleENDSWEx; /* Prevent compiler warnings */
-+    ruleENDSWEx: ;
-+
-+}
-+// $ANTLR end ENDSW
-+
-+//   Comes from: 102:9: ( '>' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start GREATER
-+ *
-+ * Looks to match the characters the constitute the token GREATER
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mGREATER(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = GREATER;
-+       
-+    
-+    // RSP.g:102:9: ( '>' )
-+    // RSP.g:102:11: '>'
-+    {
-+        MATCHC('>'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleGREATEREx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleGREATEREx; /* Prevent compiler warnings */
-+    ruleGREATEREx: ;
-+
-+}
-+// $ANTLR end GREATER
-+
-+//   Comes from: 103:6: ( '<' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LESS
-+ *
-+ * Looks to match the characters the constitute the token LESS
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLESS(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = LESS;
-+       
-+    
-+    // RSP.g:103:6: ( '<' )
-+    // RSP.g:103:8: '<'
-+    {
-+        MATCHC('<'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleLESSEx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleLESSEx; /* Prevent compiler warnings */
-+    ruleLESSEx: ;
-+
-+}
-+// $ANTLR end LESS
-+
-+//   Comes from: 104:5: ( '>=' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start GTE
-+ *
-+ * Looks to match the characters the constitute the token GTE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mGTE(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = GTE;
-+       
-+    
-+    // RSP.g:104:5: ( '>=' )
-+    // RSP.g:104:7: '>='
-+    {
-+        MATCHS(lit_6); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleGTEEx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleGTEEx; /* Prevent compiler warnings */
-+    ruleGTEEx: ;
-+
-+}
-+// $ANTLR end GTE
-+
-+//   Comes from: 105:5: ( '<=' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LTE
-+ *
-+ * Looks to match the characters the constitute the token LTE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLTE(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = LTE;
-+       
-+    
-+    // RSP.g:105:5: ( '<=' )
-+    // RSP.g:105:7: '<='
-+    {
-+        MATCHS(lit_7); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleLTEEx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleLTEEx; /* Prevent compiler warnings */
-+    ruleLTEEx: ;
-+
-+}
-+// $ANTLR end LTE
-+
-+//   Comes from: 108:8: ( 'before' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start BEFORE
-+ *
-+ * Looks to match the characters the constitute the token BEFORE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mBEFORE(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = BEFORE;
-+       
-+    
-+    // RSP.g:108:8: ( 'before' )
-+    // RSP.g:108:10: 'before'
-+    {
-+        MATCHS(lit_8); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleBEFOREEx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleBEFOREEx; /* Prevent compiler warnings */
-+    ruleBEFOREEx: ;
-+
-+}
-+// $ANTLR end BEFORE
-+
-+//   Comes from: 109:7: ( 'after' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start AFTER
-+ *
-+ * Looks to match the characters the constitute the token AFTER
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mAFTER(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = AFTER;
-+       
-+    
-+    // RSP.g:109:7: ( 'after' )
-+    // RSP.g:109:9: 'after'
-+    {
-+        MATCHS(lit_9); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleAFTEREx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleAFTEREx; /* Prevent compiler warnings */
-+    ruleAFTEREx: ;
-+
-+}
-+// $ANTLR end AFTER
-+
-+//   Comes from: 110:5: ( 'day' | 'days' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DAY
-+ *
-+ * Looks to match the characters the constitute the token DAY
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDAY(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = DAY;
-+       
-+    
-+    {
-+        //  RSP.g:110:5: ( 'day' | 'days' )
-+        
-+        ANTLR3_UINT32 alt1;
-+
-+        alt1=2;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case 'd':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'a':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'y':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 's':
-+                                                              {
-+                                                                      alt1=2;
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt1=1;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 1;
-+                                          EXCEPTION->state        = 2;
-+
-+
-+                                          goto ruleDAYEx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 1;
-+                          EXCEPTION->state        = 1;
-+
-+
-+                          goto ruleDAYEx;
-+                      }
-+
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 1;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleDAYEx;
-+        }
-+
-+        switch (alt1) 
-+        {
-+      case 1:
-+          // RSP.g:110:7: 'day'
-+          {
-+              MATCHS(lit_10); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDAYEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // RSP.g:110:15: 'days'
-+          {
-+              MATCHS(lit_11); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDAYEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleDAYEx; /* Prevent compiler warnings */
-+    ruleDAYEx: ;
-+
-+}
-+// $ANTLR end DAY
-+
-+//   Comes from: 111:6: ( 'week' | 'weeks' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start WEEK
-+ *
-+ * Looks to match the characters the constitute the token WEEK
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mWEEK(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = WEEK;
-+       
-+    
-+    {
-+        //  RSP.g:111:6: ( 'week' | 'weeks' )
-+        
-+        ANTLR3_UINT32 alt2;
-+
-+        alt2=2;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case 'w':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'e':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'e':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 'k':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 's':
-+                                                                              {
-+                                                                                      alt2=2;
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt2=1;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          CONSTRUCTEX();
-+                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                          EXCEPTION->message      = (void *)"";
-+                                                          EXCEPTION->decisionNum  = 2;
-+                                                          EXCEPTION->state        = 3;
-+
-+
-+                                                          goto ruleWEEKEx;
-+                                                      }
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 2;
-+                                          EXCEPTION->state        = 2;
-+
-+
-+                                          goto ruleWEEKEx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 2;
-+                          EXCEPTION->state        = 1;
-+
-+
-+                          goto ruleWEEKEx;
-+                      }
-+
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 2;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleWEEKEx;
-+        }
-+
-+        switch (alt2) 
-+        {
-+      case 1:
-+          // RSP.g:111:8: 'week'
-+          {
-+              MATCHS(lit_12); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleWEEKEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // RSP.g:111:17: 'weeks'
-+          {
-+              MATCHS(lit_13); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleWEEKEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleWEEKEx; /* Prevent compiler warnings */
-+    ruleWEEKEx: ;
-+
-+}
-+// $ANTLR end WEEK
-+
-+//   Comes from: 112:7: ( 'month' | 'months' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start MONTH
-+ *
-+ * Looks to match the characters the constitute the token MONTH
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mMONTH(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = MONTH;
-+       
-+    
-+    {
-+        //  RSP.g:112:7: ( 'month' | 'months' )
-+        
-+        ANTLR3_UINT32 alt3;
-+
-+        alt3=2;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case 'm':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'o':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'n':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 't':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 'h':
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case 's':
-+                                                                                              {
-+                                                                                                      alt3=2;
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          alt3=1;}
-+
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          CONSTRUCTEX();
-+                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                                          EXCEPTION->message      = (void *)"";
-+                                                                          EXCEPTION->decisionNum  = 3;
-+                                                                          EXCEPTION->state        = 4;
-+
-+
-+                                                                          goto ruleMONTHEx;
-+                                                                      }
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          CONSTRUCTEX();
-+                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                          EXCEPTION->message      = (void *)"";
-+                                                          EXCEPTION->decisionNum  = 3;
-+                                                          EXCEPTION->state        = 3;
-+
-+
-+                                                          goto ruleMONTHEx;
-+                                                      }
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 3;
-+                                          EXCEPTION->state        = 2;
-+
-+
-+                                          goto ruleMONTHEx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 3;
-+                          EXCEPTION->state        = 1;
-+
-+
-+                          goto ruleMONTHEx;
-+                      }
-+
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 3;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleMONTHEx;
-+        }
-+
-+        switch (alt3) 
-+        {
-+      case 1:
-+          // RSP.g:112:9: 'month'
-+          {
-+              MATCHS(lit_14); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleMONTHEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // RSP.g:112:19: 'months'
-+          {
-+              MATCHS(lit_15); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleMONTHEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleMONTHEx; /* Prevent compiler warnings */
-+    ruleMONTHEx: ;
-+
-+}
-+// $ANTLR end MONTH
-+
-+//   Comes from: 113:6: ( 'year' | 'years' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start YEAR
-+ *
-+ * Looks to match the characters the constitute the token YEAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mYEAR(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = YEAR;
-+       
-+    
-+    {
-+        //  RSP.g:113:6: ( 'year' | 'years' )
-+        
-+        ANTLR3_UINT32 alt4;
-+
-+        alt4=2;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case 'y':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'e':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'a':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 'r':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 's':
-+                                                                              {
-+                                                                                      alt4=2;
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt4=1;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          CONSTRUCTEX();
-+                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                          EXCEPTION->message      = (void *)"";
-+                                                          EXCEPTION->decisionNum  = 4;
-+                                                          EXCEPTION->state        = 3;
-+
-+
-+                                                          goto ruleYEAREx;
-+                                                      }
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 4;
-+                                          EXCEPTION->state        = 2;
-+
-+
-+                                          goto ruleYEAREx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 4;
-+                          EXCEPTION->state        = 1;
-+
-+
-+                          goto ruleYEAREx;
-+                      }
-+
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 4;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleYEAREx;
-+        }
-+
-+        switch (alt4) 
-+        {
-+      case 1:
-+          // RSP.g:113:8: 'year'
-+          {
-+              MATCHS(lit_16); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleYEAREx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // RSP.g:113:17: 'years'
-+          {
-+              MATCHS(lit_17); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleYEAREx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleYEAREx; /* Prevent compiler warnings */
-+    ruleYEAREx: ;
-+
-+}
-+// $ANTLR end YEAR
-+
-+//   Comes from: 114:7: ( 'today' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start TODAY
-+ *
-+ * Looks to match the characters the constitute the token TODAY
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mTODAY(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = TODAY;
-+       
-+    
-+    // RSP.g:114:7: ( 'today' )
-+    // RSP.g:114:9: 'today'
-+    {
-+        MATCHS(lit_18); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleTODAYEx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleTODAYEx; /* Prevent compiler warnings */
-+    ruleTODAYEx: ;
-+
-+}
-+// $ANTLR end TODAY
-+
-+//   Comes from: 116:9: ( ( '\\r' )? '\\n' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start NEWLINE
-+ *
-+ * Looks to match the characters the constitute the token NEWLINE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mNEWLINE(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = NEWLINE;
-+       
-+    
-+    // RSP.g:116:9: ( ( '\\r' )? '\\n' )
-+    // RSP.g:116:11: ( '\\r' )? '\\n'
-+    {
-+
-+        // RSP.g:116:11: ( '\\r' )?
-+        {
-+            int alt5=2;
-+            switch ( LA(1) ) 
-+            {
-+                case '\r':
-+                      {
-+                              alt5=1;
-+                      }
-+                    break;
-+            }
-+
-+            switch (alt5) 
-+            {
-+              case 1:
-+                  // RSP.g:116:11: '\\r'
-+                  {
-+                      MATCHC('\r'); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleNEWLINEEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+        MATCHC('\n'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleNEWLINEEx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleNEWLINEEx; /* Prevent compiler warnings */
-+    ruleNEWLINEEx: ;
-+
-+}
-+// $ANTLR end NEWLINE
-+
-+//   Comes from: 118:4: ( ( ' ' | '\\t' ) )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start WS
-+ *
-+ * Looks to match the characters the constitute the token WS
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mWS(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = WS;
-+       
-+    
-+    // RSP.g:118:4: ( ( ' ' | '\\t' ) )
-+    // RSP.g:118:6: ( ' ' | '\\t' )
-+    {
-+        if ( LA(1) == '\t' || LA(1) == ' ' )
-+        {
-+            CONSUME();
-+
-+        }
-+        else 
-+        {
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+            EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+            LRECOVER();    goto ruleWSEx;
-+        }
-+
-+        {
-+             LEXSTATE->channel = HIDDEN; 
-+        }
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleWSEx; /* Prevent compiler warnings */
-+    ruleWSEx: ;
-+
-+}
-+// $ANTLR end WS
-+
-+//   Comes from: 120:7: ( 'a' .. 'z' ( 'a' .. 'z' | '_' )* 'a' .. 'z' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start FIELD
-+ *
-+ * Looks to match the characters the constitute the token FIELD
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mFIELD(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = FIELD;
-+       
-+    
-+    // RSP.g:120:7: ( 'a' .. 'z' ( 'a' .. 'z' | '_' )* 'a' .. 'z' )
-+    // RSP.g:120:9: 'a' .. 'z' ( 'a' .. 'z' | '_' )* 'a' .. 'z'
-+    {
-+        MATCHRANGE('a', 'z'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleFIELDEx;
-+        }
-+
-+
-+        // RSP.g:120:18: ( 'a' .. 'z' | '_' )*
-+
-+        for (;;)
-+        {
-+            int alt6=2;
-+            switch ( LA(1) ) 
-+            {
-+            case 'a':
-+            case 'b':
-+            case 'c':
-+            case 'd':
-+            case 'e':
-+            case 'f':
-+            case 'g':
-+            case 'h':
-+            case 'i':
-+            case 'j':
-+            case 'k':
-+            case 'l':
-+            case 'm':
-+            case 'n':
-+            case 'o':
-+            case 'p':
-+            case 'q':
-+            case 'r':
-+            case 's':
-+            case 't':
-+            case 'u':
-+            case 'v':
-+            case 'w':
-+            case 'x':
-+            case 'y':
-+            case 'z':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case '_':
-+                      case 'a':
-+                      case 'b':
-+                      case 'c':
-+                      case 'd':
-+                      case 'e':
-+                      case 'f':
-+                      case 'g':
-+                      case 'h':
-+                      case 'i':
-+                      case 'j':
-+                      case 'k':
-+                      case 'l':
-+                      case 'm':
-+                      case 'n':
-+                      case 'o':
-+                      case 'p':
-+                      case 'q':
-+                      case 'r':
-+                      case 's':
-+                      case 't':
-+                      case 'u':
-+                      case 'v':
-+                      case 'w':
-+                      case 'x':
-+                      case 'y':
-+                      case 'z':
-+                              {
-+                                      alt6=1;
-+                              }
-+                          break;
-+
-+                      }
-+
-+              }
-+                break;
-+            case '_':
-+              {
-+                      alt6=1;
-+              }
-+                break;
-+
-+            }
-+
-+            switch (alt6) 
-+            {
-+              case 1:
-+                  // RSP.g:
-+                  {
-+                      if ( LA(1) == '_' || ((LA(1) >= 'a') && (LA(1) <= 'z')) )
-+                      {
-+                          CONSUME();
-+
-+                      }
-+                      else 
-+                      {
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+                          EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+                          LRECOVER();    goto ruleFIELDEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+
-+              default:
-+                  goto loop6; /* break out of the loop */
-+                  break;
-+            }
-+        }
-+        loop6: ; /* Jump out to here if this rule does not match */
-+
-+        MATCHRANGE('a', 'z'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleFIELDEx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleFIELDEx; /* Prevent compiler warnings */
-+    ruleFIELDEx: ;
-+
-+}
-+// $ANTLR end FIELD
-+
-+//   Comes from: 122:5: ( DIGIT19 ( DIGIT09 )* )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start INT
-+ *
-+ * Looks to match the characters the constitute the token INT
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mINT(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = INT;
-+       
-+    
-+    // RSP.g:122:5: ( DIGIT19 ( DIGIT09 )* )
-+    // RSP.g:122:7: DIGIT19 ( DIGIT09 )*
-+    {
-+        /* 122:7: DIGIT19 ( DIGIT09 )* */
-+        mDIGIT19(ctx ); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleINTEx;
-+        }
-+
-+
-+        // RSP.g:122:15: ( DIGIT09 )*
-+
-+        for (;;)
-+        {
-+            int alt7=2;
-+            switch ( LA(1) ) 
-+            {
-+            case '0':
-+            case '1':
-+            case '2':
-+            case '3':
-+            case '4':
-+            case '5':
-+            case '6':
-+            case '7':
-+            case '8':
-+            case '9':
-+              {
-+                      alt7=1;
-+              }
-+                break;
-+
-+            }
-+
-+            switch (alt7) 
-+            {
-+              case 1:
-+                  // RSP.g:122:15: DIGIT09
-+                  {
-+                      /* 122:15: DIGIT09 */
-+                      mDIGIT09(ctx ); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleINTEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+
-+              default:
-+                  goto loop7; /* break out of the loop */
-+                  break;
-+            }
-+        }
-+        loop7: ; /* Jump out to here if this rule does not match */
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleINTEx; /* Prevent compiler warnings */
-+    ruleINTEx: ;
-+
-+}
-+// $ANTLR end INT
-+
-+//   Comes from: 125:6: ( DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DATE
-+ *
-+ * Looks to match the characters the constitute the token DATE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDATE(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = DATE;
-+       
-+    
-+    // RSP.g:125:6: ( DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) )
-+    // RSP.g:125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' )
-+    {
-+        /* 125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) */
-+        mDIGIT19(ctx ); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleDATEEx;
-+        }
-+
-+        /* 125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) */
-+        mDIGIT09(ctx ); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleDATEEx;
-+        }
-+
-+        /* 125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) */
-+        mDIGIT09(ctx ); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleDATEEx;
-+        }
-+
-+        /* 125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) */
-+        mDIGIT09(ctx ); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleDATEEx;
-+        }
-+
-+        MATCHC('-'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleDATEEx;
-+        }
-+
-+
-+        // RSP.g:125:44: ( '0' DIGIT19 | '1' '0' .. '2' )
-+        {
-+            int alt8=2;
-+            switch ( LA(1) ) 
-+            {
-+            case '0':
-+              {
-+                      alt8=1;
-+              }
-+                break;
-+            case '1':
-+              {
-+                      alt8=2;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 8;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruleDATEEx;
-+            }
-+
-+            switch (alt8) 
-+            {
-+              case 1:
-+                  // RSP.g:125:45: '0' DIGIT19
-+                  {
-+                      MATCHC('0'); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleDATEEx;
-+                      }
-+
-+                      /* 125:45: '0' DIGIT19 */
-+                      mDIGIT19(ctx ); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleDATEEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP.g:125:59: '1' '0' .. '2'
-+                  {
-+                      MATCHC('1'); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleDATEEx;
-+                      }
-+
-+                      MATCHRANGE('0', '2'); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleDATEEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+        MATCHC('-'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleDATEEx;
-+        }
-+
-+
-+        // RSP.g:125:77: ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' )
-+        {
-+            int alt9=3;
-+            switch ( LA(1) ) 
-+            {
-+            case '0':
-+              {
-+                      alt9=1;
-+              }
-+                break;
-+            case '1':
-+            case '2':
-+              {
-+                      alt9=2;
-+              }
-+                break;
-+            case '3':
-+              {
-+                      alt9=3;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 9;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruleDATEEx;
-+            }
-+
-+            switch (alt9) 
-+            {
-+              case 1:
-+                  // RSP.g:125:78: '0' DIGIT19
-+                  {
-+                      MATCHC('0'); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleDATEEx;
-+                      }
-+
-+                      /* 125:78: '0' DIGIT19 */
-+                      mDIGIT19(ctx ); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleDATEEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP.g:125:92: '1' .. '2' DIGIT09
-+                  {
-+                      MATCHRANGE('1', '2'); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleDATEEx;
-+                      }
-+
-+                      /* 125:92: '1' .. '2' DIGIT09 */
-+                      mDIGIT09(ctx ); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleDATEEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // RSP.g:125:111: '3' '0' .. '1'
-+                  {
-+                      MATCHC('3'); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleDATEEx;
-+                      }
-+
-+                      MATCHRANGE('0', '1'); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleDATEEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleDATEEx; /* Prevent compiler warnings */
-+    ruleDATEEx: ;
-+
-+}
-+// $ANTLR end DATE
-+
-+//   Comes from: 133:2: ( QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start STR
-+ *
-+ * Looks to match the characters the constitute the token STR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mSTR(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+    pANTLR3_COMMON_TOKEN esc;
-+    ANTLR3_UINT32 reg;
-+
-+
-+    esc = NULL;
-+
-+    _type         = STR;
-+       
-+     pANTLR3_STRING unesc = GETTEXT()->factory->newRaw(GETTEXT()->factory); 
-+    
-+    // RSP.g:133:2: ( QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE )
-+    // RSP.g:133:4: QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE
-+    {
-+        /* 133:4: QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE */
-+        mQUOTE(ctx ); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleSTREx;
-+        }
-+
-+        // RSP.g:133:10: (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+
-+        {
-+            int cnt10=0;
-+
-+            for (;;)
-+            {
-+                int alt10=3;
-+              {
-+                 /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
-+                  */
-+                  int LA10_0 = LA(1);
-+                  if ( (((LA10_0 >= 0x0000) && (LA10_0 <= '!')) || ((LA10_0 >= '#') && (LA10_0 <= '[')) || ((LA10_0 >= ']') && (LA10_0 <= 0xFFFF))) ) 
-+                  {
-+                      alt10=1;
-+                  }
-+                  else if ( (LA10_0 == '\\') ) 
-+                  {
-+                      alt10=2;
-+                  }
-+
-+              }
-+              switch (alt10) 
-+              {
-+                  case 1:
-+                      // RSP.g:133:12: reg=~ ( '\\\\' | '\"' )
-+                      {
-+                          reg= LA(1);
-+                          if ( ((LA(1) >= 0x0000) && (LA(1) <= '!')) || ((LA(1) >= '#') && (LA(1) <= '[')) || ((LA(1) >= ']') && (LA(1) <= 0xFFFF)) )
-+                          {
-+                              CONSUME();
-+
-+                          }
-+                          else 
-+                          {
-+                              CONSTRUCTEX();
-+                              EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+                              EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+                              LRECOVER();    goto ruleSTREx;
-+                          }
-+
-+                          {
-+                               unesc->addc(unesc, reg); 
-+                          }
-+
-+                      }
-+                      break;
-+                  case 2:
-+                      // RSP.g:134:6: esc= ESCAPED
-+                      {
-+                          /* 134:6: esc= ESCAPED */
-+                          {
-+                              ANTLR3_MARKER escStart381 = GETCHARINDEX();
-+                          mESCAPED(ctx ); 
-+                              if  (HASEXCEPTION())
-+                              {
-+                                  goto ruleSTREx;
-+                              }
-+
-+                              esc = LEXSTATE->tokFactory->newToken(LEXSTATE->tokFactory);
-+                              esc->setType(esc, ANTLR3_TOKEN_INVALID);
-+                              esc->setStartIndex(esc, escStart381);
-+                              esc->setStopIndex(esc, GETCHARINDEX()-1);
-+                              esc->input = INPUT;
-+                          }
-+                          {
-+                               unesc->appendS(unesc, GETTEXT()); 
-+                          }
-+
-+                      }
-+                      break;
-+
-+                  default:
-+                  
-+                      if ( cnt10 >= 1 )
-+                      {
-+                          goto loop10;
-+                      }
-+                      /* mismatchedSetEx()
-+                       */
-+                      CONSTRUCTEX();
-+                      EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
-+                      EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
-+
-+
-+                      goto ruleSTREx;
-+              }
-+              cnt10++;
-+            }
-+            loop10: ; /* Jump to here if this rule does not match */
-+        }
-+        /* 133:4: QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE */
-+        mQUOTE(ctx ); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleSTREx;
-+        }
-+
-+        {
-+             SETTEXT(unesc); 
-+        }
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleSTREx; /* Prevent compiler warnings */
-+    ruleSTREx: ;
-+
-+    esc = NULL;
-+
-+}
-+// $ANTLR end STR
-+
-+//   Comes from: 138:9: ( '\\\\' ( '\\\\' | '\"' ) )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start ESCAPED
-+ *
-+ * Looks to match the characters the constitute the token ESCAPED
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mESCAPED(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+        
-+    // RSP.g:138:9: ( '\\\\' ( '\\\\' | '\"' ) )
-+    // RSP.g:138:11: '\\\\' ( '\\\\' | '\"' )
-+    {
-+        MATCHC('\\'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleESCAPEDEx;
-+        }
-+
-+
-+        // RSP.g:139:3: ( '\\\\' | '\"' )
-+        {
-+            int alt11=2;
-+            switch ( LA(1) ) 
-+            {
-+            case '\\':
-+              {
-+                      alt11=1;
-+              }
-+                break;
-+            case '"':
-+              {
-+                      alt11=2;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 11;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruleESCAPEDEx;
-+            }
-+
-+            switch (alt11) 
-+            {
-+              case 1:
-+                  // RSP.g:139:5: '\\\\'
-+                  {
-+                      MATCHC('\\'); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleESCAPEDEx;
-+                      }
-+
-+                      {
-+                           SETTEXT(GETTEXT()->factory->newStr8(GETTEXT()->factory, (pANTLR3_UINT8)"\\")); 
-+                      }
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP.g:140:5: '\"'
-+                  {
-+                      MATCHC('"'); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleESCAPEDEx;
-+                      }
-+
-+                      {
-+                           SETTEXT(GETTEXT()->factory->newStr8(GETTEXT()->factory, (pANTLR3_UINT8)"\"")); 
-+                      }
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+
-+    }
-+
-+
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleESCAPEDEx; /* Prevent compiler warnings */
-+    ruleESCAPEDEx: ;
-+
-+}
-+// $ANTLR end ESCAPED
-+
-+//   Comes from: 145:9: ( '0' .. '9' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DIGIT09
-+ *
-+ * Looks to match the characters the constitute the token DIGIT09
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDIGIT09(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+        
-+    // RSP.g:145:9: ( '0' .. '9' )
-+    // RSP.g:145:11: '0' .. '9'
-+    {
-+        MATCHRANGE('0', '9'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleDIGIT09Ex;
-+        }
-+
-+
-+    }
-+
-+
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleDIGIT09Ex; /* Prevent compiler warnings */
-+    ruleDIGIT09Ex: ;
-+
-+}
-+// $ANTLR end DIGIT09
-+
-+//   Comes from: 148:9: ( '1' .. '9' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DIGIT19
-+ *
-+ * Looks to match the characters the constitute the token DIGIT19
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDIGIT19(pRSPLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+        
-+    // RSP.g:148:9: ( '1' .. '9' )
-+    // RSP.g:148:11: '1' .. '9'
-+    {
-+        MATCHRANGE('1', '9'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleDIGIT19Ex;
-+        }
-+
-+
-+    }
-+
-+
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleDIGIT19Ex; /* Prevent compiler warnings */
-+    ruleDIGIT19Ex: ;
-+
-+}
-+// $ANTLR end DIGIT19
-+
-+/** This is the entry point in to the lexer from an object that
-+ *  wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
-+ */
-+static void 
-+mTokens(pRSPLexer ctx)
-+{
-+    {
-+        //  RSP.g:1:8: ( QUOTE | LPAR | RPAR | AND | OR | NOT | EQUAL | INCLUDES | STARTSW | ENDSW | GREATER | LESS | GTE | LTE | BEFORE | AFTER | DAY | WEEK | MONTH | YEAR | TODAY | NEWLINE | WS | FIELD | INT | DATE | STR )
-+        
-+        ANTLR3_UINT32 alt12;
-+
-+        alt12=27;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case '"':
-+              {
-+
-+                      {
-+                          int LA12_1 = LA(2);
-+                          if ( (((LA12_1 >= 0x0000) && (LA12_1 <= '!')) || ((LA12_1 >= '#') && (LA12_1 <= 0xFFFF))) ) 
-+                          {
-+                              alt12=27;
-+                          }
-+                          else 
-+                          {
-+                              alt12=1;    }
-+                      }
-+              }
-+            break;
-+        case '(':
-+              {
-+                      alt12=2;
-+              }
-+            break;
-+        case ')':
-+              {
-+                      alt12=3;
-+              }
-+            break;
-+        case 'a':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'n':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'd':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case '_':
-+                                                      case 'a':
-+                                                      case 'b':
-+                                                      case 'c':
-+                                                      case 'd':
-+                                                      case 'e':
-+                                                      case 'f':
-+                                                      case 'g':
-+                                                      case 'h':
-+                                                      case 'i':
-+                                                      case 'j':
-+                                                      case 'k':
-+                                                      case 'l':
-+                                                      case 'm':
-+                                                      case 'n':
-+                                                      case 'o':
-+                                                      case 'p':
-+                                                      case 'q':
-+                                                      case 'r':
-+                                                      case 's':
-+                                                      case 't':
-+                                                      case 'u':
-+                                                      case 'v':
-+                                                      case 'w':
-+                                                      case 'x':
-+                                                      case 'y':
-+                                                      case 'z':
-+                                                              {
-+                                                                      alt12=24;
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt12=4;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt12=24;}
-+
-+                              }
-+                          break;
-+                      case 'f':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 't':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 'e':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 'r':
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case '_':
-+                                                                                      case 'a':
-+                                                                                      case 'b':
-+                                                                                      case 'c':
-+                                                                                      case 'd':
-+                                                                                      case 'e':
-+                                                                                      case 'f':
-+                                                                                      case 'g':
-+                                                                                      case 'h':
-+                                                                                      case 'i':
-+                                                                                      case 'j':
-+                                                                                      case 'k':
-+                                                                                      case 'l':
-+                                                                                      case 'm':
-+                                                                                      case 'n':
-+                                                                                      case 'o':
-+                                                                                      case 'p':
-+                                                                                      case 'q':
-+                                                                                      case 'r':
-+                                                                                      case 's':
-+                                                                                      case 't':
-+                                                                                      case 'u':
-+                                                                                      case 'v':
-+                                                                                      case 'w':
-+                                                                                      case 'x':
-+                                                                                      case 'y':
-+                                                                                      case 'z':
-+                                                                                              {
-+                                                                                                      alt12=24;
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          alt12=16;}
-+
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt12=24;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt12=24;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt12=24;}
-+
-+                              }
-+                          break;
-+                      case '_':
-+                      case 'a':
-+                      case 'b':
-+                      case 'c':
-+                      case 'd':
-+                      case 'e':
-+                      case 'g':
-+                      case 'h':
-+                      case 'i':
-+                      case 'j':
-+                      case 'k':
-+                      case 'l':
-+                      case 'm':
-+                      case 'o':
-+                      case 'p':
-+                      case 'q':
-+                      case 'r':
-+                      case 's':
-+                      case 't':
-+                      case 'u':
-+                      case 'v':
-+                      case 'w':
-+                      case 'x':
-+                      case 'y':
-+                      case 'z':
-+                              {
-+                                      alt12=24;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 12;
-+                          EXCEPTION->state        = 4;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'o':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'r':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case '_':
-+                                      case 'a':
-+                                      case 'b':
-+                                      case 'c':
-+                                      case 'd':
-+                                      case 'e':
-+                                      case 'f':
-+                                      case 'g':
-+                                      case 'h':
-+                                      case 'i':
-+                                      case 'j':
-+                                      case 'k':
-+                                      case 'l':
-+                                      case 'm':
-+                                      case 'n':
-+                                      case 'o':
-+                                      case 'p':
-+                                      case 'q':
-+                                      case 'r':
-+                                      case 's':
-+                                      case 't':
-+                                      case 'u':
-+                                      case 'v':
-+                                      case 'w':
-+                                      case 'x':
-+                                      case 'y':
-+                                      case 'z':
-+                                              {
-+                                                      alt12=24;
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt12=5;}
-+
-+                              }
-+                          break;
-+                      case '_':
-+                      case 'a':
-+                      case 'b':
-+                      case 'c':
-+                      case 'd':
-+                      case 'e':
-+                      case 'f':
-+                      case 'g':
-+                      case 'h':
-+                      case 'i':
-+                      case 'j':
-+                      case 'k':
-+                      case 'l':
-+                      case 'm':
-+                      case 'n':
-+                      case 'o':
-+                      case 'p':
-+                      case 'q':
-+                      case 's':
-+                      case 't':
-+                      case 'u':
-+                      case 'v':
-+                      case 'w':
-+                      case 'x':
-+                      case 'y':
-+                      case 'z':
-+                              {
-+                                      alt12=24;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 12;
-+                          EXCEPTION->state        = 5;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case '!':
-+              {
-+                      alt12=6;
-+              }
-+            break;
-+        case '=':
-+              {
-+                      alt12=7;
-+              }
-+            break;
-+        case 'i':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'n':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'c':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 'l':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 'u':
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case 'd':
-+                                                                                              {
-+                                                                                                      switch ( LA(7) ) 
-+                                                                                                      {
-+                                                                                                      case 'e':
-+                                                                                                              {
-+                                                                                                                      switch ( LA(8) ) 
-+                                                                                                                      {
-+                                                                                                                      case 's':
-+                                                                                                                              {
-+                                                                                                                                      switch ( LA(9) ) 
-+                                                                                                                                      {
-+                                                                                                                                      case '_':
-+                                                                                                                                      case 'a':
-+                                                                                                                                      case 'b':
-+                                                                                                                                      case 'c':
-+                                                                                                                                      case 'd':
-+                                                                                                                                      case 'e':
-+                                                                                                                                      case 'f':
-+                                                                                                                                      case 'g':
-+                                                                                                                                      case 'h':
-+                                                                                                                                      case 'i':
-+                                                                                                                                      case 'j':
-+                                                                                                                                      case 'k':
-+                                                                                                                                      case 'l':
-+                                                                                                                                      case 'm':
-+                                                                                                                                      case 'n':
-+                                                                                                                                      case 'o':
-+                                                                                                                                      case 'p':
-+                                                                                                                                      case 'q':
-+                                                                                                                                      case 'r':
-+                                                                                                                                      case 's':
-+                                                                                                                                      case 't':
-+                                                                                                                                      case 'u':
-+                                                                                                                                      case 'v':
-+                                                                                                                                      case 'w':
-+                                                                                                                                      case 'x':
-+                                                                                                                                      case 'y':
-+                                                                                                                                      case 'z':
-+                                                                                                                                              {
-+                                                                                                                                                      alt12=24;
-+                                                                                                                                              }
-+                                                                                                                                          break;
-+
-+                                                                                                                                      default:
-+                                                                                                                                          alt12=8;}
-+
-+                                                                                                                              }
-+                                                                                                                          break;
-+
-+                                                                                                                      default:
-+                                                                                                                          alt12=24;}
-+
-+                                                                                                              }
-+                                                                                                          break;
-+
-+                                                                                                      default:
-+                                                                                                          alt12=24;}
-+
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          alt12=24;}
-+
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt12=24;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt12=24;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt12=24;}
-+
-+                              }
-+                          break;
-+                      case '_':
-+                      case 'a':
-+                      case 'b':
-+                      case 'c':
-+                      case 'd':
-+                      case 'e':
-+                      case 'f':
-+                      case 'g':
-+                      case 'h':
-+                      case 'i':
-+                      case 'j':
-+                      case 'k':
-+                      case 'l':
-+                      case 'm':
-+                      case 'o':
-+                      case 'p':
-+                      case 'q':
-+                      case 'r':
-+                      case 's':
-+                      case 't':
-+                      case 'u':
-+                      case 'v':
-+                      case 'w':
-+                      case 'x':
-+                      case 'y':
-+                      case 'z':
-+                              {
-+                                      alt12=24;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 12;
-+                          EXCEPTION->state        = 8;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 's':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 't':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'a':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 'r':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 't':
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case 's':
-+                                                                                              {
-+                                                                                                      switch ( LA(7) ) 
-+                                                                                                      {
-+                                                                                                      case 'w':
-+                                                                                                              {
-+                                                                                                                      switch ( LA(8) ) 
-+                                                                                                                      {
-+                                                                                                                      case 'i':
-+                                                                                                                              {
-+                                                                                                                                      switch ( LA(9) ) 
-+                                                                                                                                      {
-+                                                                                                                                      case 't':
-+                                                                                                                                              {
-+                                                                                                                                                      switch ( LA(10) ) 
-+                                                                                                                                                      {
-+                                                                                                                                                      case 'h':
-+                                                                                                                                                              {
-+                                                                                                                                                                      switch ( LA(11) ) 
-+                                                                                                                                                                      {
-+                                                                                                                                                                      case '_':
-+                                                                                                                                                                      case 'a':
-+                                                                                                                                                                      case 'b':
-+                                                                                                                                                                      case 'c':
-+                                                                                                                                                                      case 'd':
-+                                                                                                                                                                      case 'e':
-+                                                                                                                                                                      case 'f':
-+                                                                                                                                                                      case 'g':
-+                                                                                                                                                                      case 'h':
-+                                                                                                                                                                      case 'i':
-+                                                                                                                                                                      case 'j':
-+                                                                                                                                                                      case 'k':
-+                                                                                                                                                                      case 'l':
-+                                                                                                                                                                      case 'm':
-+                                                                                                                                                                      case 'n':
-+                                                                                                                                                                      case 'o':
-+                                                                                                                                                                      case 'p':
-+                                                                                                                                                                      case 'q':
-+                                                                                                                                                                      case 'r':
-+                                                                                                                                                                      case 's':
-+                                                                                                                                                                      case 't':
-+                                                                                                                                                                      case 'u':
-+                                                                                                                                                                      case 'v':
-+                                                                                                                                                                      case 'w':
-+                                                                                                                                                                      case 'x':
-+                                                                                                                                                                      case 'y':
-+                                                                                                                                                                      case 'z':
-+                                                                                                                                                                              {
-+                                                                                                                                                                                      alt12=24;
-+                                                                                                                                                                              }
-+                                                                                                                                                                          break;
-+
-+                                                                                                                                                                      default:
-+                                                                                                                                                                          alt12=9;}
-+
-+                                                                                                                                                              }
-+                                                                                                                                                          break;
-+
-+                                                                                                                                                      default:
-+                                                                                                                                                          alt12=24;}
-+
-+                                                                                                                                              }
-+                                                                                                                                          break;
-+
-+                                                                                                                                      default:
-+                                                                                                                                          alt12=24;}
-+
-+                                                                                                                              }
-+                                                                                                                          break;
-+
-+                                                                                                                      default:
-+                                                                                                                          alt12=24;}
-+
-+                                                                                                              }
-+                                                                                                          break;
-+
-+                                                                                                      default:
-+                                                                                                          alt12=24;}
-+
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          alt12=24;}
-+
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt12=24;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt12=24;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt12=24;}
-+
-+                              }
-+                          break;
-+                      case '_':
-+                      case 'a':
-+                      case 'b':
-+                      case 'c':
-+                      case 'd':
-+                      case 'e':
-+                      case 'f':
-+                      case 'g':
-+                      case 'h':
-+                      case 'i':
-+                      case 'j':
-+                      case 'k':
-+                      case 'l':
-+                      case 'm':
-+                      case 'n':
-+                      case 'o':
-+                      case 'p':
-+                      case 'q':
-+                      case 'r':
-+                      case 's':
-+                      case 'u':
-+                      case 'v':
-+                      case 'w':
-+                      case 'x':
-+                      case 'y':
-+                      case 'z':
-+                              {
-+                                      alt12=24;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 12;
-+                          EXCEPTION->state        = 9;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'e':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'n':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'd':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 's':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 'w':
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case 'i':
-+                                                                                              {
-+                                                                                                      switch ( LA(7) ) 
-+                                                                                                      {
-+                                                                                                      case 't':
-+                                                                                                              {
-+                                                                                                                      switch ( LA(8) ) 
-+                                                                                                                      {
-+                                                                                                                      case 'h':
-+                                                                                                                              {
-+                                                                                                                                      switch ( LA(9) ) 
-+                                                                                                                                      {
-+                                                                                                                                      case '_':
-+                                                                                                                                      case 'a':
-+                                                                                                                                      case 'b':
-+                                                                                                                                      case 'c':
-+                                                                                                                                      case 'd':
-+                                                                                                                                      case 'e':
-+                                                                                                                                      case 'f':
-+                                                                                                                                      case 'g':
-+                                                                                                                                      case 'h':
-+                                                                                                                                      case 'i':
-+                                                                                                                                      case 'j':
-+                                                                                                                                      case 'k':
-+                                                                                                                                      case 'l':
-+                                                                                                                                      case 'm':
-+                                                                                                                                      case 'n':
-+                                                                                                                                      case 'o':
-+                                                                                                                                      case 'p':
-+                                                                                                                                      case 'q':
-+                                                                                                                                      case 'r':
-+                                                                                                                                      case 's':
-+                                                                                                                                      case 't':
-+                                                                                                                                      case 'u':
-+                                                                                                                                      case 'v':
-+                                                                                                                                      case 'w':
-+                                                                                                                                      case 'x':
-+                                                                                                                                      case 'y':
-+                                                                                                                                      case 'z':
-+                                                                                                                                              {
-+                                                                                                                                                      alt12=24;
-+                                                                                                                                              }
-+                                                                                                                                          break;
-+
-+                                                                                                                                      default:
-+                                                                                                                                          alt12=10;}
-+
-+                                                                                                                              }
-+                                                                                                                          break;
-+
-+                                                                                                                      default:
-+                                                                                                                          alt12=24;}
-+
-+                                                                                                              }
-+                                                                                                          break;
-+
-+                                                                                                      default:
-+                                                                                                          alt12=24;}
-+
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          alt12=24;}
-+
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt12=24;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt12=24;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt12=24;}
-+
-+                              }
-+                          break;
-+                      case '_':
-+                      case 'a':
-+                      case 'b':
-+                      case 'c':
-+                      case 'd':
-+                      case 'e':
-+                      case 'f':
-+                      case 'g':
-+                      case 'h':
-+                      case 'i':
-+                      case 'j':
-+                      case 'k':
-+                      case 'l':
-+                      case 'm':
-+                      case 'o':
-+                      case 'p':
-+                      case 'q':
-+                      case 'r':
-+                      case 's':
-+                      case 't':
-+                      case 'u':
-+                      case 'v':
-+                      case 'w':
-+                      case 'x':
-+                      case 'y':
-+                      case 'z':
-+                              {
-+                                      alt12=24;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 12;
-+                          EXCEPTION->state        = 10;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case '>':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case '=':
-+                              {
-+                                      alt12=13;
-+                              }
-+                          break;
-+
-+                      default:
-+                          alt12=11;}
-+
-+              }
-+            break;
-+        case '<':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case '=':
-+                              {
-+                                      alt12=14;
-+                              }
-+                          break;
-+
-+                      default:
-+                          alt12=12;}
-+
-+              }
-+            break;
-+        case 'b':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'e':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'f':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 'o':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 'r':
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case 'e':
-+                                                                                              {
-+                                                                                                      switch ( LA(7) ) 
-+                                                                                                      {
-+                                                                                                      case '_':
-+                                                                                                      case 'a':
-+                                                                                                      case 'b':
-+                                                                                                      case 'c':
-+                                                                                                      case 'd':
-+                                                                                                      case 'e':
-+                                                                                                      case 'f':
-+                                                                                                      case 'g':
-+                                                                                                      case 'h':
-+                                                                                                      case 'i':
-+                                                                                                      case 'j':
-+                                                                                                      case 'k':
-+                                                                                                      case 'l':
-+                                                                                                      case 'm':
-+                                                                                                      case 'n':
-+                                                                                                      case 'o':
-+                                                                                                      case 'p':
-+                                                                                                      case 'q':
-+                                                                                                      case 'r':
-+                                                                                                      case 's':
-+                                                                                                      case 't':
-+                                                                                                      case 'u':
-+                                                                                                      case 'v':
-+                                                                                                      case 'w':
-+                                                                                                      case 'x':
-+                                                                                                      case 'y':
-+                                                                                                      case 'z':
-+                                                                                                              {
-+                                                                                                                      alt12=24;
-+                                                                                                              }
-+                                                                                                          break;
-+
-+                                                                                                      default:
-+                                                                                                          alt12=15;}
-+
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          alt12=24;}
-+
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt12=24;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt12=24;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt12=24;}
-+
-+                              }
-+                          break;
-+                      case '_':
-+                      case 'a':
-+                      case 'b':
-+                      case 'c':
-+                      case 'd':
-+                      case 'f':
-+                      case 'g':
-+                      case 'h':
-+                      case 'i':
-+                      case 'j':
-+                      case 'k':
-+                      case 'l':
-+                      case 'm':
-+                      case 'n':
-+                      case 'o':
-+                      case 'p':
-+                      case 'q':
-+                      case 'r':
-+                      case 's':
-+                      case 't':
-+                      case 'u':
-+                      case 'v':
-+                      case 'w':
-+                      case 'x':
-+                      case 'y':
-+                      case 'z':
-+                              {
-+                                      alt12=24;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 12;
-+                          EXCEPTION->state        = 13;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'd':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'a':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'y':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 's':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case '_':
-+                                                                      case 'a':
-+                                                                      case 'b':
-+                                                                      case 'c':
-+                                                                      case 'd':
-+                                                                      case 'e':
-+                                                                      case 'f':
-+                                                                      case 'g':
-+                                                                      case 'h':
-+                                                                      case 'i':
-+                                                                      case 'j':
-+                                                                      case 'k':
-+                                                                      case 'l':
-+                                                                      case 'm':
-+                                                                      case 'n':
-+                                                                      case 'o':
-+                                                                      case 'p':
-+                                                                      case 'q':
-+                                                                      case 'r':
-+                                                                      case 's':
-+                                                                      case 't':
-+                                                                      case 'u':
-+                                                                      case 'v':
-+                                                                      case 'w':
-+                                                                      case 'x':
-+                                                                      case 'y':
-+                                                                      case 'z':
-+                                                                              {
-+                                                                                      alt12=24;
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt12=17;}
-+
-+                                                              }
-+                                                          break;
-+                                                      case '_':
-+                                                      case 'a':
-+                                                      case 'b':
-+                                                      case 'c':
-+                                                      case 'd':
-+                                                      case 'e':
-+                                                      case 'f':
-+                                                      case 'g':
-+                                                      case 'h':
-+                                                      case 'i':
-+                                                      case 'j':
-+                                                      case 'k':
-+                                                      case 'l':
-+                                                      case 'm':
-+                                                      case 'n':
-+                                                      case 'o':
-+                                                      case 'p':
-+                                                      case 'q':
-+                                                      case 'r':
-+                                                      case 't':
-+                                                      case 'u':
-+                                                      case 'v':
-+                                                      case 'w':
-+                                                      case 'x':
-+                                                      case 'y':
-+                                                      case 'z':
-+                                                              {
-+                                                                      alt12=24;
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt12=17;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt12=24;}
-+
-+                              }
-+                          break;
-+                      case '_':
-+                      case 'b':
-+                      case 'c':
-+                      case 'd':
-+                      case 'e':
-+                      case 'f':
-+                      case 'g':
-+                      case 'h':
-+                      case 'i':
-+                      case 'j':
-+                      case 'k':
-+                      case 'l':
-+                      case 'm':
-+                      case 'n':
-+                      case 'o':
-+                      case 'p':
-+                      case 'q':
-+                      case 'r':
-+                      case 's':
-+                      case 't':
-+                      case 'u':
-+                      case 'v':
-+                      case 'w':
-+                      case 'x':
-+                      case 'y':
-+                      case 'z':
-+                              {
-+                                      alt12=24;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 12;
-+                          EXCEPTION->state        = 14;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'w':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'e':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'e':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 'k':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 's':
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case '_':
-+                                                                                      case 'a':
-+                                                                                      case 'b':
-+                                                                                      case 'c':
-+                                                                                      case 'd':
-+                                                                                      case 'e':
-+                                                                                      case 'f':
-+                                                                                      case 'g':
-+                                                                                      case 'h':
-+                                                                                      case 'i':
-+                                                                                      case 'j':
-+                                                                                      case 'k':
-+                                                                                      case 'l':
-+                                                                                      case 'm':
-+                                                                                      case 'n':
-+                                                                                      case 'o':
-+                                                                                      case 'p':
-+                                                                                      case 'q':
-+                                                                                      case 'r':
-+                                                                                      case 's':
-+                                                                                      case 't':
-+                                                                                      case 'u':
-+                                                                                      case 'v':
-+                                                                                      case 'w':
-+                                                                                      case 'x':
-+                                                                                      case 'y':
-+                                                                                      case 'z':
-+                                                                                              {
-+                                                                                                      alt12=24;
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          alt12=18;}
-+
-+                                                                              }
-+                                                                          break;
-+                                                                      case '_':
-+                                                                      case 'a':
-+                                                                      case 'b':
-+                                                                      case 'c':
-+                                                                      case 'd':
-+                                                                      case 'e':
-+                                                                      case 'f':
-+                                                                      case 'g':
-+                                                                      case 'h':
-+                                                                      case 'i':
-+                                                                      case 'j':
-+                                                                      case 'k':
-+                                                                      case 'l':
-+                                                                      case 'm':
-+                                                                      case 'n':
-+                                                                      case 'o':
-+                                                                      case 'p':
-+                                                                      case 'q':
-+                                                                      case 'r':
-+                                                                      case 't':
-+                                                                      case 'u':
-+                                                                      case 'v':
-+                                                                      case 'w':
-+                                                                      case 'x':
-+                                                                      case 'y':
-+                                                                      case 'z':
-+                                                                              {
-+                                                                                      alt12=24;
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt12=18;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt12=24;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt12=24;}
-+
-+                              }
-+                          break;
-+                      case '_':
-+                      case 'a':
-+                      case 'b':
-+                      case 'c':
-+                      case 'd':
-+                      case 'f':
-+                      case 'g':
-+                      case 'h':
-+                      case 'i':
-+                      case 'j':
-+                      case 'k':
-+                      case 'l':
-+                      case 'm':
-+                      case 'n':
-+                      case 'o':
-+                      case 'p':
-+                      case 'q':
-+                      case 'r':
-+                      case 's':
-+                      case 't':
-+                      case 'u':
-+                      case 'v':
-+                      case 'w':
-+                      case 'x':
-+                      case 'y':
-+                      case 'z':
-+                              {
-+                                      alt12=24;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 12;
-+                          EXCEPTION->state        = 15;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'm':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'o':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'n':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 't':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 'h':
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case 's':
-+                                                                                              {
-+                                                                                                      switch ( LA(7) ) 
-+                                                                                                      {
-+                                                                                                      case '_':
-+                                                                                                      case 'a':
-+                                                                                                      case 'b':
-+                                                                                                      case 'c':
-+                                                                                                      case 'd':
-+                                                                                                      case 'e':
-+                                                                                                      case 'f':
-+                                                                                                      case 'g':
-+                                                                                                      case 'h':
-+                                                                                                      case 'i':
-+                                                                                                      case 'j':
-+                                                                                                      case 'k':
-+                                                                                                      case 'l':
-+                                                                                                      case 'm':
-+                                                                                                      case 'n':
-+                                                                                                      case 'o':
-+                                                                                                      case 'p':
-+                                                                                                      case 'q':
-+                                                                                                      case 'r':
-+                                                                                                      case 's':
-+                                                                                                      case 't':
-+                                                                                                      case 'u':
-+                                                                                                      case 'v':
-+                                                                                                      case 'w':
-+                                                                                                      case 'x':
-+                                                                                                      case 'y':
-+                                                                                                      case 'z':
-+                                                                                                              {
-+                                                                                                                      alt12=24;
-+                                                                                                              }
-+                                                                                                          break;
-+
-+                                                                                                      default:
-+                                                                                                          alt12=19;}
-+
-+                                                                                              }
-+                                                                                          break;
-+                                                                                      case '_':
-+                                                                                      case 'a':
-+                                                                                      case 'b':
-+                                                                                      case 'c':
-+                                                                                      case 'd':
-+                                                                                      case 'e':
-+                                                                                      case 'f':
-+                                                                                      case 'g':
-+                                                                                      case 'h':
-+                                                                                      case 'i':
-+                                                                                      case 'j':
-+                                                                                      case 'k':
-+                                                                                      case 'l':
-+                                                                                      case 'm':
-+                                                                                      case 'n':
-+                                                                                      case 'o':
-+                                                                                      case 'p':
-+                                                                                      case 'q':
-+                                                                                      case 'r':
-+                                                                                      case 't':
-+                                                                                      case 'u':
-+                                                                                      case 'v':
-+                                                                                      case 'w':
-+                                                                                      case 'x':
-+                                                                                      case 'y':
-+                                                                                      case 'z':
-+                                                                                              {
-+                                                                                                      alt12=24;
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          alt12=19;}
-+
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt12=24;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt12=24;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt12=24;}
-+
-+                              }
-+                          break;
-+                      case '_':
-+                      case 'a':
-+                      case 'b':
-+                      case 'c':
-+                      case 'd':
-+                      case 'e':
-+                      case 'f':
-+                      case 'g':
-+                      case 'h':
-+                      case 'i':
-+                      case 'j':
-+                      case 'k':
-+                      case 'l':
-+                      case 'm':
-+                      case 'n':
-+                      case 'p':
-+                      case 'q':
-+                      case 'r':
-+                      case 's':
-+                      case 't':
-+                      case 'u':
-+                      case 'v':
-+                      case 'w':
-+                      case 'x':
-+                      case 'y':
-+                      case 'z':
-+                              {
-+                                      alt12=24;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 12;
-+                          EXCEPTION->state        = 16;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'y':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'e':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'a':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 'r':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 's':
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case '_':
-+                                                                                      case 'a':
-+                                                                                      case 'b':
-+                                                                                      case 'c':
-+                                                                                      case 'd':
-+                                                                                      case 'e':
-+                                                                                      case 'f':
-+                                                                                      case 'g':
-+                                                                                      case 'h':
-+                                                                                      case 'i':
-+                                                                                      case 'j':
-+                                                                                      case 'k':
-+                                                                                      case 'l':
-+                                                                                      case 'm':
-+                                                                                      case 'n':
-+                                                                                      case 'o':
-+                                                                                      case 'p':
-+                                                                                      case 'q':
-+                                                                                      case 'r':
-+                                                                                      case 's':
-+                                                                                      case 't':
-+                                                                                      case 'u':
-+                                                                                      case 'v':
-+                                                                                      case 'w':
-+                                                                                      case 'x':
-+                                                                                      case 'y':
-+                                                                                      case 'z':
-+                                                                                              {
-+                                                                                                      alt12=24;
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          alt12=20;}
-+
-+                                                                              }
-+                                                                          break;
-+                                                                      case '_':
-+                                                                      case 'a':
-+                                                                      case 'b':
-+                                                                      case 'c':
-+                                                                      case 'd':
-+                                                                      case 'e':
-+                                                                      case 'f':
-+                                                                      case 'g':
-+                                                                      case 'h':
-+                                                                      case 'i':
-+                                                                      case 'j':
-+                                                                      case 'k':
-+                                                                      case 'l':
-+                                                                      case 'm':
-+                                                                      case 'n':
-+                                                                      case 'o':
-+                                                                      case 'p':
-+                                                                      case 'q':
-+                                                                      case 'r':
-+                                                                      case 't':
-+                                                                      case 'u':
-+                                                                      case 'v':
-+                                                                      case 'w':
-+                                                                      case 'x':
-+                                                                      case 'y':
-+                                                                      case 'z':
-+                                                                              {
-+                                                                                      alt12=24;
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt12=20;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt12=24;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt12=24;}
-+
-+                              }
-+                          break;
-+                      case '_':
-+                      case 'a':
-+                      case 'b':
-+                      case 'c':
-+                      case 'd':
-+                      case 'f':
-+                      case 'g':
-+                      case 'h':
-+                      case 'i':
-+                      case 'j':
-+                      case 'k':
-+                      case 'l':
-+                      case 'm':
-+                      case 'n':
-+                      case 'o':
-+                      case 'p':
-+                      case 'q':
-+                      case 'r':
-+                      case 's':
-+                      case 't':
-+                      case 'u':
-+                      case 'v':
-+                      case 'w':
-+                      case 'x':
-+                      case 'y':
-+                      case 'z':
-+                              {
-+                                      alt12=24;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 12;
-+                          EXCEPTION->state        = 17;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 't':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'o':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'd':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 'a':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 'y':
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case '_':
-+                                                                                      case 'a':
-+                                                                                      case 'b':
-+                                                                                      case 'c':
-+                                                                                      case 'd':
-+                                                                                      case 'e':
-+                                                                                      case 'f':
-+                                                                                      case 'g':
-+                                                                                      case 'h':
-+                                                                                      case 'i':
-+                                                                                      case 'j':
-+                                                                                      case 'k':
-+                                                                                      case 'l':
-+                                                                                      case 'm':
-+                                                                                      case 'n':
-+                                                                                      case 'o':
-+                                                                                      case 'p':
-+                                                                                      case 'q':
-+                                                                                      case 'r':
-+                                                                                      case 's':
-+                                                                                      case 't':
-+                                                                                      case 'u':
-+                                                                                      case 'v':
-+                                                                                      case 'w':
-+                                                                                      case 'x':
-+                                                                                      case 'y':
-+                                                                                      case 'z':
-+                                                                                              {
-+                                                                                                      alt12=24;
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          alt12=21;}
-+
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt12=24;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt12=24;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt12=24;}
-+
-+                              }
-+                          break;
-+                      case '_':
-+                      case 'a':
-+                      case 'b':
-+                      case 'c':
-+                      case 'd':
-+                      case 'e':
-+                      case 'f':
-+                      case 'g':
-+                      case 'h':
-+                      case 'i':
-+                      case 'j':
-+                      case 'k':
-+                      case 'l':
-+                      case 'm':
-+                      case 'n':
-+                      case 'p':
-+                      case 'q':
-+                      case 'r':
-+                      case 's':
-+                      case 't':
-+                      case 'u':
-+                      case 'v':
-+                      case 'w':
-+                      case 'x':
-+                      case 'y':
-+                      case 'z':
-+                              {
-+                                      alt12=24;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 12;
-+                          EXCEPTION->state        = 18;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case '\n':
-+        case '\r':
-+              {
-+                      alt12=22;
-+              }
-+            break;
-+        case '\t':
-+        case ' ':
-+              {
-+                      alt12=23;
-+              }
-+            break;
-+        case 'c':
-+        case 'f':
-+        case 'g':
-+        case 'h':
-+        case 'j':
-+        case 'k':
-+        case 'l':
-+        case 'n':
-+        case 'p':
-+        case 'q':
-+        case 'r':
-+        case 'u':
-+        case 'v':
-+        case 'x':
-+        case 'z':
-+              {
-+                      alt12=24;
-+              }
-+            break;
-+        case '1':
-+        case '2':
-+        case '3':
-+        case '4':
-+        case '5':
-+        case '6':
-+        case '7':
-+        case '8':
-+        case '9':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case '0':
-+                      case '1':
-+                      case '2':
-+                      case '3':
-+                      case '4':
-+                      case '5':
-+                      case '6':
-+                      case '7':
-+                      case '8':
-+                      case '9':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case '0':
-+                                      case '1':
-+                                      case '2':
-+                                      case '3':
-+                                      case '4':
-+                                      case '5':
-+                                      case '6':
-+                                      case '7':
-+                                      case '8':
-+                                      case '9':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case '0':
-+                                                      case '1':
-+                                                      case '2':
-+                                                      case '3':
-+                                                      case '4':
-+                                                      case '5':
-+                                                      case '6':
-+                                                      case '7':
-+                                                      case '8':
-+                                                      case '9':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case '-':
-+                                                                              {
-+                                                                                      alt12=26;
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt12=25;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt12=25;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt12=25;}
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          alt12=25;}
-+
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 12;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleTokensEx;
-+        }
-+
-+        switch (alt12) 
-+        {
-+      case 1:
-+          // RSP.g:1:10: QUOTE
-+          {
-+              /* 1:10: QUOTE */
-+              mQUOTE(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // RSP.g:1:16: LPAR
-+          {
-+              /* 1:16: LPAR */
-+              mLPAR(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 3:
-+          // RSP.g:1:21: RPAR
-+          {
-+              /* 1:21: RPAR */
-+              mRPAR(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 4:
-+          // RSP.g:1:26: AND
-+          {
-+              /* 1:26: AND */
-+              mAND(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 5:
-+          // RSP.g:1:30: OR
-+          {
-+              /* 1:30: OR */
-+              mOR(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 6:
-+          // RSP.g:1:33: NOT
-+          {
-+              /* 1:33: NOT */
-+              mNOT(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 7:
-+          // RSP.g:1:37: EQUAL
-+          {
-+              /* 1:37: EQUAL */
-+              mEQUAL(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 8:
-+          // RSP.g:1:43: INCLUDES
-+          {
-+              /* 1:43: INCLUDES */
-+              mINCLUDES(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 9:
-+          // RSP.g:1:52: STARTSW
-+          {
-+              /* 1:52: STARTSW */
-+              mSTARTSW(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 10:
-+          // RSP.g:1:60: ENDSW
-+          {
-+              /* 1:60: ENDSW */
-+              mENDSW(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 11:
-+          // RSP.g:1:66: GREATER
-+          {
-+              /* 1:66: GREATER */
-+              mGREATER(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 12:
-+          // RSP.g:1:74: LESS
-+          {
-+              /* 1:74: LESS */
-+              mLESS(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 13:
-+          // RSP.g:1:79: GTE
-+          {
-+              /* 1:79: GTE */
-+              mGTE(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 14:
-+          // RSP.g:1:83: LTE
-+          {
-+              /* 1:83: LTE */
-+              mLTE(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 15:
-+          // RSP.g:1:87: BEFORE
-+          {
-+              /* 1:87: BEFORE */
-+              mBEFORE(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 16:
-+          // RSP.g:1:94: AFTER
-+          {
-+              /* 1:94: AFTER */
-+              mAFTER(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 17:
-+          // RSP.g:1:100: DAY
-+          {
-+              /* 1:100: DAY */
-+              mDAY(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 18:
-+          // RSP.g:1:104: WEEK
-+          {
-+              /* 1:104: WEEK */
-+              mWEEK(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 19:
-+          // RSP.g:1:109: MONTH
-+          {
-+              /* 1:109: MONTH */
-+              mMONTH(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 20:
-+          // RSP.g:1:115: YEAR
-+          {
-+              /* 1:115: YEAR */
-+              mYEAR(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 21:
-+          // RSP.g:1:120: TODAY
-+          {
-+              /* 1:120: TODAY */
-+              mTODAY(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 22:
-+          // RSP.g:1:126: NEWLINE
-+          {
-+              /* 1:126: NEWLINE */
-+              mNEWLINE(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 23:
-+          // RSP.g:1:134: WS
-+          {
-+              /* 1:134: WS */
-+              mWS(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 24:
-+          // RSP.g:1:137: FIELD
-+          {
-+              /* 1:137: FIELD */
-+              mFIELD(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 25:
-+          // RSP.g:1:143: INT
-+          {
-+              /* 1:143: INT */
-+              mINT(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 26:
-+          // RSP.g:1:147: DATE
-+          {
-+              /* 1:147: DATE */
-+              mDATE(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 27:
-+          // RSP.g:1:152: STR
-+          {
-+              /* 1:152: STR */
-+              mSTR(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+
-+    
-+    goto ruleTokensEx; /* Prevent compiler warnings */
-+ruleTokensEx: ;
-+}
-+
-+/* =========================================================================
-+ * Lexer matching rules end.
-+ * =========================================================================
-+ */
-+/* End of Lexer code
-+ * ================================================
-+ * ================================================
-+ */ 
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/RSPLexer.h b/src/pregen/RSPLexer.h
-new file mode 100644
-index 0000000..27bc791
---- /dev/null
-+++ b/src/pregen/RSPLexer.h
-@@ -0,0 +1,254 @@
-+/** \file
-+ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : RSP.g
-+ *     -                            On : 2016-01-01 12:23:42
-+ *     -                 for the lexer : RSPLexerLexer *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The lexer RSPLexer has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ * 
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pRSPLexer, which is returned from a call to RSPLexerNew().
-+ *
-+ * As this is a generated lexer, it is unlikely you will call it 'manually'. However
-+ * the methods are provided anyway.
-+ * * The methods in pRSPLexer are  as follows:
-+ *
-+ *  -  void      pRSPLexer->QUOTE(pRSPLexer)
-+ *  -  void      pRSPLexer->LPAR(pRSPLexer)
-+ *  -  void      pRSPLexer->RPAR(pRSPLexer)
-+ *  -  void      pRSPLexer->AND(pRSPLexer)
-+ *  -  void      pRSPLexer->OR(pRSPLexer)
-+ *  -  void      pRSPLexer->NOT(pRSPLexer)
-+ *  -  void      pRSPLexer->EQUAL(pRSPLexer)
-+ *  -  void      pRSPLexer->INCLUDES(pRSPLexer)
-+ *  -  void      pRSPLexer->STARTSW(pRSPLexer)
-+ *  -  void      pRSPLexer->ENDSW(pRSPLexer)
-+ *  -  void      pRSPLexer->GREATER(pRSPLexer)
-+ *  -  void      pRSPLexer->LESS(pRSPLexer)
-+ *  -  void      pRSPLexer->GTE(pRSPLexer)
-+ *  -  void      pRSPLexer->LTE(pRSPLexer)
-+ *  -  void      pRSPLexer->BEFORE(pRSPLexer)
-+ *  -  void      pRSPLexer->AFTER(pRSPLexer)
-+ *  -  void      pRSPLexer->DAY(pRSPLexer)
-+ *  -  void      pRSPLexer->WEEK(pRSPLexer)
-+ *  -  void      pRSPLexer->MONTH(pRSPLexer)
-+ *  -  void      pRSPLexer->YEAR(pRSPLexer)
-+ *  -  void      pRSPLexer->TODAY(pRSPLexer)
-+ *  -  void      pRSPLexer->NEWLINE(pRSPLexer)
-+ *  -  void      pRSPLexer->WS(pRSPLexer)
-+ *  -  void      pRSPLexer->FIELD(pRSPLexer)
-+ *  -  void      pRSPLexer->INT(pRSPLexer)
-+ *  -  void      pRSPLexer->DATE(pRSPLexer)
-+ *  -  void      pRSPLexer->STR(pRSPLexer)
-+ *  -  void      pRSPLexer->ESCAPED(pRSPLexer)
-+ *  -  void      pRSPLexer->DIGIT09(pRSPLexer)
-+ *  -  void      pRSPLexer->DIGIT19(pRSPLexer)
-+ *  -  void      pRSPLexer->Tokens(pRSPLexer)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+#ifndef       _RSPLexer_H
-+#define _RSPLexer_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include    <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+ 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct RSPLexer_Ctx_struct RSPLexer, * pRSPLexer;
-+
-+
-+
-+#ifdef        ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
-+//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
-+//          initialized but unused variable                                   - tree rewrite variables declared but not needed
-+//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
-+//          potentially unitialized variable used                     - retval always returned from a rule 
-+//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+
-+/** Context tracking structure for RSPLexer
-+ */
-+struct RSPLexer_Ctx_struct
-+{
-+    /** Built in ANTLR3 context tracker contains all the generic elements
-+     *  required for context tracking.
-+     */
-+    pANTLR3_LEXER    pLexer;
-+
-+
-+     void (*mQUOTE)   (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mLPAR)    (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mRPAR)    (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mAND)     (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mOR)      (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mNOT)     (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mEQUAL)   (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mINCLUDES)        (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mSTARTSW) (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mENDSW)   (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mGREATER) (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mLESS)    (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mGTE)     (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mLTE)     (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mBEFORE)  (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mAFTER)   (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mDAY)     (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mWEEK)    (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mMONTH)   (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mYEAR)    (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mTODAY)   (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mNEWLINE) (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mWS)      (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mFIELD)   (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mINT)     (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mDATE)    (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mSTR)     (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mESCAPED) (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mDIGIT09) (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mDIGIT19) (struct RSPLexer_Ctx_struct * ctx);
-+     void (*mTokens)  (struct RSPLexer_Ctx_struct * ctx);    const char * (*getGrammarFileName)();
-+    void          (*free)   (struct RSPLexer_Ctx_struct * ctx);
-+        
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pRSPLexer RSPLexerNew         (pANTLR3_INPUT_STREAM instream);
-+ANTLR3_API pRSPLexer RSPLexerNewSSD      (pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the lexer will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef        EOF
-+#undef        EOF
-+#endif
-+#ifdef        Tokens
-+#undef        Tokens
-+#endif 
-+#define STARTSW      14
-+#define WEEK      26
-+#define TODAY      24
-+#define YEAR      28
-+#define ENDSW      15
-+#define GTE      20
-+#define BEFORE      21
-+#define DAY      25
-+#define INT      16
-+#define NOT      11
-+#define AFTER      22
-+#define AND      6
-+#define EOF      -1
-+#define LTE      19
-+#define MONTH      27
-+#define DIGIT19      31
-+#define INCLUDES      13
-+#define STR      10
-+#define QUOTE      29
-+#define GREATER      18
-+#define WS      30
-+#define LPAR      7
-+#define NEWLINE      4
-+#define EQUAL      12
-+#define OR      5
-+#define LESS      17
-+#define FIELD      9
-+#define RPAR      8
-+#define ESCAPED      33
-+#define DATE      23
-+#define DIGIT09      32
-+#ifdef        EOF
-+#undef        EOF
-+#define       EOF     ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for RSPLexer
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/RSPParser.c b/src/pregen/RSPParser.c
-new file mode 100644
-index 0000000..ba8a9d2
---- /dev/null
-+++ b/src/pregen/RSPParser.c
-@@ -0,0 +1,3152 @@
-+/** \file
-+ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : RSP.g
-+ *     -                            On : 2016-01-01 12:23:42
-+ *     -                for the parser : RSPParserParser *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include    "RSPParser.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+ 
-+#define               CTX     ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef        SCOPE_TYPE
-+#undef        SCOPE_STACK
-+#undef        SCOPE_TOP
-+#define       SCOPE_TYPE(scope)   pRSPParser_##scope##_SCOPE
-+#define SCOPE_STACK(scope)  pRSPParser_##scope##Stack
-+#define       SCOPE_TOP(scope)    ctx->pRSPParser_##scope##Top
-+#define       SCOPE_SIZE(scope)               ctx->pRSPParser_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+/* Macros for accessing things in the parser
-+ */
-+ 
-+#undef            PARSER                  
-+#undef            RECOGNIZER              
-+#undef            HAVEPARSEDRULE
-+#undef                MEMOIZE
-+#undef            INPUT
-+#undef            STRSTREAM
-+#undef            HASEXCEPTION
-+#undef            EXCEPTION
-+#undef            MATCHT
-+#undef            MATCHANYT
-+#undef            FOLLOWSTACK
-+#undef            FOLLOWPUSH
-+#undef            FOLLOWPOP
-+#undef            PRECOVER
-+#undef            PREPORTERROR
-+#undef            LA
-+#undef            LT
-+#undef            CONSTRUCTEX
-+#undef            CONSUME
-+#undef            MARK
-+#undef            REWIND
-+#undef            REWINDLAST
-+#undef            PERRORRECOVERY
-+#undef            HASFAILED
-+#undef            FAILEDFLAG
-+#undef            RECOVERFROMMISMATCHEDSET
-+#undef            RECOVERFROMMISMATCHEDELEMENT
-+#undef                INDEX
-+#undef      ADAPTOR
-+#undef                SEEK
-+#undef            RULEMEMO                
-+#undef                DBG
-+
-+#define           PARSER                                                      ctx->pParser  
-+#define           RECOGNIZER                                          PARSER->rec
-+#define               PSRSTATE                                                RECOGNIZER->state
-+#define           HAVEPARSEDRULE(r)                           RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define               MEMOIZE(ri,si)                                  RECOGNIZER->memoize(RECOGNIZER, ri, si)
-+#define           INPUT                                                       PARSER->tstream
-+#define           STRSTREAM                                           INPUT
-+#define               ISTREAM                                                 INPUT->istream
-+#define               INDEX()                                                 ISTREAM->index(INPUT->istream)
-+#define           HASEXCEPTION()                                      (PSRSTATE->error == ANTLR3_TRUE)
-+#define           EXCEPTION                                           PSRSTATE->exception
-+#define           MATCHT(t, fs)                                       RECOGNIZER->match(RECOGNIZER, t, fs)
-+#define           MATCHANYT()                                         RECOGNIZER->matchAny(RECOGNIZER)
-+#define           FOLLOWSTACK                                     PSRSTATE->following
-+#define           FOLLOWPUSH(x)                                       FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
-+#define           FOLLOWPOP()                                         FOLLOWSTACK->pop(FOLLOWSTACK)
-+#define           PRECOVER()                                          RECOGNIZER->recover(RECOGNIZER)
-+#define           PREPORTERROR()                                      RECOGNIZER->reportError(RECOGNIZER)
-+#define           LA(n)                                                       INPUT->istream->_LA(ISTREAM, n)
-+#define           LT(n)                                                       INPUT->_LT(INPUT, n)
-+#define           CONSTRUCTEX()                                       RECOGNIZER->exConstruct(RECOGNIZER)
-+#define           CONSUME()                                           ISTREAM->consume(ISTREAM)
-+#define           MARK()                                                      ISTREAM->mark(ISTREAM)
-+#define           REWIND(m)                                           ISTREAM->rewind(ISTREAM, m)
-+#define           REWINDLAST()                                        ISTREAM->rewindLast(ISTREAM)
-+#define               SEEK(n)                                                 ISTREAM->seek(ISTREAM, n)
-+#define           PERRORRECOVERY                                      PSRSTATE->errorRecovery
-+#define           FAILEDFLAG                                          PSRSTATE->failed
-+#define           HASFAILED()                                         (FAILEDFLAG == ANTLR3_TRUE)
-+#define           BACKTRACKING                                        PSRSTATE->backtracking
-+#define           RECOVERFROMMISMATCHEDSET(s)         RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
-+#define           RECOVERFROMMISMATCHEDELEMENT(e)     RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
-+#define     ADAPTOR                         ctx->adaptor
-+#define               RULEMEMO                                                PSRSTATE->ruleMemo
-+#define               DBG                                                             RECOGNIZER->debugger
-+
-+#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define           UP      ANTLR3_TOKEN_UP
-+#define           DOWN    ANTLR3_TOKEN_DOWN
-+#define           EOR     ANTLR3_TOKEN_EOR
-+#define           INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+
-+/** \brief Table of all token names in symbolic order, mainly used for
-+ *         error reporting.
-+ */
-+pANTLR3_UINT8   RSPParserTokenNames[30+4]
-+     = {
-+        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
-+        (pANTLR3_UINT8) "<EOR>",
-+        (pANTLR3_UINT8) "<DOWN>", 
-+        (pANTLR3_UINT8) "<UP>", 
-+        (pANTLR3_UINT8) "NEWLINE",
-+        (pANTLR3_UINT8) "OR",
-+        (pANTLR3_UINT8) "AND",
-+        (pANTLR3_UINT8) "LPAR",
-+        (pANTLR3_UINT8) "RPAR",
-+        (pANTLR3_UINT8) "FIELD",
-+        (pANTLR3_UINT8) "STR",
-+        (pANTLR3_UINT8) "NOT",
-+        (pANTLR3_UINT8) "EQUAL",
-+        (pANTLR3_UINT8) "INCLUDES",
-+        (pANTLR3_UINT8) "STARTSW",
-+        (pANTLR3_UINT8) "ENDSW",
-+        (pANTLR3_UINT8) "INT",
-+        (pANTLR3_UINT8) "LESS",
-+        (pANTLR3_UINT8) "GREATER",
-+        (pANTLR3_UINT8) "LTE",
-+        (pANTLR3_UINT8) "GTE",
-+        (pANTLR3_UINT8) "BEFORE",
-+        (pANTLR3_UINT8) "AFTER",
-+        (pANTLR3_UINT8) "DATE",
-+        (pANTLR3_UINT8) "TODAY",
-+        (pANTLR3_UINT8) "DAY",
-+        (pANTLR3_UINT8) "WEEK",
-+        (pANTLR3_UINT8) "MONTH",
-+        (pANTLR3_UINT8) "YEAR",
-+        (pANTLR3_UINT8) "QUOTE",
-+        (pANTLR3_UINT8) "WS",
-+        (pANTLR3_UINT8) "DIGIT19",
-+        (pANTLR3_UINT8) "DIGIT09",
-+        (pANTLR3_UINT8) "ESCAPED"
-+       };
-+
-+        
-+
-+// Forward declare the locally static matching functions we have generated.
-+//
-+static RSPParser_query_return query    (pRSPParser ctx);
-+static RSPParser_expr_return  expr    (pRSPParser ctx);
-+static RSPParser_aexpr_return aexpr    (pRSPParser ctx);
-+static RSPParser_crit_return  crit    (pRSPParser ctx);
-+static RSPParser_strcrit_return       strcrit    (pRSPParser ctx);
-+static RSPParser_strop_return strop    (pRSPParser ctx);
-+static RSPParser_intcrit_return       intcrit    (pRSPParser ctx);
-+static RSPParser_intop_return intop    (pRSPParser ctx);
-+static RSPParser_datecrit_return      datecrit    (pRSPParser ctx);
-+static RSPParser_dateop_return        dateop    (pRSPParser ctx);
-+static RSPParser_datespec_return      datespec    (pRSPParser ctx);
-+static RSPParser_dateref_return       dateref    (pRSPParser ctx);
-+static RSPParser_dateintval_return    dateintval    (pRSPParser ctx);
-+static void   RSPParserFree(pRSPParser ctx);
-+/* For use in tree output where we are accumulating rule labels via label += ruleRef
-+ * we need a function that knows how to free a return scope when the list is destroyed. 
-+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
-+ */
-+static        void ANTLR3_CDECL freeScope(void * scope)
-+{
-+    ANTLR3_FREE(scope);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "RSP.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+      return fileName;
-+}
-+/** \brief Create a new RSPParser parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pRSPParser
-+RSPParserNew   (pANTLR3_COMMON_TOKEN_STREAM instream)
-+{
-+      // See if we can create a new parser with the standard constructor
-+      //
-+      return RSPParserNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new RSPParser parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pRSPParser
-+RSPParserNewSSD   (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+    pRSPParser ctx;       /* Context structure we will build and return   */
-+    
-+    ctx       = (pRSPParser) ANTLR3_CALLOC(1, sizeof(RSPParser));
-+    
-+    if        (ctx == NULL)
-+    {
-+              // Failed to allocate memory for parser context
-+              //
-+        return  NULL;
-+    }
-+    
-+    /* -------------------------------------------------------------------
-+     * Memory for basic structure is allocated, now to fill in
-+     * the base ANTLR3 structures. We initialize the function pointers
-+     * for the standard ANTLR3 parser function set, but upon return
-+     * from here, the programmer may set the pointers to provide custom
-+     * implementations of each function. 
-+     *
-+     * We don't use the macros defined in RSPParser.h here, in order that you can get a sense
-+     * of what goes where.
-+     */
-+
-+    /* Create a base parser/recognizer, using the supplied token stream
-+     */
-+    ctx->pParser          = antlr3ParserNewStream(ANTLR3_SIZE_HINT, instream->tstream, state);
-+    /* Install the implementation of our RSPParser interface
-+     */
-+    ctx->query        = query;
-+    ctx->expr = expr;
-+    ctx->aexpr        = aexpr;
-+    ctx->crit = crit;
-+    ctx->strcrit      = strcrit;
-+    ctx->strop        = strop;
-+    ctx->intcrit      = intcrit;
-+    ctx->intop        = intop;
-+    ctx->datecrit     = datecrit;
-+    ctx->dateop       = dateop;
-+    ctx->datespec     = datespec;
-+    ctx->dateref      = dateref;
-+    ctx->dateintval   = dateintval;
-+    ctx->free                 = RSPParserFree;
-+    ctx->getGrammarFileName   = getGrammarFileName;
-+    
-+    /* Install the scope pushing methods.
-+     */
-+    ADAPTOR   = ANTLR3_TREE_ADAPTORNew(instream->tstream->tokenSource->strFactory);
-+    ctx->vectors      = antlr3VectorFactoryNew(0);
-+    
-+
-+      
-+    /* Install the token table
-+     */
-+    PSRSTATE->tokenNames   = RSPParserTokenNames;
-+    
-+    
-+    /* Return the newly built parser to the caller
-+     */
-+    return  ctx;
-+}
-+
-+/** Free the parser resources
-+ */
-+ static void
-+ RSPParserFree(pRSPParser ctx)
-+ {
-+    /* Free any scope memory
-+     */
-+    
-+    ctx->vectors->close(ctx->vectors);
-+    /* We created the adaptor so we must free it
-+     */
-+    ADAPTOR->free(ADAPTOR);
-+      // Free this parser
-+      //
-+    ctx->pParser->free(ctx->pParser);
-+    ANTLR3_FREE(ctx);
-+
-+    /* Everything is released, so we can return
-+     */
-+    return;
-+ }
-+ 
-+/** Return token names used by this parser
-+ *
-+ * The returned pointer is used as an index into the token names table (using the token 
-+ * number as the index).
-+ * 
-+ * \return Pointer to first char * in the table.
-+ */
-+static pANTLR3_UINT8    *getTokenNames() 
-+{
-+        return RSPParserTokenNames; 
-+}
-+
-+    
-+/* Declare the bitsets
-+ */
-+
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_query42  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_query42_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000010) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_query42     = { FOLLOW_expr_in_query42_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NEWLINE_in_query44  */
-+static        ANTLR3_BITWORD FOLLOW_NEWLINE_in_query44_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_NEWLINE_in_query44  = { FOLLOW_NEWLINE_in_query44_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_query47  */
-+static        ANTLR3_BITWORD FOLLOW_EOF_in_query47_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_EOF_in_query47      = { FOLLOW_EOF_in_query47_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expr63  */
-+static        ANTLR3_BITWORD FOLLOW_aexpr_in_expr63_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000022) };
-+static  ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expr63     = { FOLLOW_aexpr_in_expr63_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OR_in_expr66  */
-+static        ANTLR3_BITWORD FOLLOW_OR_in_expr66_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000280) };
-+static  ANTLR3_BITSET_LIST FOLLOW_OR_in_expr66        = { FOLLOW_OR_in_expr66_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expr69  */
-+static        ANTLR3_BITWORD FOLLOW_aexpr_in_expr69_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000022) };
-+static  ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expr69     = { FOLLOW_aexpr_in_expr69_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_aexpr81  */
-+static        ANTLR3_BITWORD FOLLOW_crit_in_aexpr81_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000042) };
-+static  ANTLR3_BITSET_LIST FOLLOW_crit_in_aexpr81     = { FOLLOW_crit_in_aexpr81_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AND_in_aexpr84  */
-+static        ANTLR3_BITWORD FOLLOW_AND_in_aexpr84_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000280) };
-+static  ANTLR3_BITSET_LIST FOLLOW_AND_in_aexpr84      = { FOLLOW_AND_in_aexpr84_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_aexpr87  */
-+static        ANTLR3_BITWORD FOLLOW_crit_in_aexpr87_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000042) };
-+static  ANTLR3_BITSET_LIST FOLLOW_crit_in_aexpr87     = { FOLLOW_crit_in_aexpr87_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAR_in_crit99  */
-+static        ANTLR3_BITWORD FOLLOW_LPAR_in_crit99_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000280) };
-+static  ANTLR3_BITSET_LIST FOLLOW_LPAR_in_crit99      = { FOLLOW_LPAR_in_crit99_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_crit101  */
-+static        ANTLR3_BITWORD FOLLOW_expr_in_crit101_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000100) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expr_in_crit101     = { FOLLOW_expr_in_crit101_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAR_in_crit103  */
-+static        ANTLR3_BITWORD FOLLOW_RPAR_in_crit103_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_RPAR_in_crit103     = { FOLLOW_RPAR_in_crit103_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_strcrit_in_crit114  */
-+static        ANTLR3_BITWORD FOLLOW_strcrit_in_crit114_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_strcrit_in_crit114  = { FOLLOW_strcrit_in_crit114_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_intcrit_in_crit119  */
-+static        ANTLR3_BITWORD FOLLOW_intcrit_in_crit119_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_intcrit_in_crit119  = { FOLLOW_intcrit_in_crit119_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_datecrit_in_crit124  */
-+static        ANTLR3_BITWORD FOLLOW_datecrit_in_crit124_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_datecrit_in_crit124 = { FOLLOW_datecrit_in_crit124_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_strcrit134  */
-+static        ANTLR3_BITWORD FOLLOW_FIELD_in_strcrit134_bits[]        = { ANTLR3_UINT64_LIT(0x000000000000F000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_strcrit134 = { FOLLOW_FIELD_in_strcrit134_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_strop_in_strcrit136  */
-+static        ANTLR3_BITWORD FOLLOW_strop_in_strcrit136_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000400) };
-+static  ANTLR3_BITSET_LIST FOLLOW_strop_in_strcrit136 = { FOLLOW_strop_in_strcrit136_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_strcrit138  */
-+static        ANTLR3_BITWORD FOLLOW_STR_in_strcrit138_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STR_in_strcrit138   = { FOLLOW_STR_in_strcrit138_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_strcrit155  */
-+static        ANTLR3_BITWORD FOLLOW_FIELD_in_strcrit155_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000800) };
-+static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_strcrit155 = { FOLLOW_FIELD_in_strcrit155_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_strcrit157  */
-+static        ANTLR3_BITWORD FOLLOW_NOT_in_strcrit157_bits[]  = { ANTLR3_UINT64_LIT(0x000000000000F000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_NOT_in_strcrit157   = { FOLLOW_NOT_in_strcrit157_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_strop_in_strcrit159  */
-+static        ANTLR3_BITWORD FOLLOW_strop_in_strcrit159_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000400) };
-+static  ANTLR3_BITSET_LIST FOLLOW_strop_in_strcrit159 = { FOLLOW_strop_in_strcrit159_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_strcrit161  */
-+static        ANTLR3_BITWORD FOLLOW_STR_in_strcrit161_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STR_in_strcrit161   = { FOLLOW_STR_in_strcrit161_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQUAL_in_strop188  */
-+static        ANTLR3_BITWORD FOLLOW_EQUAL_in_strop188_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_EQUAL_in_strop188   = { FOLLOW_EQUAL_in_strop188_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCLUDES_in_strop195  */
-+static        ANTLR3_BITWORD FOLLOW_INCLUDES_in_strop195_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INCLUDES_in_strop195        = { FOLLOW_INCLUDES_in_strop195_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STARTSW_in_strop202  */
-+static        ANTLR3_BITWORD FOLLOW_STARTSW_in_strop202_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STARTSW_in_strop202 = { FOLLOW_STARTSW_in_strop202_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENDSW_in_strop209  */
-+static        ANTLR3_BITWORD FOLLOW_ENDSW_in_strop209_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_ENDSW_in_strop209   = { FOLLOW_ENDSW_in_strop209_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_intcrit219  */
-+static        ANTLR3_BITWORD FOLLOW_FIELD_in_intcrit219_bits[]        = { ANTLR3_UINT64_LIT(0x00000000001E1000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_intcrit219 = { FOLLOW_FIELD_in_intcrit219_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_intop_in_intcrit221  */
-+static        ANTLR3_BITWORD FOLLOW_intop_in_intcrit221_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000010000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_intop_in_intcrit221 = { FOLLOW_intop_in_intcrit221_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_intcrit223  */
-+static        ANTLR3_BITWORD FOLLOW_INT_in_intcrit223_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INT_in_intcrit223   = { FOLLOW_INT_in_intcrit223_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_intcrit240  */
-+static        ANTLR3_BITWORD FOLLOW_FIELD_in_intcrit240_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000800) };
-+static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_intcrit240 = { FOLLOW_FIELD_in_intcrit240_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_intcrit242  */
-+static        ANTLR3_BITWORD FOLLOW_NOT_in_intcrit242_bits[]  = { ANTLR3_UINT64_LIT(0x00000000001E1000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_NOT_in_intcrit242   = { FOLLOW_NOT_in_intcrit242_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_intop_in_intcrit244  */
-+static        ANTLR3_BITWORD FOLLOW_intop_in_intcrit244_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000010000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_intop_in_intcrit244 = { FOLLOW_intop_in_intcrit244_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_intcrit246  */
-+static        ANTLR3_BITWORD FOLLOW_INT_in_intcrit246_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INT_in_intcrit246   = { FOLLOW_INT_in_intcrit246_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQUAL_in_intop273  */
-+static        ANTLR3_BITWORD FOLLOW_EQUAL_in_intop273_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_EQUAL_in_intop273   = { FOLLOW_EQUAL_in_intop273_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LESS_in_intop280  */
-+static        ANTLR3_BITWORD FOLLOW_LESS_in_intop280_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_LESS_in_intop280    = { FOLLOW_LESS_in_intop280_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GREATER_in_intop287  */
-+static        ANTLR3_BITWORD FOLLOW_GREATER_in_intop287_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_GREATER_in_intop287 = { FOLLOW_GREATER_in_intop287_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LTE_in_intop294  */
-+static        ANTLR3_BITWORD FOLLOW_LTE_in_intop294_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_LTE_in_intop294     = { FOLLOW_LTE_in_intop294_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GTE_in_intop301  */
-+static        ANTLR3_BITWORD FOLLOW_GTE_in_intop301_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_GTE_in_intop301     = { FOLLOW_GTE_in_intop301_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_datecrit310  */
-+static        ANTLR3_BITWORD FOLLOW_FIELD_in_datecrit310_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000600000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_datecrit310        = { FOLLOW_FIELD_in_datecrit310_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateop_in_datecrit312  */
-+static        ANTLR3_BITWORD FOLLOW_dateop_in_datecrit312_bits[]      = { ANTLR3_UINT64_LIT(0x0000000001810000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_dateop_in_datecrit312       = { FOLLOW_dateop_in_datecrit312_bits, 1        };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_datespec_in_datecrit314  */
-+static        ANTLR3_BITWORD FOLLOW_datespec_in_datecrit314_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_datespec_in_datecrit314     = { FOLLOW_datespec_in_datecrit314_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_dateop337  */
-+static        ANTLR3_BITWORD FOLLOW_BEFORE_in_dateop337_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_dateop337 = { FOLLOW_BEFORE_in_dateop337_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_dateop344  */
-+static        ANTLR3_BITWORD FOLLOW_AFTER_in_dateop344_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_AFTER_in_dateop344  = { FOLLOW_AFTER_in_dateop344_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateref_in_datespec353  */
-+static        ANTLR3_BITWORD FOLLOW_dateref_in_datespec353_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_dateref_in_datespec353      = { FOLLOW_dateref_in_datespec353_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_datespec358  */
-+static        ANTLR3_BITWORD FOLLOW_INT_in_datespec358_bits[] = { ANTLR3_UINT64_LIT(0x000000001E000000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INT_in_datespec358  = { FOLLOW_INT_in_datespec358_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateintval_in_datespec360  */
-+static        ANTLR3_BITWORD FOLLOW_dateintval_in_datespec360_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000600000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_dateintval_in_datespec360   = { FOLLOW_dateintval_in_datespec360_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateop_in_datespec362  */
-+static        ANTLR3_BITWORD FOLLOW_dateop_in_datespec362_bits[]      = { ANTLR3_UINT64_LIT(0x0000000001800000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_dateop_in_datespec362       = { FOLLOW_dateop_in_datespec362_bits, 1        };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateref_in_datespec364  */
-+static        ANTLR3_BITWORD FOLLOW_dateref_in_datespec364_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_dateref_in_datespec364      = { FOLLOW_dateref_in_datespec364_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateref388  */
-+static        ANTLR3_BITWORD FOLLOW_DATE_in_dateref388_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateref388  = { FOLLOW_DATE_in_dateref388_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_TODAY_in_dateref395  */
-+static        ANTLR3_BITWORD FOLLOW_TODAY_in_dateref395_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_TODAY_in_dateref395 = { FOLLOW_TODAY_in_dateref395_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DAY_in_dateintval408  */
-+static        ANTLR3_BITWORD FOLLOW_DAY_in_dateintval408_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DAY_in_dateintval408        = { FOLLOW_DAY_in_dateintval408_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_WEEK_in_dateintval415  */
-+static        ANTLR3_BITWORD FOLLOW_WEEK_in_dateintval415_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_WEEK_in_dateintval415       = { FOLLOW_WEEK_in_dateintval415_bits, 1        };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MONTH_in_dateintval422  */
-+static        ANTLR3_BITWORD FOLLOW_MONTH_in_dateintval422_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_MONTH_in_dateintval422      = { FOLLOW_MONTH_in_dateintval422_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_YEAR_in_dateintval429  */
-+static        ANTLR3_BITWORD FOLLOW_YEAR_in_dateintval429_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_YEAR_in_dateintval429       = { FOLLOW_YEAR_in_dateintval429_bits, 1        };
-+     
-+
-+ 
-+ 
-+/* ==============================================
-+ * Parsing rules
-+ */
-+/** 
-+ * $ANTLR start query
-+ * RSP.g:27:1: query : expr ( NEWLINE )? EOF -> expr ;
-+ */
-+static RSPParser_query_return
-+query(pRSPParser ctx)
-+{   
-+    RSPParser_query_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    NEWLINE2;
-+    pANTLR3_COMMON_TOKEN    EOF3;
-+    RSPParser_expr_return expr1;
-+    #undef    RETURN_TYPE_expr1
-+    #define   RETURN_TYPE_expr1 RSPParser_expr_return
-+
-+    pANTLR3_BASE_TREE NEWLINE2_tree;
-+    pANTLR3_BASE_TREE EOF3_tree;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_NEWLINE;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_EOF;
-+    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expr;
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    NEWLINE2       = NULL;
-+    EOF3       = NULL;
-+    expr1.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    NEWLINE2_tree   = NULL;
-+    EOF3_tree   = NULL;
-+
-+    stream_NEWLINE   = NULL;
-+    #define CREATE_stream_NEWLINE  if (stream_NEWLINE == NULL) {stream_NEWLINE = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token NEWLINE"); } 
-+    stream_EOF   = NULL;
-+    #define CREATE_stream_EOF  if (stream_EOF == NULL) {stream_EOF = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token EOF"); } 
-+    stream_expr   = NULL;
-+    #define CREATE_stream_expr  if (stream_expr == NULL) {stream_expr = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expr"); }
-+
-+    retval.tree  = NULL;
-+    {
-+        // RSP.g:27:7: ( expr ( NEWLINE )? EOF -> expr )
-+        // RSP.g:27:9: expr ( NEWLINE )? EOF
-+        {
-+            FOLLOWPUSH(FOLLOW_expr_in_query42);
-+            expr1=expr(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto rulequeryEx;
-+            }
-+
-+            CREATE_stream_expr; stream_expr->add(stream_expr, expr1.tree, NULL);
-+
-+            // RSP.g:27:14: ( NEWLINE )?
-+            {
-+                int alt1=2;
-+                switch ( LA(1) ) 
-+                {
-+                    case NEWLINE:
-+                      {
-+                              alt1=1;
-+                      }
-+                        break;
-+                }
-+
-+                switch (alt1) 
-+                {
-+              case 1:
-+                  // RSP.g:27:14: NEWLINE
-+                  {
-+                      NEWLINE2 = (pANTLR3_COMMON_TOKEN) MATCHT(NEWLINE, &FOLLOW_NEWLINE_in_query44); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulequeryEx;
-+                      }
-+                       
-+                      CREATE_stream_NEWLINE; stream_NEWLINE->add(stream_NEWLINE, NEWLINE2, NULL);
-+
-+
-+                  }
-+                  break;
-+
-+                }
-+            }
-+            EOF3 = (pANTLR3_COMMON_TOKEN) MATCHT(EOF, &FOLLOW_EOF_in_query47); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto rulequeryEx;
-+            }
-+             
-+            CREATE_stream_EOF; stream_EOF->add(stream_EOF, EOF3, NULL);
-+
-+
-+             
-+            /* AST REWRITE
-+             * elements          : expr
-+             * token labels      : 
-+             * rule labels       : retval
-+             * token list labels : 
-+             * rule list labels  : 
-+             */
-+            {
-+              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+              retval.tree    = root_0;
-+              // 27:28: -> expr
-+              {
-+                  ADAPTOR->addChild(ADAPTOR, root_0, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
-+
-+              }
-+
-+              retval.tree = root_0; // set result root
-+              if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+            }
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto rulequeryEx; /* Prevent compiler warnings */
-+    rulequeryEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+        if (stream_NEWLINE != NULL) stream_NEWLINE->free(stream_NEWLINE);
-+        if (stream_EOF != NULL) stream_EOF->free(stream_EOF);
-+        if (stream_expr != NULL) stream_expr->free(stream_expr);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end query */
-+
-+/** 
-+ * $ANTLR start expr
-+ * RSP.g:30:1: expr : aexpr ( OR aexpr )* ;
-+ */
-+static RSPParser_expr_return
-+expr(pRSPParser ctx)
-+{   
-+    RSPParser_expr_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    OR5;
-+    RSPParser_aexpr_return aexpr4;
-+    #undef    RETURN_TYPE_aexpr4
-+    #define   RETURN_TYPE_aexpr4 RSPParser_aexpr_return
-+
-+    RSPParser_aexpr_return aexpr6;
-+    #undef    RETURN_TYPE_aexpr6
-+    #define   RETURN_TYPE_aexpr6 RSPParser_aexpr_return
-+
-+    pANTLR3_BASE_TREE OR5_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    OR5       = NULL;
-+    aexpr4.tree = NULL;
-+
-+    aexpr6.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    OR5_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        // RSP.g:30:6: ( aexpr ( OR aexpr )* )
-+        // RSP.g:30:8: aexpr ( OR aexpr )*
-+        {
-+            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+            FOLLOWPUSH(FOLLOW_aexpr_in_expr63);
-+            aexpr4=aexpr(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleexprEx;
-+            }
-+
-+            ADAPTOR->addChild(ADAPTOR, root_0, aexpr4.tree);
-+
-+            // RSP.g:30:14: ( OR aexpr )*
-+
-+            for (;;)
-+            {
-+                int alt2=2;
-+                switch ( LA(1) ) 
-+                {
-+                case OR:
-+                      {
-+                              alt2=1;
-+                      }
-+                    break;
-+
-+                }
-+
-+                switch (alt2) 
-+                {
-+              case 1:
-+                  // RSP.g:30:15: OR aexpr
-+                  {
-+                      OR5 = (pANTLR3_COMMON_TOKEN) MATCHT(OR, &FOLLOW_OR_in_expr66); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      OR5_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, OR5));
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, OR5_tree, root_0));
-+
-+                      FOLLOWPUSH(FOLLOW_aexpr_in_expr69);
-+                      aexpr6=aexpr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexprEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, aexpr6.tree);
-+
-+                  }
-+                  break;
-+
-+              default:
-+                  goto loop2; /* break out of the loop */
-+                  break;
-+                }
-+            }
-+            loop2: ; /* Jump out to here if this rule does not match */
-+
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleexprEx; /* Prevent compiler warnings */
-+    ruleexprEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end expr */
-+
-+/** 
-+ * $ANTLR start aexpr
-+ * RSP.g:33:1: aexpr : crit ( AND crit )* ;
-+ */
-+static RSPParser_aexpr_return
-+aexpr(pRSPParser ctx)
-+{   
-+    RSPParser_aexpr_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    AND8;
-+    RSPParser_crit_return crit7;
-+    #undef    RETURN_TYPE_crit7
-+    #define   RETURN_TYPE_crit7 RSPParser_crit_return
-+
-+    RSPParser_crit_return crit9;
-+    #undef    RETURN_TYPE_crit9
-+    #define   RETURN_TYPE_crit9 RSPParser_crit_return
-+
-+    pANTLR3_BASE_TREE AND8_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    AND8       = NULL;
-+    crit7.tree = NULL;
-+
-+    crit9.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    AND8_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        // RSP.g:33:7: ( crit ( AND crit )* )
-+        // RSP.g:33:9: crit ( AND crit )*
-+        {
-+            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+            FOLLOWPUSH(FOLLOW_crit_in_aexpr81);
-+            crit7=crit(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleaexprEx;
-+            }
-+
-+            ADAPTOR->addChild(ADAPTOR, root_0, crit7.tree);
-+
-+            // RSP.g:33:14: ( AND crit )*
-+
-+            for (;;)
-+            {
-+                int alt3=2;
-+                switch ( LA(1) ) 
-+                {
-+                case AND:
-+                      {
-+                              alt3=1;
-+                      }
-+                    break;
-+
-+                }
-+
-+                switch (alt3) 
-+                {
-+              case 1:
-+                  // RSP.g:33:15: AND crit
-+                  {
-+                      AND8 = (pANTLR3_COMMON_TOKEN) MATCHT(AND, &FOLLOW_AND_in_aexpr84); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleaexprEx;
-+                      }
-+
-+                      AND8_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, AND8));
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, AND8_tree, root_0));
-+
-+                      FOLLOWPUSH(FOLLOW_crit_in_aexpr87);
-+                      crit9=crit(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleaexprEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, crit9.tree);
-+
-+                  }
-+                  break;
-+
-+              default:
-+                  goto loop3; /* break out of the loop */
-+                  break;
-+                }
-+            }
-+            loop3: ; /* Jump out to here if this rule does not match */
-+
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleaexprEx; /* Prevent compiler warnings */
-+    ruleaexprEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end aexpr */
-+
-+/** 
-+ * $ANTLR start crit
-+ * RSP.g:36:1: crit : ( LPAR expr RPAR -> expr | strcrit | intcrit | datecrit );
-+ */
-+static RSPParser_crit_return
-+crit(pRSPParser ctx)
-+{   
-+    RSPParser_crit_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    LPAR10;
-+    pANTLR3_COMMON_TOKEN    RPAR12;
-+    RSPParser_expr_return expr11;
-+    #undef    RETURN_TYPE_expr11
-+    #define   RETURN_TYPE_expr11 RSPParser_expr_return
-+
-+    RSPParser_strcrit_return strcrit13;
-+    #undef    RETURN_TYPE_strcrit13
-+    #define   RETURN_TYPE_strcrit13 RSPParser_strcrit_return
-+
-+    RSPParser_intcrit_return intcrit14;
-+    #undef    RETURN_TYPE_intcrit14
-+    #define   RETURN_TYPE_intcrit14 RSPParser_intcrit_return
-+
-+    RSPParser_datecrit_return datecrit15;
-+    #undef    RETURN_TYPE_datecrit15
-+    #define   RETURN_TYPE_datecrit15 RSPParser_datecrit_return
-+
-+    pANTLR3_BASE_TREE LPAR10_tree;
-+    pANTLR3_BASE_TREE RPAR12_tree;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_RPAR;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LPAR;
-+    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expr;
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    LPAR10       = NULL;
-+    RPAR12       = NULL;
-+    expr11.tree = NULL;
-+
-+    strcrit13.tree = NULL;
-+
-+    intcrit14.tree = NULL;
-+
-+    datecrit15.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    LPAR10_tree   = NULL;
-+    RPAR12_tree   = NULL;
-+
-+    stream_RPAR   = NULL;
-+    #define CREATE_stream_RPAR  if (stream_RPAR == NULL) {stream_RPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token RPAR"); } 
-+    stream_LPAR   = NULL;
-+    #define CREATE_stream_LPAR  if (stream_LPAR == NULL) {stream_LPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LPAR"); } 
-+    stream_expr   = NULL;
-+    #define CREATE_stream_expr  if (stream_expr == NULL) {stream_expr = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expr"); }
-+
-+    retval.tree  = NULL;
-+    {
-+        {
-+            //  RSP.g:36:6: ( LPAR expr RPAR -> expr | strcrit | intcrit | datecrit )
-+            
-+            ANTLR3_UINT32 alt4;
-+
-+            alt4=4;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case LPAR:
-+              {
-+                      alt4=1;
-+              }
-+                break;
-+            case FIELD:
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case NOT:
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case EQUAL:
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case STR:
-+                                                              {
-+                                                                      alt4=2;
-+                                                              }
-+                                                          break;
-+                                                      case INT:
-+                                                              {
-+                                                                      alt4=3;
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          CONSTRUCTEX();
-+                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                          EXCEPTION->message      = (void *)"";
-+                                                          EXCEPTION->decisionNum  = 4;
-+                                                          EXCEPTION->state        = 8;
-+
-+
-+                                                          goto rulecritEx;
-+                                                      }
-+
-+                                              }
-+                                          break;
-+                                      case LESS:
-+                                      case GREATER:
-+                                      case LTE:
-+                                      case GTE:
-+                                              {
-+                                                      alt4=3;
-+                                              }
-+                                          break;
-+                                      case INCLUDES:
-+                                      case STARTSW:
-+                                      case ENDSW:
-+                                              {
-+                                                      alt4=2;
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 4;
-+                                          EXCEPTION->state        = 3;
-+
-+
-+                                          goto rulecritEx;
-+                                      }
-+
-+                              }
-+                          break;
-+                      case BEFORE:
-+                      case AFTER:
-+                              {
-+                                      alt4=4;
-+                              }
-+                          break;
-+                      case EQUAL:
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case INT:
-+                                              {
-+                                                      alt4=3;
-+                                              }
-+                                          break;
-+                                      case STR:
-+                                              {
-+                                                      alt4=2;
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 4;
-+                                          EXCEPTION->state        = 5;
-+
-+
-+                                          goto rulecritEx;
-+                                      }
-+
-+                              }
-+                          break;
-+                      case LESS:
-+                      case GREATER:
-+                      case LTE:
-+                      case GTE:
-+                              {
-+                                      alt4=3;
-+                              }
-+                          break;
-+                      case INCLUDES:
-+                      case STARTSW:
-+                      case ENDSW:
-+                              {
-+                                      alt4=2;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 4;
-+                          EXCEPTION->state        = 2;
-+
-+
-+                          goto rulecritEx;
-+                      }
-+
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 4;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto rulecritEx;
-+            }
-+
-+            switch (alt4) 
-+            {
-+              case 1:
-+                  // RSP.g:36:8: LPAR expr RPAR
-+                  {
-+                      LPAR10 = (pANTLR3_COMMON_TOKEN) MATCHT(LPAR, &FOLLOW_LPAR_in_crit99); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+                       
-+                      CREATE_stream_LPAR; stream_LPAR->add(stream_LPAR, LPAR10, NULL);
-+
-+                      FOLLOWPUSH(FOLLOW_expr_in_crit101);
-+                      expr11=expr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      CREATE_stream_expr; stream_expr->add(stream_expr, expr11.tree, NULL);
-+                      RPAR12 = (pANTLR3_COMMON_TOKEN) MATCHT(RPAR, &FOLLOW_RPAR_in_crit103); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+                       
-+                      CREATE_stream_RPAR; stream_RPAR->add(stream_RPAR, RPAR12, NULL);
-+
-+
-+                       
-+                      /* AST REWRITE
-+                       * elements          : expr
-+                       * token labels      : 
-+                       * rule labels       : retval
-+                       * token list labels : 
-+                       * rule list labels  : 
-+                       */
-+                      {
-+                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                              retval.tree    = root_0;
-+                              // 36:25: -> expr
-+                              {
-+                                  ADAPTOR->addChild(ADAPTOR, root_0, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
-+
-+                              }
-+
-+                              retval.tree = root_0; // set result root
-+                              if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+                      }
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP.g:37:4: strcrit
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      FOLLOWPUSH(FOLLOW_strcrit_in_crit114);
-+                      strcrit13=strcrit(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, strcrit13.tree);
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // RSP.g:38:4: intcrit
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      FOLLOWPUSH(FOLLOW_intcrit_in_crit119);
-+                      intcrit14=intcrit(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, intcrit14.tree);
-+
-+                  }
-+                  break;
-+              case 4:
-+                  // RSP.g:39:4: datecrit
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      FOLLOWPUSH(FOLLOW_datecrit_in_crit124);
-+                      datecrit15=datecrit(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, datecrit15.tree);
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto rulecritEx; /* Prevent compiler warnings */
-+    rulecritEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+        if (stream_RPAR != NULL) stream_RPAR->free(stream_RPAR);
-+        if (stream_LPAR != NULL) stream_LPAR->free(stream_LPAR);
-+        if (stream_expr != NULL) stream_expr->free(stream_expr);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end crit */
-+
-+/** 
-+ * $ANTLR start strcrit
-+ * RSP.g:42:1: strcrit : ( FIELD strop STR -> ^( strop FIELD STR ) | FIELD NOT strop STR -> ^( NOT ^( strop FIELD STR ) ) );
-+ */
-+static RSPParser_strcrit_return
-+strcrit(pRSPParser ctx)
-+{   
-+    RSPParser_strcrit_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    FIELD16;
-+    pANTLR3_COMMON_TOKEN    STR18;
-+    pANTLR3_COMMON_TOKEN    FIELD19;
-+    pANTLR3_COMMON_TOKEN    NOT20;
-+    pANTLR3_COMMON_TOKEN    STR22;
-+    RSPParser_strop_return strop17;
-+    #undef    RETURN_TYPE_strop17
-+    #define   RETURN_TYPE_strop17 RSPParser_strop_return
-+
-+    RSPParser_strop_return strop21;
-+    #undef    RETURN_TYPE_strop21
-+    #define   RETURN_TYPE_strop21 RSPParser_strop_return
-+
-+    pANTLR3_BASE_TREE FIELD16_tree;
-+    pANTLR3_BASE_TREE STR18_tree;
-+    pANTLR3_BASE_TREE FIELD19_tree;
-+    pANTLR3_BASE_TREE NOT20_tree;
-+    pANTLR3_BASE_TREE STR22_tree;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_STR;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_FIELD;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_NOT;
-+    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_strop;
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    FIELD16       = NULL;
-+    STR18       = NULL;
-+    FIELD19       = NULL;
-+    NOT20       = NULL;
-+    STR22       = NULL;
-+    strop17.tree = NULL;
-+
-+    strop21.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    FIELD16_tree   = NULL;
-+    STR18_tree   = NULL;
-+    FIELD19_tree   = NULL;
-+    NOT20_tree   = NULL;
-+    STR22_tree   = NULL;
-+
-+    stream_STR   = NULL;
-+    #define CREATE_stream_STR  if (stream_STR == NULL) {stream_STR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token STR"); } 
-+    stream_FIELD   = NULL;
-+    #define CREATE_stream_FIELD  if (stream_FIELD == NULL) {stream_FIELD = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token FIELD"); } 
-+    stream_NOT   = NULL;
-+    #define CREATE_stream_NOT  if (stream_NOT == NULL) {stream_NOT = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token NOT"); } 
-+    stream_strop   = NULL;
-+    #define CREATE_stream_strop  if (stream_strop == NULL) {stream_strop = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule strop"); }
-+
-+    retval.tree  = NULL;
-+    {
-+        {
-+            //  RSP.g:42:9: ( FIELD strop STR -> ^( strop FIELD STR ) | FIELD NOT strop STR -> ^( NOT ^( strop FIELD STR ) ) )
-+            
-+            ANTLR3_UINT32 alt5;
-+
-+            alt5=2;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case FIELD:
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case NOT:
-+                              {
-+                                      alt5=2;
-+                              }
-+                          break;
-+                      case EQUAL:
-+                      case INCLUDES:
-+                      case STARTSW:
-+                      case ENDSW:
-+                              {
-+                                      alt5=1;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 5;
-+                          EXCEPTION->state        = 1;
-+
-+
-+                          goto rulestrcritEx;
-+                      }
-+
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 5;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto rulestrcritEx;
-+            }
-+
-+            switch (alt5) 
-+            {
-+              case 1:
-+                  // RSP.g:42:11: FIELD strop STR
-+                  {
-+                      FIELD16 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_strcrit134); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestrcritEx;
-+                      }
-+                       
-+                      CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD16, NULL);
-+
-+                      FOLLOWPUSH(FOLLOW_strop_in_strcrit136);
-+                      strop17=strop(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestrcritEx;
-+                      }
-+
-+                      CREATE_stream_strop; stream_strop->add(stream_strop, strop17.tree, NULL);
-+                      STR18 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_strcrit138); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestrcritEx;
-+                      }
-+                       
-+                      CREATE_stream_STR; stream_STR->add(stream_STR, STR18, NULL);
-+
-+
-+                       
-+                      /* AST REWRITE
-+                       * elements          : FIELD, STR, strop
-+                       * token labels      : 
-+                       * rule labels       : retval
-+                       * token list labels : 
-+                       * rule list labels  : 
-+                       */
-+                      {
-+                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                              retval.tree    = root_0;
-+                              // 42:29: -> ^( strop FIELD STR )
-+                              {
-+                                  // RSP.g:42:32: ^( strop FIELD STR )
-+                                  {
-+                                      pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                                      root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_strop == NULL ? NULL : stream_strop->nextNode(stream_strop), root_1));
-+
-+                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
-+                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_STR == NULL ? NULL : stream_STR->nextNode(stream_STR));
-+
-+                                      ADAPTOR->addChild(ADAPTOR, root_0, root_1);
-+                                  }
-+
-+                              }
-+
-+                              retval.tree = root_0; // set result root
-+                              if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+                      }
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP.g:43:4: FIELD NOT strop STR
-+                  {
-+                      FIELD19 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_strcrit155); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestrcritEx;
-+                      }
-+                       
-+                      CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD19, NULL);
-+
-+                      NOT20 = (pANTLR3_COMMON_TOKEN) MATCHT(NOT, &FOLLOW_NOT_in_strcrit157); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestrcritEx;
-+                      }
-+                       
-+                      CREATE_stream_NOT; stream_NOT->add(stream_NOT, NOT20, NULL);
-+
-+                      FOLLOWPUSH(FOLLOW_strop_in_strcrit159);
-+                      strop21=strop(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestrcritEx;
-+                      }
-+
-+                      CREATE_stream_strop; stream_strop->add(stream_strop, strop21.tree, NULL);
-+                      STR22 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_strcrit161); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestrcritEx;
-+                      }
-+                       
-+                      CREATE_stream_STR; stream_STR->add(stream_STR, STR22, NULL);
-+
-+
-+                       
-+                      /* AST REWRITE
-+                       * elements          : STR, FIELD, strop, NOT
-+                       * token labels      : 
-+                       * rule labels       : retval
-+                       * token list labels : 
-+                       * rule list labels  : 
-+                       */
-+                      {
-+                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                              retval.tree    = root_0;
-+                              // 43:25: -> ^( NOT ^( strop FIELD STR ) )
-+                              {
-+                                  // RSP.g:43:28: ^( NOT ^( strop FIELD STR ) )
-+                                  {
-+                                      pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                                      root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_NOT == NULL ? NULL : stream_NOT->nextNode(stream_NOT), root_1));
-+
-+                                      // RSP.g:43:34: ^( strop FIELD STR )
-+                                      {
-+                                          pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                                          root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_strop == NULL ? NULL : stream_strop->nextNode(stream_strop), root_2));
-+
-+                                          ADAPTOR->addChild(ADAPTOR, root_2, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
-+                                          ADAPTOR->addChild(ADAPTOR, root_2, stream_STR == NULL ? NULL : stream_STR->nextNode(stream_STR));
-+
-+                                          ADAPTOR->addChild(ADAPTOR, root_1, root_2);
-+                                      }
-+
-+                                      ADAPTOR->addChild(ADAPTOR, root_0, root_1);
-+                                  }
-+
-+                              }
-+
-+                              retval.tree = root_0; // set result root
-+                              if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+                      }
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto rulestrcritEx; /* Prevent compiler warnings */
-+    rulestrcritEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+        if (stream_STR != NULL) stream_STR->free(stream_STR);
-+        if (stream_FIELD != NULL) stream_FIELD->free(stream_FIELD);
-+        if (stream_NOT != NULL) stream_NOT->free(stream_NOT);
-+        if (stream_strop != NULL) stream_strop->free(stream_strop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end strcrit */
-+
-+/** 
-+ * $ANTLR start strop
-+ * RSP.g:46:1: strop : (equal= EQUAL | includes= INCLUDES | startsw= STARTSW | endsw= ENDSW );
-+ */
-+static RSPParser_strop_return
-+strop(pRSPParser ctx)
-+{   
-+    RSPParser_strop_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    equal;
-+    pANTLR3_COMMON_TOKEN    includes;
-+    pANTLR3_COMMON_TOKEN    startsw;
-+    pANTLR3_COMMON_TOKEN    endsw;
-+
-+    pANTLR3_BASE_TREE equal_tree;
-+    pANTLR3_BASE_TREE includes_tree;
-+    pANTLR3_BASE_TREE startsw_tree;
-+    pANTLR3_BASE_TREE endsw_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    equal       = NULL;
-+    includes       = NULL;
-+    startsw       = NULL;
-+    endsw       = NULL;
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    equal_tree   = NULL;
-+    includes_tree   = NULL;
-+    startsw_tree   = NULL;
-+    endsw_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        {
-+            //  RSP.g:46:7: (equal= EQUAL | includes= INCLUDES | startsw= STARTSW | endsw= ENDSW )
-+            
-+            ANTLR3_UINT32 alt6;
-+
-+            alt6=4;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case EQUAL:
-+              {
-+                      alt6=1;
-+              }
-+                break;
-+            case INCLUDES:
-+              {
-+                      alt6=2;
-+              }
-+                break;
-+            case STARTSW:
-+              {
-+                      alt6=3;
-+              }
-+                break;
-+            case ENDSW:
-+              {
-+                      alt6=4;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 6;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto rulestropEx;
-+            }
-+
-+            switch (alt6) 
-+            {
-+              case 1:
-+                  // RSP.g:46:9: equal= EQUAL
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      equal = (pANTLR3_COMMON_TOKEN) MATCHT(EQUAL, &FOLLOW_EQUAL_in_strop188); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestropEx;
-+                      }
-+
-+                      equal_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, equal));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, equal_tree);
-+
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP.g:47:4: includes= INCLUDES
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      includes = (pANTLR3_COMMON_TOKEN) MATCHT(INCLUDES, &FOLLOW_INCLUDES_in_strop195); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestropEx;
-+                      }
-+
-+                      includes_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, includes));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, includes_tree);
-+
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // RSP.g:48:4: startsw= STARTSW
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      startsw = (pANTLR3_COMMON_TOKEN) MATCHT(STARTSW, &FOLLOW_STARTSW_in_strop202); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestropEx;
-+                      }
-+
-+                      startsw_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, startsw));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, startsw_tree);
-+
-+
-+                  }
-+                  break;
-+              case 4:
-+                  // RSP.g:49:4: endsw= ENDSW
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      endsw = (pANTLR3_COMMON_TOKEN) MATCHT(ENDSW, &FOLLOW_ENDSW_in_strop209); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulestropEx;
-+                      }
-+
-+                      endsw_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, endsw));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, endsw_tree);
-+
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto rulestropEx; /* Prevent compiler warnings */
-+    rulestropEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end strop */
-+
-+/** 
-+ * $ANTLR start intcrit
-+ * RSP.g:52:1: intcrit : ( FIELD intop INT -> ^( intop FIELD INT ) | FIELD NOT intop INT -> ^( NOT ^( intop FIELD INT ) ) );
-+ */
-+static RSPParser_intcrit_return
-+intcrit(pRSPParser ctx)
-+{   
-+    RSPParser_intcrit_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    FIELD23;
-+    pANTLR3_COMMON_TOKEN    INT25;
-+    pANTLR3_COMMON_TOKEN    FIELD26;
-+    pANTLR3_COMMON_TOKEN    NOT27;
-+    pANTLR3_COMMON_TOKEN    INT29;
-+    RSPParser_intop_return intop24;
-+    #undef    RETURN_TYPE_intop24
-+    #define   RETURN_TYPE_intop24 RSPParser_intop_return
-+
-+    RSPParser_intop_return intop28;
-+    #undef    RETURN_TYPE_intop28
-+    #define   RETURN_TYPE_intop28 RSPParser_intop_return
-+
-+    pANTLR3_BASE_TREE FIELD23_tree;
-+    pANTLR3_BASE_TREE INT25_tree;
-+    pANTLR3_BASE_TREE FIELD26_tree;
-+    pANTLR3_BASE_TREE NOT27_tree;
-+    pANTLR3_BASE_TREE INT29_tree;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_FIELD;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_INT;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_NOT;
-+    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_intop;
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    FIELD23       = NULL;
-+    INT25       = NULL;
-+    FIELD26       = NULL;
-+    NOT27       = NULL;
-+    INT29       = NULL;
-+    intop24.tree = NULL;
-+
-+    intop28.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    FIELD23_tree   = NULL;
-+    INT25_tree   = NULL;
-+    FIELD26_tree   = NULL;
-+    NOT27_tree   = NULL;
-+    INT29_tree   = NULL;
-+
-+    stream_FIELD   = NULL;
-+    #define CREATE_stream_FIELD  if (stream_FIELD == NULL) {stream_FIELD = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token FIELD"); } 
-+    stream_INT   = NULL;
-+    #define CREATE_stream_INT  if (stream_INT == NULL) {stream_INT = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token INT"); } 
-+    stream_NOT   = NULL;
-+    #define CREATE_stream_NOT  if (stream_NOT == NULL) {stream_NOT = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token NOT"); } 
-+    stream_intop   = NULL;
-+    #define CREATE_stream_intop  if (stream_intop == NULL) {stream_intop = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule intop"); }
-+
-+    retval.tree  = NULL;
-+    {
-+        {
-+            //  RSP.g:52:9: ( FIELD intop INT -> ^( intop FIELD INT ) | FIELD NOT intop INT -> ^( NOT ^( intop FIELD INT ) ) )
-+            
-+            ANTLR3_UINT32 alt7;
-+
-+            alt7=2;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case FIELD:
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case NOT:
-+                              {
-+                                      alt7=2;
-+                              }
-+                          break;
-+                      case EQUAL:
-+                      case LESS:
-+                      case GREATER:
-+                      case LTE:
-+                      case GTE:
-+                              {
-+                                      alt7=1;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 7;
-+                          EXCEPTION->state        = 1;
-+
-+
-+                          goto ruleintcritEx;
-+                      }
-+
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 7;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruleintcritEx;
-+            }
-+
-+            switch (alt7) 
-+            {
-+              case 1:
-+                  // RSP.g:52:11: FIELD intop INT
-+                  {
-+                      FIELD23 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_intcrit219); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintcritEx;
-+                      }
-+                       
-+                      CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD23, NULL);
-+
-+                      FOLLOWPUSH(FOLLOW_intop_in_intcrit221);
-+                      intop24=intop(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintcritEx;
-+                      }
-+
-+                      CREATE_stream_intop; stream_intop->add(stream_intop, intop24.tree, NULL);
-+                      INT25 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_intcrit223); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintcritEx;
-+                      }
-+                       
-+                      CREATE_stream_INT; stream_INT->add(stream_INT, INT25, NULL);
-+
-+
-+                       
-+                      /* AST REWRITE
-+                       * elements          : FIELD, INT, intop
-+                       * token labels      : 
-+                       * rule labels       : retval
-+                       * token list labels : 
-+                       * rule list labels  : 
-+                       */
-+                      {
-+                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                              retval.tree    = root_0;
-+                              // 52:29: -> ^( intop FIELD INT )
-+                              {
-+                                  // RSP.g:52:32: ^( intop FIELD INT )
-+                                  {
-+                                      pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                                      root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_intop == NULL ? NULL : stream_intop->nextNode(stream_intop), root_1));
-+
-+                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
-+                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_INT == NULL ? NULL : stream_INT->nextNode(stream_INT));
-+
-+                                      ADAPTOR->addChild(ADAPTOR, root_0, root_1);
-+                                  }
-+
-+                              }
-+
-+                              retval.tree = root_0; // set result root
-+                              if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+                      }
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP.g:53:4: FIELD NOT intop INT
-+                  {
-+                      FIELD26 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_intcrit240); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintcritEx;
-+                      }
-+                       
-+                      CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD26, NULL);
-+
-+                      NOT27 = (pANTLR3_COMMON_TOKEN) MATCHT(NOT, &FOLLOW_NOT_in_intcrit242); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintcritEx;
-+                      }
-+                       
-+                      CREATE_stream_NOT; stream_NOT->add(stream_NOT, NOT27, NULL);
-+
-+                      FOLLOWPUSH(FOLLOW_intop_in_intcrit244);
-+                      intop28=intop(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintcritEx;
-+                      }
-+
-+                      CREATE_stream_intop; stream_intop->add(stream_intop, intop28.tree, NULL);
-+                      INT29 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_intcrit246); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintcritEx;
-+                      }
-+                       
-+                      CREATE_stream_INT; stream_INT->add(stream_INT, INT29, NULL);
-+
-+
-+                       
-+                      /* AST REWRITE
-+                       * elements          : intop, NOT, INT, FIELD
-+                       * token labels      : 
-+                       * rule labels       : retval
-+                       * token list labels : 
-+                       * rule list labels  : 
-+                       */
-+                      {
-+                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                              retval.tree    = root_0;
-+                              // 53:25: -> ^( NOT ^( intop FIELD INT ) )
-+                              {
-+                                  // RSP.g:53:28: ^( NOT ^( intop FIELD INT ) )
-+                                  {
-+                                      pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                                      root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_NOT == NULL ? NULL : stream_NOT->nextNode(stream_NOT), root_1));
-+
-+                                      // RSP.g:53:34: ^( intop FIELD INT )
-+                                      {
-+                                          pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                                          root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_intop == NULL ? NULL : stream_intop->nextNode(stream_intop), root_2));
-+
-+                                          ADAPTOR->addChild(ADAPTOR, root_2, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
-+                                          ADAPTOR->addChild(ADAPTOR, root_2, stream_INT == NULL ? NULL : stream_INT->nextNode(stream_INT));
-+
-+                                          ADAPTOR->addChild(ADAPTOR, root_1, root_2);
-+                                      }
-+
-+                                      ADAPTOR->addChild(ADAPTOR, root_0, root_1);
-+                                  }
-+
-+                              }
-+
-+                              retval.tree = root_0; // set result root
-+                              if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+                      }
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleintcritEx; /* Prevent compiler warnings */
-+    ruleintcritEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+        if (stream_FIELD != NULL) stream_FIELD->free(stream_FIELD);
-+        if (stream_INT != NULL) stream_INT->free(stream_INT);
-+        if (stream_NOT != NULL) stream_NOT->free(stream_NOT);
-+        if (stream_intop != NULL) stream_intop->free(stream_intop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end intcrit */
-+
-+/** 
-+ * $ANTLR start intop
-+ * RSP.g:56:1: intop : (equal= EQUAL | less= LESS | greater= GREATER | lte= LTE | gte= GTE );
-+ */
-+static RSPParser_intop_return
-+intop(pRSPParser ctx)
-+{   
-+    RSPParser_intop_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    equal;
-+    pANTLR3_COMMON_TOKEN    less;
-+    pANTLR3_COMMON_TOKEN    greater;
-+    pANTLR3_COMMON_TOKEN    lte;
-+    pANTLR3_COMMON_TOKEN    gte;
-+
-+    pANTLR3_BASE_TREE equal_tree;
-+    pANTLR3_BASE_TREE less_tree;
-+    pANTLR3_BASE_TREE greater_tree;
-+    pANTLR3_BASE_TREE lte_tree;
-+    pANTLR3_BASE_TREE gte_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    equal       = NULL;
-+    less       = NULL;
-+    greater       = NULL;
-+    lte       = NULL;
-+    gte       = NULL;
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    equal_tree   = NULL;
-+    less_tree   = NULL;
-+    greater_tree   = NULL;
-+    lte_tree   = NULL;
-+    gte_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        {
-+            //  RSP.g:56:7: (equal= EQUAL | less= LESS | greater= GREATER | lte= LTE | gte= GTE )
-+            
-+            ANTLR3_UINT32 alt8;
-+
-+            alt8=5;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case EQUAL:
-+              {
-+                      alt8=1;
-+              }
-+                break;
-+            case LESS:
-+              {
-+                      alt8=2;
-+              }
-+                break;
-+            case GREATER:
-+              {
-+                      alt8=3;
-+              }
-+                break;
-+            case LTE:
-+              {
-+                      alt8=4;
-+              }
-+                break;
-+            case GTE:
-+              {
-+                      alt8=5;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 8;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruleintopEx;
-+            }
-+
-+            switch (alt8) 
-+            {
-+              case 1:
-+                  // RSP.g:56:9: equal= EQUAL
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      equal = (pANTLR3_COMMON_TOKEN) MATCHT(EQUAL, &FOLLOW_EQUAL_in_intop273); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintopEx;
-+                      }
-+
-+                      equal_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, equal));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, equal_tree);
-+
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP.g:57:4: less= LESS
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      less = (pANTLR3_COMMON_TOKEN) MATCHT(LESS, &FOLLOW_LESS_in_intop280); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintopEx;
-+                      }
-+
-+                      less_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, less));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, less_tree);
-+
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // RSP.g:58:4: greater= GREATER
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      greater = (pANTLR3_COMMON_TOKEN) MATCHT(GREATER, &FOLLOW_GREATER_in_intop287); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintopEx;
-+                      }
-+
-+                      greater_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, greater));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, greater_tree);
-+
-+
-+                  }
-+                  break;
-+              case 4:
-+                  // RSP.g:59:4: lte= LTE
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      lte = (pANTLR3_COMMON_TOKEN) MATCHT(LTE, &FOLLOW_LTE_in_intop294); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintopEx;
-+                      }
-+
-+                      lte_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, lte));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, lte_tree);
-+
-+
-+                  }
-+                  break;
-+              case 5:
-+                  // RSP.g:60:4: gte= GTE
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      gte = (pANTLR3_COMMON_TOKEN) MATCHT(GTE, &FOLLOW_GTE_in_intop301); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleintopEx;
-+                      }
-+
-+                      gte_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, gte));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, gte_tree);
-+
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleintopEx; /* Prevent compiler warnings */
-+    ruleintopEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end intop */
-+
-+/** 
-+ * $ANTLR start datecrit
-+ * RSP.g:63:1: datecrit : FIELD dateop datespec -> ^( dateop FIELD datespec ) ;
-+ */
-+static RSPParser_datecrit_return
-+datecrit(pRSPParser ctx)
-+{   
-+    RSPParser_datecrit_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    FIELD30;
-+    RSPParser_dateop_return dateop31;
-+    #undef    RETURN_TYPE_dateop31
-+    #define   RETURN_TYPE_dateop31 RSPParser_dateop_return
-+
-+    RSPParser_datespec_return datespec32;
-+    #undef    RETURN_TYPE_datespec32
-+    #define   RETURN_TYPE_datespec32 RSPParser_datespec_return
-+
-+    pANTLR3_BASE_TREE FIELD30_tree;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_FIELD;
-+    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_datespec;
-+    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_dateop;
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    FIELD30       = NULL;
-+    dateop31.tree = NULL;
-+
-+    datespec32.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    FIELD30_tree   = NULL;
-+
-+    stream_FIELD   = NULL;
-+    #define CREATE_stream_FIELD  if (stream_FIELD == NULL) {stream_FIELD = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token FIELD"); } 
-+    stream_datespec   = NULL;
-+    #define CREATE_stream_datespec  if (stream_datespec == NULL) {stream_datespec = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule datespec"); }
-+    stream_dateop   = NULL;
-+    #define CREATE_stream_dateop  if (stream_dateop == NULL) {stream_dateop = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule dateop"); }
-+
-+    retval.tree  = NULL;
-+    {
-+        // RSP.g:63:9: ( FIELD dateop datespec -> ^( dateop FIELD datespec ) )
-+        // RSP.g:63:11: FIELD dateop datespec
-+        {
-+            FIELD30 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_datecrit310); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruledatecritEx;
-+            }
-+             
-+            CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD30, NULL);
-+
-+            FOLLOWPUSH(FOLLOW_dateop_in_datecrit312);
-+            dateop31=dateop(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruledatecritEx;
-+            }
-+
-+            CREATE_stream_dateop; stream_dateop->add(stream_dateop, dateop31.tree, NULL);
-+            FOLLOWPUSH(FOLLOW_datespec_in_datecrit314);
-+            datespec32=datespec(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruledatecritEx;
-+            }
-+
-+            CREATE_stream_datespec; stream_datespec->add(stream_datespec, datespec32.tree, NULL);
-+
-+             
-+            /* AST REWRITE
-+             * elements          : FIELD, dateop, datespec
-+             * token labels      : 
-+             * rule labels       : retval
-+             * token list labels : 
-+             * rule list labels  : 
-+             */
-+            {
-+              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+              retval.tree    = root_0;
-+              // 63:34: -> ^( dateop FIELD datespec )
-+              {
-+                  // RSP.g:63:37: ^( dateop FIELD datespec )
-+                  {
-+                      pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                      root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_dateop == NULL ? NULL : stream_dateop->nextNode(stream_dateop), root_1));
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_1, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
-+                      ADAPTOR->addChild(ADAPTOR, root_1, stream_datespec == NULL ? NULL : stream_datespec->nextTree(stream_datespec));
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, root_1);
-+                  }
-+
-+              }
-+
-+              retval.tree = root_0; // set result root
-+              if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+            }
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruledatecritEx; /* Prevent compiler warnings */
-+    ruledatecritEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+        if (stream_FIELD != NULL) stream_FIELD->free(stream_FIELD);
-+        if (stream_datespec != NULL) stream_datespec->free(stream_datespec);
-+        if (stream_dateop != NULL) stream_dateop->free(stream_dateop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end datecrit */
-+
-+/** 
-+ * $ANTLR start dateop
-+ * RSP.g:66:1: dateop : (before= BEFORE | after= AFTER );
-+ */
-+static RSPParser_dateop_return
-+dateop(pRSPParser ctx)
-+{   
-+    RSPParser_dateop_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    before;
-+    pANTLR3_COMMON_TOKEN    after;
-+
-+    pANTLR3_BASE_TREE before_tree;
-+    pANTLR3_BASE_TREE after_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    before       = NULL;
-+    after       = NULL;
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    before_tree   = NULL;
-+    after_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        {
-+            //  RSP.g:66:8: (before= BEFORE | after= AFTER )
-+            
-+            ANTLR3_UINT32 alt9;
-+
-+            alt9=2;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case BEFORE:
-+              {
-+                      alt9=1;
-+              }
-+                break;
-+            case AFTER:
-+              {
-+                      alt9=2;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 9;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruledateopEx;
-+            }
-+
-+            switch (alt9) 
-+            {
-+              case 1:
-+                  // RSP.g:66:10: before= BEFORE
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      before = (pANTLR3_COMMON_TOKEN) MATCHT(BEFORE, &FOLLOW_BEFORE_in_dateop337); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledateopEx;
-+                      }
-+
-+                      before_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, before));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, before_tree);
-+
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP.g:67:4: after= AFTER
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      after = (pANTLR3_COMMON_TOKEN) MATCHT(AFTER, &FOLLOW_AFTER_in_dateop344); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledateopEx;
-+                      }
-+
-+                      after_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, after));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, after_tree);
-+
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruledateopEx; /* Prevent compiler warnings */
-+    ruledateopEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end dateop */
-+
-+/** 
-+ * $ANTLR start datespec
-+ * RSP.g:70:1: datespec : ( dateref | INT dateintval dateop dateref -> ^( dateop dateref INT dateintval ) );
-+ */
-+static RSPParser_datespec_return
-+datespec(pRSPParser ctx)
-+{   
-+    RSPParser_datespec_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    INT34;
-+    RSPParser_dateref_return dateref33;
-+    #undef    RETURN_TYPE_dateref33
-+    #define   RETURN_TYPE_dateref33 RSPParser_dateref_return
-+
-+    RSPParser_dateintval_return dateintval35;
-+    #undef    RETURN_TYPE_dateintval35
-+    #define   RETURN_TYPE_dateintval35 RSPParser_dateintval_return
-+
-+    RSPParser_dateop_return dateop36;
-+    #undef    RETURN_TYPE_dateop36
-+    #define   RETURN_TYPE_dateop36 RSPParser_dateop_return
-+
-+    RSPParser_dateref_return dateref37;
-+    #undef    RETURN_TYPE_dateref37
-+    #define   RETURN_TYPE_dateref37 RSPParser_dateref_return
-+
-+    pANTLR3_BASE_TREE INT34_tree;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_INT;
-+    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_dateintval;
-+    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_dateref;
-+    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_dateop;
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    INT34       = NULL;
-+    dateref33.tree = NULL;
-+
-+    dateintval35.tree = NULL;
-+
-+    dateop36.tree = NULL;
-+
-+    dateref37.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    INT34_tree   = NULL;
-+
-+    stream_INT   = NULL;
-+    #define CREATE_stream_INT  if (stream_INT == NULL) {stream_INT = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token INT"); } 
-+    stream_dateintval   = NULL;
-+    #define CREATE_stream_dateintval  if (stream_dateintval == NULL) {stream_dateintval = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule dateintval"); }
-+    stream_dateref   = NULL;
-+    #define CREATE_stream_dateref  if (stream_dateref == NULL) {stream_dateref = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule dateref"); }
-+    stream_dateop   = NULL;
-+    #define CREATE_stream_dateop  if (stream_dateop == NULL) {stream_dateop = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule dateop"); }
-+
-+    retval.tree  = NULL;
-+    {
-+        {
-+            //  RSP.g:70:9: ( dateref | INT dateintval dateop dateref -> ^( dateop dateref INT dateintval ) )
-+            
-+            ANTLR3_UINT32 alt10;
-+
-+            alt10=2;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case DATE:
-+            case TODAY:
-+              {
-+                      alt10=1;
-+              }
-+                break;
-+            case INT:
-+              {
-+                      alt10=2;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 10;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruledatespecEx;
-+            }
-+
-+            switch (alt10) 
-+            {
-+              case 1:
-+                  // RSP.g:70:11: dateref
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      FOLLOWPUSH(FOLLOW_dateref_in_datespec353);
-+                      dateref33=dateref(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatespecEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, dateref33.tree);
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP.g:71:4: INT dateintval dateop dateref
-+                  {
-+                      INT34 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_datespec358); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatespecEx;
-+                      }
-+                       
-+                      CREATE_stream_INT; stream_INT->add(stream_INT, INT34, NULL);
-+
-+                      FOLLOWPUSH(FOLLOW_dateintval_in_datespec360);
-+                      dateintval35=dateintval(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatespecEx;
-+                      }
-+
-+                      CREATE_stream_dateintval; stream_dateintval->add(stream_dateintval, dateintval35.tree, NULL);
-+                      FOLLOWPUSH(FOLLOW_dateop_in_datespec362);
-+                      dateop36=dateop(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatespecEx;
-+                      }
-+
-+                      CREATE_stream_dateop; stream_dateop->add(stream_dateop, dateop36.tree, NULL);
-+                      FOLLOWPUSH(FOLLOW_dateref_in_datespec364);
-+                      dateref37=dateref(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatespecEx;
-+                      }
-+
-+                      CREATE_stream_dateref; stream_dateref->add(stream_dateref, dateref37.tree, NULL);
-+
-+                       
-+                      /* AST REWRITE
-+                       * elements          : dateop, INT, dateintval, dateref
-+                       * token labels      : 
-+                       * rule labels       : retval
-+                       * token list labels : 
-+                       * rule list labels  : 
-+                       */
-+                      {
-+                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                              retval.tree    = root_0;
-+                              // 71:34: -> ^( dateop dateref INT dateintval )
-+                              {
-+                                  // RSP.g:71:37: ^( dateop dateref INT dateintval )
-+                                  {
-+                                      pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                                      root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_dateop == NULL ? NULL : stream_dateop->nextNode(stream_dateop), root_1));
-+
-+                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_dateref == NULL ? NULL : stream_dateref->nextTree(stream_dateref));
-+                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_INT == NULL ? NULL : stream_INT->nextNode(stream_INT));
-+                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_dateintval == NULL ? NULL : stream_dateintval->nextTree(stream_dateintval));
-+
-+                                      ADAPTOR->addChild(ADAPTOR, root_0, root_1);
-+                                  }
-+
-+                              }
-+
-+                              retval.tree = root_0; // set result root
-+                              if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+                      }
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruledatespecEx; /* Prevent compiler warnings */
-+    ruledatespecEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+        if (stream_INT != NULL) stream_INT->free(stream_INT);
-+        if (stream_dateintval != NULL) stream_dateintval->free(stream_dateintval);
-+        if (stream_dateref != NULL) stream_dateref->free(stream_dateref);
-+        if (stream_dateop != NULL) stream_dateop->free(stream_dateop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end datespec */
-+
-+/** 
-+ * $ANTLR start dateref
-+ * RSP.g:74:1: dateref : (date= DATE | today= TODAY );
-+ */
-+static RSPParser_dateref_return
-+dateref(pRSPParser ctx)
-+{   
-+    RSPParser_dateref_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    date;
-+    pANTLR3_COMMON_TOKEN    today;
-+
-+    pANTLR3_BASE_TREE date_tree;
-+    pANTLR3_BASE_TREE today_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    date       = NULL;
-+    today       = NULL;
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    date_tree   = NULL;
-+    today_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        {
-+            //  RSP.g:74:9: (date= DATE | today= TODAY )
-+            
-+            ANTLR3_UINT32 alt11;
-+
-+            alt11=2;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case DATE:
-+              {
-+                      alt11=1;
-+              }
-+                break;
-+            case TODAY:
-+              {
-+                      alt11=2;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 11;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruledaterefEx;
-+            }
-+
-+            switch (alt11) 
-+            {
-+              case 1:
-+                  // RSP.g:74:11: date= DATE
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      date = (pANTLR3_COMMON_TOKEN) MATCHT(DATE, &FOLLOW_DATE_in_dateref388); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledaterefEx;
-+                      }
-+
-+                      date_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, date));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, date_tree);
-+
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP.g:75:4: today= TODAY
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      today = (pANTLR3_COMMON_TOKEN) MATCHT(TODAY, &FOLLOW_TODAY_in_dateref395); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledaterefEx;
-+                      }
-+
-+                      today_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, today));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, today_tree);
-+
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruledaterefEx; /* Prevent compiler warnings */
-+    ruledaterefEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end dateref */
-+
-+/** 
-+ * $ANTLR start dateintval
-+ * RSP.g:78:1: dateintval : (day= DAY | week= WEEK | month= MONTH | year= YEAR );
-+ */
-+static RSPParser_dateintval_return
-+dateintval(pRSPParser ctx)
-+{   
-+    RSPParser_dateintval_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    day;
-+    pANTLR3_COMMON_TOKEN    week;
-+    pANTLR3_COMMON_TOKEN    month;
-+    pANTLR3_COMMON_TOKEN    year;
-+
-+    pANTLR3_BASE_TREE day_tree;
-+    pANTLR3_BASE_TREE week_tree;
-+    pANTLR3_BASE_TREE month_tree;
-+    pANTLR3_BASE_TREE year_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    day       = NULL;
-+    week       = NULL;
-+    month       = NULL;
-+    year       = NULL;
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    day_tree   = NULL;
-+    week_tree   = NULL;
-+    month_tree   = NULL;
-+    year_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        {
-+            //  RSP.g:79:2: (day= DAY | week= WEEK | month= MONTH | year= YEAR )
-+            
-+            ANTLR3_UINT32 alt12;
-+
-+            alt12=4;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case DAY:
-+              {
-+                      alt12=1;
-+              }
-+                break;
-+            case WEEK:
-+              {
-+                      alt12=2;
-+              }
-+                break;
-+            case MONTH:
-+              {
-+                      alt12=3;
-+              }
-+                break;
-+            case YEAR:
-+              {
-+                      alt12=4;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 12;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruledateintvalEx;
-+            }
-+
-+            switch (alt12) 
-+            {
-+              case 1:
-+                  // RSP.g:79:4: day= DAY
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      day = (pANTLR3_COMMON_TOKEN) MATCHT(DAY, &FOLLOW_DAY_in_dateintval408); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledateintvalEx;
-+                      }
-+
-+                      day_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, day));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, day_tree);
-+
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // RSP.g:80:4: week= WEEK
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      week = (pANTLR3_COMMON_TOKEN) MATCHT(WEEK, &FOLLOW_WEEK_in_dateintval415); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledateintvalEx;
-+                      }
-+
-+                      week_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, week));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, week_tree);
-+
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // RSP.g:81:4: month= MONTH
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      month = (pANTLR3_COMMON_TOKEN) MATCHT(MONTH, &FOLLOW_MONTH_in_dateintval422); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledateintvalEx;
-+                      }
-+
-+                      month_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, month));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, month_tree);
-+
-+
-+                  }
-+                  break;
-+              case 4:
-+                  // RSP.g:82:4: year= YEAR
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      year = (pANTLR3_COMMON_TOKEN) MATCHT(YEAR, &FOLLOW_YEAR_in_dateintval429); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledateintvalEx;
-+                      }
-+
-+                      year_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, year));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, year_tree);
-+
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruledateintvalEx; /* Prevent compiler warnings */
-+    ruledateintvalEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end dateintval */
-+/* End of parsing rules
-+ * ==============================================
-+ */
-+
-+/* ==============================================
-+ * Syntactic predicates
-+ */
-+/* End of syntactic predicates
-+ * ==============================================
-+ */
-+
-+ 
-+ 
-+
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/RSPParser.h b/src/pregen/RSPParser.h
-new file mode 100644
-index 0000000..1796c0a
---- /dev/null
-+++ b/src/pregen/RSPParser.h
-@@ -0,0 +1,365 @@
-+/** \file
-+ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : RSP.g
-+ *     -                            On : 2016-01-01 12:23:42
-+ *     -                for the parser : RSPParserParser *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The parser RSPParser has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ * 
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pRSPParser, which is returned from a call to RSPParserNew().
-+ *
-+ * The methods in pRSPParser are  as follows:
-+ *
-+ *  - RSPParser_query_return      pRSPParser->query(pRSPParser)
-+ *  - RSPParser_expr_return      pRSPParser->expr(pRSPParser)
-+ *  - RSPParser_aexpr_return      pRSPParser->aexpr(pRSPParser)
-+ *  - RSPParser_crit_return      pRSPParser->crit(pRSPParser)
-+ *  - RSPParser_strcrit_return      pRSPParser->strcrit(pRSPParser)
-+ *  - RSPParser_strop_return      pRSPParser->strop(pRSPParser)
-+ *  - RSPParser_intcrit_return      pRSPParser->intcrit(pRSPParser)
-+ *  - RSPParser_intop_return      pRSPParser->intop(pRSPParser)
-+ *  - RSPParser_datecrit_return      pRSPParser->datecrit(pRSPParser)
-+ *  - RSPParser_dateop_return      pRSPParser->dateop(pRSPParser)
-+ *  - RSPParser_datespec_return      pRSPParser->datespec(pRSPParser)
-+ *  - RSPParser_dateref_return      pRSPParser->dateref(pRSPParser)
-+ *  - RSPParser_dateintval_return      pRSPParser->dateintval(pRSPParser)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+#ifndef       _RSPParser_H
-+#define _RSPParser_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include    <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+ 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct RSPParser_Ctx_struct RSPParser, * pRSPParser;
-+
-+
-+
-+#ifdef        ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
-+//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
-+//          initialized but unused variable                                   - tree rewrite variables declared but not needed
-+//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
-+//          potentially unitialized variable used                     - retval always returned from a rule 
-+//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+typedef struct RSPParser_query_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    RSPParser_query_return;
-+
-+typedef struct RSPParser_expr_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    RSPParser_expr_return;
-+
-+typedef struct RSPParser_aexpr_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    RSPParser_aexpr_return;
-+
-+typedef struct RSPParser_crit_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    RSPParser_crit_return;
-+
-+typedef struct RSPParser_strcrit_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    RSPParser_strcrit_return;
-+
-+typedef struct RSPParser_strop_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    RSPParser_strop_return;
-+
-+typedef struct RSPParser_intcrit_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    RSPParser_intcrit_return;
-+
-+typedef struct RSPParser_intop_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    RSPParser_intop_return;
-+
-+typedef struct RSPParser_datecrit_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    RSPParser_datecrit_return;
-+
-+typedef struct RSPParser_dateop_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    RSPParser_dateop_return;
-+
-+typedef struct RSPParser_datespec_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    RSPParser_datespec_return;
-+
-+typedef struct RSPParser_dateref_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    RSPParser_dateref_return;
-+
-+typedef struct RSPParser_dateintval_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    RSPParser_dateintval_return;
-+
-+
-+
-+/** Context tracking structure for RSPParser
-+ */
-+struct RSPParser_Ctx_struct
-+{
-+    /** Built in ANTLR3 context tracker contains all the generic elements
-+     *  required for context tracking.
-+     */
-+    pANTLR3_PARSER   pParser;
-+
-+
-+     RSPParser_query_return (*query)  (struct RSPParser_Ctx_struct * ctx);
-+     RSPParser_expr_return (*expr)    (struct RSPParser_Ctx_struct * ctx);
-+     RSPParser_aexpr_return (*aexpr)  (struct RSPParser_Ctx_struct * ctx);
-+     RSPParser_crit_return (*crit)    (struct RSPParser_Ctx_struct * ctx);
-+     RSPParser_strcrit_return (*strcrit)      (struct RSPParser_Ctx_struct * ctx);
-+     RSPParser_strop_return (*strop)  (struct RSPParser_Ctx_struct * ctx);
-+     RSPParser_intcrit_return (*intcrit)      (struct RSPParser_Ctx_struct * ctx);
-+     RSPParser_intop_return (*intop)  (struct RSPParser_Ctx_struct * ctx);
-+     RSPParser_datecrit_return (*datecrit)    (struct RSPParser_Ctx_struct * ctx);
-+     RSPParser_dateop_return (*dateop)        (struct RSPParser_Ctx_struct * ctx);
-+     RSPParser_datespec_return (*datespec)    (struct RSPParser_Ctx_struct * ctx);
-+     RSPParser_dateref_return (*dateref)      (struct RSPParser_Ctx_struct * ctx);
-+     RSPParser_dateintval_return (*dateintval)        (struct RSPParser_Ctx_struct * ctx);
-+    // Delegated rules
-+    const char * (*getGrammarFileName)();
-+    void          (*free)   (struct RSPParser_Ctx_struct * ctx);
-+    /* @headerFile.members() */
-+    pANTLR3_BASE_TREE_ADAPTOR adaptor;
-+    pANTLR3_VECTOR_FACTORY            vectors;
-+    /* End @headerFile.members() */
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pRSPParser RSPParserNew         (pANTLR3_COMMON_TOKEN_STREAM instream);
-+ANTLR3_API pRSPParser RSPParserNewSSD      (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the parser will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef        EOF
-+#undef        EOF
-+#endif
-+#ifdef        Tokens
-+#undef        Tokens
-+#endif 
-+#define STARTSW      14
-+#define WEEK      26
-+#define TODAY      24
-+#define YEAR      28
-+#define ENDSW      15
-+#define GTE      20
-+#define BEFORE      21
-+#define DAY      25
-+#define INT      16
-+#define NOT      11
-+#define AFTER      22
-+#define AND      6
-+#define EOF      -1
-+#define LTE      19
-+#define MONTH      27
-+#define DIGIT19      31
-+#define INCLUDES      13
-+#define STR      10
-+#define QUOTE      29
-+#define WS      30
-+#define GREATER      18
-+#define NEWLINE      4
-+#define LPAR      7
-+#define EQUAL      12
-+#define OR      5
-+#define LESS      17
-+#define RPAR      8
-+#define FIELD      9
-+#define ESCAPED      33
-+#define DATE      23
-+#define DIGIT09      32
-+#ifdef        EOF
-+#undef        EOF
-+#define       EOF     ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for RSPParser
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/SMARTPL.u b/src/pregen/SMARTPL.u
-new file mode 100644
-index 0000000..2a66bf3
---- /dev/null
-+++ b/src/pregen/SMARTPL.u
-@@ -0,0 +1,6 @@
-+SMARTPLParser.c : SMARTPL.g
-+./SMARTPL.tokens : SMARTPL.g
-+SMARTPLParser.h : SMARTPL.g
-+SMARTPLLexer.c : SMARTPL.g
-+SMARTPLLexer.h : SMARTPL.g
-+ANTLR_PRODUCTS += SMARTPLParser.c ./SMARTPL.tokens SMARTPLParser.h SMARTPLLexer.c SMARTPLLexer.h 
-\ No newline at end of file
-diff --git a/src/pregen/SMARTPL2SQL.c b/src/pregen/SMARTPL2SQL.c
-new file mode 100644
-index 0000000..bd93752
---- /dev/null
-+++ b/src/pregen/SMARTPL2SQL.c
-@@ -0,0 +1,1649 @@
-+/** \file
-+ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : SMARTPL2SQL.g
-+ *     -                            On : 2016-01-01 12:23:44
-+ *     -           for the tree parser : SMARTPL2SQLTreeParser *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+
-+/* =============================================================================
-+ * This is what the grammar programmer asked us to put at the top of every file.
-+ */
-+
-+      #include <stdio.h>
-+      #include <stdlib.h>
-+      #include <string.h>
-+      #include <limits.h>
-+      #include <errno.h>
-+      #include <time.h>
-+      #include <sqlite3.h>
-+
-+      #include "logger.h"
-+      #include "db.h"
-+
-+/* End of Header action.
-+ * =============================================================================
-+ */
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include    "SMARTPL2SQL.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+ 
-+#define               CTX     ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef        SCOPE_TYPE
-+#undef        SCOPE_STACK
-+#undef        SCOPE_TOP
-+#define       SCOPE_TYPE(scope)   pSMARTPL2SQL_##scope##_SCOPE
-+#define SCOPE_STACK(scope)  pSMARTPL2SQL_##scope##Stack
-+#define       SCOPE_TOP(scope)    ctx->pSMARTPL2SQL_##scope##Top
-+#define       SCOPE_SIZE(scope)               ctx->pSMARTPL2SQL_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+/* Macros for accessing things in the parser
-+ */
-+ 
-+#undef            PARSER
-+#undef            RECOGNIZER              
-+#undef            HAVEPARSEDRULE
-+#undef            INPUT
-+#undef            STRSTREAM
-+#undef            HASEXCEPTION
-+#undef            EXCEPTION
-+#undef            MATCHT
-+#undef            MATCHANYT
-+#undef            FOLLOWSTACK
-+#undef            FOLLOWPUSH
-+#undef            FOLLOWPOP
-+#undef            PRECOVER
-+#undef            PREPORTERROR
-+#undef            LA
-+#undef            LT
-+#undef            CONSTRUCTEX
-+#undef            CONSUME
-+#undef            MARK
-+#undef            REWIND
-+#undef            REWINDLAST
-+#undef            PERRORRECOVERY
-+#undef            HASFAILED
-+#undef            FAILEDFLAG
-+#undef            RECOVERFROMMISMATCHEDSET
-+#undef            RECOVERFROMMISMATCHEDELEMENT
-+#undef            BACKTRACKING
-+#undef      ADAPTOR
-+#undef            RULEMEMO            
-+#undef                SEEK    
-+#undef                INDEX
-+#undef                DBG
-+
-+#define           PARSER                                                      ctx->pTreeParser  
-+#define           RECOGNIZER                                          PARSER->rec
-+#define               PSRSTATE                                                RECOGNIZER->state
-+#define           HAVEPARSEDRULE(r)                           RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define           INPUT                                                       PARSER->ctnstream
-+#define               ISTREAM                                                 INPUT->tnstream->istream
-+#define           STRSTREAM                                           INPUT->tnstream
-+#define           HASEXCEPTION()                                      (PSRSTATE->error == ANTLR3_TRUE)
-+#define           EXCEPTION                                           PSRSTATE->exception
-+#define           MATCHT(t, fs)                                       RECOGNIZER->match(RECOGNIZER, t, fs)
-+#define           MATCHANYT()                                         RECOGNIZER->matchAny(RECOGNIZER)
-+#define           FOLLOWSTACK                                     PSRSTATE->following
-+#define           FOLLOWPUSH(x)                                       FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
-+#define           FOLLOWPOP()                                         FOLLOWSTACK->pop(FOLLOWSTACK)
-+#define           PRECOVER()                                          RECOGNIZER->recover(RECOGNIZER)
-+#define           PREPORTERROR()                                      RECOGNIZER->reportError(RECOGNIZER)
-+#define           LA(n)                                                       ISTREAM->_LA(ISTREAM, n)
-+#define           LT(n)                                                       INPUT->tnstream->_LT(INPUT->tnstream, n)
-+#define           CONSTRUCTEX()                                       RECOGNIZER->exConstruct(RECOGNIZER)
-+#define           CONSUME()                                           ISTREAM->consume(ISTREAM)
-+#define           MARK()                                                      ISTREAM->mark(ISTREAM)
-+#define           REWIND(m)                                           ISTREAM->rewind(ISTREAM, m)
-+#define           REWINDLAST()                                        ISTREAM->rewindLast(ISTREAM)
-+#define           PERRORRECOVERY                                      PSRSTATE->errorRecovery
-+#define           FAILEDFLAG                                          PSRSTATE->failed
-+#define           HASFAILED()                                         (FAILEDFLAG == ANTLR3_TRUE)
-+#define           BACKTRACKING                                        PSRSTATE->backtracking
-+#define           RECOVERFROMMISMATCHEDSET(s)         RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
-+#define           RECOVERFROMMISMATCHEDELEMENT(e)     RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
-+#define     ADAPTOR                         INPUT->adaptor
-+#define               RULEMEMO                                                PSRSTATE->ruleMemo
-+#define               SEEK(n)                                                 ISTREAM->seek(ISTREAM, n)
-+#define               INDEX()                                                 ISTREAM->index(ISTREAM)
-+#define               DBG                                                             RECOGNIZER->debugger
-+
-+
-+#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define           UP      ANTLR3_TOKEN_UP
-+#define           DOWN    ANTLR3_TOKEN_DOWN
-+#define           EOR     ANTLR3_TOKEN_EOR
-+#define           INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+
-+/** \brief Table of all token names in symbolic order, mainly used for
-+ *         error reporting.
-+ */
-+pANTLR3_UINT8   SMARTPL2SQLTokenNames[28+4]
-+     = {
-+        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
-+        (pANTLR3_UINT8) "<EOR>",
-+        (pANTLR3_UINT8) "<DOWN>", 
-+        (pANTLR3_UINT8) "<UP>", 
-+        (pANTLR3_UINT8) "STR",
-+        (pANTLR3_UINT8) "OR",
-+        (pANTLR3_UINT8) "AND",
-+        (pANTLR3_UINT8) "NOT",
-+        (pANTLR3_UINT8) "LPAR",
-+        (pANTLR3_UINT8) "RPAR",
-+        (pANTLR3_UINT8) "STRTAG",
-+        (pANTLR3_UINT8) "INCLUDES",
-+        (pANTLR3_UINT8) "IS",
-+        (pANTLR3_UINT8) "INTTAG",
-+        (pANTLR3_UINT8) "INTBOOL",
-+        (pANTLR3_UINT8) "INT",
-+        (pANTLR3_UINT8) "DATETAG",
-+        (pANTLR3_UINT8) "AFTER",
-+        (pANTLR3_UINT8) "BEFORE",
-+        (pANTLR3_UINT8) "ENUMTAG",
-+        (pANTLR3_UINT8) "ENUMVAL",
-+        (pANTLR3_UINT8) "DATE",
-+        (pANTLR3_UINT8) "AGO",
-+        (pANTLR3_UINT8) "DATINTERVAL",
-+        (pANTLR3_UINT8) "GREATER",
-+        (pANTLR3_UINT8) "GREATEREQUAL",
-+        (pANTLR3_UINT8) "LESS",
-+        (pANTLR3_UINT8) "LESSEQUAL",
-+        (pANTLR3_UINT8) "EQUAL",
-+        (pANTLR3_UINT8) "WHITESPACE",
-+        (pANTLR3_UINT8) "'{'",
-+        (pANTLR3_UINT8) "'}'"
-+       };
-+
-+        
-+
-+// Forward declare the locally static matching functions we have generated.
-+//
-+static SMARTPL2SQL_playlist_return    playlist    (pSMARTPL2SQL ctx);
-+static pANTLR3_STRING expression    (pSMARTPL2SQL ctx);
-+static int    dateval    (pSMARTPL2SQL ctx);
-+static int    interval    (pSMARTPL2SQL ctx);
-+static void   SMARTPL2SQLFree(pSMARTPL2SQL ctx);
-+/* For use in tree output where we are accumulating rule labels via label += ruleRef
-+ * we need a function that knows how to free a return scope when the list is destroyed. 
-+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
-+ */
-+static        void ANTLR3_CDECL freeScope(void * scope)
-+{
-+    ANTLR3_FREE(scope);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "SMARTPL2SQL.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+      return fileName;
-+}
-+/** \brief Create a new SMARTPL2SQL parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pSMARTPL2SQL
-+SMARTPL2SQLNew   (pANTLR3_COMMON_TREE_NODE_STREAM instream)
-+{
-+      // See if we can create a new parser with the standard constructor
-+      //
-+      return SMARTPL2SQLNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new SMARTPL2SQL parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pSMARTPL2SQL
-+SMARTPL2SQLNewSSD   (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+    pSMARTPL2SQL ctx;     /* Context structure we will build and return   */
-+    
-+    ctx       = (pSMARTPL2SQL) ANTLR3_CALLOC(1, sizeof(SMARTPL2SQL));
-+    
-+    if        (ctx == NULL)
-+    {
-+              // Failed to allocate memory for parser context
-+              //
-+        return  NULL;
-+    }
-+    
-+    /* -------------------------------------------------------------------
-+     * Memory for basic structure is allocated, now to fill in
-+     * the base ANTLR3 structures. We initialize the function pointers
-+     * for the standard ANTLR3 parser function set, but upon return
-+     * from here, the programmer may set the pointers to provide custom
-+     * implementations of each function. 
-+     *
-+     * We don't use the macros defined in SMARTPL2SQL.h here, in order that you can get a sense
-+     * of what goes where.
-+     */
-+
-+    /* Create a base Tree parser/recognizer, using the supplied tree node stream
-+     */
-+    ctx->pTreeParser          = antlr3TreeParserNewStream(ANTLR3_SIZE_HINT, instream, state);
-+    /* Install the implementation of our SMARTPL2SQL interface
-+     */
-+    ctx->playlist     = playlist;
-+    ctx->expression   = expression;
-+    ctx->dateval      = dateval;
-+    ctx->interval     = interval;
-+    ctx->free                 = SMARTPL2SQLFree;
-+    ctx->getGrammarFileName   = getGrammarFileName;
-+    
-+    /* Install the scope pushing methods.
-+     */
-+
-+        
-+    
-+
-+      
-+    /* Install the token table
-+     */
-+    PSRSTATE->tokenNames   = SMARTPL2SQLTokenNames;
-+    
-+    
-+    /* Return the newly built parser to the caller
-+     */
-+    return  ctx;
-+}
-+
-+/** Free the parser resources
-+ */
-+ static void
-+ SMARTPL2SQLFree(pSMARTPL2SQL ctx)
-+ {
-+    /* Free any scope memory
-+     */
-+    
-+        
-+      // Free this parser
-+      //
-+    ctx->pTreeParser->free(ctx->pTreeParser);
-+    ANTLR3_FREE(ctx);
-+
-+    /* Everything is released, so we can return
-+     */
-+    return;
-+ }
-+ 
-+/** Return token names used by this tree parser
-+ *
-+ * The returned pointer is used as an index into the token names table (using the token 
-+ * number as the index).
-+ * 
-+ * \return Pointer to first char * in the table.
-+ */
-+static pANTLR3_UINT8    *getTokenNames() 
-+{
-+        return SMARTPL2SQLTokenNames; 
-+}
-+
-+
-+
-+    
-+/* Declare the bitsets
-+ */
-+
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_playlist66  */
-+static        ANTLR3_BITWORD FOLLOW_STR_in_playlist66_bits[]  = { ANTLR3_UINT64_LIT(0x0000000040000000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STR_in_playlist66   = { FOLLOW_STR_in_playlist66_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_30_in_playlist68  */
-+static        ANTLR3_BITWORD FOLLOW_30_in_playlist68_bits[]   = { ANTLR3_UINT64_LIT(0x00000000000924E0) };
-+static  ANTLR3_BITSET_LIST FOLLOW_30_in_playlist68    = { FOLLOW_30_in_playlist68_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_playlist74  */
-+static        ANTLR3_BITWORD FOLLOW_expression_in_playlist74_bits[]   = { ANTLR3_UINT64_LIT(0x0000000080000000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expression_in_playlist74    = { FOLLOW_expression_in_playlist74_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_31_in_playlist76  */
-+static        ANTLR3_BITWORD FOLLOW_31_in_playlist76_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_31_in_playlist76    = { FOLLOW_31_in_playlist76_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_expression101  */
-+static        ANTLR3_BITWORD FOLLOW_NOT_in_expression101_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static  ANTLR3_BITSET_LIST FOLLOW_NOT_in_expression101        = { FOLLOW_NOT_in_expression101_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression107  */
-+static        ANTLR3_BITWORD FOLLOW_expression_in_expression107_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expression_in_expression107 = { FOLLOW_expression_in_expression107_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AND_in_expression118  */
-+static        ANTLR3_BITWORD FOLLOW_AND_in_expression118_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static  ANTLR3_BITSET_LIST FOLLOW_AND_in_expression118        = { FOLLOW_AND_in_expression118_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression124  */
-+static        ANTLR3_BITWORD FOLLOW_expression_in_expression124_bits[]        = { ANTLR3_UINT64_LIT(0x00000000000924E0) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expression_in_expression124 = { FOLLOW_expression_in_expression124_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression130  */
-+static        ANTLR3_BITWORD FOLLOW_expression_in_expression130_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expression_in_expression130 = { FOLLOW_expression_in_expression130_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OR_in_expression141  */
-+static        ANTLR3_BITWORD FOLLOW_OR_in_expression141_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static  ANTLR3_BITSET_LIST FOLLOW_OR_in_expression141 = { FOLLOW_OR_in_expression141_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression147  */
-+static        ANTLR3_BITWORD FOLLOW_expression_in_expression147_bits[]        = { ANTLR3_UINT64_LIT(0x00000000000924E0) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expression_in_expression147 = { FOLLOW_expression_in_expression147_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression153  */
-+static        ANTLR3_BITWORD FOLLOW_expression_in_expression153_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expression_in_expression153 = { FOLLOW_expression_in_expression153_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRTAG_in_expression163  */
-+static        ANTLR3_BITWORD FOLLOW_STRTAG_in_expression163_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000800) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STRTAG_in_expression163     = { FOLLOW_STRTAG_in_expression163_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCLUDES_in_expression165  */
-+static        ANTLR3_BITWORD FOLLOW_INCLUDES_in_expression165_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000010) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INCLUDES_in_expression165   = { FOLLOW_INCLUDES_in_expression165_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_expression167  */
-+static        ANTLR3_BITWORD FOLLOW_STR_in_expression167_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STR_in_expression167        = { FOLLOW_STR_in_expression167_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRTAG_in_expression176  */
-+static        ANTLR3_BITWORD FOLLOW_STRTAG_in_expression176_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000001000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STRTAG_in_expression176     = { FOLLOW_STRTAG_in_expression176_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_IS_in_expression178  */
-+static        ANTLR3_BITWORD FOLLOW_IS_in_expression178_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000010) };
-+static  ANTLR3_BITSET_LIST FOLLOW_IS_in_expression178 = { FOLLOW_IS_in_expression178_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_expression180  */
-+static        ANTLR3_BITWORD FOLLOW_STR_in_expression180_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STR_in_expression180        = { FOLLOW_STR_in_expression180_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTTAG_in_expression189  */
-+static        ANTLR3_BITWORD FOLLOW_INTTAG_in_expression189_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000004000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INTTAG_in_expression189     = { FOLLOW_INTTAG_in_expression189_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTBOOL_in_expression191  */
-+static        ANTLR3_BITWORD FOLLOW_INTBOOL_in_expression191_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000008000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INTBOOL_in_expression191    = { FOLLOW_INTBOOL_in_expression191_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_expression193  */
-+static        ANTLR3_BITWORD FOLLOW_INT_in_expression193_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INT_in_expression193        = { FOLLOW_INT_in_expression193_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATETAG_in_expression202  */
-+static        ANTLR3_BITWORD FOLLOW_DATETAG_in_expression202_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000020000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DATETAG_in_expression202    = { FOLLOW_DATETAG_in_expression202_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_expression204  */
-+static        ANTLR3_BITWORD FOLLOW_AFTER_in_expression204_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000208000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_AFTER_in_expression204      = { FOLLOW_AFTER_in_expression204_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateval_in_expression206  */
-+static        ANTLR3_BITWORD FOLLOW_dateval_in_expression206_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_dateval_in_expression206    = { FOLLOW_dateval_in_expression206_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATETAG_in_expression215  */
-+static        ANTLR3_BITWORD FOLLOW_DATETAG_in_expression215_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000040000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DATETAG_in_expression215    = { FOLLOW_DATETAG_in_expression215_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_expression217  */
-+static        ANTLR3_BITWORD FOLLOW_BEFORE_in_expression217_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000208000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_expression217     = { FOLLOW_BEFORE_in_expression217_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateval_in_expression219  */
-+static        ANTLR3_BITWORD FOLLOW_dateval_in_expression219_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_dateval_in_expression219    = { FOLLOW_dateval_in_expression219_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENUMTAG_in_expression228  */
-+static        ANTLR3_BITWORD FOLLOW_ENUMTAG_in_expression228_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000001000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_ENUMTAG_in_expression228    = { FOLLOW_ENUMTAG_in_expression228_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_IS_in_expression230  */
-+static        ANTLR3_BITWORD FOLLOW_IS_in_expression230_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000100000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_IS_in_expression230 = { FOLLOW_IS_in_expression230_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENUMVAL_in_expression232  */
-+static        ANTLR3_BITWORD FOLLOW_ENUMVAL_in_expression232_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_ENUMVAL_in_expression232    = { FOLLOW_ENUMVAL_in_expression232_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval257  */
-+static        ANTLR3_BITWORD FOLLOW_DATE_in_dateval257_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval257  = { FOLLOW_DATE_in_dateval257_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval266  */
-+static        ANTLR3_BITWORD FOLLOW_interval_in_dateval266_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000040000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval266      = { FOLLOW_interval_in_dateval266_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_dateval268  */
-+static        ANTLR3_BITWORD FOLLOW_BEFORE_in_dateval268_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000200000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_dateval268        = { FOLLOW_BEFORE_in_dateval268_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval270  */
-+static        ANTLR3_BITWORD FOLLOW_DATE_in_dateval270_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval270  = { FOLLOW_DATE_in_dateval270_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval279  */
-+static        ANTLR3_BITWORD FOLLOW_interval_in_dateval279_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000020000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval279      = { FOLLOW_interval_in_dateval279_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_dateval281  */
-+static        ANTLR3_BITWORD FOLLOW_AFTER_in_dateval281_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000200000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_AFTER_in_dateval281 = { FOLLOW_AFTER_in_dateval281_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval283  */
-+static        ANTLR3_BITWORD FOLLOW_DATE_in_dateval283_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval283  = { FOLLOW_DATE_in_dateval283_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval292  */
-+static        ANTLR3_BITWORD FOLLOW_interval_in_dateval292_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000400000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval292      = { FOLLOW_interval_in_dateval292_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AGO_in_dateval294  */
-+static        ANTLR3_BITWORD FOLLOW_AGO_in_dateval294_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_AGO_in_dateval294   = { FOLLOW_AGO_in_dateval294_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_interval318  */
-+static        ANTLR3_BITWORD FOLLOW_INT_in_interval318_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INT_in_interval318  = { FOLLOW_INT_in_interval318_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATINTERVAL_in_interval320  */
-+static        ANTLR3_BITWORD FOLLOW_DATINTERVAL_in_interval320_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DATINTERVAL_in_interval320  = { FOLLOW_DATINTERVAL_in_interval320_bits, 1   };
-+     
-+
-+ 
-+ 
-+/* ==============================================
-+ * Parsing rules
-+ */
-+/** 
-+ * $ANTLR start playlist
-+ * SMARTPL2SQL.g:43:1: playlist returns [ pANTLR3_STRING title, pANTLR3_STRING query ] : STR '{' e= expression '}' ;
-+ */
-+static SMARTPL2SQL_playlist_return
-+playlist(pSMARTPL2SQL ctx)
-+{   
-+    SMARTPL2SQL_playlist_return retval;
-+
-+    pANTLR3_BASE_TREE    STR1;
-+    pANTLR3_STRING e;
-+    #undef    RETURN_TYPE_e
-+    #define   RETURN_TYPE_e pANTLR3_STRING
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     retval.title= NULL; retval.query= NULL; 
-+    STR1       = NULL;
-+    e = NULL;
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    {
-+        // SMARTPL2SQL.g:45:2: ( STR '{' e= expression '}' )
-+        // SMARTPL2SQL.g:45:4: STR '{' e= expression '}'
-+        {
-+            STR1 = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_playlist66); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleplaylistEx;
-+            }
-+
-+             MATCHT(30, &FOLLOW_30_in_playlist68); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleplaylistEx;
-+            }
-+
-+            FOLLOWPUSH(FOLLOW_expression_in_playlist74);
-+            e=expression(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleplaylistEx;
-+            }
-+
-+             MATCHT(31, &FOLLOW_31_in_playlist76); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleplaylistEx;
-+            }
-+
-+            {
-+
-+                                      pANTLR3_UINT8 val;
-+                                      val = (STR1->getText(STR1))->toUTF8((STR1->getText(STR1)))->chars;
-+                                      val++;
-+                                      val[strlen((const char *)val) - 1] = '\0';
-+                                      
-+                                      retval.title= (STR1->getText(STR1))->factory->newRaw((STR1->getText(STR1))->factory);
-+                                      retval.title->append8(retval.title, (const char *)val);
-+                                      
-+                                      retval.query= e->factory->newRaw(e->factory);
-+                                      retval.query->append8(retval.query, "(");
-+                                      retval.query->appendS(retval.query, e);
-+                                      retval.query->append8(retval.query, ")");
-+                              
-+            }
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleplaylistEx; /* Prevent compiler warnings */
-+    ruleplaylistEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end playlist */
-+
-+/** 
-+ * $ANTLR start expression
-+ * SMARTPL2SQL.g:62:1: expression returns [ pANTLR3_STRING result ] : ( ^( NOT a= expression ) | ^( AND a= expression b= expression ) | ^( OR a= expression b= expression ) | STRTAG INCLUDES STR | STRTAG IS STR | INTTAG INTBOOL INT | DATETAG AFTER dateval | DATETAG BEFORE dateval | ENUMTAG IS ENUMVAL );
-+ */
-+static pANTLR3_STRING
-+expression(pSMARTPL2SQL ctx)
-+{   
-+    pANTLR3_STRING result = NULL;
-+
-+    pANTLR3_BASE_TREE    STR2;
-+    pANTLR3_BASE_TREE    STRTAG3;
-+    pANTLR3_BASE_TREE    STR4;
-+    pANTLR3_BASE_TREE    STRTAG5;
-+    pANTLR3_BASE_TREE    INTTAG6;
-+    pANTLR3_BASE_TREE    INTBOOL7;
-+    pANTLR3_BASE_TREE    INT8;
-+    pANTLR3_BASE_TREE    DATETAG10;
-+    pANTLR3_BASE_TREE    DATETAG12;
-+    pANTLR3_BASE_TREE    ENUMTAG13;
-+    pANTLR3_BASE_TREE    ENUMVAL14;
-+    pANTLR3_STRING a;
-+    #undef    RETURN_TYPE_a
-+    #define   RETURN_TYPE_a pANTLR3_STRING
-+
-+    pANTLR3_STRING b;
-+    #undef    RETURN_TYPE_b
-+    #define   RETURN_TYPE_b pANTLR3_STRING
-+
-+    int dateval9;
-+    #undef    RETURN_TYPE_dateval9
-+    #define   RETURN_TYPE_dateval9 int
-+
-+    int dateval11;
-+    #undef    RETURN_TYPE_dateval11
-+    #define   RETURN_TYPE_dateval11 int
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     result= NULL; 
-+    STR2       = NULL;
-+    STRTAG3       = NULL;
-+    STR4       = NULL;
-+    STRTAG5       = NULL;
-+    INTTAG6       = NULL;
-+    INTBOOL7       = NULL;
-+    INT8       = NULL;
-+    DATETAG10       = NULL;
-+    DATETAG12       = NULL;
-+    ENUMTAG13       = NULL;
-+    ENUMVAL14       = NULL;
-+    a = NULL;
-+    b = NULL;
-+    dateval9 = 0;
-+    dateval11 = 0;
-+
-+    {
-+        {
-+            //  SMARTPL2SQL.g:64:2: ( ^( NOT a= expression ) | ^( AND a= expression b= expression ) | ^( OR a= expression b= expression ) | STRTAG INCLUDES STR | STRTAG IS STR | INTTAG INTBOOL INT | DATETAG AFTER dateval | DATETAG BEFORE dateval | ENUMTAG IS ENUMVAL )
-+            
-+            ANTLR3_UINT32 alt1;
-+
-+            alt1=9;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case NOT:
-+              {
-+                      alt1=1;
-+              }
-+                break;
-+            case AND:
-+              {
-+                      alt1=2;
-+              }
-+                break;
-+            case OR:
-+              {
-+                      alt1=3;
-+              }
-+                break;
-+            case STRTAG:
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case INCLUDES:
-+                              {
-+                                      alt1=4;
-+                              }
-+                          break;
-+                      case IS:
-+                              {
-+                                      alt1=5;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 1;
-+                          EXCEPTION->state        = 4;
-+
-+
-+                          goto ruleexpressionEx;
-+                      }
-+
-+              }
-+                break;
-+            case INTTAG:
-+              {
-+                      alt1=6;
-+              }
-+                break;
-+            case DATETAG:
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case AFTER:
-+                              {
-+                                      alt1=7;
-+                              }
-+                          break;
-+                      case BEFORE:
-+                              {
-+                                      alt1=8;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 1;
-+                          EXCEPTION->state        = 6;
-+
-+
-+                          goto ruleexpressionEx;
-+                      }
-+
-+              }
-+                break;
-+            case ENUMTAG:
-+              {
-+                      alt1=9;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 1;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruleexpressionEx;
-+            }
-+
-+            switch (alt1) 
-+            {
-+              case 1:
-+                  // SMARTPL2SQL.g:64:4: ^( NOT a= expression )
-+                  {
-+                       MATCHT(NOT, &FOLLOW_NOT_in_expression101); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_expression_in_expression107);
-+                      a=expression(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      {
-+
-+                                              result= a->factory->newRaw(a->factory);
-+                                              result->append8(result, "NOT(");
-+                                              result->appendS(result, a);
-+                                              result->append8(result, ")");
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // SMARTPL2SQL.g:71:4: ^( AND a= expression b= expression )
-+                  {
-+                       MATCHT(AND, &FOLLOW_AND_in_expression118); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_expression_in_expression124);
-+                      a=expression(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_expression_in_expression130);
-+                      b=expression(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      {
-+
-+                                              result= a->factory->newRaw(a->factory);
-+                                              result->append8(result, "(");
-+                                              result->appendS(result, a);
-+                                              result->append8(result, " AND ");
-+                                              result->appendS(result, b);
-+                                              result->append8(result, ")");
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // SMARTPL2SQL.g:80:4: ^( OR a= expression b= expression )
-+                  {
-+                       MATCHT(OR, &FOLLOW_OR_in_expression141); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_expression_in_expression147);
-+                      a=expression(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_expression_in_expression153);
-+                      b=expression(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+
-+                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      {
-+
-+                                              result= a->factory->newRaw(a->factory);
-+                                              result->append8(result, "(");
-+                                              result->appendS(result, a);
-+                                              result->append8(result, " OR ");
-+                                              result->appendS(result, b);
-+                                              result->append8(result, ")");
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 4:
-+                  // SMARTPL2SQL.g:89:4: STRTAG INCLUDES STR
-+                  {
-+                      STRTAG3 = (pANTLR3_BASE_TREE) MATCHT(STRTAG, &FOLLOW_STRTAG_in_expression163); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                       MATCHT(INCLUDES, &FOLLOW_INCLUDES_in_expression165); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      STR2 = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_expression167); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      {
-+
-+                                              pANTLR3_UINT8 val;
-+                                              val = (STR2->getText(STR2))->toUTF8((STR2->getText(STR2)))->chars;
-+                                              val++;
-+                                              val[strlen((const char *)val) - 1] = '\0';
-+                                              
-+                                              result= (STR2->getText(STR2))->factory->newRaw((STR2->getText(STR2))->factory);
-+                                              result->append8(result, "f.");
-+                                              result->appendS(result, (STRTAG3->getText(STRTAG3))->toUTF8((STRTAG3->getText(STRTAG3))));
-+                                              result->append8(result, " LIKE '%");
-+                                              result->append8(result, sqlite3_mprintf("%q", (const char *)val));
-+                                              result->append8(result, "%'");
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 5:
-+                  // SMARTPL2SQL.g:103:4: STRTAG IS STR
-+                  {
-+                      STRTAG5 = (pANTLR3_BASE_TREE) MATCHT(STRTAG, &FOLLOW_STRTAG_in_expression176); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                       MATCHT(IS, &FOLLOW_IS_in_expression178); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      STR4 = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_expression180); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      {
-+
-+                                              pANTLR3_UINT8 val;
-+                                              val = (STR4->getText(STR4))->toUTF8((STR4->getText(STR4)))->chars;
-+                                              val++;
-+                                              val[strlen((const char *)val) - 1] = '\0';
-+                                              
-+                                              result= (STR4->getText(STR4))->factory->newRaw((STR4->getText(STR4))->factory);
-+                                              result->append8(result, "f.");
-+                                              result->appendS(result, (STRTAG5->getText(STRTAG5))->toUTF8((STRTAG5->getText(STRTAG5))));
-+                                              result->append8(result, " LIKE '");
-+                                              result->append8(result, sqlite3_mprintf("%q", (const char *)val));
-+                                              result->append8(result, "'");
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 6:
-+                  // SMARTPL2SQL.g:117:4: INTTAG INTBOOL INT
-+                  {
-+                      INTTAG6 = (pANTLR3_BASE_TREE) MATCHT(INTTAG, &FOLLOW_INTTAG_in_expression189); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      INTBOOL7 = (pANTLR3_BASE_TREE) MATCHT(INTBOOL, &FOLLOW_INTBOOL_in_expression191); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      INT8 = (pANTLR3_BASE_TREE) MATCHT(INT, &FOLLOW_INT_in_expression193); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      {
-+
-+                                              result= (INTTAG6->getText(INTTAG6))->factory->newRaw((INTTAG6->getText(INTTAG6))->factory);
-+                                              result->append8(result, "f.");
-+                                              result->appendS(result, (INTTAG6->getText(INTTAG6))->toUTF8((INTTAG6->getText(INTTAG6))));
-+                                              result->append8(result, " ");
-+                                              result->appendS(result, (INTBOOL7->getText(INTBOOL7))->toUTF8((INTBOOL7->getText(INTBOOL7))));
-+                                              result->append8(result, " ");
-+                                              result->appendS(result, (INT8->getText(INT8))->toUTF8((INT8->getText(INT8))));
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 7:
-+                  // SMARTPL2SQL.g:127:4: DATETAG AFTER dateval
-+                  {
-+                      DATETAG10 = (pANTLR3_BASE_TREE) MATCHT(DATETAG, &FOLLOW_DATETAG_in_expression202); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                       MATCHT(AFTER, &FOLLOW_AFTER_in_expression204); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_dateval_in_expression206);
-+                      dateval9=dateval(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      {
-+
-+                                              char str[15];
-+                                              sprintf(str, "%d", dateval9);
-+                                              
-+                                              result= (DATETAG10->getText(DATETAG10))->factory->newRaw((DATETAG10->getText(DATETAG10))->factory);
-+                                              result->append8(result, "f.");
-+                                              result->appendS(result, (DATETAG10->getText(DATETAG10))->toUTF8((DATETAG10->getText(DATETAG10))));
-+                                              result->append8(result, " > ");
-+                                              result->append8(result, str);
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 8:
-+                  // SMARTPL2SQL.g:138:4: DATETAG BEFORE dateval
-+                  {
-+                      DATETAG12 = (pANTLR3_BASE_TREE) MATCHT(DATETAG, &FOLLOW_DATETAG_in_expression215); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                       MATCHT(BEFORE, &FOLLOW_BEFORE_in_expression217); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_dateval_in_expression219);
-+                      dateval11=dateval(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      {
-+
-+                                              char str[15];
-+                                              sprintf(str, "%d", dateval11);
-+                                              
-+                                              result= (DATETAG12->getText(DATETAG12))->factory->newRaw((DATETAG12->getText(DATETAG12))->factory);
-+                                              result->append8(result, "f.");
-+                                              result->appendS(result, (DATETAG12->getText(DATETAG12))->toUTF8((DATETAG12->getText(DATETAG12))));
-+                                              result->append8(result, " > ");
-+                                              result->append8(result, str);
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 9:
-+                  // SMARTPL2SQL.g:149:4: ENUMTAG IS ENUMVAL
-+                  {
-+                      ENUMTAG13 = (pANTLR3_BASE_TREE) MATCHT(ENUMTAG, &FOLLOW_ENUMTAG_in_expression228); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                       MATCHT(IS, &FOLLOW_IS_in_expression230); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      ENUMVAL14 = (pANTLR3_BASE_TREE) MATCHT(ENUMVAL, &FOLLOW_ENUMVAL_in_expression232); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      {
-+
-+                                              pANTLR3_UINT8 tag;
-+                                              pANTLR3_UINT8 val;
-+                                              char str[20];
-+                                              
-+                                              sprintf(str, "1=1");
-+                                              
-+                                              tag = (ENUMTAG13->getText(ENUMTAG13))->chars;
-+                                              val = (ENUMVAL14->getText(ENUMVAL14))->chars;
-+                                              if (strcmp((char *)tag, "media_kind") == 0)
-+                                              {
-+                                                      if (strcmp((char *)val, "music") == 0)
-+                                                      {
-+                                                              sprintf(str, "f.media_kind = %d", MEDIA_KIND_MUSIC);
-+                                                      }
-+                                                      else if (strcmp((char *)val, "movie") == 0)
-+                                                      {
-+                                                              sprintf(str, "f.media_kind = %d", MEDIA_KIND_MOVIE);
-+                                                      }
-+                                                      else if (strcmp((char *)val, "podcast") == 0)
-+                                                      {
-+                                                              sprintf(str, "f.media_kind = %d", MEDIA_KIND_PODCAST);
-+                                                      }
-+                                                      else if (strcmp((char *)val, "audiobook") == 0)
-+                                                      {
-+                                                              sprintf(str, "f.media_kind = %d", MEDIA_KIND_AUDIOBOOK);
-+                                                      }
-+                                                      else if (strcmp((char *)val, "tvshow") == 0)
-+                                                      {
-+                                                              sprintf(str, "f.media_kind = %d", MEDIA_KIND_TVSHOW);
-+                                                      }
-+                                              }
-+                                              else if (strcmp((char *)tag, "data_kind") == 0)
-+                                              {
-+                                                      if (strcmp((char *)val, "file") == 0)
-+                                                      {
-+                                                              sprintf(str, "f.data_kind = %d", DATA_KIND_FILE);
-+                                                      }
-+                                                      else if (strcmp((char *)val, "url") == 0)
-+                                                      {
-+                                                              sprintf(str, "f.data_kind = %d", DATA_KIND_HTTP);
-+                                                      }
-+                                                      else if (strcmp((char *)val, "spotify") == 0)
-+                                                      {
-+                                                              sprintf(str, "f.data_kind = %d", DATA_KIND_SPOTIFY);
-+                                                      }
-+                                                      else if (strcmp((char *)val, "pipe") == 0)
-+                                                      {
-+                                                              sprintf(str, "f.data_kind = %d", DATA_KIND_PIPE);
-+                                                      }
-+                                              }
-+                                              
-+                                              result= (ENUMTAG13->getText(ENUMTAG13))->factory->newRaw((ENUMTAG13->getText(ENUMTAG13))->factory);
-+                                              result->append8(result, str);
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleexpressionEx; /* Prevent compiler warnings */
-+    ruleexpressionEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return result;
-+}
-+/* $ANTLR end expression */
-+
-+/** 
-+ * $ANTLR start dateval
-+ * SMARTPL2SQL.g:207:1: dateval returns [ int result ] : ( DATE | interval BEFORE DATE | interval AFTER DATE | interval AGO );
-+ */
-+static int
-+dateval(pSMARTPL2SQL ctx)
-+{   
-+    int result = 0;
-+
-+    pANTLR3_BASE_TREE    DATE15;
-+    pANTLR3_BASE_TREE    DATE16;
-+    pANTLR3_BASE_TREE    DATE18;
-+    int interval17;
-+    #undef    RETURN_TYPE_interval17
-+    #define   RETURN_TYPE_interval17 int
-+
-+    int interval19;
-+    #undef    RETURN_TYPE_interval19
-+    #define   RETURN_TYPE_interval19 int
-+
-+    int interval20;
-+    #undef    RETURN_TYPE_interval20
-+    #define   RETURN_TYPE_interval20 int
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     result= 0; 
-+    DATE15       = NULL;
-+    DATE16       = NULL;
-+    DATE18       = NULL;
-+    interval17 = 0;
-+    interval19 = 0;
-+    interval20 = 0;
-+
-+    {
-+        {
-+            //  SMARTPL2SQL.g:209:2: ( DATE | interval BEFORE DATE | interval AFTER DATE | interval AGO )
-+            
-+            ANTLR3_UINT32 alt2;
-+
-+            alt2=4;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case DATE:
-+              {
-+                      alt2=1;
-+              }
-+                break;
-+            case INT:
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case DATINTERVAL:
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case AGO:
-+                                              {
-+                                                      alt2=4;
-+                                              }
-+                                          break;
-+                                      case BEFORE:
-+                                              {
-+                                                      alt2=2;
-+                                              }
-+                                          break;
-+                                      case AFTER:
-+                                              {
-+                                                      alt2=3;
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 2;
-+                                          EXCEPTION->state        = 3;
-+
-+
-+                                          goto ruledatevalEx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 2;
-+                          EXCEPTION->state        = 2;
-+
-+
-+                          goto ruledatevalEx;
-+                      }
-+
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 2;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruledatevalEx;
-+            }
-+
-+            switch (alt2) 
-+            {
-+              case 1:
-+                  // SMARTPL2SQL.g:209:4: DATE
-+                  {
-+                      DATE15 = (pANTLR3_BASE_TREE) MATCHT(DATE, &FOLLOW_DATE_in_dateval257); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      {
-+
-+                                              pANTLR3_UINT8 datval;
-+                                              
-+                                              datval = (DATE15->getText(DATE15))->chars;
-+                                              
-+                                              if (strcmp((char *)datval, "today") == 0)
-+                                              {
-+                                                      result= time(NULL);
-+                                              }
-+                                              else if (strcmp((char *)datval, "yesterday") == 0)
-+                                              {
-+                                                      result= time(NULL) - 24 * 3600;
-+                                              }
-+                                              else if (strcmp((char *)datval, "last week") == 0)
-+                                              {
-+                                                      result= time(NULL) - 24 * 3600 * 7;
-+                                              }
-+                                              else if (strcmp((char *)datval, "last month") == 0)
-+                                              {
-+                                                      result= time(NULL) - 24 * 3600 * 30;
-+                                              }
-+                                              else if (strcmp((char *)datval, "last year") == 0)
-+                                              {
-+                                                      result= time(NULL) - 24 * 3600 * 365;
-+                                              }
-+                                              else
-+                                              {
-+                                                      struct tm tm;
-+                                                      char year[5];
-+                                                      char month[3];
-+                                                      char day[3];
-+                                                      
-+                                                      memset((void*)&tm,0,sizeof(tm));
-+                                                      memset(year, 0, sizeof(year));
-+                                                      memset(month, 0, sizeof(month));
-+                                                      memset(day, 0, sizeof(day));
-+
-+                                                      strncpy(year, (const char *)datval, 4);
-+                                                      strncpy(month, (const char *)datval + 5, 2);
-+                                                      strncpy(day, (const char *)datval + 8, 2);
-+                                                      
-+                                                      tm.tm_year = atoi(year) - 1900;
-+                                                      tm.tm_mon = atoi(month) - 1;
-+                                                      tm.tm_mday = atoi(day);
-+                                                      
-+                                                      result= mktime(&tm);
-+                                              }
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // SMARTPL2SQL.g:258:4: interval BEFORE DATE
-+                  {
-+                      FOLLOWPUSH(FOLLOW_interval_in_dateval266);
-+                      interval17=interval(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                       MATCHT(BEFORE, &FOLLOW_BEFORE_in_dateval268); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      DATE16 = (pANTLR3_BASE_TREE) MATCHT(DATE, &FOLLOW_DATE_in_dateval270); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      {
-+
-+                                              pANTLR3_UINT8 datval;
-+                                              
-+                                              datval = (DATE16->getText(DATE16))->chars;
-+                                              
-+                                              if (strcmp((char *)datval, "yesterday") == 0)
-+                                              {
-+                                                      result= time(NULL) - 24 * 3600;
-+                                              }
-+                                              else if (strcmp((char *)datval, "last week") == 0)
-+                                              {
-+                                                      result= time(NULL) - 24 * 3600 * 7;
-+                                              }
-+                                              else if (strcmp((char *)datval, "last month") == 0)
-+                                              {
-+                                                      result= time(NULL) - 24 * 3600 * 30;
-+                                              }
-+                                              else if (strcmp((char *)datval, "last year") == 0)
-+                                              {
-+                                                      result= time(NULL) - 24 * 3600 * 365;
-+                                              }
-+                                              else
-+                                              {
-+                                                      result= time(NULL);
-+                                              }
-+                                              
-+                                              result= result - interval17;
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // SMARTPL2SQL.g:287:4: interval AFTER DATE
-+                  {
-+                      FOLLOWPUSH(FOLLOW_interval_in_dateval279);
-+                      interval19=interval(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                       MATCHT(AFTER, &FOLLOW_AFTER_in_dateval281); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      DATE18 = (pANTLR3_BASE_TREE) MATCHT(DATE, &FOLLOW_DATE_in_dateval283); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      {
-+
-+                                              pANTLR3_UINT8 datval;
-+                                              
-+                                              datval = (DATE18->getText(DATE18))->chars;
-+                                              
-+                                              if (strcmp((char *)datval, "yesterday") == 0)
-+                                              {
-+                                                      result= time(NULL) - 24 * 3600;
-+                                              }
-+                                              else if (strcmp((char *)datval, "last week") == 0)
-+                                              {
-+                                                      result= time(NULL) - 24 * 3600 * 7;
-+                                              }
-+                                              else if (strcmp((char *)datval, "last month") == 0)
-+                                              {
-+                                                      result= time(NULL) - 24 * 3600 * 30;
-+                                              }
-+                                              else if (strcmp((char *)datval, "last year") == 0)
-+                                              {
-+                                                      result= time(NULL) - 24 * 3600 * 365;
-+                                              }
-+                                              else
-+                                              {
-+                                                      result= time(NULL);
-+                                              }
-+                                              
-+                                              result= result + interval19;
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+              case 4:
-+                  // SMARTPL2SQL.g:316:4: interval AGO
-+                  {
-+                      FOLLOWPUSH(FOLLOW_interval_in_dateval292);
-+                      interval20=interval(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                       MATCHT(AGO, &FOLLOW_AGO_in_dateval294); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      {
-+
-+                                              result= time(NULL) - interval20;
-+                                      
-+                      }
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruledatevalEx; /* Prevent compiler warnings */
-+    ruledatevalEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return result;
-+}
-+/* $ANTLR end dateval */
-+
-+/** 
-+ * $ANTLR start interval
-+ * SMARTPL2SQL.g:322:1: interval returns [ int result ] : INT DATINTERVAL ;
-+ */
-+static int
-+interval(pSMARTPL2SQL ctx)
-+{   
-+    int result = 0;
-+
-+    pANTLR3_BASE_TREE    INT21;
-+    pANTLR3_BASE_TREE    DATINTERVAL22;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+     result= 0; 
-+    INT21       = NULL;
-+    DATINTERVAL22       = NULL;
-+
-+    {
-+        // SMARTPL2SQL.g:324:2: ( INT DATINTERVAL )
-+        // SMARTPL2SQL.g:324:4: INT DATINTERVAL
-+        {
-+            INT21 = (pANTLR3_BASE_TREE) MATCHT(INT, &FOLLOW_INT_in_interval318); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleintervalEx;
-+            }
-+
-+            DATINTERVAL22 = (pANTLR3_BASE_TREE) MATCHT(DATINTERVAL, &FOLLOW_DATINTERVAL_in_interval320); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleintervalEx;
-+            }
-+
-+            {
-+
-+                                      pANTLR3_UINT8 interval;
-+                                      
-+                                      result= atoi((const char *)(INT21->getText(INT21))->chars);
-+                                      interval = (DATINTERVAL22->getText(DATINTERVAL22))->chars;
-+                                      
-+                                      if (strcmp((char *)interval, "days") == 0)
-+                                      {
-+                                              result= result * 24 * 3600;
-+                                      }
-+                                      else if (strcmp((char *)interval, "weeks") == 0)
-+                                      {
-+                                              result= result * 24 * 3600 * 7;
-+                                      }
-+                                      else if (strcmp((char *)interval, "months") == 0)
-+                                      {
-+                                              result= result * 24 * 3600 * 30;
-+                                      }
-+                                      else if (strcmp((char *)interval, "weeks") == 0)
-+                                      {
-+                                              result= result * 24 * 3600 * 365;
-+                                      }
-+                                      else
-+                                      {
-+                                              result= 0;
-+                                      }
-+                              
-+            }
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleintervalEx; /* Prevent compiler warnings */
-+    ruleintervalEx: ;
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+            }
-+
-+
-+    return result;
-+}
-+/* $ANTLR end interval */
-+/* End of parsing rules
-+ * ==============================================
-+ */
-+
-+/* ==============================================
-+ * Syntactic predicates
-+ */
-+/* End of syntactic predicates
-+ * ==============================================
-+ */
-+
-+ 
-+ 
-+
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/SMARTPL2SQL.h b/src/pregen/SMARTPL2SQL.h
-new file mode 100644
-index 0000000..8e06de7
---- /dev/null
-+++ b/src/pregen/SMARTPL2SQL.h
-@@ -0,0 +1,220 @@
-+/** \file
-+ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : SMARTPL2SQL.g
-+ *     -                            On : 2016-01-01 12:23:44
-+ *     -           for the tree parser : SMARTPL2SQLTreeParser *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The tree parser SMARTPL2SQL has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ * 
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pSMARTPL2SQL, which is returned from a call to SMARTPL2SQLNew().
-+ *
-+ * The methods in pSMARTPL2SQL are  as follows:
-+ *
-+ *  - SMARTPL2SQL_playlist_return      pSMARTPL2SQL->playlist(pSMARTPL2SQL)
-+ *  - pANTLR3_STRING      pSMARTPL2SQL->expression(pSMARTPL2SQL)
-+ *  - int      pSMARTPL2SQL->dateval(pSMARTPL2SQL)
-+ *  - int      pSMARTPL2SQL->interval(pSMARTPL2SQL)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+#ifndef       _SMARTPL2SQL_H
-+#define _SMARTPL2SQL_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include    <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+ 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct SMARTPL2SQL_Ctx_struct SMARTPL2SQL, * pSMARTPL2SQL;
-+
-+
-+
-+      #include <stdio.h>
-+      #include <stdlib.h>
-+      #include <string.h>
-+      #include <limits.h>
-+      #include <errno.h>
-+      #include <time.h>
-+      #include <sqlite3.h>
-+
-+      #include "logger.h"
-+      #include "db.h"
-+
-+
-+#ifdef        ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
-+//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
-+//          initialized but unused variable                                   - tree rewrite variables declared but not needed
-+//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
-+//          potentially unitialized variable used                     - retval always returned from a rule 
-+//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+typedef struct SMARTPL2SQL_playlist_return_struct
-+{
-+    pANTLR3_BASE_TREE       start;
-+    pANTLR3_BASE_TREE       stop;   
-+    pANTLR3_STRING title;
-+    pANTLR3_STRING query;
-+}
-+    SMARTPL2SQL_playlist_return;
-+
-+
-+
-+/** Context tracking structure for SMARTPL2SQL
-+ */
-+struct SMARTPL2SQL_Ctx_struct
-+{
-+    /** Built in ANTLR3 context tracker contains all the generic elements
-+     *  required for context tracking.
-+     */
-+    pANTLR3_TREE_PARSER           pTreeParser;
-+
-+
-+     SMARTPL2SQL_playlist_return (*playlist)  (struct SMARTPL2SQL_Ctx_struct * ctx);
-+     pANTLR3_STRING (*expression)     (struct SMARTPL2SQL_Ctx_struct * ctx);
-+     int (*dateval)   (struct SMARTPL2SQL_Ctx_struct * ctx);
-+     int (*interval)  (struct SMARTPL2SQL_Ctx_struct * ctx);
-+    // Delegated rules
-+    const char * (*getGrammarFileName)();
-+    void          (*free)   (struct SMARTPL2SQL_Ctx_struct * ctx);
-+        
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pSMARTPL2SQL SMARTPL2SQLNew         (pANTLR3_COMMON_TREE_NODE_STREAM instream);
-+ANTLR3_API pSMARTPL2SQL SMARTPL2SQLNewSSD      (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the tree parser will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef        EOF
-+#undef        EOF
-+#endif
-+#ifdef        Tokens
-+#undef        Tokens
-+#endif 
-+#define INTBOOL      14
-+#define STRTAG      10
-+#define AGO      22
-+#define WHITESPACE      29
-+#define GREATEREQUAL      25
-+#define BEFORE      18
-+#define DATETAG      16
-+#define INT      15
-+#define NOT      7
-+#define AFTER      17
-+#define AND      6
-+#define EOF      -1
-+#define INCLUDES      11
-+#define STR      4
-+#define T__30      30
-+#define T__31      31
-+#define GREATER      24
-+#define LPAR      8
-+#define ENUMTAG      19
-+#define IS      12
-+#define ENUMVAL      20
-+#define EQUAL      28
-+#define OR      5
-+#define LESS      26
-+#define RPAR      9
-+#define DATE      21
-+#define LESSEQUAL      27
-+#define INTTAG      13
-+#define DATINTERVAL      23
-+#ifdef        EOF
-+#undef        EOF
-+#define       EOF     ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for SMARTPL2SQL
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/SMARTPL2SQL.u b/src/pregen/SMARTPL2SQL.u
-new file mode 100644
-index 0000000..85567d1
---- /dev/null
-+++ b/src/pregen/SMARTPL2SQL.u
-@@ -0,0 +1,5 @@
-+SMARTPL2SQL.g: SMARTPL.tokens
-+SMARTPL2SQL.c : SMARTPL2SQL.g
-+./SMARTPL2SQL.tokens : SMARTPL2SQL.g
-+SMARTPL2SQL.h : SMARTPL2SQL.g
-+ANTLR_PRODUCTS += SMARTPL2SQL.c ./SMARTPL2SQL.tokens SMARTPL2SQL.h 
-\ No newline at end of file
-diff --git a/src/pregen/SMARTPLLexer.c b/src/pregen/SMARTPLLexer.c
-new file mode 100644
-index 0000000..91d6e99
---- /dev/null
-+++ b/src/pregen/SMARTPLLexer.c
-@@ -0,0 +1,4168 @@
-+/** \file
-+ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : SMARTPL.g
-+ *     -                            On : 2016-01-01 12:23:40
-+ *     -                 for the lexer : SMARTPLLexerLexer *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include    "SMARTPLLexer.h"
-+/* ----------------------------------------- */
-+
-+
-+/** String literals used by SMARTPLLexer that we must do things like MATCHS() with.
-+ *  C will normally just lay down 8 bit characters, and you can use L"xxx" to
-+ *  get wchar_t, but wchar_t is 16 bits on Windows, which is not UTF32 and so
-+ *  we perform this little trick of defining the literals as arrays of UINT32
-+ *  and passing in the address of these.
-+ */
-+static ANTLR3_UCHAR   lit_1[]  = { 0x61, 0x72, 0x74, 0x69, 0x73, 0x74,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_2[]  = { 0x61, 0x6C, 0x62, 0x75, 0x6D, 0x5F, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_3[]  = { 0x61, 0x6C, 0x62, 0x75, 0x6D,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_4[]  = { 0x74, 0x69, 0x74, 0x6C, 0x65,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_5[]  = { 0x67, 0x65, 0x6E, 0x72, 0x65,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_6[]  = { 0x63, 0x6F, 0x6D, 0x70, 0x6F, 0x73, 0x65, 0x72,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_7[]  = { 0x70, 0x61, 0x74, 0x68,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_8[]  = { 0x74, 0x79, 0x70, 0x65,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_9[]  = { 0x67, 0x72, 0x6F, 0x75, 0x70, 0x69, 0x6E, 0x67,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_10[]  = { 0x70, 0x6C, 0x61, 0x79, 0x5F, 0x63, 0x6F, 0x75, 0x6E, 0x74,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_11[]  = { 0x72, 0x61, 0x74, 0x69, 0x6E, 0x67,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_12[]  = { 0x79, 0x65, 0x61, 0x72,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_13[]  = { 0x63, 0x6F, 0x6D, 0x70, 0x69, 0x6C, 0x61, 0x74, 0x69, 0x6F, 0x6E,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_14[]  = { 0x74, 0x69, 0x6D, 0x65, 0x5F, 0x61, 0x64, 0x64, 0x65, 0x64,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_15[]  = { 0x74, 0x69, 0x6D, 0x65, 0x5F, 0x70, 0x6C, 0x61, 0x79, 0x65, 0x64,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_16[]  = { 0x64, 0x61, 0x74, 0x61, 0x5F, 0x6B, 0x69, 0x6E, 0x64,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_17[]  = { 0x6D, 0x65, 0x64, 0x69, 0x61, 0x5F, 0x6B, 0x69, 0x6E, 0x64,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_18[]  = { 0x69, 0x6E, 0x63, 0x6C, 0x75, 0x64, 0x65, 0x73,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_19[]  = { 0x69, 0x73,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_20[]  = { 0x3E, 0x3D,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_21[]  = { 0x3C, 0x3D,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_22[]  = { 0x61, 0x66, 0x74, 0x65, 0x72,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_23[]  = { 0x62, 0x65, 0x66, 0x6F, 0x72, 0x65,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_24[]  = { 0x61, 0x67, 0x6F,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_25[]  = { 0x41, 0x4E, 0x44,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_26[]  = { 0x61, 0x6E, 0x64,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_27[]  = { 0x4F, 0x52,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_28[]  = { 0x6F, 0x72,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_29[]  = { 0x4E, 0x4F, 0x54,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_30[]  = { 0x6E, 0x6F, 0x74,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_31[]  = { 0x74, 0x6F, 0x64, 0x61, 0x79,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_32[]  = { 0x79, 0x65, 0x73, 0x74, 0x65, 0x72, 0x64, 0x61, 0x79,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_33[]  = { 0x6C, 0x61, 0x73, 0x74, 0x20, 0x77, 0x65, 0x65, 0x6B,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_34[]  = { 0x6C, 0x61, 0x73, 0x74, 0x20, 0x6D, 0x6F, 0x6E, 0x74, 0x68,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_35[]  = { 0x6C, 0x61, 0x73, 0x74, 0x20, 0x79, 0x65, 0x61, 0x72,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_36[]  = { 0x64, 0x61, 0x79, 0x73,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_37[]  = { 0x77, 0x65, 0x65, 0x6B, 0x73,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_38[]  = { 0x6D, 0x6F, 0x6E, 0x74, 0x68, 0x73,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_39[]  = { 0x79, 0x65, 0x61, 0x72, 0x73,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_40[]  = { 0x6D, 0x75, 0x73, 0x69, 0x63,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_41[]  = { 0x6D, 0x6F, 0x76, 0x69, 0x65,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_42[]  = { 0x70, 0x6F, 0x64, 0x63, 0x61, 0x73, 0x74,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_43[]  = { 0x61, 0x75, 0x64, 0x69, 0x6F, 0x62, 0x6F, 0x6F, 0x6B,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_44[]  = { 0x74, 0x76, 0x73, 0x68, 0x6F, 0x77,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_45[]  = { 0x66, 0x69, 0x6C, 0x65,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_46[]  = { 0x75, 0x72, 0x6C,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_47[]  = { 0x73, 0x70, 0x6F, 0x74, 0x69, 0x66, 0x79,  ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR   lit_48[]  = { 0x70, 0x69, 0x70, 0x65,  ANTLR3_STRING_TERMINATOR};
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+ 
-+#define               CTX     ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef        SCOPE_TYPE
-+#undef        SCOPE_STACK
-+#undef        SCOPE_TOP
-+#define       SCOPE_TYPE(scope)   pSMARTPLLexer_##scope##_SCOPE
-+#define SCOPE_STACK(scope)  pSMARTPLLexer_##scope##Stack
-+#define       SCOPE_TOP(scope)    ctx->pSMARTPLLexer_##scope##Top
-+#define       SCOPE_SIZE(scope)               ctx->pSMARTPLLexer_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+ 
-+/* Macros for accessing things in a lexer
-+ */
-+#undef            LEXER
-+#undef            RECOGNIZER              
-+#undef            RULEMEMO                
-+#undef            GETCHARINDEX
-+#undef            GETLINE
-+#undef            GETCHARPOSITIONINLINE
-+#undef            EMIT
-+#undef            EMITNEW
-+#undef            MATCHC
-+#undef            MATCHS
-+#undef            MATCHRANGE
-+#undef            LTOKEN
-+#undef            HASFAILED
-+#undef            FAILEDFLAG
-+#undef            INPUT
-+#undef            STRSTREAM
-+#undef            LA
-+#undef            HASEXCEPTION
-+#undef            EXCEPTION
-+#undef            CONSTRUCTEX
-+#undef            CONSUME
-+#undef            LRECOVER
-+#undef            MARK
-+#undef            REWIND
-+#undef            REWINDLAST
-+#undef            BACKTRACKING
-+#undef                MATCHANY
-+#undef                MEMOIZE
-+#undef                HAVEPARSEDRULE
-+#undef                GETTEXT
-+#undef                INDEX
-+#undef                SEEK
-+#undef                PUSHSTREAM
-+#undef                POPSTREAM
-+#undef                SETTEXT
-+#undef                SETTEXT8
-+
-+#define           LEXER                                       ctx->pLexer
-+#define           RECOGNIZER                      LEXER->rec
-+#define               LEXSTATE                                RECOGNIZER->state
-+#define               TOKSOURCE                               LEXSTATE->tokSource
-+#define           GETCHARINDEX()                      LEXER->getCharIndex(LEXER)
-+#define           GETLINE()                           LEXER->getLine(LEXER)
-+#define           GETTEXT()                           LEXER->getText(LEXER)
-+#define           GETCHARPOSITIONINLINE() LEXER->getCharPositionInLine(LEXER)
-+#define           EMIT()                                      LEXSTATE->type = _type; LEXER->emit(LEXER)
-+#define           EMITNEW(t)                          LEXER->emitNew(LEXER, t)
-+#define           MATCHC(c)                           LEXER->matchc(LEXER, c)
-+#define           MATCHS(s)                           LEXER->matchs(LEXER, s)
-+#define           MATCHRANGE(c1,c2)       LEXER->matchRange(LEXER, c1, c2)
-+#define           MATCHANY()                          LEXER->matchAny(LEXER)
-+#define           LTOKEN                              LEXSTATE->token
-+#define           HASFAILED()                         (LEXSTATE->failed == ANTLR3_TRUE)
-+#define           BACKTRACKING                        LEXSTATE->backtracking
-+#define           FAILEDFLAG                          LEXSTATE->failed
-+#define           INPUT                                       LEXER->input
-+#define           STRSTREAM                           INPUT
-+#define               ISTREAM                                 INPUT->istream
-+#define               INDEX()                                 ISTREAM->index(ISTREAM)
-+#define               SEEK(n)                                 ISTREAM->seek(ISTREAM, n)
-+#define           EOF_TOKEN                           &(LEXSTATE->tokSource->eofToken)
-+#define           HASEXCEPTION()                      (LEXSTATE->error == ANTLR3_TRUE)
-+#define           EXCEPTION                           LEXSTATE->exception
-+#define           CONSTRUCTEX()                       RECOGNIZER->exConstruct(RECOGNIZER)
-+#define           LRECOVER()                          LEXER->recover(LEXER)
-+#define           MARK()                                      ISTREAM->mark(ISTREAM)
-+#define           REWIND(m)                           ISTREAM->rewind(ISTREAM, m)
-+#define           REWINDLAST()                        ISTREAM->rewindLast(ISTREAM)
-+#define               MEMOIZE(ri,si)                  RECOGNIZER->memoize(RECOGNIZER, ri, si)
-+#define               HAVEPARSEDRULE(r)               RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define               PUSHSTREAM(str)                 LEXER->pushCharStream(LEXER, str)
-+#define               POPSTREAM()                             LEXER->popCharStream(LEXER)
-+#define               SETTEXT(str)                    LEXSTATE->text = str
-+#define               SKIP()                                  LEXSTATE->token = &(TOKSOURCE->skipToken)
-+#define               USER1                                   LEXSTATE->user1
-+#define               USER2                                   LEXSTATE->user2
-+#define               USER3                                   LEXSTATE->user3
-+#define               CUSTOM                                  LEXSTATE->custom
-+#define               RULEMEMO                                LEXSTATE->ruleMemo
-+#define               DBG                                             RECOGNIZER->debugger
-+
-+/* If we have been told we can rely on the standard 8 bit or 16 bit input
-+ * stream, then we can define our macros to use the direct pointers
-+ * in the input object, which is much faster than indirect calls. This
-+ * is really only significant to lexers with a lot of fragment rules (which
-+ * do not place LA(1) in a temporary at the moment) and even then
-+ * only if there is a lot of input (order of say 1M or so).
-+ */
-+#if   defined(ANTLR3_INLINE_INPUT_ASCII) || defined(ANTLR3_INLINE_INPUT_UTF16)
-+
-+# ifdef       ANTLR3_INLINE_INPUT_ASCII
-+
-+/* 8 bit "ASCII" (actually any 8 bit character set) */
-+
-+#  define         NEXTCHAR                    ((pANTLR3_UINT8)(INPUT->nextChar))
-+#  define         DATAP                               ((pANTLR3_UINT8)(INPUT->data))
-+
-+# else
-+
-+#  define         NEXTCHAR                    ((pANTLR3_UINT16)(INPUT->nextChar)) 
-+#  define         DATAP                               ((pANTLR3_UINT16)(INPUT->data))
-+
-+# endif
-+
-+# define          LA(n) ((NEXTCHAR + n) > (DATAP + INPUT->sizeBuf) ? ANTLR3_CHARSTREAM_EOF : (ANTLR3_UCHAR)(*(NEXTCHAR + n - 1)))
-+# define          CONSUME()                                                                                   \
-+{                                                                                                                                     \
-+    if        (NEXTCHAR < (DATAP + INPUT->sizeBuf))                                           \
-+    {                                                                                                                         \
-+              INPUT->charPositionInLine++;                                                            \
-+              if  ((ANTLR3_UCHAR)(*NEXTCHAR) == INPUT->newlineChar)           \
-+              {                                                                                                                       \
-+                      INPUT->line++;                                                                                  \
-+                      INPUT->charPositionInLine       = 0;                                            \
-+                      INPUT->currentLine              = (void *)(NEXTCHAR + 1);               \
-+              }                                                                                                                       \
-+              INPUT->nextChar = (void *)(NEXTCHAR + 1);                                       \
-+    }                                                                                                                         \
-+}
-+
-+#else
-+
-+// Pick up the input character by calling the input stream implementation.
-+//
-+#define           CONSUME()                           INPUT->istream->consume(INPUT->istream)
-+#define           LA(n)                                       INPUT->istream->_LA(INPUT->istream, n)
-+
-+#endif
-+#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define           UP      ANTLR3_TOKEN_UP
-+#define           DOWN    ANTLR3_TOKEN_DOWN
-+#define           EOR     ANTLR3_TOKEN_EOR
-+#define           INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+/* Forward declare the locally static matching functions we have generated and any predicate functions.
-+ */
-+static ANTLR3_INLINE  void    mT__30    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mT__31    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mSTRTAG    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mINTTAG    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mDATETAG    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mENUMTAG    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mINCLUDES    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mIS    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mINTBOOL    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mGREATER    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mGREATEREQUAL    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mLESS    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mLESSEQUAL    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mEQUAL    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mAFTER    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mBEFORE    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mAGO    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mAND    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mOR    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mNOT    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mLPAR    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mRPAR    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mDATE    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mDATINTERVAL    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mENUMVAL    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mSTR    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mINT    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mWHITESPACE    (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE  void    mTokens    (pSMARTPLLexer ctx);
-+static void   SMARTPLLexerFree(pSMARTPLLexer ctx);
-+
-+/* =========================================================================
-+ * Lexer matching rules end.
-+ * =========================================================================
-+ */
-+
-+
-+
-+static void
-+SMARTPLLexerFree  (pSMARTPLLexer ctx)
-+{
-+    LEXER->free(LEXER);
-+    
-+    ANTLR3_FREE(ctx);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "SMARTPL.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+      return fileName;
-+}
-+
-+/** \brief Create a new lexer called SMARTPLLexer
-+ *
-+ * \param[in]    instream Pointer to an initialized input stream
-+ * \return 
-+ *     - Success pSMARTPLLexer initialized for the lex start
-+ *     - Fail NULL
-+ */
-+ANTLR3_API pSMARTPLLexer SMARTPLLexerNew         
-+(pANTLR3_INPUT_STREAM instream)
-+{
-+      // See if we can create a new lexer with the standard constructor
-+      //
-+      return SMARTPLLexerNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new lexer called SMARTPLLexer
-+ *
-+ * \param[in]    instream Pointer to an initialized input stream
-+ * \param[state] state Previously created shared recognizer stat
-+ * \return 
-+ *     - Success pSMARTPLLexer initialized for the lex start
-+ *     - Fail NULL
-+ */
-+ANTLR3_API pSMARTPLLexer SMARTPLLexerNewSSD         
-+(pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+    pSMARTPLLexer ctx; // Context structure we will build and return
-+
-+    ctx = (pSMARTPLLexer) ANTLR3_CALLOC(1, sizeof(SMARTPLLexer));
-+
-+    if  (ctx == NULL)
-+    {
-+        // Failed to allocate memory for lexer context
-+        return  NULL;
-+    }
-+
-+    /* -------------------------------------------------------------------
-+     * Memory for basic structure is allocated, now to fill in
-+     * in base ANTLR3 structures. We initialize the function pointers
-+     * for the standard ANTLR3 lexer function set, but upon return
-+     * from here, the programmer may set the pointers to provide custom
-+     * implementations of each function. 
-+     *
-+     * We don't use the macros defined in SMARTPLLexer.h here so you can get a sense
-+     * of what goes where.
-+     */
-+    
-+    /* Create a base lexer, using the supplied input stream
-+     */
-+    ctx->pLexer       = antlr3LexerNewStream(ANTLR3_SIZE_HINT, instream, state);
-+    
-+    /* Check that we allocated the memory correctly
-+     */
-+    if        (ctx->pLexer == NULL)
-+    {
-+              ANTLR3_FREE(ctx);
-+              return  NULL;
-+    }
-+    /* Install the implementation of our SMARTPLLexer interface
-+     */
-+    ctx->mT__30       = mT__30;
-+    ctx->mT__31       = mT__31;
-+    ctx->mSTRTAG      = mSTRTAG;
-+    ctx->mINTTAG      = mINTTAG;
-+    ctx->mDATETAG     = mDATETAG;
-+    ctx->mENUMTAG     = mENUMTAG;
-+    ctx->mINCLUDES    = mINCLUDES;
-+    ctx->mIS  = mIS;
-+    ctx->mINTBOOL     = mINTBOOL;
-+    ctx->mGREATER     = mGREATER;
-+    ctx->mGREATEREQUAL        = mGREATEREQUAL;
-+    ctx->mLESS        = mLESS;
-+    ctx->mLESSEQUAL   = mLESSEQUAL;
-+    ctx->mEQUAL       = mEQUAL;
-+    ctx->mAFTER       = mAFTER;
-+    ctx->mBEFORE      = mBEFORE;
-+    ctx->mAGO = mAGO;
-+    ctx->mAND = mAND;
-+    ctx->mOR  = mOR;
-+    ctx->mNOT = mNOT;
-+    ctx->mLPAR        = mLPAR;
-+    ctx->mRPAR        = mRPAR;
-+    ctx->mDATE        = mDATE;
-+    ctx->mDATINTERVAL = mDATINTERVAL;
-+    ctx->mENUMVAL     = mENUMVAL;
-+    ctx->mSTR = mSTR;
-+    ctx->mINT = mINT;
-+    ctx->mWHITESPACE  = mWHITESPACE;
-+    ctx->mTokens      = mTokens;
-+    
-+    /** When the nextToken() call is made to this lexer's pANTLR3_TOKEN_SOURCE
-+     *  it will call mTokens() in this generated code, and will pass it the ctx
-+     * pointer of this lexer, not the context of the base lexer, so store that now.
-+     */
-+    ctx->pLexer->ctx      = ctx;
-+    
-+    /**Install the token matching function
-+     */
-+    ctx->pLexer->mTokens = (void (*) (void *))(mTokens);
-+    
-+    ctx->getGrammarFileName   = getGrammarFileName;
-+    ctx->free         = SMARTPLLexerFree;
-+
-+    
-+    
-+
-+
-+    /* Return the newly built lexer to the caller
-+     */
-+    return  ctx;
-+}
-+ 
-+
-+/* =========================================================================
-+ * Functions to match the lexer grammar defined tokens from the input stream
-+ */
-+
-+//   Comes from: 7:7: ( '{' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start T__30
-+ *
-+ * Looks to match the characters the constitute the token T__30
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mT__30(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = T__30;
-+       
-+    
-+    // SMARTPL.g:7:7: ( '{' )
-+    // SMARTPL.g:7:9: '{'
-+    {
-+        MATCHC('{'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleT__30Ex;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleT__30Ex; /* Prevent compiler warnings */
-+    ruleT__30Ex: ;
-+
-+}
-+// $ANTLR end T__30
-+
-+//   Comes from: 8:7: ( '}' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start T__31
-+ *
-+ * Looks to match the characters the constitute the token T__31
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mT__31(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = T__31;
-+       
-+    
-+    // SMARTPL.g:8:7: ( '}' )
-+    // SMARTPL.g:8:9: '}'
-+    {
-+        MATCHC('}'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleT__31Ex;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleT__31Ex; /* Prevent compiler warnings */
-+    ruleT__31Ex: ;
-+
-+}
-+// $ANTLR end T__31
-+
-+//   Comes from: 56:9: ( 'artist' | 'album_artist' | 'album' | 'title' | 'genre' | 'composer' | 'path' | 'type' | 'grouping' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start STRTAG
-+ *
-+ * Looks to match the characters the constitute the token STRTAG
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mSTRTAG(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = STRTAG;
-+       
-+    
-+    {
-+        //  SMARTPL.g:56:9: ( 'artist' | 'album_artist' | 'album' | 'title' | 'genre' | 'composer' | 'path' | 'type' | 'grouping' )
-+        
-+        ANTLR3_UINT32 alt1;
-+
-+        alt1=9;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case 'a':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'r':
-+                              {
-+                                      alt1=1;
-+                              }
-+                          break;
-+                      case 'l':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'b':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 'u':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 'm':
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case '_':
-+                                                                                              {
-+                                                                                                      alt1=2;
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          alt1=3;}
-+
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          CONSTRUCTEX();
-+                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                                          EXCEPTION->message      = (void *)"";
-+                                                                          EXCEPTION->decisionNum  = 1;
-+                                                                          EXCEPTION->state        = 13;
-+
-+
-+                                                                          goto ruleSTRTAGEx;
-+                                                                      }
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          CONSTRUCTEX();
-+                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                          EXCEPTION->message      = (void *)"";
-+                                                          EXCEPTION->decisionNum  = 1;
-+                                                          EXCEPTION->state        = 12;
-+
-+
-+                                                          goto ruleSTRTAGEx;
-+                                                      }
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 1;
-+                                          EXCEPTION->state        = 7;
-+
-+
-+                                          goto ruleSTRTAGEx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 1;
-+                          EXCEPTION->state        = 1;
-+
-+
-+                          goto ruleSTRTAGEx;
-+                      }
-+
-+              }
-+            break;
-+        case 't':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'i':
-+                              {
-+                                      alt1=4;
-+                              }
-+                          break;
-+                      case 'y':
-+                              {
-+                                      alt1=8;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 1;
-+                          EXCEPTION->state        = 2;
-+
-+
-+                          goto ruleSTRTAGEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'g':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'e':
-+                              {
-+                                      alt1=5;
-+                              }
-+                          break;
-+                      case 'r':
-+                              {
-+                                      alt1=9;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 1;
-+                          EXCEPTION->state        = 3;
-+
-+
-+                          goto ruleSTRTAGEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'c':
-+              {
-+                      alt1=6;
-+              }
-+            break;
-+        case 'p':
-+              {
-+                      alt1=7;
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 1;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleSTRTAGEx;
-+        }
-+
-+        switch (alt1) 
-+        {
-+      case 1:
-+          // SMARTPL.g:56:11: 'artist'
-+          {
-+              MATCHS(lit_1); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleSTRTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // SMARTPL.g:57:6: 'album_artist'
-+          {
-+              MATCHS(lit_2); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleSTRTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 3:
-+          // SMARTPL.g:58:6: 'album'
-+          {
-+              MATCHS(lit_3); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleSTRTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 4:
-+          // SMARTPL.g:59:6: 'title'
-+          {
-+              MATCHS(lit_4); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleSTRTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 5:
-+          // SMARTPL.g:60:6: 'genre'
-+          {
-+              MATCHS(lit_5); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleSTRTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 6:
-+          // SMARTPL.g:61:6: 'composer'
-+          {
-+              MATCHS(lit_6); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleSTRTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 7:
-+          // SMARTPL.g:62:6: 'path'
-+          {
-+              MATCHS(lit_7); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleSTRTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 8:
-+          // SMARTPL.g:63:6: 'type'
-+          {
-+              MATCHS(lit_8); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleSTRTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 9:
-+          // SMARTPL.g:64:6: 'grouping'
-+          {
-+              MATCHS(lit_9); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleSTRTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleSTRTAGEx; /* Prevent compiler warnings */
-+    ruleSTRTAGEx: ;
-+
-+}
-+// $ANTLR end STRTAG
-+
-+//   Comes from: 67:9: ( 'play_count' | 'rating' | 'year' | 'compilation' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start INTTAG
-+ *
-+ * Looks to match the characters the constitute the token INTTAG
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mINTTAG(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = INTTAG;
-+       
-+    
-+    {
-+        //  SMARTPL.g:67:9: ( 'play_count' | 'rating' | 'year' | 'compilation' )
-+        
-+        ANTLR3_UINT32 alt2;
-+
-+        alt2=4;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case 'p':
-+              {
-+                      alt2=1;
-+              }
-+            break;
-+        case 'r':
-+              {
-+                      alt2=2;
-+              }
-+            break;
-+        case 'y':
-+              {
-+                      alt2=3;
-+              }
-+            break;
-+        case 'c':
-+              {
-+                      alt2=4;
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 2;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleINTTAGEx;
-+        }
-+
-+        switch (alt2) 
-+        {
-+      case 1:
-+          // SMARTPL.g:67:11: 'play_count'
-+          {
-+              MATCHS(lit_10); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleINTTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // SMARTPL.g:68:6: 'rating'
-+          {
-+              MATCHS(lit_11); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleINTTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 3:
-+          // SMARTPL.g:69:6: 'year'
-+          {
-+              MATCHS(lit_12); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleINTTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 4:
-+          // SMARTPL.g:70:6: 'compilation'
-+          {
-+              MATCHS(lit_13); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleINTTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleINTTAGEx; /* Prevent compiler warnings */
-+    ruleINTTAGEx: ;
-+
-+}
-+// $ANTLR end INTTAG
-+
-+//   Comes from: 73:10: ( 'time_added' | 'time_played' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DATETAG
-+ *
-+ * Looks to match the characters the constitute the token DATETAG
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDATETAG(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = DATETAG;
-+       
-+    
-+    {
-+        //  SMARTPL.g:73:10: ( 'time_added' | 'time_played' )
-+        
-+        ANTLR3_UINT32 alt3;
-+
-+        alt3=2;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case 't':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'i':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'm':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 'e':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case '_':
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case 'a':
-+                                                                                              {
-+                                                                                                      alt3=1;
-+                                                                                              }
-+                                                                                          break;
-+                                                                                      case 'p':
-+                                                                                              {
-+                                                                                                      alt3=2;
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          CONSTRUCTEX();
-+                                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                                                          EXCEPTION->message      = (void *)"";
-+                                                                                          EXCEPTION->decisionNum  = 3;
-+                                                                                          EXCEPTION->state        = 5;
-+
-+
-+                                                                                          goto ruleDATETAGEx;
-+                                                                                      }
-+
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          CONSTRUCTEX();
-+                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                                          EXCEPTION->message      = (void *)"";
-+                                                                          EXCEPTION->decisionNum  = 3;
-+                                                                          EXCEPTION->state        = 4;
-+
-+
-+                                                                          goto ruleDATETAGEx;
-+                                                                      }
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          CONSTRUCTEX();
-+                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                          EXCEPTION->message      = (void *)"";
-+                                                          EXCEPTION->decisionNum  = 3;
-+                                                          EXCEPTION->state        = 3;
-+
-+
-+                                                          goto ruleDATETAGEx;
-+                                                      }
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 3;
-+                                          EXCEPTION->state        = 2;
-+
-+
-+                                          goto ruleDATETAGEx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 3;
-+                          EXCEPTION->state        = 1;
-+
-+
-+                          goto ruleDATETAGEx;
-+                      }
-+
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 3;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleDATETAGEx;
-+        }
-+
-+        switch (alt3) 
-+        {
-+      case 1:
-+          // SMARTPL.g:73:12: 'time_added'
-+          {
-+              MATCHS(lit_14); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDATETAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // SMARTPL.g:74:6: 'time_played'
-+          {
-+              MATCHS(lit_15); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDATETAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleDATETAGEx; /* Prevent compiler warnings */
-+    ruleDATETAGEx: ;
-+
-+}
-+// $ANTLR end DATETAG
-+
-+//   Comes from: 77:10: ( 'data_kind' | 'media_kind' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start ENUMTAG
-+ *
-+ * Looks to match the characters the constitute the token ENUMTAG
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mENUMTAG(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = ENUMTAG;
-+       
-+    
-+    {
-+        //  SMARTPL.g:77:10: ( 'data_kind' | 'media_kind' )
-+        
-+        ANTLR3_UINT32 alt4;
-+
-+        alt4=2;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case 'd':
-+              {
-+                      alt4=1;
-+              }
-+            break;
-+        case 'm':
-+              {
-+                      alt4=2;
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 4;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleENUMTAGEx;
-+        }
-+
-+        switch (alt4) 
-+        {
-+      case 1:
-+          // SMARTPL.g:77:12: 'data_kind'
-+          {
-+              MATCHS(lit_16); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleENUMTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // SMARTPL.g:78:6: 'media_kind'
-+          {
-+              MATCHS(lit_17); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleENUMTAGEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleENUMTAGEx; /* Prevent compiler warnings */
-+    ruleENUMTAGEx: ;
-+
-+}
-+// $ANTLR end ENUMTAG
-+
-+//   Comes from: 81:10: ( 'includes' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start INCLUDES
-+ *
-+ * Looks to match the characters the constitute the token INCLUDES
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mINCLUDES(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = INCLUDES;
-+       
-+    
-+    // SMARTPL.g:81:10: ( 'includes' )
-+    // SMARTPL.g:81:12: 'includes'
-+    {
-+        MATCHS(lit_18); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleINCLUDESEx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleINCLUDESEx; /* Prevent compiler warnings */
-+    ruleINCLUDESEx: ;
-+
-+}
-+// $ANTLR end INCLUDES
-+
-+//   Comes from: 84:6: ( 'is' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start IS
-+ *
-+ * Looks to match the characters the constitute the token IS
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mIS(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = IS;
-+       
-+    
-+    // SMARTPL.g:84:6: ( 'is' )
-+    // SMARTPL.g:84:8: 'is'
-+    {
-+        MATCHS(lit_19); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleISEx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleISEx; /* Prevent compiler warnings */
-+    ruleISEx: ;
-+
-+}
-+// $ANTLR end IS
-+
-+//   Comes from: 87:10: ( ( GREATER | GREATEREQUAL | LESS | LESSEQUAL | EQUAL ) )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start INTBOOL
-+ *
-+ * Looks to match the characters the constitute the token INTBOOL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mINTBOOL(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = INTBOOL;
-+       
-+    
-+    // SMARTPL.g:87:10: ( ( GREATER | GREATEREQUAL | LESS | LESSEQUAL | EQUAL ) )
-+    // SMARTPL.g:87:12: ( GREATER | GREATEREQUAL | LESS | LESSEQUAL | EQUAL )
-+    {
-+
-+        // SMARTPL.g:87:12: ( GREATER | GREATEREQUAL | LESS | LESSEQUAL | EQUAL )
-+        {
-+            int alt5=5;
-+            switch ( LA(1) ) 
-+            {
-+            case '>':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case '=':
-+                              {
-+                                      alt5=2;
-+                              }
-+                          break;
-+
-+                      default:
-+                          alt5=1;}
-+
-+              }
-+                break;
-+            case '<':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case '=':
-+                              {
-+                                      alt5=4;
-+                              }
-+                          break;
-+
-+                      default:
-+                          alt5=3;}
-+
-+              }
-+                break;
-+            case '=':
-+              {
-+                      alt5=5;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 5;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruleINTBOOLEx;
-+            }
-+
-+            switch (alt5) 
-+            {
-+              case 1:
-+                  // SMARTPL.g:87:13: GREATER
-+                  {
-+                      /* 87:13: GREATER */
-+                      mGREATER(ctx ); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleINTBOOLEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // SMARTPL.g:87:21: GREATEREQUAL
-+                  {
-+                      /* 87:21: GREATEREQUAL */
-+                      mGREATEREQUAL(ctx ); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleINTBOOLEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // SMARTPL.g:87:34: LESS
-+                  {
-+                      /* 87:34: LESS */
-+                      mLESS(ctx ); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleINTBOOLEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+              case 4:
-+                  // SMARTPL.g:87:39: LESSEQUAL
-+                  {
-+                      /* 87:39: LESSEQUAL */
-+                      mLESSEQUAL(ctx ); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleINTBOOLEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+              case 5:
-+                  // SMARTPL.g:87:49: EQUAL
-+                  {
-+                      /* 87:49: EQUAL */
-+                      mEQUAL(ctx ); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleINTBOOLEx;
-+                      }
-+
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleINTBOOLEx; /* Prevent compiler warnings */
-+    ruleINTBOOLEx: ;
-+
-+}
-+// $ANTLR end INTBOOL
-+
-+//   Comes from: 91:10: ( '>' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start GREATER
-+ *
-+ * Looks to match the characters the constitute the token GREATER
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mGREATER(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+        
-+    // SMARTPL.g:91:10: ( '>' )
-+    // SMARTPL.g:91:12: '>'
-+    {
-+        MATCHC('>'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleGREATEREx;
-+        }
-+
-+
-+    }
-+
-+
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleGREATEREx; /* Prevent compiler warnings */
-+    ruleGREATEREx: ;
-+
-+}
-+// $ANTLR end GREATER
-+
-+//   Comes from: 95:13: ( '>=' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start GREATEREQUAL
-+ *
-+ * Looks to match the characters the constitute the token GREATEREQUAL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mGREATEREQUAL(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+        
-+    // SMARTPL.g:95:13: ( '>=' )
-+    // SMARTPL.g:95:15: '>='
-+    {
-+        MATCHS(lit_20); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleGREATEREQUALEx;
-+        }
-+
-+
-+
-+    }
-+
-+
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleGREATEREQUALEx; /* Prevent compiler warnings */
-+    ruleGREATEREQUALEx: ;
-+
-+}
-+// $ANTLR end GREATEREQUAL
-+
-+//   Comes from: 99:7: ( '<' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LESS
-+ *
-+ * Looks to match the characters the constitute the token LESS
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLESS(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+        
-+    // SMARTPL.g:99:7: ( '<' )
-+    // SMARTPL.g:99:9: '<'
-+    {
-+        MATCHC('<'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleLESSEx;
-+        }
-+
-+
-+    }
-+
-+
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleLESSEx; /* Prevent compiler warnings */
-+    ruleLESSEx: ;
-+
-+}
-+// $ANTLR end LESS
-+
-+//   Comes from: 103:11: ( '<=' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LESSEQUAL
-+ *
-+ * Looks to match the characters the constitute the token LESSEQUAL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLESSEQUAL(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+        
-+    // SMARTPL.g:103:11: ( '<=' )
-+    // SMARTPL.g:103:13: '<='
-+    {
-+        MATCHS(lit_21); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleLESSEQUALEx;
-+        }
-+
-+
-+
-+    }
-+
-+
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleLESSEQUALEx; /* Prevent compiler warnings */
-+    ruleLESSEQUALEx: ;
-+
-+}
-+// $ANTLR end LESSEQUAL
-+
-+//   Comes from: 107:8: ( '=' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start EQUAL
-+ *
-+ * Looks to match the characters the constitute the token EQUAL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mEQUAL(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+        
-+    // SMARTPL.g:107:8: ( '=' )
-+    // SMARTPL.g:107:10: '='
-+    {
-+        MATCHC('='); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleEQUALEx;
-+        }
-+
-+
-+    }
-+
-+
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleEQUALEx; /* Prevent compiler warnings */
-+    ruleEQUALEx: ;
-+
-+}
-+// $ANTLR end EQUAL
-+
-+//   Comes from: 110:8: ( 'after' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start AFTER
-+ *
-+ * Looks to match the characters the constitute the token AFTER
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mAFTER(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = AFTER;
-+       
-+    
-+    // SMARTPL.g:110:8: ( 'after' )
-+    // SMARTPL.g:110:10: 'after'
-+    {
-+        MATCHS(lit_22); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleAFTEREx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleAFTEREx; /* Prevent compiler warnings */
-+    ruleAFTEREx: ;
-+
-+}
-+// $ANTLR end AFTER
-+
-+//   Comes from: 113:9: ( 'before' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start BEFORE
-+ *
-+ * Looks to match the characters the constitute the token BEFORE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mBEFORE(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = BEFORE;
-+       
-+    
-+    // SMARTPL.g:113:9: ( 'before' )
-+    // SMARTPL.g:113:11: 'before'
-+    {
-+        MATCHS(lit_23); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleBEFOREEx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleBEFOREEx; /* Prevent compiler warnings */
-+    ruleBEFOREEx: ;
-+
-+}
-+// $ANTLR end BEFORE
-+
-+//   Comes from: 116:7: ( 'ago' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start AGO
-+ *
-+ * Looks to match the characters the constitute the token AGO
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mAGO(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = AGO;
-+       
-+    
-+    // SMARTPL.g:116:7: ( 'ago' )
-+    // SMARTPL.g:116:9: 'ago'
-+    {
-+        MATCHS(lit_24); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleAGOEx;
-+        }
-+
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleAGOEx; /* Prevent compiler warnings */
-+    ruleAGOEx: ;
-+
-+}
-+// $ANTLR end AGO
-+
-+//   Comes from: 119:7: ( 'AND' | 'and' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start AND
-+ *
-+ * Looks to match the characters the constitute the token AND
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mAND(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = AND;
-+       
-+    
-+    {
-+        //  SMARTPL.g:119:7: ( 'AND' | 'and' )
-+        
-+        ANTLR3_UINT32 alt6;
-+
-+        alt6=2;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case 'A':
-+              {
-+                      alt6=1;
-+              }
-+            break;
-+        case 'a':
-+              {
-+                      alt6=2;
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 6;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleANDEx;
-+        }
-+
-+        switch (alt6) 
-+        {
-+      case 1:
-+          // SMARTPL.g:119:9: 'AND'
-+          {
-+              MATCHS(lit_25); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleANDEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // SMARTPL.g:120:6: 'and'
-+          {
-+              MATCHS(lit_26); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleANDEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleANDEx; /* Prevent compiler warnings */
-+    ruleANDEx: ;
-+
-+}
-+// $ANTLR end AND
-+
-+//   Comes from: 123:6: ( 'OR' | 'or' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start OR
-+ *
-+ * Looks to match the characters the constitute the token OR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mOR(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = OR;
-+       
-+    
-+    {
-+        //  SMARTPL.g:123:6: ( 'OR' | 'or' )
-+        
-+        ANTLR3_UINT32 alt7;
-+
-+        alt7=2;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case 'O':
-+              {
-+                      alt7=1;
-+              }
-+            break;
-+        case 'o':
-+              {
-+                      alt7=2;
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 7;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleOREx;
-+        }
-+
-+        switch (alt7) 
-+        {
-+      case 1:
-+          // SMARTPL.g:123:8: 'OR'
-+          {
-+              MATCHS(lit_27); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleOREx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // SMARTPL.g:124:6: 'or'
-+          {
-+              MATCHS(lit_28); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleOREx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleOREx; /* Prevent compiler warnings */
-+    ruleOREx: ;
-+
-+}
-+// $ANTLR end OR
-+
-+//   Comes from: 127:7: ( 'NOT' | 'not' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start NOT
-+ *
-+ * Looks to match the characters the constitute the token NOT
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mNOT(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = NOT;
-+       
-+    
-+    {
-+        //  SMARTPL.g:127:7: ( 'NOT' | 'not' )
-+        
-+        ANTLR3_UINT32 alt8;
-+
-+        alt8=2;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case 'N':
-+              {
-+                      alt8=1;
-+              }
-+            break;
-+        case 'n':
-+              {
-+                      alt8=2;
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 8;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleNOTEx;
-+        }
-+
-+        switch (alt8) 
-+        {
-+      case 1:
-+          // SMARTPL.g:127:9: 'NOT'
-+          {
-+              MATCHS(lit_29); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleNOTEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // SMARTPL.g:128:6: 'not'
-+          {
-+              MATCHS(lit_30); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleNOTEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleNOTEx; /* Prevent compiler warnings */
-+    ruleNOTEx: ;
-+
-+}
-+// $ANTLR end NOT
-+
-+//   Comes from: 131:7: ( '(' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LPAR
-+ *
-+ * Looks to match the characters the constitute the token LPAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLPAR(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = LPAR;
-+       
-+    
-+    // SMARTPL.g:131:7: ( '(' )
-+    // SMARTPL.g:131:9: '('
-+    {
-+        MATCHC('('); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleLPAREx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleLPAREx; /* Prevent compiler warnings */
-+    ruleLPAREx: ;
-+
-+}
-+// $ANTLR end LPAR
-+
-+//   Comes from: 134:7: ( ')' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start RPAR
-+ *
-+ * Looks to match the characters the constitute the token RPAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mRPAR(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = RPAR;
-+       
-+    
-+    // SMARTPL.g:134:7: ( ')' )
-+    // SMARTPL.g:134:9: ')'
-+    {
-+        MATCHC(')'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleRPAREx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleRPAREx; /* Prevent compiler warnings */
-+    ruleRPAREx: ;
-+
-+}
-+// $ANTLR end RPAR
-+
-+//   Comes from: 137:7: ( ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) '-' ( '0' .. '1' ) ( '0' .. '9' ) '-' ( '0' .. '3' ) ( '0' .. '9' ) | 'today' | 'yesterday' | 'last week' | 'last month' | 'last year' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DATE
-+ *
-+ * Looks to match the characters the constitute the token DATE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDATE(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = DATE;
-+       
-+    
-+    {
-+        //  SMARTPL.g:137:7: ( ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) '-' ( '0' .. '1' ) ( '0' .. '9' ) '-' ( '0' .. '3' ) ( '0' .. '9' ) | 'today' | 'yesterday' | 'last week' | 'last month' | 'last year' )
-+        
-+        ANTLR3_UINT32 alt9;
-+
-+        alt9=6;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case '0':
-+        case '1':
-+        case '2':
-+        case '3':
-+        case '4':
-+        case '5':
-+        case '6':
-+        case '7':
-+        case '8':
-+        case '9':
-+              {
-+                      alt9=1;
-+              }
-+            break;
-+        case 't':
-+              {
-+                      alt9=2;
-+              }
-+            break;
-+        case 'y':
-+              {
-+                      alt9=3;
-+              }
-+            break;
-+        case 'l':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'a':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 's':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 't':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case ' ':
-+                                                                              {
-+                                                                                      switch ( LA(6) ) 
-+                                                                                      {
-+                                                                                      case 'w':
-+                                                                                              {
-+                                                                                                      alt9=4;
-+                                                                                              }
-+                                                                                          break;
-+                                                                                      case 'm':
-+                                                                                              {
-+                                                                                                      alt9=5;
-+                                                                                              }
-+                                                                                          break;
-+                                                                                      case 'y':
-+                                                                                              {
-+                                                                                                      alt9=6;
-+                                                                                              }
-+                                                                                          break;
-+
-+                                                                                      default:
-+                                                                                          CONSTRUCTEX();
-+                                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                                                          EXCEPTION->message      = (void *)"";
-+                                                                                          EXCEPTION->decisionNum  = 9;
-+                                                                                          EXCEPTION->state        = 8;
-+
-+
-+                                                                                          goto ruleDATEEx;
-+                                                                                      }
-+
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          CONSTRUCTEX();
-+                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                                          EXCEPTION->message      = (void *)"";
-+                                                                          EXCEPTION->decisionNum  = 9;
-+                                                                          EXCEPTION->state        = 7;
-+
-+
-+                                                                          goto ruleDATEEx;
-+                                                                      }
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          CONSTRUCTEX();
-+                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                          EXCEPTION->message      = (void *)"";
-+                                                          EXCEPTION->decisionNum  = 9;
-+                                                          EXCEPTION->state        = 6;
-+
-+
-+                                                          goto ruleDATEEx;
-+                                                      }
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 9;
-+                                          EXCEPTION->state        = 5;
-+
-+
-+                                          goto ruleDATEEx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 9;
-+                          EXCEPTION->state        = 4;
-+
-+
-+                          goto ruleDATEEx;
-+                      }
-+
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 9;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleDATEEx;
-+        }
-+
-+        switch (alt9) 
-+        {
-+      case 1:
-+          // SMARTPL.g:137:9: ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) '-' ( '0' .. '1' ) ( '0' .. '9' ) '-' ( '0' .. '3' ) ( '0' .. '9' )
-+          {
-+              // SMARTPL.g:137:9: ( '0' .. '9' )
-+              // SMARTPL.g:137:10: '0' .. '9'
-+              {
-+                  MATCHRANGE('0', '9'); 
-+                  if  (HASEXCEPTION())
-+                  {
-+                      goto ruleDATEEx;
-+                  }
-+
-+
-+              }
-+
-+              // SMARTPL.g:137:19: ( '0' .. '9' )
-+              // SMARTPL.g:137:20: '0' .. '9'
-+              {
-+                  MATCHRANGE('0', '9'); 
-+                  if  (HASEXCEPTION())
-+                  {
-+                      goto ruleDATEEx;
-+                  }
-+
-+
-+              }
-+
-+              // SMARTPL.g:137:29: ( '0' .. '9' )
-+              // SMARTPL.g:137:30: '0' .. '9'
-+              {
-+                  MATCHRANGE('0', '9'); 
-+                  if  (HASEXCEPTION())
-+                  {
-+                      goto ruleDATEEx;
-+                  }
-+
-+
-+              }
-+
-+              // SMARTPL.g:137:39: ( '0' .. '9' )
-+              // SMARTPL.g:137:40: '0' .. '9'
-+              {
-+                  MATCHRANGE('0', '9'); 
-+                  if  (HASEXCEPTION())
-+                  {
-+                      goto ruleDATEEx;
-+                  }
-+
-+
-+              }
-+
-+              MATCHC('-'); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDATEEx;
-+              }
-+
-+              // SMARTPL.g:137:52: ( '0' .. '1' )
-+              // SMARTPL.g:137:53: '0' .. '1'
-+              {
-+                  MATCHRANGE('0', '1'); 
-+                  if  (HASEXCEPTION())
-+                  {
-+                      goto ruleDATEEx;
-+                  }
-+
-+
-+              }
-+
-+              // SMARTPL.g:137:62: ( '0' .. '9' )
-+              // SMARTPL.g:137:63: '0' .. '9'
-+              {
-+                  MATCHRANGE('0', '9'); 
-+                  if  (HASEXCEPTION())
-+                  {
-+                      goto ruleDATEEx;
-+                  }
-+
-+
-+              }
-+
-+              MATCHC('-'); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDATEEx;
-+              }
-+
-+              // SMARTPL.g:137:75: ( '0' .. '3' )
-+              // SMARTPL.g:137:76: '0' .. '3'
-+              {
-+                  MATCHRANGE('0', '3'); 
-+                  if  (HASEXCEPTION())
-+                  {
-+                      goto ruleDATEEx;
-+                  }
-+
-+
-+              }
-+
-+              // SMARTPL.g:137:85: ( '0' .. '9' )
-+              // SMARTPL.g:137:86: '0' .. '9'
-+              {
-+                  MATCHRANGE('0', '9'); 
-+                  if  (HASEXCEPTION())
-+                  {
-+                      goto ruleDATEEx;
-+                  }
-+
-+
-+              }
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // SMARTPL.g:138:6: 'today'
-+          {
-+              MATCHS(lit_31); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDATEEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 3:
-+          // SMARTPL.g:139:6: 'yesterday'
-+          {
-+              MATCHS(lit_32); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDATEEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 4:
-+          // SMARTPL.g:140:6: 'last week'
-+          {
-+              MATCHS(lit_33); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDATEEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 5:
-+          // SMARTPL.g:141:6: 'last month'
-+          {
-+              MATCHS(lit_34); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDATEEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 6:
-+          // SMARTPL.g:142:6: 'last year'
-+          {
-+              MATCHS(lit_35); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDATEEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleDATEEx; /* Prevent compiler warnings */
-+    ruleDATEEx: ;
-+
-+}
-+// $ANTLR end DATE
-+
-+//   Comes from: 145:13: ( 'days' | 'weeks' | 'months' | 'years' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DATINTERVAL
-+ *
-+ * Looks to match the characters the constitute the token DATINTERVAL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDATINTERVAL(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = DATINTERVAL;
-+       
-+    
-+    {
-+        //  SMARTPL.g:145:13: ( 'days' | 'weeks' | 'months' | 'years' )
-+        
-+        ANTLR3_UINT32 alt10;
-+
-+        alt10=4;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case 'd':
-+              {
-+                      alt10=1;
-+              }
-+            break;
-+        case 'w':
-+              {
-+                      alt10=2;
-+              }
-+            break;
-+        case 'm':
-+              {
-+                      alt10=3;
-+              }
-+            break;
-+        case 'y':
-+              {
-+                      alt10=4;
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 10;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleDATINTERVALEx;
-+        }
-+
-+        switch (alt10) 
-+        {
-+      case 1:
-+          // SMARTPL.g:145:15: 'days'
-+          {
-+              MATCHS(lit_36); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDATINTERVALEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // SMARTPL.g:146:6: 'weeks'
-+          {
-+              MATCHS(lit_37); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDATINTERVALEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 3:
-+          // SMARTPL.g:147:6: 'months'
-+          {
-+              MATCHS(lit_38); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDATINTERVALEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 4:
-+          // SMARTPL.g:148:6: 'years'
-+          {
-+              MATCHS(lit_39); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleDATINTERVALEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleDATINTERVALEx; /* Prevent compiler warnings */
-+    ruleDATINTERVALEx: ;
-+
-+}
-+// $ANTLR end DATINTERVAL
-+
-+//   Comes from: 151:10: ( 'music' | 'movie' | 'podcast' | 'audiobook' | 'tvshow' | 'file' | 'url' | 'spotify' | 'pipe' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start ENUMVAL
-+ *
-+ * Looks to match the characters the constitute the token ENUMVAL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mENUMVAL(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = ENUMVAL;
-+       
-+    
-+    {
-+        //  SMARTPL.g:151:10: ( 'music' | 'movie' | 'podcast' | 'audiobook' | 'tvshow' | 'file' | 'url' | 'spotify' | 'pipe' )
-+        
-+        ANTLR3_UINT32 alt11;
-+
-+        alt11=9;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case 'm':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'u':
-+                              {
-+                                      alt11=1;
-+                              }
-+                          break;
-+                      case 'o':
-+                              {
-+                                      alt11=2;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 11;
-+                          EXCEPTION->state        = 1;
-+
-+
-+                          goto ruleENUMVALEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'p':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'o':
-+                              {
-+                                      alt11=3;
-+                              }
-+                          break;
-+                      case 'i':
-+                              {
-+                                      alt11=9;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 11;
-+                          EXCEPTION->state        = 2;
-+
-+
-+                          goto ruleENUMVALEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'a':
-+              {
-+                      alt11=4;
-+              }
-+            break;
-+        case 't':
-+              {
-+                      alt11=5;
-+              }
-+            break;
-+        case 'f':
-+              {
-+                      alt11=6;
-+              }
-+            break;
-+        case 'u':
-+              {
-+                      alt11=7;
-+              }
-+            break;
-+        case 's':
-+              {
-+                      alt11=8;
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 11;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleENUMVALEx;
-+        }
-+
-+        switch (alt11) 
-+        {
-+      case 1:
-+          // SMARTPL.g:151:12: 'music'
-+          {
-+              MATCHS(lit_40); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleENUMVALEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // SMARTPL.g:152:6: 'movie'
-+          {
-+              MATCHS(lit_41); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleENUMVALEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 3:
-+          // SMARTPL.g:153:6: 'podcast'
-+          {
-+              MATCHS(lit_42); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleENUMVALEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 4:
-+          // SMARTPL.g:154:6: 'audiobook'
-+          {
-+              MATCHS(lit_43); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleENUMVALEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 5:
-+          // SMARTPL.g:155:6: 'tvshow'
-+          {
-+              MATCHS(lit_44); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleENUMVALEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 6:
-+          // SMARTPL.g:156:6: 'file'
-+          {
-+              MATCHS(lit_45); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleENUMVALEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 7:
-+          // SMARTPL.g:157:6: 'url'
-+          {
-+              MATCHS(lit_46); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleENUMVALEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 8:
-+          // SMARTPL.g:158:6: 'spotify'
-+          {
-+              MATCHS(lit_47); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleENUMVALEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+      case 9:
-+          // SMARTPL.g:159:6: 'pipe'
-+          {
-+              MATCHS(lit_48); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleENUMVALEx;
-+              }
-+
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleENUMVALEx; /* Prevent compiler warnings */
-+    ruleENUMVALEx: ;
-+
-+}
-+// $ANTLR end ENUMVAL
-+
-+//   Comes from: 162:7: ( '\"' (~ ( '\"' ) )+ '\"' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start STR
-+ *
-+ * Looks to match the characters the constitute the token STR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mSTR(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = STR;
-+       
-+    
-+    // SMARTPL.g:162:7: ( '\"' (~ ( '\"' ) )+ '\"' )
-+    // SMARTPL.g:162:9: '\"' (~ ( '\"' ) )+ '\"'
-+    {
-+        MATCHC('"'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleSTREx;
-+        }
-+
-+        // SMARTPL.g:162:13: (~ ( '\"' ) )+
-+        {
-+            int cnt12=0;
-+
-+            for (;;)
-+            {
-+                int alt12=2;
-+              {
-+                 /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
-+                  */
-+                  int LA12_0 = LA(1);
-+                  if ( (((LA12_0 >= 0x0000) && (LA12_0 <= '!')) || ((LA12_0 >= '#') && (LA12_0 <= 0xFFFF))) ) 
-+                  {
-+                      alt12=1;
-+                  }
-+
-+              }
-+              switch (alt12) 
-+              {
-+                  case 1:
-+                      // SMARTPL.g:162:13: ~ ( '\"' )
-+                      {
-+                          if ( ((LA(1) >= 0x0000) && (LA(1) <= '!')) || ((LA(1) >= '#') && (LA(1) <= 0xFFFF)) )
-+                          {
-+                              CONSUME();
-+
-+                          }
-+                          else 
-+                          {
-+                              CONSTRUCTEX();
-+                              EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+                              EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+                              LRECOVER();    goto ruleSTREx;
-+                          }
-+
-+
-+                      }
-+                      break;
-+
-+                  default:
-+                  
-+                      if ( cnt12 >= 1 )
-+                      {
-+                          goto loop12;
-+                      }
-+                      /* mismatchedSetEx()
-+                       */
-+                      CONSTRUCTEX();
-+                      EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
-+                      EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
-+
-+
-+                      goto ruleSTREx;
-+              }
-+              cnt12++;
-+            }
-+            loop12: ; /* Jump to here if this rule does not match */
-+        }
-+        MATCHC('"'); 
-+        if  (HASEXCEPTION())
-+        {
-+            goto ruleSTREx;
-+        }
-+
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleSTREx; /* Prevent compiler warnings */
-+    ruleSTREx: ;
-+
-+}
-+// $ANTLR end STR
-+
-+//   Comes from: 165:7: ( ( '0' .. '9' )+ )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start INT
-+ *
-+ * Looks to match the characters the constitute the token INT
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mINT(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = INT;
-+       
-+    
-+    // SMARTPL.g:165:7: ( ( '0' .. '9' )+ )
-+    // SMARTPL.g:165:9: ( '0' .. '9' )+
-+    {
-+        // SMARTPL.g:165:9: ( '0' .. '9' )+
-+        {
-+            int cnt13=0;
-+
-+            for (;;)
-+            {
-+                int alt13=2;
-+              switch ( LA(1) ) 
-+              {
-+              case '0':
-+              case '1':
-+              case '2':
-+              case '3':
-+              case '4':
-+              case '5':
-+              case '6':
-+              case '7':
-+              case '8':
-+              case '9':
-+                      {
-+                              alt13=1;
-+                      }
-+                  break;
-+
-+              }
-+
-+              switch (alt13) 
-+              {
-+                  case 1:
-+                      // SMARTPL.g:165:10: '0' .. '9'
-+                      {
-+                          MATCHRANGE('0', '9'); 
-+                          if  (HASEXCEPTION())
-+                          {
-+                              goto ruleINTEx;
-+                          }
-+
-+
-+                      }
-+                      break;
-+
-+                  default:
-+                  
-+                      if ( cnt13 >= 1 )
-+                      {
-+                          goto loop13;
-+                      }
-+                      /* mismatchedSetEx()
-+                       */
-+                      CONSTRUCTEX();
-+                      EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
-+                      EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
-+
-+
-+                      goto ruleINTEx;
-+              }
-+              cnt13++;
-+            }
-+            loop13: ; /* Jump to here if this rule does not match */
-+        }
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleINTEx; /* Prevent compiler warnings */
-+    ruleINTEx: ;
-+
-+}
-+// $ANTLR end INT
-+
-+//   Comes from: 168:12: ( ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' ) )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start WHITESPACE
-+ *
-+ * Looks to match the characters the constitute the token WHITESPACE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mWHITESPACE(pSMARTPLLexer ctx)
-+{
-+      ANTLR3_UINT32   _type;
-+
-+    _type         = WHITESPACE;
-+       
-+    
-+    // SMARTPL.g:168:12: ( ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' ) )
-+    // SMARTPL.g:168:14: ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' )
-+    {
-+        if ( ((LA(1) >= '\t') && (LA(1) <= '\n')) || ((LA(1) >= '\f') && (LA(1) <= '\r')) || LA(1) == ' ' )
-+        {
-+            CONSUME();
-+
-+        }
-+        else 
-+        {
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+            EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+            LRECOVER();    goto ruleWHITESPACEEx;
-+        }
-+
-+        {
-+             LEXSTATE->channel = HIDDEN; 
-+        }
-+
-+    }
-+
-+      LEXSTATE->type = _type;
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleWHITESPACEEx; /* Prevent compiler warnings */
-+    ruleWHITESPACEEx: ;
-+
-+}
-+// $ANTLR end WHITESPACE
-+
-+/** This is the entry point in to the lexer from an object that
-+ *  wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
-+ */
-+static void 
-+mTokens(pSMARTPLLexer ctx)
-+{
-+    {
-+        //  SMARTPL.g:1:8: ( T__30 | T__31 | STRTAG | INTTAG | DATETAG | ENUMTAG | INCLUDES | IS | INTBOOL | AFTER | BEFORE | AGO | AND | OR | NOT | LPAR | RPAR | DATE | DATINTERVAL | ENUMVAL | STR | INT | WHITESPACE )
-+        
-+        ANTLR3_UINT32 alt14;
-+
-+        alt14=23;
-+
-+        switch ( LA(1) ) 
-+        {
-+        case '{':
-+              {
-+                      alt14=1;
-+              }
-+            break;
-+        case '}':
-+              {
-+                      alt14=2;
-+              }
-+            break;
-+        case 'a':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'l':
-+                      case 'r':
-+                              {
-+                                      alt14=3;
-+                              }
-+                          break;
-+                      case 'f':
-+                              {
-+                                      alt14=10;
-+                              }
-+                          break;
-+                      case 'g':
-+                              {
-+                                      alt14=12;
-+                              }
-+                          break;
-+                      case 'n':
-+                              {
-+                                      alt14=13;
-+                              }
-+                          break;
-+                      case 'u':
-+                              {
-+                                      alt14=20;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 14;
-+                          EXCEPTION->state        = 3;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 't':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'i':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 't':
-+                                              {
-+                                                      alt14=3;
-+                                              }
-+                                          break;
-+                                      case 'm':
-+                                              {
-+                                                      alt14=5;
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 14;
-+                                          EXCEPTION->state        = 28;
-+
-+
-+                                          goto ruleTokensEx;
-+                                      }
-+
-+                              }
-+                          break;
-+                      case 'y':
-+                              {
-+                                      alt14=3;
-+                              }
-+                          break;
-+                      case 'o':
-+                              {
-+                                      alt14=18;
-+                              }
-+                          break;
-+                      case 'v':
-+                              {
-+                                      alt14=20;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 14;
-+                          EXCEPTION->state        = 4;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'g':
-+              {
-+                      alt14=3;
-+              }
-+            break;
-+        case 'c':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'o':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'm':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 'p':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 'o':
-+                                                                              {
-+                                                                                      alt14=3;
-+                                                                              }
-+                                                                          break;
-+                                                                      case 'i':
-+                                                                              {
-+                                                                                      alt14=4;
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          CONSTRUCTEX();
-+                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                                          EXCEPTION->message      = (void *)"";
-+                                                                          EXCEPTION->decisionNum  = 14;
-+                                                                          EXCEPTION->state        = 42;
-+
-+
-+                                                                          goto ruleTokensEx;
-+                                                                      }
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          CONSTRUCTEX();
-+                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                          EXCEPTION->message      = (void *)"";
-+                                                          EXCEPTION->decisionNum  = 14;
-+                                                          EXCEPTION->state        = 39;
-+
-+
-+                                                          goto ruleTokensEx;
-+                                                      }
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 14;
-+                                          EXCEPTION->state        = 29;
-+
-+
-+                                          goto ruleTokensEx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 14;
-+                          EXCEPTION->state        = 6;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'p':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'a':
-+                              {
-+                                      alt14=3;
-+                              }
-+                          break;
-+                      case 'l':
-+                              {
-+                                      alt14=4;
-+                              }
-+                          break;
-+                      case 'i':
-+                      case 'o':
-+                              {
-+                                      alt14=20;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 14;
-+                          EXCEPTION->state        = 7;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'r':
-+              {
-+                      alt14=4;
-+              }
-+            break;
-+        case 'y':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'e':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'a':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case 'r':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case 's':
-+                                                                              {
-+                                                                                      alt14=19;
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt14=4;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          CONSTRUCTEX();
-+                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                                          EXCEPTION->message      = (void *)"";
-+                                                          EXCEPTION->decisionNum  = 14;
-+                                                          EXCEPTION->state        = 40;
-+
-+
-+                                                          goto ruleTokensEx;
-+                                                      }
-+
-+                                              }
-+                                          break;
-+                                      case 's':
-+                                              {
-+                                                      alt14=18;
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 14;
-+                                          EXCEPTION->state        = 30;
-+
-+
-+                                          goto ruleTokensEx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 14;
-+                          EXCEPTION->state        = 9;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'd':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'a':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 't':
-+                                              {
-+                                                      alt14=6;
-+                                              }
-+                                          break;
-+                                      case 'y':
-+                                              {
-+                                                      alt14=19;
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 14;
-+                                          EXCEPTION->state        = 31;
-+
-+
-+                                          goto ruleTokensEx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 14;
-+                          EXCEPTION->state        = 10;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'm':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'e':
-+                              {
-+                                      alt14=6;
-+                              }
-+                          break;
-+                      case 'o':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case 'n':
-+                                              {
-+                                                      alt14=19;
-+                                              }
-+                                          break;
-+                                      case 'v':
-+                                              {
-+                                                      alt14=20;
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 14;
-+                                          EXCEPTION->state        = 33;
-+
-+
-+                                          goto ruleTokensEx;
-+                                      }
-+
-+                              }
-+                          break;
-+                      case 'u':
-+                              {
-+                                      alt14=20;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 14;
-+                          EXCEPTION->state        = 11;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case 'i':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case 'n':
-+                              {
-+                                      alt14=7;
-+                              }
-+                          break;
-+                      case 's':
-+                              {
-+                                      alt14=8;
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 14;
-+                          EXCEPTION->state        = 12;
-+
-+
-+                          goto ruleTokensEx;
-+                      }
-+
-+              }
-+            break;
-+        case '<':
-+        case '=':
-+        case '>':
-+              {
-+                      alt14=9;
-+              }
-+            break;
-+        case 'b':
-+              {
-+                      alt14=11;
-+              }
-+            break;
-+        case 'A':
-+              {
-+                      alt14=13;
-+              }
-+            break;
-+        case 'O':
-+        case 'o':
-+              {
-+                      alt14=14;
-+              }
-+            break;
-+        case 'N':
-+        case 'n':
-+              {
-+                      alt14=15;
-+              }
-+            break;
-+        case '(':
-+              {
-+                      alt14=16;
-+              }
-+            break;
-+        case ')':
-+              {
-+                      alt14=17;
-+              }
-+            break;
-+        case '0':
-+        case '1':
-+        case '2':
-+        case '3':
-+        case '4':
-+        case '5':
-+        case '6':
-+        case '7':
-+        case '8':
-+        case '9':
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case '0':
-+                      case '1':
-+                      case '2':
-+                      case '3':
-+                      case '4':
-+                      case '5':
-+                      case '6':
-+                      case '7':
-+                      case '8':
-+                      case '9':
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case '0':
-+                                      case '1':
-+                                      case '2':
-+                                      case '3':
-+                                      case '4':
-+                                      case '5':
-+                                      case '6':
-+                                      case '7':
-+                                      case '8':
-+                                      case '9':
-+                                              {
-+                                                      switch ( LA(4) ) 
-+                                                      {
-+                                                      case '0':
-+                                                      case '1':
-+                                                      case '2':
-+                                                      case '3':
-+                                                      case '4':
-+                                                      case '5':
-+                                                      case '6':
-+                                                      case '7':
-+                                                      case '8':
-+                                                      case '9':
-+                                                              {
-+                                                                      switch ( LA(5) ) 
-+                                                                      {
-+                                                                      case '-':
-+                                                                              {
-+                                                                                      alt14=18;
-+                                                                              }
-+                                                                          break;
-+
-+                                                                      default:
-+                                                                          alt14=22;}
-+
-+                                                              }
-+                                                          break;
-+
-+                                                      default:
-+                                                          alt14=22;}
-+
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          alt14=22;}
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          alt14=22;}
-+
-+              }
-+            break;
-+        case 'l':
-+              {
-+                      alt14=18;
-+              }
-+            break;
-+        case 'w':
-+              {
-+                      alt14=19;
-+              }
-+            break;
-+        case 'f':
-+        case 's':
-+        case 'u':
-+              {
-+                      alt14=20;
-+              }
-+            break;
-+        case '"':
-+              {
-+                      alt14=21;
-+              }
-+            break;
-+        case '\t':
-+        case '\n':
-+        case '\f':
-+        case '\r':
-+        case ' ':
-+              {
-+                      alt14=23;
-+              }
-+            break;
-+
-+        default:
-+            CONSTRUCTEX();
-+            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+            EXCEPTION->message      = (void *)"";
-+            EXCEPTION->decisionNum  = 14;
-+            EXCEPTION->state        = 0;
-+
-+
-+            goto ruleTokensEx;
-+        }
-+
-+        switch (alt14) 
-+        {
-+      case 1:
-+          // SMARTPL.g:1:10: T__30
-+          {
-+              /* 1:10: T__30 */
-+              mT__30(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 2:
-+          // SMARTPL.g:1:16: T__31
-+          {
-+              /* 1:16: T__31 */
-+              mT__31(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 3:
-+          // SMARTPL.g:1:22: STRTAG
-+          {
-+              /* 1:22: STRTAG */
-+              mSTRTAG(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 4:
-+          // SMARTPL.g:1:29: INTTAG
-+          {
-+              /* 1:29: INTTAG */
-+              mINTTAG(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 5:
-+          // SMARTPL.g:1:36: DATETAG
-+          {
-+              /* 1:36: DATETAG */
-+              mDATETAG(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 6:
-+          // SMARTPL.g:1:44: ENUMTAG
-+          {
-+              /* 1:44: ENUMTAG */
-+              mENUMTAG(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 7:
-+          // SMARTPL.g:1:52: INCLUDES
-+          {
-+              /* 1:52: INCLUDES */
-+              mINCLUDES(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 8:
-+          // SMARTPL.g:1:61: IS
-+          {
-+              /* 1:61: IS */
-+              mIS(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 9:
-+          // SMARTPL.g:1:64: INTBOOL
-+          {
-+              /* 1:64: INTBOOL */
-+              mINTBOOL(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 10:
-+          // SMARTPL.g:1:72: AFTER
-+          {
-+              /* 1:72: AFTER */
-+              mAFTER(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 11:
-+          // SMARTPL.g:1:78: BEFORE
-+          {
-+              /* 1:78: BEFORE */
-+              mBEFORE(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 12:
-+          // SMARTPL.g:1:85: AGO
-+          {
-+              /* 1:85: AGO */
-+              mAGO(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 13:
-+          // SMARTPL.g:1:89: AND
-+          {
-+              /* 1:89: AND */
-+              mAND(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 14:
-+          // SMARTPL.g:1:93: OR
-+          {
-+              /* 1:93: OR */
-+              mOR(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 15:
-+          // SMARTPL.g:1:96: NOT
-+          {
-+              /* 1:96: NOT */
-+              mNOT(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 16:
-+          // SMARTPL.g:1:100: LPAR
-+          {
-+              /* 1:100: LPAR */
-+              mLPAR(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 17:
-+          // SMARTPL.g:1:105: RPAR
-+          {
-+              /* 1:105: RPAR */
-+              mRPAR(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 18:
-+          // SMARTPL.g:1:110: DATE
-+          {
-+              /* 1:110: DATE */
-+              mDATE(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 19:
-+          // SMARTPL.g:1:115: DATINTERVAL
-+          {
-+              /* 1:115: DATINTERVAL */
-+              mDATINTERVAL(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 20:
-+          // SMARTPL.g:1:127: ENUMVAL
-+          {
-+              /* 1:127: ENUMVAL */
-+              mENUMVAL(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 21:
-+          // SMARTPL.g:1:135: STR
-+          {
-+              /* 1:135: STR */
-+              mSTR(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 22:
-+          // SMARTPL.g:1:139: INT
-+          {
-+              /* 1:139: INT */
-+              mINT(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+      case 23:
-+          // SMARTPL.g:1:143: WHITESPACE
-+          {
-+              /* 1:143: WHITESPACE */
-+              mWHITESPACE(ctx ); 
-+              if  (HASEXCEPTION())
-+              {
-+                  goto ruleTokensEx;
-+              }
-+
-+
-+          }
-+          break;
-+
-+        }
-+    }
-+
-+    
-+    goto ruleTokensEx; /* Prevent compiler warnings */
-+ruleTokensEx: ;
-+}
-+
-+/* =========================================================================
-+ * Lexer matching rules end.
-+ * =========================================================================
-+ */
-+/* End of Lexer code
-+ * ================================================
-+ * ================================================
-+ */ 
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/SMARTPLLexer.h b/src/pregen/SMARTPLLexer.h
-new file mode 100644
-index 0000000..87e8c7e
---- /dev/null
-+++ b/src/pregen/SMARTPLLexer.h
-@@ -0,0 +1,248 @@
-+/** \file
-+ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : SMARTPL.g
-+ *     -                            On : 2016-01-01 12:23:40
-+ *     -                 for the lexer : SMARTPLLexerLexer *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The lexer SMARTPLLexer has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ * 
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pSMARTPLLexer, which is returned from a call to SMARTPLLexerNew().
-+ *
-+ * As this is a generated lexer, it is unlikely you will call it 'manually'. However
-+ * the methods are provided anyway.
-+ * * The methods in pSMARTPLLexer are  as follows:
-+ *
-+ *  -  void      pSMARTPLLexer->T__30(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->T__31(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->STRTAG(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->INTTAG(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->DATETAG(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->ENUMTAG(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->INCLUDES(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->IS(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->INTBOOL(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->GREATER(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->GREATEREQUAL(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->LESS(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->LESSEQUAL(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->EQUAL(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->AFTER(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->BEFORE(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->AGO(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->AND(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->OR(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->NOT(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->LPAR(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->RPAR(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->DATE(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->DATINTERVAL(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->ENUMVAL(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->STR(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->INT(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->WHITESPACE(pSMARTPLLexer)
-+ *  -  void      pSMARTPLLexer->Tokens(pSMARTPLLexer)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+#ifndef       _SMARTPLLexer_H
-+#define _SMARTPLLexer_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include    <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+ 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct SMARTPLLexer_Ctx_struct SMARTPLLexer, * pSMARTPLLexer;
-+
-+
-+
-+#ifdef        ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
-+//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
-+//          initialized but unused variable                                   - tree rewrite variables declared but not needed
-+//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
-+//          potentially unitialized variable used                     - retval always returned from a rule 
-+//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+
-+/** Context tracking structure for SMARTPLLexer
-+ */
-+struct SMARTPLLexer_Ctx_struct
-+{
-+    /** Built in ANTLR3 context tracker contains all the generic elements
-+     *  required for context tracking.
-+     */
-+    pANTLR3_LEXER    pLexer;
-+
-+
-+     void (*mT__30)   (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mT__31)   (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mSTRTAG)  (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mINTTAG)  (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mDATETAG) (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mENUMTAG) (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mINCLUDES)        (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mIS)      (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mINTBOOL) (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mGREATER) (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mGREATEREQUAL)    (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mLESS)    (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mLESSEQUAL)       (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mEQUAL)   (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mAFTER)   (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mBEFORE)  (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mAGO)     (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mAND)     (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mOR)      (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mNOT)     (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mLPAR)    (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mRPAR)    (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mDATE)    (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mDATINTERVAL)     (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mENUMVAL) (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mSTR)     (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mINT)     (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mWHITESPACE)      (struct SMARTPLLexer_Ctx_struct * ctx);
-+     void (*mTokens)  (struct SMARTPLLexer_Ctx_struct * ctx);    const char * (*getGrammarFileName)();
-+    void          (*free)   (struct SMARTPLLexer_Ctx_struct * ctx);
-+        
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pSMARTPLLexer SMARTPLLexerNew         (pANTLR3_INPUT_STREAM instream);
-+ANTLR3_API pSMARTPLLexer SMARTPLLexerNewSSD      (pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the lexer will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef        EOF
-+#undef        EOF
-+#endif
-+#ifdef        Tokens
-+#undef        Tokens
-+#endif 
-+#define INTBOOL      14
-+#define STRTAG      10
-+#define AGO      22
-+#define WHITESPACE      29
-+#define GREATEREQUAL      25
-+#define BEFORE      18
-+#define DATETAG      16
-+#define INT      15
-+#define NOT      7
-+#define AFTER      17
-+#define AND      6
-+#define EOF      -1
-+#define INCLUDES      11
-+#define STR      4
-+#define T__30      30
-+#define T__31      31
-+#define GREATER      24
-+#define LPAR      8
-+#define ENUMTAG      19
-+#define IS      12
-+#define ENUMVAL      20
-+#define EQUAL      28
-+#define OR      5
-+#define LESS      26
-+#define RPAR      9
-+#define DATE      21
-+#define LESSEQUAL      27
-+#define INTTAG      13
-+#define DATINTERVAL      23
-+#ifdef        EOF
-+#undef        EOF
-+#define       EOF     ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for SMARTPLLexer
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/SMARTPLParser.c b/src/pregen/SMARTPLParser.c
-new file mode 100644
-index 0000000..f39e5ae
---- /dev/null
-+++ b/src/pregen/SMARTPLParser.c
-@@ -0,0 +1,1812 @@
-+/** \file
-+ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : SMARTPL.g
-+ *     -                            On : 2016-01-01 12:23:40
-+ *     -                for the parser : SMARTPLParserParser *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include    "SMARTPLParser.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+ 
-+#define               CTX     ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef        SCOPE_TYPE
-+#undef        SCOPE_STACK
-+#undef        SCOPE_TOP
-+#define       SCOPE_TYPE(scope)   pSMARTPLParser_##scope##_SCOPE
-+#define SCOPE_STACK(scope)  pSMARTPLParser_##scope##Stack
-+#define       SCOPE_TOP(scope)    ctx->pSMARTPLParser_##scope##Top
-+#define       SCOPE_SIZE(scope)               ctx->pSMARTPLParser_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+/* Macros for accessing things in the parser
-+ */
-+ 
-+#undef            PARSER                  
-+#undef            RECOGNIZER              
-+#undef            HAVEPARSEDRULE
-+#undef                MEMOIZE
-+#undef            INPUT
-+#undef            STRSTREAM
-+#undef            HASEXCEPTION
-+#undef            EXCEPTION
-+#undef            MATCHT
-+#undef            MATCHANYT
-+#undef            FOLLOWSTACK
-+#undef            FOLLOWPUSH
-+#undef            FOLLOWPOP
-+#undef            PRECOVER
-+#undef            PREPORTERROR
-+#undef            LA
-+#undef            LT
-+#undef            CONSTRUCTEX
-+#undef            CONSUME
-+#undef            MARK
-+#undef            REWIND
-+#undef            REWINDLAST
-+#undef            PERRORRECOVERY
-+#undef            HASFAILED
-+#undef            FAILEDFLAG
-+#undef            RECOVERFROMMISMATCHEDSET
-+#undef            RECOVERFROMMISMATCHEDELEMENT
-+#undef                INDEX
-+#undef      ADAPTOR
-+#undef                SEEK
-+#undef            RULEMEMO                
-+#undef                DBG
-+
-+#define           PARSER                                                      ctx->pParser  
-+#define           RECOGNIZER                                          PARSER->rec
-+#define               PSRSTATE                                                RECOGNIZER->state
-+#define           HAVEPARSEDRULE(r)                           RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define               MEMOIZE(ri,si)                                  RECOGNIZER->memoize(RECOGNIZER, ri, si)
-+#define           INPUT                                                       PARSER->tstream
-+#define           STRSTREAM                                           INPUT
-+#define               ISTREAM                                                 INPUT->istream
-+#define               INDEX()                                                 ISTREAM->index(INPUT->istream)
-+#define           HASEXCEPTION()                                      (PSRSTATE->error == ANTLR3_TRUE)
-+#define           EXCEPTION                                           PSRSTATE->exception
-+#define           MATCHT(t, fs)                                       RECOGNIZER->match(RECOGNIZER, t, fs)
-+#define           MATCHANYT()                                         RECOGNIZER->matchAny(RECOGNIZER)
-+#define           FOLLOWSTACK                                     PSRSTATE->following
-+#define           FOLLOWPUSH(x)                                       FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
-+#define           FOLLOWPOP()                                         FOLLOWSTACK->pop(FOLLOWSTACK)
-+#define           PRECOVER()                                          RECOGNIZER->recover(RECOGNIZER)
-+#define           PREPORTERROR()                                      RECOGNIZER->reportError(RECOGNIZER)
-+#define           LA(n)                                                       INPUT->istream->_LA(ISTREAM, n)
-+#define           LT(n)                                                       INPUT->_LT(INPUT, n)
-+#define           CONSTRUCTEX()                                       RECOGNIZER->exConstruct(RECOGNIZER)
-+#define           CONSUME()                                           ISTREAM->consume(ISTREAM)
-+#define           MARK()                                                      ISTREAM->mark(ISTREAM)
-+#define           REWIND(m)                                           ISTREAM->rewind(ISTREAM, m)
-+#define           REWINDLAST()                                        ISTREAM->rewindLast(ISTREAM)
-+#define               SEEK(n)                                                 ISTREAM->seek(ISTREAM, n)
-+#define           PERRORRECOVERY                                      PSRSTATE->errorRecovery
-+#define           FAILEDFLAG                                          PSRSTATE->failed
-+#define           HASFAILED()                                         (FAILEDFLAG == ANTLR3_TRUE)
-+#define           BACKTRACKING                                        PSRSTATE->backtracking
-+#define           RECOVERFROMMISMATCHEDSET(s)         RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
-+#define           RECOVERFROMMISMATCHEDELEMENT(e)     RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
-+#define     ADAPTOR                         ctx->adaptor
-+#define               RULEMEMO                                                PSRSTATE->ruleMemo
-+#define               DBG                                                             RECOGNIZER->debugger
-+
-+#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define           UP      ANTLR3_TOKEN_UP
-+#define           DOWN    ANTLR3_TOKEN_DOWN
-+#define           EOR     ANTLR3_TOKEN_EOR
-+#define           INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+
-+/** \brief Table of all token names in symbolic order, mainly used for
-+ *         error reporting.
-+ */
-+pANTLR3_UINT8   SMARTPLParserTokenNames[28+4]
-+     = {
-+        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
-+        (pANTLR3_UINT8) "<EOR>",
-+        (pANTLR3_UINT8) "<DOWN>", 
-+        (pANTLR3_UINT8) "<UP>", 
-+        (pANTLR3_UINT8) "STR",
-+        (pANTLR3_UINT8) "OR",
-+        (pANTLR3_UINT8) "AND",
-+        (pANTLR3_UINT8) "NOT",
-+        (pANTLR3_UINT8) "LPAR",
-+        (pANTLR3_UINT8) "RPAR",
-+        (pANTLR3_UINT8) "STRTAG",
-+        (pANTLR3_UINT8) "INCLUDES",
-+        (pANTLR3_UINT8) "IS",
-+        (pANTLR3_UINT8) "INTTAG",
-+        (pANTLR3_UINT8) "INTBOOL",
-+        (pANTLR3_UINT8) "INT",
-+        (pANTLR3_UINT8) "DATETAG",
-+        (pANTLR3_UINT8) "AFTER",
-+        (pANTLR3_UINT8) "BEFORE",
-+        (pANTLR3_UINT8) "ENUMTAG",
-+        (pANTLR3_UINT8) "ENUMVAL",
-+        (pANTLR3_UINT8) "DATE",
-+        (pANTLR3_UINT8) "AGO",
-+        (pANTLR3_UINT8) "DATINTERVAL",
-+        (pANTLR3_UINT8) "GREATER",
-+        (pANTLR3_UINT8) "GREATEREQUAL",
-+        (pANTLR3_UINT8) "LESS",
-+        (pANTLR3_UINT8) "LESSEQUAL",
-+        (pANTLR3_UINT8) "EQUAL",
-+        (pANTLR3_UINT8) "WHITESPACE",
-+        (pANTLR3_UINT8) "'{'",
-+        (pANTLR3_UINT8) "'}'"
-+       };
-+
-+        
-+
-+// Forward declare the locally static matching functions we have generated.
-+//
-+static SMARTPLParser_playlist_return  playlist    (pSMARTPLParser ctx);
-+static SMARTPLParser_expression_return        expression    (pSMARTPLParser ctx);
-+static SMARTPLParser_aexpr_return     aexpr    (pSMARTPLParser ctx);
-+static SMARTPLParser_nexpr_return     nexpr    (pSMARTPLParser ctx);
-+static SMARTPLParser_crit_return      crit    (pSMARTPLParser ctx);
-+static SMARTPLParser_dateval_return   dateval    (pSMARTPLParser ctx);
-+static SMARTPLParser_interval_return  interval    (pSMARTPLParser ctx);
-+static void   SMARTPLParserFree(pSMARTPLParser ctx);
-+/* For use in tree output where we are accumulating rule labels via label += ruleRef
-+ * we need a function that knows how to free a return scope when the list is destroyed. 
-+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
-+ */
-+static        void ANTLR3_CDECL freeScope(void * scope)
-+{
-+    ANTLR3_FREE(scope);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "SMARTPL.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+      return fileName;
-+}
-+/** \brief Create a new SMARTPLParser parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pSMARTPLParser
-+SMARTPLParserNew   (pANTLR3_COMMON_TOKEN_STREAM instream)
-+{
-+      // See if we can create a new parser with the standard constructor
-+      //
-+      return SMARTPLParserNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new SMARTPLParser parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pSMARTPLParser
-+SMARTPLParserNewSSD   (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+    pSMARTPLParser ctx;           /* Context structure we will build and return   */
-+    
-+    ctx       = (pSMARTPLParser) ANTLR3_CALLOC(1, sizeof(SMARTPLParser));
-+    
-+    if        (ctx == NULL)
-+    {
-+              // Failed to allocate memory for parser context
-+              //
-+        return  NULL;
-+    }
-+    
-+    /* -------------------------------------------------------------------
-+     * Memory for basic structure is allocated, now to fill in
-+     * the base ANTLR3 structures. We initialize the function pointers
-+     * for the standard ANTLR3 parser function set, but upon return
-+     * from here, the programmer may set the pointers to provide custom
-+     * implementations of each function. 
-+     *
-+     * We don't use the macros defined in SMARTPLParser.h here, in order that you can get a sense
-+     * of what goes where.
-+     */
-+
-+    /* Create a base parser/recognizer, using the supplied token stream
-+     */
-+    ctx->pParser          = antlr3ParserNewStream(ANTLR3_SIZE_HINT, instream->tstream, state);
-+    /* Install the implementation of our SMARTPLParser interface
-+     */
-+    ctx->playlist     = playlist;
-+    ctx->expression   = expression;
-+    ctx->aexpr        = aexpr;
-+    ctx->nexpr        = nexpr;
-+    ctx->crit = crit;
-+    ctx->dateval      = dateval;
-+    ctx->interval     = interval;
-+    ctx->free                 = SMARTPLParserFree;
-+    ctx->getGrammarFileName   = getGrammarFileName;
-+    
-+    /* Install the scope pushing methods.
-+     */
-+    ADAPTOR   = ANTLR3_TREE_ADAPTORNew(instream->tstream->tokenSource->strFactory);
-+    ctx->vectors      = antlr3VectorFactoryNew(0);
-+    
-+
-+      
-+    /* Install the token table
-+     */
-+    PSRSTATE->tokenNames   = SMARTPLParserTokenNames;
-+    
-+    
-+    /* Return the newly built parser to the caller
-+     */
-+    return  ctx;
-+}
-+
-+/** Free the parser resources
-+ */
-+ static void
-+ SMARTPLParserFree(pSMARTPLParser ctx)
-+ {
-+    /* Free any scope memory
-+     */
-+    
-+    ctx->vectors->close(ctx->vectors);
-+    /* We created the adaptor so we must free it
-+     */
-+    ADAPTOR->free(ADAPTOR);
-+      // Free this parser
-+      //
-+    ctx->pParser->free(ctx->pParser);
-+    ANTLR3_FREE(ctx);
-+
-+    /* Everything is released, so we can return
-+     */
-+    return;
-+ }
-+ 
-+/** Return token names used by this parser
-+ *
-+ * The returned pointer is used as an index into the token names table (using the token 
-+ * number as the index).
-+ * 
-+ * \return Pointer to first char * in the table.
-+ */
-+static pANTLR3_UINT8    *getTokenNames() 
-+{
-+        return SMARTPLParserTokenNames; 
-+}
-+
-+    
-+/* Declare the bitsets
-+ */
-+
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_playlist42  */
-+static        ANTLR3_BITWORD FOLLOW_STR_in_playlist42_bits[]  = { ANTLR3_UINT64_LIT(0x0000000040000000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STR_in_playlist42   = { FOLLOW_STR_in_playlist42_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_30_in_playlist44  */
-+static        ANTLR3_BITWORD FOLLOW_30_in_playlist44_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000092580) };
-+static  ANTLR3_BITSET_LIST FOLLOW_30_in_playlist44    = { FOLLOW_30_in_playlist44_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_playlist46  */
-+static        ANTLR3_BITWORD FOLLOW_expression_in_playlist46_bits[]   = { ANTLR3_UINT64_LIT(0x0000000080000000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expression_in_playlist46    = { FOLLOW_expression_in_playlist46_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_31_in_playlist48  */
-+static        ANTLR3_BITWORD FOLLOW_31_in_playlist48_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_31_in_playlist48    = { FOLLOW_31_in_playlist48_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_playlist50  */
-+static        ANTLR3_BITWORD FOLLOW_EOF_in_playlist50_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_EOF_in_playlist50   = { FOLLOW_EOF_in_playlist50_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expression62  */
-+static        ANTLR3_BITWORD FOLLOW_aexpr_in_expression62_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000022) };
-+static  ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expression62       = { FOLLOW_aexpr_in_expression62_bits, 1        };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OR_in_expression65  */
-+static        ANTLR3_BITWORD FOLLOW_OR_in_expression65_bits[] = { ANTLR3_UINT64_LIT(0x0000000000092580) };
-+static  ANTLR3_BITSET_LIST FOLLOW_OR_in_expression65  = { FOLLOW_OR_in_expression65_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expression68  */
-+static        ANTLR3_BITWORD FOLLOW_aexpr_in_expression68_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000022) };
-+static  ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expression68       = { FOLLOW_aexpr_in_expression68_bits, 1        };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_nexpr_in_aexpr83  */
-+static        ANTLR3_BITWORD FOLLOW_nexpr_in_aexpr83_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000042) };
-+static  ANTLR3_BITSET_LIST FOLLOW_nexpr_in_aexpr83    = { FOLLOW_nexpr_in_aexpr83_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AND_in_aexpr86  */
-+static        ANTLR3_BITWORD FOLLOW_AND_in_aexpr86_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000092580) };
-+static  ANTLR3_BITSET_LIST FOLLOW_AND_in_aexpr86      = { FOLLOW_AND_in_aexpr86_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_nexpr_in_aexpr89  */
-+static        ANTLR3_BITWORD FOLLOW_nexpr_in_aexpr89_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000042) };
-+static  ANTLR3_BITSET_LIST FOLLOW_nexpr_in_aexpr89    = { FOLLOW_nexpr_in_aexpr89_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_nexpr104  */
-+static        ANTLR3_BITWORD FOLLOW_NOT_in_nexpr104_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000092580) };
-+static  ANTLR3_BITSET_LIST FOLLOW_NOT_in_nexpr104     = { FOLLOW_NOT_in_nexpr104_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_nexpr107  */
-+static        ANTLR3_BITWORD FOLLOW_crit_in_nexpr107_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_crit_in_nexpr107    = { FOLLOW_crit_in_nexpr107_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_nexpr114  */
-+static        ANTLR3_BITWORD FOLLOW_crit_in_nexpr114_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_crit_in_nexpr114    = { FOLLOW_crit_in_nexpr114_bits, 1     };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAR_in_crit127  */
-+static        ANTLR3_BITWORD FOLLOW_LPAR_in_crit127_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000092580) };
-+static  ANTLR3_BITSET_LIST FOLLOW_LPAR_in_crit127     = { FOLLOW_LPAR_in_crit127_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_crit129  */
-+static        ANTLR3_BITWORD FOLLOW_expression_in_crit129_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000200) };
-+static  ANTLR3_BITSET_LIST FOLLOW_expression_in_crit129       = { FOLLOW_expression_in_crit129_bits, 1        };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAR_in_crit131  */
-+static        ANTLR3_BITWORD FOLLOW_RPAR_in_crit131_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_RPAR_in_crit131     = { FOLLOW_RPAR_in_crit131_bits, 1      };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRTAG_in_crit142  */
-+static        ANTLR3_BITWORD FOLLOW_STRTAG_in_crit142_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000001800) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STRTAG_in_crit142   = { FOLLOW_STRTAG_in_crit142_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_crit144  */
-+static        ANTLR3_BITWORD FOLLOW_set_in_crit144_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000010) };
-+static  ANTLR3_BITSET_LIST FOLLOW_set_in_crit144      = { FOLLOW_set_in_crit144_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_crit150  */
-+static        ANTLR3_BITWORD FOLLOW_STR_in_crit150_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_STR_in_crit150      = { FOLLOW_STR_in_crit150_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTTAG_in_crit157  */
-+static        ANTLR3_BITWORD FOLLOW_INTTAG_in_crit157_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000004000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INTTAG_in_crit157   = { FOLLOW_INTTAG_in_crit157_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTBOOL_in_crit159  */
-+static        ANTLR3_BITWORD FOLLOW_INTBOOL_in_crit159_bits[] = { ANTLR3_UINT64_LIT(0x0000000000008000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INTBOOL_in_crit159  = { FOLLOW_INTBOOL_in_crit159_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_crit161  */
-+static        ANTLR3_BITWORD FOLLOW_INT_in_crit161_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INT_in_crit161      = { FOLLOW_INT_in_crit161_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATETAG_in_crit168  */
-+static        ANTLR3_BITWORD FOLLOW_DATETAG_in_crit168_bits[] = { ANTLR3_UINT64_LIT(0x0000000000060000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DATETAG_in_crit168  = { FOLLOW_DATETAG_in_crit168_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_crit170  */
-+static        ANTLR3_BITWORD FOLLOW_set_in_crit170_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000208000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_set_in_crit170      = { FOLLOW_set_in_crit170_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateval_in_crit176  */
-+static        ANTLR3_BITWORD FOLLOW_dateval_in_crit176_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_dateval_in_crit176  = { FOLLOW_dateval_in_crit176_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENUMTAG_in_crit183  */
-+static        ANTLR3_BITWORD FOLLOW_ENUMTAG_in_crit183_bits[] = { ANTLR3_UINT64_LIT(0x0000000000001000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_ENUMTAG_in_crit183  = { FOLLOW_ENUMTAG_in_crit183_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_IS_in_crit185  */
-+static        ANTLR3_BITWORD FOLLOW_IS_in_crit185_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000100000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_IS_in_crit185       = { FOLLOW_IS_in_crit185_bits, 1        };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENUMVAL_in_crit187  */
-+static        ANTLR3_BITWORD FOLLOW_ENUMVAL_in_crit187_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_ENUMVAL_in_crit187  = { FOLLOW_ENUMVAL_in_crit187_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval200  */
-+static        ANTLR3_BITWORD FOLLOW_DATE_in_dateval200_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval200  = { FOLLOW_DATE_in_dateval200_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval207  */
-+static        ANTLR3_BITWORD FOLLOW_interval_in_dateval207_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000040000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval207      = { FOLLOW_interval_in_dateval207_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_dateval209  */
-+static        ANTLR3_BITWORD FOLLOW_BEFORE_in_dateval209_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000200000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_dateval209        = { FOLLOW_BEFORE_in_dateval209_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval211  */
-+static        ANTLR3_BITWORD FOLLOW_DATE_in_dateval211_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval211  = { FOLLOW_DATE_in_dateval211_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval218  */
-+static        ANTLR3_BITWORD FOLLOW_interval_in_dateval218_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000020000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval218      = { FOLLOW_interval_in_dateval218_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_dateval220  */
-+static        ANTLR3_BITWORD FOLLOW_AFTER_in_dateval220_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000200000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_AFTER_in_dateval220 = { FOLLOW_AFTER_in_dateval220_bits, 1  };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval222  */
-+static        ANTLR3_BITWORD FOLLOW_DATE_in_dateval222_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval222  = { FOLLOW_DATE_in_dateval222_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval229  */
-+static        ANTLR3_BITWORD FOLLOW_interval_in_dateval229_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000400000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval229      = { FOLLOW_interval_in_dateval229_bits, 1       };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AGO_in_dateval231  */
-+static        ANTLR3_BITWORD FOLLOW_AGO_in_dateval231_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_AGO_in_dateval231   = { FOLLOW_AGO_in_dateval231_bits, 1    };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_interval243  */
-+static        ANTLR3_BITWORD FOLLOW_INT_in_interval243_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000) };
-+static  ANTLR3_BITSET_LIST FOLLOW_INT_in_interval243  = { FOLLOW_INT_in_interval243_bits, 1   };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATINTERVAL_in_interval245  */
-+static        ANTLR3_BITWORD FOLLOW_DATINTERVAL_in_interval245_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static  ANTLR3_BITSET_LIST FOLLOW_DATINTERVAL_in_interval245  = { FOLLOW_DATINTERVAL_in_interval245_bits, 1   };
-+     
-+
-+ 
-+ 
-+/* ==============================================
-+ * Parsing rules
-+ */
-+/** 
-+ * $ANTLR start playlist
-+ * SMARTPL.g:27:1: playlist : STR '{' expression '}' EOF ;
-+ */
-+static SMARTPLParser_playlist_return
-+playlist(pSMARTPLParser ctx)
-+{   
-+    SMARTPLParser_playlist_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    STR1;
-+    pANTLR3_COMMON_TOKEN    char_literal2;
-+    pANTLR3_COMMON_TOKEN    char_literal4;
-+    pANTLR3_COMMON_TOKEN    EOF5;
-+    SMARTPLParser_expression_return expression3;
-+    #undef    RETURN_TYPE_expression3
-+    #define   RETURN_TYPE_expression3 SMARTPLParser_expression_return
-+
-+    pANTLR3_BASE_TREE STR1_tree;
-+    pANTLR3_BASE_TREE char_literal2_tree;
-+    pANTLR3_BASE_TREE char_literal4_tree;
-+    pANTLR3_BASE_TREE EOF5_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    STR1       = NULL;
-+    char_literal2       = NULL;
-+    char_literal4       = NULL;
-+    EOF5       = NULL;
-+    expression3.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    STR1_tree   = NULL;
-+    char_literal2_tree   = NULL;
-+    char_literal4_tree   = NULL;
-+    EOF5_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        // SMARTPL.g:27:10: ( STR '{' expression '}' EOF )
-+        // SMARTPL.g:27:12: STR '{' expression '}' EOF
-+        {
-+            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+            STR1 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_playlist42); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleplaylistEx;
-+            }
-+
-+            STR1_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STR1));
-+            ADAPTOR->addChild(ADAPTOR, root_0, STR1_tree);
-+
-+            char_literal2 = (pANTLR3_COMMON_TOKEN) MATCHT(30, &FOLLOW_30_in_playlist44); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleplaylistEx;
-+            }
-+
-+            char_literal2_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, char_literal2));
-+            ADAPTOR->addChild(ADAPTOR, root_0, char_literal2_tree);
-+
-+            FOLLOWPUSH(FOLLOW_expression_in_playlist46);
-+            expression3=expression(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleplaylistEx;
-+            }
-+
-+            ADAPTOR->addChild(ADAPTOR, root_0, expression3.tree);
-+            char_literal4 = (pANTLR3_COMMON_TOKEN) MATCHT(31, &FOLLOW_31_in_playlist48); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleplaylistEx;
-+            }
-+
-+            char_literal4_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, char_literal4));
-+            ADAPTOR->addChild(ADAPTOR, root_0, char_literal4_tree);
-+
-+            EOF5 = (pANTLR3_COMMON_TOKEN) MATCHT(EOF, &FOLLOW_EOF_in_playlist50); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleplaylistEx;
-+            }
-+
-+            EOF5_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, EOF5));
-+            ADAPTOR->addChild(ADAPTOR, root_0, EOF5_tree);
-+
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleplaylistEx; /* Prevent compiler warnings */
-+    ruleplaylistEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end playlist */
-+
-+/** 
-+ * $ANTLR start expression
-+ * SMARTPL.g:30:1: expression : aexpr ( OR aexpr )* ;
-+ */
-+static SMARTPLParser_expression_return
-+expression(pSMARTPLParser ctx)
-+{   
-+    SMARTPLParser_expression_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    OR7;
-+    SMARTPLParser_aexpr_return aexpr6;
-+    #undef    RETURN_TYPE_aexpr6
-+    #define   RETURN_TYPE_aexpr6 SMARTPLParser_aexpr_return
-+
-+    SMARTPLParser_aexpr_return aexpr8;
-+    #undef    RETURN_TYPE_aexpr8
-+    #define   RETURN_TYPE_aexpr8 SMARTPLParser_aexpr_return
-+
-+    pANTLR3_BASE_TREE OR7_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    OR7       = NULL;
-+    aexpr6.tree = NULL;
-+
-+    aexpr8.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    OR7_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        // SMARTPL.g:30:12: ( aexpr ( OR aexpr )* )
-+        // SMARTPL.g:30:14: aexpr ( OR aexpr )*
-+        {
-+            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+            FOLLOWPUSH(FOLLOW_aexpr_in_expression62);
-+            aexpr6=aexpr(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleexpressionEx;
-+            }
-+
-+            ADAPTOR->addChild(ADAPTOR, root_0, aexpr6.tree);
-+
-+            // SMARTPL.g:30:20: ( OR aexpr )*
-+
-+            for (;;)
-+            {
-+                int alt1=2;
-+                switch ( LA(1) ) 
-+                {
-+                case OR:
-+                      {
-+                              alt1=1;
-+                      }
-+                    break;
-+
-+                }
-+
-+                switch (alt1) 
-+                {
-+              case 1:
-+                  // SMARTPL.g:30:21: OR aexpr
-+                  {
-+                      OR7 = (pANTLR3_COMMON_TOKEN) MATCHT(OR, &FOLLOW_OR_in_expression65); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      OR7_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, OR7));
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, OR7_tree, root_0));
-+
-+                      FOLLOWPUSH(FOLLOW_aexpr_in_expression68);
-+                      aexpr8=aexpr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleexpressionEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, aexpr8.tree);
-+
-+                  }
-+                  break;
-+
-+              default:
-+                  goto loop1; /* break out of the loop */
-+                  break;
-+                }
-+            }
-+            loop1: ; /* Jump out to here if this rule does not match */
-+
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleexpressionEx; /* Prevent compiler warnings */
-+    ruleexpressionEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end expression */
-+
-+/** 
-+ * $ANTLR start aexpr
-+ * SMARTPL.g:33:1: aexpr : nexpr ( AND nexpr )* ;
-+ */
-+static SMARTPLParser_aexpr_return
-+aexpr(pSMARTPLParser ctx)
-+{   
-+    SMARTPLParser_aexpr_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    AND10;
-+    SMARTPLParser_nexpr_return nexpr9;
-+    #undef    RETURN_TYPE_nexpr9
-+    #define   RETURN_TYPE_nexpr9 SMARTPLParser_nexpr_return
-+
-+    SMARTPLParser_nexpr_return nexpr11;
-+    #undef    RETURN_TYPE_nexpr11
-+    #define   RETURN_TYPE_nexpr11 SMARTPLParser_nexpr_return
-+
-+    pANTLR3_BASE_TREE AND10_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    AND10       = NULL;
-+    nexpr9.tree = NULL;
-+
-+    nexpr11.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    AND10_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        // SMARTPL.g:33:8: ( nexpr ( AND nexpr )* )
-+        // SMARTPL.g:33:10: nexpr ( AND nexpr )*
-+        {
-+            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+            FOLLOWPUSH(FOLLOW_nexpr_in_aexpr83);
-+            nexpr9=nexpr(ctx);
-+
-+            FOLLOWPOP();
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleaexprEx;
-+            }
-+
-+            ADAPTOR->addChild(ADAPTOR, root_0, nexpr9.tree);
-+
-+            // SMARTPL.g:33:16: ( AND nexpr )*
-+
-+            for (;;)
-+            {
-+                int alt2=2;
-+                switch ( LA(1) ) 
-+                {
-+                case AND:
-+                      {
-+                              alt2=1;
-+                      }
-+                    break;
-+
-+                }
-+
-+                switch (alt2) 
-+                {
-+              case 1:
-+                  // SMARTPL.g:33:17: AND nexpr
-+                  {
-+                      AND10 = (pANTLR3_COMMON_TOKEN) MATCHT(AND, &FOLLOW_AND_in_aexpr86); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleaexprEx;
-+                      }
-+
-+                      AND10_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, AND10));
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, AND10_tree, root_0));
-+
-+                      FOLLOWPUSH(FOLLOW_nexpr_in_aexpr89);
-+                      nexpr11=nexpr(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruleaexprEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, nexpr11.tree);
-+
-+                  }
-+                  break;
-+
-+              default:
-+                  goto loop2; /* break out of the loop */
-+                  break;
-+                }
-+            }
-+            loop2: ; /* Jump out to here if this rule does not match */
-+
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleaexprEx; /* Prevent compiler warnings */
-+    ruleaexprEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end aexpr */
-+
-+/** 
-+ * $ANTLR start nexpr
-+ * SMARTPL.g:36:1: nexpr : ( NOT crit | crit );
-+ */
-+static SMARTPLParser_nexpr_return
-+nexpr(pSMARTPLParser ctx)
-+{   
-+    SMARTPLParser_nexpr_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    NOT12;
-+    SMARTPLParser_crit_return crit13;
-+    #undef    RETURN_TYPE_crit13
-+    #define   RETURN_TYPE_crit13 SMARTPLParser_crit_return
-+
-+    SMARTPLParser_crit_return crit14;
-+    #undef    RETURN_TYPE_crit14
-+    #define   RETURN_TYPE_crit14 SMARTPLParser_crit_return
-+
-+    pANTLR3_BASE_TREE NOT12_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    NOT12       = NULL;
-+    crit13.tree = NULL;
-+
-+    crit14.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    NOT12_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        {
-+            //  SMARTPL.g:36:8: ( NOT crit | crit )
-+            
-+            ANTLR3_UINT32 alt3;
-+
-+            alt3=2;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case NOT:
-+              {
-+                      alt3=1;
-+              }
-+                break;
-+            case LPAR:
-+            case STRTAG:
-+            case INTTAG:
-+            case DATETAG:
-+            case ENUMTAG:
-+              {
-+                      alt3=2;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 3;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto rulenexprEx;
-+            }
-+
-+            switch (alt3) 
-+            {
-+              case 1:
-+                  // SMARTPL.g:36:10: NOT crit
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      NOT12 = (pANTLR3_COMMON_TOKEN) MATCHT(NOT, &FOLLOW_NOT_in_nexpr104); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulenexprEx;
-+                      }
-+
-+                      NOT12_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, NOT12));
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, NOT12_tree, root_0));
-+
-+                      FOLLOWPUSH(FOLLOW_crit_in_nexpr107);
-+                      crit13=crit(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulenexprEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, crit13.tree);
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // SMARTPL.g:37:6: crit
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      FOLLOWPUSH(FOLLOW_crit_in_nexpr114);
-+                      crit14=crit(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulenexprEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, crit14.tree);
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto rulenexprEx; /* Prevent compiler warnings */
-+    rulenexprEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end nexpr */
-+
-+/** 
-+ * $ANTLR start crit
-+ * SMARTPL.g:40:1: crit : ( LPAR expression RPAR -> expression | STRTAG ( INCLUDES | IS ) STR | INTTAG INTBOOL INT | DATETAG ( AFTER | BEFORE ) dateval | ENUMTAG IS ENUMVAL );
-+ */
-+static SMARTPLParser_crit_return
-+crit(pSMARTPLParser ctx)
-+{   
-+    SMARTPLParser_crit_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    LPAR15;
-+    pANTLR3_COMMON_TOKEN    RPAR17;
-+    pANTLR3_COMMON_TOKEN    STRTAG18;
-+    pANTLR3_COMMON_TOKEN    set19;
-+    pANTLR3_COMMON_TOKEN    STR20;
-+    pANTLR3_COMMON_TOKEN    INTTAG21;
-+    pANTLR3_COMMON_TOKEN    INTBOOL22;
-+    pANTLR3_COMMON_TOKEN    INT23;
-+    pANTLR3_COMMON_TOKEN    DATETAG24;
-+    pANTLR3_COMMON_TOKEN    set25;
-+    pANTLR3_COMMON_TOKEN    ENUMTAG27;
-+    pANTLR3_COMMON_TOKEN    IS28;
-+    pANTLR3_COMMON_TOKEN    ENUMVAL29;
-+    SMARTPLParser_expression_return expression16;
-+    #undef    RETURN_TYPE_expression16
-+    #define   RETURN_TYPE_expression16 SMARTPLParser_expression_return
-+
-+    SMARTPLParser_dateval_return dateval26;
-+    #undef    RETURN_TYPE_dateval26
-+    #define   RETURN_TYPE_dateval26 SMARTPLParser_dateval_return
-+
-+    pANTLR3_BASE_TREE LPAR15_tree;
-+    pANTLR3_BASE_TREE RPAR17_tree;
-+    pANTLR3_BASE_TREE STRTAG18_tree;
-+    pANTLR3_BASE_TREE set19_tree;
-+    pANTLR3_BASE_TREE STR20_tree;
-+    pANTLR3_BASE_TREE INTTAG21_tree;
-+    pANTLR3_BASE_TREE INTBOOL22_tree;
-+    pANTLR3_BASE_TREE INT23_tree;
-+    pANTLR3_BASE_TREE DATETAG24_tree;
-+    pANTLR3_BASE_TREE set25_tree;
-+    pANTLR3_BASE_TREE ENUMTAG27_tree;
-+    pANTLR3_BASE_TREE IS28_tree;
-+    pANTLR3_BASE_TREE ENUMVAL29_tree;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_RPAR;
-+    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LPAR;
-+    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expression;
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    LPAR15       = NULL;
-+    RPAR17       = NULL;
-+    STRTAG18       = NULL;
-+    set19       = NULL;
-+    STR20       = NULL;
-+    INTTAG21       = NULL;
-+    INTBOOL22       = NULL;
-+    INT23       = NULL;
-+    DATETAG24       = NULL;
-+    set25       = NULL;
-+    ENUMTAG27       = NULL;
-+    IS28       = NULL;
-+    ENUMVAL29       = NULL;
-+    expression16.tree = NULL;
-+
-+    dateval26.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    LPAR15_tree   = NULL;
-+    RPAR17_tree   = NULL;
-+    STRTAG18_tree   = NULL;
-+    set19_tree   = NULL;
-+    STR20_tree   = NULL;
-+    INTTAG21_tree   = NULL;
-+    INTBOOL22_tree   = NULL;
-+    INT23_tree   = NULL;
-+    DATETAG24_tree   = NULL;
-+    set25_tree   = NULL;
-+    ENUMTAG27_tree   = NULL;
-+    IS28_tree   = NULL;
-+    ENUMVAL29_tree   = NULL;
-+
-+    stream_RPAR   = NULL;
-+    #define CREATE_stream_RPAR  if (stream_RPAR == NULL) {stream_RPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token RPAR"); } 
-+    stream_LPAR   = NULL;
-+    #define CREATE_stream_LPAR  if (stream_LPAR == NULL) {stream_LPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LPAR"); } 
-+    stream_expression   = NULL;
-+    #define CREATE_stream_expression  if (stream_expression == NULL) {stream_expression = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expression"); }
-+
-+    retval.tree  = NULL;
-+    {
-+        {
-+            //  SMARTPL.g:40:7: ( LPAR expression RPAR -> expression | STRTAG ( INCLUDES | IS ) STR | INTTAG INTBOOL INT | DATETAG ( AFTER | BEFORE ) dateval | ENUMTAG IS ENUMVAL )
-+            
-+            ANTLR3_UINT32 alt4;
-+
-+            alt4=5;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case LPAR:
-+              {
-+                      alt4=1;
-+              }
-+                break;
-+            case STRTAG:
-+              {
-+                      alt4=2;
-+              }
-+                break;
-+            case INTTAG:
-+              {
-+                      alt4=3;
-+              }
-+                break;
-+            case DATETAG:
-+              {
-+                      alt4=4;
-+              }
-+                break;
-+            case ENUMTAG:
-+              {
-+                      alt4=5;
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 4;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto rulecritEx;
-+            }
-+
-+            switch (alt4) 
-+            {
-+              case 1:
-+                  // SMARTPL.g:40:9: LPAR expression RPAR
-+                  {
-+                      LPAR15 = (pANTLR3_COMMON_TOKEN) MATCHT(LPAR, &FOLLOW_LPAR_in_crit127); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+                       
-+                      CREATE_stream_LPAR; stream_LPAR->add(stream_LPAR, LPAR15, NULL);
-+
-+                      FOLLOWPUSH(FOLLOW_expression_in_crit129);
-+                      expression16=expression(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      CREATE_stream_expression; stream_expression->add(stream_expression, expression16.tree, NULL);
-+                      RPAR17 = (pANTLR3_COMMON_TOKEN) MATCHT(RPAR, &FOLLOW_RPAR_in_crit131); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+                       
-+                      CREATE_stream_RPAR; stream_RPAR->add(stream_RPAR, RPAR17, NULL);
-+
-+
-+                       
-+                      /* AST REWRITE
-+                       * elements          : expression
-+                       * token labels      : 
-+                       * rule labels       : retval
-+                       * token list labels : 
-+                       * rule list labels  : 
-+                       */
-+                      {
-+                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+                              retval.tree    = root_0;
-+                              // 40:30: -> expression
-+                              {
-+                                  ADAPTOR->addChild(ADAPTOR, root_0, stream_expression == NULL ? NULL : stream_expression->nextTree(stream_expression));
-+
-+                              }
-+
-+                              retval.tree = root_0; // set result root
-+                              if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+                      }
-+                  }
-+                  break;
-+              case 2:
-+                  // SMARTPL.g:41:6: STRTAG ( INCLUDES | IS ) STR
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      STRTAG18 = (pANTLR3_COMMON_TOKEN) MATCHT(STRTAG, &FOLLOW_STRTAG_in_crit142); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      STRTAG18_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STRTAG18));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, STRTAG18_tree);
-+
-+                      set19=(pANTLR3_COMMON_TOKEN)LT(1);
-+                      if ( ((LA(1) >= INCLUDES) && (LA(1) <= IS)) )
-+                      {
-+                          CONSUME();
-+                          ADAPTOR->addChild(ADAPTOR, root_0, (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set19)));
-+                          PERRORRECOVERY=ANTLR3_FALSE;
-+                      }
-+                      else 
-+                      {
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+                          EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+                          EXCEPTION->expectingSet = &FOLLOW_set_in_crit144;
-+                          RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_crit144);    goto rulecritEx;
-+                      }
-+
-+                      STR20 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_crit150); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      STR20_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STR20));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, STR20_tree);
-+
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // SMARTPL.g:42:6: INTTAG INTBOOL INT
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      INTTAG21 = (pANTLR3_COMMON_TOKEN) MATCHT(INTTAG, &FOLLOW_INTTAG_in_crit157); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      INTTAG21_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, INTTAG21));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, INTTAG21_tree);
-+
-+                      INTBOOL22 = (pANTLR3_COMMON_TOKEN) MATCHT(INTBOOL, &FOLLOW_INTBOOL_in_crit159); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      INTBOOL22_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, INTBOOL22));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, INTBOOL22_tree);
-+
-+                      INT23 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_crit161); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      INT23_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, INT23));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, INT23_tree);
-+
-+
-+                  }
-+                  break;
-+              case 4:
-+                  // SMARTPL.g:43:6: DATETAG ( AFTER | BEFORE ) dateval
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      DATETAG24 = (pANTLR3_COMMON_TOKEN) MATCHT(DATETAG, &FOLLOW_DATETAG_in_crit168); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      DATETAG24_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATETAG24));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, DATETAG24_tree);
-+
-+                      set25=(pANTLR3_COMMON_TOKEN)LT(1);
-+                      if ( ((LA(1) >= AFTER) && (LA(1) <= BEFORE)) )
-+                      {
-+                          CONSUME();
-+                          ADAPTOR->addChild(ADAPTOR, root_0, (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set25)));
-+                          PERRORRECOVERY=ANTLR3_FALSE;
-+                      }
-+                      else 
-+                      {
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+                          EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+                          EXCEPTION->expectingSet = &FOLLOW_set_in_crit170;
-+                          RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_crit170);    goto rulecritEx;
-+                      }
-+
-+                      FOLLOWPUSH(FOLLOW_dateval_in_crit176);
-+                      dateval26=dateval(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, dateval26.tree);
-+
-+                  }
-+                  break;
-+              case 5:
-+                  // SMARTPL.g:44:6: ENUMTAG IS ENUMVAL
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      ENUMTAG27 = (pANTLR3_COMMON_TOKEN) MATCHT(ENUMTAG, &FOLLOW_ENUMTAG_in_crit183); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      ENUMTAG27_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, ENUMTAG27));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, ENUMTAG27_tree);
-+
-+                      IS28 = (pANTLR3_COMMON_TOKEN) MATCHT(IS, &FOLLOW_IS_in_crit185); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      IS28_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, IS28));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, IS28_tree);
-+
-+                      ENUMVAL29 = (pANTLR3_COMMON_TOKEN) MATCHT(ENUMVAL, &FOLLOW_ENUMVAL_in_crit187); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto rulecritEx;
-+                      }
-+
-+                      ENUMVAL29_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, ENUMVAL29));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, ENUMVAL29_tree);
-+
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto rulecritEx; /* Prevent compiler warnings */
-+    rulecritEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+        if (stream_RPAR != NULL) stream_RPAR->free(stream_RPAR);
-+        if (stream_LPAR != NULL) stream_LPAR->free(stream_LPAR);
-+        if (stream_expression != NULL) stream_expression->free(stream_expression);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end crit */
-+
-+/** 
-+ * $ANTLR start dateval
-+ * SMARTPL.g:47:1: dateval : ( DATE | interval BEFORE DATE | interval AFTER DATE | interval AGO );
-+ */
-+static SMARTPLParser_dateval_return
-+dateval(pSMARTPLParser ctx)
-+{   
-+    SMARTPLParser_dateval_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    DATE30;
-+    pANTLR3_COMMON_TOKEN    BEFORE32;
-+    pANTLR3_COMMON_TOKEN    DATE33;
-+    pANTLR3_COMMON_TOKEN    AFTER35;
-+    pANTLR3_COMMON_TOKEN    DATE36;
-+    pANTLR3_COMMON_TOKEN    AGO38;
-+    SMARTPLParser_interval_return interval31;
-+    #undef    RETURN_TYPE_interval31
-+    #define   RETURN_TYPE_interval31 SMARTPLParser_interval_return
-+
-+    SMARTPLParser_interval_return interval34;
-+    #undef    RETURN_TYPE_interval34
-+    #define   RETURN_TYPE_interval34 SMARTPLParser_interval_return
-+
-+    SMARTPLParser_interval_return interval37;
-+    #undef    RETURN_TYPE_interval37
-+    #define   RETURN_TYPE_interval37 SMARTPLParser_interval_return
-+
-+    pANTLR3_BASE_TREE DATE30_tree;
-+    pANTLR3_BASE_TREE BEFORE32_tree;
-+    pANTLR3_BASE_TREE DATE33_tree;
-+    pANTLR3_BASE_TREE AFTER35_tree;
-+    pANTLR3_BASE_TREE DATE36_tree;
-+    pANTLR3_BASE_TREE AGO38_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    DATE30       = NULL;
-+    BEFORE32       = NULL;
-+    DATE33       = NULL;
-+    AFTER35       = NULL;
-+    DATE36       = NULL;
-+    AGO38       = NULL;
-+    interval31.tree = NULL;
-+
-+    interval34.tree = NULL;
-+
-+    interval37.tree = NULL;
-+
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    DATE30_tree   = NULL;
-+    BEFORE32_tree   = NULL;
-+    DATE33_tree   = NULL;
-+    AFTER35_tree   = NULL;
-+    DATE36_tree   = NULL;
-+    AGO38_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        {
-+            //  SMARTPL.g:47:10: ( DATE | interval BEFORE DATE | interval AFTER DATE | interval AGO )
-+            
-+            ANTLR3_UINT32 alt5;
-+
-+            alt5=4;
-+
-+            switch ( LA(1) ) 
-+            {
-+            case DATE:
-+              {
-+                      alt5=1;
-+              }
-+                break;
-+            case INT:
-+              {
-+                      switch ( LA(2) ) 
-+                      {
-+                      case DATINTERVAL:
-+                              {
-+                                      switch ( LA(3) ) 
-+                                      {
-+                                      case AGO:
-+                                              {
-+                                                      alt5=4;
-+                                              }
-+                                          break;
-+                                      case AFTER:
-+                                              {
-+                                                      alt5=3;
-+                                              }
-+                                          break;
-+                                      case BEFORE:
-+                                              {
-+                                                      alt5=2;
-+                                              }
-+                                          break;
-+
-+                                      default:
-+                                          CONSTRUCTEX();
-+                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                                          EXCEPTION->message      = (void *)"";
-+                                          EXCEPTION->decisionNum  = 5;
-+                                          EXCEPTION->state        = 3;
-+
-+
-+                                          goto ruledatevalEx;
-+                                      }
-+
-+                              }
-+                          break;
-+
-+                      default:
-+                          CONSTRUCTEX();
-+                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                          EXCEPTION->message      = (void *)"";
-+                          EXCEPTION->decisionNum  = 5;
-+                          EXCEPTION->state        = 2;
-+
-+
-+                          goto ruledatevalEx;
-+                      }
-+
-+              }
-+                break;
-+
-+            default:
-+                CONSTRUCTEX();
-+                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+                EXCEPTION->message      = (void *)"";
-+                EXCEPTION->decisionNum  = 5;
-+                EXCEPTION->state        = 0;
-+
-+
-+                goto ruledatevalEx;
-+            }
-+
-+            switch (alt5) 
-+            {
-+              case 1:
-+                  // SMARTPL.g:47:12: DATE
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      DATE30 = (pANTLR3_COMMON_TOKEN) MATCHT(DATE, &FOLLOW_DATE_in_dateval200); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      DATE30_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATE30));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, DATE30_tree);
-+
-+
-+                  }
-+                  break;
-+              case 2:
-+                  // SMARTPL.g:48:6: interval BEFORE DATE
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      FOLLOWPUSH(FOLLOW_interval_in_dateval207);
-+                      interval31=interval(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, interval31.tree);
-+                      BEFORE32 = (pANTLR3_COMMON_TOKEN) MATCHT(BEFORE, &FOLLOW_BEFORE_in_dateval209); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      BEFORE32_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, BEFORE32));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, BEFORE32_tree);
-+
-+                      DATE33 = (pANTLR3_COMMON_TOKEN) MATCHT(DATE, &FOLLOW_DATE_in_dateval211); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      DATE33_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATE33));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, DATE33_tree);
-+
-+
-+                  }
-+                  break;
-+              case 3:
-+                  // SMARTPL.g:49:6: interval AFTER DATE
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      FOLLOWPUSH(FOLLOW_interval_in_dateval218);
-+                      interval34=interval(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, interval34.tree);
-+                      AFTER35 = (pANTLR3_COMMON_TOKEN) MATCHT(AFTER, &FOLLOW_AFTER_in_dateval220); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      AFTER35_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, AFTER35));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, AFTER35_tree);
-+
-+                      DATE36 = (pANTLR3_COMMON_TOKEN) MATCHT(DATE, &FOLLOW_DATE_in_dateval222); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      DATE36_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATE36));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, DATE36_tree);
-+
-+
-+                  }
-+                  break;
-+              case 4:
-+                  // SMARTPL.g:50:6: interval AGO
-+                  {
-+                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+                      FOLLOWPUSH(FOLLOW_interval_in_dateval229);
-+                      interval37=interval(ctx);
-+
-+                      FOLLOWPOP();
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      ADAPTOR->addChild(ADAPTOR, root_0, interval37.tree);
-+                      AGO38 = (pANTLR3_COMMON_TOKEN) MATCHT(AGO, &FOLLOW_AGO_in_dateval231); 
-+                      if  (HASEXCEPTION())
-+                      {
-+                          goto ruledatevalEx;
-+                      }
-+
-+                      AGO38_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, AGO38));
-+                      ADAPTOR->addChild(ADAPTOR, root_0, AGO38_tree);
-+
-+
-+                  }
-+                  break;
-+
-+            }
-+        }
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruledatevalEx; /* Prevent compiler warnings */
-+    ruledatevalEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end dateval */
-+
-+/** 
-+ * $ANTLR start interval
-+ * SMARTPL.g:53:1: interval : INT DATINTERVAL ;
-+ */
-+static SMARTPLParser_interval_return
-+interval(pSMARTPLParser ctx)
-+{   
-+    SMARTPLParser_interval_return retval;
-+
-+    pANTLR3_BASE_TREE root_0;
-+
-+    pANTLR3_COMMON_TOKEN    INT39;
-+    pANTLR3_COMMON_TOKEN    DATINTERVAL40;
-+
-+    pANTLR3_BASE_TREE INT39_tree;
-+    pANTLR3_BASE_TREE DATINTERVAL40_tree;
-+
-+    /* Initialize rule variables
-+     */
-+
-+
-+    root_0 = NULL;
-+
-+    INT39       = NULL;
-+    DATINTERVAL40       = NULL;
-+    retval.start = LT(1); retval.stop = retval.start;
-+
-+    INT39_tree   = NULL;
-+    DATINTERVAL40_tree   = NULL;
-+
-+
-+    retval.tree  = NULL;
-+    {
-+        // SMARTPL.g:53:10: ( INT DATINTERVAL )
-+        // SMARTPL.g:53:12: INT DATINTERVAL
-+        {
-+            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+            INT39 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_interval243); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleintervalEx;
-+            }
-+
-+            INT39_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, INT39));
-+            ADAPTOR->addChild(ADAPTOR, root_0, INT39_tree);
-+
-+            DATINTERVAL40 = (pANTLR3_COMMON_TOKEN) MATCHT(DATINTERVAL, &FOLLOW_DATINTERVAL_in_interval245); 
-+            if  (HASEXCEPTION())
-+            {
-+                goto ruleintervalEx;
-+            }
-+
-+            DATINTERVAL40_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATINTERVAL40));
-+            ADAPTOR->addChild(ADAPTOR, root_0, DATINTERVAL40_tree);
-+
-+
-+        }
-+
-+    }
-+    
-+
-+    // This is where rules clean up and exit
-+    //
-+    goto ruleintervalEx; /* Prevent compiler warnings */
-+    ruleintervalEx: ;
-+    retval.stop = LT(-1);
-+
-+      retval.stop = LT(-1);
-+      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+            if (HASEXCEPTION())
-+            {
-+                PREPORTERROR();
-+                PRECOVER();
-+                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+            }
-+
-+
-+    return retval;
-+}
-+/* $ANTLR end interval */
-+/* End of parsing rules
-+ * ==============================================
-+ */
-+
-+/* ==============================================
-+ * Syntactic predicates
-+ */
-+/* End of syntactic predicates
-+ * ==============================================
-+ */
-+
-+ 
-+ 
-+
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/SMARTPLParser.h b/src/pregen/SMARTPLParser.h
-new file mode 100644
-index 0000000..38ef500
---- /dev/null
-+++ b/src/pregen/SMARTPLParser.h
-@@ -0,0 +1,285 @@
-+/** \file
-+ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ *     -  From the grammar source file : SMARTPL.g
-+ *     -                            On : 2016-01-01 12:23:40
-+ *     -                for the parser : SMARTPLParserParser *
-+ * Editing it, at least manually, is not wise. 
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The parser SMARTPLParser has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ * 
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pSMARTPLParser, which is returned from a call to SMARTPLParserNew().
-+ *
-+ * The methods in pSMARTPLParser are  as follows:
-+ *
-+ *  - SMARTPLParser_playlist_return      pSMARTPLParser->playlist(pSMARTPLParser)
-+ *  - SMARTPLParser_expression_return      pSMARTPLParser->expression(pSMARTPLParser)
-+ *  - SMARTPLParser_aexpr_return      pSMARTPLParser->aexpr(pSMARTPLParser)
-+ *  - SMARTPLParser_nexpr_return      pSMARTPLParser->nexpr(pSMARTPLParser)
-+ *  - SMARTPLParser_crit_return      pSMARTPLParser->crit(pSMARTPLParser)
-+ *  - SMARTPLParser_dateval_return      pSMARTPLParser->dateval(pSMARTPLParser)
-+ *  - SMARTPLParser_interval_return      pSMARTPLParser->interval(pSMARTPLParser)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+//    notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+//    notice, this list of conditions and the following disclaimer in the
-+//    documentation and/or other materials provided with the distribution.
-+// 3. The name of the author may not be used to endorse or promote products
-+//    derived from this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-+// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+#ifndef       _SMARTPLParser_H
-+#define _SMARTPLParser_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include    <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+ 
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct SMARTPLParser_Ctx_struct SMARTPLParser, * pSMARTPLParser;
-+
-+
-+
-+#ifdef        ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
-+//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
-+//          initialized but unused variable                                   - tree rewrite variables declared but not needed
-+//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
-+//          potentially unitialized variable used                     - retval always returned from a rule 
-+//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+typedef struct SMARTPLParser_playlist_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    SMARTPLParser_playlist_return;
-+
-+typedef struct SMARTPLParser_expression_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    SMARTPLParser_expression_return;
-+
-+typedef struct SMARTPLParser_aexpr_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    SMARTPLParser_aexpr_return;
-+
-+typedef struct SMARTPLParser_nexpr_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    SMARTPLParser_nexpr_return;
-+
-+typedef struct SMARTPLParser_crit_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    SMARTPLParser_crit_return;
-+
-+typedef struct SMARTPLParser_dateval_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    SMARTPLParser_dateval_return;
-+
-+typedef struct SMARTPLParser_interval_return_struct
-+{
-+    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+     */
-+    pANTLR3_COMMON_TOKEN    start;
-+    pANTLR3_COMMON_TOKEN    stop;
-+    pANTLR3_BASE_TREE tree;
-+   
-+}
-+    SMARTPLParser_interval_return;
-+
-+
-+
-+/** Context tracking structure for SMARTPLParser
-+ */
-+struct SMARTPLParser_Ctx_struct
-+{
-+    /** Built in ANTLR3 context tracker contains all the generic elements
-+     *  required for context tracking.
-+     */
-+    pANTLR3_PARSER   pParser;
-+
-+
-+     SMARTPLParser_playlist_return (*playlist)        (struct SMARTPLParser_Ctx_struct * ctx);
-+     SMARTPLParser_expression_return (*expression)    (struct SMARTPLParser_Ctx_struct * ctx);
-+     SMARTPLParser_aexpr_return (*aexpr)      (struct SMARTPLParser_Ctx_struct * ctx);
-+     SMARTPLParser_nexpr_return (*nexpr)      (struct SMARTPLParser_Ctx_struct * ctx);
-+     SMARTPLParser_crit_return (*crit)        (struct SMARTPLParser_Ctx_struct * ctx);
-+     SMARTPLParser_dateval_return (*dateval)  (struct SMARTPLParser_Ctx_struct * ctx);
-+     SMARTPLParser_interval_return (*interval)        (struct SMARTPLParser_Ctx_struct * ctx);
-+    // Delegated rules
-+    const char * (*getGrammarFileName)();
-+    void          (*free)   (struct SMARTPLParser_Ctx_struct * ctx);
-+    /* @headerFile.members() */
-+    pANTLR3_BASE_TREE_ADAPTOR adaptor;
-+    pANTLR3_VECTOR_FACTORY            vectors;
-+    /* End @headerFile.members() */
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pSMARTPLParser SMARTPLParserNew         (pANTLR3_COMMON_TOKEN_STREAM instream);
-+ANTLR3_API pSMARTPLParser SMARTPLParserNewSSD      (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the parser will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef        EOF
-+#undef        EOF
-+#endif
-+#ifdef        Tokens
-+#undef        Tokens
-+#endif 
-+#define INTBOOL      14
-+#define STRTAG      10
-+#define AGO      22
-+#define WHITESPACE      29
-+#define GREATEREQUAL      25
-+#define BEFORE      18
-+#define DATETAG      16
-+#define INT      15
-+#define NOT      7
-+#define AFTER      17
-+#define AND      6
-+#define EOF      -1
-+#define INCLUDES      11
-+#define STR      4
-+#define T__30      30
-+#define T__31      31
-+#define GREATER      24
-+#define LPAR      8
-+#define ENUMTAG      19
-+#define IS      12
-+#define ENUMVAL      20
-+#define EQUAL      28
-+#define OR      5
-+#define LESS      26
-+#define RPAR      9
-+#define DATE      21
-+#define LESSEQUAL      27
-+#define DATINTERVAL      23
-+#define INTTAG      13
-+#ifdef        EOF
-+#undef        EOF
-+#define       EOF     ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for SMARTPLParser
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
diff --git a/sound/forked-daapd/patches/010-use_a_wrapper_for_dmap_find_field.patch b/sound/forked-daapd/patches/010-use_a_wrapper_for_dmap_find_field.patch
new file mode 100644 (file)
index 0000000..bbbd2cc
--- /dev/null
@@ -0,0 +1,103 @@
+From 1b8adc11edec48a9b8fcb75b9efdaf618a6744bd Mon Sep 17 00:00:00 2001
+From: ejurgensen <espenjurgensen@gmail.com>
+Date: Fri, 25 Aug 2017 19:27:41 +0200
+Subject: [PATCH] [dmap] Use a wrapper for dmap_find_field() Avoids the need to
+ have definition of dmap_find_field in dmap_common.h that must be kept in sync
+ with the definition that gperf generates.
+
+Also should fix compilation problems when gperf is not present, ref pr #390
+---
+ configure.ac      | 21 ---------------------
+ src/dmap_common.c |  6 ++++++
+ src/dmap_common.h |  4 +---
+ src/httpd_daap.c  |  2 +-
+ 4 files changed, 8 insertions(+), 25 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9b149be..9819c82 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -32,27 +32,6 @@ to install it.]])],
+               [AC_MSG_ERROR([[GNU gperf required, please install it.]])])
+       ])
+-GPERF_TEST="$(echo foo,bar | ${GPERF} -L ANSI-C)"
+-
+-AC_COMPILE_IFELSE(
+-      [AC_LANG_PROGRAM([
+-              #include <string.h>
+-              const char * in_word_set(const char *, size_t);
+-              $GPERF_TEST]
+-      )],
+-      [GPERF_LEN_TYPE=size_t],
+-      [AC_COMPILE_IFELSE(
+-              [AC_LANG_PROGRAM([
+-                      #include <string.h>
+-                      const char * in_word_set(const char *, unsigned);
+-                      $GPERF_TEST]
+-              )],
+-              [GPERF_LEN_TYPE=unsigned],
+-              [AC_MSG_ERROR([** unable to determine gperf len type])]
+-      )]
+-)
+-
+-AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type])
+ AC_PATH_PROG([ANTLR], [[antlr3]])
+ AS_IF([[test -z "$ANTLR"]],
+       [AS_IF([[test -f "$srcdir/src/SMARTPLLexer.h"]],
+diff --git a/src/dmap_common.c b/src/dmap_common.c
+index 250a2d1..b2bc362 100644
+--- a/src/dmap_common.c
++++ b/src/dmap_common.c
+@@ -42,6 +42,12 @@ dmap_get_fields_table(int *nfields)
+   return dmap_fields;
+ }
++// This wrapper is so callers don't need to include dmap_fields_hash.h
++const struct dmap_field *
++dmap_find_field_wrapper(const char *str, int len)
++{
++  return dmap_find_field(str, len);
++}
+ void
+ dmap_add_container(struct evbuffer *evbuf, const char *tag, int len)
+diff --git a/src/dmap_common.h b/src/dmap_common.h
+index 93a2bdc..73f72d0 100644
+--- a/src/dmap_common.h
++++ b/src/dmap_common.h
+@@ -2,7 +2,6 @@
+ #ifndef __DMAP_HELPERS_H__
+ #define __DMAP_HELPERS_H__
+-#include "config.h"
+ #include <event2/buffer.h>
+ #include <event2/http.h>
+@@ -45,9 +44,8 @@ extern const struct dmap_field_map dfm_dmap_aeSP;
+ const struct dmap_field *
+ dmap_get_fields_table(int *nfields);
+-/* From dmap_fields.gperf - keep in sync, don't alter */
+ const struct dmap_field *
+-dmap_find_field (register const char *str, register GPERF_LEN_TYPE len);
++dmap_find_field_wrapper(const char *str, int len);
+ void
+diff --git a/src/httpd_daap.c b/src/httpd_daap.c
+index aef2fe0..0564275 100644
+--- a/src/httpd_daap.c
++++ b/src/httpd_daap.c
+@@ -738,7 +738,7 @@ parse_meta(struct evhttp_request *req, char *tag, const char *param, const struc
+       if (n == i)
+       {
+-        meta[i] = dmap_find_field(field, strlen(field));
++        meta[i] = dmap_find_field_wrapper(field, strlen(field));
+         if (!meta[i])
+           {
+-- 
+2.7.4
+
diff --git a/sound/lame/Config.in b/sound/lame/Config.in
new file mode 100644 (file)
index 0000000..1e52519
--- /dev/null
@@ -0,0 +1,12 @@
+menu "Configuration"
+       depends on PACKAGE_lame-lib
+
+config LAME-LIB_OPTIMIZE_SPEED
+       bool "Optimize for speed"
+       default n
+       help
+               This enables additional experimental
+               optmization and increases performance 
+               considerably at the expense of binary size.
+
+endmenu
index 41a90f7d5670d5cce65b120f0c5f10477cc138c0..45cd14d4c3fc5dbf08158e0ebd7e6aead90c3223 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lame
-PKG_VERSION:=3.99.5
-PKG_RELEASE:=2
+PKG_VERSION:=3.100
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/lame
-PKG_MD5SUM:=84835b313d4a8b68f5349816d33e07ce
+PKG_HASH:=ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e
 PKG_FIXUP:=autoreconf
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
@@ -22,6 +22,8 @@ PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=LGPL-2.0
 PKG_LICENSE_FILES:=COPYING LICENSE
 
+PKG_CONFIG_DEPENDS:= CONFIG_LAME-LIB_OPTIMIZE_SPEED
+
 include $(INCLUDE_DIR)/package.mk
 
 PKG_INSTALL=1
@@ -30,20 +32,23 @@ define Package/lame/Default
   SECTION:=sound
   CATEGORY:=Sound
   URL:=http://sourceforge.net/projects/lame
-  DEPENDS:=@BUILD_PATENTED
 endef
 
 define Package/lame
 $(call Package/lame/Default)
   TITLE:=lame
   MENU:=1
-  DEPENDS += +libncurses
+  DEPENDS += +libncurses +lame-lib
 endef
 
 define Package/lame/description
 lame mp3 encoder
 endef
 
+define Package/lame-lib/config
+       source "$(SOURCE)/Config.in"
+endef
+
 define Package/lame-lib
 $(call Package/lame/Default)
   TITLE:=lame-lib
@@ -53,12 +58,17 @@ define Package/lame-lib/description
 lame mp3 encoder libs
 endef
 
-CONFIG_VARS+=NASM=no
-
 ifeq ($(ARCH),i386)
 TARGET_CFLAGS+=-msse
 endif
 
+ifeq ($(CONFIG_LAME-LIB_OPTIMIZE_SPEED),y)
+       TARGET_CFLAGS += $(TARGET_CFLAGS) -O3 -ffast-math
+       TARGET_CFLAGS := $(filter-out -Os,$(TARGET_CFLAGS))
+endif
+
+CONFIGURE_ARGS += --disable-gtktest --disable-static
+
 define Package/lame/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lame $(1)/usr/bin/
diff --git a/sound/lame/patches/001-automake-compat.patch b/sound/lame/patches/001-automake-compat.patch
deleted file mode 100644 (file)
index 8857ad7..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
---- a/configure.in
-+++ b/configure.in
-@@ -393,7 +393,7 @@ CONFIG_MATH_LIB="${USE_LIBM}"
- dnl configure use of features
--AM_PATH_GTK(1.2.0, HAVE_GTK="yes", HAVE_GTK="no")
-+HAVE_GTK="no"
- dnl ElectricFence malloc debugging
- AC_MSG_CHECKING(use of ElectricFence malloc debugging)
---- a/frontend/Makefile.am
-+++ b/frontend/Makefile.am
-@@ -35,7 +35,7 @@ lame_SOURCES = lame_main.c $(common_sour
- mp3rtp_SOURCES = mp3rtp.c rtp.c $(common_sources)
- mp3x_SOURCES = mp3x.c gtkanal.c gpkplotting.c $(common_sources)
--CFLAGS = @CFLAGS@ @GTK_CFLAGS@ @FRONTEND_CFLAGS@ @SNDFILE_CFLAGS@
-+CFLAGS = @CFLAGS@ @FRONTEND_CFLAGS@ @SNDFILE_CFLAGS@
- LDFLAGS = @LDFLAGS@ @FRONTEND_LDFLAGS@ @SNDFILE_LIBS@
- INCLUDES = -I$(top_srcdir)/libmp3lame -I$(top_srcdir)/include -I$(top_builddir)
---- a/frontend/Makefile.in
-+++ b/frontend/Makefile.in
-@@ -99,7 +99,7 @@ AUTOMAKE = @AUTOMAKE@
- AWK = @AWK@
- CC = @CC@
- CCDEPMODE = @CCDEPMODE@
--CFLAGS = @CFLAGS@ @GTK_CFLAGS@ @FRONTEND_CFLAGS@ @SNDFILE_CFLAGS@
-+CFLAGS = @CFLAGS@ @FRONTEND_CFLAGS@ @SNDFILE_CFLAGS@
- CONFIG_DEFS = @CONFIG_DEFS@
- CONFIG_MATH_LIB = @CONFIG_MATH_LIB@
- CPP = @CPP@
index 00a1b490de7e438a5a268f1e207e44b7191c2cd6..068280f3657ee13c44295ad25fa976ca17c56f5e 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=6
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/mad \
        ftp://ftp.mars.org/pub/mpeg/
-PKG_MD5SUM:=6814b47ceaa99880c754c5195aa1aac1
+PKG_HASH:=5a79c7516ff7560dffc6a14399a389432bc619c905b13d3b73da22fa65acede0
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Simon Peter <probono@puredarwin.org>
index 93f9c6faf89fe41554522b28c945646b0a52282d..8860ce19528d8674bd60415227f4c036c9e78ff4 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=moc
 PKG_VERSION:=2.5.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://ftp.daper.net/pub/soft/moc/stable/
-PKG_MD5SUM:=f3a68115602a4788b7cfa9bbe9397a9d5e24c68cb61a57695d1c2c3ecf49db08
+PKG_HASH:=f3a68115602a4788b7cfa9bbe9397a9d5e24c68cb61a57695d1c2c3ecf49db08
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
@@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/nls.mk
 define Package/moc
   SECTION:=sound
   CATEGORY:=Sound
-  DEPENDS:=+libcurl +BUILD_PATENTED:libmad +libvorbis $(ICONV_DEPENDS) +alsa-lib +libid3tag +libflac +libsamplerate +libncursesw +libffmpeg +libltdl +libmagic +faad2 +libdb47
+  DEPENDS:=+libcurl $(ICONV_DEPENDS) +alsa-lib +libid3tag +libsamplerate +libncursesw +libffmpeg +libltdl +libmagic +libdb47
   TITLE:=Music On Console
   URL:=http://moc.daper.net/
 endef
@@ -43,16 +43,18 @@ TARGET_CFLAGS+=-D_GNU_SOURCE
 TARGET_CPPFLAGS+=-P
 
 CONFIGURE_ARGS+= \
-               $(if $(CONFIG_BUILD_PATENTED),,--without-mp3) \
                --enable-shared \
                --disable-static \
                --disable-debug \
                --without-speex \
-               --without-samplerate \
-               --without-curl \
+               --without-aac \
                --without-flac \
+               --without-mp3 \
                --without-musepack \
                --without-rcc \
+               --without-sndfile \
+               --without-vorbis \
+               --without-wavpack \
                $(if $(CONFIG_PACKAGE_libncursesw),--with-ncursesw --without-ncurses,--with-ncurses --without-ncursesw) \
                --with-bdb-dir="$(STAGING_DIR)/usr"
 
index 3109b1c0889c5b398a733a052ccbe3a5bb6ddc19..e5277f14997bf16d54cc5d32e8c0e42335bbbba2 100644 (file)
@@ -1,6 +1,4 @@
 #
-# 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 +6,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mpc
-PKG_VERSION:=0.27
+PKG_VERSION:=0.28
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.musicpd.org/download/mpc/0
-PKG_MD5SUM:=d9430db9b9d7fb1eadbe4d13e8d97c66
+PKG_HASH:=a4337d06c85dc81a638821d30fce8a137a58d13d510be34a11c1cce95cabc547
+
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
index 162660ab0baa80ab4d481ee1b9f7bf54dd48502c..771984cba3ec9caf435fc2963108f8b08bbc73de 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2015-2016 Ted Hess
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -8,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mpd
-PKG_VERSION:=0.19.19
+PKG_VERSION:=0.20.9
 PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://www.musicpd.org/download/mpd/0.19/
-PKG_MD5SUM:=6e4fca9a9c26dad08b61bac9a91802db
+PKG_SOURCE_URL:=http://www.musicpd.org/download/mpd/0.20/
+PKG_HASH:=cd77a2869e32354b004cc6b34fcb0bee56114caa2d9ed862aaa8071441e34eb7
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=GPL-2.0
@@ -26,6 +24,7 @@ PKG_CONFIG_DEPENDS:= \
        CONFIG_IPV6 \
 
 PKG_INSTALL:=1
+PKG_USE_MIPS16:=0
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
@@ -35,9 +34,8 @@ define Package/mpd/Default
   CATEGORY:=Sound
   TITLE:=Music Player Daemon
   URL:=http://www.musicpd.org/
-  DEPENDS:= +glib2 +libcurl +libpthread +libmpdclient +libstdcpp $(ICONV_DEPENDS) \
-           +libflac +BUILD_PATENTED:libmad +libvorbisidec +AUDIO_SUPPORT:alsa-lib \
-            +boost +boost-container +libexpat
+  DEPENDS:= +zlib +libcurl +libpthread +libmpdclient +libstdcpp $(ICONV_DEPENDS) \
+           +AUDIO_SUPPORT:alsa-lib +boost +boost-container +libexpat
 endef
 
 define Package/mpd/Default/description
@@ -50,9 +48,7 @@ endef
 define Package/mpd-full
 $(call Package/mpd/Default)
   TITLE+= (full)
-  DEPENDS+= \
-       +libaudiofile +BUILD_PATENTED:libfaad2 +libffmpeg +libid3tag \
-       +libmms +libogg +libsndfile +libvorbis +libupnp
+  DEPENDS+= +libffmpeg +libid3tag +libmms +libupnp +libshout
   PROVIDES:=mpd
   VARIANT:=full
 endef
@@ -70,6 +66,7 @@ endef
 define Package/mpd-mini
 $(call Package/mpd/Default)
   TITLE+= (mini)
+  DEPENDS+= +libflac +libmpg123 +libvorbisidec
   PROVIDES:=mpd
   VARIANT:=mini
 endef
@@ -102,83 +99,77 @@ define Package/mpd-avahi-service/conffiles
 /etc/avahi/services/mpd.service
 endef
 
+EXTRA_LDFLAGS += $(if $(ICONV_FULL),-liconv,-Wl,--whole-archive -liconv -Wl,--no-whole-archive)
+EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_VERSION_4_8),-std=gnu++11,-std=gnu++14)
+
 CONFIGURE_ARGS += \
        $(call autoconf_bool,CONFIG_IPV6,ipv6) \
        --disable-debug \
        --disable-documentation \
        --disable-test \
-       --disable-werror \
-       \
+       --disable-aac \
+       --disable-adplug \
        --disable-ao \
+       --disable-audiofile \
        --disable-bzip2 \
+       --disable-cdio-paranoia \
        --disable-fluidsynth \
        --disable-wildmidi \
        --disable-gme \
        --enable-inotify \
        --disable-icu \
-       --disable-eventfd \
+       --enable-iconv \
        --disable-iso9660 \
        --disable-jack \
        --disable-roar \
        --disable-libwrap \
        --disable-lsr \
+       --disable-mad \
        --disable-mikmod \
        --disable-modplug \
        --disable-mpc \
-       --disable-mpg123 \
+       --disable-nfs \
        --disable-openal \
        --disable-opus \
        --disable-pulse \
        --disable-sidplay \
+       --disable-smbclient \
+       --disable-sndfile \
        --disable-solaris-output \
        --disable-sqlite \
+       --disable-systemd-daemon \
        --disable-lame-encoder \
        --disable-twolame-encoder \
        --disable-shine-encoder \
+       --disable-vorbis-encoder \
        --enable-wave-encoder \
        --disable-wavpack \
+       --disable-webdav \
        --disable-wildmidi \
        --disable-zzip \
        --with-zeroconf=no \
        --disable-soxr \
-       \
        --enable-curl \
-       --enable-flac \
        --enable-httpd-output \
-       $(call autoconf_bool,CONFIG_BUILD_PATENTED,mad) \
        $(call autoconf_bool,CONFIG_AUDIO_SUPPORT,alsa) \
        --enable-tcp \
-       --enable-un \
-
-CONFIGURE_VARS += \
-       FLAC_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/FLAC" \
-       FLAC_LIBS="$(TARGET_LDFLAGS) -lFLAC" \
-       $(if $(CONFIG_BUILD_PATENTED),MAD_CFLAGS="$(TARGET_CFLAGS)") \
-       $(if $(CONFIG_BUILD_PATENTED),MAD_LIBS="$(TARGET_LDFLAGS) -lmad") \
+       --disable-sndio \
+       --disable-haiku
 
-TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib $(if $(ICONV_FULL),-liconv)
 
 ifeq ($(BUILD_VARIANT),full)
 
   CONFIGURE_ARGS += \
        --enable-upnp \
-       $(call autoconf_bool,CONFIG_BUILD_PATENTED,aac) \
-       --enable-audiofile \
-       --enable-fifo \
        --enable-ffmpeg \
+       --disable-flac \
        --enable-id3 \
-       --enable-lastfm \
        --enable-mms \
-       --enable-oggflac \
+       --disable-mpg123 \
        --enable-pipe-output \
        --enable-recorder-output \
-       --disable-shout \
-       --enable-sndfile \
-       --enable-vorbis \
-       --disable-vorbis-encoder \
-       --with-faad="$(STAGING_DIR)/usr" \
-       --with-tremor=yes \
-
+       --enable-shout \
+       --disable-vorbis
 endif
 
 ifeq ($(BUILD_VARIANT),mini)
@@ -186,20 +177,14 @@ ifeq ($(BUILD_VARIANT),mini)
   # oggflac is not compatible with tremor
   CONFIGURE_ARGS += \
        --disable-upnp \
-       --disable-aac \
-       --disable-audiofile \
        --disable-fifo \
        --disable-ffmpeg \
        --disable-id3 \
        --disable-mms \
-       --disable-pipe-output \
-       --disable-recorder-output \
        --disable-shout \
-       --disable-sndfile \
-       --disable-vorbis \
-       --disable-vorbis-encoder \
+       --enable-vorbis \
        --with-tremor=yes \
-
+       --disable-recorder-output
 endif
 
 define Package/mpd/install
index 275657061f79a457294448fcb4c9c0c03ac35a4f..7f31d7d06d76a5b43ebba23ea88234a605a95096 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
 +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
-@@ -777,6 +777,7 @@ static const char *const ffmpeg_mime_typ
+@@ -931,6 +931,7 @@ static const char *const ffmpeg_mime_typ
        "audio/qcelp",
        "audio/vorbis",
        "audio/vorbis+ogg",
index 2ebb91cc0dd2c8d381ea6c1ea50ac17023bcd8be..e0d099e46e22d21138ed9183df1451f7a47a19e4 100644 (file)
@@ -1,16 +1,16 @@
 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
 +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
-@@ -465,6 +465,13 @@ ffmpeg_probe(Decoder *decoder, InputStre
+@@ -478,6 +478,13 @@ ffmpeg_probe(DecoderClient *client, Inpu
  
        unsigned char buffer[BUFFER_SIZE];
-       size_t nbytes = decoder_read(decoder, is, buffer, BUFFER_SIZE);
+       size_t nbytes = decoder_read(client, is, buffer, BUFFER_SIZE);
 +
 +      if ((nbytes > 0) && (nbytes < 1024))
 +      {
 +              // Gobble some more data if header is small
-+              nbytes += decoder_read(decoder, is, buffer + nbytes, BUFFER_SIZE - nbytes);
++              nbytes += decoder_read(client, is, buffer + nbytes, BUFFER_SIZE - nbytes);
 +      }
 +
-       if (nbytes <= PADDING || !is.LockRewind(IgnoreError()))
+       if (nbytes <= PADDING)
                return nullptr;
  
index 8495ed2579297924c5cef018a65f20160f388171..20790c53b7d377619e45193c51d9e277f46f6336 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mpg123
-PKG_VERSION:=1.22.3
-PKG_RELEASE:=3
+PKG_VERSION:=1.25.8
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://www.mpg123.de/download/
-PKG_MD5SUM:=fca857bc5ad0d2070cd38bd5f0f85f1c
+PKG_SOURCE_URL:=@SF/mpg123
+PKG_HASH:=79da51efae011814491f07c95cb5e46de0476aca7a0bf240ba61cfc27af8499b
 PKG_MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
 
 PKG_FIXUP:=libtool
@@ -27,7 +27,6 @@ include $(INCLUDE_DIR)/package.mk
 
 define Package/mpg123/Default
   URL:=http://www.mpg123.de
-  DEPENDS:=@BUILD_PATENTED
 endef
 
 define Package/libmpg123
@@ -38,33 +37,56 @@ define Package/libmpg123
   DEPENDS:=+libltdl
 endef
 
+define Package/libout123
+  $(call Package/mpg123/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Library for continuous playback of audio streams via various platform-specific output methods
+  DEPENDS:=+libltdl
+endef
+
 define Package/mpg123
   $(call Package/mpg123/Default)
   SECTION:=sound
   CATEGORY:=Sound
   TITLE:=fast console mpeg audio player
-  DEPENDS+=+libmpg123 +alsa-lib
+  DEPENDS+=+libmpg123 +alsa-lib +libout123
 endef
 
-define Build/Configure
-       $(call Build/Configure/Default, \
-               --enable-shared \
-               --enable-static \
+TARGET_CFLAGS += -D_GNU_SOURCE
+
+CONFIGURE_ARGS+= \
+       --enable-shared \
+       --enable-static \
+       --with-audio=alsa \
+       --with-default-audio=alsa \
+
+ifeq ($(CONFIG_SOFT_FLOAT),y)
+       CONFIGURE_ARGS+= \
                --with-cpu=generic_nofpu \
-               --with-audio=alsa \
-               --with-default-audio=alsa \
-       )
-endef
+               --enable-int-quality=yes
+else
+       CONFIGURE_ARGS+= \
+               --with-cpu=generic_fpu
+endif
+
+ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
+        CONFIGURE_ARGS+= \
+                --with-cpu=arm_fpu
+endif
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(INSTALL_DATA) \
                $(PKG_INSTALL_DIR)/usr/include/mpg123.h \
+               $(PKG_INSTALL_DIR)/usr/include/out123.h \
+               $(PKG_INSTALL_DIR)/usr/include/fmt123.h \
                $(1)/usr/include/
 
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/lib/libmpg123.{la,a,so*} \
+               $(PKG_INSTALL_DIR)/usr/lib/libout123.{la,a,so*} \
                $(1)/usr/lib/
 
        $(INSTALL_DIR) $(1)/usr/lib/mpg123
@@ -75,6 +97,7 @@ define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmpg123.pc \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libout123.pc \
                $(1)/usr/lib/pkgconfig
 endef
 
@@ -85,6 +108,13 @@ define Package/libmpg123/install
                $(1)/usr/lib/
 endef
 
+define Package/libout123/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libout123.so* \
+               $(1)/usr/lib/
+endef
+
 define Package/mpg123/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) \
@@ -99,4 +129,5 @@ define Package/mpg123/install
 endef
 
 $(eval $(call BuildPackage,libmpg123))
+$(eval $(call BuildPackage,libout123))
 $(eval $(call BuildPackage,mpg123))
diff --git a/sound/opus-tools/Makefile b/sound/opus-tools/Makefile
new file mode 100644 (file)
index 0000000..1b5b9a1
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=opus-tools
+PKG_VERSION:=0.1.10
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://downloads.xiph.org/releases/opus/
+PKG_HASH:=a2357532d19471b70666e0e0ec17d514246d8b3cb2eb168f68bb0f6fd372b28c
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
+               Nicolas Thill <nico@openwrt.org>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/opus-tools
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+libogg +libopus
+  TITLE:=OPUS Codec tools
+  URL:=http://opus-codec.org/
+endef
+
+define Package/opus-tools/description
+ This package provides command-line utilities to encode, inspect,
+ and decode .opus files.
+endef
+
+CONFIGURE_ARGS += \
+       --without-flac \
+
+define Package/opus-tools/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/opus{dec,enc,info} $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,opus-tools))
index e92ae64cb6f224bf7260996ce249226f4faf016f..1284fd5ed9c91b071720ab5166302b160b798091 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pianod
-PKG_VERSION:=174.05
+PKG_VERSION:=174.07
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=https://github.com/thess/pianod-sc/releases/download/$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=0bae19b0c1e309343bc1b351e521173fe439431542a949dd2bacf4165cce5200
+PKG_HASH:=eee969926c095497893fbd28711258a31efb2d2301da87563dbcd101d8771bff
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
@@ -28,7 +28,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/pianod
   SECTION:=sound
   CATEGORY:=Sound
-  DEPENDS:=+libao +libfaad2 +libmad +libmbedtls +libjson-c +libgcrypt +libpthread
+  DEPENDS:=+libao +libfaad2 +libmpg123 +libmbedtls +libjson-c +libgcrypt +libpthread
   TITLE:=Pandora radio daemon
   USERID:=pianod=88:pianod=88
   URL:=http://deviousfish.com/pianod1/
index ffa5cfb05b91753e66e813aa14761e4d0f02b18a..40d99d79b1003d94099ac5cbc3bf53407a765638 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=portaudio
 PKG_VERSION:=19_20140130
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=pa_stable_v$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=http://www.portaudio.com/archives/
-PKG_MD5SUM:=7f220406902af9dca009668e198cbd23
+PKG_HASH:=8fe024a5f0681e112c6979808f684c3516061cc51d3acc0b726af98fc96c8d57
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE.txt
@@ -46,6 +46,12 @@ CONFIGURE_ARGS+= \
        --without-jack \
        --with-oss \
 
+EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
+
+define Build/Compile
+       $(call Build/Compile/Default,lib/libportaudio.la)
+endef
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) \
index 788111b94fb9fccc784f91ef7525a0e69ec80fc7..1ceaec80617fd2471a8f921262db7d6b570a1919 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pulseaudio
-PKG_VERSION:=9.0
-PKG_RELEASE:=1
+PKG_VERSION:=11.1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://freedesktop.org/software/pulseaudio/releases/
-PKG_MD5SUM:=da7162541b3a9bc20576dbd0d7d1489a
+PKG_SOURCE_URL:=https://freedesktop.org/software/pulseaudio/releases/
+PKG_HASH:=f2521c525a77166189e3cb9169f75c2ee2b82fa3fcf9476024fbc2c3a6c9cd9e
 PKG_LICENSE:=LGPL-2.1+
 PKG_LICENSE_FILES:=GPL LICENSE
 
@@ -22,6 +22,8 @@ PKG_BUILD_DEPENDS:=intltool/host
 PKG_FIXUP:=autoreconf
 PKG_USE_MIPS16:=0
 
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
 PKG_INSTALL = 1
 
 include $(INCLUDE_DIR)/package.mk
@@ -30,8 +32,8 @@ include $(INCLUDE_DIR)/nls.mk
 define Package/pulseaudio/Default
   SECTION:=sound
   CATEGORY:=Sound
-  DEPENDS:=+libspeexdsp +libsndfile +libltdl +libpthread \
-       +librt +alsa-lib +libopenssl +libwrap +libcap $(ICONV_DEPENDS) $(INTL_DEPENDS)
+  DEPENDS:=+libsndfile +libltdl +libpthread +librt +alsa-lib \
+       +libopenssl +libwrap +libcap $(ICONV_DEPENDS) $(INTL_DEPENDS)
   TITLE:=Network sound server
   MAINTAINER:=Peter Wagner <tripolar@gmx.at>
   URL:=http://www.pulseaudio.org
@@ -41,7 +43,15 @@ endef
 
 define Package/pulseaudio-daemon
   $(call Package/pulseaudio/Default)
-  DEPENDS+= +libjson-c
+  VARIANT:=noavahi
+endef
+
+define Package/pulseaudio-daemon-avahi
+  $(call Package/pulseaudio/Default)
+  DEPENDS+=+dbus +libavahi-client +sbc
+#  DEPENDS+=+avahi-daemon 
+  TITLE+= (avahi/bluez)
+  VARIANT:=avahi
 endef
 
 define Package/pulseaudio/Default/description
@@ -52,6 +62,11 @@ define Package/pulseaudio-daemon/description
   $(call Package/pulseaudio/Default/description)
 endef
 
+define Package/pulseaudio-daemon-avahi/description
+  $(call Package/pulseaudio/Default/description)
+  This package enables avahi,bluez and is compiled against dbus, sbc, and avahi.
+endef
+
 define Package/pulseaudio-daemon/conffiles
 /etc/pulse/client.conf
 /etc/pulse/daemon.conf
@@ -59,12 +74,20 @@ define Package/pulseaudio-daemon/conffiles
 /etc/pulse/system.pa
 endef
 
+define Package/pulseaudio-daemon-avahi/conffiles
+/etc/pulse/client.conf
+/etc/pulse/daemon.conf
+/etc/pulse/default.pa
+/etc/pulse/system.pa
+endef
+
 define Package/pulseaudio-tools
   SECTION:=sound
   CATEGORY:=Sound
   DEPENDS:=+libsndfile +pulseaudio
   TITLE:=Tools for Pulseaudio
   URL:=http://www.pulseaudio.org
+  VARIANT:=noavahi
 endef
 
 define Package/pulseaudio-profiles
@@ -76,6 +99,7 @@ define Package/pulseaudio-profiles
 endef
 
 CONFIGURE_ARGS += \
+       $(if $(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),--enable-neon-opt,--disable-neon-opt) \
        --with-system-user=pulse \
        --with-system-group=pulse \
        --with-access-group=audio \
@@ -95,12 +119,23 @@ CONFIGURE_ARGS += \
        --disable-jack \
        --disable-asyncns \
        --disable-lirc \
-       --disable-bluez \
        --disable-udev \
        --without-fftw \
+       --without-soxr \
+       --without-speex
+# --disable-bluez
+
+ifeq ($(BUILD_VARIANT),avahi)
+CONFIGURE_ARGS += \
+       --enable-avahi \
+       --enable-dbus
+endif
+
+ifeq ($(BUILD_VARIANT),noavahi)
+CONFIGURE_ARGS += \
        --disable-avahi \
-       --disable-dbus \
-       --without-soxr
+       --disable-dbus
+endif
 
 CONFIGURE_VARS += \
        PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig"
@@ -167,6 +202,49 @@ define Package/pulseaudio-daemon/install
 
 endef
 
+define Package/pulseaudio-daemon-avahi/install
+       $(INSTALL_DIR) \
+               $(1)/etc/pulse \
+               $(1)/etc/init.d \
+               $(1)/usr/bin \
+               $(1)/usr/lib \
+               $(1)/usr/lib/pulseaudio \
+               $(1)/usr/lib/pulse-$(PKG_VERSION)/modules \
+               $(1)/etc/dbus-1/system.d
+
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/bin/pulseaudio \
+               $(1)/usr/bin/pulseaudio
+
+       $(INSTALL_BIN) \
+               ./files/pulseaudio.init \
+               $(1)/etc/init.d/pulseaudio
+
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/etc/pulse/* \
+               $(1)/etc/pulse
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+               $(1)/usr/lib/
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/* \
+               $(1)/usr/lib/pulseaudio/
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/lib*.so \
+               $(1)/usr/lib/
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/module*.so \
+               $(1)/usr/lib/pulse-$(PKG_VERSION)/modules/
+
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/pulseaudio-system.conf \
+               $(1)/etc/dbus-1/system.d/pulseaudio-system.conf
+endef
+
 define Package/pulseaudio-tools/install
        $(INSTALL_DIR) \
                $(1)/usr/bin
@@ -191,5 +269,6 @@ define Package/pulseaudio-profiles/install
 endef
 
 $(eval $(call BuildPackage,pulseaudio-daemon))
+$(eval $(call BuildPackage,pulseaudio-daemon-avahi))
 $(eval $(call BuildPackage,pulseaudio-tools))
 $(eval $(call BuildPackage,pulseaudio-profiles))
index 191647c51e17a54aabc82153f880654b9247a3ab..64d689c7e5aedd2d9b39c7d24b9d77c0667c6f1f 100644 (file)
@@ -16,6 +16,7 @@ PKG_SOURCE_URL:=git://github.com/juhovh/shairplay.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=ce80e005908f41d0e6fde1c4a21e9cb8ee54007b
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=55fe50e21ab5998d745626bd3f98fdbbf2f670b87c26823f5654537a29e7f6c9
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=MIT
index abec42156dcb9a2f6775818165475e8c3440d2cd..f30cd17fe8cfcc7f583220baf46f68db2d4d5ff3 100644 (file)
@@ -7,14 +7,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=shairport-sync
-PKG_VERSION:=2.8.6
-PKG_RELEASE:=2
+PKG_VERSION:=3.1.6
+PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=git://github.com/mikebrady/shairport-sync.git
 PKG_SOURCE_VERSION:=$(PKG_VERSION)
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE:=$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=8f440a6bca6a58d04f7c0f6c7ea711b31a0aa4abc7e4d8f4da7346a085dcd966
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
                Mike Brady <mikebrady@eircom.net>
 
@@ -32,7 +33,7 @@ define Package/shairport-sync/default
   SECTION:=sound
   CATEGORY:=Sound
   TITLE:=AirPlay compatible audio player
-  DEPENDS:=@AUDIO_SUPPORT +libpthread +alsa-lib +libconfig +libdaemon +libpopt
+  DEPENDS:=@AUDIO_SUPPORT +libpthread +libstdcpp +alsa-lib +libconfig +libdaemon +libpopt
   PROVIDES:=shairport-sync
   URL:=http://github.com/mikebrady/shairport-sync
 endef
index 96917af6cc8c1e407d81caa8c59f508ffc035598..fa1a8dddc4e1e5916a1ffa11f2cf02f2125eada3 100644 (file)
@@ -1,13 +1,13 @@
 # Use your own config file
 config shairport-sync 'shairport_sync_file'
-       option disabled '1'
+       option enabled '0'
        option respawn '1'
        option conf_custom '1'
        option conf_file '/etc/shairport-sync.conf'
 
 # Use OpenWrt UCI config
 config shairport-sync 'shairport_sync'
-       option disabled '1'
+       option enabled '0'
        option respawn '1'
        # General
        option name 'Shairport-Sync-%v-%h'
index afda520e8e192bfa88d0c706bd2b4ee7ee4f56ec..a4a1da9319d4ca473d51066c64da2b63e8e7124f 100644 (file)
@@ -31,8 +31,8 @@ start_instance() {
        local cfg=$1
        local conf_custom conf_file aux
 
-       config_get_bool aux "$cfg" 'disabled' '0'
-       [ "$aux" = 1 ] && return 1
+       config_get_bool aux "$cfg" 'enabled' '0'
+       [ "$aux" = 0 ] && return 1
 
        config_get_bool conf_custom "$cfg" 'conf_custom' '0'
        config_get conf_file "$cfg" "conf_file"
diff --git a/sound/shairport-sync/patches/100-replace_polarssl_with_mbedtls.patch b/sound/shairport-sync/patches/100-replace_polarssl_with_mbedtls.patch
deleted file mode 100644 (file)
index 984eb4c..0000000
+++ /dev/null
@@ -1,395 +0,0 @@
-diff --git a/common.c b/common.c
-index bf72127..2d4739e 100644
---- a/common.c
-+++ b/common.c
-@@ -54,17 +54,14 @@
- #include <openssl/buffer.h>
- #endif
--#ifdef HAVE_LIBPOLARSSL
--#include <polarssl/version.h>
--#include <polarssl/base64.h>
--#include <polarssl/x509.h>
--#include <polarssl/md.h>
--#include "polarssl/entropy.h"
--#include "polarssl/ctr_drbg.h"
--
--#if POLARSSL_VERSION_NUMBER >= 0x01030000
--#include "polarssl/compat-1.2.h"
--#endif
-+#ifdef HAVE_LIBMBEDTLS
-+#include <mbedtls/version.h>
-+#include <mbedtls/base64.h>
-+#include <mbedtls/x509.h>
-+#include <mbedtls/md.h>
-+#include "mbedtls/entropy.h"
-+#include "mbedtls/ctr_drbg.h"
-+
- #endif
- #include "common.h"
-@@ -126,16 +123,16 @@ void inform(char *format, ...) {
-   daemon_log(LOG_INFO, "%s", s);
- }
--#ifdef HAVE_LIBPOLARSSL
-+#ifdef HAVE_LIBMBEDTLS
- char *base64_enc(uint8_t *input, int length) {
-   char *buf = NULL;
-   size_t dlen = 0;
--  int rc = base64_encode(NULL, &dlen, input, length);
--  if (rc && (rc != POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL))
-+  int rc = mbedtls_base64_encode(NULL, 0, &dlen, input, length);
-+  if (rc && (rc != MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL))
-     debug(1, "Error %d getting length of base64 encode.", rc);
-   else {
-     buf = (char *)malloc(dlen);
--    rc = base64_encode((unsigned char *)buf, &dlen, input, length);
-+    rc = mbedtls_base64_encode((unsigned char *)buf, dlen, &dlen, input, length);
-     if (rc != 0)
-       debug(1, "Error %d encoding base64.", rc);
-   }
-@@ -156,10 +153,10 @@ uint8_t *base64_dec(char *input, int *outlen) {
-   else {
-     strcpy(inbuf, input);
-     strcat(inbuf, "===");
--    // debug(1,"base64_dec called with string \"%s\", length %d, filled string: \"%s\", length
--    // %d.",input,strlen(input),inbuf,inbufsize);
--    int rc = base64_decode(buf, &dlen, (unsigned char *)inbuf, inbufsize);
--    if (rc && (rc != POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL))
-+    // debug(1,"base64_dec called with string \"%s\", length %d, filled string: \"%s\", length %d.",
-+    //                input,strlen(input),inbuf,inbufsize);
-+    int rc = mbedtls_base64_decode(NULL, 0, &dlen, (unsigned char *)inbuf, inbufsize);
-+    if (rc && (rc != MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL))
-       debug(1, "Error %d getting decode length, result is %d.", rc, dlen);
-     else {
-       // debug(1,"Decode size is %d.",dlen);
-@@ -167,7 +164,7 @@ uint8_t *base64_dec(char *input, int *outlen) {
-       if (buf == 0)
-         debug(1, "Can't allocate memory in base64_dec.");
-       else {
--        rc = base64_decode(buf, &dlen, (unsigned char *)inbuf, inbufsize);
-+        rc = mbedtls_base64_decode(buf, dlen, &dlen, (unsigned char *)inbuf, inbufsize);
-         if (rc != 0)
-           debug(1, "Error %d in base64_dec.", rc);
-       }
-@@ -280,58 +277,59 @@ uint8_t *rsa_apply(uint8_t *input, int inlen, int *outlen, int mode) {
- }
- #endif
--#ifdef HAVE_LIBPOLARSSL
-+#ifdef HAVE_LIBMBEDTLS
- uint8_t *rsa_apply(uint8_t *input, int inlen, int *outlen, int mode) {
--  rsa_context trsa;
-+  mbedtls_pk_context pkctx;
-+  mbedtls_rsa_context *trsa;
-   const char *pers = "rsa_encrypt";
-+  size_t olen = *outlen;
-   int rc;
--  entropy_context entropy;
--  ctr_drbg_context ctr_drbg;
--  entropy_init(&entropy);
--  if ((rc = ctr_drbg_init(&ctr_drbg, entropy_func, &entropy, (const unsigned char *)pers,
--                          strlen(pers))) != 0)
--    debug(1, "ctr_drbg_init returned %d\n", rc);
-+  mbedtls_entropy_context entropy;
-+  mbedtls_ctr_drbg_context ctr_drbg;
-+
-+  mbedtls_entropy_init(&entropy);
-+
-+  mbedtls_ctr_drbg_init(&ctr_drbg);
-+  mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy,
-+                      (const unsigned char *)pers, strlen(pers));
--  rsa_init(&trsa, RSA_PKCS_V21, POLARSSL_MD_SHA1); // padding and hash id get overwritten
--  // BTW, this seems to reset a lot of parameters in the rsa_context
--  rc = x509parse_key(&trsa, (unsigned char *)super_secret_key, strlen(super_secret_key), NULL, 0);
-+  mbedtls_pk_init(&pkctx);
-+
-+  rc = mbedtls_pk_parse_key(&pkctx, (unsigned char *)super_secret_key, sizeof(super_secret_key), NULL, 0);
-   if (rc != 0)
--    debug(1, "Error %d reading the private key.");
-+    debug(1, "Error %d reading the private key.", rc);
--  uint8_t *out = NULL;
-+  uint8_t *outbuf = NULL;
-+  trsa = mbedtls_pk_rsa(pkctx);  
-   switch (mode) {
-   case RSA_MODE_AUTH:
--    trsa.padding = RSA_PKCS_V15;
--    trsa.hash_id = POLARSSL_MD_NONE;
--    debug(2, "rsa_apply encrypt");
--    out = malloc(trsa.len);
--    rc = rsa_pkcs1_encrypt(&trsa, ctr_drbg_random, &ctr_drbg, RSA_PRIVATE, inlen, input, out);
-+    mbedtls_rsa_set_padding(trsa, MBEDTLS_RSA_PKCS_V15, MBEDTLS_MD_NONE);
-+    outbuf = malloc(trsa->len);
-+    rc = mbedtls_rsa_pkcs1_encrypt(trsa, mbedtls_ctr_drbg_random, &ctr_drbg, MBEDTLS_RSA_PRIVATE,
-+                         inlen, input, outbuf);
-     if (rc != 0)
--      debug(1, "rsa_pkcs1_encrypt error %d.", rc);
--    *outlen = trsa.len;
-+      debug(1, "mbedtls_pk_encrypt error %d.", rc);
-+    *outlen = trsa->len;
-     break;
-   case RSA_MODE_KEY:
--    debug(2, "rsa_apply decrypt");
--    trsa.padding = RSA_PKCS_V21;
--    trsa.hash_id = POLARSSL_MD_SHA1;
--    out = malloc(trsa.len);
--#if POLARSSL_VERSION_NUMBER >= 0x01020900
--    rc = rsa_pkcs1_decrypt(&trsa, ctr_drbg_random, &ctr_drbg, RSA_PRIVATE, (size_t *)outlen, input,
--                           out, trsa.len);
--#else
--    rc = rsa_pkcs1_decrypt(&trsa, RSA_PRIVATE, outlen, input, out, trsa.len);
--#endif
-+    mbedtls_rsa_set_padding(trsa, MBEDTLS_RSA_PKCS_V21, MBEDTLS_MD_SHA1);
-+    outbuf = malloc(trsa->len);
-+    rc = mbedtls_rsa_pkcs1_decrypt(trsa, mbedtls_ctr_drbg_random, &ctr_drbg, MBEDTLS_RSA_PRIVATE, 
-+                         &olen, input, outbuf, trsa->len);
-     if (rc != 0)
--      debug(1, "decrypt error %d.", rc);
-+      debug(1, "mbedtls_pk_decrypt error %d.", rc);
-+    *outlen = olen;
-     break;
-   default:
-     die("bad rsa mode");
-   }
--  rsa_free(&trsa);
--  debug(2, "rsa_apply exit");
--  return out;
-+
-+  mbedtls_ctr_drbg_free(&ctr_drbg);
-+  mbedtls_entropy_free(&entropy);
-+  mbedtls_pk_free(&pkctx);
-+  return outbuf;
- }
- #endif
-@@ -517,7 +515,7 @@ ssize_t non_blocking_write(int fd, const void *buf, size_t count) {
-       void *ibuf = (void *)buf;
-       size_t bytes_remaining = count;
-       int rc = 0;
--  struct pollfd ufds[1];
-+      struct pollfd ufds[1];
-       while ((bytes_remaining>0) && (rc==0)) {
-               // check that we can do some writing
-               ufds[0].fd = fd;
-diff --git a/configure.ac b/configure.ac
-index 8d82da4..a2d1e4f 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -108,11 +108,11 @@ AC_ARG_WITH(piddir, [ --with-piddir=<pathname> Specify a pathname to a directory
- AM_CONDITIONAL([USE_CUSTOMPIDDIR], [test "x$HAS_CUSTOMPIDDIR" = "x1"])
- # Check --with-ssl=argument
--AC_ARG_WITH(ssl, [ choose --with-ssl=openssl or --with-ssl=polarssl for encryption services], [
-+AC_ARG_WITH(ssl, [ choose --with-ssl=openssl or --with-ssl=mbedtls for encryption services], [
-   AC_MSG_CHECKING(encryption libraries chosen)
-   if test "x${with_ssl}" = x -o "x${with_ssl}" = xyes ; then
-     AC_MSG_RESULT(not found)
--    AC_MSG_ERROR(choose either "openssl" or "polarssl" encryption)
-+    AC_MSG_ERROR(choose either "openssl" or "mbedtls" encryption)
-   fi
-   if test "x${with_ssl}" = xopenssl ; then
-     if  test "x${with_pkg_config}" = xyes ; then
-@@ -127,10 +127,15 @@ AC_ARG_WITH(ssl, [ choose --with-ssl=openssl or --with-ssl=polarssl for encrypti
-       AC_DEFINE([HAVE_LIBCRYPTO],[1],[Define to 1 if you have libcrypto])
-       AC_DEFINE([HAVE_LIBSSL],[1],[Define to 1 if you have libssl])
-     fi
--  elif test "x${with_ssl}" = xpolarssl ; then
--    AC_CHECK_LIB([polarssl],[ssl_init], , AC_MSG_ERROR(PolarSSL selected but the library cannot be found!))
-+  elif test "x${with_ssl}" = xmbedtls ; then
-+    AC_CHECK_LIB([mbedtls],[mbedtls_ssl_init],,
-+              [AC_MSG_ERROR([Cannot find required libray: libmbedtls],1)])
-+    AC_CHECK_LIB([mbedcrypto], [mbedtls_entropy_func],,
-+                [AC_MSG_ERROR([Cannot find required library: libmbedcrypto],1)])
-+    AC_CHECK_LIB([mbedx509], [mbedtls_pk_init],,
-+                [AC_MSG_ERROR([Cannot find required library: libmbedx509],1)])
-   else
--    AC_MSG_ERROR(unknown option "${with_ssl}"." Please choose with "openssl" or "polarssl")
-+    AC_MSG_ERROR(unknown option "${with_ssl}"." Please choose with "openssl" or "mbedtls")
-   fi
- ], )
-diff --git a/player.c b/player.c
-index 97eccfb..da2d735 100644
---- a/player.c
-+++ b/player.c
-@@ -47,9 +47,9 @@
- #include "config.h"
--#ifdef HAVE_LIBPOLARSSL
--#include <polarssl/aes.h>
--#include <polarssl/havege.h>
-+#ifdef HAVE_LIBMBEDTLS
-+#include <mbedtls/aes.h>
-+#include <mbedtls/havege.h>
- #endif
- #ifdef HAVE_LIBSSL
-@@ -82,8 +82,8 @@ static int max_frame_size_change = 1;
- // maximal resampling shift - conservative
- //#define OUTFRAME_BYTES(frame_size) (4 * (frame_size + 3))
--#ifdef HAVE_LIBPOLARSSL
--static aes_context dctx;
-+#ifdef HAVE_LIBMBEDTLS
-+static mbedtls_aes_context dctx;
- #endif
- //static pthread_t player_thread = NULL;
-@@ -247,8 +247,8 @@ static int alac_decode(short *dest, int *destlen, uint8_t *buf, int len) {
-     unsigned char iv[16];
-     int aeslen = len & ~0xf;
-     memcpy(iv, aesiv, sizeof(iv));
--#ifdef HAVE_LIBPOLARSSL
--    aes_crypt_cbc(&dctx, AES_DECRYPT, aeslen, iv, buf, packet);
-+#ifdef HAVE_LIBMBEDTLS
-+    mbedtls_aes_crypt_cbc(&dctx, MBEDTLS_AES_DECRYPT, aeslen, iv, buf, packet);
- #endif
- #ifdef HAVE_LIBSSL
-     AES_cbc_encrypt(buf, packet, aeslen, &aes, iv, AES_DECRYPT);
-@@ -1685,9 +1685,9 @@ int player_play(stream_cfg *stream, pthread_t *player_thread) {
-     die("specified buffer starting fill %d > buffer size %d", config.buffer_start_fill,
-         BUFFER_FRAMES);
-   if (encrypted) {
--#ifdef HAVE_LIBPOLARSSL
--    memset(&dctx, 0, sizeof(aes_context));
--    aes_setkey_dec(&dctx, stream->aeskey, 128);
-+#ifdef HAVE_LIBMBEDTLS
-+    memset(&dctx, 0, sizeof(mbedtls_aes_context));
-+    mbedtls_aes_setkey_dec(&dctx, stream->aeskey, 128);
- #endif
- #ifdef HAVE_LIBSSL
-diff --git a/rtsp.c b/rtsp.c
-index 38b0745..8003803 100644
---- a/rtsp.c
-+++ b/rtsp.c
-@@ -50,8 +50,8 @@
- #include <openssl/md5.h>
- #endif
--#ifdef HAVE_LIBPOLARSSL
--#include <polarssl/md5.h>
-+#ifdef HAVE_LIBMBEDTLS
-+#include <mbedtls/md5.h>
- #endif
- #include "common.h"
-@@ -979,7 +979,7 @@ static void handle_set_parameter_parameter(rtsp_conn_info *conn,
- // more significant changes make it not malloc memory
- // needs to initialise the docoding table first
--// add _so to end of name to avoid confusion with polarssl's implementation
-+// add _so to end of name to avoid confusion with SSL library implementation
- static char encoding_table[] = {
-     'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
-@@ -1651,21 +1651,21 @@ static int rtsp_auth(char **nonce, rtsp_message *req, rtsp_message *resp) {
-   MD5_Final(digest_mu, &ctx);
- #endif
--#ifdef HAVE_LIBPOLARSSL
--  md5_context tctx;
--  md5_starts(&tctx);
--  md5_update(&tctx, (const unsigned char *)username, strlen(username));
--  md5_update(&tctx, (unsigned char *)":", 1);
--  md5_update(&tctx, (const unsigned char *)realm, strlen(realm));
--  md5_update(&tctx, (unsigned char *)":", 1);
--  md5_update(&tctx, (const unsigned char *)config.password,
-+#ifdef HAVE_LIBMBEDTLS
-+  mbedtls_md5_context tctx;
-+  mbedtls_md5_starts(&tctx);
-+  mbedtls_md5_update(&tctx, (const unsigned char *)username, strlen(username));
-+  mbedtls_md5_update(&tctx, (unsigned char *)":", 1);
-+  mbedtls_md5_update(&tctx, (const unsigned char *)realm, strlen(realm));
-+  mbedtls_md5_update(&tctx, (unsigned char *)":", 1);
-+  mbedtls_md5_update(&tctx, (const unsigned char *)config.password,
-              strlen(config.password));
--  md5_finish(&tctx, digest_urp);
--  md5_starts(&tctx);
--  md5_update(&tctx, (const unsigned char *)req->method, strlen(req->method));
--  md5_update(&tctx, (unsigned char *)":", 1);
--  md5_update(&tctx, (const unsigned char *)uri, strlen(uri));
--  md5_finish(&tctx, digest_mu);
-+  mbedtls_md5_finish(&tctx, digest_urp);
-+  mbedtls_md5_starts(&tctx);
-+  mbedtls_md5_update(&tctx, (const unsigned char *)req->method, strlen(req->method));
-+  mbedtls_md5_update(&tctx, (unsigned char *)":", 1);
-+  mbedtls_md5_update(&tctx, (const unsigned char *)uri, strlen(uri));
-+  mbedtls_md5_finish(&tctx, digest_mu);
- #endif
-   int i;
-@@ -1685,16 +1685,16 @@ static int rtsp_auth(char **nonce, rtsp_message *req, rtsp_message *resp) {
-   MD5_Final(digest_total, &ctx);
- #endif
--#ifdef HAVE_LIBPOLARSSL
--  md5_starts(&tctx);
--  md5_update(&tctx, buf, 32);
--  md5_update(&tctx, (unsigned char *)":", 1);
--  md5_update(&tctx, (const unsigned char *)*nonce, strlen(*nonce));
--  md5_update(&tctx, (unsigned char *)":", 1);
-+#ifdef HAVE_LIBMBEDTLS
-+  mbedtls_md5_starts(&tctx);
-+  mbedtls_md5_update(&tctx, buf, 32);
-+  mbedtls_md5_update(&tctx, (unsigned char *)":", 1);
-+  mbedtls_md5_update(&tctx, (const unsigned char *)*nonce, strlen(*nonce));
-+  mbedtls_md5_update(&tctx, (unsigned char *)":", 1);
-   for (i = 0; i < 16; i++)
-     sprintf((char *)buf + 2 * i, "%02x", digest_mu[i]);
--  md5_update(&tctx, buf, 32);
--  md5_finish(&tctx, digest_total);
-+  mbedtls_md5_update(&tctx, buf, 32);
-+  mbedtls_md5_finish(&tctx, digest_total);
- #endif
-   for (i = 0; i < 16; i++)
-diff --git a/shairport.c b/shairport.c
-index f725d60..2349447 100644
---- a/shairport.c
-+++ b/shairport.c
-@@ -42,8 +42,8 @@
- #include "config.h"
--#ifdef HAVE_LIBPOLARSSL
--#include <polarssl/md5.h>
-+#ifdef HAVE_LIBMBEDTLS
-+#include <mbedtls/md5.h>
- #endif
- #ifdef HAVE_LIBSSL
-@@ -109,8 +109,8 @@ char* get_version_string() {
-   char* version_string = malloc(200);
-   if (version_string) {
-     strcpy(version_string, PACKAGE_VERSION);
--  #ifdef HAVE_LIBPOLARSSL
--    strcat(version_string, "-PolarSSL");
-+  #ifdef HAVE_LIBMBEDTLS
-+    strcat(version_string, "-mbedTLS");
-   #endif
-   #ifdef HAVE_LIBSSL
-     strcat(version_string, "-OpenSSL");
-@@ -1046,11 +1046,11 @@ int main(int argc, char **argv) {
-   MD5_Final(ap_md5, &ctx);
- #endif
--#ifdef HAVE_LIBPOLARSSL
--  md5_context tctx;
--  md5_starts(&tctx);
--  md5_update(&tctx, (unsigned char *)config.service_name, strlen(config.service_name));
--  md5_finish(&tctx, ap_md5);
-+#ifdef HAVE_LIBMBEDTLS
-+  mbedtls_md5_context tctx;
-+  mbedtls_md5_starts(&tctx);
-+  mbedtls_md5_update(&tctx, (unsigned char *)config.service_name, strlen(config.service_name));
-+  mbedtls_md5_finish(&tctx, ap_md5);
- #endif
-   memcpy(config.hw_addr, ap_md5, sizeof(config.hw_addr));
- #ifdef CONFIG_METADATA
diff --git a/sound/shairport/Makefile b/sound/shairport/Makefile
deleted file mode 100644 (file)
index aeb63f7..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Copyright (C) 2013-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=shairport
-PKG_VERSION:=2014-10-28
-PKG_RELEASE:=2
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://github.com/abrasive/shairport.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=d679d19a4bd66cc220dabfd23ad748c34e95995c
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
-
-PKG_LICENSE:=MIT
-PKG_LICENSE_FILES:=LICENSES
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/shairport
-  SECTION:=sound
-  CATEGORY:=Sound
-  DEPENDS:=+libpthread +libopenssl +libavahi-client +alsa-lib
-  TITLE:=ShairPort AirPort Express emulator (un-maintained)
-endef
-
-define Package/shairport/description
-  This program emulates an AirPort Express for the purpose of streaming
-  music from iTunes and compatible iPods. It implements a server for the
-  Apple RAOP protocol.
-  ShairPort does not support AirPlay v2 (video and photo streaming).
-
-  It supports multiple simultaneous streams, if your audio output chain
-  (as detected by libao) does so.
-endef
-
-TARGET_CFLAGS += $(FPIC)
-
-LIBS:=-lm -lcrypto -lpthread -lavahi-common -lavahi-client -lasound
-
-MAKE_FLAGS += \
-       CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
-       LDFLAGS="$(TARGET_LDFLAGS) $(LIBS)"
-
-define Package/shairport/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/shairport $(1)/usr/bin/
-       $(INSTALL_DIR) $(1)/etc/init.d/
-       $(INSTALL_BIN) files/shairport.init $(1)/etc/init.d/shairport
-       $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_CONF) files/shairport.config $(1)/etc/config/shairport
-endef
-
-$(eval $(call BuildPackage,shairport))
diff --git a/sound/shairport/files/shairport.config b/sound/shairport/files/shairport.config
deleted file mode 100644 (file)
index 9b2165a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-config shairport main
-       option disabled '1'
-       option respawn '1'
-       option bname 'AirPort'
-       option password ''
-       option port '5002'
-       option buffer ''
-       option log_file ''
-       option err_file ''
-       option meta_dir ''
-       option cmd_start ''
-       option cmd_stop ''
-       option cmd_wait '0'
-       option audio_output 'alsa'
-       option mdns 'avahi'
-
-       # options for alsa output
-       option output_dev ''
-       option mixer_dev ''
-       option mixer_type ''
-       option mixer_control ''
-       option mixer_index ''
-
-       # options for ao output
-       option ao_driver ''
-       option ao_name ''
-       option ao_id ''
-       option ao_options ''
-
-       # options for pipe output
-       option output_fifo ''
-
-       # options for pulse output
-       option pulse_server ''
-       option pulse_sink ''
-       option pulse_appname ''
diff --git a/sound/shairport/files/shairport.init b/sound/shairport/files/shairport.init
deleted file mode 100644 (file)
index 341ff6f..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2013-2014 OpenWrt.org
-
-START=94
-USE_PROCD=1
-
-append_arg() {
-       local cfg="$1"
-       local var="$2"
-       local opt="$3"
-       local def="$4"
-       local val
-
-       config_get val "$cfg" "$var"
-       [ -n "$val" -o -n "$def" ] && procd_append_param command $opt "${val:-$def}"
-}
-
-append_bool() {
-       local cfg="$1"
-       local var="$2"
-       local opt="$3"
-       local def="$4"
-       local val
-
-       config_get_bool val "$cfg" "$var" "$def"
-       [ "$val" = 1 ] && procd_append_param command "$opt"
-}
-
-start_instance() {
-       local cfg="$1"
-       local ao dev aux
-
-       config_get_bool aux "$cfg" 'disabled' '0'
-       [ "$aux" = 1 ] && return 1
-
-       procd_open_instance
-
-       procd_set_param command /usr/bin/shairport
-
-       append_arg "$cfg" bname "-a" "AirPort"
-       append_arg "$cfg" log_file "-l"
-       append_arg "$cfg" err_file "-e"
-       append_arg "$cfg" meta_dir "-M"
-       append_arg "$cfg" buffer "-b"
-       append_arg "$cfg" port "-p"
-       append_arg "$cfg" password "-k"
-       append_arg "$cfg" mdns "-m"
-
-       append_arg "$cfg" cmd_start "-B"
-       append_arg "$cfg" cmd_stop "-E"
-       append_bool "$cfg" cmd_wait "-w"
-
-       append_arg "$cfg" audio_output "-o"
-
-       config_get ao "$cfg" audio_output ""
-       if [ "$ao" = "alsa" ]; then
-               config_get dev "$cfg" output_dev ""
-               if [ -n "$dev" ]; then
-                       procd_append_param command "--"
-                       append_arg "$cfg" output_dev "-d"
-                       append_arg "$cfg" mixer_dev "-m"
-                       append_arg "$cfg" mixer_type "-t"
-                       append_arg "$cfg" mixer_control "-c"
-                       append_arg "$cfg" mixer_index "-i"
-               fi
-       elif [ "$ao" = "ao" ]; then
-               config_get dev "$cfg" ao_driver ""
-               if [ -n "$dev" ]; then
-                       procd_append_param command "--"
-                       append_arg "$cfg" ao_driver "-d"
-                       append_arg "$cfg" ao_id "-i"
-                       append_arg "$cfg" ao_name "-n"
-                       append_arg "$cfg" ao_options "-o"
-               fi
-       elif [ "$ao" = "pipe" ]; then
-               config_get dev "$cfg" output_fifo ""
-               if [ -n "$dev" ]; then
-                       procd_append_param command "--"
-                       append_arg "$cfg" output_fifo ""
-               fi
-       elif [ "$ao" = "pulse" ]; then
-               config_get dev "$cfg" pulse_server ""
-               if [ -n "$dev" ]; then
-                       procd_append_param command "--"
-                       append_arg "$cfg" pulse_server "-a"
-                       append_arg "$cfg" pulse_sink "-s"
-                       append_arg "$cfg" pulse_appname "-n"
-               fi
-       fi
-
-       config_get_bool aux "$cfg" 'respawn' '0'
-       [ "$aux" = 1 ] && procd_set_param respawn
-
-       procd_close_instance
-}
-
-service_triggers() { 
-       procd_add_reload_trigger "shairport" 
-} 
-
-start_service() {
-       config_load shairport
-       config_foreach start_instance shairport
-}
diff --git a/sound/shairport/patches/001-disable_pulseaudio.patch b/sound/shairport/patches/001-disable_pulseaudio.patch
deleted file mode 100644 (file)
index 7f0407e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/configure
-+++ b/configure
-@@ -59,7 +59,7 @@ do_pkg_config()
- do_pkg_config OpenSSL       openssl
--do_pkg_config libao         ao              CONFIG_AO
--do_pkg_config PulseAudio    libpulse-simple CONFIG_PULSE
-+#do_pkg_config libao         ao              CONFIG_AO
-+#do_pkg_config PulseAudio    libpulse-simple CONFIG_PULSE
- do_pkg_config ALSA          alsa            CONFIG_ALSA
- do_pkg_config Avahi\ client avahi-client    CONFIG_AVAHI
index 7b1dda0c5981f32ce7c4652ad26e74735ac80fd9..2b99c700ad430d9ed9bfc5c4b5abe97a47f30a40 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/toots/shine/releases/download/$(PKG_VERSION)/
-PKG_MD5SUM:=fcad8108335f4b051b303fbdf3fca3fe
+PKG_HASH:=6c5310bda766b116ed2415d639a27e5e11040e068b4b2db6bd733333e620cb4f
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index 11402f8e4287e2c74e5780e410a22bf2e59fd453..f2bad90ed94bdc5591dc4b14e0f35cb1c7bd320b 100644 (file)
@@ -1,7 +1,4 @@
 #
-# Copyright (C) 2008 David Cooper <dave@kupesoft.com>
-# Copyright (C) 2006-2017 OpenWrt
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -10,11 +7,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sox
 PKG_VERSION:=14.4.2
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/sox
-PKG_MD5SUM:=81a6956d4330e75b5827316e44ae381e6f1e8928003c6aa45896da9041ea149c
+PKG_HASH:=81a6956d4330e75b5827316e44ae381e6f1e8928003c6aa45896da9041ea149c
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=LGPL-2.1 GPL-2.0
@@ -31,9 +28,8 @@ TARGET_LDFLAGS+= \
 define Package/sox
   SECTION:=sound
   CATEGORY:=Sound
-  DEPENDS:=+BUILD_PATENTED:lame-lib +BUILD_PATENTED:libmad +BUILD_PATENTED:libid3tag \
-               +libvorbis +libvorbisidec +alsa-lib +libsndfile +libflac \
-               +libmagic +libpng
+  DEPENDS:=+lame-lib +libmad +libid3tag +libmagic \
+               +libvorbis +alsa-lib +libflac
   TITLE:=Sox is a general purpose sound converter/player/recorder
   URL:=http://sox.sourceforge.net/
 endef
@@ -46,23 +42,18 @@ define Package/sox/description
        several unix-style platforms.
 endef
 
-define Build/Configure
-       $(call Build/Configure/Default, \
+CONFIGURE_ARGS += \
                --without-oss \
                --without-ao \
                --with-alsa \
                --without-libltdl \
-               --with-ogg \
                --with-flac \
-               --without-amr-wb \
-               --without-amr-nb \
-               --without-samplerate \
                --without-ladspa \
-               --$(if $(CONFIG_BUILD_PATENTED),with-mad,without-mad) \
-               --$(if $(CONFIG_BUILD_PATENTED),with-lame,without-lame) \
-               --$(if $(CONFIG_BUILD_PATENTED),with-id3tag,without-id3tag) \
-       )
-endef
+               --without-png \
+               --without-sndfile \
+               --with-lame \
+               --with-id3tag \
+               --disable-openmp
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
diff --git a/sound/sox/patches/020-reproducible-builds.patch b/sound/sox/patches/020-reproducible-builds.patch
new file mode 100644 (file)
index 0000000..f8d099a
--- /dev/null
@@ -0,0 +1,32 @@
+--- a/src/libsox.c
++++ b/src/libsox.c
+@@ -65,8 +65,6 @@ sox_version_info_t const * sox_version_i
+ #else
+         NULL,
+ #endif
+-        /* sox_time */
+-        __DATE__ " " __TIME__,
+         /* sox_distro */
+ #ifdef DISTRO
+         DISTRO,
+--- a/src/sox.h
++++ b/src/sox.h
+@@ -1321,7 +1321,6 @@ typedef struct sox_version_info_t {
+     sox_uint32_t version_code; /**< version number = 0x140400 */
+     char const * version;      /**< version string = sox_version(), for example, "14.4.0" */
+     char const * version_extra;/**< version extra info or null = "PACKAGE_EXTRA", for example, "beta" */
+-    char const * time;         /**< build time = "__DATE__ __TIME__", for example, "Jan  7 2010 03:31:50" */
+     char const * distro;       /**< distro or null = "DISTRO", for example, "Debian" */
+     char const * compiler;     /**< compiler info or null, for example, "msvc 160040219" */
+     char const * arch;         /**< arch, for example, "1248 48 44 L OMP" */
+--- a/src/sox.c
++++ b/src/sox.c
+@@ -1828,8 +1828,6 @@ static void display_SoX_version(FILE * f
+       info->version_extra ? info->version_extra : "");
+   if (sox_globals.verbosity > 3) {
+-    if (info->time)
+-      fprintf(file, "time:     %s\n", info->time);
+     if (info->distro)
+       fprintf(file, "issue:    %s\n", info->distro);
+ #if HAVE_SYS_UTSNAME_H
index 6c1b489720fec841bb643421bf3d9d19affdb2df..122a0957981810b03bc0f55b759997972d9aea8b 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2015-2016 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -9,22 +7,21 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=squeezelite
 PKG_VERSION:=1.8.4-743
-PKG_RELEASE=1
+PKG_RELEASE=2
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=LICENSE.txt
-PKG_MAINTAINER:= Ted Hess <thess@kitschensync.net>
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/ralph-irving/squeezelite.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=e37ed17fed9e11a7346cbe9f1e1deeccc051f42e
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=b6ea4a11366330790f5e36bd875b45bb19a9772dfc984c462f436dfca30256c0
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 
-PKG_BUILD_DEPENDS:=libflac libvorbis libmad libfaad2 SQUEEZELITE_WMA:libffmpeg-audio-dec
-
 include $(INCLUDE_DIR)/package.mk
 
 define Package/squeezelite/default
@@ -40,7 +37,7 @@ endef
 define Package/squeezelite-full
     $(call Package/squeezelite/default)
     TITLE+= (full)
-    DEPENDS+= +libflac +libvorbis +libmad +libfaad2 \
+    DEPENDS+= +libflac +libvorbis +libmpg123 +libfaad2 \
               +SQUEEZELITE_WMA:libffmpeg-audio-dec
     VARIANT:=full
 endef
@@ -128,6 +125,7 @@ TARGET_LDFLAGS+= -lasound -lpthread -lm -lrt
 
 ifeq ($(BUILD_VARIANT),full)
     TARGET_CFLAGS+= -DLINKALL
+    TARGET_LDFLAGS+= -lvorbis -logg
 endif
 
 define Package/squeezelite/install
index d5746254d035e89d0d5d65d45628eb0736ecb3aa..de320daf35e16e1406d18911ed92d2436c96d46a 100644 (file)
@@ -102,7 +102,7 @@ make_cmdline() {
        local vorbis_lib="libvorbisidec.so.1"
 
        excl_codecs=`checkcodec decode_flac "libFLAC.so.8" flac "$excl_codecs"`
-       excl_codecs=`checkcodec decode_mp3 "libmad.so.0" mp3 "$excl_codecs"`
+       excl_codecs=`checkcodec decode_mp3 "libmpg123.so.0" mp3 "$excl_codecs"`
        excl_codecs=`checkcodec decode_aac "libfaad.so.2" aac "$excl_codecs"`
 
        [ -e "/usr/lib/$vorbis_lib" ] || vorbis_lib="libvorbisfile.so.3"
diff --git a/sound/squeezelite/patches/020-no_libmad.patch b/sound/squeezelite/patches/020-no_libmad.patch
new file mode 100644 (file)
index 0000000..cb619c6
--- /dev/null
@@ -0,0 +1,83 @@
+--- a/Makefile
++++ b/Makefile
+@@ -15,7 +15,7 @@ OPT_IR      = -DIR
+ SOURCES = \
+       main.c slimproto.c buffer.c stream.c utils.c \
+       output.c output_alsa.c output_pa.c output_stdout.c output_pack.c decode.c \
+-      flac.c pcm.c mad.c vorbis.c faad.c mpg.c
++      flac.c pcm.c vorbis.c faad.c mpg.c
+ SOURCES_DSD      = dsd.c dop.c dsd2pcm/dsd2pcm.c
+ SOURCES_FF       = ffmpeg.c
+@@ -25,7 +25,7 @@ SOURCES_IR       = ir.c
+ LINK_LINUX       = -ldl
+-LINKALL          = -lFLAC -lmad -lvorbisfile -lfaad -lmpg123
++LINKALL          = -lFLAC -lvorbisfile -lfaad -lmpg123
+ LINKALL_FF       = -lavcodec -lavformat -lavutil
+ LINKALL_RESAMPLE = -lsoxr
+ LINKALL_IR       = -llirc_client
+--- a/decode.c
++++ b/decode.c
+@@ -145,8 +145,8 @@ void decode_init(log_level level, const
+       if (!strstr(exclude_codecs, "pcm")  && (!include_codecs || strstr(include_codecs, "pcm")))  codecs[i++] = register_pcm();
+       // try mad then mpg for mp3 unless command line option passed
+-      if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) &&
+-              (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mad")))    codecs[i] = register_mad();
++//    if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) &&
++//            (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mad")))    codecs[i] = register_mad();
+       if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) && !codecs[i] &&
+               (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mpg")))    codecs[i] = register_mpg();
+--- a/main.c
++++ b/main.c
+@@ -39,7 +39,8 @@
+ #else
+ #define CODECS_DSD  ""
+ #endif
+-#define CODECS_MP3  " (mad,mpg for specific mp3 codec)"
++//#define CODECS_MP3  " (mad,mpg for specific mp3 codec)"
++#define CODECS_MP3  " (mpg123 for specific mp3 codec)"
+ #define CODECS CODECS_BASE CODECS_FF CODECS_DSD CODECS_MP3
+--- a/squeezelite.h
++++ b/squeezelite.h
+@@ -154,7 +154,7 @@
+ #if LINUX
+ #define LIBFLAC "libFLAC.so.8"
+-#define LIBMAD  "libmad.so.0"
++//#define LIBMAD  "libmad.so.0"
+ #define LIBMPG "libmpg123.so.0"
+ #define LIBVORBIS "libvorbisfile.so.3"
+ #define LIBTREMOR "libvorbisidec.so.1"
+@@ -168,7 +168,7 @@
+ #if OSX
+ #define LIBFLAC "libFLAC.8.dylib"
+-#define LIBMAD  "libmad.0.dylib"
++//#define LIBMAD  "libmad.0.dylib"
+ #define LIBMPG "libmpg123.0.dylib"
+ #define LIBVORBIS "libvorbisfile.3.dylib"
+ #define LIBTREMOR "libvorbisidec.1.dylib"
+@@ -181,7 +181,7 @@
+ #if WIN
+ #define LIBFLAC "libFLAC.dll"
+-#define LIBMAD  "libmad-0.dll"
++//#define LIBMAD  "libmad-0.dll"
+ #define LIBMPG "libmpg123-0.dll"
+ #define LIBVORBIS "libvorbisfile.dll"
+ #define LIBTREMOR "libvorbisidec.dll"
+@@ -194,7 +194,7 @@
+ #if FREEBSD
+ #define LIBFLAC "libFLAC.so.11"
+-#define LIBMAD  "libmad.so.2"
++//#define LIBMAD  "libmad.so.2"
+ #define LIBMPG "libmpg123.so.0"
+ #define LIBVORBIS "libvorbisfile.so.6"
+ #define LIBTREMOR "libvorbisidec.so.1"
diff --git a/sound/squeezelite/patches/020-no_mpg123.patch b/sound/squeezelite/patches/020-no_mpg123.patch
deleted file mode 100644 (file)
index bc0547a..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -15,7 +15,7 @@ OPT_IR      = -DIR
- SOURCES = \
-       main.c slimproto.c buffer.c stream.c utils.c \
-       output.c output_alsa.c output_pa.c output_stdout.c output_pack.c decode.c \
--      flac.c pcm.c mad.c vorbis.c faad.c mpg.c
-+      flac.c pcm.c mad.c vorbis.c faad.c
- SOURCES_DSD      = dsd.c dop.c dsd2pcm/dsd2pcm.c
- SOURCES_FF       = ffmpeg.c
-@@ -25,7 +25,7 @@ SOURCES_IR       = ir.c
- LINK_LINUX       = -ldl
--LINKALL          = -lFLAC -lmad -lvorbisfile -lfaad -lmpg123
-+LINKALL          = -lFLAC -lmad -lvorbisfile -lfaad
- LINKALL_FF       = -lavcodec -lavformat -lavutil
- LINKALL_RESAMPLE = -lsoxr
- LINKALL_IR       = -llirc_client
---- a/decode.c
-+++ b/decode.c
-@@ -147,8 +147,8 @@ void decode_init(log_level level, const
-       // try mad then mpg for mp3 unless command line option passed
-       if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) &&
-               (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mad")))    codecs[i] = register_mad();
--      if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) && !codecs[i] &&
--              (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mpg")))    codecs[i] = register_mpg();
-+//    if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) && !codecs[i] &&
-+//            (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mpg")))    codecs[i] = register_mpg();
-       mutex_create(decode.mutex);
---- a/main.c
-+++ b/main.c
-@@ -39,7 +39,8 @@
- #else
- #define CODECS_DSD  ""
- #endif
--#define CODECS_MP3  " (mad,mpg for specific mp3 codec)"
-+//#define CODECS_MP3  " (mad,mpg for specific mp3 codec)"
-+#define CODECS_MP3  " (mad for specific mp3 codec)"
- #define CODECS CODECS_BASE CODECS_FF CODECS_DSD CODECS_MP3
---- a/squeezelite.h
-+++ b/squeezelite.h
-@@ -155,7 +155,7 @@
- #if LINUX
- #define LIBFLAC "libFLAC.so.8"
- #define LIBMAD  "libmad.so.0"
--#define LIBMPG "libmpg123.so.0"
-+//#define LIBMPG "libmpg123.so.0"
- #define LIBVORBIS "libvorbisfile.so.3"
- #define LIBTREMOR "libvorbisidec.so.1"
- #define LIBFAAD "libfaad.so.2"
-@@ -169,7 +169,7 @@
- #if OSX
- #define LIBFLAC "libFLAC.8.dylib"
- #define LIBMAD  "libmad.0.dylib"
--#define LIBMPG "libmpg123.0.dylib"
-+//#define LIBMPG "libmpg123.0.dylib"
- #define LIBVORBIS "libvorbisfile.3.dylib"
- #define LIBTREMOR "libvorbisidec.1.dylib"
- #define LIBFAAD "libfaad.2.dylib"
-@@ -182,7 +182,7 @@
- #if WIN
- #define LIBFLAC "libFLAC.dll"
- #define LIBMAD  "libmad-0.dll"
--#define LIBMPG "libmpg123-0.dll"
-+//#define LIBMPG "libmpg123-0.dll"
- #define LIBVORBIS "libvorbisfile.dll"
- #define LIBTREMOR "libvorbisidec.dll"
- #define LIBFAAD "libfaad2.dll"
-@@ -195,7 +195,7 @@
- #if FREEBSD
- #define LIBFLAC "libFLAC.so.11"
- #define LIBMAD  "libmad.so.2"
--#define LIBMPG "libmpg123.so.0"
-+//#define LIBMPG "libmpg123.so.0"
- #define LIBVORBIS "libvorbisfile.so.6"
- #define LIBTREMOR "libvorbisidec.so.1"
- #define LIBFAAD "libfaad.so.2"
index 43c2b13cec4aa60f3606aaa3bd9a36ccbb98eb4d..3587a7c75fce187ec38356c9d3e10c7c71a735f1 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/s/svox
-PKG_MD5SUM:=df4bf610ff4273b420e80ff64af93130
+PKG_HASH:=337b25e6ccb3764f0df1e176470b883c90e40e98840d4133340fcc89eb3cea0c
 
 PKG_MAINTAINER:=Alessandro Di Marco <dmr@ethzero.com>
 PKG_LICENSE:=Apache-2.0
index 27bbee8594d44d50a6e8456c1b966b9eb65add06..d873faa8ecf96024bbcf54e01dd93a821255593f 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.lesbonscomptes.com/upmpdcli/downloads
-PKG_MD5SUM:=de9f232d6d5f746ec81ec239e11bdda4
+PKG_HASH:=2df3e6593f18c097b6247fb8da919b94701bf083b219056b006d68e6dcef75b5
 PKG_MAINTAINER:=Petko Bordjukov <bordjukov@gmail.com>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index 943958247efbbd3c1d9c9501e451d4f16b3aa8e2..53e23561d225c434175d9238a7ef7d36b4ce01b4 100644 (file)
@@ -8,12 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=acl
-PKG_REV:=ea3c6bb711e76d91759f8bf5475e1900362a3142
-PKG_VERSION:=20160519
+PKG_REV:=c39f7c5475e3e00d8abeb7b30e61958670fb3ee2
+PKG_VERSION:=20180121
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=git://git.sv.gnu.org/acl.git
+PKG_MIRROR_HASH:=0291d931bbac041f14bc12d317e505cd596e0ec6f1b8bcdfa03b9a1fad274ac2
+PKG_SOURCE_URL:=https://git.savannah.gnu.org/git/acl.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=$(PKG_REV)
diff --git a/utils/acpica-unix/Makefile b/utils/acpica-unix/Makefile
new file mode 100644 (file)
index 0000000..ff70d71
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2017 Philip Prindeville
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=acpica-unix
+PKG_VERSION:=20171215
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://acpica.org/sites/$(patsubst %-unix,%,$(PKG_NAME))/files/$(PKG_SOURCE_URL)
+PKG_HASH:=1287c3d75c7956680dbb7e90151caef0255797eb29e18dd55588d713ada97d14
+PKG_MAINTAINER:=Philip Prindeville <philipp@redfish-solutions.com>
+
+PKG_LICENSE:=GPL-2.0
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_FORTIFY_SOURCE:=0
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/acpica-unix
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=@TARGET_x86_64
+  TITLE:=ACPI utilities (currently acpidump) for UNIX
+  URL:=https://acpica.org/
+endef
+
+define Package/acpica-unix/description
+       Open Source utilities for ACPI including the ACPICA Machine Language
+       (AML) interpreter, a simulator, test suites, and a compiler to
+       translate ACPI Source Language (ASL) into AML.
+
+       At this time, only acpidump is bundled; more might be added later.
+endef
+
+define Build/Configure
+endef
+
+MAKE_VARS += HOST=_LINUX
+
+MAKE_PATH:=generate/unix
+
+define Package/acpica-unix/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/generate/unix/acpidump/obj/acpidump $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,acpica-unix))
index f1d1d9c19b84b6a3fd8dac699e95ee00cfbfbdae..8f4972a5f7d029dc9b7163c99c8ee05e1ff6d510 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=acpid
-PKG_VERSION:=2.0.27
+PKG_VERSION:=2.0.28
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@SF/acpid2 
-PKG_MD5SUM:=e41bdf628e122edb4342fca432ea7db9
+PKG_HASH:=980c3a54b0d3f2fd49fd845a0584c5c2abeaab9e9ac09fcbb68686bbb57a7110
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index a30fa5d5268343fa0fbb2ae149e8e640a8a5fb57..ea2eb2f80045461e0f49e85446b988cd87d3a4fd 100644 (file)
@@ -7,22 +7,21 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ap51-flash
-PKG_VERSION:=2016-10-16
+PKG_VERSION:=2017-12-07
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://dev.cloudtrax.com/ap51-flash.git
+PKG_SOURCE_URL:=https://github.com/ap51-flash/ap51-flash.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=48b3fbac1c30c5968b2608eb09b53ea37c310a24
+PKG_SOURCE_VERSION:=f94f9c99711d14a3c0186318d822d67d9d0ce391
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=15786a0ecae9be5ed4e8f32940624d1a1c83da924294df08003616a863947074
 PKG_MAINTAINER:=Russell Senior <russell@personaltelco.net>
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=LICENSES/preferred/GPL-3.0
 
 include $(INCLUDE_DIR)/package.mk
 
-ifeq ($(CONFIG_BIG_ENDIAN),y)
-  STAMP_BUILT:=$(STAMP_BUILT)_big
-endif
-
 define Package/ap51-flash
   SECTION:=utils
   CATEGORY:=Utilities
@@ -30,15 +29,8 @@ define Package/ap51-flash
   URL:=http://dev.cloudtrax.com/wiki/ap51-flash-station
 endef
 
-TARGET_EXTRA_CFLAGS:=-DFLASH_FROM_FILE -DNO_LIBPCAP -D_GNU_SOURCE -DIPPORT_TFTP=69
-ifeq ($(CONFIG_BIG_ENDIAN),y)
-       TARGET_EXTRA_CFLAGS:=$(TARGET_EXTRA_CFLAGS) -DUIP_CONF_BYTE_ORDER=1234
-endif
-
 # pass optimization flags
 MAKE_FLAGS += \
-       OFLAGS="$(TARGET_CFLAGS)" \
-       EXTRA_CFLAGS="$(TARGET_EXTRA_CFLAGS)" \
        REVISION="$(PKG_VERSION)" \
        ap51-flash
 
index b9a4ef8d4283d1c91a66a75374deb5078bf377b4..17a2d721b9744269b02664c4991880fe8f77da20 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=at
-PKG_VERSION:=3.1.16
-PKG_RELEASE:=2
+PKG_VERSION:=3.1.20
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/a/at
-PKG_MD5SUM:=d05da75d9b75d93917ffb16ab48b1e19
+PKG_HASH:=0871923cab73050b98ace020664eb2ddc1e669e4166b5abb64d864d02fcefab9
 
 PKG_LICENSE:=GPL-2.0+ GPL-3.0+ ISC
 PKG_LICENSE_FILES:=COPYING Copyright
diff --git a/utils/attendedsysupgrade-common/Makefile b/utils/attendedsysupgrade-common/Makefile
new file mode 100644 (file)
index 0000000..d1419ae
--- /dev/null
@@ -0,0 +1,56 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=attendedsysupgrade-common
+PKG_VERSION:=0.1
+PKG_RELEASE:=2
+PKG_LICENSE:=GPL-2.0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/attendedsysupgrade-common
+  SECTION:=utils
+  CATEGORY:=Base system
+  TITLE:=Common files neede by attendedsysupgrade packages
+  MAINTAINER:=Paul Spooren <paul@spooren.de>
+  DEPENDS:=+rpcd +rpcd-mod-rpcsys
+endef
+
+define Package/attendedsysupgrade-common/description
+       Common needed files for attendedsysupgrade tool
+
+       Manages dependencies and brings settings used by clients.
+
+       UCI options:
+
+       attendedsysupgrade.server.url
+       URL of compatible upgrade server [1]
+
+       attendedsysupgrade.client.upgrade_packages
+       Client should request image also if no new release but new packages upgrade are available.
+
+       attendedsysupgrade.client.advanced_mode
+       Offer advanced options like editing packages before request and show additional information.
+
+       attendedsysupgrade.client.auto_search
+       Tells the client to automattically search for upgrades
+       This can be done when opening luci or login in to console - depends on client.
+
+       [1]: https://github.com/aparcar/gsoc17-attended-sysupgrade
+endef
+
+define Build/Compile
+endef
+
+define Build/Configure
+endef
+
+define Package/attendedsysupgrade-common/install
+       $(INSTALL_DIR) $(1)/etc/uci-defaults/
+       $(INSTALL_BIN) ./files/attendedsysupgrade.defaults $(1)/etc/uci-defaults/attendedsysupgrade
+endef
+
+$(eval $(call BuildPackage,attendedsysupgrade-common))
diff --git a/utils/attendedsysupgrade-common/files/attendedsysupgrade.defaults b/utils/attendedsysupgrade-common/files/attendedsysupgrade.defaults
new file mode 100644 (file)
index 0000000..f7fb1eb
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+[ -e /etc/config/attendedsysupgrade ] && return 0
+
+touch /etc/config/attendedsysupgrade
+
+uci -q batch <<EOF
+set attendedsysupgrade.server=server
+set attendedsysupgrade.server.url='https://example.org'
+
+set attendedsysupgrade.client=client
+set attendedsysupgrade.client.upgrade_packages='1'
+set attendedsysupgrade.client.auto_search='0'
+set attendedsysupgrade.client.advanced_mode='0'
+
+commit attendedsysupgrade
+EOF
index 9eb978fc6dda2ff93a021d7c5d2643fbe383e89c..ad35355565149be302fb0b43aac2a469bf19407f 100644 (file)
@@ -8,15 +8,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=attr
-PKG_REV:=315af30d0c1a198dc662a90e6e6ae2456abf2489
-PKG_VERSION:=20160302
+PKG_REV:=cfd8e6ef491a7a5ff900ba2ba3deff7d0bebb0a6
+PKG_VERSION:=20170915
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://git.savannah.gnu.org/r/attr.git
+PKG_SOURCE_URL:=https://git.savannah.gnu.org/git/attr.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_MIRROR_HASH:=3c4f9331fd73192801a30071a379f07b48699adffe0d560133a740ade029a04c
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 
 PKG_LICENSE:=LGPL-2.1 GPL-2.0
diff --git a/utils/auc/Makefile b/utils/auc/Makefile
new file mode 100644 (file)
index 0000000..4440670
--- /dev/null
@@ -0,0 +1,38 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=auc
+PKG_VERSION:=0.0.9
+PKG_RELEASE:=2
+PKG_LICENSE:=GPL-3.0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/auc
+  SECTION:=base
+  CATEGORY:=Base system
+  TITLE:=Attended sysUpgrade CLI (EXPERIMENTAL)
+  DEPENDS:=+attendedsysupgrade-common +libblobmsg-json +libubox +libubus \
+           +libuci +libuclient +rpcd-mod-rpcsys
+endef
+
+define Package/auc/description
+   CLI client for attended-sysupgrade
+endef
+
+# set to 1 to enable debugging
+DEBUG:=1
+
+EXTRA_CFLAGS += \
+       $(if $(DEBUG),-DAUC_DEBUG=ON)
+
+define Package/auc/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/auc $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,auc))
diff --git a/utils/auc/src/CMakeLists.txt b/utils/auc/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ce291a4
--- /dev/null
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 2.6)
+
+PROJECT(auc C)
+ADD_DEFINITIONS(-Os -ggdb -Wall --std=gnu99 -Wmissing-declarations)
+
+SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
+
+find_library(json NAMES json-c json)
+
+ADD_EXECUTABLE(auc auc.c)
+TARGET_LINK_LIBRARIES(auc uci ubox ubus uclient blobmsg_json ${json})
+INSTALL(TARGETS auc RUNTIME DESTINATION sbin)
diff --git a/utils/auc/src/auc.c b/utils/auc/src/auc.c
new file mode 100644 (file)
index 0000000..6c53b1b
--- /dev/null
@@ -0,0 +1,1172 @@
+/*
+ * auc - attendedsysUpgrade CLI
+ * Copyright (C) 2017 Daniel Golle <daniel@makrotopia.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3
+ * as published by the Free Software Foundation
+ *
+ * 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.
+ */
+
+#define _GNU_SOURCE
+#define AUC_VERSION "0.0.9"
+
+#include <fcntl.h>
+#include <dlfcn.h>
+#include <glob.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include <uci.h>
+#include <uci_blob.h>
+#include <json-c/json.h>
+#include <libubox/ulog.h>
+#include <libubox/list.h>
+#include <libubox/vlist.h>
+#include <libubox/blobmsg_json.h>
+#include <libubox/avl-cmp.h>
+#include <libubox/uclient.h>
+#include <libubox/uclient-utils.h>
+#include <libubus.h>
+
+#define REQ_TIMEOUT 15
+#define APIOBJ_CHECK "api/upgrade-check"
+#define APIOBJ_REQUEST "api/upgrade-request"
+
+#define PUBKEY_PATH "/etc/opkg/keys"
+
+#ifdef AUC_DEBUG
+#define DPRINTF(...) if (debug) fprintf(stderr, __VA_ARGS__)
+#else
+#define DPRINTF(...)
+#endif
+
+static const char server_issues[]="https://github.com/aparcar/attendedsysupgrade-server/issues";
+
+static char user_agent[80];
+static char *serverurl;
+static int upgrade_packages;
+static struct ustream_ssl_ctx *ssl_ctx;
+static const struct ustream_ssl_ops *ssl_ops;
+static off_t out_bytes;
+static off_t out_len;
+static off_t out_offset;
+static bool cur_resume;
+static int output_fd = -1;
+static int retry, imagebuilder, building, ibready;
+static char *board_name = NULL;
+static char *target = NULL, *subtarget = NULL;
+static char *distribution = NULL, *version = NULL;
+static int uptodate;
+static char *filename = NULL;
+static int rc;
+
+#ifdef AUC_DEBUG
+static int debug = 0;
+#endif
+
+/*
+ * policy for ubus call system board
+ * see procd/system.c
+ */
+enum {
+       BOARD_BOARD_NAME,
+       BOARD_RELEASE,
+       __BOARD_MAX,
+};
+
+static const struct blobmsg_policy board_policy[__BOARD_MAX] = {
+       [BOARD_BOARD_NAME] = { .name = "board_name", .type = BLOBMSG_TYPE_STRING },
+       [BOARD_RELEASE] = { .name = "release", .type = BLOBMSG_TYPE_TABLE },
+};
+
+/*
+ * policy for release information in system board reply
+ * see procd/system.c
+ */
+enum {
+       RELEASE_DISTRIBUTION,
+       RELEASE_VERSION,
+       RELEASE_TARGET,
+       __RELEASE_MAX,
+};
+
+static const struct blobmsg_policy release_policy[__RELEASE_MAX] = {
+       [RELEASE_DISTRIBUTION] = { .name = "distribution", .type = BLOBMSG_TYPE_STRING },
+       [RELEASE_VERSION] = { .name = "version", .type = BLOBMSG_TYPE_STRING },
+       [RELEASE_TARGET] = { .name = "target", .type = BLOBMSG_TYPE_STRING },
+};
+
+/*
+ * policy for packagelist
+ * see rpcd/sys.c
+ */
+enum {
+       PACKAGELIST_PACKAGES,
+       __PACKAGELIST_MAX,
+};
+
+static const struct blobmsg_policy packagelist_policy[__PACKAGELIST_MAX] = {
+       [PACKAGELIST_PACKAGES] = { .name = "packages", .type = BLOBMSG_TYPE_TABLE },
+};
+
+/*
+ * policy for upgrade_test
+ * see rpcd/sys.c
+ */
+enum {
+       UPGTEST_CODE,
+       UPGTEST_STDOUT,
+       __UPGTEST_MAX,
+};
+
+static const struct blobmsg_policy upgtest_policy[__UPGTEST_MAX] = {
+       [UPGTEST_CODE] = { .name = "code", .type = BLOBMSG_TYPE_INT32 },
+       [UPGTEST_STDOUT] = { .name = "stdout", .type = BLOBMSG_TYPE_STRING },
+};
+
+
+/*
+ * policy to extract version from upgrade-check response
+ */
+enum {
+       CHECK_VERSION,
+       CHECK_UPGRADES,
+       __CHECK_MAX,
+};
+
+static const struct blobmsg_policy check_policy[__CHECK_MAX] = {
+       [CHECK_VERSION] = { .name = "version", .type = BLOBMSG_TYPE_STRING },
+       [CHECK_UPGRADES] = { .name = "upgrades", .type = BLOBMSG_TYPE_TABLE },
+};
+
+static const struct blobmsg_policy pkg_upgrades_policy[2] = {
+       { .type = BLOBMSG_TYPE_STRING },
+       { .type = BLOBMSG_TYPE_STRING },
+};
+
+/*
+ * policy for upgrade-request response
+ * parse download information for the ready image.
+ */
+enum {
+       IMAGE_REQHASH,
+       IMAGE_FILESIZE,
+       IMAGE_URL,
+       IMAGE_CHECKSUM,
+       IMAGE_FILES,
+       IMAGE_SYSUPGRADE,
+       __IMAGE_MAX,
+};
+
+static const struct blobmsg_policy image_policy[__IMAGE_MAX] = {
+       [IMAGE_REQHASH] = { .name = "request_hash", .type = BLOBMSG_TYPE_STRING },
+       [IMAGE_URL] = { .name = "url", .type = BLOBMSG_TYPE_STRING },
+       [IMAGE_FILES] = { .name = "files", .type = BLOBMSG_TYPE_STRING },
+       [IMAGE_SYSUPGRADE] = { .name = "sysupgrade", .type = BLOBMSG_TYPE_STRING },
+};
+
+/*
+ * policy for HTTP headers received from server
+ */
+enum {
+       H_RANGE,
+       H_LEN,
+       H_IBSTATUS,
+       H_IBQUEUEPOS,
+       H_UNKNOWN_PACKAGE,
+       __H_MAX
+};
+
+static const struct blobmsg_policy policy[__H_MAX] = {
+       [H_RANGE] = { .name = "content-range", .type = BLOBMSG_TYPE_STRING },
+       [H_LEN] = { .name = "content-length", .type = BLOBMSG_TYPE_STRING },
+       [H_IBSTATUS] = { .name = "x-imagebuilder-status", .type = BLOBMSG_TYPE_STRING },
+       [H_IBQUEUEPOS] = { .name = "x-build-queue-position", .type = BLOBMSG_TYPE_STRING },
+       [H_UNKNOWN_PACKAGE] = { .name = "x-unknown-package", .type = BLOBMSG_TYPE_STRING },
+};
+
+/*
+ * load serverurl from UCI
+ */
+static int load_config() {
+       struct uci_context *uci_ctx;
+       struct uci_package *uci_attendedsysupgrade;
+       struct uci_section *uci_s;
+
+       uci_ctx = uci_alloc_context();
+       if (!uci_ctx)
+               return -1;
+
+       uci_ctx->flags &= ~UCI_FLAG_STRICT;
+
+       if (uci_load(uci_ctx, "attendedsysupgrade", &uci_attendedsysupgrade) ||
+           !uci_attendedsysupgrade) {
+               fprintf(stderr, "Failed to load attendedsysupgrade config\n");
+               return -1;
+       }
+
+       uci_s = uci_lookup_section(uci_ctx, uci_attendedsysupgrade, "server");
+       if (!uci_s) {
+               fprintf(stderr, "Failed to read server url from config\n");
+               return -1;
+       }
+       serverurl = strdup(uci_lookup_option_string(uci_ctx, uci_s, "url"));
+
+       uci_s = uci_lookup_section(uci_ctx, uci_attendedsysupgrade, "client");
+       if (!uci_s) {
+               fprintf(stderr, "Failed to read client config\n");
+               return -1;
+       }
+       upgrade_packages = atoi(uci_lookup_option_string(uci_ctx, uci_s, "upgrade_packages"));
+
+       uci_free_context(uci_ctx);
+
+       return 0;
+}
+
+
+/**
+ * UBUS response callbacks
+ */
+
+/*
+ * rpc-sys packagelist
+ * append packagelist response to blobbuf given in req->priv
+ */
+static void pkglist_check_cb(struct ubus_request *req, int type, struct blob_attr *msg) {
+       struct blob_buf *buf = (struct blob_buf *)req->priv;
+       struct blob_attr *tb[__PACKAGELIST_MAX];
+
+       blobmsg_parse(packagelist_policy, __PACKAGELIST_MAX, tb, blob_data(msg), blob_len(msg));
+
+       if (!tb[PACKAGELIST_PACKAGES]) {
+               fprintf(stderr, "No packagelist received\n");
+               rc=-1;
+               return;
+       }
+
+       blobmsg_add_field(buf, BLOBMSG_TYPE_TABLE, "packages", blobmsg_data(tb[PACKAGELIST_PACKAGES]), blobmsg_data_len(tb[PACKAGELIST_PACKAGES]));
+};
+
+/*
+ * rpc-sys packagelist
+ * append array of package names to blobbuf given in req->priv
+ */
+static void pkglist_req_cb(struct ubus_request *req, int type, struct blob_attr *msg) {
+       struct blob_buf *buf = (struct blob_buf *)req->priv;
+       struct blob_attr *tb[__PACKAGELIST_MAX];
+       struct blob_attr *cur;
+       int rem;
+       void *array;
+
+       blobmsg_parse(packagelist_policy, __PACKAGELIST_MAX, tb, blob_data(msg), blob_len(msg));
+
+       if (!tb[PACKAGELIST_PACKAGES]) {
+               fprintf(stderr, "No packagelist received\n");
+               return;
+       }
+
+       array = blobmsg_open_array(buf, "packages");
+       blobmsg_for_each_attr(cur, tb[PACKAGELIST_PACKAGES], rem)
+               blobmsg_add_string(buf, NULL, blobmsg_name(cur));
+
+       blobmsg_close_array(buf, array);
+};
+
+
+/*
+ * system board
+ * append append board information to blobbuf given in req->priv
+ * populate board and release global strings
+ */
+static void board_cb(struct ubus_request *req, int type, struct blob_attr *msg) {
+       struct blob_buf *buf = (struct blob_buf *)req->priv;
+       struct blob_attr *tb[__BOARD_MAX];
+       struct blob_attr *rel[__RELEASE_MAX];
+
+       blobmsg_parse(board_policy, __BOARD_MAX, tb, blob_data(msg), blob_len(msg));
+
+       if (!tb[BOARD_BOARD_NAME]) {
+               fprintf(stderr, "No board name received\n");
+               rc=-1;
+               return;
+       }
+       board_name = strdup(blobmsg_get_string(tb[BOARD_BOARD_NAME]));
+
+       if (!tb[BOARD_RELEASE]) {
+               fprintf(stderr, "No release received\n");
+               rc=-1;
+               return;
+       }
+
+       blobmsg_parse(release_policy, __RELEASE_MAX, rel,
+                       blobmsg_data(tb[BOARD_RELEASE]), blobmsg_data_len(tb[BOARD_RELEASE]));
+
+       if (!rel[RELEASE_TARGET]) {
+               fprintf(stderr, "No target received\n");
+               rc=-1;
+               return;
+       }
+
+       target = strdup(blobmsg_get_string(rel[RELEASE_TARGET]));
+       subtarget = strchr(target, '/');
+       *subtarget++ = '\0';
+
+       distribution = strdup(blobmsg_get_string(rel[RELEASE_DISTRIBUTION]));
+       version = strdup(blobmsg_get_string(rel[RELEASE_VERSION]));
+
+       blobmsg_add_string(buf, "distro", distribution);
+       blobmsg_add_string(buf, "target", target);
+       blobmsg_add_string(buf, "subtarget", subtarget);
+       blobmsg_add_string(buf, "version", version);
+}
+
+/*
+ * rpc-sys upgrade_test
+ * check if downloaded file is accepted by sysupgrade
+ */
+static void upgtest_cb(struct ubus_request *req, int type, struct blob_attr *msg) {
+       int *valid = (int *)req->priv;
+       struct blob_attr *tb[__UPGTEST_MAX];
+
+       blobmsg_parse(upgtest_policy, __UPGTEST_MAX, tb, blob_data(msg), blob_len(msg));
+
+       if (!tb[UPGTEST_CODE]) {
+               fprintf(stderr, "No sysupgrade test return code received\n");
+               return;
+       }
+
+       *valid = (blobmsg_get_u32(tb[UPGTEST_CODE]) == 0)?1:0;
+       if (*valid == 0)
+               fprintf(stderr, "%s", blobmsg_get_string(tb[UPGTEST_STDOUT]));
+};
+
+/**
+ * uclient stuff
+ */
+static int open_output_file(const char *path, uint64_t resume_offset)
+{
+       char *filename = NULL;
+       int flags;
+       int ret;
+
+       if (cur_resume)
+               flags = O_RDWR;
+       else
+               flags = O_WRONLY | O_EXCL;
+
+       flags |= O_CREAT;
+
+       filename = uclient_get_url_filename(path, "firmware.bin");
+
+       fprintf(stderr, "Writing to '%s'\n", filename);
+       ret = open(filename, flags, 0644);
+       if (ret < 0)
+               goto free;
+
+       if (resume_offset &&
+           lseek(ret, resume_offset, SEEK_SET) < 0) {
+               fprintf(stderr, "Failed to seek %"PRIu64" bytes in output file\n", resume_offset);
+               close(ret);
+               ret = -1;
+               goto free;
+       }
+
+       out_offset = resume_offset;
+       out_bytes += resume_offset;
+
+free:
+       free(filename);
+       return ret;
+}
+
+struct jsonblobber {
+       json_tokener *tok;
+       struct blob_buf *outbuf;
+};
+
+static void request_done(struct uclient *cl)
+{
+       struct jsonblobber *jsb = (struct jsonblobber *)cl->priv;
+       if (jsb) {
+               json_tokener_free(jsb->tok);
+               free(jsb);
+       };
+
+       uclient_disconnect(cl);
+       uloop_end();
+}
+
+static void header_done_cb(struct uclient *cl)
+{
+       struct blob_attr *tb[__H_MAX];
+       uint64_t resume_offset = 0, resume_end, resume_size;
+       char *ibstatus;
+       unsigned int queuepos = 0;
+
+       if (uclient_http_redirect(cl)) {
+               fprintf(stderr, "Redirected to %s on %s\n", cl->url->location, cl->url->host);
+
+               return;
+       }
+
+       if (cl->status_code == 204 && cur_resume) {
+               /* Resume attempt failed, try normal download */
+               cur_resume = false;
+               //init_request(cl);
+               return;
+       }
+
+       DPRINTF("headers:\n%s\n", blobmsg_format_json_indent(cl->meta, true, 0));
+
+       blobmsg_parse(policy, __H_MAX, tb, blob_data(cl->meta), blob_len(cl->meta));
+
+       switch (cl->status_code) {
+       case 400:
+               request_done(cl);
+               rc=-1;
+               break;
+       case 412:
+               fprintf(stderr, "%s target %s/%s (%s) not found. Please report this at %s\n",
+                       distribution, target, subtarget, board_name, server_issues);
+               request_done(cl);
+               rc=-2;
+               break;
+       case 413:
+               fprintf(stderr, "image too big.\n");
+               rc=-1;
+               request_done(cl);
+               break;
+       case 416:
+               fprintf(stderr, "File download already fully retrieved; nothing to do.\n");
+               request_done(cl);
+               break;
+       case 422:
+               fprintf(stderr, "unknown package '%s' requested.\n",
+                       blobmsg_get_string(tb[H_UNKNOWN_PACKAGE]));
+               rc=-1;
+               request_done(cl);
+               break;
+       case 501:
+               fprintf(stderr, "ImageBuilder didn't produce sysupgrade file.\n");
+               rc=-2;
+               request_done(cl);
+               break;
+       case 204:
+               fprintf(stdout, "system is up to date.\n");
+               uptodate=1;
+               request_done(cl);
+               break;
+       case 206:
+               if (!cur_resume) {
+                       fprintf(stderr, "Error: Partial content received, full content requested\n");
+                       request_done(cl);
+                       break;
+               }
+
+               if (!tb[H_RANGE]) {
+                       fprintf(stderr, "Content-Range header is missing\n");
+                       break;
+               }
+
+               if (sscanf(blobmsg_get_string(tb[H_RANGE]),
+                          "bytes %"PRIu64"-%"PRIu64"/%"PRIu64,
+                          &resume_offset, &resume_end, &resume_size) != 3) {
+                       fprintf(stderr, "Content-Range header is invalid\n");
+                       break;
+               }
+       case 202:
+               if (!tb[H_IBSTATUS])
+                       break;
+
+               ibstatus = blobmsg_get_string(tb[H_IBSTATUS]);
+
+               if (!strncmp(ibstatus, "queue", 6)) {
+                       if (!imagebuilder) {
+                               fprintf(stderr, "server is dispatching build job\n");
+                               imagebuilder=1;
+                       } else {
+                               if (tb[H_IBQUEUEPOS]) {
+                                       queuepos = atoi(blobmsg_get_string(tb[H_IBQUEUEPOS]));
+                                       fprintf(stderr, "build is in queue position %u.\n", queuepos);
+                               }
+                       }
+                       retry=1;
+               } else if (!strncmp(ibstatus, "building", 9)) {
+                       if (!building) {
+                               fprintf(stderr, "server is now building image...\n");
+                               building=1;
+                       }
+                       retry=1;
+               } else if (!strncmp(ibstatus, "initialize", 11)) {
+                       if (!ibready) {
+                               fprintf(stderr, "server is setting up ImageBuilder...\n");
+                               ibready=1;
+                       }
+                       retry=1;
+               } else {
+                       fprintf(stderr, "unrecognized remote imagebuilder status '%s'\n", ibstatus);
+                       rc=-2;
+               }
+               // fall through
+       case 200:
+               if (cl->priv)
+                       break;
+
+               if (tb[H_LEN])
+                       out_len = strtoul(blobmsg_get_string(tb[H_LEN]), NULL, 10);
+
+               output_fd = open_output_file(cl->url->location, resume_offset);
+               if (output_fd < 0) {
+                       perror("Cannot open output file");
+                       request_done(cl);
+               }
+               break;
+
+       default:
+               fprintf(stderr, "HTTP error %d\n", cl->status_code);
+               request_done(cl);
+               break;
+       }
+}
+
+static void read_data_cb(struct uclient *cl)
+{
+       char buf[256];
+       int len;
+       json_object *jsobj;
+       struct blob_buf *outbuf = NULL;
+       json_tokener *tok = NULL;
+       struct jsonblobber *jsb = (struct jsonblobber *)cl->priv;
+
+       if (!jsb) {
+               while (1) {
+                       len = uclient_read(cl, buf, sizeof(buf));
+                       if (!len)
+                               return;
+
+                       out_bytes += len;
+                       write(output_fd, buf, len);
+               }
+               return;
+       }
+
+       outbuf = jsb->outbuf;
+       tok = jsb->tok;
+
+       while (1) {
+               len = uclient_read(cl, buf, sizeof(buf));
+               if (!len)
+                       break;
+
+               out_bytes += len;
+
+               jsobj = json_tokener_parse_ex(tok, buf, len);
+
+               if (json_tokener_get_error(tok) == json_tokener_continue)
+                       continue;
+
+               if (json_tokener_get_error(tok) != json_tokener_success)
+                       break;
+
+               if (jsobj)
+               {
+                       if (json_object_get_type(jsobj) == json_type_object)
+                               blobmsg_add_object(outbuf, jsobj);
+
+                       json_object_put(jsobj);
+                       break;
+               }
+       }
+}
+
+static void eof_cb(struct uclient *cl)
+{
+       if (!cl->data_eof && !uptodate) {
+               fprintf(stderr, "Connection reset prematurely\n");
+       }
+       request_done(cl);
+}
+
+static void handle_uclient_error(struct uclient *cl, int code)
+{
+       const char *type = "Unknown error";
+
+       switch(code) {
+       case UCLIENT_ERROR_CONNECT:
+               type = "Connection failed";
+               break;
+       case UCLIENT_ERROR_TIMEDOUT:
+               type = "Connection timed out";
+               break;
+       case UCLIENT_ERROR_SSL_INVALID_CERT:
+               type = "Invalid SSL certificate";
+               break;
+       case UCLIENT_ERROR_SSL_CN_MISMATCH:
+               type = "Server hostname does not match SSL certificate";
+               break;
+       default:
+               break;
+       }
+
+       fprintf(stderr, "Connection error: %s\n", type);
+
+       request_done(cl);
+}
+
+static const struct uclient_cb check_cb = {
+       .header_done = header_done_cb,
+       .data_read = read_data_cb,
+       .data_eof = eof_cb,
+       .error = handle_uclient_error,
+};
+
+static int server_request(const char *url, struct blob_buf *inbuf, struct blob_buf *outbuf) {
+       struct uclient *ucl;
+       struct jsonblobber *jsb = NULL;
+       int rc = -1;
+       char *post_data;
+       out_offset = 0;
+       out_bytes = 0;
+       out_len = 0;
+
+       uloop_init();
+
+       ucl = uclient_new(url, NULL, &check_cb);
+       if (outbuf) {
+               jsb = malloc(sizeof(struct jsonblobber));
+               jsb->outbuf = outbuf;
+               jsb->tok = json_tokener_new();
+       };
+
+       uclient_http_set_ssl_ctx(ucl, ssl_ops, ssl_ctx, 1);
+       ucl->timeout_msecs = REQ_TIMEOUT * 1000;
+       ucl->priv = jsb;
+       rc = uclient_connect(ucl);
+       if (rc)
+               return rc;
+
+       rc = uclient_http_set_request_type(ucl, inbuf?"POST":"GET");
+       if (rc)
+               return rc;
+
+       uclient_http_reset_headers(ucl);
+       uclient_http_set_header(ucl, "User-Agent", user_agent);
+       if (inbuf) {
+               uclient_http_set_header(ucl, "Content-Type", "text/json");
+               post_data = blobmsg_format_json(inbuf->head, true);
+               uclient_write(ucl, post_data, strlen(post_data));
+       }
+       rc = uclient_request(ucl);
+       if (rc)
+               return rc;
+
+       uloop_run();
+       uloop_done();
+       uclient_free(ucl);
+
+       return 0;
+}
+
+/**
+ * ustream-ssl
+ */
+static int init_ustream_ssl(void) {
+       void *dlh;
+       glob_t gl;
+       int i;
+
+       dlh = dlopen("libustream-ssl.so", RTLD_LAZY | RTLD_LOCAL);
+       if (!dlh)
+               return -1;
+
+       ssl_ops = dlsym(dlh, "ustream_ssl_ops");
+       if (!ssl_ops)
+               return -1;
+
+       ssl_ctx = ssl_ops->context_new(false);
+
+       glob("/etc/ssl/certs/*.crt", 0, NULL, &gl);
+       if (!gl.gl_pathc)
+               return -2;
+
+       for (i = 0; i < gl.gl_pathc; i++)
+               ssl_ops->context_add_ca_crt_file(ssl_ctx, gl.gl_pathv[i]);
+
+       return 0;
+}
+
+/**
+ * use busybox sha256sum to verify sha256sums file
+ */
+static int sha256sum_v(const char *sha256file, const char *msgfile) {
+       pid_t pid;
+       int fds[2];
+       int status;
+       FILE *f = fopen(sha256file, "r");
+       char sumline[512] = {};
+       char *fname;
+       unsigned int fnlen;
+       unsigned int cnt = 0;
+
+       if (pipe(fds))
+               return -1;
+
+       if (!f)
+               return -1;
+
+
+       pid = fork();
+       switch (pid) {
+       case -1:
+               return -1;
+
+       case 0:
+               uloop_done();
+
+               dup2(fds[0], 0);
+               close(1);
+               close(2);
+               close(fds[0]);
+               close(fds[1]);
+               if (execl("/bin/busybox", "/bin/busybox", "sha256sum", "-s", "-c", NULL));
+                       return -1;
+
+               break;
+
+       default:
+               while (fgets(sumline, sizeof(sumline), f)) {
+                       fname = &sumline[66];
+                       fnlen = strlen(fname);
+                       fname[fnlen-1] = '\0';
+                       if (!strcmp(fname, msgfile)) {
+                               fname[fnlen-1] = '\n';
+                               write(fds[1], sumline, strlen(sumline));
+                               cnt++;
+                       }
+               }
+               fclose(f);
+               close(fds[1]);
+               waitpid(pid, &status, 0);
+               close(fds[0]);
+
+               if (cnt == 1)
+                       return WEXITSTATUS(status);
+               else
+                       return -1;
+       }
+
+       return -1;
+}
+
+/**
+ * use usign to verify sha256sums.sig
+ */
+static int usign_v(const char *file) {
+       pid_t pid;
+       int status;
+
+       pid = fork();
+       switch (pid) {
+       case -1:
+               return -1;
+
+       case 0:
+               uloop_done();
+
+               if (execl("/usr/bin/usign", "/usr/bin/usign",
+                         "-V", "-q", "-P", PUBKEY_PATH, "-m", file, NULL));
+                       return -1;
+
+               break;
+
+       default:
+               waitpid(pid, &status, 0);
+               return WEXITSTATUS(status);
+       }
+
+       return -1;
+}
+
+static int ask_user(void)
+{
+       fprintf(stderr, "Are you sure you want to continue the upgrade process? [N/y] ");
+       if (getchar() != 'y')
+               return -1;
+       return 0;
+}
+
+static void print_package_updates(struct blob_attr *upgrades) {
+       struct blob_attr *cur;
+       struct blob_attr *tb[2];
+       int rem;
+
+       blobmsg_for_each_attr(cur, upgrades, rem) {
+               blobmsg_parse_array(pkg_upgrades_policy, ARRAY_SIZE(policy), tb, blobmsg_data(cur), blobmsg_data_len(cur));
+               if (!tb[0] || !tb[1])
+                       continue;
+
+               fprintf(stdout, "\t%s (%s -> %s)\n", blobmsg_name(cur),
+                       blobmsg_get_string(tb[1]), blobmsg_get_string(tb[0]));
+       };
+}
+
+/* this main function is too big... todo: split */
+int main(int args, char *argv[]) {
+       static struct blob_buf allpkg, checkbuf, infobuf, reqbuf, imgbuf, upgbuf;
+       struct ubus_context *ctx = ubus_connect(NULL);
+       uint32_t id;
+       int valid, use_get;
+       char url[256];
+       char *newversion = NULL;
+       struct blob_attr *tb[__IMAGE_MAX];
+       struct blob_attr *tbc[__CHECK_MAX];
+       char *tmp;
+       struct stat imgstat;
+       int check_only = 0;
+       int ignore_sig = 0;
+       unsigned char argc = 1;
+
+       snprintf(user_agent, sizeof(user_agent), "%s (%s)", argv[0], AUC_VERSION);
+       fprintf(stdout, "%s\n", user_agent);
+
+       while (argc<args) {
+               if (!strncmp(argv[argc], "-h", 3) ||
+                   !strncmp(argv[argc], "--help", 7)) {
+                       fprintf(stdout, "%s: Attended sysUpgrade CLI client\n", argv[0]);
+                       fprintf(stdout, "Usage: auc [-d] [-h]\n");
+                       fprintf(stdout, " -c\tonly check if system is up-to-date\n");
+                       fprintf(stdout, " -F\tignore result of signature verification\n");
+#ifdef AUC_DEBUG
+                       fprintf(stdout, " -d\tenable debugging output\n");
+#endif
+                       fprintf(stdout, " -h\toutput help\n");
+                       return 0;
+               }
+
+#ifdef AUC_DEBUG
+               if (!strncmp(argv[argc], "-d", 3))
+                       debug = 1;
+#endif
+               if (!strncmp(argv[argc], "-c", 3))
+                       check_only = 1;
+
+               if (!strncmp(argv[argc], "-F", 3))
+                       ignore_sig = 1;
+
+               argc++;
+       };
+
+       if (!ctx) {
+               fprintf(stderr, "failed to connect to ubus.\n");
+               return -1;
+       }
+       if (load_config()) {
+               rc=-1;
+               goto freeubus;
+       }
+
+       if (chdir("/tmp")) {
+               rc=-1;
+               goto freeconfig;
+       }
+
+       rc = init_ustream_ssl();
+       if (rc == -2) {
+               fprintf(stderr, "No CA certificates loaded, please install ca-certificates\n");
+               rc=-1;
+               goto freessl;
+       }
+
+       if (rc || !ssl_ctx) {
+               fprintf(stderr, "SSL support not available, please install ustream-ssl\n");
+               rc=-1;
+               goto freessl;
+       }
+
+       blobmsg_buf_init(&checkbuf);
+       blobmsg_buf_init(&infobuf);
+       blobmsg_buf_init(&reqbuf);
+       blobmsg_buf_init(&imgbuf);
+       /* ubus requires BLOBMSG_TYPE_UNSPEC */
+       blob_buf_init(&allpkg, 0);
+       blob_buf_init(&upgbuf, 0);
+
+       if (ubus_lookup_id(ctx, "system", &id) ||
+           ubus_invoke(ctx, id, "board", NULL, board_cb, &checkbuf, 3000)) {
+               fprintf(stderr, "cannot request board info from procd\n");
+               rc=-1;
+               goto freebufs;
+       }
+
+       if (rc)
+               goto freebufs;
+
+       blobmsg_add_u8(&allpkg, "all", 1);
+       blobmsg_add_string(&allpkg, "dummy", "foo");
+       if (ubus_lookup_id(ctx, "rpc-sys", &id) ||
+           ubus_invoke(ctx, id, "packagelist", allpkg.head, pkglist_check_cb, &checkbuf, 3000)) {
+               fprintf(stderr, "cannot request packagelist from rpcd\n");
+               rc=-1;
+               goto freeboard;
+       }
+
+       if (rc)
+               goto freeboard;
+
+       blobmsg_add_u32(&checkbuf, "upgrade_packages", upgrade_packages);
+
+       fprintf(stdout, "running %s %s on %s/%s (%s)\n", distribution,
+               version, target, subtarget, board_name);
+
+       fprintf(stdout, "checking %s for release upgrade%s\n", serverurl,
+               upgrade_packages?" or updated packages":"");
+
+
+       snprintf(url, sizeof(url), "%s/%s", serverurl, APIOBJ_CHECK);
+       uptodate=0;
+
+       do {
+               retry=0;
+               DPRINTF("requesting:\n%s\n", blobmsg_format_json_indent(checkbuf.head, true, 0));
+               if (server_request(url, &checkbuf, &infobuf)) {
+                       fprintf(stderr, "failed to connect to server\n");
+                       rc=-1;
+                       goto freeboard;
+               };
+
+               if (retry)
+                       sleep(3);
+       } while(retry);
+
+       DPRINTF("reply:\n%s\n", blobmsg_format_json_indent(infobuf.head, true, 0));
+
+       blobmsg_parse(check_policy, __CHECK_MAX, tbc, blob_data(infobuf.head), blob_len(infobuf.head));
+
+       if (!tbc[CHECK_VERSION] && !tbc[CHECK_UPGRADES]) {
+               if (uptodate) {
+                       rc=0;
+               } else if (!rc) {
+                       fprintf(stderr, "server reply invalid.\n");
+                       rc=-2;
+               }
+               goto freeboard;
+       }
+
+       if (tbc[CHECK_VERSION]) {
+               newversion = blobmsg_get_string(tbc[CHECK_VERSION]);
+               fprintf(stdout, "new %s release %s found.\n", distribution, newversion);
+       } else {
+               newversion = version;
+               fprintf(stdout, "staying on %s release version %s\n", distribution, version);
+       };
+
+       blobmsg_add_string(&reqbuf, "version", newversion);
+
+       if (tbc[CHECK_UPGRADES]) {
+               fprintf(stdout, "package updates:\n");
+               print_package_updates(tbc[CHECK_UPGRADES]);
+       }
+
+       if (check_only) {
+               rc=1;
+               goto freeboard;
+       };
+
+       rc = ask_user();
+       if (rc)
+               goto freeboard;
+
+       blobmsg_add_string(&reqbuf, "distro", distribution);
+       blobmsg_add_string(&reqbuf, "target", target);
+       blobmsg_add_string(&reqbuf, "subtarget", subtarget);
+       blobmsg_add_string(&reqbuf, "board", board_name);
+
+       blob_buf_init(&allpkg, 0);
+       blobmsg_add_u8(&allpkg, "all", 0);
+       blobmsg_add_string(&allpkg, "dummy", "foo");
+       if (ubus_invoke(ctx, id, "packagelist", allpkg.head, pkglist_req_cb, &reqbuf, 3000)) {
+               fprintf(stderr, "cannot request packagelist from rpcd\n");
+               rc=-1;
+               goto freeboard;
+       }
+
+       snprintf(url, sizeof(url), "%s/%s", serverurl, APIOBJ_REQUEST);
+
+       imagebuilder = 0;
+       building = 0;
+       use_get = 0;
+
+       do {
+               retry = 0;
+
+               DPRINTF("requesting:\n%s\n", use_get?"":blobmsg_format_json_indent(reqbuf.head, true, 0));
+
+               server_request(url, use_get?NULL:&reqbuf, &imgbuf);
+               blobmsg_parse(image_policy, __IMAGE_MAX, tb, blob_data(imgbuf.head), blob_len(imgbuf.head));
+
+               if (!use_get && tb[IMAGE_REQHASH]) {
+                       snprintf(url, sizeof(url), "%s/%s/%s", serverurl,
+                                APIOBJ_REQUEST,
+                                blobmsg_get_string(tb[IMAGE_REQHASH]));
+                       DPRINTF("polling via GET %s\n", url);
+                       retry=1;
+                       use_get=1;
+               }
+
+               if (retry) {
+                       blob_buf_free(&imgbuf);
+                       blobmsg_buf_init(&imgbuf);
+                       sleep(3);
+               }
+       } while(retry);
+
+       DPRINTF("reply:\n%s\n", blobmsg_format_json_indent(imgbuf.head, true, 0));
+
+       if (!tb[IMAGE_SYSUPGRADE]) {
+               if (!rc) {
+                       fprintf(stderr, "no sysupgrade image returned\n");
+                       rc=-1;
+               }
+               goto freeboard;
+       }
+
+       strncpy(url, blobmsg_get_string(tb[IMAGE_SYSUPGRADE]), sizeof(url));
+
+       server_request(url, NULL, NULL);
+
+       filename = uclient_get_url_filename(url, "firmware.bin");
+
+       if (stat(filename, &imgstat)) {
+               fprintf(stderr, "image download failed\n");
+               rc=-1;
+               goto freeboard;
+       }
+
+       if ((intmax_t)imgstat.st_size != out_len) {
+               fprintf(stderr, "file size mismatch\n");
+               unlink(filename);
+               rc=-1;
+               goto freeboard;
+       }
+
+       tmp=strrchr(url, '/');
+
+       strcpy(tmp, "/sha256sums");
+       server_request(url, NULL, NULL);
+
+       if (stat("sha256sums", &imgstat)) {
+               fprintf(stderr, "sha256sums download failed\n");
+               rc=-1;
+               goto freeboard;
+       }
+
+       if ((intmax_t)imgstat.st_size != out_len) {
+               fprintf(stderr, "sha256sums download incomplete\n");
+               unlink("sha256sums");
+               rc=-1;
+               goto freeboard;
+       }
+
+       if (out_len < 68) {
+               fprintf(stderr, "sha256sums size mismatch\n");
+               unlink("sha256sums");
+               rc=-1;
+               goto freeboard;
+       }
+
+       if (sha256sum_v("sha256sums", filename)) {
+               fprintf(stderr, "checksum verification failed\n");
+               unlink(filename);
+               unlink("sha256sums");
+               rc=-1;
+               goto freeboard;
+       }
+
+       strcpy(tmp, "/sha256sums.sig");
+       server_request(url, NULL, NULL);
+
+       if (stat("sha256sums.sig", &imgstat)) {
+               fprintf(stderr, "sha256sums.sig download failed\n");
+               rc=-1;
+               goto freeboard;
+       }
+
+       if ((intmax_t)imgstat.st_size != out_len) {
+               fprintf(stderr, "sha256sums.sig download incomplete\n");
+               unlink("sha256sums.sig");
+               rc=-1;
+               goto freeboard;
+       }
+
+       if (out_len < 16) {
+               fprintf(stderr, "sha256sums.sig size mismatch\n");
+               unlink("sha256sums.sig");
+               rc=-1;
+               goto freeboard;
+       }
+
+       if (usign_v("sha256sums")) {
+               fprintf(stderr, "signature verification failed\n");
+               if (!ignore_sig) {
+                       unlink(filename);
+                       unlink("sha256sums");
+                       unlink("sha256sums.sig");
+                       rc=-1;
+                       goto freeboard;
+               }
+       };
+
+       if (strcmp(filename, "firmware.bin")) {
+               if (rename(filename, "firmware.bin")) {
+                       fprintf(stderr, "can't rename to firmware.bin\n");
+                       unlink(filename);
+                       rc=-1;
+                       goto freeboard;
+               }
+       }
+
+       valid = 0;
+       ubus_invoke(ctx, id, "upgrade_test", NULL, upgtest_cb, &valid, 3000);
+       if (!valid) {
+               rc=-1;
+               goto freeboard;
+       }
+
+       blobmsg_add_u8(&upgbuf, "keep", 1);
+       fprintf(stdout, "invoking sysupgrade\n");
+       ubus_invoke(ctx, id, "upgrade_start", upgbuf.head, NULL, NULL, 3000);
+
+freeboard:
+       free(board_name);
+       free(target);
+       /* subtarget is a pointer within target, don't free */
+       free(distribution);
+       free(version);
+
+freebufs:
+       blob_buf_free(&checkbuf);
+       blob_buf_free(&infobuf);
+       blob_buf_free(&reqbuf);
+       blob_buf_free(&imgbuf);
+       blob_buf_free(&upgbuf);
+
+freessl:
+       if (ssl_ctx)
+               ssl_ops->context_free(ssl_ctx);
+
+freeconfig:
+       free(serverurl);
+
+freeubus:
+       ubus_free(ctx);
+
+       return rc;
+}
index ca27a853e066bd562fe23e99f90611073c53a944..c87027f1500ef45ce363694712936ce29a071a3a 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=avrdude
 PKG_VERSION:=6.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME)
-PKG_MD5SUM:=58bb42049122cf80fe4f4d0ce36d92ee
+PKG_HASH:=0f9f731b6394ca7795b88359689a7fa1fba818c6e1d962513eb28da670e0a196
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=GPL-2.0
diff --git a/utils/avrdude/patches/020-no-cpp-timestamps.patch b/utils/avrdude/patches/020-no-cpp-timestamps.patch
new file mode 100644 (file)
index 0000000..8427055
--- /dev/null
@@ -0,0 +1,21 @@
+Description: no CPP macro timestamps
+ Reporducible builds project support, see: 
+ http://wiki.debian.org/ReproducibleBuilds/TimestampsFromCPPMacros
+Author: Milan Kupcevic <milan@debian.org>
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/main.c
++++ b/main.c
+@@ -679,10 +679,10 @@
+    * Print out an identifying string so folks can tell what version
+    * they are running
+    */
+-  avrdude_message(MSG_NOTICE, "\n%s: Version %s, compiled on %s at %s\n"
++  avrdude_message(MSG_NOTICE, "\n%s: Version %s\n"
+                     "%sCopyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/\n"
+                     "%sCopyright (c) 2007-2014 Joerg Wunsch\n\n",
+-                    progname, version, __DATE__, __TIME__, progbuf, progbuf);
++                    progname, version, progbuf, progbuf);
+   avrdude_message(MSG_NOTICE, "%sSystem wide configuration file is \"%s\"\n",
+             progbuf, sys_config);
index 955e735017e75d525e1435a5ce322682958508b0..74e37f89a3ebeb6040bdabf014b2ace85a3e2b51 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/NethServer/bandwidthd/archive/$(PKG_VERSION)
-PKG_MD5SUM:=a4075335d06fe91ae815616ed9e27375
+PKG_HASH:=41803a202956ae99b095f98ce92e5637dad62d25509ccd5cff9a8913626a4226
 
 PKG_MAINTAINER:=Jean-Michel Lacroix <lacroix@lepine-lacroix.info>
 
index 130698d83268278140cdfc0ae4c9edaa2ec0c22f..9978d4925ea4c0951c991db6b0dfa3c71b692efa 100644 (file)
@@ -7,15 +7,15 @@
 
 include $(TOPDIR)/rules.mk
 
-BASE_VERSION:=4.3
+BASE_VERSION:=4.4
 
 PKG_NAME:=bash
-PKG_VERSION:=$(BASE_VERSION).42
+PKG_VERSION:=$(BASE_VERSION).12
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(BASE_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/bash
-PKG_MD5SUM:=81348932d5da294953e15d4814c74dd1
+PKG_HASH:=d86b3392c1202e8ff5a423b302e6284db7f8f435ea9f39b5b1b20fd3ac36dfcb
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BASE_VERSION)
 
 PKG_LICENSE:=GPL-3.0+
index 7efa97b363125e1ed47cbdd932d1936f2fc17c52..c3ab62364c4ed1425dc223b95e2a01330a65372d 100644 (file)
@@ -1,6 +1,8 @@
---- a/execute_cmd.c
-+++ b/execute_cmd.c
-@@ -2369,7 +2369,11 @@ execute_pipeline (command, asynchronous,
+Index: bash-4.4/execute_cmd.c
+===================================================================
+--- bash-4.4.orig/execute_cmd.c
++++ bash-4.4/execute_cmd.c
+@@ -2459,7 +2459,11 @@ execute_pipeline (command, asynchronous,
    /* If the `lastpipe' option is set with shopt, and job control is not
       enabled, execute the last element of non-async pipelines in the
       current shell environment. */
index 050e4763e1e3d13d26648682c8aaed87a4575513..fd0b6958f8ab1d9c662eb2180c29cce2ca9537a4 100644 (file)
@@ -1,6 +1,8 @@
---- a/configure
-+++ b/configure
-@@ -5430,8 +5430,7 @@ if test $opt_readline = yes; then
+Index: bash-4.4/configure
+===================================================================
+--- bash-4.4.orig/configure
++++ bash-4.4/configure
+@@ -5420,8 +5420,7 @@ if test $opt_readline = yes; then
                # static version specified as -llibname to override the
                # dynamic version
                case "${host_os}" in
                esac
        fi
  else
---- a/configure.ac
-+++ b/configure.ac
-@@ -578,8 +578,7 @@ if test $opt_readline = yes; then
+Index: bash-4.4/configure.ac
+===================================================================
+--- bash-4.4.orig/configure.ac
++++ bash-4.4/configure.ac
+@@ -573,8 +573,7 @@ if test $opt_readline = yes; then
                # static version specified as -llibname to override the
                # dynamic version
                case "${host_os}" in
diff --git a/utils/bash/patches/101-upstream-bash43-001.patch b/utils/bash/patches/101-upstream-bash43-001.patch
deleted file mode 100644 (file)
index 3231273..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-001
-
-Bug-Reported-by:       NBaH <nbah@sfr.fr>
-Bug-Reference-ID:      <ler0b5$iu9$1@speranza.aioe.org>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00092.html
-
-Bug-Description:
-
-A missing check for a valid option prevented `test -R' from working.  There
-is another problem that causes bash to look up the wrong variable name when
-processing the argument to `test -R'.
-
-Patch (apply with `patch -p0'):
-
---- a/test.c
-+++ b/test.c
-@@ -646,8 +646,8 @@ unary_test (op, arg)
-       return (v && invisible_p (v) == 0 && var_isset (v) ? TRUE : FALSE);
-     case 'R':
--      v = find_variable (arg);
--      return (v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v) ? TRUE : FALSE);
-+      v = find_variable_noref (arg);
-+      return ((v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v)) ? TRUE : FALSE);
-     }
-   /* We can't actually get here, but this shuts up gcc. */
-@@ -723,6 +723,7 @@ test_unop (op)
-     case 'o': case 'p': case 'r': case 's': case 't':
-     case 'u': case 'v': case 'w': case 'x': case 'z':
-     case 'G': case 'L': case 'O': case 'S': case 'N':
-+    case 'R':
-       return (1);
-     }
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 0
-+#define PATCHLEVEL 1
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/101-upstream-bash44-001.patch b/utils/bash/patches/101-upstream-bash44-001.patch
new file mode 100644 (file)
index 0000000..8481ed2
--- /dev/null
@@ -0,0 +1,36 @@
+Index: bash-4.4/lib/readline/history.c
+===================================================================
+--- bash-4.4.orig/lib/readline/history.c
++++ bash-4.4/lib/readline/history.c
+@@ -57,6 +57,8 @@ extern int errno;
+ /* How big to make the_history when we first allocate it. */
+ #define DEFAULT_HISTORY_INITIAL_SIZE  502
++#define MAX_HISTORY_INITIAL_SIZE      8192
++
+ /* The number of slots to increase the_history by. */
+ #define DEFAULT_HISTORY_GROW_SIZE 50
+@@ -307,7 +309,9 @@ add_history (string)
+       if (history_size == 0)
+       {
+         if (history_stifled && history_max_entries > 0)
+-          history_size = history_max_entries + 2;
++          history_size = (history_max_entries > MAX_HISTORY_INITIAL_SIZE)
++                              ? MAX_HISTORY_INITIAL_SIZE
++                              : history_max_entries + 2;
+         else
+           history_size = DEFAULT_HISTORY_INITIAL_SIZE;
+         the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *));
+Index: bash-4.4/patchlevel.h
+===================================================================
+--- bash-4.4.orig/patchlevel.h
++++ bash-4.4/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 0
++#define PATCHLEVEL 1
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/102-upstream-bash43-002.patch b/utils/bash/patches/102-upstream-bash43-002.patch
deleted file mode 100644 (file)
index 35421e8..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-002
-
-Bug-Reported-by:       Moe Tunes <moetunes42@gmail.com>
-Bug-Reference-ID:      <53103F49.3070100@gmail.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00086.html
-
-Bug-Description:
-
-A change to save state while running the DEBUG trap caused pipelines to hang
-on systems which need process group synchronization while building pipelines.
-
-Patch (apply with `patch -p0'):
-
---- a/trap.c
-+++ b/trap.c
-@@ -920,7 +920,8 @@ _run_trap_internal (sig, tag)
-       subst_assign_varlist = 0;
- #if defined (JOB_CONTROL)
--      save_pipeline (1);      /* XXX only provides one save level */
-+      if (sig != DEBUG_TRAP)  /* run_debug_trap does this */
-+      save_pipeline (1);      /* XXX only provides one save level */
- #endif
-       /* If we're in a function, make sure return longjmps come here, too. */
-@@ -940,7 +941,8 @@ _run_trap_internal (sig, tag)
-       trap_exit_value = last_command_exit_value;
- #if defined (JOB_CONTROL)
--      restore_pipeline (1);
-+      if (sig != DEBUG_TRAP)  /* run_debug_trap does this */
-+      restore_pipeline (1);
- #endif
-       subst_assign_varlist = save_subst_varlist;
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 1
-+#define PATCHLEVEL 2
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/102-upstream-bash44-002.patch b/utils/bash/patches/102-upstream-bash44-002.patch
new file mode 100644 (file)
index 0000000..c3da17a
--- /dev/null
@@ -0,0 +1,46 @@
+Index: bash-4.4/patchlevel.h
+===================================================================
+--- bash-4.4.orig/patchlevel.h
++++ bash-4.4/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 1
++#define PATCHLEVEL 2
+ #endif /* _PATCHLEVEL_H_ */
+Index: bash-4.4/subst.c
+===================================================================
+--- bash-4.4.orig/subst.c
++++ bash-4.4/subst.c
+@@ -5931,6 +5931,7 @@ read_comsub (fd, quoted, rflag)
+   char *istring, buf[128], *bufp, *s;
+   int istring_index, istring_size, c, tflag, skip_ctlesc, skip_ctlnul;
+   ssize_t bufn;
++  int nullbyte;
+   istring = (char *)NULL;
+   istring_index = istring_size = bufn = tflag = 0;
+@@ -5938,6 +5939,8 @@ read_comsub (fd, quoted, rflag)
+   for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++)
+     skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL;
++  nullbyte = 0;
++
+   /* Read the output of the command through the pipe.  This may need to be
+      changed to understand multibyte characters in the future. */
+   while (1)
+@@ -5956,7 +5959,11 @@ read_comsub (fd, quoted, rflag)
+       if (c == 0)
+       {
+ #if 1
+-        internal_warning ("%s", _("command substitution: ignored null byte in input"));
++        if (nullbyte == 0)
++          {
++            internal_warning ("%s", _("command substitution: ignored null byte in input"));
++            nullbyte = 1;
++          }
+ #endif
+         continue;
+       }
diff --git a/utils/bash/patches/103-upstream-bash43-003.patch b/utils/bash/patches/103-upstream-bash43-003.patch
deleted file mode 100644 (file)
index 7c9e56b..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-003
-
-Bug-Reported-by:       Anatol Pomozov <anatol.pomozov@gmail.com>
-Bug-Reference-ID:      <CAOMFOmXy3mT2So5GQ5F-smCVArQuAeBwZ2QKzgCtMeXJoDeYOQ@mail.gmail.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00010.html
-
-Bug-Description:
-
-When in callback mode, some readline commands can cause readline to seg
-fault by passing invalid contexts to callback functions.
-
-Patch (apply with `patch -p0'):
-
---- a/lib/readline/readline.c
-+++ b/lib/readline/readline.c
-@@ -744,7 +744,8 @@ _rl_dispatch_callback (cxt)
-     r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ));
-   RL_CHECK_SIGNALS ();
--  if (r == 0)                 /* success! */
-+  /* We only treat values < 0 specially to simulate recursion. */
-+  if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0)) /* success! or failure! */
-     {
-       _rl_keyseq_chain_dispose ();
-       RL_UNSETSTATE (RL_STATE_MULTIKEY);
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 2
-+#define PATCHLEVEL 3
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/103-upstream-bash44-003.patch b/utils/bash/patches/103-upstream-bash44-003.patch
new file mode 100644 (file)
index 0000000..6d4dea3
--- /dev/null
@@ -0,0 +1,39 @@
+Index: bash-4.4/lib/glob/sm_loop.c
+===================================================================
+--- bash-4.4.orig/lib/glob/sm_loop.c
++++ bash-4.4/lib/glob/sm_loop.c
+@@ -330,6 +330,12 @@ PARSE_COLLSYM (p, vp)
+   for (pc = 0; p[pc]; pc++)
+     if (p[pc] == L('.') && p[pc+1] == L(']'))
+       break;
++   if (p[pc] == 0)
++    {
++      if (vp)
++      *vp = INVALID;
++      return (p + pc);
++    }
+    val = COLLSYM (p, pc);
+    if (vp)
+      *vp = val;
+@@ -483,6 +489,9 @@ BRACKMATCH (p, test, flags)
+       c = *p++;
+       c = FOLD (c);
++      if (c == L('\0'))
++      return ((test == L('[')) ? savep : (CHAR *)0);
++
+       if ((flags & FNM_PATHNAME) && c == L('/'))
+       /* [/] can never match when matching a pathname.  */
+       return (CHAR *)0;
+Index: bash-4.4/patchlevel.h
+===================================================================
+--- bash-4.4.orig/patchlevel.h
++++ bash-4.4/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 2
++#define PATCHLEVEL 3
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/104-upstream-bash43-004.patch b/utils/bash/patches/104-upstream-bash43-004.patch
deleted file mode 100644 (file)
index 40ac35f..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-004
-
-Bug-Reported-by:       Daan van Rossum <daan@flash.uchicago.edu>
-Bug-Reference-ID:      <20140307072523.GA14250@flash.uchicago.edu>
-Bug-Reference-URL:     
-
-Bug-Description:
-
-The `.' command in vi mode cannot undo multi-key commands beginning with
-`c', `d', and `y' (command plus motion specifier).
-
-Patch (apply with `patch -p0'):
-
---- a/lib/readline/readline.c
-+++ b/lib/readline/readline.c
-@@ -965,7 +965,7 @@ _rl_dispatch_subseq (key, map, got_subse
- #if defined (VI_MODE)
-   if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
-       key != ANYOTHERKEY &&
--      rl_key_sequence_length == 1 &&  /* XXX */
-+      _rl_dispatching_keymap == vi_movement_keymap &&
-       _rl_vi_textmod_command (key))
-     _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
- #endif
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 3
-+#define PATCHLEVEL 4
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/104-upstream-bash44-004.patch b/utils/bash/patches/104-upstream-bash44-004.patch
new file mode 100644 (file)
index 0000000..f1ebff6
--- /dev/null
@@ -0,0 +1,66 @@
+Index: bash-4.4/jobs.c
+===================================================================
+--- bash-4.4.orig/jobs.c
++++ bash-4.4/jobs.c
+@@ -453,6 +453,21 @@ cleanup_the_pipeline ()
+     discard_pipeline (disposer);
+ }
++void
++discard_last_procsub_child ()
++{
++  PROCESS *disposer;
++  sigset_t set, oset;
++
++  BLOCK_CHILD (set, oset);
++  disposer = last_procsub_child;
++  last_procsub_child = (PROCESS *)NULL;
++  UNBLOCK_CHILD (oset);
++
++  if (disposer)
++    discard_pipeline (disposer);
++}
++
+ struct pipeline_saver *
+ alloc_pipeline_saver ()
+ {
+Index: bash-4.4/jobs.h
+===================================================================
+--- bash-4.4.orig/jobs.h
++++ bash-4.4/jobs.h
+@@ -190,6 +190,7 @@ extern JOB **jobs;
+ extern void making_children __P((void));
+ extern void stop_making_children __P((void));
+ extern void cleanup_the_pipeline __P((void));
++extern void discard_last_procsub_child __P((void));
+ extern void save_pipeline __P((int));
+ extern PROCESS *restore_pipeline __P((int));
+ extern void start_pipeline __P((void));
+Index: bash-4.4/patchlevel.h
+===================================================================
+--- bash-4.4.orig/patchlevel.h
++++ bash-4.4/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 3
++#define PATCHLEVEL 4
+ #endif /* _PATCHLEVEL_H_ */
+Index: bash-4.4/subst.c
+===================================================================
+--- bash-4.4.orig/subst.c
++++ bash-4.4/subst.c
+@@ -5808,10 +5808,7 @@ process_substitute (string, open_for_rea
+     {
+ #if defined (JOB_CONTROL)
+       if (last_procsub_child)
+-      {
+-        discard_pipeline (last_procsub_child);
+-        last_procsub_child = (PROCESS *)NULL;
+-      }
++      discard_last_procsub_child ();
+       last_procsub_child = restore_pipeline (0);
+ #endif
diff --git a/utils/bash/patches/105-upstream-bash43-005.patch b/utils/bash/patches/105-upstream-bash43-005.patch
deleted file mode 100644 (file)
index 1cc5473..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-005
-
-Bug-Reported-by:       David Sines <dave.gma@googlemail.com>
-Bug-Reference-ID:      <CAO3BAa_CK_Rgkhdfzs+NJ4KFYdB9qW3pvXQK0xLCi6GMmDU8bw@mail.gmail.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00037.html
-
-Bug-Description:
-
-When in Posix mode, bash did not correctly interpret the ANSI-C-style
-$'...' quoting mechanism when performing pattern substitution word
-expansions within double quotes.
-
-Patch (apply with `patch -p0'):
-
---- a/parse.y
-+++ b/parse.y
-@@ -3398,7 +3398,7 @@ parse_matched_pair (qc, open, close, len
-          within a double-quoted ${...} construct "an even number of
-          unescaped double-quotes or single-quotes, if any, shall occur." */
-       /* This was changed in Austin Group Interp 221 */
--      if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
-+      if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
-       continue;
-       /* Could also check open == '`' if we want to parse grouping constructs
---- a/y.tab.c
-+++ b/y.tab.c
-@@ -5710,7 +5710,7 @@ parse_matched_pair (qc, open, close, len
-          within a double-quoted ${...} construct "an even number of
-          unescaped double-quotes or single-quotes, if any, shall occur." */
-       /* This was changed in Austin Group Interp 221 */
--      if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
-+      if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
-       continue;
-       /* Could also check open == '`' if we want to parse grouping constructs
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 4
-+#define PATCHLEVEL 5
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/105-upstream-bash44-005.patch b/utils/bash/patches/105-upstream-bash44-005.patch
new file mode 100644 (file)
index 0000000..f9fb018
--- /dev/null
@@ -0,0 +1,29 @@
+Index: bash-4.4/builtins/evalstring.c
+===================================================================
+--- bash-4.4.orig/builtins/evalstring.c
++++ bash-4.4/builtins/evalstring.c
+@@ -104,12 +104,9 @@ should_suppress_fork (command)
+         running_trap == 0 &&
+         *bash_input.location.string == '\0' &&
+         command->type == cm_simple &&
+-#if 0
+         signal_is_trapped (EXIT_TRAP) == 0 &&
+         signal_is_trapped (ERROR_TRAP) == 0 &&
+-#else
+         any_signals_trapped () < 0 &&
+-#endif
+         command->redirects == 0 && command->value.Simple->redirects == 0 &&
+         ((command->flags & CMD_TIME_PIPELINE) == 0) &&
+         ((command->flags & CMD_INVERT_RETURN) == 0));
+Index: bash-4.4/patchlevel.h
+===================================================================
+--- bash-4.4.orig/patchlevel.h
++++ bash-4.4/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 4
++#define PATCHLEVEL 5
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/106-upstream-bash43-006.patch b/utils/bash/patches/106-upstream-bash43-006.patch
deleted file mode 100644 (file)
index c5f52b1..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-006
-
-Bug-Reported-by:       Eduardo A . Bustamante Lopez <dualbus@gmail.com>
-Bug-Reference-ID:      <20140228170013.GA16015@dualbus.me>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00091.html
-
-Bug-Description:
-
-A shell that started with job control active but was not interactive left
-the terminal in the wrong process group when exiting, causing its parent
-shell to get a stop signal when it attempted to read from the terminal.
-
-Patch (apply with `patch -p0'):
-
---- a/jobs.c
-+++ b/jobs.c
-@@ -4374,7 +4374,7 @@ without_job_control ()
- void
- end_job_control ()
- {
--  if (interactive_shell)              /* XXX - should it be interactive? */
-+  if (interactive_shell || job_control)               /* XXX - should it be just job_control? */
-     {
-       terminate_stopped_jobs ();
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 5
-+#define PATCHLEVEL 6
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/106-upstream-bash44-006.patch b/utils/bash/patches/106-upstream-bash44-006.patch
new file mode 100644 (file)
index 0000000..a232bff
--- /dev/null
@@ -0,0 +1,37 @@
+Index: bash-4.4/builtins/pushd.def
+===================================================================
+--- bash-4.4.orig/builtins/pushd.def
++++ bash-4.4/builtins/pushd.def
+@@ -365,7 +365,7 @@ popd_builtin (list)
+       break;
+     }
+-  if (which > directory_list_offset || (directory_list_offset == 0 && which == 0))
++  if (which > directory_list_offset || (which < -directory_list_offset) || (directory_list_offset == 0 && which == 0))
+     {
+       pushd_error (directory_list_offset, which_word ? which_word : "");
+       return (EXECUTION_FAILURE);
+@@ -387,6 +387,11 @@ popd_builtin (list)
+        remove that directory from the list and shift the remainder
+        of the list into place. */
+       i = (direction == '+') ? directory_list_offset - which : which;
++      if (i < 0 || i > directory_list_offset)
++      {
++        pushd_error (directory_list_offset, which_word ? which_word : "");
++        return (EXECUTION_FAILURE);
++      }
+       free (pushd_directory_list[i]);
+       directory_list_offset--;
+Index: bash-4.4/patchlevel.h
+===================================================================
+--- bash-4.4.orig/patchlevel.h
++++ bash-4.4/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 5
++#define PATCHLEVEL 6
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/107-upstream-bash43-007.patch b/utils/bash/patches/107-upstream-bash43-007.patch
deleted file mode 100644 (file)
index 8578bd4..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-007
-
-Bug-Reported-by:       geir.hauge@gmail.com
-Bug-Reference-ID:      <20140318093650.B181C1C5B0B@gina.itea.ntnu.no>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00095.html
-
-Bug-Description:
-
-Using compound assignments for associative arrays like
-
-assoc=( [x]= [y]=bar )
-
-left the value corresponding to the key `x' NULL.  This caused subsequent
-lookups to interpret it as unset.
-
-Patch (apply with `patch -p0'):
-
---- a/arrayfunc.c
-+++ b/arrayfunc.c
-@@ -597,6 +597,11 @@ assign_compound_array_list (var, nlist,
-       if (assoc_p (var))
-       {
-         val = expand_assignment_string_to_string (val, 0);
-+        if (val == 0)
-+          {
-+            val = (char *)xmalloc (1);
-+            val[0] = '\0';    /* like do_assignment_internal */
-+          }
-         free_val = 1;
-       }
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 6
-+#define PATCHLEVEL 7
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/107-upstream-bash44-007.patch b/utils/bash/patches/107-upstream-bash44-007.patch
new file mode 100644 (file)
index 0000000..3e2973d
--- /dev/null
@@ -0,0 +1,100 @@
+Index: bash-4.4/bashline.c
+===================================================================
+--- bash-4.4.orig/bashline.c
++++ bash-4.4/bashline.c
+@@ -142,7 +142,7 @@ static int executable_completion __P((co
+ static rl_icppfunc_t *save_directory_hook __P((void));
+ static void restore_directory_hook __P((rl_icppfunc_t));
+-static int directory_exists __P((const char *));
++static int directory_exists __P((const char *, int));
+ static void cleanup_expansion_error __P((void));
+ static void maybe_make_readline_line __P((char *));
+@@ -3102,18 +3102,20 @@ restore_directory_hook (hookf)
+     rl_directory_rewrite_hook = hookf;
+ }
+-/* Check whether not the (dequoted) version of DIRNAME, with any trailing slash
+-   removed, exists. */
++/* Check whether not DIRNAME, with any trailing slash removed, exists.  If
++   SHOULD_DEQUOTE is non-zero, we dequote the directory name first. */
+ static int
+-directory_exists (dirname)
++directory_exists (dirname, should_dequote)
+      const char *dirname;
++     int should_dequote;
+ {
+   char *new_dirname;
+   int dirlen, r;
+   struct stat sb;
+-  /* First, dequote the directory name */
+-  new_dirname = bash_dequote_filename ((char *)dirname, rl_completion_quote_character);
++  /* We save the string and chop the trailing slash because stat/lstat behave
++     inconsistently if one is present. */
++  new_dirname = should_dequote ? bash_dequote_filename ((char *)dirname, rl_completion_quote_character) : savestring (dirname);
+   dirlen = STRLEN (new_dirname);
+   if (new_dirname[dirlen - 1] == '/')
+     new_dirname[dirlen - 1] = '\0';
+@@ -3145,7 +3147,7 @@ bash_filename_stat_hook (dirname)
+   else if (t = mbschr (local_dirname, '`'))   /* XXX */
+     should_expand_dirname = '`';
+-  if (should_expand_dirname && directory_exists (local_dirname))
++  if (should_expand_dirname && directory_exists (local_dirname, 0))
+     should_expand_dirname = 0;
+   
+   if (should_expand_dirname)  
+@@ -3155,7 +3157,7 @@ bash_filename_stat_hook (dirname)
+        have to worry about restoring this setting. */
+       global_nounset = unbound_vars_is_error;
+       unbound_vars_is_error = 0;
+-      wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_COMPLETE);      /* does the right thing */
++      wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_NOPROCSUB|W_COMPLETE);  /* does the right thing */
+       unbound_vars_is_error = global_nounset;
+       if (wl)
+       {
+@@ -3244,13 +3246,13 @@ bash_directory_completion_hook (dirname)
+       should_expand_dirname = '`';
+     }
+-  if (should_expand_dirname && directory_exists (local_dirname))
++  if (should_expand_dirname && directory_exists (local_dirname, 1))
+     should_expand_dirname = 0;
+   if (should_expand_dirname)  
+     {
+       new_dirname = savestring (local_dirname);
+-      wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_COMPLETE);      /* does the right thing */
++      wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_NOPROCSUB|W_COMPLETE);  /* does the right thing */
+       if (wl)
+       {
+         *dirname = string_list (wl);
+Index: bash-4.4/patchlevel.h
+===================================================================
+--- bash-4.4.orig/patchlevel.h
++++ bash-4.4/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 6
++#define PATCHLEVEL 7
+ #endif /* _PATCHLEVEL_H_ */
+Index: bash-4.4/subst.c
+===================================================================
+--- bash-4.4.orig/subst.c
++++ bash-4.4/subst.c
+@@ -9458,6 +9458,10 @@ add_twochars:
+               tword->flags |= word->flags & (W_ASSIGNARG|W_ASSIGNRHS);        /* affects $@ */
+             if (word->flags & W_COMPLETE)
+               tword->flags |= W_COMPLETE;     /* for command substitutions */
++            if (word->flags & W_NOCOMSUB)
++              tword->flags |= W_NOCOMSUB;
++            if (word->flags & W_NOPROCSUB)
++              tword->flags |= W_NOPROCSUB;
+             temp = (char *)NULL;
diff --git a/utils/bash/patches/108-upstream-bash43-008.patch b/utils/bash/patches/108-upstream-bash43-008.patch
deleted file mode 100644 (file)
index 2402021..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-008
-
-Bug-Reported-by:       Stephane Chazelas <stephane.chazelas@gmail.com>
-Bug-Reference-ID:      <20140318135901.GB22158@chaz.gmail.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00098.html
-
-Bug-Description:
-
-Some extended glob patterns incorrectly matched filenames with a leading
-dot, regardless of the setting of the `dotglob' option.
-
-Patch (apply with `patch -p0'):
-
---- a/lib/glob/gmisc.c
-+++ b/lib/glob/gmisc.c
-@@ -210,6 +210,7 @@ extglob_pattern_p (pat)
-     case '+':
-     case '!':
-     case '@':
-+    case '?':
-       return (pat[1] == LPAREN);
-     default:
-       return 0;
---- a/lib/glob/glob.c
-+++ b/lib/glob/glob.c
-@@ -179,42 +179,50 @@ extglob_skipname (pat, dname, flags)
-      char *pat, *dname;
-      int flags;
- {
--  char *pp, *pe, *t;
--  int n, r;
-+  char *pp, *pe, *t, *se;
-+  int n, r, negate;
-+  negate = *pat == '!';
-   pp = pat + 2;
--  pe = pp + strlen (pp) - 1;  /*(*/
--  if (*pe != ')')
--    return 0;
--  if ((t = strchr (pp, '|')) == 0)    /* easy case first */
-+  se = pp + strlen (pp) - 1;          /* end of string */
-+  pe = glob_patscan (pp, se, 0);      /* end of extglob pattern (( */
-+  /* we should check for invalid extglob pattern here */
-+  /* if pe != se we have more of the pattern at the end of the extglob
-+     pattern. Check the easy case first ( */
-+  if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0)
-     {
-       *pe = '\0';
-+#if defined (HANDLE_MULTIBYTE)
-+      r = mbskipname (pp, dname, flags);
-+#else
-       r = skipname (pp, dname, flags);        /*(*/
-+#endif
-       *pe = ')';
-       return r;
-     }
-+
-+  /* check every subpattern */
-   while (t = glob_patscan (pp, pe, '|'))
-     {
-       n = t[-1];
-       t[-1] = '\0';
-+#if defined (HANDLE_MULTIBYTE)
-+      r = mbskipname (pp, dname, flags);
-+#else
-       r = skipname (pp, dname, flags);
-+#endif
-       t[-1] = n;
-       if (r == 0)     /* if any pattern says not skip, we don't skip */
-         return r;
-       pp = t;
-     } /*(*/
--  if (pp == pe)               /* glob_patscan might find end of pattern */
-+  /* glob_patscan might find end of pattern */
-+  if (pp == se)
-     return r;
--  *pe = '\0';
--#  if defined (HANDLE_MULTIBYTE)
--  r = mbskipname (pp, dname, flags);  /*(*/
--#  else
--  r = skipname (pp, dname, flags);    /*(*/
--#  endif
--  *pe = ')';
--  return r;
-+  /* but if it doesn't then we didn't match a leading dot */
-+  return 0;
- }
- #endif
-@@ -277,20 +285,23 @@ wextglob_skipname (pat, dname, flags)
-      int flags;
- {
- #if EXTENDED_GLOB
--  wchar_t *pp, *pe, *t, n;
--  int r;
-+  wchar_t *pp, *pe, *t, n, *se;
-+  int r, negate;
-+  negate = *pat == L'!';
-   pp = pat + 2;
--  pe = pp + wcslen (pp) - 1;  /*(*/
--  if (*pe != L')')
--    return 0;
--  if ((t = wcschr (pp, L'|')) == 0)
-+  se = pp + wcslen (pp) - 1;  /*(*/
-+  pe = glob_patscan_wc (pp, se, 0);
-+
-+  if (pe == se && *pe == ')' && (t = wcschr (pp, L'|')) == 0)
-     {
-       *pe = L'\0';
-       r = wchkname (pp, dname); /*(*/
-       *pe = L')';
-       return r;
-     }
-+
-+  /* check every subpattern */
-   while (t = glob_patscan_wc (pp, pe, '|'))
-     {
-       n = t[-1];
-@@ -305,10 +316,8 @@ wextglob_skipname (pat, dname, flags)
-   if (pp == pe)               /* glob_patscan_wc might find end of pattern */
-     return r;
--  *pe = L'\0';
--  r = wchkname (pp, dname);   /*(*/
--  *pe = L')';
--  return r;
-+  /* but if it doesn't then we didn't match a leading dot */
-+  return 0;
- #else
-   return (wchkname (pat, dname));
- #endif
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 7
-+#define PATCHLEVEL 8
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/108-upstream-bash44-008.patch b/utils/bash/patches/108-upstream-bash44-008.patch
new file mode 100644 (file)
index 0000000..9503b05
--- /dev/null
@@ -0,0 +1,58 @@
+Index: bash-4.4/expr.c
+===================================================================
+--- bash-4.4.orig/expr.c
++++ bash-4.4/expr.c
+@@ -578,24 +578,23 @@ expcond ()
+   rval = cval = explor ();
+   if (curtok == QUES)         /* found conditional expr */
+     {
+-      readtok ();
+-      if (curtok == 0 || curtok == COL)
+-      evalerror (_("expression expected"));
+       if (cval == 0)
+       {
+         set_noeval = 1;
+         noeval++;
+       }
++      readtok ();
++      if (curtok == 0 || curtok == COL)
++      evalerror (_("expression expected"));
++
+       val1 = EXP_HIGHEST ();
+       if (set_noeval)
+       noeval--;
+       if (curtok != COL)
+       evalerror (_("`:' expected for conditional expression"));
+-      readtok ();
+-      if (curtok == 0)
+-      evalerror (_("expression expected"));
++
+       set_noeval = 0;
+       if (cval)
+       {
+@@ -603,7 +602,11 @@ expcond ()
+         noeval++;
+       }
++      readtok ();
++      if (curtok == 0)
++      evalerror (_("expression expected"));
+       val2 = expcond ();
++
+       if (set_noeval)
+       noeval--;
+       rval = cval ? val1 : val2;
+Index: bash-4.4/patchlevel.h
+===================================================================
+--- bash-4.4.orig/patchlevel.h
++++ bash-4.4/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 7
++#define PATCHLEVEL 8
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/109-upstream-bash43-009.patch b/utils/bash/patches/109-upstream-bash43-009.patch
deleted file mode 100644 (file)
index f222bd6..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-009
-
-Bug-Reported-by:       Matthias Klose <doko@debian.org>
-Bug-Reference-ID:      <53346FC8.6090005@debian.org>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00171.html
-
-Bug-Description:
-
-There is a problem with unsigned sign extension when attempting to reallocate
-the input line when it is fewer than 3 characters long and there has been a
-history expansion.  The sign extension causes the shell to not reallocate the
-line, which results in a segmentation fault when it writes past the end.
-
-Patch (apply with `patch -p0'):
-
---- a/parse.y
-+++ b/parse.y
-@@ -2424,7 +2424,7 @@ shell_getc (remove_quoted_newline)
-        not already end in an EOF character.  */
-       if (shell_input_line_terminator != EOF)
-       {
--        if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3)
-+        if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size))
-           shell_input_line = (char *)xrealloc (shell_input_line,
-                                       1 + (shell_input_line_size += 2));
---- a/y.tab.c
-+++ b/y.tab.c
-@@ -4736,7 +4736,7 @@ shell_getc (remove_quoted_newline)
-        not already end in an EOF character.  */
-       if (shell_input_line_terminator != EOF)
-       {
--        if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3)
-+        if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size))
-           shell_input_line = (char *)xrealloc (shell_input_line,
-                                       1 + (shell_input_line_size += 2));
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 8
-+#define PATCHLEVEL 9
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/109-upstream-bash44-009.patch b/utils/bash/patches/109-upstream-bash44-009.patch
new file mode 100644 (file)
index 0000000..580d9a2
--- /dev/null
@@ -0,0 +1,67 @@
+Index: bash-4.4/lib/readline/history.c
+===================================================================
+--- bash-4.4.orig/lib/readline/history.c
++++ bash-4.4/lib/readline/history.c
+@@ -279,6 +279,7 @@ add_history (string)
+      const char *string;
+ {
+   HIST_ENTRY *temp;
++  int new_length;
+   if (history_stifled && (history_length == history_max_entries))
+     {
+@@ -295,13 +296,9 @@ add_history (string)
+       /* Copy the rest of the entries, moving down one slot.  Copy includes
+        trailing NULL.  */
+-#if 0
+-      for (i = 0; i < history_length; i++)
+-      the_history[i] = the_history[i + 1];
+-#else
+       memmove (the_history, the_history + 1, history_length * sizeof (HIST_ENTRY *));
+-#endif
++      new_length = history_length;
+       history_base++;
+     }
+   else
+@@ -315,7 +312,7 @@ add_history (string)
+         else
+           history_size = DEFAULT_HISTORY_INITIAL_SIZE;
+         the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *));
+-        history_length = 1;
++        new_length = 1;
+       }
+       else
+       {
+@@ -325,14 +322,15 @@ add_history (string)
+             the_history = (HIST_ENTRY **)
+               xrealloc (the_history, history_size * sizeof (HIST_ENTRY *));
+           }
+-        history_length++;
++        new_length = history_length + 1;
+       }
+     }
+   temp = alloc_history_entry ((char *)string, hist_inittime ());
+-  the_history[history_length] = (HIST_ENTRY *)NULL;
+-  the_history[history_length - 1] = temp;
++  the_history[new_length] = (HIST_ENTRY *)NULL;
++  the_history[new_length - 1] = temp;
++  history_length = new_length;
+ }
+ /* Change the time stamp of the most recent history entry to STRING. */
+Index: bash-4.4/patchlevel.h
+===================================================================
+--- bash-4.4.orig/patchlevel.h
++++ bash-4.4/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 8
++#define PATCHLEVEL 9
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/110-upstream-bash43-010.patch b/utils/bash/patches/110-upstream-bash43-010.patch
deleted file mode 100644 (file)
index 22d9f1b..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-010
-
-Bug-Reported-by:       Albert Shih <Albert.Shih@obspm.fr>
-Bug-Reference-ID:      Wed, 5 Mar 2014 23:01:40 +0100
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00028.html
-
-Bug-Description:
-
-Patch (apply with `patch -p0'):
-
-This patch changes the behavior of programmable completion to compensate
-for two assumptions made by the bash-completion package.  Bash-4.3 changed
-to dequote the argument to programmable completion only under certain
-circumstances, to make the behavior of compgen more consistent when run
-from the command line -- closer to the behavior when run by a shell function
-run as part of programmable completion.  Bash-completion can pass quoted
-arguments to compgen when the original word to be completed was not quoted,
-expecting programmable completion to dequote the word before attempting
-completion.
-
-This patch fixes two cases:
-
-1.  An empty string that bash-completion passes to compgen as a quoted null
-    string ('').
-
-2.  An unquoted word that bash-completion quotes using single quotes or
-    backslashes before passing it to compgen.
-
-In these cases, since readline did not detect a quote character in the original
-word to be completed, bash-4.3 
-
---- a/externs.h
-+++ b/externs.h
-@@ -324,6 +324,7 @@ extern char *sh_un_double_quote __P((cha
- extern char *sh_backslash_quote __P((char *, const char *, int));
- extern char *sh_backslash_quote_for_double_quotes __P((char *));
- extern int sh_contains_shell_metas __P((char *));
-+extern int sh_contains_quotes __P((char *));
- /* declarations for functions defined in lib/sh/spell.c */
- extern int spname __P((char *, char *));
---- a/lib/sh/shquote.c
-+++ b/lib/sh/shquote.c
-@@ -311,3 +311,17 @@ sh_contains_shell_metas (string)
-   return (0);
- }
-+
-+int
-+sh_contains_quotes (string)
-+     char *string;
-+{
-+  char *s;
-+
-+  for (s = string; s && *s; s++)
-+    {
-+      if (*s == '\'' || *s == '"' || *s == '\\')
-+      return 1;
-+    }
-+  return 0;
-+}
---- a/pcomplete.c
-+++ b/pcomplete.c
-@@ -183,6 +183,7 @@ ITEMLIST it_variables = { LIST_DYNAMIC,
- COMPSPEC *pcomp_curcs;
- const char *pcomp_curcmd;
-+const char *pcomp_curtxt;
- #ifdef DEBUG
- /* Debugging code */
-@@ -753,6 +754,32 @@ pcomp_filename_completion_function (text
-            quoted strings. */
-         dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
-       }
-+      /* Intended to solve a mismatched assumption by bash-completion.  If
-+       the text to be completed is empty, but bash-completion turns it into
-+       a quoted string ('') assuming that this code will dequote it before
-+       calling readline, do the dequoting. */
-+      else if (iscompgen && iscompleting &&
-+             pcomp_curtxt && *pcomp_curtxt == 0 &&
-+             text && (*text == '\'' || *text == '"') && text[1] == text[0] && text[2] == 0 && 
-+             rl_filename_dequoting_function)
-+      dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
-+      /* Another mismatched assumption by bash-completion.  If compgen is being
-+               run as part of bash-completion, and the argument to compgen is not
-+               the same as the word originally passed to the programmable completion
-+               code, dequote the argument if it has quote characters.  It's an
-+               attempt to detect when bash-completion is quoting its filename
-+               argument before calling compgen. */
-+      /* We could check whether gen_shell_function_matches is in the call
-+       stack by checking whether the gen-shell-function-matches tag is in
-+       the unwind-protect stack, but there's no function to do that yet.
-+       We could simply check whether we're executing in a function by
-+       checking variable_context, and may end up doing that. */
-+      else if (iscompgen && iscompleting && rl_filename_dequoting_function &&
-+             pcomp_curtxt && text &&
-+             STREQ (pcomp_curtxt, text) == 0 &&
-+             variable_context &&
-+             sh_contains_quotes (text))       /* guess */
-+      dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
-       else
-       dfn = savestring (text);
-     }
-@@ -1522,7 +1549,7 @@ gen_progcomp_completions (ocmd, cmd, wor
-      COMPSPEC **lastcs;
- {
-   COMPSPEC *cs, *oldcs;
--  const char *oldcmd;
-+  const char *oldcmd, *oldtxt;
-   STRINGLIST *ret;
-   cs = progcomp_search (ocmd);
-@@ -1545,14 +1572,17 @@ gen_progcomp_completions (ocmd, cmd, wor
-   oldcs = pcomp_curcs;
-   oldcmd = pcomp_curcmd;
-+  oldtxt = pcomp_curtxt;
-   pcomp_curcs = cs;
-   pcomp_curcmd = cmd;
-+  pcomp_curtxt = word;
-   ret = gen_compspec_completions (cs, cmd, word, start, end, foundp);
-   pcomp_curcs = oldcs;
-   pcomp_curcmd = oldcmd;
-+  pcomp_curtxt = oldtxt;
-   /* We need to conditionally handle setting *retryp here */
-   if (retryp)
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 9
-+#define PATCHLEVEL 10
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/110-upstream-bash44-010.patch b/utils/bash/patches/110-upstream-bash44-010.patch
new file mode 100644 (file)
index 0000000..1636b76
--- /dev/null
@@ -0,0 +1,26 @@
+Index: bash-4.4/builtins/read.def
+===================================================================
+--- bash-4.4.orig/builtins/read.def
++++ bash-4.4/builtins/read.def
+@@ -181,7 +181,8 @@ read_builtin (list)
+      WORD_LIST *list;
+ {
+   register char *varname;
+-  int size, i, nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2;
++  int size, nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2;
++  volatile int i;
+   int input_is_tty, input_is_pipe, unbuffered_read, skip_ctlesc, skip_ctlnul;
+   int raw, edit, nchars, silent, have_timeout, ignore_delim, fd, lastsig, t_errno;
+   unsigned int tmsec, tmusec;
+Index: bash-4.4/patchlevel.h
+===================================================================
+--- bash-4.4.orig/patchlevel.h
++++ bash-4.4/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 9
++#define PATCHLEVEL 10
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/111-upstream-bash43-011.patch b/utils/bash/patches/111-upstream-bash43-011.patch
deleted file mode 100644 (file)
index b4c181a..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-011
-
-Bug-Reported-by:       Egmont Koblinger <egmont@gmail.com>
-Bug-Reference-ID:      <CAGWcZk+bU5Jo1M+tutGvL-250UBE9DXjpeJVofYJSFcqFEVfMg@mail.gmail.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00153.html
-
-Bug-Description:
-
-The signal handling changes to bash and readline (to avoid running any code
-in a signal handler context) cause the cursor to be placed on the wrong
-line of a multi-line command after a ^C interrupts editing.
-
-Patch (apply with `patch -p0'):
-
---- a/lib/readline/display.c
-+++ b/lib/readline/display.c
-@@ -2677,7 +2677,8 @@ _rl_clean_up_for_exit ()
- {
-   if (_rl_echoing_p)
-     {
--      _rl_move_vert (_rl_vis_botlin);
-+      if (_rl_vis_botlin > 0) /* minor optimization plus bug fix */
-+      _rl_move_vert (_rl_vis_botlin);
-       _rl_vis_botlin = 0;
-       fflush (rl_outstream);
-       rl_restart_output (1, 0);
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 10
-+#define PATCHLEVEL 11
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/111-upstream-bash44-011.patch b/utils/bash/patches/111-upstream-bash44-011.patch
new file mode 100644 (file)
index 0000000..b6ea030
--- /dev/null
@@ -0,0 +1,26 @@
+Index: bash-4.4/patchlevel.h
+===================================================================
+--- bash-4.4.orig/patchlevel.h
++++ bash-4.4/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 10
++#define PATCHLEVEL 11
+ #endif /* _PATCHLEVEL_H_ */
+Index: bash-4.4/sig.c
+===================================================================
+--- bash-4.4.orig/sig.c
++++ bash-4.4/sig.c
+@@ -585,7 +585,8 @@ termsig_handler (sig)
+ #if defined (JOB_CONTROL)
+   if (sig == SIGHUP && (interactive || (subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PROCSUB))))
+     hangup_all_jobs ();
+-  end_job_control ();
++  if ((subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PROCSUB)) == 0)
++    end_job_control ();
+ #endif /* JOB_CONTROL */
+ #if defined (PROCESS_SUBSTITUTION)
diff --git a/utils/bash/patches/112-upstream-bash43-012.patch b/utils/bash/patches/112-upstream-bash43-012.patch
deleted file mode 100644 (file)
index 8fd2ea6..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-012
-
-Bug-Reported-by:       Eduardo A. Bustamante López<dualbus@gmail.com>
-Bug-Reference-ID:      <5346B54C.4070205@case.edu>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00051.html
-
-Bug-Description:
-
-When a SIGCHLD trap runs a command containing a shell builtin while
-a script is running `wait' to wait for all running children to complete,
-the SIGCHLD trap will not be run once for each child that terminates.
-
-Patch (apply with `patch -p0'):
-
---- a/jobs.c
-+++ b/jobs.c
-@@ -3597,6 +3597,7 @@ run_sigchld_trap (nchild)
-   unwind_protect_int (jobs_list_frozen);
-   unwind_protect_pointer (the_pipeline);
-   unwind_protect_pointer (subst_assign_varlist);
-+  unwind_protect_pointer (this_shell_builtin);
-   /* We have to add the commands this way because they will be run
-      in reverse order of adding.  We don't want maybe_set_sigchld_trap ()
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 11
-+#define PATCHLEVEL 12
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/112-upstream-bash44-012.patch b/utils/bash/patches/112-upstream-bash44-012.patch
new file mode 100644 (file)
index 0000000..83d239e
--- /dev/null
@@ -0,0 +1,106 @@
+Index: bash-4.4/patchlevel.h
+===================================================================
+--- bash-4.4.orig/patchlevel.h
++++ bash-4.4/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 11
++#define PATCHLEVEL 12
+ #endif /* _PATCHLEVEL_H_ */
+Index: bash-4.4/subst.c
+===================================================================
+--- bash-4.4.orig/subst.c
++++ bash-4.4/subst.c
+@@ -2825,11 +2825,15 @@ list_string (string, separators, quoted)
+ /* Parse a single word from STRING, using SEPARATORS to separate fields.
+    ENDPTR is set to the first character after the word.  This is used by
+-   the `read' builtin.  This is never called with SEPARATORS != $IFS;
+-   it should be simplified.
++   the `read' builtin.
++   
++   This is never called with SEPARATORS != $IFS, and takes advantage of that.
+    XXX - this function is very similar to list_string; they should be
+        combined - XXX */
++
++#define islocalsep(c) (local_cmap[(unsigned char)(c)] != 0)
++
+ char *
+ get_word_from_string (stringp, separators, endptr)
+      char **stringp, *separators, **endptr;
+@@ -2837,6 +2841,7 @@ get_word_from_string (stringp, separator
+   register char *s;
+   char *current_word;
+   int sindex, sh_style_split, whitesep, xflags;
++  unsigned char local_cmap[UCHAR_MAX+1];      /* really only need single-byte chars here */
+   size_t slen;
+   if (!stringp || !*stringp || !**stringp)
+@@ -2846,20 +2851,23 @@ get_word_from_string (stringp, separator
+                                separators[1] == '\t' &&
+                                separators[2] == '\n' &&
+                                separators[3] == '\0';
+-  for (xflags = 0, s = ifs_value; s && *s; s++)
++  memset (local_cmap, '\0', sizeof (local_cmap));
++  for (xflags = 0, s = separators; s && *s; s++)
+     {
+       if (*s == CTLESC) xflags |= SX_NOCTLESC;
+       if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL;
++      local_cmap[(unsigned char)*s] = 1;      /* local charmap of separators */
+     }
+   s = *stringp;
+   slen = 0;
+   /* Remove sequences of whitespace at the beginning of STRING, as
+-     long as those characters appear in IFS. */
+-  if (sh_style_split || !separators || !*separators)
++     long as those characters appear in SEPARATORS.  This happens if
++     SEPARATORS == $' \t\n' or if IFS is unset. */
++  if (sh_style_split || separators == 0)
+     {
+-      for (; *s && spctabnl (*s) && isifs (*s); s++);
++      for (; *s && spctabnl (*s) && islocalsep (*s); s++);
+       /* If the string is nothing but whitespace, update it and return. */
+       if (!*s)
+@@ -2878,9 +2886,9 @@ get_word_from_string (stringp, separator
+      This obeys the field splitting rules in Posix.2. */
+   sindex = 0;
+-  /* Don't need string length in ADVANCE_CHAR or string_extract_verbatim
+-     unless multibyte chars are possible. */
+-  slen = (MB_CUR_MAX > 1) ? STRLEN (s) : 1;
++  /* Don't need string length in ADVANCE_CHAR unless multibyte chars are
++     possible, but need it in string_extract_verbatim for bounds checking */
++  slen = STRLEN (s);
+   current_word = string_extract_verbatim (s, slen, &sindex, separators, xflags);
+   /* Set ENDPTR to the first character after the end of the word. */
+@@ -2899,19 +2907,19 @@ get_word_from_string (stringp, separator
+   /* Now skip sequences of space, tab, or newline characters if they are
+      in the list of separators. */
+-  while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex]))
++  while (s[sindex] && spctabnl (s[sindex]) && islocalsep (s[sindex]))
+     sindex++;
+   /* If the first separator was IFS whitespace and the current character is
+      a non-whitespace IFS character, it should be part of the current field
+      delimiter, not a separate delimiter that would result in an empty field.
+      Look at POSIX.2, 3.6.5, (3)(b). */
+-  if (s[sindex] && whitesep && isifs (s[sindex]) && !spctabnl (s[sindex]))
++  if (s[sindex] && whitesep && islocalsep (s[sindex]) && !spctabnl (s[sindex]))
+     {
+       sindex++;
+       /* An IFS character that is not IFS white space, along with any adjacent
+        IFS white space, shall delimit a field. */
+-      while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex]))
++      while (s[sindex] && spctabnl (s[sindex]) && islocalsep(s[sindex]))
+       sindex++;
+     }
diff --git a/utils/bash/patches/113-upstream-bash43-013.patch b/utils/bash/patches/113-upstream-bash43-013.patch
deleted file mode 100644 (file)
index 63c6c1e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-013
-
-Bug-Reported-by:       <Trond.Endrestol@ximalas.info>
-Bug-Reference-ID:      <alpine.BSF.2.03.1404192114310.1973@enterprise.ximalas.info>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00069.html
-
-Bug-Description:
-
-Using reverse-i-search when horizontal scrolling is enabled does not redisplay
-the entire line containing the successful search results.
-
-Patch (apply with `patch -p0'):
---- a/lib/readline/display.c
-+++ b/lib/readline/display.c
-@@ -1637,7 +1637,7 @@ update_line (old, new, current_line, oma
-   /* If we are changing the number of invisible characters in a line, and
-      the spot of first difference is before the end of the invisible chars,
-      lendiff needs to be adjusted. */
--  if (current_line == 0 && !_rl_horizontal_scroll_mode &&
-+  if (current_line == 0 && /* !_rl_horizontal_scroll_mode && */
-       current_invis_chars != visible_wrap_offset)
-     {
-       if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
-@@ -1825,8 +1825,13 @@ update_line (old, new, current_line, oma
-             else
-               _rl_last_c_pos += bytes_to_insert;
-+            /* XXX - we only want to do this if we are at the end of the line
-+               so we move there with _rl_move_cursor_relative */
-             if (_rl_horizontal_scroll_mode && ((oe-old) > (ne-new)))
--              goto clear_rest_of_line;
-+              {
-+                _rl_move_cursor_relative (ne-new, new);
-+                goto clear_rest_of_line;
-+              }
-           }
-       }
-       /* Otherwise, print over the existing material. */
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 12
-+#define PATCHLEVEL 13
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/114-upstream-bash43-014.patch b/utils/bash/patches/114-upstream-bash43-014.patch
deleted file mode 100644 (file)
index 99e16b9..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-014
-
-Bug-Reported-by:       Greg Wooledge <wooledg@eeg.ccf.org>
-Bug-Reference-ID:      <20140418202123.GB7660@eeg.ccf.org>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/help-bash/2014-04/msg00004.html
-
-Bug-Description:
-
-Under certain circumstances, $@ is expanded incorrectly in contexts where
-word splitting is not performed.
-
-Patch (apply with `patch -p0'):
---- a/subst.c
-+++ b/subst.c
-@@ -3248,8 +3248,10 @@ cond_expand_word (w, special)
-   if (w->word == 0 || w->word[0] == '\0')
-     return ((char *)NULL);
-+  expand_no_split_dollar_star = 1;
-   w->flags |= W_NOSPLIT2;
-   l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0);
-+  expand_no_split_dollar_star = 0;
-   if (l)
-     {
-       if (special == 0)                       /* LHS */
-@@ -7847,6 +7849,10 @@ param_expand (string, sindex, quoted, ex
-        We also want to make sure that splitting is done no matter what --
-        according to POSIX.2, this expands to a list of the positional
-        parameters no matter what IFS is set to. */
-+      /* XXX - what to do when in a context where word splitting is not
-+       performed? Even when IFS is not the default, posix seems to imply
-+       that we behave like unquoted $* ?  Maybe we should use PF_NOSPLIT2
-+       here. */
-       temp = string_list_dollar_at (list, (pflags & PF_ASSIGNRHS) ? (quoted|Q_DOUBLE_QUOTES) : quoted);
-       tflag |= W_DOLLARAT;
-@@ -8816,6 +8822,7 @@ finished_with_string:
-   else
-     {
-       char *ifs_chars;
-+      char *tstring;
-       ifs_chars = (quoted_dollar_at || has_dollar_at) ? ifs_value : (char *)NULL;
-@@ -8830,11 +8837,36 @@ finished_with_string:
-        regardless of what else has happened to IFS since the expansion. */
-       if (split_on_spaces)
-       list = list_string (istring, " ", 1);   /* XXX quoted == 1? */
-+      /* If we have $@ (has_dollar_at != 0) and we are in a context where we
-+       don't want to split the result (W_NOSPLIT2), and we are not quoted,
-+       we have already separated the arguments with the first character of
-+       $IFS.  In this case, we want to return a list with a single word
-+       with the separator possibly replaced with a space (it's what other
-+       shells seem to do).
-+       quoted_dollar_at is internal to this function and is set if we are
-+       passed an argument that is unquoted (quoted == 0) but we encounter a
-+       double-quoted $@ while expanding it. */
-+      else if (has_dollar_at && quoted_dollar_at == 0 && ifs_chars && quoted == 0 && (word->flags & W_NOSPLIT2))
-+      {
-+        /* Only split and rejoin if we have to */
-+        if (*ifs_chars && *ifs_chars != ' ')
-+          {
-+            list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1);
-+            tstring = string_list (list);
-+          }
-+        else
-+          tstring = istring;
-+        tword = make_bare_word (tstring);
-+        if (tstring != istring)
-+          free (tstring);
-+        goto set_word_flags;
-+      }
-       else if (has_dollar_at && ifs_chars)
-       list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1);
-       else
-       {
-         tword = make_bare_word (istring);
-+set_word_flags:
-         if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) || (quoted_state == WHOLLY_QUOTED))
-           tword->flags |= W_QUOTED;
-         if (word->flags & W_ASSIGNMENT)
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 13
-+#define PATCHLEVEL 14
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/115-upstream-bash43-015.patch b/utils/bash/patches/115-upstream-bash43-015.patch
deleted file mode 100644 (file)
index ae8be2d..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-015
-
-Bug-Reported-by:       Clark Wang <dearvoid@gmail.com>
-Bug-Reference-ID:      <CADv8-og2TOSoabXeNVXVGaXN3tEMHnYVq1rwOLe5meaRPSGRig@mail.gmail.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00095.html
-
-Bug-Description:
-
-When completing directory names, the directory name is dequoted twice.
-This causes problems for directories with single and double quotes in
-their names.
-
-Patch (apply with `patch -p0'):
---- a/bashline.c
-+++ b/bashline.c
-@@ -4167,9 +4167,16 @@ bash_directory_completion_matches (text)
-   int qc;
-   qc = rl_dispatching ? rl_completion_quote_character : 0;  
--  dfn = bash_dequote_filename ((char *)text, qc);
-+  /* If rl_completion_found_quote != 0, rl_completion_matches will call the
-+     filename dequoting function, causing the directory name to be dequoted
-+     twice. */
-+  if (rl_dispatching && rl_completion_found_quote == 0)
-+    dfn = bash_dequote_filename ((char *)text, qc);
-+  else
-+    dfn = (char *)text;
-   m1 = rl_completion_matches (dfn, rl_filename_completion_function);
--  free (dfn);
-+  if (dfn != text)
-+    free (dfn);
-   if (m1 == 0 || m1[0] == 0)
-     return m1;
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 14
-+#define PATCHLEVEL 15
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/116-upstream-bash43-016.patch b/utils/bash/patches/116-upstream-bash43-016.patch
deleted file mode 100644 (file)
index 3ce37f6..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-016
-
-Bug-Reported-by:       Pierre Gaston <pierre.gaston@gmail.com>
-Bug-Reference-ID:      <CAPSX3sTCD61k1VQLJ5r-LWzEt+e7Xc-fxXmwn2u8EA5gJJej8Q@mail.gmail.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00100.html
-
-Bug-Description:
-
-An extended glob pattern containing a slash (`/') causes the globbing code
-to misinterpret it as a directory separator.
-
-Patch (apply with `patch -p0'):
---- a/lib/glob/glob.c
-+++ b/lib/glob/glob.c
-@@ -123,6 +123,8 @@ static char **glob_dir_to_array __P((cha
- extern char *glob_patscan __P((char *, char *, int));
- extern wchar_t *glob_patscan_wc __P((wchar_t *, wchar_t *, int));
-+extern char *glob_dirscan __P((char *, int));
-+
- /* Compile `glob_loop.c' for single-byte characters. */
- #define CHAR  unsigned char
- #define INT   int
-@@ -187,6 +189,9 @@ extglob_skipname (pat, dname, flags)
-   se = pp + strlen (pp) - 1;          /* end of string */
-   pe = glob_patscan (pp, se, 0);      /* end of extglob pattern (( */
-   /* we should check for invalid extglob pattern here */
-+  if (pe == 0)
-+    return 0;
-+
-   /* if pe != se we have more of the pattern at the end of the extglob
-      pattern. Check the easy case first ( */
-   if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0)
-@@ -1015,7 +1020,7 @@ glob_filename (pathname, flags)
- {
-   char **result;
-   unsigned int result_size;
--  char *directory_name, *filename, *dname;
-+  char *directory_name, *filename, *dname, *fn;
-   unsigned int directory_len;
-   int free_dirname;                   /* flag */
-   int dflags;
-@@ -1031,6 +1036,18 @@ glob_filename (pathname, flags)
-   /* Find the filename.  */
-   filename = strrchr (pathname, '/');
-+#if defined (EXTENDED_GLOB)
-+  if (filename && extended_glob)
-+    {
-+      fn = glob_dirscan (pathname, '/');
-+#if DEBUG_MATCHING
-+      if (fn != filename)
-+      fprintf (stderr, "glob_filename: glob_dirscan: fn (%s) != filename (%s)\n", fn ? fn : "(null)", filename);
-+#endif
-+      filename = fn;
-+    }
-+#endif
-+
-   if (filename == NULL)
-     {
-       filename = pathname;
---- a/lib/glob/gmisc.c
-+++ b/lib/glob/gmisc.c
-@@ -42,6 +42,8 @@
- #define WLPAREN         L'('
- #define WRPAREN         L')'
-+extern char *glob_patscan __P((char *, char *, int));
-+
- /* Return 1 of the first character of WSTRING could match the first
-    character of pattern WPAT.  Wide character version. */
- int
-@@ -375,3 +377,34 @@ bad_bracket:
-   return matlen;
- }
-+
-+/* Skip characters in PAT and return the final occurrence of DIRSEP.  This
-+   is only called when extended_glob is set, so we have to skip over extglob
-+   patterns x(...) */
-+char *
-+glob_dirscan (pat, dirsep)
-+     char *pat;
-+     int dirsep;
-+{
-+  char *p, *d, *pe, *se;
-+
-+  d = pe = se = 0;
-+  for (p = pat; p && *p; p++)
-+    {
-+      if (extglob_pattern_p (p))
-+      {
-+        if (se == 0)
-+          se = p + strlen (p) - 1;
-+        pe = glob_patscan (p + 2, se, 0);
-+        if (pe == 0)
-+          continue;
-+        else if (*pe == 0)
-+          break;
-+        p = pe - 1;   /* will do increment above */
-+        continue;
-+      }
-+      if (*p ==  dirsep)
-+      d = p;
-+    }
-+  return d;
-+}
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 15
-+#define PATCHLEVEL 16
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/117-upstream-bash43-017.patch b/utils/bash/patches/117-upstream-bash43-017.patch
deleted file mode 100644 (file)
index 9c7eecc..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-017
-
-Bug-Reported-by:       Dan Douglas <ormaaj@gmail.com>
-Bug-Reference-ID:      <7781746.RhfoTROLxF@smorgbox>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-05/msg00026.html
-
-Bug-Description:
-
-The code that creates local variables should not clear the `invisible'
-attribute when returning an existing local variable.  Let the code that
-actually assigns a value clear it.
-
-Patch (apply with `patch -p0'):
---- a/variables.c
-+++ b/variables.c
-@@ -2197,10 +2197,7 @@ make_local_variable (name)
-   /* local foo; local foo;  is a no-op. */
-   old_var = find_variable (name);
-   if (old_var && local_p (old_var) && old_var->context == variable_context)
--    {
--      VUNSETATTR (old_var, att_invisible);    /* XXX */
--      return (old_var);
--    }
-+    return (old_var);
-   was_tmpvar = old_var && tempvar_p (old_var);
-   /* If we're making a local variable in a shell function, the temporary env
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 16
-+#define PATCHLEVEL 17
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/118-upstream-bash43-018.patch b/utils/bash/patches/118-upstream-bash43-018.patch
deleted file mode 100644 (file)
index 095ca93..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-018
-
-Bug-Reported-by:       Geir Hauge <geir.hauge@gmail.com>
-Bug-Reference-ID:      <CAO-BiTLOvfPXDypg61jcBausADrxUKJejakV2WTWP26cW0=rgA@mail.gmail.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-05/msg00040.html
-
-Bug-Description:
-
-When assigning an array variable using the compound assignment syntax,
-but using `declare' with the rhs of the compound assignment quoted, the
-shell did not mark the variable as visible after successfully performing
-the assignment.
-
-Patch (apply with `patch -p0'):
---- a/arrayfunc.c
-+++ b/arrayfunc.c
-@@ -179,6 +179,7 @@ bind_array_var_internal (entry, ind, key
-     array_insert (array_cell (entry), ind, newval);
-   FREE (newval);
-+  VUNSETATTR (entry, att_invisible);  /* no longer invisible */
-   return (entry);
- }
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 17
-+#define PATCHLEVEL 18
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/119-upstream-bash43-019.patch b/utils/bash/patches/119-upstream-bash43-019.patch
deleted file mode 100644 (file)
index 2d0fa44..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-019
-
-Bug-Reported-by:       John Lenton
-Bug-Reference-ID:
-Bug-Reference-URL:     https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1317476
-
-Bug-Description:
-
-The -t timeout option to `read' does not work when the -e option is used.
-
-Patch (apply with `patch -p0'):
-
---- a/lib/readline/input.c
-+++ b/lib/readline/input.c
-@@ -534,8 +534,16 @@ rl_getc (stream)
-       return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
-       else if (_rl_caught_signal == SIGHUP || _rl_caught_signal == SIGTERM)
-       return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
-+      /* keyboard-generated signals of interest */
-       else if (_rl_caught_signal == SIGINT || _rl_caught_signal == SIGQUIT)
-         RL_CHECK_SIGNALS ();
-+      /* non-keyboard-generated signals of interest */
-+      else if (_rl_caught_signal == SIGALRM
-+#if defined (SIGVTALRM)
-+              || _rl_caught_signal == SIGVTALRM
-+#endif
-+            )
-+        RL_CHECK_SIGNALS ();
-       if (rl_signal_event_hook)
-       (*rl_signal_event_hook) ();
---- a/builtins/read.def
-+++ b/builtins/read.def
-@@ -442,7 +442,10 @@ read_builtin (list)
-       add_unwind_protect (reset_alarm, (char *)NULL);
- #if defined (READLINE)
-       if (edit)
--      add_unwind_protect (reset_attempted_completion_function, (char *)NULL);
-+      {
-+        add_unwind_protect (reset_attempted_completion_function, (char *)NULL);
-+        add_unwind_protect (bashline_reset_event_hook, (char *)NULL);
-+      }
- #endif
-       falarm (tmsec, tmusec);
-     }
-@@ -1021,6 +1024,7 @@ edit_line (p, itext)
-   old_attempted_completion_function = rl_attempted_completion_function;
-   rl_attempted_completion_function = (rl_completion_func_t *)NULL;
-+  bashline_set_event_hook ();
-   if (itext)
-     {
-       old_startup_hook = rl_startup_hook;
-@@ -1032,6 +1036,7 @@ edit_line (p, itext)
-   rl_attempted_completion_function = old_attempted_completion_function;
-   old_attempted_completion_function = (rl_completion_func_t *)NULL;
-+  bashline_reset_event_hook ();
-   if (ret == 0)
-     return ret;
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 18
-+#define PATCHLEVEL 19
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/120-upstream-bash43-020.patch b/utils/bash/patches/120-upstream-bash43-020.patch
deleted file mode 100644 (file)
index abf0c30..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-020
-
-Bug-Reported-by:       Jared Yanovich <slovichon@gmail.com>
-Bug-Reference-ID:      <20140417073654.GB26875@nightderanger.psc.edu>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00065.html
-
-Bug-Description:
-
-When PS2 contains a command substitution, here-documents entered in an
-interactive shell can sometimes cause a segmentation fault.
-
-Patch (apply with `patch -p0'):
-
---- a/shell.h
-+++ b/shell.h
-@@ -168,7 +168,8 @@ typedef struct _sh_parser_state_t {
-   /* flags state affecting the parser */
-   int expand_aliases;
-   int echo_input_at_read;
--  
-+  int need_here_doc;
-+
- } sh_parser_state_t;
- typedef struct _sh_input_line_state_t {
---- a/parse.y
-+++ b/parse.y
-@@ -2642,7 +2642,7 @@ gather_here_documents ()
-   int r;
-   r = 0;
--  while (need_here_doc)
-+  while (need_here_doc > 0)
-     {
-       parser_state |= PST_HEREDOC;
-       make_here_document (redir_stack[r++], line_number);
-@@ -6075,6 +6075,7 @@ save_parser_state (ps)
-   ps->expand_aliases = expand_aliases;
-   ps->echo_input_at_read = echo_input_at_read;
-+  ps->need_here_doc = need_here_doc;
-   ps->token = token;
-   ps->token_buffer_size = token_buffer_size;
-@@ -6123,6 +6124,7 @@ restore_parser_state (ps)
-   expand_aliases = ps->expand_aliases;
-   echo_input_at_read = ps->echo_input_at_read;
-+  need_here_doc = ps->need_here_doc;
-   FREE (token);
-   token = ps->token;
---- a/y.tab.c
-+++ b/y.tab.c
-@@ -4954,7 +4954,7 @@ gather_here_documents ()
-   int r;
-   r = 0;
--  while (need_here_doc)
-+  while (need_here_doc > 0)
-     {
-       parser_state |= PST_HEREDOC;
-       make_here_document (redir_stack[r++], line_number);
-@@ -8387,6 +8387,7 @@ save_parser_state (ps)
-   ps->expand_aliases = expand_aliases;
-   ps->echo_input_at_read = echo_input_at_read;
-+  ps->need_here_doc = need_here_doc;
-   ps->token = token;
-   ps->token_buffer_size = token_buffer_size;
-@@ -8435,6 +8436,7 @@ restore_parser_state (ps)
-   expand_aliases = ps->expand_aliases;
-   echo_input_at_read = ps->echo_input_at_read;
-+  need_here_doc = ps->need_here_doc;
-   FREE (token);
-   token = ps->token;
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 19
-+#define PATCHLEVEL 20
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/121-upstream-bash43-021.patch b/utils/bash/patches/121-upstream-bash43-021.patch
deleted file mode 100644 (file)
index b7367a0..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-021
-
-Bug-Reported-by:       Jared Yanovich <slovichon@gmail.com>
-Bug-Reference-ID:      <20140625225019.GJ17044@nightderanger.psc.edu>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00070.html
-
-Bug-Description:
-
-When the readline `revert-all-at-newline' option is set, pressing newline
-when the current line is one retrieved from history results in a double free
-and a segmentation fault.
-
-Patch (apply with `patch -p0'):
-
---- a/lib/readline/misc.c
-+++ b/lib/readline/misc.c
-@@ -461,6 +461,7 @@ _rl_revert_all_lines ()
-           saved_undo_list = 0;
-         /* Set up rl_line_buffer and other variables from history entry */
-         rl_replace_from_history (entry, 0);   /* entry->line is now current */
-+        entry->data = 0;                      /* entry->data is now current undo list */
-         /* Undo all changes to this history entry */
-         while (rl_undo_list)
-           rl_do_undo ();
-@@ -468,7 +469,6 @@ _rl_revert_all_lines ()
-            the timestamp. */
-         FREE (entry->line);
-         entry->line = savestring (rl_line_buffer);
--        entry->data = 0;
-       }
-       entry = previous_history ();
-     }
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 20
-+#define PATCHLEVEL 21
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/122-upstream-bash43-022.patch b/utils/bash/patches/122-upstream-bash43-022.patch
deleted file mode 100644 (file)
index 1ee8f13..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-022
-
-Bug-Reported-by:       scorp.dev.null@gmail.com
-Bug-Reference-ID:      <E1WxXw8-0007iE-Bi@pcm14>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00061.html
-
-Bug-Description:
-
-Using nested pipelines within loops with the `lastpipe' option set can result
-in a segmentation fault.
-
-Patch (apply with `patch -p0'):
-
---- a/execute_cmd.c
-+++ b/execute_cmd.c
-@@ -2413,7 +2413,16 @@ execute_pipeline (command, asynchronous,
- #endif
-       lstdin = wait_for (lastpid);
- #if defined (JOB_CONTROL)
--      exec_result = job_exit_status (lastpipe_jid);
-+      /* If wait_for removes the job from the jobs table, use result of last
-+       command as pipeline's exit status as usual.  The jobs list can get
-+       frozen and unfrozen at inconvenient times if there are multiple pipelines
-+       running simultaneously. */
-+      if (INVALID_JOB (lastpipe_jid) == 0)
-+      exec_result = job_exit_status (lastpipe_jid);
-+      else if (pipefail_opt)
-+      exec_result = exec_result | lstdin;     /* XXX */
-+      /* otherwise we use exec_result */
-+        
- #endif
-       unfreeze_jobs_list ();
-     }
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 21
-+#define PATCHLEVEL 22
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/123-upstream-bash43-023.patch b/utils/bash/patches/123-upstream-bash43-023.patch
deleted file mode 100644 (file)
index 8684c13..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-023
-
-Bug-Reported-by:       Tim Friske <me@timfriske.com>
-Bug-Reference-ID:      <CAM1RzOcOR9zzC2i+aeES6LtbHNHoOV+0pZEYPrqxv_QAii-RXA@mail.gmail.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00056.html
-
-Bug-Description:
-
-Bash does not correctly parse process substitution constructs that contain
-unbalanced parentheses as part of the contained command.
-
-Patch (apply with `patch -p0'):
-
---- a/subst.h
-+++ b/subst.h
-@@ -82,7 +82,7 @@ extern char *extract_arithmetic_subst __
- /* Extract the <( or >( construct in STRING, and return a new string.
-    Start extracting at (SINDEX) as if we had just seen "<(".
-    Make (SINDEX) get the position just after the matching ")". */
--extern char *extract_process_subst __P((char *, char *, int *));
-+extern char *extract_process_subst __P((char *, char *, int *, int));
- #endif /* PROCESS_SUBSTITUTION */
- /* Extract the name of the variable to bind to from the assignment string. */
---- a/subst.c
-+++ b/subst.c
-@@ -1192,12 +1192,18 @@ extract_arithmetic_subst (string, sindex
-    Start extracting at (SINDEX) as if we had just seen "<(".
-    Make (SINDEX) get the position of the matching ")". */ /*))*/
- char *
--extract_process_subst (string, starter, sindex)
-+extract_process_subst (string, starter, sindex, xflags)
-      char *string;
-      char *starter;
-      int *sindex;
-+     int xflags;
- {
-+#if 0
-   return (extract_delimited_string (string, sindex, starter, "(", ")", SX_COMMAND));
-+#else
-+  xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0);
-+  return (xparse_dolparen (string, string+*sindex, sindex, xflags));
-+#endif
- }
- #endif /* PROCESS_SUBSTITUTION */
-@@ -1785,7 +1791,7 @@ skip_to_delim (string, start, delims, fl
-         si = i + 2;
-         if (string[si] == '\0')
-           CQ_RETURN(si);
--        temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si);
-+        temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si, 0);
-         free (temp);          /* no SX_ALLOC here */
-         i = si;
-         if (string[i] == '\0')
-@@ -8249,7 +8255,7 @@ add_string:
-           else
-             t_index = sindex + 1; /* skip past both '<' and LPAREN */
--          temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index); /*))*/
-+          temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index, 0); /*))*/
-           sindex = t_index;
-           /* If the process substitution specification is `<()', we want to
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 22
-+#define PATCHLEVEL 23
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/124-upstream-bash43-024.patch b/utils/bash/patches/124-upstream-bash43-024.patch
deleted file mode 100644 (file)
index 7941455..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-024
-
-Bug-Reported-by:       Corentin Peuvrel <cpeuvrel@pom-monitoring.com>
-Bug-Reference-ID:      <53CE9E5D.6050203@pom-monitoring.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-07/msg00021.html
-
-Bug-Description:
-
-Indirect variable references do not work correctly if the reference
-variable expands to an array reference using a subscript other than 0
-(e.g., foo='bar[1]' ; echo ${!foo}).
-
-Patch (apply with `patch -p0'):
-
---- a/subst.c
-+++ b/subst.c
-@@ -7374,7 +7374,13 @@ parameter_brace_expand (string, indexp,
-     }
-   if (want_indir)
--    tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at);
-+    {
-+      tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at);
-+      /* Turn off the W_ARRAYIND flag because there is no way for this function
-+       to return the index we're supposed to be using. */
-+      if (tdesc && tdesc->flags)
-+      tdesc->flags &= ~W_ARRAYIND;
-+    }
-   else
-     tdesc = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND|(pflags&(PF_NOSPLIT2|PF_ASSIGNRHS)), &ind);
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 23
-+#define PATCHLEVEL 24
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/125-upstream-bash43-025.patch b/utils/bash/patches/125-upstream-bash43-025.patch
deleted file mode 100644 (file)
index 6b2ef4b..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-025
-
-Bug-Reported-by:       Stephane Chazelas <stephane.chazelas@gmail.com>
-Bug-Reference-ID:
-Bug-Reference-URL:
-
-Bug-Description:
-
-Under certain circumstances, bash will execute user code while processing the
-environment for exported function definitions.
-
-Patch (apply with `patch -p0'):
-
---- a/builtins/common.h
-+++ b/builtins/common.h
-@@ -33,6 +33,8 @@
- #define SEVAL_RESETLINE       0x010
- #define SEVAL_PARSEONLY       0x020
- #define SEVAL_NOLONGJMP 0x040
-+#define SEVAL_FUNCDEF 0x080           /* only allow function definitions */
-+#define SEVAL_ONECMD  0x100           /* only allow a single command */
- /* Flags for describe_command, shared between type.def and command.def */
- #define CDESC_ALL             0x001   /* type -a */
---- a/builtins/evalstring.c
-+++ b/builtins/evalstring.c
-@@ -308,6 +308,14 @@ parse_and_execute (string, from_file, fl
-           {
-             struct fd_bitmap *bitmap;
-+            if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def)
-+              {
-+                internal_warning ("%s: ignoring function definition attempt", from_file);
-+                should_jump_to_top_level = 0;
-+                last_result = last_command_exit_value = EX_BADUSAGE;
-+                break;
-+              }
-+
-             bitmap = new_fd_bitmap (FD_BITMAP_SIZE);
-             begin_unwind_frame ("pe_dispose");
-             add_unwind_protect (dispose_fd_bitmap, bitmap);
-@@ -368,6 +376,9 @@ parse_and_execute (string, from_file, fl
-             dispose_command (command);
-             dispose_fd_bitmap (bitmap);
-             discard_unwind_frame ("pe_dispose");
-+
-+            if (flags & SEVAL_ONECMD)
-+              break;
-           }
-       }
-       else
---- a/variables.c
-+++ b/variables.c
-@@ -358,13 +358,11 @@ initialize_shell_variables (env, privmod
-         temp_string[char_index] = ' ';
-         strcpy (temp_string + char_index + 1, string);
--        if (posixly_correct == 0 || legal_identifier (name))
--          parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST);
--
--        /* Ancient backwards compatibility.  Old versions of bash exported
--           functions like name()=() {...} */
--        if (name[char_index - 1] == ')' && name[char_index - 2] == '(')
--          name[char_index - 2] = '\0';
-+        /* Don't import function names that are invalid identifiers from the
-+           environment, though we still allow them to be defined as shell
-+           variables. */
-+        if (legal_identifier (name))
-+          parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
-         if (temp_var = find_function (name))
-           {
-@@ -381,10 +379,6 @@ initialize_shell_variables (env, privmod
-             last_command_exit_value = 1;
-             report_error (_("error importing function definition for `%s'"), name);
-           }
--
--        /* ( */
--        if (name[char_index - 1] == ')' && name[char_index - 2] == '\0')
--          name[char_index - 2] = '(';         /* ) */
-       }
- #if defined (ARRAY_VARS)
- #  if ARRAY_EXPORT
---- a/subst.c
-+++ b/subst.c
-@@ -8047,7 +8047,9 @@ comsub:
-         goto return0;
-       }
--      else if (var = find_variable_last_nameref (temp1))
-+      else if (var && (invisible_p (var) || var_isset (var) == 0))
-+      temp = (char *)NULL;
-+      else if ((var = find_variable_last_nameref (temp1)) && var_isset (var) && invisible_p (var) == 0)
-       {
-         temp = nameref_cell (var);
- #if defined (ARRAY_VARS)
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 24
-+#define PATCHLEVEL 25
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/126-upstream-bash43-026.patch b/utils/bash/patches/126-upstream-bash43-026.patch
deleted file mode 100644 (file)
index e9535be..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-026
-
-Bug-Reported-by:       Tavis Ormandy <taviso@cmpxchg8b.com>
-Bug-Reference-ID:
-Bug-Reference-URL:     http://twitter.com/taviso/statuses/514887394294652929
-
-Bug-Description:
-
-Under certain circumstances, bash can incorrectly save a lookahead character and
-return it on a subsequent call, even when reading a new line.
-
-Patch (apply with `patch -p0'):
-
---- a/parse.y
-+++ b/parse.y
-@@ -2953,6 +2953,8 @@ reset_parser ()
-   FREE (word_desc_to_read);
-   word_desc_to_read = (WORD_DESC *)NULL;
-+  eol_ungetc_lookahead = 0;
-+
-   current_token = '\n';               /* XXX */
-   last_read_token = '\n';
-   token_to_read = '\n';
---- a/y.tab.c
-+++ b/y.tab.c
-@@ -5265,6 +5265,8 @@ reset_parser ()
-   FREE (word_desc_to_read);
-   word_desc_to_read = (WORD_DESC *)NULL;
-+  eol_ungetc_lookahead = 0;
-+
-   current_token = '\n';               /* XXX */
-   last_read_token = '\n';
-   token_to_read = '\n';
-@@ -8539,4 +8541,3 @@ set_line_mbstate ()
-     }
- }
- #endif /* HANDLE_MULTIBYTE */
--
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 25
-+#define PATCHLEVEL 26
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/127-upstream-bash43-027.patch b/utils/bash/patches/127-upstream-bash43-027.patch
deleted file mode 100644 (file)
index 6e8a51a..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-027
-
-Bug-Reported-by:       Florian Weimer <fweimer@redhat.com>
-Bug-Reference-ID:
-Bug-Reference-URL:
-
-Bug-Description:
-
-This patch changes the encoding bash uses for exported functions to avoid
-clashes with shell variables and to avoid depending only on an environment
-variable's contents to determine whether or not to interpret it as a shell
-function.
-
-Patch (apply with `patch -p0'):
-
---- a/variables.c
-+++ b/variables.c
-@@ -83,6 +83,11 @@
- #define ifsname(s)    ((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0')
-+#define BASHFUNC_PREFIX               "BASH_FUNC_"
-+#define BASHFUNC_PREFLEN      10      /* == strlen(BASHFUNC_PREFIX */
-+#define BASHFUNC_SUFFIX               "%%"
-+#define BASHFUNC_SUFFLEN      2       /* == strlen(BASHFUNC_SUFFIX) */
-+
- extern char **environ;
- /* Variables used here and defined in other files. */
-@@ -279,7 +284,7 @@ static void push_temp_var __P((PTR_T));
- static void propagate_temp_var __P((PTR_T));
- static void dispose_temporary_env __P((sh_free_func_t *));     
--static inline char *mk_env_string __P((const char *, const char *));
-+static inline char *mk_env_string __P((const char *, const char *, int));
- static char **make_env_array_from_var_list __P((SHELL_VAR **));
- static char **make_var_export_array __P((VAR_CONTEXT *));
- static char **make_func_export_array __P((void));
-@@ -349,22 +354,33 @@ initialize_shell_variables (env, privmod
-       /* If exported function, define it now.  Don't import functions from
-        the environment in privileged mode. */
--      if (privmode == 0 && read_but_dont_execute == 0 && STREQN ("() {", string, 4))
-+      if (privmode == 0 && read_but_dont_execute == 0 && 
-+          STREQN (BASHFUNC_PREFIX, name, BASHFUNC_PREFLEN) &&
-+          STREQ (BASHFUNC_SUFFIX, name + char_index - BASHFUNC_SUFFLEN) &&
-+        STREQN ("() {", string, 4))
-       {
-+        size_t namelen;
-+        char *tname;          /* desired imported function name */
-+
-+        namelen = char_index - BASHFUNC_PREFLEN - BASHFUNC_SUFFLEN;
-+
-+        tname = name + BASHFUNC_PREFLEN;      /* start of func name */
-+        tname[namelen] = '\0';                /* now tname == func name */
-+
-         string_length = strlen (string);
--        temp_string = (char *)xmalloc (3 + string_length + char_index);
-+        temp_string = (char *)xmalloc (namelen + string_length + 2);
--        strcpy (temp_string, name);
--        temp_string[char_index] = ' ';
--        strcpy (temp_string + char_index + 1, string);
-+        memcpy (temp_string, tname, namelen);
-+        temp_string[namelen] = ' ';
-+        memcpy (temp_string + namelen + 1, string, string_length + 1);
-         /* Don't import function names that are invalid identifiers from the
-            environment, though we still allow them to be defined as shell
-            variables. */
--        if (legal_identifier (name))
--          parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
-+        if (absolute_program (tname) == 0 && (posixly_correct == 0 || legal_identifier (tname)))
-+          parse_and_execute (temp_string, tname, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
--        if (temp_var = find_function (name))
-+        if (temp_var = find_function (tname))
-           {
-             VSETATTR (temp_var, (att_exported|att_imported));
-             array_needs_making = 1;
-@@ -377,8 +393,11 @@ initialize_shell_variables (env, privmod
-                 array_needs_making = 1;
-               }
-             last_command_exit_value = 1;
--            report_error (_("error importing function definition for `%s'"), name);
-+            report_error (_("error importing function definition for `%s'"), tname);
-           }
-+
-+        /* Restore original suffix */
-+        tname[namelen] = BASHFUNC_SUFFIX[0];
-       }
- #if defined (ARRAY_VARS)
- #  if ARRAY_EXPORT
-@@ -2954,7 +2973,7 @@ assign_in_env (word, flags)
-   var->context = variable_context;    /* XXX */
-   INVALIDATE_EXPORTSTR (var);
--  var->exportstr = mk_env_string (name, value);
-+  var->exportstr = mk_env_string (name, value, 0);
-   array_needs_making = 1;
-@@ -3852,21 +3871,42 @@ merge_temporary_env ()
- /* **************************************************************** */
- static inline char *
--mk_env_string (name, value)
-+mk_env_string (name, value, isfunc)
-      const char *name, *value;
-+     int isfunc;
- {
--  int name_len, value_len;
--  char        *p;
-+  size_t name_len, value_len;
-+  char        *p, *q;
-   name_len = strlen (name);
-   value_len = STRLEN (value);
--  p = (char *)xmalloc (2 + name_len + value_len);
--  strcpy (p, name);
--  p[name_len] = '=';
-+
-+  /* If we are exporting a shell function, construct the encoded function
-+     name. */
-+  if (isfunc && value)
-+    {
-+      p = (char *)xmalloc (BASHFUNC_PREFLEN + name_len + BASHFUNC_SUFFLEN + value_len + 2);
-+      q = p;
-+      memcpy (q, BASHFUNC_PREFIX, BASHFUNC_PREFLEN);
-+      q += BASHFUNC_PREFLEN;
-+      memcpy (q, name, name_len);
-+      q += name_len;
-+      memcpy (q, BASHFUNC_SUFFIX, BASHFUNC_SUFFLEN);
-+      q += BASHFUNC_SUFFLEN;
-+    }
-+  else
-+    {
-+      p = (char *)xmalloc (2 + name_len + value_len);
-+      memcpy (p, name, name_len);
-+      q = p + name_len;
-+    }
-+
-+  q[0] = '=';
-   if (value && *value)
--    strcpy (p + name_len + 1, value);
-+    memcpy (q + 1, value, value_len + 1);
-   else
--    p[name_len + 1] = '\0';
-+    q[1] = '\0';
-+
-   return (p);
- }
-@@ -3952,7 +3992,7 @@ make_env_array_from_var_list (vars)
-         /* Gee, I'd like to get away with not using savestring() if we're
-            using the cached exportstr... */
-         list[list_index] = USE_EXPORTSTR ? savestring (value)
--                                         : mk_env_string (var->name, value);
-+                                         : mk_env_string (var->name, value, function_p (var));
-         if (USE_EXPORTSTR == 0)
-           SAVE_EXPORTSTR (var, list[list_index]);
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 26
-+#define PATCHLEVEL 27
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/128-upstream-bash43-028.patch b/utils/bash/patches/128-upstream-bash43-028.patch
deleted file mode 100644 (file)
index b4b1b6d..0000000
+++ /dev/null
@@ -1,1526 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-028
-
-Bug-Reported-by:       Florian Weimer <fweimer@redhat.com>
-Bug-Reference-ID:
-Bug-Reference-URL:
-
-Bug-Description:
-
-There are two local buffer overflows in parse.y that can cause the shell
-to dump core when given many here-documents attached to a single command
-or many nested loops.
-
-Patch (apply with `patch -p0'):
-
---- a/parse.y
-+++ b/parse.y
-@@ -168,6 +168,9 @@ static char *read_a_line __P((int));
- static int reserved_word_acceptable __P((int));
- static int yylex __P((void));
-+
-+static void push_heredoc __P((REDIRECT *));
-+static char *mk_alexpansion __P((char *));
- static int alias_expand_token __P((char *));
- static int time_command_acceptable __P((void));
- static int special_case_tokens __P((char *));
-@@ -265,7 +268,9 @@ int parser_state;
- /* Variables to manage the task of reading here documents, because we need to
-    defer the reading until after a complete command has been collected. */
--static REDIRECT *redir_stack[10];
-+#define HEREDOC_MAX 16
-+
-+static REDIRECT *redir_stack[HEREDOC_MAX];
- int need_here_doc;
- /* Where shell input comes from.  History expansion is performed on each
-@@ -307,7 +312,7 @@ static int global_extglob;
-    or `for WORD' begins.  This is a nested command maximum, since the array
-    index is decremented after a case, select, or for command is parsed. */
- #define MAX_CASE_NEST 128
--static int word_lineno[MAX_CASE_NEST];
-+static int word_lineno[MAX_CASE_NEST+1];
- static int word_top = -1;
- /* If non-zero, it is the token that we want read_token to return
-@@ -520,42 +525,42 @@ redirection:     '>' WORD
-                         source.dest = 0;
-                         redir.filename = $2;
-                         $$ = make_redirection (source, r_reading_until, redir, 0);
--                        redir_stack[need_here_doc++] = $$;
-+                        push_heredoc ($$);
-                       }
-       |       NUMBER LESS_LESS WORD
-                       {
-                         source.dest = $1;
-                         redir.filename = $3;
-                         $$ = make_redirection (source, r_reading_until, redir, 0);
--                        redir_stack[need_here_doc++] = $$;
-+                        push_heredoc ($$);
-                       }
-       |       REDIR_WORD LESS_LESS WORD
-                       {
-                         source.filename = $1;
-                         redir.filename = $3;
-                         $$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN);
--                        redir_stack[need_here_doc++] = $$;
-+                        push_heredoc ($$);
-                       }
-       |       LESS_LESS_MINUS WORD
-                       {
-                         source.dest = 0;
-                         redir.filename = $2;
-                         $$ = make_redirection (source, r_deblank_reading_until, redir, 0);
--                        redir_stack[need_here_doc++] = $$;
-+                        push_heredoc ($$);
-                       }
-       |       NUMBER LESS_LESS_MINUS WORD
-                       {
-                         source.dest = $1;
-                         redir.filename = $3;
-                         $$ = make_redirection (source, r_deblank_reading_until, redir, 0);
--                        redir_stack[need_here_doc++] = $$;
-+                        push_heredoc ($$);
-                       }
-       |       REDIR_WORD  LESS_LESS_MINUS WORD
-                       {
-                         source.filename = $1;
-                         redir.filename = $3;
-                         $$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN);
--                        redir_stack[need_here_doc++] = $$;
-+                        push_heredoc ($$);
-                       }
-       |       LESS_LESS_LESS WORD
-                       {
-@@ -2636,6 +2641,21 @@ yylex ()
-    which allow ESAC to be the next one read. */
- static int esacs_needed_count;
-+static void
-+push_heredoc (r)
-+     REDIRECT *r;
-+{
-+  if (need_here_doc >= HEREDOC_MAX)
-+    {
-+      last_command_exit_value = EX_BADUSAGE;
-+      need_here_doc = 0;
-+      report_syntax_error (_("maximum here-document count exceeded"));
-+      reset_parser ();
-+      exit_shell (last_command_exit_value);
-+    }
-+  redir_stack[need_here_doc++] = r;
-+}
-+
- void
- gather_here_documents ()
- {
---- a/y.tab.c
-+++ b/y.tab.c
-@@ -168,7 +168,7 @@
- /* Copy the first part of user declarations.  */
--#line 21 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 21 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
- #include "config.h"
-@@ -319,6 +319,9 @@ static char *read_a_line __P((int));
- static int reserved_word_acceptable __P((int));
- static int yylex __P((void));
-+
-+static void push_heredoc __P((REDIRECT *));
-+static char *mk_alexpansion __P((char *));
- static int alias_expand_token __P((char *));
- static int time_command_acceptable __P((void));
- static int special_case_tokens __P((char *));
-@@ -416,7 +419,9 @@ int parser_state;
- /* Variables to manage the task of reading here documents, because we need to
-    defer the reading until after a complete command has been collected. */
--static REDIRECT *redir_stack[10];
-+#define HEREDOC_MAX 16
-+
-+static REDIRECT *redir_stack[HEREDOC_MAX];
- int need_here_doc;
- /* Where shell input comes from.  History expansion is performed on each
-@@ -458,7 +463,7 @@ static int global_extglob;
-    or `for WORD' begins.  This is a nested command maximum, since the array
-    index is decremented after a case, select, or for command is parsed. */
- #define MAX_CASE_NEST 128
--static int word_lineno[MAX_CASE_NEST];
-+static int word_lineno[MAX_CASE_NEST+1];
- static int word_top = -1;
- /* If non-zero, it is the token that we want read_token to return
-@@ -492,7 +497,7 @@ static REDIRECTEE redir;
- #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
- typedef union YYSTYPE
--#line 324 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 329 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
- {
-   WORD_DESC *word;            /* the word that we read. */
-   int number;                 /* the number that we read. */
-@@ -503,7 +508,7 @@ typedef union YYSTYPE
-   PATTERN_LIST *pattern;
- }
- /* Line 193 of yacc.c.  */
--#line 507 "y.tab.c"
-+#line 512 "y.tab.c"
-       YYSTYPE;
- # define yystype YYSTYPE /* obsolescent; will be withdrawn */
- # define YYSTYPE_IS_DECLARED 1
-@@ -516,7 +521,7 @@ typedef union YYSTYPE
- /* Line 216 of yacc.c.  */
--#line 520 "y.tab.c"
-+#line 525 "y.tab.c"
- #ifdef short
- # undef short
-@@ -886,23 +891,23 @@ static const yytype_int8 yyrhs[] =
- /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
- static const yytype_uint16 yyrline[] =
- {
--       0,   377,   377,   388,   397,   412,   422,   424,   428,   434,
--     440,   446,   452,   458,   464,   470,   476,   482,   488,   494,
--     500,   506,   512,   518,   525,   532,   539,   546,   553,   560,
--     566,   572,   578,   584,   590,   596,   602,   608,   614,   620,
--     626,   632,   638,   644,   650,   656,   662,   668,   674,   680,
--     686,   692,   700,   702,   704,   708,   712,   723,   725,   729,
--     731,   733,   749,   751,   755,   757,   759,   761,   763,   765,
--     767,   769,   771,   773,   775,   779,   784,   789,   794,   799,
--     804,   809,   814,   821,   826,   831,   836,   843,   848,   853,
--     858,   863,   868,   875,   880,   885,   892,   895,   898,   902,
--     904,   935,   942,   947,   964,   969,   986,   993,   995,   997,
--    1002,  1006,  1010,  1014,  1016,  1018,  1022,  1023,  1027,  1029,
--    1031,  1033,  1037,  1039,  1041,  1043,  1045,  1047,  1051,  1053,
--    1062,  1070,  1071,  1077,  1078,  1085,  1089,  1091,  1093,  1100,
--    1102,  1104,  1108,  1109,  1112,  1114,  1116,  1120,  1121,  1130,
--    1143,  1159,  1174,  1176,  1178,  1185,  1188,  1192,  1194,  1200,
--    1206,  1223,  1243,  1245,  1268,  1272,  1274,  1276
-+       0,   382,   382,   393,   402,   417,   427,   429,   433,   439,
-+     445,   451,   457,   463,   469,   475,   481,   487,   493,   499,
-+     505,   511,   517,   523,   530,   537,   544,   551,   558,   565,
-+     571,   577,   583,   589,   595,   601,   607,   613,   619,   625,
-+     631,   637,   643,   649,   655,   661,   667,   673,   679,   685,
-+     691,   697,   705,   707,   709,   713,   717,   728,   730,   734,
-+     736,   738,   754,   756,   760,   762,   764,   766,   768,   770,
-+     772,   774,   776,   778,   780,   784,   789,   794,   799,   804,
-+     809,   814,   819,   826,   831,   836,   841,   848,   853,   858,
-+     863,   868,   873,   880,   885,   890,   897,   900,   903,   907,
-+     909,   940,   947,   952,   969,   974,   991,   998,  1000,  1002,
-+    1007,  1011,  1015,  1019,  1021,  1023,  1027,  1028,  1032,  1034,
-+    1036,  1038,  1042,  1044,  1046,  1048,  1050,  1052,  1056,  1058,
-+    1067,  1075,  1076,  1082,  1083,  1090,  1094,  1096,  1098,  1105,
-+    1107,  1109,  1113,  1114,  1117,  1119,  1121,  1125,  1126,  1135,
-+    1148,  1164,  1179,  1181,  1183,  1190,  1193,  1197,  1199,  1205,
-+    1211,  1228,  1248,  1250,  1273,  1277,  1279,  1281
- };
- #endif
-@@ -2093,7 +2098,7 @@ yyreduce:
-   switch (yyn)
-     {
-         case 2:
--#line 378 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 383 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         /* Case of regular command.  Discard the error
-                            safety net,and return the command just parsed. */
-@@ -2107,7 +2112,7 @@ yyreduce:
-     break;
-   case 3:
--#line 389 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 394 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         /* Case of regular command, but not a very
-                            interesting one.  Return a NULL command. */
-@@ -2119,7 +2124,7 @@ yyreduce:
-     break;
-   case 4:
--#line 398 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 403 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         /* Error during parsing.  Return NULL command. */
-                         global_command = (COMMAND *)NULL;
-@@ -2137,7 +2142,7 @@ yyreduce:
-     break;
-   case 5:
--#line 413 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 418 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         /* Case of EOF seen by itself.  Do ignoreeof or
-                            not. */
-@@ -2148,17 +2153,17 @@ yyreduce:
-     break;
-   case 6:
--#line 423 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 428 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
-     break;
-   case 7:
--#line 425 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 430 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); }
-     break;
-   case 8:
--#line 429 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 434 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 1;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2167,7 +2172,7 @@ yyreduce:
-     break;
-   case 9:
--#line 435 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 440 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 0;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2176,7 +2181,7 @@ yyreduce:
-     break;
-   case 10:
--#line 441 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 446 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2185,7 +2190,7 @@ yyreduce:
-     break;
-   case 11:
--#line 447 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 452 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2194,7 +2199,7 @@ yyreduce:
-     break;
-   case 12:
--#line 453 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 458 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2203,7 +2208,7 @@ yyreduce:
-     break;
-   case 13:
--#line 459 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 464 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2212,7 +2217,7 @@ yyreduce:
-     break;
-   case 14:
--#line 465 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 470 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 1;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2221,7 +2226,7 @@ yyreduce:
-     break;
-   case 15:
--#line 471 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 476 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2230,7 +2235,7 @@ yyreduce:
-     break;
-   case 16:
--#line 477 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 482 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2239,7 +2244,7 @@ yyreduce:
-     break;
-   case 17:
--#line 483 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 488 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 1;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2248,7 +2253,7 @@ yyreduce:
-     break;
-   case 18:
--#line 489 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 494 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2257,7 +2262,7 @@ yyreduce:
-     break;
-   case 19:
--#line 495 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 500 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2266,7 +2271,7 @@ yyreduce:
-     break;
-   case 20:
--#line 501 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 506 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 0;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2275,7 +2280,7 @@ yyreduce:
-     break;
-   case 21:
--#line 507 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 512 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2284,7 +2289,7 @@ yyreduce:
-     break;
-   case 22:
--#line 513 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 518 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2293,67 +2298,67 @@ yyreduce:
-     break;
-   case 23:
--#line 519 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 524 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 0;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-                         (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0);
--                        redir_stack[need_here_doc++] = (yyval.redirect);
-+                        push_heredoc ((yyval.redirect));
-                       }
-     break;
-   case 24:
--#line 526 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 531 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-                         (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0);
--                        redir_stack[need_here_doc++] = (yyval.redirect);
-+                        push_heredoc ((yyval.redirect));
-                       }
-     break;
-   case 25:
--#line 533 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 538 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-                         (yyval.redirect) = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN);
--                        redir_stack[need_here_doc++] = (yyval.redirect);
-+                        push_heredoc ((yyval.redirect));
-                       }
-     break;
-   case 26:
--#line 540 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 545 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 0;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-                         (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0);
--                        redir_stack[need_here_doc++] = (yyval.redirect);
-+                        push_heredoc ((yyval.redirect));
-                       }
-     break;
-   case 27:
--#line 547 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 552 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-                         (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0);
--                        redir_stack[need_here_doc++] = (yyval.redirect);
-+                        push_heredoc ((yyval.redirect));
-                       }
-     break;
-   case 28:
--#line 554 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 559 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-                         (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN);
--                        redir_stack[need_here_doc++] = (yyval.redirect);
-+                        push_heredoc ((yyval.redirect));
-                       }
-     break;
-   case 29:
--#line 561 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 566 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 0;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2362,7 +2367,7 @@ yyreduce:
-     break;
-   case 30:
--#line 567 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 572 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2371,7 +2376,7 @@ yyreduce:
-     break;
-   case 31:
--#line 573 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 578 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2380,7 +2385,7 @@ yyreduce:
-     break;
-   case 32:
--#line 579 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 584 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 0;
-                         redir.dest = (yyvsp[(2) - (2)].number);
-@@ -2389,7 +2394,7 @@ yyreduce:
-     break;
-   case 33:
--#line 585 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 590 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.dest = (yyvsp[(3) - (3)].number);
-@@ -2398,7 +2403,7 @@ yyreduce:
-     break;
-   case 34:
--#line 591 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 596 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.dest = (yyvsp[(3) - (3)].number);
-@@ -2407,7 +2412,7 @@ yyreduce:
-     break;
-   case 35:
--#line 597 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 602 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 1;
-                         redir.dest = (yyvsp[(2) - (2)].number);
-@@ -2416,7 +2421,7 @@ yyreduce:
-     break;
-   case 36:
--#line 603 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 608 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.dest = (yyvsp[(3) - (3)].number);
-@@ -2425,7 +2430,7 @@ yyreduce:
-     break;
-   case 37:
--#line 609 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 614 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.dest = (yyvsp[(3) - (3)].number);
-@@ -2434,7 +2439,7 @@ yyreduce:
-     break;
-   case 38:
--#line 615 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 620 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 0;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2443,7 +2448,7 @@ yyreduce:
-     break;
-   case 39:
--#line 621 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 626 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2452,7 +2457,7 @@ yyreduce:
-     break;
-   case 40:
--#line 627 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 632 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2461,7 +2466,7 @@ yyreduce:
-     break;
-   case 41:
--#line 633 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 638 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 1;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2470,7 +2475,7 @@ yyreduce:
-     break;
-   case 42:
--#line 639 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 644 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2479,7 +2484,7 @@ yyreduce:
-     break;
-   case 43:
--#line 645 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 650 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2488,7 +2493,7 @@ yyreduce:
-     break;
-   case 44:
--#line 651 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 656 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 1;
-                         redir.dest = 0;
-@@ -2497,7 +2502,7 @@ yyreduce:
-     break;
-   case 45:
--#line 657 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 662 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.dest = 0;
-@@ -2506,7 +2511,7 @@ yyreduce:
-     break;
-   case 46:
--#line 663 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 668 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.dest = 0;
-@@ -2515,7 +2520,7 @@ yyreduce:
-     break;
-   case 47:
--#line 669 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 674 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 0;
-                         redir.dest = 0;
-@@ -2524,7 +2529,7 @@ yyreduce:
-     break;
-   case 48:
--#line 675 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 680 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.dest = 0;
-@@ -2533,7 +2538,7 @@ yyreduce:
-     break;
-   case 49:
--#line 681 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 686 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.dest = 0;
-@@ -2542,7 +2547,7 @@ yyreduce:
-     break;
-   case 50:
--#line 687 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 692 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 1;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2551,7 +2556,7 @@ yyreduce:
-     break;
-   case 51:
--#line 693 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 698 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         source.dest = 1;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2560,29 +2565,29 @@ yyreduce:
-     break;
-   case 52:
--#line 701 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 706 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
-     break;
-   case 53:
--#line 703 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 708 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
-     break;
-   case 54:
--#line 705 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 710 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; }
-     break;
-   case 55:
--#line 709 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 714 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.redirect) = (yyvsp[(1) - (1)].redirect);
-                       }
-     break;
-   case 56:
--#line 713 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 718 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         register REDIRECT *t;
-@@ -2594,27 +2599,27 @@ yyreduce:
-     break;
-   case 57:
--#line 724 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 729 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); }
-     break;
-   case 58:
--#line 726 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 731 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); }
-     break;
-   case 59:
--#line 730 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 735 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); }
-     break;
-   case 60:
--#line 732 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 737 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 61:
--#line 734 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 739 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         COMMAND *tc;
-@@ -2633,72 +2638,72 @@ yyreduce:
-     break;
-   case 62:
--#line 750 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 755 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 63:
--#line 752 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 757 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 64:
--#line 756 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 761 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 65:
--#line 758 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 763 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 66:
--#line 760 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 765 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
-     break;
-   case 67:
--#line 762 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 767 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
-     break;
-   case 68:
--#line 764 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 769 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 69:
--#line 766 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 771 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 70:
--#line 768 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 773 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 71:
--#line 770 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 775 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 72:
--#line 772 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 777 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 73:
--#line 774 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 779 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 74:
--#line 776 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 781 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 75:
--#line 780 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 785 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2706,7 +2711,7 @@ yyreduce:
-     break;
-   case 76:
--#line 785 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 790 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2714,7 +2719,7 @@ yyreduce:
-     break;
-   case 77:
--#line 790 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 795 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2722,7 +2727,7 @@ yyreduce:
-     break;
-   case 78:
--#line 795 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 800 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2730,7 +2735,7 @@ yyreduce:
-     break;
-   case 79:
--#line 800 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 805 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2738,7 +2743,7 @@ yyreduce:
-     break;
-   case 80:
--#line 805 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 810 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2746,7 +2751,7 @@ yyreduce:
-     break;
-   case 81:
--#line 810 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 815 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2754,7 +2759,7 @@ yyreduce:
-     break;
-   case 82:
--#line 815 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 820 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2762,7 +2767,7 @@ yyreduce:
-     break;
-   case 83:
--#line 822 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 827 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
-                                 if (word_top > 0) word_top--;
-@@ -2770,7 +2775,7 @@ yyreduce:
-     break;
-   case 84:
--#line 827 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 832 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
-                                 if (word_top > 0) word_top--;
-@@ -2778,7 +2783,7 @@ yyreduce:
-     break;
-   case 85:
--#line 832 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 837 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
-                                 if (word_top > 0) word_top--;
-@@ -2786,7 +2791,7 @@ yyreduce:
-     break;
-   case 86:
--#line 837 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 842 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
-                                 if (word_top > 0) word_top--;
-@@ -2794,7 +2799,7 @@ yyreduce:
-     break;
-   case 87:
--#line 844 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 849 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2802,7 +2807,7 @@ yyreduce:
-     break;
-   case 88:
--#line 849 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 854 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2810,7 +2815,7 @@ yyreduce:
-     break;
-   case 89:
--#line 854 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 859 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2818,7 +2823,7 @@ yyreduce:
-     break;
-   case 90:
--#line 859 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 864 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2826,7 +2831,7 @@ yyreduce:
-     break;
-   case 91:
--#line 864 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 869 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2834,7 +2839,7 @@ yyreduce:
-     break;
-   case 92:
--#line 869 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 874 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2842,7 +2847,7 @@ yyreduce:
-     break;
-   case 93:
--#line 876 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 881 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2850,7 +2855,7 @@ yyreduce:
-     break;
-   case 94:
--#line 881 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 886 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2858,7 +2863,7 @@ yyreduce:
-     break;
-   case 95:
--#line 886 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 891 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2866,27 +2871,27 @@ yyreduce:
-     break;
-   case 96:
--#line 893 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 898 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); }
-     break;
-   case 97:
--#line 896 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 901 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); }
-     break;
-   case 98:
--#line 899 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 904 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); }
-     break;
-   case 99:
--#line 903 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 908 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 100:
--#line 905 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 910 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         COMMAND *tc;
-@@ -2918,7 +2923,7 @@ yyreduce:
-     break;
-   case 101:
--#line 936 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 941 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command));
-                         (yyval.command)->flags |= CMD_WANT_SUBSHELL;
-@@ -2926,7 +2931,7 @@ yyreduce:
-     break;
-   case 102:
--#line 943 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 948 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command));
-                         (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL;
-@@ -2934,7 +2939,7 @@ yyreduce:
-     break;
-   case 103:
--#line 948 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 953 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         COMMAND *tc;
-@@ -2954,7 +2959,7 @@ yyreduce:
-     break;
-   case 104:
--#line 965 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 970 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command));
-                         (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL;
-@@ -2962,7 +2967,7 @@ yyreduce:
-     break;
-   case 105:
--#line 970 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 975 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         COMMAND *tc;
-@@ -2982,7 +2987,7 @@ yyreduce:
-     break;
-   case 106:
--#line 987 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 992 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command)));
-                         (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL;
-@@ -2990,117 +2995,117 @@ yyreduce:
-     break;
-   case 107:
--#line 994 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 999 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); }
-     break;
-   case 108:
--#line 996 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1001 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); }
-     break;
-   case 109:
--#line 998 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1003 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); }
-     break;
-   case 110:
--#line 1003 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1008 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); }
-     break;
-   case 111:
--#line 1007 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1012 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); }
-     break;
-   case 112:
--#line 1011 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1016 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(2) - (3)].command); }
-     break;
-   case 113:
--#line 1015 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1020 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); }
-     break;
-   case 114:
--#line 1017 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1022 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); }
-     break;
-   case 115:
--#line 1019 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1024 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); }
-     break;
-   case 117:
--#line 1024 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1029 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); }
-     break;
-   case 118:
--#line 1028 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1033 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); }
-     break;
-   case 119:
--#line 1030 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1035 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); }
-     break;
-   case 120:
--#line 1032 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1037 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); }
-     break;
-   case 121:
--#line 1034 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1039 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); }
-     break;
-   case 122:
--#line 1038 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1043 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
-     break;
-   case 123:
--#line 1040 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1045 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
-     break;
-   case 124:
--#line 1042 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1047 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
-     break;
-   case 125:
--#line 1044 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1049 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
-     break;
-   case 126:
--#line 1046 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1051 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
-     break;
-   case 127:
--#line 1048 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1053 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
-     break;
-   case 128:
--#line 1052 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1057 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
-     break;
-   case 129:
--#line 1054 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1059 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); }
-     break;
-   case 130:
--#line 1063 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1068 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = (yyvsp[(2) - (2)].command);
-                         if (need_here_doc)
-@@ -3109,14 +3114,14 @@ yyreduce:
-     break;
-   case 132:
--#line 1072 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1077 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = (yyvsp[(2) - (2)].command);
-                       }
-     break;
-   case 134:
--#line 1079 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1084 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         if ((yyvsp[(1) - (3)].command)->type == cm_connection)
-                           (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&');
-@@ -3126,17 +3131,17 @@ yyreduce:
-     break;
-   case 136:
--#line 1090 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1095 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
-     break;
-   case 137:
--#line 1092 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1097 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
-     break;
-   case 138:
--#line 1094 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1099 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         if ((yyvsp[(1) - (4)].command)->type == cm_connection)
-                           (yyval.command) = connect_async_list ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&');
-@@ -3146,37 +3151,37 @@ yyreduce:
-     break;
-   case 139:
--#line 1101 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1106 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
-     break;
-   case 140:
--#line 1103 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1108 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
-     break;
-   case 141:
--#line 1105 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1110 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 144:
--#line 1113 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1118 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.number) = '\n'; }
-     break;
-   case 145:
--#line 1115 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1120 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.number) = ';'; }
-     break;
-   case 146:
--#line 1117 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1122 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.number) = yacc_EOF; }
-     break;
-   case 149:
--#line 1131 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1136 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = (yyvsp[(1) - (1)].command);
-                         if (need_here_doc)
-@@ -3192,7 +3197,7 @@ yyreduce:
-     break;
-   case 150:
--#line 1144 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1149 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         if ((yyvsp[(1) - (2)].command)->type == cm_connection)
-                           (yyval.command) = connect_async_list ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&');
-@@ -3211,7 +3216,7 @@ yyreduce:
-     break;
-   case 151:
--#line 1160 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1165 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         (yyval.command) = (yyvsp[(1) - (2)].command);
-                         if (need_here_doc)
-@@ -3227,17 +3232,17 @@ yyreduce:
-     break;
-   case 152:
--#line 1175 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1180 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
-     break;
-   case 153:
--#line 1177 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1182 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
-     break;
-   case 154:
--#line 1179 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1184 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         if ((yyvsp[(1) - (3)].command)->type == cm_connection)
-                           (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&');
-@@ -3247,22 +3252,22 @@ yyreduce:
-     break;
-   case 155:
--#line 1186 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1191 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); }
-     break;
-   case 156:
--#line 1189 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1194 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 157:
--#line 1193 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1198 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 158:
--#line 1195 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1200 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         if ((yyvsp[(2) - (2)].command))
-                           (yyvsp[(2) - (2)].command)->flags ^= CMD_INVERT_RETURN;     /* toggle */
-@@ -3271,7 +3276,7 @@ yyreduce:
-     break;
-   case 159:
--#line 1201 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1206 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         if ((yyvsp[(2) - (2)].command))
-                           (yyvsp[(2) - (2)].command)->flags |= (yyvsp[(1) - (2)].number);
-@@ -3280,7 +3285,7 @@ yyreduce:
-     break;
-   case 160:
--#line 1207 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1212 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         ELEMENT x;
-@@ -3300,7 +3305,7 @@ yyreduce:
-     break;
-   case 161:
--#line 1224 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1229 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         ELEMENT x;
-@@ -3321,12 +3326,12 @@ yyreduce:
-     break;
-   case 162:
--#line 1244 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1249 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); }
-     break;
-   case 163:
--#line 1246 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1251 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     {
-                         /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */
-                         COMMAND *tc;
-@@ -3352,28 +3357,28 @@ yyreduce:
-     break;
-   case 164:
--#line 1269 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1274 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 165:
--#line 1273 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1278 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.number) = CMD_TIME_PIPELINE; }
-     break;
-   case 166:
--#line 1275 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1280 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
-     break;
-   case 167:
--#line 1277 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1282 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-     { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
-     break;
- /* Line 1267 of yacc.c.  */
--#line 3377 "y.tab.c"
-+#line 3382 "y.tab.c"
-       default: break;
-     }
-   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-@@ -3587,7 +3592,7 @@ yyreturn:
- }
--#line 1279 "/usr/homes/chet/src/bash/src/parse.y"
-+#line 1284 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
- /* Initial size to allocate for tokens, and the
-@@ -4948,6 +4953,21 @@ yylex ()
-    which allow ESAC to be the next one read. */
- static int esacs_needed_count;
-+static void
-+push_heredoc (r)
-+     REDIRECT *r;
-+{
-+  if (need_here_doc >= HEREDOC_MAX)
-+    {
-+      last_command_exit_value = EX_BADUSAGE;
-+      need_here_doc = 0;
-+      report_syntax_error (_("maximum here-document count exceeded"));
-+      reset_parser ();
-+      exit_shell (last_command_exit_value);
-+    }
-+  redir_stack[need_here_doc++] = r;
-+}
-+
- void
- gather_here_documents ()
- {
-@@ -8541,3 +8561,4 @@ set_line_mbstate ()
-     }
- }
- #endif /* HANDLE_MULTIBYTE */
-+
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 27
-+#define PATCHLEVEL 28
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/129-upstream-bash43-029.patch b/utils/bash/patches/129-upstream-bash43-029.patch
deleted file mode 100644 (file)
index be82403..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-029
-
-Bug-Reported-by:       Michal Zalewski <lcamtuf@coredump.cx>
-Bug-Reference-ID:
-Bug-Reference-URL:
-
-Bug-Description:
-
-When bash is parsing a function definition that contains a here-document
-delimited by end-of-file (or end-of-string), it leaves the closing delimiter
-uninitialized.  This can result in an invalid memory access when the parsed
-function is later copied.
-
-Patch (apply with `patch -p0'):
-
---- a/make_cmd.c
-+++ b/make_cmd.c
-@@ -692,6 +692,7 @@ make_redirection (source, instruction, d
-   /* First do the common cases. */
-   temp->redirector = source;
-   temp->redirectee = dest_and_filename;
-+  temp->here_doc_eof = 0;
-   temp->instruction = instruction;
-   temp->flags = 0;
-   temp->rflags = flags;
---- a/copy_cmd.c
-+++ b/copy_cmd.c
-@@ -126,7 +126,7 @@ copy_redirect (redirect)
-     {
-     case r_reading_until:
-     case r_deblank_reading_until:
--      new_redirect->here_doc_eof = savestring (redirect->here_doc_eof);
-+      new_redirect->here_doc_eof = redirect->here_doc_eof ? savestring (redirect->here_doc_eof) : 0;
-       /*FALLTHROUGH*/
-     case r_reading_string:
-     case r_appending_to:
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 28
-+#define PATCHLEVEL 29
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/130-upstream-bash43-030.patch b/utils/bash/patches/130-upstream-bash43-030.patch
deleted file mode 100644 (file)
index 0eadc5c..0000000
+++ /dev/null
@@ -1,1396 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-030
-
-Bug-Reported-by:       Michal Zalewski <lcamtuf@coredump.cx>
-Bug-Reference-ID:
-Bug-Reference-URL:
-
-Bug-Description:
-
-A combination of nested command substitutions and function importing from
-the environment can cause bash to execute code appearing in the environment
-variable value following the function definition.
-
-Patch (apply with `patch -p0'):
-
---- a/builtins/evalstring.c
-+++ b/builtins/evalstring.c
-@@ -308,12 +308,25 @@ parse_and_execute (string, from_file, fl
-           {
-             struct fd_bitmap *bitmap;
--            if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def)
-+            if (flags & SEVAL_FUNCDEF)
-               {
--                internal_warning ("%s: ignoring function definition attempt", from_file);
--                should_jump_to_top_level = 0;
--                last_result = last_command_exit_value = EX_BADUSAGE;
--                break;
-+                char *x;
-+
-+                /* If the command parses to something other than a straight
-+                   function definition, or if we have not consumed the entire
-+                   string, or if the parser has transformed the function
-+                   name (as parsing will if it begins or ends with shell
-+                   whitespace, for example), reject the attempt */
-+                if (command->type != cm_function_def ||
-+                    ((x = parser_remaining_input ()) && *x) ||
-+                    (STREQ (from_file, command->value.Function_def->name->word) == 0))
-+                  {
-+                    internal_warning (_("%s: ignoring function definition attempt"), from_file);
-+                    should_jump_to_top_level = 0;
-+                    last_result = last_command_exit_value = EX_BADUSAGE;
-+                    reset_parser ();
-+                    break;
-+                  }
-               }
-             bitmap = new_fd_bitmap (FD_BITMAP_SIZE);
-@@ -378,7 +391,10 @@ parse_and_execute (string, from_file, fl
-             discard_unwind_frame ("pe_dispose");
-             if (flags & SEVAL_ONECMD)
--              break;
-+              {
-+                reset_parser ();
-+                break;
-+              }
-           }
-       }
-       else
---- a/parse.y
-+++ b/parse.y
-@@ -2538,6 +2538,16 @@ shell_ungetc (c)
-     eol_ungetc_lookahead = c;
- }
-+char *
-+parser_remaining_input ()
-+{
-+  if (shell_input_line == 0)
-+    return 0;
-+  if (shell_input_line_index < 0 || shell_input_line_index >= shell_input_line_len)
-+    return '\0';      /* XXX */
-+  return (shell_input_line + shell_input_line_index);
-+}
-+
- #ifdef INCLUDE_UNUSED
- /* Back the input pointer up by one, effectively `ungetting' a character. */
- static void
-@@ -4027,8 +4037,8 @@ xparse_dolparen (base, string, indp, fla
-   reset_parser ();
-   /* reset_parser clears shell_input_line and associated variables */
-   restore_input_line_state (&ls);
--  if (interactive)
--    token_to_read = 0;
-+
-+  token_to_read = 0;
-   /* Need to find how many characters parse_and_execute consumed, update
-      *indp, if flags != 0, copy the portion of the string parsed into RET
---- a/shell.h
-+++ b/shell.h
-@@ -180,6 +180,8 @@ typedef struct _sh_input_line_state_t {
- } sh_input_line_state_t;
- /* Let's try declaring these here. */
-+extern char *parser_remaining_input __P((void));
-+
- extern sh_parser_state_t *save_parser_state __P((sh_parser_state_t *));
- extern void restore_parser_state __P((sh_parser_state_t *));
---- a/y.tab.c
-+++ b/y.tab.c
-@@ -168,7 +168,7 @@
- /* Copy the first part of user declarations.  */
--#line 21 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 21 "/usr/src/local/bash/bash-4.3-patched/parse.y"
- #include "config.h"
-@@ -497,7 +497,7 @@ static REDIRECTEE redir;
- #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
- typedef union YYSTYPE
--#line 329 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 329 "/usr/src/local/bash/bash-4.3-patched/parse.y"
- {
-   WORD_DESC *word;            /* the word that we read. */
-   int number;                 /* the number that we read. */
-@@ -2098,7 +2098,7 @@ yyreduce:
-   switch (yyn)
-     {
-         case 2:
--#line 383 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 383 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         /* Case of regular command.  Discard the error
-                            safety net,and return the command just parsed. */
-@@ -2112,7 +2112,7 @@ yyreduce:
-     break;
-   case 3:
--#line 394 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 394 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         /* Case of regular command, but not a very
-                            interesting one.  Return a NULL command. */
-@@ -2124,7 +2124,7 @@ yyreduce:
-     break;
-   case 4:
--#line 403 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 403 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         /* Error during parsing.  Return NULL command. */
-                         global_command = (COMMAND *)NULL;
-@@ -2142,7 +2142,7 @@ yyreduce:
-     break;
-   case 5:
--#line 418 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 418 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         /* Case of EOF seen by itself.  Do ignoreeof or
-                            not. */
-@@ -2153,17 +2153,17 @@ yyreduce:
-     break;
-   case 6:
--#line 428 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 428 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
-     break;
-   case 7:
--#line 430 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 430 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); }
-     break;
-   case 8:
--#line 434 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 434 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 1;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2172,7 +2172,7 @@ yyreduce:
-     break;
-   case 9:
--#line 440 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 440 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 0;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2181,7 +2181,7 @@ yyreduce:
-     break;
-   case 10:
--#line 446 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 446 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2190,7 +2190,7 @@ yyreduce:
-     break;
-   case 11:
--#line 452 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 452 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2199,7 +2199,7 @@ yyreduce:
-     break;
-   case 12:
--#line 458 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 458 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2208,7 +2208,7 @@ yyreduce:
-     break;
-   case 13:
--#line 464 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 464 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2217,7 +2217,7 @@ yyreduce:
-     break;
-   case 14:
--#line 470 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 470 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 1;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2226,7 +2226,7 @@ yyreduce:
-     break;
-   case 15:
--#line 476 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 476 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2235,7 +2235,7 @@ yyreduce:
-     break;
-   case 16:
--#line 482 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 482 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2244,7 +2244,7 @@ yyreduce:
-     break;
-   case 17:
--#line 488 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 488 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 1;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2253,7 +2253,7 @@ yyreduce:
-     break;
-   case 18:
--#line 494 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 494 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2262,7 +2262,7 @@ yyreduce:
-     break;
-   case 19:
--#line 500 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 500 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2271,7 +2271,7 @@ yyreduce:
-     break;
-   case 20:
--#line 506 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 506 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 0;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2280,7 +2280,7 @@ yyreduce:
-     break;
-   case 21:
--#line 512 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 512 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2289,7 +2289,7 @@ yyreduce:
-     break;
-   case 22:
--#line 518 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 518 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2298,7 +2298,7 @@ yyreduce:
-     break;
-   case 23:
--#line 524 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 524 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 0;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2308,7 +2308,7 @@ yyreduce:
-     break;
-   case 24:
--#line 531 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 531 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2318,7 +2318,7 @@ yyreduce:
-     break;
-   case 25:
--#line 538 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 538 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2328,7 +2328,7 @@ yyreduce:
-     break;
-   case 26:
--#line 545 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 545 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 0;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2338,7 +2338,7 @@ yyreduce:
-     break;
-   case 27:
--#line 552 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 552 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2348,7 +2348,7 @@ yyreduce:
-     break;
-   case 28:
--#line 559 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 559 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2358,7 +2358,7 @@ yyreduce:
-     break;
-   case 29:
--#line 566 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 566 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 0;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2367,7 +2367,7 @@ yyreduce:
-     break;
-   case 30:
--#line 572 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 572 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2376,7 +2376,7 @@ yyreduce:
-     break;
-   case 31:
--#line 578 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 578 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2385,7 +2385,7 @@ yyreduce:
-     break;
-   case 32:
--#line 584 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 584 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 0;
-                         redir.dest = (yyvsp[(2) - (2)].number);
-@@ -2394,7 +2394,7 @@ yyreduce:
-     break;
-   case 33:
--#line 590 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 590 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.dest = (yyvsp[(3) - (3)].number);
-@@ -2403,7 +2403,7 @@ yyreduce:
-     break;
-   case 34:
--#line 596 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 596 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.dest = (yyvsp[(3) - (3)].number);
-@@ -2412,7 +2412,7 @@ yyreduce:
-     break;
-   case 35:
--#line 602 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 602 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 1;
-                         redir.dest = (yyvsp[(2) - (2)].number);
-@@ -2421,7 +2421,7 @@ yyreduce:
-     break;
-   case 36:
--#line 608 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 608 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.dest = (yyvsp[(3) - (3)].number);
-@@ -2430,7 +2430,7 @@ yyreduce:
-     break;
-   case 37:
--#line 614 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 614 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.dest = (yyvsp[(3) - (3)].number);
-@@ -2439,7 +2439,7 @@ yyreduce:
-     break;
-   case 38:
--#line 620 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 620 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 0;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2448,7 +2448,7 @@ yyreduce:
-     break;
-   case 39:
--#line 626 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 626 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2457,7 +2457,7 @@ yyreduce:
-     break;
-   case 40:
--#line 632 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 632 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2466,7 +2466,7 @@ yyreduce:
-     break;
-   case 41:
--#line 638 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 638 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 1;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2475,7 +2475,7 @@ yyreduce:
-     break;
-   case 42:
--#line 644 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 644 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2484,7 +2484,7 @@ yyreduce:
-     break;
-   case 43:
--#line 650 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 650 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.filename = (yyvsp[(3) - (3)].word);
-@@ -2493,7 +2493,7 @@ yyreduce:
-     break;
-   case 44:
--#line 656 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 656 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 1;
-                         redir.dest = 0;
-@@ -2502,7 +2502,7 @@ yyreduce:
-     break;
-   case 45:
--#line 662 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 662 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.dest = 0;
-@@ -2511,7 +2511,7 @@ yyreduce:
-     break;
-   case 46:
--#line 668 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 668 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.dest = 0;
-@@ -2520,7 +2520,7 @@ yyreduce:
-     break;
-   case 47:
--#line 674 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 674 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 0;
-                         redir.dest = 0;
-@@ -2529,7 +2529,7 @@ yyreduce:
-     break;
-   case 48:
--#line 680 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 680 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = (yyvsp[(1) - (3)].number);
-                         redir.dest = 0;
-@@ -2538,7 +2538,7 @@ yyreduce:
-     break;
-   case 49:
--#line 686 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 686 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.filename = (yyvsp[(1) - (3)].word);
-                         redir.dest = 0;
-@@ -2547,7 +2547,7 @@ yyreduce:
-     break;
-   case 50:
--#line 692 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 692 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 1;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2556,7 +2556,7 @@ yyreduce:
-     break;
-   case 51:
--#line 698 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 698 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         source.dest = 1;
-                         redir.filename = (yyvsp[(2) - (2)].word);
-@@ -2565,29 +2565,29 @@ yyreduce:
-     break;
-   case 52:
--#line 706 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 706 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
-     break;
-   case 53:
--#line 708 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 708 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
-     break;
-   case 54:
--#line 710 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 710 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; }
-     break;
-   case 55:
--#line 714 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 714 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.redirect) = (yyvsp[(1) - (1)].redirect);
-                       }
-     break;
-   case 56:
--#line 718 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 718 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         register REDIRECT *t;
-@@ -2599,27 +2599,27 @@ yyreduce:
-     break;
-   case 57:
--#line 729 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 729 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); }
-     break;
-   case 58:
--#line 731 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 731 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); }
-     break;
-   case 59:
--#line 735 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 735 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); }
-     break;
-   case 60:
--#line 737 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 737 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 61:
--#line 739 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 739 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         COMMAND *tc;
-@@ -2638,72 +2638,72 @@ yyreduce:
-     break;
-   case 62:
--#line 755 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 755 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 63:
--#line 757 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 757 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 64:
--#line 761 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 761 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 65:
--#line 763 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 763 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 66:
--#line 765 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 765 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
-     break;
-   case 67:
--#line 767 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 767 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
-     break;
-   case 68:
--#line 769 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 769 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 69:
--#line 771 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 771 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 70:
--#line 773 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 773 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 71:
--#line 775 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 775 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 72:
--#line 777 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 777 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 73:
--#line 779 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 779 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 74:
--#line 781 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 781 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 75:
--#line 785 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 785 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2711,7 +2711,7 @@ yyreduce:
-     break;
-   case 76:
--#line 790 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 790 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2719,7 +2719,7 @@ yyreduce:
-     break;
-   case 77:
--#line 795 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 795 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2727,7 +2727,7 @@ yyreduce:
-     break;
-   case 78:
--#line 800 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 800 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2735,7 +2735,7 @@ yyreduce:
-     break;
-   case 79:
--#line 805 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 805 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2743,7 +2743,7 @@ yyreduce:
-     break;
-   case 80:
--#line 810 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 810 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2751,7 +2751,7 @@ yyreduce:
-     break;
-   case 81:
--#line 815 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 815 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2759,7 +2759,7 @@ yyreduce:
-     break;
-   case 82:
--#line 820 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 820 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2767,7 +2767,7 @@ yyreduce:
-     break;
-   case 83:
--#line 827 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 827 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
-                                 if (word_top > 0) word_top--;
-@@ -2775,7 +2775,7 @@ yyreduce:
-     break;
-   case 84:
--#line 832 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 832 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
-                                 if (word_top > 0) word_top--;
-@@ -2783,7 +2783,7 @@ yyreduce:
-     break;
-   case 85:
--#line 837 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 837 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
-                                 if (word_top > 0) word_top--;
-@@ -2791,7 +2791,7 @@ yyreduce:
-     break;
-   case 86:
--#line 842 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 842 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
-                                 if (word_top > 0) word_top--;
-@@ -2799,7 +2799,7 @@ yyreduce:
-     break;
-   case 87:
--#line 849 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 849 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2807,7 +2807,7 @@ yyreduce:
-     break;
-   case 88:
--#line 854 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 854 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2815,7 +2815,7 @@ yyreduce:
-     break;
-   case 89:
--#line 859 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 859 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2823,7 +2823,7 @@ yyreduce:
-     break;
-   case 90:
--#line 864 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 864 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2831,7 +2831,7 @@ yyreduce:
-     break;
-   case 91:
--#line 869 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 869 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2839,7 +2839,7 @@ yyreduce:
-     break;
-   case 92:
--#line 874 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 874 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2847,7 +2847,7 @@ yyreduce:
-     break;
-   case 93:
--#line 881 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 881 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2855,7 +2855,7 @@ yyreduce:
-     break;
-   case 94:
--#line 886 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 886 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2863,7 +2863,7 @@ yyreduce:
-     break;
-   case 95:
--#line 891 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 891 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]);
-                         if (word_top > 0) word_top--;
-@@ -2871,27 +2871,27 @@ yyreduce:
-     break;
-   case 96:
--#line 898 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 898 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); }
-     break;
-   case 97:
--#line 901 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 901 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); }
-     break;
-   case 98:
--#line 904 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 904 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); }
-     break;
-   case 99:
--#line 908 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 908 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 100:
--#line 910 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 910 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         COMMAND *tc;
-@@ -2923,7 +2923,7 @@ yyreduce:
-     break;
-   case 101:
--#line 941 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 941 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command));
-                         (yyval.command)->flags |= CMD_WANT_SUBSHELL;
-@@ -2931,7 +2931,7 @@ yyreduce:
-     break;
-   case 102:
--#line 948 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 948 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command));
-                         (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL;
-@@ -2939,7 +2939,7 @@ yyreduce:
-     break;
-   case 103:
--#line 953 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 953 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         COMMAND *tc;
-@@ -2959,7 +2959,7 @@ yyreduce:
-     break;
-   case 104:
--#line 970 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 970 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command));
-                         (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL;
-@@ -2967,7 +2967,7 @@ yyreduce:
-     break;
-   case 105:
--#line 975 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 975 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         COMMAND *tc;
-@@ -2987,7 +2987,7 @@ yyreduce:
-     break;
-   case 106:
--#line 992 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 992 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command)));
-                         (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL;
-@@ -2995,117 +2995,117 @@ yyreduce:
-     break;
-   case 107:
--#line 999 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 999 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); }
-     break;
-   case 108:
--#line 1001 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1001 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); }
-     break;
-   case 109:
--#line 1003 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1003 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); }
-     break;
-   case 110:
--#line 1008 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1008 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); }
-     break;
-   case 111:
--#line 1012 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1012 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); }
-     break;
-   case 112:
--#line 1016 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1016 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(2) - (3)].command); }
-     break;
-   case 113:
--#line 1020 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1020 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); }
-     break;
-   case 114:
--#line 1022 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1022 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); }
-     break;
-   case 115:
--#line 1024 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1024 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); }
-     break;
-   case 117:
--#line 1029 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1029 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); }
-     break;
-   case 118:
--#line 1033 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1033 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); }
-     break;
-   case 119:
--#line 1035 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1035 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); }
-     break;
-   case 120:
--#line 1037 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1037 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); }
-     break;
-   case 121:
--#line 1039 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1039 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); }
-     break;
-   case 122:
--#line 1043 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1043 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
-     break;
-   case 123:
--#line 1045 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1045 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
-     break;
-   case 124:
--#line 1047 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1047 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
-     break;
-   case 125:
--#line 1049 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1049 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
-     break;
-   case 126:
--#line 1051 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1051 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
-     break;
-   case 127:
--#line 1053 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1053 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
-     break;
-   case 128:
--#line 1057 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1057 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
-     break;
-   case 129:
--#line 1059 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1059 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); }
-     break;
-   case 130:
--#line 1068 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1068 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = (yyvsp[(2) - (2)].command);
-                         if (need_here_doc)
-@@ -3114,14 +3114,14 @@ yyreduce:
-     break;
-   case 132:
--#line 1077 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1077 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = (yyvsp[(2) - (2)].command);
-                       }
-     break;
-   case 134:
--#line 1084 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1084 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         if ((yyvsp[(1) - (3)].command)->type == cm_connection)
-                           (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&');
-@@ -3131,17 +3131,17 @@ yyreduce:
-     break;
-   case 136:
--#line 1095 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1095 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
-     break;
-   case 137:
--#line 1097 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1097 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
-     break;
-   case 138:
--#line 1099 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1099 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         if ((yyvsp[(1) - (4)].command)->type == cm_connection)
-                           (yyval.command) = connect_async_list ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&');
-@@ -3151,37 +3151,37 @@ yyreduce:
-     break;
-   case 139:
--#line 1106 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1106 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
-     break;
-   case 140:
--#line 1108 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1108 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
-     break;
-   case 141:
--#line 1110 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1110 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 144:
--#line 1118 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1118 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.number) = '\n'; }
-     break;
-   case 145:
--#line 1120 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1120 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.number) = ';'; }
-     break;
-   case 146:
--#line 1122 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1122 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.number) = yacc_EOF; }
-     break;
-   case 149:
--#line 1136 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1136 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = (yyvsp[(1) - (1)].command);
-                         if (need_here_doc)
-@@ -3197,7 +3197,7 @@ yyreduce:
-     break;
-   case 150:
--#line 1149 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1149 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         if ((yyvsp[(1) - (2)].command)->type == cm_connection)
-                           (yyval.command) = connect_async_list ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&');
-@@ -3216,7 +3216,7 @@ yyreduce:
-     break;
-   case 151:
--#line 1165 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1165 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         (yyval.command) = (yyvsp[(1) - (2)].command);
-                         if (need_here_doc)
-@@ -3232,17 +3232,17 @@ yyreduce:
-     break;
-   case 152:
--#line 1180 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1180 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
-     break;
-   case 153:
--#line 1182 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1182 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
-     break;
-   case 154:
--#line 1184 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1184 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         if ((yyvsp[(1) - (3)].command)->type == cm_connection)
-                           (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&');
-@@ -3252,22 +3252,22 @@ yyreduce:
-     break;
-   case 155:
--#line 1191 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1191 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); }
-     break;
-   case 156:
--#line 1194 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1194 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 157:
--#line 1198 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1198 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 158:
--#line 1200 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1200 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         if ((yyvsp[(2) - (2)].command))
-                           (yyvsp[(2) - (2)].command)->flags ^= CMD_INVERT_RETURN;     /* toggle */
-@@ -3276,7 +3276,7 @@ yyreduce:
-     break;
-   case 159:
--#line 1206 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1206 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         if ((yyvsp[(2) - (2)].command))
-                           (yyvsp[(2) - (2)].command)->flags |= (yyvsp[(1) - (2)].number);
-@@ -3285,7 +3285,7 @@ yyreduce:
-     break;
-   case 160:
--#line 1212 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1212 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         ELEMENT x;
-@@ -3305,7 +3305,7 @@ yyreduce:
-     break;
-   case 161:
--#line 1229 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1229 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         ELEMENT x;
-@@ -3326,12 +3326,12 @@ yyreduce:
-     break;
-   case 162:
--#line 1249 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1249 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); }
-     break;
-   case 163:
--#line 1251 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1251 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     {
-                         /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */
-                         COMMAND *tc;
-@@ -3357,22 +3357,22 @@ yyreduce:
-     break;
-   case 164:
--#line 1274 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1274 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.command) = (yyvsp[(1) - (1)].command); }
-     break;
-   case 165:
--#line 1278 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1278 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.number) = CMD_TIME_PIPELINE; }
-     break;
-   case 166:
--#line 1280 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1280 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
-     break;
-   case 167:
--#line 1282 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1282 "/usr/src/local/bash/bash-4.3-patched/parse.y"
-     { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
-     break;
-@@ -3592,7 +3592,7 @@ yyreturn:
- }
--#line 1284 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
-+#line 1284 "/usr/src/local/bash/bash-4.3-patched/parse.y"
- /* Initial size to allocate for tokens, and the
-@@ -4850,6 +4850,16 @@ shell_ungetc (c)
-     eol_ungetc_lookahead = c;
- }
-+char *
-+parser_remaining_input ()
-+{
-+  if (shell_input_line == 0)
-+    return 0;
-+  if (shell_input_line_index < 0 || shell_input_line_index >= shell_input_line_len)
-+    return '\0';      /* XXX */
-+  return (shell_input_line + shell_input_line_index);
-+}
-+
- #ifdef INCLUDE_UNUSED
- /* Back the input pointer up by one, effectively `ungetting' a character. */
- static void
-@@ -6339,8 +6349,8 @@ xparse_dolparen (base, string, indp, fla
-   reset_parser ();
-   /* reset_parser clears shell_input_line and associated variables */
-   restore_input_line_state (&ls);
--  if (interactive)
--    token_to_read = 0;
-+
-+  token_to_read = 0;
-   /* Need to find how many characters parse_and_execute consumed, update
-      *indp, if flags != 0, copy the portion of the string parsed into RET
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 29
-+#define PATCHLEVEL 30
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/131-upstream-bash43-031.patch b/utils/bash/patches/131-upstream-bash43-031.patch
deleted file mode 100644 (file)
index a22cb07..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-031
-
-Bug-Reported-by:       lolilolicon <lolilolicon@gmail.com>
-Bug-Reference-ID:      <CAMtVo_Nz=32Oq=zWTb6=+8gUNXOo2rRvud1W4oPnA-cgVk_ZqQ@mail.gmail.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-08/msg00139.html
-
-Bug-Description:
-
-The new nameref assignment functionality introduced in bash-4.3 did not perform
-enough validation on the variable value and would create variables with
-invalid names.
-
-Patch (apply with `patch -p0'):
-
---- a/subst.h
-+++ b/subst.h
-@@ -47,6 +47,7 @@
- #define ASS_MKASSOC   0x0004
- #define ASS_MKGLOBAL  0x0008  /* force global assignment */
- #define ASS_NAMEREF   0x0010  /* assigning to nameref variable */
-+#define ASS_FROMREF   0x0020  /* assigning from value of nameref variable */
- /* Flags for the string extraction functions. */
- #define SX_NOALLOC    0x0001  /* just skip; don't return substring */
---- a/variables.c
-+++ b/variables.c
-@@ -2516,10 +2516,27 @@ bind_variable_internal (name, value, tab
-      HASH_TABLE *table;
-      int hflags, aflags;
- {
--  char *newval;
-+  char *newname, *newval;
-   SHELL_VAR *entry;
-+#if defined (ARRAY_VARS)
-+  arrayind_t ind;
-+  char *subp;
-+  int sublen;
-+#endif
-+  newname = 0;
-+#if defined (ARRAY_VARS)
-+  if ((aflags & ASS_FROMREF) && (hflags & HASH_NOSRCH) == 0 && valid_array_reference (name))
-+    {
-+      newname = array_variable_name (name, &subp, &sublen);
-+      if (newname == 0)
-+      return (SHELL_VAR *)NULL;       /* XXX */
-+      entry = hash_lookup (newname, table);
-+    }
-+  else
-+#endif
-   entry = (hflags & HASH_NOSRCH) ? (SHELL_VAR *)NULL : hash_lookup (name, table);
-+
-   /* Follow the nameref chain here if this is the global variables table */
-   if (entry && nameref_p (entry) && (invisible_p (entry) == 0) && table == global_variables->table)
-     {
-@@ -2550,6 +2567,16 @@ bind_variable_internal (name, value, tab
-       var_setvalue (entry, make_variable_value (entry, value, 0));
-       }
-     }
-+#if defined (ARRAY_VARS)
-+  else if (entry == 0 && newname)
-+    {
-+      entry = make_new_array_variable (newname);      /* indexed array by default */
-+      if (entry == 0)
-+      return entry;
-+      ind = array_expand_index (name, subp, sublen);
-+      bind_array_element (entry, ind, value, aflags);
-+    }
-+#endif
-   else if (entry == 0)
-     {
-       entry = make_new_variable (name, table);
-@@ -2670,7 +2697,8 @@ bind_variable (name, value, flags)
-                        normal. */
-                     if (nameref_cell (nv) == 0)
-                       return (bind_variable_internal (nv->name, value, nvc->table, 0, flags));
--                    return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags));
-+                    /* XXX - bug here with ref=array[index] */
-+                    return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags|ASS_FROMREF));
-                   }
-                 else
-                   v = nv;
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 30
-+#define PATCHLEVEL 31
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/132-upstream-bash43-032.patch b/utils/bash/patches/132-upstream-bash43-032.patch
deleted file mode 100644 (file)
index 96a86c9..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-032
-
-Bug-Reported-by:       crispusfairbairn@gmail.com
-Bug-Reference-ID:      <b5e499f7-3b98-408d-9f94-c0387580e73a@googlegroups.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-09/msg00013.html
-
-Bug-Description:
-
-When bash is running in Posix mode, it allows signals -- including SIGCHLD --
-to interrupt the `wait' builtin, as Posix requires.  However, the interrupt
-causes bash to not run a SIGCHLD trap for all exited children.  This patch
-fixes the issue and restores the documented behavior in Posix mode.
-
-Patch (apply with `patch -p0'):
-
---- a/jobs.c
-+++ b/jobs.c
-@@ -3339,7 +3339,9 @@ itrace("waitchld: waitpid returns %d blo
-       if (posixly_correct && this_shell_builtin && this_shell_builtin == wait_builtin)
-       {
-         interrupt_immediately = 0;
--        trap_handler (SIGCHLD);       /* set pending_traps[SIGCHLD] */
-+        /* This was trap_handler (SIGCHLD) but that can lose traps if
-+           children_exited > 1 */
-+        queue_sigchld_trap (children_exited);
-         wait_signal_received = SIGCHLD;
-         /* If we're in a signal handler, let CHECK_WAIT_INTR pick it up;
-            run_pending_traps will call run_sigchld_trap later  */
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 31
-+#define PATCHLEVEL 32
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/133-upstream-bash43-033.patch b/utils/bash/patches/133-upstream-bash43-033.patch
deleted file mode 100644 (file)
index 6210b5e..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-033
-
-Bug-Reported-by:       mickael9@gmail.com, Jan Rome <jan.rome@gmail.com>
-Bug-Reference-ID:      <20140907224046.382ED3610CC@mickael-laptop.localdomain>,
-                       <540D661D.50908@gmail.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-09/msg00029.html
-                       http://lists.gnu.org/archive/html/bug-bash/2014-09/msg00030.html
-
-Bug-Description:
-
-Bash does not clean up the terminal state in all cases where bash or
-readline  modifies it and bash is subsequently terminated by a fatal signal.
-This happens when the `read' builtin modifies the terminal settings, both
-when readline is active and when it is not.  It occurs most often when a script
-installs a trap that exits on a signal without re-sending the signal to itself.
-
-Patch (apply with `patch -p0'):
-
---- a/shell.c
-+++ b/shell.c
-@@ -73,6 +73,7 @@
- #endif
- #if defined (READLINE)
-+#  include <readline/readline.h>
- #  include "bashline.h"
- #endif
-@@ -909,6 +910,14 @@ exit_shell (s)
-   fflush (stdout);            /* XXX */
-   fflush (stderr);
-+  /* Clean up the terminal if we are in a state where it's been modified. */
-+#if defined (READLINE)
-+  if (RL_ISSTATE (RL_STATE_TERMPREPPED) && rl_deprep_term_function)
-+    (*rl_deprep_term_function) ();
-+#endif
-+  if (read_tty_modified ())
-+    read_tty_cleanup ();
-+
-   /* Do trap[0] if defined.  Allow it to override the exit status
-      passed to us. */
-   if (signal_is_trapped (0))
---- a/builtins/read.def
-+++ b/builtins/read.def
-@@ -140,10 +140,12 @@ static void reset_alarm __P((void));
- procenv_t alrmbuf;
- int sigalrm_seen;
--static int reading;
-+static int reading, tty_modified;
- static SigHandler *old_alrm;
- static unsigned char delim;
-+static struct ttsave termsave;
-+
- /* In all cases, SIGALRM just sets a flag that we check periodically.  This
-    avoids problems with the semi-tricky stuff we do with the xfree of
-    input_string at the top of the unwind-protect list (see below). */
-@@ -188,7 +190,6 @@ read_builtin (list)
-   struct stat tsb;
-   SHELL_VAR *var;
-   TTYSTRUCT ttattrs, ttset;
--  struct ttsave termsave;
- #if defined (ARRAY_VARS)
-   WORD_LIST *alist;
- #endif
-@@ -221,7 +222,7 @@ read_builtin (list)
-   USE_VAR(ps2);
-   USE_VAR(lastsig);
--  sigalrm_seen = reading = 0;
-+  sigalrm_seen = reading = tty_modified = 0;
-   i = 0;              /* Index into the string that we are reading. */
-   raw = edit = 0;     /* Not reading raw input by default. */
-@@ -438,6 +439,8 @@ read_builtin (list)
-         retval = 128+SIGALRM;
-         goto assign_vars;
-       }
-+      if (interactive_shell == 0)
-+      initialize_terminating_signals ();
-       old_alrm = set_signal_handler (SIGALRM, sigalrm);
-       add_unwind_protect (reset_alarm, (char *)NULL);
- #if defined (READLINE)
-@@ -482,7 +485,10 @@ read_builtin (list)
-         i = silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset);
-         if (i < 0)
-           sh_ttyerror (1);
-+        tty_modified = 1;
-         add_unwind_protect ((Function *)ttyrestore, (char *)&termsave);
-+        if (interactive_shell == 0)
-+          initialize_terminating_signals ();
-       }
-     }
-   else if (silent)    /* turn off echo but leave term in canonical mode */
-@@ -497,7 +503,10 @@ read_builtin (list)
-       if (i < 0)
-       sh_ttyerror (1);
-+      tty_modified = 1;
-       add_unwind_protect ((Function *)ttyrestore, (char *)&termsave);
-+      if (interactive_shell == 0)
-+      initialize_terminating_signals ();
-     }
-   /* This *must* be the top unwind-protect on the stack, so the manipulation
-@@ -588,6 +597,8 @@ read_builtin (list)
-           }
-         else
-           lastsig = 0;
-+        if (terminating_signal && tty_modified)
-+          ttyrestore (&termsave);     /* fix terminal before exiting */
-         CHECK_TERMSIG;
-         eof = 1;
-         break;
-@@ -978,6 +989,20 @@ ttyrestore (ttp)
-      struct ttsave *ttp;
- {
-   ttsetattr (ttp->fd, ttp->attrs);
-+  tty_modified = 0;
-+}
-+
-+void
-+read_tty_cleanup ()
-+{
-+  if (tty_modified)
-+    ttyrestore (&termsave);
-+}
-+
-+int
-+read_tty_modified ()
-+{
-+  return (tty_modified);
- }
- #if defined (READLINE)
---- a/builtins/common.h
-+++ b/builtins/common.h
-@@ -122,6 +122,10 @@ extern void bash_logout __P((void));
- /* Functions from getopts.def */
- extern void getopts_reset __P((int));
-+/* Functions from read.def */
-+extern void read_tty_cleanup __P((void));
-+extern int read_tty_modified __P((void));
-+
- /* Functions from set.def */
- extern int minus_o_option_value __P((char *));
- extern void list_minus_o_opts __P((int, int));
---- a/bashline.c
-+++ b/bashline.c
-@@ -202,6 +202,7 @@ extern int current_command_line_count, s
- extern int last_command_exit_value;
- extern int array_needs_making;
- extern int posixly_correct, no_symbolic_links;
-+extern int sigalrm_seen;
- extern char *current_prompt_string, *ps1_prompt;
- extern STRING_INT_ALIST word_token_alist[];
- extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin;
-@@ -4208,8 +4209,9 @@ bash_event_hook ()
- {
-   /* If we're going to longjmp to top_level, make sure we clean up readline.
-      check_signals will call QUIT, which will eventually longjmp to top_level,
--     calling run_interrupt_trap along the way. */
--  if (interrupt_state)
-+     calling run_interrupt_trap along the way.  The check for sigalrm_seen is
-+     to clean up the read builtin's state. */
-+  if (terminating_signal || interrupt_state || sigalrm_seen)
-     rl_cleanup_after_signal ();
-   bashline_reset_event_hook ();
-   check_signals_and_traps (); /* XXX */
---- a/sig.c
-+++ b/sig.c
-@@ -532,8 +532,10 @@ termsig_sighandler (sig)
- #if defined (READLINE)
-   /* Set the event hook so readline will call it after the signal handlers
-      finish executing, so if this interrupted character input we can get
--     quick response. */
--  if (interactive_shell && interactive && no_line_editing == 0)
-+     quick response.  If readline is active or has modified the terminal we
-+     need to set this no matter what the signal is, though the check for
-+     RL_STATE_TERMPREPPED is possibly redundant. */
-+  if (RL_ISSTATE (RL_STATE_SIGHANDLER) || RL_ISSTATE (RL_STATE_TERMPREPPED))
-     bashline_set_event_hook ();
- #endif
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 32
-+#define PATCHLEVEL 33
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/134-upstream-bash43-034.patch b/utils/bash/patches/134-upstream-bash43-034.patch
deleted file mode 100644 (file)
index d3c4f8f..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-034
-
-Bug-Reported-by:       Dreamcat4 <dreamcat4@gmail.com>
-Bug-Reference-ID:      <CAN39uTpAEs2GFu4ebC_SfSVMRTh-DJ9YanrY4BZZ3OO+CCHjng@mail.gmail.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2015-05/msg00001.html
-
-Bug-Description:
-
-If neither the -f nor -v options is supplied to unset, and a name argument is
-found to be a function and unset, subsequent name arguments are not treated as
-variables before attempting to unset a function by that name.
-
-Patch (apply with `patch -p0'):
-
---- a/builtins/set.def
-+++ b/builtins/set.def
-@@ -751,9 +751,11 @@ unset_builtin (list)
-   WORD_LIST *list;
- {
-   int unset_function, unset_variable, unset_array, opt, nameref, any_failed;
-+  int global_unset_func, global_unset_var;
-   char *name;
-   unset_function = unset_variable = unset_array = nameref = any_failed = 0;
-+  global_unset_func = global_unset_var = 0;
-   reset_internal_getopt ();
-   while ((opt = internal_getopt (list, "fnv")) != -1)
-@@ -761,10 +763,10 @@ unset_builtin (list)
-       switch (opt)
-       {
-       case 'f':
--        unset_function = 1;
-+        global_unset_func = 1;
-         break;
-       case 'v':
--        unset_variable = 1;
-+        global_unset_var = 1;
-         break;
-       case 'n':
-         nameref = 1;
-@@ -777,7 +779,7 @@ unset_builtin (list)
-   list = loptend;
--  if (unset_function && unset_variable)
-+  if (global_unset_func && global_unset_var)
-     {
-       builtin_error (_("cannot simultaneously unset a function and a variable"));
-       return (EXECUTION_FAILURE);
-@@ -795,6 +797,9 @@ unset_builtin (list)
-       name = list->word->word;
-+      unset_function = global_unset_func;
-+      unset_variable = global_unset_var;
-+
- #if defined (ARRAY_VARS)
-       unset_array = 0;
-       if (!unset_function && valid_array_reference (name))
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 33
-+#define PATCHLEVEL 34
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/135-upstream-bash43-035.patch b/utils/bash/patches/135-upstream-bash43-035.patch
deleted file mode 100644 (file)
index 4e614ce..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-035
-
-Bug-Reported-by:       <romerox.adrian@gmail.com>
-Bug-Reference-ID:      <CABV5r3zhPXmSKUe9uedeGc5YFBM2njJ1iVmY2h5neWdQpDBQug@mail.gmail.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-08/msg00045.html
-
-Bug-Description:
-
-A locale with a long name can trigger a buffer overflow and core dump.  This
-applies on systems that do not have locale_charset in libc, are not using
-GNU libiconv, and are not using the libintl that ships with bash in lib/intl.
-
-Patch (apply with `patch -p0'):
-
---- a/lib/sh/unicode.c
-+++ b/lib/sh/unicode.c
-@@ -78,13 +78,15 @@ stub_charset ()
-   s = strrchr (locale, '.');
-   if (s)
-     {
--      strcpy (charsetbuf, s+1);
-+      strncpy (charsetbuf, s+1, sizeof (charsetbuf) - 1);
-+      charsetbuf[sizeof (charsetbuf) - 1] = '\0';
-       t = strchr (charsetbuf, '@');
-       if (t)
-       *t = 0;
-       return charsetbuf;
-     }
--  strcpy (charsetbuf, locale);
-+  strncpy (charsetbuf, locale, sizeof (charsetbuf) - 1);
-+  charsetbuf[sizeof (charsetbuf) - 1] = '\0';
-   return charsetbuf;
- }
- #endif
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 34
-+#define PATCHLEVEL 35
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/136-upstream-bash43-036.patch b/utils/bash/patches/136-upstream-bash43-036.patch
deleted file mode 100644 (file)
index 198b662..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-036
-
-Bug-Reported-by:       emanuelczirai@cryptolab.net
-Bug-Reference-ID:      <f962e4f556da5ebfadaf7afe9c78a8cb@cryptolab.net>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2015-02/msg00071.html
-
-Bug-Description:
-
-When evaluating and setting integer variables, and the assignment fails to
-create a variable (for example, when performing an operation on an array
-variable with an invalid subscript), bash attempts to dereference a null
-pointer, causing a segmentation violation.
-
-Patch (apply with `patch -p0'):
-
---- a/variables.c
-+++ b/variables.c
-@@ -2833,10 +2833,12 @@ bind_int_variable (lhs, rhs)
- #endif
-     v = bind_variable (lhs, rhs, 0);
--  if (v && isint)
--    VSETATTR (v, att_integer);
--
--  VUNSETATTR (v, att_invisible);
-+  if (v)
-+    {
-+      if (isint)
-+      VSETATTR (v, att_integer);
-+      VUNSETATTR (v, att_invisible);
-+    }
-   return (v);
- }
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 35
-+#define PATCHLEVEL 36
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/137-upstream-bash43-037.patch b/utils/bash/patches/137-upstream-bash43-037.patch
deleted file mode 100644 (file)
index 946e9fe..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-037
-
-Bug-Reported-by:       Greg Wooledge <wooledg@eeg.ccf.org>
-Bug-Reference-ID:      <20150204144240.GN13956@eeg.ccf.org>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2015-02/msg00007.html
-
-Bug-Description:
-
-If an associative array uses `@' or `*' as a subscript, `declare -p' produces
-output that cannot be reused as input.
-
-Patch (apply with `patch -p0'):
-
---- a/assoc.c
-+++ b/assoc.c
-@@ -436,6 +436,8 @@ assoc_to_assign (hash, quoted)
- #if 1
-       if (sh_contains_shell_metas (tlist->key))
-         istr = sh_double_quote (tlist->key);
-+      else if (ALL_ELEMENT_SUB (tlist->key[0]) && tlist->key[1] == '\0')
-+        istr = sh_double_quote (tlist->key);  
-       else
-         istr = tlist->key;    
- #else
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 36
-+#define PATCHLEVEL 37
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/138-upstream-bash43-038.patch b/utils/bash/patches/138-upstream-bash43-038.patch
deleted file mode 100644 (file)
index 9857847..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-038
-
-Bug-Reported-by:       worley@alum.mit.edu (Dale R. Worley)
-Bug-Reference-ID:      <201406100051.s5A0pCeB014978@hobgoblin.ariadne.com>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00028.html
-
-Bug-Description:
-
-There are a number of instances where `time' is not recognized as a reserved
-word when the shell grammar says it should be.
-
-Patch (apply with `patch -p0'):
-
---- a/parse.y
-+++ b/parse.y
-@@ -2818,11 +2818,16 @@ time_command_acceptable ()
-     case AND_AND:
-     case OR_OR:
-     case '&':
-+    case WHILE:
-     case DO:
-+    case UNTIL:
-+    case IF:
-     case THEN:
-+    case ELIF:
-     case ELSE:
-     case '{':         /* } */
--    case '(':         /* ) */
-+    case '(':         /* )( */
-+    case ')':         /* only valid in case statement */
-     case BANG:                /* ! time pipeline */
-     case TIME:                /* time time pipeline */
-     case TIMEOPT:     /* time -p time pipeline */
---- a/y.tab.c
-+++ b/y.tab.c
-@@ -5130,11 +5130,16 @@ time_command_acceptable ()
-     case AND_AND:
-     case OR_OR:
-     case '&':
-+    case WHILE:
-     case DO:
-+    case UNTIL:
-+    case IF:
-     case THEN:
-+    case ELIF:
-     case ELSE:
-     case '{':         /* } */
--    case '(':         /* ) */
-+    case '(':         /* )( */
-+    case ')':         /* only valid in case statement */
-     case BANG:                /* ! time pipeline */
-     case TIME:                /* time time pipeline */
-     case TIMEOPT:     /* time -p time pipeline */
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 37
-+#define PATCHLEVEL 38
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/139-upstream-bash43-039.patch b/utils/bash/patches/139-upstream-bash43-039.patch
deleted file mode 100644 (file)
index f8ad363..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-039
-
-Bug-Reported-by:       SN <poczta-sn@gazeta.pl>
-Bug-Reference-ID:      <54E2554C.205@gazeta.pl>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2015-02/msg00060.html
-
-Bug-Description:
-
-Using the output of `declare -p' when run in a function can result in variables
-that are invisible to `declare -p'.  This problem occurs when an assignment
-builtin such as `declare' receives a quoted compound array assignment as one of
-its arguments.
-
-Patch (apply with `patch -p0'):
-
---- a/arrayfunc.c
-+++ b/arrayfunc.c
-@@ -404,6 +404,9 @@ assign_array_var_from_word_list (var, li
-       (*var->assign_func) (var, l->word->word, i, 0);
-     else
-       array_insert (a, i, l->word->word);
-+
-+  VUNSETATTR (var, att_invisible);    /* no longer invisible */
-+
-   return var;
- }
-@@ -634,6 +637,10 @@ assign_array_var_from_string (var, value
-   if (nlist)
-     dispose_words (nlist);
-+
-+  if (var)
-+    VUNSETATTR (var, att_invisible);  /* no longer invisible */
-+
-   return (var);
- }
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 38
-+#define PATCHLEVEL 39
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/140-upstream-bash43-040.patch b/utils/bash/patches/140-upstream-bash43-040.patch
deleted file mode 100644 (file)
index a329d37..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-040
-
-Bug-Reported-by:       Jean Delvare <jdelvare@suse.de>
-Bug-Reference-ID:      <20150609180231.5f463695@endymion.delvare>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2015-06/msg00033.html
-
-Bug-Description:
-
-There is a memory leak that occurs when bash expands an array reference on
-the rhs of an assignment statement.
-
-Patch (apply with `patch -p0'):
-
---- a/subst.c
-+++ b/subst.c
-@@ -5782,7 +5782,7 @@ expand_arrayref:
-       /* XXX - does this leak if name[@] or name[*]? */
-       if (pflags & PF_ASSIGNRHS)
-         {
--          temp = array_variable_name (name, &tt, (int *)0);
-+          var = array_variable_part (name, &tt, (int *)0);
-           if (ALL_ELEMENT_SUB (tt[0]) && tt[1] == ']')
-           temp = array_value (name, quoted|Q_DOUBLE_QUOTES, 0, &atype, &ind);
-         else
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 39
-+#define PATCHLEVEL 40
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/141-upstream-bash43-041.patch b/utils/bash/patches/141-upstream-bash43-041.patch
deleted file mode 100644 (file)
index 75fdace..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-041
-
-Bug-Reported-by:       Hanno Böck <hanno@hboeck.de>
-Bug-Reference-ID:      <20150623131106.6f111da9@pc1>, <20150707004640.0e61d2f9@pc1>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2015-06/msg00089.html,
-                       http://lists.gnu.org/archive/html/bug-bash/2015-07/msg00018.html
-
-Bug-Description:
-
-There are several out-of-bounds read errors that occur when completing command
-lines where assignment statements appear before the command name.  The first
-two appear only when programmable completion is enabled; the last one only
-happens when listing possible completions.
-
-Patch (apply with `patch -p0'):
-
---- a/bashline.c
-+++ b/bashline.c
-@@ -1468,10 +1468,23 @@ attempt_shell_completion (text, start, e
-       os = start;
-       n = 0;
-+      was_assignment = 0;
-       s = find_cmd_start (os);
-       e = find_cmd_end (end);
-       do
-       {
-+        /* Don't read past the end of rl_line_buffer */
-+        if (s > rl_end)
-+          {
-+            s1 = s = e1;
-+            break;
-+          }
-+        /* Or past point if point is within an assignment statement */
-+        else if (was_assignment && s > rl_point)
-+          {
-+            s1 = s = e1;
-+            break;
-+          }
-         /* Skip over assignment statements preceding a command name.  If we
-            don't find a command name at all, we can perform command name
-            completion.  If we find a partial command name, we should perform
---- a/lib/readline/complete.c
-+++ b/lib/readline/complete.c
-@@ -689,6 +689,8 @@ printable_part (pathname)
-   if (temp == 0 || *temp == '\0')
-     return (pathname);
-+  else if (temp[1] == 0 && temp == pathname)
-+    return (pathname);
-   /* If the basename is NULL, we might have a pathname like '/usr/src/'.
-      Look for a previous slash and, if one is found, return the portion
-      following that slash.  If there's no previous slash, just return the
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 40
-+#define PATCHLEVEL 41
- #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/142-upstream-bash43-042.patch b/utils/bash/patches/142-upstream-bash43-042.patch
deleted file mode 100644 (file)
index bf1546b..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-                            BASH PATCH REPORT
-                            =================
-
-Bash-Release:  4.3
-Patch-ID:      bash43-042
-
-Bug-Reported-by:       Nathan Neulinger <nneul@neulinger.org>
-Bug-Reference-ID:      <558EFDF2.7060402@neulinger.org>
-Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2015-06/msg00096.html
-
-Bug-Description:
-
-There is a problem when parsing command substitutions containing `case'
-commands within pipelines that causes the parser to not correctly identify
-the end of the command substitution.
-
-Patch (apply with `patch -p0'):
-
---- a/parse.y
-+++ b/parse.y
-@@ -3708,6 +3708,8 @@ eof_error:
- /*itrace("parse_comsub:%d: lex_inword -> 1 ch = `%c' (%d)", line_number, ch, __LINE__);*/
-             tflags |= LEX_INWORD;
-             lex_wlen = 0;
-+            if (tflags & LEX_RESWDOK)
-+              lex_rwlen = 0;
-           }
-       }
---- a/y.tab.c
-+++ b/y.tab.c
-@@ -6020,6 +6020,8 @@ eof_error:
- /*itrace("parse_comsub:%d: lex_inword -> 1 ch = `%c' (%d)", line_number, ch, __LINE__);*/
-             tflags |= LEX_INWORD;
-             lex_wlen = 0;
-+            if (tflags & LEX_RESWDOK)
-+              lex_rwlen = 0;
-           }
-       }
---- a/patchlevel.h
-+++ b/patchlevel.h
-@@ -25,6 +25,6 @@
-    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
-    looks for to find the patch level (for the sccs version string). */
--#define PATCHLEVEL 41
-+#define PATCHLEVEL 42
- #endif /* _PATCHLEVEL_H_ */
index 900fd3e2ba05086779c11159cd1c7bc354161798..f02285e8d6907d18fb747643f43df008d55ffef9 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
 PKG_SOURCE_URL:=ftp://ftp.debian.org/debian/pool/main/b/bc
-PKG_MD5SUM:=24d0831812d8262b6cac8316b0bac483
+PKG_HASH:=5e1471869dd27ba4120dd3942d2f4ec6646cf917fb056be9ae0d3a8259668d47
 
 PKG_MAINTAINER:=Bruno Randolf <br1@einfach.org>
 PKG_LICENSE:=GPL-2.0
diff --git a/utils/beep/Makefile b/utils/beep/Makefile
new file mode 100644 (file)
index 0000000..f78af91
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2017 Chris Blake (chrisrblake93@gmail.com)
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=beep
+PKG_REV:=0d790fa45777896749a885c3b93b2c1476d59f20
+PKG_VERSION:=1.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/johnath/beep.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_REV)
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/beep
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=@(TARGET_x86||TARGET_x86_64) +kmod-pcspkr
+  TITLE:=Play beep sounds through a PC speaker
+  URL:=http://johnath.com/beep/README
+endef
+
+define Package/beep/description
+       This program plays beeps through the PC speaker
+endef
+
+MAKE_FLAGS += \
+       CFLAGS="$(TARGET_CFLAGS)"
+
+define Package/beep/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/beep $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,beep))
index 5ef7c65f7852b98a4173dad7666cd335860ba7f8..d3b590cd1ea59db4925537cd72425410eb780b2b 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.digifail.com/software/bluelog
-PKG_MD5SUM:=614d0fe65bae68acff1d33d9f86e4805
+PKG_HASH:=9750b007daffaffecea3b8dd2332bf74cc24955c307861197a20d04d845bc412
 
 OUI_SOURCE:=oui-2016-05-30.txt.gz
 OUI_URL:=http://sources.lede-project.org/
index 0430cd6c1ae766f004d91ed06589850a8d1f6f82..245e45d5f526278d73a81c35efc72e9cd5a1ef6b 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bluez
-PKG_VERSION:=5.38
+PKG_VERSION:=5.47
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/
-PKG_MD5SUM:=dae2ed00c63791800ea7d10a381270a5
+PKG_HASH:=cf75bf7cd5d564f21cc4a2bd01d5c39ce425397335fd47d9bbe43af0a58342c8
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
@@ -70,7 +70,7 @@ define Package/bluez-daemon/conffiles
 /etc/bluetooth/main.conf
 /etc/bluetooth/network.conf
 /etc/bluetooth/input.conf
-/etc/bluetooth/proximity.conf
+/etc/bluetooth/audio.conf
 /etc/config/bluetooth
 endef
 
@@ -92,6 +92,7 @@ CONFIGURE_ARGS += \
        --disable-systemd \
        --disable-test \
        --disable-udev \
+       --enable-deprecated
 
 TARGET_CPPFLAGS += \
        -D_GNU_SOURCE
@@ -148,7 +149,7 @@ define Package/bluez-daemon/install
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/input/input.conf $(1)/etc/bluetooth/input.conf
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/proximity/proximity.conf $(1)/etc/bluetooth/proximity.conf
+       $(INSTALL_DATA) ./files/audio.conf $(1)/etc/bluetooth/audio.conf
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/bluetoothd.init $(1)/etc/init.d/bluetoothd
 endef
diff --git a/utils/bluez/files/audio.conf b/utils/bluez/files/audio.conf
new file mode 100644 (file)
index 0000000..0455c6c
--- /dev/null
@@ -0,0 +1 @@
+Enable=Source,Sink,Media,Socket
index 96e8a26c59dd8e089cfd66bf05c52c7f16fbe60d..15eb6e1da8b7b70ce6dac3e585014a3b6a3319a2 100644 (file)
@@ -9,7 +9,7 @@ Subject: [PATCH 1/4] bcm43xx: Add bcm43xx-3wire variant
 
 --- a/tools/hciattach.c
 +++ b/tools/hciattach.c
-@@ -1144,6 +1144,9 @@ struct uart_t uart[] = {
+@@ -1090,6 +1090,9 @@ struct uart_t uart[] = {
        { "bcm43xx",    0x0000, 0x0000, HCI_UART_H4,   115200, 3000000,
                                FLOW_CTL, DISABLE_PM, NULL, bcm43xx, NULL  },
  
index fa0948d9210a973a4865857a7028008557fb790f..74911d3caba8ed8df4d2f0fad8ae70fa2a6176ee 100644 (file)
@@ -9,7 +9,7 @@ Subject: [PATCH 3/4] Increase firmware load timeout to 30s
 
 --- a/tools/hciattach.c
 +++ b/tools/hciattach.c
-@@ -1293,7 +1293,7 @@ int main(int argc, char *argv[])
+@@ -1239,7 +1239,7 @@ int main(int argc, char *argv[])
  {
        struct uart_t *u = NULL;
        int detach, printpid, raw, opt, i, n, ld, err;
diff --git a/utils/bluez/patches/200-uart-speed.patch b/utils/bluez/patches/200-uart-speed.patch
deleted file mode 100644 (file)
index ebe0153..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
---- a/tools/hciattach.c
-+++ b/tools/hciattach.c
-@@ -101,20 +101,37 @@ int uart_speed(int s)
-               return B230400;
-       case 460800:
-               return B460800;
-+/* FIX: Not all platform support this high serial speed
-+   claudyus84 @gamil.com
-+*/
-+#ifdef B500000
-       case 500000:
-               return B500000;
-+#endif
-+#ifdef B576000
-       case 576000:
-               return B576000;
-+#endif
-+#ifdef B921600
-       case 921600:
-               return B921600;
-+#endif
-+#ifdef B1000000
-       case 1000000:
-               return B1000000;
-+#endif
-+#ifdef B1152000
-       case 1152000:
-               return B1152000;
-+#endif
-+#ifdef B1500000
-       case 1500000:
-               return B1500000;
-+#endif
-+#ifdef B2000000
-       case 2000000:
-               return B2000000;
-+#endif
- #ifdef B2500000
-       case 2500000:
-               return B2500000;
index 45e155325c76f4d49047514a51c19f44fe0bbf83..5794371620bb587ae8493a364d9384a41cbadd87 100644 (file)
@@ -1,22 +1,24 @@
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -2441,7 +2441,7 @@ unit_tests = $(am__append_35) unit/test-
+--- a/Makefile.in      2017-09-14 11:47:06.000000000 +0200
++++ b/Makefile.in      2017-09-15 02:52:39.315926972 +0200
+@@ -2447,7 +2447,7 @@
  @CLIENT_TRUE@                                 monitor/uuid.h monitor/uuid.c
  
- @CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \
--@CLIENT_TRUE@                         -lreadline
-+@CLIENT_TRUE@                         -lreadline -lncurses
+ @CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
+-@CLIENT_TRUE@                         @GLIB_LIBS@ @DBUS_LIBS@ -lreadline
++@CLIENT_TRUE@                         @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses
  
- @MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \
- @MONITOR_TRUE@                                monitor/display.h monitor/display.c \
-@@ -2691,13 +2691,13 @@ unit_tests = $(am__append_35) unit/test-
- @READLINE_TRUE@                               client/display.h
+ @MESH_TRUE@mesh_meshctl_SOURCES = mesh/main.c \
+ @MESH_TRUE@                           mesh/mesh-net.h \
+@@ -2468,7 +2468,7 @@
  
- @READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \
--@READLINE_TRUE@                       src/libshared-glib.la @GLIB_LIBS@ -lreadline
-+@READLINE_TRUE@                       src/libshared-glib.la @GLIB_LIBS@ -lreadline -lncurses
+ @MESH_TRUE@mesh_meshctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
+ @MESH_TRUE@                           lib/libbluetooth-internal.la \
+-@MESH_TRUE@                           @GLIB_LIBS@ @DBUS_LIBS@ -ljson-c -lreadline
++@MESH_TRUE@                           @GLIB_LIBS@ @DBUS_LIBS@ -ljson-c -lreadline -lncurses
  
- @READLINE_TRUE@tools_obex_client_tool_SOURCES = $(gobex_sources) $(btio_sources) \
+ @MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \
+ @MONITOR_TRUE@                                monitor/display.h monitor/display.c \
+@@ -2724,7 +2724,7 @@
  @READLINE_TRUE@                                               tools/obex-client-tool.c
  
  @READLINE_TRUE@tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \
@@ -25,7 +27,7 @@
  
  @READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \
  @READLINE_TRUE@                                               tools/obex-server-tool.c
-@@ -2707,17 +2707,17 @@ unit_tests = $(am__append_35) unit/test-
+@@ -2734,17 +2734,17 @@
  @READLINE_TRUE@                               client/display.h client/display.c
  
  @READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \
 -@READLINE_TRUE@                               -lreadline
 +@READLINE_TRUE@                               -lreadline -lncurses
  
- @EXPERIMENTAL_TRUE@tools_gatt_service_SOURCES = tools/gatt-service.c
- @EXPERIMENTAL_TRUE@tools_gatt_service_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ gdbus/libgdbus-internal.la
+ @DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \
+ @DEPRECATED_TRUE@@READLINE_TRUE@                              attrib/gattrib.c btio/btio.c \
+@@ -2753,7 +2753,7 @@
+ @DEPRECATED_TRUE@@READLINE_TRUE@                              client/display.h
+ @DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \
+-@DEPRECATED_TRUE@@READLINE_TRUE@                      src/libshared-glib.la @GLIB_LIBS@ -lreadline
++@DEPRECATED_TRUE@@READLINE_TRUE@                      src/libshared-glib.la @GLIB_LIBS@ -lreadline -lncurses
+ @CUPS_TRUE@cupsdir = $(libdir)/cups/backend
+ @CUPS_TRUE@profiles_cups_bluetooth_SOURCES = profiles/cups/main.c \
index 0008cc23c98806260606479c799fc39dd2cae3cf..6ae0d415358c926e3b2cf2bf0fa9c4626a4ab466 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=http://www.coker.com.au/bonnie++/experimental/
-PKG_MD5SUM:=d6cf9703242998b2ddc2d875b028b3c6
+PKG_HASH:=44f5a05937648a6526ba99354555d7d15f2dd392e55d3436f6746da6f6c35982
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=copyright.txt
 PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
index 70c4a06c6d7020adb1cb162ffb5cc646eadabf23..6f6363a8337bedf8811dbce108f89e9b849b122a 100644 (file)
@@ -8,21 +8,21 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=btrfs-progs
-PKG_VERSION:=4.7.2
+PKG_VERSION:=4.15.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs/
-PKG_MD5SUM:=f49bc9e143ffe60260c5bd70ef3b624576673f8b50f41e309892a425f7fbe60f
+PKG_HASH:=67102ac0d6795f368acc94efaca29b6626d972638790a4a0c9f89a27cd543f96
+PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
 
-PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
-PKG_BUILD_DEPENDS:=libacl
+PKG_BUILD_DEPENDS:=acl
 
 PKG_FIXUP:=autoreconf
 
@@ -45,12 +45,25 @@ define Package/btrfs-progs/description
 endef
 
 progs = btrfs btrfs-debug-tree btrfs-find-root btrfs-image btrfs-map-logical \
-       btrfs-show-super btrfstune btrfs-zero-log fsck.btrfs mkfs.btrfs
+       btrfs-select-super btrfstune btrfs-zero-log fsck.btrfs mkfs.btrfs
 
 CONFIGURE_ARGS += \
        --disable-backtrace \
        --disable-convert \
-       --disable-documentation
+       --disable-documentation \
+       --disable-zstd
+
+EXTRA_CFLAGS=$(TARGET_CPPFLAGS)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/* \
+               $(1)/usr/include/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libbtrfs.{a,so*} \
+               $(1)/usr/lib/
+endef
 
 define Package/btrfs-progs/install
        $(INSTALL_DIR) $(1)/usr/lib
diff --git a/utils/btrfs-progs/patches/0001-use-pthread_join-instead-of-pthread_tryjoin_np.patch b/utils/btrfs-progs/patches/0001-use-pthread_join-instead-of-pthread_tryjoin_np.patch
deleted file mode 100644 (file)
index 90b56b4..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/chunk-recover.c
-+++ b/chunk-recover.c
-@@ -887,7 +887,7 @@ static int scan_devices(struct recover_c
-               for (i = 0; i < devidx; i++) {
-                       if (dev_scans[i].bytenr == -1)
-                               continue;
--                      ret = pthread_tryjoin_np(t_scans[i],
-+                      ret = pthread_join(t_scans[i],
-                                                (void **)&t_rets[i]);
-                       if (ret == EBUSY) {
-                               all_done = 0;
index 58ae762abd47e28f6930e649941b703abab569d2..7781fd390870d7cfde5336dfeea4396977546030 100644 (file)
@@ -12,21 +12,17 @@ PKG_RELEASE=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/linux-can/can-utils
-PKG_SOURCE_VERSION:=0e3ff3b3157e456d4b6343f5d4b42ef692bce538
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+PKG_SOURCE_DATE:=2017-02-16
+PKG_SOURCE_VERSION:=cb33a55720716cbe01e6025a2bda74a1b7e492d3
+PKG_MIRROR_HASH:=d9c01eeff3d81a28161ca5c3937ec005a1f49ca3eb97bee0164d53cc66365786
 
 PKG_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
 PKG_LICENSE:=GPL-2.0+
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 PKG_FIXUP:=autoreconf
 
 include $(INCLUDE_DIR)/package.mk
 
-FILES:=canbusload can-calc-bit-timing candump \
-       cangen cangw canplayer cansniffer cansend
-
 define Package/canutils/Default
   SECTION:=utils
   CATEGORY:=Utilities
@@ -39,30 +35,30 @@ define Package/canutils
   MENU:=1
 endef
 
-define Package/canutils-log-conversion
-  $(call Package/canutils/Default)
-  TITLE:=canutils log conversion
-  DEPENDS:=canutils
-endef
+define GenPlugin
+  define Package/$(addprefix canutils-,$(1))
+    $(call Package/canutils/Default)
+    DEPENDS:=canutils
+    TITLE:=Utility $(1) from the CAN utilities
+  endef
 
-define PartGen
-define Package/canutils-$(1)
-  $(call Package/canutils/Default)
-  TITLE:=$(1) tool from canutils
-  DEPENDS:=canutils
-endef
+   define Package/$(addprefix canutils-,$(1))/description
+     Utility $(1) from the CAN utilities package.
+   endef
 endef
 
-$(foreach file,$(FILES),$(eval $(call PartGen,$(file))))
+FILES:=canbusload can-calc-bit-timing candump \
+       cangen cangw canplayer cansniffer cansend \
+       canfdtest asc2log log2asc log2long bcmserver \
+       canlogserver isotpdump isotpperf isotprecv \
+       isotpsend isotpserver isotpsniffer isotptun \
+       slcan_attach slcand slcanpty
+
 
-define Package/canutils/install
-endef
+$(foreach a,$(FILES),$(eval $(call GenPlugin,$(a))))
 
-define Package/canutils-log-conversion/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/asc2log $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/log2asc $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/log2long $(1)/usr/bin/
+define Package/canutils/install
+       true
 endef
 
 define PartInstall
@@ -74,43 +70,7 @@ define Package/canutils-$(1)/install
 endef
 endef
 
-define Package/canutils-log-conversion/description
-asc2log - convert ASC logfile to compact CAN frame logfile.
-log2asc - convert compact CAN frame logfile to ASC logfile.
-log2long - convert compact CAN frame representation into user readable.
-endef
-
-define Package/canutils-canbusload/description
-canbusload - display the load percentage of can buses.
-endef
-
-define Package/canutils-can-calc-bit-timing/description
-can-calc-bit-timing - calculate hw bittiming for supported can chips.
-endef
-
-define Package/canutils-candump/description
-candump - dumps can frames to terminal, logfile or another can device,
-with optional filtering.
-endef
-
-define Package/canutils-cangen/description
-cangen - CAN frames generator for testing purposes.
-endef
-
-define Package/canutils-cangw/description
-cangw - manage PF_CAN netlink gateway.
-endef
-
-define Package/canutils-canplayer/description
-canplayer - replay a compact CAN frame logfile to CAN devices.
-endef
-
-define Package/canutils-cansend/description
-cansend - simple command line tool to send CAN-frames via CAN_RAW sockets.
-endef
-
 $(foreach file,$(FILES),$(eval $(call PartInstall,$(file))))
 
 $(eval $(call BuildPackage,canutils))
-$(eval $(call BuildPackage,canutils-log-conversion))
 $(foreach file,$(FILES),$(eval $(call BuildPackage,canutils-$(file))))
index 8b3b09d5518beae4de7d1663e2230d21895ccf0c..9b05f6efa4bdb19872ad49d9717b322c68ea35de 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ccid
-PKG_VERSION:=1.4.26
+PKG_VERSION:=1.4.28
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4205
-PKG_MD5SUM:=3267bf708ab780c02f01f6241b7c7277cb892d30fd1179a9926a8cc0ca40be2f
+PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4230
+PKG_HASH:=875836ac5d9d952b40dc1a253a726e74361671864d81337285a3260268f8ade0
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING
index 15c0cc28fb0f1a82f7c87a1d0616995afe002d94..386ac9e4d9d2b44202c7635315af30aaf5ab7cd9 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/ccrypt
-PKG_MD5SUM:=87d66da2170facabf6f2fc073586ae2c7320d4689980cfca415c74688e499ba0
+PKG_HASH:=87d66da2170facabf6f2fc073586ae2c7320d4689980cfca415c74688e499ba0
 PKG_MAINTAINER:=Hannu Nyman <hannu.nyman@iki.fi>
 PKG_LICENSE:=GPLv2+
 
@@ -25,7 +25,7 @@ define Package/ccrypt
   SECTION:=utils
   CATEGORY:=Utilities
   SUBMENU:=Encryption
-  TITLE:=ccrypt is a utility for encrypting and decrypting files and streams
+  TITLE:=utility for encrypting/decrypting files and streams
   URL:=http://ccrypt.sourceforge.net/
 endef
 
index c092fc90bd4933d2273bb7641d6451bca127d5a9..6c7356a406656d654161cc7072b42627a99967c6 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=@SF/cmdpad
-PKG_MD5SUM:=6633b2354b7f23f9cd8e2bfb6e735965
+PKG_HASH:=19963f20f1af50fab0013fb373af294ea412da7241d1ea91fad90455291948b9
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=MIT
@@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/cmdpad
   SECTION:=utils
   CATEGORY:=Utilities
-  TITLE:=execute commands when a key is pressed, released or hold down
+  TITLE:=execute commands when key is pressed/released/held down
   URL:=http://cmdpad.sourceforge.net/index.php
 endef
 
index 27491c6fe9c1cd57a278e2af90aa270ac62ee2c2..ed22103f6f4324bf7cea714db982e9b101361006 100644 (file)
@@ -8,12 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=collectd
-PKG_VERSION:=5.5.3
-PKG_RELEASE:=3
+PKG_VERSION:=5.8.0
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://collectd.org/files/
-PKG_MD5SUM:=6f10633d0f73f99ef61472a8e377d4a058de161e80f3353b4b17d394c68f2f44
+PKG_SOURCE_URL:=https://collectd.org/files/ \
+       https://github.com/collectd/collectd/releases/download/collectd-$(PKG_VERSION)
+PKG_HASH:=b06ff476bbf05533cb97ae6749262cc3c76c9969f032bd8496690084ddeb15c9
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
@@ -31,23 +32,34 @@ COLLECTD_PLUGINS_DISABLED:= \
        battery \
        ceph \
        cgroups \
+       cpusleep \
        curl_json \
        curl_xml \
        dbi \
+       dpdkevents \
+       dpdkstat \
        drbd \
        ethstat \
        fhcount \
        genericjmx \
        gmond \
+       gps \
+       grpc \
        hddtemp \
+       hugepages \
+       intel_pmu \
+       intel_rdt \
        ipc \
        ipmi \
        ipvs \
        java \
        log_logstash \
+       lua \
        lvm \
        lpar \
+       madwifi \
        mbmon \
+       mcelog \
        md \
        memcachec \
        memcached \
@@ -58,10 +70,13 @@ COLLECTD_PLUGINS_DISABLED:= \
        nfs \
        notify_desktop \
        notify_email \
+       notify_nagios \
        numa \
        openldap \
        openvz \
        oracle \
+       ovs_events \
+       ovs_stats \
        perl \
        pf \
        pinba \
@@ -72,8 +87,10 @@ COLLECTD_PLUGINS_DISABLED:= \
        serial \
        sigrok \
        smart \
+       snmp_agent \
        statsd \
        swap \
+       synproxy \
        tape \
        tokyotyrant \
        turbostat \
@@ -84,12 +101,15 @@ COLLECTD_PLUGINS_DISABLED:= \
        write_kafka \
        write_log \
        write_mongodb \
+       write_prometheus \
        write_redis \
        write_riemann \
        write_sensu \
        write_tsdb \
+       xencpu \
        xmms \
        zfs_arc \
+       zone \
        zookeeper
 
 COLLECTD_PLUGINS_SELECTED:= \
@@ -97,6 +117,7 @@ COLLECTD_PLUGINS_SELECTED:= \
        apcups \
        ascent \
        bind \
+       chrony \
        conntrack \
        contextswitch \
        cpu \
@@ -117,9 +138,14 @@ COLLECTD_PLUGINS_SELECTED:= \
        iwinfo \
        load \
        logfile \
-       madwifi \
+       match_empty_counter \
+       match_hashed \
+       match_regex \
+       match_timediff \
+       match_value \
        memory \
        modbus \
+       mqtt \
        mysql \
        netlink \
        network \
@@ -163,7 +189,7 @@ define Package/collectd/Default
   SECTION:=utils
   CATEGORY:=Utilities
   TITLE:=Lightweight system statistics collection daemon
-  URL:=http://verplant.org/collectd/
+  URL:=https://collectd.org/
 endef
 
 define Package/collectd
@@ -191,25 +217,29 @@ endif
 
 # common configure args
 CONFIGURE_ARGS+= \
+       --disable-werror \
        --disable-debug \
        --enable-daemon \
        --with-nan-emulation \
+       --with-libyajl=no \
        --without-perl-bindings \
        --without-libudev
 
+CONFIGURE_VARS+= \
+       CFLAGS="$$$$CFLAGS $(FPIC)" \
+       LDFLAGS="$$$$LDFLAGS -lm -lz" \
+       KERNEL_DIR="$(LINUX_DIR)" \
+
 ifneq ($(CONFIG_PACKAGE_COLLECTD_ENCRYPTED_NETWORK),)
 CONFIGURE_ARGS+= \
-       --with-libgcrypt=$(STAGING_DIR)/usr/include
+       --with-libgcrypt=$(STAGING_DIR)/usr
+CONFIGURE_VARS+= \
+       GCRYPT_LIBS="-lgcrypt"
 else
 CONFIGURE_ARGS+= \
        --without-libgcrypt
 endif
 
-CONFIGURE_VARS+= \
-       CFLAGS="$$$$CFLAGS $(FPIC)" \
-       LDFLAGS="$$$$LDFLAGS -lm -lz" \
-       KERNEL_DIR="$(LINUX_DIR)" \
-
 CONFIGURE_PLUGIN= \
        $(foreach m, $(1), \
                $(if $(CONFIG_PACKAGE_collectd-mod-$(subst _,-,$(m))),--enable-$(m),--disable-$(m)) \
@@ -309,6 +339,7 @@ $(eval $(call BuildPlugin,apache,apache status input,apache,+PACKAGE_collectd-mo
 $(eval $(call BuildPlugin,apcups,apcups status input,apcups,))
 $(eval $(call BuildPlugin,ascent,ascent status input,ascent,+PACKAGE_collectd-mod-ascent:libcurl +PACKAGE_collectd-mod-ascent:libxml2))
 $(eval $(call BuildPlugin,bind,BIND server/zone input,bind,+PACKAGE_collectd-mod-bind:libcurl +PACKAGE_collectd-mod-bind:libxml2))
+$(eval $(call BuildPlugin,chrony,chrony status input,chrony,))
 $(eval $(call BuildPlugin,conntrack,connection tracking table size input,conntrack,))
 $(eval $(call BuildPlugin,contextswitch,context switch input,contextswitch,))
 $(eval $(call BuildPlugin,cpu,CPU input,cpu,))
@@ -330,15 +361,20 @@ $(eval $(call BuildPlugin,irq,interrupt usage input,irq,))
 $(eval $(call BuildPlugin,iwinfo,libiwinfo wireless statistics,iwinfo,+PACKAGE_collectd-mod-iwinfo:libiwinfo))
 $(eval $(call BuildPlugin,load,system load input,load,))
 $(eval $(call BuildPlugin,logfile,log files output,logfile,))
-$(eval $(call BuildPlugin,madwifi,MadWifi status input,madwifi,))
+$(eval $(call BuildPlugin,match-empty-counter,empty-counter match,match_empty_counter,))
+$(eval $(call BuildPlugin,match-hashed,hashed match,match_hashed,))
+$(eval $(call BuildPlugin,match-regex,regex match,match_regex,))
+$(eval $(call BuildPlugin,match-timediff,timediff match,match_timediff,))
+$(eval $(call BuildPlugin,match-value,value match,match_value,))
 #$(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient-r))
 $(eval $(call BuildPlugin,memory,physical memory usage input,memory,))
 $(eval $(call BuildPlugin,modbus,read variables through libmodbus,modbus,+PACKAGE_collectd-mod-modbus:libmodbus))
+$(eval $(call BuildPlugin,mqtt,transmit data with MQTT,mqtt,+PACKAGE_collectd-mod-mqtt:libmosquitto))
 $(eval $(call BuildPlugin,netlink,netlink input,netlink,+PACKAGE_collectd-mod-netlink:libmnl))
 $(eval $(call BuildPlugin,network,network input/output,network,+PACKAGE_COLLECTD_ENCRYPTED_NETWORK:libgcrypt))
 $(eval $(call BuildPlugin,nginx,nginx status input,nginx,+PACKAGE_collectd-mod-nginx:libcurl))
 $(eval $(call BuildPlugin,ntpd,NTP daemon status input,ntpd,))
-$(eval $(call BuildPlugin,nut,UPS monitoring input,nut,+PACKAGE_collectd-mod-nut:nut))
+$(eval $(call BuildPlugin,nut,UPS monitoring input,nut,+PACKAGE_collectd-mod-nut:nut-common))
 $(eval $(call BuildPlugin,olsrd,OLSRd status input,olsrd,))
 $(eval $(call BuildPlugin,onewire,onewire sensor input,onewire,+PACKAGE_collectd-mod-onewire:libow-capi @BROKEN))
 $(eval $(call BuildPlugin,openvpn,OpenVPN traffic/compression input,openvpn,))
diff --git a/utils/collectd/patches/003-remove-werror.patch b/utils/collectd/patches/003-remove-werror.patch
deleted file mode 100644 (file)
index c81f209..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -7,7 +7,7 @@ SUBDIRS += daemon
- PLUGIN_LDFLAGS = -module -avoid-version -export-symbols-regex '\<module_register\>'
- if COMPILER_IS_GCC
--AM_CFLAGS = -Wall -Werror
-+AM_CFLAGS = -Wall
- endif
- AM_CPPFLAGS = -I$(srcdir)/daemon
---- a/src/libcollectdclient/Makefile.am
-+++ b/src/libcollectdclient/Makefile.am
-@@ -1,7 +1,7 @@
- AUTOMAKE_OPTIONS = foreign no-dependencies
- if COMPILER_IS_GCC
--AM_CFLAGS = -Wall -Werror
-+AM_CFLAGS = -Wall
- endif
- pkginclude_HEADERS = collectd/client.h collectd/network.h collectd/network_buffer.h collectd/lcc_features.h
diff --git a/utils/collectd/patches/050-backport-modbus-little-endian.patch b/utils/collectd/patches/050-backport-modbus-little-endian.patch
new file mode 100644 (file)
index 0000000..6cb9703
--- /dev/null
@@ -0,0 +1,179 @@
+From 6028f89df95b12219d735b277863f83e9f5ee9e9 Mon Sep 17 00:00:00 2001
+From: PJ Bostley <pbostley@gmail.com>
+Date: Sat, 20 Jan 2018 16:39:36 -0700
+Subject: [PATCH 1/2] Adding support for CDAB endian 32-bit modbus polls
+
+---
+ src/modbus.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 56 insertions(+), 5 deletions(-)
+
+diff --git a/src/modbus.c b/src/modbus.c
+index 31f0c2da81..daa3c028f5 100644
+--- a/src/modbus.c
++++ b/src/modbus.c
+@@ -76,9 +76,13 @@
+ enum mb_register_type_e /* {{{ */
+ { REG_TYPE_INT16,
+   REG_TYPE_INT32,
++  REG_TYPE_INT32_CDAB,
+   REG_TYPE_UINT16,
+   REG_TYPE_UINT32,
+-  REG_TYPE_FLOAT }; /* }}} */
++  REG_TYPE_UINT32_CDAB,
++  REG_TYPE_FLOAT,
++  REG_TYPE_FLOAT_CDAB }; /* }}} */
++
+ enum mb_mreg_type_e /* {{{ */
+ { MREG_HOLDING,
+   MREG_INPUT }; /* }}} */
+@@ -425,7 +429,9 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
+   if ((ds->ds[0].type != DS_TYPE_GAUGE) &&
+       (data->register_type != REG_TYPE_INT32) &&
+-      (data->register_type != REG_TYPE_UINT32)) {
++      (data->register_type != REG_TYPE_INT32_CDAB) &&
++      (data->register_type != REG_TYPE_UINT32) &&
++      (data->register_type != REG_TYPE_UINT32_CDAB)) {
+     NOTICE(
+         "Modbus plugin: The data source of type \"%s\" is %s, not gauge. "
+         "This will most likely result in problems, because the register type "
+@@ -434,8 +440,11 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
+   }
+   if ((data->register_type == REG_TYPE_INT32) ||
++      (data->register_type == REG_TYPE_INT32_CDAB) ||
+       (data->register_type == REG_TYPE_UINT32) ||
+-      (data->register_type == REG_TYPE_FLOAT))
++      (data->register_type == REG_TYPE_UINT32_CDAB) ||
++      (data->register_type == REG_TYPE_FLOAT) ||
++      (data->register_type == REG_TYPE_FLOAT_CDAB))
+     values_num = 2;
+   else
+     values_num = 1;
+@@ -496,8 +505,8 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
+   }
+   if (status != values_num) {
+     ERROR("Modbus plugin: modbus read function (%s/%s) failed. "
+-          " status = %i, values_num = %i. Giving up.",
+-          host->host, host->node, status, values_num);
++          " status = %i, start_addr = %i, values_num = %i. Giving up.",
++          host->host, host->node, status, data->register_base, values_num);
+ #if LEGACY_LIBMODBUS
+     modbus_close(&host->connection);
+ #else
+@@ -521,6 +530,17 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
+           "Returned float value is %g",
+           (double)float_value);
++    CAST_TO_VALUE_T(ds, vt, float_value);
++    mb_submit(host, slave, data, vt);
++  } else if (data->register_type == REG_TYPE_FLOAT_CDAB) {
++    float float_value;
++    value_t vt;
++
++    float_value = mb_register_to_float(values[1], values[0]);
++    DEBUG("Modbus plugin: mb_read_data: "
++          "Returned float value is %g",
++          (double)float_value);
++
+     CAST_TO_VALUE_T(ds, vt, float_value);
+     mb_submit(host, slave, data, vt);
+   } else if (data->register_type == REG_TYPE_INT32) {
+@@ -535,6 +555,20 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
+           "Returned int32 value is %" PRIi32,
+           v.i32);
++    CAST_TO_VALUE_T(ds, vt, v.i32);
++    mb_submit(host, slave, data, vt);
++  } else if (data->register_type == REG_TYPE_INT32_CDAB) {
++    union {
++      uint32_t u32;
++      int32_t i32;
++    } v;
++    value_t vt;
++
++    v.u32 = (((uint32_t)values[1]) << 16) | ((uint32_t)values[0]);
++    DEBUG("Modbus plugin: mb_read_data: "
++          "Returned int32 value is %" PRIi32,
++          v.i32);
++
+     CAST_TO_VALUE_T(ds, vt, v.i32);
+     mb_submit(host, slave, data, vt);
+   } else if (data->register_type == REG_TYPE_INT16) {
+@@ -561,6 +595,17 @@ static int mb_read_data(mb_host_t *host, mb_slave_t *slave, /* {{{ */
+           "Returned uint32 value is %" PRIu32,
+           v32);
++    CAST_TO_VALUE_T(ds, vt, v32);
++    mb_submit(host, slave, data, vt);
++  } else if (data->register_type == REG_TYPE_UINT32_CDAB) {
++    uint32_t v32;
++    value_t vt;
++
++    v32 = (((uint32_t)values[1]) << 16) | ((uint32_t)values[0]);
++    DEBUG("Modbus plugin: mb_read_data: "
++          "Returned uint32 value is %" PRIu32,
++          v32);
++
+     CAST_TO_VALUE_T(ds, vt, v32);
+     mb_submit(host, slave, data, vt);
+   } else /* if (data->register_type == REG_TYPE_UINT16) */
+@@ -702,12 +747,18 @@ static int mb_config_add_data(oconfig_item_t *ci) /* {{{ */
+         data.register_type = REG_TYPE_INT16;
+       else if (strcasecmp("Int32", tmp) == 0)
+         data.register_type = REG_TYPE_INT32;
++      else if (strcasecmp("Int32LE", tmp) == 0)
++        data.register_type = REG_TYPE_INT32_CDAB;
+       else if (strcasecmp("Uint16", tmp) == 0)
+         data.register_type = REG_TYPE_UINT16;
+       else if (strcasecmp("Uint32", tmp) == 0)
+         data.register_type = REG_TYPE_UINT32;
++      else if (strcasecmp("Uint32LE", tmp) == 0)
++        data.register_type = REG_TYPE_UINT32_CDAB;
+       else if (strcasecmp("Float", tmp) == 0)
+         data.register_type = REG_TYPE_FLOAT;
++      else if (strcasecmp("FloatLE", tmp) == 0)
++        data.register_type = REG_TYPE_FLOAT_CDAB;
+       else {
+         ERROR("Modbus plugin: The register type \"%s\" is unknown.", tmp);
+         status = -1;
+
+From 67afd2685892e69ababb489f48b9033ab5908f4d Mon Sep 17 00:00:00 2001
+From: PJ Bostley <pbostley@gmail.com>
+Date: Tue, 23 Jan 2018 15:33:23 -0700
+Subject: [PATCH 2/2] Adding documentation for the Modbus little endian modes
+ where 32 bit values have thier registers swapped
+
+---
+ src/collectd.conf.pod | 18 +++++++++++++-----
+ 1 file changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
+index dfd785a2c8..e9715126e6 100644
+--- a/src/collectd.conf.pod
++++ b/src/collectd.conf.pod
+@@ -4128,11 +4128,19 @@ Configures the base register to read from the device. If the option
+ B<RegisterType> has been set to B<Uint32> or B<Float>, this and the next
+ register will be read (the register number is increased by one).
+-=item B<RegisterType> B<Int16>|B<Int32>|B<Uint16>|B<Uint32>|B<Float>
+-
+-Specifies what kind of data is returned by the device. If the type is B<Int32>,
+-B<Uint32> or B<Float>, two 16E<nbsp>bit registers will be read and the data is
+-combined into one value. Defaults to B<Uint16>.
++=item B<RegisterType> B<Int16>|B<Int32>|B<Uint16>|B<Uint32>|B<Float>|B<Int32LE>|B<Uint32LE>|B<FloatLE>
++
++Specifies what kind of data is returned by the device. This defaults to
++B<Uint16>.  If the type is B<Int32>, B<Int32LE>, B<Uint32>, B<Uint32LE>,
++B<Float> or B<FloatLE>, two 16E<nbsp>bit registers at B<RegisterBase>
++and B<RegisterBase+1> will be read and the data is combined into one
++32E<nbsp>value. For B<Int32>, B<Uint32> and B<Float> the most significant
++16E<nbsp>bits are in the register at B<RegisterBase> and the least
++significant 16E<nbsp>bits are in the register at B<RegisterBase+1>.
++For B<Int32LE>, B<Uint32LE>, or B<Float32LE>, the high and low order
++registers are swapped with the most significant 16E<nbsp>bits in
++the B<RegisterBase+1> and the least significant 16E<nbsp>bits in
++B<RegisterBase>.
+ =item B<RegisterCmd> B<ReadHolding>|B<ReadInput>
diff --git a/utils/collectd/patches/050-upstream-fix-for-network-plugin-ddos.patch b/utils/collectd/patches/050-upstream-fix-for-network-plugin-ddos.patch
deleted file mode 100644 (file)
index d4d333e..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-From f6be4f9b49b949b379326c3d7002476e6ce4f211 Mon Sep 17 00:00:00 2001
-From: Pavel Rochnyack <pavel2000@ngs.ru>
-Date: Mon, 3 Apr 2017 11:57:09 +0600
-Subject: [PATCH] network plugin: Fix endless loop DOS in parse_packet()
-
-When correct 'Signature part' is received by Collectd, configured without
-AuthFile option, condition for endless loop occurs due to missing increase
-of pointer to next unprocessed part.
-
-Fixes: CVE-2017-7401
-
-Signed-off-by: Florian Forster <octo@collectd.org>
-
-
---- a/src/network.c
-+++ b/src/network.c
-@@ -1066,14 +1066,6 @@ static int parse_part_sign_sha256 (socke
-   buffer_len = *ret_buffer_len;
-   buffer_offset = 0;
--  if (se->data.server.userdb == NULL)
--  {
--    c_complain (LOG_NOTICE, &complain_no_users,
--        "network plugin: Received signed network packet but can't verify it "
--        "because no user DB has been configured. Will accept it.");
--    return (0);
--  }
--
-   /* Check if the buffer has enough data for this structure. */
-   if (buffer_len <= PART_SIGNATURE_SHA256_SIZE)
-     return (-ENOMEM);
-@@ -1091,6 +1083,18 @@ static int parse_part_sign_sha256 (socke
-     return (-1);
-   }
-+  if (se->data.server.userdb == NULL) {
-+    c_complain(
-+        LOG_NOTICE, &complain_no_users,
-+        "network plugin: Received signed network packet but can't verify it "
-+        "because no user DB has been configured. Will accept it.");
-+
-+    *ret_buffer = buffer + pss_head_length;
-+    *ret_buffer_len -= pss_head_length;
-+
-+    return (0);
-+  }
-+
-   /* Copy the hash. */
-   BUFFER_READ (pss.hash, sizeof (pss.hash));
index 704962f75b79fd639681309cc95c01d8324daf9f..b0ef7c48477c64b5e9fc5f82b091cb859929312d 100644 (file)
@@ -1,40 +1,38 @@
 --- a/src/rrdtool.c
 +++ b/src/rrdtool.c
-@@ -82,6 +82,7 @@ static const char *config_keys[] =
-       "HeartBeat",
-       "RRARows",
-       "RRATimespan",
-+      "RRASingle",
-       "XFF",
-       "WritesPerSecond",
-       "RandomTimeout"
-@@ -103,6 +104,8 @@ static rrdcreate_config_t rrdcreate_conf
-       /* timespans = */ NULL,
-       /* timespans_num = */ 0,
-+      /* rrasingle = */ 0,
+@@ -60,6 +60,7 @@ typedef struct rrd_queue_s rrd_queue_t;
+ static const char *config_keys[] = {
+     "CacheTimeout", "CacheFlush",      "CreateFilesAsync", "DataDir",
+     "StepSize",     "HeartBeat",       "RRARows",          "RRATimespan",
++    "RRASingle",
+     "XFF",          "WritesPerSecond", "RandomTimeout"};
+ static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
+@@ -77,6 +78,8 @@ static rrdcreate_config_t rrdcreate_conf
+     /* timespans = */ NULL,
+     /* timespans_num = */ 0,
++    /* rrasingle = */ 0,
 +
-       /* consolidation_functions = */ NULL,
-       /* consolidation_functions_num = */ 0,
+     /* consolidation_functions = */ NULL,
+     /* consolidation_functions_num = */ 0,
  
-@@ -1110,6 +1113,14 @@ static int rrd_config (const char *key,
+@@ -950,6 +953,12 @@ static int rrd_config(const char *key, c
+           /* compar = */ rrd_compare_numeric);
  
-               free (value_copy);
-       }
-+      else if (strcasecmp ("RRASingle", key) == 0)
-+      {
+     free(value_copy);
++  } else if (strcasecmp ("RRASingle", key) == 0) {
 +              if (IS_TRUE (value))
 +              {
 +                      rrdcreate_config.rrasingle = 1;
 +                      NOTICE ("rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs");
 +              }
-+      }
-       else if (strcasecmp ("XFF", key) == 0)
-       {
-               double tmp = atof (value);
+   } else if (strcasecmp("XFF", key) == 0) {
+     double tmp = atof(value);
+     if ((tmp < 0.0) || (tmp >= 1.0)) {
 --- a/src/utils_rrdcreate.c
 +++ b/src/utils_rrdcreate.c
-@@ -213,6 +213,9 @@ static int rra_get (char ***ret, const v
+@@ -180,6 +180,9 @@ static int rra_get(char ***ret, const va
      rts_num = rra_timespans_num;
    }
  
 +    rra_types_num = 1;
 +
    rra_max = rts_num * rra_types_num;
-   assert (rra_max > 0);
+   assert(rra_max > 0);
  
 --- a/src/utils_rrdcreate.h
 +++ b/src/utils_rrdcreate.h
-@@ -41,6 +41,8 @@ struct rrdcreate_config_s
+@@ -40,6 +40,8 @@ struct rrdcreate_config_s {
    int *timespans;
    size_t timespans_num;
  
index 22990bd5be2bacd88482bbfb4057229f196b5c92..30c6f7f5fc4f59debf2e8b0ef99a8fa0a2fbe1f4 100644 (file)
@@ -1,11 +1,11 @@
 --- a/src/daemon/configfile.c
 +++ b/src/daemon/configfile.c
-@@ -111,7 +111,7 @@ static cf_global_option_t cf_global_opti
-       {"BaseDir",     NULL, PKGLOCALSTATEDIR},
-       {"PIDFile",     NULL, PIDFILE},
-       {"Hostname",    NULL, NULL},
--      {"FQDNLookup",  NULL, "true"},
-+      {"FQDNLookup",  NULL, "false"},
-       {"Interval",    NULL, NULL},
-       {"ReadThreads", NULL, "5"},
-       {"WriteThreads", NULL, "5"},
+@@ -104,7 +104,7 @@ static cf_global_option_t cf_global_opti
+     {"BaseDir", NULL, 0, PKGLOCALSTATEDIR},
+     {"PIDFile", NULL, 0, PIDFILE},
+     {"Hostname", NULL, 0, NULL},
+-    {"FQDNLookup", NULL, 0, "true"},
++    {"FQDNLookup", NULL, 0, "false"},
+     {"Interval", NULL, 0, NULL},
+     {"ReadThreads", NULL, 0, "5"},
+     {"WriteThreads", NULL, 0, "5"},
diff --git a/utils/collectd/patches/200-fix-git-describe-error.patch b/utils/collectd/patches/200-fix-git-describe-error.patch
deleted file mode 100644 (file)
index 71f2036..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/version-gen.sh
-+++ b/version-gen.sh
-@@ -2,7 +2,7 @@
- DEFAULT_VERSION="5.5.3.git"
--VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
-+#VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
- if test -z "$VERSION"; then
-       VERSION="$DEFAULT_VERSION"
index 495c80f3ae42a0be67b618bf663314ffc536c25e..3d878d750d764f425634dff3a19abeb56a560ac3 100644 (file)
@@ -1,11 +1,11 @@
 --- a/src/daemon/plugin.c
 +++ b/src/daemon/plugin.c
-@@ -1149,7 +1149,7 @@ static int plugin_insert_read (read_func
-       int status;
-       llentry_t *le;
+@@ -1099,7 +1099,7 @@ static int plugin_insert_read(read_func_
+   int status;
+   llentry_t *le;
  
--      rf->rf_next_read = cdtime ();
-+      rf->rf_next_read = cdtime () + (cdtime_t) 1073741824; //delay first read 1s
-       rf->rf_effective_interval = rf->rf_interval;
+-  rf->rf_next_read = cdtime();
++  rf->rf_next_read = cdtime() + (cdtime_t) 1073741824; //delay first read 1s
+   rf->rf_effective_interval = rf->rf_interval;
  
-       pthread_mutex_lock (&read_lock);
+   pthread_mutex_lock(&read_lock);
index 1dc6c5894022005ea06440daa7823402d64b15e4..d12295ad4ddd492fdb0a901280032fbe0b32a714 100644 (file)
@@ -1,11 +1,11 @@
 --- a/src/olsrd.c
 +++ b/src/olsrd.c
-@@ -658,7 +658,7 @@ static int olsrd_read (void) /* {{{ */
+@@ -585,7 +585,7 @@ static int olsrd_read(void) /* {{{ */
    if (fh == NULL)
-     return (-1);
+     return -1;
  
--  fputs ("\r\n", fh);
-+  fputs ("/all \r\n", fh);
-   fflush (fh);
+-  fputs("\r\n", fh);
++  fputs("/all \r\n", fh);
+   fflush(fh);
  
-   while (fgets (buffer, sizeof (buffer), fh) != NULL)
+   while (fgets(buffer, sizeof(buffer), fh) != NULL) {
index aacf182fbff9370c5a634c0f471be80c66792e44..80e4720ac84be98fbfd515b0dad79bb6d672bf4f 100644 (file)
@@ -18,15 +18,18 @@ Reversed patch to be applied:
 
 --- a/configure.ac
 +++ b/configure.ac
-@@ -2627,7 +2627,7 @@ then
-       SAVE_CPPFLAGS="$CPPFLAGS"
-       CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
+@@ -3327,9 +3327,9 @@ if test "x$with_libmodbus" = "xyes"; the
+   SAVE_CPPFLAGS="$CPPFLAGS"
+   CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
  
--      AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
-+      AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
+-  AC_CHECK_HEADERS([modbus.h],
++  AC_CHECK_HEADERS([modbus/modbus.h],
+     [with_libmodbus="yes"],
+-    [with_libmodbus="no (modbus.h not found)"]
++    [with_libmodbus="no (modbus/modbus.h not found)"]
+   )
  
-       CPPFLAGS="$SAVE_CPPFLAGS"
- fi
+   CPPFLAGS="$SAVE_CPPFLAGS"
 --- a/src/modbus.c
 +++ b/src/modbus.c
 @@ -26,7 +26,7 @@
diff --git a/utils/collectd/patches/700-disable-sys-capability-check.patch b/utils/collectd/patches/700-disable-sys-capability-check.patch
new file mode 100644 (file)
index 0000000..9592068
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -526,11 +526,7 @@ if test "x$ac_system" = "xLinux"; then
+     [have_cpuid_h="no (cpuid.h not found)"]
+   )
+-  AC_CHECK_HEADERS([sys/capability.h],
+-    [have_capability="yes"],
+-    [have_capability="no (<sys/capability.h> not found)"]
+-  )
+-
++  have_capability="no"
+   if test "x$have_capability" = "xyes"; then
+     AC_CHECK_LIB([cap], [cap_get_proc],
+       [have_capability="yes"],
index d23b09ea1fc3bf2cf67d5500d80a6595b54c734c..69aaf791284e6f8665dddbc6f2c01db85575a7a2 100644 (file)
@@ -1,50 +1,52 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -705,6 +705,9 @@ AC_CHECK_HEADERS(net/pfvar.h,
- have_termios_h="no"
AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
+@@ -710,6 +710,11 @@ AC_CACHE_CHECK([whether clock_boottime a
+   ]
+ )
  
 +# For the iwinfo plugin
-+AC_CHECK_LIB(iwinfo, iwinfo_backend, [with_iwinfo="yes"], [with_iwinfo="no (libiwinfo not found)"], [])
-+
- # For the turbostat plugin
- have_asm_msrindex_h="no"
- AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
-@@ -5310,6 +5313,7 @@ plugin_interface="no"
++AC_CHECK_LIB([iwinfo], [iwinfo_backend],
++    [with_iwinfo="yes"],
++    [with_iwinfo="no (libiwinfo not found)"]
++)
+ #
+ # Checks for typedefs, structures, and compiler characteristics.
+@@ -6127,6 +6132,7 @@ plugin_ipc="no"
  plugin_ipmi="no"
  plugin_ipvs="no"
  plugin_irq="no"
 +plugin_iwinfo="no"
  plugin_load="no"
  plugin_log_logstash="no"
- plugin_memory="no"
-@@ -5713,6 +5717,7 @@ AC_PLUGIN([ipmi],        [$plugin_ipmi],
- AC_PLUGIN([iptables],    [$with_libiptc],      [IPTables rule counters])
- AC_PLUGIN([ipvs],        [$plugin_ipvs],       [IPVS connection statistics])
- AC_PLUGIN([irq],         [$plugin_irq],        [IRQ statistics])
-+AC_PLUGIN([iwinfo],      [$with_iwinfo],       [Common iwinfo wireless statistics])
- AC_PLUGIN([java],        [$with_java],         [Embed the Java Virtual Machine])
- AC_PLUGIN([load],        [$plugin_load],       [System load])
- AC_PLUGIN([logfile],     [yes],                [File logging plugin])
-@@ -6042,6 +6047,7 @@ Configuration:
-     oracle  . . . . . . . $with_oracle
-     protobuf-c  . . . . . $have_protoc_c
-     python  . . . . . . . $with_python
-+    iwinfo  . . . . . . . $with_iwinfo
-   Features:
-     daemon mode . . . . . $enable_daemon
-@@ -6091,6 +6097,7 @@ Configuration:
-     iptables  . . . . . . $enable_iptables
-     ipvs  . . . . . . . . $enable_ipvs
-     irq . . . . . . . . . $enable_irq
-+    iwinfo  . . . . . . . $enable_iwinfo
-     java  . . . . . . . . $enable_java
-     load  . . . . . . . . $enable_load
-     logfile . . . . . . . $enable_logfile
+ plugin_mcelog="no"
+@@ -6538,6 +6544,7 @@ AC_PLUGIN([ipmi],                [$plugi
+ AC_PLUGIN([iptables],            [$with_libiptc],           [IPTables rule counters])
+ AC_PLUGIN([ipvs],                [$plugin_ipvs],            [IPVS connection statistics])
+ AC_PLUGIN([irq],                 [$plugin_irq],             [IRQ statistics])
++AC_PLUGIN([iwinfo],              [$with_iwinfo],            [Common iwinfo wireless statistics])
+ AC_PLUGIN([java],                [$with_java],              [Embed the Java Virtual Machine])
+ AC_PLUGIN([load],                [$plugin_load],            [System load])
+ AC_PLUGIN([log_logstash],        [$plugin_log_logstash],    [Logstash json_event compatible logging])
+@@ -6899,6 +6906,7 @@ AC_MSG_RESULT([    libyajl . . . . . . .
+ AC_MSG_RESULT([    oracle  . . . . . . . $with_oracle])
+ AC_MSG_RESULT([    protobuf-c  . . . . . $have_protoc_c])
+ AC_MSG_RESULT([    protoc 3  . . . . . . $have_protoc3])
++AC_MSG_RESULT([    iwinfo  . . . . . . . $with_iwinfo])
+ AC_MSG_RESULT()
+ AC_MSG_RESULT([  Features:])
+ AC_MSG_RESULT([    daemon mode . . . . . $enable_daemon])
+@@ -6957,6 +6965,7 @@ AC_MSG_RESULT([    ipmi  . . . . . . . .
+ AC_MSG_RESULT([    iptables  . . . . . . $enable_iptables])
+ AC_MSG_RESULT([    ipvs  . . . . . . . . $enable_ipvs])
+ AC_MSG_RESULT([    irq . . . . . . . . . $enable_irq])
++AC_MSG_RESULT([    iwinfo  . . . . . . . $enable_iwinfo])
+ AC_MSG_RESULT([    java  . . . . . . . . $enable_java])
+ AC_MSG_RESULT([    load  . . . . . . . . $enable_load])
+ AC_MSG_RESULT([    logfile . . . . . . . $enable_logfile])
 --- a/src/collectd.conf.in
 +++ b/src/collectd.conf.in
-@@ -128,6 +128,7 @@
+@@ -137,6 +137,7 @@
  #@BUILD_PLUGIN_IPTABLES_TRUE@LoadPlugin iptables
  #@BUILD_PLUGIN_IPVS_TRUE@LoadPlugin ipvs
  #@BUILD_PLUGIN_IRQ_TRUE@LoadPlugin irq
@@ -52,7 +54,7 @@
  #@BUILD_PLUGIN_JAVA_TRUE@LoadPlugin java
  @BUILD_PLUGIN_LOAD_TRUE@@BUILD_PLUGIN_LOAD_TRUE@LoadPlugin load
  #@BUILD_PLUGIN_LPAR_TRUE@LoadPlugin lpar
-@@ -582,6 +583,12 @@
+@@ -720,6 +721,12 @@
  #     IgnoreSelected true
  #</Plugin>
  
@@ -67,7 +69,7 @@
  #     JVMArg "-Djava.class.path=@prefix@/share/collectd/java/collectd-api.jar"
 --- a/src/collectd.conf.pod
 +++ b/src/collectd.conf.pod
-@@ -2612,6 +2612,27 @@ and all other interrupts are collected.
+@@ -3503,6 +3503,27 @@ and all other interrupts are collected.
  
  =back
  
 +      plugin_register_config("iwinfo", iwinfo_config, config_keys, config_keys_num);
 +      plugin_register_read("iwinfo", iwinfo_read);
 +}
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -457,6 +457,13 @@ irq_la_SOURCES = irq.c
- irq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+--- a/src/types.db
++++ b/src/types.db
+@@ -269,6 +269,7 @@ voltage_threshold       value:GAUGE:U:U,
+ vs_memory               value:GAUGE:0:9223372036854775807
+ vs_processes            value:GAUGE:0:65535
+ vs_threads              value:GAUGE:0:65535
++stations                value:GAUGE:0:256
+ #
+ # Legacy types
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -983,6 +983,14 @@ irq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+ irq_la_LIBADD = libignorelist.la
  endif
  
 +if BUILD_PLUGIN_IWINFO
 +pkglib_LTLIBRARIES += iwinfo.la
-+iwinfo_la_SOURCES = iwinfo.c
-+iwinfo_la_LDFLAGS = -module -avoid-version
-+iwinfo_la_LIBADD = -liwinfo
++iwinfo_la_SOURCES = src/iwinfo.c
++#iwinfo_la_LDFLAGS = -module -avoid-version
++iwinfo_la_LDFLAGS = $(PLUGIN_LDFLAGS)
++iwinfo_la_LIBADD = -liwinfo libignorelist.la
 +endif
 +
  if BUILD_PLUGIN_JAVA
  pkglib_LTLIBRARIES += java.la
- java_la_SOURCES = java.c
---- a/src/types.db
-+++ b/src/types.db
-@@ -228,6 +228,7 @@ voltage                    value:GAUGE:U:U
- vs_memory             value:GAUGE:0:9223372036854775807
- vs_processes          value:GAUGE:0:65535
- vs_threads            value:GAUGE:0:65535
-+stations              value:GAUGE:0:256
- #
- # Legacy types
+ java_la_SOURCES = src/java.c
index 947dc546bab056b216f643298265e11e68c044b8..b39207e35d21620695fecd215e7e2de63e021e31 100644 (file)
@@ -1,11 +1,11 @@
 --- a/src/ping.c
 +++ b/src/ping.c
-@@ -655,7 +655,7 @@ static int ping_read (void) /* {{{ */
-           / ((double) (pkg_recv * (pkg_recv - 1))));
+@@ -635,7 +635,7 @@ static int ping_read(void) /* {{{ */
+                             ((double)(pkg_recv * (pkg_recv - 1))));
  
      /* Calculate drop rate. */
--    droprate = ((double) (pkg_sent - pkg_recv)) / ((double) pkg_sent);
-+    droprate = ((double) (pkg_sent - pkg_recv)) * 100 / ((double) pkg_sent);
+-    droprate = ((double)(pkg_sent - pkg_recv)) / ((double)pkg_sent);
++    droprate = ((double)(pkg_sent - pkg_recv)) * 100 / ((double)pkg_sent);
  
-     submit (hl->host, "ping", latency_average);
-     submit (hl->host, "ping_stddev", latency_stddev);
+     submit(hl->host, "ping", latency_average);
+     submit(hl->host, "ping_stddev", latency_stddev);
index 0d52b60ea4c1bab51a5bcaf280c54858404deff4..32db0821ee659ed4817d31c8d969bcdedc15a517 100644 (file)
@@ -9,12 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=coreutils
 PKG_VERSION:=8.23
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/coreutils
-PKG_MD5SUM:=abed135279f87ad6762ce57ff6d89c41
-PKG_BUILD_DEPENDS:=libpthread
+PKG_HASH:=ec43ca5bcfc62242accb46b7f121f6b684ee21ecd7d075059bf650ff9e37b82d
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 
 PKG_BUILD_PARALLEL:=1
@@ -43,6 +42,8 @@ DEPENDS_ls = +libacl +libcap
 DEPENDS_mv = +libacl
 DEPENDS_vdir = +libacl +libcap
 
+FILES_stdbuf := usr/lib/coreutils/libstdbuf.so
+
 define Package/coreutils/Default
   SECTION:=utils
   CATEGORY:=Utilities
@@ -105,6 +106,10 @@ define BuildPlugin
   define Package/$(1)/install
        $(INSTALL_DIR) $$(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/
+       $(foreach f,$(FILES_$(2)),
+               $(INSTALL_DIR) $$(1)/$(dir $(f))
+               $(INSTALL_BIN) $(PKG_INSTALL_DIR)/$(f) $$(1)/$(f)
+       )
   endef
 
   $$(eval $$(call BuildPackage,$(1)))
diff --git a/utils/crconf/Makefile b/utils/crconf/Makefile
new file mode 100644 (file)
index 0000000..6344d1a
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 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:=crconf
+PKG_VERSION:=pre2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/crconf
+PKG_HASH:=15d39b599acda93a50f473190e702d593ba13613b6ed31711f3584b5726b81b8
+
+PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/crconf
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Linux crypto layer configuraton tool
+  URL:=https://sourceforge.net/projects/crconf
+endef
+
+define Package/crconf/description
+  Linux crypto layer configuraton tool.
+  Use this to manipulate kernel Crypto API/framework stuff,
+  like drivers, templates, etc.
+  Example: https://wiki.strongswan.org/projects/strongswan/wiki/Pcrypt
+  Most interesting stuff you can find on https://wiki.strongswan.org
+endef
+
+define Package/crconf/install
+       $(INSTALL_DIR) $(1)/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/crconf $(1)/sbin
+endef
+
+$(eval $(call BuildPackage,crconf))
index 5e14052c23552857aad95114c1197a6fa9dd3bae..45497983e434290623b6a18926d45051d9ae8fca 100644 (file)
@@ -15,6 +15,7 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/ondrej1024/crelay
 PKG_SOURCE_VERSION:=V$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=e7cae6dcc299cbec86e6cbc79dd155a1489d97c9a46b3b4e5179a6ca11cc4b8b
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
index 4f187c84c648a38f7ef46f8e02f2186759529d17..6e8fbabeccc57fa21da2b22294ce03febbdb28e2 100644 (file)
@@ -10,12 +10,17 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=cryptodev-linux
-PKG_VERSION:=1.8
-PKG_RELEASE:=2
+PKG_VERSION:=1.9.git-2017-10-04
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://download.gna.org/cryptodev-linux/
-PKG_MD5SUM:=02644cc4cd02301e0b503a332eb2f0b5
+PKG_SOURCE_URL:=https://github.com/cryptodev-linux/cryptodev-linux
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=0a54e38b264d9a3bed74c642a61b88191660d0f8
+PKG_MIRROR_HASH:=af3c303afe7ff995b120add6101261a652a6478a2a69018dd740f49a8b14ed09
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Ansuel Smith <ansuelsmth@gmail.com>
 
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
@@ -35,6 +40,7 @@ define KernelPackage/cryptodev
   FILES:= \
                $(PKG_BUILD_DIR)/cryptodev.$(LINUX_KMOD_SUFFIX)
   AUTOLOAD:=$(call AutoLoad,50,$(CRYPTODEV_AUTOLOAD))
+  MODPARAMS.cryptodev:= cryptodev_verbosity=-1
 endef
 
 define KernelPackage/cryptodev/description
@@ -65,11 +71,4 @@ define Build/InstallDev
        $(CP) $(PKG_BUILD_DIR)/crypto/cryptodev.h $(STAGING_DIR)/usr/include/crypto/
 endef
 
-define KernelPackage/cryptodev/install
-       $(INSTALL_DIR) $(1)/etc/modules.d
-       $(INSTALL_DATA) ./files/cryptodev.modules $(1)/etc/modules.d/80-cryptodev
-       $(INSTALL_DIR) $(1)/lib/modules/$(LINUX_VERSION)
-       $(INSTALL_DIR) $(1)/usr/sbin
-endef
-
 $(eval $(call KernelPackage,cryptodev))
diff --git a/utils/cryptodev-linux/files/cryptodev.modules b/utils/cryptodev-linux/files/cryptodev.modules
deleted file mode 100644 (file)
index fb39fcd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-cryptodev
index 691103fbd4b56f395c467f0c7e8599b7491ff7c9..ae0c36c9402ab19e585ae43b8839a19c224021ad 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cryptsetup
-PKG_VERSION:=1.7.2
+PKG_VERSION:=1.7.5
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-2.0+ LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING COPYING.LGPL
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/cryptsetup/v1.7
-PKG_MD5SUM:=a11a140cea496961222170944db01fc1
+PKG_HASH:=2b30cd1d0dd606a53ac77b406e1d37798d4b0762fa89de6ea546201906a251bd
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
index 0560fc6a0103655f040f9c0da0f1e7addac0d17b..b28a50632ca9e61b1748a7cdd8d92db101bb92c5 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://dbus.freedesktop.org/releases/dbus/
-PKG_MD5SUM:=27b8e99ffad603b8acfa25201c6e3d5c
+PKG_HASH:=ad7dcad73ad9b0ff55819985d354eacfffe07e2eb8c763e155efc21d6001084b
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
 PKG_LICENSE:=AFL-2.1
 
index 777f92d2f0939eed1c854af5f0016d5fe66455c9..aadd7965fccb23bd442e6a1ff8809730bb2de8fa 100644 (file)
@@ -12,8 +12,8 @@ PKG_VERSION:=0.7.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://downloads.sourceforge.net/project/dfu-programmer/dfu-programmer/$(PKG_VERSION)/
-PKG_MD5SUM:=98641b0a7cf1cc8c8be3584d5552f6d8
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)/$(PKG_VERSION)
+PKG_HASH:=1db4d36b1aedab2adc976e8faa5495df3cf82dc4bf883633dc6ba71f7c4af995
 
 PKG_MAINTAINER:=Stefan Hellermann <stefan@the2masters.de>
 PKG_LICENSE:=GPL-2.0
diff --git a/utils/dfu-util/Makefile b/utils/dfu-util/Makefile
new file mode 100644 (file)
index 0000000..bd148dd
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# Copyright (C) 2017 Bruno Randolf (br1@einfach.org)
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=dfu-util
+PKG_VERSION:=0.9
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
+PKG_MAINTAINER:=Bruno Randolf <br1@einfach.org>
+PKG_HASH:=36428c6a6cb3088cad5a3592933385253da5f29f2effa61518ee5991ea38f833
+
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/dfu-util
+  SUBMENU:=
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libusb-1.0
+  TITLE:=Device Firmware Upgrade Utilities
+  URL:=http://dfu-util.sourceforge.net/
+  MAINTAINER:=Bruno Randolf <br1@einfach.org>
+endef
+
+define Package/dfu-util/description
+       dfu-util is a host side implementation of the DFU 1.0 and DFU 1.1
+       specifications of the USB forum. DFU is intended to download and
+       upload firmware to/from devices connected over USB.
+endef
+
+define Package/dfu-util/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dfu-util $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,dfu-util))
diff --git a/utils/digitemp/Makefile b/utils/digitemp/Makefile
new file mode 100644 (file)
index 0000000..e0b3350
--- /dev/null
@@ -0,0 +1,89 @@
+#
+# Copyright (C) 2009-2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# Comment: This makefile is based on the oldpackage makefile by acinonyx / nbd
+# https://dev.openwrt.org/browser/packages/utils/digitemp/Makefile
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=digitemp
+PKG_VERSION:=3.7.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/bcl/digitemp.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=be824bbbc81189931bf4b130a8acc39288d75662
+PKG_MAINTAINER:=Jasper Scholte <NightNL@outlook.com>
+PKG_LICENSE:=GPL-2.0+
+PKG_MIRROR_HASH:=490f9c94c671aa74ce0ef4fbc95231644f3aa7023d2b947714ed55fd712672f2
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/digitemp/Default
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=DigiTemp is a simple to use program for reading values from 1-wire devices.
+  URL:=http://www.digitemp.com
+endef
+
+define Package/digitemp/Default/description
+       DigiTemp is a simple to use program for reading values from 1-wire devices.
+       Its main use is for reading temperature sensors, but it also reads counters,
+       and understands the 1-wire hubs with devices on different branches of the network.
+endef
+
+define Package/digitemp
+$(call Package/digitemp/Default)
+  TITLE += (serial version)
+endef
+
+define Package/digitemp/description
+$(call Package/digitemp/Default/description)
+       This package is built without USB support.
+endef
+
+define Package/digitemp-usb
+$(call Package/digitemp/Default)
+  TITLE += (USB version)
+  DEPENDS += +libusb-compat
+endef
+
+define Package/digitemp-usb/description
+$(call Package/digitemp/Default/description)
+       This package is built with USB support.
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS) -DLINUX $(TARGET_CPPFLAGS) \
+                       -I./src -I./userial" \
+               LIBS="$(TARGET_LDFLAGS)" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               ds9097 ds9097u
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS) -DLINUX $(TARGET_CPPFLAGS) \
+                       -I./src -I./userial -DOWUSB" \
+               LIBS="$(TARGET_LDFLAGS) -lusb -lm -DOWUSB" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               clean ds2490
+endef
+
+define Package/digitemp/install
+       $(INSTALL_DIR) $(1)/usr/bin/
+       $(CP) $(PKG_BUILD_DIR)/digitemp_{DS9097,DS9097U} $(1)/usr/bin/
+endef
+
+define Package/digitemp-usb/install
+       $(INSTALL_DIR) $(1)/usr/bin/
+       $(CP) $(PKG_BUILD_DIR)/digitemp_DS2490 $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,digitemp))
+$(eval $(call BuildPackage,digitemp-usb))
diff --git a/utils/digitemp/patches/0001_add_missing_includes.patch b/utils/digitemp/patches/0001_add_missing_includes.patch
new file mode 100644 (file)
index 0000000..3774951
--- /dev/null
@@ -0,0 +1,72 @@
+--- a/src/ds2438.c     2015-12-22 04:47:28.000000000 +0100
++++ b/src/ds2438.c     2017-07-02 22:52:36.671830316 +0200
+@@ -5,6 +5,7 @@
+    Licensed under GPL v2
+    ----------------------------------------------------------------------- */
+ #include <stdio.h>
++#include <sys/types.h>
+ #include "ownet.h"
+ #include "ad26.h"
+
+--- a/userial/ad26.c   2015-12-22 04:47:28.000000000 +0100
++++ b/userial/ad26.c   2017-07-02 22:58:03.902024016 +0200
+@@ -33,7 +33,7 @@
+ #include "ownet.h"
+ #include "ad26.h"
+ #include "owproto.h"
+-
++#include "sys/types.h"
+
+ extern int   owBlock(int,int,uchar *,int);
+ extern void  setcrc8(int,uchar);
+
+--- a/userial/cnt1d.c  2015-12-22 04:47:28.000000000 +0100
++++ b/userial/cnt1d.c  2017-07-02 22:56:26.850619935 +0200
+@@ -29,6 +29,7 @@
+ //  Version: 2.00
+ //
+ //
++#include "sys/types.h"
+ #include "ownet.h"
+
+ // external One Wire functions from nework layer
+
+--- a/userial/crcutil.c        2015-12-22 04:47:28.000000000 +0100
++++ b/userial/crcutil.c        2017-07-02 22:55:13.631039389 +0200
+@@ -29,6 +29,7 @@
+
+ // Include files
+ #include "ownet.h"
++#include "sys/types.h"
+
+ // Local subroutines
+ void setcrc16(int,ushort);
+
+--- a/userial/ds9097u/owtrnu.c 2015-12-22 04:47:28.000000000 +0100
++++ b/userial/ds9097u/owtrnu.c 2017-07-02 23:00:52.320902969 +0200
+@@ -39,6 +39,7 @@
+ //                        Added file I/O operations
+ //
+
++#include "sys/types.h"
+ #include "ownet.h"
+ #include "ds2480.h"
+
+--- a/userial/ioutil.c 2015-12-22 04:47:28.000000000 +0100
++++ b/userial/ioutil.c 2017-07-02 22:55:48.378843851 +0200
+@@ -36,6 +36,7 @@
+ #include <string.h>
+ #include <ctype.h>
+ #include "ownet.h"
++#include "sys/types.h"
+
+ #ifdef __MC68K__
+ #include <PalmOS.h>
+
+--- a/userial/owproto.h        2015-12-22 04:47:28.000000000 +0100
++++ b/userial/owproto.h        2017-07-02 22:58:59.561664538 +0200
+@@ -1,3 +1,4 @@
++#include "sys/types.h"
+ /* Prototypes for userial driver functions */
+
+ /* From other low level userial files */
index cae94d05db387e24929c8ad31221d9f9b856e6f0..dea0e2c32ca46d4dd9fb975c983d48c186e9ec9e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2016 OpenWrt.org
+# Copyright (C) 2007-2017 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:=dmidecode
-PKG_VERSION:=3.0
-PKG_RELEASE:=3
+PKG_VERSION:=3.1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME)
-PKG_MD5SUM:=7ec35bb193729c1d593a1460b59d82d24b89102ab23fd0416e6cf4325d077e45
+PKG_HASH:=d766ce9b25548c59b1e7e930505b4cad9a7bb0b904a1a391fbb604d529781ac0
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=GPL-2.0
diff --git a/utils/domoticz/Makefile b/utils/domoticz/Makefile
new file mode 100644 (file)
index 0000000..d8dee81
--- /dev/null
@@ -0,0 +1,108 @@
+#
+# Copyright (C) 2016 - 2017  Stijn Tintel <stijn@linux-ipv6.be>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=domoticz
+PKG_VERSION_MAJOR:=3
+PKG_VERSION_PATCH:=8153
+PKG_VERSION:=$(PKG_VERSION_MAJOR).$(PKG_VERSION_PATCH)
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/domoticz/domoticz/archive/$(PKG_VERSION)/$(PKG_SOURCE)
+PKG_HASH:=5ea8f37f2ef900e9bd17b1b5375e75bfdec4f09001e3e2e0b647a260989d014c
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=License.txt
+
+PKG_BUILD_PARALLEL:=1
+PKG_USE_MIPS16:=0
+
+CMAKE_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/domoticz
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Open Source Home Automation System
+  URL:=http://domoticz.com/
+  MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
+  USERID:=domoticz=6144:domoticz=6144
+  DEPENDS:= \
+       +boost \
+       +boost-date_time \
+       +boost-system \
+       +boost-thread \
+       +libcurl \
+       +libmosquittopp \
+       +libopenssl \
+       +libopenzwave \
+       +libsqlite3 \
+       +libstdcpp \
+       +zlib
+endef
+
+define Package/domoticz/description
+  Domoticz is a Home Automation System that lets you monitor and configure various devices like: Lights, Switches, various sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water and much more. Notifications/Alerts can be sent to any mobile device.
+endef
+
+CMAKE_OPTIONS += \
+       -DCMAKE_BUILD_TYPE=Release \
+       -DUSE_BUILTIN_MQTT=no \
+       -DUSE_BUILTIN_SQLITE=no \
+       -DUSE_STATIC_BOOST=no \
+       -DUSE_STATIC_LIBSTDCXX=no \
+       -DUSE_STATIC_OPENZWAVE=no \
+       -DUSE_PYTHON=no
+
+TARGET_CXXFLAGS+=-DWITH_GPIO
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       # Fix APPVERSION to suppress update popup
+       sed -i 's/#define APPVERSION.*/#define APPVERSION $(PKG_VERSION_PATCH)/' \
+                $(PKG_BUILD_DIR)/appversion.default
+       # Remove unwanted scripts
+       cd $(PKG_BUILD_DIR)/scripts && rm -rf \
+               buienradar_rain_example.pl \
+               _domoticz_main* \
+               download_update.sh \
+               dzVents/{.gitignore,documentation,examples,generated_scripts} \
+               dzVents/runtime/{integration-tests,misc/smoothing.xlsx,tests} \
+               logrotate/ \
+               lua_parsers/example* \
+               lua/*demo.lua \
+               python/ \
+               readme.txt \
+               restart_domoticz \
+               templates/All.Python \
+               update_domoticz
+       # Remove *.md
+       cd $(PKG_BUILD_DIR) && $(FIND) -name '*.md' -delete
+endef
+
+define Package/domoticz/install
+       $(INSTALL_DIR) $(1)/etc/config $(1)/etc/hotplug.d/tty $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/domoticz.hotplug $(1)/etc/hotplug.d/tty/domoticz
+       $(INSTALL_BIN) ./files/domoticz.init $(1)/etc/init.d/domoticz
+       $(INSTALL_CONF) ./files/domoticz.config $(1)/etc/config/domoticz
+       $(INSTALL_DIR) $(1)/usr/share/domoticz $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/Config $(1)/usr/share/domoticz/openzwave
+       $(CP) $(PKG_INSTALL_DIR)/usr/scripts $(1)/usr/share/domoticz/
+       $(CP) $(PKG_INSTALL_DIR)/usr/www $(1)/usr/share/domoticz/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/domoticz $(1)/usr/bin/domoticz
+endef
+
+define Package/domoticz/conffiles
+/etc/config/domoticz
+/var/lib/domoticz/
+endef
+
+$(eval $(call BuildPackage,domoticz))
diff --git a/utils/domoticz/files/domoticz.config b/utils/domoticz/files/domoticz.config
new file mode 100644 (file)
index 0000000..b300f3f
--- /dev/null
@@ -0,0 +1,28 @@
+config domoticz
+       option disabled '1'
+       option loglevel '1'
+       option syslog 'daemon'
+       # option sslcert '/path/to/ssl.crt'
+       # option sslkey '/path/to/ssl.key'
+       # option sslpass 'passphrase'
+       option sslwww '0'
+       # CAUTION - by default, /var is not persistent accross reboots
+       # Don't forget the trailing / - domoticz requires it
+       option userdata '/var/lib/domoticz/'
+
+#config device
+#      option product '658/200/0'
+#      option symlink 'ttyACM-aeotec-zstick-g5'
+
+#config device
+#      option serial '526359'
+#      option symlink 'ttyUSB-serial'
+
+#config device
+#      option usbif '2-1:1.0'
+#      option symlink 'ttyUSB-port1'
+
+#config device
+#      option product '67b/2303/202'
+#      option usbif '2-2:1.0'
+#      option symlink 'ttyUSB-port2'
diff --git a/utils/domoticz/files/domoticz.hotplug b/utils/domoticz/files/domoticz.hotplug
new file mode 100644 (file)
index 0000000..7138175
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+. /lib/functions.sh
+
+[ "$SUBSYSTEM" = "tty" ] || exit 0
+
+add() {
+       local cfg="$1"
+       local product serial symlink usbif
+
+       [ -c "/dev/$DEVICENAME" ] || return
+
+       config_get product "$cfg" product
+       config_get serial "$cfg" serial
+       config_get symlink "$cfg" symlink
+       config_get usbif "$cfg" usbif
+
+       [ -z "$product" -a -z "$serial" -a -z "$usbif" ] && return
+
+       . "/sys/$DEVPATH/device/../uevent"
+       SERIAL="$(cat /sys/$DEVPATH/device/../../serial)" 2>/dev/null
+       USBIF="$(echo $DEVPATH | awk -F/ 'BEGIN {i=3}; /ACM/ {i=2}; END {print $(NF-i)}')"
+
+       [ -n "$product" -a "$product" != "$PRODUCT" ] && return
+       [ -n "$serial" -a "$serial" != "$SERIAL" ] && return
+       [ -n "$usbif" -a "$usbif" != "$USBIF" ] && return
+
+       chgrp domoticz "/dev/$DEVICENAME"
+       chmod g+rw "/dev/$DEVICENAME"
+
+       [ -n "$symlink" ] && ln -s "/dev/$DEVICENAME" "/dev/$symlink"
+}
+
+remove() {
+       local cfg="$1"
+       local symlink
+
+       config_get symlink "$cfg" symlink
+
+       [ "/dev/$DEVICENAME" = "$(readlink /dev/$symlink)" ] && rm "/dev/$symlink"
+}
+
+config_load "domoticz"
+config_foreach "$ACTION" device
diff --git a/utils/domoticz/files/domoticz.init b/utils/domoticz/files/domoticz.init
new file mode 100644 (file)
index 0000000..26e0c42
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/sh /etc/rc.common
+
+START=99
+USE_PROCD=1
+PROG=/usr/bin/domoticz
+PIDFILE=/var/run/domoticz.pid
+
+start_domoticz() {
+       local section="$1"
+       local loglevel sslcert sslpass sslwww syslog userdata
+
+       config_get loglevel "$section" "loglevel"
+       config_get sslcert "$section" "sslcert"
+       config_get sslkey "$section" "sslkey"
+       config_get sslpass "$section" "sslpass"
+       config_get sslwww "$section" "sslwww"
+       config_get syslog "$section" "syslog"
+       config_get userdata "$section" "userdata"
+
+       [ -n "$loglevel" ] && procd_append_param command -loglevel "$loglevel"
+       [ -n "$syslog" ] && procd_append_param command -syslog "$syslog"
+       [ -n "$userdata" ] && {
+               mkdir -p "${userdata}/generated_scripts"
+               chmod -R 0770 "$userdata"
+               chown -R domoticz:domoticz "$userdata"
+               procd_append_param command -userdata "$userdata"
+       }
+       [ -n "$sslcert" -a "${sslwww:-0}" -gt 0 ] && {
+               procd_append_param command -sslcert "$sslcert"
+               procd_append_param command -sslwww "$sslwww"
+               [ -n "$sslkey" ] && procd_append_param command -sslkey "$sslkey"
+               [ -n "$sslpass" ] && procd_append_param command -sslpass "$sslpass"
+       } || procd_append_param command -sslwww 0
+}
+
+start_service() {
+       procd_open_instance
+
+       procd_set_param command "$PROG"
+       procd_append_param command -scripts /usr/share/domoticz/scripts/
+       procd_append_param command -wwwroot /usr/share/domoticz/www/
+
+       config_load "domoticz"
+       config_get_bool disabled "$section" "disabled" 0
+       [ "$disabled" -gt 0 ] && return 1
+       config_foreach start_domoticz domoticz
+
+       procd_set_param pidfile "$PIDFILE"
+       procd_set_param respawn
+       procd_set_param stdout 0
+       procd_set_param term_timeout 10
+       procd_set_param user "domoticz"
+
+       procd_close_instance
+}
diff --git a/utils/domoticz/patches/900_fix-build.patch b/utils/domoticz/patches/900_fix-build.patch
new file mode 100644 (file)
index 0000000..b9fbebd
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -645,8 +645,6 @@ else()
+   target_link_libraries(domoticz -lrt ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} ${CURL_LIBRARIES} pthread ${LUA_LIBRARIES} ${MQTT_LIBRARIES} ${SQLite_LIBRARIES} ${CMAKE_DL_LIBS} ${TELLDUS_LIBRARIES} ${EXECINFO_LIBRARIES})
+ ENDIF()
+-ADD_PRECOMPILED_HEADER(domoticz "main/stdafx.h")
+-
+ IF(CMAKE_COMPILER_IS_GNUCXX)
+   option(USE_STATIC_LIBSTDCXX "Build with static libgcc/libstdc++ libraries" YES)
+   IF(USE_STATIC_LIBSTDCXX)
diff --git a/utils/domoticz/patches/901_no-udev.patch b/utils/domoticz/patches/901_no-udev.patch
new file mode 100644 (file)
index 0000000..0ea9dd9
--- /dev/null
@@ -0,0 +1,42 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -579,39 +579,6 @@ IF(OpenZWave)
+   target_link_libraries(domoticz ${OpenZWave})
+   include_directories(${CMAKE_SOURCE_DIR}/hardware/openzwave)
+   add_definitions(-DWITH_OPENZWAVE)
+-  # open-zwave needs libudev
+-  IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+-    set(IOKIT_LIBRARY "-framework IOKit -framework CoreFoundation" CACHE FILEPATH "IOKit framework" FORCE)
+-    target_link_libraries(domoticz ${IOKIT_LIBRARY})
+-  else()
+-    IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+-      MESSAGE(STATUS "Building on FreeBSD, libudev not needed!")
+-      FIND_PATH(ICONV_INCLUDE_DIR iconv.h)
+-      FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
+-      IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
+-        SET(ICONV_FOUND TRUE)
+-        #target_link_libraries(domoticz ${ICONV_INCLUDE_DIR})
+-        target_link_libraries(domoticz ${ICONV_LIBRARIES} -lrt)
+-        message(STATUS ${ICONV_LIBRARIES})
+-      else()
+-        MESSAGE(FATAL_ERROR "libiconv not found on your system")
+-      ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
+-    else()
+-      find_library(UDEV NAMES libudev.a)
+-      IF(UDEV)
+-        message(STATUS ${UDEV})
+-        target_link_libraries(domoticz ${UDEV} -lrt -lresolv)
+-      else()
+-        find_library(UDEV NAMES libudev.so)
+-        IF(UDEV)
+-           message(STATUS ${UDEV})
+-           target_link_libraries(domoticz ${UDEV} -lrt -lresolv)
+-        else()
+-           MESSAGE(FATAL_ERROR "LIB UDEV not found on your system, see install.txt how to get them installed.\nsudo apt-get install libudev-dev")
+-        ENDIF(UDEV)
+-      ENDIF(UDEV)
+-    ENDIF()
+-  ENDIF()
+ else()
+   MESSAGE(STATUS "==== OpenZWave not found, support disabled!")
+ ENDIF(OpenZWave)
diff --git a/utils/domoticz/patches/902_disable-libusb.patch b/utils/domoticz/patches/902_disable-libusb.patch
new file mode 100644 (file)
index 0000000..f4f03c3
--- /dev/null
@@ -0,0 +1,39 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -521,20 +521,23 @@ else()
+   MESSAGE(FATAL_ERROR "cURL not found on your system, see install.txt how to get them installed. (for example 'sudo apt-get install curl libcurl4-openssl-dev')")
+ ENDIF(CURL_FOUND)
+-find_path(LIBUSB_INCLUDE_DIR usb.h
+-   HINTS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
+-find_library(LIBUSB_LIBRARY NAMES usb
+-   HINTS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
+-set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY})
++option(WITH_LIBUSB "Enable libusb support" NO)
++  if(WITH_LIBUSB)
++  find_path(LIBUSB_INCLUDE_DIR usb.h
++     HINTS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
++  find_library(LIBUSB_LIBRARY NAMES usb
++     HINTS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
++  set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY})
+-find_package_handle_standard_args(LIBUSB  DEFAULT_MSG  LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
+-IF(LIBUSB_FOUND)
+-  MESSAGE(STATUS "LIBUSB found at: ${LIBUSB_LIBRARIES}")
+-  add_definitions(-DWITH_LIBUSB)
+-  target_link_libraries(domoticz ${LIBUSB_LIBRARIES})
+-else()
+-  MESSAGE(STATUS "==== LibUSB not found, support for TE923/Voltcraft disabled!")
+-ENDIF(LIBUSB_FOUND)
++  find_package_handle_standard_args(LIBUSB  DEFAULT_MSG  LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
++  IF(LIBUSB_FOUND)
++    MESSAGE(STATUS "LIBUSB found at: ${LIBUSB_LIBRARIES}")
++    add_definitions(-DWITH_LIBUSB)
++    target_link_libraries(domoticz ${LIBUSB_LIBRARIES})
++  else()
++    MESSAGE(STATUS "==== LibUSB not found, support for TE923/Voltcraft disabled!")
++  ENDIF(LIBUSB_FOUND)
++endif(WITH_LIBUSB)
+ #
+ # Find MD5/RMD160/SHA library
diff --git a/utils/domoticz/patches/903_fhs.patch b/utils/domoticz/patches/903_fhs.patch
new file mode 100644 (file)
index 0000000..11e531a
--- /dev/null
@@ -0,0 +1,407 @@
+diff --git a/hardware/EvohomeScript.cpp b/hardware/EvohomeScript.cpp
+index 5258fc55..0a44e97c 100644
+--- a/hardware/EvohomeScript.cpp
++++ b/hardware/EvohomeScript.cpp
+@@ -30,7 +30,7 @@
+ #include <string>
+-extern std::string szUserDataFolder;
++extern std::string szScriptsFolder;
+ CEvohomeScript::CEvohomeScript(const int ID)
+@@ -143,7 +143,7 @@ void CEvohomeScript::RunScript(const char *pdata, const unsigned char length)
+                       std::string scriptname = OnAction.substr(9);
+ #if !defined WIN32
+                       if (scriptname.find("/") != 0)
+-                              scriptname = szUserDataFolder + "scripts/" + scriptname;
++                              scriptname = szScriptsFolder + "scripts/" + scriptname;
+ #endif
+                       std::string scriptparams="";
+                       //Add parameters
+diff --git a/hardware/OpenZWave.cpp b/hardware/OpenZWave.cpp
+index 1f5c341c..24db61c9 100644
+--- a/hardware/OpenZWave.cpp
++++ b/hardware/OpenZWave.cpp
+@@ -948,7 +948,7 @@ bool COpenZWave::OpenSerialConnector()
+       m_nodes.clear();
+       m_bNeedSave = false;
+-      std::string ConfigPath = szStartupFolder + "Config/";
++      std::string ConfigPath = "/usr/share/domoticz/openzwave/";
+       std::string UserPath = ConfigPath;
+       if (szStartupFolder != szUserDataFolder)
+       {
+diff --git a/main/EventSystem.cpp b/main/EventSystem.cpp
+index 4eff02fd..f2b17b97 100644
+--- a/main/EventSystem.cpp
++++ b/main/EventSystem.cpp
+@@ -33,9 +33,11 @@ extern "C" {
+ #endif
+ }
++extern std::string szScriptsFolder;
+ extern std::string szUserDataFolder;
+ extern http::server::CWebServerHelper m_webservers;
++static std::string dzv_Dir;
+ static std::string m_printprefix;
+ #ifdef ENABLE_PYTHON
+@@ -115,7 +117,6 @@ static const _tJsonMap JsonMap[] =
+       { NULL,                                 NULL,                                           tString         }
+ };
+-
+ CEventSystem::CEventSystem(void)
+ {
+       m_stoprequested = false;
+@@ -149,7 +150,7 @@ void CEventSystem::StartEventSystem()
+       GetCurrentScenesGroups();
+       GetCurrentUserVariables();
+ #ifdef ENABLE_PYTHON
+-    Plugins::PythonEventsInitialize(szUserDataFolder);
++    Plugins::PythonEventsInitialize(szScriptsFolder);
+ #endif
+       m_thread = boost::shared_ptr<boost::thread>(new boost::thread(boost::bind(&CEventSystem::Do_Work, this)));
+@@ -179,11 +180,11 @@ void CEventSystem::SetEnabled(const bool bEnabled)
+ void CEventSystem::LoadEvents()
+ {
+-      std::string dzv_Dir,s;
++      std::string s;
+ #ifdef WIN32
+-      dzv_Dir = szUserDataFolder + "scripts\\dzVents\\generated_scripts\\";
++      dzv_Dir = szUserDataFolder + "generated_scripts\\";
+ #else
+-      dzv_Dir = szUserDataFolder + "scripts/dzVents/generated_scripts/";
++      dzv_Dir = szUserDataFolder + "generated_scripts/";
+ #endif
+       boost::unique_lock<boost::shared_mutex> eventsMutexLock(m_eventsMutex);
+       _log.Log(LOG_STATUS, "EventSystem: reset all events...");
+@@ -274,18 +275,18 @@ void CEventSystem::LoadEvents()
+ void CEventSystem::Do_Work()
+ {
+ #ifdef WIN32
+-      m_lua_Dir = szUserDataFolder + "scripts\\lua\\";
+-      m_dzv_Dir = szUserDataFolder + "scripts\\dzVents\\runtime\\";
++      m_lua_Dir = szScriptsFolder + "lua\\";
++      m_dzv_Dir = szScriptsFolder + "dzVents\\runtime\\";
+ #else
+-      m_lua_Dir = szUserDataFolder + "scripts/lua/";
+-      m_dzv_Dir = szUserDataFolder + "scripts/dzVents/runtime/";
++      m_lua_Dir = szScriptsFolder + "lua/";
++      m_dzv_Dir = szScriptsFolder + "dzVents/runtime/";
+ #endif
+ #ifdef ENABLE_PYTHON
+ #ifdef WIN32
+-      m_python_Dir = szUserDataFolder + "scripts\\python\\";
++      m_python_Dir = szScriptsFolder + "python\\";
+ #else
+-      m_python_Dir = szUserDataFolder + "scripts/python/";
++      m_python_Dir = szScriptsFolder + "python/";
+ #endif
+ #endif
+       m_stoprequested = false;
+@@ -1426,9 +1427,9 @@ void CEventSystem::EvaluateEvent(const std::string &reason, const uint64_t Devic
+               {
+                       std::string dzv_scripts;
+ #ifdef WIN32
+-                      dzv_scripts = szUserDataFolder + "scripts\\dzVents\\scripts\\";
++                      dzv_scripts = szScriptsFolder + "dzVents\\scripts\\";
+ #else
+-                      dzv_scripts = szUserDataFolder + "scripts/dzVents/scripts/";
++                      dzv_scripts = szScriptsFolder + "dzVents/scripts/";
+ #endif
+                       DirectoryListing(FileEntries, dzv_scripts, false, true);
+                       for (itt = FileEntries.begin(); itt != FileEntries.end(); ++itt)
+@@ -2404,7 +2405,7 @@ bool CEventSystem::parseBlocklyActions(const std::string &Actions, const std::st
+                       }
+ #if !defined WIN32
+                       if (sPath.find("/") != 0)
+-                              sPath = szUserDataFolder + "scripts/" + sPath;
++                              sPath = szScriptsFolder + sPath;
+ #endif
+                       m_sql.AddTaskItem(_tTaskItem::ExecuteScript(0.2f, sPath, sParam));
+@@ -3508,13 +3509,16 @@ void CEventSystem::EvaluateLua(const std::string &reason, const std::string &fil
+               {
+                       std::stringstream lua_DirT;
+-                      lua_DirT << szUserDataFolder <<
++                      lua_DirT << szScriptsFolder <<
+ #ifdef WIN32
+-                      "scripts\\dzVents\\";
++                      "dzVents\\";
+ #else
+-                      "scripts/dzVents/";
++                      "dzVents/";
+ #endif
++                      lua_pushstring(lua_state, "generated_script_path");
++                      lua_pushstring(lua_state, dzv_Dir.c_str());
++                      lua_rawset(lua_state, -3);
+                       lua_pushstring(lua_state, "script_path");
+                       lua_pushstring(lua_state, lua_DirT.str().c_str());
+                       lua_rawset(lua_state, -3);
+@@ -4695,9 +4699,9 @@ namespace http {
+                               std::stringstream template_file;
+ #ifdef WIN32
+-                              template_file << szUserDataFolder << "scripts\\templates\\" << eventType << "." << interpreter;
++                              template_file << szScriptsFolder << "templates\\" << eventType << "." << interpreter;
+ #else
+-                              template_file << szUserDataFolder << "scripts/templates/" << eventType << "." << interpreter;
++                              template_file << szScriptsFolder << "templates/" << eventType << "." << interpreter;
+ #endif
+                               std::ifstream file;
+                               std::stringstream template_content;
+diff --git a/main/EventsPythonModule.cpp b/main/EventsPythonModule.cpp
+index f69e7219..2d97562e 100644
+--- a/main/EventsPythonModule.cpp
++++ b/main/EventsPythonModule.cpp
+@@ -108,7 +108,7 @@
+         
+         int PythonEventsInitalized = 0;
+-        bool PythonEventsInitialize(std::string szUserDataFolder) {
++        bool PythonEventsInitialize(std::string szScriptsFolder) {
+             
+             if (!Plugins::Py_LoadLibrary())
+             {
+@@ -131,9 +131,9 @@
+             
+             std::string ssPath;
+ #ifdef WIN32
+-            ssPath  = szUserDataFolder + "scripts\\python\\;";
++            ssPath  = szScriptsFolder + "python\\;";
+ #else
+-            ssPath  = szUserDataFolder + "scripts/python/:";
++            ssPath  = szScriptsFolder + "python/:";
+ #endif
+             
+             std::wstring sPath = std::wstring(ssPath.begin(), ssPath.end());
+diff --git a/main/LuaHandler.cpp b/main/LuaHandler.cpp
+index 8fdcb278..c2ad98ff 100644
+--- a/main/LuaHandler.cpp
++++ b/main/LuaHandler.cpp
+@@ -22,7 +22,7 @@ extern "C" {
+ #include "mainworker.h"
+ #include "../hardware/hardwaretypes.h"
+-extern std::string szUserDataFolder;
++extern std::string szScriptsFolder;
+ int CLuaHandler::l_domoticz_updateDevice(lua_State* lua_state)
+ {
+@@ -155,9 +155,9 @@ bool CLuaHandler::executeLuaScript(const std::string &script, const std::string
+ {
+       std::stringstream lua_DirT;
+ #ifdef WIN32
+-      lua_DirT << szUserDataFolder << "scripts\\lua_parsers\\";
++      lua_DirT << szScriptsFolder << "lua_parsers\\";
+ #else
+-      lua_DirT << szUserDataFolder << "scripts/lua_parsers/";
++      lua_DirT << szScriptsFolder << "lua_parsers/";
+ #endif
+       std::string lua_Dir = lua_DirT.str();
+diff --git a/main/SQLHelper.cpp b/main/SQLHelper.cpp
+index 491aa5a2..d529243a 100644
+--- a/main/SQLHelper.cpp
++++ b/main/SQLHelper.cpp
+@@ -633,6 +633,7 @@ const char *sqlCreateMobileDevices =
+ "[LastUpdate] DATETIME DEFAULT(datetime('now', 'localtime'))"
+ ");";
++extern std::string szScriptsFolder;
+ extern std::string szUserDataFolder;
+ CSQLHelper::CSQLHelper(void)
+@@ -3683,9 +3684,9 @@ uint64_t CSQLHelper::UpdateValueInt(const int HardwareID, const char* ID, const
+                               //Execute possible script
+                               std::string scriptname;
+ #ifdef WIN32
+-                              scriptname = szUserDataFolder + "scripts\\domoticz_main.bat";
++                              scriptname = szScriptsFolder + "domoticz_main.bat";
+ #else
+-                              scriptname = szUserDataFolder + "scripts/domoticz_main";
++                              scriptname = szScriptsFolder + "domoticz_main";
+ #endif
+                               if (file_exist(scriptname.c_str()))
+                               {
+@@ -6641,7 +6642,7 @@ bool CSQLHelper::HandleOnOffAction(const bool bIsOn, const std::string &OnAction
+                       std::string scriptname = OnAction.substr(9);
+ #if !defined WIN32
+                       if (scriptname.find("/") != 0)
+-                              scriptname = szUserDataFolder + "scripts/" + scriptname;
++                              scriptname = szScriptsFolder + scriptname;
+ #endif
+                       std::string scriptparams="";
+                       //Add parameters
+@@ -6675,7 +6676,7 @@ bool CSQLHelper::HandleOnOffAction(const bool bIsOn, const std::string &OnAction
+               std::string scriptname = OffAction.substr(9);
+ #if !defined WIN32
+               if (scriptname.find("/") != 0)
+-                      scriptname = szUserDataFolder + "scripts/" + scriptname;
++                      scriptname = szScriptsFolder + scriptname;
+ #endif
+               std::string scriptparams = "";
+               int pindex = scriptname.find(' ');
+diff --git a/main/WebServer.cpp b/main/WebServer.cpp
+index f8471791..d2cf10b2 100644
+--- a/main/WebServer.cpp
++++ b/main/WebServer.cpp
+@@ -59,6 +59,7 @@
+ #define round(a) ( int ) ( a + .5 )
++extern std::string szScriptsFolder;
+ extern std::string szUserDataFolder;
+ extern std::string szWWWFolder;
+@@ -2987,9 +2988,9 @@ namespace http {
+                       if (scriptname.find("..") != std::string::npos)
+                               return;
+ #ifdef WIN32
+-                      scriptname = szUserDataFolder + "scripts\\" + scriptname;
++                      scriptname = szScriptsFolder + scriptname;
+ #else
+-                      scriptname = szUserDataFolder + "scripts/" + scriptname;
++                      scriptname = szScriptsFolder + scriptname;
+ #endif
+                       if (!file_exist(scriptname.c_str()))
+                               return;
+diff --git a/main/domoticz.cpp b/main/domoticz.cpp
+index 5ef96f68..52599b14 100644
+--- a/main/domoticz.cpp
++++ b/main/domoticz.cpp
+@@ -136,6 +136,7 @@ static const _facilities facilities[] =
+ }; 
+ std::string logfacname = "user";
+ #endif
++std::string szScriptsFolder;
+ std::string szStartupFolder;
+ std::string szUserDataFolder;
+ std::string szWWWFolder;
+@@ -696,6 +697,19 @@ int main(int argc, char**argv)
+                       szUserDataFolder = szroot;
+       }
++      szScriptsFolder=szStartupFolder;
++      if (cmdLine.HasSwitch("-scripts"))
++      {
++              if (cmdLine.GetArgumentCount("-scripts") != 1)
++              {
++                      _log.Log(LOG_ERROR, "Please specify a path for scripts directory");
++                      return 1;
++              }
++              std::string szroot = cmdLine.GetSafeArgument("-scripts", 0, "");
++              if (szroot.size() != 0)
++                      szScriptsFolder = szroot;
++      }
++
+       if (cmdLine.HasSwitch("-startupdelay"))
+       {
+               if (cmdLine.GetArgumentCount("-startupdelay") != 1)
+diff --git a/main/mainworker.cpp b/main/mainworker.cpp
+index 803690e1..e89a783b 100644
+--- a/main/mainworker.cpp
++++ b/main/mainworker.cpp
+@@ -159,6 +159,7 @@
+ #define round(a) ( int ) ( a + .5 )
++extern std::string szScriptsFolder;
+ extern std::string szStartupFolder;
+ extern std::string szUserDataFolder;
+ extern std::string szWWWFolder;
+@@ -1473,8 +1474,8 @@ void MainWorker::Do_Work()
+                       m_sql.GetPreferencesVar("ReleaseChannel", nValue);
+                       bool bIsBetaChannel = (nValue != 0);
+-                      std::string scriptname = szUserDataFolder + "scripts/download_update.sh";
+-                      std::string strparm = szUserDataFolder;
++                      std::string scriptname = szScriptsFolder + "download_update.sh";
++                      std::string strparm = szScriptsFolder;
+                       if (bIsBetaChannel)
+                               strparm += " /beta";
+diff --git a/notifications/NotificationHTTP.cpp b/notifications/NotificationHTTP.cpp
+index decff3b4..632e4e66 100644
+--- a/notifications/NotificationHTTP.cpp
++++ b/notifications/NotificationHTTP.cpp
+@@ -6,7 +6,7 @@
+ #include "../main/SQLHelper.h"
+ #include "../main/Logger.h"
+-extern std::string szUserDataFolder;
++extern std::string szScriptsFolder;
+ CNotificationHTTP::CNotificationHTTP() : CNotificationBase(std::string("http"), OPTIONS_NONE)
+ {
+@@ -105,7 +105,7 @@ bool CNotificationHTTP::SendMessageImplementation(
+               std::string scriptparams = "";
+ #if !defined WIN32
+               if (scriptname.find("/") != 0)
+-                      scriptname = szUserDataFolder + "scripts/" + scriptname;
++                      scriptname = szScriptsFolder + scriptname;
+ #endif
+               //Add parameters
+               uPos = scriptname.find(" ");
+diff --git a/push/GooglePubSubPush.cpp b/push/GooglePubSubPush.cpp
+index 359a7d7c..46e489f6 100644
+--- a/push/GooglePubSubPush.cpp
++++ b/push/GooglePubSubPush.cpp
+@@ -22,7 +22,7 @@ extern "C" {
+ using namespace boost::python;
+ #endif
+-extern std::string szUserDataFolder;
++extern std::string szScriptsFolder;
+ // this should be filled in by the preprocessor
+ extern const char * Python_exe;
+@@ -231,11 +231,11 @@ void CGooglePubSubPush::DoGooglePubSubPush()
+ #ifdef ENABLE_PYTHON_DECAP
+ #ifdef WIN32
+-                              python_DirT << szUserDataFolder << "scripts\\python\\";
+-                              std::string filename = szUserDataFolder + "scripts\\python\\" + "googlepubsub.py";
++                              python_DirT << szScriptsFolder << "python\\";
++                              std::string filename = szScriptsFolder + "python\\" + "googlepubsub.py";
+ #else
+-                              python_DirT << szUserDataFolder << "scripts/python/";
+-                              std::string filename = szUserDataFolder + "scripts/python/" + "googlepubsub.py";
++                              python_DirT << szScriptsFolder << "python/";
++                              std::string filename = szScriptsFolder + "python/" + "googlepubsub.py";
+ #endif
+                               wchar_t * argv[1];
+diff --git a/scripts/dzVents/runtime/dzVents.lua b/scripts/dzVents/runtime/dzVents.lua
+index d0dfa869..8370d6a9 100644
+--- a/scripts/dzVents/runtime/dzVents.lua
++++ b/scripts/dzVents/runtime/dzVents.lua
+@@ -1,8 +1,9 @@
+ local currentPath = globalvariables['script_path']
++local generatedScriptPath = globalvariables['generated_script_path']
+ local triggerReason = globalvariables['script_reason']
+ _G.scriptsFolderPath = currentPath .. 'scripts' -- global
+-_G.generatedScriptsFolderPath = currentPath .. 'generated_scripts' -- global
++_G.generatedScriptsFolderPath = generatedScriptPath -- global
+ _G.dataFolderPath = currentPath .. 'data' -- global
+ package.path = package.path .. ';' .. currentPath .. '?.lua'
+@@ -10,7 +11,7 @@ package.path = package.path .. ';' .. currentPath .. 'runtime/?.lua'
+ package.path = package.path .. ';' .. currentPath .. 'runtime/device-adapters/?.lua'
+ package.path = package.path .. ';' .. currentPath .. 'dzVents/?.lua'
+ package.path = package.path .. ';' .. currentPath .. 'scripts/?.lua'
+-package.path = package.path .. ';' .. currentPath .. 'generated_scripts/?.lua'
++package.path = package.path .. ';' .. generatedScriptPath .. '?.lua'
+ package.path = package.path .. ';' .. currentPath .. 'data/?.lua'
+ local EventHelpers = require('EventHelpers')
index 82b8a68f4b2b0cfa9e05d28d1ae43cd7bf4ecb56..52d050c4b36af83909f3eb136473da1ffa6e0210 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dosfstools
-PKG_VERSION:=4.0
-PKG_RELEASE:=2
+PKG_VERSION:=4.1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://github.com/dosfstools/dosfstools/releases/download/v$(PKG_VERSION)/ \
                http://fossies.org/linux/misc
-PKG_MD5SUM:=9037738953559d1efe04fc5408b6846216cc0138f7f9d32de80b6ec3c35e7daf
+PKG_HASH:=e6b2aca70ccc3fe3687365009dd94a2e18e82b688ed4e260e04b7412471cc173
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=GPL-3.0+
diff --git a/utils/dosfstools/patches/0001-mkfs-Default-to-64-32-heads-sectors-for-targets-smal.patch b/utils/dosfstools/patches/0001-mkfs-Default-to-64-32-heads-sectors-for-targets-smal.patch
deleted file mode 100644 (file)
index 76672e0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-From 1e76e5778a1885452939a79d9145b80634a5b023 Mon Sep 17 00:00:00 2001
-From: Andreas Bombe <aeb@debian.org>
-Date: Wed, 11 May 2016 03:44:58 +0200
-Subject: [PATCH] mkfs: Default to 64/32 heads/sectors for targets smaller than
- 512 MB
-
-This may put defaults in certain use cases a little bit more in line
-with the old defaults in versions up to 3.0.28. It has mostly aesthetic
-value in most cases.
-
-Signed-off-by: Andreas Bombe <aeb@debian.org>
----
- src/mkfs.fat.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
---- a/src/mkfs.fat.c
-+++ b/src/mkfs.fat.c
-@@ -519,6 +519,16 @@ static void establish_params(struct devi
-     unsigned int cluster_size = 4;  /* starting point for FAT12 and FAT16 */
-     int def_root_dir_entries = 512;
-+    if (info->size < 512 * 1024 * 1024) {
-+      /*
-+       * These values are more or less meaningless, but we can at least
-+       * use less extreme values for smaller filesystems where the large
-+       * dummy values signifying LBA only access are not needed.
-+       */
-+      sec_per_track = 32;
-+      heads = 64;
-+    }
-+
-     if (info->type != TYPE_FIXED) {
-       /* enter default parameters for floppy disks if the size matches */
-       switch (info->size / 1024) {
index 72a932dfd53d3a5eb1fcb77c3915d712ab717c56..ea9332082169e9140547fd2aa7544b1d1b899a44 100644 (file)
@@ -23,5 +23,5 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
 -AC_SEARCH_LIBS(iconv_open, iconv)
 +AC_CHECK_LIB(iconv, iconv_open)
  
- AC_CONFIG_FILES([Makefile src/Makefile src/version.h
-                manpages/Makefile manpages/mkfs.fat.8
+ # xxd (distributed with vim) is used in the testsuite
+ AC_CHECK_PROG([XXD_FOUND], [xxd], [yes])
index 2ca4abf38515f8debfb6e15447f4f30e9874416a..d0efb353f02c589210a212221805070c63856ef8 100644 (file)
@@ -8,20 +8,21 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dump1090
-PKG_VERSION:=2016-11-26
+PKG_VERSION:=2017-06-01
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/mutability/dump1090.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=fb63bdc2a61f0169b3c21b33bcdc99f202685b78
+PKG_SOURCE_VERSION:=b155fdb458c3241ab375d1f2b12fbb6a9f8a8a3a
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=ff1bc142107d367c6c58ccc5dbcec822c251a683e43e3b771ab4a33a9012f602 
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING LICENSE
 
-PKG_BUILD_DEPENDS:=librtlsdr
+PKG_BUILD_DEPENDS:=libusb
 
 include $(INCLUDE_DIR)/package.mk
 
index 8df01a6c3ffd71496a5b22733229d3295c7890c1..51106fa251bb4e742b0d2f60ec1d3f4824a8e866 100644 (file)
@@ -1,16 +1,16 @@
 #!/bin/sh
 uci batch <<-EOF
-       set uhttpd.xupnpd=uhttpd
-       set uhttpd.xupnpd.listen_http='0.0.0.0:8080 [::]:8080'
-       set uhttpd.xupnpd.home=/usr/share/dump1090
-       set uhttpd.xupnpd.rfc1918_filter=1
-       set uhttpd.xupnpd.max_requests=3
-       set uhttpd.xupnpd.max_connections=100
-       set uhttpd.xupnpd.script_timeout=60
-       set uhttpd.xupnpd.network_timeout=30
-       set uhttpd.xupnpd.http_keepalive=20
-       set uhttpd.xupnpd.tcp_keepalive=1
-       set uhttpd.xupnpd.index_page='index.html index.htm gmap.html'
+       set uhttpd.dump1090=uhttpd
+       set uhttpd.dump1090.listen_http='0.0.0.0:8080 [::]:8080'
+       set uhttpd.dump1090.home=/usr/share/dump1090
+       set uhttpd.dump1090.rfc1918_filter=1
+       set uhttpd.dump1090.max_requests=3
+       set uhttpd.dump1090.max_connections=100
+       set uhttpd.dump1090.script_timeout=60
+       set uhttpd.dump1090.network_timeout=30
+       set uhttpd.dump1090.http_keepalive=20
+       set uhttpd.dump1090.tcp_keepalive=1
+       set uhttpd.dump1090.index_page='index.html index.htm gmap.html'
        commit uhttpd
 EOF
 exit 0
index 471b0e5f9b8b9b0f06c2733ba05a02f900906265..ef35abdd0529fbeaa78c3482706eb02e60b8da71 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=dvtm-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.brain-dump.org/projects/dvtm/
-PKG_MD5SUM:=887e162a3abe2ad8e86caefab20cdd63
+PKG_HASH:=8f2015c05e2ad82f12ae4cf12b363d34f527a4bbc8c369667f239e4542e1e510
 PKG_MAINTAINER:=Yunfan Jiang <jyf1987@gmail.com>
 
 PKG_LICENSE:=MIT/X
index e5f3567a80d26474f2d570fbd7852678e166a915..7f1c76f0301f56b0a88c1f6a1a0147397fde25c7 100644 (file)
@@ -13,6 +13,7 @@ PKG_RELEASE:=1
 PKG_REV:=07538893fb6c2a9539678c45f9dbbf1e4f222b46
 PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=397395a471c0b5af1a173666ba21a5bedb4c3423a6e37c545c3627bed73dcb76
 PKG_SOURCE_URL:=git://github.com/tcatm/$(PKG_NAME).git
 PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
diff --git a/utils/eudev/Config.in b/utils/eudev/Config.in
deleted file mode 100644 (file)
index 6cd3970..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-# udev package config
-
-menu "Configuration"
-       depends on PACKAGE_eudev
-
-config EUDEV_EXTRA_ata_id
-       bool "Install eudev ata_id callout"
-       default y
-       help
-         ata_id - udev callout to read product/serial number
-         from ATA drives
-
-config EUDEV_EXTRA_blkid
-       bool "Use blkid to identify block devices"
-       default y
-       help
-         blkid - make use of libblkid to identify block devices
-
-config EUDEV_EXTRA_cdrom_id
-       bool "Install eudev cdrom_id callout"
-       default y
-       help
-         cdrom_id - udev callout to determine the capabilities
-         of optical drives and media
-
-config EUDEV_EXTRA_collect
-       bool "Install eudev collect"
-       default n
-       help
-         Adds ID to the list governed by <checkpoint>
-
-config EUDEV_EXTRA_input_id
-       bool "Install input_id callout"
-       default y
-       help
-        input_id - udev callout to classify input devices
-
-config EUDEV_EXTRA_kmod
-       bool "Use kmod for loading kernel modules"
-       default n
-       help
-         kmod - make use of kmod to load kernel modules on demand
-
-config EUDEV_EXTRA_mtd_probe
-       bool "Install mtd_probe callout"
-       default y
-       help
-         mtd_probe - udev callout to probe mtd devices
-
-config EUDEV_EXTRA_rule_generator
-       bool "Install (legacy) eudev rule_generator"
-       default n
-       help
-
-config EUDEV_EXTRA_scsi_id
-       bool "Install eudev scsi_id callout"
-       default y
-       help
-         scsi_id - retrieve and generate a unique SCSI identifier
-
-config EUDEV_EXTRA_v4l_id
-       bool "Install eudev v4l_id callout"
-       default y
-       help
-         v4l_id - udev callout to identify Video4Linux devices
-
-
-endmenu
diff --git a/utils/eudev/Makefile b/utils/eudev/Makefile
deleted file mode 100644 (file)
index 9c42b74..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-#
-# Copyright (C) 2006-2008 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:=eudev
-PKG_VERSION:=3.2
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://dev.gentoo.org/~blueness/eudev/
-PKG_MD5SUM:=7e42d9b9ed8162021665139520676367
-PKG_LICENSE:=GPL-2.0
-
-include $(INCLUDE_DIR)/package.mk
-
-PKG_BUILD_DEPENDS:=gperf/host
-PKG_FIXUP:=autoreconf
-PKG_INSTALL=1
-
-define Package/libudev
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=Dynamic device management subsystem
-  URL:=https://wiki.gentoo.org/wiki/Project:Eudev
-  MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
-endef
-
-define Package/eudev
-  SECTION:=base
-  CATEGORY:=Base system
-  TITLE:=Dynamic device management subsystem
-  URL:=https://wiki.gentoo.org/wiki/Project:Eudev
-  MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
-  MENU:=1
-  DEPENDS:=+EUDEV_EXTRA_blkid:libblkid +EUDEV_EXTRA_kmod:libkmod +librt +libudev
-  PROVIDES:=udev
-  CONFLICTS:=udev
-endef
-
-define Package/eudev/description
-udev allows Linux users to have a dynamic /dev directory and it
-provides the ability to have persistent device names.
-eudev is a fork of systemd-udev with the goal of obtaining better
-compatibility with existing software such as OpenRC and Upstart, older
-kernels, various toolchains and anything else required by users and
-various distributions.
-endef
-
-define Package/eudev/conffiles
-/etc/udev/udev.conf
-endef
-
-define Package/eudev/config
-       source "$(SOURCE)/Config.in"
-endef
-
-CONFIGURE_ARGS += \
-       --prefix=/usr --exec-prefix= --sysconfdir=/etc \
-       --libexecdir=/lib/udev --sbindir=/sbin \
-       --disable-hwdb --disable-introspection --disable-manpages \
-       --disable-selinux \
-       $(if $(CONFIG_EUDEV_EXTRA_blkid),--enable-blkid,--disable-blkid) \
-       $(if $(CONFIG_EUDEV_EXTRA_kmod),--enable-kmod,--disable-kmod)
-
-
-eudev-extra-lib-bin-$(CONFIG_EUDEV_EXTRA_ata_id) += ata_id
-
-eudev-extra-rules-$(CONFIG_EUDEV_EXTRA_blkid) += 60-persistent-storage.rules
-
-eudev-extra-lib-bin-$(CONFIG_EUDEV_EXTRA_cdrom_id) += cdrom_id
-eudev-extra-rules-$(CONFIG_EUDEV_EXTRA_cdrom_id) += 60-cdrom_id.rules
-
-eudev-extra-lib-bin-$(CONFIG_EUDEV_EXTRA_collect) += collect
-
-eudev-extra-rules-$(CONFIG_EUDEV_EXTRA_input_id) += 60-persistent-input.rules
-
-eudev-extra-lib-bin-$(CONFIG_EUDEV_EXTRA_mtd_probe) += mtd_probe
-eudev-extra-rules-$(CONFIG_EUDEV_EXTRA_mtd_probe) += 75-probe_mtd.rules
-
-eudev-extra-lib-bin-$(CONFIG_EUDEV_EXTRA_scsi_id) += scsi_id
-
-eudev-extra-lib-bin-$(CONFIG_EUDEV_EXTRA_v4l_id) += v4l_id
-eudev-extra-rules-$(CONFIG_EUDEV_EXTRA_v4l_id) += 60-persistent-v4l.rules
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/libudev.h $(1)/usr/include
-       $(INSTALL_DIR) $(1)/usr/share/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/udev.pc $(1)/usr/share/pkgconfig
-       $(INSTALL_DIR) $(1)/lib
-       $(CP) $(PKG_INSTALL_DIR)/lib/libudev.so* $(1)/lib
-       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/lib/pkgconfig/libudev.pc $(1)/usr/lib/pkgconfig
-endef
-
-define Package/libudev/install
-       $(INSTALL_DIR) $(1)/lib
-       $(CP) $(PKG_INSTALL_DIR)/lib/libudev.so* $(1)/lib
-endef
-
-define Package/eudev/install
-       $(INSTALL_DIR) $(1)/etc/udev/rules.d
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/udev/udev.conf $(1)/etc/udev
-
-       $(INSTALL_DIR) $(1)/sbin
-       $(INSTALL_BIN) \
-               $(PKG_INSTALL_DIR)/usr/bin/udevadm \
-               $(PKG_INSTALL_DIR)/sbin/udevd \
-               $(1)/sbin
-
-       $(INSTALL_DIR) $(1)/lib/udev/rules.d
-       $(INSTALL_DATA) \
-               $(addprefix $(PKG_INSTALL_DIR)/lib/udev/rules.d/, \
-                       $(eudev-extra-rules-y)) \
-               $(addprefix $(PKG_INSTALL_DIR)/lib/udev/rules.d/, \
-                       50-udev-default.rules \
-                       60-block.rules \
-                       60-drm.rules \
-                       60-evdev.rules \
-                       60-persistent-alsa.rules \
-                       60-persistent-storage-tape.rules \
-                       60-serial.rules \
-                       64-btrfs.rules \
-                       70-mouse.rules \
-                       75-net-description.rules \
-                       78-sound-card.rules \
-                       80-net-name-slot.rules) \
-               $(1)/lib/udev/rules.d
-
-ifneq ($(eudev-extra-lib-bin-y),)
-               $(INSTALL_BIN) \
-                       $(addprefix $(PKG_INSTALL_DIR)/lib/udev/, \
-                               $(eudev-extra-lib-bin-y)) \
-                       $(1)/lib/udev/
-endif
-endef
-
-$(eval $(call BuildPackage,eudev))
-$(eval $(call BuildPackage,libudev))
diff --git a/utils/eudev/patches/0001-mtd_probe-uses-stdint_h.patch b/utils/eudev/patches/0001-mtd_probe-uses-stdint_h.patch
deleted file mode 100644 (file)
index 2ae5634..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: eudev-3.1.5/src/mtd_probe/mtd_probe.h
-===================================================================
---- eudev-3.1.5.orig/src/mtd_probe/mtd_probe.h
-+++ eudev-3.1.5/src/mtd_probe/mtd_probe.h
-@@ -18,6 +18,7 @@
-  */
- #include <mtd/mtd-user.h>
-+#include <stdint.h>
- #include "macro.h"
index e85deeb4b4c5b0996a19548bfe36d71b7932be6e..c9d76b7c7404ab6c1607d7affae99f6a0b525081 100644 (file)
@@ -13,6 +13,7 @@ PKG_VERSION:=1.33
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=9716be17dadc496f15861e41e17980be9d444de856bc2e5b9a732f9ce826b8dd
 PKG_SOURCE_URL:=git://anongit.freedesktop.org/evtest
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
diff --git a/utils/f2fs-tools/Makefile b/utils/f2fs-tools/Makefile
deleted file mode 100644 (file)
index 6a39bc7..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-# 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:=f2fs-tools
-PKG_VERSION:=1.7.0
-PKG_RELEASE:=1
-
-PKG_LICENSE:=GPLv2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/
-PKG_MD5SUM:=9db22274264f0c88dbee012f257917b1
-
-PKG_FIXUP:=autoreconf
-PKG_BUILD_PARALLEL:=1
-PKG_INSTALL:=1
-
-PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/f2fs-tools/Default
-  SECTION:=utils
-  CATEGORY:=Utilities
-  SUBMENU:=Filesystem
-  DEPENDS:=+libf2fs
-  URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git
-endef
-
-define Package/mkf2fs
-  $(Package/f2fs-tools/Default)
-  TITLE:=Utility for creating a Flash-Friendly File System (F2FS)
-endef
-
-define Package/f2fsck
-  $(Package/f2fs-tools/Default)
-  TITLE:=Utility for checking/repairing a Flash-Friendly File System (F2FS)
-endef
-
-define Package/f2fs-tools
-  $(Package/f2fs-tools/Default)
-  TITLE:=Tools for Flash-Friendly File System (F2FS)
-  DEPENDS += +mkf2fs +f2fsck
-endef
-
-define Package/libf2fs
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=Library for Flash-Friendly File System (F2FS) tools
-  DEPENDS:=+libuuid
-endef
-
-define Package/libf2fs/install
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) \
-               $(PKG_INSTALL_DIR)/usr/lib/libf2fs.so* $(1)/usr/lib/
-endef
-
-define Package/mkf2fs/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.f2fs $(1)/usr/sbin
-endef
-
-define Package/f2fsck/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.f2fs $(1)/usr/sbin
-       ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/defrag.f2fs
-       ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/dump.f2fs
-       ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/sload.f2fs
-       ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/resize.f2fs
-endef
-
-define Package/f2fs-tools/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/f2fstat $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fibmap.f2fs $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/parse.f2fs $(1)/usr/sbin
-endef
-
-$(eval $(call BuildPackage,libf2fs))
-$(eval $(call BuildPackage,mkf2fs))
-$(eval $(call BuildPackage,f2fsck))
-$(eval $(call BuildPackage,f2fs-tools))
diff --git a/utils/f2fs-tools/patches/001-compile.patch b/utils/f2fs-tools/patches/001-compile.patch
deleted file mode 100644 (file)
index 2ff6ee8..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -20,14 +20,9 @@ AC_DEFINE([F2FS_MINOR_VERSION], m4_bpats
-                               [\([0-9]*\).\([0-9]*\)\(\w\|\W\)*], [\2]),
-                               [Minor version for f2fs-tools])
--AC_CHECK_FILE(.git,
--      AC_DEFINE([F2FS_TOOLS_DATE],
--              "m4_bpatsubst(f2fs_tools_gitdate,
--              [\([0-9-]*\)\(\w\|\W\)*], [\1])",
--              [f2fs-tools date based on Git commits]),
--      AC_DEFINE([F2FS_TOOLS_DATE],
-+AC_DEFINE([F2FS_TOOLS_DATE],
-               "f2fs_tools_date",
--              [f2fs-tools date based on Source releases]))
-+              [f2fs-tools date based on Source releases])
- AC_CONFIG_SRCDIR([config.h.in])
- AC_CONFIG_HEADER([config.h])
diff --git a/utils/f2fs-tools/patches/010-include-byteswap-h.patch b/utils/f2fs-tools/patches/010-include-byteswap-h.patch
deleted file mode 100644 (file)
index b8c9ff3..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/include/f2fs_fs.h
-+++ b/include/f2fs_fs.h
-@@ -12,6 +12,7 @@
- #include <inttypes.h>
- #include <linux/types.h>
- #include <sys/types.h>
-+#include <byteswap.h>
- #ifdef HAVE_CONFIG_H
- #include <config.h>
diff --git a/utils/f2fs-tools/patches/020-sload.f2fs-allow-to-build-without-libselinux.patch b/utils/f2fs-tools/patches/020-sload.f2fs-allow-to-build-without-libselinux.patch
deleted file mode 100644 (file)
index eac06c9..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-From b0a2386089fd6efade6b89094325ed8a9f8c6fff Mon Sep 17 00:00:00 2001
-From: Christian Hesse <mail@eworm.de>
-Date: Sat, 22 Oct 2016 22:06:54 +0200
-Subject: [PATCH] sload.f2fs: allow to build without libselinux
-
-Some systems do not have libselinux. Allow to build sload.f2fs without
-support for selinux.
-
-Signed-off-by: Christian Hesse <mail@eworm.de>
-Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
----
- configure.ac |  4 +++-
- fsck/sload.c | 12 +++++++++++-
- 2 files changed, 14 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index f519790..7a62328 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -54,7 +54,9 @@ AC_PATH_PROG([LDCONFIG], [ldconfig],
- # Checks for libraries.
- PKG_CHECK_MODULES([libuuid], [uuid])
--PKG_CHECK_MODULES([libselinux], [libselinux])
-+PKG_CHECK_MODULES([libselinux], [libselinux],
-+      [AC_DEFINE([HAVE_LIBSELINUX], [1], [Use libselinux])],
-+      [AC_MSG_NOTICE([libselinux not found])])
- # Checks for header files.
- AC_CHECK_HEADERS([linux/fs.h fcntl.h mntent.h stdlib.h string.h \
-diff --git a/fsck/sload.c b/fsck/sload.c
-index ea072d1..68799c1 100644
---- a/fsck/sload.c
-+++ b/fsck/sload.c
-@@ -16,8 +16,11 @@
- #include <libgen.h>
- #include <dirent.h>
- #include <mntent.h>
-+
-+#ifdef HAVE_LIBSELINUX
- #include <selinux/selinux.h>
- #include <selinux/label.h>
-+#endif
- #ifdef WITH_ANDROID
- #include <selinux/label.h>
-@@ -110,10 +113,12 @@ static int build_directory(struct f2fs_sb_info *sbi, const char *full_path,
-               handle_selabel(dentries + i, S_ISDIR(stat.st_mode),
-                                                       target_out_dir);
-+#ifdef HAVE_LIBSELINUX
-               if (sehnd && selabel_lookup(sehnd, &dentries[i].secon,
-                                       dentries[i].path, stat.st_mode) < 0)
-                       ERR_MSG("Cannot lookup security context for %s\n",
-                                               dentries[i].path);
-+#endif
-               dentries[i].pino = dir_ino;
-@@ -174,6 +179,7 @@ static int build_directory(struct f2fs_sb_info *sbi, const char *full_path,
-                       MSG(1, "Error unknown file type\n");
-               }
-+#ifdef HAVE_LIBSELINUX
-               if (dentries[i].secon) {
-                       inode_set_selinux(sbi, dentries[i].ino, dentries[i].secon);
-                       MSG(1, "File = %s \n----->SELinux context = %s\n",
-@@ -184,10 +190,12 @@ static int build_directory(struct f2fs_sb_info *sbi, const char *full_path,
-                                       dentries[i].gid, dentries[i].capabilities);
-               }
-+              free(dentries[i].secon);
-+#endif
-+
-               free(dentries[i].path);
-               free(dentries[i].full_path);
-               free((void *)dentries[i].name);
--              free(dentries[i].secon);
-       }
-       free(dentries);
-@@ -218,6 +226,7 @@ int f2fs_sload(struct f2fs_sb_info *sbi, const char *from_dir,
-               return ret;
-       }
-+#ifdef HAVE_LIBSELINUX
-       if (sehnd) {
-               char *secontext = NULL;
-@@ -233,6 +242,7 @@ int f2fs_sload(struct f2fs_sb_info *sbi, const char *from_dir,
-               }
-               free(secontext);
-       }
-+#endif
-       /* update curseg info; can update sit->types */
-       move_curseg_info(sbi, SM_I(sbi)->main_blkaddr);
--- 
-2.10.0
-
index d884a95a951c7cf874a9d6b8d9608f22a2bb9f26..5376fb90e6b3209fedc6bea4af02c79b4715388c 100644 (file)
@@ -12,7 +12,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=9936aa8009438ce185bea2694a997fc1
+PKG_HASH:=ded4c9f73731cd48fec3b6bdaccce896473b6d8e337e9612e16cf1431bb1169d
 PKG_MAINTAINER:=Daniel Dickinson <lede@daniel.thecshore.com>
 
 PKG_BUILD_PARALLEL:=1
index bc062d3f5fc2bceb4f8d75abd6347b684f6a0c40..df0561a2ab71ed0ea8a9998bb62485cfb4e7dcf8 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2010-2016 OpenWrt.org
+# Copyright (C) 2010-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=flashrom
-PKG_VERSION:=0.9.9
-PKG_RELEASE:=2
+PKG_VERSION:=0.9.9.1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://download.flashrom.org/releases
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_MD5SUM:=aab9c98925d9cfb5ffb28b67a6112530
+PKG_HASH:=0e145a5b9b18c98752acf0f8329a9a260ddf030abf687416daab9f05a0f508d0
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
index 376d6b285d7fcd0d0b5ea4b44affe5b2faf342b1..581e0704a23a73f0b50361e2aef64ea60d184764 100644 (file)
@@ -1,6 +1,6 @@
 --- a/programmer.h
 +++ b/programmer.h
-@@ -557,7 +557,7 @@ enum spi_controller {
+@@ -584,7 +584,7 @@ enum spi_controller {
  #if CONFIG_DEDIPROG == 1
        SPI_CONTROLLER_DEDIPROG,
  #endif
index 50aa2a8fae3c69a4544f00afbb8ec1390a8d4e6d..63109e1f11fd17f9feaa38e07d59c62042ab91ec 100644 (file)
@@ -1,12 +1,10 @@
-diff -uprN a/linux_spi.c b/linux_spi.c
---- a/flash.h     2015-02-08 16:57:52.000000000 -0500
-+++ b/flash.h     2016-01-08 20:09:51.599387507 -0500
+--- a/flash.h
++++ b/flash.h
 @@ -30,6 +30,7 @@
  #include <stdio.h>
  #include <stdint.h>
  #include <stddef.h>
 +#include <sys/io.h>
+ #include <stdarg.h>
  #include <stdbool.h>
  #if IS_WINDOWS
- #include <windows.h>
-
index b4ef0224c936caf5bf7036e67f3a6d500e3840c0..55dca989c4b9b2f41a25931f3bff1b47ab35988f 100644 (file)
@@ -12,6 +12,7 @@ PKG_VERSION:=1.0.1
 PKG_LICENSE:=GPLv3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_MIRROR_HASH:=0c4a99179a76e8479bdc7d91c312de7fc9e6d4d54132d1b2aba836138c86440c
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/tohojo/flent
 PKG_REV:=03c72cc340def354024351b6500774b11170d5ba
@@ -21,7 +22,7 @@ PKG_SOURCE_VERSION:=$(PKG_REV)
 include $(INCLUDE_DIR)/package.mk
 
 define Package/flent-tools
-  SECTION:=util
+  SECTION:=utils
   CATEGORY:=Utilities
   TITLE:=Helper programs for the Flent test tool
   URL:=https://flent.org
index 7d0ef2dce80bb124346da6190c0e793e3809cf62..68999daef3ec135e6df5579f90e055d06defdf11 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://fontconfig.org/release/
-PKG_MD5SUM:=824d000eb737af6e16c826dd3b2d6c90
+PKG_HASH:=dc62447533bca844463a3c3fd4083b57c90f18a70506e7a9f4936b5a1e516a99
 
 PKG_FIXUP:=libtool
 PKG_INSTALL:=1
index f2ab0fc9cb3a36824230ae0d7a6e07eceee0ce53..20de09ef48c78de3b66b15d10ffa9e342cb9bde4 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gammu
-PKG_VERSION:=1.37.4
+PKG_VERSION:=1.38.4
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://dl.cihar.com/gammu/releases/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=38e6f5a48fe05a64b0f0f1dc6787f1f2
+PKG_HASH:=a8ba1dc52ee82562abd57e9546c409f2f887f45187aae012fe43af0b730611ae
 PKG_MAINTAINER:=Vitaly Protsko <villy@sft.ru>
 PKG_LICENCE:=GPL-2.0
 
diff --git a/utils/gawk/Makefile b/utils/gawk/Makefile
new file mode 100644 (file)
index 0000000..9c32cb4
--- /dev/null
@@ -0,0 +1,45 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gawk
+PKG_VERSION:=4.2.0
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNU/gawk
+
+PKG_HASH:=d4f3cd31c001fd0ed52832d4fbfbdfeaa38ad541c182f80ff8fdf87324a6a9f2
+
+PKG_LICENSE:=GPL
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/gawk
+  SECTION:=utils
+  CATEGORY:=Utilities
+  URL:=https://www.gnu.org/software/gawk/
+  TITLE:=GNU awk
+  DEPENDS:=+libncursesw +libreadline
+endef
+
+define Package/gawk/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/gawk $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib/gawk
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/gawk/* $(1)/usr/lib/gawk/
+       $(INSTALL_DIR) $(1)/usr/lib/awk
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/awk/* $(1)/usr/lib/awk/
+       $(INSTALL_DIR) $(1)/usr/share/awk
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/awk/* $(1)/usr/share/awk/
+endef
+
+$(eval $(call BuildPackage,gawk))
+
index 6f3b19cf193a27f58e61cba3a931208851e8f416..f8240e4bda0776d0514fe20790067f22452e686e 100644 (file)
@@ -13,7 +13,7 @@ PKG_LICENSE:=GPL-2.0
 
 PKG_SOURCE:=gku100.tar.gz
 PKG_SOURCE_URL:=ftp://kermit.columbia.edu/kermit/archives
-PKG_MD5SUM:=aea4fa728b9981fce41c9f2c635f2e05
+PKG_HASH:=3dbe63291277c4795255343b48b860777fb0a160163d7e1d30b1ee68585593eb
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
 PKG_MAINTAINER:=Nathaniel Wesley Filardo <nwfilardo@gmail.com>
index 62b52d6c49cdd80c841f6d00de02a5e126bbeb28..16d086be4e9b79eb84ca7a2e331228b2dfb705a7 100644 (file)
@@ -14,7 +14,6 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.franken.de/pub/crypt/mirror/ftp.gnupg.org/gcrypt/gnupg \
        ftp://ftp.gnupg.org/gcrypt/gnupg
-PKG_MD5SUM:=9bdeabf3c0f87ff21cb3f9216efdd01d
 PKG_HASH:=6b47a3100c857dcab3c60e6152e56a997f2c7862c1b8b2b25adf3884a1ae2276
 
 PKG_LICENSE:=GPL-3.0
index ee72b95083fb85ee0a5797f7f114b3dad486b8d8..5593bffab2d49932a9f88ef0e5b24e9863c17587 100644 (file)
@@ -13,19 +13,17 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME)
-PKG_MD5SUM:=68691b5de4c94f82ec4062b042b5eb63
+PKG_HASH:=03579af13a4d3fe0c5b79fa44b5f75c9f3cac6749357f1d99ce5d38c09bc2029
 
 PKG_MAINTAINER:=Pushpal Sidhu <psidhu.devel@gmail.com>
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING
 
-PKG_BUILD_DEPENDS:=libncurses libusb-1.0
-
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/scons.mk
 
 define Package/gpsd/Default
-  DEPENDS:=+librt +libncurses
+  DEPENDS+= +libusb-1.0
   URL:=http://catb.org/gpsd/
 endef
 
@@ -41,9 +39,8 @@ endef
 
 define Package/gpsd
   $(call Package/gpsd/Default)
-  SECTION:=net
-  CATEGORY:=Network
-  DEPENDS+= +libgps +libusb-1.0
+  SECTION:=utils
+  CATEGORY:=Utilities
   TITLE:=An interface daemon for GPS receivers
 endef
 
@@ -58,9 +55,9 @@ endef
 
 define Package/gpsd-clients
   $(call Package/gpsd/Default)
-  SECTION:=net
-  CATEGORY:=Network
-  DEPENDS+= +libgps +libncurses +libusb-1.0
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS+= +libncurses
   TITLE:=GPS tools and clients
 endef
 
@@ -74,7 +71,6 @@ define Package/libgps
   $(call Package/gpsd/Default)
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS+= +libcap
   TITLE:=C service library for communicating with the GPS daemon
 endef
 
@@ -104,6 +100,7 @@ SCONS_OPTIONS += \
        python=no \
        implicit_link=no \
        chrpath=no \
+       manbuild=no \
        target="$(TARGET_CROSS:-=)"
 
 define Build/InstallDev
index 96cee782d4aaadbb218a664811bf07a524f3f471..c4b709c94d9a4c37a63a83bdd1b3e0807069deb7 100644 (file)
@@ -2,31 +2,43 @@
 # Copyright (C) 2009-2011 OpenWrt.org
 START=50
 
+USE_PROCD=1
+PROG=/usr/sbin/gpsd
 NAME=gpsd
-PIDF=/var/run/$NAME.pid
-PROG=/usr/sbin/$NAME
-
-start() {
-    config_load gpsd
-    config_get device core device
-    config_get port core port
-    config_get_bool listen_globally core listen_globally
-    config_get_bool enabled core enabled
-    [ "$enabled" != "1" ] && exit
-    logger -t "$NAME" "Starting..."
-    [ ! -c "$device" ] && {
-        logger -t "$NAME" "Unable to find device $device. Exiting."
-        exit 1
-    }
-    [ "$listen_globally" != "0" ] && append args "-G"
-    $PROG -n -P $PIDF -S $port $args $device
+
+validate_section_gpsd()
+{
+       uci_validate_section gpsd gpsd "${1}" \
+               'enabled:bool:1' \
+               'device:string' \
+               'listen_globally:bool:0' \
+               'port:port:2947'
+}
+
+gpsd_instance()
+{
+       local device enabled listen_globally port
+
+       validate_section_gpsd "${1}" || {
+               echo "validation failed"
+               return 1
+       }
+
+       [ "${enabled}" = "0" ] && return 1
+
+       procd_open_instance
+       procd_set_param command "$PROG" -N -n
+
+       [ "${listen_globally}" -ne 0 ] && procd_append_param command -G
+       procd_append_param command -S "${port}"
+       procd_append_param command "${device}"
+       procd_set_param respawn
+
+       procd_close_instance
 }
 
-stop() {
-    logger -t "$NAME" "Stopping..."
-    [ -f "$PIDF" ] && {
-        read PID < "$PIDF"
-        kill -9 $PID
-        rm $PIDF
-    }
+start_service()
+{
+       config_load "${NAME}"
+       config_foreach gpsd_instance gpsd
 }
diff --git a/utils/gptfdisk/Makefile b/utils/gptfdisk/Makefile
deleted file mode 100644 (file)
index 3ce5a69..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#
-# Copyright (C) 2016 Daniel Engberg <daniel.engberg.lists@pyret.net>
-#
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gptfdisk
-PKG_VERSION:=1.0.1
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/gptfdisk
-PKG_MD5SUM:=d7f3d306b083123bcc6f5941efade586
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/gptfdisk/default
-  SECTION:=utils
-  CATEGORY:=Utilities
-  SUBMENU:=Disc
-  URL:=http://www.rodsbooks.com/gdisk
-  MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
-endef
-
-define Package/gdisk
-  $(call Package/gptfdisk/default)
-  TITLE:=GPT partition table manipulation utility
-  DEPENDS:=+libstdcpp +libuuid +libpopt
-endef
-
-define Package/gdisk/description
- GPT partition table manipulation utility with an interface
- similar to fdisk. It can read and convert MBR partitions in GPT
- but is otherwise unable to generate or modify MBR partitions.
-endef
-
-define Package/sgdisk
-  $(call Package/gptfdisk/default)
-  TITLE:=script-friendly GPT partition table manipulation utility
-  DEPENDS:=+libstdcpp +libuuid +libpopt
-endef
-
-define Package/sgdisk/description
- Script-friendly GPT partition table manipulation utility.
- It can read and convert MBR partitions in GPT but is otherwise
- unable to generate or modify MBR partitions.
- To the contrary of gdisk, its interface is geared towards scripts,
- so it takes command line arguments instead of being interactive.
- It will NOT ask confirmation before carrying out the operations.
- It has a slightly smaller footprint than gdisk tool.
-endef
-
-define Package/cgdisk
- $(call Package/gptfdisk/default)
- TITLE:=ncurses-based GPT partition table manipulation utility
- DEPENDS:=+libstdcpp +libuuid +libncurses +libpopt
-endef
-
-define Package/cgdisk/description
-ncurses-based partition table manipulation utility with GPT support.
-Similar to sfdisk, but works with GPT partitions. Shares the same limitations
-of the gdisk partition utility. While it can read and convert MBR partitions
-in GPT, it cannot modify MBR partitions on its own.
-endef
-
-define Package/gdisk/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/gdisk $(1)/usr/sbin
-endef
-
-define Package/sgdisk/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/sgdisk $(1)/usr/sbin
-endef
-
-define Package/cgdisk/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/cgdisk $(1)/usr/sbin
-endef
-
-$(eval $(call BuildPackage,gdisk))
-$(eval $(call BuildPackage,sgdisk))
-$(eval $(call BuildPackage,cgdisk))
index 6ee0697c6217cf92989c0034528680b4afc6a080..0b7d5daf1dbbef89885c8b067b68545a82c12e44 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/grep
-PKG_MD5SUM:=afdd61c7221434722671baf002ac9267
+PKG_HASH:=246a8fb37e82aa33d495b07c22fdab994c039ab0f818538eac81b01e78636870
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
index 83f3e384bcb36b88a06fc110f0dd0dcf8d3e9dc9..38850557757b34500f2dc0090c56603553aaaeff 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/gzip
-PKG_MD5SUM:=c4abae2ddd5c6f39c6f8169693cc7ac0
+PKG_HASH:=eccbaa178c7801618c887956f1668d45bb57863a9d2678bfc3e36d01fb951904
 PKG_LICENSE:=GPL-3.0+
 
 PKG_INSTALL:=1
diff --git a/utils/hamlib/Makefile b/utils/hamlib/Makefile
new file mode 100644 (file)
index 0000000..d3efbcb
--- /dev/null
@@ -0,0 +1,100 @@
+#
+# Copyright (C) 2014-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:=hamlib
+PKG_VERSION:=3.0.1
+PKG_RELEASE:=1
+PKG_HASH:=3fec97ea326d02aa8f35834c4af34194a3f544e6212f391397d788c566b44e32
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/hamlib
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Vasilis Tsiligiannis <acinonyx@openwrt.gr>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/hamlib/Default
+  TITLE:=Ham Radio Control
+  URL:=http://hamlib.sourceforge.net
+endef
+
+define Package/hamlib/Default/description
+  Ham Radio Control Libraries is a development effort to provide a consistent
+  interface for programmers wanting to incorporate radio control in their
+  programs.
+endef
+
+define Package/hamlib
+  $(call Package/hamlib/Default)
+  TITLE+= utilities
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libhamlib
+endef
+
+define Package/hamlib/description
+  $(call Package/hamlib/Default/description)
+
+  This package contains the utilities and daemons.
+endef
+
+define Package/libhamlib/Default
+  $(call Package/hamlib/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= shared library
+endef
+
+define Package/libhamlib
+  $(call Package/libhamlib/Default)
+  DEPENDS:=+libusb-1.0
+  MENU:=1
+endef
+
+define Package/libhamlib/description
+  $(call Package/hamlib/Default/description)
+
+  This package contains the hamlib shared library.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/hamlib
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/hamlib/*.h $(1)/usr/include/hamlib
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhamlib.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hamlib.pc $(1)/usr/lib/pkgconfig/
+endef
+
+CONFIGURE_ARGS+= \
+       --disable-html-matrix \
+       --disable-winradio \
+       --without-readline \
+       --without-cxx-binding \
+       --with-pic \
+
+CONFIGURE_VARS+= \
+       LIBUSB_LIBS="-lusb-1.0" \
+
+define Package/hamlib/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/{rig,rot}* $(1)/usr/bin/
+endef
+
+define Package/libhamlib/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhamlib.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,hamlib))
+$(eval $(call BuildPackage,libhamlib))
index 1d58625e1184366ae2a33c59cbbff4131224130c..6020727d66d261fe37ba575c87edb3d0956ee357 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/haserl
-PKG_MD5SUM:=918f0b4f6cec0b438c8b5c78f2989010
+PKG_HASH:=a1b633e80f3e2638e7f8f850786e95072cfd9877f88780092996fd6aaf7ae2da
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index c5adad734b9c6a8ad2e3402b2a955a71c689da1e..1ce3a4380549dd1ea50aa117cb3bd69b6ce3dc6b 100644 (file)
@@ -8,18 +8,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=haveged
-PKG_VERSION:=1.9.1
-PKG_RELEASE:=5
+PKG_VERSION:=1.9.2
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/haveged \
                http://www.issihosts.com/$(PKG_NAME)
-PKG_MD5SUM:=9c2363ed9542a6784ff08e247182137e71f2ddb79e8e6c1ac4ad50d21ced3715
+PKG_HASH:=f77d9adbdf421b61601fa29faa9ce3b479d910f73c66b9e364ba8642ccbfbe70
 PKG_LICENSE:=GPLv3
 
 PKG_MAINTAINER:=Hannu Nyman <hannu.nyman@iki.fi>
 
 PKG_BUILD_PARALLEL:=1
+PKG_USE_MIPS16:=0
 
 include $(INCLUDE_DIR)/package.mk
 
index a0c9cca4a6732ce0a0f725737558b417cc5a4219..f7f4645a20d2212f07b9275e1ba474e805157fb2 100644 (file)
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hd-idle
-PKG_VERSION:=1.04
-PKG_RELEASE:=2
+PKG_VERSION:=1.05
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Lim Guo Wei <limguowei@gmail.com>
 PKG_LICENSE:=GPL-2.0
@@ -17,7 +17,7 @@ PKG_LICENSE_FILES:=
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=41e52e669fc59fa82ee0c2bcce1336d3
+PKG_HASH:=4efefe79d145b50e055582730d9d685e485da3df3dad90fef030036d52aa3a0c
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
index f3b552cfedd1b78dd664342b84d4c349631f1687..bc1d46228b9a14b2909d35bb0d2797110e27642d 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hdparm
-PKG_VERSION:=9.50
+PKG_VERSION:=9.52
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=d380062ad6c4b40076736efbb640f1f5
+PKG_HASH:=c3429cd423e271fa565bf584598fd751dd2e773bb7199a592b06b5a61cec4fb6
 PKG_MAINTAINER:=Richard Kunze <richard.kunze@web.de>
 PKG_LICENSE:=BSD-Style Open Source License
 
index 48cca4d77c3b11f66201faf2bab21bbf0705c556..a3a8a35d0b208939d23f323bc2c49bae729f9af1 100644 (file)
@@ -20,6 +20,7 @@ PKG_LICENSE:=GPL-2.0+
 PKG_MAINTAINER:=Simon Peter <probono@puredarwin.org>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=98ffd9ead07d6208acf7f713dc6574877d4967bdfb47bf70444ec9d44399faaa
 PKG_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/package.mk
index 4fb9b50f51b434b2397fccf4621acc3dabfd4604..88dd6b3f6aeecdcd85075f83c1d68300ace37937 100644 (file)
@@ -15,7 +15,7 @@ PKG_SOURCE_URL:=http://dl.lm-sensors.org/i2c-tools/releases/ \
                 http://fossies.org/linux/misc/
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=7104a1043d11a5e2c7b131614eb1b962
+PKG_HASH:=db5e69f2e2a6e3aa2ecdfe6a5f490b149c504468770f58921c8c5b8a7860a441
 
 PKG_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=PACKAGE_python-smbus:python
@@ -25,8 +25,8 @@ PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=COPYING
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../../lang/python/python-package.mk
+include ../../lang/python/python3-package.mk
 
 define Package/i2c/Default
   URL:=http://lm-sensors.org/wiki/I2CTools
index 3132104b4abe63573162a7406b3bc71218fd4315..23d41a33738ee5dea19ff3284df6956995eff610 100644 (file)
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=joe
-PKG_VERSION:=4.3
+PKG_VERSION:=4.4
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=@SF/joe-editor
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=5a167f5e88e62c77bb42b0145d72c466
+PKG_HASH:=a5704828bbca29acb9e200414fef522c66cdf9ce28150f402d6767da43460979
 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_MAINTAINER:=Vitaly Protsko <villy@sft.ru>
 PKG_LICENCE:=GPL-2.0
diff --git a/utils/jq/Makefile b/utils/jq/Makefile
new file mode 100644 (file)
index 0000000..7a1fcb1
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 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:=jq
+PKG_VERSION:=1.5
+PKG_RELEASE:=2
+PKG_LICENSE:=BSD
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/stedolan/jq/releases/download/jq-$(PKG_VERSION)/
+PKG_HASH:=c4d2bfec6436341113419debf479d833692cc5cdab7eb0326b5a4d4fbe9f493c
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+ifdef CONFIG_USE_MIPS16
+  TARGET_CFLAGS += -fno-ipa-sra
+endif
+
+TARGET_CFLAGS += -std=c99
+
+define Package/jq
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Lightweight and flexible command-line JSON processor.
+  URL:=https://stedolan.github.io/jq/
+  MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
+endef
+
+define Package/jq/description
+       Lightweight and flexible command-line JSON processor.
+endef
+
+define Package/jq/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,jq))
diff --git a/utils/jq/patches/001-stack-exhaustion.patch b/utils/jq/patches/001-stack-exhaustion.patch
new file mode 100644 (file)
index 0000000..8d23f61
--- /dev/null
@@ -0,0 +1,37 @@
+From 2d38a12d686a5156d4e7afb1fed7851805590582 Mon Sep 17 00:00:00 2001
+From: W-Mark Kubacki <wmark@hurrikane.de>
+Date: Fri, 19 Aug 2016 19:50:39 +0200
+Subject: [PATCH] Skip printing at MAX_DEPTH and deeper
+
+This addresses #1136, and mitigates a stack exhaustion when printing
+a very deeply nested term.
+---
+ src/jv_print.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/jv_print.c b/src/jv_print.c
+index 5f4f234..cf6651b 100644
+--- src/jv_print.c
++++ src/jv_print.c
+@@ -13,6 +13,10 @@
+ #include "jv_dtoa.h"
+ #include "jv_unicode.h"
+
++#ifndef MAX_DEPTH
++#define MAX_DEPTH 256
++#endif
++
+ #define ESC "\033"
+ #define COL(c) (ESC "[" c "m")
+ #define COLRESET (ESC "[0m")
+@@ -150,7 +154,9 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
+       }
+     }
+   }
+-  switch (jv_get_kind(x)) {
++  if (indent > MAX_DEPTH) {
++    put_str("<stripped: exceeds max depth>", F, S, flags & JV_PRINT_ISATTY);
++  } else switch (jv_get_kind(x)) {
+   default:
+   case JV_KIND_INVALID:
+     if (flags & JV_PRINT_INVALID) {
diff --git a/utils/jq/patches/002-heap-buffer-overflow.patch b/utils/jq/patches/002-heap-buffer-overflow.patch
new file mode 100644 (file)
index 0000000..ecfbd71
--- /dev/null
@@ -0,0 +1,34 @@
+From 8eb1367ca44e772963e704a700ef72ae2e12babd Mon Sep 17 00:00:00 2001
+From: Nicolas Williams <nico@cryptonector.com>
+Date: Sat, 24 Oct 2015 17:24:57 -0500
+Subject: [PATCH] Heap buffer overflow in tokenadd() (fix #105)
+
+This was an off-by one: the NUL terminator byte was not allocated on
+resize.  This was triggered by JSON-encoded numbers longer than 256
+bytes.
+---
+ src/jv_parse.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/jv_parse.c b/src/jv_parse.c
+index 3102ed4..84245b8 100644
+--- src/jv_parse.c
++++ src/jv_parse.c
+@@ -383,7 +383,7 @@ static pfunc stream_token(struct jv_parser* p, char ch) {
+
+ static void tokenadd(struct jv_parser* p, char c) {
+   assert(p->tokenpos <= p->tokenlen);
+-  if (p->tokenpos == p->tokenlen) {
++  if (p->tokenpos >= (p->tokenlen - 1)) {
+     p->tokenlen = p->tokenlen*2 + 256;
+     p->tokenbuf = jv_mem_realloc(p->tokenbuf, p->tokenlen);
+   }
+@@ -485,7 +485,7 @@ static pfunc check_literal(struct jv_parser* p) {
+     TRY(value(p, v));
+   } else {
+     // FIXME: better parser
+-    p->tokenbuf[p->tokenpos] = 0; // FIXME: invalid
++    p->tokenbuf[p->tokenpos] = 0;
+     char* end = 0;
+     double d = jvp_strtod(&p->dtoa, p->tokenbuf, &end);
+     if (end == 0 || *end != 0)
index 4374e276bb25e87079b15eca6d9721360ef77acd..7ca229fb654bb923d395b74c89dd44bc492b3424 100644 (file)
@@ -10,14 +10,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=klish
 PKG_VERSION:=2.1.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://libcode.org/attachments/download/66/
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENCE
 PKG_MAINTAINER:=Takashi Umeno <umeno.takashi@gmail.com>
-PKG_MD5SUM:=7dfe46d474c02c86946c1d7a461ae549
+PKG_HASH:=70528039da9c5fdfadaea325ab6243cdabef627da0398335312e08d90ab415f8
 
 PKG_INSTALL:=1
 
@@ -50,6 +50,9 @@ define Package/klish/description
  More information about these tools is to be found on the klish web site.
 endef
 
+TARGET_LDFLAGS += -lxml2 -lz
+TARGET_CFLAGS += -D_XOPEN_SOURCE=500
+
 define Build/Configure
        $(call Build/Configure/Default, \
                --with-libxml2 \
index 96769aae51061f9f40dcc07f9f58d1504978b91d..4f8803f7b136ea2c17f94ae5a0bec734be44cb25 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://www.kernel.org/pub/linux/utils/kernel/kmod/
-PKG_MD5SUM:=d6f4fef718a50bd88080de6a43bc64d8
+PKG_HASH:=89c1a1a2193c31f9ebe582640bfa2bd401341dc24119f5a7f702588116fadaa0
 PKG_MAINTAINER:=Jeff Waugh <jdub@bethesignal.org>
 PKG_LICENSE:=LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING
index cbb8c91351e31b8fb5fe90ec522edfdcef42014f..00dea85047254c0eb84e6f03256e117a58120a86 100644 (file)
@@ -120,13 +120,6 @@ PKG_INSTALL:=1
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 
 PKG_BUILD_DEPENDS:= \
-       libdbus \
-       libgd \
-       libmpdclient \
-       libmysqlclient \
-       libncurses \
-       libnmeap \
-       libsqlite3 \
        ppp \
 #      libftdi \
 #      libX11 \
diff --git a/utils/lcdproc/Makefile b/utils/lcdproc/Makefile
new file mode 100644 (file)
index 0000000..0260cf4
--- /dev/null
@@ -0,0 +1,167 @@
+#
+# 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:=lcdproc
+PKG_VERSION:=0.5.9
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/lcdproc/lcdproc/releases/download/v$(PKG_VERSION)/
+PKG_HASH:=d48a915496c96ff775b377d2222de3150ae5172bfb84a6ec9f9ceab962f97b83
+PKG_MAINTAINER:=Harald Geyer <harald@ccbib.org>, \
+               Philip Prindeville <philipp@redfish-solutions.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lcdproc/Default
+  SECTION:=utils
+  CATEGORY:=Utilities
+  URL:=http://lcdproc.org/
+endef
+
+define Package/lcdproc/Default-description
+LCDProc is a daemon and clients for displaying system information
+on various LCD displays
+endef
+
+
+define Package/lcdproc-clients
+  $(call Package/lcdproc/Default)
+  TITLE:=LCD Display clients
+endef
+
+define Package/lcdproc-clients/description
+$(call Package/lcdproc/Default-description)
+
+This package contains the clients distributed by the official lcdproc
+project:
+* lcdproc -- displays system information
+* lcdexec -- displays a menu structure to execute commands
+* lcdvc -- shows the content of the system console
+endef
+
+define Package/lcdproc-clients/conffiles
+/etc/lcdproc.conf
+/etc/lcdexec.conf
+/etc/lcdvc.conf
+endef
+
+
+define Package/lcdproc-server
+  $(call Package/lcdproc/Default)
+  TITLE:=LCD Display server
+  DEPENDS:=+libpthread
+endef
+
+define LCDPROC_CORE_DRIVERS_TEXT
+bayrad CFontzPacket CFontz CwLnx ea65 EyeboxOne glk icp_a106 imonlcd
+imon irtrans joy lb216 lcdm001 lcterm linux_input MD8800 ms6931
+mtc_s16209x MtxOrb NoritakeVFD Olimex_MOD_LCD1x9 pyramid rawserial
+serialPOS serialVFD sli SureElec text tyan vlsys_m428 yard2LCD
+endef
+
+LCDPROC_CORE_DRIVERS:=$(strip $(LCDPROC_CORE_DRIVERS_TEXT))
+
+define Package/lcdproc-server/description
+$(call Package/lcdproc/Default-description)
+
+This package contains the server and a core set of display drivers
+without external dependencies:
+$(LCDPROC_CORE_DRIVERS_TEXT)
+endef
+
+define Package/lcdproc-server/conffiles
+/etc/LCDd.conf
+endef
+
+
+define Package/lcdproc-drivers
+  $(call Package/lcdproc/Default)
+  TITLE:=LCD Display extra drivers
+  DEPENDS:=+lcdproc-server +libncurses +libusb-1.0 +libusb-compat +libftdi1 \
+       +GPIO_SUPPORT:libugpio
+endef
+
+define LCDPROC_OTHER_DRIVERS_TEXT
+curses futaba glcd hd44780 IOWarrior i2500vfd lis picolcd shuttleVFD ula200
+endef
+
+ifeq ($(CONFIG_PACKAGE_kmod-lp),y)
+LCDPROC_OTHER_DRIVERS_TEXT+=sdeclcd sed1330 sed1520 stv5730 t6963
+endif
+
+LCDPROC_OTHER_DRIVERS:=$(strip $(LCDPROC_OTHER_DRIVERS_TEXT))
+
+define Package/lcdproc-drivers/description
+$(call Package/lcdproc/Default-description)
+
+This package contains display drivers with external dependencies:
+$(LCDPROC_OTHER_DRIVERS_TEXT)
+endef
+
+
+# not everything groks --disable-nls
+DISABLE_NLS:=
+
+CONFIGURE_ARGS += \
+       --disable-libX11 \
+       --disable-libhid \
+       --disable-libpng \
+       --disable-freetype \
+       --enable-drivers='all,!g15,!g15driver,!glcdlib,!irman,!lirc,!mdm166a,!mx5000,!svga,!xosd'
+
+# can't use -Wformat=2 because MUSL is somewhat broken
+TARGET_CFLAGS+=-Wall
+
+MAKE_FLAGS += \
+        CFLAGS="$(TARGET_CFLAGS)" \
+        LDFLAGS="$(TARGET_LDFLAGS)"
+
+
+define Package/lcdproc-clients/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/clients/lcdproc/lcdproc $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/clients/lcdexec/lcdexec $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/clients/lcdvc/lcdvc $(1)/usr/bin/
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/clients/lcdproc/lcdproc.conf $(1)/etc/
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/clients/lcdexec/lcdexec.conf $(1)/etc/
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/clients/lcdvc/lcdvc.conf $(1)/etc/
+       $(INSTALL_BIN) ./files/lcd* $(1)/etc/init.d/
+endef
+
+define Package/lcdproc-server/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_DIR) $(1)/usr/lib/lcdproc
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/server/LCDd $(1)/usr/sbin/
+       $(CP) $(foreach driver,$(LCDPROC_CORE_DRIVERS),$(PKG_BUILD_DIR)/server/drivers/$(driver).so) $(1)/usr/lib/lcdproc/
+       $(CP) -p $(PKG_BUILD_DIR)/LCDd.conf $(PKG_BUILD_DIR)/LCDd.conf.orig
+       sed -i -r \
+               -e 's!^(DriverPath=).*$$$$!\1/usr/lib/lcdproc/!' \
+               -e 's!^(Driver=)curses$$$$!\1sdeclcd!' \
+               $(PKG_BUILD_DIR)/LCDd.conf
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/LCDd.conf $(1)/etc/
+       $(INSTALL_BIN) ./files/LCDd $(1)/etc/init.d/
+endef
+
+define Package/lcdproc-drivers/install
+       $(INSTALL_DIR) $(1)/usr/lib/lcdproc
+       $(CP) $(foreach driver,$(LCDPROC_OTHER_DRIVERS),$(PKG_BUILD_DIR)/server/drivers/$(driver).so) $(1)/usr/lib/lcdproc/
+endef
+
+
+$(eval $(call BuildPackage,lcdproc-clients))
+$(eval $(call BuildPackage,lcdproc-server))
+$(eval $(call BuildPackage,lcdproc-drivers))
+
diff --git a/utils/lcdproc/files/LCDd b/utils/lcdproc/files/LCDd
new file mode 100755 (executable)
index 0000000..595407f
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh /etc/rc.common
+
+START=22
+USE_PROCD=1
+PROG=/usr/sbin/LCDd
+
+config_file=/etc/LCDd.conf
+
+start_service() {
+       procd_open_instance
+       procd_set_param command $PROG -f -c $config_file
+       procd_close_instance
+}
+
diff --git a/utils/lcdproc/files/lcdexec b/utils/lcdproc/files/lcdexec
new file mode 100755 (executable)
index 0000000..e6a76f6
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh /etc/rc.common
+
+START=50
+USE_PROCD=1
+PROG=/usr/bin/lcdexec
+
+config_file=/etc/lcdexec.conf
+
+start_service() {
+       procd_open_instance
+       procd_set_param command $PROG -f -c $config_file
+       procd_close_instance
+}
+
diff --git a/utils/lcdproc/files/lcdproc b/utils/lcdproc/files/lcdproc
new file mode 100755 (executable)
index 0000000..15eb997
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh /etc/rc.common
+
+START=50
+USE_PROCD=1
+PROG=/usr/bin/lcdproc
+
+config_file=/etc/lcdproc.conf
+
+start_service() {
+       procd_open_instance
+       procd_set_param command $PROG -f -c $config_file
+       procd_close_instance
+}
+
diff --git a/utils/lcdproc/files/lcdvc b/utils/lcdproc/files/lcdvc
new file mode 100755 (executable)
index 0000000..0362815
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh /etc/rc.common
+
+START=50
+USE_PROCD=1
+PROG=/usr/bin/lcdvc
+
+config_file=/etc/lcdvc.conf
+
+start_service() {
+       procd_open_instance
+       procd_set_param command $PROG -f -c $config_file
+       procd_close_instance
+}
+
diff --git a/utils/lcdproc/patches/100-remove-build-timestamp.patch b/utils/lcdproc/patches/100-remove-build-timestamp.patch
new file mode 100644 (file)
index 0000000..33f2c57
--- /dev/null
@@ -0,0 +1,35 @@
+Index: lcdproc-0.5.9/clients/lcdproc/main.c
+===================================================================
+--- lcdproc-0.5.9.orig/clients/lcdproc/main.c  2017-04-21 12:43:48.000000000 +0200
++++ lcdproc-0.5.9/clients/lcdproc/main.c       2017-12-06 23:36:54.674753530 +0100
+@@ -58,7 +58,6 @@
+ int sock = -1;
+ char *version = VERSION;
+-char *build_date = __DATE__;
+ int lcd_wid = 0;
+ int lcd_hgt = 0;
+Index: lcdproc-0.5.9/server/main.c
+===================================================================
+--- lcdproc-0.5.9.orig/server/main.c   2017-04-24 22:17:15.000000000 +0200
++++ lcdproc-0.5.9/server/main.c        2017-12-06 23:36:47.550605856 +0100
+@@ -104,7 +104,6 @@
+ char *version = VERSION;
+ char *protocol_version = PROTOCOL_VERSION;
+ char *api_version = API_VERSION;
+-char *build_date = __DATE__;
+ /**** Configuration variables ****/
+@@ -197,8 +196,8 @@
+       /* Report that server is starting (report will be delayed) */
+       report(RPT_NOTICE, "LCDd version %s starting", version);
+-      report(RPT_INFO, "Built on %s, protocol version %s, API version %s",
+-              build_date, protocol_version, api_version);
++      report(RPT_INFO, "Protocol version %s, API version %s",
++              protocol_version, api_version);
+       clear_settings();
index 2e79e8ea1ec30681092af36670470d44d253439b..5db0de7470c395f0e4cb29917218af29c5ed3edb 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=less
-PKG_VERSION:=481
+PKG_VERSION:=487
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.greenwoodsoftware.com/less
-PKG_MD5SUM:=50ef46065c65257141a7340123527767
+PKG_HASH:=f3dc8455cb0b2b66e0c6b816c00197a71bf6d1787078adeee0bcf2aea4b12706
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
index b11349c343973a96fa8dc16428fe537304a19855..c9cd8bbe3ce373db5e8837d2dd9e06d3dfe63158 100644 (file)
@@ -9,13 +9,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lm-sensors
 PKG_VERSION:=3.3.5
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/groeck/lm-sensors.git
 PKG_SOURCE_VERSION:=f8cdcc35bff0785aecf49d9a8484a71ce3ebee4f
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=892e9e2eed78e27fb7a08e8ce78b1164a3d101ba79a9e04f1c1273940d48cf17
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 PKG_LICENSE:=GPL-2.0+ LGPL-2.1+
 
@@ -65,6 +66,7 @@ endef
 
 define Package/lm-sensors/conffiles
 /etc/sensors.conf
+/etc/sensors3.conf
 endef
 
 define Build/Compile
@@ -100,6 +102,8 @@ ifeq ($(ARCH),i386)
        $(INSTALL_DIR) $(1)/etc
        $(INSTALL_CONF) ./files/sensors.conf $(1)/etc/sensors.conf
 endif
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/lm-sensors.init $(1)/etc/init.d/lm-sensors
 endef
 
 define Package/lm-sensors-detect/install
diff --git a/utils/lm-sensors/files/lm-sensors.init b/utils/lm-sensors/files/lm-sensors.init
new file mode 100644 (file)
index 0000000..5ac7a72
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2017 Philip Prindeville, Redfish Solutions LLC
+
+START=28
+STOP=
+
+PROG=/usr/sbin/sensors
+
+start() {
+       [ -f /etc/sensors.conf -o -f /etc/sensors3.conf ] || return
+
+       $PROG -s
+}
+
index 4823c594431322faf5f6bb7f8f2c7dac220366fc..2bd8f1498b14d3ca0ce07481a8a90f899816b06b 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= https://github.com/logrotate/logrotate/releases/download/$(PKG_VERSION)
-PKG_MD5SUM:=888f58caf07082c76f5dd39e5d30ec12
+PKG_HASH:=dbc76cae5d4912455b5221654bb6114e43d91a3a0879ce3e20a62a157532912e
 PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
index 5074a1d0b6ffac8ada563e47623cfab9c75f8a02..50374e53ea0d17cc74364461b75e211a1fc9fd03 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://ohse.de/uwe/releases/
-PKG_MD5SUM:=b5ce6a74abc9b9eb2af94dffdfd372a4
+PKG_HASH:=c28b36b14bddb014d9e9c97c52459852f97bd405f89113f30bee45ed92728ff1
 
 PKG_MAINTAINER:=Hsing-Wang Liao <kuoruan@gmail.com>
 PKG_LICENSE:=GPL-2.0+
index c8913441f5ff19ae7e10dca4bb21ae13d1493f3a..65df6f3ddb62c93abdf1d5b2e4101320054113e4 100644 (file)
@@ -10,11 +10,11 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=lsof
 PKG_VERSION:=4.89
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://sunsite.ualberta.ca/pub/Mirror/lsof/ ftp://ftp.fu-berlin.de/pub/unix/tools/lsof
-PKG_MD5SUM:=1b9cd34f3fb86856a125abbf2be3a386
+PKG_HASH:=81ac2fc5fdc944793baf41a14002b6deb5a29096b387744e28f8c30a360a3718
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_LICENSE:=Unique
@@ -57,6 +57,10 @@ define Build/Configure
 endef
 
 define Build/Compile   
+       LSOF_HOST="none" \
+       LSOF_LOGNAME="none" \
+       LSOF_SYSINFO="none" \
+       LSOF_USER="none" \
        $(MAKE) -C $(PKG_BUILD_DIR)
 endef
 
diff --git a/utils/lsof/patches/005-reproducable-build.patch b/utils/lsof/patches/005-reproducable-build.patch
new file mode 100644 (file)
index 0000000..1e4ab15
--- /dev/null
@@ -0,0 +1,24 @@
+diff --git a/dialects/linux/Makefile b/dialects/linux/Makefile
+index 2bea108..ed8382e 100644
+--- a/dialects/linux/Makefile
++++ b/dialects/linux/Makefile
+@@ -78,8 +78,8 @@ version.h:   FRC
+       @echo '#define  LSOF_BLDCMT     "${LSOF_BLDCMT}"' > version.h;
+       @echo '#define  LSOF_CC         "${CC}"' >> version.h
+       @echo '#define  LSOF_CCV        "${CCV}"' >> version.h
+-      @echo '#define  LSOF_CCDATE     "'`date`'"' >> version.h
+-      @echo '#define  LSOF_CCFLAGS    "'`echo ${CFLAGS} | sed 's/\\\\(/\\(/g' | sed 's/\\\\)/\\)/g' | sed 's/"/\\\\"/g'`'"' >> version.h
++      @echo '#define  LSOF_CCDATE     "'`date -d @${SOURCE_DATE_EPOCH}`'"' >> version.h
++      @echo '#define  LSOF_CCFLAGS    ""' >> version.h
+       @echo '#define  LSOF_CINFO      "${CINFO}"' >> version.h
+       @if [ "X${LSOF_HOST}" = "X" ]; then \
+         echo '#define LSOF_HOST       "'`uname -n`'"' >> version.h; \
+@@ -90,7 +90,7 @@ version.h:   FRC
+           echo '#define       LSOF_HOST       "${LSOF_HOST}"' >> version.h; \
+         fi \
+       fi
+-      @echo '#define  LSOF_LDFLAGS    "${CFGL}"' >> version.h
++      @echo '#define  LSOF_LDFLAGS    ""' >> version.h
+       @if [ "X${LSOF_LOGNAME}" = "X" ]; then \
+         echo '#define LSOF_LOGNAME    "${LOGNAME}"' >> version.h; \
+       else \
diff --git a/utils/luci-app-lxc/Makefile b/utils/luci-app-lxc/Makefile
deleted file mode 100644 (file)
index 026f714..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#
-# 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:=luci-app-lxc
-PKG_RELEASE:=20161030
-
-PKG_LICENSE:=Apache-2.0
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luci-app-lxc
-  SECTION:=luci
-  CATEGORY:=LuCI
-  SUBMENU:=3. Applications
-  TITLE:=LXC management Web UI
-  DEPENDS:=+luci-mod-admin-full +lxc +lxc-create +liblxc +rpcd-mod-lxc +getopt +xz
-  MAINTAINER:=Petar Koretic <petar.koretic@sartura.hr>
-endef
-
-define Package/luci-app-lxc/description
- This package will install LXC management Web UI.
-endef
-
-define Build/Prepare
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/luci-app-lxc/install
-       $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller/
-       $(INSTALL_BIN) \
-               ./files/controller/lxc.lua \
-               $(1)/usr/lib/lua/luci/controller/
-
-       $(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/
-       $(INSTALL_DATA) \
-               ./files/view/lxc.htm \
-               $(1)/usr/lib/lua/luci/view/
-
-       $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/
-       $(INSTALL_BIN) \
-               ./files/model/cbi/lxc.lua \
-               $(1)/usr/lib/lua/luci/model/cbi/
-
-       $(INSTALL_DIR) $(1)/etc/config/
-       $(INSTALL_DATA) \
-               ./files/lxc.config \
-               $(1)/etc/config/lxc
-
-       $(INSTALL_DIR) $(1)/www
-       $(CP) -R \
-               ./files/www/* \
-               $(1)/www
-endef
-
-$(eval $(call BuildPackage,luci-app-lxc))
diff --git a/utils/luci-app-lxc/files/controller/lxc.lua b/utils/luci-app-lxc/files/controller/lxc.lua
deleted file mode 100644 (file)
index ea7adba..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
---[[
-
-LuCI LXC module
-
-Copyright (C) 2014, Cisco Systems, Inc.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Author: Petar Koretic <petar.koretic@sartura.hr>
-
-]]--
-
-module("luci.controller.lxc", package.seeall)
-
-require "ubus"
-local conn = ubus.connect()
-if not conn then
-    error("Failed to connect to ubus")
-end
-
-
-function fork_exec(command)
-       local pid = nixio.fork()
-       if pid > 0 then
-               return
-       elseif pid == 0 then
-               -- change to root dir
-               nixio.chdir("/")
-
-               -- patch stdin, out, err to /dev/null
-               local null = nixio.open("/dev/null", "w+")
-               if null then
-                       nixio.dup(null, nixio.stderr)
-                       nixio.dup(null, nixio.stdout)
-                       nixio.dup(null, nixio.stdin)
-                       if null:fileno() > 2 then
-                               null:close()
-                       end
-               end
-
-               -- replace with target command
-               nixio.exec("/bin/sh", "-c", command)
-       end
-end
-
-function index()
-       page = node("admin", "services", "lxc")
-       page.target = cbi("lxc")
-       page.title = _("LXC Containers")
-       page.order = 70
-
-       page = entry({"admin", "services", "lxc_create"}, call("lxc_create"), nil)
-       page.leaf = true
-
-       page = entry({"admin", "services", "lxc_action"}, call("lxc_action"), nil)
-       page.leaf = true
-
-       page = entry({"admin", "services", "lxc_get_downloadable"}, call("lxc_get_downloadable"), nil)
-       page.leaf = true
-
-       page = entry({"admin", "services", "lxc_configuration_get"}, call("lxc_configuration_get"), nil)
-       page.leaf = true
-
-       page = entry({"admin", "services", "lxc_configuration_set"}, call("lxc_configuration_set"), nil)
-       page.leaf = true
-
-end
-
-function lxc_get_downloadable()
-       luci.http.prepare_content("application/json")
-
-       local f = io.popen('uname -m', 'r')
-       local target = f:read('*a')
-       f:close()
-       target = target:gsub("^%s*(.-)%s*$", "%1")
-
-       local templates = {}
-
-       local f = io.popen('lxc-create -n just_want_to_list_available_lxc_templates -t download -- --list', 'r')
-
-       for line in f:lines() do
-               local dist,version = line:match("^(%S+)%s+(%S+)%s+" .. target .. "%s+default%s+%S+$")
-               if dist~=nil and version~=nil then templates[#templates + 1] = dist .. ":" .. version end
-       end
-
-       f:close()
-       luci.http.write_json(templates)
-end
-
-function lxc_create(lxc_name, lxc_template)
-       luci.http.prepare_content("text/plain")
-
-       local uci = require("uci").cursor()
-
-       local url = uci:get("lxc", "lxc", "url")
-
-       if not pcall(dofile, "/etc/openwrt_release") then
-               return luci.http.write("1")
-       end
-
-       local f = io.popen('uname -m', 'r')
-       local target = f:read('*a')
-       f:close()
-       target = target:gsub("^%s*(.-)%s*$", "%1")
-
-       local lxc_dist = lxc_template:gsub("(.*):(.*)", '%1')
-       local lxc_release = lxc_template:gsub("(.*):(.*)", '%2')
-
-       local data = conn:call("lxc", "create", { name = lxc_name, template = "download", args = { "--server", url,  "--no-validate", "--dist", lxc_dist, "--release", lxc_release, "--arch", target } } )
-
-       luci.http.write(data)
-end
-
-function lxc_action(lxc_action, lxc_name)
-       luci.http.prepare_content("application/json")
-
-       local data, ec = conn:call("lxc", lxc_action, lxc_name and { name = lxc_name} or {} )
-
-       luci.http.write_json(ec and {} or data)
-end
-
-function lxc_get_config_path()
-       local f = io.open("/etc/lxc/lxc.conf", "r")
-       local content = f:read("*all")
-       f:close()
-       local ret = content:match('^%s*lxc.lxcpath%s*=%s*([^%s]*)')
-       if ret then
-               return ret .. "/"
-       else
-               return "/srv/lxc/"
-       end
-end
-
-function lxc_configuration_get(lxc_name)
-       luci.http.prepare_content("text/plain")
-
-       local f = io.open(lxc_get_config_path() .. lxc_name .. "/config", "r")
-       local content = f:read("*all")
-       f:close()
-
-       luci.http.write(content)
-end
-
-function lxc_configuration_set(lxc_name)
-       luci.http.prepare_content("text/plain")
-
-       local lxc_configuration = luci.http.formvalue("lxc_configuration")
-
-       if lxc_configuration == nil then
-               return luci.http.write("1")
-       end
-
-       local f, err = io.open(lxc_get_config_path() .. lxc_name .. "/config","w+")
-       if not f then
-               return luci.http.write("2")
-       end
-
-       f:write(lxc_configuration)
-       f:close()
-
-       luci.http.write("0")
-end
-
diff --git a/utils/luci-app-lxc/files/lxc.config b/utils/luci-app-lxc/files/lxc.config
deleted file mode 100644 (file)
index 5572c73..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# lxc uci configuration
-#
-
-config lxc 'lxc'
-       option url 'virtualwrt.org/containers/'
diff --git a/utils/luci-app-lxc/files/model/cbi/lxc.lua b/utils/luci-app-lxc/files/model/cbi/lxc.lua
deleted file mode 100644 (file)
index ac0fdff..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
---[[
-
-LuCI LXC module
-
-Copyright (C) 2014, Cisco Systems, Inc.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Author: Petar Koretic <petar.koretic@sartura.hr>
-
-]]--
-
-local fs = require "nixio.fs"
-
-m = Map("lxc", translate("LXC Containers"))
-
-if fs.access("/etc/config/lxc") then
-       m:section(SimpleSection).template = "lxc"
-
-       s = m:section(TypedSection, "lxc", translate("Options"))
-       s.anonymous = true
-       s.addremove = false
-
-       s:option(Value, "url", translate("Containers URL"))
-end
-
-return m
diff --git a/utils/luci-app-lxc/files/view/lxc.htm b/utils/luci-app-lxc/files/view/lxc.htm
deleted file mode 100644 (file)
index edfff8e..0000000
+++ /dev/null
@@ -1,458 +0,0 @@
-<%#
-
-LuCI LXC module
-
-Copyright (C) 2014, Cisco Systems, Inc.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Author: Petar Koretic <petar.koretic@sartura.hr>
-
--%>
-
-<fieldset class="cbi-section">
-       <legend><%:Available Containers%></legend>
-       <div class="cbi-section-node">
-               <table id="t_lxc_list" class="cbi-section-table">
-                       <tr class="cbi-section-table-titles">
-                               <th class="cbi-section-table-cell"><%:Name%></th>
-                               <th class="cbi-section-table-cell"><%:Status%></th>
-                               <th class="cbi-section-table-cell"><%:Actions%></th>
-                       </tr>
-               </table>
-       </div>
-</fieldset>
-
-<fieldset class="cbi-section">
-       <span id="lxc-list-output"></span>
-</fieldset>
-
-<hr/>
-<fieldset class="cbi-section">
-       <legend><%:Create New Container%></legend>
-       <div class="cbi-section-node">
-               <table id="t_lxc_create" class="cbi-section-table">
-                       <tr class="cbi-section-table-titles">
-                               <th class="cbi-section-table-cell"><%:Name%></th>
-                               <th class="cbi-section-table-cell"><%:Template%></th>
-                               <th class="cbi-section-table-cell"><%:Actions%></th>
-                       </tr>
-                       <tr id="tr_holder">
-                               <td>
-                                       <input type="text" id="tx_name" placeholder="<%:Enter new name%>" value='' />
-                               </td>
-                               <td>
-                                       <select id="s_template" class="cbi-input-select cbi-button">
-                                       </select>
-                               </td>
-                               <td>
-                                       <input type="button" id="bt_create" value="<%:Create%>" onclick="lxc_create(tr_holder)" class="cbi-button cbi-button-add" />
-                                       <span id="lxc-add-loader" style="display:inline-block; width:16px; height:16px; margin:0 5px"></span>
-                               </td>
-                       </tr>
-               </table>
-       </div>
-</fieldset>
-
-<fieldset class="cbi-section">
-       <span id="lxc-add-output"></span>
-</fieldset>
-
-<hr/>
-
-<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
-<script type="text/javascript">//<![CDATA[
-
-       window.img = { "red" : "<%=resource%>/cbi/red.gif", "green" : "<%=resource%>/cbi/green.gif", "purple" : "<%=resource%>/cbi/purple.gif" }
-       window.states = {  "STOPPED" : "red", "RUNNING" : "green", "FROZEN" : "purple"}
-
-       var t_lxc_list = document.getElementById('t_lxc_list');
-       var loader_html = '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" width="16" height="16" style="vertical-align:middle" /> ';
-       var timeout_msg = 0
-       var output_list = document.getElementById("lxc-list-output")
-       var output_add = document.getElementById("lxc-add-output")
-       var loader_add = document.getElementById("lxc-add-loader")
-
-       function lxc_create(tr)
-       {
-               var lxc_name = tr.querySelector("#tx_name").value.trim()
-               var lxc_template = tr.querySelector("#s_template").value
-               var bt_create = tr.querySelector("#bt_create")
-
-               if (t_lxc_list.querySelector("[data-id='" + lxc_name + "']") != null)
-                       return info_message(output_add, "Container with that name already exists!", 4000)
-
-               bt_create.disabled = true
-               output_add.innerHTML = ''
-
-               if (!lxc_name || !lxc_name.length)
-               {
-                       bt_create.disabled = false
-                       return info_message(output_add, "Name cannot be empty!", 4000)
-               }
-
-               loading(loader_add)
-
-               new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_create/' + '%h/%h'.format(lxc_name, lxc_template) , null,
-               function(x)
-               {
-                       bt_create.disabled = false
-                       loading(loader_add, 0)
-
-                       if (!x)
-                               info_message(output_add, "Container creation failed!")
-               })
-       }
-
-       function lxc_create_template(lxc_name, lxc_state)
-       {
-               var info_row = t_lxc_list.querySelector("#empty")
-               if (info_row)
-                       t_lxc_list.deleteRow(1)
-
-               var actions = ''
-               actions += '<input type="button" onclick="action_handler(this)" data-action="start" value="<%:Start%>" class="cbi-button cbi-button-apply" />'
-               actions+= '<input type="button" onclick="action_handler(this)" data-action="stop" value="<%:Stop%>" class="cbi-button cbi-button-reset" />'
-               actions+= '<input type="button" onclick="action_handler(this)" data-action="destroy" value="<%:Delete%>" class="cbi-button cbi-button-remove" />'
-               actions+= ' <select class="cbi-input-select cbi-button" onchange="action_more_handler(this)">\
-                                               <option selected disabled>more</option>\
-                                               <option>configure</option>\
-                                               <option>freeze</option>\
-                                               <option>unfreeze</option>\
-                                               <option>reboot</option>\
-                                       </select>'
-               actions+= '<span data-loader style="display:inline-block; width:16px; height:16px; margin:0 5px"></span>'
-
-               var row = t_lxc_list.insertRow(-1)
-               var cell = row.insertCell(-1)
-               cell.innerHTML = '%q%h%q'.format("<strong>", lxc_name, "</strong>")
-               cell.width = "30%"
-               cell.setAttribute("data-id", lxc_name)
-
-               cell = row.insertCell(-1)
-               cell.width = "20%"
-               cell.innerHTML = "<img src='"+window.img[lxc_state]+"'/>"
-
-               cell = row.insertCell(-1)
-               cell.width = "50%"
-               cell.innerHTML = actions
-       }
-
-       function action_handler(self)
-       {
-               var action = self.getAttribute("data-action");
-
-               var bt_action = self
-               var lxc_name = self.parentNode.parentNode.children[0].getAttribute('data-id')
-               var status_img = self.parentNode.parentNode.querySelector('img')
-               var loader = self.parentNode.querySelector('[data-loader]')
-
-               bt_action.disabled = true
-
-               if (action == "stop")
-               {
-                       loading(loader)
-
-                       new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(action, lxc_name), null,
-                       function(x, ec)
-                       {
-                               loading(loader, 0)
-                               bt_action.disabled = false
-
-                               if (!x || ec)
-                                       return info_message(output_list,"Action failed!")
-
-                               set_status(status_img, "red")
-
-                       });
-               }
-
-               else if (action == "start")
-               {
-                       loading(loader)
-
-                       new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(action, lxc_name), null,
-                       function(x, data)
-                       {
-                               loading(loader, 0)
-                               bt_action.disabled = false
-
-                               //FIXME: uncomment after fixing 'lxc-start'
-                               if (!x /*|| ec */)
-                                       return info_message(output_list,"Action failed!")
-
-                               //FIXME: uncomment after fixing 'lxc-start'
-                               //set_status(status_img, "green")
-                       });
-               }
-
-               else if (action == "destroy")
-               {
-                       if (!confirm("This will completely remove LXC container from the disk. Are you sure? (container will be stopped if running)"))
-                               return
-
-                       loading(loader)
-
-                       new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(action, lxc_name), null,
-                       function(x, ec)
-                       {
-                               loading(loader, 0)
-                               bt_action.disabled = false
-
-                               if (!x || ec)
-                                       return info_message(output_list,"Action failed!")
-
-                               var row = self.parentNode.parentNode
-                               row.parentNode.removeChild(row)
-
-                       });
-               }
-       }
-
-       function lxc_configure_handler(self)
-       {
-               var td = self.parentNode
-               var textarea = td.querySelector('[data-id]')
-               var lxc_name = textarea.getAttribute('data-id')
-               var lxc_configuration = textarea.value
-
-               new XHR().post('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_set/' + lxc_name, "lxc_configuration=" + encodeURIComponent(lxc_configuration) ,
-               function(x)
-               {
-                       if (!x || x.responseText != "0")
-                               return info_message(output_list,"Action failed!")
-
-                       info_message(output_list,"LXC configuration updated")
-                       var row = td.parentNode
-                       row.parentNode.removeChild(row)
-               })
-       }
-
-       function lxc_rename_template(lxc_name)
-       {
-               var h = '\
-                       <input data-id="'+ lxc_name + '" type="text" placeholder="Enter new name" /> \
-                       <input data-id="bt_confirm" onclick="lxc_rename_handler(this)" type="button" class="cbi-button" value="Confirm" />'
-
-               return h
-       }
-
-       function lxc_configure_template(lxc_name, lxc_configuration)
-       {
-               var h = '\
-                       <textarea data-id="'+ lxc_name + '" rows="20" style="width:100%">'+ lxc_configuration +'</textarea> \
-                       <input data-id="bt_confirm" onclick="lxc_configure_handler(this)" type="button" class="cbi-button" value="Confirm" />'
-
-               return h
-       }
-
-       function action_more_handler(self)
-       {
-               var lxc_name = self.parentNode.parentNode.querySelector('[data-id]').getAttribute('data-id')
-               var loader = self.parentNode.parentNode.querySelector('[data-loader]')
-
-               var option = self.options[self.selectedIndex].text
-
-               self.value = "more"
-
-               switch (option)
-               {
-                       case "configure":
-                               var tr = document.createElement('tr')
-                               var row = self.parentNode.parentNode
-                               var next_row = row.nextSibling
-                               if (next_row && next_row.getAttribute('data-action') !== null)
-                                       row.parentNode.removeChild(next_row)
-
-                               new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_get/' + lxc_name, null,
-                               function(x)
-                               {
-                                       tr.innerHTML="<td colspan='" + row.cells.length + "'>" + lxc_configure_template(lxc_name, x.responseText) + "</td>"
-                                       tr.setAttribute('data-action','')
-                                       row.parentNode.insertBefore(tr, row.nextSibling)
-                               })
-
-                       break
-
-                       case "freeze":
-                               var tr = self.parentNode.parentNode
-                               var img = tr.querySelector('img')
-                               if(img.getAttribute('src') != window.img["green"])
-                                       return info_message(output_list,"Container is not running!")
-
-                               loading(loader)
-                               new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(option, lxc_name), null,
-                               function(x, ec)
-                               {
-                                       loading(loader, 0)
-                                       if (!x || ec)
-                                               return info_message(output_list,"Action failed!")
-
-                                       set_status(img, "purple")
-                               })
-
-                       break
-
-                       case "unfreeze":
-                               var tr = self.parentNode.parentNode
-                               var img = tr.querySelector('img')
-
-                               if(img.getAttribute('src') != window.img["purple"])
-                                       return info_message(output_list,"Container is not frozen!")
-
-                               loading(loader)
-                               new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(option, lxc_name), null,
-                               function(x, ec)
-                               {
-                                       loading(loader, 0)
-                                       if (!x || ec)
-                                               return info_message(output_list,"Action failed!")
-
-                                       set_status(img, "green")
-                               })
-
-                       break
-
-                       case "reboot":
-                               var tr = self.parentNode.parentNode
-                               var img = tr.querySelector('img')
-                               if(img.getAttribute('src') != window.img["green"])
-                                       return info_message(output_list,"Container is not running!")
-
-                               if (!confirm("Are you sure?"))
-                                       return
-
-                               loading(loader)
-                               new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(option, lxc_name), null,
-                               function(x, ec)
-                               {
-                                       loading(loader, 0)
-                                       if (!x || ec)
-                                               return info_message(output_list,"Action failed!")
-
-                                       info_message(output_list,"LXC rebooted")
-                               })
-                       break
-               }
-
-       }
-
-       function set_empty(t_lxc_list)
-       {
-               if (document.getElementById('empty') !== null)
-                       return
-
-               var row_count = t_lxc_list.rows.length;
-               while(--row_count) t_lxc_list.deleteRow(row_count);
-
-               var row = t_lxc_list.insertRow(-1);
-               row.id = 'empty'
-               var cell = row.insertCell(0);
-               cell.colSpan = 4;
-               cell.innerHTML = '<em><br />There are no containers available yet.</em>';
-       }
-
-       function lxc_list_update()
-       {
-               XHR.poll(4, '<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/list', null,
-               function(x, data)
-               {
-                       if (!x) return;
-
-                       var lxc_count = Object.keys(data).length
-                       if (!data || !lxc_count)
-                               return set_empty(t_lxc_list)
-
-                       if (document.getElementById('empty') !== null)
-                               t_lxc_list.deleteRow(1);
-
-                       var lxcs = t_lxc_list.querySelectorAll('td[data-id]')
-                       var lxc_name_table = {}
-                       for (var i = 0, len = lxcs.length; i < len; i++)
-                       {
-                               var lxc_name = lxcs[i].getAttribute('data-id')
-                               if (!(lxc_name in data))
-                               {
-                                       var row = t_lxc_list.querySelector("[data-id='" + lxc_name + "']").parentNode
-                                       row.parentNode.removeChild(row)
-                                       continue
-                               }
-
-                               lxc_name_table[lxc_name] = lxcs[i].parentNode.querySelector('img')
-                       }
-
-                       for(var key in data)
-                       {
-                               var lxc_name = key
-                               var state = window.states[data[key]]
-
-                               if (!(lxc_name in lxc_name_table))
-                                       lxc_create_template(lxc_name, state)
-
-                               else if (state != get_status(lxc_name_table[lxc_name]))
-                                       set_status(lxc_name_table[lxc_name], state)
-                       }
-
-               })
-       }
-
-       function loading(elem, state)
-       {
-               state = (typeof state === 'undefined') ? 1 : state
-
-               if (state === 1)
-                       elem.innerHTML = loader_html
-               else
-                       setTimeout(function() { elem.innerHTML = ''}, 1000)
-       }
-
-       function set_status(elem, state)
-       {
-               state = (typeof state === 'undefined') ? 1 : state
-
-               setTimeout(function() { elem.setAttribute('src', window.img[state])}, 300)
-       }
-
-       function get_status(elem)
-       {
-               var src = elem.getAttribute('src')
-
-               for (var i in img)
-               {
-                       if (img[i] == src)
-                               return i
-               }
-       }
-
-       function info_message(output, msg, timeout)
-       {
-               timeout = timeout || 3000
-               output.innerHTML = msg
-               clearTimeout(timeout_msg)
-               timeout_msg = setTimeout(function(){ output.innerHTML=""}, timeout);
-       }
-
-       lxc_list_update()
-
-       new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_get_downloadable', null,
-       function(x, data)
-       {
-               if (!x) return;
-
-               var lxc_count = Object.keys(data).length
-               if (!data || !lxc_count) return;
-               var select = document.getElementById("s_template");
-               for(var key in data)
-               {
-                       var option = document.createElement('option');
-                       option.value = data[key];
-                       option.text = data[key].replace(/[_:]/g, ' ');
-                       select.add(option, -1);
-               }
-       })
-
-//]]></script>
diff --git a/utils/luci-app-lxc/files/www/luci-static/resources/cbi/green.gif b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/green.gif
deleted file mode 100644 (file)
index d09febf..0000000
Binary files a/utils/luci-app-lxc/files/www/luci-static/resources/cbi/green.gif and /dev/null differ
diff --git a/utils/luci-app-lxc/files/www/luci-static/resources/cbi/purple.gif b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/purple.gif
deleted file mode 100644 (file)
index f0d68cc..0000000
Binary files a/utils/luci-app-lxc/files/www/luci-static/resources/cbi/purple.gif and /dev/null differ
diff --git a/utils/luci-app-lxc/files/www/luci-static/resources/cbi/red.gif b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/red.gif
deleted file mode 100644 (file)
index c1b39bb..0000000
Binary files a/utils/luci-app-lxc/files/www/luci-static/resources/cbi/red.gif and /dev/null differ
index 928050a9f010fa2257dc523b56206f4d9c2c8a08..f90f6ea73283038ffe3d68c8a9f7baa35f7c59eb 100644 (file)
@@ -9,13 +9,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=LVM2
-PKG_VERSION:=2.02.165
+PKG_VERSION:=2.02.177
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-2.0 LGPL-2.1
 
 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=ftp://sources.redhat.com/pub/lvm2/releases
-PKG_MD5SUM:=d459cfe50fd549fe41eeed4ef8fbca3f9833f68012f735adb3462483360e07c7
+PKG_SOURCE_URL:=ftp://sources.redhat.com/pub/lvm2/releases \
+               http://ftp.gwdg.de/pub/linux/sources.redhat.com/lvm2/
+PKG_HASH:=4025a23ec9b15c2cb7486d151c29dc953b75efc4d452cfe9dbbc7c0fac8e80f2
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)
 
index 9fa1c1d5688cffe66dd976d0e0c34496738f62f3..0ba1c9b764cb3acb6648a6280025793f55a01c68 100644 (file)
@@ -1,6 +1,6 @@
 --- a/make.tmpl.in
 +++ b/make.tmpl.in
-@@ -19,7 +19,7 @@ SHELL = /bin/sh
+@@ -19,7 +19,7 @@ SHELL = @SHELL@
  
  # Allow environment to override any built-in default value for CC.
  # If there is a built-in default, CC is NOT set to @CC@ here.
index 546a03cb2114ffcf85feffda17e4775bca3c7467..1db823477a7823a6ca52aa3e58ec433aeb36f617 100644 (file)
@@ -1,6 +1,6 @@
 --- a/lib/commands/toolcontext.c
 +++ b/lib/commands/toolcontext.c
-@@ -1843,7 +1843,7 @@ struct cmd_context *create_toolcontext(u
+@@ -1869,7 +1869,7 @@ struct cmd_context *create_toolcontext(u
        /* FIXME Make this configurable? */
        reset_lvm_errno(1);
  
@@ -9,7 +9,7 @@
        /* Set in/out stream buffering before glibc */
        if (set_buffering) {
                /* Allocate 2 buffers */
-@@ -2224,7 +2224,7 @@ void destroy_toolcontext(struct cmd_cont
+@@ -2249,7 +2249,7 @@ void destroy_toolcontext(struct cmd_cont
        if (cmd->libmem)
                dm_pool_destroy(cmd->libmem);
  
@@ -20,7 +20,7 @@
                if (is_valid_fd(STDIN_FILENO) &&
 --- a/tools/lvmcmdline.c
 +++ b/tools/lvmcmdline.c
-@@ -1815,6 +1815,7 @@ int lvm_split(char *str, int *argc, char
+@@ -3074,6 +3074,7 @@ int lvm_split(char *str, int *argc, char
  /* Make sure we have always valid filedescriptors 0,1,2 */
  static int _check_standard_fds(void)
  {
@@ -28,7 +28,7 @@
        int err = is_valid_fd(STDERR_FILENO);
  
        if (!is_valid_fd(STDIN_FILENO) &&
-@@ -1841,6 +1842,12 @@ static int _check_standard_fds(void)
+@@ -3100,6 +3101,12 @@ static int _check_standard_fds(void)
                       strerror(errno));
                return 0;
        }
index 618fde0a03e105162c09f503e6ffa0ebaea3645f..3340a3c2f1b109a761f4fbc995cb38cf0d77d9bd 100644 (file)
@@ -7,6 +7,14 @@ config LXC_KERNEL_OPTIONS
        select KERNEL_CGROUPS
        select KERNEL_NAMESPACES
        select KERNEL_LXC_MISC
+       select KERNEL_CGROUP_SCHED
+       select KERNEL_FAIR_GROUP_SCHED
+       select KERNEL_RT_GROUP_SCHED
+       select KERNEL_CGROUP_CPUACCT
+       select KERNEL_MEMCG
+       select KERNEL_MEMCG_KMEM
+       select KERNEL_CPUSETS
+       select PACKAGE_kmod-ikconfig
        help
          Select needed kernel options for LXC related utilities. Options
          include cgroups, namespaces and other miscellaneous options. These
@@ -34,4 +42,12 @@ config LXC_SECCOMP
          Build LXC with support for seccomp filters.
          Select libseccomp which also pulls-in the needed kernel features.
 
+config LXC_NETWORKING
+       bool "Enable networking support for LXC containers"
+       default n
+       select PACKAGE_kmod-veth
+       select PACKAGE_kmod-macvlan
+       help
+         Enable "veth pair device" and "macvlan"
+
 endmenu
index 0df1460fe31c26d74d27b0cd748d9168c4892f1e..288d5039cfa9250dadf0cb2572289d1027650924 100644 (file)
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lxc
-PKG_VERSION:=1.1.5
-PKG_RELEASE:=3
+PKG_VERSION:=2.1.1
+PKG_RELEASE:=1
 
 PKG_LICENSE:=LGPL-2.1+ BSD-2-Clause GPL-2.0
-PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
+PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://linuxcontainers.org/downloads/lxc/
-PKG_MD5SUM:=dd9684dde0a58ed13f4f49c855b79a1a
+PKG_SOURCE_URL:=https://linuxcontainers.org/downloads/lxc/
+PKG_HASH:=68663a67450a8d6734e137eac54cc7077209fb15c456eec401a2c26e6386eff6
 
 PKG_BUILD_DEPENDS:=lua
 PKG_BUILD_PARALLEL:=1
@@ -27,24 +27,20 @@ PKG_FIXUP:=autoreconf
 include $(INCLUDE_DIR)/package.mk
 
 LXC_APPLETS_BIN += \
-       attach autostart cgroup clone config console create destroy device \
+       attach autostart cgroup copy config console create destroy device \
        execute freeze info monitor snapshot start stop unfreeze unshare \
-       usernsexec wait
+       usernsexec wait top ls
 
 LXC_APPLETS_LIB += \
        monitord user-nic
 
 LXC_SCRIPTS += \
-       checkconfig ls top
+       checkconfig
 
 DEPENDS_APPLETS = +libpthread +libcap +liblxc
 
 DEPENDS_create = +lxc-configs +lxc-hooks +lxc-templates +flock
 
-DEPENDS_ls = +lxc-config
-DEPENDS_top = +lxc-lua +luafilesystem @BROKEN
-
-
 define Package/lxc/Default
   SECTION:=utils
   CATEGORY:=Utilities
@@ -74,6 +70,22 @@ define Package/lxc-auto/conffiles
 /etc/config/lxc-auto
 endef
 
+define Package/lxc-unprivileged
+  $(call Package/lxc/Default)
+  TITLE:=Helper script for unprivileged containers support
+  DEPENDS:=+shadow-utils +shadow-newuidmap +shadow-newgidmap
+endef
+
+define Package/lxc-unprivileged/description
+ Support for unprivileged containers requires newuidmap and newguidmap.
+ This package makes sure they are available & have correct permissions.
+endef
+
+define Package/lxc-unprivileged/install
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_DATA) ./files/lxc-unprivileged.defaults $(1)/etc/uci-defaults/lxc-unprivileged
+endef
+
 define Package/lxc/config
   source "$(SOURCE)/Config.in"
 endef
@@ -118,7 +130,7 @@ endef
 define Package/lxc-lua
   $(call Package/lxc/Default)
   TITLE:=LXC Lua bindings
-  DEPENDS:= lxc +liblua +liblxc +luafilesystem
+  DEPENDS:= lxc +liblua +liblxc
 endef
 
 define Package/lxc-init
@@ -128,6 +140,7 @@ define Package/lxc-init
 endef
 
 CONFIGURE_ARGS += \
+       --disable-gnutls \
        --disable-apparmor \
        --disable-doc \
        --disable-examples \
@@ -275,6 +288,7 @@ $(eval $(call BuildPackage,liblxc))
 $(eval $(call BuildPackage,lxc-lua))
 $(eval $(call BuildPackage,lxc-init))
 $(eval $(call BuildPackage,lxc-auto))
+$(eval $(call BuildPackage,lxc-unprivileged))
 $(foreach u,$(LXC_APPLETS_BIN),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/bin")))
 $(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/lib/lxc")))
 $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin")))
diff --git a/utils/lxc/files/lxc-unprivileged.defaults b/utils/lxc/files/lxc-unprivileged.defaults
new file mode 100644 (file)
index 0000000..45c9839
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+chmod u+s /usr/bin/newuidmap && \
+chmod u+s /usr/bin/newgidmap
diff --git a/utils/lxc/patches/002-compile.patch b/utils/lxc/patches/002-compile.patch
new file mode 100644 (file)
index 0000000..9a98777
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/lxc/storage/aufs.h
++++ b/src/lxc/storage/aufs.h
+@@ -24,7 +24,6 @@
+ #ifndef __LXC_AUFS_H
+ #define __LXC_AUFS_H
+-#define _GNU_SOURCE
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <stdint.h>
diff --git a/utils/lxc/patches/003-compile.patch b/utils/lxc/patches/003-compile.patch
new file mode 100644 (file)
index 0000000..b26b78d
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/lxc/confile_utils.c
++++ b/src/lxc/confile_utils.c
+@@ -677,7 +677,7 @@
+       char *endptr = NULL;
+       if (strncmp(*value, "unlimited", sizeof("unlimited") - 1) == 0) {
+-              *res = RLIM_INFINITY;
++              *res = (unsigned long)RLIM_INFINITY;
+               *value += sizeof("unlimited") - 1;
+               return true;
+       }
index 6f12c382abc6a67ced413201aac50b6f4fedbea9..903e4cd7bd000396ee5369be969df699c629991a 100644 (file)
@@ -1,19 +1,20 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -31,30 +31,6 @@ AC_CANONICAL_HOST
- AM_PROG_CC_C_O
- AC_GNU_SOURCE
+@@ -47,34 +47,6 @@ AC_GNU_SOURCE
+ LT_INIT
+ AC_SUBST([LIBTOOL_DEPS])
  
 -# Detect the distribution. This is used for the default configuration and
 -# for some distro-specific build options.
 -AC_MSG_CHECKING([host distribution])
--AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, oracle, centos, fedora, suse, gentoo, debian, arch, slackware, paldo, openmandriva or pardus.]))
+-AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, oracle, centos, fedora, suse, gentoo, debian, arch, slackware, plamo, paldo, openmandriva, pardus, sparclinux, altlinux.]))
 -if type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then
 -      with_distro=`lsb_release -is`
 -fi
 -if test "z$with_distro" = "z"; then
 -      AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat")
 -      AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle")
+-      AC_CHECK_FILE(/etc/sparclinux-release,with_distro="sparclinux")
 -      AC_CHECK_FILE(/etc/centos-release,with_distro="centos")
 -      AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora")
 -      AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
 -      AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
 -      AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
 -      AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
+-      AC_CHECK_FILE(/etc/plamo-version,with_distro="plamo")
 -      AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
 -      AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva")
 -      AC_CHECK_FILE(/etc/mandriva-release,with_distro="openmandriva")
 -      AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus")
+-      AC_CHECK_FILE(/etc/altlinux-release,with_distro="altlinux")
+-      AC_CHECK_FILE(/etc/pld-release,with_distro="pld")
 -fi
 -with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'`
 -
- if test "z$with_distro" = "z"; then
-       with_distro="unknown"
+ if test "z$with_distro" = "zforsparc"; then
+       with_distro="sparclinux"
  fi
index 2dfaa9bea5a652cc708604ce3658bbd66828ed50..c91e010c5c58559cb6a8289fcef3781c932270df 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/lxc/utils.h
 +++ b/src/lxc/utils.h
-@@ -41,11 +41,7 @@ extern int mkdir_p(const char *dir, mode
+@@ -59,11 +59,7 @@ extern int mkdir_p(const char *dir, mode_t mode);
  extern char *get_rundir(void);
  
  /* Define getline() if missing from the C library */
index 272f76b052a11a62ffb4f6fdc33c853118b9f427..0e644ea47653b899fa7c3f185d76aaec2e13a937 100644 (file)
@@ -1,8 +1,8 @@
---- a/src/lxc/lxc-checkconfig.in
-+++ b/src/lxc/lxc-checkconfig.in
-@@ -4,6 +4,17 @@
+--- a/src/lxc/tools/lxc-checkconfig.in
++++ b/src/lxc/tools/lxc-checkconfig.in
+@@ -3,6 +3,17 @@
+ # Allow environment variables to override config
  : ${CONFIG:=/proc/config.gz}
- : ${GREP:=zgrep}
  : ${MODNAME:=configs}
 +: ${ZGREP:=zgrep}
 +: ${GUNZIP:=gunzip}
@@ -16,5 +16,5 @@
 +      GREP=grep
 +fi
  
SETCOLOR_SUCCESS="printf \\033[1;32m"
- SETCOLOR_FAILURE="printf \\033[1;31m"
CAT="cat"
index cb0a9f0d2a3084e72f2fc04b83079315e5555cd3..b20870890bb1ddc81fa8eca327870890a0cade36 100644 (file)
@@ -1,19 +1,24 @@
 --- a/templates/lxc-download.in
 +++ b/templates/lxc-download.in
-@@ -494,15 +494,7 @@ fi
+@@ -505,20 +505,7 @@ fi
  # Unpack the rootfs
  echo "Unpacking the rootfs"
  
 -EXCLUDES=""
 -excludelist=$(relevant_file excludes)
 -if [ -f "${excludelist}" ]; then
--    while read line; do
--        EXCLUDES="$EXCLUDES --exclude=$line"
--    done < $excludelist
+-    while read -r line; do
+-        EXCLUDES="${EXCLUDES} --exclude=${line}"
+-    done < "${excludelist}"
 -fi
 -
+-# Do not surround ${EXCLUDES} by quotes. This does not work. The solution could
+-# use array but this is not POSIX compliant. The only POSIX compliant solution
+-# is to use a function wrapper, but the latter can't be used here as the args
+-# are dynamic. We thus need to ignore the warning brought by shellcheck.
+-# shellcheck disable=SC2086
 -tar  --anchored ${EXCLUDES} --numeric-owner -xpJf \
 +tar --numeric-owner -xpJf \
-     ${LXC_CACHE_PATH}/rootfs.tar.xz -C ${LXC_ROOTFS}
+     "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}"
  
- mkdir -p ${LXC_ROOTFS}/dev/pts/
+ mkdir -p "${LXC_ROOTFS}/dev/pts/"
diff --git a/utils/lxc/patches/030-lxc-download.patch b/utils/lxc/patches/030-lxc-download.patch
deleted file mode 100644 (file)
index 295bae0..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
---- a/templates/lxc-download.in
-+++ b/templates/lxc-download.in
-@@ -39,7 +39,7 @@ DOWNLOAD_LIST_IMAGES="false"
- DOWNLOAD_MODE="system"
- DOWNLOAD_READY_GPG="false"
- DOWNLOAD_RELEASE=
--DOWNLOAD_SERVER="images.linuxcontainers.org"
-+DOWNLOAD_SERVER="virtualwrt.org/containers/"
- DOWNLOAD_SHOW_GPG_WARNING="true"
- DOWNLOAD_SHOW_HTTP_WARNING="true"
- DOWNLOAD_TARGET="system"
-@@ -257,14 +257,6 @@ for bin in tar xz wget; do
-     fi
- done
--# Check for GPG
--if [ "$DOWNLOAD_VALIDATE" = "true" ]; then
--    if ! type gpg >/dev/null 2>&1; then
--        echo "ERROR: Missing recommended tool: gpg" 1>&2
--        echo "You can workaround this by using --no-validate." 1>&2
--        exit 1
--    fi
--fi
- # Check that we have all variables we need
- if [ -z "$LXC_NAME" ] || [ -z "$LXC_PATH" ] || [ -z "$LXC_ROOTFS" ]; then
-@@ -456,16 +448,9 @@ if [ "$DOWNLOAD_USE_CACHE" = "false" ];
-         echo "Downloading the rootfs"
-         download_file $DOWNLOAD_URL/rootfs.tar.xz \
-             ${DOWNLOAD_TEMP}/rootfs.tar.xz normal
--        download_sig  $DOWNLOAD_URL/rootfs.tar.xz.asc \
--             ${DOWNLOAD_TEMP}/rootfs.tar.xz.asc normal
--        gpg_validate ${DOWNLOAD_TEMP}/rootfs.tar.xz.asc
--
-         echo "Downloading the metadata"
-         download_file $DOWNLOAD_URL/meta.tar.xz \
-             ${DOWNLOAD_TEMP}/meta.tar.xz normal
--        download_sig  $DOWNLOAD_URL/meta.tar.xz.asc \
--            ${DOWNLOAD_TEMP}/meta.tar.xz.asc normal
--        gpg_validate ${DOWNLOAD_TEMP}/meta.tar.xz.asc
-         if [ -d $LXC_CACHE_PATH ]; then
-             rm -Rf $LXC_CACHE_PATH
diff --git a/utils/lxc/patches/035-fix-undefined-lfd.patch b/utils/lxc/patches/035-fix-undefined-lfd.patch
deleted file mode 100644 (file)
index 42e194c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/src/lxc/bdev.c
-+++ b/src/lxc/bdev.c
-@@ -1939,7 +1939,7 @@ static int find_free_loopdev(int *retfd,
- static int loop_mount(struct bdev *bdev)
- {
--      int lfd, ffd = -1, ret = -1;
-+      int lfd = -1, ffd = -1, ret = -1;
-       struct loop_info64 lo;
-       char loname[100];
-@@ -1977,7 +1977,7 @@ out:
-       if (ffd > -1)
-               close(ffd);
-       if (ret < 0) {
--              close(lfd);
-+              if (lfd > -1) close(lfd);
-               bdev->lofd = -1;
-       }
-       return ret;
index 2bfcbbf2d94212f8882504861c93922b59fcc434..e0d9b7c2959990607b18d14a47a7a78f7a77c9ed 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/alobbs/macchanger/releases/download/$(PKG_VERSION)/
-PKG_MD5SUM:=ca56f16142914337391dac91603eb332
+PKG_HASH:=dae2717c270fd5f62d790dbf80c19793c651b1b26b62c101b82d5fdf25a845bf
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
index 109adc6f710111245c664e79612c7a52b229460b..d55a795565626f1134908a68f0caeed49c9ddb8e 100644 (file)
@@ -13,9 +13,10 @@ PKG_VERSION:=2014-10-29
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://github.com/webstack/mbtools
+PKG_SOURCE_URL:=https://github.com/webstack/mbtools.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=149e9c69cec180f18cf8781cf5285b97352bf719
+PKG_MIRROR_HASH:=3aed4146e06bd9f9bcc271824c6b1d75d1fc2a0bd980f2b729c3b4755c6f70a8
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 
 PKG_FIXUP:=autoreconf
index cca11237566fb503576efd87223046e01ce94f34..52b8f880f92a287a35ee70ecb3bf61335fe4190c 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2006-2016 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -8,14 +6,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mc
-PKG_VERSION:=4.8.18
-PKG_RELEASE:=1
+PKG_VERSION:=4.8.20
+PKG_RELEASE:=2
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 PKG_LICENSE:=GPL-3.0+
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://ftp.midnight-commander.org/
-PKG_MD5SUM:=f7636815c987c1719c4f5de2dcd156a0e7d097b1d10e4466d2bdead343d5bece
+PKG_HASH:=017ee7f4f8ae420a04f4d6fcebaabe5b494661075c75442c76e9c8b1923d501c
 PKG_BUILD_PARALLEL:=1
 PKG_FIXUP:=autoreconf gettext-version
 
@@ -32,7 +30,7 @@ PKG_CONFIG_DEPENDS := \
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
 
-define Package/$(PKG_NAME)
+define Package/mc
        SECTION:=utils
        CATEGORY:=Utilities
        DEPENDS:=+glib2 +libncurses +libmount +MC_VFS:libssh2 $(LIBRPC_DEPENDS) $(ICONV_DEPENDS)
@@ -41,11 +39,11 @@ define Package/$(PKG_NAME)
        MENU:=1
 endef
 
-define Package/$(PKG_NAME)/config
+define Package/mc/config
        source "$(SOURCE)/Config.in"
 endef
 
-define Package/$(PKG_NAME)/description
+define Package/mc/description
 GNU Midnight Commander is a visual file manager.
 It's a feature rich full-screen text mode application that allows you to copy,
 move and delete files and whole directory trees, search for files and run commands in the subshell.
@@ -54,6 +52,8 @@ Internal viewer and editor are included as well.
 endef
 
 CONFIGURE_ARGS += \
+       --enable-silent-rules \
+       --disable-tests \
        --disable-doxygen-doc \
        --with-homedir=/etc/mc \
        --with-screen=ncurses \
@@ -64,41 +64,34 @@ CONFIGURE_VARS += \
        ac_cv_search_addwstr=no \
 
 ifeq ($(CONFIG_MC_DIFFVIEWER),)
-CONFIGURE_ARGS += \
-       --without-diff-viewer
+CONFIGURE_ARGS += --without-diff-viewer
 endif
 
 ifeq ($(CONFIG_MC_EDITOR),)
-CONFIGURE_ARGS += \
-       --without-internal-edit
+CONFIGURE_ARGS += --without-internal-edit
 endif
 
 ifeq ($(CONFIG_MC_SUBSHELL),)
-CONFIGURE_ARGS += \
-       --without-subshell
+CONFIGURE_ARGS += --without-subshell
 endif
 
 ifeq ($(CONFIG_MC_LARGEFILE),)
-CONFIGURE_ARGS += \
-       --disable-largefile
+CONFIGURE_ARGS += --disable-largefile
 endif
 
 ifeq ($(CONFIG_MC_BACKGROUND),)
-CONFIGURE_ARGS += \
-       --disable-background
+CONFIGURE_ARGS += --disable-background
 endif
 
 ifeq ($(CONFIG_MC_CHARSET),)
-CONFIGURE_ARGS += \
-       --disable-charset
+CONFIGURE_ARGS += --disable-charset
 endif
 
 ifeq ($(CONFIG_MC_VFS),)
-CONFIGURE_ARGS += \
-       --disable-vfs
+CONFIGURE_ARGS += --disable-vfs
 endif
 
-define Package/$(PKG_NAME)/install
+define Package/mc/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mc $(1)/usr/bin
        $(INSTALL_DIR) $(1)/etc/mc
@@ -107,21 +100,25 @@ define Package/$(PKG_NAME)/install
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/mc.ext $(1)/etc/mc
        $(INSTALL_DIR) $(1)/usr/share/mc/help
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/hlp/mc.hlp $(1)/usr/share/mc/help
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/mc.menu $(1)/etc/mc
+       $(INSTALL_DIR) $(1)/etc/mc/skins
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/skins/default.ini $(1)/etc/mc/skins
+       $(INSTALL_DIR) $(1)/etc/mc/mcedit/Syntax
 ifeq ($(CONFIG_MC_DIFFVIEWER),y)
        ln -sf mc $(1)/usr/bin/mcdiff
 endif
 ifeq ($(CONFIG_MC_EDITOR),y)
        ln -sf mc $(1)/usr/bin/mcedit
 endif
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/mc.menu $(1)/etc/mc
-       $(INSTALL_DIR) $(1)/etc/mc/skins
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/skins/default.ini $(1)/etc/mc/skins
-       $(INSTALL_DIR) $(1)/etc/mc/mcedit/Syntax
+ifeq ($(CONFIG_MC_VFS),y)
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/vfs/extfs/helpers/sfs.ini $(1)/etc/mc
+       $(INSTALL_DIR) $(1)/usr/lib/mc/extfs.d
+endif
 endef
 
-define Package/$(PKG_NAME)/conffiles
+define Package/mc/conffiles
 /etc/mc/mc.menu
 /etc/mc/skins/default.ini
 endef
 
-$(eval $(call BuildPackage,$(PKG_NAME)))
+$(eval $(call BuildPackage,mc))
index bd7ee35e90f54a254f1c5dbd7518a159882b9428..35432e6dddfdd5b72ab8921ccb764b382fd178c3 100644 (file)
@@ -1,11 +1,22 @@
 --- a/src/subshell/common.c
 +++ b/src/subshell/common.c
-@@ -849,7 +849,7 @@ init_subshell_precmd (char *precmd, size
-                     "else "
-                     "[ \"${PWD##$HOME/}\" = \"$PWD\" ] && MC_PWD=\"$PWD\" || MC_PWD=\"~/${PWD##$HOME/}\"; "
-                     "fi; "
+@@ -843,16 +843,9 @@ init_subshell_precmd (char *precmd, size
+          * "PS1='$($PRECMD)$ '\n",
+          */
+         g_snprintf (precmd, buff_size,
+-                    "precmd() { "
+-                    "if [ ! \"${PWD##$HOME}\" ]; then "
+-                    "MC_PWD=\"~\"; "
+-                    "else "
+-                    "[ \"${PWD##$HOME/}\" = \"$PWD\" ] && MC_PWD=\"$PWD\" || MC_PWD=\"~/${PWD##$HOME/}\"; "
+-                    "fi; "
 -                    "echo \"$USER@$(hostname -s):$MC_PWD\"; "
-+                    "echo \"$USER@$HOSTNAME:$MC_PWD\"; "
-                     "pwd>&%d; "
-                     "kill -STOP $$; "
-                     "}; " "PRECMD=precmd; " "PS1='$($PRECMD)$ '\n", subshell_pipe[WRITE]);
+-                    "pwd>&%d; "
+-                    "kill -STOP $$; "
+-                    "}; " "PRECMD=precmd; " "PS1='$($PRECMD)$ '\n", subshell_pipe[WRITE]);
++                    "precmd() { pwd>&%d; kill -STOP $$; }; "
++                    "PRECMD=precmd; "
++                    "PS1='$(eval $PRECMD)\\u@\\h:\\w\\$ '\n", subshell_pipe[WRITE]);
+         break;
+     case SHELL_ZSH:
index b588993e2a931f5bf2a4b1575c78fef6d3d10cf1..5bffc22c6b3997be7cabdcc71dda0258273773df 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2015 OpenWrt.org
+# Copyright (C) 2006-2017 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:=minicom
-PKG_VERSION:=2.7
-PKG_RELEASE:=3
+PKG_VERSION:=2.7.1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/3977/
-PKG_MD5SUM:=7044ca3e291268c33294f171d426dc2d
+PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4215
+PKG_HASH:=532f836b7a677eb0cb1dca8d70302b73729c3d30df26d58368d712e5cca041f1
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=GPL-2.0
diff --git a/utils/minicom/patches/110-reproducible-builds.patch b/utils/minicom/patches/110-reproducible-builds.patch
new file mode 100644 (file)
index 0000000..1302f5b
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/src/minicom.c
++++ b/src/minicom.c
+@@ -1161,7 +1161,7 @@ int main(int argc, char **argv)
+       switch(c) {
+       case 'v':
+         printf(_("%s version %s"), PACKAGE, VERSION);
+-#ifdef __DATE__
++#if 0 
+         printf(_(" (compiled %s)"), __DATE__);
+ #endif
+         printf("\n");
+@@ -1464,7 +1464,7 @@ int main(int argc, char **argv)
+   mc_wprintf(us, "\n%s %s\r\n", _("Welcome to minicom"), VERSION);
+   mc_wprintf(us, "\n%s: %s\r\n", _("OPTIONS"), option_string);
+-#if defined (__DATE__) && defined (__TIME__)
++#if 0
+   mc_wprintf(us, "%s %s, %s.\r\n",_("Compiled on"), __DATE__,__TIME__);
+ #endif
+   {
index 445974c3b19c09ee9b5cb1da820e73a01a2c894f..d20fbdfecf3c3c7c0663527c1b77114cd758c617 100644 (file)
@@ -9,15 +9,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mksh
-PKG_VERSION:=52c
+PKG_VERSION:=56b
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Thorsten Glaser <tg@mirbsd.org>
 PKG_LICENSE:=MirOS
 
 PKG_SOURCE:=$(PKG_NAME)-R$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=http://www.mirbsd.org/MirOS/dist/mir/mksh
-PKG_MD5SUM:=cc3884e02314447e7b4a3073b8d65d1e
+PKG_SOURCE_URL:=http://www.mirbsd.org/MirOS/dist/mir/mksh \
+               http://pub.allbsd.org/MirOS/dist/mir/mksh
+PKG_HASH:=40ec744eec256583e4e18907cde22af57c980286f535df47326fed07e48c9a7f
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
@@ -62,7 +63,7 @@ define Build/Compile
                CC="$(TARGET_CC)" \
                TARGET_OS="$(shell uname -s)" \
                CFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="-DMKSH_SMALL=1 -DMKSH_ASSUME_UTF8=0 -DMKSH_BINSHPOSIX" \
+               CPPFLAGS="-DMKSH_SMALL=1 -DMKSH_ASSUME_UTF8=0 -DMKSH_BINSHPOSIX -DMKSHRC_PATH=\\\"/etc/mkshrc\\\"" \
                HAVE_CAN_FSTACKPROTECTORALL=0 \
                HAVE_CAN_FSTACKPROTECTORSTRONG=0 \
                LDFLAGS="$(TARGET_LDFLAGS)" \
index 7e9da8a024f97c1540afebdefdb2f3f5787eae74..21069fc533d8bd0b135658f13adda361b1f09d77 100644 (file)
@@ -1,5 +1,3 @@
-Refreshed for mksh-r52c, based on tg's patch
-
 From 23712cea8e2a623fd952eb781df0011c501703d0 Mon Sep 17 00:00:00 2001
 From: Thorsten Glaser <tg@mirbsd.org>
 Date: Thu, 25 Jul 2013 22:07:33 +0200
@@ -10,37 +8,41 @@ Subject: [PATCH] Make default mkshrc file suitable for OpenWrt environment:
   - ls(1) has no -o option
 * OpenWrt and FreeWRT-1.0 fix:
   - since this is not ~/.mkshrc make sure subshells find it
+
+From: Alif M. A. <alive4ever@live.com>
+Date: Thu, 20 Jul 2017 14:52:39 +0000
+Subject: [PATCH] Refresh 100-dot_mkshrc for mksh-R55
+
+Additional changes of the patch as of mksh-R55
+* Use content of `/proc/sys/kernel/hostname` to set `$HOSTNAME`, since
+  `hostname` applet isn't compiled into `busybox`.
+* Use `/bin/vi` as fallback `$EDITOR`.
+* Use `/etc/mkshrc` as default startup file, so there is no need to
+  manually source it during interactive session.
+
+From: Alif M. A. <alive4ever@live.com>
+Date: Thu, 11 Jan 2018 02:13:46 +0000
+Subject: [PATCH] Refresh 100-dot_mkshrc for mksh-R55
+
+Refreshed 100-dot_mkshrc for mksh-r56b
+
 ---
+Reviewed-by: Thorsten Glaser <tg at mirbsd.org>
 Signed-off-by: Alif M. A. <alive4ever at live.com>
+
 --- a/dot.mkshrc
 +++ b/dot.mkshrc
-@@ -28,8 +28,9 @@
- *) return 0 ;;
- esac
--PS1='#'; (( USER_ID )) && PS1='$'; \: "${TERM:=vt100}${HOSTNAME:=$(\ulimit -c \
--    0; hostname 2>/dev/null)}${EDITOR:=/bin/ed}${USER:=$(\ulimit -c 0; id -un \
-+PS1='#'; (( USER_ID )) && PS1='$'; \: "${HOSTNAME:=$(</proc/sys/kernel/hostname\
-+    )} = *([     ]|localhost) && HOSTNAME=$(\ulimit -c \
-+    0; hostname 2>/dev/null)}${EDITOR:=/bin/vi}${USER:=$(\ulimit -c 0; id -un \
-     2>/dev/null || \echo \?)}${MKSH:=$(\builtin whence -p mksh)}"
- HOSTNAME=${HOSTNAME%%*([       ]).*}; HOSTNAME=${HOSTNAME##*([         ])}
- [[ $HOSTNAME = ?(ip6-)localhost?(6) ]] && HOSTNAME=
-@@ -52,7 +53,7 @@
- \alias l='ls -F'
- \alias la='l -a'
- \alias ll='l -l'
--\alias lo='l -alo'
-+\alias lo='l -al'
- \alias doch='sudo mksh -c "$(\builtin fc -ln -1)"'
- \command -v rot13 >/dev/null || \alias rot13='tr \
-     abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \
-@@ -601,4 +602,8 @@
+@@ -63,10 +63,9 @@
+       EDITOR=
+ done
  
- \unset p
+-\\builtin alias ls=ls l='ls -F' la='l -a' ll='l -l' lo='l -alo'
+-\: "${HOSTNAME:=$(\\builtin ulimit -c 0; \\builtin print -r -- $(hostname \
+-    2>/dev/null))}${EDITOR:=/bin/ed}${TERM:=vt100}${USER:=$(\\builtin ulimit \
+-    -c 0; id -un 2>/dev/null)}${USER:=?}"
++\\builtin alias ls=ls l='ls -F' la='l -a' ll='l -l' lo='l -al'
++\: "${HOSTNAME:=$(</proc/sys/kernel/hostname)}${EDITOR:=/bin/vi}${TERM:=vt100}\
++      ${USER:=$(\\builtin ulimit -c 0; id -un 2>/dev/null)}${USER:=?}"
+ [[ $HOSTNAME = ?(?(ip6-)localhost?(6)) ]] && HOSTNAME=nil; \\builtin unalias ls
+ \\builtin export EDITOR HOSTNAME TERM USER
  
-+# we need this in OpenWrt for subshells that are not login shells
-+\: ${ENV=/etc/mkshrc}
-+[[ -z $ENV ]] || export ENV
-+
- \: place customisations above this line
index 2e23e23bba387a925ce849a7f1e1382ac8dd0365..3bc241a617fbdf85b643bd7164c854d68ec090bb 100644 (file)
@@ -8,16 +8,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mktorrent
-PKG_VERSION:=1.0
+PKG_VERSION:=1.1
 PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/Rudde/$(PKG_NAME)
+PKG_SOURCE_VERSION:=b20ef699b4ee5ded2f078ead776c7deac969e19a
+PKG_MIRROR_HASH:=abe5f96d1a91c00bd6dcf86640a205583e8607d2b0e9299a588cec76c556a8e8
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://downloads.sourceforge.net/$(PKG_NAME)/
-PKG_MD5SUM:=0da00209da96a0dc39efbb6eb5b4d8ff
-
 include $(INCLUDE_DIR)/package.mk
 
 define Package/mktorrent
@@ -25,7 +28,7 @@ define Package/mktorrent
   SECTION:=net
   CATEGORY:=Network
   TITLE:=mktorrent
-  URL:=http://mktorrent.sourceforge.net/
+  URL:=https://github.com/Rudde/mktorrent
 endef
 
 define Package/mktorrent/Description
index 9e1d70ec922ebcbe9faa19bd355840b861430c65..3f37d9336c860daea96b0297341b93751268ef30 100644 (file)
@@ -8,14 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mmc-utils
-PKG_VERSION=2016-09-11-$(PKG_SOURCE_VERSION)
-PKG_RELEASE:=2
+PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git
-PKG_SOURCE_VERSION:=2cb6695e8dec00d887bdd5309d1b57d836fcd214
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE_DATE:=2017-03-20
+PKG_SOURCE_VERSION:=37c86e60c0442fef570b75cd81aeb1db4d0cbafd
+PKG_MIRROR_HASH:=652958e818d984804be6846ba504961f31c6e98414d0d34ec7a0d76d0844584a
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=
@@ -23,7 +22,6 @@ PKG_LICENSE_FILES:=
 PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
 
 PKG_BUILD_PARALLEL:=1
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
diff --git a/utils/moreutils/Makefile b/utils/moreutils/Makefile
new file mode 100644 (file)
index 0000000..310319e
--- /dev/null
@@ -0,0 +1,61 @@
+#
+# Copyright (C) 2016 Nikil Mehta <nikil.mehta@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=moreutils
+PKG_VERSION:=0.60
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.xz
+PKG_SOURCE_URL:=http://http.debian.net/debian/pool/main/m/moreutils/
+PKG_HASH:=e42d18bacbd2d003779a55fb3542befa5d1d217ee37c1874e8c497581ebc17c5
+
+PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/moreutils
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=additional Unix utilities
+  URL:=https://joeyh.name/code/moreutils/
+  DEPENDS:=+perl +perlbase-file +perlbase-getopt +perlbase-io +perlbase-ipc +perlbase-posix
+endef
+
+define Package/moreutils/description
+       This is a growing collection of the Unix tools that nobody thought
+       to write long ago, when Unix was young.
+       .
+       So far, it includes the following utilities:
+       - chronic: runs a command quietly unless it fails
+       - combine: combine the lines in two files using boolean operations
+       - errno: look up errno names and descriptions
+       - ifdata: get network interface info without parsing ifconfig output
+       - ifne: run a program if the standard input is not empty
+       - isutf8: check if a file or standard input is utf-8
+       - lckdo: execute a program with a lock held
+       - mispipe: pipe two commands, returning the exit status of the first
+       - parallel: run multiple jobs at once
+       - pee: tee standard input to pipes
+       - sponge: soak up standard input and write to a file
+       - ts: timestamp standard input
+       - vidir: edit a directory in your text editor
+       - vipe: insert a text editor into a pipe
+       - zrun: automatically uncompress arguments to command
+endef
+
+define Package/moreutils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,moreutils))
diff --git a/utils/moreutils/patches/001_disable-manuals.patch b/utils/moreutils/patches/001_disable-manuals.patch
new file mode 100644 (file)
index 0000000..c777108
--- /dev/null
@@ -0,0 +1,21 @@
+--- a/Makefile
++++ b/Makefile
+@@ -13,7 +13,7 @@
+ DOCBOOK2XMAN=xsltproc --param man.authors.section.enabled 0 $(DOCBOOKXSL)/manpages/docbook.xsl
+-all: $(BINS) $(MANS)
++all: $(BINS)
+ clean:
+       rm -f $(BINS) $(MANS) dump.c errnos.h errno.o
+@@ -27,9 +27,6 @@
+       $(INSTALL_BIN) $(BINS) $(DESTDIR)$(PREFIX)/bin
+       install $(PERLSCRIPTS) $(DESTDIR)$(PREFIX)/bin
+-      mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
+-      install $(MANS) $(DESTDIR)$(PREFIX)/share/man/man1
+-
+ check: isutf8
+       ./is_utf8/test.sh
diff --git a/utils/moreutils/patches/002_no-install-strip.patch b/utils/moreutils/patches/002_no-install-strip.patch
new file mode 100644 (file)
index 0000000..82b7457
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -2,7 +2,7 @@
+ PERLSCRIPTS=vidir vipe ts combine zrun chronic
+ MANS=sponge.1 vidir.1 vipe.1 isutf8.1 ts.1 combine.1 ifdata.1 ifne.1 pee.1 zrun.1 chronic.1 mispipe.1 lckdo.1 parallel.1 errno.1
+ CFLAGS?=-O2 -g -Wall
+-INSTALL_BIN?=install -s
++INSTALL_BIN?=install
+ PREFIX?=/usr
+ ifneq (,$(findstring CYGWIN,$(shell uname)))
index c2b77eb1c54d8bb52e689f94604577ae8b5cd663..c2e0953788d181f3c5e06dde61ed4c19c1266aac 100644 (file)
@@ -14,7 +14,7 @@ PKG_LICENSE:=NLPL
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://ftp.andrew.cmu.edu/pub/mpack/
-PKG_MD5SUM:=a70fa5afa76539a9afb70b9d81568fe8
+PKG_HASH:=274108bb3a39982a4efc14fb3a65298e66c8e71367c3dabf49338162d207a94c
 
 PKG_INSTALL:=1
 
diff --git a/utils/mpack/patches/001-use-stdlib.patch b/utils/mpack/patches/001-use-stdlib.patch
new file mode 100644 (file)
index 0000000..c5d10df
--- /dev/null
@@ -0,0 +1,34 @@
+Index: mpack-1.6/unixos.c
+===================================================================
+--- mpack-1.6.orig/unixos.c
++++ mpack-1.6/unixos.c
+@@ -25,6 +25,7 @@
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <string.h>
++#include <stdlib.h>
+ #include <errno.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+@@ -39,8 +40,6 @@
+ #endif
+ extern int errno;
+-extern char *malloc();
+-extern char *getenv();
+ int overwrite_files = 0;
+ int didchat;
+Index: mpack-1.6/xmalloc.c
+===================================================================
+--- mpack-1.6.orig/xmalloc.c
++++ mpack-1.6/xmalloc.c
+@@ -24,7 +24,7 @@
+  */
+ #include <stdio.h>
+ #include <string.h>
+-extern char *malloc(), *realloc();
++#include <stdlib.h>
+ char *xmalloc (int size)
+ {
index 45056eb22b81ec972f34a4aa0341e6a9e9a2854e..aab5e751e90b7c64d6187690d07505c1d0f5ac31 100644 (file)
@@ -15,7 +15,7 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)
 PKG_SOURCE_VERSION:=$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.ibiblio.org/pub/Linux/system/backup/
-PKG_MD5SUM:=fdd5f5ec673c9f630a102ceff7612774
+PKG_HASH:=945cb4f3d9957dabe768f5941a9148b746396836c797b25f020c84319ba8170d
 
 PKG_LICENSE:=GPL-2.0
 
index c8422301c62073525ede698b2bda1f3507320b76..32d07f416f028b3ed889d26054b7d5941009b1ab 100644 (file)
@@ -19,11 +19,10 @@ PKG_SOURCE_URL:=\
        http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.1/ \
        http://mirror.switch.ch/ftp/mirror/mysql/Downloads/MySQL-5.1/
 
-PKG_MD5SUM:=887f869bcc757957067b9198f707f32f
+PKG_HASH:=05ebe21305408b24407d14b77607a3e5ffa3c300e03f1359d3066f301989dcb5
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 PKG_LICENSE:=GPL-2.0
 
-PKG_BUILD_DEPENDS:=libncurses libreadline
 PKG_BUILD_PARALLEL:=1
 PKG_USE_MIPS16:=0
 
@@ -42,7 +41,7 @@ endef
 define Package/mysql-server
   SECTION:=utils
   CATEGORY:=Utilities
-  DEPENDS:=+libmysqlclient +libpthread +libncursesw +libreadline
+  DEPENDS:=+libmysqlclient +libpthread +libncurses +libreadline
   TITLE:=MySQL Server
   URL:=http://dev.mysql.com/
   SUBMENU:=database
index db285504f8a33caeed9441c8c5fc37f05b7e0a05..32eef6b328531bc860fef39382d171c229c60e25 100644 (file)
@@ -8,15 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nano
-PKG_VERSION:=2.7.5
+PKG_VERSION:=2.9.4
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/nano
-PKG_MD5SUM:=002703e368e07882f75e304c8860d83d
-PKG_HASH:=a64d24e6bc4fc448376d038f9a755af77f8e748c9051b6f45bf85e783a7e67e4
+PKG_HASH:=2cf9726e735f5c962af63d27c2faaead5936e45adec983659fb9e4af88ffa35a
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
@@ -29,7 +28,8 @@ define Package/nano
   CATEGORY:=Utilities
   TITLE:=An enhanced clone of the Pico text editor
   URL:=http://www.nano-editor.org/
-  MAINTAINER:=Jonathan Bennett <JBennett@incomsystems.biz>
+  MAINTAINER:=Jonathan Bennett <JBennett@incomsystems.biz>, \
+               Hannu Nyman <hannu.nyman@iki.fi>
   DEPENDS:=+libncurses
 endef
 
@@ -40,10 +40,9 @@ endef
 
 CONFIGURE_ARGS += \
        --enable-tiny \
-       --disable-glibtest \
        --disable-utf8 \
-        --without-slang \
-        --disable-color \
+       --without-slang \
+       --disable-color \
 
 CONFIGURE_VARS += \
        ac_cv_header_regex_h=no \
index fa52ff610312b3b2b55babdb6570fb03851c605b..1e01c5c493a262d4b6a733dde23e2c25a38f31c0 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://dev.yorhel.nl/download
-PKG_MD5SUM:=7365ac46c420bc511621216b1747984f
+PKG_HASH:=820e4e4747a2a2ec7a2e9f06d2f5a353516362c22496a10a9834f871b877499a
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
diff --git a/utils/netwhere/Makefile b/utils/netwhere/Makefile
new file mode 100644 (file)
index 0000000..8f3220a
--- /dev/null
@@ -0,0 +1,41 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=netwhere
+PKG_VERSION:=0.9
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=netwhere-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/benhsmith/netwhere/archive/$(PKG_VERSION)/
+PKG_HASH:=94a672bdcd9d4455b85429dddd81ffc778e0b26fe87af19ad75c27858ec9dbe2
+
+PKG_BUILD_DEPENDS:=boost
+
+PKG_MAINTAINER:=Ben Smith <le.ben.smith@gmail.com>
+
+CMAKE_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/netwhere
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Netwhere
+  MAINTAINER:=Ben Smith
+  DEPENDS:=+libtins +libmicrohttpd
+endef
+
+define Package/netwhere/description
+  Network monitor
+endef
+
+define Package/netwhere/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/netwhere $(1)/usr/bin/netwhere
+       $(INSTALL_DIR) $(1)/www/netwhere
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/html/index.html $(1)/www/netwhere/
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/html/netwhere.js $(1)/www/netwhere/
+endef
+
+$(eval $(call BuildPackage,netwhere))
index a68747e268723d8d96f9522412920b49efb2bd62..a943d9851caeec313072a39d42b12f01119679cc 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2007-2016 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -10,10 +8,10 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=ntfs-3g
 PKG_RELEASE:=1
 
-PKG_VERSION:=2016.2.22
+PKG_VERSION:=2017.3.23
 PKG_SOURCE:=$(PKG_NAME)_ntfsprogs-$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=http://www.tuxera.com/opensource/
-PKG_MD5SUM:=ccbe8672d0f757bd0c975b50aa4c512e
+PKG_SOURCE_URL:=https://www.tuxera.com/opensource/
+PKG_HASH:=3e5a021d7b761261836dcb305370af299793eedbded731df3d6943802e1262d5
 
 PKG_LICENSE:=GPL-2.0 LGPL-2.0
 PKG_LICENSE_FILES:=COPYING COPYING.LIB
@@ -87,22 +85,8 @@ define Package/ntfs-3g-low/description
 
 endef
 
-define Package/ntfs-3g-utils
-  $(call Package/ntfs-3g/common)
-  TITLE:=ntfs-3g utilities (extra)
-  DEPENDS+= +ntfs-3g
-endef
 
 define Package/ntfs-3g-utils/description
-  Additional ntfs-3g utilities. Not included by default for size
-  considerations.
-
-  Currently:
-   - ntfs-3g.secaudit
-   - ntfs-3g.usermap
-endef
-
-define Package/ntfsprogs_ntfs-3g/description
   Suite of NTFS utilities for doing neat things with NTFS.
   Contains:
    - mkntfs - Create an NTFS filesystem.
@@ -111,17 +95,19 @@ define Package/ntfsprogs_ntfs-3g/description
    - ntfscluster - Locate the files which use the given sectors or clusters.
    - ntfscmp - Compare two NTFS filesystems and tell the differences.
    - ntfscp - Copy a file to an NTFS volume.
+   - ntfssecaudit - Display ownership and permissions, check consistency
    - ntfsfix - Check and fix some common errors, clear the LogFile.
    - ntfsinfo - Show information about NTFS or one of the files or directories within it.
    - ntfslabel - Show, or set, an NTFS filesystem's volume label.
    - ntfsls - List information about files in a directory residing on an NTFS.
    - ntfsresize - Resize NTFS without losing data.
    - ntfsundelete - Recover deleted files from NTFS.
+   - ntfsusermap - Define mapping of Windows accounts to Linux logins
 endef
 
-define Package/ntfsprogs_ntfs-3g
+define Package/ntfs-3g-utils
   $(call Package/ntfs-3g/common)
-  TITLE:=ntfsprogs (ntfs-3g)
+  TITLE:=ntfs-3g utilities
   DEPENDS+= +ntfs-3g +libgcrypt +libuuid
 endef
 
@@ -139,11 +125,11 @@ else
        TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS)
 endif
 
-# enable disable ntfsprogs
-ifneq ($(CONFIG_PACKAGE_ntfsprogs_ntfs-3g)$(SDK)$(DEVELOPER),)
-       CONFIGURE_ARGS += --enable-ntfsprogs
+# enable ntfsprogs and extras
+ifneq ($(CONFIG_PACKAGE_ntfs-3g-utils)$(SDK)$(DEVELOPER),)
+       CONFIGURE_ARGS += --enable-ntfsprogs --enable-extras
 else
-       CONFIGURE_ARGS += --disable-ntfsprogs
+       CONFIGURE_ARGS += --disable-ntfsprogs --disable-extras
 endif
 
 # redefine prepare to extract to our build dir
@@ -214,12 +200,6 @@ fi
 endef
 
 define Package/ntfs-3g-utils/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g.secaudit $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g.usermap $(1)/usr/bin
-endef
-
-define Package/ntfsprogs_ntfs-3g/install
        $(INSTALL_DIR) $(1)/sbin
        $(CP) $(PKG_INSTALL_DIR)/sbin/mkfs.ntfs $(1)/sbin/
        $(INSTALL_DIR) $(1)/usr/bin
@@ -231,4 +211,3 @@ endef
 $(eval $(call BuildPackage,ntfs-3g))
 $(eval $(call BuildPackage,ntfs-3g-low))
 $(eval $(call BuildPackage,ntfs-3g-utils))
-$(eval $(call BuildPackage,ntfsprogs_ntfs-3g))
index 577c89bf22fd2d7eb008625483d318dba3574f77..96cbb1ec62fd5ceb4d84d34b64112d0a976d2468 100644 (file)
@@ -1,8 +1,6 @@
-Index: ntfs-3g-2014.2.15-1-fuseint/libfuse-lite/fusermount.c
-===================================================================
---- ntfs-3g-2014.2.15-1-fuseint.orig/libfuse-lite/fusermount.c
-+++ ntfs-3g-2014.2.15-1-fuseint/libfuse-lite/fusermount.c
-@@ -36,6 +36,10 @@
+--- a/libfuse-lite/fusermount.c
++++ b/libfuse-lite/fusermount.c
+@@ -37,6 +37,10 @@
  
  #define FUSE_DEV_NEW "/dev/fuse"
  
@@ -13,11 +11,9 @@ Index: ntfs-3g-2014.2.15-1-fuseint/libfuse-lite/fusermount.c
  #ifndef MS_DIRSYNC
  #define MS_DIRSYNC 128
  #endif
-Index: ntfs-3g-2014.2.15-1-fuseint/libfuse-lite/mount_util.c
-===================================================================
---- ntfs-3g-2014.2.15-1-fuseint.orig/libfuse-lite/mount_util.c
-+++ ntfs-3g-2014.2.15-1-fuseint/libfuse-lite/mount_util.c
-@@ -255,6 +255,10 @@ int fuse_mnt_check_fuseblk(void)
+--- a/libfuse-lite/mount_util.c
++++ b/libfuse-lite/mount_util.c
+@@ -264,6 +264,10 @@ int fuse_mnt_check_fuseblk(void)
  
  #else /* __SOLARIS__ */
  
index 014c9df7f35fdc59343f00e9e3ecee41495fc3fb..55b71687503b6a4d69b7c29e9e9f370207a17717 100644 (file)
@@ -11,8 +11,8 @@ PKG_NAME:=oath-toolkit
 PKG_VERSION:=2.6.2
 PKG_RELEASE:=1
 PKG_SOURCE:=oath-toolkit-$(PKG_VERSION).tar.gz
+PKG_HASH:=b03446fa4b549af5ebe4d35d7aba51163442d255660558cd861ebce536824aa0
 PKG_SOURCE_URL:=@SAVANNAH/oath-toolkit
-PKG_SOURCE_MD5SUM:=4a05cd4768764843bd5493609a6bdb17
 PKG_LICENSE:=LGPL-2.0+ GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
 PKG_INSTALL:=1
index 243d8e9f328936407a6963b9c583fecaaf977dcc..092025ec9167e7aeb4a989f726c094f1e1d5bb95 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=open-plc-utils
-PKG_VERSION:=2017-01-15
+PKG_VERSION:=2017-12-03
 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
@@ -16,6 +16,7 @@ PKG_SOURCE_URL:=https://github.com/qca/open-plc-utils.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=18b7e2a9a17f043fe8ac8b457680aafb1c249c55
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=8ccbee8a6eb9a9be97bab74e02033cdb57456ae5f78fd3b19a3661352b89e259
 
 PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
 
@@ -42,11 +43,11 @@ define GenPlugin
   define Package/$(addprefix open-plc-utils-,$(1))
     $(call Package/open-plc-utils/Default)
     DEPENDS:=open-plc-utils
-    TITLE:=Utility $(2) from the Open PLC utilities
+    TITLE:=Utility $(1) from the Open PLC utilities
   endef
 
    define Package/$(addprefix open-plc-utils-,$(1))/description
-     Utility $(2) from the Open PLC utilities package.
+     Utility $(1) from the Open PLC utilities package.
    endef
 endef
 
diff --git a/utils/open-plc-utils/patches/100-remove-build-timestamp.patch b/utils/open-plc-utils/patches/100-remove-build-timestamp.patch
new file mode 100644 (file)
index 0000000..57d5eee
--- /dev/null
@@ -0,0 +1,37 @@
+Index: open-plc-utils-2017-01-15/docbook/version.h.html
+===================================================================
+--- open-plc-utils-2017-01-15.orig/docbook/version.h.html      2017-01-13 19:44:27.000000000 +0100
++++ open-plc-utils-2017-01-15/docbook/version.h.html   2017-12-03 03:46:31.119387280 +0100
+@@ -40,7 +40,6 @@
+ #define PROJECT &quot;open-plc-utils&quot;
+ #define VERSION &quot;0.0.6&quot;
+ #define RELEASE &quot;OSRQCA-929&quot;
+-#define COMPILE __TIME__ &quot; &quot; __DATE__
+ #define CONTACT &quot;cmaier@qca.qualcomm.com&quot;
+ #define LICENSE &quot;Clear BSD&quot;
+Index: open-plc-utils-2017-01-15/tools/version.c
+===================================================================
+--- open-plc-utils-2017-01-15.orig/tools/version.c     2017-01-13 19:44:27.000000000 +0100
++++ open-plc-utils-2017-01-15/tools/version.c  2017-12-03 03:45:57.358690651 +0100
+@@ -30,7 +30,6 @@
+       printf (RELEASE " ");
+       printf ("ISO C ");
+-      printf (COMPANY " ");
++      printf (COMPANY "\n");
+-      printf (COMPILE "\n");
+       return;
+ }
+Index: open-plc-utils-2017-01-15/tools/version.h
+===================================================================
+--- open-plc-utils-2017-01-15.orig/tools/version.h     2017-01-13 19:44:27.000000000 +0100
++++ open-plc-utils-2017-01-15/tools/version.h  2017-12-03 03:46:08.902929217 +0100
+@@ -20,7 +20,6 @@
+ #define PROJECT "open-plc-utils"
+ #define VERSION "0.0.6"
+ #define RELEASE "OSRQCA-929"
+-#define COMPILE __TIME__ " " __DATE__
+ #define CONTACT "https://github.com/qca/open-plc-utils"
+ #define LICENSE "Clear BSD"
index f03b96ddbd6d726bf08a91ef9481192463a8bce7..bb50a3d709a980fce197aa409aef744dbe70bf2f 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=1
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-Source
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-Source.tar.gz
 PKG_SOURCE_URL:=@SF/openobex
-PKG_MD5SUM:=3181bfed9cb7db591605391068cb0085
+PKG_HASH:=3b264665d90901ea4ff720332ffb9b6d1d8f67187463d3a3279caddc7205ea57
 
 PKG_LICENSE:=GPL-2.0+ LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING
index e18e1aa19efe577466d701cdc397f61e08976cdb..e6d4c8f949d447e6c2863fd57b8bc87bee61b538 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openocd
-PKG_VERSION:=v0.9.0
+PKG_SOURCE_VERSION:=0.10.0
+PKG_VERSION:=v$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://git.code.sf.net/p/openocd/code
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=$(PKG_VERSION)
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/openocd
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+PKG_HASH:=7312e7d680752ac088b8b8f2b5ba3ff0d30e0a78139531847be4b75c101316ae
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
@@ -59,10 +59,7 @@ CONFIGURE_ARGS += \
        --disable-werror \
        MAKEINFO=true \
        --enable-dummy \
-       --enable-sysfsgpio \
-       --enable-usb_blaster_libftdi \
-        --enable-openjtag_ftdi \
-        --enable-presto_libftdi
+       --enable-sysfsgpio
 
 define Build/Compile
         +$(MAKE_VARS) \
index 4687ac84889e161beaf8881f49dfa23da17ec5e8..f1350cfb2b11b5a1182c1634f53d383694a52dcf 100644 (file)
@@ -8,9 +8,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=opensc
-PKG_VERSION:=0.16.0
+PKG_VERSION:=0.17.0
 PKG_RELEASE:=1
-PKG_MD5SUM:=3ac8c29542bb48179e7086d35a1b8907a4e86aca3de3323c2f48bd74eaaf5729
+PKG_HASH:=be73c6816867ab4721e6a9ae7dba8e890c5f169f0a2cbb4bf354e0f30a948300
 
 PKG_LICENSE:=LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING
@@ -18,7 +18,7 @@ PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_SOURCE_URL:=https://github.com/OpenSC/OpenSC/releases/download/$(PKG_VERSION)/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 
-PKG_BUILD_DEPENDS:=+libpcsclite
+PKG_BUILD_DEPENDS:=pcsc-lite
 PKG_FIXUP:=libtool
 
 PKG_INSTALL:=1
@@ -92,7 +92,7 @@ define ProfileGen
 define Package/libopensc-profile-$(subst _,-,$(firstword $(subst :, ,$(1))))
   TITLE:=$(firstword $(subst :, ,$(1))) card profile for opensc
   URL:=https://github.com/OpenSC/OpenSC/wiki
-  SECTION:=lib
+  SECTION:=libs
   CATEGORY:=Libraries
   DEPENDS:=libopensc
 endef
@@ -152,8 +152,8 @@ $(foreach file,$(PROFILES),$(eval $(call ProfileGen,$(file))))
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopensc.{a,so}* $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmm-local.{a,so}* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopensc.{la,so}* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmm-local.{la,so}* $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/opensc-pkcs11.so $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkcs11-spy.so $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/pkcs11
diff --git a/utils/openzwave/Makefile b/utils/openzwave/Makefile
new file mode 100644 (file)
index 0000000..1445c1a
--- /dev/null
@@ -0,0 +1,96 @@
+#
+# Copyright (C) 2017  Hauke Mehrtens <hauke@hauke-m.de>
+# Copyright (C) 2016 - 2017  Stijn Tintel <stijn@linux-ipv6.be>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=openzwave
+PKG_REV:=164
+PKG_VERSION:=1.4.$(PKG_REV)
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://old.openzwave.com/downloads
+PKG_HASH:=4ecf39787aaf278c203764069b581dbc26094ce57cafeab4a0c1f012d2c0ac69
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/openzwave/default
+  URL:=http://openzwave.com
+  MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
+  DEPENDS:=+libpthread +libstdcpp
+endef
+
+define Package/openzwave/description
+       Open-ZWave is a library that interfaces with selected Z-Wave PC controllers
+endef
+
+define Package/libopenzwave
+$(call Package/openzwave/default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Open-ZWave Library
+endef
+
+define Package/openzwave
+$(call Package/openzwave/default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Open-ZWave MinOZW test utility
+  DEPENDS:=+libopenzwave +openzwave-config
+endef
+
+define Package/openzwave-config
+$(call Package/openzwave/default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Open-ZWave Device Configs
+endef
+
+MAKE_FLAGS += \
+       LD="$(TARGET_CROSS)g++" \
+       LIBDIR="$(PKG_BUILD_DIR)" \
+       PREFIX=$(CONFIGURE_PREFIX) \
+       instlibdir=/usr/lib \
+       pkgconfigdir=/usr/lib/pkgconfig \
+       sysconfdir=/etc/openzwave
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       rm $(PKG_BUILD_DIR)/cpp/src/platform/HidController.*
+       sed -i -e '/hidapi/d;/HidController/d' $(PKG_BUILD_DIR)/distfiles.mk
+endef
+
+define Package/libopenzwave/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopenzwave.so* $(1)/usr/lib/
+endef
+
+define Package/openzwave/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/MinOZW $(1)/usr/bin/
+endef
+
+define Package/openzwave-config/install
+       $(INSTALL_DIR) $(1)/etc/
+       $(CP) $(PKG_INSTALL_DIR)/etc/openzwave $(1)/etc/
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/openzwave $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopenzwave.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libopenzwave.pc $(1)/usr/lib/pkgconfig/
+endef
+
+$(eval $(call BuildPackage,libopenzwave))
+$(eval $(call BuildPackage,openzwave))
+$(eval $(call BuildPackage,openzwave-config))
diff --git a/utils/openzwave/patches/001-unix-fix-compilation-against-musl-libc-1127.patch b/utils/openzwave/patches/001-unix-fix-compilation-against-musl-libc-1127.patch
new file mode 100644 (file)
index 0000000..3001667
--- /dev/null
@@ -0,0 +1,28 @@
+From eab45f0959ccb1deb662c6f8c036651088e2e8d6 Mon Sep 17 00:00:00 2001
+From: Stijn Tintel <stijn@linux-ipv6.be>
+Date: Fri, 17 Feb 2017 05:42:25 +0100
+Subject: [PATCH] unix: fix compilation against musl libc (#1127)
+
+POSIX.1-2001 requires sys/select.h for select() and friends.
+Compile-tested on glibc and musl, runtime tested on musl.
+
+Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
+---
+ cpp/src/platform/unix/SerialControllerImpl.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cpp/src/platform/unix/SerialControllerImpl.cpp b/cpp/src/platform/unix/SerialControllerImpl.cpp
+index d95f848..b52b74f 100644
+--- a/cpp/src/platform/unix/SerialControllerImpl.cpp
++++ b/cpp/src/platform/unix/SerialControllerImpl.cpp
+@@ -25,6 +25,7 @@
+ //    along with OpenZWave.  If not, see <http://www.gnu.org/licenses/>.
+ //
+ //-----------------------------------------------------------------------------
++#include <sys/select.h>
+ #include <unistd.h>
+ #include <pthread.h>
+ #include "Defs.h"
+-- 
+2.10.2
+
diff --git a/utils/openzwave/patches/900_fix-build.patch b/utils/openzwave/patches/900_fix-build.patch
new file mode 100644 (file)
index 0000000..1081c98
--- /dev/null
@@ -0,0 +1,29 @@
+--- a/cpp/build/Makefile
++++ b/cpp/build/Makefile
+@@ -15,7 +15,7 @@
+ # what flags we will use for compiling in debug mode
+ DEBUG_CFLAGS    := -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -Werror -Wno-error=sequence-point -Wno-sequence-point -ggdb -DDEBUG -fPIC  -DSYSCONFDIR="\"$(PREFIX)/etc/openzwave/\""
+ # what flags we will use for compiling in release mode
+-RELEASE_CFLAGS  := -Wall -Wno-unknown-pragmas -Werror -Wno-format -Wno-error=sequence-point -Wno-sequence-point -O3 -DNDEBUG -fPIC  -DSYSCONFDIR="\"$(PREFIX)/etc/openzwave/\""
++RELEASE_CFLAGS  := -Wall -Wno-unknown-pragmas -Wno-error=sequence-point -Wno-sequence-point -DNDEBUG -fPIC  -DSYSCONFDIR="\"/etc/openzwave/\""
+ #what flags we will use for linking in debug mode
+ DEBUG_LDFLAGS := -g
+@@ -139,7 +139,7 @@ $(LIBDIR)/libopenzwave.a:  $(patsubst %.c
+                       $(patsubst %.cpp,$(OBJDIR)/%.o,$(indep)) \
+                       $(OBJDIR)/vers.o
+       @echo "Linking Static Library"
+-      @$(AR) $@ $+
++      @$(AR) q $@ $+
+       @$(RANLIB) $@
+ $(LIBDIR)/$(SHARED_LIB_NAME): $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \
+@@ -161,7 +161,7 @@ $(top_builddir)/libopenzwave.pc: $(top_s
+               -e 's|[@]exec_prefix@|$(PREFIX)/bin|g' \
+               -e 's|[@]libdir@|$(instlibdir)|g' \
+               -e 's|[@]includedir@|$(PREFIX)/include/openzwave/|g' \
+-                -e 's|[@]sysconfdir@|$(PREFIX)/etc/openzwave/|g' \
++                -e 's|[@]sysconfdir@|/etc/openzwave/|g' \
+                 -e 's|[@]gitversion@|$(GITVERSION)|g' \
+                 -e 's|[@]docdir@|$(docdir)/|g' \
+               -e 's|[@]VERSION@|$(VERSION)|g' \
diff --git a/utils/openzwave/patches/901_no-hidcontroller.patch b/utils/openzwave/patches/901_no-hidcontroller.patch
new file mode 100644 (file)
index 0000000..dfacbf0
--- /dev/null
@@ -0,0 +1,89 @@
+--- a/cpp/src/Driver.cpp
++++ b/cpp/src/Driver.cpp
+@@ -37,11 +37,6 @@
+ #include "platform/Event.h"
+ #include "platform/Mutex.h"
+ #include "platform/SerialController.h"
+-#ifdef WINRT
+-#include "platform/winRT/HidControllerWinRT.h"
+-#else
+-#include "platform/HidController.h"
+-#endif
+ #include "platform/Thread.h"
+ #include "platform/Log.h"
+ #include "platform/TimeStamp.h"
+@@ -223,14 +218,7 @@ m_nonceReportSentAttempt( 0 )
+       initNetworkKeys(false);
+-      if( ControllerInterface_Hid == _interface )
+-      {
+-              m_controller = new HidController();
+-      }
+-      else
+-      {
+-              m_controller = new SerialController();
+-      }
++      m_controller = new SerialController();
+       m_controller->SetSignalThreshold( 1 );
+       Options::Get()->GetOptionAsBool( "NotifyTransactions", &m_notifytransactions );
+--- a/cpp/build/Makefile
++++ b/cpp/build/Makefile
+@@ -66,16 +66,7 @@ CFLAGS  += $(CPPFLAGS)
+ #where to put the temporary library
+ LIBDIR        ?= $(top_builddir)
+-INCLUDES      := -I $(top_srcdir)/cpp/src -I $(top_srcdir)/cpp/tinyxml/ -I $(top_srcdir)/cpp/hidapi/hidapi/
+-
+-ifeq ($(UNAME),Darwin)
+-SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/mac
+-else ifeq ($(UNAME),FreeBSD)
+-SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/libusb
+-else
+-SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/linux
+-endif
+-
++INCLUDES      := -I $(top_srcdir)/cpp/src -I $(top_srcdir)/cpp/tinyxml/
+ SOURCES               := $(top_srcdir)/cpp/src $(top_srcdir)/cpp/src/command_classes $(top_srcdir)/cpp/tinyxml \
+       $(top_srcdir)/cpp/src/value_classes $(top_srcdir)/cpp/src/platform $(top_srcdir)/cpp/src/platform/unix $(SOURCES_HIDAPI) $(top_srcdir)/cpp/src/aes/
+@@ -85,14 +76,6 @@ VPATH = $(top_srcdir)/cpp/src:$(top_srcd
+ tinyxml := $(notdir $(wildcard $(top_srcdir)/cpp/tinyxml/*.cpp))
+-ifeq ($(UNAME),Darwin)
+-hidapi := $(notdir $(wildcard $(top_srcdir)/cpp/hidapi/mac/*.c))
+-else ifeq ($(UNAME),FreeBSD)
+-hidapi := $(notdir $(wildcard $(top_srcdir)/cpp/hidapi/libusb/*.c))
+-else
+-hidapi := $(notdir $(wildcard $(top_srcdir)/cpp/hidapi/linux/*.c)) # we do not want the libusb version
+-endif
+-
+ cclasses := $(notdir $(wildcard $(top_srcdir)/cpp/src/command_classes/*.cpp))
+ vclasses := $(notdir $(wildcard $(top_srcdir)/cpp/src/value_classes/*.cpp))
+ pform := $(notdir $(wildcard $(top_srcdir)/cpp/src/platform/*.cpp)) \
+@@ -111,7 +94,6 @@ printversion:
+ -include $(patsubst %.cpp,$(DEPDIR)/%.d,$(tinyxml))
+--include $(patsubst %.c,$(DEPDIR)/%.d,$(hidapi))
+ -include $(patsubst %.cpp,$(DEPDIR)/%.d,$(cclasses))
+ -include $(patsubst %.cpp,$(DEPDIR)/%.d,$(vclasses))
+ -include $(patsubst %.cpp,$(DEPDIR)/%.d,$(pform))
+@@ -131,7 +113,6 @@ $(top_srcdir)/cpp/src/vers.cpp:
+ #$(OBJDIR)/vers.o:    $(top_builddir)/vers.cpp
+ $(LIBDIR)/libopenzwave.a:     $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \
+-                      $(patsubst %.c,$(OBJDIR)/%.o,$(hidapi)) \
+                       $(patsubst %.c,$(OBJDIR)/%.o,$(aes)) \
+                       $(patsubst %.cpp,$(OBJDIR)/%.o,$(cclasses)) \
+                       $(patsubst %.cpp,$(OBJDIR)/%.o,$(vclasses)) \
+@@ -143,7 +124,6 @@ $(LIBDIR)/libopenzwave.a:  $(patsubst %.c
+       @$(RANLIB) $@
+ $(LIBDIR)/$(SHARED_LIB_NAME): $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \
+-                      $(patsubst %.c,$(OBJDIR)/%.o,$(hidapi)) \
+                       $(patsubst %.c,$(OBJDIR)/%.o,$(aes)) \
+                       $(patsubst %.cpp,$(OBJDIR)/%.o,$(cclasses)) \
+                       $(patsubst %.cpp,$(OBJDIR)/%.o,$(vclasses)) \
diff --git a/utils/openzwave/patches/902_no-udev.patch b/utils/openzwave/patches/902_no-udev.patch
new file mode 100644 (file)
index 0000000..c9176d7
--- /dev/null
@@ -0,0 +1,24 @@
+--- a/cpp/src/platform/unix/SerialControllerImpl.cpp
++++ b/cpp/src/platform/unix/SerialControllerImpl.cpp
+@@ -34,10 +34,6 @@
+ #include "SerialControllerImpl.h"
+ #include "platform/Log.h"
+-#ifdef __linux__
+-#include <libudev.h>
+-#endif
+-
+ using namespace OpenZWave;
+ //-----------------------------------------------------------------------------
+--- a/cpp/build/Makefile
++++ b/cpp/build/Makefile
+@@ -59,7 +59,7 @@ endif
+ else
+ LDFLAGS += -shared -Wl,-soname,libopenzwave.so.$(VERSION)
+-LIBS  += -ludev
++LIBS  +=
+ endif
+ CFLAGS  += $(CPPFLAGS)
diff --git a/utils/openzwave/patches/903-no-examples.patch b/utils/openzwave/patches/903-no-examples.patch
new file mode 100644 (file)
index 0000000..52ea137
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/Makefile
++++ b/Makefile
+@@ -18,15 +18,12 @@
+ all: 
+       CPPFLAGS=$(CPPFLAGS) $(MAKE) -C $(top_srcdir)/cpp/build/ -$(MAKEFLAGS) 
+-      CPPFLAGS=$(CPPFLAGS) $(MAKE) -C $(top_srcdir)/cpp/examples/MinOZW/ -$(MAKEFLAGS) 
+ install:
+       $(MAKE) -C $(top_srcdir)/cpp/build/ -$(MAKEFLAGS) $(MAKECMDGOALS)
+-      $(MAKE) -C $(top_srcdir)/cpp/examples/MinOZW/ -$(MAKEFLAGS) $(MAKECMDGOALS)
+ clean:
+       $(MAKE) -C $(top_srcdir)/cpp/build/ -$(MAKEFLAGS) $(MAKECMDGOALS)
+-      $(MAKE) -C $(top_srcdir)/cpp/examples/MinOZW/ -$(MAKEFLAGS) $(MAKECMDGOALS)
+ cpp/src/vers.cpp:
+       CPPFLAGS=$(CPPFLAGS) $(MAKE) -C $(top_srcdir)/cpp/build/ -$(MAKEFLAGS) cpp/src/vers.cpp
diff --git a/utils/openzwave/patches/904-fix-lib-include-path.patch b/utils/openzwave/patches/904-fix-lib-include-path.patch
new file mode 100644 (file)
index 0000000..d0c7c39
--- /dev/null
@@ -0,0 +1,15 @@
+diff --git a/cpp/build/Makefile b/cpp/build/Makefile
+index 666472d..41dc58c 100644
+--- a/cpp/build/Makefile
++++ b/cpp/build/Makefile
+@@ -139,8 +139,8 @@ $(top_builddir)/libopenzwave.pc: $(top_srcdir)/cpp/build/libopenzwave.pc.in $(PK
+       @$(SED) \
+               -e 's|[@]prefix@|$(PREFIX)|g' \
+               -e 's|[@]exec_prefix@|$(PREFIX)/bin|g' \
+-              -e 's|[@]libdir@|$(instlibdir)|g' \
+-              -e 's|[@]includedir@|$(PREFIX)/include/openzwave/|g' \
++              -e 's|[@]libdir@|$${prefix}/lib|g' \
++              -e 's|[@]includedir@|$${prefix}/include/openzwave/|g' \
+                 -e 's|[@]sysconfdir@|/etc/openzwave/|g' \
+                 -e 's|[@]gitversion@|$(GITVERSION)|g' \
+                 -e 's|[@]docdir@|$(docdir)/|g' \
diff --git a/utils/opus-tools/Makefile b/utils/opus-tools/Makefile
deleted file mode 100644 (file)
index e53b843..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# 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:=opus-tools
-PKG_VERSION:=0.1.9
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://downloads.xiph.org/releases/opus/
-PKG_MD5SUM:=20682e4d8d1ae9ec5af3cf43e808b8cb
-
-PKG_LICENSE:=BSD-2-Clause
-PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/opus-tools
-  SECTION:=utils
-  CATEGORY:=Utilities
-  DEPENDS:=+libogg +libopus
-  TITLE:=OPUS Codec tools
-  URL:=http://opus-codec.org/
-endef
-
-define Package/opus-tools/description
- This package provides command-line utilities to encode, inspect, and decode 
- .opus files.
-endef
-
-CONFIGURE_ARGS += \
-       --without-flac \
-
-define Package/opus-tools/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/opus{dec,enc,info} $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,opus-tools))
index e0ac78f4ba8a75b67769cd4f94572d95bc301034..37a61c6134b9bad4d2c6afea5d61cfa800c68cf5 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=b5c20998e8ffc6fa3974daef99c02402
+PKG_HASH:=f7e11bae6cd29d58726e6d29b297834e5656d6069a407d798067ae25cb0812ea
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 PKG_LICENSE:=GPL-2.0
 
@@ -34,7 +34,7 @@ include $(INCLUDE_DIR)/package.mk
 # templates
 #
 
-define Package/$(PKG_NAME)/Default
+define Package/owfs/Default
   TITLE:=OWFS (1-Wire File System)
   URL:=http://owfs.sourceforge.net/
   SECTION:=net
@@ -42,7 +42,7 @@ define Package/$(PKG_NAME)/Default
   SUBMENU:=Filesystem
 endef
 
-define Package/$(PKG_NAME)/Default/description
+define Package/owfs/Default/description
   OWFS is a suite of programs that designed to make the 1-wire bus and its
   devices easily accessible. The underlying principle is to create a virtual
   filesystem, with the unique ID being the directory, and the individual
@@ -94,7 +94,7 @@ define Package/libow/config
 endef
 
 define Package/libow/description
-  $(call Package/$(PKG_NAME)/Default/description)
+  $(call Package/owfs/Default/description)
 
   This package contains the OWFS library.
 endef
@@ -106,7 +106,7 @@ define Package/libow-capi
 endef
 
 define Package/libow-capi/description
-  $(call Package/$(PKG_NAME)/Default/description)
+  $(call Package/owfs/Default/description)
 
   This package contains the OWFS C-API library.
 endef
@@ -122,7 +122,7 @@ define Package/owshell
 endef
 
 define Package/owshell/description
-  $(call Package/$(PKG_NAME)/Default/description)
+  $(call Package/owfs/Default/description)
 
   This package contains the OWFS shell utilities.
 endef
@@ -135,7 +135,7 @@ define Package/owfs
 endef
 
 define Package/owfs/description
-  $(call Package/$(PKG_NAME)/Default/description)
+  $(call Package/owfs/Default/description)
 
   This package contains the OWFS fuse filesystem.
 endef
@@ -150,7 +150,7 @@ define Package/owhttpd
 endef
 
 define Package/owhttpd/description
-  $(call Package/$(PKG_NAME)/Default/description)
+  $(call Package/owfs/Default/description)
 
   This package contains the OWFS http server.
 endef
@@ -161,7 +161,7 @@ define Package/owftpd
 endef
 
 define Package/owftpd/description
-  $(call Package/$(PKG_NAME)/Default/description)
+  $(call Package/owfs/Default/description)
 
   This package contains the OWFS ftp server.
 endef
@@ -172,7 +172,7 @@ define Package/owserver
 endef
 
 define Package/owserver/description
-  $(call Package/$(PKG_NAME)/Default/description)
+  $(call Package/owfs/Default/description)
 
   This package contains the OWFS network server.
 endef
index 3f61b4450fd39f624d3ae33b6527258a76c88f21..9d04894f2fbf7703ff2c0fd8a97b2c7d29fd9feb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2016 OpenWrt.org
+# Copyright (C) 2007-2017 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:=pciutils
-PKG_VERSION:=3.5.2
+PKG_VERSION:=3.5.6
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
-PKG_MD5SUM:=3a99141a9f40528d0a0035665a06dc37ddb1ae341658e51b50a76ecf86235efc
+PKG_HASH:=f346eeb90cce0910c05b877fe49eadc760fa084c0455fd313e39d4b2c2d4bb21
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=GPL-2.0
@@ -37,17 +37,26 @@ define Package/pciutils/description
  of PCI devices
 endef
 
-define Package/pciutils/postinst
-#!/bin/sh
-[ -z "$${IPKG_INSTROOT}" ] || \
-(cd $${PKG_ROOT}/usr/share; $${PKG_ROOT}/usr/sbin/update-pciids; rm pci.ids.gz.old)
-exit 0
+PCI_IDS_REV:=91cfa8a0c994634ba9a4a8639aa2ac6dff8453b9
+PCI_IDS_FILE:=pci.ids.$(PCI_IDS_REV)
+define Download/pci_ids
+  FILE:=$(PCI_IDS_FILE)
+  URL_FILE:=pci.ids
+  URL:=@GITHUB/pciutils/pciids/$(PCI_IDS_REV)
+  HASH:=798528092d1c58eeac99c6505033ec4ce8fe3e19d7e0c41b06790d58753a89b6
+endef
+$(eval $(call Download,pci_ids))
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       $(RM) $(PKG_BUILD_DIR)/pci.ids
+       $(CP) $(DL_DIR)/$(PCI_IDS_FILE) $(PKG_BUILD_DIR)/pci.ids
 endef
 
 MAKE_FLAGS += \
-       CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
+       CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
        PREFIX="/usr" \
-       HOST="$(GNU_TARGET_NAME)" \
+       HOST="Linux" \
        HWDB="no" \
        ZLIB="yes"
 
index c38d1cfc57104351810778f1dafd989bf3bbfac8..0acfb81cb5bb607c22779f128fde921ca6d43667 100644 (file)
@@ -1,6 +1,6 @@
 --- a/lib/configure
 +++ b/lib/configure
-@@ -57,7 +57,7 @@ echo >>$c "#define PCI_OS_`echo $sys | t
+@@ -52,7 +52,7 @@ echo >>$c "#define PCI_OS_`echo $sys | t
  echo >$m 'WITH_LIBS='
  
  echo_n "Looking for access methods..."
index 8df4b8ce7b412a7de8ea473746516a38c199eb82..14f7ded61e3bd9a2217ad9f5b8c738e361b402f0 100644 (file)
@@ -1,6 +1,6 @@
 --- a/lib/configure
 +++ b/lib/configure
-@@ -44,7 +44,7 @@ if [ -z "$HOST" ] ; then
+@@ -39,7 +39,7 @@ if [ -z "$HOST" ] ; then
  fi
  [ -n "$RELEASE" ] && rel="${RELEASE}"
  # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless.
diff --git a/utils/pcmciautils/Makefile b/utils/pcmciautils/Makefile
new file mode 100644 (file)
index 0000000..026089b
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2008-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:=pcmciautils
+PKG_VERSION:=018
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/pcmcia
+PKG_HASH:=79e6ae441278e178c07501d492394ed2c0326fdb66894f6d040ec811b0dc8ed5
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINATINER:=Tomasz Maciej Nowak <tomek_n@o2.pl>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/pcmciautils
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libsysfs @PCMCIA_SUPPORT
+  TITLE:=PCMCIA Utilities
+  URL:=http://www.kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html
+endef
+
+define Build/Compile
+       $(call Build/Compile/Default, \
+               LD="$(TARGET_CC)" UDEV=false \
+               CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) \
+               -DPCMCIAUTILS_VERSION=\\\"$(PKG_VERSION)\\\"" \
+               prefix=/usr all \
+       )
+endef
+
+define Package/pcmciautils/install
+       $(INSTALL_DIR) $(1)/usr/sbin/
+       $(CP) $(PKG_BUILD_DIR)/pccardctl $(1)/usr/sbin/
+       $(CP) $(PKG_BUILD_DIR)/pcmcia-check-broken-cis $(1)/usr/sbin/
+       $(CP) $(PKG_BUILD_DIR)/pcmcia-socket-startup $(1)/usr/sbin/
+       rm -f $(1)/usr/sbin/lspcmcia
+       ln -s pccardctl $(1)/usr/sbin/lspcmcia
+       $(INSTALL_DIR) $(1)/etc/pcmcia/
+       $(CP) $(PKG_BUILD_DIR)/config/config.opts $(1)/etc/pcmcia/
+       $(CP) files/* $(1)/
+endef
+
+define Package/pcmciautils/conffiles
+/etc/pcmcia/config.opts
+endef
+
+$(eval $(call BuildPackage,pcmciautils))
diff --git a/utils/pcmciautils/files/etc/hotplug.d/pcmcia/pcmcia.agent b/utils/pcmciautils/files/etc/hotplug.d/pcmcia/pcmcia.agent
new file mode 100644 (file)
index 0000000..537c50a
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+# Copyright (C) 2008 OpenWrt.org
+
+case "$ACTION" in
+       add)
+               SYSFS=/sys/bus/pcmcia/devices/
+               DEVPATH=$SOCKET_NO.$((0x$DEVICE_NO))
+
+               # check whether the CIS is completely broken
+               if [ ! -h $SYSFS$DEVPATH/driver ]; then
+                       CISFILE=$(/usr/sbin/pcmcia-check-broken-cis $SOCKET_NO)
+                       echo PCMCIA: $CISFILE;
+                       if [ ! -z $CISFILE ]; then
+                               if [ -f /lib/firmware/$CISFILE ]; then
+                                       cat /lib/firmware/$CISFILE > $SYSFS/class/pcmcia_socket/pcmcia_socket$(SOCKET_NO)/cis
+                               fi;
+                       fi;
+               fi;
+
+               # allow a match solely based on the "function ID" field
+               if [ ! -h $SYSFS$DEVPATH/driver ]; then
+                       if [ -w $SYSFS$DEVPATH/allow_func_id_match ]; then
+                               echo PCMCIA: allowing func_id based match for PCMCIA device $SOCKET_NO.$DEVICE_NO
+                               echo -n "42" > $SYSFS$DEVPATH/allow_func_id_match;
+                       fi;
+               fi;
+               ;;
+esac
diff --git a/utils/pcmciautils/files/etc/hotplug.d/pcmcia_socket/pcmcia_socket.agent b/utils/pcmciautils/files/etc/hotplug.d/pcmcia_socket/pcmcia_socket.agent
new file mode 100644 (file)
index 0000000..79b3524
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Copyright (C) 2008 OpenWrt.org
+
+case "$ACTION" in
+       add)
+               echo PCMCIA: socket number: $SOCKET_NO
+
+               sleep 1;
+               /usr/sbin/pcmcia-socket-startup $SOCKET_NO
+               DONE_FILE=/sys/class/pcmcia_socket/pcmcia_socket$SOCKET_NO/available_resources_setup_done
+               if [ -f  $DONE_FILE ]; then
+                       if [ -w $DONE_FILE ]; then
+                               echo -n "42" > $DONE_FILE
+                       fi;
+               fi;
+               ;;
+
+esac
diff --git a/utils/pcmciautils/files/etc/init.d/pcmcia b/utils/pcmciautils/files/etc/init.d/pcmcia
new file mode 100755 (executable)
index 0000000..16f2276
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2008 OpenWrt.org 
+
+START=42
+start() {
+       if [ -d /sys/bus/pcmcia/devices/ ]; then
+               # 2.6 kernels
+               cd /sys/bus/pcmcia/devices/
+               for PCMCIA_DEVICE in *; do
+                       if [ $PCMCIA_DEVICE == \* ]; then
+                               continue;
+                       fi;
+                       MODALIAS=$(cat $PCMCIA_DEVICE/modalias)
+                       echo PCMCIA: $MODALIAS $PCMCIA_DEVICE
+                       if [ -z $MODALIAS ]; then
+                               continue;
+                       fi;
+                       ACTION=add
+                       SOCKET_NO=$(echo $PCMCIA_DEVICE | cut -d. -f1)
+                       DEVICE_NO=$(echo $MODALIAS | sed 's/.*pfn\(..\).*/\1/')
+                       export MODALIAS ACTION SOCKET_NO DEVICE_NO
+                       /sbin/hotplug-call pcmcia
+               done;
+       fi;
+}
diff --git a/utils/pcmciautils/files/etc/init.d/pcmcia_socket b/utils/pcmciautils/files/etc/init.d/pcmcia_socket
new file mode 100755 (executable)
index 0000000..fdd0b8c
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2008 OpenWrt.org 
+
+START=41
+start() {
+       if [ -d /sys/class/pcmcia_socket/ ]; then
+               # 2.6 kernels
+               cd /sys/class/pcmcia_socket/
+               for PCMCIA_SOCKET in *; do
+                       if [ $PCMCIA_SOCKET == \* ]; then
+                               continue;
+                       fi;
+                       SOCKET_NO=$(echo $PCMCIA_SOCKET | cut -b14-)
+                       ACTION=add
+                       export SOCKET_NO ACTION
+                       /sbin/hotplug-call pcmcia_socket
+               done;
+       fi;
+}
diff --git a/utils/pcmciautils/patches/001-switch_unsigned.patch b/utils/pcmciautils/patches/001-switch_unsigned.patch
new file mode 100644 (file)
index 0000000..8a1559c
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/yacc_config.y
++++ b/src/yacc_config.y
+@@ -40,7 +40,7 @@
+ %union {
+     char *str;
+-    u_long num;
++    unsigned long num;
+     struct adjust_list_t *adjust;
+ }
diff --git a/utils/pcmciautils/patches/002-disable_yywrap.patch b/utils/pcmciautils/patches/002-disable_yywrap.patch
new file mode 100644 (file)
index 0000000..e30abb0
--- /dev/null
@@ -0,0 +1,27 @@
+--- pcmciautils-018/src/lex_config.l
++++ pcmciautils-018/src/lex_config.l
+@@ -1,8 +1,8 @@
+ /* Special state for handling include files */
+ %x src
+-%option noinput nounput
++%option noinput nounput noyywrap
+ %{
+ /*
+  * Startup tool for non statically mapped PCMCIA sockets
+  *
+@@ -75,14 +75,10 @@ module             /* skip */ ;
+ .             return yytext[0];
+ %%
+-#ifndef yywrap
+-int yywrap() { return 1; }
+-#endif
+-
+ /*======================================================================
+     Stuff to parse basic data types
+ ======================================================================*/
index dc96467c55fd83e48a8793ecfcfd439fdc074fca..c8218f2aa8545f6e1eaba1bba3aae12052403709 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pcsc-lite
-PKG_VERSION:=1.8.20
+PKG_VERSION:=1.8.23
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4203
-PKG_MD5SUM:=ec7d0114016c788c1c09859c84860f6cec6c4595436d23245105154b9c046bb2
+PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4235
+PKG_HASH:=5a27262586eff39cfd5c19aadc8891dd71c0818d3d629539bd631b958be689c9
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING
@@ -24,7 +24,7 @@ PKG_INSTALL:=1
 include $(INCLUDE_DIR)/package.mk
 
 define Package/pcsc-lite/Default
-  TITLE:=Middleware to access a smart card using SCard API (PC/SC).
+  TITLE:=Access a smart card using SCard API (PC/SC)
   URL:=http://pcsclite.alioth.debian.org/
 endef
 
@@ -67,6 +67,7 @@ TARGET_LDFLAGS += -lpthread
 
 CONFIGURE_ARGS += \
        --disable-libudev \
+       --disable-libsystemd \
        --enable-libusb \
        --enable-static \
        --enable-usbdropdir=/usr/lib/pcsc/drivers
diff --git a/utils/pcsc-tools/Makefile b/utils/pcsc-tools/Makefile
new file mode 100644 (file)
index 0000000..249d722
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2017 Daniel Engberg <daniel.engberg.lists@pyret.net>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pcsc-tools
+PKG_VERSION=1.5.2
+PKG_RELEASE:=1
+PKG_MAINTAINER:=
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://ludovic.rousseau.free.fr/softwares/pcsc-tools/
+PKG_HASH:=ff4e087c76700aa5a25dd7d0bc4f55bb4a5e71cd4f0d6b5301babe0b434f86fc
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/pcsc-tools
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libpcsclite
+  TITLE:=pcsc-tools
+  URL:=http://ludovic.rousseau.free.fr/softwares/pcsc-tools/
+endef
+
+define Package/pcsc-tools/description
+  Tools that are used to test a PC/SC driver, card or reader.
+  Only includes pcsc_scan without ATR analysis for now.
+endef
+
+define Package/pcsc-tools/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/pcsc_scan $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,pcsc-tools))
diff --git a/utils/pcsc-tools/patches/001-disable-atr.patch b/utils/pcsc-tools/patches/001-disable-atr.patch
new file mode 100644 (file)
index 0000000..127f192
--- /dev/null
@@ -0,0 +1,17 @@
+Windows (Win32) doesn't support the analyze ATR perl-script and since we 
+don't want to pull in perl as a dependency add the same workaround here. 
+
+diff --git a/pcsc_scan.c b/pcsc_scan.c
+index e1d8942..81344e1 100644
+--- a/pcsc_scan.c
++++ b/pcsc_scan.c
+@@ -224,9 +224,7 @@ int main(int argc, char *argv[])
+       printf("PC/SC device scanner\n");
+       printf("V " PACKAGE_VERSION " (c) 2001-2017, Ludovic Rousseau <ludovic.rousseau@free.fr>\n");
+-#ifdef WIN32
+       analyse_atr = FALSE;
+-#endif
+       while ((opt = getopt(argc, argv, "Vhns")) != EOF)
+       {
index 31a1ad644bdca3066a4daf4a5aeeb1cf25fe1080..7eb2b438881561dadfcd35c823f5c9459e09d7cd 100644 (file)
@@ -12,8 +12,8 @@ PKG_VERSION:=1.7
 PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://picocom.googlecode.com/files
-PKG_MD5SUM:=8eaba1d31407e8408674d6e57af447ef
+PKG_SOURCE_URL:=https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/picocom
+PKG_HASH:=d0f31c8f7a215a76922d30c81a52b9a2348c89e02a84935517002b3bc2c1129e
 
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
 PKG_LICENSE:=GPL-2.0+
index 578004d7b84dbe4d27edf6f99a3be0eb6e9af22b..418d74291c1ab7c76e8523bbd32d1bd1821e1207 100644 (file)
@@ -16,6 +16,7 @@ PKG_SOURCE_URL:=git://github.com/ago/pps-tools
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=0deb9c7e135e9380a6d09e9d2e938a146bb698c8
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MIRROR_HASH:=46bd7acf9a0f8fec1858496844ba0ef2f9525a22ac8c5c61b3fc4f2dc5881f33
 
 PKG_MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
 PKG_LICENSE:=GPL-2.0
index 7a33d2297212d531f286d952e8d39eadc97958b6..f302c2693b181de8769e24ed21166378067ea63b 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=procps-ng
 PKG_VERSION:=3.3.11
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING COPYING.LIB
 
@@ -18,6 +18,9 @@ PKG_SOURCE_URL:=https://gitlab.com/procps-ng/procps.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=8a198e3eafbde0b627e9992b41d26e6762e4f8c7
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=60da7bd78e834112494e4019998c9de8d61f747eab244ef3c42cadc7fd0958cc
+
+PKG_MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
@@ -28,17 +31,25 @@ include $(INCLUDE_DIR)/package.mk
 
 CONFIGURE_ARGS += --enable-skill
 
+# most of these have alternatives provided by busybox applets
 PROCPS_APPLETS := \
     free kill pgrep pkill pmap ps pwdx skill slabtop \
     snice tload top uptime vmstat w watch
 
+# procps-ng will be configured with "--bindir=/usr/bin --sbindir=/usr/sbin" and
+# as such executables will be installed there by default, but some of them need
+# to reside in locations such as /bin and /sbin to be in accordance with
+# busybox alternatives which is also other distributions like debian and centos
+# are doing
+PROCPS_APPLETS_DIR_bin:=kill ps watch
+procps-applets-dir=$(if $(findstring $(1),$(PROCPS_APPLETS_DIR_bin)),/bin,/usr/bin)
+
 define Package/procps-ng/Default
   SECTION:=utils
   CATEGORY:=Utilities
   DEPENDS:=+libncurses
   TITLE:=procps-ng utilities
   URL:=https://gitlab.com/procps-ng/procps
-  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
 endef
 
 define Build/Prepare
@@ -66,6 +77,7 @@ define GenPlugin
    DEPENDS:=procps-ng
    TITLE:=Applet $(2) from the procps-ng package
    DEFAULT:=y
+   ALTERNATIVES:=200:$(3)/$(2):$(3)/$(1)
  endef
 
  define Package/$(1)/description
@@ -73,7 +85,7 @@ define GenPlugin
  endef
 endef
 
-$(foreach a,$(PROCPS_APPLETS),$(eval $(call GenPlugin,procps-ng-$(a),$(a))))
+$(foreach a,$(PROCPS_APPLETS),$(eval $(call GenPlugin,procps-ng-$(a),$(a),$(call procps-applets-dir,$(a)))))
 
 MAKE_FLAGS += \
        CFLAGS="$(TARGET_CFLAGS)" \
@@ -81,19 +93,18 @@ MAKE_FLAGS += \
        LDFLAGS="$(TARGET_LDFLAGS)" \
 
 define Package/procps-ng/install
-       $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_DIR) $(1)/usr/lib
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libprocps.so* $(1)/usr/lib/
 endef
 
 define BuildPlugin
   define Package/$(1)/install
-       $(INSTALL_DIR) $$(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/
+       $(INSTALL_DIR) $$(1)$(3)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)$(3)/$(1)
   endef
 
   $$(eval $$(call BuildPackage,$(1)))
 endef
 
-$(foreach a,$(PROCPS_APPLETS),$(eval $(call BuildPlugin,procps-ng-$(a),$(a))))
+$(foreach a,$(PROCPS_APPLETS),$(eval $(call BuildPlugin,procps-ng-$(a),$(a),$(call procps-applets-dir,$(a)))))
 $(eval $(call BuildPackage,procps-ng))
diff --git a/utils/progress/Makefile b/utils/progress/Makefile
new file mode 100644 (file)
index 0000000..35b6d2e
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2016 Nikil Mehta <nikil.mehta@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=progress
+PKG_VERSION:=0.13.1
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/Xfennec/progress.git
+PKG_SOURCE_VERSION:=f6894b827c638af5cf8c5c622e66491c179ba2eb
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=143047dd44f78c10763446097bcadc551e99a7a8fefc484ef5a65d7bcbe8c181
+
+PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/progress
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Coreutils Progress Viewer (formerly known as 'cv')
+  URL:=https://github.com/Xfennec/progress
+  DEPENDS:=+libncursesw
+endef
+
+define Package/progress/description
+       This tool can be described as a Tiny, Dirty, Linux-and-OSX-Only
+       C command that looks for coreutils basic commands (cp, mv, dd, tar,
+       gzip/gunzip, cat, etc.) currently running on your system and
+       displays the percentage of copied data. It can also show estimated
+       time and throughput, and provide a "top-like" mode (monitoring).
+       .
+       It simply scans `/proc` for interesting commands, and then looks at
+       directories `fd` and `fdinfo` to find opened files and seek positions,
+       and reports status for the largest file.
+       .
+       It's very light, and compatible with virtually any command.
+       This program was formerly known as 'cv' on github.
+endef
+
+define Package/progress/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/progress $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,progress))
diff --git a/utils/progress/patches/001_set-ncurses-lib.patch b/utils/progress/patches/001_set-ncurses-lib.patch
new file mode 100644 (file)
index 0000000..64b3508
--- /dev/null
@@ -0,0 +1,23 @@
+--- a/Makefile 2016-11-26 01:24:23.392903433 -0800
++++ b/Makefile 2016-11-26 01:24:41.084939184 -0800
+@@ -1,19 +1,6 @@
+ OBJ = progress
+ override CFLAGS += -g -Wall -D_FILE_OFFSET_BITS=64
+-override LDFLAGS += -lm
+-UNAME := $(shell uname)
+-ifeq ($(UNAME), Linux)
+-    ifeq (, $(shell which pkg-config 2> /dev/null))
+-    $(error "pkg-config command not found")
+-    endif
+-    ifeq (, $(shell pkg-config ncurses --libs 2> /dev/null))
+-    $(error "ncurses package not found")
+-    endif
+-    override LDFLAGS += $(shell pkg-config ncurses --libs)
+-endif
+-ifeq ($(UNAME), Darwin)
+-    override LDFLAGS += -lncurses
+-endif
++override LDFLAGS += -lm -lncursesw
+ PREFIX ?= /usr/local
+ BINDIR = $(PREFIX)/bin
+ MANDIR = $(PREFIX)/share/man/man1
diff --git a/utils/prometheus-node-exporter-lua/Makefile b/utils/prometheus-node-exporter-lua/Makefile
new file mode 100644 (file)
index 0000000..2d8c681
--- /dev/null
@@ -0,0 +1,128 @@
+#
+# Copyright (C) 2013-2017 OpenWrt.org
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=prometheus-node-exporter-lua
+PKG_VERSION:=2017.12.08
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Christian Simon <simon@swine.de>
+PKG_LICENSE:=Apache-2.0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/prometheus-node-exporter-lua/Default
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Prometheus node exporter
+  PKGARCH:=all
+endef
+
+define Package/prometheus-node-exporter-lua
+  $(call Package/prometheus-node-exporter-lua/Default)
+  DEPENDS:=+luasocket +lua
+endef
+
+define Package/prometheus-node-exporter-lua/conffiles
+/etc/config/prometheus-node-exporter-lua
+endef
+
+define Package/prometheus-node-exporter-lua/description
+  Provides node metrics as Prometheus scraping endpoint.
+
+  This service is a lightweight rewrite in LUA of the offical Prometheus node_exporter.
+endef
+
+define Package/prometheus-node-exporter-lua-nat_traffic
+  $(call Package/prometheus-node-exporter-lua/Default)
+  TITLE+= (nat_traffic collector)
+  DEPENDS:=prometheus-node-exporter-lua
+endef
+
+define Package/prometheus-node-exporter-lua-netstat
+  $(call Package/prometheus-node-exporter-lua/Default)
+  TITLE+= (netstat collector)
+  DEPENDS:=prometheus-node-exporter-lua
+endef
+
+define Package/prometheus-node-exporter-lua-wifi
+  $(call Package/prometheus-node-exporter-lua/Default)
+  TITLE+= (wifi collector)
+  DEPENDS:=prometheus-node-exporter-lua +libiwinfo-lua +libubus-lua
+endef
+
+define Package/prometheus-node-exporter-lua-wifi_stations
+  $(call Package/prometheus-node-exporter-lua/Default)
+  TITLE+= (wifi_stations collector)
+  DEPENDS:=prometheus-node-exporter-lua +libiwinfo-lua +libubus-lua
+endef
+
+define Package/prometheus-node-exporter-lua-bmx6
+  $(call Package/prometheus-node-exporter-lua/Default)
+  TITLE+= (bmx6 links collector)
+  DEPENDS:=prometheus-node-exporter-lua bmx6 +lua-cjson +bmx6-json
+endef
+
+define Package/prometheus-node-exporter-lua-bmx7
+  $(call Package/prometheus-node-exporter-lua/Default)
+  TITLE+= (bmx7 links collector)
+  DEPENDS:=prometheus-node-exporter-lua bmx7 +lua-cjson +bmx7-json
+endef
+
+Build/Compile=
+
+define Package/prometheus-node-exporter-lua/install
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/etc/config/prometheus-node-exporter-lua $(1)/etc/config/prometheus-node-exporter-lua
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/etc/init.d/prometheus-node-exporter-lua $(1)/etc/init.d/prometheus-node-exporter-lua
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) ./files/usr/bin/prometheus-node-exporter-lua $(1)/usr/bin/prometheus-node-exporter-lua
+       $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
+       $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/cpu.lua         $(1)/usr/lib/lua/prometheus-collectors/
+       $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/filefd.lua      $(1)/usr/lib/lua/prometheus-collectors/
+       $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/loadavg.lua     $(1)/usr/lib/lua/prometheus-collectors/
+       $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/meminfo.lua     $(1)/usr/lib/lua/prometheus-collectors/
+       $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/netdev.lua      $(1)/usr/lib/lua/prometheus-collectors/
+       $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/time.lua        $(1)/usr/lib/lua/prometheus-collectors/
+       $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/uname.lua       $(1)/usr/lib/lua/prometheus-collectors/
+endef
+
+define Package/prometheus-node-exporter-lua-nat_traffic/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
+       $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/nat_traffic.lua $(1)/usr/lib/lua/prometheus-collectors/
+endef
+
+define Package/prometheus-node-exporter-lua-netstat/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
+       $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/netstat.lua $(1)/usr/lib/lua/prometheus-collectors/
+endef
+
+define Package/prometheus-node-exporter-lua-wifi/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
+       $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/wifi.lua $(1)/usr/lib/lua/prometheus-collectors/
+endef
+
+define Package/prometheus-node-exporter-lua-wifi_stations/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
+       $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/wifi_stations.lua $(1)/usr/lib/lua/prometheus-collectors/
+endef
+
+define Package/prometheus-node-exporter-lua-bmx6/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
+       $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/bmx6.lua $(1)/usr/lib/lua/prometheus-collectors/
+endef
+
+define Package/prometheus-node-exporter-lua-bmx7/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
+       $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/bmx7.lua $(1)/usr/lib/lua/prometheus-collectors/
+endef
+
+$(eval $(call BuildPackage,prometheus-node-exporter-lua))
+$(eval $(call BuildPackage,prometheus-node-exporter-lua-nat_traffic))
+$(eval $(call BuildPackage,prometheus-node-exporter-lua-netstat))
+$(eval $(call BuildPackage,prometheus-node-exporter-lua-wifi))
+$(eval $(call BuildPackage,prometheus-node-exporter-lua-wifi_stations))
+$(eval $(call BuildPackage,prometheus-node-exporter-lua-bmx6))
+$(eval $(call BuildPackage,prometheus-node-exporter-lua-bmx7))
diff --git a/utils/prometheus-node-exporter-lua/files/etc/config/prometheus-node-exporter-lua b/utils/prometheus-node-exporter-lua/files/etc/config/prometheus-node-exporter-lua
new file mode 100644 (file)
index 0000000..1401a1a
--- /dev/null
@@ -0,0 +1,3 @@
+config prometheus-node-exporter-lua 'main'
+       option listen_address '::1'
+       option listen_port '9100'
diff --git a/utils/prometheus-node-exporter-lua/files/etc/init.d/prometheus-node-exporter-lua b/utils/prometheus-node-exporter-lua/files/etc/init.d/prometheus-node-exporter-lua
new file mode 100644 (file)
index 0000000..a1a4707
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2013-2017 OpenWrt.org
+
+START=60
+USE_PROCD=1
+
+start_service() {
+       procd_open_instance
+
+       config_load prometheus-node-exporter-lua.main
+       config_get bind "main" listen_address ::1
+       config_get port "main" listen_port 9100
+
+       procd_set_param command /usr/bin/prometheus-node-exporter-lua
+       procd_append_param command --port ${port}
+       procd_append_param command --bind ${bind}
+
+       procd_set_param stdout 1
+       procd_set_param stderr 1
+
+       procd_close_instance
+}
diff --git a/utils/prometheus-node-exporter-lua/files/usr/bin/prometheus-node-exporter-lua b/utils/prometheus-node-exporter-lua/files/usr/bin/prometheus-node-exporter-lua
new file mode 100755 (executable)
index 0000000..62e4022
--- /dev/null
@@ -0,0 +1,146 @@
+#!/usr/bin/lua
+
+-- Metrics web server
+
+-- Copyright (c) 2016 Jeff Schornick <jeff@schornick.org>
+-- Copyright (c) 2015 Kevin Lyda
+-- Licensed under the Apache License, Version 2.0
+
+socket = require("socket")
+
+-- Parsing
+
+function space_split(s)
+  local elements = {}
+  for element in s:gmatch("%S+") do
+    table.insert(elements, element)
+  end
+  return elements
+end
+
+function get_contents(filename)
+  local f = io.open(filename, "rb")
+  local contents = ""
+  if f then
+    contents = f:read "*a"
+    f:close()
+  end
+
+  return contents
+end
+
+-- Metric printing
+
+function print_metric(metric, labels, value)
+  local label_string = ""
+  if labels then
+    for label,value in pairs(labels) do
+      label_string =  label_string .. label .. '="' .. value .. '",'
+    end
+    label_string = "{" .. string.sub(label_string, 1, -2) .. "}"
+  end
+  output(string.format("%s%s %s", metric, label_string, value))
+end
+
+function metric(name, mtype, labels, value)
+  output("# TYPE " .. name .. " " .. mtype)
+  local outputter = function(labels, value)
+    print_metric(name, labels, value)
+  end
+  if value then
+    outputter(labels, value)
+  end
+  return outputter
+end
+
+function timed_scrape(collector)
+  local start_time = socket.gettime()
+  local success = 1
+  local status, err = pcall(collector.scrape)
+  if not status then
+    success = 0
+    print(err)
+  end
+  return (socket.gettime() - start_time), success
+end
+
+function run_all_collectors(collectors)
+  local metric_duration = metric("node_scrape_collector_duration_seconds", "gauge")
+  local metric_success = metric("node_scrape_collector_success", "gauge")
+  for _,cname in pairs(collectors) do
+    if col_mods[cname] ~= nil then
+      local duration, success = timed_scrape(col_mods[cname])
+      local labels = {collector=cname}
+      metric_duration(labels, duration)
+      metric_success(labels, success)
+    end
+  end
+end
+
+-- Web server-specific functions
+
+function http_ok_header()
+  output("HTTP/1.0 200 OK\r\nServer: lua-metrics\r\nContent-Type: text/plain; version=0.0.4\r\n\r")
+end
+
+function http_not_found()
+  output("HTTP/1.0 404 Not Found\r\nServer: lua-metrics\r\nContent-Type: text/plain\r\n\r\nERROR: File Not Found.")
+end
+
+function serve(request)
+  local q = request:match("^GET /metrics%??([^ ]*) HTTP/1%.[01]$")
+  if q == nil then
+    http_not_found()
+  else
+    http_ok_header()
+    local cols = {}
+    for c in q:gmatch("collect[^=]*=([^&]+)") do
+      cols[#cols+1] = c
+    end
+    if #cols == 0 then
+      cols = col_names
+    end
+    run_all_collectors(cols)
+  end
+  client:close()
+  return true
+end
+
+-- Main program
+
+for k,v in ipairs(arg) do
+  if (v == "-p") or (v == "--port") then
+    port = arg[k+1]
+  end
+  if (v == "-b") or (v == "--bind") then
+    bind = arg[k+1]
+  end
+end
+
+col_mods = {}
+col_names = {}
+for c in io.popen("ls -1 /usr/lib/lua/prometheus-collectors/*.lua"):lines() do
+  c = c:match("([^/]+)%.lua$")
+  col_mods[c] = require('prometheus-collectors.'..c)
+  col_names[#col_names+1] = c
+end
+
+if port then
+  server = assert(socket.bind(bind, port))
+
+  while 1 do
+    client = server:accept()
+    client:settimeout(60)
+    local request, err = client:receive()
+
+    if not err then
+      output = function (str) client:send(str.."\n") end
+      if not serve(request) then
+        break
+      end
+    end
+  end
+else
+  output = print
+  run_all_collectors(col_names)
+end
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/bmx6.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/bmx6.lua
new file mode 100644 (file)
index 0000000..6b6c118
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/lua
+
+local json = require "cjson"
+
+local function interpret_suffix(rate)
+  local value = string.sub(rate, 1, -2)
+  local suffix = string.sub(rate, -1)
+  if suffix == "K" then return tonumber(value) * 10^3 end
+  if suffix == "M" then return tonumber(value) * 10^6 end
+  if suffix == "G" then return tonumber(value) * 10^9 end
+  return rate
+end
+
+local function scrape()
+  local status = json.decode(get_contents("/var/run/bmx6/json/status")).status
+  local labels = {
+    version = status.version,
+    id = status.name,
+    address = status.primaryIp
+  }
+
+  metric("bmx6_status", "gauge", labels, 1)
+
+  local links = json.decode(get_contents("/var/run/bmx6/json/links")).links
+  local metric_bmx6_rxRate = metric("bmx6_link_rxRate","gauge")
+  local metric_bmx6_txRate = metric("bmx6_link_txRate","gauge")
+
+  for _, link in pairs(links) do
+    local labels = {
+      source = status.name,
+      target = link.name,
+      dev = link.viaDev
+    }
+    metric_bmx6_rxRate(labels, interpret_suffix(link.rxRate))
+    metric_bmx6_txRate(labels, interpret_suffix(link.txRate))
+  end
+end
+
+return { scrape = scrape }
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/bmx7.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/bmx7.lua
new file mode 100644 (file)
index 0000000..a6d6e9f
--- /dev/null
@@ -0,0 +1,45 @@
+#!/usr/bin/lua
+
+local json = require "cjson"
+
+local function interpret_suffix(rate)
+  if rate ~= nil then
+    local value = string.sub(rate, 1, -2)
+    local suffix = string.sub(rate, -1)
+    if suffix == "K" then return tonumber(value) * 10^3 end
+    if suffix == "M" then return tonumber(value) * 10^6 end
+    if suffix == "G" then return tonumber(value) * 10^9 end
+  end
+  return rate
+end
+
+local function scrape()
+  local status = json.decode(get_contents("/var/run/bmx7/json/status")).status
+  local labels = {
+    id = status.shortId,
+    name = status.name,
+    address = status.primaryIp,
+    revision = status.revision,
+  }
+
+  metric("bmx7_status", "gauge", labels, 1)
+  metric("bmx7_cpu_usage", "gauge", nil, status.cpu)
+  metric("bmx7_mem_usage", "gauge", nil, interpret_suffix(status.mem))
+
+  local links = json.decode(get_contents("/var/run/bmx7/json/links")).links
+  local metric_bmx7_rxRate = metric("bmx7_link_rxRate","gauge")
+  local metric_bmx7_txRate = metric("bmx7_link_txRate","gauge")
+
+  for _, link in pairs(links) do
+    local labels = {
+      source = status.shortId,
+      target = link.shortId,
+      name = link.name,
+      dev = link.dev
+    }
+    metric_bmx7_rxRate(labels, interpret_suffix(link.rxRate))
+    metric_bmx7_txRate(labels, interpret_suffix(link.txRate))
+    end
+end
+
+return { scrape = scrape }
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/cpu.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/cpu.lua
new file mode 100644 (file)
index 0000000..9d083db
--- /dev/null
@@ -0,0 +1,40 @@
+-- stat/cpu collector
+local function scrape()
+  local stat = get_contents("/proc/stat")
+
+  -- system boot time, seconds since epoch
+  metric("node_boot_time", "gauge", nil, string.match(stat, "btime ([0-9]+)"))
+
+  -- context switches since boot (all CPUs)
+  metric("node_context_switches", "counter", nil, string.match(stat, "ctxt ([0-9]+)"))
+
+  -- cpu times, per CPU, per mode
+  local cpu_mode = {"user", "nice", "system", "idle", "iowait", "irq",
+                    "softirq", "steal", "guest", "guest_nice"}
+  local i = 0
+  local cpu_metric = metric("node_cpu", "counter")
+  while true do
+    local cpu = {string.match(stat, "cpu"..i.." (%d+) (%d+) (%d+) (%d+) (%d+) (%d+) (%d+) (%d+) (%d+) (%d+)")}
+    if #cpu ~= 10 then
+      break
+    end
+    for ii, mode in ipairs(cpu_mode) do
+      cpu_metric({cpu="cpu"..i, mode=mode}, cpu[ii] / 100)
+    end
+    i = i + 1
+  end
+
+  -- interrupts served
+  metric("node_intr", "counter", nil, string.match(stat, "intr ([0-9]+)"))
+
+  -- processes forked
+  metric("node_forks", "counter", nil, string.match(stat, "processes ([0-9]+)"))
+
+  -- processes running
+  metric("node_procs_running", "gauge", nil, string.match(stat, "procs_running ([0-9]+)"))
+
+  -- processes blocked for I/O
+  metric("node_procs_blocked", "gauge", nil, string.match(stat, "procs_blocked ([0-9]+)"))
+end
+
+return { scrape = scrape }
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/filefd.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/filefd.lua
new file mode 100644 (file)
index 0000000..7e2ff63
--- /dev/null
@@ -0,0 +1,8 @@
+local function scrape()
+  local file_nr = space_split(get_contents("/proc/sys/fs/file-nr"))
+
+  metric("node_filefd_allocated", "gauge", nil, file_nr[1])
+  metric("node_filefd_maximum", "gauge", nil, file_nr[3])
+end
+
+return { scrape = scrape }
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/loadavg.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/loadavg.lua
new file mode 100644 (file)
index 0000000..6bfab89
--- /dev/null
@@ -0,0 +1,9 @@
+local function scrape()
+  local loadavg = space_split(get_contents("/proc/loadavg"))
+
+  metric("node_load1", "gauge", nil, loadavg[1])
+  metric("node_load5", "gauge", nil, loadavg[2])
+  metric("node_load15", "gauge", nil, loadavg[3])
+end
+
+return { scrape = scrape }
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/meminfo.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/meminfo.lua
new file mode 100644 (file)
index 0000000..01f262b
--- /dev/null
@@ -0,0 +1,11 @@
+local function scrape()
+  for line in io.lines("/proc/meminfo") do
+    local name, size, unit = string.match(line, "([^:]+):%s+(%d+)%s?(k?B?)")
+    if unit == 'kB' then
+      size = size * 1024
+    end
+    metric("node_memory_" .. name:gsub("[):]", ""):gsub("[(]", "_"), "gauge", nil, size)
+  end
+end
+
+return { scrape = scrape }
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/nat_traffic.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/nat_traffic.lua
new file mode 100644 (file)
index 0000000..0b2da7d
--- /dev/null
@@ -0,0 +1,31 @@
+local function scrape()
+  -- documetation about nf_conntrack:
+  -- https://www.frozentux.net/iptables-tutorial/chunkyhtml/x1309.html
+  nat_metric =  metric("node_nat_traffic", "gauge" )
+  for e in io.lines("/proc/net/nf_conntrack") do
+    -- output(string.format("%s\n",e  ))
+    local fields = space_split(e)
+    local src, dest, bytes;
+    bytes = 0;
+    for _, field in ipairs(fields) do
+      if src == nil and string.match(field, '^src') then
+        src = string.match(field,"src=([^ ]+)");
+      elseif dest == nil and string.match(field, '^dst') then
+        dest = string.match(field,"dst=([^ ]+)");
+      elseif string.match(field, '^bytes') then
+        local b = string.match(field, "bytes=([^ ]+)");
+        bytes = bytes + b;
+        -- output(string.format("\t%d %s",ii,field  ));
+      end
+
+    end
+    -- local src, dest, bytes = string.match(natstat[i], "src=([^ ]+) dst=([^ ]+) .- bytes=([^ ]+)");
+    -- local src, dest, bytes = string.match(natstat[i], "src=([^ ]+) dst=([^ ]+) sport=[^ ]+ dport=[^ ]+ packets=[^ ]+ bytes=([^ ]+)")
+
+    local labels = { src = src, dest = dest }
+    -- output(string.format("src=|%s| dest=|%s| bytes=|%s|", src, dest, bytes  ))
+    nat_metric(labels, bytes )
+  end
+end
+
+return { scrape = scrape }
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/netdev.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/netdev.lua
new file mode 100644 (file)
index 0000000..9127e12
--- /dev/null
@@ -0,0 +1,25 @@
+
+local netdevsubstat = {"receive_bytes", "receive_packets", "receive_errs",
+                   "receive_drop", "receive_fifo", "receive_frame", "receive_compressed",
+                   "receive_multicast", "transmit_bytes", "transmit_packets",
+                   "transmit_errs", "transmit_drop", "transmit_fifo", "transmit_colls",
+                   "transmit_carrier", "transmit_compressed"}
+local pattern = "([^%s:]+):%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)"
+
+local function scrape()
+  local nds_table = {}
+  for line in io.lines("/proc/net/dev") do
+    local t = {string.match(line, pattern)}
+    if #t == 17 then
+      nds_table[t[1]] = t
+    end
+  end
+  for i, ndss in ipairs(netdevsubstat) do
+    netdev_metric = metric("node_network_" .. ndss, "gauge")
+    for dev, nds_dev in pairs(nds_table) do
+      netdev_metric({device=dev}, nds_dev[i+1])
+    end
+  end
+end
+
+return { scrape = scrape }
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/netstat.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/netstat.lua
new file mode 100644 (file)
index 0000000..cd62bff
--- /dev/null
@@ -0,0 +1,20 @@
+local function scrape()
+  -- NOTE: Both of these are missing in OpenWRT kernels.
+  --       See: https://dev.openwrt.org/ticket/15781
+  local netstat = get_contents("/proc/net/netstat") .. get_contents("/proc/net/snmp")
+
+  -- all devices
+  local netsubstat = {"IcmpMsg", "Icmp", "IpExt", "Ip", "TcpExt", "Tcp", "UdpLite", "Udp"}
+  for i, nss in ipairs(netsubstat) do
+    local substat_s = string.match(netstat, nss .. ": ([A-Z][A-Za-z0-9 ]+)")
+    if substat_s then
+      local substat = space_split(substat_s)
+      local substatv = space_split(string.match(netstat, nss .. ": ([0-9 -]+)"))
+      for ii, ss in ipairs(substat) do
+        metric("node_netstat_" .. nss .. "_" .. ss, "gauge", nil, substatv[ii])
+      end
+    end
+  end
+end
+
+return { scrape = scrape }
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/time.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/time.lua
new file mode 100644 (file)
index 0000000..d0abb66
--- /dev/null
@@ -0,0 +1,6 @@
+local function scrape()
+  -- current time
+  metric("node_time", "counter", nil, os.time())
+end
+
+return { scrape = scrape }
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/uname.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/uname.lua
new file mode 100644 (file)
index 0000000..9874b53
--- /dev/null
@@ -0,0 +1,16 @@
+local labels = {
+  domainname = "",
+  nodename = "",
+  release = string.sub(get_contents("/proc/sys/kernel/osrelease"), 1, -2),
+  sysname = string.sub(get_contents("/proc/sys/kernel/ostype"), 1, -2),
+  version = string.sub(get_contents("/proc/sys/kernel/version"), 1, -2),
+  machine = string.sub(io.popen("uname -m"):read("*a"), 1, -2)
+}
+
+local function scrape()
+  labels["domainname"] = string.sub(get_contents("/proc/sys/kernel/domainname"), 1, -2)
+  labels["nodename"] = string.sub(get_contents("/proc/sys/kernel/hostname"), 1, -2)
+  metric("node_uname_info", "gauge", labels, 1)
+end
+
+return { scrape = scrape }
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/wifi.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/wifi.lua
new file mode 100644 (file)
index 0000000..975b7dd
--- /dev/null
@@ -0,0 +1,43 @@
+local ubus = require "ubus"
+local iwinfo = require "iwinfo"
+
+local function scrape()
+  local metric_wifi_network_quality = metric("wifi_network_quality","gauge")
+  local metric_wifi_network_bitrate = metric("wifi_network_bitrate","gauge")
+  local metric_wifi_network_noise = metric("wifi_network_noise","gauge")
+  local metric_wifi_network_signal = metric("wifi_network_signal","gauge")
+
+  local u = ubus.connect()
+  local status = u:call("network.wireless", "status", {})
+
+  for dev, dev_table in pairs(status) do
+    for _, intf in ipairs(dev_table['interfaces']) do
+      local ifname = intf['ifname']
+      local iw = iwinfo[iwinfo.type(ifname)]
+      local labels = {
+        channel = iw.channel(ifname),
+        ssid = iw.ssid(ifname),
+        bssid = iw.bssid(ifname),
+        mode = iw.mode(ifname),
+        ifname = ifname,
+        country = iw.country(ifname),
+        frequency = iw.frequency(ifname),
+        device = dev,
+      }
+
+      local qc = iw.quality(ifname) or 0
+      local qm = iw.quality_max(ifname) or 0
+      local quality = 0
+      if qc > 0 and qm > 0 then
+        quality = math.floor((100 / qm) * qc)
+      end
+
+      metric_wifi_network_quality(labels, quality)
+      metric_wifi_network_noise(labels, iw.noise(ifname) or 0)
+      metric_wifi_network_bitrate(labels, iw.bitrate(ifname) or 0)
+      metric_wifi_network_signal(labels, iw.signal(ifname) or -255)
+    end
+  end
+end
+
+return { scrape = scrape }
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/wifi_stations.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/wifi_stations.lua
new file mode 100644 (file)
index 0000000..06c79a8
--- /dev/null
@@ -0,0 +1,31 @@
+local ubus = require "ubus"
+local iwinfo = require "iwinfo"
+
+local function scrape()
+  local metric_wifi_station_signal = metric("wifi_station_signal","gauge")
+  local metric_wifi_station_tx_packets = metric("wifi_station_tx_packets","gauge")
+  local metric_wifi_station_rx_packets = metric("wifi_station_rx_packets","gauge")
+
+  local u = ubus.connect()
+  local status = u:call("network.wireless", "status", {})
+
+  for dev, dev_table in pairs(status) do
+    for _, intf in ipairs(dev_table['interfaces']) do
+      local ifname = intf['ifname']
+      local iw = iwinfo[iwinfo.type(ifname)]
+
+      local assoclist = iw.assoclist(ifname)
+      for mac, station in pairs(assoclist) do
+        local labels = {
+          ifname = ifname,
+          mac = mac,
+        }
+        metric_wifi_station_signal(labels, station.signal)
+        metric_wifi_station_tx_packets(labels, station.tx_packets)
+        metric_wifi_station_rx_packets(labels, station.rx_packets)
+      end
+    end
+  end
+end
+
+return { scrape = scrape }
index b28bcfee351a7a75035ab8dec2e0f0f20b1e9273..7c7378c2d3dd28a23711adfcaec43d49c07f9551 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.ivarch.com/programs/sources/
-PKG_MD5SUM:=efe8e9e4cad5f3264a32258a63bf2c8e
+PKG_HASH:=76f3999b1c3b3027163dce6ef667cdf8dafb75218ee25e54a03bfe590478f90e
 PKG_LICENSE:=Artistic-2.0
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 
index 76c1c4fe514d7893c6dd602702857e65336732ff..a56451c67de52359e930b93523e97bb9ebf97980 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Copyright (C) 2016 OpenWrt.org
-# Copyright (C) 2016 Yousong Zhou <yszhou4tech@gmail.com>
+# Copyright (C) 2016-2018 Yousong Zhou <yszhou4tech@gmail.com>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,15 +9,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=qemu
-PKG_VERSION:=2.6.2
-PKG_RELEASE:=3
+PKG_VERSION:=2.11.1
+PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_HASH:=d9df2213ceed32e91dab7bc9dd19c1af83f91ba72c7aeef7605dfaaf81732ccb
 PKG_SOURCE_URL:=http://wiki.qemu-project.org/download/
-PKG_SOURCE_MD5SUM:=bdf1f3d0c177ebeb35a079a4bc3fc74e
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=LICENSE tcg/LICENSE
 PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
 
+PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
 PKG_USE_MIPS16:=0
 
@@ -123,7 +124,7 @@ define qemu-target
     TITLE:=QEMU target $(1)
     URL:=http://www.qemu.org
     DEPENDS:= +glib2 +libpthread +zlib $(CXX_DEPENDS) $(QEMU_DEPS_IN_HOST) \
-       $(if $(filter %-softmmu,$(1)),+libncurses +libfdt +qemu-blobs)
+       $(if $(filter %-softmmu,$(1)),+libncurses +libfdt +pixman +qemu-blobs)
   endef
 
   define Package/qemu-$(1)/description
@@ -211,7 +212,6 @@ CONFIGURE_ARGS +=                   \
        --disable-tools                 \
        --disable-seccomp               \
        --disable-glusterfs             \
-       --disable-archipelago           \
        --disable-gtk                   \
        --disable-gnutls                \
        --disable-nettle                \
diff --git a/utils/qemu/patches/0001-allow-disable-fortify-source.patch b/utils/qemu/patches/0001-allow-disable-fortify-source.patch
deleted file mode 100644 (file)
index ef6813a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/configure.orig   2016-11-22 11:53:25.739180380 +0800
-+++ b/configure        2016-11-22 11:53:55.183189596 +0800
-@@ -1147,6 +1147,8 @@ for opt do
-   ;;
-   --enable-jemalloc) jemalloc="yes"
-   ;;
-+  --disable-fortify-source) fortify_source="no"
-+  ;;
-   *)
-       echo "ERROR: unknown option $opt"
-       echo "Try '$0 --help' for more information"
diff --git a/utils/qemu/patches/0001-configure-allow-disable-fortify_source.patch b/utils/qemu/patches/0001-configure-allow-disable-fortify_source.patch
new file mode 100644 (file)
index 0000000..8c11f00
--- /dev/null
@@ -0,0 +1,27 @@
+From 0b4011cd0983ced6e065f397049f967656494793 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Sat, 24 Feb 2018 13:43:19 +0800
+Subject: [PATCH 1/3] configure: allow disable fortify_source
+
+Tell build system of qemu to not add _FORTIFY_SOURCE options and let the
+OpenWrt base build system decide flavor of fortify_source to use
+---
+ configure | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure b/configure
+index 0c6e757..8ea3fdd 100755
+--- a/configure
++++ b/configure
+@@ -1313,6 +1313,8 @@ for opt do
+   ;;
+   --disable-git-update) git_update=no
+   ;;
++  --disable-fortify-source) fortify_source="no"
++  ;;
+   *)
+       echo "ERROR: unknown option $opt"
+       echo "Try '$0 --help' for more information"
+-- 
+1.8.3.1
+
diff --git a/utils/qemu/patches/0002-disas-fix-compilation-failure-when-isnan-is-a-macro.patch b/utils/qemu/patches/0002-disas-fix-compilation-failure-when-isnan-is-a-macro.patch
new file mode 100644 (file)
index 0000000..bd1ac2d
--- /dev/null
@@ -0,0 +1,69 @@
+From 83e72b93889fbcbbfff281b0dbcc58c5a7455257 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Sat, 24 Feb 2018 13:45:25 +0800
+Subject: [PATCH 2/3] disas: fix compilation failure when isnan is a macro
+
+---
+ disas/libvixl/vixl/utils.h | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/disas/libvixl/vixl/utils.h b/disas/libvixl/vixl/utils.h
+index 5ab134e..df30663 100644
+--- a/disas/libvixl/vixl/utils.h
++++ b/disas/libvixl/vixl/utils.h
+@@ -118,11 +118,17 @@ double double_pack(uint64_t sign, uint64_t exp, uint64_t mantissa);
+ // An fpclassify() function for 16-bit half-precision floats.
+ int float16classify(float16 value);
++#ifdef isnan
++#define isnan_ isnan
++#else
++#define isnan_ std::isnan
++#endif
++
+ // NaN tests.
+ inline bool IsSignallingNaN(double num) {
+   const uint64_t kFP64QuietNaNMask = UINT64_C(0x0008000000000000);
+   uint64_t raw = double_to_rawbits(num);
+-  if (std::isnan(num) && ((raw & kFP64QuietNaNMask) == 0)) {
++  if (isnan_(num) && ((raw & kFP64QuietNaNMask) == 0)) {
+     return true;
+   }
+   return false;
+@@ -132,7 +138,7 @@ inline bool IsSignallingNaN(double num) {
+ inline bool IsSignallingNaN(float num) {
+   const uint32_t kFP32QuietNaNMask = 0x00400000;
+   uint32_t raw = float_to_rawbits(num);
+-  if (std::isnan(num) && ((raw & kFP32QuietNaNMask) == 0)) {
++  if (isnan_(num) && ((raw & kFP32QuietNaNMask) == 0)) {
+     return true;
+   }
+   return false;
+@@ -148,21 +154,21 @@ inline bool IsSignallingNaN(float16 num) {
+ template <typename T>
+ inline bool IsQuietNaN(T num) {
+-  return std::isnan(num) && !IsSignallingNaN(num);
++  return isnan_(num) && !IsSignallingNaN(num);
+ }
+ // Convert the NaN in 'num' to a quiet NaN.
+ inline double ToQuietNaN(double num) {
+   const uint64_t kFP64QuietNaNMask = UINT64_C(0x0008000000000000);
+-  VIXL_ASSERT(std::isnan(num));
++  VIXL_ASSERT(isnan_(num));
+   return rawbits_to_double(double_to_rawbits(num) | kFP64QuietNaNMask);
+ }
+ inline float ToQuietNaN(float num) {
+   const uint32_t kFP32QuietNaNMask = 0x00400000;
+-  VIXL_ASSERT(std::isnan(num));
++  VIXL_ASSERT(isnan_(num));
+   return rawbits_to_float(float_to_rawbits(num) | kFP32QuietNaNMask);
+ }
+-- 
+1.8.3.1
+
diff --git a/utils/qemu/patches/0002-setting-language-type-for-_asm-files.patch b/utils/qemu/patches/0002-setting-language-type-for-_asm-files.patch
deleted file mode 100644 (file)
index ea6d49d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/rules.mak.orig   2016-11-22 13:30:40.933006727 +0800
-+++ b/rules.mak        2016-11-22 13:30:47.229008698 +0800
-@@ -70,7 +70,7 @@ LINK = $(call quiet-command, $(LINKPROG)
-       $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -o $@ $<,"  CPP   $(TARGET_DIR)$@")
- %.o: %.asm
--      $(call quiet-command,$(AS) $(ASFLAGS) -o $@ $<,"  AS    $(TARGET_DIR)$@")
-+      $(call quiet-command,$(AS) $(ASFLAGS) -o $@ -x assembler $<,"  AS    $(TARGET_DIR)$@")
- %.o: %.cc
-       $(call quiet-command,$(CXX) $(QEMU_INCLUDES) $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($@-cflags) -c -o $@ $<,"  CXX   $(TARGET_DIR)$@")
diff --git a/utils/qemu/patches/0003-disable-avx2_opt-with-musl.patch b/utils/qemu/patches/0003-disable-avx2_opt-with-musl.patch
deleted file mode 100644 (file)
index c52cb4c..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/configure.orig   2016-11-22 17:35:12.069598617 +0800
-+++ b/configure        2016-11-22 18:24:01.042515353 +0800
-@@ -1789,7 +1789,10 @@ static void foo(void) __attribute__((ifu
- int main(void) { foo(); return 0; }
- EOF
- if compile_prog "-mavx2" "" ; then
--    if readelf --syms $TMPE |grep "IFUNC.*foo" >/dev/null 2>&1; then
-+    if readelf --program-headers $TMPE | grep -iq 'Requesting program interpreter: .*ld-musl'; then
-+        # ifunc support is not available with dynamic linker of musl
-+        avx2_opt="no"
-+    elif readelf --syms $TMPE |grep "IFUNC.*foo" >/dev/null 2>&1; then
-         avx2_opt="yes"
-     fi
- fi
diff --git a/utils/qemu/patches/0003-pc-bios-fix-compilation-when-AS-is-actually-gcc-driv.patch b/utils/qemu/patches/0003-pc-bios-fix-compilation-when-AS-is-actually-gcc-driv.patch
new file mode 100644 (file)
index 0000000..374afc2
--- /dev/null
@@ -0,0 +1,35 @@
+From b6d4bff30f2bdc3a6f26c9f6c7f32e352270d119 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Sat, 24 Feb 2018 13:46:31 +0800
+Subject: [PATCH 3/3] pc-bios: fix compilation when $(AS) is actually gcc
+ driver
+
+---
+ pc-bios/optionrom/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
+index a9a9e5e..f88b3ee 100644
+--- a/pc-bios/optionrom/Makefile
++++ b/pc-bios/optionrom/Makefile
+@@ -34,7 +34,7 @@ endif
+ QEMU_INCLUDES += -I$(SRC_PATH)
+ Wa = -Wa,
+-ASFLAGS += -32
++ASFLAGS += $(Wa)-32
+ QEMU_CFLAGS += $(call cc-c-option, $(QEMU_CFLAGS), $(Wa)-32)
+ build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin
+@@ -44,7 +44,7 @@ build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin
+ %.o: %.S
+-      $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$(TARGET_DIR)$@")
++      $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@ -x assembler -,"AS","$(TARGET_DIR)$@")
+ %.img: %.o
+       $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_I386_EMULATION) -T $(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $<,"BUILD","$(TARGET_DIR)$@")
+-- 
+1.8.3.1
+
diff --git a/utils/qemu/patches/0004-pixman-fix-detection-of-mips-dspr2.patch b/utils/qemu/patches/0004-pixman-fix-detection-of-mips-dspr2.patch
deleted file mode 100644 (file)
index 05e34e0..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/pixman/configure.ac.orig 2016-11-22 20:44:21.205150763 +0800
-+++ b/pixman/configure.ac      2016-11-22 20:44:55.505161500 +0800
-@@ -720,7 +720,6 @@ dnl Check if assembler is gas compatible
- have_mips_dspr2=no
- AC_MSG_CHECKING(whether to use MIPS DSPr2 assembler)
- xserver_save_CFLAGS=$CFLAGS
--CFLAGS="-mdspr2 $CFLAGS"
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
- #if !(defined(__mips__) &&  __mips_isa_rev >= 2)
diff --git a/utils/qemu/patches/0005-pixman-arm-neon-assembler-fix.patch b/utils/qemu/patches/0005-pixman-arm-neon-assembler-fix.patch
deleted file mode 100644 (file)
index 93c967a..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/pixman/pixman/pixman-private.h.orig      2016-11-22 22:10:33.574769654 +0800
-+++ b/pixman/pixman/pixman-private.h   2016-11-22 22:10:47.638774056 +0800
-@@ -1,5 +1,3 @@
--#include <float.h>
--
- #ifndef PIXMAN_PRIVATE_H
- #define PIXMAN_PRIVATE_H
-@@ -17,6 +15,8 @@
- #ifndef __ASSEMBLER__
-+#include <float.h>
-+
- #ifndef PACKAGE
- #  error config.h must be included before pixman-private.h
- #endif
diff --git a/utils/qemu/patches/0006-libvixl-cxx-macro-isnan.patch b/utils/qemu/patches/0006-libvixl-cxx-macro-isnan.patch
deleted file mode 100644 (file)
index 0dae8ce..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
---- a/disas/libvixl/vixl/utils.h.orig  2016-11-22 22:36:20.691253883 +0800
-+++ b/disas/libvixl/vixl/utils.h       2016-11-22 22:55:44.639618185 +0800
-@@ -118,11 +118,17 @@ double double_pack(uint64_t sign, uint64
- // An fpclassify() function for 16-bit half-precision floats.
- int float16classify(float16 value);
-+#ifdef isnan
-+#define isnan_ isnan
-+#else
-+#define isnan_ std::isnan
-+#endif
-+
- // NaN tests.
- inline bool IsSignallingNaN(double num) {
-   const uint64_t kFP64QuietNaNMask = UINT64_C(0x0008000000000000);
-   uint64_t raw = double_to_rawbits(num);
--  if (std::isnan(num) && ((raw & kFP64QuietNaNMask) == 0)) {
-+  if (isnan_(num) && ((raw & kFP64QuietNaNMask) == 0)) {
-     return true;
-   }
-   return false;
-@@ -132,7 +138,7 @@ inline bool IsSignallingNaN(double num)
- inline bool IsSignallingNaN(float num) {
-   const uint32_t kFP32QuietNaNMask = 0x00400000;
-   uint32_t raw = float_to_rawbits(num);
--  if (std::isnan(num) && ((raw & kFP32QuietNaNMask) == 0)) {
-+  if (isnan_(num) && ((raw & kFP32QuietNaNMask) == 0)) {
-     return true;
-   }
-   return false;
-@@ -148,21 +154,21 @@ inline bool IsSignallingNaN(float16 num)
- template <typename T>
- inline bool IsQuietNaN(T num) {
--  return std::isnan(num) && !IsSignallingNaN(num);
-+  return isnan_(num) && !IsSignallingNaN(num);
- }
- // Convert the NaN in 'num' to a quiet NaN.
- inline double ToQuietNaN(double num) {
-   const uint64_t kFP64QuietNaNMask = UINT64_C(0x0008000000000000);
--  VIXL_ASSERT(std::isnan(num));
-+  VIXL_ASSERT(isnan_(num));
-   return rawbits_to_double(double_to_rawbits(num) | kFP64QuietNaNMask);
- }
- inline float ToQuietNaN(float num) {
-   const uint32_t kFP32QuietNaNMask = 0x00400000;
--  VIXL_ASSERT(std::isnan(num));
-+  VIXL_ASSERT(isnan_(num));
-   return rawbits_to_float(float_to_rawbits(num) | kFP32QuietNaNMask);
- }
index 1d064f74c45674139e9096cc016cdbee0c1b4321..e9f351d4fa3019e8c08f04784f9e71d9df2ca4ec 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=3
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/relayctl/relayctl-$(PKG_VERSION)
 PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
-PKG_MD5SUM:=24c848e0d705421dcd6accfffa31f704
+PKG_HASH:=74ce41ebd5d18816d52b5f9b1071f658f5a814b8194257f20700214bbee9de1e
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING
 
index d69832759188fba27828e109ee2ceef6f33ac807..629af248fed49688a8c5f19a0e842d1056d51878 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rng-tools
 PKG_VERSION:=5
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/gkernel/rng-tools/$(PKG_VERSION)/
-PKG_MD5SUM:=6726cdc6fae1f5122463f24ae980dd68
+PKG_HASH:=60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e
 PKG_LICENSE:=GPLv2
 PKG_MAINTAINER:=Nathaniel Wesley Filardo <nwfilardo@gmail.com>
 
diff --git a/utils/rng-tools/patches/100-message-no-newline.patch b/utils/rng-tools/patches/100-message-no-newline.patch
new file mode 100644 (file)
index 0000000..29f5ad3
--- /dev/null
@@ -0,0 +1,137 @@
+From d401b23149a89fc14806dc8c347f2a85205a95cd Mon Sep 17 00:00:00 2001
+From: Philip Prindeville <philipp@redfish-solutions.com>
+Date: Mon, 26 Jun 2017 18:34:04 -0600
+Subject: [PATCH v1 1/1] Cleanup calls to message() containing newlines
+To: Philipp Rumpf <prumpf@mandrakesoft.com>, Jeff Garzik <jgarzik@pobox.com>, Henrique de Moraes Holschuh <hmh@debian.org>, Andrew Morton <akpm@linux-foundation.org>
+Cc: Philip Prindeville <philipp@redfish-solutions.com>
+
+Newlines are added automatically by logging daemons, and having
+embedded newlines can cause extra blank lines in syslog-ng,
+busybox, etc.
+
+Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
+---
+ rngd.c           | 8 ++++----
+ rngd_entsource.c | 6 +++---
+ rngd_linux.c     | 2 +-
+ rngd_rdrand.c    | 6 +++---
+ 4 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/rngd.c b/rngd.c
+index 0205d40e0abb970fb126460306398388bd7462a0..f10198682a14f2f1460100a1d274ad0d724cb326 100644
+--- a/rngd.c
++++ b/rngd.c
+@@ -271,7 +271,7 @@ static void do_loop(int random_step)
+                       } else if (iter->failures >= MAX_RNG_FAILURES) {
+                               if (!arguments->quiet)
+                                       message(LOG_DAEMON|LOG_ERR,
+-                                      "too many FIPS failures, disabling entropy source\n");
++                                      "too many FIPS failures, disabling entropy source");
+                               iter->disabled = true;
+                       }
+               }
+@@ -282,7 +282,7 @@ static void do_loop(int random_step)
+       if (!arguments->quiet)
+               message(LOG_DAEMON|LOG_ERR,
+-              "No entropy sources working, exiting rngd\n");
++              "No entropy sources working, exiting rngd");
+ }
+ static void term_signal(int signo)
+@@ -317,7 +317,7 @@ int main(int argc, char **argv)
+                       message(LOG_DAEMON|LOG_ERR,
+                               "can't open any entropy source");
+                       message(LOG_DAEMON|LOG_ERR,
+-                              "Maybe RNG device modules are not loaded\n");
++                              "Maybe RNG device modules are not loaded");
+               }
+               return 1;
+       }
+@@ -337,7 +337,7 @@ int main(int argc, char **argv)
+               && (rc_tpm || !arguments->enable_tpm)) {
+               if (!arguments->quiet)
+                       message(LOG_DAEMON|LOG_ERR,
+-              "No entropy source available, shutting down\n");
++              "No entropy source available, shutting down");
+               return 1;
+       }
+diff --git a/rngd_entsource.c b/rngd_entsource.c
+index f0e219d7af674204e5bdcf96e9045c40717872c3..8c1d7cb33159c9a0e03a4ea83f3a3358c706e2e3 100644
+--- a/rngd_entsource.c
++++ b/rngd_entsource.c
+@@ -64,7 +64,7 @@ int xread(void *buf, size_t size, struct rng *ent_src)
+       }
+       if (size) {
+-              message(LOG_DAEMON|LOG_ERR, "read error\n");
++              message(LOG_DAEMON|LOG_ERR, "read error");
+               return -1;
+       }
+       return 0;
+@@ -114,7 +114,7 @@ int xread_tpm(void *buf, size_t size, struct rng *ent_src)
+                                      sizeof(rng_cmd) - r);
+                       if (retval < 0) {
+                               message(LOG_ERR|LOG_INFO,
+-                                      "Error writing %s\n",
++                                      "Error writing %s",
+                                       ent_src->rng_name);
+                               retval = -1;
+                               goto error_out;
+@@ -123,7 +123,7 @@ int xread_tpm(void *buf, size_t size, struct rng *ent_src)
+               }
+               if (r < sizeof(rng_cmd)) {
+                       message(LOG_ERR|LOG_INFO,
+-                              "Error writing %s\n", ent_src->rng_name);
++                              "Error writing %s", ent_src->rng_name);
+                       retval = -1;
+                       goto error_out;
+               }
+diff --git a/rngd_linux.c b/rngd_linux.c
+index c4f45dedecad0fd3bf80a35d7c240b917bf5ffdd..481c6bb15def3f06989766988b61f35d91207b58 100644
+--- a/rngd_linux.c
++++ b/rngd_linux.c
+@@ -131,7 +131,7 @@ void random_add_entropy(void *buf, size_t size)
+       memcpy(entropy.data, buf, size);
+       if (ioctl(random_fd, RNDADDENTROPY, &entropy) != 0) {
+-              message(LOG_DAEMON|LOG_ERR, "RNDADDENTROPY failed: %s\n",
++              message(LOG_DAEMON|LOG_ERR, "RNDADDENTROPY failed: %s",
+                       strerror(errno));
+               exit(1);
+       }
+diff --git a/rngd_rdrand.c b/rngd_rdrand.c
+index 4d7a5a7b3f52c3af8e677d3c4d758d4d235f1dd6..c1919d538428a8647dbce88d7d76384761e5b6cc 100644
+--- a/rngd_rdrand.c
++++ b/rngd_rdrand.c
+@@ -162,7 +162,7 @@ static inline int gcrypt_mangle(unsigned char *tmp)
+       if (gcry_error) {
+               message(LOG_DAEMON|LOG_ERR,
+-                      "gcry_cipher_encrypt error: %s\n",
++                      "gcry_cipher_encrypt error: %s",
+                       gcry_strerror(gcry_error));
+               return -1;
+       }
+@@ -257,7 +257,7 @@ static int init_gcrypt(const void *key)
+       if (!gcry_check_version(MIN_GCRYPT_VERSION)) {
+               message(LOG_DAEMON|LOG_ERR,
+-                      "libgcrypt version mismatch: have %s, require >= %s\n",
++                      "libgcrypt version mismatch: have %s, require >= %s",
+                       gcry_check_version(NULL), MIN_GCRYPT_VERSION);
+               return 1;
+       }
+@@ -278,7 +278,7 @@ static int init_gcrypt(const void *key)
+       if (gcry_error) {
+               message(LOG_DAEMON|LOG_ERR,
+-                      "could not set key or IV: %s\n",
++                      "could not set key or IV: %s",
+                       gcry_strerror(gcry_error));
+               gcry_cipher_close(gcry_cipher_hd);
+               return 1;
+-- 
+2.7.4
+
index 154336b7b0e2c26c60f94962847f0931e8eb2bc2..fc333612c83060cd3cb72b17d7628d4482d968ae 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rpcd-mod-lxc
-PKG_RELEASE=20141012
+PKG_RELEASE=20171206
 
 PKG_LICENSE:=ISC
 
index 0d52f167749f70588a108cab448a7f9d494a038e..a98fcfc54482aa64a44cd30a8aedcd37e11b8ef8 100644 (file)
@@ -316,6 +316,53 @@ out:
        return rc;
 }
 
+static int
+rpc_lxc_info(struct ubus_context *ctx, struct ubus_object *obj,
+            struct ubus_request_data *req, const char *method,
+            struct blob_attr *msg)
+{
+       struct blob_attr *tb[__RPC_LXC_RENAME_MAX];
+       struct rpc_lxc *l = NULL;
+       char **addresses;
+       void *k;
+       pid_t initpid;
+
+       blobmsg_parse(rpc_lxc_min_policy, __RPC_LXC_MAX, tb, blob_data(msg), blob_len(msg));
+
+       l = rpc_lxc_init(tb);
+       if (!l)
+               return UBUS_STATUS_INVALID_ARGUMENT;
+
+       if (!l->container->is_running(l->container) &&
+           !l->container->is_defined(l->container))
+               return UBUS_STATUS_NOT_FOUND;
+
+       blob_buf_init(&buf, 0);
+
+       blobmsg_add_string(&buf, "name", l->container->name);
+
+       blobmsg_add_string(&buf, "state", l->container->state(l->container));
+
+       initpid = l->container->init_pid(l->container);
+       if (initpid >= 0)
+               blobmsg_add_u32(&buf, "pid", initpid);
+
+       k = blobmsg_open_array(&buf, "ips");
+       addresses = l->container->get_ips(l->container, NULL, NULL, 0);
+       if (addresses) {
+               int i;
+
+               for (i = 0; addresses[i]; i++)
+                       blobmsg_add_string(&buf, "ip", addresses[i]);
+       }
+       blobmsg_close_array(&buf, k);
+
+       ubus_send_reply(ctx, req, buf.head);
+       rpc_lxc_done(l);
+
+       return UBUS_STATUS_OK;
+}
+
 static int
 rpc_lxc_rename(struct ubus_context *ctx, struct ubus_object *obj,
                struct ubus_request_data *req, const char *method,
@@ -480,6 +527,7 @@ rpc_lxc_api_init(const struct rpc_daemon_ops *o, struct ubus_context *ctx)
                UBUS_METHOD("stop", rpc_lxc_stop, rpc_lxc_min_policy),
                UBUS_METHOD("freeze", rpc_lxc_freeze, rpc_lxc_min_policy),
                UBUS_METHOD("unfreeze", rpc_lxc_unfreeze, rpc_lxc_min_policy),
+               UBUS_METHOD("info", rpc_lxc_info, rpc_lxc_min_policy),
                UBUS_METHOD("rename", rpc_lxc_rename, rpc_lxc_rename_policy),
                UBUS_METHOD("create", rpc_lxc_create, rpc_lxc_create_policy),
                UBUS_METHOD("destroy", rpc_lxc_destroy, rpc_lxc_min_policy),
index dd221ae8ee3a8373a8ac545cc5ea44dd824ae879..61eeec704580eb4f519742097384aa59ea754181 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:= \
        http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.0.x \
        http://www.fastmirrors.org/rrdtool/rrdtool-1.0.x \
        ftp://ftp.sunet.se/pub/network/monitoring/rrdtool/rrdtool-1.0.x
-PKG_MD5SUM:=c466e2e7df95fa8e318e46437da87686
+PKG_HASH:=42aa7c213dedbd95d33ca84d92f4187880f7e96062c6a3fb05bfb16f77ba2a91
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 
 PKG_FIXUP:=autoreconf
index 9d7ed6db8726a550de10aadd90a429d17cca8d98..f179f266961470cfbce786e2547adfc321bb4672 100644 (file)
@@ -14,6 +14,7 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=git://github.com/tomojitakasu/RTKLIB.git
 PKG_SOURCE_VERSION:=1cec90a9ffa424908ad1a4ca3d52f33f9b94d1f7
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=edda6c29ba3d2f5401145a1497e88646fa0c13afc31ade7bdd982bd8e8081c6a
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_LICENSE:=BSD-2-Clause
 
index ba455571b53cfe79da0a622cae84ca24272076f9..83668f6afb3c6492d17fce34234c0d8006f64212 100644 (file)
@@ -16,6 +16,7 @@ PKG_SOURCE_URL:=https://github.com/dgiardini/rtl-ais.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=b805be0164475e58a73b57763a8cbbf8a2bd0ded
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=0bf15869935e4496108ade4f7e9c1f7990b11ce53c9c1e0c9e81bc7f082b33b5
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
index 37e7f848a738f1fd15b13aded17c8b76fd88444e..3e375122a9bdf33130c8c24ebb6d146157703f17 100644 (file)
@@ -16,6 +16,7 @@ PKG_SOURCE_VERSION:=e3c03f738f5aef4dc51e2b741fbdb542b9cc1bb1
 
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_MIRROR_HASH:=6b1a3ae95e6d9e896ec4f8dcca46b7cf5741533bb549d429ac3fd46c76e2d595
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 PKG_BUILD_PARALLEL:=1
 
diff --git a/utils/rtl_433/Makefile b/utils/rtl_433/Makefile
new file mode 100644 (file)
index 0000000..d0eae62
--- /dev/null
@@ -0,0 +1,46 @@
+# 
+# Copyright (C) 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:=rtl_433
+PKG_VERSION:=6531ea4
+PKG_RELEASE:=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://github.com/merbanan/rtl_433.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=6531ea48a7933ac8289724672059e54fd8aad8eb
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=f96301c8d7e87605b113aad4493f15b63a675fea6f00642b0606de5a3a858746
+
+CMAKE_INSTALL:=1
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/rtl_433
+  TITLE:=Realtek RTL2832 based 433.92MHz generic data receiver
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+librtlsdr +rtl-sdr +libtool-bin
+  URL:=https://github.com/merbanan/rtl_433
+  MAINTAINER:=Jasper Scholte <NightNL@outlook.com>
+endef
+
+define Package/rtl-sdr/description
+  rtl_433 turns your Realtek RTL2832 based DVB dongle into a 433.92MHz generic data receiver.
+endef
+
+define Package/rtl_433/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/rtl_433 $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,rtl_433))
diff --git a/utils/rtty/Makefile b/utils/rtty/Makefile
new file mode 100755 (executable)
index 0000000..1ab5003
--- /dev/null
@@ -0,0 +1,93 @@
+#
+# Copyright (C) 2018 Jianhui Zhao
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=rtty
+PKG_VERSION:=4.1.1
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+PKG_SOURCE_URL=https://github.com/zhaojh329/rtty.git
+PKG_MIRROR_HASH:=2689ffafc7a6b2e649173edff802ec6d7c8476f1998497fca36a26c21fdcdc1c
+
+PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_MAINTAINER:=Jianhui Zhao <jianhuizhao329@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/rtty/default
+  SECTION:=utils
+  CATEGORY:=Utilities
+  SUBMENU:=Terminal
+  TITLE:=A reverse proxy WebTTY
+  DEPENDS:=+libblobmsg-json
+endef
+
+define Package/rtty/default/description
+A reverse proxy WebTTY. This is the client part running on devices to be managed.
+endef
+
+define Package/rtty-nossl
+  $(Package/rtty/default)
+  TITLE += (NO SSL)
+  DEPENDS += +libuwsc-nossl
+  VARIANT:=nossl
+  CONFLICTS:=rtty-openssl rtty-wolfssl rtty-mbedtls
+endef
+
+define Package/rtty-openssl
+  $(Package/rtty/default)
+  TITLE += (openssl)
+  DEPENDS += +libuwsc-openssl
+  VARIANT:=openssl
+  CONFLICTS:=rtty-wolfssl rtty-mbedtls
+endef
+
+define Package/rtty-wolfssl
+  $(Package/rtty/default)
+  TITLE += (wolfssl)
+  DEPENDS += +libuwsc-wolfssl
+  VARIANT:=wolfssl
+  CONFLICTS:=rtty-mbedtls
+endef
+
+define Package/rtty-mbedtls
+  $(Package/rtty/default)
+  TITLE += (mbedtls)
+  DEPENDS += +libuwsc-mbedtls
+  VARIANT:=mbedtls
+endef
+
+Package/rtty-nossl/description = $(Package/rtty/default/description)
+Package/rtty-openssl/description = $(Package/rtty/default/description)
+Package/rtty-wolfssl/description = $(Package/rtty/default/description)
+Package/rtty-mbedtls/description = $(Package/rtty/default/description)
+
+define Package/rtty/default/install
+       $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/rtty $(1)/usr/sbin
+       $(INSTALL_BIN) ./files/rtty.init $(1)/etc/init.d/rtty
+       $(INSTALL_CONF) ./files/rtty.config $(1)/etc/config/rtty
+endef
+
+Package/rtty-nossl/install = $(Package/rtty/default/install)
+Package/rtty-openssl/install = $(Package/rtty/default/install)
+Package/rtty-wolfssl/install = $(Package/rtty/default/install)
+Package/rtty-mbedtls/install = $(Package/rtty/default/install)
+
+$(eval $(call BuildPackage,rtty-nossl))
+$(eval $(call BuildPackage,rtty-mbedtls))
+$(eval $(call BuildPackage,rtty-wolfssl))
+$(eval $(call BuildPackage,rtty-openssl))
+
diff --git a/utils/rtty/files/rtty.config b/utils/rtty/files/rtty.config
new file mode 100644 (file)
index 0000000..dd8694a
--- /dev/null
@@ -0,0 +1,13 @@
+# You must specify an interface or id,
+# If the id is not specified, RTTY will uses the MAC address
+# of the interface you specify as its ID, otherwise the id
+# you specify is used as its ID
+
+#config rtty
+#   option  interface   'lan'
+#   option  id          'My-Device'
+#   option  description 'Description of my device'
+#   option  host        'your-server-host'  # Server host
+#   option  port        '5912'              # Server Port
+#   option  ssl         1                   # Whether to use ssl
+#   option  ping        5                   # heartbeat interval(second)
diff --git a/utils/rtty/files/rtty.init b/utils/rtty/files/rtty.init
new file mode 100644 (file)
index 0000000..f5c2231
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh /etc/rc.common
+
+. /lib/functions/network.sh
+
+USE_PROCD=1
+START=99
+
+BIN=/usr/sbin/rtty
+
+start_rtty() {
+    local cfg="$1"
+    local interface ifname id description host port ssl
+
+    uci_validate_section rtty rtty "${1}" \
+        'interface:uci("network", "@interface"):lan' \
+        'id:maxlength(63)' \
+        'description:maxlength(126)' \
+        'host:host' \
+        'port:port' \
+        'ssl:bool:0' \
+        'ping:uinteger:5'
+    
+    [ $? -ne 0 ] && {
+        echo "validation failed" >&2
+        return 1
+    }
+
+    [ -n "$interface" ] && network_get_device ifname "$interface"
+
+    [ -z "$ifname" -a -z "$id" ] && {
+        echo "You must specify an interface or ID" >&2
+        return 1
+    }
+
+    [ -z "$host" ] && {
+        echo "host required" >&2
+        return 1
+    }
+    
+    [ -z "$port" ] && {
+        echo "port required" >&2
+        return 1
+    }
+
+    procd_open_instance
+    procd_set_param command $BIN -h $host -p $port -a -P $ping
+    [ -n "$ifname" ] && procd_append_param command -i "$ifname"
+    [ -n "$id" ] && procd_append_param command -I "$id"
+    [ -n "$description" ] && procd_append_param command -d "$description"
+    [ "$ssl" = "1" ] && procd_append_param command -s
+    procd_set_param respawn
+    procd_close_instance
+}
+
+start_service() {
+    config_load rtty
+    config_foreach start_rtty rtty
+}
+
index 0eee249c509d5bdea1b293605c6916fdb82fcd9a..ddc24c2fb82589f5a1575621453ea36ed50d3216 100644 (file)
@@ -1,5 +1,6 @@
 #
 # 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.
@@ -8,19 +9,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sane-backends
-PKG_VERSION:=1.0.25
-PKG_RELEASE:=2
+PKG_VERSION:=1.0.27
+PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://fossies.org/linux/misc \
     https://alioth.debian.org/frs/download.php/file/4146/
-PKG_MD5SUM:=f9ed5405b3c12f07c6ca51ee60225fe7
+PKG_HASH:=293747bf37275c424ebb2c833f8588601a60b2f9653945d5a3194875355e36c9
 PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
 PKG_LICENSE:=GPL-2.0 GPL-2.0+
 PKG_LICENSE_FILES:=COPYING LICENSE
 
-PKG_FIXUP:=autoreconf
-PKG_REMOVE_FILES:=aclocal.m4
-
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
@@ -167,8 +165,6 @@ TARGET_LDFLAGS += \
 CONFIGURE_ARGS+= \
        --enable-shared \
        --enable-static \
-       --disable-translations \
-       --disable-latex \
        --without-gphoto2 \
        --without-snmp
 
@@ -352,7 +348,7 @@ $(eval $(call SaneBackend,umax,UMAX scanners))
 $(eval $(call SaneBackend,umax1220u,the UMAX Astra 1220U and similar scanners))
 $(eval $(call SaneBackend,umax_pp,Umax Astra parallel port flatbed scanners))
 $(eval $(call SaneBackend,v4l,Video for Linux API,+libv4l +libjpeg))
-$(eval $(call SaneBackend,xerox_mfp,Xerox Phaser 3200MFP device))
+$(eval $(call SaneBackend,xerox_mfp,Xerox Phaser 3200MFP device,+libjpeg))
 $(eval $(call BuildPackage,sane-backends))
 $(eval $(call BuildPackage,sane-backends-all))
 $(eval $(call BuildPackage,sane-frontends))
index 83480583b9419df1e1d29157c6915888e6c4ae47..5bbf9cdf67961aa0a3ebe9736da98b2def9966d1 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -400,7 +400,7 @@ target_alias = @target_alias@
+@@ -423,7 +423,7 @@ target_alias = @target_alias@
  top_build_prefix = @top_build_prefix@
  top_builddir = @top_builddir@
  top_srcdir = @top_srcdir@
diff --git a/utils/sane-backends/patches/020-fix_pieusb.patch b/utils/sane-backends/patches/020-fix_pieusb.patch
deleted file mode 100644 (file)
index ae97040..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/backend/pieusb_buffer.c
-+++ b/backend/pieusb_buffer.c
-@@ -104,11 +104,13 @@
- /* When creating the release backend, make complains about unresolved external
-  * le16toh, although it finds the include <endian.h> */
-+#ifndef le16toh
- #if __BYTE_ORDER == __LITTLE_ENDIAN
-  #define le16toh(x) (x)
- #else
-  #define le16toh(x) __bswap_16 (x)
- #endif
-+#endif
- static void buffer_update_read_index(struct Pieusb_Read_Buffer* buffer, int increment);
diff --git a/utils/sane-backends/patches/030-musl.patch b/utils/sane-backends/patches/030-musl.patch
deleted file mode 100644 (file)
index 7f0a5a2..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
---- a/include/sane/sanei_udp.h
-+++ b/include/sane/sanei_udp.h
-@@ -27,6 +27,9 @@
- #include <netinet/in.h>
- #include <netdb.h>
- #endif
-+#ifdef HAVE_SYS_TYPES_H
-+#include <sys/types.h>
-+#endif
- extern SANE_Status sanei_udp_open(const char *host, int port, int *fdp);
- extern SANE_Status sanei_udp_open_broadcast(int *fdp);
---- a/backend/kvs20xx_cmd.h
-+++ b/backend/kvs20xx_cmd.h
-@@ -9,6 +9,10 @@
-    Panasonic KV-S20xx USB-SCSI scanners.
- */
-+#ifdef HAVE_SYS_TYPES_H
-+#include <sys/types.h>
-+#endif
-+
- #define COMMAND_BLOCK 1
- #define DATA_BLOCK    2
- #define RESPONSE_BLOCK        3
---- a/backend/kvs40xx.h
-+++ b/backend/kvs40xx.h
-@@ -10,6 +10,9 @@
- #include "../include/sane/config.h"
- #include <semaphore.h>
-+#ifdef HAVE_SYS_TYPES_H
-+#include <sys/types.h>
-+#endif
- #undef  BACKEND_NAME
- #define BACKEND_NAME kvs40xx
---- a/backend/hp5400.c
-+++ b/backend/hp5400.c
-@@ -67,6 +67,9 @@
- #include <stdlib.h>           /* malloc, free */
- #include <string.h>           /* memcpy */
- #include <stdio.h>
-+#ifdef HAVE_SYS_TYPES_H
-+#include <sys/types.h>
-+#endif
- #define HP5400_CONFIG_FILE "hp5400.conf"
---- a/backend/hp5590.c
-+++ b/backend/hp5590.c
-@@ -48,6 +48,9 @@
- #include <stdio.h>
- #include <string.h>
- #include <unistd.h>
-+#ifdef HAVE_SYS_TYPES_H
-+#include <sys/types.h>
-+#endif
- #include "../include/sane/sane.h"
- #define BACKEND_NAME hp5590
---- a/backend/epsonds-io.c
-+++ b/backend/epsonds-io.c
-@@ -16,6 +16,9 @@
- #include "sane/config.h"
- #include <ctype.h>
- #include <unistd.h>     /* sleep */
-+#ifdef HAVE_SYS_TYPES_H
-+#include <sys/types.h>
-+#endif
- #include "epsonds.h"
- #include "epsonds-io.h"
index b7495a5dc48fc9ff3928dd82b92aacb94ac7f5fb..5993b27d5eb989d623e6cd11ddb7ed7f8b38919a 100644 (file)
@@ -1,8 +1,8 @@
---- a/configure.in
-+++ b/configure.in
-@@ -279,6 +279,9 @@ dnl ************************************
- dnl Checks for library functions
- dnl ***********************************************************************
+--- a/configure.ac
++++ b/configure.ac
+@@ -280,6 +280,9 @@ AS_IF([test x != x$ALLOCA],
+       [LTALLOCA=`echo "$ALLOCA" | sed 's/\.o$//; s/\.obj$//'`.lo])
+ AC_SUBST(LTALLOCA)
  
 +dnl Check mkostemp (missing in uclibc)
 +AC_CHECK_FUNC(mkostemp)
@@ -12,7 +12,7 @@
  AC_CHECK_FUNC(gethostbyaddr,, [AC_CHECK_LIB(bind, gethostbyaddr, BIND_LIB="-lbind")])
 --- a/include/sane/config.h.in
 +++ b/include/sane/config.h.in
-@@ -207,6 +207,9 @@
+@@ -229,6 +229,9 @@
  /* Define to 1 if you have the `mkdir' function. */
  #undef HAVE_MKDIR
  
  /* Define to 1 if you have a working `mmap' system call. */
  #undef HAVE_MMAP
  
---- a/backend/pieusb_buffer.c
-+++ b/backend/pieusb_buffer.c
-@@ -112,6 +112,11 @@
- #endif
- #endif
-+#ifndef HAVE_MKOSTEMP
-+/* uclibc might not implement mkostemp GNU extension */
-+#define mkostemp(template, flags) mkstemp(template)
-+#endif
-+
- static void buffer_update_read_index(struct Pieusb_Read_Buffer* buffer, int increment);
- /* READER */
index bb01dd9d96e967c20aef61d9fc0bc92d2172ecd6..5a4b9de1c6e2ea0cbaad8b6fb874c9dbc36e702f 100644 (file)
@@ -1,11 +1,22 @@
 --- a/backend/Makefile.am
 +++ b/backend/Makefile.am
-@@ -1142,7 +1142,7 @@ EXTRA_DIST += dll.aliases
+@@ -1122,7 +1122,7 @@ EXTRA_DIST += dll.aliases
  nodist_libsane_la_SOURCES =  dll-s.c
  libsane_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll
  libsane_la_LDFLAGS = $(DIST_LIBS_LDFLAGS)
--libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll_preload.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo  ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo $(DL_LIBS) $(LIBV4L_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(GPHOTO2_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(AVAHI_LIBS) $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS)
-+libsane_la_LIBADD = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll_preload.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo  ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo $(DL_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS)
+-libsane_la_LIBADD = $(COMMON_LIBS) $(PRELOADABLE_BACKENDS_ENABLED) libdll_preload.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo  ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo $(DL_LIBS) $(LIBV4L_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(GPHOTO2_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(AVAHI_LIBS) $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS)
++libsane_la_LIBADD = $(COMMON_LIBS) $(PRELOADABLE_BACKENDS_ENABLED) libdll_preload.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo  ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo $(DL_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS)
  
  # WARNING: Automake is getting this wrong so have to do it ourselves.
- libsane_la_DEPENDENCIES = $(COMMON_LIBS) @PRELOADABLE_BACKENDS_ENABLED@ libdll_preload.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo  ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo @SANEI_SANEI_JPEG_LO@
+ libsane_la_DEPENDENCIES = $(COMMON_LIBS) $(PRELOADABLE_BACKENDS_ENABLED) libdll_preload.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo  ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo $(SANEI_SANEI_JPEG_LO)
+--- a/backend/Makefile.in
++++ b/backend/Makefile.in
+@@ -2757,7 +2757,7 @@ libsane_dll_la_LIBADD = $(COMMON_LIBS) l
+ nodist_libsane_la_SOURCES = dll-s.c
+ libsane_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=dll
+ libsane_la_LDFLAGS = $(DIST_LIBS_LDFLAGS)
+-libsane_la_LIBADD = $(COMMON_LIBS) $(PRELOADABLE_BACKENDS_ENABLED) libdll_preload.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo  ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo $(DL_LIBS) $(LIBV4L_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(TIFF_LIBS) $(JPEG_LIBS) $(GPHOTO2_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(AVAHI_LIBS) $(SCSI_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS)
++libsane_la_LIBADD = $(COMMON_LIBS) $(PRELOADABLE_BACKENDS_ENABLED) libdll_preload.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo  ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo $(DL_LIBS) $(MATH_LIB) $(IEEE1284_LIBS) $(SOCKET_LIBS) $(USB_LIBS) $(PTHREAD_LIBS) $(RESMGR_LIBS)
+ # WARNING: Automake is getting this wrong so have to do it ourselves.
+ libsane_la_DEPENDENCIES = $(COMMON_LIBS) $(PRELOADABLE_BACKENDS_ENABLED) libdll_preload.la sane_strstatus.lo ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_pv8630.lo ../sanei/sanei_pp.lo ../sanei/sanei_thread.lo  ../sanei/sanei_lm983x.lo ../sanei/sanei_access.lo ../sanei/sanei_net.lo ../sanei/sanei_wire.lo ../sanei/sanei_codec_bin.lo ../sanei/sanei_pa4s2.lo ../sanei/sanei_ab306.lo ../sanei/sanei_pio.lo ../sanei/sanei_tcp.lo ../sanei/sanei_udp.lo ../sanei/sanei_magic.lo $(SANEI_SANEI_JPEG_LO)
index 09e0ef9e7099c100562f5a97990e1471b7c03724..8399f19bdf1ce38a4448effff892886eee4f581d 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=screen
-PKG_VERSION:=4.3.1
+PKG_VERSION:=4.6.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=1b6922520e6a0ce5e28768d620b0f640a6631397f95ccb043b70b91bb503fa3a
 PKG_SOURCE_URL:=@GNU/screen
-PKG_MD5SUM:=5bb3b0ff2674e29378c31ad3411170ad
 
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=
@@ -38,6 +38,7 @@ endef
 define Build/Configure
        $(call Build/Configure/Default,\
                --with-sys-screenrc=/etc/screenrc \
+               --enable-colors256 \
        )
        # XXX: memmove() works well with overlapped memory areas
        echo "#define USEMEMMOVE 1" >>$(PKG_BUILD_DIR)/config.h
index d9662b4f0a38c815ff7273c2d111f5d1fe337cbd..38821c412d8419fd4b284b8cd4574a49ea0d7bf4 100644 (file)
@@ -9,7 +9,7 @@
  } # as_fn_error
  
  if expr a : '\(a\)' >/dev/null 2>&1 &&
-@@ -5942,8 +5942,6 @@ else
+@@ -5909,8 +5909,6 @@ else
  fi
  rm -f core conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
@@ -18,7 +18,7 @@
  oldlibs="$LIBS"
  LIBS="$LIBS -lsun"
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking IRIX sun library..." >&5
-@@ -7024,7 +7022,7 @@ as_fn_error ()
+@@ -6991,7 +6989,7 @@ as_fn_error ()
      $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
    fi
    $as_echo "$as_me: error: $2" >&2
index 50d00b86971f81348e1a1868b373bb836a386113..61389b792cf2112ceff1cf12386c48b0ecbc4c6e 100644 (file)
@@ -8,4 +8,4 @@
 +      $(CC) -c $(M_CFLAGS) $(CPPFLAGS) $(DEFS) \
            $(OPTIONS) $(CFLAGS) $<
  
- install_bin: .version screen
+ install_bin: .version screen installdirs
index fbf648e29a15bf16f6e1d2a2e9af7d125d108a7c..2b787686c5e1a8b5e6b636ba936f3d56d0df700b 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/serialconsole/sc
-PKG_MD5SUM:=4fe58576a5bddb9f1fb3dcfc6410b885
+PKG_HASH:=5ae99b370a5a3feb38372b383edc23012b5be5d81547aeb1ac52b408037c1d1c
 PKG_MAINTAINER:=Stefan Bethke <stb@lassitu.de>
 
 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
diff --git a/utils/setserial/Makefile b/utils/setserial/Makefile
new file mode 100644 (file)
index 0000000..0a7be5a
--- /dev/null
@@ -0,0 +1,34 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=setserial
+PKG_VERSION:=2.17
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/setserial
+PKG_HASH:=7e4487d320ac31558563424189435d396ddf77953bb23111a17a3d1487b5794a
+
+PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
+PKG_LICENSE:=GPL-2.0
+
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/setserial
+  SECTION:=utils
+  CATEGORY:=Utilities
+  URL:=http://setserial.sourceforge.net/
+  TITLE:=Serial port attribute utility
+endef
+
+define Package/setserial/install
+       $(INSTALL_DIR) $(1)/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/setserial $(1)/bin/
+endef
+
+define Package/setserial/description
+ Setserial is a program which allows you to look at and change various
+ attributes of a serial device, including its port, its IRQ, and other
+ serial port options.
+endef
+
+$(eval $(call BuildPackage,setserial))
index d56be82713f96467aebb8af9dd53ba98a92d8208..3ab40d9a3c3462e915b7e336a18b983be0ffa13b 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=shadow
 PKG_VERSION:=4.2.1
-PKG_RELEASE:=5
+PKG_RELEASE:=8
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://pkg-shadow.alioth.debian.org/releases
-PKG_MD5SUM:=2bfafe7d4962682d31b5eba65dba4fc8
+PKG_HASH:=3b0893d1476766868cd88920f4f1231c4795652aa407569faff802bcda0f3d41
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
 PKG_LICENSE:=BSD-3-Clause
 
@@ -25,8 +25,11 @@ include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
 
 SHADOW_APPLETS := \
-       chage groupadd groupdel groupmod groups passwd su \
-       useradd userdel usermod
+       chage chpasswd chfn chsh expiry faillog gpasswd \
+       groupadd groupdel groupmems groupmod groups \
+       lastlog login newgidmap newgrp newuidmap nologin \
+       passwd su \
+       useradd userdel usermod vipw
 
 CONFIGURE_ARGS += \
        --without-audit \
@@ -35,8 +38,7 @@ CONFIGURE_ARGS += \
        --without-acl \
        --without-attr \
        --without-tcb \
-       --without-nscd \
-       --disable-subordinate-ids \
+       --without-nscd
 
 define Package/shadow/Default
   SECTION:=utils
diff --git a/utils/shadow/patches/003-Check-size-of-uid_t-and-gid_t-using-AC_CHECK_SIZEOF.patch b/utils/shadow/patches/003-Check-size-of-uid_t-and-gid_t-using-AC_CHECK_SIZEOF.patch
new file mode 100644 (file)
index 0000000..046523d
--- /dev/null
@@ -0,0 +1,35 @@
+From 2cb54158b80cdbd97ca3b36df83f9255e923ae3f Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@aura-online.co.uk>
+Date: Sat, 23 Aug 2014 09:46:39 +0100
+Subject: [PATCH] Check size of uid_t and gid_t using AC_CHECK_SIZEOF
+
+This built-in check is simpler than the previous method and, most
+importantly, works when cross-compiling.
+
+Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
+---
+ configure.in | 14 ++++----------
+ 1 file changed, 4 insertions(+), 10 deletions(-)
+
+--- a/configure.in
++++ b/configure.in
+@@ -334,16 +334,10 @@ if test "$enable_subids" != "no"; then
+       dnl
+       dnl FIXME: check if 32 bit UIDs/GIDs are supported by libc
+       dnl
+-      AC_RUN_IFELSE([AC_LANG_SOURCE([
+-#include <sys/types.h>
+-int main(void) {
+-      uid_t u;
+-      gid_t g;
+-      return (sizeof u < 4) || (sizeof g < 4);
+-}
+-      ])], [id32bit="yes"], [id32bit="no"])
++      AC_CHECK_SIZEOF([uid_t],, [#include "sys/types.h"])
++      AC_CHECK_SIZEOF([gid_t],, [#include "sys/types.h"])
+-      if test "x$id32bit" = "xyes"; then
++      if test "$ac_cv_sizeof_uid_t" -ge 4 && test "$ac_cv_sizeof_gid_t" -ge 4; then
+               AC_DEFINE(ENABLE_SUBIDS, 1, [Define to support the subordinate IDs.])
+               enable_subids="yes"
+       else
diff --git a/utils/shadow/patches/003-fix-disabling-subids.patch b/utils/shadow/patches/003-fix-disabling-subids.patch
deleted file mode 100644 (file)
index bbc65c7..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
---- a/src/usermod.c
-+++ b/src/usermod.c
-@@ -1361,6 +1361,7 @@ static void process_flags (int argc, cha
-               exit (E_UID_IN_USE);
-       }
-+#ifdef ENABLE_SUBIDS
-       if (   (vflg || Vflg)
-           && !is_sub_uid) {
-               fprintf (stderr,
-@@ -1376,6 +1377,7 @@ static void process_flags (int argc, cha
-                        Prog, sub_gid_dbname (), "-w", "-W");
-               exit (E_USAGE);
-       }
-+#endif
- }
- /*
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -52,7 +52,10 @@ usbin_PROGRAMS = \
- noinst_PROGRAMS = id sulogin
- suidbins       = su
--suidubins      = chage chfn chsh expiry gpasswd newgrp passwd newuidmap newgidmap
-+suidubins      = chage chfn chsh expiry gpasswd newgrp passwd
-+if ENABLE_SUBIDS
-+      suidubins += newuidmap newgidmap
-+endif
- if ACCT_TOOLS_SETUID
-       suidubins += chage chgpasswd chpasswd groupadd groupdel groupmod newusers useradd userdel usermod
- endif
index 4c130c7367b95c413343877e1bc9c737124d2caf..2f7a670b36c9c58aea05fc98c1a9c195a006d619 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/su.c
 +++ b/src/su.c
-@@ -1090,8 +1090,12 @@
+@@ -1090,8 +1090,12 @@ int main (int argc, char **argv)
  
                if (fd >= 0) {
                        err = ioctl (fd, TIOCNOTTY, (char *) 0);
index ad6c1e3523f3af9c2d79d7f7aaad71fa47d7c789..fff1dbd517861f604d6887a3e396254b38d78d6e 100644 (file)
@@ -14,6 +14,7 @@ PKG_RELEASE:=1
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=5ff4a05a5bcb6a64a9d6f77fed47014512f66b11
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=d09782160dbcc1ba3bd6a38941f38e130049d8383843f6f292409909678aed82
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=git://git.code.sf.net/p/sispmctl/git
 PKG_MAINTAINER:=Richard Kunze <richard.kunze@web.de>
index c0dfef983429d47c72bf19ae4b82b9134c5bf769..352579a45d11e1d0cc47251be56e57ff9ca59118 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2016 OpenWrt.org
+# Copyright (C) 2016, 2018 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,14 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=slide-switch
-PKG_VERSION:=0.9.0
+PKG_VERSION:=0.9.1
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/jefferyto/openwrt-slide-switch.git
-PKG_SOURCE_VERSION:=9171c2ea9cc9cbfb6f27b7bc25a535c8c35ee534
+PKG_SOURCE_VERSION:=d70b5a09f457050e7e3b45fe03787945aa8880a0
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=78227e0cdc36f105b4fc5657620e41d6bb429eeef76419ce2cd53d2b6700ce31
 
 PKG_BUILD_PARALLEL:=1
 PKG_FIXUP:=autoreconf
@@ -31,7 +32,7 @@ define Package/slide-switch
        SECTION:=utils
        CATEGORY:=Utilities
        DEPENDS:=+jshn +jsonfilter
-       TITLE:=Translate switch position changes into normal button presses
+       TITLE:=Translate switch position change to button press
        URL:=https://github.com/jefferyto/openwrt-slide-switch
 endef
 
index 88d68402042d4d240a87deae1a0bf1e75849214a..fc0c1008c1061b8cbd31fbe8cc336f261f679160 100644 (file)
@@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/uclibc++.mk
 
 PKG_NAME:=smartmontools
-PKG_VERSION:=6.5
+PKG_VERSION:=6.6
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/smartmontools
-PKG_MD5SUM:=093aeec3f8f39fa9a37593c4012d3156
+PKG_HASH:=51f43d0fb064fccaf823bbe68cf0d317d0895ff895aa353b3339a3b316a53054
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
@@ -55,13 +55,17 @@ define Package/smartd/description
   ATA and SCSI disks. It is derived from smartsuite.
 endef
 
-# uses GNU configure
+ifeq ($(CONFIG_USE_UCLIBCXX),y)
+  UCXXCFLAGS:=-fno-builtin -fno-rtti -nostdinc++
+  UCXXCPPFLAGS:=-I$(STAGING_DIR)/usr/include/uClibc++
+  UCXXLIBS:=-nodefaultlibs -lc -luClibc++
+endif
 
 CONFIGURE_VARS += \
-       CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti -nostdinc++" \
-       CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/uClibc++ -I$(LINUX_DIR)/include" \
+       CXXFLAGS="$$$$CXXFLAGS $(UCXXCFLAGS)" \
+       CPPFLAGS="$$$$CPPFLAGS $(UCXXCPPFLAGS) -I$(LINUX_DIR)/include" \
        LDFLAGS="$$$$LDFLAGS" \
-       LIBS="-nodefaultlibs -lc -luClibc++ -lm $(LIBGCC_S) -lc" \
+       LIBS="$(UCXXLIBS) -lm $(LIBGCC_S) -lc" \
 
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
diff --git a/utils/smartmontools/patches/001-musl-compat-realpath.patch b/utils/smartmontools/patches/001-musl-compat-realpath.patch
new file mode 100644 (file)
index 0000000..cc11023
--- /dev/null
@@ -0,0 +1,19 @@
+commit 2473c5e01ea14fae96c157d8bce3a3ec1da124f3
+Author: Maxim Storchak <m.storchak@gmail.com>
+Date:   Sat Dec 9 15:21:51 2017 +0200
+
+    Replace canonicalize_file_name with realpath equivalent
+
+diff --git a/os_linux.cpp b/os_linux.cpp
+index 134d5bc..0575a13 100644
+--- a/os_linux.cpp
++++ b/os_linux.cpp
+@@ -3176,7 +3176,7 @@ static bool is_hpsa(const char * name)
+ {
+   char path[128];
+   snprintf(path, sizeof(path), "/sys/block/%s/device", name);
+-  char * syshostpath = canonicalize_file_name(path);
++  char * syshostpath = realpath(path, NULL);
+   if (!syshostpath)
+     return false;
index 9df7698e79971514032e5aa29e1e2e7ae6cfb959..7acdcc0926cb32072de8c0f493935ba14d68276b 100644 (file)
@@ -8,10 +8,10 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=smstools3
-PKG_VERSION:=3.1.15
-PKG_RELEASE:=3
+PKG_VERSION:=3.1.21
+PKG_RELEASE:=2
 
-PKG_MAINTAINER:=Gérald Kerma <dreagle@doukki.net>
+PKG_MAINTAINER:=Harald Geyer <harald@ccbib.org>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=LICENSE
 
@@ -19,7 +19,7 @@ PKG_BUILD_PARALLEL:=0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://smstools3.kekekasvi.com/packages/
-PKG_MD5SUM:=0241ef60e646fac1a06254a848e61ed7
+PKG_HASH:=a26ba4c02b16f6cf13177bffca6c9230dc5fefaeba8e3030cd4e4905f6a92084
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
@@ -47,22 +47,19 @@ TARGET_CFLAGS += -D_FILE_OFFSET_BITS=64
 
 MAKE_VARS += LFLAGS="$(TARGET_LDFLAGS) $(if $(ICONV_FULL),-liconv)"
 
-BINDIR=/usr/local/bin
-
 define Package/smstools3/configure
 endef
 
 define Package/smstools3/install
-       $(INSTALL_DIR) $(1)/$(BINDIR)
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/smsd $(1)/$(BINDIR)/smsd
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/sendsms $(1)/$(BINDIR)/sendsms
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/sms2html $(1)/$(BINDIR)/sms2html
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/sms2unicode $(1)/$(BINDIR)/sms2unicode
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/unicode2sms $(1)/$(BINDIR)/unicode2sms
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/src/smsd \
+               $(PKG_BUILD_DIR)/scripts/sendsms \
+               $(1)/usr/bin/
        $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_DATA) -m 0755 ./files/smstools3.init $(1)/etc/init.d/smstools3
+       $(INSTALL_BIN) ./files/smstools3.init $(1)/etc/init.d/smstools3
        $(INSTALL_DIR) $(1)/etc
-       $(INSTALL_DATA) -m 0755 ./files/smstools3.conf $(1)/etc/smsd.conf
+       $(INSTALL_CONF) ./files/smstools3.conf $(1)/etc/smsd.conf
 endef
 
 $(eval $(call BuildPackage,smstools3))
index c8732e353793b9791a7c0ea8d9c3f24e9a6ca303..da5a36a3d5e5f6510511ebbd3bc3bdeef49d7477 100644 (file)
@@ -10,11 +10,15 @@ failed = /var/spool/sms/failed
 sent = /var/spool/sms/sent
 receive_before_send = no
 autosplit = 3
+logfile = 1
+loglevel = 5
 
-[GSM1]
-init = AT+CPMS="ME","ME","ME"
-device = /dev/ttyUSB0
-incoming = yes
-pin = 0000
-baudrate = 9600
+# Uncomment (and edit) this section to allow smsd to start:
+#
+#[GSM1]
+#init = AT+CPMS="ME","ME","ME"
+#device = /dev/ttyUSB0
+#incoming = yes
+#pin = 0000
+#baudrate = 115200
 
index 6598795b16421252fda683454ed4b8eaa4a3a1d8..b46fa5a286df0aad934af1e38875e988abc535a6 100644 (file)
@@ -1,43 +1,21 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2014 OpenWrt.org
-# smsd initscript openwrt mod
+# Copyright (C) 2014-2018 OpenWrt.org
 
-START=99
-STOP=99
+START=94
 
-EXTRA_COMMANDS="status"
-EXTRA_HELP="        status  View pid and service status "
-
-# Set USER and GROUP, if necessary:
-USER=""
-GROUP=""
+USE_PROCD=1
 
 # If an unpriviledged user is selected, make sure that next two
 # files are writable by that user:
 PIDFILE="/var/run/smsd.pid"
 INFOFILE="/var/run/smsd.working"
-# Logfile can also be defined in here:
-LOGFILE="/var/log/smsd.log"
 
-DAEMON=/usr/local/bin/smsd
-# A program which turns power off for couple of seconds:
-RESETMODEMS=/usr/local/bin/smsd_resetmodems
-NAME=smsd
-PSOPT=""
+DAEMON=/usr/bin/smsd
 
 # Set/edit this before starting service !!!!!
 WRT_SPOOL=/var/spool
 
-# Maximum time to stop smsd, after that it gets killed hardly:
-MAXWAIT=45
-
-boot() {
-       start
-}
-
-start() {
-       test -x $DAEMON || exit 0
-
+start_service() {
        echo "Creating minimum spool directories"
        mkdir -p $WRT_SPOOL
        mkdir -p $WRT_SPOOL/sms
@@ -47,106 +25,13 @@ start() {
        mkdir -p $WRT_SPOOL/sms/failed
        mkdir -p $WRT_SPOOL/sms/sent
 
-       echo -n "Starting SMS Daemon: "
-       MSG="."
-       ARGS="-n MAINPROCESS -p$PIDFILE -i$INFOFILE"
-       [ "x$USER" != x ] && ARGS="$ARGS -u$USER"
-       [ "x$GROUP" != x ] && ARGS="$ARGS -g$GROUP"
-       [ "x$LOGFILE" != x ] && ARGS="$ARGS -l$LOGFILE"
-       PID=`cat $PIDFILE 2>/dev/null`
-       if [ "x$PID" != x ]; then
-         if kill -0 $PID 2>/dev/null; then
-           MSG=" already running ($PID)."
-         else
-           PID=""
-         fi
-       fi
-       if [ "x$PID" = x ]; then
-         if ps $PSOPT | grep $NAME | grep -v grep >/dev/null; then
-           MSG=" already running."
-         else
-           $DAEMON $ARGS
-           sleep 1
-           PIDS=`ps $PSOPT | grep $NAME | grep -v grep`
-           [ "x$PIDS" = x ] && MSG=" failed."
-         fi
-       fi
-       echo "$NAME$MSG"
-}
-
-stop() {
-       if ps $PSOPT | grep $NAME | grep -v grep >/dev/null; then
-         PID=`cat $PIDFILE 2>/dev/null`
-         if [ "x$PID" != x ]; then
-           P=`kill -0 $PID 2>/dev/null`
-           [ "x$P" != x ] && PID=""
-         fi
-         if [ "x$PID" != x ]; then
-           kill $PID
-         else
-           kill `ps $PSOPT | grep $NAME | grep -v grep | awk '{print $1}'` >/dev/null 2>&1
-         fi
-         sleep 1
-         if ps $PSOPT | grep $NAME | grep -v grep >/dev/null; then
-           echo "Allowing $NAME to terminate gracefully within $MAXWAIT seconds"
-           infofound=0
-           dots=0
-           seconds=0
-           while ps $PSOPT | grep $NAME | grep -v grep >/dev/null; do
-             if [ $infofound -lt 1 ]; then
-               if [ -f $INFOFILE ]; then
-                 infofound=1
-                 if [ $dots -gt 0 ]; then
-                   echo ""
-                   dots=0
-                 fi
-                 $ECHO -n "$NAME is currently "
-                 cat $INFOFILE
-                 echo "Time counting is now disabled and we will wait until this job is complete."
-               fi
-             fi
-             [ $infofound -lt 1 ] && seconds=`expr $seconds + 1`
-             echo -n "."
-             dots=`expr $dots + 1`
-             if [ "$seconds" -ge $MAXWAIT ]; then
-               if [ $dots -gt 0 ]; then
-                 echo ""
-                 dots=0
-               fi
-               echo "Timeout occurred, killing $NAME hardly."
-               kill -9 `ps $PSOPT | grep $NAME | grep -v grep | awk '{print $1}'` >/dev/null 2>&1
-               [ -f $PIDFILE ] && rm $PIDFILE
-               seconds=0
-             fi
-             sleep 1
-           done
-           [ $dots -gt 0 ] && echo ""
-           #echo "$NAME is stopped."
-         fi
-       fi
-}
-
-restart() {
-       stop
-       start
-}
-
+       procd_open_instance
 
-status() {
-       PID=$(cat $PIDFILE)
+       procd_set_param command $DAEMON -n MAINPROCESS -p$PIDFILE -i$INFOFILE
+       procd_set_param respawn
+       procd_set_param stdout 1
 
-       test -e $PIDFILE
-       if [ $? == 0 ]; then
-               echo $NAME " running! pid $PID"
-       else
-               echo $NAME " not running !!!"
-       fi
+       procd_close_instance
 }
 
-reset() {
-       $0 stop
-       [ -f "$RESETMODEMS" ] && "$RESETMODEMS"
-       sleep 30
-       $0 start
-}
 
diff --git a/utils/smstools3/patches/001-smsd.patch b/utils/smstools3/patches/001-smsd.patch
deleted file mode 100644 (file)
index 6761661..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/src/smsd.c       2010-09-21 13:47:48.000000000 +0300
-+++ b/src/smsd.c       2013-03-05 05:26:26.000000000 +0300
-@@ -5200,8 +5200,8 @@
-       int result = 1;
-       char *cmd;
-       char *p;
--      char answer[500];
--      char buffer[600];
-+      char answer[1024];
-+      char buffer[1024];
-       int fd;
-       int log_retry = 3;
-       int i;
index 1e5630f3963570a3a2ef8d3038ba48abc754473b..a52aee4f9c9eb4640a267adb017f5d27c8ccb4ff 100644 (file)
@@ -9,12 +9,3 @@
  
  # Uncomment for Solaris
  # CFLAGS += -D SOLARIS
-@@ -43,7 +43,7 @@ smsd: smsd.c extras.o locking.o cfgfile.
- ifneq (,$(findstring SOLARIS,$(CFLAGS)))
- ifeq (,$(findstring DISABLE_INET_SOCKET,$(CFLAGS)))
--override LFLAGS += -lsocket -lnsl
-+      override LFLAGS += -lsocket -lnsl
- endif
- endif
diff --git a/utils/smstools3/patches/003-bash-ash.patch b/utils/smstools3/patches/003-bash-ash.patch
new file mode 100644 (file)
index 0000000..4ad1663
--- /dev/null
@@ -0,0 +1,8 @@
+--- a/scripts/sendsms
++++ b/scripts/sendsms
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/ash
+ # This script send a text sms at the command line by creating
+ # a sms file in the outgoing queue.
diff --git a/utils/smstools3/patches/004-modem-processes.patch b/utils/smstools3/patches/004-modem-processes.patch
new file mode 100644 (file)
index 0000000..95de7ba
--- /dev/null
@@ -0,0 +1,26 @@
+commit 3790bd05ed86b1692719df22857ef76c1293b01c
+Author: Harald Geyer <harald@ccbib.org>
+Date:   Sun Feb 18 19:24:48 2018 +0100
+
+    Make modem processes terminate when main process dies
+
+diff --git a/src/smsd.c b/src/smsd.c
+index fdfa193..37b2e4d 100755
+--- a/src/smsd.c
++++ b/src/smsd.c
+@@ -34,6 +34,7 @@ Either version 2 of the License, or (at your option) any later version.
+ #ifndef DISABLE_INOTIFY
+ #include <sys/inotify.h>
+ #endif
++#include <sys/prctl.h>
+ #include "extras.h"
+ #include "locking.h"
+@@ -8100,6 +8101,7 @@ int main(int argc,char** argv)
+       if (pid == 0)
+       {
++        prctl(PR_SET_PDEATHSIG, SIGTERM, 0, 0, 0);
+         process_id = i;
+         strcpy(process_title, DEVICE.name);
+         apply_process_name(argc, argv, process_title);
index ca4da885e5ffa98f224afaf263f74f2e70b72e59..ce2b15e7289ff7d5acc994edb4673bc39cff8fc1 100644 (file)
@@ -17,6 +17,7 @@ PKG_SOURCE_URL:=https://github.com/cpb-/spi-tools.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=cc6a41fdcec60610703ba6db488c621c64952898
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=3c37fde79ab09e9a590f4cdb55751083017197d0037a7c0dce56fceef5e05a21
 
 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
 
index b904fa4e01a2caaae50fe9d7a876552a1dd09daf..d856ce7c150e5f13628077a57c26941f9dec2742 100644 (file)
@@ -9,15 +9,16 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=squashfs-tools
 PKG_VERSION:=4.3
-PKG_RELEASE:=3
+PKG_RELEASE:=6
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/plougher/squashfs-tools
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=9c1db6d13a51a2e009f0027ef336ce03624eac0d
+PKG_SOURCE_VERSION:=5be5d61e5e5a93911256b5f2106e50da0ca81e8d
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=eac1bc559708dc8656fe7d099ffc9e9374ae0cfb9a12d180a9c0c28acb0adf11
 
 PKG_BUILD_PARALLEL:=1
 include $(INCLUDE_DIR)/package.mk
@@ -69,6 +70,8 @@ endif
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR)/squashfs-tools \
                CC="$(TARGET_CC)" \
+               EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+               EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
                $(MAKE_FLAGS) \
                mksquashfs unsquashfs
 endef
diff --git a/utils/squashfs-tools/patches/0001-squashfs-tools-fix-fnmatch.h-compatibility-with-musl.patch b/utils/squashfs-tools/patches/0001-squashfs-tools-fix-fnmatch.h-compatibility-with-musl.patch
deleted file mode 100644 (file)
index 5bfd28d..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-From a0c129760ca9bdc7e564ae2a508fac3799f9d39b Mon Sep 17 00:00:00 2001
-From: Alexandru Ardelean <aa@ocedo.com>
-Date: Wed, 6 Jan 2016 15:33:43 +0200
-Subject: [PATCH 1/2] squashfs-tools: with fnmatch.h compatibility with musl
-
-Signed-off-by: Alexandru Ardelean <aa@ocedo.com>
----
- squashfs-tools/action.c         |  2 +-
- squashfs-tools/fnmatch_compat.h | 32 ++++++++++++++++++++++++++++++++
- squashfs-tools/mksquashfs.c     |  2 +-
- squashfs-tools/unsquashfs.c     |  1 +
- squashfs-tools/unsquashfs.h     |  1 -
- 5 files changed, 35 insertions(+), 3 deletions(-)
- create mode 100644 squashfs-tools/fnmatch_compat.h
-
-diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c
-index 35889a4..4b06ccb 100644
---- a/squashfs-tools/action.c
-+++ b/squashfs-tools/action.c
-@@ -31,7 +31,6 @@
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <unistd.h>
--#include <fnmatch.h>
- #include <pwd.h>
- #include <grp.h>
- #include <sys/wait.h>
-@@ -43,6 +42,7 @@
- #include "mksquashfs.h"
- #include "action.h"
- #include "error.h"
-+#include "fnmatch_compat.h"
- /*
-  * code to parse actions
-diff --git a/squashfs-tools/fnmatch_compat.h b/squashfs-tools/fnmatch_compat.h
-new file mode 100644
-index 0000000..7b4afd8
---- /dev/null
-+++ b/squashfs-tools/fnmatch_compat.h
-@@ -0,0 +1,32 @@
-+#ifndef FNMATCH_COMPAT
-+#define FNMATCH_COMPAT
-+/*
-+ * Squashfs
-+ *
-+ * Copyright (c) 2015
-+ * Phillip Lougher <phillip@squashfs.org.uk>
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version 2,
-+ * 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, write to the Free Software
-+ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ * fnmatch_compat.h
-+ */
-+
-+#include <fnmatch.h>
-+
-+#ifndef FNM_EXTMATCH
-+#define FNM_EXTMATCH  0
-+#endif
-+
-+#endif
-diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
-index d221c35..4e7cbdd 100644
---- a/squashfs-tools/mksquashfs.c
-+++ b/squashfs-tools/mksquashfs.c
-@@ -46,7 +46,6 @@
- #include <sys/mman.h>
- #include <pthread.h>
- #include <regex.h>
--#include <fnmatch.h>
- #include <sys/wait.h>
- #include <limits.h>
- #include <ctype.h>
-@@ -76,6 +75,7 @@
- #include "read_fs.h"
- #include "restore.h"
- #include "process_fragments.h"
-+#include "fnmatch_compat.h"
- int delete = FALSE;
- int fd;
-diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
-index 1323dd6..2428baa 100644
---- a/squashfs-tools/unsquashfs.c
-+++ b/squashfs-tools/unsquashfs.c
-@@ -30,6 +30,7 @@
- #include "xattr.h"
- #include "unsquashfs_info.h"
- #include "stdarg.h"
-+#include "fnmatch_compat.h"
- #include <sys/sysinfo.h>
- #include <sys/types.h>
-diff --git a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h
-index ecd0bb4..0edbd25 100644
---- a/squashfs-tools/unsquashfs.h
-+++ b/squashfs-tools/unsquashfs.h
-@@ -40,7 +40,6 @@
- #include <grp.h>
- #include <time.h>
- #include <regex.h>
--#include <fnmatch.h>
- #include <signal.h>
- #include <pthread.h>
- #include <math.h>
--- 
-2.1.4
-
diff --git a/utils/squashfs-tools/patches/0002-pseudo.c-add-explicit-stat.h-include.patch b/utils/squashfs-tools/patches/0002-pseudo.c-add-explicit-stat.h-include.patch
deleted file mode 100644 (file)
index 8f10211..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0ea07a1b5ddb2f2fa1358b2c1b42bcf34bbf5ee2 Mon Sep 17 00:00:00 2001
-From: Alexandru Ardelean <aa@ocedo.com>
-Date: Wed, 6 Jan 2016 15:36:48 +0200
-Subject: [PATCH 2/2] pseudo.c: add explicit <stat.h> include
-
-Signed-off-by: Alexandru Ardelean <aa@ocedo.com>
----
- squashfs-tools/pseudo.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/squashfs-tools/pseudo.c b/squashfs-tools/pseudo.c
-index f85fe60..7a26bca 100644
---- a/squashfs-tools/pseudo.c
-+++ b/squashfs-tools/pseudo.c
-@@ -32,6 +32,7 @@
- #include <stdlib.h>
- #include <sys/types.h>
- #include <sys/wait.h>
-+#include <sys/stat.h>
- #include <ctype.h>
- #include "pseudo.h"
--- 
-2.1.4
-
diff --git a/utils/squashfs-tools/patches/0004-vla-to-malloc.patch b/utils/squashfs-tools/patches/0004-vla-to-malloc.patch
new file mode 100644 (file)
index 0000000..ffe2a79
--- /dev/null
@@ -0,0 +1,474 @@
+diff -aurp a/squashfs-tools/unsquash-1.c b/squashfs-tools/unsquash-1.c
+--- a/squashfs-tools/unsquash-1.c      2014-09-18 20:16:18.000000000 -0600
++++ b/squashfs-tools/unsquash-1.c      2017-08-29 13:18:14.403020644 -0600
+@@ -332,17 +332,19 @@ int read_uids_guids_1()
+       guid_table = uid_table + sBlk.no_uids;
+       if(swap) {
+-              unsigned int suid_table[sBlk.no_uids + sBlk.no_guids];
++              unsigned int* suid_table = malloc((sBlk.no_uids + sBlk.no_guids) * sizeof(unsigned int));
+               res = read_fs_bytes(fd, sBlk.uid_start, (sBlk.no_uids +
+                       sBlk.no_guids) * sizeof(unsigned int), suid_table);
+               if(res == FALSE) {
++                      free(suid_table);
+                       ERROR("read_uids_guids: failed to read uid/gid table"
+                               "\n");
+                       return FALSE;
+               }
+               SQUASHFS_SWAP_INTS_3(uid_table, suid_table,
+                       sBlk.no_uids + sBlk.no_guids);
++              free(suid_table);
+       } else {
+               res = read_fs_bytes(fd, sBlk.uid_start, (sBlk.no_uids +
+                       sBlk.no_guids) * sizeof(unsigned int), uid_table);
+diff -aurp a/squashfs-tools/unsquash-2.c b/squashfs-tools/unsquash-2.c
+--- a/squashfs-tools/unsquash-2.c      2014-09-18 20:16:18.000000000 -0600
++++ b/squashfs-tools/unsquash-2.c      2017-08-29 13:23:48.111321548 -0600
+@@ -32,7 +32,7 @@ void read_block_list_2(unsigned int *blo
+       TRACE("read_block_list: blocks %d\n", blocks);
+       if(swap) {
+-              unsigned int sblock_list[blocks];
++              unsigned int* sblock_list = malloc(blocks*sizeof(unsigned int));
+               memcpy(sblock_list, block_ptr, blocks * sizeof(unsigned int));
+               SQUASHFS_SWAP_INTS_3(block_list, sblock_list, blocks);
+       } else
+@@ -45,7 +45,7 @@ int read_fragment_table_2(long long *dir
+       int res, i;
+       int bytes = SQUASHFS_FRAGMENT_BYTES_2(sBlk.s.fragments);
+       int indexes = SQUASHFS_FRAGMENT_INDEXES_2(sBlk.s.fragments);
+-      unsigned int fragment_table_index[indexes];
++      unsigned int* fragment_table_index = malloc(indexes * sizeof(unsigned int));
+       TRACE("read_fragment_table: %d fragments, reading %d fragment indexes "
+               "from 0x%llx\n", sBlk.s.fragments, indexes,
+@@ -53,6 +53,7 @@ int read_fragment_table_2(long long *dir
+       if(sBlk.s.fragments == 0) {
+               *directory_table_end = sBlk.s.fragment_table_start;
++              free(fragment_table_index);
+               return TRUE;
+       }
+@@ -62,7 +63,7 @@ int read_fragment_table_2(long long *dir
+                       "fragment table\n");
+       if(swap) {
+-               unsigned int sfragment_table_index[indexes];
++               unsigned int* sfragment_table_index = malloc(indexes * sizeof(unsigned int));
+                res = read_fs_bytes(fd, sBlk.s.fragment_table_start,
+                       SQUASHFS_FRAGMENT_INDEX_BYTES_2(sBlk.s.fragments),
+@@ -70,10 +71,14 @@ int read_fragment_table_2(long long *dir
+               if(res == FALSE) {
+                       ERROR("read_fragment_table: failed to read fragment "
+                               "table index\n");
++                      free(sfragment_table_index);
++                      free(fragment_table_index);
+                       return FALSE;
+               }
+               SQUASHFS_SWAP_FRAGMENT_INDEXES_2(fragment_table_index,
+                       sfragment_table_index, indexes);
++              
++              free(sfragment_table_index);
+       } else {
+               res = read_fs_bytes(fd, sBlk.s.fragment_table_start,
+                       SQUASHFS_FRAGMENT_INDEX_BYTES_2(sBlk.s.fragments),
+@@ -81,6 +86,7 @@ int read_fragment_table_2(long long *dir
+               if(res == FALSE) {
+                       ERROR("read_fragment_table: failed to read fragment "
+                               "table index\n");
++                      free(fragment_table_index);
+                       return FALSE;
+               }
+       }
+@@ -96,6 +102,7 @@ int read_fragment_table_2(long long *dir
+               if(length == FALSE) {
+                       ERROR("read_fragment_table: failed to read fragment "
+                               "table block\n");
++                      free(fragment_table_index);
+                       return FALSE;
+               }
+       }
+@@ -111,6 +118,7 @@ int read_fragment_table_2(long long *dir
+       }
+       *directory_table_end = fragment_table_index[0];
++      free(fragment_table_index);
+       return TRUE;
+ }
+diff -aurp a/squashfs-tools/unsquash-3.c b/squashfs-tools/unsquash-3.c
+--- a/squashfs-tools/unsquash-3.c      2014-09-18 20:16:18.000000000 -0600
++++ b/squashfs-tools/unsquash-3.c      2017-08-29 14:43:17.016089289 -0600
+@@ -32,7 +32,7 @@ int read_fragment_table_3(long long *dir
+       int res, i;
+       int bytes = SQUASHFS_FRAGMENT_BYTES_3(sBlk.s.fragments);
+       int indexes = SQUASHFS_FRAGMENT_INDEXES_3(sBlk.s.fragments);
+-      long long fragment_table_index[indexes];
++      long long* fragment_table_index = malloc(indexes * sizeof(long long));
+       TRACE("read_fragment_table: %d fragments, reading %d fragment indexes "
+               "from 0x%llx\n", sBlk.s.fragments, indexes,
+@@ -40,6 +40,7 @@ int read_fragment_table_3(long long *dir
+       if(sBlk.s.fragments == 0) {
+               *directory_table_end = sBlk.s.fragment_table_start;
++              free(fragment_table_index);
+               return TRUE;
+       }
+@@ -49,7 +50,7 @@ int read_fragment_table_3(long long *dir
+                       "fragment table\n");
+       if(swap) {
+-              long long sfragment_table_index[indexes];
++              long long* sfragment_table_index = malloc(indexes * sizeof(long long));
+               res = read_fs_bytes(fd, sBlk.s.fragment_table_start,
+                       SQUASHFS_FRAGMENT_INDEX_BYTES_3(sBlk.s.fragments),
+@@ -57,10 +58,13 @@ int read_fragment_table_3(long long *dir
+               if(res == FALSE) {
+                       ERROR("read_fragment_table: failed to read fragment "
+                               "table index\n");       
++                      free(fragment_table_index);
++                      free(sfragment_table_index);
+                       return FALSE;
+               }
+               SQUASHFS_SWAP_FRAGMENT_INDEXES_3(fragment_table_index,
+                       sfragment_table_index, indexes);
++              free(sfragment_table_index);
+       } else {
+               res = read_fs_bytes(fd, sBlk.s.fragment_table_start,
+                       SQUASHFS_FRAGMENT_INDEX_BYTES_3(sBlk.s.fragments),
+@@ -68,6 +72,7 @@ int read_fragment_table_3(long long *dir
+               if(res == FALSE) {
+                       ERROR("read_fragment_table: failed to read fragment "
+                               "table index\n");       
++                      free(fragment_table_index);
+                       return FALSE;
+               }
+       }
+@@ -83,6 +88,7 @@ int read_fragment_table_3(long long *dir
+               if(length == FALSE) {
+                       ERROR("read_fragment_table: failed to read fragment "
+                               "table block\n");       
++                      free(fragment_table_index);
+                       return FALSE;
+               }
+       }
+@@ -98,6 +104,7 @@ int read_fragment_table_3(long long *dir
+       }
+       *directory_table_end = fragment_table_index[0];
++      free(fragment_table_index);
+       return TRUE;
+ }
+diff -aurp a/squashfs-tools/unsquash-4.c b/squashfs-tools/unsquash-4.c
+--- a/squashfs-tools/unsquash-4.c      2014-09-18 20:16:18.000000000 -0600
++++ b/squashfs-tools/unsquash-4.c      2017-08-29 14:49:01.424441708 -0600
+@@ -33,7 +33,7 @@ int read_fragment_table_4(long long *dir
+       int res, i;
+       int bytes = SQUASHFS_FRAGMENT_BYTES(sBlk.s.fragments);
+       int  indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk.s.fragments);
+-      long long fragment_table_index[indexes];
++      long long* fragment_table_index = malloc(indexes * sizeof(long long));
+       TRACE("read_fragment_table: %d fragments, reading %d fragment indexes "
+               "from 0x%llx\n", sBlk.s.fragments, indexes,
+@@ -41,6 +41,7 @@ int read_fragment_table_4(long long *dir
+       if(sBlk.s.fragments == 0) {
+               *directory_table_end = sBlk.s.fragment_table_start;
++              free(fragment_table_index);
+               return TRUE;
+       }
+@@ -55,6 +56,7 @@ int read_fragment_table_4(long long *dir
+       if(res == FALSE) {
+               ERROR("read_fragment_table: failed to read fragment table "
+                       "index\n");
++              free(fragment_table_index);
+               return FALSE;
+       }
+       SQUASHFS_INSWAP_FRAGMENT_INDEXES(fragment_table_index, indexes);
+@@ -70,6 +72,7 @@ int read_fragment_table_4(long long *dir
+               if(length == FALSE) {
+                       ERROR("read_fragment_table: failed to read fragment "
+                               "table index\n");
++                      free(fragment_table_index);
+                       return FALSE;
+               }
+       }
+@@ -78,6 +81,7 @@ int read_fragment_table_4(long long *dir
+               SQUASHFS_INSWAP_FRAGMENT_ENTRY(&fragment_table[i]);
+       *directory_table_end = fragment_table_index[0];
++      free(fragment_table_index);
+       return TRUE;
+ }
+@@ -356,13 +360,14 @@ int read_uids_guids_4()
+       int res, i;
+       int bytes = SQUASHFS_ID_BYTES(sBlk.s.no_ids);
+       int indexes = SQUASHFS_ID_BLOCKS(sBlk.s.no_ids);
+-      long long id_index_table[indexes];
++      long long* id_index_table = malloc(indexes * sizeof(long long));
+       TRACE("read_uids_guids: no_ids %d\n", sBlk.s.no_ids);
+       id_table = malloc(bytes);
+       if(id_table == NULL) {
+               ERROR("read_uids_guids: failed to allocate id table\n");
++              free(id_index_table);
+               return FALSE;
+       }
+@@ -370,6 +375,7 @@ int read_uids_guids_4()
+               SQUASHFS_ID_BLOCK_BYTES(sBlk.s.no_ids), id_index_table);
+       if(res == FALSE) {
+               ERROR("read_uids_guids: failed to read id index table\n");
++              free(id_index_table);
+               return FALSE;
+       }
+       SQUASHFS_INSWAP_ID_BLOCKS(id_index_table, indexes);
+@@ -382,11 +388,13 @@ int read_uids_guids_4()
+               if(res == FALSE) {
+                       ERROR("read_uids_guids: failed to read id table block"
+                               "\n");
++                      free(id_index_table);
+                       return FALSE;
+               }
+       }
+       SQUASHFS_INSWAP_INTS(id_table, sBlk.s.no_ids);
++      free(id_index_table);
+       return TRUE;
+ }
+diff -aurp a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
+--- a/squashfs-tools/unsquashfs.c      2017-08-29 14:58:51.917037533 -0600
++++ b/squashfs-tools/unsquashfs.c      2017-08-29 13:14:03.082818149 -0600
+@@ -691,7 +691,7 @@ int read_block(int fd, long long start,
+               return 0;
+       if(compressed) {
+-              char buffer[c_byte];
++              char* buffer = malloc(c_byte);
+               int error;
+               res = read_fs_bytes(fd, start + offset, c_byte, buffer);
+@@ -704,8 +704,10 @@ int read_block(int fd, long long start,
+               if(res == -1) {
+                       ERROR("%s uncompress failed with error code %d\n",
+                               comp->name, error);
++                      free(buffer);
+                       goto failed;
+               }
++              free(buffer);
+       } else {
+               res = read_fs_bytes(fd, start + offset, c_byte, block);
+               if(res == FALSE)
+@@ -2097,7 +2099,7 @@ void *writer(void *arg)
+  */
+ void *inflator(void *arg)
+ {
+-      char tmp[block_size];
++      char* tmp = malloc(block_size);
+       while(1) {
+               struct cache_entry *entry = queue_get(to_inflate);
+@@ -2120,6 +2122,7 @@ void *inflator(void *arg)
+                */ 
+               cache_block_ready(entry, res == -1);
+       }
++      free(tmp);
+ }
+diff -aurp a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+--- a/squashfs-tools/mksquashfs.c      2017-09-05 15:09:19.090937121 -0600
++++ b/squashfs-tools/mksquashfs.c      2017-09-01 09:58:11.274529037 -0600
+@@ -652,7 +652,7 @@ long long write_directories()
+ long long write_id_table()
+ {
+       unsigned int id_bytes = SQUASHFS_ID_BYTES(id_count);
+-      unsigned int p[id_count];
++      unsigned int* p = malloc(id_count * sizeof(unsigned int));
+       int i;
+       TRACE("write_id_table: ids %d, id_bytes %d\n", id_count, id_bytes);
+@@ -655,6 +655,9 @@ long long write_id_table()
+       unsigned int* p = malloc(id_count * sizeof(unsigned int));
+       int i;
++      if(p == NULL)
++              MEM_ERROR();
++
+       TRACE("write_id_table: ids %d, id_bytes %d\n", id_count, id_bytes);
+       for(i = 0; i < id_count; i++) {
+               TRACE("write_id_table: id index %d, id %d", i, id_table[i]->id);
+
+@@ -661,6 +661,7 @@ long long write_id_table()
+               SQUASHFS_SWAP_INTS(&id_table[i]->id, p + i, 1);
+       }
++      free(p);
+       return generic_write_table(id_bytes, p, 0, NULL, noI);
+ }
+diff -aurp a/squashfs-tools/read_fs.c b/squashfs-tools/read_fs.c
+--- a/squashfs-tools/read_fs.c 2014-09-18 20:16:18.000000000 -0600
++++ b/squashfs-tools/read_fs.c 2017-09-05 15:35:19.328547536 -0600
+@@ -77,18 +77,24 @@ int read_block(int fd, long long start,
+               return 0;
+       if(compressed) {
+-              char buffer[c_byte];
++              char* buffer = malloc(c_byte);
+               int error;
++              if(buffer == NULL)
++                      MEM_ERROR();
++
+               res = read_fs_bytes(fd, start + 2, c_byte, buffer);
+-              if(res == 0)
++              if(res == 0) {
++                      free(buffer);
+                       return 0;
++              }
+               res = compressor_uncompress(comp, block, buffer, c_byte,
+                       outlen, &error);
+               if(res == -1) {
+                       ERROR("%s uncompress failed with error code %d\n",
+                               comp->name, error);
++                      free(buffer);
+                       return 0;
+               }
+       } else {
+@@ -699,7 +705,7 @@ all_done:
+ unsigned int *read_id_table(int fd, struct squashfs_super_block *sBlk)
+ {
+       int indexes = SQUASHFS_ID_BLOCKS(sBlk->no_ids);
+-      long long index[indexes];
++      long long* index;
+       int bytes = SQUASHFS_ID_BYTES(sBlk->no_ids);
+       unsigned int *id_table;
+       int res, i;
+@@ -708,12 +714,17 @@ unsigned int *read_id_table(int fd, stru
+       if(id_table == NULL)
+               MEM_ERROR();
++      index = malloc(indexes * sizeof(long long));
++      if(index == NULL)
++              MEM_ERROR();
++
+       res = read_fs_bytes(fd, sBlk->id_table_start,
+               SQUASHFS_ID_BLOCK_BYTES(sBlk->no_ids), index);
+       if(res == 0) {
+               ERROR("Failed to read id table index\n");
+               ERROR("Filesystem corrupted?\n");
+               free(id_table);
++              free(index);
+               return NULL;
+       }
+@@ -732,6 +743,7 @@ unsigned int *read_id_table(int fd, stru
+                               "length %d\n", i, index[i], length);
+                       ERROR("Filesystem corrupted?\n");
+                       free(id_table);
++                      free(index);
+                       return NULL;
+               }
+       }
+@@ -753,14 +765,19 @@ int read_fragment_table(int fd, struct s
+       int res, i;
+       int bytes = SQUASHFS_FRAGMENT_BYTES(sBlk->fragments);
+       int indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk->fragments);
+-      long long fragment_table_index[indexes];
++      long long* fragment_table_index = malloc(indexes * sizeof(long long));
++
++      if(fragment_table_index == NULL)
++              MEM_ERROR();
+       TRACE("read_fragment_table: %d fragments, reading %d fragment indexes "
+               "from 0x%llx\n", sBlk->fragments, indexes,
+               sBlk->fragment_table_start);
+-      if(sBlk->fragments == 0)
++      if(sBlk->fragments == 0) {
++              free(fragment_table_index);
+               return 1;
++      }
+       *fragment_table = malloc(bytes);
+       if(*fragment_table == NULL)
+@@ -773,6 +790,7 @@ int read_fragment_table(int fd, struct s
+               ERROR("Failed to read fragment table index\n");
+               ERROR("Filesystem corrupted?\n");
+               free(*fragment_table);
++              free(fragment_table_index);
+               return 0;
+       }
+@@ -792,6 +810,7 @@ int read_fragment_table(int fd, struct s
+                               fragment_table_index[i], length);
+                       ERROR("Filesystem corrupted?\n");
+                       free(*fragment_table);
++                      free(fragment_table_index);
+                       return 0;
+               }
+       }
+@@ -799,6 +818,7 @@ int read_fragment_table(int fd, struct s
+       for(i = 0; i < sBlk->fragments; i++)
+               SQUASHFS_INSWAP_FRAGMENT_ENTRY(&(*fragment_table)[i]);
++      free(fragment_table_index);
+       return 1;
+ }
+@@ -808,11 +828,16 @@ int read_inode_lookup_table(int fd, stru
+ {
+       int lookup_bytes = SQUASHFS_LOOKUP_BYTES(sBlk->inodes);
+       int indexes = SQUASHFS_LOOKUP_BLOCKS(sBlk->inodes);
+-      long long index[indexes];
++      long long* index = malloc(indexes * sizeof(long long));
+       int res, i;
+-      if(sBlk->lookup_table_start == SQUASHFS_INVALID_BLK)
++      if(index == NULL)
++              MEM_ERROR();
++
++      if(sBlk->lookup_table_start == SQUASHFS_INVALID_BLK) {
++              free(index);
+               return 1;
++      }
+       *inode_lookup_table = malloc(lookup_bytes);
+       if(*inode_lookup_table == NULL)
+@@ -824,6 +849,7 @@ int read_inode_lookup_table(int fd, stru
+               ERROR("Failed to read inode lookup table index\n");
+               ERROR("Filesystem corrupted?\n");
+               free(*inode_lookup_table);
++              free(index);
+               return 0;
+       }
+@@ -843,12 +869,14 @@ int read_inode_lookup_table(int fd, stru
+                               length);
+                       ERROR("Filesystem corrupted?\n");
+                       free(*inode_lookup_table);
++                      free(index);
+                       return 0;
+               }
+       }
+       SQUASHFS_INSWAP_LONG_LONGS(*inode_lookup_table, sBlk->inodes);
++      free(index);
+       return 1;
+ }
index 6ceb87a10d903ed9b61f18040bb7a8dbffee45ea..1136acb83ec799ad4d4b472c0ee0a779f0a954cb 100644 (file)
@@ -12,8 +12,8 @@ PKG_VERSION:=0.4
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://releases.stm32flash.googlecode.com/git
-PKG_MD5SUM:=ec9b5c8bae67f9a489786546d088bd14
+PKG_SOURCE_URL:=https://sourceforge.net/projects/stm32flash/files
+PKG_HASH:=023f28b01f644edc235c8815a4352e359d3ebdbe6368aaf6bbc28bab3e6ffa5b
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
 PKG_LICENSE:=GPL-2.0+
@@ -24,7 +24,7 @@ define Package/stm32flash
   SECTION:=utils
   CATEGORY:=Utilities
   SUBMENU:=Microcontroller programming
-  URL:=http://code.google.com/p/stm32flash/
+  URL:=https://sourceforge.net/projects/stm32flash
   TITLE:=Firmware flash tool for STM32's serial bootloader
 endef
 
index 1dc828c10f3c0c59d899d017357afec1ee406436..e5722293f5787a78b1e9a1c6a555214afdb188bd 100644 (file)
@@ -17,6 +17,7 @@ PKG_SOURCE_URL:=https://github.com/cernekee/stoken.git
 
 PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_MIRROR_HASH:=2f77c42b14a0b6b1e4d44dfd4d66b63ce6ed7484ca97debec0344f5c966e2e5c
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
 PKG_LICENSE:=LGPL-2.1
@@ -29,7 +30,7 @@ PKG_FIXUP:=autoreconf
 include $(INCLUDE_DIR)/package.mk
 
 define Package/stoken/Default
-  TITLE:=stoken is a tokencode generator compatible with RSA SecurID 128-bit (AES)
+  TITLE:=tokencode generator compatible with RSA SecurID 128-bit (AES)
   URL:=http://sourceforge.net/p/stoken/
   DEPENDS:= +libxml2 +libnettle
 endef
@@ -53,6 +54,8 @@ define Package/libstoken
   CATEGORY:=Libraries
 endef
 
+TARGET_LDFLAGS += -lz
+
 CONFIGURE_ARGS += \
        --with-nettle
 
index c1fbce3fdb2e16e0330c68e0f178378917710e8c..51fd7d1692549288ff6e39f546387cf1e603bb2c 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://people.seas.harvard.edu/~apw/stress/
-PKG_MD5SUM:=a607afa695a511765b40993a64c6e2f4
+PKG_HASH:=369c997f65e8426ae8b318d4fdc8e6f07a311cfa77cc4b25dace465c582163c0
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index 799d2251bc139a11763a4cc3172a4dae2925f416..67a6eab8e0054673ed3ac9a4bd6777387fab3f98 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-src-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/sumo
-PKG_MD5SUM:=0bb98ab7339aea15b14b633e1b74691f
+PKG_HASH:=4494190bd6570646df7a020befe25bc66355377273d922753685737c0d38bfdf
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=GPL-3.0
index 977eaf2b96fc5736eadd0115b1d4a3dd8fedb3d5..235f907e749d32a28d0ecf9805f3d0d36d752f69 100644 (file)
@@ -12,7 +12,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=7fff46c84b8c630ede5b0f0827e3d90a
+PKG_HASH:=06dc8816a225667ce1eee545af3caf87e1bbaa379c32838d4cea53152514348d
 PKG_INSTALL:=1
 
 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
index 3e9457b2585b809b32c4af1584cb8af21337e4cc..60df6f57992684821f61aa9c95f8ede67b2a1592 100644 (file)
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sysstat
-PKG_VERSION:=11.0.4
+PKG_VERSION:=11.6.0
 PKG_RELEASE:=2
 
 PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://perso.orange.fr/sebastien.godard/
-PKG_MD5SUM:=df1ed75656eb06320088d54247f0e803
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pagesperso-orange.fr/sebastien.godard/
+PKG_HASH:=14bb696545cba0d99e3492092c9ed15fe9b6da79df349695251b41d345e969a7
 
 PKG_INSTALL:=1
 
diff --git a/utils/sysstat/patches/110-remove-sccsid.patch b/utils/sysstat/patches/110-remove-sccsid.patch
new file mode 100644 (file)
index 0000000..05c1032
--- /dev/null
@@ -0,0 +1,131 @@
+From: Robert Luberda <robert@debian.org>
+Date: Wed, 9 Sep 2015 21:37:37 +0200
+Subject: Remove scscid()
+
+Remove sccsid() function togethwe with SCCSID string that
+contained __DATE__ and __TIME__ macros. This should cause
+binary to be more reproducible, see
+https://wiki.debian.org/ReproducibleBuilds/TimestampsFromCPPMacros
+---
+ cifsiostat.c | 3 ---
+ iostat.c     | 3 ---
+ mpstat.c     | 3 ---
+ pidstat.c    | 3 ---
+ sadc.c       | 3 ---
+ sadf.c       | 3 ---
+ sar.c        | 3 ---
+ tapestat.c   | 3 ---
+ 8 files changed, 24 deletions(-)
+
+diff --git a/cifsiostat.c b/cifsiostat.c
+index a3c81d0..4668a7c 100644
+--- a/cifsiostat.c
++++ b/cifsiostat.c
+@@ -41,9 +41,6 @@
+ #define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ unsigned long long uptime0[2] = {0, 0};
+ struct cifs_stats *st_cifs[2];
+ struct io_hdr_stats *st_hdr_cifs;
+diff --git a/iostat.c b/iostat.c
+index 7b346e2..a0199d2 100644
+--- a/iostat.c
++++ b/iostat.c
+@@ -48,9 +48,6 @@
+ #define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ struct stats_cpu *st_cpu[2];
+ unsigned long long uptime[2]  = {0, 0};
+ unsigned long long uptime0[2] = {0, 0};
+diff --git a/mpstat.c b/mpstat.c
+index 1c83ea2..e4a040b 100644
+--- a/mpstat.c
++++ b/mpstat.c
+@@ -43,9 +43,6 @@
+ #define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": "  __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ unsigned long long uptime[3] = {0, 0, 0};
+ unsigned long long uptime0[3] = {0, 0, 0};
+diff --git a/pidstat.c b/pidstat.c
+index 876635c..5372176 100644
+--- a/pidstat.c
++++ b/pidstat.c
+@@ -47,9 +47,6 @@
+ #define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ unsigned long long uptime[3] = {0, 0, 0};
+ unsigned long long uptime0[3] = {0, 0, 0};
+ struct pid_stats *st_pid_list[3] = {NULL, NULL, NULL};
+diff --git a/sadc.c b/sadc.c
+index 7cdbc38..bfb4dac 100644
+--- a/sadc.c
++++ b/sadc.c
+@@ -52,9 +52,6 @@
+ #include "sensors/error.h"
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ long interval = 0;
+ unsigned int flags = 0;
+diff --git a/sadf.c b/sadf.c
+index 160b485..0c0017c 100644
+--- a/sadf.c
++++ b/sadf.c
+@@ -41,9 +41,6 @@
+ # define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ long interval = -1, count = 0;
+ unsigned int flags = 0;
+diff --git a/sar.c b/sar.c
+index ccf426e..07a9b4a 100644
+--- a/sar.c
++++ b/sar.c
+@@ -42,9 +42,6 @@
+ #define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ /* Interval and count parameters */
+ long interval = -1, count = 0;
+diff --git a/tapestat.c b/tapestat.c
+index 268e4a5..df0a01b 100644
+--- a/tapestat.c
++++ b/tapestat.c
+@@ -58,9 +58,6 @@
+ #define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ int cpu_nr = 0;               /* Nb of processors on the machine */
+ int flags = 0;                /* Flag for common options and system state */
index 45befbf3a8efa1e1845b845bae6f7eeaa85bfbbd..fb5277091b741245923dc9f5b6598dbf07f0783c 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008-2016 OpenWrt.org
+# Copyright (C) 2008-2017 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:=tar
-PKG_VERSION:=1.29
-PKG_RELEASE:=3
+PKG_VERSION:=1.30
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=955cd533955acb1804b83fd70218da51
+PKG_HASH:=f1bf92dbb1e1ab27911a861ea8dde8208ee774866c46c0bb6ead41f4d1f4d2d3
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=GPL-3.0
diff --git a/utils/tar/patches/001-CVE-2016-6321.patch b/utils/tar/patches/001-CVE-2016-6321.patch
deleted file mode 100644 (file)
index 0783473..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From 7340f67b9860ea0531c1450e5aa261c50f67165d Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@Penguin.CS.UCLA.EDU>
-Date: Sat, 29 Oct 2016 21:04:40 -0700
-Subject: When extracting, skip ".." members
-
-* src/extract.c (extract_archive): Skip members whose names
-contain "..".
---- a/src/extract.c
-+++ b/src/extract.c
-@@ -1629,12 +1629,20 @@ extract_archive (void)
- {
-   char typeflag;
-   tar_extractor_t fun;
-+  bool skip_dotdot_name;
-   fatal_exit_hook = extract_finish;
-   set_next_block_after (current_header);
-+  skip_dotdot_name = (!absolute_names_option
-+                    && contains_dot_dot (current_stat_info.orig_file_name));
-+  if (skip_dotdot_name)
-+    ERROR ((0, 0, _("%s: Member name contains '..'"),
-+          quotearg_colon (current_stat_info.orig_file_name)));
-+
-   if (!current_stat_info.file_name[0]
-+      || skip_dotdot_name
-       || (interactive_option
-         && !confirm ("extract", current_stat_info.file_name)))
-     {
index a417a45b0682166fd864a887c378eb3531269c3d..1aa563713b58ccf290870b3db81424390c5b009a 100644 (file)
@@ -15,7 +15,7 @@ PKG_LICENSE:=MIT
 
 PKG_SOURCE:=task-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.taskwarrior.org/download/
-PKG_MD5SUM:=517450c4a23a5842df3e9905b38801b3
+PKG_HASH:=7ff406414e0be480f91981831507ac255297aab33d8246f98dbfd2b1b2df8e3b
 PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/task-$(PKG_VERSION)
index 7b0d188acb1ad11a7a0e15e458300821d716c727..4f22824752697fa1835ebabba5490a6ae75851d8 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2011-2016 OpenWrt.org
+# Copyright (C) 2011-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tcsh
 PKG_VERSION:=6.20.00
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= \
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:= \
        http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/old/ \
        ftp://ftp.astron.com/pub/tcsh/ \
        ftp://ftp.astron.com/pub/tcsh/old
-PKG_MD5SUM:=59d40ef40a68e790d95e182069431834
+PKG_HASH:=b89de7064ab54dac454a266cfe5d8bf66940cb5ed048d0c30674ea62e7ecef9d
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=Copyright
diff --git a/utils/tcsh/patches/001-sysmalloc.patch b/utils/tcsh/patches/001-sysmalloc.patch
new file mode 100644 (file)
index 0000000..b22c018
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/config_f.h               
++++ b/config_f.h
+@@ -139,11 +139,8 @@
+  *            This can be much slower and no memory statistics will be
+  *            provided.
+  */
+-#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__) || defined (__CYGWIN__) || defined(__GLIBC__) || defined(__OpenBSD__) || defined(__APPLE__) || defined (__ANDROID__)
++
+ # define SYSMALLOC
+-#else
+-# undef SYSMALLOC
+-#endif
+ /*
+  * USE_ACCESS Use access(2) rather than stat(2) when POSIX is defined.
diff --git a/utils/tio/Makefile b/utils/tio/Makefile
new file mode 100644 (file)
index 0000000..90d93b4
--- /dev/null
@@ -0,0 +1,42 @@
+#
+# Copyright (C) 2017-2018 Daniel Engberg <daniel.engberg.lists@pyret.net>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=tio
+PKG_VERSION:=1.28
+PKG_RELEASE:=1
+PKG_MAINTAINER:=
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE_URL:=https://github.com/$(PKG_NAME)/$(PKG_NAME)/releases/download/v$(PKG_VERSION)/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_HASH:=bb5fa22b2ca5c2eeb811f57e1af45ae5a2b852eed1aabbeb3a419cc3b4d4d22a
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tio
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=A simple TTY terminal I/O application
+  URL:=https://tio.github.io/
+  SUBMENU:=Terminal
+endef
+
+define Package/tio/description
+  A small and simple TTY terminal I/O application
+endef
+
+define Package/tio/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tio $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,tio))
index 593a9c02fbac51387fcbca0bef3a9ab124f61004..f99b7bc867818e315ca01472a71f0d876ca2389f 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tmux
-PKG_VERSION:=2.3
+PKG_VERSION:=2.6
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/tmux/tmux/releases/download/$(PKG_VERSION)
-PKG_MD5SUM:=55313e132f0f42de7e020bf6323a1939ee02ab79c48634aa07475db41573852b
+PKG_HASH:=b17cd170a94d7b58c0698752e1f4f263ab6dc47425230df7e53a6435cc7cd7e8
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 
 PKG_LICENSE:=ISC
@@ -21,6 +21,7 @@ PKG_LICENSE_FILES:=COPYING
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -30,17 +31,13 @@ define Package/tmux
   SUBMENU:=Terminal
   TITLE:=Terminal multiplexer
   DEPENDS:=+libncurses +libevent2 +libpthread +librt
-  URL:=http://tmux.sourceforge.net/
+  URL:=http://tmux.github.io/
 endef
 
 define Package/tmux/description
   tmux is a modern, BSD-licensed alternative to GNU screen.
 endef
 
-MAKE_FLAGS += \
-       PREFIX="/usr" \
-       PLATFORM="linux"
-
 define Package/tmux/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tmux $(1)/usr/bin/
diff --git a/utils/tmux/patches/100-b64_ntop-conflict.patch b/utils/tmux/patches/100-b64_ntop-conflict.patch
deleted file mode 100644 (file)
index 5afc9b7..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-diff --git a/compat.h b/compat.h
-index 8666a1d..2a44a2b 100644
---- a/compat.h
-+++ b/compat.h
-@@ -223,7 +223,9 @@ int                 daemon(int, int);
- #ifndef HAVE_B64_NTOP
- /* b64_ntop.c */
- #undef b64_ntop /* for Cygwin */
--int            b64_ntop(const char *, size_t, char *, size_t);
-+int            local_b64_ntop(const char *, size_t, char *, size_t);
-+#else
-+#define local_b64_ntop b64_ntop
- #endif
- #ifndef HAVE_FORKPTY
-diff --git a/compat/b64_ntop.c b/compat/b64_ntop.c
-index 2b4dc2d..a1314ca 100644
---- a/compat/b64_ntop.c
-+++ b/compat/b64_ntop.c
-@@ -122,7 +122,7 @@ static const char Pad64 = '=';
-    */
- int
--b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) {
-+local_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) {
-       size_t datalength = 0;
-       uint8_t input[3];
-       uint8_t output[4];
-diff --git a/tty.c b/tty.c
-index 7be952c..06dedab 100644
---- a/tty.c
-+++ b/tty.c
-@@ -1134,7 +1134,7 @@ tty_cmd_setselection(struct tty *tty, const struct tty_ctx *ctx)
-       off = 4 * ((ctx->num + 2) / 3) + 1; /* storage for base64 */
-       buf = xmalloc(off);
--      b64_ntop(ctx->ptr, ctx->num, buf, off);
-+      local_b64_ntop(ctx->ptr, ctx->num, buf, off);
-       tty_putcode_ptr2(tty, TTYC_MS, "", buf);
-       free(buf);
index 9a0bc7a3d288cf48864d8c1aaccc1ca52c5a4d26..36e66f0b5e8bd9a44836a0c6cb0c859f35cdf74e 100644 (file)
@@ -19,6 +19,7 @@ PKG_SOURCE_URL:=https://github.com/dangowrt/tracertools.git
 PKG_SOURCE_VERSION:=28d0bb9a10a0b56b4964e3256135cfd152075a59
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=aac4f73d7d606b54e58f0ebc4b1cd1d86b29914d8c924c97c81501a677d91451
 
 PKG_INSTALL:=1
 
diff --git a/utils/tree/Makefile b/utils/tree/Makefile
new file mode 100644 (file)
index 0000000..32bdb0a
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 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:=tree
+PKG_RELEASE:=2
+PKG_VERSION:=1.7.0
+PKG_SOURCE_URL:=ftp://mama.indstate.edu/linux/tree/
+PKG_HASH:=6957c20e82561ac4231638996e74f4cfa4e6faabc5a2f511f0b4e3940e8f7b12
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_MAINTAINER:=Banglang Huang <banglang.huang@foxmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tree
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=List contents of directories in a tree-like format
+  DEPENDS:=+libc +libgcc
+endef
+
+MAKE_FLAGS += \
+       CFLAGS="$(TARGET_CFLAGS)" \
+       LDFLAGS="$(TARGET_LDFLAGS)"
+
+define Package/tree/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/tree $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,tree))
index 97c6e90315d87c29d7eb55d427fe2a9d7ea960ed..e25b868dd32a7be12bdd48de1e71a1453f88a70c 100644 (file)
@@ -8,18 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=triggerhappy
-PKG_VERSION:=0.3.4-151001
-PKG_REV:=7e5abc69f215678e93a6b999524981c8b40bdcd9
+PKG_VERSION:=0.5.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=git://github.com/wertarbyte/triggerhappy
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_SOURCE_URL:=https://github.com/wertarbyte/$(PKG_NAME)/archive/release/$(PKG_VERSION)/
+PKG_HASH:=af0fc196202f2d35153be401769a9ad9107b5b6387146cfa8895ae9cafad631c
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-release-$(PKG_VERSION)
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
-PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/utils/ttyd/Makefile b/utils/ttyd/Makefile
new file mode 100644 (file)
index 0000000..bc99502
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2016 Shuanglei Tao <tsl0922@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ttyd
+PKG_VERSION:=1.3.3+git-04d5bc
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/tsl0922/ttyd.git
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=04d5bc1ecb59667d025a94e1967a83c24141f911
+PKG_MIRROR_HASH=87ea900f7bf67daf5131ecfcec0917e175d168ce52771012139c06dbafcc641d
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+CMAKE_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/ttyd
+       SECTION:=utils
+       CATEGORY:=Utilities
+       TITLE:=Command-line tool for sharing terminal over the web
+       DEPENDS:=+libopenssl +libjson-c +libpthread +libwebsockets-openssl
+       URL:=https://github.com/tsl0922/ttyd
+       SUBMENU:=Terminal
+       MAINTAINER:=Shuanglei Tao <tsl0922@gmail.com>
+endef
+
+define Package/ttyd/description
+ttyd is a command-line tool for sharing terminal over the web.
+endef
+
+define Package/ttyd/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ttyd $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,ttyd))
diff --git a/utils/uledd/Makefile b/utils/uledd/Makefile
new file mode 100644 (file)
index 0000000..b698333
--- /dev/null
@@ -0,0 +1,32 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=uledd
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=https://github.com/blogic/uledd.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=bc94c7e52009f7ec33b23652502b4754351d8040
+PKG_MIRROR_HASH:=23a407197d6a423bb0b32f381e93ad3676e15f07465d7b53c843a2b510c7c284
+PKG_MAINTAINER:=John Crispin <john@phrozen.org>
+PKG_LICENSE:=GPL-2.0
+
+CMAKE_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/uledd
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libubox +libubus
+  TITLE:=PWM/RGB LED ubus frontend
+endef
+
+define Package/uledd/install
+       $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d
+
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/uledd $(1)/sbin/
+       $(INSTALL_BIN) ./files/uledd.init $(1)/etc/init.d/uledd
+endef
+
+$(eval $(call BuildPackage,uledd))
diff --git a/utils/uledd/files/uledd.init b/utils/uledd/files/uledd.init
new file mode 100644 (file)
index 0000000..b179267
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh /etc/rc.common
+
+START=95
+
+USE_PROCD=1
+PROG=/sbin/uledd
+
+start_service() {
+       procd_open_instance
+       procd_set_param command "$PROG"
+       procd_set_param respawn
+       procd_close_instance
+}
index 93a4dcffcb382bdaec3eb36eb643e58e0f9bc663..fd8f74b7c34b7841d94fda04ab74ec5b5e84e2b8 100644 (file)
@@ -10,11 +10,11 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=unzip
 PKG_REV:=60
 PKG_VERSION:=6.0
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE:=$(PKG_NAME)$(PKG_REV).tar.gz
 PKG_SOURCE_URL:=@SF/infozip
-PKG_MD5SUM:=62b490407489521db863b523a7f86375
+PKG_HASH:=036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=BSD-4-Clause
diff --git a/utils/unzip/patches/010-remove-build-date.patch b/utils/unzip/patches/010-remove-build-date.patch
new file mode 100644 (file)
index 0000000..bb60533
--- /dev/null
@@ -0,0 +1,17 @@
+From: Jérémy Bobbio <lunar@debian.org>
+Subject: Remove build date
+Bug-Debian: https://bugs.debian.org/782851
+ In order to make unzip build reproducibly, we remove the
+ (already optional) build date from the binary.
+
+--- a/unix/unix.c
++++ b/unix/unix.c
+@@ -1705,7 +1705,7 @@
+ #endif /* Sun */
+ #endif /* SGI */
+-#ifdef __DATE__
++#if 0
+       " on ", __DATE__
+ #else
+       "", ""
index b05563eb55e41ff6709abc5198c682c75d8afb96..aa6006d3bc25cc41f9948c3697aabb0de7ac123d 100644 (file)
@@ -20,6 +20,7 @@ PKG_SOURCE_URL:=https://github.com/libimobiledevice/usbmuxd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=35e5d48f29ae03b2b9686109e4ed9ab8b9677ce8
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=7c0d8ea230570344fbc0183c0171689c74baf3d75fff33bbdfca2d1775a4d62d
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index 7ab033c55a20b2e1ddb717dc08fb5c9933309251..7f57432391cb6f70d6096f7e76573208e734f41a 100644 (file)
@@ -9,10 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uvcdynctrl
 PKG_VERSION:=0.2.4
+PKG_REV:=2
 
 PKG_SOURCE:=libwebcam-src-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/libwebcam
-PKG_MD5SUM:=31dbb5713e95a699c5fc4dbe1493f764
+PKG_HASH:=91741aca11f079eb6d043e31b7da6fe1f7927c28d7496590386928f8466b4297
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/libwebcam-src-$(PKG_VERSION)
@@ -23,7 +24,7 @@ include $(INCLUDE_DIR)/cmake.mk
 define Package/uvcdynctrl
   SECTION:=utils
   CATEGORY:=Utilities
-  DEPENDS:=+libwebcam +PACKAGE_UVCDYNCTRL_UDEV_RULE:udev
+  DEPENDS:=+libwebcam
   TITLE:=Manage dynamic controls in uvcvideo
   URL:=http://sourceforge.net/projects/libwebcam/
   MENU:=1
@@ -35,16 +36,6 @@ define Package/uvcdynctrl/description
   - uvcdynctrl: Manage dynamic controls in uvcvideo (GPL)
 endef
 
-define Package/uvcdynctrl/config
-config PACKAGE_UVCDYNCTRL_UDEV_RULE
-       bool "uvcdynctrl udev rule, selects udev"
-       depends on PACKAGE_uvcdynctrl
-       default no
-       help
-         Installs an udev rule to load uvcdynctrl with dynamic controls
-         from xml files in /usr/share/uvcdynctrl when a webcam is attached.
-endef
-
 define Package/libwebcam
   SECTION:=libs
   CATEGORY:=Libraries
@@ -64,12 +55,6 @@ define Package/uvcdynctrl/install
        $(INSTALL_DIR) $(1)/usr/{bin,share}
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/uvcdynctrl* $(1)/usr/bin/
        $(CP) $(PKG_INSTALL_DIR)/usr/share/uvcdynctrl/ $(1)/usr/share/
-
-ifeq ($(CONFIG_PACKAGE_UVCDYNCTRL_UDEV_RULE),y)
-       $(INSTALL_DIR) $(1)/lib/udev/rules.d
-       $(CP) $(PKG_INSTALL_DIR)/lib/udev/rules.d/*.rules $(1)/lib/udev/rules.d/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/udev/uvcdynctrl $(1)/lib/udev/
-endif
 endef
 
 define Package/libwebcam/install
index 2e9f96a8b62cdcaa852446d36316d6d5f203c193..2480c26572c98a324b7dcb11672eef88a5d26ca0 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=vim
-PKG_VERSION:=7.4
-PKG_RELEASE:=3
-VIMVER:=74
+PKG_VERSION:=8.0.586
+PKG_RELEASE:=2
+VIMVER:=80
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.vim.org/pub/vim/unix/
-PKG_MD5SUM:=607e135c559be642f210094ad023dc65
+PKG_HASH:=08bd0d1dd30ece3cb9905ccd48b82b2f81c861696377508021265177dc153a61
 PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)$(VIMVER)
@@ -41,6 +41,12 @@ define Package/vim-full
   TITLE+= (Normal)
 endef
 
+
+define Package/vim-fuller
+  $(call Package/vim/Default)
+  TITLE+= (Big)
+endef
+
 define Package/vim-runtime
   $(call Package/vim/Default)
   TITLE+= (runtime files)
@@ -78,6 +84,12 @@ define Package/vim-full/description
  (Normal build)
 endef
 
+
+define Package/vim-fuller/description
+ Vim is an almost compatible version of the UNIX editor Vi.
+ (Big build)
+endef
+
 define Package/vim-runtime/description
  Vim is an almost compatible version of the UNIX editor Vi.
  (Runtime files)
@@ -102,7 +114,8 @@ CONFIGURE_ARGS += \
        --disable-cscope \
        --disable-gpm \
        --disable-acl \
-       --with-tlib=ncurses
+       --with-tlib=ncurses \
+       --with-compiledby="non-existent-hostname-compiled"
 
 CONFIGURE_VARS += \
        vim_cv_getcwd_broken=no \
@@ -114,6 +127,11 @@ CONFIGURE_VARS += \
        vim_cv_tty_group=root \
        vim_cv_tty_mode=0620
 
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       $(MAKE) -C $(PKG_BUILD_DIR)/src autoconf
+endef
+
 ifneq ($(CONFIG_PACKAGE_vim),)
 define Build/Compile/vim
        $(call Build/Configure/Default, \
@@ -138,6 +156,20 @@ define Build/Compile/vim-full
 endef
 endif
 
+ifneq ($(CONFIG_PACKAGE_vim-fuller),)
+define Build/Compile/vim-fuller
+       $(call Build/Configure/Default, \
+               --with-features=big \
+               --enable-multibyte \
+       )
+       +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               DESTDIR="$(PKG_INSTALL_DIR)" all
+       $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_big
+endef
+endif
+
+
+
 ifneq ($(CONFIG_PACKAGE_xxd),)
 define Build/Compile/xxd
        +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
@@ -155,6 +187,7 @@ endef
 define Build/Compile
 $(call Build/Compile/vim)
 $(call Build/Compile/vim-full)
+$(call Build/Compile/vim-fuller)
 $(call Build/Compile/vim-runtime)
 $(call Build/Compile/xxd)
 endef
@@ -173,6 +206,17 @@ define Package/vim-full/install
        $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
 endef
 
+
+define Package/vim-fuller/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_big $(1)/usr/bin/vim
+       $(INSTALL_DIR) $(1)/usr/share/vim
+       $(CP) -r $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER) $(1)/usr/share/vim
+       $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
+endef
+
+
+
 define Package/vim-runtime/install
        $(CP) $(PKG_INSTALL_DIR)/* $(1)
        rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc
@@ -189,6 +233,7 @@ endef
 
 $(eval $(call BuildPackage,vim))
 $(eval $(call BuildPackage,vim-full))
+$(eval $(call BuildPackage,vim-fuller))
 $(eval $(call BuildPackage,vim-runtime))
 $(eval $(call BuildPackage,vim-help))
 $(eval $(call BuildPackage,xxd))
diff --git a/utils/vim/patches/001-compile.patch b/utils/vim/patches/001-compile.patch
deleted file mode 100644 (file)
index 6740f1a..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/src/auto/configure
-+++ b/src/auto/configure
-@@ -12294,37 +12294,8 @@ _ACEOF
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking uint32_t is 32 bits" >&5
- $as_echo_n "checking uint32_t is 32 bits... " >&6; }
--if test "$cross_compiling" = yes; then :
--  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check uint32_t when cross-compiling." >&5
--$as_echo "$as_me: WARNING: cannot check uint32_t when cross-compiling." >&2;}
--else
--  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h.  */
--
--#ifdef HAVE_STDINT_H
--# include <stdint.h>
--#endif
--#ifdef HAVE_INTTYPES_H
--# include <inttypes.h>
--#endif
--main() {
--  uint32_t nr1 = (uint32_t)-1;
--  uint32_t nr2 = (uint32_t)0xffffffffUL;
--  if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) exit(1);
--  exit(0);
--}
--_ACEOF
--if ac_fn_c_try_run "$LINENO"; then :
--  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming ok" >&5
- $as_echo "ok" >&6; }
--else
--  as_fn_error "WRONG!  uint32_t not defined correctly." "$LINENO" 5
--fi
--rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
--  conftest.$ac_objext conftest.beam conftest.$ac_ext
--fi
--
--
- bcopy_test_prog='
- #include "confdefs.h"
diff --git a/utils/vim/patches/001-support-defining-compilation-date-in-SOURCE_DATE_EPOCH.patch b/utils/vim/patches/001-support-defining-compilation-date-in-SOURCE_DATE_EPOCH.patch
new file mode 100644 (file)
index 0000000..220539c
--- /dev/null
@@ -0,0 +1,81 @@
+From: James McCoy <jamessan@jamessan.com>
+Date: Thu, 28 Jan 2016 10:55:11 -0500
+Subject: Support defining compilation date in $SOURCE_DATE_EPOCH
+
+There is an ongoing effort[0] to make FOSS software reproducibly
+buildable.  In order to make Vim build reproducibly, it is necessary to
+allow defining the date/time that is part of VIM_VERSION_LONG as part of
+the build process.
+
+This commit enables that by adding support for the SOURCE_DATE_EPOCH
+spec[1].  When the $SOURCE_DATE_EPOCH environment variable is defined,
+it will be used to populate the BUILD_DATE preprocessor define.
+
+If BUILD_DATE is not defined, the existing behavior of relying on the
+preprocessor's __DATE__/__TIME__ symbols will be used.
+
+[0]: https://reproducible-builds.org/
+[1]: https://reproducible-builds.org/specs/source-date-epoch/
+---
+ src/config.h.in  |  3 +++
+ src/configure.ac | 10 ++++++++++
+ src/version.c    |  6 ++++++
+ 3 files changed, 19 insertions(+)
+
+diff --git a/src/config.h.in b/src/config.h.in
+index e692d40..d3aa1a2 100644
+--- a/src/config.h.in
++++ b/src/config.h.in
+@@ -30,6 +30,9 @@
+ /* Define when __DATE__ " " __TIME__ can be used */
+ #undef HAVE_DATE_TIME
++/* Defined as the date of last modification */
++#undef BUILD_DATE
++
+ /* Define when __attribute__((unused)) can be used */
+ #undef HAVE_ATTRIBUTE_UNUSED
+diff --git a/src/configure.ac b/src/configure.ac
+index e287124..5a16797 100644
+--- a/src/configure.ac
++++ b/src/configure.ac
+@@ -29,6 +29,16 @@ dnl in autoconf needs it, where it uses STDC_HEADERS.
+ AC_HEADER_STDC
+ AC_HEADER_SYS_WAIT
++dnl If $SOURCE_DATE_EPOCH is present in the environment, use that as the
++dnl "compiled" timestamp in :version's output.  Attempt to get the formatted
++dnl date using GNU date syntax, BSD date syntax, and finally falling back to
++dnl just using the current time.
++if test -n "$SOURCE_DATE_EPOCH"; then
++  DATE_FMT="%b %d %Y %H:%M:%S"
++  BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || LC_ALL=C date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || LC_ALL=C date -u "+$DATE_FMT")
++  AC_DEFINE_UNQUOTED(BUILD_DATE, ["$BUILD_DATE"])
++fi
++
+ dnl Check for the flag that fails if stuff are missing.
+ AC_MSG_CHECKING(--enable-fail-if-missing argument)
+diff --git a/src/version.c b/src/version.c
+index 65f5a4b..9422657 100644
+--- a/src/version.c
++++ b/src/version.c
+@@ -44,11 +44,17 @@ make_version(void)
+      * VAX C can't catenate strings in the preprocessor.
+      */
+     strcpy(longVersion, VIM_VERSION_LONG_DATE);
++#ifdef BUILD_DATE
++    strcat(longVersion, BUILD_DATE);
++#else
+     strcat(longVersion, __DATE__);
+     strcat(longVersion, " ");
+     strcat(longVersion, __TIME__);
++#endif
+     strcat(longVersion, ")");
+ }
++# elif defined(BUILD_DATE)
++char  *longVersion = VIM_VERSION_LONG_DATE BUILD_DATE ")";
+ # else
+ char  *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")";
+ # endif
index d25c0c2a4d14b38ae54f9f3bcb72474e97164d32..fff7c4a1a1f7edf342f6e3076edf9debf8f2866c 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=watchcat
 PKG_VERSION:=1
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
 PKG_LICENSE:=GPL-2.0
index d6f954e9e5617098904b9bd06e68c14b04e594bb..213186063410a92ba2062be6377cc28d9e4f3d12 100644 (file)
@@ -83,7 +83,7 @@ stop() {
 
                while read pid
                do
-                       kill "$pid"
+                       kill -KILL "$pid"
                done < "${PIDFILE}.pids"
 
                rm "${PIDFILE}.pids"
index c3536c2439ab6b9442f61612a577a3b74a40a0b6..9b1c6e74943c95ad1aed0d0f47c8038ab2de2411 100644 (file)
@@ -15,7 +15,7 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/lzmautils \
                http://tukaani.org/xz
-PKG_MD5SUM:=fd9ca16de1052aac899ad3495ad20dfa906c27b4a5070102a2ec35ca3a4740c1
+PKG_HASH:=fd9ca16de1052aac899ad3495ad20dfa906c27b4a5070102a2ec35ca3a4740c1
 
 PKG_LICENSE:=Public-Domain LGPL-2.1+ GPL-2.0+ GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
diff --git a/utils/yara/Config.in b/utils/yara/Config.in
new file mode 100644 (file)
index 0000000..76e83db
--- /dev/null
@@ -0,0 +1,16 @@
+if PACKAGE_yara
+       comment "Optional modules"
+
+       config YARA_module_magic
+               bool "Magic module"
+               default y
+               help
+                 Identify the type of the file based on the output of file command
+
+       config YARA_module_cuckoo
+               bool "Cuckoo module"
+               default n
+               help
+                 Create rules based on behavioral info generated by a Cuckoo sandbox
+endif
+
diff --git a/utils/yara/Makefile b/utils/yara/Makefile
new file mode 100644 (file)
index 0000000..a15f78f
--- /dev/null
@@ -0,0 +1,71 @@
+#
+# Copyright (C) 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:=yara
+PKG_VERSION:=3.7.0
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/VirusTotal/yara/archive/v$(PKG_VERSION)/
+PKG_HASH:=01f0841e7387918c2b6d0b7fb48014bda41d1487be1cabf718a0576018969641
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/yara
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Pattern matching swiss knife for malware researchers
+  URL:=http://virustotal.github.io/yara/
+  MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
+  DEPENDS:= +libopenssl
+  DEPENDS+= +YARA_module_magic:libmagic
+  DEPENDS+= +YARA_module_cuckoo:jansson
+  MENU:=1
+endef
+
+define Package/yara/description
+  YARA is a tool aimed at (but not limited to) helping malware researchers
+  to identify and classify malware samples. With YARA you can create
+  descriptions of malware families based on textual or binary patterns.
+endef
+
+CONFIGURE_ARGS += \
+       --disable-dotnet \
+       $(if $(YARA_module_magic),--enable,--disable)-magic \
+       $(if $(YARA_module_cuckoo),--enable,--disable)-cuckoo
+
+define Package/yara/config
+       source "$(SOURCE)/Config.in"
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/yara.h $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/include/yara
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/yara/* $(1)/usr/include/yara
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyara.{a,la,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/yara.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/yara/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/yara $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/yarac $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyara.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,yara))
index ae492325260af965d25b731bcd5b58fe99c2bcf3..427e07ec7c0b73d81d8617d1369718f31ad781f0 100644 (file)
@@ -17,6 +17,7 @@ PKG_SOURCE_URL:=https://github.com/arduino/YunBridge.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=f2042052115e71ad2c91f77e78d21db8275fcdd6
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=367db3667c6d2d8e20a0a214895e1bf2546918b008d084c3e7ca1adba9527dda
 
 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
 PKG_LICENSE:=GPL-2.0
index 0bd948791fffc221b1b93c6dbaced88dcb05bff6..06d5d2ff6ef6d46c5bbb62ee39f02883425150e1 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/zile
-PKG_MD5SUM:=fe77d801ba69e0fb9b4914a04b9ff506
+PKG_HASH:=218bb2af414c6a168101656631a5b2da92f20a965895e1006658cc658b0b7e89
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=GPL-3.0+
index 6427dda926844f58c59a6ecee9fa1b6579b86c20..c87f1ed84f16f96d1cee6f75eaa44d4345f2fbfb 100644 (file)
@@ -10,19 +10,21 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=zip
 PKG_REV:=30
 PKG_VERSION:=3.0
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)$(PKG_REV).tar.gz
 PKG_SOURCE_URL:=@SF/infozip
-PKG_MD5SUM:=7b74551e63f8ee6aab6fbc86676c0d37
+PKG_HASH:=f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=BSD-4-Clause
 PKG_LICENSE_FILES:=LICENSE
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/zip$(PKG_REV)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)/zip$(PKG_REV)
 PKG_CHECK_FORMAT_SECURITY:=0
 
+include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
 
 define Package/zip
@@ -58,4 +60,14 @@ define Package/zip/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
 endef
 
+define Host/Compile
+       +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) -I. -f unix/Makefile generic 
+endef
+
+define Host/Install
+       $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/zip $(STAGING_DIR_HOSTPKG)/bin/
+endef
+
+$(eval $(call HostBuild))
 $(eval $(call BuildPackage,zip))
diff --git a/utils/zip/patches/010-remove-build-date.patch b/utils/zip/patches/010-remove-build-date.patch
new file mode 100644 (file)
index 0000000..d7165cd
--- /dev/null
@@ -0,0 +1,15 @@
+From: Santiago Vila <sanvila@debian.org>
+Subject: Remove (optional) build date to make the build reproducible
+Bug-Debian: http://bugs.debian.org/779042
+
+--- a/unix/unix.c
++++ b/unix/unix.c
+@@ -1020,7 +1020,7 @@
+ /* Define the compile date string */
+-#ifdef __DATE__
++#if 0
+ #  define COMPILE_DATE " on " __DATE__
+ #else
+ #  define COMPILE_DATE ""
index cd334f2db737e680e1bd15103e9e694c150df031..0dffe867ad4634c6ccb177bf523487a4631f0064 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2016 OpenWrt.org
+# Copyright (C) 2007-2018 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,8 +9,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zoneinfo
-PKG_VERSION:=2016j
-PKG_VERSION_CODE:=2016j
+PKG_VERSION:=2018c
+PKG_VERSION_CODE:=2018c
 PKG_RELEASE:=1
 
 #As i couldn't find real license used "Public Domain"
@@ -20,14 +20,14 @@ PKG_LICENSE:=Public Domain
 PKG_SOURCE:=tzdata$(PKG_VERSION).tar.gz
 PKG_SOURCE_CODE:=tzcode$(PKG_VERSION_CODE).tar.gz
 PKG_SOURCE_URL:=http://www.iana.org/time-zones/repository/releases
-PKG_MD5SUM:=db361d005ac8b30a2d18c5ca38d3e8ab
+PKG_HASH:=2825c3e4b7ef520f24d393bcc02942f9762ffd3e7fc9b23850789ed8f22933f6
 
 include $(INCLUDE_DIR)/package.mk
 
 define Download/tzcode
    FILE=$(PKG_SOURCE_CODE)
    URL=$(PKG_SOURCE_URL)
-   MD5SUM:=0684b98eb184fab250b6ca946862078d
+   HASH:=31fa7fc0f94a6ff2d6bc878c0a35e8ab8b5aa0e8b01445a1d4a8f14777d0e665
 endef
 
 $(eval $(call Download,tzcode))
@@ -110,7 +110,7 @@ define Build/Compile
                $(HOST_CONFIGURE_OPTS) \
                CC="$(HOSTCC)" \
                LD="\$$$$(CC)" \
-               CPPFLAGS="$(HOST_CPPFLAGS)" \
+               CPPFLAGS="$(HOST_CPPFLAGS) -DHAVE_SNPRINTF=1" \
                LDFLAGS="$(HOST_LDFLAGS)" \
                TOPDIR="$(PKG_INSTALL_DIR)" \
                TZDIR="$(PKG_INSTALL_DIR)/zoneinfo" \
index 8bd4fcd7b1541ebc0e7cb86c0e4b814b24ed87d5..4c6c961404432115a728478002d19911b76a6cd9 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zsh
-PKG_VERSION:=5.2
+PKG_VERSION:=5.4.2
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/zsh
-PKG_MD5SUM:=afe96fde08b70e23c1cab1ca7a68fb34
+PKG_HASH:=957bcdb2c57f64c02f673693ea5a7518ef24b6557aeb3a4ce222cefa6d74acc9
 PKG_MAINTAINER:=Vadim A. Misbakh-Soloviov <openwrt-zsh@mva.name>
 PKG_LICENSE:=ZSH
 
@@ -26,7 +26,7 @@ define Package/zsh
   CATEGORY:=Utilities
   SUBMENU:=Shells
   TITLE:=The Z shell
-  DEPENDS:=+libncurses +libncursesw +libpcre +librt
+  DEPENDS:=+libcap +libncurses +libncursesw +libpcre +librt
   URL:=http://www.zsh.org/
 endef
 
@@ -41,14 +41,26 @@ endef
 
 define Build/Configure
        $(call Build/Configure/Default, \
-               --bindir=/bin \
                --disable-etcdir \
                --disable-gdbm \
+               --enable-dynamic \
+               --enable-libc-musl \
                --enable-pcre \
+               --enable-cap \
                --enable-multibyte \
+               --enable-unicode9 \
+               --enable-runhelpdir=$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/help \
+               --enable-fndir=$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/functions \
+               --enable-site-fndir=$(CONFIGURE_PREFIX)/share/zsh/site-functions \
                --enable-function-subdirs \
                --with-tcsetpgrp \
                --with-term-lib="ncursesw", \
+               zsh_cv_shared_environ=yes \
+               zsh_cv_sys_dynamic_clash_ok=yes\
+               zsh_cv_sys_dynamic_execsyms=yes \
+               zsh_cv_sys_dynamic_rtld_global=yes \
+               zsh_cv_sys_dynamic_strip_exe=yes \
+               zsh_cv_sys_dynamic_strip_lib=yes \
                zsh_cv_sys_nis=no \
                zsh_cv_sys_nis_plus=no \
        )
@@ -70,14 +82,27 @@ endef
 define Package/zsh/postinst
 #!/bin/sh
 grep zsh $${IPKG_INSTROOT}/etc/shells || \
-       echo "/bin/zsh" >> $${IPKG_INSTROOT}/etc/shells
+       echo "/usr/bin/zsh" >> $${IPKG_INSTROOT}/etc/shells
+
+       # Backwards compatibility
+       if [[ -e /bin/zsh ]] && ([[ ! -L /bin/zsh ]] || [[ "$(readlink -fn $${IPKG_INSTROOT}/bin/zsh)" != "../$(CONFIGURE_PREFIX)/bin/zsh" ]]); then
+               ln -fs "../$(CONFIGURE_PREFIX)/bin/zsh" "$${IPKG_INSTROOT}/bin/zsh"
+       fi
 endef
 
 define Package/zsh/install
        $(INSTALL_DIR) $(1)/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/zsh $(1)/bin/
-       $(INSTALL_DIR) $(1)/usr/share/zsh/$(PKG_VERSION)
-       $(CP) $(PKG_INSTALL_DIR)/usr/share/zsh/$(PKG_VERSION)/* $(1)/usr/share/zsh/$(PKG_VERSION)/
+       $(INSTALL_DIR) $(1)/$(CONFIGURE_PREFIX)/bin
+       $(INSTALL_DIR) $(1)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)
+       $(INSTALL_DIR) $(1)/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)
+
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/$(CONFIGURE_PREFIX)/bin/zsh $(1)/$(CONFIGURE_PREFIX)/bin/
+       $(CP) $(PKG_INSTALL_DIR)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)/* $(1)/$(CONFIGURE_PREFIX)/lib/zsh/$(PKG_VERSION)/
+       $(CP) $(PKG_INSTALL_DIR)/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/* $(1)/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)/
+endef
+
+define Package/zsh/postrm
+       rm -rf "$${IPKG_INSTROOT}/$(CONFIGURE_PREFIX)/share/zsh/$(PKG_VERSION)"
 endef
 
 $(eval $(call BuildPackage,zsh))