Commit based upon d6442850bde61f0c3e7e2ae3247b4a856073c5e0
authorRISCi_ATOM <bob@bobcall.me>
Sat, 31 Mar 2018 16:47:15 +0000 (12:47 -0400)
committerRISCi_ATOM <bob@bobcall.me>
Sat, 31 Mar 2018 16:47:15 +0000 (12:47 -0400)
814 files changed:
lang/chardet/Makefile [new file with mode: 0644]
lang/django-appconf/Makefile [new file with mode: 0644]
lang/django-compressor/Makefile [new file with mode: 0644]
lang/django-constance/Makefile [new file with mode: 0644]
lang/django-jsonfield/Makefile [new file with mode: 0644]
lang/django-picklefield/Makefile [new file with mode: 0644]
lang/django-postoffice/Makefile [new file with mode: 0644]
lang/django-restframework/Makefile [new file with mode: 0644]
lang/django-statici18n/Makefile [new file with mode: 0644]
lang/django/Makefile [new file with mode: 0644]
lang/dkjson/Makefile [new file with mode: 0644]
lang/erlang/Makefile [new file with mode: 0644]
lang/erlang/patches/101-emulator_includes.patch [new file with mode: 0644]
lang/erlang/patches/102-musl_compat.patch [new file with mode: 0644]
lang/erlang/patches/103-disable_emacs.patch [new file with mode: 0644]
lang/et_xmlfile/Makefile [new file with mode: 0644]
lang/flup/Makefile [new file with mode: 0644]
lang/gunicorn/Makefile [new file with mode: 0644]
lang/jamvm/Makefile [new file with mode: 0644]
lang/jdcal/Makefile [new file with mode: 0644]
lang/json4lua/Makefile [new file with mode: 0644]
lang/lpeg/Makefile [new file with mode: 0644]
lang/lua-bencode/Makefile [new file with mode: 0644]
lang/lua-cjson/Makefile [new file with mode: 0644]
lang/lua-copas/Makefile [new file with mode: 0644]
lang/lua-copas/patches/makefile.patch [new file with mode: 0644]
lang/lua-coxpcall/Makefile [new file with mode: 0644]
lang/lua-coxpcall/patches/config.patch [new file with mode: 0644]
lang/lua-lsqlite3/Makefile [new file with mode: 0644]
lang/lua-lzlib/Makefile [new file with mode: 0644]
lang/lua-lzlib/patches/001-allow_optim_flags.patch [new file with mode: 0644]
lang/lua-md5/Makefile [new file with mode: 0644]
lang/lua-md5/patches/config.patch [new file with mode: 0644]
lang/lua-md5/patches/makefile.patch [new file with mode: 0644]
lang/lua-mobdebug/Makefile [new file with mode: 0644]
lang/lua-openssl/Makefile [new file with mode: 0644]
lang/lua-openssl/patches/0001-Revise-Makefile.patch [new file with mode: 0644]
lang/lua-openssl/patches/0010-Fix-Linkage.patch [new file with mode: 0644]
lang/lua-openssl/patches/0020-support-OPENSSL_NO_SSL3_METHOD.patch [new file with mode: 0644]
lang/lua-openssl/patches/0030-support-OPENSSL_NO_COMP.patch [new file with mode: 0644]
lang/lua-penlight/Makefile [new file with mode: 0644]
lang/lua-rings/Makefile [new file with mode: 0644]
lang/lua-rings/patches/config.patch [new file with mode: 0644]
lang/lua-rings/patches/makefile.patch [new file with mode: 0644]
lang/lua-rs232/Makefile [new file with mode: 0644]
lang/lua-sha2/Makefile [new file with mode: 0644]
lang/lua-sha2/patches/001-makefile.patch [new file with mode: 0644]
lang/lua-wsapi/Makefile [new file with mode: 0644]
lang/lua-xavante/Makefile [new file with mode: 0644]
lang/luabitop/Makefile [new file with mode: 0644]
lang/luaexpat/Makefile [new file with mode: 0644]
lang/luaexpat/files/compat-5.1r5/compat-5.1.c [new file with mode: 0644]
lang/luaexpat/files/compat-5.1r5/compat-5.1.h [new file with mode: 0644]
lang/luaexpat/files/compat-5.1r5/compat-5.1.lua [new file with mode: 0644]
lang/luafilesystem/Makefile [new file with mode: 0644]
lang/luai2c/Makefile [new file with mode: 0755]
lang/lualanes/Makefile [new file with mode: 0644]
lang/lualanes/patches/100-musl-compat.patch [new file with mode: 0644]
lang/luaposix/Makefile [new file with mode: 0644]
lang/luaposix/patches/100-eglibc-compat.patch [new file with mode: 0644]
lang/luaposix/patches/101-disable-curses.patch [new file with mode: 0644]
lang/luaposix/patches/102-disable-compat-deprecated.diff [new file with mode: 0644]
lang/luarocks/Makefile [new file with mode: 0644]
lang/luarocks/patches/01_dont_modify_bin_shebang.diff [new file with mode: 0644]
lang/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch [new file with mode: 0644]
lang/luasec/Makefile [new file with mode: 0644]
lang/luasoap/Makefile [new file with mode: 0644]
lang/luasocket/Makefile [new file with mode: 0644]
lang/luasocket/patches/0001-Add-interface-support.patch [new file with mode: 0644]
lang/luasql/Makefile [new file with mode: 0644]
lang/lzmq/Makefile [new file with mode: 0644]
lang/micropython-lib/Makefile [new file with mode: 0644]
lang/micropython/Makefile [new file with mode: 0644]
lang/micropython/patches/000-Makefile-no-errors [new file with mode: 0644]
lang/node-arduino-firmata/Makefile [new file with mode: 0644]
lang/node-arduino-firmata/files/usr/lib/node/arduino-firmata/lib/arduino-firmata.js [new file with mode: 0644]
lang/node-arduino-firmata/patches/000-new-serialport.patch [new file with mode: 0644]
lang/node-cylon/Makefile [new file with mode: 0644]
lang/node-cylon/patches/0001-serialport.patch [new file with mode: 0644]
lang/node-hid/Makefile [new file with mode: 0644]
lang/node-serialport/Makefile [new file with mode: 0644]
lang/node/Makefile [new file with mode: 0644]
lang/node/patches/001-hardfloat.patch [new file with mode: 0644]
lang/node/patches/002-addr_info.patch [new file with mode: 0644]
lang/node/patches/003-path.patch [new file with mode: 0644]
lang/openpyxl/Makefile [new file with mode: 0644]
lang/perl-cgi/Makefile [new file with mode: 0644]
lang/perl-compress-bzip2/Makefile [new file with mode: 0644]
lang/perl-dbi/Makefile [new file with mode: 0644]
lang/perl-device-serialport/Makefile [new file with mode: 0644]
lang/perl-device-usb/Makefile [new file with mode: 0644]
lang/perl-device-usb/README.patches [new file with mode: 0644]
lang/perl-device-usb/patches/100-fix_buildsystem.patch [new file with mode: 0644]
lang/perl-device-usb/patches/110-just_assume_libusb_is_there.diff [new file with mode: 0644]
lang/perl-device-usb/patches/120-use_libusb_0_1.patch [new file with mode: 0644]
lang/perl-device-usb/patches/130-provide-proper-library-paths.patch [new file with mode: 0644]
lang/perl-device-usb/patches/140-avoid-libusb-name-conflicts.patch [new file with mode: 0644]
lang/perl-encode-locale/Makefile [new file with mode: 0644]
lang/perl-file-listing/Makefile [new file with mode: 0644]
lang/perl-file-sharedir-install/Makefile [new file with mode: 0644]
lang/perl-html-form/Makefile [new file with mode: 0644]
lang/perl-html-parser/Makefile [new file with mode: 0644]
lang/perl-html-tagset/Makefile [new file with mode: 0644]
lang/perl-html-tree/Makefile [new file with mode: 0644]
lang/perl-http-cookies/Makefile [new file with mode: 0644]
lang/perl-http-daemon/Makefile [new file with mode: 0644]
lang/perl-http-date/Makefile [new file with mode: 0644]
lang/perl-http-message/Makefile [new file with mode: 0644]
lang/perl-http-negotiate/Makefile [new file with mode: 0644]
lang/perl-http-server-simple/Makefile [new file with mode: 0644]
lang/perl-inline-c/Makefile [new file with mode: 0644]
lang/perl-inline-c/patches/100-inline_c-no_compile_hack.patch [new file with mode: 0644]
lang/perl-inline-c/patches/110-inline_c-make_system_typemap_overridable.patch [new file with mode: 0644]
lang/perl-inline/Makefile [new file with mode: 0644]
lang/perl-io-html/Makefile [new file with mode: 0644]
lang/perl-lockfile-simple/Makefile [new file with mode: 0644]
lang/perl-lwp-mediatypes/Makefile [new file with mode: 0644]
lang/perl-net-http/Makefile [new file with mode: 0644]
lang/perl-net-telnet/Makefile [new file with mode: 0644]
lang/perl-parse-recdescent/Makefile [new file with mode: 0644]
lang/perl-sub-uplevel/Makefile [new file with mode: 0644]
lang/perl-test-harness/Makefile [new file with mode: 0644]
lang/perl-test-warn/Makefile [new file with mode: 0644]
lang/perl-uri/Makefile [new file with mode: 0644]
lang/perl-www-curl/Makefile [new file with mode: 0644]
lang/perl-www-curl/patches/100-perl-www-curl_disable_curl-config_hack.patch [new file with mode: 0644]
lang/perl-www-curl/patches/101-skip-preprocessor-symbol.path [new file with mode: 0644]
lang/perl-www-curl/patches/200-fix_default_lflags.patch [new file with mode: 0644]
lang/perl-www-mechanize/Makefile [new file with mode: 0644]
lang/perl-www-robotrules/Makefile [new file with mode: 0644]
lang/perl-www/Makefile [new file with mode: 0644]
lang/perl-xml-parser/Makefile [new file with mode: 0644]
lang/perl-xml-parser/patches/010-xml-parser-expat-use-ppport.h [new file with mode: 0644]
lang/perl-xml-parser/patches/020-xml-parser-expat-lib-inc-path-anchor.patch [new file with mode: 0644]
lang/perl/Config.in [new file with mode: 0644]
lang/perl/Makefile [new file with mode: 0644]
lang/perl/README.patches [new file with mode: 0644]
lang/perl/files/README.config [new file with mode: 0644]
lang/perl/files/architecture.config [new file with mode: 0644]
lang/perl/files/arm.config [new file with mode: 0644]
lang/perl/files/armeb.config [new file with mode: 0644]
lang/perl/files/base.config [new file with mode: 0644]
lang/perl/files/i486.config [new file with mode: 0644]
lang/perl/files/libc.config [new file with mode: 0644]
lang/perl/files/mips.config [new file with mode: 0644]
lang/perl/files/mips64.config [new file with mode: 0644]
lang/perl/files/mipsel.config [new file with mode: 0644]
lang/perl/files/misc.config [new file with mode: 0644]
lang/perl/files/perl-run_tests.sh [new file with mode: 0755]
lang/perl/files/perlconfig.pl [new file with mode: 0644]
lang/perl/files/powerpc.config [new file with mode: 0644]
lang/perl/files/signal.config [new file with mode: 0644]
lang/perl/files/threads.config [new file with mode: 0644]
lang/perl/files/version.config [new file with mode: 0644]
lang/perl/files/x86_64.config [new file with mode: 0644]
lang/perl/patches/010-musl-compat.patch [new file with mode: 0644]
lang/perl/patches/020-host-libc-dir-moved-debian+derivatives.patch [new file with mode: 0644]
lang/perl/patches/100-fix-cross-compile-endianness-detection.patch [new file with mode: 0644]
lang/perl/patches/110-always_use_miniperl.patch [new file with mode: 0644]
lang/perl/patches/300-add-relink-hack.patch [new file with mode: 0644]
lang/perl/patches/310-recompile-hack.patch [new file with mode: 0644]
lang/perl/patches/700-tie_fetch_count_t-handle_missing_crypt.patch [new file with mode: 0644]
lang/perl/patches/710-threads_join-skip_ps_on_busybox.patch [new file with mode: 0644]
lang/perl/patches/900-CVE-2015-8607.patch [new file with mode: 0644]
lang/perl/patches/901-CVE-2016-2381.patch [new file with mode: 0644]
lang/perl/perlbase.mk [new file with mode: 0644]
lang/perl/perlmod.mk [new file with mode: 0644]
lang/php7-pecl-dio/Makefile [new file with mode: 0644]
lang/php7-pecl-http/Makefile [new file with mode: 0644]
lang/php7-pecl-http/patches.old/100_config9-m4.patch [new file with mode: 0644]
lang/php7-pecl-http/patches/100_php_http_etag_bigendian_check.patch [new file with mode: 0644]
lang/php7-pecl-libevent/Makefile [new file with mode: 0644]
lang/php7-pecl-libevent/patches/010-libevent2.patch [new file with mode: 0644]
lang/php7-pecl-propro/Makefile [new file with mode: 0644]
lang/php7-pecl-raphf/Makefile [new file with mode: 0644]
lang/php7/Makefile [new file with mode: 0644]
lang/php7/files/php.ini [new file with mode: 0644]
lang/php7/files/php7-fastcgi.config [new file with mode: 0644]
lang/php7/files/php7-fastcgi.init [new file with mode: 0644]
lang/php7/files/php7-fpm-www.conf [new file with mode: 0644]
lang/php7/files/php7-fpm.conf [new file with mode: 0644]
lang/php7/files/php7-fpm.config [new file with mode: 0644]
lang/php7/files/php7-fpm.init [new file with mode: 0644]
lang/php7/patches/0013-Add-support-for-use-of-the-system-timezone-database.patch [new file with mode: 0644]
lang/php7/patches/0016-dont-gitclean-in-build.patch [new file with mode: 0644]
lang/php7/patches/0032-Use-system-timezone.patch [new file with mode: 0644]
lang/php7/patches/0041-Add-patch-to-remove-build-timestamps-from-generated-.patch [new file with mode: 0644]
lang/php7/patches/0042-Remove-W3C-validation-icon-to-not-expose-the-reader-.patch [new file with mode: 0644]
lang/php7/patches/1000-fix_membar_producer_link_error_gcc3x.patch [new file with mode: 0644]
lang/php7/patches/1001-ext-opcache-fix-detection-of-shm-mmap.patch [new file with mode: 0644]
lang/php7/patches/1002-gd-iconv.patch [new file with mode: 0644]
lang/php7/patches/1003-Fix-dl-cross-compiling-issue.patch [new file with mode: 0644]
lang/php7/patches/1004-disable-phar-command.patch [new file with mode: 0644]
lang/php7/patches/1005-fix-asm-constraints-in-aarch64-multiply-macro.patch [new file with mode: 0644]
lang/php7/pecl.mk [new file with mode: 0644]
lang/pillow/Makefile [new file with mode: 0644]
lang/pillow/patches/010-fix-paths.patch [new file with mode: 0644]
lang/python-attrs/Makefile [new file with mode: 0644]
lang/python-cffi/Makefile [new file with mode: 0644]
lang/python-crcmod/Makefile [new file with mode: 0644]
lang/python-crypto/Makefile [new file with mode: 0644]
lang/python-crypto/patches/001-no-host-paths.patch [new file with mode: 0644]
lang/python-crypto/patches/002-fix-endianness-detect.patch [new file with mode: 0644]
lang/python-cryptography/Makefile [new file with mode: 0644]
lang/python-dateutil/Makefile [new file with mode: 0644]
lang/python-dns/Makefile [new file with mode: 0644]
lang/python-egenix-mx-base/Makefile [new file with mode: 0644]
lang/python-enum34/Makefile [new file with mode: 0644]
lang/python-enum34/patches/001-omit-docs.patch [new file with mode: 0644]
lang/python-gmpy2/Makefile [new file with mode: 0644]
lang/python-idna/Makefile [new file with mode: 0644]
lang/python-ipaddress/Makefile [new file with mode: 0644]
lang/python-ldap/Makefile [new file with mode: 0644]
lang/python-ldap/patches/010-setup_cfg.patch [new file with mode: 0644]
lang/python-mysql/Makefile [new file with mode: 0644]
lang/python-mysql/patches/010-threadsafe.patch [new file with mode: 0644]
lang/python-packages/Makefile [new file with mode: 0644]
lang/python-packages/README.md [new file with mode: 0644]
lang/python-parsley/Makefile [new file with mode: 0644]
lang/python-parsley/patches/001-omit-tests.patch [new file with mode: 0644]
lang/python-pcapy/Makefile [new file with mode: 0644]
lang/python-pip/Makefile [new file with mode: 0644]
lang/python-pip/files/pip.conf [new file with mode: 0644]
lang/python-ply/Makefile [new file with mode: 0644]
lang/python-psycopg2/Makefile [new file with mode: 0644]
lang/python-pyasn1-modules/Makefile [new file with mode: 0644]
lang/python-pyasn1/Makefile [new file with mode: 0644]
lang/python-pycparser/Makefile [new file with mode: 0644]
lang/python-pycparser/patches/001-use-external-ply.patch [new file with mode: 0644]
lang/python-pyopenssl/Makefile [new file with mode: 0644]
lang/python-pyptlib/Makefile [new file with mode: 0644]
lang/python-pyserial/Makefile [new file with mode: 0644]
lang/python-service-identity/Makefile [new file with mode: 0644]
lang/python-setuptools/Makefile [new file with mode: 0644]
lang/python-setuptools/patches/0001-remove-windows-support.patch [new file with mode: 0644]
lang/python-setuptools/patches/0002-fix-pyvenv-environment-get.patch [new file with mode: 0644]
lang/python-six/Makefile [new file with mode: 0644]
lang/python-txsocksx/Makefile [new file with mode: 0644]
lang/python-txsocksx/patches/001-omit-tests.patch [new file with mode: 0644]
lang/python-txsocksx/patches/002-do-not-use-vcversioner.patch [new file with mode: 0644]
lang/python-urllib3/Makefile [new file with mode: 0644]
lang/python-yaml/Makefile [new file with mode: 0644]
lang/python/files/config.site [new file with mode: 0644]
lang/python/files/python-host.mk [new file with mode: 0644]
lang/python/files/python-package-codecs.mk [new file with mode: 0644]
lang/python/files/python-package-compiler.mk [new file with mode: 0644]
lang/python/files/python-package-ctypes.mk [new file with mode: 0644]
lang/python/files/python-package-db.mk [new file with mode: 0644]
lang/python/files/python-package-decimal.mk [new file with mode: 0644]
lang/python/files/python-package-dev.mk [new file with mode: 0644]
lang/python/files/python-package-distutils.mk [new file with mode: 0644]
lang/python/files/python-package-email.mk [new file with mode: 0644]
lang/python/files/python-package-gdbm.mk [new file with mode: 0644]
lang/python/files/python-package-lib2to3.mk [new file with mode: 0644]
lang/python/files/python-package-logging.mk [new file with mode: 0644]
lang/python/files/python-package-multiprocessing.mk [new file with mode: 0644]
lang/python/files/python-package-ncurses.mk [new file with mode: 0644]
lang/python/files/python-package-openssl.mk [new file with mode: 0644]
lang/python/files/python-package-pydoc.mk [new file with mode: 0644]
lang/python/files/python-package-sqlite3.mk [new file with mode: 0644]
lang/python/files/python-package-unittest.mk [new file with mode: 0644]
lang/python/files/python-package-xml.mk [new file with mode: 0644]
lang/python/files/python-package.mk [new file with mode: 0644]
lang/python/patches/007-distutils-do-not-adjust-path.patch [new file with mode: 0644]
lang/python3-bottle/Makefile [new file with mode: 0644]
lang/python3-pip/Makefile [new file with mode: 0644]
lang/python3-pip/patches/0001-remove-self-version-checking.patch [new file with mode: 0644]
lang/python3-setuptools/Makefile [new file with mode: 0644]
lang/python3-setuptools/patches/0001-remove-windows-support.patch [new file with mode: 0644]
lang/python3-setuptools/patches/0002-fix-pyvenv-environment-get.patch [new file with mode: 0644]
lang/python3/Makefile [new file with mode: 0644]
lang/python3/files/config.site [new file with mode: 0644]
lang/python3/files/python3-host.mk [new file with mode: 0644]
lang/python3/files/python3-package-asyncio.mk [new file with mode: 0644]
lang/python3/files/python3-package-codecs.mk [new file with mode: 0644]
lang/python3/files/python3-package-ctypes.mk [new file with mode: 0644]
lang/python3/files/python3-package-dbm.mk [new file with mode: 0644]
lang/python3/files/python3-package-decimal.mk [new file with mode: 0644]
lang/python3/files/python3-package-dev.mk [new file with mode: 0644]
lang/python3/files/python3-package-distutils.mk [new file with mode: 0644]
lang/python3/files/python3-package-email.mk [new file with mode: 0644]
lang/python3/files/python3-package-gdbm.mk [new file with mode: 0644]
lang/python3/files/python3-package-lib2to3.mk [new file with mode: 0644]
lang/python3/files/python3-package-logging.mk [new file with mode: 0644]
lang/python3/files/python3-package-lzma.mk [new file with mode: 0644]
lang/python3/files/python3-package-multiprocessing.mk [new file with mode: 0644]
lang/python3/files/python3-package-ncurses.mk [new file with mode: 0644]
lang/python3/files/python3-package-openssl.mk [new file with mode: 0644]
lang/python3/files/python3-package-pydoc.mk [new file with mode: 0644]
lang/python3/files/python3-package-sqlite3.mk [new file with mode: 0644]
lang/python3/files/python3-package-unittest.mk [new file with mode: 0644]
lang/python3/files/python3-package-xml.mk [new file with mode: 0644]
lang/python3/files/python3-package.mk [new file with mode: 0644]
lang/python3/files/python3-version.mk [new file with mode: 0644]
lang/python3/patches/001-enable-zlib.patch [new file with mode: 0644]
lang/python3/patches/002-do-not-add-include-dirs-when-cross-compiling.patch [new file with mode: 0644]
lang/python3/patches/003-do-not-run-distutils-tests.patch [new file with mode: 0644]
lang/python3/patches/004-do-not-write-bytes-codes.patch [new file with mode: 0644]
lang/python3/patches/005-fix-libffi-x86-64-configure.patch [new file with mode: 0644]
lang/python3/patches/006-remove-debian-multiarch-support.patch [new file with mode: 0644]
lang/python3/patches/007-distutils-do-not-adjust-path.patch [new file with mode: 0644]
lang/python3/patches/010-do-not-add-rt-lib-dirs-when-cross-compiling.patch [new file with mode: 0644]
lang/python3/patches/011-do-not-prefer-ncursesw.patch [new file with mode: 0644]
lang/python3/patches/011-fix-ncursesw-definition-colisions.patch [new file with mode: 0644]
lang/python3/patches/012-disable-wcsftime-detection.patch [new file with mode: 0644]
lang/python3/patches/014-remove-platform-so-suffix.patch [new file with mode: 0644]
lang/python3/patches/015-abort-on-failed-modules.patch [new file with mode: 0644]
lang/python3/patches/016-adjust-config-paths.patch [new file with mode: 0644]
lang/pytz/Makefile [new file with mode: 0644]
lang/rcssmin/Makefile [new file with mode: 0644]
lang/ruby/files/ruby [new file with mode: 0644]
lang/ruby/ruby_find_pkgsdeps [new file with mode: 0644]
lang/ruby/ruby_missingfiles [new file with mode: 0644]
lang/simplejson/Makefile [new file with mode: 0644]
lang/tcl/Makefile [new file with mode: 0644]
lang/tcl/patches/100-disable_tzdata_and_msgs_install.patch [new file with mode: 0644]
lang/tcl/patches/200-fix_mips_build.patch [new file with mode: 0644]
lang/twisted/Makefile [new file with mode: 0644]
lang/twisted/patches/001-fix-zsh-completion.patch [new file with mode: 0644]
lang/twisted/patches/002-omit-tests.patch [new file with mode: 0644]
lang/uuid/Makefile [new file with mode: 0644]
lang/vala/Makefile [new file with mode: 0644]
lang/zope-interface/Makefile [new file with mode: 0644]
libs/alsa-lib/patches/001-link_fix.patch [new file with mode: 0644]
libs/alsa-lib/patches/005-fix_include_file_redirect_warnings.patch [new file with mode: 0644]
libs/apr-util/Makefile [new file with mode: 0644]
libs/apr-util/patches/001-automake-compat.patch [new file with mode: 0644]
libs/apr/Makefile [new file with mode: 0644]
libs/apr/patches/001-autoconf-compat.patch [new file with mode: 0644]
libs/apr/patches/101-fix_apr_time_now.patch [new file with mode: 0644]
libs/apr/patches/201-upgrade-and-fix-1.5.1.patch [new file with mode: 0644]
libs/avahi/Makefile [new file with mode: 0644]
libs/avahi/files/avahi-daemon.conf [new file with mode: 0644]
libs/avahi/files/avahi-daemon.init [new file with mode: 0644]
libs/avahi/files/netifd-autoip.sh [new file with mode: 0755]
libs/avahi/files/service-http [new file with mode: 0644]
libs/avahi/files/service-ssh [new file with mode: 0644]
libs/avahi/patches/010-step_back_autotools-no-gettext.patch [new file with mode: 0644]
libs/avahi/patches/011-fix-poll-h-warnings-on-musl.patch [new file with mode: 0644]
libs/avro/Makefile [new file with mode: 0644]
libs/boost/Makefile [new file with mode: 0644]
libs/boost/patches/01_fiber_fix.patch [new file with mode: 0644]
libs/c-ares/Makefile [new file with mode: 0644]
libs/check/Makefile [new file with mode: 0644]
libs/classpath/Makefile [new file with mode: 0644]
libs/classpath/patches/010-double-memleak.patch [new file with mode: 0644]
libs/confuse/Makefile [new file with mode: 0644]
libs/db47/Makefile [new file with mode: 0644]
libs/db47/patches/010-patch.4.7.25.1.patch [new file with mode: 0644]
libs/db47/patches/020-patch.4.7.25.2.patch [new file with mode: 0644]
libs/db47/patches/030-patch.4.7.25.3.patch [new file with mode: 0644]
libs/db47/patches/040-patch.4.7.25.4.patch [new file with mode: 0644]
libs/db47/patches/100-repmgr-format-security.patch [new file with mode: 0644]
libs/dmx_usb_module/Makefile [new file with mode: 0644]
libs/dmx_usb_module/patches/001-dmx_usb_Makefile.patch [new file with mode: 0644]
libs/dtc/Makefile [new file with mode: 0644]
libs/dtndht/Makefile [new file with mode: 0644]
libs/dtndht/patches/001-musl_header.patch [new file with mode: 0644]
libs/elektra/Makefile [new file with mode: 0644]
libs/eventlog/Makefile [new file with mode: 0644]
libs/faad2/Config.in [new file with mode: 0644]
libs/faad2/Makefile [new file with mode: 0644]
libs/fcgi/Makefile [new file with mode: 0644]
libs/fcgi/patches/100-fcgio-int-type-fix.patch [new file with mode: 0644]
libs/fcgi/patches/110-no_examples.patch [new file with mode: 0644]
libs/fcgi/patches/120-stdio.patch [new file with mode: 0644]
libs/fftw3/Makefile [new file with mode: 0644]
libs/fftw3/patches/001-makefile.patch [new file with mode: 0644]
libs/file/Makefile [new file with mode: 0644]
libs/flac/Makefile [new file with mode: 0644]
libs/flac/patches/001-no-docs-and-examples.patch [new file with mode: 0644]
libs/flac/patches/002-no-utility.patch [new file with mode: 0644]
libs/flac/patches/005-gcc_debug_options.patch [new file with mode: 0644]
libs/flac/patches/010-automake-compat.patch [new file with mode: 0644]
libs/flac/patches/020-fix-musl-sigemptyset-x86.patch [new file with mode: 0644]
libs/freetype/Makefile [new file with mode: 0644]
libs/gdbm/Makefile [new file with mode: 0644]
libs/giflib/Makefile [new file with mode: 0644]
libs/giflib/patches/100-no-docs.patch [new file with mode: 0644]
libs/glpk/Makefile [new file with mode: 0644]
libs/gperf/Makefile [new file with mode: 0644]
libs/hidapi/Makefile [new file with mode: 0644]
libs/hidapi/patches/010-add-iconv-linkage.patch [new file with mode: 0644]
libs/hiredis/Makefile [new file with mode: 0644]
libs/ibrcommon/Makefile [new file with mode: 0644]
libs/ibrcommon/patches/001-fix-build-with-musl.patch [new file with mode: 0644]
libs/ibrdtn/Makefile [new file with mode: 0644]
libs/icu/patches/000-dont-cpy-files-from-topdirs.patch [new file with mode: 0644]
libs/icu/patches/001-disable-strtod_l.patch [new file with mode: 0644]
libs/icu/patches/CVE-2017-7867_CVE-2017-7868.patch [new file with mode: 0644]
libs/intltool/Makefile [new file with mode: 0644]
libs/intltool/patches/100-optional-perl-xml-parser.patch [new file with mode: 0644]
libs/jansson/Makefile [new file with mode: 0644]
libs/ldns/Makefile [new file with mode: 0644]
libs/ldns/patches/001-perl5-defined-array.patch [new file with mode: 0644]
libs/libaio/Makefile [new file with mode: 0644]
libs/libaio/patches/001_arches.patch [new file with mode: 0644]
libs/libaio/patches/002_arches_sh.patch [new file with mode: 0644]
libs/libaio/patches/003_arches_sparc64.patch [new file with mode: 0644]
libs/libaio/patches/004_arches_x32.patch [new file with mode: 0644]
libs/libaio/patches/005_arches_mips.patch [new file with mode: 0644]
libs/libaio/patches/006_arches_mips_fix_padding.patch [new file with mode: 0644]
libs/libantlr3c/Makefile [new file with mode: 0644]
libs/libao/Makefile [new file with mode: 0644]
libs/libarchive/Makefile [new file with mode: 0644]
libs/libartnet/Makefile [new file with mode: 0644]
libs/libartnet/patches/001-bswap_16.patch [new file with mode: 0644]
libs/libaudiofile/Makefile [new file with mode: 0644]
libs/libavl/Makefile [new file with mode: 0644]
libs/libavl/patches/010-update_GNUmakefile.patch [new file with mode: 0644]
libs/libcanfestival/Makefile [new file with mode: 0644]
libs/libcanfestival/patches/001-sigval-ref-fix.patch [new file with mode: 0644]
libs/libcanfestival/patches/002-makefile-gcc-linker.patch [new file with mode: 0644]
libs/libcanfestival/patches/003-makefile-skip-examples.patch [new file with mode: 0644]
libs/libcap/Makefile [new file with mode: 0644]
libs/libcap/patches/100-portability.patch [new file with mode: 0644]
libs/libcoap/Makefile [new file with mode: 0644]
libs/libdaemon/Makefile [new file with mode: 0644]
libs/libdaemon/patches/001-daemon_set_verbosity.patch [new file with mode: 0644]
libs/libdaq/Makefile [new file with mode: 0644]
libs/libdaq/patches/001-compile.patch [new file with mode: 0644]
libs/libdaq/patches/100-musl-compat.patch [new file with mode: 0644]
libs/libdbi-drivers/Makefile [new file with mode: 0644]
libs/libdbi-drivers/patches/001_libsqlite3_fix.patch [new file with mode: 0644]
libs/libdbi/Makefile [new file with mode: 0644]
libs/libdnet/Makefile [new file with mode: 0644]
libs/libdnet/patches/001-compile.patch [new file with mode: 0644]
libs/libdnet/patches/002-config.patch [new file with mode: 0644]
libs/libdouble-conversion/Makefile [new file with mode: 0644]
libs/libdrm/Makefile [new file with mode: 0644]
libs/libdrm/patches/000-remove-dep-on-pthread-stubs.patch [new file with mode: 0644]
libs/libedit/Makefile [new file with mode: 0644]
libs/libesmtp/Makefile [new file with mode: 0644]
libs/libestr/Makefile [new file with mode: 0644]
libs/libev/Makefile [new file with mode: 0644]
libs/libevdev/Makefile [new file with mode: 0644]
libs/libevdev/patches/010-no-clock-monotonic-raw-in-uclibc.patch [new file with mode: 0644]
libs/libevent/Makefile [new file with mode: 0644]
libs/libexif/Makefile [new file with mode: 0644]
libs/libexif/patches/100-no_doc.patch [new file with mode: 0644]
libs/libextractor/Makefile [new file with mode: 0644]
libs/libextractor/patches/001-backport-support-for-giflib-5-1.patch [new file with mode: 0644]
libs/libextractor/patches/002-ffmpeg2.9_api_backport.patch [new file with mode: 0644]
libs/libfastjson/Makefile [new file with mode: 0644]
libs/libftdi/Makefile [new file with mode: 0644]
libs/libftdi/patches/100-fix-x86_64-build.patch [new file with mode: 0644]
libs/libftdi/patches/101-fix-cmake-version-packagekit.patch [new file with mode: 0644]
libs/libftdi/patches/102-fix-cmake-include-examples.patch [new file with mode: 0644]
libs/libftdi1/Makefile [new file with mode: 0644]
libs/libftdi1/patches/100-fix-x86_64-build.patch [new file with mode: 0644]
libs/libgee/Makefile [new file with mode: 0644]
libs/libgee/patches/libgee-0.18.0-no-introspection.patch [new file with mode: 0644]
libs/libhttp-parser/Makefile [new file with mode: 0644]
libs/libical/Makefile [new file with mode: 0644]
libs/libid3tag/Makefile [new file with mode: 0644]
libs/libidn/Makefile [new file with mode: 0644]
libs/libidn/patches/002-disable-po-docs-examples.patch [new file with mode: 0644]
libs/libidn/patches/010-fix-idn-error-usage.patch [new file with mode: 0644]
libs/libimobiledevice/Makefile [new file with mode: 0644]
libs/libinput/Makefile [new file with mode: 0644]
libs/libinput/patches/001-no-locale.patch [new file with mode: 0644]
libs/libinput/patches/002-static_assert.patch [new file with mode: 0644]
libs/liblo/Makefile [new file with mode: 0644]
libs/liblo/patches/001-fix-musl-include.patch [new file with mode: 0644]
libs/liblz4/Makefile [new file with mode: 0644]
libs/libmad/Makefile [new file with mode: 0644]
libs/libmad/patches/001-mips_removal_h_constraint.patch [new file with mode: 0644]
libs/libmcrypt/Makefile [new file with mode: 0644]
libs/libmicrohttpd/Makefile [new file with mode: 0644]
libs/libmms/Makefile [new file with mode: 0644]
libs/libmodbus/Makefile [new file with mode: 0644]
libs/libmpdclient/Makefile [new file with mode: 0644]
libs/libmpeg2/Makefile [new file with mode: 0644]
libs/libmpeg2/patches/101-ppc_no_altivec.patch [new file with mode: 0644]
libs/libmpeg2/patches/102-arm_data_preload_check.patch [new file with mode: 0644]
libs/libnatpmp/Makefile [new file with mode: 0644]
libs/libnatpmp/patches/001-install_declspec.patch [new file with mode: 0644]
libs/libnet-1.2.x/Makefile [new file with mode: 0644]
libs/libnet-1.2.x/patches/100-musl-compat.patch [new file with mode: 0644]
libs/libnopoll/Makefile [new file with mode: 0644]
libs/libogg/Makefile [new file with mode: 0644]
libs/liboil/Makefile [new file with mode: 0644]
libs/liboping/Makefile [new file with mode: 0644]
libs/liboping/patches/01-no-werror.patch [new file with mode: 0644]
libs/libowfat/Makefile [new file with mode: 0644]
libs/libowfat/patches/001-fixbuild.patch [new file with mode: 0644]
libs/libp11/Makefile [new file with mode: 0644]
libs/libp11/patches/001-fix-install.patch [new file with mode: 0644]
libs/libplist/Makefile [new file with mode: 0644]
libs/libsamplerate/Makefile [new file with mode: 0644]
libs/libsearpc/Makefile [new file with mode: 0644]
libs/libseccomp/Makefile [new file with mode: 0644]
libs/libseccomp/patches/100-dont-use-linux-prctl.h-with-musl.patch [new file with mode: 0644]
libs/libshout/Makefile [new file with mode: 0644]
libs/libshout/patches/100-add_with-openssl_option.patch [new file with mode: 0644]
libs/libshout/patches/120-vorbis-c.patch [new file with mode: 0644]
libs/libshout/patches/140-no_example_doc_win32.patch [new file with mode: 0644]
libs/libsigc++/Makefile [new file with mode: 0644]
libs/libsigc++/patches/001-no_doc_tests_examples.patch [new file with mode: 0644]
libs/libsndfile/Makefile [new file with mode: 0644]
libs/libsoxr/Makefile [new file with mode: 0644]
libs/libstrophe/Config.in [new file with mode: 0644]
libs/libstrophe/Makefile [new file with mode: 0644]
libs/libtalloc/Makefile [new file with mode: 0644]
libs/libtheora/Makefile [new file with mode: 0644]
libs/libtheora/patches/001-no_docs_tests.patch [new file with mode: 0644]
libs/libtheora/patches/002-no_sdl_check.patch [new file with mode: 0644]
libs/libtorrent/Makefile [new file with mode: 0644]
libs/libtorrent/patches/100-fix_cross_compile.patch [new file with mode: 0644]
libs/libuecc/Makefile [new file with mode: 0644]
libs/libugpio/Makefile [new file with mode: 0644]
libs/libunistring/Makefile [new file with mode: 0644]
libs/libupnp/Makefile [new file with mode: 0644]
libs/libupnpp/Makefile [new file with mode: 0644]
libs/liburcu/Makefile [new file with mode: 0644]
libs/libusbmuxd/Makefile [new file with mode: 0644]
libs/libuv/Makefile [new file with mode: 0644]
libs/libuvc/Makefile [new file with mode: 0644]
libs/libv4l/Makefile [new file with mode: 0644]
libs/libv4l/patches/020-add-missing-includes.patch [new file with mode: 0644]
libs/libv4l/patches/030-dont-call-getsubopt.patch [new file with mode: 0644]
libs/libvorbis/Makefile [new file with mode: 0644]
libs/libvorbisidec/Makefile [new file with mode: 0644]
libs/libvpx/Makefile [new file with mode: 0644]
libs/libx264/Makefile [new file with mode: 0644]
libs/libxerces-c/Makefile [new file with mode: 0644]
libs/libzdb/Makefile [new file with mode: 0644]
libs/libzdb/patches/010-cross-compile-fixes.patch [new file with mode: 0644]
libs/libzdb/patches/020-filterh-use-host-built-version.patch [new file with mode: 0644]
libs/lttng-ust/Makefile [new file with mode: 0644]
libs/lttng-ust/patches/001-no_docs_tests.patch [new file with mode: 0644]
libs/lttng-ust/patches/002-examples.patch [new file with mode: 0644]
libs/mtdev/Makefile [new file with mode: 0644]
libs/mxml/Makefile [new file with mode: 0644]
libs/mxml/patches/001-targets.patch [new file with mode: 0644]
libs/nacl/Makefile [new file with mode: 0644]
libs/nacl/do-openwrt [new file with mode: 0755]
libs/neon/Makefile [new file with mode: 0644]
libs/opus/Makefile [new file with mode: 0644]
libs/poco/Makefile [new file with mode: 0644]
libs/poco/patches/100-configure.patch [new file with mode: 0644]
libs/poco/patches/200-strerror.patch [new file with mode: 0644]
libs/postgresql/files/postgresql.config [new file with mode: 0644]
libs/postgresql/files/postgresql.init [new file with mode: 0644]
libs/postgresql/files/postgresql.sh [new file with mode: 0644]
libs/postgresql/patches/001-configure_fixes.patch [new file with mode: 0644]
libs/postgresql/patches/200-ranlib.patch [new file with mode: 0644]
libs/postgresql/patches/800-busybox-default-pager.patch [new file with mode: 0644]
libs/postgresql/patches/900-pg_ctl-setuid.patch [new file with mode: 0644]
libs/protobuf-c/Makefile [new file with mode: 0644]
libs/protobuf/Makefile [new file with mode: 0644]
libs/protobuf/patches/001-mipseb-compile.patch [new file with mode: 0644]
libs/protobuf/patches/003-mips2andHigher-compile.patch [new file with mode: 0644]
libs/pthsem/Makefile [new file with mode: 0644]
libs/pthsem/patches/001-linux3x-fix.patch [new file with mode: 0644]
libs/pthsem/patches/002-fix-signal.h [new file with mode: 0644]
libs/qrencode/Makefile [new file with mode: 0644]
libs/qrencode/patches/001-disable-png.patch [new file with mode: 0644]
libs/quasselc/Makefile [new file with mode: 0644]
libs/quasselc/patches/001-respect-cflags-ldflags.patch [new file with mode: 0644]
libs/rxtx/Makefile [new file with mode: 0755]
libs/rxtx/patches/010-acm-devices.patch [new file with mode: 0755]
libs/sbc/Makefile [new file with mode: 0644]
libs/speex/Makefile [new file with mode: 0644]
libs/tcp_wrappers/Makefile [new file with mode: 0644]
libs/tcp_wrappers/patches/001-debian_subset.patch [new file with mode: 0644]
libs/tcp_wrappers/patches/002-opt_cflags.patch [new file with mode: 0644]
libs/tcp_wrappers/patches/003-scaffold_malloc.patch [new file with mode: 0644]
libs/tcp_wrappers/patches/004-ipv4_prefix.patch [new file with mode: 0644]
libs/tcp_wrappers/patches/005-no--lnsl-on-musl.patch [new file with mode: 0644]
libs/tdb/Makefile [new file with mode: 0644]
libs/tdb/patches/001-printf-fix.patch [new file with mode: 0644]
libs/tinycdb/Makefile [new file with mode: 0644]
libs/tinycdb/patches/100-Makefile.patch [new file with mode: 0644]
libs/unixodbc/Makefile [new file with mode: 0644]
libs/unixodbc/files/unixodbc_conf.h [new file with mode: 0644]
libs/vips/Makefile [new file with mode: 0644]
libs/vips/patches/001-no_cpp.patch [new file with mode: 0644]
libs/xmlrpc-c/Makefile [new file with mode: 0644]
libs/xmlrpc-c/patches/001-config.mk.in.patch [new file with mode: 0644]
libs/xmlrpc-c/patches/002-automake-compat.patch [new file with mode: 0644]
libs/xr_usb_serial_common/Makefile [new file with mode: 0644]
libs/yajl/Makefile [new file with mode: 0644]
libs/yajl/patches/100-link-reformatter-uclibc-libm.patch [new file with mode: 0644]
libs/yajl/patches/101-link-perf-uclibc-libm.patch [new file with mode: 0644]
libs/yaml/Makefile [new file with mode: 0644]
libs/zmq/Makefile [new file with mode: 0644]
libs/zmq/patches/010-disable_pedantic_on_linux_with_ulibc++.patch [new file with mode: 0644]
libs/zmq/patches/020-map_with_const_string_with_ublic++.patch [new file with mode: 0644]
libs/zmq/patches/030-streamoff_missing_with_ulibc++.patch [new file with mode: 0644]
libs/zmq/patches/040-fix_GNUC_conditional_for_GCC5.patch [new file with mode: 0644]
libs/zmq/patches/100-fix-cxx-include-order.patch [new file with mode: 0644]
mail/bogofilter/Makefile [new file with mode: 0644]
mail/bogofilter/files/postfix-bogofilter [new file with mode: 0755]
multimedia/crtmpserver/Makefile [new file with mode: 0644]
multimedia/crtmpserver/files/crtmpserver.init [new file with mode: 0644]
multimedia/crtmpserver/patches/010-link-crypt-for-lua.patch [new file with mode: 0644]
multimedia/crtmpserver/patches/020-add-rpath.patch [new file with mode: 0644]
multimedia/crtmpserver/patches/030-default-config.patch [new file with mode: 0644]
multimedia/crtmpserver/patches/040-use-select.patch [new file with mode: 0644]
multimedia/crtmpserver/patches/050-add-missing-make-defines.patch [new file with mode: 0644]
multimedia/crtmpserver/patches/060-add-missing-includes.patch [new file with mode: 0644]
multimedia/crtmpserver/patches/070-missing-include-gcc-47.patch [new file with mode: 0644]
multimedia/crtmpserver/patches/080-disable-apple-streaming.patch [new file with mode: 0644]
multimedia/crtmpserver/patches/080-musl-uint32_t.patch [new file with mode: 0644]
multimedia/fswebcam/Makefile [new file with mode: 0644]
multimedia/gst1-libav/Config.in [new file with mode: 0644]
multimedia/gst1-libav/Makefile [new file with mode: 0644]
multimedia/gst1-plugins-base/Makefile [new file with mode: 0644]
multimedia/gst1-plugins-base/patches/001-no-translations.patch [new file with mode: 0644]
multimedia/gst1-plugins-base/patches/002-no-tests.patch [new file with mode: 0644]
multimedia/gst1-plugins-base/patches/003-no-docs.patch [new file with mode: 0644]
multimedia/gstreamer1/Makefile [new file with mode: 0644]
multimedia/gstreamer1/patches/001-no-translations.patch [new file with mode: 0644]
multimedia/gstreamer1/patches/002-no-tests.patch [new file with mode: 0644]
multimedia/gstreamer1/patches/003-no-docs.patch [new file with mode: 0644]
multimedia/gstreamer1/patches/010-gstplugin-use-lazy-symbol-binding.patch [new file with mode: 0644]
multimedia/icecast/Makefile [new file with mode: 0644]
multimedia/icecast/files/icecast.init [new file with mode: 0755]
multimedia/icecast/patches/001-icecast-2.4.0-tremor.patch [new file with mode: 0644]
multimedia/icecast/patches/005-no_examples_doc_win32.patch [new file with mode: 0644]
multimedia/icecast/patches/010-fix_libcurl_test_crap.patch [new file with mode: 0644]
multimedia/icecast/patches/015-add_with-openssl_option.patch [new file with mode: 0644]
multimedia/icecast/patches/020-icecast_config_for_openwrt.patch [new file with mode: 0644]
multimedia/ices/Makefile [new file with mode: 0644]
multimedia/mjpg-streamer/Config.in [new file with mode: 0644]
multimedia/mjpg-streamer/Makefile [new file with mode: 0644]
multimedia/mjpg-streamer/files/mjpg-streamer.config [new file with mode: 0644]
multimedia/mjpg-streamer/files/mjpg-streamer.hotplug [new file with mode: 0644]
multimedia/mjpg-streamer/files/mjpg-streamer.init [new file with mode: 0644]
multimedia/mjpg-streamer/patches/005-musl_compatibility.patch [new file with mode: 0644]
multimedia/mjpg-streamer/patches/010-enable_additional_plugins.patch [new file with mode: 0644]
multimedia/mjpg-streamer/patches/020-remove_gcc_debug_options.patch [new file with mode: 0644]
multimedia/mjpg-streamer/patches/030-allow_16_char_device_names.patch [new file with mode: 0644]
multimedia/mjpg-streamer/patches/040-Buffer-the-bytesused-variable-from-struct-v4l2_buffe.patch [new file with mode: 0644]
multimedia/mjpg-streamer/patches/041-Stop-leaking-data-via-struct-v4l2_buffer.patch [new file with mode: 0644]
multimedia/mjpg-streamer/patches/050-fix-yuv-capture.patch [new file with mode: 0644]
multimedia/mjpg-streamer/patches/060-fix-sigtrap-in-v4l2uvc.patch [new file with mode: 0644]
multimedia/motion/Makefile [new file with mode: 0644]
multimedia/motion/patches/100-musl-compat.patch [new file with mode: 0644]
multimedia/oggfwd/Makefile [new file with mode: 0644]
multimedia/tvheadend/Config.in [new file with mode: 0644]
multimedia/tvheadend/Makefile [new file with mode: 0644]
multimedia/tvheadend/files/tvheadend.config [new file with mode: 0644]
multimedia/tvheadend/files/tvheadend.init [new file with mode: 0644]
multimedia/xupnpd/Makefile [new file with mode: 0644]
multimedia/xupnpd/files/xupnpd.init [new file with mode: 0644]
multimedia/xupnpd/patches/100-default_config.patch [new file with mode: 0644]
multimedia/xupnpd/patches/101-root_dir_param.patch [new file with mode: 0644]
multimedia/youtube-dl/Makefile [new file with mode: 0644]
net/apache/Makefile [new file with mode: 0644]
net/apache/patches/001-Makefile_in.patch [new file with mode: 0644]
net/apache/patches/002-test_char_h.patch [new file with mode: 0644]
net/apache/patches/003-logdir_fix.patch [new file with mode: 0644]
net/apache/patches/004-pidfile_fix.patch [new file with mode: 0644]
net/apache/patches/005-httpd_conf.patch [new file with mode: 0644]
net/bmon/Makefile [new file with mode: 0644]
net/daemonlogger/Makefile [new file with mode: 0644]
net/davfs2/Makefile [new file with mode: 0644]
net/davfs2/files/davfs2.conf [new file with mode: 0644]
net/davfs2/patches/010-main_code_fix.patch [new file with mode: 0644]
net/davfs2/patches/100-musl-compat.patch [new file with mode: 0644]
net/davfs2/patches/200-davfs2-1.5.4-no-forced-stack-protector.patch [new file with mode: 0644]
net/iotivity/Makefile [new file with mode: 0644]
net/iotivity/files/etc/iotivity/ReadMe.txt [new file with mode: 0644]
net/iotivity/files/etc/iotivity/oic_svr_db.cbor [new file with mode: 0644]
net/iotivity/files/etc/iotivity/oic_svr_db.json [new file with mode: 0644]
net/iotivity/patches/001-no_unit_test.patch [new file with mode: 0644]
net/iotivity/patches/002-do-not-chck-for-boost.patch [new file with mode: 0644]
net/iotivity/patches/020-linux-Add-more-architectures.patch [new file with mode: 0644]
net/iotivity/patches/021-build-do-not-set-TARGET_ARCH-to-default.patch [new file with mode: 0644]
net/iotivity/patches/022-build-restrict-compiler-options-to-supported-archite.patch [new file with mode: 0644]
net/iotivity/patches/023-build-take-compiler-options-from-environment.patch [new file with mode: 0644]
net/iotivity/patches/030-remove-check-for-curl.patch [new file with mode: 0644]
net/iotivity/patches/040-linux-Use-system-sqlite3.patch [new file with mode: 0644]
net/iotivity/patches/050-csdk-move-OCEntityHandlerResponse-from-stack-to-heap.patch [new file with mode: 0644]
net/iotivity/patches/051-csdk-move-OCClientResponse-from-stack-to-heap.patch [new file with mode: 0644]
net/iotivity/patches/053-src-move-OCClientResponse-from-stack-to-heap.patch [new file with mode: 0644]
net/iotivity/patches/070-ssl-fix-compilation-against-non-debug-mbedtls.patch [new file with mode: 0644]
net/iotivity/patches/071-ssl-call-mbedtls_version_get_string-only-if-availabl.patch [new file with mode: 0644]
net/iotivity/patches/072-ssl-call-mbedtls_ssl_conf_renegotiation-only-if-avai.patch [new file with mode: 0644]
net/iotivity/patches/075-ssl-enable-usage-of-patched-mbed-functions-condition.patch [new file with mode: 0644]
net/iotivity/patches/078-use-system-mbedtls.patch [new file with mode: 0644]
net/iotivity/patches/080-zigbee_wrapper-do-not-check-for-floating-point.patch [new file with mode: 0644]
net/iotivity/patches/140-remove-glib2.patch [new file with mode: 0644]
net/iotivity/patches/200-examples-OICMiddle-try-to-load-security-configuratio.patch [new file with mode: 0644]
net/lighttpd/Makefile [deleted file]
net/lighttpd/files/lighttpd.conf [deleted file]
net/lighttpd/files/lighttpd.init [deleted file]
net/lighttpd/patches/0001-mod_cgi-RFC3875-CGI-local-redir-strict-adherence-210.patch [deleted file]
net/lighttpd/patches/0002-mod_cgi-fix-CGI-local-redir-w-url.rewrite-once-fixes.patch [deleted file]
net/lighttpd/patches/0003-mod_cgi-status-200-OK-if-no-hdrs-deprecated-2786.patch [deleted file]
net/lighttpd/patches/0004-mod_cgi-cgi.local-redir-enable-disable-2108-2793.patch [deleted file]
net/noddos/Makefile [deleted file]
net/ola/Makefile [deleted file]
net/ola/files/olad.init [deleted file]
net/ola/patches/001-include-endian_h.patch [deleted file]
net/ola/patches/002-remove-visibility-inlines-hidden-flag.patch [deleted file]
net/ola/patches/003-Make-DNS-SD-functionality-optional-at-build-time.patch [deleted file]
net/openconnect/Config.in [deleted file]
net/openconnect/Makefile [deleted file]
net/openconnect/README [deleted file]
net/openconnect/files/openconnect-wrapper [deleted file]
net/openconnect/files/openconnect.sh [deleted file]
net/openconnect/files/openconnect.upgrade [deleted file]
net/tor/Makefile [new file with mode: 0644]
net/tor/files/tor.init [new file with mode: 0644]
net/tor/patches/001-torrc.patch [new file with mode: 0644]
net/wireguard/Makefile [new file with mode: 0644]
net/wireguard/files/wireguard.sh [new file with mode: 0644]
sound/alsa-utils/Makefile [new file with mode: 0644]
sound/alsa-utils/patches/100-uClibc-compat.patch [new file with mode: 0644]
sound/espeak/Makefile [new file with mode: 0644]
sound/espeak/patches/101-portaudio.patch [new file with mode: 0644]
sound/forked-daapd/Makefile [new file with mode: 0644]
sound/forked-daapd/files/forked-daapd.conf [new file with mode: 0644]
sound/forked-daapd/files/forked-daapd.init [new file with mode: 0644]
sound/forked-daapd/patches/010-include_pregen.patch [new file with mode: 0644]
sound/lame/Makefile [new file with mode: 0644]
sound/lame/patches/001-automake-compat.patch [new file with mode: 0644]
sound/madplay/Makefile [new file with mode: 0644]
sound/madplay/patches/0001-switch-to-new-alsa-api.patch [new file with mode: 0644]
sound/madplay/patches/010-use_correct_shell.patch [new file with mode: 0644]
sound/mocp/Makefile [new file with mode: 0644]
sound/mpc/Makefile [new file with mode: 0644]
sound/mpc/files/pls-handler.sh [new file with mode: 0644]
sound/mpd/Makefile [new file with mode: 0644]
sound/mpd/files/mpd.init [new file with mode: 0644]
sound/mpd/files/mpd.service [new file with mode: 0644]
sound/mpd/patches/210-support_raw_pcm_streams.patch [new file with mode: 0644]
sound/mpd/patches/220-handle_slow_server_stream_startup.patch [new file with mode: 0644]
sound/mpg123/Makefile [new file with mode: 0644]
sound/pianod/Makefile [new file with mode: 0644]
sound/pianod/files/pianod.init [new file with mode: 0644]
sound/portaudio/Makefile [new file with mode: 0644]
sound/pulseaudio/Makefile [new file with mode: 0644]
sound/pulseaudio/files/pulseaudio.init [new file with mode: 0644]
sound/pulseaudio/patches/001-no_default_64mb_alloc.patch [new file with mode: 0644]
sound/shairplay/Makefile [new file with mode: 0644]
sound/shairplay/files/shairplay.config [new file with mode: 0644]
sound/shairplay/files/shairplay.init [new file with mode: 0644]
sound/shairplay/patches/001-key_file_dir.patch [new file with mode: 0644]
sound/shairplay/patches/002-libavahi-compat-dnssd.patch [new file with mode: 0644]
sound/shairplay/patches/003-fix_big-endian.patch [new file with mode: 0644]
sound/shairport-sync/Makefile [new file with mode: 0644]
sound/shairport-sync/files/shairport-sync.config [new file with mode: 0644]
sound/shairport-sync/files/shairport-sync.init [new file with mode: 0644]
sound/shairport-sync/patches/100-replace_polarssl_with_mbedtls.patch [new file with mode: 0644]
sound/shairport/Makefile [new file with mode: 0644]
sound/shairport/files/shairport.config [new file with mode: 0644]
sound/shairport/files/shairport.init [new file with mode: 0644]
sound/shairport/patches/001-disable_pulseaudio.patch [new file with mode: 0644]
sound/shine/Makefile [new file with mode: 0644]
sound/shine/patches/001-fix_mips64_bswap.patch [new file with mode: 0644]
sound/shine/patches/002-fix-name-collision-with-ffmpeg.patch [new file with mode: 0644]
sound/sox/Makefile [new file with mode: 0644]
sound/sox/patches/001-cross_compile.patch [new file with mode: 0644]
sound/sox/patches/010-fix_uclibc_build_issue.patch [new file with mode: 0644]
sound/squeezelite/Makefile [new file with mode: 0644]
sound/squeezelite/files/squeezelite.conf [new file with mode: 0644]
sound/squeezelite/files/squeezelite.init [new file with mode: 0644]
sound/squeezelite/patches/005-respect_LDFLAGS.patch [new file with mode: 0644]
sound/squeezelite/patches/010-select_broadcast_interface.patch [new file with mode: 0644]
sound/squeezelite/patches/020-no_mpg123.patch [new file with mode: 0644]
sound/squeezelite/patches/030-fix_musl_compatibilty.patch [new file with mode: 0644]
sound/squeezelite/patches/040-clear_dynlink_errors.patch [new file with mode: 0644]
sound/svox/Makefile [new file with mode: 0644]
sound/svox/patches/0001-autoconf-building-of-library-using-libtool.patch [new file with mode: 0644]
sound/svox/patches/0002-gitignore-for-autotools-files.patch [new file with mode: 0644]
sound/svox/patches/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch [new file with mode: 0644]
sound/svox/patches/0004-add-header-files.patch [new file with mode: 0644]
sound/svox/patches/0005-Install-lang-files.patch [new file with mode: 0644]
sound/svox/patches/0006-Set-picolangdir.patch [new file with mode: 0644]
sound/svox/patches/0008-64bits.patch [new file with mode: 0644]
sound/svox/patches/0009-Fix-link-order.patch [new file with mode: 0644]
sound/svox/patches/0010-platform.patch [new file with mode: 0644]
sound/svox/patches/0011-subdir.patch [new file with mode: 0644]
sound/svox/patches/0012-no-headers.patch [new file with mode: 0644]
sound/upmpdcli/Config.in [new file with mode: 0644]
sound/upmpdcli/Makefile [new file with mode: 0644]
sound/upmpdcli/files/upmpdcli.config [new file with mode: 0644]
sound/upmpdcli/files/upmpdcli.init [new file with mode: 0644]
sound/upmpdcli/files/upmpdcli.png [new file with mode: 0644]
sound/upmpdcli/patches/010-Add_icon_config.patch [new file with mode: 0644]
utils/bluelog/Makefile [new file with mode: 0644]
utils/bluelog/files/bluelog.init [new file with mode: 0644]
utils/bluelog/patches/100-gen-oui-fix-tempfile-use-mirror.patch [new file with mode: 0644]
utils/bluez/Makefile [new file with mode: 0644]
utils/bluez/files/bluetooth.config [new file with mode: 0644]
utils/bluez/files/bluetooth.dbus [new file with mode: 0644]
utils/bluez/files/bluetoothd.init [new file with mode: 0644]
utils/bluez/files/givepin [new file with mode: 0644]
utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch [new file with mode: 0644]
utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch [new file with mode: 0644]
utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch [new file with mode: 0644]
utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch [new file with mode: 0644]
utils/bluez/patches/200-uart-speed.patch [new file with mode: 0644]
utils/bluez/patches/201-readline.patch [new file with mode: 0644]
utils/collectd/files/collectd.conf [new file with mode: 0644]
utils/collectd/files/collectd.init [new file with mode: 0644]
utils/collectd/patches/001-undefined-AM_PATH_LIBGCRYPT.patch [new file with mode: 0644]
utils/collectd/patches/003-remove-werror.patch [new file with mode: 0644]
utils/collectd/patches/050-upstream-fix-for-network-plugin-ddos.patch [new file with mode: 0644]
utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch [new file with mode: 0644]
utils/collectd/patches/140-fix-fqdnlookup.patch [new file with mode: 0644]
utils/collectd/patches/200-fix-git-describe-error.patch [new file with mode: 0644]
utils/collectd/patches/300-delay-first-read-cycle.patch [new file with mode: 0644]
utils/collectd/patches/400-fix-olsrd-get-all.patch [new file with mode: 0644]
utils/collectd/patches/600-fix-libmodbus-detection.patch [new file with mode: 0644]
utils/collectd/patches/900-add-iwinfo-plugin.patch [new file with mode: 0644]
utils/collectd/patches/920-fix-ping-droprate.patch [new file with mode: 0644]
utils/crelay/Makefile [new file with mode: 0644]
utils/crelay/files/crelay.init [new file with mode: 0644]
utils/crelay/patches/010-link_with_ftdi1.patch [new file with mode: 0644]

diff --git a/lang/chardet/Makefile b/lang/chardet/Makefile
new file mode 100644 (file)
index 0000000..6343b4e
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..c06fa6a
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..414e342
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..11dd2e2
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..40a9ff7
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..0747796
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..18dce36
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..5ae6956
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..5d94774
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..c932cc1
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# 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))
diff --git a/lang/dkjson/Makefile b/lang/dkjson/Makefile
new file mode 100644 (file)
index 0000000..efb0012
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 20013-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:=dkjson
+PKG_VERSION:=2.5
+PKG_RELEASE:=3
+
+PKG_SOURCE_URL:=https://github.com/LuaDist/dkjson.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=e72ba0c9f5d8b8746fc306f6189a819dbb5cd0be
+PKG_LICENSE:=MIT
+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/dkjson
+       SUBMENU:=Lua
+       SECTION:=lang
+       CATEGORY:=Languages
+       TITLE:=DKJSON
+       URL:=http://dkolf.de/src/dkjson-lua.fsl/home
+       MAINTAINER:=Lars Gierth <larsg@systemli.org>
+       DEPENDS:=+lua
+endef
+
+define Package/dkjson/description
+       Lua JSON parser/serializer with UTF-8 support
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/dkjson/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/dkjson.lua $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,dkjson))
diff --git a/lang/erlang/Makefile b/lang/erlang/Makefile
new file mode 100644 (file)
index 0000000..3a86aa5
--- /dev/null
@@ -0,0 +1,339 @@
+#
+# 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:=erlang
+PKG_VERSION:=17.5
+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_LICENSE:=ErlPL-1.1
+PKG_LICENSE_FILES:=EPLICENCE
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_BUILD_DEPENDS:=erlang/host openssl
+PKG_USE_MIPS16:=0
+
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/otp_src_$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/otp_src_$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/erlang/Default
+  SUBMENU:=Erlang
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Erlang/OTP programming language
+  URL:=http://www.erlang.org/
+endef
+
+define Package/erlang/Default/description
+ Erlang/OTP is a general-purpose programming language and runtime
+ environment. Erlang has built-in support for concurrency, distribution
+ and fault tolerance.
+endef
+
+define Package/erlang
+$(call Package/erlang/Default)
+  DEPENDS+= +libncurses +librt +zlib
+  PROVIDES:= erlang-erts=6.4 erlang-kernel=3.2 erlang-sasl=2.4.1 erlang-stdlib=2.4
+endef
+
+define Package/erlang/description
+$(call Package/erlang/Default/description)
+ .
+ This package contains the runtime implementation and a minimal set of
+ modules (erts, kernel, sasl & stdlib).
+endef
+
+
+define Package/erlang-asn1
+$(call Package/erlang/Default)
+  TITLE:=Abstract Syntax Notation One (ASN.1) support
+  VERSION:=3.0.4
+  DEPENDS+= +erlang +erlang-syntax-tools
+endef
+
+define Package/erlang-asn1/description
+$(call Package/erlang/Default/description)
+ .
+ This Erlang/OTP package provides Abstract Syntax Notation One (ASN.1)
+ support.
+endef
+
+
+define Package/erlang-compiler
+$(call Package/erlang/Default)
+  TITLE:=Byte code compiler
+  VERSION:=5.0.4
+  DEPENDS+= +erlang +erlang-hipe
+endef
+
+define Package/erlang-compiler/description
+$(call Package/erlang/Default/description)
+ .
+ This Erlang/OTP package provides a byte code compiler for Erlang which
+ produces highly compact code.
+endef
+
+
+define Package/erlang-crypto
+$(call Package/erlang/Default)
+  TITLE:=Cryptography support
+  VERSION:=3.5
+  DEPENDS+= +erlang +libopenssl
+endef
+
+define Package/erlang-crypto/description
+$(call Package/erlang/Default/description)
+ .
+ This Erlang/OTP package provides functions for computation of message
+ digests, and encryption and decryption functions.
+endef
+
+
+define Package/erlang-hipe
+$(call Package/erlang/Default)
+  TITLE:=High Performance Erlang
+  VERSION:=3.11.3
+  DEPENDS+= +erlang
+endef
+
+define Package/erlang-hipe/description
+$(call Package/erlang/Default/description)
+ .
+ This Erlang/OTP package provides HiPE (High Performance Erlang)
+ support.
+endef
+
+
+define Package/erlang-inets
+$(call Package/erlang/Default)
+  TITLE:=Internet clients and servers
+  VERSION:=5.10.6
+  DEPENDS+= +erlang
+endef
+
+define Package/erlang-inets/description
+$(call Package/erlang/Default/description)
+ .
+ This Erlang/OTP package provides a container for Internet clients and
+ servers. Currently a FTP client, a HTTP client and server, and a tftp
+ client and server have been incorporated in Inets.
+endef
+
+
+define Package/erlang-mnesia
+$(call Package/erlang/Default)
+  TITLE:=Distributed database
+  VERSION:=4.12.5
+  DEPENDS+= +erlang
+endef
+
+define Package/erlang-mnesia/description
+$(call Package/erlang/Default/description)
+ .
+ This Erlang/OTP package provides a distributed DataBase Management
+ System (DBMS), appropriate for telecommunications applications and
+ other Erlang applications which require continuous operation and
+ exhibit soft real-time properties.
+endef
+
+
+define Package/erlang-runtime-tools
+$(call Package/erlang/Default)
+  TITLE:=Low-profile debugging/tracing tools
+  VERSION:=1.8.16
+  DEPENDS+= +erlang
+endef
+
+define Package/erlang-runtime-tools/description
+$(call Package/erlang/Default/description)
+ .
+ This Erlang/OTP package provides low footprint tracing/debugging tools
+ suitable for inclusion in a production system.
+endef
+
+
+define Package/erlang-snmp
+$(call Package/erlang/Default)
+  TITLE:=Simple Network Management Protocol (SNMP) support
+  VERSION:=5.1.1
+  DEPENDS+= +erlang +erlang-asn1
+endef
+
+define Package/erlang-snmp/description
+$(call Package/erlang/Default/description)
+ .
+ This Erlang/OTP package provides Simple Network Management Protocol
+ (SNMP) support including a MIB compiler and tools for creating SNMP
+ agents.
+endef
+
+
+define Package/erlang-ssh
+$(call Package/erlang/Default)
+  TITLE:=Secure Shell (SSH) support
+  VERSION:=3.2
+  DEPENDS+= +erlang +erlang-crypto
+endef
+
+define Package/erlang-ssh/description
+$(call Package/erlang/Default/description)
+ .
+ This Erlang/OTP package provides an implementation of the Secure Shell
+ protocol, with SSH & SFTP support.
+endef
+
+
+define Package/erlang-ssl
+$(call Package/erlang/Default)
+  TITLE:=Secure Sockets Layer (SSL) support
+  VERSION:=6.0
+  DEPENDS+= +erlang +erlang-crypto
+endef
+
+define Package/erlang-ssl/description
+$(call Package/erlang/Default/description)
+ .
+ This Erlang/OTP package provides support for secure communication over
+ sockets.
+endef
+
+
+define Package/erlang-syntax-tools
+$(call Package/erlang/Default)
+  TITLE:=Abstract Erlang syntax trees handling support
+  VERSION:=1.6.18
+  DEPENDS+= +erlang
+endef
+
+define Package/erlang-syntax-tools/description
+$(call Package/erlang/Default/description)
+ .
+ This Erlang/OTP package provides support for handling abstract Erlang
+ syntax trees.
+endef
+
+
+# Host
+
+HOST_CONFIGURE_ARGS += \
+       --disable-hipe \
+       --disable-smp-support \
+       --without-javac
+
+HOST_CFLAGS += -D_GNU_SOURCE
+
+define Host/Compile
+       $(MAKE) -C $(HOST_BUILD_DIR) all
+endef
+
+define Host/Install
+       $(MAKE) -C $(HOST_BUILD_DIR) install
+endef
+
+
+# Target
+
+CONFIGURE_ARGS += \
+       --disable-hipe \
+       --disable-smp-support \
+       --without-javac \
+       --enable-dynamic-ssl-lib
+
+CONFIGURE_VARS += \
+       SHLIB_LD="$(TARGET_CC)" \
+       TARGET_ARCH="$(TARGET_ARCH)" \
+       ac_cv_func_mmap_fixed_mapped=yes \
+       ac_cv_path_WX_CONFIG_PATH=no \
+       erl_xcomp_getaddrinfo=no \
+       erl_xcomp_sysroot="$(STAGING_DIR)"
+
+EXTRA_CFLAGS+=-D_GNU_SOURCE
+EXTRA_LDFLAGS+=-lz
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               noboot
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
+               install
+endef
+
+define Package/erlang/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       for f in epmd erl erlc escript run_erl; do \
+               $(CP) $(PKG_INSTALL_DIR)/usr/bin/$$$$f $(1)/usr/bin/ ; \
+       done
+       $(INSTALL_DIR) $(1)/usr/lib/erlang/bin
+       for f in erl erlc escript run_erl start start.boot start.script start_clean.boot start_erl start_sasl.boot to_erl; do \
+               $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/bin/$$$$f $(1)/usr/lib/erlang/bin/ ; \
+       done
+       $(INSTALL_DIR) $(1)/usr/lib/erlang/lib
+       for m in erts kernel sasl stdlib; do \
+               $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/lib/$$$$m-* $(1)/usr/lib/erlang/lib/ ; \
+               rm -rf $(1)/usr/lib/erlang/lib/$$$$m-*/examples ; \
+               rm -rf $(1)/usr/lib/erlang/lib/$$$$m-*/src ; \
+       done
+       $(INSTALL_DIR) $(1)/usr/lib/erlang
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/erts-* $(1)/usr/lib/erlang/
+       rm -rf $(1)/usr/lib/erlang/erts-*/{doc,include,lib,man,src}
+       rm -rf $(1)/usr/lib/erlang/erts-*/bin/*.src
+       $(INSTALL_DIR) $(1)/usr/lib/erlang/releases
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/releases/* $(1)/usr/lib/erlang/releases/
+       $(SED) 's,%ERL_ROOT%,/usr/lib/erlang,g' \
+               $(1)/usr/lib/erlang/releases/RELEASES.src
+       mv -f $(1)/usr/lib/erlang/releases/RELEASES.src \
+               $(1)/usr/lib/erlang/releases/RELEASES
+       for f in bin/erl bin/start erts-*/bin/erl erts-*/bin/start; do \
+               $(SED) 's,^\(ROOTDIR\)=.*,\1=/usr/lib/erlang,g' \
+                       $(1)/usr/lib/erlang/$$$$f ; \
+       done
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/obj/*/*.a $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/include/*.h $(1)/usr/include/
+endef
+
+define BuildModule
+
+  define Package/erlang-$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/lib/erlang/lib
+       for m in $(2); do \
+               $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/lib/$$$$$$$$m-* $$(1)/usr/lib/erlang/lib/ ; \
+               rm -rf $$(1)/usr/lib/erlang/lib/$$$$$$$$m-*/{examples,priv/obj,src} ; \
+       done
+  endef
+
+  $$(eval $$(call BuildPackage,erlang-$(1)))
+
+endef
+
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,erlang))
+$(eval $(call BuildModule,asn1,asn1))
+$(eval $(call BuildModule,compiler,compiler))
+$(eval $(call BuildModule,crypto,crypto))
+$(eval $(call BuildModule,hipe,hipe))
+$(eval $(call BuildModule,inets,inets))
+$(eval $(call BuildModule,mnesia,mnesia))
+$(eval $(call BuildModule,runtime-tools,runtime_tools))
+$(eval $(call BuildModule,snmp,snmp))
+$(eval $(call BuildModule,ssh,ssh))
+$(eval $(call BuildModule,ssl,ssl))
+$(eval $(call BuildModule,syntax-tools,syntax_tools))
diff --git a/lang/erlang/patches/101-emulator_includes.patch b/lang/erlang/patches/101-emulator_includes.patch
new file mode 100644 (file)
index 0000000..5a413af
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/erts/emulator/Makefile.in
++++ b/erts/emulator/Makefile.in
+@@ -682,7 +682,7 @@ $(OBJDIR)/beam_emu.o: beam/beam_emu.c
+ endif
+ $(OBJDIR)/%.o: beam/%.c
+-      $(V_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
++      $(V_CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@
+ $(OBJDIR)/%.o: $(TARGET)/%.c
+       $(V_CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -c $< -o $@
diff --git a/lang/erlang/patches/102-musl_compat.patch b/lang/erlang/patches/102-musl_compat.patch
new file mode 100644 (file)
index 0000000..d23900e
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/lib/erl_interface/src/connect/ei_resolve.c
++++ b/lib/erl_interface/src/connect/ei_resolve.c
+@@ -642,7 +642,7 @@ struct hostent *ei_gethostbyname_r(const
+ #ifndef HAVE_GETHOSTBYNAME_R
+   return my_gethostbyname_r(name,hostp,buffer,buflen,h_errnop);
+ #else
+-#if (defined(__GLIBC__) || (__FreeBSD_version >= 602000) || defined(__DragonFly__) || defined(__ANDROID__))
++#if (defined(_GNU_SOURCE) || (__FreeBSD_version >= 602000) || defined(__DragonFly__) || defined(__ANDROID__))
+   struct hostent *result;
+   gethostbyname_r(name, hostp, buffer, buflen, &result, h_errnop);
diff --git a/lang/erlang/patches/103-disable_emacs.patch b/lang/erlang/patches/103-disable_emacs.patch
new file mode 100644 (file)
index 0000000..9412195
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/lib/tools/Makefile
++++ b/lib/tools/Makefile
+@@ -23,7 +23,7 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk
+ # Macros
+ # ----------------------------------------------------
+-SUB_DIRECTORIES = c_src src doc/src examples priv emacs
++SUB_DIRECTORIES = c_src src doc/src examples priv
+ include vsn.mk
+ VSN = $(TOOLS_VSN)
diff --git a/lang/et_xmlfile/Makefile b/lang/et_xmlfile/Makefile
new file mode 100644 (file)
index 0000000..f0c0139
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..b0514f4
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..efdf9f4
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# 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))
diff --git a/lang/jamvm/Makefile b/lang/jamvm/Makefile
new file mode 100644 (file)
index 0000000..996dfa0
--- /dev/null
@@ -0,0 +1,67 @@
+#
+# 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:=jamvm
+PKG_VERSION:=2.0.0
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0+
+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_USE_MIPS16:=0
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/jamvm
+  SUBMENU:=Java
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=A compact Java Virtual Machine
+  URL:=http://sourceforge.net/projects/jamvm
+  DEPENDS:=+zlib +libpthread +librt +classpath @!avr32
+endef
+
+define Package/jamvm/description
+ JamVM is a new Java Virtual Machine which conforms to the JVM
+ specification version (blue book). In comparison to most other VM's (free
+ and commercial) it is extremely small.However, unlike other small VMs
+ (e.g. KVM) it is designed to support the full specification, and includes
+ support for object finalisation, Soft/Weak/Phantom References, the Java
+ Native Interface (JNI) and the Reflection API.
+endef
+
+CONFIGURE_ARGS += \
+       --with-java-runtime-library=gnuclasspath \
+       --with-classpath-install-dir=/usr \
+       --disable-int-inlining \
+       --disable-shared \
+       --without-pic
+
+MAKE_FLAGS += \
+       GLIBJ_ZIP=$(STAGING_DIR)/usr/share/classpath/glibj.zip
+
+define Package/jamvm/install
+       $(INSTALL_DIR) $(1)/usr
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/bin \
+               $(PKG_INSTALL_DIR)/usr/share \
+               $(1)/usr/
+endef
+
+define Build/InstallDev
+       $(CP) $(PKG_INSTALL_DIR)/* $(1)/
+endef
+
+$(eval $(call BuildPackage,jamvm))
diff --git a/lang/jdcal/Makefile b/lang/jdcal/Makefile
new file mode 100644 (file)
index 0000000..34d3970
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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))
diff --git a/lang/json4lua/Makefile b/lang/json4lua/Makefile
new file mode 100644 (file)
index 0000000..0e0c9c5
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# 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:=json4lua
+PKG_VERSION:=0.9.53
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/amrhassan/json4lua.git
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+
+PKG_MAINTAINER:=Amr Hassan <amr.hassan@gmail.com>
+PKG_LICENSE=MIT
+
+LUA_MODULE_PATH:=/usr/lib/lua
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/json4lua
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=json4lua
+  URL:=https://github.com/amrhassan/json4lua
+  DEPENDS:=+lua +luasocket
+endef
+
+define Package/json4lua/description
+       JSON and JSONRPC for Lua
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/json4lua/install
+       $(INSTALL_DIR) $(1)/$(LUA_MODULE_PATH)/json
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/json/json.lua $(1)/$(LUA_MODULE_PATH)/json.lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/json/rpc.lua $(1)/$(LUA_MODULE_PATH)/json/rpc.lua
+endef
+
+$(eval $(call BuildPackage,json4lua))
diff --git a/lang/lpeg/Makefile b/lang/lpeg/Makefile
new file mode 100644 (file)
index 0000000..ee8a4ef
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=lpeg
+PKG_VERSION:=0.12.2
+PKG_RELEASE:=1
+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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lpeg
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=LPeg
+  URL:=http://www.inf.puc-rio.br/~roberto/lpeg/
+  DEPENDS:=+lua
+endef
+
+define Package/lpeg/description
+       LPeg is a new pattern-matching library for Lua, based on Parsing Expression Grammars (PEGs)
+endef
+
+define Build/Configure
+endef
+
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Package/lpeg/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lpeg.so $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lpeg))
diff --git a/lang/lua-bencode/Makefile b/lang/lua-bencode/Makefile
new file mode 100644 (file)
index 0000000..a7b898b
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 20013-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:=lua-bencode
+PKG_VERSION:=2.1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://bitbucket.org/wilhelmy/lua-bencode/downloads/
+PKG_HASH:=4624f33ff026bc62990a323ee4953e42d68430c38a1a4726c9cfd77c085b1422
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-bencode
+       SUBMENU:=Lua
+       SECTION:=lang
+       CATEGORY:=Languages
+       TITLE:=lua-bencode
+       URL:=https://bitbucket.org/wilhelmy/lua-bencode
+       MAINTAINER:=Lars Gierth <larsg@systemli.org>
+       DEPENDS:=+lua
+endef
+
+define Package/lua-bencode/description
+       This is a module for the lua programming language for decoding and encoding
+       bencoded data which can be used to read and write torrent files for bittorrent.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+
+define Package/lua-bencode/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/bencode.lua $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-bencode))
diff --git a/lang/lua-cjson/Makefile b/lang/lua-cjson/Makefile
new file mode 100644 (file)
index 0000000..7cdb350
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# 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:=lua-cjson
+PKG_VERSION:=2.1.0
+PKG_RELEASE:=2
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+HOST_BUILD_DEPENDS:=lua/host
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/lua-cjson
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua CJSON parser
+  URL:=https://github.com/mpx/lua-cjson
+  DEPENDS:= +lua
+endef
+
+define Package/lua-cjson/description
+  Lua CJSON is a fast JSON encoding/parsing module for Lua.
+endef
+
+CMAKE_OPTIONS += \
+       -DUSE_LUA=ON
+
+CMAKE_HOST_OPTIONS += \
+       -DLUA_MATH_LIBRARY=m
+
+define Package/lua-cjson/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/cjson.so $(1)/usr/lib/lua/
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/cjson
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/lua/cjson/util.lua $(1)/usr/lib/lua/cjson
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,lua-cjson))
diff --git a/lang/lua-copas/Makefile b/lang/lua-copas/Makefile
new file mode 100644 (file)
index 0000000..4f073e2
--- /dev/null
@@ -0,0 +1,62 @@
+#
+# 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
+
+PKG_NAME:=lua-copas
+PKG_VERSION:=2.0.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/copas.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=f39a80add9f7c010ac979297652bbaaea0360a27
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-copas
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-Copas
+  URL:=https://github.com/keplerproject/copas
+  DEPENDS:=+lua
+endef
+
+define Package/lua-copas/description
+  Copas is a dispatcher based on coroutines that can be used by TCP/IP servers.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               T="$(BUILD_VARIANT)" \
+               PREFIX="$(PKG_INSTALL_DIR)/usr" \
+               install
+endef
+
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Package/lua-copas/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DIR) $(1)/usr/lib/lua/copas
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas.lua $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/ftp.lua $(1)/usr/lib/lua/copas
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/smtp.lua $(1)/usr/lib/lua/copas
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/http.lua $(1)/usr/lib/lua/copas
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/copas/limit.lua $(1)/usr/lib/lua/copas
+endef
+
+$(eval $(call BuildPackage,lua-copas))
diff --git a/lang/lua-copas/patches/makefile.patch b/lang/lua-copas/patches/makefile.patch
new file mode 100644 (file)
index 0000000..10e4734
--- /dev/null
@@ -0,0 +1,15 @@
+--- lua-copas-1.2.1_org/Makefile       2014-06-04 16:39:17.451563827 +0800
++++ lua-copas-1.2.1/Makefile   2014-06-04 16:39:41.115563309 +0800
+@@ -1,10 +1,10 @@
+ # $Id: Makefile,v 1.3 2007/10/29 22:50:16 carregal Exp $
+ # Default prefix
+-PREFIX = /usr/local
++PREFIX ?= $(DESTDIR)/usr
+ # System's lua directory (where Lua libraries are installed)
+-LUA_DIR= $(PREFIX)/share/lua/5.1
++LUA_DIR= $(PREFIX)/lib/lua
+ install:
+       mkdir -p $(LUA_DIR)/copas
diff --git a/lang/lua-coxpcall/Makefile b/lang/lua-coxpcall/Makefile
new file mode 100644 (file)
index 0000000..6ca3ff8
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# 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
+
+PKG_NAME:=lua-coxpcall
+PKG_VERSION:=1.15.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/coxpcall.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=979257892884816c97391dfd7b0a7b30dcc8f479
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-coxpcall
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-Coxpcall
+  URL:=https://github.com/keplerproject/coxpcall
+  DEPENDS:=+lua
+endef
+
+define Package/lua-coxpcall/description
+  Coxpcall encapsulates the protected calls with a coroutine based loop,
+  so errors can be dealed without the usual pcall/xpcall issues with coroutines.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               T="$(BUILD_VARIANT)" \
+               LUA_DIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
+               install
+endef
+
+define Package/lua-coxpcall/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/coxpcall.lua $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-coxpcall))
diff --git a/lang/lua-coxpcall/patches/config.patch b/lang/lua-coxpcall/patches/config.patch
new file mode 100644 (file)
index 0000000..2a1dbfd
--- /dev/null
@@ -0,0 +1,4 @@
+--- lua-coxpcall-1.15.0_org/config     1970-01-01 08:00:00.000000000 +0800
++++ lua-coxpcall-1.15.0/config 2014-06-04 16:51:55.487547258 +0800
+@@ -0,0 +1 @@
++LUA_DIR ?=$(DESTDIR)/usr/lib/lua
diff --git a/lang/lua-lsqlite3/Makefile b/lang/lua-lsqlite3/Makefile
new file mode 100644 (file)
index 0000000..473e215
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# 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:=lsqlite3
+PKG_VERSION:=0.9.3
+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_LICENSE:=MIT
+PKG_MAINTAINER:=Oskari Rauta <oskari.rauta@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)_fsl09w.zip
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lsqlite3
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua wrapper for the SQLite3 library
+  URL:=http://lua.sqlite.org
+  DEPENDS:= +lua +libsqlite3
+endef
+
+define Package/lsqlite3/description
+ LuaSQLite3 is a thin wrapper around the public domain SQLite3 database engine.
+endef
+
+TARGET_CFLAGS += $(FPIC) -std=gnu99
+TARGET_CPPFLAGS += -DLUA_USE_LINUX
+TARGET_LDFLAGS += -llua -lsqlite3 -lpthread
+
+define Build/Compile
+       $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) \
+               -c $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/lsqlite3.c \
+               -o $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/lsqlite3.o \
+               -DSQLITE_VERSION="$(PKG_VERSION)"
+       $(TARGET_CC) $(TARGET_LDFLAGS) -shared \
+               $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/lsqlite3.o \
+               -o $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/lsqlite3.so
+endef
+
+define Package/lsqlite3/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/*.so $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,lsqlite3))
diff --git a/lang/lua-lzlib/Makefile b/lang/lua-lzlib/Makefile
new file mode 100644 (file)
index 0000000..e4094f5
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=lua-lzlib
+PKG_VERSION:=0.4.3
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/LuaDist/lzlib.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=79329a07d8f79c19eadd7ea2752b4c4e1574b015
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-lzlib
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua zlib binding
+  URL:=http://github.com/LuaDist/lzlib
+  DEPENDS:= +lua +zlib
+endef
+
+define Package/lua-lzlib/description
+       A library to access zlib library functions and also to read/write gzip files using an interface similar to the base io package. 
+endef
+
+MAKE_FLAGS += \
+       LUA="$(STAGING_DIR)/usr" \
+       OFLAGS="$(TARGET_CFLAGS)" \
+
+define Package/lua-lzlib/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/zlib.so $(1)/usr/lib/lua/
+
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/gzip.lua $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,lua-lzlib))
diff --git a/lang/lua-lzlib/patches/001-allow_optim_flags.patch b/lang/lua-lzlib/patches/001-allow_optim_flags.patch
new file mode 100644 (file)
index 0000000..78f981d
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/Makefile
++++ b/Makefile
+@@ -14,7 +14,8 @@ LUABIN= $(LUA)/bin
+ ZLIB=../zlib-1.2.3
+ # no need to change anything below here
+-CFLAGS= $(INCS) $(DEFS) $(WARN) -O0 -fPIC
++CFLAGS= $(INCS) $(DEFS) $(WARN) $(OFLAGS) -fPIC
++OFLAGS= -O0
+ WARN= -g -Werror -Wall -pedantic #-ansi
+ INCS= -I$(LUAINC) -I$(ZLIB)
+ LIBS= -L$(ZLIB) -lz -L$(LUALIB) -L$(LUABIN) #-llua51
diff --git a/lang/lua-md5/Makefile b/lang/lua-md5/Makefile
new file mode 100644 (file)
index 0000000..36e0d9d
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-md5
+PKG_VERSION:=1.2
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/md5.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=024b65738b4434860777fc43d7cacaefea29ec60
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-md5
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-MD5
+  URL:=https://github.com/keplerproject/md5
+  DEPENDS:=+lua
+endef
+
+define Package/lua-md5/description
+  MD5 offers basic cryptographic facilities for Lua
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               PREFIX="$(STAGING_DIR)/usr" \
+               LUA_LIBDIR="$(STAGING_DIR)/usr/lib/lua" \
+               clean
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               PREFIX="$(STAGING_DIR)/usr" \
+               LUA_LIBDIR="$(STAGING_DIR)/usr/lib/lua" \
+               LIB_OPTION="-shared" \
+               CC="$(TARGET_CROSS)gcc" \
+               CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+               all
+endef
+
+define Build/Install
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               LUA_LIBDIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
+               LUA_DIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
+               install
+endef
+
+define Package/lua-md5/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/md5.lua $(1)/usr/lib/lua
+       $(INSTALL_DIR) $(1)/usr/lib/lua/md5
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/core.so $(1)/usr/lib/lua/md5/core.so
+endef
+
+$(eval $(call BuildPackage,lua-md5))
diff --git a/lang/lua-md5/patches/config.patch b/lang/lua-md5/patches/config.patch
new file mode 100644 (file)
index 0000000..abea3a8
--- /dev/null
@@ -0,0 +1,19 @@
+--- lua-md5-1.2/config 2014-06-04 16:55:50.000000000 +0800
++++ lua-md5-1.2_new/config     2014-06-04 16:57:54.223539416 +0800
+@@ -1,13 +1,13 @@
+ # Installation directories
+ # Default prefix
+-PREFIX = /usr/local
++PREFIX = /usr
+ # System's libraries directory (where binary libraries are installed)
+-LUA_LIBDIR= $(PREFIX)/lib/lua/5.1
++LUA_LIBDIR= $(PREFIX)/lib/lua
+ # System's lua directory (where Lua libraries are installed)
+-LUA_DIR= $(PREFIX)/share/lua/5.1
++LUA_DIR= $(PREFIX)/lib/lua
+ # Lua includes directory
+ LUA_INC= $(PREFIX)/include
diff --git a/lang/lua-md5/patches/makefile.patch b/lang/lua-md5/patches/makefile.patch
new file mode 100644 (file)
index 0000000..89a2e33
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/Makefile.orig    2014-06-04 17:16:40.083514808 +0800
++++ b/Makefile 2014-06-04 17:17:27.111513780 +0800
+@@ -1,6 +1,6 @@
+ # $Id: Makefile,v 1.7 2007/10/11 00:02:56 carregal Exp $
+-CONFIG= ./config
++CFLAGS+= -fPIC
+ include $(CONFIG)
diff --git a/lang/lua-mobdebug/Makefile b/lang/lua-mobdebug/Makefile
new file mode 100644 (file)
index 0000000..3d11539
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# 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:=lua-mobdebug
+PKG_VERSION:=0.61
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/pkulchenko/MobDebug.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=9a03aa59696647ba3b7f9ae2f29a9f28532a4feb
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-mobdebug
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-MobDebug
+  URL:=https://github.com/pkulchenko/MobDebug
+  DEPENDS:=+lua
+endef
+
+define Package/lua-mobdebug/description
+  MobDebug is a remote debugger for Lua (including Lua 5.1, Lua 5.2, Lua 5.3, and LuaJIT 2.x).
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Build/Install
+endef
+
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Package/lua-mobdebug/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/mobdebug.lua $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-mobdebug))
diff --git a/lang/lua-openssl/Makefile b/lang/lua-openssl/Makefile
new file mode 100644 (file)
index 0000000..6f46e7a
--- /dev/null
@@ -0,0 +1,42 @@
+#
+# Copyright (C) 2016 Amnon Paz <pazamnon@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:=lua-openssl
+PKG_VERSION:=0.6.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Amnon Paz <pazamnon@gmail.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/zhaozg/lua-openssl.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=1b950e6ff8617205cda1a1b612637ef21b9daf96
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/$(PKG_NAME)
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua openSSL binding
+  URL:=http://github.com/zhaozg/lua-openssl
+  DEPENDS:=+lua +libopenssl +librt
+endef
+
+define Package/lua-openssl/description
+    A free, MIT-licensed OpenSSL binding for Lua.
+endef
+
+define Package/$(PKG_NAME)/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/openssl.so $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/lang/lua-openssl/patches/0001-Revise-Makefile.patch b/lang/lua-openssl/patches/0001-Revise-Makefile.patch
new file mode 100644 (file)
index 0000000..e084c0b
--- /dev/null
@@ -0,0 +1,135 @@
+diff --git a/Makefile b/Makefile
+index 6cb1176..6605879 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,85 +1,45 @@
+-T=openssl\r
+-\r
+-PREFIX                ?=/usr/local\r
+-LIB_OPTION    ?= -shared \r
+-\r
+-#Lua auto detect\r
+-LUA_VERSION ?= $(shell pkg-config luajit --print-provides)\r
+-ifeq ($(LUA_VERSION),)                         ############ Not use luajit\r
+-LUAV          ?= $(shell lua -e "_,_,v=string.find(_VERSION,'Lua (.+)');print(v)")\r
+-LUA_CFLAGS    ?= -I$(PREFIX)/include/lua$(LUAV)\r
+-LUA_LIBS      ?= -L$(PREFIX)/lib \r
+-LUA_LIBDIR    ?= $(PREFIX)/lib/lua/$(LUAV)\r
+-else\r
+-LUAV          ?= $(shell lua -e "_,_,v=string.find(_VERSION,'Lua (.+)');print(v)")\r
+-LUA_CFLAGS    ?= $(shell pkg-config luajit --cflags)\r
+-LUA_LIBS      ?= $(shell pkg-config luajit --libs)\r
+-LUA_LIBDIR    ?= $(PREFIX)/lib/lua/$(LUAV)\r
+-endif\r
+-\r
+-#OS auto detect\r
+-SYS := $(shell gcc -dumpmachine)\r
+-\r
+-ifneq (, $(findstring linux, $(SYS)))\r
+-# Do linux things\r
+-LDFLAGS                   = -fPIC -lrt -ldl\r
+-OPENSSL_LIBS  ?= $(shell pkg-config openssl --libs) \r
+-OPENSSL_CFLAGS        ?= $(shell pkg-config openssl --cflags)\r
+-CFLAGS                    = -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS) \r
+-endif\r
+-ifneq (, $(findstring apple, $(SYS)))\r
+-# Do darwin things\r
+-LDFLAGS                   = -fPIC -lrt -ldl\r
+-OPENSSL_LIBS  ?= $(shell pkg-config openssl --libs) \r
+-OPENSSL_CFLAGS        ?= $(shell pkg-config openssl --cflags)\r
+-CFLAGS                    = -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
+-endif\r
+-ifneq (, $(findstring mingw, $(SYS)))\r
+-# Do mingw things\r
+-V                     = $(shell lua -e "v=string.gsub('$(LUAV)','%.','');print(v)")\r
+-LDFLAGS               = -mwindows -lcrypt32 -lssl -lcrypto -lws2_32 $(PREFIX)/bin/lua$(V).dll \r
+-LUA_CFLAGS    = -DLUA_LIB -DLUA_BUILD_AS_DLL -I$(PREFIX)/include/\r
+-CFLAGS                = $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
+-endif\r
+-ifneq (, $(findstring cygwin, $(SYS)))\r
+-# Do cygwin things\r
+-OPENSSL_LIBS  ?= $(shell pkg-config openssl --libs) \r
+-OPENSSL_CFLAGS  ?= $(shell pkg-config openssl --cflags)\r
+-CFLAGS                = -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
+-endif\r
+-#custome config\r
+-ifeq (.config, $(wildcard .config))\r
+-include .config\r
+-endif\r
+-\r
+-LIBNAME= $T.so.$V\r
+-\r
+-#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X\r
+-\r
+-# Compilation directives\r
+-WARN_MOST     = -Wall -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic\r
+-WARN          = -Wall -Wno-unused-value\r
+-WARN_MIN      = \r
+-CFLAGS                += $(WARN_MIN) -DPTHREADS \r
+-CC= gcc -g $(CFLAGS) -Ideps\r
+-\r
+-\r
+-OBJS=src/asn1.o src/auxiliar.o src/bio.o src/cipher.o src/cms.o src/compat.o src/crl.o src/csr.o src/dh.o src/digest.o src/dsa.o \\r
+-src/ec.o src/engine.o src/hmac.o src/lbn.o src/lhash.o src/misc.o src/ocsp.o src/openssl.o src/ots.o src/pkcs12.o src/pkcs7.o    \\r
+-src/pkey.o src/rsa.o src/ssl.o src/th-lock.o src/util.o src/x509.o src/xattrs.o src/xexts.o src/xname.o src/xstore.o src/xalgor.o src/callback.o \r
+-\r
+-.c.o:\r
+-      $(CC) -c -o $@ $?\r
+-\r
+-all: $T.so\r
+-      echo $(SYS)\r
+-\r
+-$T.so: $(OBJS)\r
+-      MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; $(CC) $(CFLAGS) $(LIB_OPTION) -o $T.so $(OBJS) $(OPENSSL_LIBS) $(LUA_LIBS) $(LDFLAGS)\r
+-\r
+-install: all\r
+-      mkdir -p $(LUA_LIBDIR)\r
+-      cp $T.so $(LUA_LIBDIR)\r
+-\r
+-clean:\r
+-      rm -f $T.so $(OBJS) \r
++.PHONY: install clean
++
++PKGC ?= pkg-config
++
++LIBNAME = openssl.so
++LIB_OPTION = -shared
++
++# lua's package config can be under various names
++LUAPKGC := $(shell for pc in lua lua5.1 lua5.2 lua5.3; do \
++              $(PKGC) --exists $$pc && echo $$pc && break; \
++      done)
++
++BUILD_DIR = $(shell pwd)
++
++# LUA include/libraries build flags
++LUA_LIBDIR := $(shell $(PKGC) --variable=libdir $(LUAPKGC))
++LUA_CFLAGS := $(shell $(PKGC) --cflags $(LUAPKGC))
++LUA_LIBS := $(shell $(PKGC) --libs-only-L $(LUAPKGC))
++
++# openssl include/libraries build flags
++OPENSSL_LIBS  = $(shell $(PKGC) openssl --libs)
++OPENSSL_CFLAGS        = $(shell $(PKGC) openssl --cflags)
++
++# openssl include/libraries build flags
++LOCAL_INCLUDE = -I$(BUILD_DIR)/deps
++
++CFLAGS        += -fPIC -DPTHREADS -g $(LOCAL_INCLUDE) $(OPENSSL_CFLAGS) $(LUA_CFLAGS)
++LDFLAGS += -lrt -ldl $(OPENSSL_LIBS) $(LUA_LIBS)
++
++OBJS = src/asn1.o src/auxiliar.o src/bio.o src/cipher.o src/cms.o src/compat.o src/crl.o src/csr.o src/dh.o src/digest.o src/dsa.o src/ec.o src/engine.o src/hmac.o src/lbn.o src/lhash.o src/misc.o src/ocsp.o src/openssl.o src/ots.o src/pkcs12.o src/pkcs7.o src/pkey.o src/rsa.o src/ssl.o src/th-lock.o src/util.o src/x509.o src/xattrs.o src/xexts.o src/xname.o src/xstore.o src/xalgor.o src/callback.o
++
++all: clean $(LIBNAME)
++
++$(LIBNAME): $(OBJS)
++      $(CC) $(LDFLAGS) $(LIB_OPTION) $(OBJS) -o $@
++
++%.o: %.c
++      $(CC) $(CFLAGS) -c $< -o $@
++
++install: all
++      mkdir -p $(LUA_LIBDIR)
++      cp $(LIBNAME) $(LUA_LIBDIR)
++
++clean:
++      rm -f $(LIBNAME) $(OBJS)
diff --git a/lang/lua-openssl/patches/0010-Fix-Linkage.patch b/lang/lua-openssl/patches/0010-Fix-Linkage.patch
new file mode 100644 (file)
index 0000000..52bcf1a
--- /dev/null
@@ -0,0 +1,36 @@
+diff --git a/deps/lua-compat/c-api/compat-5.3.c b/deps/lua-compat/c-api/compat-5.3.c
+index 4395bbc..4a8877c 100644
+--- a/deps/lua-compat/c-api/compat-5.3.c
++++ b/deps/lua-compat/c-api/compat-5.3.c
+@@ -491,17 +491,6 @@ COMPAT53_API int lua_geti (lua_State *L, int index, lua_Integer i) {
+ }
+
+
+-COMPAT53_API int lua_isinteger (lua_State *L, int index) {
+-  if (lua_type(L, index) == LUA_TNUMBER) {
+-    lua_Number n = lua_tonumber(L, index);
+-    lua_Integer i = lua_tointeger(L, index);
+-    if (i == n)
+-      return 1;
+-  }
+-  return 0;
+-}
+-
+-
+ static void compat53_reverse (lua_State *L, int a, int b) {
+   for (; a < b; ++a, --b) {
+     lua_pushvalue(L, a);
+diff --git a/deps/lua-compat/c-api/compat-5.3.h b/deps/lua-compat/c-api/compat-5.3.h
+index 2309294..8e67bae 100644
+--- a/deps/lua-compat/c-api/compat-5.3.h
++++ b/deps/lua-compat/c-api/compat-5.3.h
+@@ -244,9 +244,6 @@ typedef int (*lua_KFunction)(lua_State *L, int status, lua_KContext ctx);
+ #define lua_geti COMPAT53_CONCAT(COMPAT53_PREFIX, _geti)
+ COMPAT53_API int lua_geti (lua_State *L, int index, lua_Integer i);
+
+-#define lua_isinteger COMPAT53_CONCAT(COMPAT53_PREFIX, _isinteger)
+-COMPAT53_API int lua_isinteger (lua_State *L, int index);
+-
+ #define lua_numbertointeger(n, p) \
+   ((*(p) = (lua_Integer)(n)), 1)
+
diff --git a/lang/lua-openssl/patches/0020-support-OPENSSL_NO_SSL3_METHOD.patch b/lang/lua-openssl/patches/0020-support-OPENSSL_NO_SSL3_METHOD.patch
new file mode 100644 (file)
index 0000000..2f29680
--- /dev/null
@@ -0,0 +1,41 @@
+--- lua-openssl-0.6.0.old/src/ssl.c    2016-09-19 08:30:43.735075695 +0200
++++ lua-openssl-0.6.0/src/ssl.c        2016-09-19 09:02:45.733813437 +0200
+@@ -24,12 +24,17 @@
+   SSL_METHOD* method = NULL;
+   const char* ciphers;
+   SSL_CTX* ctx;
+-  if (strcmp(meth, "SSLv3") == 0)
++  if (0);
++
++#ifndef OPENSSL_NO_SSL3
++  else if (strcmp(meth, "SSLv3") == 0)
+     method = SSLv3_method();    /* SSLv3 */
+   else if (strcmp(meth, "SSLv3_server") == 0)
+     method = SSLv3_server_method(); /* SSLv3 */
+   else if (strcmp(meth, "SSLv3_client") == 0)
+     method = SSLv3_client_method(); /* SSLv3 */
++#endif
++
+   else if (strcmp(meth, "SSLv23") == 0)
+     method = SSLv23_method();   /* SSLv3 but can rollback to v2 */
+   else if (strcmp(meth, "SSLv23_server") == 0)
+@@ -79,15 +84,15 @@
+ #endif
+   else
+     luaL_error(L, "#1:%s not supported\n"
+-               "Maybe SSLv3 SSLv23 TLSv1 TLSv1_1 TLSv1_2 DTLSv1 [SSLv2], option followed by _client or _server\n",
+-               "default is SSLv3",
++               "Maybe [SSLv3] SSLv23 TLSv1 TLSv1_1 TLSv1_2 DTLSv1 [SSLv2], option followed by _client or _server\n",
++               "default is TLSv1",
+                meth);
+   ciphers = luaL_optstring(L, 2, SSL_DEFAULT_CIPHER_LIST);
+   ctx = SSL_CTX_new(method);
+   if (!ctx)
+     luaL_error(L, "#1:%s not supported\n"
+-               "Maybe SSLv3 SSLv23 TLSv1 TLSv1_1 TLSv1_2 DTLSv1 [SSLv2], option followed by _client or _server\n",
+-               "default is SSLv3",
++               "Maybe [SSLv3] SSLv23 TLSv1 TLSv1_1 TLSv1_2 DTLSv1 [SSLv2], option followed by _client or _server\n",
++               "default is TLSv1",
+                meth);
+   openssl_newvalue(L, ctx);
+   SSL_CTX_set_cipher_list(ctx, ciphers);
diff --git a/lang/lua-openssl/patches/0030-support-OPENSSL_NO_COMP.patch b/lang/lua-openssl/patches/0030-support-OPENSSL_NO_COMP.patch
new file mode 100644 (file)
index 0000000..44e5330
--- /dev/null
@@ -0,0 +1,20 @@
+--- lua-openssl-0.6.0.old/src/ssl.c    2016-09-19 08:30:43.735075695 +0200
++++ lua-openssl-0.6.0/src/ssl.c        2016-09-19 08:48:37.393737125 +0200
+@@ -1245,7 +1250,7 @@
+   lua_pushinteger(L, st);
+   return 2;
+ }
+-#ifndef LIBRESSL_VERSION_NUMBER
++#if !defined(OPENSSL_NO_COMP) && !defined(LIBRESSL_VERSION_NUMBER)
+ static int openssl_ssl_current_compression(lua_State *L)
+ {
+   SSL* s = CHECK_OBJECT(1, SSL, "openssl.ssl");
+@@ -1803,7 +1808,7 @@
+   {"getfd",     openssl_ssl_getfd},
+
+   {"current_cipher",        openssl_ssl_current_cipher},
+-#ifndef LIBRESSL_VERSION_NUMBER
++#if !defined(OPENSSL_NO_COMP) && !defined(LIBRESSL_VERSION_NUMBER)
+   {"current_compression",   openssl_ssl_current_compression},
+ #endif
+   {"getpeerverification",   openssl_ssl_getpeerverification},
diff --git a/lang/lua-penlight/Makefile b/lang/lua-penlight/Makefile
new file mode 100644 (file)
index 0000000..5c1b72a
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# 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:=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_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE.md
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/$(PKG_NAME)
+  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>
+endef
+
+define Package/$(PKG_NAME)/description
+  It is often said of Lua that it does not include batteries.
+  Penlight is the batteries.
+endef
+
+define Build/Compile
+       echo "Nothing to compile, pure lua package"
+endef
+
+define Package/$(PKG_NAME)/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(CP) $(PKG_BUILD_DIR)/lua/pl $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/lang/lua-rings/Makefile b/lang/lua-rings/Makefile
new file mode 100644 (file)
index 0000000..7b2e270
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# 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:=lua-rings
+PKG_VERSION:=1.3.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/rings.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=2b8a900f8b9dbde304859a3ac9d437795c3fdde3
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_FIXUP:=autoreconf
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-rings
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua-Rings
+  URL:=http://keplerproject.github.io/rings/
+  DEPENDS:=+lua
+endef
+
+define Package/lua-rings/description
+  Rings is a library which provides a way to create new Lua states from within Lua.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+# add make variable overrides here
+MAKE_FLAGS +=
+
+define Build/Configure
+endef
+
+define Package/lua-rings/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/rings.so $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/stable.lua $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,lua-rings))
diff --git a/lang/lua-rings/patches/config.patch b/lang/lua-rings/patches/config.patch
new file mode 100644 (file)
index 0000000..5740fae
--- /dev/null
@@ -0,0 +1,28 @@
+--- lua-rings-1.3.0_org/config 2014-06-04 15:24:24.223662038 +0800
++++ lua-rings-1.3.0/config     2014-06-04 16:16:15.183594040 +0800
+@@ -1,15 +1,15 @@
+ # Installation directories
+ # Default prefix
+-PREFIX ?= /usr/local
++PREFIX ?= /usr
+ DESTDIR ?= /
+ # System's libraries directory (where binary libraries are installed)
+-LUA_LIBDIR ?= $(PREFIX)/lib/lua/5.1
++LUA_LIBDIR ?= $(PREFIX)/lib/lua
+ # System's lua directory (where Lua libraries are installed)
+-LUA_DIR ?= $(PREFIX)/share/lua/5.1
++LUA_DIR ?= $(PREFIX)/lib/lua
+ # Lua includes directory
+ LUA_INC ?= $(PREFIX)/include
+@@ -24,6 +24,5 @@
+ WARN ?= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -Wpointer-arith -pedantic
+ INCS ?= -I$(LUA_INC)
+ CFLAGS ?= $(WARN) $(INCS)
+-CC ?= gcc
+ # $Id: config,v 1.7 2007/10/29 22:51:39 carregal Exp $
diff --git a/lang/lua-rings/patches/makefile.patch b/lang/lua-rings/patches/makefile.patch
new file mode 100644 (file)
index 0000000..8bb0551
--- /dev/null
@@ -0,0 +1,11 @@
+--- lua-rings-1.3.0_org/Makefile       2014-06-04 15:24:37.583661746 +0800
++++ lua-rings-1.3.0/Makefile   2014-06-04 15:23:41.611662970 +0800
+@@ -3,6 +3,8 @@
+ T= rings
+ CONFIG= ./config
++CFLAGS+= -fPIC
++
+ include $(CONFIG)
+ SRCS= src/rings.c
diff --git a/lang/lua-rs232/Makefile b/lang/lua-rs232/Makefile
new file mode 100644 (file)
index 0000000..7ef5ac7
--- /dev/null
@@ -0,0 +1,62 @@
+#
+# 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:=lua-rs232
+PKG_VERSION:=1.0.3
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/srdgame/librs232.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=a9d463181e7f7034fe6a55bc38e845fb04fa93ba
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-rs232
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua Serial Library
+  URL:=https://github.com/srdgame/librs232
+  DEPENDS:= +lua
+endef
+
+define Package/lua-rs232/description
+  multiplatform library for serial communications over RS-232
+endef
+
+CONFIGURE_ARGS += \
+       --with-lua-inc=$(STAGING_DIR)/usr/include \
+       --with-lua-lib=$(STAGING_DIR)/usr/lib
+
+#define Build/Configure
+#      ( cd "$(PKG_BUILD_DIR)"; ./autogen.sh )
+#      $(call Build/Configure/Default)
+#endef
+define Build/Configure
+endef
+
+define Build/Compile
+       (cd "$(PKG_BUILD_DIR)"; $(TARGET_CC)  src/rs232.c src/rs232_posix.c bindings/lua/luars232.c -DLUAROCKS_HACK -std=gnu99 -I./include -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib -fPIC -shared -o luars232.so)
+endef
+
+define Build/Install
+endef
+
+define Package/lua-rs232/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/luars232.so $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,lua-rs232))
diff --git a/lang/lua-sha2/Makefile b/lang/lua-sha2/Makefile
new file mode 100644 (file)
index 0000000..321d6de
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 20013-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:=lua-sha2
+PKG_VERSION:=0.2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/lgierth/lua-sha2.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=02bd4bfdc8062c7e1ae51c5a72906efc0a6375ee
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-sha2
+       SUBMENU:=Lua
+       SECTION:=lang
+       CATEGORY:=Languages
+       TITLE:=Lua binding for Aaron Gifford's SHA-2 implementation
+       URL:=https://code.google.com/p/sha2/
+       MAINTAINER:=Lars Gierth <larsg@systemli.org>
+       DEPENDS:=+lua
+endef
+
+define Package/lua-sha2/description
+       Lua Binding for the SHA-2 (SHA-256/384/512) BSD-licensed C implementation by Aaron Gifford.
+       Also contains a HMAC implementation in Lua.
+endef
+
+TARGET_CFLAGS += -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN
+TARGET_LDFLAGS += -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN
+
+define Build/Configure
+endef
+
+define Package/lua-sha2/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua/hmac
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/sha2.so $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac.lua $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac/sha2.lua $(1)/usr/lib/lua/hmac
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac/md5.lua $(1)/usr/lib/lua/hmac
+endef
+
+$(eval $(call BuildPackage,lua-sha2))
diff --git a/lang/lua-sha2/patches/001-makefile.patch b/lang/lua-sha2/patches/001-makefile.patch
new file mode 100644 (file)
index 0000000..e395044
--- /dev/null
@@ -0,0 +1,14 @@
+From: Lars Gierth <larsg@systemli.org>
+Date: Tue, 2 Sep 2014 00:05:39 +0200
+
+    Add rump Makefile
+
+new file mode 100644
+index 0000000..f081d38
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,4 @@
++all: sha2.o sha2lib.o
++      $(CC) -shared -o sha2.so sha2.o sha2lib.o
++
++.PHONY: all
diff --git a/lang/lua-wsapi/Makefile b/lang/lua-wsapi/Makefile
new file mode 100644 (file)
index 0000000..5117596
--- /dev/null
@@ -0,0 +1,95 @@
+#
+# 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:=lua-wsapi
+PKG_VERSION:=1.6.1
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/wsapi.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=eed8338401196cc155e59280adbe58d78933ead0
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-wsapi/Default
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua WSAPI
+  URL:=https://keplerproject.github.io/wsapi/
+  DEPENDS:= +lua
+endef
+
+define Package/lua-wsapi/Default/description
+  WSAPI is an API that abstracts the web server from Lua web applications
+endef
+
+
+define Package/lua-wsapi-base
+$(call Package/lua-wsapi/Default)
+  TITLE+= base
+  DEPENDS+= +luafilesystem
+  VARIANT:=base
+endef
+
+define Package/lua-wsapi-base/description
+$(call Package/lua-wsapi/Default/description)
+ .
+ This package contains the basic stuff.
+endef
+
+define Package/lua-wsapi-xavante
+$(call Package/lua-wsapi/Default)
+  TITLE+= xavante
+  DEPENDS+= +lua-wsapi-base +lua-xavante
+  VARIANT:=xavante
+endef
+
+define Package/lua-wsapi-xavante/description
+$(call Package/lua-wsapi/Default/description)
+ .
+ This package contains the Xavante stuff.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Build/Install
+endef
+
+define Package/lua-wsapi-base/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/wsapi.lua $(1)/usr/lib/lua
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/launcher/wsapi.cgi $(1)/usr/bin
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/wsapi
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/wsapi/{common,request,response,util,cgi,sapi,ringer,mock}.lua $(1)/usr/lib/lua/wsapi
+endef
+
+define Package/lua-wsapi-xavante/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/launcher/wsapi $(1)/usr/bin
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/wsapi
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/wsapi/xavante.lua $(1)/usr/lib/lua/wsapi
+endef
+
+
+$(eval $(call BuildPackage,lua-wsapi-base))
+$(eval $(call BuildPackage,lua-wsapi-xavante))
diff --git a/lang/lua-xavante/Makefile b/lang/lua-xavante/Makefile
new file mode 100644 (file)
index 0000000..71ed8bd
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# 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:=lua-xavante
+PKG_VERSION:=2.3.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/xavante.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=9825b905133e14d37a4c179f2d02367ab93f1ef6
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-xavante
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Xavante Web Server
+  URL:=http://keplerproject.github.io/xavante/
+  DEPENDS:= +lua
+endef
+
+define Package/lua-xavante/description
+  Xavante is a Lua HTTP 1.1 Web server that uses a modular architecture based on URI mapped handlers.
+endef
+
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Build/Install
+endef
+
+define Package/lua-xavante/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/sajax/sajax.lua $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/xavante/xavante.lua $(1)/usr/lib/lua
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/xavante
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/xavante/{cgiluahandler,encoding,filehandler,httpd,mime,patternhandler,redirecthandler,vhostshandler,indexhandler,urlhandler,ruleshandler}.lua $(1)/usr/lib/lua/xavante
+endef
+
+$(eval $(call BuildPackage,lua-xavante))
diff --git a/lang/luabitop/Makefile b/lang/luabitop/Makefile
new file mode 100644 (file)
index 0000000..6153c8d
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# 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:=luabitop
+PKG_VERSION:=1.0.2
+PKG_RELEASE:=1
+
+_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_BUILD_DIR:=$(BUILD_DIR)/$(_BASENAME)-$(PKG_VERSION)
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luabitop
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=luabitop
+  URL:=http://bitop.luajit.org/
+  DEPENDS:=+liblua
+endef
+
+define Package/luabitop/description
+Lua BitOp is a C extension module for Lua 5.1/5.2 which adds bitwise operations on numbers.
+endef
+
+define Build/Configure
+endef
+
+
+TARGET_CFLAGS += $(FPIC) -DLUA_USE_LINUX -DLUA_NUMBER_DOUBLE
+
+define Build/Compile
+       $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_CPPFLAGS) -std=gnu99 $(FPIC) -DLUA_USE_LINUX -shared -o $(PKG_BUILD_DIR)/bit.so $(PKG_BUILD_DIR)/bit.c
+endef
+
+define Package/luabitop/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bit.so $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,luabitop))
diff --git a/lang/luaexpat/Makefile b/lang/luaexpat/Makefile
new file mode 100644 (file)
index 0000000..eae164f
--- /dev/null
@@ -0,0 +1,56 @@
+# 
+# Copyright (C) 2009 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:=luaexpat
+PKG_VERSION:=1.3.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://matthewwild.co.uk/projects/luaexpat
+PKG_MD5SUM:=3c20b5795e7107f847f8da844fbfe2da
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luaexpat
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=LuaExpat 
+  URL:=http://matthewwild.co.uk/projects/luaexpat/
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+  DEPENDS:=+lua +libexpat
+endef
+
+define Package/luaexpat/description
+  LuaExpat is a SAX XML parser based on the Expat library.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(CP) files/compat-5.1r5 $(PKG_BUILD_DIR)/compat-5.1r5
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+       EXPAT_INC="-I$(STAGING_DIR)/usr/include/" \
+       LUA_INC="-I$(STAGING_DIR)/usr/include/" \
+       LUA_LIBDIR="$(STAGING_DIR)/usr/lib/" \
+       COMPAT_DIR="$(PKG_BUILD_DIR)/compat-5.1r5" \
+       LDFLAGS="-shared $(TARGET_LDFLAGS)" \
+       CC="$(TARGET_CC) $(TARGET_CFLAGS) $(FPIC) -std=c99" \
+       LD="$(TARGET_CROSS)ld -shared" 
+endef
+
+define Package/luaexpat/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lxp.so $(1)/usr/lib/lua/lxp.so
+       $(INSTALL_DIR) $(1)/usr/lib/lua/lxp
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lxp/lom.lua $(1)/usr/lib/lua/lxp
+endef
+
+$(eval $(call BuildPackage,luaexpat))
diff --git a/lang/luaexpat/files/compat-5.1r5/compat-5.1.c b/lang/luaexpat/files/compat-5.1r5/compat-5.1.c
new file mode 100644 (file)
index 0000000..6fdb8b7
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+** Compat-5.1
+** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat)
+** $Id: compat-5.1.c,v 1.13 2006/02/20 21:12:47 carregal Exp $
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include "lua.h"
+#include "lauxlib.h"
+#include "compat-5.1.h"
+
+static void getfield(lua_State *L, int idx, const char *name) {
+    const char *end = strchr(name, '.');
+    lua_pushvalue(L, idx);
+    while (end) {
+        lua_pushlstring(L, name, end - name);
+        lua_gettable(L, -2);
+        lua_remove(L, -2);
+        if (lua_isnil(L, -1)) return;
+        name = end+1;
+        end = strchr(name, '.');
+    }
+    lua_pushstring(L, name);
+    lua_gettable(L, -2);
+    lua_remove(L, -2);
+}
+
+static void setfield(lua_State *L, int idx, const char *name) {
+    const char *end = strchr(name, '.');
+    lua_pushvalue(L, idx);
+    while (end) {
+        lua_pushlstring(L, name, end - name);
+        lua_gettable(L, -2);
+        /* create table if not found */
+        if (lua_isnil(L, -1)) {
+            lua_pop(L, 1);
+            lua_newtable(L);
+            lua_pushlstring(L, name, end - name);
+            lua_pushvalue(L, -2);
+            lua_settable(L, -4);
+        }
+        lua_remove(L, -2);
+        name = end+1;
+        end = strchr(name, '.');
+    }
+    lua_pushstring(L, name);
+    lua_pushvalue(L, -3);
+    lua_settable(L, -3);
+    lua_pop(L, 2);
+}
+
+LUALIB_API void luaL_module(lua_State *L, const char *libname,
+                              const luaL_reg *l, int nup) {
+  if (libname) {
+    getfield(L, LUA_GLOBALSINDEX, libname);  /* check whether lib already exists */
+    if (lua_isnil(L, -1)) { 
+      int env, ns;
+      lua_pop(L, 1); /* get rid of nil */
+      lua_pushliteral(L, "require");
+      lua_gettable(L, LUA_GLOBALSINDEX); /* look for require */
+      lua_getfenv(L, -1); /* getfenv(require) */
+      lua_remove(L, -2); /* remove function require */
+      env = lua_gettop(L);
+
+      lua_newtable(L); /* create namespace for lib */
+      ns = lua_gettop(L);
+      getfield(L, env, "package.loaded"); /* get package.loaded table */
+      if (lua_isnil(L, -1)) { /* create package.loaded table */
+          lua_pop(L, 1); /* remove previous result */
+          lua_newtable(L);
+          lua_pushvalue(L, -1);
+          setfield(L, env, "package.loaded");
+      }
+      else if (!lua_istable(L, -1))
+        luaL_error(L, "name conflict for library `%s'", libname);
+      lua_pushstring(L, libname);
+      lua_pushvalue(L, ns); 
+      lua_settable(L, -3); /* package.loaded[libname] = ns */
+      lua_pop(L, 1); /* get rid of package.loaded table */
+      lua_pushvalue(L, ns); /* copy namespace */
+      setfield(L, LUA_GLOBALSINDEX, libname);
+      lua_remove (L, env); /* remove env */
+    }
+    lua_insert(L, -(nup+1));  /* move library table to below upvalues */
+  }
+  for (; l->name; l++) {
+    int i;
+    lua_pushstring(L, l->name);
+    for (i=0; i<nup; i++)  /* copy upvalues to the top */
+      lua_pushvalue(L, -(nup+1));
+    lua_pushcclosure(L, l->func, nup);
+    lua_settable(L, -(nup+3));
+  }
+  lua_pop(L, nup);  /* remove upvalues */
+}
+
diff --git a/lang/luaexpat/files/compat-5.1r5/compat-5.1.h b/lang/luaexpat/files/compat-5.1r5/compat-5.1.h
new file mode 100644 (file)
index 0000000..97570d9
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+** Compat-5.1
+** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat/)
+** $Id: compat-5.1.h,v 1.8 2006/02/20 21:12:47 carregal Exp $
+*/
+
+#ifndef COMPAT_H
+
+LUALIB_API void luaL_module(lua_State *L, const char *libname,
+                                       const luaL_reg *l, int nup);
+#define luaL_openlib luaL_module
+
+#endif
diff --git a/lang/luaexpat/files/compat-5.1r5/compat-5.1.lua b/lang/luaexpat/files/compat-5.1r5/compat-5.1.lua
new file mode 100644 (file)
index 0000000..0938d56
--- /dev/null
@@ -0,0 +1,267 @@
+--
+-- Compat-5.1
+-- Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat)
+-- According to Lua 5.1
+-- $Id: compat-5.1.lua,v 1.22 2006/02/20 21:12:47 carregal Exp $
+--
+
+_COMPAT51 = "Compat-5.1 R5"
+
+local LUA_DIRSEP = '/'
+local LUA_OFSEP = '_'
+local OLD_LUA_OFSEP = ''
+local POF = 'luaopen_'
+local LUA_PATH_MARK = '?'
+local LUA_IGMARK = ':'
+
+local assert, error, getfenv, ipairs, loadfile, loadlib, pairs, setfenv, setmetatable, type = assert, error, getfenv, ipairs, loadfile, loadlib, pairs, setfenv, setmetatable, type
+local find, format, gfind, gsub, sub = string.find, string.format, string.gfind, string.gsub, string.sub
+
+--
+-- avoid overwriting the package table if it's already there
+--
+package = package or {}
+local _PACKAGE = package
+
+package.path = LUA_PATH or os.getenv("LUA_PATH") or
+             ("./?.lua;" ..
+              "/usr/local/share/lua/5.0/?.lua;" ..
+              "/usr/local/share/lua/5.0/?/?.lua;" ..
+              "/usr/local/share/lua/5.0/?/init.lua" )
+package.cpath = LUA_CPATH or os.getenv("LUA_CPATH") or
+             "./?.so;" ..
+             "./l?.so;" ..
+             "/usr/local/lib/lua/5.0/?.so;" ..
+             "/usr/local/lib/lua/5.0/l?.so"
+
+--
+-- make sure require works with standard libraries
+--
+package.loaded = package.loaded or {}
+package.loaded.debug = debug
+package.loaded.string = string
+package.loaded.math = math
+package.loaded.io = io
+package.loaded.os = os
+package.loaded.table = table 
+package.loaded.base = _G
+package.loaded.coroutine = coroutine
+local _LOADED = package.loaded
+
+--
+-- avoid overwriting the package.preload table if it's already there
+--
+package.preload = package.preload or {}
+local _PRELOAD = package.preload
+
+
+--
+-- looks for a file `name' in given path
+--
+local function findfile (name, pname)
+       name = gsub (name, "%.", LUA_DIRSEP)
+       local path = _PACKAGE[pname]
+       assert (type(path) == "string", format ("package.%s must be a string", pname))
+       for c in gfind (path, "[^;]+") do
+               c = gsub (c, "%"..LUA_PATH_MARK, name)
+               local f = io.open (c)
+               if f then
+                       f:close ()
+                       return c
+               end
+       end
+       return nil -- not found
+end
+
+
+--
+-- check whether library is already loaded
+--
+local function loader_preload (name)
+       assert (type(name) == "string", format (
+               "bad argument #1 to `require' (string expected, got %s)", type(name)))
+       assert (type(_PRELOAD) == "table", "`package.preload' must be a table")
+       return _PRELOAD[name]
+end
+
+
+--
+-- Lua library loader
+--
+local function loader_Lua (name)
+       assert (type(name) == "string", format (
+               "bad argument #1 to `require' (string expected, got %s)", type(name)))
+       local filename = findfile (name, "path")
+       if not filename then
+               return false
+       end
+       local f, err = loadfile (filename)
+       if not f then
+               error (format ("error loading module `%s' (%s)", name, err))
+       end
+       return f
+end
+
+
+local function mkfuncname (name)
+       name = gsub (name, "^.*%"..LUA_IGMARK, "")
+       name = gsub (name, "%.", LUA_OFSEP)
+       return POF..name
+end
+
+local function old_mkfuncname (name)
+       --name = gsub (name, "^.*%"..LUA_IGMARK, "")
+       name = gsub (name, "%.", OLD_LUA_OFSEP)
+       return POF..name
+end
+
+--
+-- C library loader
+--
+local function loader_C (name)
+       assert (type(name) == "string", format (
+               "bad argument #1 to `require' (string expected, got %s)", type(name)))
+       local filename = findfile (name, "cpath")
+       if not filename then
+               return false
+       end
+       local funcname = mkfuncname (name)
+       local f, err = loadlib (filename, funcname)
+       if not f then
+               funcname = old_mkfuncname (name)
+               f, err = loadlib (filename, funcname)
+               if not f then
+                       error (format ("error loading module `%s' (%s)", name, err))
+               end
+       end
+       return f
+end
+
+
+local function loader_Croot (name)
+       local p = gsub (name, "^([^.]*).-$", "%1")
+       if p == "" then
+               return
+       end
+       local filename = findfile (p, "cpath")
+       if not filename then
+               return
+       end
+       local funcname = mkfuncname (name)
+       local f, err, where = loadlib (filename, funcname)
+       if f then
+               return f
+       elseif where ~= "init" then
+               error (format ("error loading module `%s' (%s)", name, err))
+       end
+end
+
+-- create `loaders' table
+package.loaders = package.loaders or { loader_preload, loader_Lua, loader_C, loader_Croot, }
+local _LOADERS = package.loaders
+
+
+--
+-- iterate over available loaders
+--
+local function load (name, loaders)
+       -- iterate over available loaders
+       assert (type (loaders) == "table", "`package.loaders' must be a table")
+       for i, loader in ipairs (loaders) do
+               local f = loader (name)
+               if f then
+                       return f
+               end
+       end
+       error (format ("module `%s' not found", name))
+end
+
+-- sentinel
+local sentinel = function () end
+
+--
+-- new require
+--
+function _G.require (modname)
+       assert (type(modname) == "string", format (
+               "bad argument #1 to `require' (string expected, got %s)", type(name)))
+       local p = _LOADED[modname]
+       if p then -- is it there?
+               if p == sentinel then
+                       error (format ("loop or previous error loading module '%s'", modname))
+               end
+               return p -- package is already loaded
+       end
+       local init = load (modname, _LOADERS)
+       _LOADED[modname] = sentinel
+       local actual_arg = _G.arg
+       _G.arg = { modname }
+       local res = init (modname)
+       if res then
+               _LOADED[modname] = res
+       end
+       _G.arg = actual_arg
+       if _LOADED[modname] == sentinel then
+               _LOADED[modname] = true
+       end
+       return _LOADED[modname]
+end
+
+
+-- findtable
+local function findtable (t, f)
+       assert (type(f)=="string", "not a valid field name ("..tostring(f)..")")
+       local ff = f.."."
+       local ok, e, w = find (ff, '(.-)%.', 1)
+       while ok do
+               local nt = rawget (t, w)
+               if not nt then
+                       nt = {}
+                       t[w] = nt
+               elseif type(t) ~= "table" then
+                       return sub (f, e+1)
+               end
+               t = nt
+               ok, e, w = find (ff, '(.-)%.', e+1)
+       end
+       return t
+end
+
+--
+-- new package.seeall function
+--
+function _PACKAGE.seeall (module)
+       local t = type(module)
+       assert (t == "table", "bad argument #1 to package.seeall (table expected, got "..t..")")
+       local meta = getmetatable (module)
+       if not meta then
+               meta = {}
+               setmetatable (module, meta)
+       end
+       meta.__index = _G
+end
+
+
+--
+-- new module function
+--
+function _G.module (modname, ...)
+       local ns = _LOADED[modname]
+       if type(ns) ~= "table" then
+               ns = findtable (_G, modname)
+               if not ns then
+                       error (string.format ("name conflict for module '%s'", modname))
+               end
+               _LOADED[modname] = ns
+       end
+       if not ns._NAME then
+               ns._NAME = modname
+               ns._M = ns
+               ns._PACKAGE = gsub (modname, "[^.]*$", "")
+       end
+       setfenv (2, ns)
+       for i, f in ipairs (arg) do
+               f (ns)
+       end
+end
diff --git a/lang/luafilesystem/Makefile b/lang/luafilesystem/Makefile
new file mode 100644 (file)
index 0000000..13abef6
--- /dev/null
@@ -0,0 +1,66 @@
+#
+# Copyright (C) 2008-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:=luafilesystem
+PKG_VERSION:=1.6.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/luafilesystem.git
+PKG_SOURCE_VERSION:=2fd989cd6c777583be1c93616018c55b2cbb1bcf
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luafilesystem
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=LuaFileSystem
+  URL:=http://keplerproject.github.com/luafilesystem/
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+  DEPENDS:=+liblua
+endef
+
+define Package/luafilesystem/description
+ This package contains the LuaFileSystem library, a set of portable
+ functions for directory creation, listing and deletion and for file
+ locking.
+endef
+
+define Build/Configure
+endef
+
+TARGET_CFLAGS += $(FPIC) $(TARGET_CPPFLAGS)
+
+TARGET_LDFLAGS += -llua
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS) -std=gnu99" \
+               LDFLAGS="$(TARGET_LDFLAGS)"
+       $(TARGET_CROSS)ar r $(PKG_BUILD_DIR)/src/luafilesystem.a $(PKG_BUILD_DIR)/src/lfs.o
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/include
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lfs.h $(STAGING_DIR)/usr/include
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/lfs.so $(STAGING_DIR)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/luafilesystem.a $(STAGING_DIR)/usr/lib/lua
+endef
+
+define Package/luafilesystem/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/lfs.so $(1)/usr/lib/lua/lfs.so
+endef
+
+$(eval $(call BuildPackage,luafilesystem))
diff --git a/lang/luai2c/Makefile b/lang/luai2c/Makefile
new file mode 100755 (executable)
index 0000000..5022b49
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# 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:=luai2c
+PKG_VERSION:=1.0.0
+PKG_RELEASE:=3
+PKG_MAINTAINER:=Frank Edelhaeuser <mrpace2@gmail.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/mrpace2/i2c-lua.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luai2c
+       SUBMENU:=Lua
+       SECTION:=lang
+       CATEGORY:=Languages
+       TITLE:=Lua I2C binding
+       URL:=https://github.com/mrpace2/i2c-lua/
+       DEPENDS:=+liblua +kmod-i2c-core
+       MAINTAINER:=Frank Edelhaeuser <mrpace2@gmail.com>
+endef
+
+define Package/luai2c/description
+       This is the Lua binding for I2C. It provides access to I2C slaves supported by the kernel.
+endef
+
+define Package/luai2c/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/i2c.so $(1)/usr/lib/lua
+       $(INSTALL_DIR) $(1)/usr/lib/lua/i2c
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/* $(1)/usr/lib/lua/i2c
+endef
+
+$(eval $(call BuildPackage,luai2c))
diff --git a/lang/lualanes/Makefile b/lang/lualanes/Makefile
new file mode 100644 (file)
index 0000000..749709d
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# 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:=lualanes
+PKG_REV:=aa9bfcf2dd49f55f11b27e7c21d5b75d81ccfc7e
+PKG_VERSION:=3.9.4
+PKG_RELEASE=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_SOURCE_URL:=https://github.com/LuaLanes/lanes.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+PKG_BUILD_DEPENDS:=lua/host luac/host
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lualanes
+       SUBMENU:=Lua
+       SECTION:=lang
+       CATEGORY:=Languages
+       TITLE:=LuaLanes
+       URL:=http://luaforge.net/projects/lanes/
+       DEPENDS:=+lua +luac +liblua +libpthread
+       MAINTAINER:=Vladimir Malyutin <first-leon@yandex.ru>
+endef
+
+define Package/lualanes/description
+       Lanes is a lightweight, native, lazy evaluating multithreading library for Lua 5.1 and 5.2.
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) all \
+        CC="$(TARGET_CC)" \
+        LUA="$(STAGING_DIR_HOSTPKG)/bin/lua" \
+        LUAC="$(STAGING_DIR_HOSTPKG)/bin/luac" \
+        OPT_FLAGS="$(TARGET_CFLAGS) --std=c99 -Dpthread_yield=sched_yield"
+endef
+
+define Package/lualanes/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/lanes.lua $(1)/usr/lib/lua/
+       $(INSTALL_DIR) $(1)/usr/lib/lua/lanes
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lanes/core.so $(1)/usr/lib/lua/lanes/core.so
+endef
+
+$(eval $(call BuildPackage,lualanes))
diff --git a/lang/lualanes/patches/100-musl-compat.patch b/lang/lualanes/patches/100-musl-compat.patch
new file mode 100644 (file)
index 0000000..ba3f49f
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/src/threading.h b/src/threading.h
+index bfa9ab8..7b3d6a1 100644
+--- a/src/threading.h
++++ b/src/threading.h
+@@ -128,7 +128,7 @@ enum e_status { PENDING, RUNNING, WAITING, DONE, ERROR_ST, CANCELLED };
+   #endif // PLATFORM_WIN32
+   #include <pthread.h>
+-  #ifdef PLATFORM_LINUX
++  #if defined(PLATFORM_LINUX) && defined(__UCLIBC__)
+   # define _MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
+   #else
+     /* OS X, ... */
diff --git a/lang/luaposix/Makefile b/lang/luaposix/Makefile
new file mode 100644 (file)
index 0000000..9bf3628
--- /dev/null
@@ -0,0 +1,61 @@
+#
+# Copyright (C) 2011 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:=luaposix
+PKG_VERSION:=v33.2.1
+PKG_RELEASE:=5
+
+PKG_SOURCE:=release-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/luaposix/luaposix/archive/
+PKG_MD5SUM:=aa68b5c07ab1ecea81bb466c81e88056
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-release-$(PKG_VERSION)
+PKG_REMOVE_FILES:=aclocal.m4
+PKG_FIXUP:=autoreconf
+PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luaposix
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=luaposix
+  URL:=http://luaforge.net/projects/luaposix/
+  DEPENDS:=+lua +librt
+  PKG_BUILD_DEPENDS:=+lua/host
+endef
+
+define Package/luaposix/description
+  luaposix is a general POSIX library for Lua providing access
+  to various low level libc functions.
+endef
+
+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
+endif
+
+ifneq ($(CONFIG_USE_GLIBC),)
+  ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),)
+    TARGET_CFLAGS += -DNO_GETLOGIN
+  endif
+endif
+
+
+define Package/luaposix/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua/posix
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ext/posix/.libs/posix.so $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/posix.lua $(1)/usr/lib/lua
+endef
+
+$(eval $(call BuildPackage,luaposix))
diff --git a/lang/luaposix/patches/100-eglibc-compat.patch b/lang/luaposix/patches/100-eglibc-compat.patch
new file mode 100644 (file)
index 0000000..e4df63b
--- /dev/null
@@ -0,0 +1,30 @@
+diff --git a/ext/posix/unistd.c b/ext/posix/unistd.c
+index 9276640..69c8cef 100644
+--- a/ext/posix/unistd.c
++++ b/ext/posix/unistd.c
+@@ -525,6 +525,7 @@ Pgetgroups(lua_State *L)
+ #endif
++#ifndef NO_GETLOGIN
+ /***
+ Current logged-in user.
+ @treturn[1] string username, if successful
+@@ -537,6 +538,7 @@ Pgetlogin(lua_State *L)
+       checknargs(L, 0);
+       return pushstringresult(getlogin());
+ }
++#endif
+ /***
+@@ -1044,7 +1046,9 @@ static const luaL_Reg posix_unistd_fns[] =
+       LPOSIX_FUNC( Pgetegid           ),
+       LPOSIX_FUNC( Pgeteuid           ),
+       LPOSIX_FUNC( Pgetgid            ),
++#ifndef NO_GETLOGIN
+       LPOSIX_FUNC( Pgetlogin          ),
++#endif
+       LPOSIX_FUNC( Pgetpgrp           ),
+       LPOSIX_FUNC( Pgetpid            ),
+       LPOSIX_FUNC( Pgetppid           ),
diff --git a/lang/luaposix/patches/101-disable-curses.patch b/lang/luaposix/patches/101-disable-curses.patch
new file mode 100644 (file)
index 0000000..6412799
--- /dev/null
@@ -0,0 +1,32 @@
+diff --git a/configure.ac b/configure.ac
+index dfd4199..19924d0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -153,15 +153,6 @@ AC_CHECK_LIB([rt], [clock_gettime])
+ AC_SUBST([LIBRT], [$LIBS])
+ LIBS=$save_LIBS
+-## Curses
+-AX_WITH_CURSES
+-AC_ARG_VAR(CURSES_LIB, [linker flags for curses library])
+-
+-save_LIBS=$LIBS
+-LIBS="$CURSES_LIB $LIBS"
+-AC_CHECK_FUNCS([resizeterm])
+-LIBS=$save_LIBS
+-
+ ## Use system implementation, or bundled replacement?
+ AC_CHECK_FUNCS([strlcpy])
+diff --git a/ext/posix/posix.c b/ext/posix/posix.c
+index 6019df0..2d75487 100644
+--- a/ext/posix/posix.c
++++ b/ext/posix/posix.c
+@@ -12,7 +12,6 @@
+ #include "bit32.c"
+ #include "ctype.c"
+-#include "curses.c"
+ #include "dirent.c"
+ #include "errno.c"
+ #include "fcntl.c"
diff --git a/lang/luaposix/patches/102-disable-compat-deprecated.diff b/lang/luaposix/patches/102-disable-compat-deprecated.diff
new file mode 100644 (file)
index 0000000..7c58be4
--- /dev/null
@@ -0,0 +1,20 @@
+diff --git a/lib/posix.lua.in b/lib/posix.lua.in
+index 17ef39a..a248d9b 100644
+--- a/lib/posix.lua.in
++++ b/lib/posix.lua.in
+@@ -35,15 +35,6 @@ for _, sub in ipairs {
+   end
+ end
+-
+--- Inject deprecated APIs (overwriting submodules) for backwards compatibility.
+-for k, v in pairs (require "posix.deprecated") do
+-  M[k] = v
+-end
+-for k, v in pairs (require "posix.compat") do
+-  M[k] = v
+-end
+-
+ M.version = "posix for " .. _VERSION .. " / @PACKAGE_STRING@"
diff --git a/lang/luarocks/Makefile b/lang/luarocks/Makefile
new file mode 100644 (file)
index 0000000..73dbde7
--- /dev/null
@@ -0,0 +1,62 @@
+#
+# 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:=luarocks
+PKG_VERSION:=2.2.2
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/keplerproject/luarocks.git
+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_LICENSE=GPL
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luarocks
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=luarocks
+  URL:=https://github.com/keplerproject/luarocks
+  DEPENDS:=+lua +luac +liblua +luasocket +unzip +curl +luasec
+endef
+
+define Package/luarocks/description
+       LuaRocks is a deployment and management system for Lua modules.
+endef
+
+# My custom args, copied and modified from SDK_ROOT/include/package-defaults.mk
+CONFIGURE_ARGS = \
+    --prefix=$(CONFIGURE_PREFIX) \
+    --sysconfdir=/etc \
+    --with-lua=$(STAGING_DIR_HOSTPKG)
+
+CONFIGURE_VARS = \
+       LUAROCKS_UNAME_S="Linux" \
+       LUAROCKS_UNAME_M="$(ARCH)"
+
+define Build/Compile
+       $(call Build/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
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-admin-5.1 $(1)/usr/bin/luarocks-admin
+       $(CP) $(PKG_INSTALL_DIR)/usr/share $(1)/usr/share
+       $(CP) $(PKG_INSTALL_DIR)/etc $(1)/etc
+endef
+
+$(eval $(call BuildPackage,luarocks))
diff --git a/lang/luarocks/patches/01_dont_modify_bin_shebang.diff b/lang/luarocks/patches/01_dont_modify_bin_shebang.diff
new file mode 100644 (file)
index 0000000..a1bad21
--- /dev/null
@@ -0,0 +1,13 @@
+diff -rupN luarocks/Makefile luarocks.new/Makefile
+--- luarocks/Makefile  2015-02-19 13:24:07.027310956 +0200
++++ luarocks.new/Makefile      2015-02-22 13:28:24.497353543 +0200
+@@ -104,7 +104,7 @@ build_bins: cleanup_bins
+       for f in $(BIN_FILES) ;\
+       do \
+          sed "1d" src/bin/$$f > src/bin/$$f.bak ;\
+-         echo "#!$(LUA_BINDIR)/lua$(LUA_SUFFIX)" > src/bin/$$f ;\
++         echo "#!/usr/bin/env lua" > src/bin/$$f ;\
+          echo "package.path = [[$(LUADIR)/?.lua;]]..package.path" | sed "s,//,/,g" >> src/bin/$$f ;\
+          cat src/bin/$$f.bak >> src/bin/$$f ;\
+          chmod +x src/bin/$$f ;\
+Binary files luarocks/src/bin/.luarocks.swp and luarocks.new/src/bin/.luarocks.swp differ
diff --git a/lang/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch b/lang/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch
new file mode 100644 (file)
index 0000000..5c9c968
--- /dev/null
@@ -0,0 +1,37 @@
+Index: luarocks-2.2.2/configure
+===================================================================
+--- luarocks-2.2.2.orig/configure
++++ luarocks-2.2.2/configure
+@@ -388,18 +388,22 @@ then
+ fi
+ echo_n "Configuring for system... "
+-if uname -s
+-then
+-   LUAROCKS_UNAME_S=`uname -s`
+-else
+-   die "Could not determine operating system. 'uname -s' failed."
++if [ -z "$LUAROCKS_UNAME_S" ]; then
++    if uname -s
++    then
++        LUAROCKS_UNAME_S=`uname -s`
++    else
++        die "Could not determine operating system. 'uname -s' failed."
++    fi
+ fi
+ echo_n "Configuring for architecture... "
+-if uname -m
+-then
+-   LUAROCKS_UNAME_M=`uname -m`
+-else
+-   die "Could not determine processor architecture. 'uname -m' failed."
++if [ -z "$LUAROCKS_UNAME_M" ]; then
++    if uname -m
++    then
++        LUAROCKS_UNAME_M=`uname -m`
++    else
++        die "Could not determine processor architecture. 'uname -m' failed."
++    fi
+ fi
+ for v in 5.1 5.2 5.3; do
diff --git a/lang/luasec/Makefile b/lang/luasec/Makefile
new file mode 100644 (file)
index 0000000..b2bde57
--- /dev/null
@@ -0,0 +1,61 @@
+#
+# Copyright (C) 2009-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:=luasec
+PKG_VERSION:=0.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/brunoos/luasec/archive/
+PKG_MD5SUM:=14e1aef6d2aae96bbf98afc6b6634af2
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION)
+
+MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luasec
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=LuaSec
+  URL:=https://github.com/brunoos/luasec
+  DEPENDS:=+lua +libopenssl +luasocket
+endef
+
+define Package/luasec/description
+  LuaSec is a binding for OpenSSL library to provide TLS/SSL communication.
+endef
+
+define Build/Configure
+endef
+
+MAKE_FLAGS += \
+       INCDIR="$(TARGET_CPPFLAGS) -I." \
+       LIBDIR="$(TARGET_LDFLAGS) -L./luasocket" \
+       LUACPATH="$(PKG_INSTALL_DIR)/usr/lib/lua" \
+       LUAPATH="$(PKG_INSTALL_DIR)/usr/lib/lua"
+
+define Build/Compile
+$(call Build/Compile/Default,linux)
+endef
+
+define Package/luasec/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lua/ssl.so $(1)/usr/lib/lua/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/ssl.lua $(1)/usr/lib/lua/
+       $(INSTALL_DIR) $(1)/usr/lib/lua/ssl
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lua/ssl/https.lua $(1)/usr/lib/lua/ssl/
+endef
+
+$(eval $(call BuildPackage,luasec))
diff --git a/lang/luasoap/Makefile b/lang/luasoap/Makefile
new file mode 100644 (file)
index 0000000..6ebf03b
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2011 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:=luasoap
+PKG_VERSION:=2014-08-21
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+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_MAINTAINER:=Liu Peng <pengliu@credosemi.com>
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luasoap
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=LuaSOAP
+  URL:=https://github.com/tomasguisasola/luasoap
+  DEPENDS:=+lua +luaexpat +luasec +luasocket
+endef
+
+define Package/luasoap/description
+  LuaSOAP is a library of functions to deal with SOAP.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/luasoap/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/soap.lua $(1)/usr/lib/lua/
+       $(INSTALL_DIR) $(1)/usr/lib/lua/soap
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{client,server}.lua $(1)/usr/lib/lua/soap/
+       $(INSTALL_DIR) $(1)/usr/lib/lua/soap/client
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/client/https.lua $(1)/usr/lib/lua/soap/client/
+       $(INSTALL_DIR) $(1)/usr/lib/lua/soap/tests
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/tests/test{,-http,-server}.lua $(1)/usr/lib/lua/soap/tests/
+endef
+
+$(eval $(call BuildPackage,luasoap))
diff --git a/lang/luasocket/Makefile b/lang/luasocket/Makefile
new file mode 100644 (file)
index 0000000..5e7c983
--- /dev/null
@@ -0,0 +1,63 @@
+#
+# 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
+
+PKG_NAME:=luasocket
+PKG_SOURCE_VERSION:=6d5e40c324c84d9c1453ae88e0ad5bdd0a631448
+PKG_VERSION:=3.0-rc1-20130909
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://github.com/diegonehab/luasocket.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luasocket
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=LuaSocket
+  URL:=http://luasocket.luaforge.net/
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+  DEPENDS:=+lua
+endef
+
+define Package/luasocket/description
+  LuaSocket is the most comprehensive networking support
+  library for the Lua language. It provides easy access to
+  TCP, UDP, DNS, SMTP, FTP, HTTP, MIME and much more.
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR)/ \
+               LIBDIR="$(TARGET_LDFLAGS)" \
+               CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -std=gnu99" \
+               LD="$(TARGET_CROSS)ld -shared" \
+               all
+endef
+
+
+define Package/luasocket/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{ltn12,mime,socket}.lua $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mime.so.1.0.3 $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/socket.so.3.0-rc1 $(1)/usr/lib/lua
+       $(INSTALL_DIR) $(1)/usr/lib/lua/mime
+       ln -sf ../mime.so.1.0.3 $(1)/usr/lib/lua/mime/core.so
+       $(INSTALL_DIR) $(1)/usr/lib/lua/socket
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/{ftp,http,smtp,tp,url,headers}.lua $(1)/usr/lib/lua/socket
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/unix.so $(1)/usr/lib/lua/socket
+       ln -sf ../socket.so.3.0-rc1 $(1)/usr/lib/lua/socket/core.so
+endef
+
+$(eval $(call BuildPackage,luasocket))
diff --git a/lang/luasocket/patches/0001-Add-interface-support.patch b/lang/luasocket/patches/0001-Add-interface-support.patch
new file mode 100644 (file)
index 0000000..3be42ed
--- /dev/null
@@ -0,0 +1,237 @@
+From 96fdf07acf78ecfc9be76a8b0591f38fe6f1a875 Mon Sep 17 00:00:00 2001
+From: Steven Barth <steven@midlink.org>
+Date: Sat, 9 Nov 2013 12:01:42 +0100
+Subject: [PATCH] Add interface resolving
+
+---
+ src/if.c        | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/if.h        |  27 ++++++++++++++
+ src/luasocket.c |   2 +
+ src/makefile    |   2 +
+ src/options.c   |   9 +++++
+ 5 files changed, 153 insertions(+)
+ create mode 100644 src/if.c
+ create mode 100644 src/if.h
+
+diff --git a/src/if.c b/src/if.c
+new file mode 100644
+index 0000000..db231aa
+--- /dev/null
++++ b/src/if.c
+@@ -0,0 +1,113 @@
++/*
++ * $Id: if.c $
++ *
++ * Author: Markus Stenberg <fingon@iki.fi>
++ *
++ * Copyright (c) 2012 cisco Systems, Inc.
++ *
++ * Created:       Tue Dec  4 14:50:34 2012 mstenber
++ * Last modified: Wed Dec  5 18:51:08 2012 mstenber
++ * Edit time:     24 min
++ *
++ */
++
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <net/if.h>
++
++#include "if.h"
++
++#include "lauxlib.h"
++
++static int if_global_indextoname(lua_State *L);
++static int if_global_nametoindex(lua_State *L);
++static int if_global_nameindex(lua_State *L);
++
++static luaL_Reg func[] = {
++    { "indextoname", if_global_indextoname},
++    { "nametoindex", if_global_nametoindex},
++    { "nameindex", if_global_nameindex},
++    { NULL, NULL}
++};
++
++int if_open(lua_State *L)
++{
++    lua_pushstring(L, "iface");
++    lua_newtable(L);
++    luaL_openlib(L, NULL, func, 0);
++    lua_settable(L, -3);
++    return 0;
++}
++
++int if_global_indextoname(lua_State *L)
++{
++  unsigned int ifnumber;
++  const char *name;
++  char buf[IF_NAMESIZE+1];
++
++  if (!lua_isnumber(L, 1))
++    {
++      lua_pushnil(L);
++      lua_pushstring(L, "indextoname expects only number argument");
++      return 2;
++    }
++  ifnumber = lua_tonumber(L, 1);
++  if (!(name = if_indextoname(ifnumber, buf)))
++    {
++      lua_pushnil(L);
++      lua_pushstring(L, "nonexistent interface");
++      return 2;
++    }
++  lua_pushstring(L, name);
++  return 1;
++}
++
++int if_global_nametoindex(lua_State *L)
++{
++  unsigned int ifnumber;
++  if (!lua_isstring(L, 1))
++    {
++      lua_pushnil(L);
++      lua_pushstring(L, "nametoindex expects only string argument");
++      return 2;
++    }
++  if (!(ifnumber = if_nametoindex(lua_tostring(L, 1))))
++    {
++      lua_pushnil(L);
++      lua_pushstring(L, "nonexistent interface");
++      return 2;
++    }
++  lua_pushnumber(L, ifnumber);
++  return 1;
++}
++
++int if_global_nameindex(lua_State *L)
++{
++  struct if_nameindex *ni, *oni;
++  int i = 1;
++  oni = ni = if_nameindex();
++  lua_newtable(L);
++  while (ni && ni->if_index && *(ni->if_name))
++    {
++      /* at result[i], we store.. */
++      lua_pushnumber(L, i);
++
++      /* new table with two items - index, name*/
++      lua_newtable(L);
++      lua_pushstring(L, "index");
++      lua_pushnumber(L, ni->if_index);
++      lua_settable(L, -3);
++
++      lua_pushstring(L, "name");
++      lua_pushstring(L, ni->if_name);
++      lua_settable(L, -3);
++
++      /* Then, actually store it */
++      lua_settable(L, -3);
++
++      i++;
++      ni++;
++    }
++  if_freenameindex(oni);
++  return 1;
++}
+diff --git a/src/if.h b/src/if.h
+new file mode 100644
+index 0000000..dc7faf8
+--- /dev/null
++++ b/src/if.h
+@@ -0,0 +1,27 @@
++/*
++ * $Id: if.h $
++ *
++ * Author: Markus Stenberg <fingon@iki.fi>
++ *
++ *  Copyright (c) 2012 cisco Systems, Inc.
++ *
++ * Created:       Tue Dec  4 14:37:24 2012 mstenber
++ * Last modified: Tue Dec  4 14:51:43 2012 mstenber
++ * Edit time:     7 min
++ *
++ */
++
++/* This module provides Lua wrapping for the advanced socket API
++ * defined in RFC3542, or mainly, the access to the system's interface
++ * list. It is necessary for use of recvmsg/sendmsg.
++ *
++ * TODO - Do something clever with Windows?
++ */
++#ifndef IF_H
++#define IF_H
++
++#include "lua.h"
++
++int if_open(lua_State *L);
++
++#endif /* IF_H */
+diff --git a/src/luasocket.c b/src/luasocket.c
+index e6ee747..85d41a6 100644
+--- a/src/luasocket.c
++++ b/src/luasocket.c
+@@ -31,6 +31,7 @@
+ #include "tcp.h"
+ #include "udp.h"
+ #include "select.h"
++#include "if.h"
+ /*-------------------------------------------------------------------------*\
+ * Internal function prototypes
+@@ -51,6 +52,7 @@ static const luaL_Reg mod[] = {
+     {"tcp", tcp_open},
+     {"udp", udp_open},
+     {"select", select_open},
++    {"iface", if_open},
+     {NULL, NULL}
+ };
+diff --git a/src/makefile b/src/makefile
+index 8d3521e..09d4882 100644
+--- a/src/makefile
++++ b/src/makefile
+@@ -262,6 +262,7 @@ SOCKET_OBJS= \
+       auxiliar.$(O) \
+       options.$(O) \
+       inet.$(O) \
++      if.$(O) \
+       $(SOCKET) \
+       except.$(O) \
+       select.$(O) \
+@@ -387,6 +388,7 @@ auxiliar.$(O): auxiliar.c auxiliar.h
+ buffer.$(O): buffer.c buffer.h io.h timeout.h
+ except.$(O): except.c except.h
+ inet.$(O): inet.c inet.h socket.h io.h timeout.h usocket.h
++if.$(O): if.c if.h
+ io.$(O): io.c io.h timeout.h
+ luasocket.$(O): luasocket.c luasocket.h auxiliar.h except.h \
+       timeout.h buffer.h io.h inet.h socket.h usocket.h tcp.h \
+diff --git a/src/options.c b/src/options.c
+index 8ac2a14..1c73e6f 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -3,6 +3,9 @@
+ * LuaSocket toolkit
+ \*=========================================================================*/
+ #include <string.h> 
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <net/if.h>
+ #include "lauxlib.h"
+@@ -285,6 +288,12 @@ static int opt_ip6_setmembership(lua_State *L, p_socket ps, int level, int name)
+     if (!lua_isnil(L, -1)) {
+         if (lua_isnumber(L, -1)) {
+             val.ipv6mr_interface = (unsigned int) lua_tonumber(L, -1);
++        } else if (lua_isstring(L, -1)) {
++            if (!(val.ipv6mr_interface = if_nametoindex(lua_tostring(L, -1)))) {
++                lua_pushnil(L);
++                lua_pushstring(L, "nonexistent interface");
++                return 2;
++            }
+         } else
+           luaL_argerror(L, -1, "number 'interface' field expected");
+     }
+-- 
+1.8.4.rc3
+
diff --git a/lang/luasql/Makefile b/lang/luasql/Makefile
new file mode 100644 (file)
index 0000000..135ebff
--- /dev/null
@@ -0,0 +1,118 @@
+#
+# Copyright (C) 2010-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luasql
+PKG_VERSION:=2.3.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/keplerproject/luasql.git
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=docs/us/license.html
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luasql/Default
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua SQL binding
+  URL:=http://keplerproject.github.io/luasql/
+  DEPENDS:= +lua
+endef
+
+define Package/luasql/Default/description
+ LuaSQL is a simple interface from Lua to a DBMS.
+endef
+
+
+define Package/luasql-mysql
+$(call Package/luasql/Default)
+  TITLE+= for MySQL
+  DEPENDS+= +libmysqlclient
+  VARIANT:=mysql
+endef
+
+define Package/luasql-mysql/description
+$(call Package/luasql/Default/description)
+ .
+ This package contains the MySQL binding.
+endef
+
+
+define Package/luasql-pgsql
+$(call Package/luasql/Default)
+  TITLE+= for PostgreSQL
+  DEPENDS+= +libpq
+  VARIANT:=postgres
+endef
+
+define Package/luasql-pgsql/description
+$(call Package/luasql/Default/description)
+ .
+ This package contains the PostgreSQL binding.
+endef
+
+
+define Package/luasql-sqlite3
+$(call Package/luasql/Default)
+  TITLE+= for SQLite 3
+  DEPENDS+= +libsqlite3
+  VARIANT:=sqlite3
+endef
+
+define Package/luasql-sqlite3/description
+$(call Package/luasql/Default/description)
+ .
+ This package contains the SQLite 3 binding.
+endef
+
+
+TARGET_CFLAGS += $(FPIC) -std=gnu99
+TARGET_CPPFLAGS += -DLUA_USE_LINUX
+
+ifeq ($(BUILD_VARIANT),mysql)
+  TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/mysql
+  TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz
+endif
+
+ifeq ($(BUILD_VARIANT),postgres)
+  TARGET_LDFLAGS += -lpq
+endif
+
+ifeq ($(BUILD_VARIANT),sqlite3)
+  TARGET_LDFLAGS += -lsqlite3 -lpthread
+endif
+
+MAKE_FLAGS += \
+       T="$(BUILD_VARIANT)" \
+       DRIVER_INCS="$(TARGET_CPPFLAGS)" \
+       DRIVER_LIBS="$(TARGET_LDFLAGS)" \
+       CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+       lib
+
+define Package/Install/Default
+       $(INSTALL_DIR) $(1)/usr/lib/lua/luasql
+       $(CP) $(PKG_BUILD_DIR)/src/*.so $(1)/usr/lib/lua/luasql/
+endef
+
+Package/luasql-mysql/install = $(Package/Install/Default)
+Package/luasql-pgsql/install = $(Package/Install/Default)
+Package/luasql-sqlite3/install = $(Package/Install/Default)
+
+$(eval $(call BuildPackage,luasql-mysql))
+$(eval $(call BuildPackage,luasql-pgsql))
+$(eval $(call BuildPackage,luasql-sqlite3))
diff --git a/lang/lzmq/Makefile b/lang/lzmq/Makefile
new file mode 100644 (file)
index 0000000..b17b945
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=lzmq
+PKG_VERSION:=0.4.3
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+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
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/lzmq
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua ZeroMQ binding
+  URL:=https://github.com/moteus/lzmq/
+  DEPENDS:= +lua +libzmq
+endef
+
+define Package/lzmq/description
+ LZMQ is a Lua binding to ZeroMQ.
+endef
+
+CMAKE_OPTIONS += \
+       -DUSE_LUA=ON
+
+define Package/lzmq/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lzmq.so $(1)/usr/lib/lua/
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/lzmq
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lzmq/timer.so $(1)/usr/lib/lua/lzmq
+       $(CP) -R $(PKG_BUILD_DIR)/src/lua/lzmq/* $(1)/usr/lib/lua/lzmq
+endef
+
+$(eval $(call BuildPackage,lzmq))
diff --git a/lang/micropython-lib/Makefile b/lang/micropython-lib/Makefile
new file mode 100644 (file)
index 0000000..2f3fc61
--- /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.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
new file mode 100644 (file)
index 0000000..7ee5882
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# 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
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/node-arduino-firmata/Makefile b/lang/node-arduino-firmata/Makefile
new file mode 100644 (file)
index 0000000..f4de0c0
--- /dev/null
@@ -0,0 +1,68 @@
+#
+# Copyright (C) 2014 Arduino LLC
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NPM_NAME:=arduino-firmata
+PKG_NAME:=node-$(PKG_NPM_NAME)
+PKG_VERSION:=0.3.3
+PKG_RELEASE:=5
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/shokai/node-arduino-firmata.git
+PKG_SOURCE_VERSION:=16e76007edf218d72df590adbd711ac6b7432845
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_BUILD_DEPENDS:=node/host
+PKG_NODE_VERSION:=4.4.5
+
+PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
+PKG_LICENSE:=MIT
+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
+endef
+
+define Package/node-arduino-firmata/description
+ Node.js package to access serial ports for reading and writing OR Welcome your robotic JavaScript overlords. Better yet, program them!
+endef
+
+define Build/Prepare
+       /bin/tar xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip-components 1
+       $(Build/Patch)
+endef
+
+EXTRA_LDFLAGS="-L$(TOOLCHAIN_DIR)/lib/ -Wl,-rpath-link $(TOOLCHAIN_DIR)/lib/" \
+
+define Build/Compile
+       $(MAKE_FLAGS) \
+       npm_config_arch=$(CONFIG_ARCH) \
+       npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
+       npm_config_cache=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/npm-cache \
+       PREFIX="$(PKG_INSTALL_DIR)/usr/" \
+       npm install -g $(PKG_BUILD_DIR)
+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) ./files/* $(1)/
+endef
+
+$(eval $(call BuildPackage,node-arduino-firmata))
+
diff --git a/lang/node-arduino-firmata/files/usr/lib/node/arduino-firmata/lib/arduino-firmata.js b/lang/node-arduino-firmata/files/usr/lib/node/arduino-firmata/lib/arduino-firmata.js
new file mode 100644 (file)
index 0000000..578bd40
--- /dev/null
@@ -0,0 +1,306 @@
+(function() {
+  'use strict';
+  var ArduinoFirmata, SerialPort, debug, events, exports, serialport,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  events = require('eventemitter2');
+
+  SerialPort = (serialport = require('serialport')).SerialPort;
+
+  debug = require('debug')('arduino-firmata');
+
+  exports = module.exports = ArduinoFirmata = (function(superClass) {
+    extend(ArduinoFirmata, superClass);
+
+    ArduinoFirmata.Status = {
+      CLOSE: 0,
+      OPEN: 1
+    };
+
+    ArduinoFirmata.INPUT = 0;
+
+    ArduinoFirmata.OUTPUT = 1;
+
+    ArduinoFirmata.ANALOG = 2;
+
+    ArduinoFirmata.PWM = 3;
+
+    ArduinoFirmata.SERVO = 4;
+
+    ArduinoFirmata.SHIFT = 5;
+
+    ArduinoFirmata.I2C = 6;
+
+    ArduinoFirmata.LOW = 0;
+
+    ArduinoFirmata.HIGH = 1;
+
+    ArduinoFirmata.MAX_DATA_BYTES = 32;
+
+    ArduinoFirmata.DIGITAL_MESSAGE = 0x90;
+
+    ArduinoFirmata.ANALOG_MESSAGE = 0xE0;
+
+    ArduinoFirmata.REPORT_ANALOG = 0xC0;
+
+    ArduinoFirmata.REPORT_DIGITAL = 0xD0;
+
+    ArduinoFirmata.SET_PIN_MODE = 0xF4;
+
+    ArduinoFirmata.REPORT_VERSION = 0xF9;
+
+    ArduinoFirmata.SYSTEM_RESET = 0xFF;
+
+    ArduinoFirmata.START_SYSEX = 0xF0;
+
+    ArduinoFirmata.END_SYSEX = 0xF7;
+
+    ArduinoFirmata.list = function(callback) {
+      return serialport.list(function(err, ports) {
+        var devices, j, len, port;
+        if (err) {
+          return callback(err);
+        }
+        devices = [];
+        for (j = 0, len = ports.length; j < len; j++) {
+          port = ports[j];
+          if (/usb|acm|com\d+/i.test(port.comName)) {
+            devices.push(port.comName);
+          }
+        }
+        return callback(null, devices);
+      });
+    };
+
+    function ArduinoFirmata() {
+      this.status = ArduinoFirmata.Status.CLOSE;
+      this.wait_for_data = 0;
+      this.execute_multi_byte_command = 0;
+      this.multi_byte_channel = 0;
+      this.stored_input_data = [];
+      this.parsing_sysex = false;
+      this.sysex_bytes_read = 0;
+      this.digital_output_data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+      this.digital_input_data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+      this.analog_input_data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+      this.boardVersion = null;
+    }
+
+    ArduinoFirmata.prototype.isOldArduinoDevice = function() {
+      return /usbserial|USB/.test(this.serialport_name);
+    };
+
+    ArduinoFirmata.prototype.connect = function(serialport_name, opts) {
+      this.serialport_name = serialport_name;
+      if (opts == null) {
+        opts = {
+          baudrate: 57600
+        };
+      }
+      opts.parser = serialport.parsers.raw;
+      if (!this.serialport_name) {
+        ArduinoFirmata.list((function(_this) {
+          return function(err, devices) {
+            return _this.connect(devices[0], opts);
+          };
+        })(this));
+        return this;
+      }
+      this.once('boardReady', function() {
+        var io_init_wait;
+        debug('boardReady');
+        io_init_wait = this.isOldArduinoDevice() ? (debug("old arduino device found " + this.serialport_name), 3000) : (debug("new arduino device found " + this.serialport_name), 100);
+        debug("wait " + io_init_wait + "(msec)");
+        return setTimeout((function(_this) {
+          return function() {
+            var i, j, k;
+            for (i = j = 0; j < 6; i = ++j) {
+              _this.write([ArduinoFirmata.REPORT_ANALOG | i, 1]);
+            }
+            for (i = k = 0; k < 2; i = ++k) {
+              _this.write([ArduinoFirmata.REPORT_DIGITAL | i, 1]);
+            }
+            debug('init IO ports');
+            return _this.emit('connect');
+          };
+        })(this), io_init_wait);
+      });
+      this.serialport = new SerialPort(this.serialport_name, opts);
+      this.serialport.once('open', (function(_this) {
+        return function() {
+          var cid;
+          cid = setInterval(function() {
+            debug('request REPORT_VERSION');
+            return _this.write([ArduinoFirmata.REPORT_VERSION]);
+          }, 500);
+          _this.once('boardVersion', function(version) {
+            clearInterval(cid);
+            _this.status = ArduinoFirmata.Status.OPEN;
+            return _this.emit('boardReady');
+          });
+          return _this.serialport.on('data', function(data) {
+            var byte, j, len, results;
+            results = [];
+            for (j = 0, len = data.length; j < len; j++) {
+              byte = data[j];
+              results.push(_this.process_input(byte));
+            }
+            return results;
+          });
+        };
+      })(this));
+      return this;
+    };
+
+    ArduinoFirmata.prototype.isOpen = function() {
+      return this.status === ArduinoFirmata.Status.OPEN;
+    };
+
+    ArduinoFirmata.prototype.close = function(callback) {
+      this.status = ArduinoFirmata.Status.CLOSE;
+      return this.serialport.close(callback);
+    };
+
+    ArduinoFirmata.prototype.reset = function(callback) {
+      return this.write([ArduinoFirmata.SYSTEM_RESET], callback);
+    };
+
+    ArduinoFirmata.prototype.write = function(bytes, callback) {
+      return this.serialport.write(bytes, callback);
+    };
+
+    ArduinoFirmata.prototype.sysex = function(command, data, callback) {
+      var write_data;
+      if (data == null) {
+        data = [];
+      }
+      data = data.map(function(i) {
+        return i & 0x7f;
+      });
+      write_data = [ArduinoFirmata.START_SYSEX, command].concat(data, [ArduinoFirmata.END_SYSEX]);
+      return this.write(write_data, callback);
+    };
+
+    ArduinoFirmata.prototype.pinMode = function(pin, mode, callback) {
+      switch (mode) {
+        case true:
+          mode = ArduinoFirmata.OUTPUT;
+          break;
+        case false:
+          mode = ArduinoFirmata.INPUT;
+      }
+      return this.write([ArduinoFirmata.SET_PIN_MODE, pin, mode], callback);
+    };
+
+    ArduinoFirmata.prototype.digitalWrite = function(pin, value, callback) {
+      var port_num;
+      this.pinMode(pin, ArduinoFirmata.OUTPUT);
+      port_num = (pin >>> 3) & 0x0F;
+      if (value === 0 || value === false) {
+        this.digital_output_data[port_num] &= ~(1 << (pin & 0x07));
+      } else {
+        this.digital_output_data[port_num] |= 1 << (pin & 0x07);
+      }
+      return this.write([ArduinoFirmata.DIGITAL_MESSAGE | port_num, this.digital_output_data[port_num] & 0x7F, this.digital_output_data[port_num] >>> 7], callback);
+    };
+
+    ArduinoFirmata.prototype.analogWrite = function(pin, value, callback) {
+      value = Math.floor(value);
+      this.pinMode(pin, ArduinoFirmata.PWM);
+      return this.write([ArduinoFirmata.ANALOG_MESSAGE | (pin & 0x0F), value & 0x7F, value >>> 7], callback);
+    };
+
+    ArduinoFirmata.prototype.servoWrite = function(pin, angle, callback) {
+      this.pinMode(pin, ArduinoFirmata.SERVO);
+      return this.write([ArduinoFirmata.ANALOG_MESSAGE | (pin & 0x0F), angle & 0x7F, angle >>> 7], callback);
+    };
+
+    ArduinoFirmata.prototype.digitalRead = function(pin) {
+      return ((this.digital_input_data[pin >>> 3] >>> (pin & 0x07)) & 0x01) > 0;
+    };
+
+    ArduinoFirmata.prototype.analogRead = function(pin) {
+      return this.analog_input_data[pin];
+    };
+
+    ArduinoFirmata.prototype.process_input = function(input_data) {
+      var analog_value, command, diff, i, j, old_analog_value, results, stat, sysex_command, sysex_data;
+      if (this.parsing_sysex) {
+        if (input_data === ArduinoFirmata.END_SYSEX) {
+          this.parsing_sysex = false;
+          sysex_command = this.stored_input_data[0];
+          sysex_data = this.stored_input_data.slice(1, this.sysex_bytes_read);
+          return this.emit('sysex', {
+            command: sysex_command,
+            data: sysex_data
+          });
+        } else {
+          this.stored_input_data[this.sysex_bytes_read] = input_data;
+          return this.sysex_bytes_read += 1;
+        }
+      } else if (this.wait_for_data > 0 && input_data < 128) {
+        this.wait_for_data -= 1;
+        this.stored_input_data[this.wait_for_data] = input_data;
+        if (this.execute_multi_byte_command !== 0 && this.wait_for_data === 0) {
+          switch (this.execute_multi_byte_command) {
+            case ArduinoFirmata.DIGITAL_MESSAGE:
+              input_data = (this.stored_input_data[0] << 7) + this.stored_input_data[1];
+              diff = this.digital_input_data[this.multi_byte_channel] ^ input_data;
+              this.digital_input_data[this.multi_byte_channel] = input_data;
+              if (this.listeners('digitalChange').length > 0) {
+                results = [];
+                for (i = j = 0; j <= 13; i = ++j) {
+                  if (((0x01 << i) & diff) > 0) {
+                    stat = (input_data & diff) > 0;
+                    results.push(this.emit('digitalChange', {
+                      pin: i + this.multi_byte_channel * 8,
+                      value: stat,
+                      old_value: !stat
+                    }));
+                  } else {
+                    results.push(void 0);
+                  }
+                }
+                return results;
+              }
+              break;
+            case ArduinoFirmata.ANALOG_MESSAGE:
+              analog_value = (this.stored_input_data[0] << 7) + this.stored_input_data[1];
+              old_analog_value = this.analogRead(this.multi_byte_channel);
+              this.analog_input_data[this.multi_byte_channel] = analog_value;
+              if (old_analog_value !== analog_value) {
+                return this.emit('analogChange', {
+                  pin: this.multi_byte_channel,
+                  value: analog_value,
+                  old_value: old_analog_value
+                });
+              }
+              break;
+            case ArduinoFirmata.REPORT_VERSION:
+              this.boardVersion = this.stored_input_data[1] + "." + this.stored_input_data[0];
+              return this.emit('boardVersion', this.boardVersion);
+          }
+        }
+      } else {
+        if (input_data < 0xF0) {
+          command = input_data & 0xF0;
+          this.multi_byte_channel = input_data & 0x0F;
+        } else {
+          command = input_data;
+        }
+        if (command === ArduinoFirmata.START_SYSEX) {
+          this.parsing_sysex = true;
+          return this.sysex_bytes_read = 0;
+        } else if (command === ArduinoFirmata.DIGITAL_MESSAGE || command === ArduinoFirmata.ANALOG_MESSAGE || command === ArduinoFirmata.REPORT_VERSION) {
+          this.wait_for_data = 2;
+          return this.execute_multi_byte_command = command;
+        }
+      }
+    };
+
+    return ArduinoFirmata;
+
+  })(events.EventEmitter2);
+
+}).call(this);
diff --git a/lang/node-arduino-firmata/patches/000-new-serialport.patch b/lang/node-arduino-firmata/patches/000-new-serialport.patch
new file mode 100644 (file)
index 0000000..10eab64
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/package.json
++++ b/package.json
+@@ -30,7 +30,6 @@
+   "author": "Sho Hashimoto <hashimoto@shokai.org>",
+   "license": "MIT",
+   "dependencies": {
+-    "serialport": "*",
+     "eventemitter2": "*",
+     "debug": "*"
+   },
diff --git a/lang/node-cylon/Makefile b/lang/node-cylon/Makefile
new file mode 100644 (file)
index 0000000..13833a3
--- /dev/null
@@ -0,0 +1,99 @@
+#
+# Copyright (C) 2014 Arduino LLC
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NPM_NAME:=cylon
+PKG_NAME:=node-$(PKG_NPM_NAME)
+PKG_VERSION:=0.22.0
+PKG_RELEASE:=5
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/hybridgroup/cylon-firmata.git
+PKG_SOURCE_VERSION:=0c37da77e48b3e2cc3a8d566822a17689de91b40
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_BUILD_DEPENDS:=node/host
+PKG_NODE_VERSION:=4.4.5
+
+PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
+PKG_LICENSE:=Apache-2.0
+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
+endef
+
+define Package/node-cylon
+  $(call Package/node-cylon/default,Core)
+endef
+
+define Package/node-cylon-i2c
+  $(call Package/node-cylon/default,I2C,+node-cylon)
+endef
+
+define Package/node-cylon-gpio
+  $(call Package/node-cylon/default,GPIO,+node-cylon)
+endef
+
+define Package/node-cylon-firmata
+  $(call Package/node-cylon/default,Firmata,+node-cylon-gpio +node-cylon-i2c +node-arduino-firmata)
+endef
+
+define Package/node-cylon/description
+       JavaScript Robotics, By Your Command Next generation robotics framework with support for 36 different platforms Get Started
+endef
+
+define Build/Prepare
+       /bin/tar xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip-components 1
+       $(Build/Patch)
+endef
+
+EXTRA_LDFLAGS="-L$(TOOLCHAIN_DIR)/lib/ -Wl,-rpath-link $(TOOLCHAIN_DIR)/lib/" \
+
+define Build/Compile
+       $(MAKE_FLAGS) \
+       npm_config_arch=$(CONFIG_ARCH) \
+       npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
+       npm_config_cache=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/npm-cache \
+       PREFIX="$(PKG_INSTALL_DIR)/usr/" \
+       npm install -g $(PKG_BUILD_DIR)
+endef
+
+define Package/node-cylon/install
+       mkdir -p $(1)/usr/lib/node/cylon
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/cylon-firmata/node_modules/cylon/* $(1)/usr/lib/node/cylon/
+endef
+
+define Package/node-cylon-i2c/install
+       mkdir -p $(1)/usr/lib/node/cylon-i2c
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/cylon-firmata/node_modules/cylon-i2c/* $(1)/usr/lib/node/cylon-i2c/
+endef
+
+define Package/node-cylon-gpio/install
+       mkdir -p $(1)/usr/lib/node/cylon-gpio
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/cylon-firmata/node_modules/cylon-gpio/* $(1)/usr/lib/node/cylon-gpio/
+endef
+
+define Package/node-cylon-firmata/install
+       mkdir -p $(1)/usr/lib/node/cylon-firmata
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/cylon-firmata/{index.js,lib,LICENSE,package.json,README.md,RELEASES.md,spec} $(1)/usr/lib/node/cylon-firmata/
+endef
+
+$(eval $(call BuildPackage,node-cylon))
+$(eval $(call BuildPackage,node-cylon-i2c))
+$(eval $(call BuildPackage,node-cylon-gpio))
+$(eval $(call BuildPackage,node-cylon-firmata))
+
diff --git a/lang/node-cylon/patches/0001-serialport.patch b/lang/node-cylon/patches/0001-serialport.patch
new file mode 100644 (file)
index 0000000..08d579c
--- /dev/null
@@ -0,0 +1,12 @@
+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 @@
+   },
+   "dependencies": {
+-    "firmata":    ">= 0.3.2",
+     "cylon":      "1.1.0",
+     "cylon-gpio": "0.26.0",
+     "cylon-i2c":  "0.22.0"
diff --git a/lang/node-hid/Makefile b/lang/node-hid/Makefile
new file mode 100644 (file)
index 0000000..b8a5b7a
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# 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_NPM_NAME:=hid
+PKG_NAME:=node-$(PKG_NPM_NAME)
+PKG_VERSION:=0.5.1
+PKG_RELEASE:=5
+
+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:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_BUILD_DEPENDS:=node/host
+PKG_NODE_VERSION:=4.4.5
+
+PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
+PKG_LICENSE:=Custom
+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
+endef
+
+define Package/node-hid/description
+ Node.js package to access HID devices
+endef
+
+CPU:=$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))
+
+EXTRA_CFLAGS+=-I$(STAGING_DIR)/usr/include/libusb-1.0
+
+define Build/Compile
+       git init $(PKG_BUILD_DIR)
+       $(MAKE_VARS) \
+       $(MAKE_FLAGS) \
+       npm_config_arch=$(CONFIG_ARCH) \
+       npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
+       npm_config_cache=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/npm-cache \
+       PREFIX="$(PKG_INSTALL_DIR)/usr/" \
+       npm install --build-from-source --target_arch=$(CPU) -g $(PKG_BUILD_DIR)
+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/
+endef
+
+$(eval $(call BuildPackage,node-hid))
+
diff --git a/lang/node-serialport/Makefile b/lang/node-serialport/Makefile
new file mode 100644 (file)
index 0000000..3109404
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2014 Arduino LLC
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NPM_NAME:=serialport
+PKG_NAME:=node-$(PKG_NPM_NAME)
+PKG_VERSION:=3.0.0
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://registry.npmjs.org/$(PKG_NPM_NAME)/-/
+PKG_MD5SUM:=ea20a17746dd64e72d5f6f2019d9e28d
+
+PKG_BUILD_DEPENDS:=node/host
+PKG_NODE_VERSION:=4.4.5
+
+PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
+PKG_LICENSE:=Custom
+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
+endef
+
+define Package/node-serialport/description
+ Node.js package to access serial ports for reading and writing OR Welcome your robotic JavaScript overlords. Better yet, program them!
+endef
+
+define Build/Prepare
+       /bin/tar xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip-components 1
+       $(Build/Patch)
+endef
+
+CPU:=$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))
+
+EXTRA_LDFLAGS="-L$(TOOLCHAIN_DIR)/lib/ -Wl,-rpath-link $(TOOLCHAIN_DIR)/lib/" \
+
+define Build/Compile
+       $(MAKE_FLAGS) \
+       npm_config_arch=$(CONFIG_ARCH) \
+       npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
+       npm_config_cache=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/npm-cache \
+       PREFIX="$(PKG_INSTALL_DIR)/usr/" \
+       npm install --build-from-source --target_arch=$(CPU) -g $(PKG_BUILD_DIR)
+endef
+
+define Package/node-serialport/install
+       mkdir -p $(1)/usr/lib/node/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/* $(1)/usr/lib/node/
+endef
+
+$(eval $(call BuildPackage,node-serialport))
+
diff --git a/lang/node/Makefile b/lang/node/Makefile
new file mode 100644 (file)
index 0000000..3a1a2f3
--- /dev/null
@@ -0,0 +1,94 @@
+#
+# 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:=node
+PKG_VERSION:=v4.4.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=node-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION}
+PKG_MD5SUM:=376140907bbe362f36065a30af04f020
+
+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:=
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/node
+  SECTION:=lang
+  CATEGORY:=Languages
+  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
+endef
+
+define Package/node/description
+  Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses
+  an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js'
+   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))))
+
+MAKE_VARS += \
+       DESTCPU=$(CPU)
+
+CONFIGURE_ARGS= \
+       --dest-cpu=$(CPU) \
+       --dest-os=linux \
+       --without-snapshot \
+       --shared-zlib \
+       --shared-openssl \
+       --prefix=/usr
+
+ifneq ($(findstring arm,$(ARCH)),)
+CONFIGURE_ARGS+= \
+       $(if $(CONFIG_SOFT_FLOAT),--with-arm-float-abi=soft,--with-arm-float-abi=hard)
+endif
+
+ifneq ($(findstring mips,$(ARCH)),)
+CONFIGURE_ARGS+= \
+       $(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft,--with-mips-float-abi=hard)
+endif
+
+HOST_CONFIGURE_VARS:=
+
+HOST_CONFIGURE_ARGS:= \
+       --dest-os=linux \
+       --without-snapshot \
+       --prefix=$(STAGING_DIR_HOSTPKG)
+
+HOST_CONFIGURE_CMD:=python ./configure
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+endef
+
+define Package/node/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/lib/node_modules/npm/bin/npm-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))
diff --git a/lang/node/patches/001-hardfloat.patch b/lang/node/patches/001-hardfloat.patch
new file mode 100644 (file)
index 0000000..1bb2493
--- /dev/null
@@ -0,0 +1,12 @@
+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) {
+       ".set push\n\t"
+       ".set noreorder\n\t"
+       ".set oddspreg\n\t"
++      ".set hardfloat\n\t"
+       "lui $t0, 0x3FF0\n\t"
+       "ldc1 $f0, %0\n\t"
+       "mtc1 $t0, $f1\n\t"
diff --git a/lang/node/patches/002-addr_info.patch b/lang/node/patches/002-addr_info.patch
new file mode 100644 (file)
index 0000000..0aa02da
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/deps/uv/src/unix/getaddrinfo.c
++++ b/deps/uv/src/unix/getaddrinfo.c
+@@ -99,6 +99,7 @@ static void uv__getaddrinfo_work(struct
+   int err;
+   req = container_of(w, uv_getaddrinfo_t, work_req);
++   req->hints->ai_flags &= ~AI_V4MAPPED;
+   err = getaddrinfo(req->hostname, req->service, req->hints, &req->addrinfo);
+   req->retcode = uv__getaddrinfo_translate_error(err);
+ }
diff --git a/lang/node/patches/003-path.patch b/lang/node/patches/003-path.patch
new file mode 100644 (file)
index 0000000..01a71c6
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/lib/module.js
++++ b/lib/module.js
+@@ -453,7 +453,8 @@ Module._initPaths = function() {
+     homeDir = process.env.HOME;
+   }
+-  var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node')];
++  var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node'),
++    path.resolve(process.execPath, '..', '..', 'lib', 'node_modules')];
+   if (homeDir) {
+     paths.unshift(path.resolve(homeDir, '.node_libraries'));
diff --git a/lang/openpyxl/Makefile b/lang/openpyxl/Makefile
new file mode 100644 (file)
index 0000000..6656d56
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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-cgi/Makefile b/lang/perl-cgi/Makefile
new file mode 100644 (file)
index 0000000..eaca425
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# 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:=perl-cgi
+PKG_VERSION:=4.35
+PKG_RELEASE:=2
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/L/LE/LEEJO
+PKG_SOURCE:=CGI-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=15e63942c02354426b25f056f2a4467c
+
+PKG_LICENSE:=GPL Artistic-2.0
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>, \
+               Philip Prindeville <philipp@redfish-solutions.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/CGI-$(PKG_VERSION)
+
+# don't strip comments because that will mangle this module
+PKG_LEAVE_COMMENTS:=1
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-cgi
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Handle Common Gateway Interface requests and responses
+  URL:=http://search.cpan.org/dist/CGI/
+  DEPENDS:=perl +perl-html-parser +perlbase-base +perlbase-config +perlbase-encode +perlbase-essential +perlbase-file +perlbase-if +perlbase-utf8
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-cgi/install
+        $(call perlmod/Install,$(1),CGI CGI.pm auto/CGI)
+endef
+
+
+$(eval $(call BuildPackage,perl-cgi))
diff --git a/lang/perl-compress-bzip2/Makefile b/lang/perl-compress-bzip2/Makefile
new file mode 100644 (file)
index 0000000..2876646
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-compress-bzip2
+PKG_VERSION:=2.24
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Compress-Bzip2-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-compress-bzip2
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Perl interface to bzip2 compression library
+  URL:=http://search.cpan.org/dist/Compress-Bzip2/
+  DEPENDS:=perl +libbz2 +perlbase-autoloader +perlbase-config +perlbase-essential +perlbase-fcntl +perlbase-file +perlbase-getopt +perlbase-test +perlbase-xsloader
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,,BUILD_BZLIB=0)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-compress-bzip2/install
+       $(call perlmod/Install,$(1),Compress auto/Compress)
+endef
+
+
+$(eval $(call BuildPackage,perl-compress-bzip2))
diff --git a/lang/perl-dbi/Makefile b/lang/perl-dbi/Makefile
new file mode 100644 (file)
index 0000000..3c594d1
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# 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:=perl-dbi
+PKG_VERSION:=1.634
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/DBI-$(PKG_VERSION)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/DBI-$(PKG_VERSION)
+
+HOST_BUILD_DEPENDS:=perl/host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+include ../perl/perlmod.mk
+
+define Package/perl-dbi
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Database independent interface for Perl
+  URL:=http://search.cpan.org/dist/DBI/
+  DEPENDS:=perl +perlbase-base +perlbase-config +perlbase-cwd +perlbase-data +perlbase-dynaloader +perlbase-errno +perlbase-essential +perlbase-fcntl +perlbase-file +perlbase-io +perlbase-ipc +perlbase-scalar +perlbase-storable +perlbase-symbol +perlbase-tie +perlbase-universal +perlbase-utf8
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Host/Configure
+       $(call perlmod/host/Configure,,)
+endef
+
+define Host/Compile
+       $(call perlmod/host/Compile,,)
+endef
+
+define Host/Install
+       $(call perlmod/host/Install,$(1),)
+endef
+
+define Package/perl-dbi/install
+       $(call perlmod/Install,$(1),DB* auto/DBI,DBI/W32ODBC.pm auto/DBI/*.h)
+endef
+
+
+$(eval $(call BuildPackage,perl-dbi))
+$(eval $(call HostBuild))
diff --git a/lang/perl-device-serialport/Makefile b/lang/perl-device-serialport/Makefile
new file mode 100644 (file)
index 0000000..2069bed
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# 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:=perl-device-serialport
+PKG_VERSION:=1.04
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Paul Oranje <por@xs4all.nl>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Device-SerialPort-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-device-serialport
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=A POSIX-based version of the Win32::SerialPort module
+  URL:=http://search.cpan.org/dist/Device-SerialPort/
+  DEPENDS:=perl +perlbase-essential +perlbase-io +perlbase-posix +perlbase-test +perlbase-xsloader
+endef
+
+define Package/perl-device-serialport/description
+  A POSIX-based version of the Win32::SerialPort module
+  that provides modem support to Perl applications
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-device-serialport/install
+        $(call perlmod/Install,$(1),Device auto/Device)
+endef
+
+
+$(eval $(call BuildPackage,perl-device-serialport))
diff --git a/lang/perl-device-usb/Makefile b/lang/perl-device-usb/Makefile
new file mode 100644 (file)
index 0000000..0a2c737
--- /dev/null
@@ -0,0 +1,73 @@
+#
+# 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:=perl-device-usb
+PKG_VERSION:=0.36
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Device-USB-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=perl-inline-c/host
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-device-usb
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=libusb library wrapper
+  URL:=http://search.cpan.org/dist/Device-USB/
+  DEPENDS:=perl +libusb-compat +perl-inline +perl-inline-c +perlbase-essential +perlbase-test
+endef
+
+# Device::USB will generate a second Makefile.PL to build it's native code
+# using Inline::C under _Inline/. The goal here is to prevent Inline::C from
+# running that one automatically, as we need to supply a bunch of overrides via
+# perlmod/Configure.
+# _INLINE_C_NO_COMPILE_ is an OpenWRT-specific environment variable to Inline::C
+# that does just that.
+define Build/Configure
+       $(call perlmod/Configure,,)
+       
+       # Prepare a library directory where we can link againt lusb-0.1(as
+       # opposed to -lusb) to avoid confusion at runtime
+       mkdir $(PKG_BUILD_DIR)/syslib
+       $(LN) $(STAGING_DIR)/usr/lib/libusb.so $(PKG_BUILD_DIR)/syslib/libusb-0.1.so
+       
+       # Generate _Inline
+       $(call perlmod/Compile,config,LIBUSB_LIBDIR=$(PKG_BUILD_DIR)/syslib \
+                                     _INLINE_C_NO_COMPILE_=1 \
+                                     _INLINE_C_SYSTEM_TYPEMAP_=$(STAGING_DIR)/usr/lib/perl5/$(PERL_VERSION)/ExtUtils/typemap)
+       $(call perlmod/Compile,dynamic,_INLINE_C_NO_COMPILE_=1)
+       
+       # Configure _Inline
+       $(call perlmod/Configure,,,$(PKG_BUILD_DIR)/_Inline/build/Device/USB)
+       
+       # Prevent re-configuring Inline code
+       sed 's/^dynamic :: D.*$$$$//' -i $(PKG_BUILD_DIR)/Makefile
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,,$(PKG_BUILD_DIR)/_Inline/build/Device/USB)
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-device-usb/install
+        $(call perlmod/Install,$(1),Device auto/Device)
+endef
+
+
+$(eval $(call BuildPackage,perl-device-usb))
diff --git a/lang/perl-device-usb/README.patches b/lang/perl-device-usb/README.patches
new file mode 100644 (file)
index 0000000..66ece00
--- /dev/null
@@ -0,0 +1,8 @@
+This package contains some patches taken directly from Debian Jessie(stable at 
+the time of writing). 
+Namely, these are:
+- 100-fix_buildsystem.patch
+- 110-just_assume_libusb_is_there.diff
+
+The other patches are specific to OpenWRT, fixing bugs and resolving conflicts
+where necessary.
\ No newline at end of file
diff --git a/lang/perl-device-usb/patches/100-fix_buildsystem.patch b/lang/perl-device-usb/patches/100-fix_buildsystem.patch
new file mode 100644 (file)
index 0000000..5201894
--- /dev/null
@@ -0,0 +1,20 @@
+Description: Ignore files we do not want installed.
+Forwarded: not-needed
+Author: Tim Retout <diocles@debian.org>
+Reviewed-by: gregor herrmann <gregoa@debian.org>
+Last-Update: 2013-10-28
+
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -2,6 +2,11 @@
+ use warnings;
+ use Inline::MakeMaker;
++sub MY::libscan {
++      return if ($_[1] eq 'USB.pm' or $_[1] eq 'dump_usb.pl');
++      return $_[1];
++}
++
+ if($^O eq 'MSWin32')
+ {
+     if(!$ENV{LIBUSB_LIBDIR} or !$ENV{LIBUSB_INCDIR})
diff --git a/lang/perl-device-usb/patches/110-just_assume_libusb_is_there.diff b/lang/perl-device-usb/patches/110-just_assume_libusb_is_there.diff
new file mode 100644 (file)
index 0000000..9365eb4
--- /dev/null
@@ -0,0 +1,30 @@
+Subject: Just assume libusb is out there
+ Makefile.PL should not try to check for libusb in a given list of directories
+ as the compiler might look in other places as well.
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/639677
+Forwarded: not-needed
+From: Ansgar Burchardt <ansgar@debian.org>
+Reviewed-by: gregor herrmann <gregoa@debian.org>
+Last-Update: 2013-10-28
+
+--- libdevice-usb-perl.orig/Makefile.PL
++++ libdevice-usb-perl/Makefile.PL
+@@ -21,7 +21,7 @@
+     }
+ }
+-unless(header_found())
++unless(1 || header_found())
+ {
+     die <<"END";
+ ERROR: Can't find usb.h header.
+@@ -36,7 +36,7 @@
+ END
+ }
+-unless(lib_found())
++unless(1 || lib_found())
+ {
+     die <<"END";
+ ERROR: Can't find libusb library.
diff --git a/lang/perl-device-usb/patches/120-use_libusb_0_1.patch b/lang/perl-device-usb/patches/120-use_libusb_0_1.patch
new file mode 100644 (file)
index 0000000..7d43e73
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/lib/Device/USB.pm
++++ b/lib/Device/USB.pm
+@@ -9,8 +9,8 @@ use Inline (
+         C => "DATA",
+         ($ENV{LIBUSB_LIBDIR}
+             ? ( LIBS => "-L\"$ENV{LIBUSB_LIBDIR}\" " .
+-                        ($^O eq 'MSWin32' ? ' -llibusb -L\"$ENV{WINDDK}\\lib\\crt\\i386\" -lmsvcrt ' : '-lusb') )
+-            : ( LIBS => '-lusb', )
++                        ($^O eq 'MSWin32' ? ' -llibusb -L\"$ENV{WINDDK}\\lib\\crt\\i386\" -lmsvcrt ' : '-lusb-0.1') )
++            : ( LIBS => '-lusb-0.1', )
+         ),
+         ($ENV{LIBUSB_INCDIR} ? ( INC => "-I\"$ENV{LIBUSB_INCDIR}\"" ) : () ),
+         NAME => 'Device::USB',
diff --git a/lang/perl-device-usb/patches/130-provide-proper-library-paths.patch b/lang/perl-device-usb/patches/130-provide-proper-library-paths.patch
new file mode 100644 (file)
index 0000000..3fce75a
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/lib/Device/USB.pm
++++ b/lib/Device/USB.pm
+@@ -8,8 +8,8 @@ use Carp;
+ use Inline (
+         C => "DATA",
+         ($ENV{LIBUSB_LIBDIR}
+-            ? ( LIBS => "-L\"$ENV{LIBUSB_LIBDIR}\" " .
+-                        ($^O eq 'MSWin32' ? ' -llibusb -L\"$ENV{WINDDK}\\lib\\crt\\i386\" -lmsvcrt ' : '-lusb-0.1') )
++            ? ( LIBS => "-L$ENV{LIBUSB_LIBDIR} " .
++                        ($^O eq 'MSWin32' ? ' -llibusb -L$ENV{WINDDK}\\lib\\crt\\i386 -lmsvcrt ' : '-lusb-0.1') )
+             : ( LIBS => '-lusb-0.1', )
+         ),
+         ($ENV{LIBUSB_INCDIR} ? ( INC => "-I\"$ENV{LIBUSB_INCDIR}\"" ) : () ),
diff --git a/lang/perl-device-usb/patches/140-avoid-libusb-name-conflicts.patch b/lang/perl-device-usb/patches/140-avoid-libusb-name-conflicts.patch
new file mode 100644 (file)
index 0000000..55e5cc3
--- /dev/null
@@ -0,0 +1,219 @@
+--- a/lib/Device/USB.pm
++++ b/lib/Device/USB.pm
+@@ -15,6 +15,7 @@ use Inline (
+         ($ENV{LIBUSB_INCDIR} ? ( INC => "-I\"$ENV{LIBUSB_INCDIR}\"" ) : () ),
+         NAME => 'Device::USB',
+         VERSION => '0.36',
++        PREFIX => 'deviceusb_',
+    );
+ Inline->init();
+@@ -540,74 +541,74 @@ unsigned DeviceUSBDebugLevel()
+     return debugLevel;
+ }
+-void libusb_init()
++void deviceusb_libusb_init()
+ {
+     usb_init();
+ }
+-int libusb_find_busses()
++int deviceusb_libusb_find_busses()
+ {
+     return usb_find_busses();
+ }
+-int libusb_find_devices()
++int deviceusb_libusb_find_devices()
+ {
+     return usb_find_devices();
+ }
+-void *libusb_get_busses()
++void *deviceusb_libusb_get_busses()
+ {
+     return usb_get_busses();
+ }
+-void *libusb_open(void *dev)
++void *deviceusb_libusb_open(void *dev)
+ {
+     return usb_open( (struct usb_device*)dev );
+ }
+-int libusb_close(void *dev)
++int deviceusb_libusb_close(void *dev)
+ {
+     return usb_close((usb_dev_handle *)dev);
+ }
+-int libusb_set_configuration(void *dev, int configuration)
++int deviceusb_libusb_set_configuration(void *dev, int configuration)
+ {
+     if(DeviceUSBDebugLevel())
+     {
+-        printf( "libusb_set_configuration( %d )\n", configuration );
++        printf( "deviceusb_libusb_set_configuration( %d )\n", configuration );
+     }
+     return usb_set_configuration((usb_dev_handle *)dev, configuration);
+ }
+-int libusb_set_altinterface(void *dev, int alternate)
++int deviceusb_libusb_set_altinterface(void *dev, int alternate)
+ {
+     if(DeviceUSBDebugLevel())
+     {
+-        printf( "libusb_set_altinterface( %d )\n", alternate );
++        printf( "deviceusb_libusb_set_altinterface( %d )\n", alternate );
+     }
+     return usb_set_altinterface((usb_dev_handle *)dev, alternate);
+ }
+-int libusb_clear_halt(void *dev, unsigned int ep)
++int deviceusb_libusb_clear_halt(void *dev, unsigned int ep)
+ {
+     if(DeviceUSBDebugLevel())
+     {
+-        printf( "libusb_clear_halt( %d )\n", ep );
++        printf( "deviceusb_libusb_clear_halt( %d )\n", ep );
+     }
+     return usb_clear_halt((usb_dev_handle *)dev, ep);
+ }
+-int libusb_reset(void *dev)
++int deviceusb_libusb_reset(void *dev)
+ {
+     return usb_reset((usb_dev_handle *)dev);
+ }
+-int libusb_get_driver_np(void *dev, int interface, char *name, unsigned int namelen)
++int deviceusb_libusb_get_driver_np(void *dev, int interface, char *name, unsigned int namelen)
+ {
+     int ret = 0;
+     if(DeviceUSBDebugLevel())
+     {
+-        printf( "libusb_get_driver_np( %d )\n", interface );
++        printf( "deviceusb_libusb_get_driver_np( %d )\n", interface );
+     }
+ #if LIBUSB_HAS_GET_DRIVER_NP
+     ret = usb_get_driver_np((usb_dev_handle *)dev, interface, name, namelen);
+@@ -618,11 +619,11 @@ int libusb_get_driver_np(void *dev, int
+ #endif
+ }
+-int libusb_detach_kernel_driver_np(void *dev, int interface)
++int deviceusb_libusb_detach_kernel_driver_np(void *dev, int interface)
+ {
+     if(DeviceUSBDebugLevel())
+     {
+-        printf( "libusb_detach_kernel_driver_np( %d )\n", interface );
++        printf( "deviceusb_libusb_detach_kernel_driver_np( %d )\n", interface );
+     }
+ #if LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP
+     return usb_detach_kernel_driver_np((usb_dev_handle *)dev, interface);
+@@ -631,25 +632,25 @@ int libusb_detach_kernel_driver_np(void
+ #endif
+ }
+-int libusb_claim_interface(void *dev, int interface)
++int deviceusb_libusb_claim_interface(void *dev, int interface)
+ {
+     if(DeviceUSBDebugLevel())
+     {
+-        printf( "libusb_claim_interface( %d )\n", interface );
++        printf( "deviceusb_libusb_claim_interface( %d )\n", interface );
+     }
+     return usb_claim_interface((usb_dev_handle *)dev, interface);
+ }
+-int libusb_release_interface(void *dev, int interface)
++int deviceusb_libusb_release_interface(void *dev, int interface)
+ {
+     if(DeviceUSBDebugLevel())
+     {
+-        printf( "libusb_release_interface( %d )\n", interface );
++        printf( "deviceusb_libusb_release_interface( %d )\n", interface );
+     }
+     return usb_release_interface((usb_dev_handle *)dev, interface);
+ }
+-void libusb_control_msg(void *dev, int requesttype, int request, int value, int index, char *bytes, int size, int timeout)
++void deviceusb_libusb_control_msg(void *dev, int requesttype, int request, int value, int index, char *bytes, int size, int timeout)
+ {
+     int i = 0;
+     int retval = 0;
+@@ -658,7 +659,7 @@ void libusb_control_msg(void *dev, int r
+     if(DeviceUSBDebugLevel())
+     {
+-        printf( "libusb_control_msg( %#04x, %#04x, %#04x, %#04x, %p, %d, %d )\n",
++        printf( "deviceusb_libusb_control_msg( %#04x, %#04x, %#04x, %#04x, %p, %d, %d )\n",
+             requesttype, request, value, index, bytes, size, timeout
+         );
+         /* maybe need to add support for printing the bytes string. */
+@@ -691,54 +692,54 @@ void libusb_control_msg(void *dev, int r
+     Inline_Stack_Done;
+ }
+-int libusb_get_string(void *dev, int index, int langid, char *buf, size_t buflen)
++int deviceusb_libusb_get_string(void *dev, int index, int langid, char *buf, size_t buflen)
+ {
+     if(DeviceUSBDebugLevel())
+     {
+-        printf( "libusb_get_string( %d, %d, %p, %lu )\n",
++        printf( "deviceusb_libusb_get_string( %d, %d, %p, %lu )\n",
+             index, langid, buf, (unsigned long)buflen
+         );
+     }
+     return usb_get_string((usb_dev_handle *)dev, index, langid, buf, buflen);
+ }
+-int libusb_get_string_simple(void *dev, int index, char *buf, size_t buflen)
++int deviceusb_libusb_get_string_simple(void *dev, int index, char *buf, size_t buflen)
+ {
+     if(DeviceUSBDebugLevel())
+     {
+-        printf( "libusb_get_string_simple( %d, %p, %lu )\n",
++        printf( "deviceusb_libusb_get_string_simple( %d, %p, %lu )\n",
+             index, buf, (unsigned long)buflen
+         );
+     }
+     return usb_get_string_simple((usb_dev_handle *)dev, index, buf, buflen);
+ }
+-int libusb_get_descriptor(void *dev, unsigned char type, unsigned char index, char *buf, int size)
++int deviceusb_libusb_get_descriptor(void *dev, unsigned char type, unsigned char index, char *buf, int size)
+ {
+     return usb_get_descriptor((usb_dev_handle *)dev, type, index, buf, size);
+ }
+-int libusb_get_descriptor_by_endpoint(void *dev, int ep, unsigned char type, unsigned char index, char *buf, int size)
++int deviceusb_libusb_get_descriptor_by_endpoint(void *dev, int ep, unsigned char type, unsigned char index, char *buf, int size)
+ {
+     return usb_get_descriptor_by_endpoint((usb_dev_handle *)dev, ep, type, index, buf, size);
+ }
+-int libusb_bulk_write(void *dev, int ep, char *bytes, int size, int timeout)
++int deviceusb_libusb_bulk_write(void *dev, int ep, char *bytes, int size, int timeout)
+ {
+     return usb_bulk_write((usb_dev_handle *)dev, ep, bytes, size, timeout);
+ }
+-int libusb_bulk_read(void *dev, int ep, char *bytes, int size, int timeout)
++int deviceusb_libusb_bulk_read(void *dev, int ep, char *bytes, int size, int timeout)
+ {
+     return usb_bulk_read((usb_dev_handle *)dev, ep, bytes, size, timeout);
+ }
+-int libusb_interrupt_write(void *dev, int ep, char *bytes, int size, int timeout)
++int deviceusb_libusb_interrupt_write(void *dev, int ep, char *bytes, int size, int timeout)
+ {
+     return usb_interrupt_write((usb_dev_handle *)dev, ep, bytes, size, timeout);
+ }
+-int libusb_interrupt_read(void *dev, int ep, char *bytes, int size, int timeout)
++int deviceusb_libusb_interrupt_read(void *dev, int ep, char *bytes, int size, int timeout)
+ {
+     return usb_interrupt_read((usb_dev_handle *)dev, ep, bytes, size, timeout);
+ }
diff --git a/lang/perl-encode-locale/Makefile b/lang/perl-encode-locale/Makefile
new file mode 100644 (file)
index 0000000..54071dc
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-encode-locale
+PKG_VERSION:=1.05
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Encode-Locale-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-encode-locale
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Determine the locale encoding
+  URL:=http://search.cpan.org/dist/Encode-Locale/
+  DEPENDS:=perl +perlbase-base +perlbase-encode +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-encode-locale/install
+        $(call perlmod/Install,$(1),Encode auto/Encode)
+endef
+
+
+$(eval $(call BuildPackage,perl-encode-locale))
diff --git a/lang/perl-file-listing/Makefile b/lang/perl-file-listing/Makefile
new file mode 100644 (file)
index 0000000..19a6938
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-file-listing
+PKG_VERSION:=6.04
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/File-Listing-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-file-listing
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Parse directory listing
+  URL:=http://search.cpan.org/dist/File-Listing/
+  DEPENDS:=perl +perl-http-date +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-file-listing/install
+        $(call perlmod/Install,$(1),File auto/File)
+endef
+
+
+$(eval $(call BuildPackage,perl-file-listing))
diff --git a/lang/perl-file-sharedir-install/Makefile b/lang/perl-file-sharedir-install/Makefile
new file mode 100644 (file)
index 0000000..d107d70
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# 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:=perl-file-sharedir-install
+PKG_VERSION:=0.10
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/File-ShareDir-Install-$(PKG_VERSION)
+HOST_BUILD_DEPENDS:=perl/host
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/File-ShareDir-Install-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+include ../perl/perlmod.mk
+
+define Package/perl-file-sharedir-install
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Install read-only data files
+  URL:=http://search.cpan.org/dist/File-ShareDir-Install/
+  DEPENDS:=perl +perlbase-essential +perlbase-extutils +perlbase-file +perlbase-io
+endef
+
+define Host/Configure
+        $(call perlmod/host/Configure,,,)
+endef
+
+define Host/Compile
+        $(call perlmod/host/Compile,,)
+endef
+
+define Host/Install
+        $(call perlmod/host/Install,$(1),)
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-file-sharedir-install/install
+        $(call perlmod/Install,$(1),File auto/File)
+endef
+
+
+$(eval $(call BuildPackage,perl-file-sharedir-install))
+$(eval $(call HostBuild))
diff --git a/lang/perl-html-form/Makefile b/lang/perl-html-form/Makefile
new file mode 100644 (file)
index 0000000..d412a1f
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-html-form
+PKG_VERSION:=6.03
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTML-Form-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-html-form
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Class that represents an HTML form element
+  URL:=http://search.cpan.org/dist/HTML-Form/
+  DEPENDS:=perl +perl-html-parser +perl-http-message +perl-uri +perlbase-encode +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-html-form/install
+        $(call perlmod/Install,$(1),HTML auto/HTML)
+endef
+
+
+$(eval $(call BuildPackage,perl-html-form))
diff --git a/lang/perl-html-parser/Makefile b/lang/perl-html-parser/Makefile
new file mode 100644 (file)
index 0000000..e977217
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-html-parser
+PKG_VERSION:=3.72
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTML-Parser-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-html-parser
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=A collection of modules that parse HTML text documents
+  URL:=http://search.cpan.org/dist/HTML-Parser/
+  DEPENDS:=perl +perl-html-tagset +perlbase-essential +perlbase-xsloader
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-html-parser/install
+       $(call perlmod/Install,$(1),HTML auto/HTML)
+endef
+
+
+$(eval $(call BuildPackage,perl-html-parser))
diff --git a/lang/perl-html-tagset/Makefile b/lang/perl-html-tagset/Makefile
new file mode 100644 (file)
index 0000000..4bcd10c
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-html-tagset
+PKG_VERSION:=3.20
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTML-Tagset-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-html-tagset
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Data tables pertaining to HTML
+  URL:=http://search.cpan.org/dist/HTML-Tagset/
+  DEPENDS:=perl +perlbase-essential
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-html-tagset/install
+       $(call perlmod/Install,$(1),HTML)
+endef
+
+
+$(eval $(call BuildPackage,perl-html-tagset))
diff --git a/lang/perl-html-tree/Makefile b/lang/perl-html-tree/Makefile
new file mode 100644 (file)
index 0000000..d1b4ac9
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# 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:=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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTML-Tree-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-html-tree
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Represent and create HTML syntax trees
+  URL:=http://search.cpan.org/dist/HTML-Tree/
+  DEPENDS:=perl +perl-html-parser +perl-html-tagset +perlbase-essential +perlbase-integer
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-html-tree/install
+       $(call perlmod/Install,$(1),HTML)
+endef
+
+
+$(eval $(call BuildPackage,perl-html-tree))
diff --git a/lang/perl-http-cookies/Makefile b/lang/perl-http-cookies/Makefile
new file mode 100644 (file)
index 0000000..329767a
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-http-cookies
+PKG_VERSION:=6.01
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTTP-Cookies-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-http-cookies
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=HTTP cookie jars
+  URL:=http://search.cpan.org/dist/HTTP-Cookies/
+  DEPENDS:=perl +perl-http-date +perl-http-message +perlbase-essential +perlbase-time
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-http-cookies/install
+        $(call perlmod/Install,$(1),HTTP auto/HTTP)
+endef
+
+
+$(eval $(call BuildPackage,perl-http-cookies))
diff --git a/lang/perl-http-daemon/Makefile b/lang/perl-http-daemon/Makefile
new file mode 100644 (file)
index 0000000..178573d
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-http-daemon
+PKG_VERSION:=6.01
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTTP-Daemon-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-http-daemon
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=A simple http server class
+  URL:=http://search.cpan.org/dist/HTTP-Daemon/
+  DEPENDS:=perl +perl-http-date +perl-http-message +perl-lwp-mediatypes +perlbase-essential +perlbase-io +perlbase-sys
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-http-daemon/install
+        $(call perlmod/Install,$(1),HTTP auto/HTTP)
+endef
+
+
+$(eval $(call BuildPackage,perl-http-daemon))
diff --git a/lang/perl-http-date/Makefile b/lang/perl-http-date/Makefile
new file mode 100644 (file)
index 0000000..bf0bd40
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-http-date
+PKG_VERSION:=6.02
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTTP-Date-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-http-date
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Date conversion routines
+  URL:=http://search.cpan.org/dist/HTTP-Date/
+  DEPENDS:=perl +perlbase-essential +perlbase-time
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-http-date/install
+        $(call perlmod/Install,$(1),HTTP auto/HTTP)
+endef
+
+
+$(eval $(call BuildPackage,perl-http-date))
diff --git a/lang/perl-http-message/Makefile b/lang/perl-http-message/Makefile
new file mode 100644 (file)
index 0000000..2b90e2a
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-http-message
+PKG_VERSION:=6.11
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTTP-Message-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-http-message
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=HTTP style messages
+  URL:=http://search.cpan.org/dist/HTTP-Message/
+  DEPENDS:=perl +perl-encode-locale +perl-http-date +perl-io-html +perl-lwp-mediatypes +perl-uri +perlbase-base +perlbase-compress +perlbase-encode +perlbase-essential +perlbase-io +perlbase-mime
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-http-message/install
+        $(call perlmod/Install,$(1),HTTP auto/HTTP)
+endef
+
+
+$(eval $(call BuildPackage,perl-http-message))
diff --git a/lang/perl-http-negotiate/Makefile b/lang/perl-http-negotiate/Makefile
new file mode 100644 (file)
index 0000000..a72893a
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-http-negotiate
+PKG_VERSION:=6.01
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTTP-Negotiate-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-http-negotiate
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Choose a variant to serve
+  URL:=http://search.cpan.org/dist/HTTP-Negotiate/
+  DEPENDS:=perl +perl-http-message +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-http-negotiate/install
+        $(call perlmod/Install,$(1),HTTP auto/HTTP)
+endef
+
+
+$(eval $(call BuildPackage,perl-http-negotiate))
diff --git a/lang/perl-http-server-simple/Makefile b/lang/perl-http-server-simple/Makefile
new file mode 100644 (file)
index 0000000..9a41da6
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-http-server-simple
+PKG_VERSION:=0.51
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/HTTP-Server-Simple-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-http-server-simple
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lightweight HTTP server
+  URL:=http://search.cpan.org/dist/HTTP-Server-Simple/
+  DEPENDS:=perl +perl-cgi +perlbase-base +perlbase-essential +perlbase-filehandle +perlbase-socket +perlbase-test
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-http-server-simple/install
+        $(call perlmod/Install,$(1),HTTP auto/HTTP)
+endef
+
+
+$(eval $(call BuildPackage,perl-http-server-simple))
diff --git a/lang/perl-inline-c/Makefile b/lang/perl-inline-c/Makefile
new file mode 100644 (file)
index 0000000..52826d2
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# 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:=perl-inline-c
+PKG_VERSION:=0.76
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/I/IN/INGY
+PKG_SOURCE:=Inline-C-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=c0fbfdd058075c9271a1384c822c9a87
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/Inline-C-$(PKG_VERSION)
+HOST_BUILD_DEPENDS:=perl/host perl-inline/host perl-parse-recdescent/host perl-file-sharedir-install/host
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Inline-C-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=perl-inline/host perl-parse-recdescent/host perl-file-sharedir-install/host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+include ../perl/perlmod.mk
+
+define Package/perl-inline-c
+  SUBMENU:=Perl
+  SECTION:=lang
+  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
+endef
+
+define Host/Configure
+        $(call perlmod/host/Configure,,,)
+endef
+
+define Host/Compile
+        $(call perlmod/host/Compile,,)
+endef
+
+define Host/Install
+        $(call perlmod/host/Install,$(1),)
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-inline-c/install
+        $(call perlmod/Install,$(1),Inline auto/Inline)
+endef
+
+
+$(eval $(call BuildPackage,perl-inline-c))
+$(eval $(call HostBuild))
diff --git a/lang/perl-inline-c/patches/100-inline_c-no_compile_hack.patch b/lang/perl-inline-c/patches/100-inline_c-no_compile_hack.patch
new file mode 100644 (file)
index 0000000..dcfe2bb
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/lib/Inline/C.pm
++++ b/lib/Inline/C.pm
+@@ -361,7 +361,7 @@ sub build {
+     $o->call('write_XS', 'Build Glue 1');
+     $o->call('write_Inline_headers', 'Build Glue 2');
+     $o->call('write_Makefile_PL', 'Build Glue 3');
+-    $o->call('compile', 'Build Compile');
++    $o->call('compile', 'Build Compile') unless $ENV{'_INLINE_C_NO_COMPILE_'};
+     if (IS_WIN32) {
+         $lockfh->release or die "releasemutex $file: $^E";
+     }
diff --git a/lang/perl-inline-c/patches/110-inline_c-make_system_typemap_overridable.patch b/lang/perl-inline-c/patches/110-inline_c-make_system_typemap_overridable.patch
new file mode 100644 (file)
index 0000000..b2ae09e
--- /dev/null
@@ -0,0 +1,46 @@
+--- a/lib/Inline/C.pm
++++ b/lib/Inline/C.pm
+@@ -438,22 +438,28 @@ sub get_maps {
+     print STDERR "get_maps Stage\n" if $o->{CONFIG}{BUILD_NOISY};
+     my $typemap = '';
+     my $file;
+-    $file = File::Spec->catfile(
+-        $Config::Config{installprivlib},
+-        "ExtUtils",
+-        "typemap",
+-    );
+-    $typemap = $file if -f $file;
+-    $file = File::Spec->catfile(
+-        $Config::Config{privlibexp}
+-        ,"ExtUtils","typemap"
+-    );
+-    $typemap = $file
+-        if (not $typemap and -f $file);
+-    warn "Can't find the default system typemap file"
+-        if (not $typemap and $^W);
++    
++    unless ($ENV{'_INLINE_C_SYSTEM_TYPEMAP_'}) {
++        $file = File::Spec->catfile(
++            $Config::Config{installprivlib},
++            "ExtUtils",
++            "typemap",
++        );
++        $typemap = $file if -f $file;
++        $file = File::Spec->catfile(
++            $Config::Config{privlibexp}
++            ,"ExtUtils","typemap"
++        );
++        $typemap = $file
++            if (not $typemap and -f $file);
++        warn "Can't find the default system typemap file"
++            if (not $typemap and $^W);
+-    unshift(@{$o->{ILSM}{MAKEFILE}{TYPEMAPS}}, $typemap) if $typemap;
++        unshift(@{$o->{ILSM}{MAKEFILE}{TYPEMAPS}}, $typemap) if $typemap;
++    }
++    else {
++        unshift(@{$o->{ILSM}{MAKEFILE}{TYPEMAPS}}, $ENV{'_INLINE_C_SYSTEM_TYPEMAP_'});
++    }
+     if (not $o->UNTAINT) {
+         require FindBin;
diff --git a/lang/perl-inline/Makefile b/lang/perl-inline/Makefile
new file mode 100644 (file)
index 0000000..a120705
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# 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:=perl-inline
+PKG_VERSION:=0.80
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Inline-$(PKG_VERSION)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/Inline-$(PKG_VERSION)
+
+HOST_BUILD_DEPENDS:=perl/host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+include ../perl/perlmod.mk
+
+define Package/perl-inline
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Write subroutines in other languages
+  URL:=http://search.cpan.org/dist/Inline/
+  DEPENDS:=perl +perlbase-base +perlbase-config +perlbase-cwd +perlbase-digest +perlbase-essential +perlbase-fcntl +perlbase-file
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-inline/install
+        $(call perlmod/Install,$(1),Inline.pm Inline auto/Inline)
+endef
+
+define Host/Configure
+       $(call perlmod/host/Configure,,,)
+endef
+
+define Host/Compile
+       $(call perlmod/host/Compile,,)
+endef
+
+define Host/Install
+       $(call perlmod/host/Install,$(1),)
+endef
+
+
+$(eval $(call BuildPackage,perl-inline))
+$(eval $(call HostBuild))
diff --git a/lang/perl-io-html/Makefile b/lang/perl-io-html/Makefile
new file mode 100644 (file)
index 0000000..9390c36
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-io-html
+PKG_VERSION:=1.001
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/IO-HTML-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-io-html
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Open an HTML file with automatic charset detection
+  URL:=http://search.cpan.org/dist/IO-HTML/
+  DEPENDS:=perl +perlbase-encode +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-io-html/install
+        $(call perlmod/Install,$(1),IO auto/IO)
+endef
+
+
+$(eval $(call BuildPackage,perl-io-html))
diff --git a/lang/perl-lockfile-simple/Makefile b/lang/perl-lockfile-simple/Makefile
new file mode 100644 (file)
index 0000000..b81e678
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-lockfile-simple
+PKG_VERSION:=0.208
+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_LICENSE:=GPL-2.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/LockFile-Simple-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-lockfile-simple
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Simple advisory file locking
+  URL:=http://search.cpan.org/dist/LockFile-Simple/
+  DEPENDS:=perl +perlbase-essential +perlbase-sys
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-lockfile-simple/install
+       $(call perlmod/Install,$(1),LockFile auto/LockFile)
+endef
+
+
+$(eval $(call BuildPackage,perl-lockfile-simple))
diff --git a/lang/perl-lwp-mediatypes/Makefile b/lang/perl-lwp-mediatypes/Makefile
new file mode 100644 (file)
index 0000000..6985431
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-lwp-mediatypes
+PKG_VERSION:=6.02
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/LWP-MediaTypes-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-lwp-mediatypes
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Guess media type for a file or a URL
+  URL:=http://search.cpan.org/dist/LWP-MediaTypes/
+  DEPENDS:=perl +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-lwp-mediatypes/install
+        $(call perlmod/Install,$(1),LWP auto/LWP)
+endef
+
+
+$(eval $(call BuildPackage,perl-lwp-mediatypes))
diff --git a/lang/perl-net-http/Makefile b/lang/perl-net-http/Makefile
new file mode 100644 (file)
index 0000000..058ac16
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-net-http
+PKG_VERSION:=6.09
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Net-HTTP-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-net-http
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Low-level HTTP connection (client)
+  URL:=http://search.cpan.org/dist/Net-HTTP/
+  DEPENDS:=perl +perl-uri +perlbase-compress +perlbase-essential +perlbase-io
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-net-http/install
+        $(call perlmod/Install,$(1),Net auto/Net)
+endef
+
+
+$(eval $(call BuildPackage,perl-net-http))
diff --git a/lang/perl-net-telnet/Makefile b/lang/perl-net-telnet/Makefile
new file mode 100644 (file)
index 0000000..c915064
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2011-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:=perl-net-telnet
+PKG_VERSION:=3.04
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Net-Telnet-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-net-telnet
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Telnet client
+  URL:=http://search.cpan.org/dist/Net-Telnet/
+  DEPENDS:=perl +perlbase-essential +perlbase-socket +perlbase-symbol
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-net-telnet/install
+       $(call perlmod/Install,$(1),Net auto/Net)
+endef
+
+
+$(eval $(call BuildPackage,perl-net-telnet))
diff --git a/lang/perl-parse-recdescent/Makefile b/lang/perl-parse-recdescent/Makefile
new file mode 100644 (file)
index 0000000..bbeff7b
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# 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:=perl-parse-recdescent
+PKG_VERSION:=1.967013
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/Parse-RecDescent-$(PKG_VERSION)
+HOST_BUILD_DEPENDS:=perl/host
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Parse-RecDescent-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+include ../perl/perlmod.mk
+
+define Package/perl-parse-recdescent
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Generate Recursive-Descent Parsers
+  URL:=http://search.cpan.org/dist/Parse-RecDescent/
+  DEPENDS:=perl +perlbase-essential +perlbase-test +perlbase-text
+endef
+
+define Host/Configure
+        $(call perlmod/host/Configure,,,)
+endef
+
+define Host/Compile
+        $(call perlmod/host/Compile,,)
+endef
+
+define Host/Install
+        $(call perlmod/host/Install,$(1),)
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-parse-recdescent/install
+        $(call perlmod/Install,$(1),Parse auto/Parse)
+endef
+
+
+$(eval $(call BuildPackage,perl-parse-recdescent))
+$(eval $(call HostBuild))
diff --git a/lang/perl-sub-uplevel/Makefile b/lang/perl-sub-uplevel/Makefile
new file mode 100644 (file)
index 0000000..266bce4
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-sub-uplevel
+PKG_VERSION:=0.25
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Sub-Uplevel-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-sub-uplevel
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Apparently run a function in a higher stack frame
+  URL:=http://search.cpan.org/dist/Sub-Uplevel/
+  DEPENDS:=perl +perlbase-essential
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-sub-uplevel/install
+        $(call perlmod/Install,$(1),Sub auto/Sub)
+endef
+
+
+$(eval $(call BuildPackage,perl-sub-uplevel))
diff --git a/lang/perl-test-harness/Makefile b/lang/perl-test-harness/Makefile
new file mode 100644 (file)
index 0000000..0c14e85
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-test-harness
+PKG_VERSION:=3.36
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Test-Harness-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-test-harness
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Perl Test Harness
+  URL:=http://search.cpan.org/dist/Test-Harness/
+  DEPENDS:=perl +perlbase-base +perlbase-benchmark +perlbase-config +perlbase-essential +perlbase-file +perlbase-getopt +perlbase-io +perlbase-posix +perlbase-text
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-test-harness/install
+       $(call perlmod/Install,$(1),App auto/Test TAP Test)
+endef
+
+
+$(eval $(call BuildPackage,perl-test-harness))
diff --git a/lang/perl-test-warn/Makefile b/lang/perl-test-warn/Makefile
new file mode 100644 (file)
index 0000000..995e1ba
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-test-warn
+PKG_VERSION:=0.30
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Test-Warn-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-test-warn
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Perl extension to test methods for warnings
+  URL:=http://search.cpan.org/dist/Test-Warn/
+  DEPENDS:=perl +perl-sub-uplevel +perlbase-essential +perlbase-test
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-test-warn/install
+        $(call perlmod/Install,$(1),Test auto/Test)
+endef
+
+
+$(eval $(call BuildPackage,perl-test-warn))
diff --git a/lang/perl-uri/Makefile b/lang/perl-uri/Makefile
new file mode 100644 (file)
index 0000000..18667fc
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-uri
+PKG_VERSION:=1.71
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/URI-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-uri
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Manipulates and accesses URI strings
+  URL:=http://search.cpan.org/dist/URI/
+  DEPENDS:=perl +perlbase-essential +perlbase-integer +perlbase-mime +perlbase-scalar +perlbase-utf8
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-uri/install
+       $(call perlmod/Install,$(1),URI URI.pm)
+endef
+
+
+$(eval $(call BuildPackage,perl-uri))
diff --git a/lang/perl-www-curl/Makefile b/lang/perl-www-curl/Makefile
new file mode 100644 (file)
index 0000000..1e424cb
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# 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:=perl-www-curl
+PKG_VERSION:=4.17
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/WWW-Curl-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-www-curl
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Perl bindings to libcurl
+  URL:=http://search.cpan.org/dist/WWW-Curl/
+  DEPENDS:=perl +libcurl +perlbase-essential +perlbase-xsloader
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,$(STAGING_DIR)/usr/include,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-www-curl/install
+       $(call perlmod/Install,$(1),WWW/Curl WWW/Curl.pm auto/WWW/Curl)
+endef
+
+
+$(eval $(call BuildPackage,perl-www-curl))
diff --git a/lang/perl-www-curl/patches/100-perl-www-curl_disable_curl-config_hack.patch b/lang/perl-www-curl/patches/100-perl-www-curl_disable_curl-config_hack.patch
new file mode 100644 (file)
index 0000000..568b65c
--- /dev/null
@@ -0,0 +1,74 @@
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -12,31 +12,31 @@ no_index           directory => 'template';
+ repository            'http://github.com/szbalint/WWW--Curl';
+ # This is a hack. If you have libcurl installed, just specify curl.h below
+ # and comment out this line.
+-if ($^O ne 'MSWin32') {
+-    if (!$ENV{CURL_CONFIG}) {
+-          requires_external_bin       'curl-config';
+-    }
+-} else {
+-      print   "Sorry, no automated install is available on Windows,\n".
+-              "please see the README.Win32 file on instructions for a manual install.\n";
+-      exit(0);
+-}
+-
+-my $curl_config = $ENV{CURL_CONFIG} || 'curl-config';
+-
+-my $vernum = `${curl_config} --vernum`; chomp $vernum;
+-my $version = `${curl_config} --version`; chomp $version; 
+-
+-my $minimum_ver = hex("070a08");
+-
+-if ($vernum && hex($vernum) <= $minimum_ver) {
+-      print   "Your currently installed libcurl version - $version - is too old.\n".
+-              "This module doesn't seek compatibility with versions older than 7.10.8\n".
+-              "Proceed manually if you know what you're doing.\n";
+-      exit(0);
+-}
+-
+-print "The version is $version\n";
++#if ($^O ne 'MSWin32') {
++#    if (!$ENV{CURL_CONFIG}) {
++#         requires_external_bin       'curl-config';
++#    }
++#} else {
++#     print   "Sorry, no automated install is available on Windows,\n".
++#             "please see the README.Win32 file on instructions for a manual install.\n";
++#     exit(0);
++#}
++#
++#my $curl_config = $ENV{CURL_CONFIG} || 'curl-config';
++#
++#my $vernum = `${curl_config} --vernum`; chomp $vernum;
++#my $version = `${curl_config} --version`; chomp $version; 
++#
++#my $minimum_ver = hex("070a08");
++#
++#if ($vernum && hex($vernum) <= $minimum_ver) {
++#     print   "Your currently installed libcurl version - $version - is too old.\n".
++#             "This module doesn't seek compatibility with versions older than 7.10.8\n".
++#             "Proceed manually if you know what you're doing.\n";
++#     exit(0);
++#}
++#
++#print "The version is $version\n";
+ my @includes = qw();
+ my ($cflags,$lflags, $ldflags) = ('','','');
+@@ -58,10 +58,10 @@ if ($^O ne 'MSWin32') {
+ # Get curl to tell us where it is, if we can.
+ #
+-if ($^O ne 'MSWin32') {
+-      $cflags = `${curl_config} --cflags`;
+-      $lflags = `${curl_config} --libs`;
+-}
++#if ($^O ne 'MSWin32') {
++#     $cflags = `${curl_config} --cflags`;
++#     $lflags = `${curl_config} --libs`;
++#}
+ # can't find link flags, make some guesses
+ if (!defined($lflags)) {
diff --git a/lang/perl-www-curl/patches/101-skip-preprocessor-symbol.path b/lang/perl-www-curl/patches/101-skip-preprocessor-symbol.path
new file mode 100644 (file)
index 0000000..34221c0
--- /dev/null
@@ -0,0 +1,34 @@
+From 0be0223422e6e5f4091c6e4e058d213623eed105 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Mon, 12 Sep 2016 14:40:44 +0200
+Subject: [PATCH] Skip preprocessor symbol only CURL_STRICTER
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+CURL_STRICTER leaked into curl-constants.c when building against
+curl-7.50.2. This is a preprocessor only macro without a value.
+
+CPAN RT#117793
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ Makefile.PL | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index f9170bb..ad2bd3d 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -127,7 +127,7 @@ if (!defined($curl_h)) {
+     close H;
+     for my $e (sort @syms) {
+-       if($e =~ /(OBSOLETE|^CURL_EXTERN|_LAST\z|_LASTENTRY\z)/) {
++       if($e =~ /(OBSOLETE|^CURL_EXTERN|^CURL_STRICTER\z|_LAST\z|_LASTENTRY\z)/) {
+           next;
+        }
+        my ($group) = $e =~ m/^([^_]+_)/;
+-- 
+2.7.4
+
diff --git a/lang/perl-www-curl/patches/200-fix_default_lflags.patch b/lang/perl-www-curl/patches/200-fix_default_lflags.patch
new file mode 100644 (file)
index 0000000..f51eaf5
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -39,7 +39,7 @@ repository           'http://github.com/szbalint/
+ #print "The version is $version\n";
+ my @includes = qw();
+-my ($cflags,$lflags, $ldflags) = ('','','');
++my ($cflags,$lflags, $ldflags) = ('','-lcurl','');
+ # You may need to specify where to find curl.h on your platform
+ # These are guesses only, in case curl-config is not telling us.
diff --git a/lang/perl-www-mechanize/Makefile b/lang/perl-www-mechanize/Makefile
new file mode 100644 (file)
index 0000000..93d6be2
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2010-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:=perl-www-mechanize
+PKG_VERSION:=1.75
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/WWW-Mechanize-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-www-mechanize
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Perl WWW Mechanize
+  URL:=http://search.cpan.org/dist/WWW-Mechanize/
+  DEPENDS:=perl +perl-cgi +perl-html-form +perl-html-parser +perl-html-tree +perl-http-daemon +perl-http-message +perl-http-server-simple +perl-test-warn +perl-uri +perl-www +perlbase-base +perlbase-essential +perlbase-file +perlbase-findbin +perlbase-getopt +perlbase-pod +perlbase-test
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,$(STAGING_DIR)/usr/include,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-www-mechanize/install
+       $(call perlmod/Install,$(1),WWW/Mechanize WWW/Mechanize.pm)
+endef
+
+
+$(eval $(call BuildPackage,perl-www-mechanize))
diff --git a/lang/perl-www-robotrules/Makefile b/lang/perl-www-robotrules/Makefile
new file mode 100644 (file)
index 0000000..c28b8c2
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-www-robotrules
+PKG_VERSION:=6.02
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/WWW-RobotRules-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-www-robotrules
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=database of robots.txt-derived permissions
+  URL:=http://search.cpan.org/dist/WWW-RobotRules/
+  DEPENDS:=perl +perl-uri +perlbase-anydbm-file +perlbase-essential +perlbase-fcntl
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-www-robotrules/install
+        $(call perlmod/Install,$(1),WWW auto/WWW)
+endef
+
+
+$(eval $(call BuildPackage,perl-www-robotrules))
diff --git a/lang/perl-www/Makefile b/lang/perl-www/Makefile
new file mode 100644 (file)
index 0000000..86bf15b
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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:=perl-www
+PKG_VERSION:=6.15
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/libwww-perl-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-www
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=WWW client/server library for Perl (aka LWP)
+  URL:=http://search.cpan.org/dist/libwww-perl/
+  DEPENDS:=perl +perl-encode-locale +perl-file-listing +perl-html-parser +perl-http-cookies +perl-http-daemon +perl-http-date +perl-http-message +perl-http-negotiate +perl-lwp-mediatypes +perl-net-http +perl-uri +perl-www-robotrules +perlbase-base +perlbase-digest +perlbase-encode +perlbase-essential +perlbase-io +perlbase-mime +perlbase-net
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-www/install
+       $(call perlmod/Install,$(1),LWP.pm auto/LWP LWP)
+endef
+
+
+$(eval $(call BuildPackage,perl-www))
diff --git a/lang/perl-xml-parser/Makefile b/lang/perl-xml-parser/Makefile
new file mode 100644 (file)
index 0000000..57977c1
--- /dev/null
@@ -0,0 +1,86 @@
+#
+# 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:=perl-xml-parser
+PKG_VERSION:=2.44
+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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/XML-Parser-$(PKG_VERSION)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/XML-Parser-$(PKG_VERSION)
+
+HOST_BUILD_DEPENDS:=perl/host expat/host
+
+EXPAT_LIBPATH:=$(STAGING_DIR)/usr/lib
+EXPAT_INCPATH=$(STAGING_DIR)/usr/include
+HOST_EXPAT_LIBPATH:=$(STAGING_DIR_HOSTPKG)/lib
+HOST_EXPAT_INCPATH=$(STAGING_DIR_HOSTPKG)/include
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+include ../perl/perlmod.mk
+
+define Package/perl-xml-parser
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Perl XML Parser
+  URL:=http://search.cpan.org/dist/XML-Parser/
+  DEPENDS:=perl +libexpat +perlbase-dynaloader +perlbase-essential
+endef
+
+define FixupExpat
+       # Manually reconfigure XML::Parser::Expat, as some overrides we provide will not have any effect otherwise
+       # Force usage of OpenWRT's expat
+       sed \
+               -e 's!%%EXPAT_LIBPATH%%!$(2)!g' \
+               -e 's!%%EXPAT_INCPATH%%!$(3)!g' \
+               -i $(1)/Expat/Makefile.PL
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,EXPATLIBPATH=$(EXPAT_LIBPATH) EXPATINCPATH=$(EXPAT_INCPATH),,)
+       
+       $(call FixupExpat,$(PKG_BUILD_DIR),$(EXPAT_LIBPATH),$(EXPAT_INCPATH))
+       $(call perlmod/Configure,,,$(PKG_BUILD_DIR)/Expat)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+       $(call perlmod/Compile,,,$(PKG_BUILD_DIR)/Expat)
+endef
+
+define Host/Configure
+       $(call perlmod/host/Configure,EXPATLIBPATH=$(HOST_EXPAT_LIBPATH) EXPATINCPATH=$(HOST_EXPAT_INCPATH),,)
+       $(call FixupExpat,$(HOST_BUILD_DIR),$(HOST_EXPAT_LIBPATH),$(HOST_EXPAT_INCPATH))
+       $(call perlmod/host/Configure,,,$(HOST_BUILD_DIR)/Expat)
+endef
+
+define Host/Compile
+       $(call perlmod/host/Compile,,)
+       $(call perlmod/host/Compile,,,$(HOST_BUILD_DIR)/Expat)
+endef
+
+define Host/Install
+       $(call perlmod/host/Install,$(1),)
+endef
+
+define Package/perl-xml-parser/install
+       $(call perlmod/Install,$(1),auto/XML XML)
+endef
+
+
+$(eval $(call BuildPackage,perl-xml-parser))
+$(eval $(call HostBuild))
diff --git a/lang/perl-xml-parser/patches/010-xml-parser-expat-use-ppport.h b/lang/perl-xml-parser/patches/010-xml-parser-expat-use-ppport.h
new file mode 100644 (file)
index 0000000..e2aad83
--- /dev/null
@@ -0,0 +1,7476 @@
+--- a/Expat/Expat.xs
++++ b/Expat/Expat.xs
+@@ -20,17 +20,7 @@
+ #include "patchlevel.h"
+ #include "encoding.h"
+-
+-/* Version 5.005_5x (Development version for 5.006) doesn't like sv_...
+-   anymore, but 5.004 doesn't know about PL_sv..
+-   Don't want to push up required version just for this. */
+-
+-#if PATCHLEVEL < 5
+-#define PL_sv_undef   sv_undef
+-#define PL_sv_no      sv_no
+-#define PL_sv_yes     sv_yes
+-#define PL_na         na
+-#endif
++#include "ppport.h"
+ #define BUFSIZE 32768
+--- /dev/null
++++ b/Expat/ppport.h
+@@ -0,0 +1,7452 @@
++#if 0
++<<'SKIP';
++#endif
++/*
++----------------------------------------------------------------------
++
++    ppport.h -- Perl/Pollution/Portability Version 3.21
++
++    Automatically created by Devel::PPPort running under perl 5.020002.
++
++    Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
++    includes in parts/inc/ instead.
++
++    Use 'perldoc ppport.h' to view the documentation below.
++
++----------------------------------------------------------------------
++
++SKIP
++
++=pod
++
++=head1 NAME
++
++ppport.h - Perl/Pollution/Portability version 3.21
++
++=head1 SYNOPSIS
++
++  perl ppport.h [options] [source files]
++
++  Searches current directory for files if no [source files] are given
++
++  --help                      show short help
++
++  --version                   show version
++
++  --patch=file                write one patch file with changes
++  --copy=suffix               write changed copies with suffix
++  --diff=program              use diff program and options
++
++  --compat-version=version    provide compatibility with Perl version
++  --cplusplus                 accept C++ comments
++
++  --quiet                     don't output anything except fatal errors
++  --nodiag                    don't show diagnostics
++  --nohints                   don't show hints
++  --nochanges                 don't suggest changes
++  --nofilter                  don't filter input files
++
++  --strip                     strip all script and doc functionality from
++                              ppport.h
++
++  --list-provided             list provided API
++  --list-unsupported          list unsupported API
++  --api-info=name             show Perl API portability information
++
++=head1 COMPATIBILITY
++
++This version of F<ppport.h> is designed to support operation with Perl
++installations back to 5.003, and has been tested up to 5.11.5.
++
++=head1 OPTIONS
++
++=head2 --help
++
++Display a brief usage summary.
++
++=head2 --version
++
++Display the version of F<ppport.h>.
++
++=head2 --patch=I<file>
++
++If this option is given, a single patch file will be created if
++any changes are suggested. This requires a working diff program
++to be installed on your system.
++
++=head2 --copy=I<suffix>
++
++If this option is given, a copy of each file will be saved with
++the given suffix that contains the suggested changes. This does
++not require any external programs. Note that this does not
++automagially add a dot between the original filename and the
++suffix. If you want the dot, you have to include it in the option
++argument.
++
++If neither C<--patch> or C<--copy> are given, the default is to
++simply print the diffs for each file. This requires either
++C<Text::Diff> or a C<diff> program to be installed.
++
++=head2 --diff=I<program>
++
++Manually set the diff program and options to use. The default
++is to use C<Text::Diff>, when installed, and output unified
++context diffs.
++
++=head2 --compat-version=I<version>
++
++Tell F<ppport.h> to check for compatibility with the given
++Perl version. The default is to check for compatibility with Perl
++version 5.003. You can use this option to reduce the output
++of F<ppport.h> if you intend to be backward compatible only
++down to a certain Perl version.
++
++=head2 --cplusplus
++
++Usually, F<ppport.h> will detect C++ style comments and
++replace them with C style comments for portability reasons.
++Using this option instructs F<ppport.h> to leave C++
++comments untouched.
++
++=head2 --quiet
++
++Be quiet. Don't print anything except fatal errors.
++
++=head2 --nodiag
++
++Don't output any diagnostic messages. Only portability
++alerts will be printed.
++
++=head2 --nohints
++
++Don't output any hints. Hints often contain useful portability
++notes. Warnings will still be displayed.
++
++=head2 --nochanges
++
++Don't suggest any changes. Only give diagnostic output and hints
++unless these are also deactivated.
++
++=head2 --nofilter
++
++Don't filter the list of input files. By default, files not looking
++like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped.
++
++=head2 --strip
++
++Strip all script and documentation functionality from F<ppport.h>.
++This reduces the size of F<ppport.h> dramatically and may be useful
++if you want to include F<ppport.h> in smaller modules without
++increasing their distribution size too much.
++
++The stripped F<ppport.h> will have a C<--unstrip> option that allows
++you to undo the stripping, but only if an appropriate C<Devel::PPPort>
++module is installed.
++
++=head2 --list-provided
++
++Lists the API elements for which compatibility is provided by
++F<ppport.h>. Also lists if it must be explicitly requested,
++if it has dependencies, and if there are hints or warnings for it.
++
++=head2 --list-unsupported
++
++Lists the API elements that are known not to be supported by
++F<ppport.h> and below which version of Perl they probably
++won't be available or work.
++
++=head2 --api-info=I<name>
++
++Show portability information for API elements matching I<name>.
++If I<name> is surrounded by slashes, it is interpreted as a regular
++expression.
++
++=head1 DESCRIPTION
++
++In order for a Perl extension (XS) module to be as portable as possible
++across differing versions of Perl itself, certain steps need to be taken.
++
++=over 4
++
++=item *
++
++Including this header is the first major one. This alone will give you
++access to a large part of the Perl API that hasn't been available in
++earlier Perl releases. Use
++
++    perl ppport.h --list-provided
++
++to see which API elements are provided by ppport.h.
++
++=item *
++
++You should avoid using deprecated parts of the API. For example, using
++global Perl variables without the C<PL_> prefix is deprecated. Also,
++some API functions used to have a C<perl_> prefix. Using this form is
++also deprecated. You can safely use the supported API, as F<ppport.h>
++will provide wrappers for older Perl versions.
++
++=item *
++
++If you use one of a few functions or variables that were not present in
++earlier versions of Perl, and that can't be provided using a macro, you
++have to explicitly request support for these functions by adding one or
++more C<#define>s in your source code before the inclusion of F<ppport.h>.
++
++These functions or variables will be marked C<explicit> in the list shown
++by C<--list-provided>.
++
++Depending on whether you module has a single or multiple files that
++use such functions or variables, you want either C<static> or global
++variants.
++
++For a C<static> function or variable (used only in a single source
++file), use:
++
++    #define NEED_function
++    #define NEED_variable
++
++For a global function or variable (used in multiple source files),
++use:
++
++    #define NEED_function_GLOBAL
++    #define NEED_variable_GLOBAL
++
++Note that you mustn't have more than one global request for the
++same function or variable in your project.
++
++    Function / Variable       Static Request               Global Request
++    -----------------------------------------------------------------------------------------
++    PL_parser                 NEED_PL_parser               NEED_PL_parser_GLOBAL
++    PL_signals                NEED_PL_signals              NEED_PL_signals_GLOBAL
++    eval_pv()                 NEED_eval_pv                 NEED_eval_pv_GLOBAL
++    grok_bin()                NEED_grok_bin                NEED_grok_bin_GLOBAL
++    grok_hex()                NEED_grok_hex                NEED_grok_hex_GLOBAL
++    grok_number()             NEED_grok_number             NEED_grok_number_GLOBAL
++    grok_numeric_radix()      NEED_grok_numeric_radix      NEED_grok_numeric_radix_GLOBAL
++    grok_oct()                NEED_grok_oct                NEED_grok_oct_GLOBAL
++    load_module()             NEED_load_module             NEED_load_module_GLOBAL
++    my_snprintf()             NEED_my_snprintf             NEED_my_snprintf_GLOBAL
++    my_sprintf()              NEED_my_sprintf              NEED_my_sprintf_GLOBAL
++    my_strlcat()              NEED_my_strlcat              NEED_my_strlcat_GLOBAL
++    my_strlcpy()              NEED_my_strlcpy              NEED_my_strlcpy_GLOBAL
++    newCONSTSUB()             NEED_newCONSTSUB             NEED_newCONSTSUB_GLOBAL
++    newRV_noinc()             NEED_newRV_noinc             NEED_newRV_noinc_GLOBAL
++    newSV_type()              NEED_newSV_type              NEED_newSV_type_GLOBAL
++    newSVpvn_flags()          NEED_newSVpvn_flags          NEED_newSVpvn_flags_GLOBAL
++    newSVpvn_share()          NEED_newSVpvn_share          NEED_newSVpvn_share_GLOBAL
++    pv_display()              NEED_pv_display              NEED_pv_display_GLOBAL
++    pv_escape()               NEED_pv_escape               NEED_pv_escape_GLOBAL
++    pv_pretty()               NEED_pv_pretty               NEED_pv_pretty_GLOBAL
++    sv_2pv_flags()            NEED_sv_2pv_flags            NEED_sv_2pv_flags_GLOBAL
++    sv_2pvbyte()              NEED_sv_2pvbyte              NEED_sv_2pvbyte_GLOBAL
++    sv_catpvf_mg()            NEED_sv_catpvf_mg            NEED_sv_catpvf_mg_GLOBAL
++    sv_catpvf_mg_nocontext()  NEED_sv_catpvf_mg_nocontext  NEED_sv_catpvf_mg_nocontext_GLOBAL
++    sv_pvn_force_flags()      NEED_sv_pvn_force_flags      NEED_sv_pvn_force_flags_GLOBAL
++    sv_setpvf_mg()            NEED_sv_setpvf_mg            NEED_sv_setpvf_mg_GLOBAL
++    sv_setpvf_mg_nocontext()  NEED_sv_setpvf_mg_nocontext  NEED_sv_setpvf_mg_nocontext_GLOBAL
++    vload_module()            NEED_vload_module            NEED_vload_module_GLOBAL
++    vnewSVpvf()               NEED_vnewSVpvf               NEED_vnewSVpvf_GLOBAL
++    warner()                  NEED_warner                  NEED_warner_GLOBAL
++
++To avoid namespace conflicts, you can change the namespace of the
++explicitly exported functions / variables using the C<DPPP_NAMESPACE>
++macro. Just C<#define> the macro before including C<ppport.h>:
++
++    #define DPPP_NAMESPACE MyOwnNamespace_
++    #include "ppport.h"
++
++The default namespace is C<DPPP_>.
++
++=back
++
++The good thing is that most of the above can be checked by running
++F<ppport.h> on your source code. See the next section for
++details.
++
++=head1 EXAMPLES
++
++To verify whether F<ppport.h> is needed for your module, whether you
++should make any changes to your code, and whether any special defines
++should be used, F<ppport.h> can be run as a Perl script to check your
++source code. Simply say:
++
++    perl ppport.h
++
++The result will usually be a list of patches suggesting changes
++that should at least be acceptable, if not necessarily the most
++efficient solution, or a fix for all possible problems.
++
++If you know that your XS module uses features only available in
++newer Perl releases, if you're aware that it uses C++ comments,
++and if you want all suggestions as a single patch file, you could
++use something like this:
++
++    perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff
++
++If you only want your code to be scanned without any suggestions
++for changes, use:
++
++    perl ppport.h --nochanges
++
++You can specify a different C<diff> program or options, using
++the C<--diff> option:
++
++    perl ppport.h --diff='diff -C 10'
++
++This would output context diffs with 10 lines of context.
++
++If you want to create patched copies of your files instead, use:
++
++    perl ppport.h --copy=.new
++
++To display portability information for the C<newSVpvn> function,
++use:
++
++    perl ppport.h --api-info=newSVpvn
++
++Since the argument to C<--api-info> can be a regular expression,
++you can use
++
++    perl ppport.h --api-info=/_nomg$/
++
++to display portability information for all C<_nomg> functions or
++
++    perl ppport.h --api-info=/./
++
++to display information for all known API elements.
++
++=head1 BUGS
++
++If this version of F<ppport.h> is causing failure during
++the compilation of this module, please check if newer versions
++of either this module or C<Devel::PPPort> are available on CPAN
++before sending a bug report.
++
++If F<ppport.h> was generated using the latest version of
++C<Devel::PPPort> and is causing failure of this module, please
++file a bug report using the CPAN Request Tracker at L<http://rt.cpan.org/>.
++
++Please include the following information:
++
++=over 4
++
++=item 1.
++
++The complete output from running "perl -V"
++
++=item 2.
++
++This file.
++
++=item 3.
++
++The name and version of the module you were trying to build.
++
++=item 4.
++
++A full log of the build that failed.
++
++=item 5.
++
++Any other information that you think could be relevant.
++
++=back
++
++For the latest version of this code, please get the C<Devel::PPPort>
++module from CPAN.
++
++=head1 COPYRIGHT
++
++Version 3.x, Copyright (c) 2004-2013, Marcus Holland-Moritz.
++
++Version 2.x, Copyright (C) 2001, Paul Marquess.
++
++Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
++
++This program is free software; you can redistribute it and/or
++modify it under the same terms as Perl itself.
++
++=head1 SEE ALSO
++
++See L<Devel::PPPort>.
++
++=cut
++
++use strict;
++
++# Disable broken TRIE-optimization
++BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if $] >= 5.009004 && $] <= 5.009005 }
++
++my $VERSION = 3.21;
++
++my %opt = (
++  quiet     => 0,
++  diag      => 1,
++  hints     => 1,
++  changes   => 1,
++  cplusplus => 0,
++  filter    => 1,
++  strip     => 0,
++  version   => 0,
++);
++
++my($ppport) = $0 =~ /([\w.]+)$/;
++my $LF = '(?:\r\n|[\r\n])';   # line feed
++my $HS = "[ \t]";             # horizontal whitespace
++
++# Never use C comments in this file!
++my $ccs  = '/'.'*';
++my $cce  = '*'.'/';
++my $rccs = quotemeta $ccs;
++my $rcce = quotemeta $cce;
++
++eval {
++  require Getopt::Long;
++  Getopt::Long::GetOptions(\%opt, qw(
++    help quiet diag! filter! hints! changes! cplusplus strip version
++    patch=s copy=s diff=s compat-version=s
++    list-provided list-unsupported api-info=s
++  )) or usage();
++};
++
++if ($@ and grep /^-/, @ARGV) {
++  usage() if "@ARGV" =~ /^--?h(?:elp)?$/;
++  die "Getopt::Long not found. Please don't use any options.\n";
++}
++
++if ($opt{version}) {
++  print "This is $0 $VERSION.\n";
++  exit 0;
++}
++
++usage() if $opt{help};
++strip() if $opt{strip};
++
++if (exists $opt{'compat-version'}) {
++  my($r,$v,$s) = eval { parse_version($opt{'compat-version'}) };
++  if ($@) {
++    die "Invalid version number format: '$opt{'compat-version'}'\n";
++  }
++  die "Only Perl 5 is supported\n" if $r != 5;
++  die "Invalid version number: $opt{'compat-version'}\n" if $v >= 1000 || $s >= 1000;
++  $opt{'compat-version'} = sprintf "%d.%03d%03d", $r, $v, $s;
++}
++else {
++  $opt{'compat-version'} = 5;
++}
++
++my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/
++                ? ( $1 => {
++                      ($2                  ? ( base     => $2 ) : ()),
++                      ($3                  ? ( todo     => $3 ) : ()),
++                      (index($4, 'v') >= 0 ? ( varargs  => 1  ) : ()),
++                      (index($4, 'p') >= 0 ? ( provided => 1  ) : ()),
++                      (index($4, 'n') >= 0 ? ( nothxarg => 1  ) : ()),
++                    } )
++                : die "invalid spec: $_" } qw(
++AvFILLp|5.004050||p
++AvFILL|||
++BhkDISABLE||5.019003|
++BhkENABLE||5.019003|
++BhkENTRY_set||5.019003|
++BhkENTRY|||
++BhkFLAGS|||
++CALL_BLOCK_HOOKS|||
++CLASS|||n
++CPERLscope|5.005000||p
++CX_CURPAD_SAVE|||
++CX_CURPAD_SV|||
++CopFILEAV|5.006000||p
++CopFILEGV_set|5.006000||p
++CopFILEGV|5.006000||p
++CopFILESV|5.006000||p
++CopFILE_set|5.006000||p
++CopFILE|5.006000||p
++CopSTASHPV_set|5.006000||p
++CopSTASHPV|5.006000||p
++CopSTASH_eq|5.006000||p
++CopSTASH_set|5.006000||p
++CopSTASH|5.006000||p
++CopyD|5.009002|5.004050|p
++Copy||5.004050|
++CvPADLIST||5.008001|
++CvSTASH|||
++CvWEAKOUTSIDE|||
++DEFSV_set|5.010001||p
++DEFSV|5.004050||p
++END_EXTERN_C|5.005000||p
++ENTER|||
++ERRSV|5.004050||p
++EXTEND|||
++EXTERN_C|5.005000||p
++F0convert|||n
++FREETMPS|||
++GIMME_V||5.004000|n
++GIMME|||n
++GROK_NUMERIC_RADIX|5.007002||p
++G_ARRAY|||
++G_DISCARD|||
++G_EVAL|||
++G_METHOD|5.006001||p
++G_NOARGS|||
++G_SCALAR|||
++G_VOID||5.004000|
++GetVars|||
++GvAV|||
++GvCV|||
++GvHV|||
++GvSVn|5.009003||p
++GvSV|||
++Gv_AMupdate||5.011000|
++HEf_SVKEY||5.004000|
++HeHASH||5.004000|
++HeKEY||5.004000|
++HeKLEN||5.004000|
++HePV||5.004000|
++HeSVKEY_force||5.004000|
++HeSVKEY_set||5.004000|
++HeSVKEY||5.004000|
++HeUTF8||5.010001|
++HeVAL||5.004000|
++HvENAMELEN||5.015004|
++HvENAMEUTF8||5.015004|
++HvENAME||5.013007|
++HvNAMELEN_get|5.009003||p
++HvNAMELEN||5.015004|
++HvNAMEUTF8||5.015004|
++HvNAME_get|5.009003||p
++HvNAME|||
++INT2PTR|5.006000||p
++IN_LOCALE_COMPILETIME|5.007002||p
++IN_LOCALE_RUNTIME|5.007002||p
++IN_LOCALE|5.007002||p
++IN_PERL_COMPILETIME|5.008001||p
++IS_NUMBER_GREATER_THAN_UV_MAX|5.007002||p
++IS_NUMBER_INFINITY|5.007002||p
++IS_NUMBER_IN_UV|5.007002||p
++IS_NUMBER_NAN|5.007003||p
++IS_NUMBER_NEG|5.007002||p
++IS_NUMBER_NOT_INT|5.007002||p
++IVSIZE|5.006000||p
++IVTYPE|5.006000||p
++IVdf|5.006000||p
++LEAVE|||
++LINKLIST||5.013006|
++LVRET|||
++MARK|||
++MULTICALL||5.019003|
++MY_CXT_CLONE|5.009002||p
++MY_CXT_INIT|5.007003||p
++MY_CXT|5.007003||p
++MoveD|5.009002|5.004050|p
++Move||5.004050|
++NOOP|5.005000||p
++NUM2PTR|5.006000||p
++NVTYPE|5.006000||p
++NVef|5.006001||p
++NVff|5.006001||p
++NVgf|5.006001||p
++Newxc|5.009003||p
++Newxz|5.009003||p
++Newx|5.009003||p
++Nullav|||
++Nullch|||
++Nullcv|||
++Nullhv|||
++Nullsv|||
++OP_CLASS||5.013007|
++OP_DESC||5.007003|
++OP_NAME||5.007003|
++ORIGMARK|||
++PAD_BASE_SV|||
++PAD_CLONE_VARS|||
++PAD_COMPNAME_FLAGS|||
++PAD_COMPNAME_GEN_set|||
++PAD_COMPNAME_GEN|||
++PAD_COMPNAME_OURSTASH|||
++PAD_COMPNAME_PV|||
++PAD_COMPNAME_TYPE|||
++PAD_RESTORE_LOCAL|||
++PAD_SAVE_LOCAL|||
++PAD_SAVE_SETNULLPAD|||
++PAD_SETSV|||
++PAD_SET_CUR_NOSAVE|||
++PAD_SET_CUR|||
++PAD_SVl|||
++PAD_SV|||
++PERLIO_FUNCS_CAST|5.009003||p
++PERLIO_FUNCS_DECL|5.009003||p
++PERL_ABS|5.008001||p
++PERL_BCDVERSION|5.019002||p
++PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p
++PERL_HASH|5.004000||p
++PERL_INT_MAX|5.004000||p
++PERL_INT_MIN|5.004000||p
++PERL_LONG_MAX|5.004000||p
++PERL_LONG_MIN|5.004000||p
++PERL_MAGIC_arylen|5.007002||p
++PERL_MAGIC_backref|5.007002||p
++PERL_MAGIC_bm|5.007002||p
++PERL_MAGIC_collxfrm|5.007002||p
++PERL_MAGIC_dbfile|5.007002||p
++PERL_MAGIC_dbline|5.007002||p
++PERL_MAGIC_defelem|5.007002||p
++PERL_MAGIC_envelem|5.007002||p
++PERL_MAGIC_env|5.007002||p
++PERL_MAGIC_ext|5.007002||p
++PERL_MAGIC_fm|5.007002||p
++PERL_MAGIC_glob|5.019002||p
++PERL_MAGIC_isaelem|5.007002||p
++PERL_MAGIC_isa|5.007002||p
++PERL_MAGIC_mutex|5.019002||p
++PERL_MAGIC_nkeys|5.007002||p
++PERL_MAGIC_overload_elem|5.019002||p
++PERL_MAGIC_overload_table|5.007002||p
++PERL_MAGIC_overload|5.019002||p
++PERL_MAGIC_pos|5.007002||p
++PERL_MAGIC_qr|5.007002||p
++PERL_MAGIC_regdata|5.007002||p
++PERL_MAGIC_regdatum|5.007002||p
++PERL_MAGIC_regex_global|5.007002||p
++PERL_MAGIC_shared_scalar|5.007003||p
++PERL_MAGIC_shared|5.007003||p
++PERL_MAGIC_sigelem|5.007002||p
++PERL_MAGIC_sig|5.007002||p
++PERL_MAGIC_substr|5.007002||p
++PERL_MAGIC_sv|5.007002||p
++PERL_MAGIC_taint|5.007002||p
++PERL_MAGIC_tiedelem|5.007002||p
++PERL_MAGIC_tiedscalar|5.007002||p
++PERL_MAGIC_tied|5.007002||p
++PERL_MAGIC_utf8|5.008001||p
++PERL_MAGIC_uvar_elem|5.007003||p
++PERL_MAGIC_uvar|5.007002||p
++PERL_MAGIC_vec|5.007002||p
++PERL_MAGIC_vstring|5.008001||p
++PERL_PV_ESCAPE_ALL|5.009004||p
++PERL_PV_ESCAPE_FIRSTCHAR|5.009004||p
++PERL_PV_ESCAPE_NOBACKSLASH|5.009004||p
++PERL_PV_ESCAPE_NOCLEAR|5.009004||p
++PERL_PV_ESCAPE_QUOTE|5.009004||p
++PERL_PV_ESCAPE_RE|5.009005||p
++PERL_PV_ESCAPE_UNI_DETECT|5.009004||p
++PERL_PV_ESCAPE_UNI|5.009004||p
++PERL_PV_PRETTY_DUMP|5.009004||p
++PERL_PV_PRETTY_ELLIPSES|5.010000||p
++PERL_PV_PRETTY_LTGT|5.009004||p
++PERL_PV_PRETTY_NOCLEAR|5.010000||p
++PERL_PV_PRETTY_QUOTE|5.009004||p
++PERL_PV_PRETTY_REGPROP|5.009004||p
++PERL_QUAD_MAX|5.004000||p
++PERL_QUAD_MIN|5.004000||p
++PERL_REVISION|5.006000||p
++PERL_SCAN_ALLOW_UNDERSCORES|5.007003||p
++PERL_SCAN_DISALLOW_PREFIX|5.007003||p
++PERL_SCAN_GREATER_THAN_UV_MAX|5.007003||p
++PERL_SCAN_SILENT_ILLDIGIT|5.008001||p
++PERL_SHORT_MAX|5.004000||p
++PERL_SHORT_MIN|5.004000||p
++PERL_SIGNALS_UNSAFE_FLAG|5.008001||p
++PERL_SUBVERSION|5.006000||p
++PERL_SYS_INIT3||5.010000|
++PERL_SYS_INIT||5.010000|
++PERL_SYS_TERM||5.019003|
++PERL_UCHAR_MAX|5.004000||p
++PERL_UCHAR_MIN|5.004000||p
++PERL_UINT_MAX|5.004000||p
++PERL_UINT_MIN|5.004000||p
++PERL_ULONG_MAX|5.004000||p
++PERL_ULONG_MIN|5.004000||p
++PERL_UNUSED_ARG|5.009003||p
++PERL_UNUSED_CONTEXT|5.009004||p
++PERL_UNUSED_DECL|5.007002||p
++PERL_UNUSED_VAR|5.007002||p
++PERL_UQUAD_MAX|5.004000||p
++PERL_UQUAD_MIN|5.004000||p
++PERL_USE_GCC_BRACE_GROUPS|5.009004||p
++PERL_USHORT_MAX|5.004000||p
++PERL_USHORT_MIN|5.004000||p
++PERL_VERSION|5.006000||p
++PL_DBsignal|5.005000||p
++PL_DBsingle|||pn
++PL_DBsub|||pn
++PL_DBtrace|||pn
++PL_Sv|5.005000||p
++PL_bufend|5.019002||p
++PL_bufptr|5.019002||p
++PL_check||5.006000|
++PL_compiling|5.004050||p
++PL_comppad_name||5.017004|
++PL_comppad||5.008001|
++PL_copline|5.019002||p
++PL_curcop|5.004050||p
++PL_curpad||5.005000|
++PL_curstash|5.004050||p
++PL_debstash|5.004050||p
++PL_defgv|5.004050||p
++PL_diehook|5.004050||p
++PL_dirty|5.004050||p
++PL_dowarn|||pn
++PL_errgv|5.004050||p
++PL_error_count|5.019002||p
++PL_expect|5.019002||p
++PL_hexdigit|5.005000||p
++PL_hints|5.005000||p
++PL_in_my_stash|5.019002||p
++PL_in_my|5.019002||p
++PL_keyword_plugin||5.011002|
++PL_last_in_gv|||n
++PL_laststatval|5.005000||p
++PL_lex_state|5.019002||p
++PL_lex_stuff|5.019002||p
++PL_linestr|5.019002||p
++PL_modglobal||5.005000|n
++PL_na|5.004050||pn
++PL_no_modify|5.006000||p
++PL_ofsgv|||n
++PL_opfreehook||5.011000|n
++PL_parser|5.009005|5.009005|p
++PL_peepp||5.007003|n
++PL_perl_destruct_level|5.004050||p
++PL_perldb|5.004050||p
++PL_ppaddr|5.006000||p
++PL_rpeepp||5.013005|n
++PL_rsfp_filters|5.019002||p
++PL_rsfp|5.019002||p
++PL_rs|||n
++PL_signals|5.008001||p
++PL_stack_base|5.004050||p
++PL_stack_sp|5.004050||p
++PL_statcache|5.005000||p
++PL_stdingv|5.004050||p
++PL_sv_arenaroot|5.004050||p
++PL_sv_no|5.004050||pn
++PL_sv_undef|5.004050||pn
++PL_sv_yes|5.004050||pn
++PL_tainted|5.004050||p
++PL_tainting|5.004050||p
++PL_tokenbuf|5.019002||p
++POP_MULTICALL||5.019003|
++POPi|||n
++POPl|||n
++POPn|||n
++POPpbytex||5.007001|n
++POPpx||5.005030|n
++POPp|||n
++POPs|||n
++PTR2IV|5.006000||p
++PTR2NV|5.006000||p
++PTR2UV|5.006000||p
++PTR2nat|5.009003||p
++PTR2ul|5.007001||p
++PTRV|5.006000||p
++PUSHMARK|||
++PUSH_MULTICALL||5.019003|
++PUSHi|||
++PUSHmortal|5.009002||p
++PUSHn|||
++PUSHp|||
++PUSHs|||
++PUSHu|5.004000||p
++PUTBACK|||
++PadARRAY||5.019003|
++PadMAX||5.019003|
++PadlistARRAY||5.019003|
++PadlistMAX||5.019003|
++PadlistNAMESARRAY||5.019003|
++PadlistNAMESMAX||5.019003|
++PadlistNAMES||5.019003|
++PadlistREFCNT||5.017004|
++PadnameIsOUR|||
++PadnameIsSTATE|||
++PadnameLEN||5.019003|
++PadnameOURSTASH|||
++PadnameOUTER|||
++PadnamePV||5.019003|
++PadnameSV||5.019003|
++PadnameTYPE|||
++PadnameUTF8||5.019003|
++PadnamelistARRAY||5.019003|
++PadnamelistMAX||5.019003|
++PerlIO_clearerr||5.007003|
++PerlIO_close||5.007003|
++PerlIO_context_layers||5.009004|
++PerlIO_eof||5.007003|
++PerlIO_error||5.007003|
++PerlIO_fileno||5.007003|
++PerlIO_fill||5.007003|
++PerlIO_flush||5.007003|
++PerlIO_get_base||5.007003|
++PerlIO_get_bufsiz||5.007003|
++PerlIO_get_cnt||5.007003|
++PerlIO_get_ptr||5.007003|
++PerlIO_read||5.007003|
++PerlIO_seek||5.007003|
++PerlIO_set_cnt||5.007003|
++PerlIO_set_ptrcnt||5.007003|
++PerlIO_setlinebuf||5.007003|
++PerlIO_stderr||5.007003|
++PerlIO_stdin||5.007003|
++PerlIO_stdout||5.007003|
++PerlIO_tell||5.007003|
++PerlIO_unread||5.007003|
++PerlIO_write||5.007003|
++Perl_signbit||5.009005|n
++PoisonFree|5.009004||p
++PoisonNew|5.009004||p
++PoisonWith|5.009004||p
++Poison|5.008000||p
++READ_XDIGIT||5.017006|
++RETVAL|||n
++Renewc|||
++Renew|||
++SAVECLEARSV|||
++SAVECOMPPAD|||
++SAVEPADSV|||
++SAVETMPS|||
++SAVE_DEFSV|5.004050||p
++SPAGAIN|||
++SP|||
++START_EXTERN_C|5.005000||p
++START_MY_CXT|5.007003||p
++STMT_END|||p
++STMT_START|||p
++STR_WITH_LEN|5.009003||p
++ST|||
++SV_CONST_RETURN|5.009003||p
++SV_COW_DROP_PV|5.008001||p
++SV_COW_SHARED_HASH_KEYS|5.009005||p
++SV_GMAGIC|5.007002||p
++SV_HAS_TRAILING_NUL|5.009004||p
++SV_IMMEDIATE_UNREF|5.007001||p
++SV_MUTABLE_RETURN|5.009003||p
++SV_NOSTEAL|5.009002||p
++SV_SMAGIC|5.009003||p
++SV_UTF8_NO_ENCODING|5.008001||p
++SVfARG|5.009005||p
++SVf_UTF8|5.006000||p
++SVf|5.006000||p
++SVt_INVLIST||5.019002|
++SVt_IV|||
++SVt_NULL|||
++SVt_NV|||
++SVt_PVAV|||
++SVt_PVCV|||
++SVt_PVFM|||
++SVt_PVGV|||
++SVt_PVHV|||
++SVt_PVIO|||
++SVt_PVIV|||
++SVt_PVLV|||
++SVt_PVMG|||
++SVt_PVNV|||
++SVt_PV|||
++SVt_REGEXP||5.011000|
++Safefree|||
++Slab_Alloc|||
++Slab_Free|||
++Slab_to_ro|||
++Slab_to_rw|||
++StructCopy|||
++SvCUR_set|||
++SvCUR|||
++SvEND|||
++SvGAMAGIC||5.006001|
++SvGETMAGIC|5.004050||p
++SvGROW|||
++SvIOK_UV||5.006000|
++SvIOK_notUV||5.006000|
++SvIOK_off|||
++SvIOK_only_UV||5.006000|
++SvIOK_only|||
++SvIOK_on|||
++SvIOKp|||
++SvIOK|||
++SvIVX|||
++SvIV_nomg|5.009001||p
++SvIV_set|||
++SvIVx|||
++SvIV|||
++SvIsCOW_shared_hash||5.008003|
++SvIsCOW||5.008003|
++SvLEN_set|||
++SvLEN|||
++SvLOCK||5.007003|
++SvMAGIC_set|5.009003||p
++SvNIOK_off|||
++SvNIOKp|||
++SvNIOK|||
++SvNOK_off|||
++SvNOK_only|||
++SvNOK_on|||
++SvNOKp|||
++SvNOK|||
++SvNVX|||
++SvNV_nomg||5.013002|
++SvNV_set|||
++SvNVx|||
++SvNV|||
++SvOK|||
++SvOOK_offset||5.011000|
++SvOOK|||
++SvPOK_off|||
++SvPOK_only_UTF8||5.006000|
++SvPOK_only|||
++SvPOK_on|||
++SvPOKp|||
++SvPOK|||
++SvPVX_const|5.009003||p
++SvPVX_mutable|5.009003||p
++SvPVX|||
++SvPV_const|5.009003||p
++SvPV_flags_const_nolen|5.009003||p
++SvPV_flags_const|5.009003||p
++SvPV_flags_mutable|5.009003||p
++SvPV_flags|5.007002||p
++SvPV_force_flags_mutable|5.009003||p
++SvPV_force_flags_nolen|5.009003||p
++SvPV_force_flags|5.007002||p
++SvPV_force_mutable|5.009003||p
++SvPV_force_nolen|5.009003||p
++SvPV_force_nomg_nolen|5.009003||p
++SvPV_force_nomg|5.007002||p
++SvPV_force|||p
++SvPV_mutable|5.009003||p
++SvPV_nolen_const|5.009003||p
++SvPV_nolen|5.006000||p
++SvPV_nomg_const_nolen|5.009003||p
++SvPV_nomg_const|5.009003||p
++SvPV_nomg_nolen|5.013007||p
++SvPV_nomg|5.007002||p
++SvPV_renew|5.009003||p
++SvPV_set|||
++SvPVbyte_force||5.009002|
++SvPVbyte_nolen||5.006000|
++SvPVbytex_force||5.006000|
++SvPVbytex||5.006000|
++SvPVbyte|5.006000||p
++SvPVutf8_force||5.006000|
++SvPVutf8_nolen||5.006000|
++SvPVutf8x_force||5.006000|
++SvPVutf8x||5.006000|
++SvPVutf8||5.006000|
++SvPVx|||
++SvPV|||
++SvREFCNT_dec_NN||5.017007|
++SvREFCNT_dec|||
++SvREFCNT_inc_NN|5.009004||p
++SvREFCNT_inc_simple_NN|5.009004||p
++SvREFCNT_inc_simple_void_NN|5.009004||p
++SvREFCNT_inc_simple_void|5.009004||p
++SvREFCNT_inc_simple|5.009004||p
++SvREFCNT_inc_void_NN|5.009004||p
++SvREFCNT_inc_void|5.009004||p
++SvREFCNT_inc|||p
++SvREFCNT|||
++SvROK_off|||
++SvROK_on|||
++SvROK|||
++SvRV_set|5.009003||p
++SvRV|||
++SvRXOK||5.009005|
++SvRX||5.009005|
++SvSETMAGIC|||
++SvSHARED_HASH|5.009003||p
++SvSHARE||5.007003|
++SvSTASH_set|5.009003||p
++SvSTASH|||
++SvSetMagicSV_nosteal||5.004000|
++SvSetMagicSV||5.004000|
++SvSetSV_nosteal||5.004000|
++SvSetSV|||
++SvTAINTED_off||5.004000|
++SvTAINTED_on||5.004000|
++SvTAINTED||5.004000|
++SvTAINT|||
++SvTHINKFIRST|||
++SvTRUE_nomg||5.013006|
++SvTRUE|||
++SvTYPE|||
++SvUNLOCK||5.007003|
++SvUOK|5.007001|5.006000|p
++SvUPGRADE|||
++SvUTF8_off||5.006000|
++SvUTF8_on||5.006000|
++SvUTF8||5.006000|
++SvUVXx|5.004000||p
++SvUVX|5.004000||p
++SvUV_nomg|5.009001||p
++SvUV_set|5.009003||p
++SvUVx|5.004000||p
++SvUV|5.004000||p
++SvVOK||5.008001|
++SvVSTRING_mg|5.009004||p
++THIS|||n
++UNDERBAR|5.009002||p
++UTF8_MAXBYTES|5.009002||p
++UVSIZE|5.006000||p
++UVTYPE|5.006000||p
++UVXf|5.007001||p
++UVof|5.006000||p
++UVuf|5.006000||p
++UVxf|5.006000||p
++WARN_ALL|5.006000||p
++WARN_AMBIGUOUS|5.006000||p
++WARN_ASSERTIONS|5.019002||p
++WARN_BAREWORD|5.006000||p
++WARN_CLOSED|5.006000||p
++WARN_CLOSURE|5.006000||p
++WARN_DEBUGGING|5.006000||p
++WARN_DEPRECATED|5.006000||p
++WARN_DIGIT|5.006000||p
++WARN_EXEC|5.006000||p
++WARN_EXITING|5.006000||p
++WARN_GLOB|5.006000||p
++WARN_INPLACE|5.006000||p
++WARN_INTERNAL|5.006000||p
++WARN_IO|5.006000||p
++WARN_LAYER|5.008000||p
++WARN_MALLOC|5.006000||p
++WARN_MISC|5.006000||p
++WARN_NEWLINE|5.006000||p
++WARN_NUMERIC|5.006000||p
++WARN_ONCE|5.006000||p
++WARN_OVERFLOW|5.006000||p
++WARN_PACK|5.006000||p
++WARN_PARENTHESIS|5.006000||p
++WARN_PIPE|5.006000||p
++WARN_PORTABLE|5.006000||p
++WARN_PRECEDENCE|5.006000||p
++WARN_PRINTF|5.006000||p
++WARN_PROTOTYPE|5.006000||p
++WARN_QW|5.006000||p
++WARN_RECURSION|5.006000||p
++WARN_REDEFINE|5.006000||p
++WARN_REGEXP|5.006000||p
++WARN_RESERVED|5.006000||p
++WARN_SEMICOLON|5.006000||p
++WARN_SEVERE|5.006000||p
++WARN_SIGNAL|5.006000||p
++WARN_SUBSTR|5.006000||p
++WARN_SYNTAX|5.006000||p
++WARN_TAINT|5.006000||p
++WARN_THREADS|5.008000||p
++WARN_UNINITIALIZED|5.006000||p
++WARN_UNOPENED|5.006000||p
++WARN_UNPACK|5.006000||p
++WARN_UNTIE|5.006000||p
++WARN_UTF8|5.006000||p
++WARN_VOID|5.006000||p
++WIDEST_UTYPE|5.015004||p
++XCPT_CATCH|5.009002||p
++XCPT_RETHROW|5.009002|5.007001|p
++XCPT_TRY_END|5.009002|5.004000|p
++XCPT_TRY_START|5.009002|5.004000|p
++XPUSHi|||
++XPUSHmortal|5.009002||p
++XPUSHn|||
++XPUSHp|||
++XPUSHs|||
++XPUSHu|5.004000||p
++XSPROTO|5.010000||p
++XSRETURN_EMPTY|||
++XSRETURN_IV|||
++XSRETURN_NO|||
++XSRETURN_NV|||
++XSRETURN_PV|||
++XSRETURN_UNDEF|||
++XSRETURN_UV|5.008001||p
++XSRETURN_YES|||
++XSRETURN|||p
++XST_mIV|||
++XST_mNO|||
++XST_mNV|||
++XST_mPV|||
++XST_mUNDEF|||
++XST_mUV|5.008001||p
++XST_mYES|||
++XS_APIVERSION_BOOTCHECK||5.013004|
++XS_EXTERNAL||5.019003|
++XS_INTERNAL||5.019003|
++XS_VERSION_BOOTCHECK|||
++XS_VERSION|||
++XSprePUSH|5.006000||p
++XS|||
++XopDISABLE||5.019003|
++XopENABLE||5.019003|
++XopENTRY_set||5.019003|
++XopENTRY||5.019003|
++XopFLAGS||5.013007|
++ZeroD|5.009002||p
++Zero|||
++_aMY_CXT|5.007003||p
++_add_range_to_invlist|||
++_append_range_to_invlist|||
++_core_swash_init|||
++_get_swash_invlist|||
++_invlist_array_init|||
++_invlist_contains_cp|||
++_invlist_contents|||
++_invlist_dump|||
++_invlist_intersection_maybe_complement_2nd|||
++_invlist_intersection|||
++_invlist_invert_prop|||
++_invlist_invert|||
++_invlist_len|||
++_invlist_populate_swatch|||
++_invlist_search|||
++_invlist_subtract|||
++_invlist_union_maybe_complement_2nd|||
++_invlist_union|||
++_is_uni_FOO||5.017008|
++_is_uni_perl_idcont||5.017008|
++_is_uni_perl_idstart||5.017007|
++_is_utf8_FOO||5.017008|
++_is_utf8_mark||5.017008|
++_is_utf8_perl_idcont||5.017008|
++_is_utf8_perl_idstart||5.017007|
++_new_invlist_C_array|||
++_new_invlist|||
++_pMY_CXT|5.007003||p
++_swash_inversion_hash|||
++_swash_to_invlist|||
++_to_fold_latin1|||
++_to_uni_fold_flags||5.013011|
++_to_upper_title_latin1|||
++_to_utf8_fold_flags||5.015006|
++_to_utf8_lower_flags||5.015006|
++_to_utf8_title_flags||5.015006|
++_to_utf8_upper_flags||5.015006|
++aMY_CXT_|5.007003||p
++aMY_CXT|5.007003||p
++aTHXR_|5.019002||p
++aTHXR|5.019002||p
++aTHX_|5.006000||p
++aTHX|5.006000||p
++aassign_common_vars|||
++add_cp_to_invlist|||
++add_data|||n
++add_utf16_textfilter|||
++addmad|||
++adjust_size_and_find_bucket|||n
++adjust_stack_on_leave|||
++alloc_maybe_populate_EXACT|||
++alloccopstash|||
++allocmy|||
++amagic_call|||
++amagic_cmp_locale|||
++amagic_cmp|||
++amagic_deref_call||5.013007|
++amagic_i_ncmp|||
++amagic_is_enabled|||
++amagic_ncmp|||
++anonymise_cv_maybe|||
++any_dup|||
++ao|||
++append_madprops|||
++apply_attrs_my|||
++apply_attrs_string||5.006001|
++apply_attrs|||
++apply|||
++assert_uft8_cache_coherent|||
++atfork_lock||5.007003|n
++atfork_unlock||5.007003|n
++av_arylen_p||5.009003|
++av_clear|||
++av_create_and_push||5.009005|
++av_create_and_unshift_one||5.009005|
++av_delete||5.006000|
++av_exists||5.006000|
++av_extend_guts|||
++av_extend|||
++av_fetch|||
++av_fill|||
++av_iter_p||5.011000|
++av_len|||
++av_make|||
++av_pop|||
++av_push|||
++av_reify|||
++av_shift|||
++av_store|||
++av_tindex||5.017009|
++av_top_index||5.017009|
++av_undef|||
++av_unshift|||
++ax|||n
++bad_type_gv|||
++bad_type_pv|||
++bind_match|||
++block_end|||
++block_gimme||5.004000|
++block_start|||
++blockhook_register||5.013003|
++boolSV|5.004000||p
++boot_core_PerlIO|||
++boot_core_UNIVERSAL|||
++boot_core_mro|||
++bytes_cmp_utf8||5.013007|
++bytes_from_utf8||5.007001|
++bytes_to_uni|||n
++bytes_to_utf8||5.006001|
++call_argv|5.006000||p
++call_atexit||5.006000|
++call_list||5.004000|
++call_method|5.006000||p
++call_pv|5.006000||p
++call_sv|5.006000||p
++caller_cx||5.013005|
++calloc||5.007002|n
++cando|||
++cast_i32||5.006000|
++cast_iv||5.006000|
++cast_ulong||5.006000|
++cast_uv||5.006000|
++check_locale_boundary_crossing|||
++check_type_and_open|||
++check_uni|||
++check_utf8_print|||
++checkcomma|||
++ckWARN|5.006000||p
++ck_entersub_args_core|||
++ck_entersub_args_list||5.013006|
++ck_entersub_args_proto_or_list||5.013006|
++ck_entersub_args_proto||5.013006|
++ck_warner_d||5.011001|v
++ck_warner||5.011001|v
++ckwarn_common|||
++ckwarn_d||5.009003|
++ckwarn||5.009003|
++cl_and|||n
++cl_anything|||n
++cl_init|||n
++cl_is_anything|||n
++cl_or|||n
++clear_placeholders|||
++clone_params_del|||n
++clone_params_new|||n
++closest_cop|||
++compute_EXACTish|||
++convert|||
++cop_fetch_label||5.015001|
++cop_free|||
++cop_hints_2hv||5.013007|
++cop_hints_fetch_pvn||5.013007|
++cop_hints_fetch_pvs||5.013007|
++cop_hints_fetch_pv||5.013007|
++cop_hints_fetch_sv||5.013007|
++cop_store_label||5.015001|
++cophh_2hv||5.013007|
++cophh_copy||5.013007|
++cophh_delete_pvn||5.013007|
++cophh_delete_pvs||5.013007|
++cophh_delete_pv||5.013007|
++cophh_delete_sv||5.013007|
++cophh_fetch_pvn||5.013007|
++cophh_fetch_pvs||5.013007|
++cophh_fetch_pv||5.013007|
++cophh_fetch_sv||5.013007|
++cophh_free||5.013007|
++cophh_new_empty||5.019003|
++cophh_store_pvn||5.013007|
++cophh_store_pvs||5.013007|
++cophh_store_pv||5.013007|
++cophh_store_sv||5.013007|
++core_prototype|||
++core_regclass_swash|||
++coresub_op|||
++could_it_be_a_POSIX_class|||
++cr_textfilter|||
++create_eval_scope|||
++croak_memory_wrap||5.019003|n
++croak_no_mem|||n
++croak_no_modify||5.013003|n
++croak_nocontext|||vn
++croak_popstack|||n
++croak_sv||5.013001|
++croak_xs_usage||5.010001|n
++croak|||v
++csighandler||5.009003|n
++curmad|||
++current_re_engine|||
++curse|||
++custom_op_desc||5.007003|
++custom_op_name||5.007003|
++custom_op_register||5.013007|
++custom_op_xop||5.013007|
++cv_ckproto_len_flags|||
++cv_clone_into|||
++cv_clone|||
++cv_const_sv_or_av|||
++cv_const_sv||5.004000|
++cv_dump|||
++cv_forget_slab|||
++cv_get_call_checker||5.013006|
++cv_set_call_checker||5.013006|
++cv_undef|||
++cvgv_set|||
++cvstash_set|||
++cx_dump||5.005000|
++cx_dup|||
++cxinc|||
++dAXMARK|5.009003||p
++dAX|5.007002||p
++dITEMS|5.007002||p
++dMARK|||
++dMULTICALL||5.009003|
++dMY_CXT_SV|5.007003||p
++dMY_CXT|5.007003||p
++dNOOP|5.006000||p
++dORIGMARK|||
++dSP|||
++dTHR|5.004050||p
++dTHXR|5.019002||p
++dTHXa|5.006000||p
++dTHXoa|5.006000||p
++dTHX|5.006000||p
++dUNDERBAR|5.009002||p
++dVAR|5.009003||p
++dXCPT|5.009002||p
++dXSARGS|||
++dXSI32|||
++dXSTARG|5.006000||p
++deb_curcv|||
++deb_nocontext|||vn
++deb_stack_all|||
++deb_stack_n|||
++debop||5.005000|
++debprofdump||5.005000|
++debprof|||
++debstackptrs||5.007003|
++debstack||5.007003|
++debug_start_match|||
++deb||5.007003|v
++defelem_target|||
++del_sv|||
++delete_eval_scope|||
++delimcpy||5.004000|n
++deprecate_commaless_var_list|||
++despatch_signals||5.007001|
++destroy_matcher|||
++die_nocontext|||vn
++die_sv||5.013001|
++die_unwind|||
++die|||v
++dirp_dup|||
++div128|||
++djSP|||
++do_aexec5|||
++do_aexec|||
++do_aspawn|||
++do_binmode||5.004050|
++do_chomp|||
++do_close|||
++do_delete_local|||
++do_dump_pad|||
++do_eof|||
++do_exec3|||
++do_execfree|||
++do_exec|||
++do_gv_dump||5.006000|
++do_gvgv_dump||5.006000|
++do_hv_dump||5.006000|
++do_ipcctl|||
++do_ipcget|||
++do_join|||
++do_magic_dump||5.006000|
++do_msgrcv|||
++do_msgsnd|||
++do_ncmp|||
++do_oddball|||
++do_op_dump||5.006000|
++do_op_xmldump|||
++do_open9||5.006000|
++do_openn||5.007001|
++do_open||5.004000|
++do_pmop_dump||5.006000|
++do_pmop_xmldump|||
++do_print|||
++do_readline|||
++do_seek|||
++do_semop|||
++do_shmio|||
++do_smartmatch|||
++do_spawn_nowait|||
++do_spawn|||
++do_sprintf|||
++do_sv_dump||5.006000|
++do_sysseek|||
++do_tell|||
++do_trans_complex_utf8|||
++do_trans_complex|||
++do_trans_count_utf8|||
++do_trans_count|||
++do_trans_simple_utf8|||
++do_trans_simple|||
++do_trans|||
++do_vecget|||
++do_vecset|||
++do_vop|||
++docatch|||
++doeval|||
++dofile|||
++dofindlabel|||
++doform|||
++doing_taint||5.008001|n
++dooneliner|||
++doopen_pm|||
++doparseform|||
++dopoptoeval|||
++dopoptogiven|||
++dopoptolabel|||
++dopoptoloop|||
++dopoptosub_at|||
++dopoptowhen|||
++doref||5.009003|
++dounwind|||
++dowantarray|||
++dump_all_perl|||
++dump_all||5.006000|
++dump_eval||5.006000|
++dump_exec_pos|||
++dump_fds|||
++dump_form||5.006000|
++dump_indent||5.006000|v
++dump_mstats|||
++dump_packsubs_perl|||
++dump_packsubs||5.006000|
++dump_sub_perl|||
++dump_sub||5.006000|
++dump_sv_child|||
++dump_trie_interim_list|||
++dump_trie_interim_table|||
++dump_trie|||
++dump_vindent||5.006000|
++dumpuntil|||
++dup_attrlist|||
++emulate_cop_io|||
++eval_pv|5.006000||p
++eval_sv|5.006000||p
++exec_failed|||
++expect_number|||
++fbm_compile||5.005000|
++fbm_instr||5.005000|
++feature_is_enabled|||
++filter_add|||
++filter_del|||
++filter_gets|||
++filter_read|||
++finalize_optree|||
++finalize_op|||
++find_and_forget_pmops|||
++find_array_subscript|||
++find_beginning|||
++find_byclass|||
++find_hash_subscript|||
++find_in_my_stash|||
++find_lexical_cv|||
++find_runcv_where|||
++find_runcv||5.008001|
++find_rundefsv2|||
++find_rundefsvoffset||5.009002|
++find_rundefsv||5.013002|
++find_script|||
++find_uninit_var|||
++first_symbol|||n
++foldEQ_latin1||5.013008|n
++foldEQ_locale||5.013002|n
++foldEQ_utf8_flags||5.013010|
++foldEQ_utf8||5.013002|
++foldEQ||5.013002|n
++fold_constants|||
++forbid_setid|||
++force_ident_maybe_lex|||
++force_ident|||
++force_list|||
++force_next|||
++force_strict_version|||
++force_version|||
++force_word|||
++forget_pmop|||
++form_nocontext|||vn
++form_short_octal_warning|||
++form||5.004000|v
++fp_dup|||
++fprintf_nocontext|||vn
++free_global_struct|||
++free_tied_hv_pool|||
++free_tmps|||
++gen_constant_list|||
++get_and_check_backslash_N_name|||
++get_aux_mg|||
++get_av|5.006000||p
++get_context||5.006000|n
++get_cvn_flags|5.009005||p
++get_cvs|5.011000||p
++get_cv|5.006000||p
++get_db_sub|||
++get_debug_opts|||
++get_hash_seed|||
++get_hv|5.006000||p
++get_invlist_iter_addr|||
++get_invlist_offset_addr|||
++get_invlist_previous_index_addr|||
++get_mstats|||
++get_no_modify|||
++get_num|||
++get_op_descs||5.005000|
++get_op_names||5.005000|
++get_opargs|||
++get_ppaddr||5.006000|
++get_re_arg|||
++get_sv|5.006000||p
++get_vtbl||5.005030|
++getcwd_sv||5.007002|
++getenv_len|||
++glob_2number|||
++glob_assign_glob|||
++glob_assign_ref|||
++gp_dup|||
++gp_free|||
++gp_ref|||
++grok_bin|5.007003||p
++grok_bslash_N|||
++grok_bslash_c|||
++grok_bslash_o|||
++grok_bslash_x|||
++grok_hex|5.007003||p
++grok_number|5.007002||p
++grok_numeric_radix|5.007002||p
++grok_oct|5.007003||p
++group_end|||
++gv_AVadd|||
++gv_HVadd|||
++gv_IOadd|||
++gv_SVadd|||
++gv_add_by_type||5.011000|
++gv_autoload4||5.004000|
++gv_autoload_pvn||5.015004|
++gv_autoload_pv||5.015004|
++gv_autoload_sv||5.015004|
++gv_check|||
++gv_const_sv||5.009003|
++gv_dump||5.006000|
++gv_efullname3||5.004000|
++gv_efullname4||5.006001|
++gv_efullname|||
++gv_ename|||
++gv_fetchfile_flags||5.009005|
++gv_fetchfile|||
++gv_fetchmeth_autoload||5.007003|
++gv_fetchmeth_pv_autoload||5.015004|
++gv_fetchmeth_pvn_autoload||5.015004|
++gv_fetchmeth_pvn||5.015004|
++gv_fetchmeth_pv||5.015004|
++gv_fetchmeth_sv_autoload||5.015004|
++gv_fetchmeth_sv||5.015004|
++gv_fetchmethod_autoload||5.004000|
++gv_fetchmethod_pv_flags||5.015004|
++gv_fetchmethod_pvn_flags||5.015004|
++gv_fetchmethod_sv_flags||5.015004|
++gv_fetchmethod|||
++gv_fetchmeth|||
++gv_fetchpvn_flags|5.009002||p
++gv_fetchpvs|5.009004||p
++gv_fetchpv|||
++gv_fetchsv|5.009002||p
++gv_fullname3||5.004000|
++gv_fullname4||5.006001|
++gv_fullname|||
++gv_handler||5.007001|
++gv_init_pvn||5.015004|
++gv_init_pv||5.015004|
++gv_init_svtype|||
++gv_init_sv||5.015004|
++gv_init|||
++gv_magicalize_isa|||
++gv_name_set||5.009004|
++gv_stashpvn|5.004000||p
++gv_stashpvs|5.009003||p
++gv_stashpv|||
++gv_stashsv|||
++gv_try_downgrade|||
++handle_regex_sets|||
++he_dup|||
++hek_dup|||
++hfree_next_entry|||
++hfreeentries|||
++hsplit|||
++hv_assert|||
++hv_auxinit|||
++hv_backreferences_p|||
++hv_clear_placeholders||5.009001|
++hv_clear|||
++hv_common_key_len||5.010000|
++hv_common||5.010000|
++hv_copy_hints_hv||5.009004|
++hv_delayfree_ent||5.004000|
++hv_delete_common|||
++hv_delete_ent||5.004000|
++hv_delete|||
++hv_eiter_p||5.009003|
++hv_eiter_set||5.009003|
++hv_ename_add|||
++hv_ename_delete|||
++hv_exists_ent||5.004000|
++hv_exists|||
++hv_fetch_ent||5.004000|
++hv_fetchs|5.009003||p
++hv_fetch|||
++hv_fill||5.013002|
++hv_free_ent_ret|||
++hv_free_ent||5.004000|
++hv_iterinit|||
++hv_iterkeysv||5.004000|
++hv_iterkey|||
++hv_iternext_flags||5.008000|
++hv_iternextsv|||
++hv_iternext|||
++hv_iterval|||
++hv_kill_backrefs|||
++hv_ksplit||5.004000|
++hv_magic_check|||n
++hv_magic|||
++hv_name_set||5.009003|
++hv_notallowed|||
++hv_placeholders_get||5.009003|
++hv_placeholders_p|||
++hv_placeholders_set||5.009003|
++hv_rand_set||5.017011|
++hv_riter_p||5.009003|
++hv_riter_set||5.009003|
++hv_scalar||5.009001|
++hv_store_ent||5.004000|
++hv_store_flags||5.008000|
++hv_stores|5.009004||p
++hv_store|||
++hv_undef_flags|||
++hv_undef|||
++ibcmp_locale||5.004000|
++ibcmp_utf8||5.007003|
++ibcmp|||
++incline|||
++incpush_if_exists|||
++incpush_use_sep|||
++incpush|||
++ingroup|||
++init_argv_symbols|||
++init_constants|||
++init_dbargs|||
++init_debugger|||
++init_global_struct|||
++init_i18nl10n||5.006000|
++init_i18nl14n||5.006000|
++init_ids|||
++init_interp|||
++init_main_stash|||
++init_perllib|||
++init_postdump_symbols|||
++init_predump_symbols|||
++init_stacks||5.005000|
++init_tm||5.007002|
++inplace_aassign|||
++instr|||n
++intro_my|||
++intuit_method|||
++intuit_more|||
++invert|||
++invlist_array|||
++invlist_clone|||
++invlist_extend|||
++invlist_highest|||
++invlist_is_iterating|||
++invlist_iterfinish|||
++invlist_iterinit|||
++invlist_iternext|||
++invlist_max|||
++invlist_previous_index|||
++invlist_set_len|||
++invlist_set_previous_index|||
++invlist_trim|||
++invoke_exception_hook|||
++io_close|||
++isALNUMC|5.006000||p
++isALNUM_lazy|||
++isALPHANUMERIC||5.017008|
++isALPHA|||
++isASCII|5.006000|5.006000|p
++isBLANK|5.006001||p
++isCNTRL|5.006000|5.006000|p
++isDIGIT|||
++isFOO_lc|||
++isFOO_utf8_lc|||
++isGRAPH|5.006000||p
++isGV_with_GP|5.009004||p
++isIDCONT||5.017008|
++isIDFIRST_lazy|||
++isIDFIRST|||
++isLOWER|||
++isOCTAL||5.013005|
++isPRINT|5.004000||p
++isPSXSPC|5.006001||p
++isPUNCT|5.006000||p
++isSPACE|||
++isUPPER|||
++isWORDCHAR||5.013006|
++isXDIGIT|5.006000||p
++is_an_int|||
++is_ascii_string||5.011000|n
++is_cur_LC_category_utf8|||
++is_handle_constructor|||n
++is_list_assignment|||
++is_lvalue_sub||5.007001|
++is_uni_alnum_lc||5.006000|
++is_uni_alnumc_lc||5.017007|
++is_uni_alnumc||5.017007|
++is_uni_alnum||5.006000|
++is_uni_alpha_lc||5.006000|
++is_uni_alpha||5.006000|
++is_uni_ascii_lc||5.006000|
++is_uni_ascii||5.006000|
++is_uni_blank_lc||5.017002|
++is_uni_blank||5.017002|
++is_uni_cntrl_lc||5.006000|
++is_uni_cntrl||5.006000|
++is_uni_digit_lc||5.006000|
++is_uni_digit||5.006000|
++is_uni_graph_lc||5.006000|
++is_uni_graph||5.006000|
++is_uni_idfirst_lc||5.006000|
++is_uni_idfirst||5.006000|
++is_uni_lower_lc||5.006000|
++is_uni_lower||5.006000|
++is_uni_print_lc||5.006000|
++is_uni_print||5.006000|
++is_uni_punct_lc||5.006000|
++is_uni_punct||5.006000|
++is_uni_space_lc||5.006000|
++is_uni_space||5.006000|
++is_uni_upper_lc||5.006000|
++is_uni_upper||5.006000|
++is_uni_xdigit_lc||5.006000|
++is_uni_xdigit||5.006000|
++is_utf8_alnumc||5.017007|
++is_utf8_alnum||5.006000|
++is_utf8_alpha||5.006000|
++is_utf8_ascii||5.006000|
++is_utf8_blank||5.017002|
++is_utf8_char_buf||5.015008|n
++is_utf8_char_slow|||n
++is_utf8_char||5.006000|n
++is_utf8_cntrl||5.006000|
++is_utf8_common|||
++is_utf8_digit||5.006000|
++is_utf8_graph||5.006000|
++is_utf8_idcont||5.008000|
++is_utf8_idfirst||5.006000|
++is_utf8_lower||5.006000|
++is_utf8_mark||5.006000|
++is_utf8_perl_space||5.011001|
++is_utf8_perl_word||5.011001|
++is_utf8_posix_digit||5.011001|
++is_utf8_print||5.006000|
++is_utf8_punct||5.006000|
++is_utf8_space||5.006000|
++is_utf8_string_loclen||5.009003|n
++is_utf8_string_loc||5.008001|n
++is_utf8_string||5.006001|n
++is_utf8_upper||5.006000|
++is_utf8_xdigit||5.006000|
++is_utf8_xidcont||5.013010|
++is_utf8_xidfirst||5.013010|
++isa_lookup|||
++items|||n
++ix|||n
++jmaybe|||
++join_exact|||
++keyword_plugin_standard|||
++keyword|||
++leave_scope|||
++lex_bufutf8||5.011002|
++lex_discard_to||5.011002|
++lex_grow_linestr||5.011002|
++lex_next_chunk||5.011002|
++lex_peek_unichar||5.011002|
++lex_read_space||5.011002|
++lex_read_to||5.011002|
++lex_read_unichar||5.011002|
++lex_start||5.009005|
++lex_stuff_pvn||5.011002|
++lex_stuff_pvs||5.013005|
++lex_stuff_pv||5.013006|
++lex_stuff_sv||5.011002|
++lex_unstuff||5.011002|
++listkids|||
++list|||
++load_module_nocontext|||vn
++load_module|5.006000||pv
++localize|||
++looks_like_bool|||
++looks_like_number|||
++lop|||
++mPUSHi|5.009002||p
++mPUSHn|5.009002||p
++mPUSHp|5.009002||p
++mPUSHs|5.010001||p
++mPUSHu|5.009002||p
++mXPUSHi|5.009002||p
++mXPUSHn|5.009002||p
++mXPUSHp|5.009002||p
++mXPUSHs|5.010001||p
++mXPUSHu|5.009002||p
++mad_free|||
++madlex|||
++madparse|||
++magic_clear_all_env|||
++magic_cleararylen_p|||
++magic_clearenv|||
++magic_clearhints|||
++magic_clearhint|||
++magic_clearisa|||
++magic_clearpack|||
++magic_clearsig|||
++magic_copycallchecker|||
++magic_dump||5.006000|
++magic_existspack|||
++magic_freearylen_p|||
++magic_freeovrld|||
++magic_getarylen|||
++magic_getdefelem|||
++magic_getnkeys|||
++magic_getpack|||
++magic_getpos|||
++magic_getsig|||
++magic_getsubstr|||
++magic_gettaint|||
++magic_getuvar|||
++magic_getvec|||
++magic_get|||
++magic_killbackrefs|||
++magic_methcall1|||
++magic_methcall|||v
++magic_methpack|||
++magic_nextpack|||
++magic_regdata_cnt|||
++magic_regdatum_get|||
++magic_regdatum_set|||
++magic_scalarpack|||
++magic_set_all_env|||
++magic_setarylen|||
++magic_setcollxfrm|||
++magic_setdbline|||
++magic_setdefelem|||
++magic_setenv|||
++magic_sethint|||
++magic_setisa|||
++magic_setmglob|||
++magic_setnkeys|||
++magic_setpack|||
++magic_setpos|||
++magic_setregexp|||
++magic_setsig|||
++magic_setsubstr|||
++magic_settaint|||
++magic_setutf8|||
++magic_setuvar|||
++magic_setvec|||
++magic_set|||
++magic_sizepack|||
++magic_wipepack|||
++make_matcher|||
++make_trie_failtable|||
++make_trie|||
++malloc_good_size|||n
++malloced_size|||n
++malloc||5.007002|n
++markstack_grow|||
++matcher_matches_sv|||
++mayberelocate|||
++measure_struct|||
++memEQs|5.009005||p
++memEQ|5.004000||p
++memNEs|5.009005||p
++memNE|5.004000||p
++mem_collxfrm|||
++mem_log_common|||n
++mess_alloc|||
++mess_nocontext|||vn
++mess_sv||5.013001|
++mess||5.006000|v
++method_common|||
++mfree||5.007002|n
++mg_clear|||
++mg_copy|||
++mg_dup|||
++mg_find_mglob|||
++mg_findext||5.013008|
++mg_find|||
++mg_free_type||5.013006|
++mg_free|||
++mg_get|||
++mg_length||5.005000|
++mg_localize|||
++mg_magical|||
++mg_set|||
++mg_size||5.005000|
++mini_mktime||5.007002|
++minus_v|||
++missingterm|||
++mode_from_discipline|||
++modkids|||
++more_bodies|||
++more_sv|||
++moreswitches|||
++mro_clean_isarev|||
++mro_gather_and_rename|||
++mro_get_from_name||5.010001|
++mro_get_linear_isa_dfs|||
++mro_get_linear_isa||5.009005|
++mro_get_private_data||5.010001|
++mro_isa_changed_in|||
++mro_meta_dup|||
++mro_meta_init|||
++mro_method_changed_in||5.009005|
++mro_package_moved|||
++mro_register||5.010001|
++mro_set_mro||5.010001|
++mro_set_private_data||5.010001|
++mul128|||
++mulexp10|||n
++my_atof2||5.007002|
++my_atof||5.006000|
++my_attrs|||
++my_bcopy|||n
++my_bzero|||n
++my_chsize|||
++my_clearenv|||
++my_cxt_index|||
++my_cxt_init|||
++my_dirfd||5.009005|
++my_exit_jump|||
++my_exit|||
++my_failure_exit||5.004000|
++my_fflush_all||5.006000|
++my_fork||5.007003|n
++my_kid|||
++my_lstat_flags|||
++my_lstat||5.019003|
++my_memcmp|||n
++my_memset||5.004000|n
++my_pclose||5.004000|
++my_popen_list||5.007001|
++my_popen||5.004000|
++my_setenv|||
++my_snprintf|5.009004||pvn
++my_socketpair||5.007003|n
++my_sprintf|5.009003||pvn
++my_stat_flags|||
++my_stat||5.019003|
++my_strftime||5.007002|
++my_strlcat|5.009004||pn
++my_strlcpy|5.009004||pn
++my_unexec|||
++my_vsnprintf||5.009004|n
++need_utf8|||n
++newANONATTRSUB||5.006000|
++newANONHASH|||
++newANONLIST|||
++newANONSUB|||
++newASSIGNOP|||
++newATTRSUB_flags|||
++newATTRSUB||5.006000|
++newAVREF|||
++newAV|||
++newBINOP|||
++newCONDOP|||
++newCONSTSUB_flags||5.015006|
++newCONSTSUB|5.004050||p
++newCVREF|||
++newDEFSVOP|||
++newFORM|||
++newFOROP||5.013007|
++newGIVENOP||5.009003|
++newGIVWHENOP|||
++newGP|||
++newGVOP|||
++newGVREF|||
++newGVgen_flags||5.015004|
++newGVgen|||
++newHVREF|||
++newHVhv||5.005000|
++newHV|||
++newIO|||
++newLISTOP|||
++newLOGOP|||
++newLOOPEX|||
++newLOOPOP|||
++newMADPROP|||
++newMADsv|||
++newMYSUB||5.017004|
++newNULLLIST|||
++newOP|||
++newPADOP|||
++newPMOP|||
++newPROG|||
++newPVOP|||
++newRANGE|||
++newRV_inc|5.004000||p
++newRV_noinc|5.004000||p
++newRV|||
++newSLICEOP|||
++newSTATEOP|||
++newSTUB|||
++newSUB|||
++newSVOP|||
++newSVREF|||
++newSV_type|5.009005||p
++newSVhek||5.009003|
++newSViv|||
++newSVnv|||
++newSVpadname||5.017004|
++newSVpv_share||5.013006|
++newSVpvf_nocontext|||vn
++newSVpvf||5.004000|v
++newSVpvn_flags|5.010001||p
++newSVpvn_share|5.007001||p
++newSVpvn_utf8|5.010001||p
++newSVpvn|5.004050||p
++newSVpvs_flags|5.010001||p
++newSVpvs_share|5.009003||p
++newSVpvs|5.009003||p
++newSVpv|||
++newSVrv|||
++newSVsv|||
++newSVuv|5.006000||p
++newSV|||
++newTOKEN|||
++newUNOP|||
++newWHENOP||5.009003|
++newWHILEOP||5.013007|
++newXS_flags||5.009004|
++newXS_len_flags|||
++newXSproto||5.006000|
++newXS||5.006000|
++new_collate||5.006000|
++new_constant|||
++new_ctype||5.006000|
++new_he|||
++new_logop|||
++new_numeric||5.006000|
++new_stackinfo||5.005000|
++new_version||5.009000|
++new_warnings_bitfield|||
++next_symbol|||
++nextargv|||
++nextchar|||
++ninstr|||n
++no_bareword_allowed|||
++no_fh_allowed|||
++no_op|||
++not_a_number|||
++not_incrementable|||
++nothreadhook||5.008000|
++nuke_stacks|||
++num_overflow|||n
++oopsAV|||
++oopsHV|||
++op_append_elem||5.013006|
++op_append_list||5.013006|
++op_clear|||
++op_const_sv|||
++op_contextualize||5.013006|
++op_dump||5.006000|
++op_free|||
++op_getmad_weak|||
++op_getmad|||
++op_integerize|||
++op_linklist||5.013006|
++op_lvalue_flags|||
++op_lvalue||5.013007|
++op_null||5.007002|
++op_prepend_elem||5.013006|
++op_refcnt_dec|||
++op_refcnt_inc|||
++op_refcnt_lock||5.009002|
++op_refcnt_unlock||5.009002|
++op_scope||5.013007|
++op_std_init|||
++op_unscope|||
++op_xmldump|||
++open_script|||
++opslab_force_free|||
++opslab_free_nopad|||
++opslab_free|||
++pMY_CXT_|5.007003||p
++pMY_CXT|5.007003||p
++pTHX_|5.006000||p
++pTHX|5.006000||p
++packWARN|5.007003||p
++pack_cat||5.007003|
++pack_rec|||
++package_version|||
++package|||
++packlist||5.008001|
++pad_add_anon||5.008001|
++pad_add_name_pvn||5.015001|
++pad_add_name_pvs||5.015001|
++pad_add_name_pv||5.015001|
++pad_add_name_sv||5.015001|
++pad_alloc_name|||
++pad_alloc|||
++pad_block_start|||
++pad_check_dup|||
++pad_compname_type||5.009003|
++pad_findlex|||
++pad_findmy_pvn||5.015001|
++pad_findmy_pvs||5.015001|
++pad_findmy_pv||5.015001|
++pad_findmy_sv||5.015001|
++pad_fixup_inner_anons|||
++pad_free|||
++pad_leavemy|||
++pad_new||5.008001|
++pad_peg|||n
++pad_push|||
++pad_reset|||
++pad_setsv|||
++pad_sv|||
++pad_swipe|||
++pad_tidy||5.008001|
++padlist_dup|||
++padlist_store|||
++parse_arithexpr||5.013008|
++parse_barestmt||5.013007|
++parse_block||5.013007|
++parse_body|||
++parse_fullexpr||5.013008|
++parse_fullstmt||5.013005|
++parse_ident|||
++parse_label||5.013007|
++parse_listexpr||5.013008|
++parse_lparen_question_flags|||
++parse_stmtseq||5.013006|
++parse_termexpr||5.013008|
++parse_unicode_opts|||
++parser_dup|||
++parser_free_nexttoke_ops|||
++parser_free|||
++path_is_searchable|||n
++peep|||
++pending_ident|||
++perl_alloc_using|||n
++perl_alloc|||n
++perl_clone_using|||n
++perl_clone|||n
++perl_construct|||n
++perl_destruct||5.007003|n
++perl_free|||n
++perl_parse||5.006000|n
++perl_run|||n
++pidgone|||
++pm_description|||
++pmop_dump||5.006000|
++pmop_xmldump|||
++pmruntime|||
++pmtrans|||
++pop_scope|||
++populate_isa|||v
++pregcomp||5.009005|
++pregexec|||
++pregfree2||5.011000|
++pregfree|||
++prepend_madprops|||
++prescan_version||5.011004|
++printbuf|||
++printf_nocontext|||vn
++process_special_blocks|||
++ptr_hash|||n
++ptr_table_clear||5.009005|
++ptr_table_fetch||5.009005|
++ptr_table_find|||n
++ptr_table_free||5.009005|
++ptr_table_new||5.009005|
++ptr_table_split||5.009005|
++ptr_table_store||5.009005|
++push_scope|||
++put_byte|||
++put_latin1_charclass_innards|||
++pv_display|5.006000||p
++pv_escape|5.009004||p
++pv_pretty|5.009004||p
++pv_uni_display||5.007003|
++qerror|||
++qsortsvu|||
++re_compile||5.009005|
++re_croak2|||
++re_dup_guts|||
++re_intuit_start||5.019001|
++re_intuit_string||5.006000|
++re_op_compile|||
++readpipe_override|||
++realloc||5.007002|n
++reentrant_free||5.019003|
++reentrant_init||5.019003|
++reentrant_retry||5.019003|vn
++reentrant_size||5.019003|
++ref_array_or_hash|||
++refcounted_he_chain_2hv|||
++refcounted_he_fetch_pvn|||
++refcounted_he_fetch_pvs|||
++refcounted_he_fetch_pv|||
++refcounted_he_fetch_sv|||
++refcounted_he_free|||
++refcounted_he_inc|||
++refcounted_he_new_pvn|||
++refcounted_he_new_pvs|||
++refcounted_he_new_pv|||
++refcounted_he_new_sv|||
++refcounted_he_value|||
++refkids|||
++refto|||
++ref||5.019003|
++reg_check_named_buff_matched|||
++reg_named_buff_all||5.009005|
++reg_named_buff_exists||5.009005|
++reg_named_buff_fetch||5.009005|
++reg_named_buff_firstkey||5.009005|
++reg_named_buff_iter|||
++reg_named_buff_nextkey||5.009005|
++reg_named_buff_scalar||5.009005|
++reg_named_buff|||
++reg_node|||
++reg_numbered_buff_fetch|||
++reg_numbered_buff_length|||
++reg_numbered_buff_store|||
++reg_qr_package|||
++reg_recode|||
++reg_scan_name|||
++reg_skipcomment|||
++reg_temp_copy|||
++reganode|||
++regatom|||
++regbranch|||
++regclass_swash||5.009004|
++regclass|||
++regcppop|||
++regcppush|||
++regcurly|||
++regdump_extflags|||
++regdump_intflags|||
++regdump||5.005000|
++regdupe_internal|||
++regexec_flags||5.005000|
++regfree_internal||5.009005|
++reghop3|||n
++reghop4|||n
++reghopmaybe3|||n
++reginclass|||
++reginitcolors||5.006000|
++reginsert|||
++regmatch|||
++regnext||5.005000|
++regpatws|||n
++regpiece|||
++regpposixcc|||
++regprop|||
++regrepeat|||
++regtail_study|||
++regtail|||
++regtry|||
++reguni|||
++regwhite|||n
++reg|||
++repeatcpy|||n
++report_evil_fh|||
++report_redefined_cv|||
++report_uninit|||
++report_wrongway_fh|||
++require_pv||5.006000|
++require_tie_mod|||
++restore_magic|||
++rninstr|||n
++rpeep|||
++rsignal_restore|||
++rsignal_save|||
++rsignal_state||5.004000|
++rsignal||5.004000|
++run_body|||
++run_user_filter|||
++runops_debug||5.005000|
++runops_standard||5.005000|
++rv2cv_op_cv||5.013006|
++rvpv_dup|||
++rxres_free|||
++rxres_restore|||
++rxres_save|||
++safesyscalloc||5.006000|n
++safesysfree||5.006000|n
++safesysmalloc||5.006000|n
++safesysrealloc||5.006000|n
++same_dirent|||
++save_I16||5.004000|
++save_I32|||
++save_I8||5.006000|
++save_adelete||5.011000|
++save_aelem_flags||5.011000|
++save_aelem||5.004050|
++save_alloc||5.006000|
++save_aptr|||
++save_ary|||
++save_bool||5.008001|
++save_clearsv|||
++save_delete|||
++save_destructor_x||5.006000|
++save_destructor||5.006000|
++save_freeop|||
++save_freepv|||
++save_freesv|||
++save_generic_pvref||5.006001|
++save_generic_svref||5.005030|
++save_gp||5.004000|
++save_hash|||
++save_hdelete||5.011000|
++save_hek_flags|||n
++save_helem_flags||5.011000|
++save_helem||5.004050|
++save_hints||5.010001|
++save_hptr|||
++save_int|||
++save_item|||
++save_iv||5.005000|
++save_lines|||
++save_list|||
++save_long|||
++save_magic_flags|||
++save_mortalizesv||5.007001|
++save_nogv|||
++save_op||5.005000|
++save_padsv_and_mortalize||5.010001|
++save_pptr|||
++save_pushi32ptr||5.010001|
++save_pushptri32ptr|||
++save_pushptrptr||5.010001|
++save_pushptr||5.010001|
++save_re_context||5.006000|
++save_scalar_at|||
++save_scalar|||
++save_set_svflags||5.009000|
++save_shared_pvref||5.007003|
++save_sptr|||
++save_svref|||
++save_vptr||5.006000|
++savepvn|||
++savepvs||5.009003|
++savepv|||
++savesharedpvn||5.009005|
++savesharedpvs||5.013006|
++savesharedpv||5.007003|
++savesharedsvpv||5.013006|
++savestack_grow_cnt||5.008001|
++savestack_grow|||
++savesvpv||5.009002|
++sawparens|||
++scalar_mod_type|||n
++scalarboolean|||
++scalarkids|||
++scalarseq|||
++scalarvoid|||
++scalar|||
++scan_bin||5.006000|
++scan_commit|||
++scan_const|||
++scan_formline|||
++scan_heredoc|||
++scan_hex|||
++scan_ident|||
++scan_inputsymbol|||
++scan_num||5.007001|
++scan_oct|||
++scan_pat|||
++scan_str|||
++scan_subst|||
++scan_trans|||
++scan_version||5.009001|
++scan_vstring||5.009005|
++scan_word|||
++screaminstr||5.005000|
++search_const|||
++seed||5.008001|
++sequence_num|||
++set_context||5.006000|n
++set_numeric_local||5.006000|
++set_numeric_radix||5.006000|
++set_numeric_standard||5.006000|
++setdefout|||
++share_hek_flags|||
++share_hek||5.004000|
++si_dup|||
++sighandler|||n
++simplify_sort|||
++skipspace0|||
++skipspace1|||
++skipspace2|||
++skipspace_flags|||
++softref2xv|||
++sortcv_stacked|||
++sortcv_xsub|||
++sortcv|||
++sortsv_flags||5.009003|
++sortsv||5.007003|
++space_join_names_mortal|||
++ss_dup|||
++stack_grow|||
++start_force|||
++start_glob|||
++start_subparse||5.004000|
++stdize_locale|||
++strEQ|||
++strGE|||
++strGT|||
++strLE|||
++strLT|||
++strNE|||
++str_to_version||5.006000|
++strip_return|||
++strnEQ|||
++strnNE|||
++study_chunk|||
++sub_crush_depth|||
++sublex_done|||
++sublex_push|||
++sublex_start|||
++sv_2bool_flags||5.013006|
++sv_2bool|||
++sv_2cv|||
++sv_2io|||
++sv_2iuv_common|||
++sv_2iuv_non_preserve|||
++sv_2iv_flags||5.009001|
++sv_2iv|||
++sv_2mortal|||
++sv_2num|||
++sv_2nv_flags||5.013001|
++sv_2pv_flags|5.007002||p
++sv_2pv_nolen|5.006000||p
++sv_2pvbyte_nolen|5.006000||p
++sv_2pvbyte|5.006000||p
++sv_2pvutf8_nolen||5.006000|
++sv_2pvutf8||5.006000|
++sv_2pv|||
++sv_2uv_flags||5.009001|
++sv_2uv|5.004000||p
++sv_add_arena|||
++sv_add_backref|||
++sv_backoff|||
++sv_bless|||
++sv_cat_decode||5.008001|
++sv_catpv_flags||5.013006|
++sv_catpv_mg|5.004050||p
++sv_catpv_nomg||5.013006|
++sv_catpvf_mg_nocontext|||pvn
++sv_catpvf_mg|5.006000|5.004000|pv
++sv_catpvf_nocontext|||vn
++sv_catpvf||5.004000|v
++sv_catpvn_flags||5.007002|
++sv_catpvn_mg|5.004050||p
++sv_catpvn_nomg|5.007002||p
++sv_catpvn|||
++sv_catpvs_flags||5.013006|
++sv_catpvs_mg||5.013006|
++sv_catpvs_nomg||5.013006|
++sv_catpvs|5.009003||p
++sv_catpv|||
++sv_catsv_flags||5.007002|
++sv_catsv_mg|5.004050||p
++sv_catsv_nomg|5.007002||p
++sv_catsv|||
++sv_catxmlpvn|||
++sv_catxmlpv|||
++sv_catxmlsv|||
++sv_chop|||
++sv_clean_all|||
++sv_clean_objs|||
++sv_clear|||
++sv_cmp_flags||5.013006|
++sv_cmp_locale_flags||5.013006|
++sv_cmp_locale||5.004000|
++sv_cmp|||
++sv_collxfrm_flags||5.013006|
++sv_collxfrm|||
++sv_copypv_flags||5.017002|
++sv_copypv_nomg||5.017002|
++sv_copypv|||
++sv_dec_nomg||5.013002|
++sv_dec|||
++sv_del_backref|||
++sv_derived_from_pvn||5.015004|
++sv_derived_from_pv||5.015004|
++sv_derived_from_sv||5.015004|
++sv_derived_from||5.004000|
++sv_destroyable||5.010000|
++sv_display|||
++sv_does_pvn||5.015004|
++sv_does_pv||5.015004|
++sv_does_sv||5.015004|
++sv_does||5.009004|
++sv_dump|||
++sv_dup_common|||
++sv_dup_inc_multiple|||
++sv_dup_inc|||
++sv_dup|||
++sv_eq_flags||5.013006|
++sv_eq|||
++sv_exp_grow|||
++sv_force_normal_flags||5.007001|
++sv_force_normal||5.006000|
++sv_free2|||
++sv_free_arenas|||
++sv_free|||
++sv_gets||5.004000|
++sv_grow|||
++sv_i_ncmp|||
++sv_inc_nomg||5.013002|
++sv_inc|||
++sv_insert_flags||5.010001|
++sv_insert|||
++sv_isa|||
++sv_isobject|||
++sv_iv||5.005000|
++sv_kill_backrefs|||
++sv_len_utf8_nomg|||
++sv_len_utf8||5.006000|
++sv_len|||
++sv_magic_portable|5.019003|5.004000|p
++sv_magicext_mglob|||
++sv_magicext||5.007003|
++sv_magic|||
++sv_mortalcopy_flags|||
++sv_mortalcopy|||
++sv_ncmp|||
++sv_newmortal|||
++sv_newref|||
++sv_nolocking||5.007003|
++sv_nosharing||5.007003|
++sv_nounlocking|||
++sv_nv||5.005000|
++sv_peek||5.005000|
++sv_pos_b2u_flags||5.019003|
++sv_pos_b2u_midway|||
++sv_pos_b2u||5.006000|
++sv_pos_u2b_cached|||
++sv_pos_u2b_flags||5.011005|
++sv_pos_u2b_forwards|||n
++sv_pos_u2b_midway|||n
++sv_pos_u2b||5.006000|
++sv_pvbyten_force||5.006000|
++sv_pvbyten||5.006000|
++sv_pvbyte||5.006000|
++sv_pvn_force_flags|5.007002||p
++sv_pvn_force|||
++sv_pvn_nomg|5.007003|5.005000|p
++sv_pvn||5.005000|
++sv_pvutf8n_force||5.006000|
++sv_pvutf8n||5.006000|
++sv_pvutf8||5.006000|
++sv_pv||5.006000|
++sv_recode_to_utf8||5.007003|
++sv_reftype|||
++sv_ref|||
++sv_release_COW|||
++sv_replace|||
++sv_report_used|||
++sv_resetpvn|||
++sv_reset|||
++sv_rvweaken||5.006000|
++sv_sethek|||
++sv_setiv_mg|5.004050||p
++sv_setiv|||
++sv_setnv_mg|5.006000||p
++sv_setnv|||
++sv_setpv_mg|5.004050||p
++sv_setpvf_mg_nocontext|||pvn
++sv_setpvf_mg|5.006000|5.004000|pv
++sv_setpvf_nocontext|||vn
++sv_setpvf||5.004000|v
++sv_setpviv_mg||5.008001|
++sv_setpviv||5.008001|
++sv_setpvn_mg|5.004050||p
++sv_setpvn|||
++sv_setpvs_mg||5.013006|
++sv_setpvs|5.009004||p
++sv_setpv|||
++sv_setref_iv|||
++sv_setref_nv|||
++sv_setref_pvn|||
++sv_setref_pvs||5.019003|
++sv_setref_pv|||
++sv_setref_uv||5.007001|
++sv_setsv_cow|||
++sv_setsv_flags||5.007002|
++sv_setsv_mg|5.004050||p
++sv_setsv_nomg|5.007002||p
++sv_setsv|||
++sv_setuv_mg|5.004050||p
++sv_setuv|5.004000||p
++sv_tainted||5.004000|
++sv_taint||5.004000|
++sv_true||5.005000|
++sv_unglob|||
++sv_uni_display||5.007003|
++sv_unmagicext||5.013008|
++sv_unmagic|||
++sv_unref_flags||5.007001|
++sv_unref|||
++sv_untaint||5.004000|
++sv_upgrade|||
++sv_usepvn_flags||5.009004|
++sv_usepvn_mg|5.004050||p
++sv_usepvn|||
++sv_utf8_decode||5.006000|
++sv_utf8_downgrade||5.006000|
++sv_utf8_encode||5.006000|
++sv_utf8_upgrade_flags_grow||5.011000|
++sv_utf8_upgrade_flags||5.007002|
++sv_utf8_upgrade_nomg||5.007002|
++sv_utf8_upgrade||5.007001|
++sv_uv|5.005000||p
++sv_vcatpvf_mg|5.006000|5.004000|p
++sv_vcatpvfn_flags||5.017002|
++sv_vcatpvfn||5.004000|
++sv_vcatpvf|5.006000|5.004000|p
++sv_vsetpvf_mg|5.006000|5.004000|p
++sv_vsetpvfn||5.004000|
++sv_vsetpvf|5.006000|5.004000|p
++sv_xmlpeek|||
++svtype|||
++swallow_bom|||
++swash_fetch||5.007002|
++swash_init||5.006000|
++swatch_get|||
++sys_init3||5.010000|n
++sys_init||5.010000|n
++sys_intern_clear|||
++sys_intern_dup|||
++sys_intern_init|||
++sys_term||5.010000|n
++taint_env|||
++taint_proper|||
++tied_method|||v
++tmps_grow||5.006000|
++toFOLD_uni||5.007003|
++toFOLD_utf8||5.019001|
++toFOLD||5.019001|
++toLOWER_L1||5.019001|
++toLOWER_LC||5.004000|
++toLOWER_uni||5.007003|
++toLOWER_utf8||5.015007|
++toLOWER|||
++toTITLE_uni||5.007003|
++toTITLE_utf8||5.015007|
++toTITLE||5.019001|
++toUPPER_uni||5.007003|
++toUPPER_utf8||5.015007|
++toUPPER||5.004000|
++to_byte_substr|||
++to_lower_latin1|||
++to_uni_fold||5.007003|
++to_uni_lower_lc||5.006000|
++to_uni_lower||5.007003|
++to_uni_title_lc||5.006000|
++to_uni_title||5.007003|
++to_uni_upper_lc||5.006000|
++to_uni_upper||5.007003|
++to_utf8_case||5.007003|
++to_utf8_fold||5.015007|
++to_utf8_lower||5.015007|
++to_utf8_substr|||
++to_utf8_title||5.015007|
++to_utf8_upper||5.015007|
++token_free|||
++token_getmad|||
++tokenize_use|||
++tokeq|||
++tokereport|||
++too_few_arguments_pv|||
++too_few_arguments_sv|||
++too_many_arguments_pv|||
++too_many_arguments_sv|||
++translate_substr_offsets|||
++try_amagic_bin|||
++try_amagic_un|||
++uiv_2buf|||n
++unlnk|||
++unpack_rec|||
++unpack_str||5.007003|
++unpackstring||5.008001|
++unreferenced_to_tmp_stack|||
++unshare_hek_or_pvn|||
++unshare_hek|||
++unsharepvn||5.004000|
++unwind_handler_stack|||
++update_debugger_info|||
++upg_version||5.009005|
++usage|||
++utf16_textfilter|||
++utf16_to_utf8_reversed||5.006001|
++utf16_to_utf8||5.006001|
++utf8_distance||5.006000|
++utf8_hop||5.006000|
++utf8_length||5.007001|
++utf8_mg_len_cache_update|||
++utf8_mg_pos_cache_update|||
++utf8_to_bytes||5.006001|
++utf8_to_uvchr_buf||5.015009|
++utf8_to_uvchr||5.007001|
++utf8_to_uvuni_buf||5.015009|
++utf8_to_uvuni||5.007001|
++utf8n_to_uvchr|||
++utf8n_to_uvuni||5.007001|
++utilize|||
++uvchr_to_utf8_flags||5.007003|
++uvchr_to_utf8|||
++uvuni_to_utf8_flags||5.007003|
++uvuni_to_utf8||5.007001|
++valid_utf8_to_uvchr|||
++valid_utf8_to_uvuni||5.015009|
++validate_proto|||
++validate_suid|||
++varname|||
++vcmp||5.009000|
++vcroak||5.006000|
++vdeb||5.007003|
++vform||5.006000|
++visit|||
++vivify_defelem|||
++vivify_ref|||
++vload_module|5.006000||p
++vmess||5.006000|
++vnewSVpvf|5.006000|5.004000|p
++vnormal||5.009002|
++vnumify||5.009000|
++vstringify||5.009000|
++vverify||5.009003|
++vwarner||5.006000|
++vwarn||5.006000|
++wait4pid|||
++warn_nocontext|||vn
++warn_sv||5.013001|
++warner_nocontext|||vn
++warner|5.006000|5.004000|pv
++warn|||v
++was_lvalue_sub|||
++watch|||
++whichsig_pvn||5.015004|
++whichsig_pv||5.015004|
++whichsig_sv||5.015004|
++whichsig|||
++win32_croak_not_implemented|||n
++with_queued_errors|||
++wrap_op_checker||5.015008|
++write_to_stderr|||
++xmldump_all_perl|||
++xmldump_all|||
++xmldump_attr|||
++xmldump_eval|||
++xmldump_form|||
++xmldump_indent|||v
++xmldump_packsubs_perl|||
++xmldump_packsubs|||
++xmldump_sub_perl|||
++xmldump_sub|||
++xmldump_vindent|||
++xs_apiversion_bootcheck|||
++xs_version_bootcheck|||
++yyerror_pvn|||
++yyerror_pv|||
++yyerror|||
++yylex|||
++yyparse|||
++yyunlex|||
++yywarn|||
++);
++
++if (exists $opt{'list-unsupported'}) {
++  my $f;
++  for $f (sort { lc $a cmp lc $b } keys %API) {
++    next unless $API{$f}{todo};
++    print "$f ", '.'x(40-length($f)), " ", format_version($API{$f}{todo}), "\n";
++  }
++  exit 0;
++}
++
++# Scan for possible replacement candidates
++
++my(%replace, %need, %hints, %warnings, %depends);
++my $replace = 0;
++my($hint, $define, $function);
++
++sub find_api
++{
++  my $code = shift;
++  $code =~ s{
++    / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
++  | "[^"\\]*(?:\\.[^"\\]*)*"
++  | '[^'\\]*(?:\\.[^'\\]*)*' }{}egsx;
++  grep { exists $API{$_} } $code =~ /(\w+)/mg;
++}
++
++while (<DATA>) {
++  if ($hint) {
++    my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings;
++    if (m{^\s*\*\s(.*?)\s*$}) {
++      for (@{$hint->[1]}) {
++        $h->{$_} ||= '';  # suppress warning with older perls
++        $h->{$_} .= "$1\n";
++      }
++    }
++    else { undef $hint }
++  }
++
++  $hint = [$1, [split /,?\s+/, $2]]
++      if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$};
++
++  if ($define) {
++    if ($define->[1] =~ /\\$/) {
++      $define->[1] .= $_;
++    }
++    else {
++      if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) {
++        my @n = find_api($define->[1]);
++        push @{$depends{$define->[0]}}, @n if @n
++      }
++      undef $define;
++    }
++  }
++
++  $define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)};
++
++  if ($function) {
++    if (/^}/) {
++      if (exists $API{$function->[0]}) {
++        my @n = find_api($function->[1]);
++        push @{$depends{$function->[0]}}, @n if @n
++      }
++      undef $function;
++    }
++    else {
++      $function->[1] .= $_;
++    }
++  }
++
++  $function = [$1, ''] if m{^DPPP_\(my_(\w+)\)};
++
++  $replace     = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$};
++  $replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)};
++  $replace{$2} = $1 if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+).*$rccs\s+Replace\s+$rcce};
++  $replace{$1} = $2 if m{^\s*$rccs\s+Replace (\w+) with (\w+)\s+$rcce\s*$};
++
++  if (m{^\s*$rccs\s+(\w+(\s*,\s*\w+)*)\s+depends\s+on\s+(\w+(\s*,\s*\w+)*)\s+$rcce\s*$}) {
++    my @deps = map { s/\s+//g; $_ } split /,/, $3;
++    my $d;
++    for $d (map { s/\s+//g; $_ } split /,/, $1) {
++      push @{$depends{$d}}, @deps;
++    }
++  }
++
++  $need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)};
++}
++
++for (values %depends) {
++  my %s;
++  $_ = [sort grep !$s{$_}++, @$_];
++}
++
++if (exists $opt{'api-info'}) {
++  my $f;
++  my $count = 0;
++  my $match = $opt{'api-info'} =~ m!^/(.*)/$! ? $1 : "^\Q$opt{'api-info'}\E\$";
++  for $f (sort { lc $a cmp lc $b } keys %API) {
++    next unless $f =~ /$match/;
++    print "\n=== $f ===\n\n";
++    my $info = 0;
++    if ($API{$f}{base} || $API{$f}{todo}) {
++      my $base = format_version($API{$f}{base} || $API{$f}{todo});
++      print "Supported at least starting from perl-$base.\n";
++      $info++;
++    }
++    if ($API{$f}{provided}) {
++      my $todo = $API{$f}{todo} ? format_version($API{$f}{todo}) : "5.003";
++      print "Support by $ppport provided back to perl-$todo.\n";
++      print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f};
++      print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f};
++      print "\n$hints{$f}" if exists $hints{$f};
++      print "\nWARNING:\n$warnings{$f}" if exists $warnings{$f};
++      $info++;
++    }
++    print "No portability information available.\n" unless $info;
++    $count++;
++  }
++  $count or print "Found no API matching '$opt{'api-info'}'.";
++  print "\n";
++  exit 0;
++}
++
++if (exists $opt{'list-provided'}) {
++  my $f;
++  for $f (sort { lc $a cmp lc $b } keys %API) {
++    next unless $API{$f}{provided};
++    my @flags;
++    push @flags, 'explicit' if exists $need{$f};
++    push @flags, 'depend'   if exists $depends{$f};
++    push @flags, 'hint'     if exists $hints{$f};
++    push @flags, 'warning'  if exists $warnings{$f};
++    my $flags = @flags ? '  ['.join(', ', @flags).']' : '';
++    print "$f$flags\n";
++  }
++  exit 0;
++}
++
++my @files;
++my @srcext = qw( .xs .c .h .cc .cpp -c.inc -xs.inc );
++my $srcext = join '|', map { quotemeta $_ } @srcext;
++
++if (@ARGV) {
++  my %seen;
++  for (@ARGV) {
++    if (-e) {
++      if (-f) {
++        push @files, $_ unless $seen{$_}++;
++      }
++      else { warn "'$_' is not a file.\n" }
++    }
++    else {
++      my @new = grep { -f } glob $_
++          or warn "'$_' does not exist.\n";
++      push @files, grep { !$seen{$_}++ } @new;
++    }
++  }
++}
++else {
++  eval {
++    require File::Find;
++    File::Find::find(sub {
++      $File::Find::name =~ /($srcext)$/i
++          and push @files, $File::Find::name;
++    }, '.');
++  };
++  if ($@) {
++    @files = map { glob "*$_" } @srcext;
++  }
++}
++
++if (!@ARGV || $opt{filter}) {
++  my(@in, @out);
++  my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files;
++  for (@files) {
++    my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i;
++    push @{ $out ? \@out : \@in }, $_;
++  }
++  if (@ARGV && @out) {
++    warning("Skipping the following files (use --nofilter to avoid this):\n| ", join "\n| ", @out);
++  }
++  @files = @in;
++}
++
++die "No input files given!\n" unless @files;
++
++my(%files, %global, %revreplace);
++%revreplace = reverse %replace;
++my $filename;
++my $patch_opened = 0;
++
++for $filename (@files) {
++  unless (open IN, "<$filename") {
++    warn "Unable to read from $filename: $!\n";
++    next;
++  }
++
++  info("Scanning $filename ...");
++
++  my $c = do { local $/; <IN> };
++  close IN;
++
++  my %file = (orig => $c, changes => 0);
++
++  # Temporarily remove C/XS comments and strings from the code
++  my @ccom;
++
++  $c =~ s{
++    ( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]*
++    | ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* )
++  | ( ^$HS*\#[^\r\n]*
++    | "[^"\\]*(?:\\.[^"\\]*)*"
++    | '[^'\\]*(?:\\.[^'\\]*)*'
++    | / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* ) )
++  }{ defined $2 and push @ccom, $2;
++     defined $1 ? $1 : "$ccs$#ccom$cce" }mgsex;
++
++  $file{ccom} = \@ccom;
++  $file{code} = $c;
++  $file{has_inc_ppport} = $c =~ /^$HS*#$HS*include[^\r\n]+\b\Q$ppport\E\b/m;
++
++  my $func;
++
++  for $func (keys %API) {
++    my $match = $func;
++    $match .= "|$revreplace{$func}" if exists $revreplace{$func};
++    if ($c =~ /\b(?:Perl_)?($match)\b/) {
++      $file{uses_replace}{$1}++ if exists $revreplace{$func} && $1 eq $revreplace{$func};
++      $file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/;
++      if (exists $API{$func}{provided}) {
++        $file{uses_provided}{$func}++;
++        if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) {
++          $file{uses}{$func}++;
++          my @deps = rec_depend($func);
++          if (@deps) {
++            $file{uses_deps}{$func} = \@deps;
++            for (@deps) {
++              $file{uses}{$_} = 0 unless exists $file{uses}{$_};
++            }
++          }
++          for ($func, @deps) {
++            $file{needs}{$_} = 'static' if exists $need{$_};
++          }
++        }
++      }
++      if (exists $API{$func}{todo} && $API{$func}{todo} > $opt{'compat-version'}) {
++        if ($c =~ /\b$func\b/) {
++          $file{uses_todo}{$func}++;
++        }
++      }
++    }
++  }
++
++  while ($c =~ /^$HS*#$HS*define$HS+(NEED_(\w+?)(_GLOBAL)?)\b/mg) {
++    if (exists $need{$2}) {
++      $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++;
++    }
++    else { warning("Possibly wrong #define $1 in $filename") }
++  }
++
++  for (qw(uses needs uses_todo needed_global needed_static)) {
++    for $func (keys %{$file{$_}}) {
++      push @{$global{$_}{$func}}, $filename;
++    }
++  }
++
++  $files{$filename} = \%file;
++}
++
++# Globally resolve NEED_'s
++my $need;
++for $need (keys %{$global{needs}}) {
++  if (@{$global{needs}{$need}} > 1) {
++    my @targets = @{$global{needs}{$need}};
++    my @t = grep $files{$_}{needed_global}{$need}, @targets;
++    @targets = @t if @t;
++    @t = grep /\.xs$/i, @targets;
++    @targets = @t if @t;
++    my $target = shift @targets;
++    $files{$target}{needs}{$need} = 'global';
++    for (@{$global{needs}{$need}}) {
++      $files{$_}{needs}{$need} = 'extern' if $_ ne $target;
++    }
++  }
++}
++
++for $filename (@files) {
++  exists $files{$filename} or next;
++
++  info("=== Analyzing $filename ===");
++
++  my %file = %{$files{$filename}};
++  my $func;
++  my $c = $file{code};
++  my $warnings = 0;
++
++  for $func (sort keys %{$file{uses_Perl}}) {
++    if ($API{$func}{varargs}) {
++      unless ($API{$func}{nothxarg}) {
++        my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
++                              { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
++        if ($changes) {
++          warning("Doesn't pass interpreter argument aTHX to Perl_$func");
++          $file{changes} += $changes;
++        }
++      }
++    }
++    else {
++      warning("Uses Perl_$func instead of $func");
++      $file{changes} += ($c =~ s{\bPerl_$func(\s*)\((\s*aTHX_?)?\s*}
++                                {$func$1(}g);
++    }
++  }
++
++  for $func (sort keys %{$file{uses_replace}}) {
++    warning("Uses $func instead of $replace{$func}");
++    $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g);
++  }
++
++  for $func (sort keys %{$file{uses_provided}}) {
++    if ($file{uses}{$func}) {
++      if (exists $file{uses_deps}{$func}) {
++        diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}}));
++      }
++      else {
++        diag("Uses $func");
++      }
++    }
++    $warnings += hint($func);
++  }
++
++  unless ($opt{quiet}) {
++    for $func (sort keys %{$file{uses_todo}}) {
++      print "*** WARNING: Uses $func, which may not be portable below perl ",
++            format_version($API{$func}{todo}), ", even with '$ppport'\n";
++      $warnings++;
++    }
++  }
++
++  for $func (sort keys %{$file{needed_static}}) {
++    my $message = '';
++    if (not exists $file{uses}{$func}) {
++      $message = "No need to define NEED_$func if $func is never used";
++    }
++    elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') {
++      $message = "No need to define NEED_$func when already needed globally";
++    }
++    if ($message) {
++      diag($message);
++      $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg);
++    }
++  }
++
++  for $func (sort keys %{$file{needed_global}}) {
++    my $message = '';
++    if (not exists $global{uses}{$func}) {
++      $message = "No need to define NEED_${func}_GLOBAL if $func is never used";
++    }
++    elsif (exists $file{needs}{$func}) {
++      if ($file{needs}{$func} eq 'extern') {
++        $message = "No need to define NEED_${func}_GLOBAL when already needed globally";
++      }
++      elsif ($file{needs}{$func} eq 'static') {
++        $message = "No need to define NEED_${func}_GLOBAL when only used in this file";
++      }
++    }
++    if ($message) {
++      diag($message);
++      $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg);
++    }
++  }
++
++  $file{needs_inc_ppport} = keys %{$file{uses}};
++
++  if ($file{needs_inc_ppport}) {
++    my $pp = '';
++
++    for $func (sort keys %{$file{needs}}) {
++      my $type = $file{needs}{$func};
++      next if $type eq 'extern';
++      my $suffix = $type eq 'global' ? '_GLOBAL' : '';
++      unless (exists $file{"needed_$type"}{$func}) {
++        if ($type eq 'global') {
++          diag("Files [@{$global{needs}{$func}}] need $func, adding global request");
++        }
++        else {
++          diag("File needs $func, adding static request");
++        }
++        $pp .= "#define NEED_$func$suffix\n";
++      }
++    }
++
++    if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) {
++      $pp = '';
++      $file{changes}++;
++    }
++
++    unless ($file{has_inc_ppport}) {
++      diag("Needs to include '$ppport'");
++      $pp .= qq(#include "$ppport"\n)
++    }
++
++    if ($pp) {
++      $file{changes} += ($c =~ s/^($HS*#$HS*define$HS+NEED_\w+.*?)^/$1$pp/ms)
++                     || ($c =~ s/^(?=$HS*#$HS*include.*\Q$ppport\E)/$pp/m)
++                     || ($c =~ s/^($HS*#$HS*include.*XSUB.*\s*?)^/$1$pp/m)
++                     || ($c =~ s/^/$pp/);
++    }
++  }
++  else {
++    if ($file{has_inc_ppport}) {
++      diag("No need to include '$ppport'");
++      $file{changes} += ($c =~ s/^$HS*?#$HS*include.*\Q$ppport\E.*?$LF//m);
++    }
++  }
++
++  # put back in our C comments
++  my $ix;
++  my $cppc = 0;
++  my @ccom = @{$file{ccom}};
++  for $ix (0 .. $#ccom) {
++    if (!$opt{cplusplus} && $ccom[$ix] =~ s!^//!!) {
++      $cppc++;
++      $file{changes} += $c =~ s/$rccs$ix$rcce/$ccs$ccom[$ix] $cce/;
++    }
++    else {
++      $c =~ s/$rccs$ix$rcce/$ccom[$ix]/;
++    }
++  }
++
++  if ($cppc) {
++    my $s = $cppc != 1 ? 's' : '';
++    warning("Uses $cppc C++ style comment$s, which is not portable");
++  }
++
++  my $s = $warnings != 1 ? 's' : '';
++  my $warn = $warnings ? " ($warnings warning$s)" : '';
++  info("Analysis completed$warn");
++
++  if ($file{changes}) {
++    if (exists $opt{copy}) {
++      my $newfile = "$filename$opt{copy}";
++      if (-e $newfile) {
++        error("'$newfile' already exists, refusing to write copy of '$filename'");
++      }
++      else {
++        local *F;
++        if (open F, ">$newfile") {
++          info("Writing copy of '$filename' with changes to '$newfile'");
++          print F $c;
++          close F;
++        }
++        else {
++          error("Cannot open '$newfile' for writing: $!");
++        }
++      }
++    }
++    elsif (exists $opt{patch} || $opt{changes}) {
++      if (exists $opt{patch}) {
++        unless ($patch_opened) {
++          if (open PATCH, ">$opt{patch}") {
++            $patch_opened = 1;
++          }
++          else {
++            error("Cannot open '$opt{patch}' for writing: $!");
++            delete $opt{patch};
++            $opt{changes} = 1;
++            goto fallback;
++          }
++        }
++        mydiff(\*PATCH, $filename, $c);
++      }
++      else {
++fallback:
++        info("Suggested changes:");
++        mydiff(\*STDOUT, $filename, $c);
++      }
++    }
++    else {
++      my $s = $file{changes} == 1 ? '' : 's';
++      info("$file{changes} potentially required change$s detected");
++    }
++  }
++  else {
++    info("Looks good");
++  }
++}
++
++close PATCH if $patch_opened;
++
++exit 0;
++
++
++sub try_use { eval "use @_;"; return $@ eq '' }
++
++sub mydiff
++{
++  local *F = shift;
++  my($file, $str) = @_;
++  my $diff;
++
++  if (exists $opt{diff}) {
++    $diff = run_diff($opt{diff}, $file, $str);
++  }
++
++  if (!defined $diff and try_use('Text::Diff')) {
++    $diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' });
++    $diff = <<HEADER . $diff;
++--- $file
+++++ $file.patched
++HEADER
++  }
++
++  if (!defined $diff) {
++    $diff = run_diff('diff -u', $file, $str);
++  }
++
++  if (!defined $diff) {
++    $diff = run_diff('diff', $file, $str);
++  }
++
++  if (!defined $diff) {
++    error("Cannot generate a diff. Please install Text::Diff or use --copy.");
++    return;
++  }
++
++  print F $diff;
++}
++
++sub run_diff
++{
++  my($prog, $file, $str) = @_;
++  my $tmp = 'dppptemp';
++  my $suf = 'aaa';
++  my $diff = '';
++  local *F;
++
++  while (-e "$tmp.$suf") { $suf++ }
++  $tmp = "$tmp.$suf";
++
++  if (open F, ">$tmp") {
++    print F $str;
++    close F;
++
++    if (open F, "$prog $file $tmp |") {
++      while (<F>) {
++        s/\Q$tmp\E/$file.patched/;
++        $diff .= $_;
++      }
++      close F;
++      unlink $tmp;
++      return $diff;
++    }
++
++    unlink $tmp;
++  }
++  else {
++    error("Cannot open '$tmp' for writing: $!");
++  }
++
++  return undef;
++}
++
++sub rec_depend
++{
++  my($func, $seen) = @_;
++  return () unless exists $depends{$func};
++  $seen = {%{$seen||{}}};
++  return () if $seen->{$func}++;
++  my %s;
++  grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}};
++}
++
++sub parse_version
++{
++  my $ver = shift;
++
++  if ($ver =~ /^(\d+)\.(\d+)\.(\d+)$/) {
++    return ($1, $2, $3);
++  }
++  elsif ($ver !~ /^\d+\.[\d_]+$/) {
++    die "cannot parse version '$ver'\n";
++  }
++
++  $ver =~ s/_//g;
++  $ver =~ s/$/000000/;
++
++  my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
++
++  $v = int $v;
++  $s = int $s;
++
++  if ($r < 5 || ($r == 5 && $v < 6)) {
++    if ($s % 10) {
++      die "cannot parse version '$ver'\n";
++    }
++  }
++
++  return ($r, $v, $s);
++}
++
++sub format_version
++{
++  my $ver = shift;
++
++  $ver =~ s/$/000000/;
++  my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
++
++  $v = int $v;
++  $s = int $s;
++
++  if ($r < 5 || ($r == 5 && $v < 6)) {
++    if ($s % 10) {
++      die "invalid version '$ver'\n";
++    }
++    $s /= 10;
++
++    $ver = sprintf "%d.%03d", $r, $v;
++    $s > 0 and $ver .= sprintf "_%02d", $s;
++
++    return $ver;
++  }
++
++  return sprintf "%d.%d.%d", $r, $v, $s;
++}
++
++sub info
++{
++  $opt{quiet} and return;
++  print @_, "\n";
++}
++
++sub diag
++{
++  $opt{quiet} and return;
++  $opt{diag} and print @_, "\n";
++}
++
++sub warning
++{
++  $opt{quiet} and return;
++  print "*** ", @_, "\n";
++}
++
++sub error
++{
++  print "*** ERROR: ", @_, "\n";
++}
++
++my %given_hints;
++my %given_warnings;
++sub hint
++{
++  $opt{quiet} and return;
++  my $func = shift;
++  my $rv = 0;
++  if (exists $warnings{$func} && !$given_warnings{$func}++) {
++    my $warn = $warnings{$func};
++    $warn =~ s!^!*** !mg;
++    print "*** WARNING: $func\n", $warn;
++    $rv++;
++  }
++  if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) {
++    my $hint = $hints{$func};
++    $hint =~ s/^/   /mg;
++    print "   --- hint for $func ---\n", $hint;
++  }
++  $rv;
++}
++
++sub usage
++{
++  my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
++  my %M = ( 'I' => '*' );
++  $usage =~ s/^\s*perl\s+\S+/$^X $0/;
++  $usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
++
++  print <<ENDUSAGE;
++
++Usage: $usage
++
++See perldoc $0 for details.
++
++ENDUSAGE
++
++  exit 2;
++}
++
++sub strip
++{
++  my $self = do { local(@ARGV,$/)=($0); <> };
++  my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
++  $copy =~ s/^(?=\S+)/    /gms;
++  $self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
++  $self =~ s/^SKIP.*(?=^__DATA__)/SKIP
++if (\@ARGV && \$ARGV[0] eq '--unstrip') {
++  eval { require Devel::PPPort };
++  \$@ and die "Cannot require Devel::PPPort, please install.\\n";
++  if (eval \$Devel::PPPort::VERSION < $VERSION) {
++    die "$0 was originally generated with Devel::PPPort $VERSION.\\n"
++      . "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n"
++      . "Please install a newer version, or --unstrip will not work.\\n";
++  }
++  Devel::PPPort::WriteFile(\$0);
++  exit 0;
++}
++print <<END;
++
++Sorry, but this is a stripped version of \$0.
++
++To be able to use its original script and doc functionality,
++please try to regenerate this file using:
++
++  \$^X \$0 --unstrip
++
++END
++/ms;
++  my($pl, $c) = $self =~ /(.*^__DATA__)(.*)/ms;
++  $c =~ s{
++    / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
++  | ( "[^"\\]*(?:\\.[^"\\]*)*"
++    | '[^'\\]*(?:\\.[^'\\]*)*' )
++  | ($HS+) }{ defined $2 ? ' ' : ($1 || '') }gsex;
++  $c =~ s!\s+$!!mg;
++  $c =~ s!^$LF!!mg;
++  $c =~ s!^\s*#\s*!#!mg;
++  $c =~ s!^\s+!!mg;
++
++  open OUT, ">$0" or die "cannot strip $0: $!\n";
++  print OUT "$pl$c\n";
++
++  exit 0;
++}
++
++__DATA__
++*/
++
++#ifndef _P_P_PORTABILITY_H_
++#define _P_P_PORTABILITY_H_
++
++#ifndef DPPP_NAMESPACE
++#  define DPPP_NAMESPACE DPPP_
++#endif
++
++#define DPPP_CAT2(x,y) CAT2(x,y)
++#define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name)
++
++#ifndef PERL_REVISION
++#  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
++#    define PERL_PATCHLEVEL_H_IMPLICIT
++#    include <patchlevel.h>
++#  endif
++#  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
++#    include <could_not_find_Perl_patchlevel.h>
++#  endif
++#  ifndef PERL_REVISION
++#    define PERL_REVISION       (5)
++     /* Replace: 1 */
++#    define PERL_VERSION        PATCHLEVEL
++#    define PERL_SUBVERSION     SUBVERSION
++     /* Replace PERL_PATCHLEVEL with PERL_VERSION */
++     /* Replace: 0 */
++#  endif
++#endif
++
++#define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
++#define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))
++
++/* It is very unlikely that anyone will try to use this with Perl 6
++   (or greater), but who knows.
++ */
++#if PERL_REVISION != 5
++#  error ppport.h only works with Perl version 5
++#endif /* PERL_REVISION != 5 */
++#ifndef dTHR
++#  define dTHR                           dNOOP
++#endif
++#ifndef dTHX
++#  define dTHX                           dNOOP
++#endif
++
++#ifndef dTHXa
++#  define dTHXa(x)                       dNOOP
++#endif
++#ifndef pTHX
++#  define pTHX                           void
++#endif
++
++#ifndef pTHX_
++#  define pTHX_
++#endif
++
++#ifndef aTHX
++#  define aTHX
++#endif
++
++#ifndef aTHX_
++#  define aTHX_
++#endif
++
++#if (PERL_BCDVERSION < 0x5006000)
++#  ifdef USE_THREADS
++#    define aTHXR  thr
++#    define aTHXR_ thr,
++#  else
++#    define aTHXR
++#    define aTHXR_
++#  endif
++#  define dTHXR  dTHR
++#else
++#  define aTHXR  aTHX
++#  define aTHXR_ aTHX_
++#  define dTHXR  dTHX
++#endif
++#ifndef dTHXoa
++#  define dTHXoa(x)                      dTHXa(x)
++#endif
++
++#ifdef I_LIMITS
++#  include <limits.h>
++#endif
++
++#ifndef PERL_UCHAR_MIN
++#  define PERL_UCHAR_MIN ((unsigned char)0)
++#endif
++
++#ifndef PERL_UCHAR_MAX
++#  ifdef UCHAR_MAX
++#    define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)
++#  else
++#    ifdef MAXUCHAR
++#      define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR)
++#    else
++#      define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0)
++#    endif
++#  endif
++#endif
++
++#ifndef PERL_USHORT_MIN
++#  define PERL_USHORT_MIN ((unsigned short)0)
++#endif
++
++#ifndef PERL_USHORT_MAX
++#  ifdef USHORT_MAX
++#    define PERL_USHORT_MAX ((unsigned short)USHORT_MAX)
++#  else
++#    ifdef MAXUSHORT
++#      define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)
++#    else
++#      ifdef USHRT_MAX
++#        define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)
++#      else
++#        define PERL_USHORT_MAX ((unsigned short)~(unsigned)0)
++#      endif
++#    endif
++#  endif
++#endif
++
++#ifndef PERL_SHORT_MAX
++#  ifdef SHORT_MAX
++#    define PERL_SHORT_MAX ((short)SHORT_MAX)
++#  else
++#    ifdef MAXSHORT    /* Often used in <values.h> */
++#      define PERL_SHORT_MAX ((short)MAXSHORT)
++#    else
++#      ifdef SHRT_MAX
++#        define PERL_SHORT_MAX ((short)SHRT_MAX)
++#      else
++#        define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1))
++#      endif
++#    endif
++#  endif
++#endif
++
++#ifndef PERL_SHORT_MIN
++#  ifdef SHORT_MIN
++#    define PERL_SHORT_MIN ((short)SHORT_MIN)
++#  else
++#    ifdef MINSHORT
++#      define PERL_SHORT_MIN ((short)MINSHORT)
++#    else
++#      ifdef SHRT_MIN
++#        define PERL_SHORT_MIN ((short)SHRT_MIN)
++#      else
++#        define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))
++#      endif
++#    endif
++#  endif
++#endif
++
++#ifndef PERL_UINT_MAX
++#  ifdef UINT_MAX
++#    define PERL_UINT_MAX ((unsigned int)UINT_MAX)
++#  else
++#    ifdef MAXUINT
++#      define PERL_UINT_MAX ((unsigned int)MAXUINT)
++#    else
++#      define PERL_UINT_MAX (~(unsigned int)0)
++#    endif
++#  endif
++#endif
++
++#ifndef PERL_UINT_MIN
++#  define PERL_UINT_MIN ((unsigned int)0)
++#endif
++
++#ifndef PERL_INT_MAX
++#  ifdef INT_MAX
++#    define PERL_INT_MAX ((int)INT_MAX)
++#  else
++#    ifdef MAXINT    /* Often used in <values.h> */
++#      define PERL_INT_MAX ((int)MAXINT)
++#    else
++#      define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1))
++#    endif
++#  endif
++#endif
++
++#ifndef PERL_INT_MIN
++#  ifdef INT_MIN
++#    define PERL_INT_MIN ((int)INT_MIN)
++#  else
++#    ifdef MININT
++#      define PERL_INT_MIN ((int)MININT)
++#    else
++#      define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))
++#    endif
++#  endif
++#endif
++
++#ifndef PERL_ULONG_MAX
++#  ifdef ULONG_MAX
++#    define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)
++#  else
++#    ifdef MAXULONG
++#      define PERL_ULONG_MAX ((unsigned long)MAXULONG)
++#    else
++#      define PERL_ULONG_MAX (~(unsigned long)0)
++#    endif
++#  endif
++#endif
++
++#ifndef PERL_ULONG_MIN
++#  define PERL_ULONG_MIN ((unsigned long)0L)
++#endif
++
++#ifndef PERL_LONG_MAX
++#  ifdef LONG_MAX
++#    define PERL_LONG_MAX ((long)LONG_MAX)
++#  else
++#    ifdef MAXLONG
++#      define PERL_LONG_MAX ((long)MAXLONG)
++#    else
++#      define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1))
++#    endif
++#  endif
++#endif
++
++#ifndef PERL_LONG_MIN
++#  ifdef LONG_MIN
++#    define PERL_LONG_MIN ((long)LONG_MIN)
++#  else
++#    ifdef MINLONG
++#      define PERL_LONG_MIN ((long)MINLONG)
++#    else
++#      define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3))
++#    endif
++#  endif
++#endif
++
++#if defined(HAS_QUAD) && (defined(convex) || defined(uts))
++#  ifndef PERL_UQUAD_MAX
++#    ifdef ULONGLONG_MAX
++#      define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX)
++#    else
++#      ifdef MAXULONGLONG
++#        define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG)
++#      else
++#        define PERL_UQUAD_MAX (~(unsigned long long)0)
++#      endif
++#    endif
++#  endif
++
++#  ifndef PERL_UQUAD_MIN
++#    define PERL_UQUAD_MIN ((unsigned long long)0L)
++#  endif
++
++#  ifndef PERL_QUAD_MAX
++#    ifdef LONGLONG_MAX
++#      define PERL_QUAD_MAX ((long long)LONGLONG_MAX)
++#    else
++#      ifdef MAXLONGLONG
++#        define PERL_QUAD_MAX ((long long)MAXLONGLONG)
++#      else
++#        define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1))
++#      endif
++#    endif
++#  endif
++
++#  ifndef PERL_QUAD_MIN
++#    ifdef LONGLONG_MIN
++#      define PERL_QUAD_MIN ((long long)LONGLONG_MIN)
++#    else
++#      ifdef MINLONGLONG
++#        define PERL_QUAD_MIN ((long long)MINLONGLONG)
++#      else
++#        define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3))
++#      endif
++#    endif
++#  endif
++#endif
++
++/* This is based on code from 5.003 perl.h */
++#ifdef HAS_QUAD
++#  ifdef cray
++#ifndef IVTYPE
++#  define IVTYPE                         int
++#endif
++
++#ifndef IV_MIN
++#  define IV_MIN                         PERL_INT_MIN
++#endif
++
++#ifndef IV_MAX
++#  define IV_MAX                         PERL_INT_MAX
++#endif
++
++#ifndef UV_MIN
++#  define UV_MIN                         PERL_UINT_MIN
++#endif
++
++#ifndef UV_MAX
++#  define UV_MAX                         PERL_UINT_MAX
++#endif
++
++#    ifdef INTSIZE
++#ifndef IVSIZE
++#  define IVSIZE                         INTSIZE
++#endif
++
++#    endif
++#  else
++#    if defined(convex) || defined(uts)
++#ifndef IVTYPE
++#  define IVTYPE                         long long
++#endif
++
++#ifndef IV_MIN
++#  define IV_MIN                         PERL_QUAD_MIN
++#endif
++
++#ifndef IV_MAX
++#  define IV_MAX                         PERL_QUAD_MAX
++#endif
++
++#ifndef UV_MIN
++#  define UV_MIN                         PERL_UQUAD_MIN
++#endif
++
++#ifndef UV_MAX
++#  define UV_MAX                         PERL_UQUAD_MAX
++#endif
++
++#      ifdef LONGLONGSIZE
++#ifndef IVSIZE
++#  define IVSIZE                         LONGLONGSIZE
++#endif
++
++#      endif
++#    else
++#ifndef IVTYPE
++#  define IVTYPE                         long
++#endif
++
++#ifndef IV_MIN
++#  define IV_MIN                         PERL_LONG_MIN
++#endif
++
++#ifndef IV_MAX
++#  define IV_MAX                         PERL_LONG_MAX
++#endif
++
++#ifndef UV_MIN
++#  define UV_MIN                         PERL_ULONG_MIN
++#endif
++
++#ifndef UV_MAX
++#  define UV_MAX                         PERL_ULONG_MAX
++#endif
++
++#      ifdef LONGSIZE
++#ifndef IVSIZE
++#  define IVSIZE                         LONGSIZE
++#endif
++
++#      endif
++#    endif
++#  endif
++#ifndef IVSIZE
++#  define IVSIZE                         8
++#endif
++
++#ifndef LONGSIZE
++#  define LONGSIZE                       8
++#endif
++
++#ifndef PERL_QUAD_MIN
++#  define PERL_QUAD_MIN                  IV_MIN
++#endif
++
++#ifndef PERL_QUAD_MAX
++#  define PERL_QUAD_MAX                  IV_MAX
++#endif
++
++#ifndef PERL_UQUAD_MIN
++#  define PERL_UQUAD_MIN                 UV_MIN
++#endif
++
++#ifndef PERL_UQUAD_MAX
++#  define PERL_UQUAD_MAX                 UV_MAX
++#endif
++
++#else
++#ifndef IVTYPE
++#  define IVTYPE                         long
++#endif
++
++#ifndef LONGSIZE
++#  define LONGSIZE                       4
++#endif
++
++#ifndef IV_MIN
++#  define IV_MIN                         PERL_LONG_MIN
++#endif
++
++#ifndef IV_MAX
++#  define IV_MAX                         PERL_LONG_MAX
++#endif
++
++#ifndef UV_MIN
++#  define UV_MIN                         PERL_ULONG_MIN
++#endif
++
++#ifndef UV_MAX
++#  define UV_MAX                         PERL_ULONG_MAX
++#endif
++
++#endif
++
++#ifndef IVSIZE
++#  ifdef LONGSIZE
++#    define IVSIZE LONGSIZE
++#  else
++#    define IVSIZE 4 /* A bold guess, but the best we can make. */
++#  endif
++#endif
++#ifndef UVTYPE
++#  define UVTYPE                         unsigned IVTYPE
++#endif
++
++#ifndef UVSIZE
++#  define UVSIZE                         IVSIZE
++#endif
++#ifndef sv_setuv
++#  define sv_setuv(sv, uv)               \
++               STMT_START {                         \
++                 UV TeMpUv = uv;                    \
++                 if (TeMpUv <= IV_MAX)              \
++                   sv_setiv(sv, TeMpUv);            \
++                 else                               \
++                   sv_setnv(sv, (double)TeMpUv);    \
++               } STMT_END
++#endif
++#ifndef newSVuv
++#  define newSVuv(uv)                    ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv))
++#endif
++#ifndef sv_2uv
++#  define sv_2uv(sv)                     ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv)))
++#endif
++
++#ifndef SvUVX
++#  define SvUVX(sv)                      ((UV)SvIVX(sv))
++#endif
++
++#ifndef SvUVXx
++#  define SvUVXx(sv)                     SvUVX(sv)
++#endif
++
++#ifndef SvUV
++#  define SvUV(sv)                       (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))
++#endif
++
++#ifndef SvUVx
++#  define SvUVx(sv)                      ((PL_Sv = (sv)), SvUV(PL_Sv))
++#endif
++
++/* Hint: sv_uv
++ * Always use the SvUVx() macro instead of sv_uv().
++ */
++#ifndef sv_uv
++#  define sv_uv(sv)                      SvUVx(sv)
++#endif
++
++#if !defined(SvUOK) && defined(SvIOK_UV)
++#  define SvUOK(sv) SvIOK_UV(sv)
++#endif
++#ifndef XST_mUV
++#  define XST_mUV(i,v)                   (ST(i) = sv_2mortal(newSVuv(v))  )
++#endif
++
++#ifndef XSRETURN_UV
++#  define XSRETURN_UV(v)                 STMT_START { XST_mUV(0,v);  XSRETURN(1); } STMT_END
++#endif
++#ifndef PUSHu
++#  define PUSHu(u)                       STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG;  } STMT_END
++#endif
++
++#ifndef XPUSHu
++#  define XPUSHu(u)                      STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END
++#endif
++
++#ifdef HAS_MEMCMP
++#ifndef memNE
++#  define memNE(s1,s2,l)                 (memcmp(s1,s2,l))
++#endif
++
++#ifndef memEQ
++#  define memEQ(s1,s2,l)                 (!memcmp(s1,s2,l))
++#endif
++
++#else
++#ifndef memNE
++#  define memNE(s1,s2,l)                 (bcmp(s1,s2,l))
++#endif
++
++#ifndef memEQ
++#  define memEQ(s1,s2,l)                 (!bcmp(s1,s2,l))
++#endif
++
++#endif
++#ifndef memEQs
++#  define memEQs(s1, l, s2)              \
++                   (sizeof(s2)-1 == l && memEQ(s1, (s2 ""), (sizeof(s2)-1)))
++#endif
++
++#ifndef memNEs
++#  define memNEs(s1, l, s2)              !memEQs(s1, l, s2)
++#endif
++#ifndef MoveD
++#  define MoveD(s,d,n,t)                 memmove((char*)(d),(char*)(s), (n) * sizeof(t))
++#endif
++
++#ifndef CopyD
++#  define CopyD(s,d,n,t)                 memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
++#endif
++
++#ifdef HAS_MEMSET
++#ifndef ZeroD
++#  define ZeroD(d,n,t)                   memzero((char*)(d), (n) * sizeof(t))
++#endif
++
++#else
++#ifndef ZeroD
++#  define ZeroD(d,n,t)                   ((void)memzero((char*)(d), (n) * sizeof(t)), d)
++#endif
++
++#endif
++#ifndef PoisonWith
++#  define PoisonWith(d,n,t,b)            (void)memset((char*)(d), (U8)(b), (n) * sizeof(t))
++#endif
++
++#ifndef PoisonNew
++#  define PoisonNew(d,n,t)               PoisonWith(d,n,t,0xAB)
++#endif
++
++#ifndef PoisonFree
++#  define PoisonFree(d,n,t)              PoisonWith(d,n,t,0xEF)
++#endif
++
++#ifndef Poison
++#  define Poison(d,n,t)                  PoisonFree(d,n,t)
++#endif
++#ifndef Newx
++#  define Newx(v,n,t)                    New(0,v,n,t)
++#endif
++
++#ifndef Newxc
++#  define Newxc(v,n,t,c)                 Newc(0,v,n,t,c)
++#endif
++
++#ifndef Newxz
++#  define Newxz(v,n,t)                   Newz(0,v,n,t)
++#endif
++
++#ifndef PERL_UNUSED_DECL
++#  ifdef HASATTRIBUTE
++#    if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
++#      define PERL_UNUSED_DECL
++#    else
++#      define PERL_UNUSED_DECL __attribute__((unused))
++#    endif
++#  else
++#    define PERL_UNUSED_DECL
++#  endif
++#endif
++
++#ifndef PERL_UNUSED_ARG
++#  if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */
++#    include <note.h>
++#    define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
++#  else
++#    define PERL_UNUSED_ARG(x) ((void)x)
++#  endif
++#endif
++
++#ifndef PERL_UNUSED_VAR
++#  define PERL_UNUSED_VAR(x) ((void)x)
++#endif
++
++#ifndef PERL_UNUSED_CONTEXT
++#  ifdef USE_ITHREADS
++#    define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
++#  else
++#    define PERL_UNUSED_CONTEXT
++#  endif
++#endif
++#ifndef NOOP
++#  define NOOP                           /*EMPTY*/(void)0
++#endif
++
++#ifndef dNOOP
++#  define dNOOP                          extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL
++#endif
++
++#ifndef NVTYPE
++#  if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
++#    define NVTYPE long double
++#  else
++#    define NVTYPE double
++#  endif
++typedef NVTYPE NV;
++#endif
++
++#ifndef INT2PTR
++#  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
++#    define PTRV                  UV
++#    define INT2PTR(any,d)        (any)(d)
++#  else
++#    if PTRSIZE == LONGSIZE
++#      define PTRV                unsigned long
++#    else
++#      define PTRV                unsigned
++#    endif
++#    define INT2PTR(any,d)        (any)(PTRV)(d)
++#  endif
++#endif
++
++#ifndef PTR2ul
++#  if PTRSIZE == LONGSIZE
++#    define PTR2ul(p)     (unsigned long)(p)
++#  else
++#    define PTR2ul(p)     INT2PTR(unsigned long,p)
++#  endif
++#endif
++#ifndef PTR2nat
++#  define PTR2nat(p)                     (PTRV)(p)
++#endif
++
++#ifndef NUM2PTR
++#  define NUM2PTR(any,d)                 (any)PTR2nat(d)
++#endif
++
++#ifndef PTR2IV
++#  define PTR2IV(p)                      INT2PTR(IV,p)
++#endif
++
++#ifndef PTR2UV
++#  define PTR2UV(p)                      INT2PTR(UV,p)
++#endif
++
++#ifndef PTR2NV
++#  define PTR2NV(p)                      NUM2PTR(NV,p)
++#endif
++
++#undef START_EXTERN_C
++#undef END_EXTERN_C
++#undef EXTERN_C
++#ifdef __cplusplus
++#  define START_EXTERN_C extern "C" {
++#  define END_EXTERN_C }
++#  define EXTERN_C extern "C"
++#else
++#  define START_EXTERN_C
++#  define END_EXTERN_C
++#  define EXTERN_C extern
++#endif
++
++#if defined(PERL_GCC_PEDANTIC)
++#  ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
++#    define PERL_GCC_BRACE_GROUPS_FORBIDDEN
++#  endif
++#endif
++
++#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
++#  ifndef PERL_USE_GCC_BRACE_GROUPS
++#    define PERL_USE_GCC_BRACE_GROUPS
++#  endif
++#endif
++
++#undef STMT_START
++#undef STMT_END
++#ifdef PERL_USE_GCC_BRACE_GROUPS
++#  define STMT_START    (void)( /* gcc supports ``({ STATEMENTS; })'' */
++#  define STMT_END      )
++#else
++#  if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
++#    define STMT_START  if (1)
++#    define STMT_END    else (void)0
++#  else
++#    define STMT_START  do
++#    define STMT_END    while (0)
++#  endif
++#endif
++#ifndef boolSV
++#  define boolSV(b)                      ((b) ? &PL_sv_yes : &PL_sv_no)
++#endif
++
++/* DEFSV appears first in 5.004_56 */
++#ifndef DEFSV
++#  define DEFSV                          GvSV(PL_defgv)
++#endif
++
++#ifndef SAVE_DEFSV
++#  define SAVE_DEFSV                     SAVESPTR(GvSV(PL_defgv))
++#endif
++
++#ifndef DEFSV_set
++#  define DEFSV_set(sv)                  (DEFSV = (sv))
++#endif
++
++/* Older perls (<=5.003) lack AvFILLp */
++#ifndef AvFILLp
++#  define AvFILLp                        AvFILL
++#endif
++#ifndef ERRSV
++#  define ERRSV                          get_sv("@",FALSE)
++#endif
++
++/* Hint: gv_stashpvn
++ * This function's backport doesn't support the length parameter, but
++ * rather ignores it. Portability can only be ensured if the length
++ * parameter is used for speed reasons, but the length can always be
++ * correctly computed from the string argument.
++ */
++#ifndef gv_stashpvn
++#  define gv_stashpvn(str,len,create)    gv_stashpv(str,create)
++#endif
++
++/* Replace: 1 */
++#ifndef get_cv
++#  define get_cv                         perl_get_cv
++#endif
++
++#ifndef get_sv
++#  define get_sv                         perl_get_sv
++#endif
++
++#ifndef get_av
++#  define get_av                         perl_get_av
++#endif
++
++#ifndef get_hv
++#  define get_hv                         perl_get_hv
++#endif
++
++/* Replace: 0 */
++#ifndef dUNDERBAR
++#  define dUNDERBAR                      dNOOP
++#endif
++
++#ifndef UNDERBAR
++#  define UNDERBAR                       DEFSV
++#endif
++#ifndef dAX
++#  define dAX                            I32 ax = MARK - PL_stack_base + 1
++#endif
++
++#ifndef dITEMS
++#  define dITEMS                         I32 items = SP - MARK
++#endif
++#ifndef dXSTARG
++#  define dXSTARG                        SV * targ = sv_newmortal()
++#endif
++#ifndef dAXMARK
++#  define dAXMARK                        I32 ax = POPMARK; \
++                               register SV ** const mark = PL_stack_base + ax++
++#endif
++#ifndef XSprePUSH
++#  define XSprePUSH                      (sp = PL_stack_base + ax - 1)
++#endif
++
++#if (PERL_BCDVERSION < 0x5005000)
++#  undef XSRETURN
++#  define XSRETURN(off)                                   \
++      STMT_START {                                        \
++          PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
++          return;                                         \
++      } STMT_END
++#endif
++#ifndef XSPROTO
++#  define XSPROTO(name)                  void name(pTHX_ CV* cv)
++#endif
++
++#ifndef SVfARG
++#  define SVfARG(p)                      ((void*)(p))
++#endif
++#ifndef PERL_ABS
++#  define PERL_ABS(x)                    ((x) < 0 ? -(x) : (x))
++#endif
++#ifndef dVAR
++#  define dVAR                           dNOOP
++#endif
++#ifndef SVf
++#  define SVf                            "_"
++#endif
++#ifndef UTF8_MAXBYTES
++#  define UTF8_MAXBYTES                  UTF8_MAXLEN
++#endif
++#ifndef CPERLscope
++#  define CPERLscope(x)                  x
++#endif
++#ifndef PERL_HASH
++#  define PERL_HASH(hash,str,len)        \
++     STMT_START { \
++        const char *s_PeRlHaSh = str; \
++        I32 i_PeRlHaSh = len; \
++        U32 hash_PeRlHaSh = 0; \
++        while (i_PeRlHaSh--) \
++            hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
++        (hash) = hash_PeRlHaSh; \
++    } STMT_END
++#endif
++
++#ifndef PERLIO_FUNCS_DECL
++# ifdef PERLIO_FUNCS_CONST
++#  define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs
++#  define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs)
++# else
++#  define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs
++#  define PERLIO_FUNCS_CAST(funcs) (funcs)
++# endif
++#endif
++
++/* provide these typedefs for older perls */
++#if (PERL_BCDVERSION < 0x5009003)
++
++# ifdef ARGSproto
++typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto);
++# else
++typedef OP* (CPERLscope(*Perl_ppaddr_t))(pTHX);
++# endif
++
++typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
++
++#endif
++#ifndef isPSXSPC
++#  define isPSXSPC(c)                    (isSPACE(c) || (c) == '\v')
++#endif
++
++#ifndef isBLANK
++#  define isBLANK(c)                     ((c) == ' ' || (c) == '\t')
++#endif
++
++#ifdef EBCDIC
++#ifndef isALNUMC
++#  define isALNUMC(c)                    isalnum(c)
++#endif
++
++#ifndef isASCII
++#  define isASCII(c)                     isascii(c)
++#endif
++
++#ifndef isCNTRL
++#  define isCNTRL(c)                     iscntrl(c)
++#endif
++
++#ifndef isGRAPH
++#  define isGRAPH(c)                     isgraph(c)
++#endif
++
++#ifndef isPRINT
++#  define isPRINT(c)                     isprint(c)
++#endif
++
++#ifndef isPUNCT
++#  define isPUNCT(c)                     ispunct(c)
++#endif
++
++#ifndef isXDIGIT
++#  define isXDIGIT(c)                    isxdigit(c)
++#endif
++
++#else
++# if (PERL_BCDVERSION < 0x5010000)
++/* Hint: isPRINT
++ * The implementation in older perl versions includes all of the
++ * isSPACE() characters, which is wrong. The version provided by
++ * Devel::PPPort always overrides a present buggy version.
++ */
++#  undef isPRINT
++# endif
++
++#ifdef HAS_QUAD
++# define WIDEST_UTYPE U64TYPE
++#else
++# define WIDEST_UTYPE U32
++#endif
++#ifndef isALNUMC
++#  define isALNUMC(c)                    (isALPHA(c) || isDIGIT(c))
++#endif
++
++#ifndef isASCII
++#  define isASCII(c)                     ((WIDEST_UTYPE) (c) <= 127)
++#endif
++
++#ifndef isCNTRL
++#  define isCNTRL(c)                     ((WIDEST_UTYPE) (c) < ' ' || (c) == 127)
++#endif
++
++#ifndef isGRAPH
++#  define isGRAPH(c)                     (isALNUM(c) || isPUNCT(c))
++#endif
++
++#ifndef isPRINT
++#  define isPRINT(c)                     (((c) >= 32 && (c) < 127))
++#endif
++
++#ifndef isPUNCT
++#  define isPUNCT(c)                     (((c) >= 33 && (c) <= 47) || ((c) >= 58 && (c) <= 64)  || ((c) >= 91 && (c) <= 96) || ((c) >= 123 && (c) <= 126))
++#endif
++
++#ifndef isXDIGIT
++#  define isXDIGIT(c)                    (isDIGIT(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
++#endif
++
++#endif
++
++#ifndef PERL_SIGNALS_UNSAFE_FLAG
++
++#define PERL_SIGNALS_UNSAFE_FLAG 0x0001
++
++#if (PERL_BCDVERSION < 0x5008000)
++#  define D_PPP_PERL_SIGNALS_INIT   PERL_SIGNALS_UNSAFE_FLAG
++#else
++#  define D_PPP_PERL_SIGNALS_INIT   0
++#endif
++
++#if defined(NEED_PL_signals)
++static U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
++#elif defined(NEED_PL_signals_GLOBAL)
++U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
++#else
++extern U32 DPPP_(my_PL_signals);
++#endif
++#define PL_signals DPPP_(my_PL_signals)
++
++#endif
++
++/* Hint: PL_ppaddr
++ * Calling an op via PL_ppaddr requires passing a context argument
++ * for threaded builds. Since the context argument is different for
++ * 5.005 perls, you can use aTHXR (supplied by ppport.h), which will
++ * automatically be defined as the correct argument.
++ */
++
++#if (PERL_BCDVERSION <= 0x5005005)
++/* Replace: 1 */
++#  define PL_ppaddr                 ppaddr
++#  define PL_no_modify              no_modify
++/* Replace: 0 */
++#endif
++
++#if (PERL_BCDVERSION <= 0x5004005)
++/* Replace: 1 */
++#  define PL_DBsignal               DBsignal
++#  define PL_DBsingle               DBsingle
++#  define PL_DBsub                  DBsub
++#  define PL_DBtrace                DBtrace
++#  define PL_Sv                     Sv
++#  define PL_bufend                 bufend
++#  define PL_bufptr                 bufptr
++#  define PL_compiling              compiling
++#  define PL_copline                copline
++#  define PL_curcop                 curcop
++#  define PL_curstash               curstash
++#  define PL_debstash               debstash
++#  define PL_defgv                  defgv
++#  define PL_diehook                diehook
++#  define PL_dirty                  dirty
++#  define PL_dowarn                 dowarn
++#  define PL_errgv                  errgv
++#  define PL_error_count            error_count
++#  define PL_expect                 expect
++#  define PL_hexdigit               hexdigit
++#  define PL_hints                  hints
++#  define PL_in_my                  in_my
++#  define PL_laststatval            laststatval
++#  define PL_lex_state              lex_state
++#  define PL_lex_stuff              lex_stuff
++#  define PL_linestr                linestr
++#  define PL_na                     na
++#  define PL_perl_destruct_level    perl_destruct_level
++#  define PL_perldb                 perldb
++#  define PL_rsfp_filters           rsfp_filters
++#  define PL_rsfp                   rsfp
++#  define PL_stack_base             stack_base
++#  define PL_stack_sp               stack_sp
++#  define PL_statcache              statcache
++#  define PL_stdingv                stdingv
++#  define PL_sv_arenaroot           sv_arenaroot
++#  define PL_sv_no                  sv_no
++#  define PL_sv_undef               sv_undef
++#  define PL_sv_yes                 sv_yes
++#  define PL_tainted                tainted
++#  define PL_tainting               tainting
++#  define PL_tokenbuf               tokenbuf
++/* Replace: 0 */
++#endif
++
++/* Warning: PL_parser
++ * For perl versions earlier than 5.9.5, this is an always
++ * non-NULL dummy. Also, it cannot be dereferenced. Don't
++ * use it if you can avoid is and unless you absolutely know
++ * what you're doing.
++ * If you always check that PL_parser is non-NULL, you can
++ * define DPPP_PL_parser_NO_DUMMY to avoid the creation of
++ * a dummy parser structure.
++ */
++
++#if (PERL_BCDVERSION >= 0x5009005)
++# ifdef DPPP_PL_parser_NO_DUMMY
++#  define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
++                (croak("panic: PL_parser == NULL in %s:%d", \
++                       __FILE__, __LINE__), (yy_parser *) NULL))->var)
++# else
++#  ifdef DPPP_PL_parser_NO_DUMMY_WARNING
++#   define D_PPP_parser_dummy_warning(var)
++#  else
++#   define D_PPP_parser_dummy_warning(var) \
++             warn("warning: dummy PL_" #var " used in %s:%d", __FILE__, __LINE__),
++#  endif
++#  define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
++                (D_PPP_parser_dummy_warning(var) &DPPP_(dummy_PL_parser)))->var)
++#if defined(NEED_PL_parser)
++static yy_parser DPPP_(dummy_PL_parser);
++#elif defined(NEED_PL_parser_GLOBAL)
++yy_parser DPPP_(dummy_PL_parser);
++#else
++extern yy_parser DPPP_(dummy_PL_parser);
++#endif
++
++# endif
++
++/* PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf depends on PL_parser */
++/* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf
++ * Do not use this variable unless you know exactly what you're
++ * doint. It is internal to the perl parser and may change or even
++ * be removed in the future. As of perl 5.9.5, you have to check
++ * for (PL_parser != NULL) for this variable to have any effect.
++ * An always non-NULL PL_parser dummy is provided for earlier
++ * perl versions.
++ * If PL_parser is NULL when you try to access this variable, a
++ * dummy is being accessed instead and a warning is issued unless
++ * you define DPPP_PL_parser_NO_DUMMY_WARNING.
++ * If DPPP_PL_parser_NO_DUMMY is defined, the code trying to access
++ * this variable will croak with a panic message.
++ */
++
++# define PL_expect         D_PPP_my_PL_parser_var(expect)
++# define PL_copline        D_PPP_my_PL_parser_var(copline)
++# define PL_rsfp           D_PPP_my_PL_parser_var(rsfp)
++# define PL_rsfp_filters   D_PPP_my_PL_parser_var(rsfp_filters)
++# define PL_linestr        D_PPP_my_PL_parser_var(linestr)
++# define PL_bufptr         D_PPP_my_PL_parser_var(bufptr)
++# define PL_bufend         D_PPP_my_PL_parser_var(bufend)
++# define PL_lex_state      D_PPP_my_PL_parser_var(lex_state)
++# define PL_lex_stuff      D_PPP_my_PL_parser_var(lex_stuff)
++# define PL_tokenbuf       D_PPP_my_PL_parser_var(tokenbuf)
++# define PL_in_my          D_PPP_my_PL_parser_var(in_my)
++# define PL_in_my_stash    D_PPP_my_PL_parser_var(in_my_stash)
++# define PL_error_count    D_PPP_my_PL_parser_var(error_count)
++
++
++#else
++
++/* ensure that PL_parser != NULL and cannot be dereferenced */
++# define PL_parser         ((void *) 1)
++
++#endif
++#ifndef mPUSHs
++#  define mPUSHs(s)                      PUSHs(sv_2mortal(s))
++#endif
++
++#ifndef PUSHmortal
++#  define PUSHmortal                     PUSHs(sv_newmortal())
++#endif
++
++#ifndef mPUSHp
++#  define mPUSHp(p,l)                    sv_setpvn(PUSHmortal, (p), (l))
++#endif
++
++#ifndef mPUSHn
++#  define mPUSHn(n)                      sv_setnv(PUSHmortal, (NV)(n))
++#endif
++
++#ifndef mPUSHi
++#  define mPUSHi(i)                      sv_setiv(PUSHmortal, (IV)(i))
++#endif
++
++#ifndef mPUSHu
++#  define mPUSHu(u)                      sv_setuv(PUSHmortal, (UV)(u))
++#endif
++#ifndef mXPUSHs
++#  define mXPUSHs(s)                     XPUSHs(sv_2mortal(s))
++#endif
++
++#ifndef XPUSHmortal
++#  define XPUSHmortal                    XPUSHs(sv_newmortal())
++#endif
++
++#ifndef mXPUSHp
++#  define mXPUSHp(p,l)                   STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END
++#endif
++
++#ifndef mXPUSHn
++#  define mXPUSHn(n)                     STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
++#endif
++
++#ifndef mXPUSHi
++#  define mXPUSHi(i)                     STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
++#endif
++
++#ifndef mXPUSHu
++#  define mXPUSHu(u)                     STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
++#endif
++
++/* Replace: 1 */
++#ifndef call_sv
++#  define call_sv                        perl_call_sv
++#endif
++
++#ifndef call_pv
++#  define call_pv                        perl_call_pv
++#endif
++
++#ifndef call_argv
++#  define call_argv                      perl_call_argv
++#endif
++
++#ifndef call_method
++#  define call_method                    perl_call_method
++#endif
++#ifndef eval_sv
++#  define eval_sv                        perl_eval_sv
++#endif
++
++/* Replace: 0 */
++#ifndef PERL_LOADMOD_DENY
++#  define PERL_LOADMOD_DENY              0x1
++#endif
++
++#ifndef PERL_LOADMOD_NOIMPORT
++#  define PERL_LOADMOD_NOIMPORT          0x2
++#endif
++
++#ifndef PERL_LOADMOD_IMPORT_OPS
++#  define PERL_LOADMOD_IMPORT_OPS        0x4
++#endif
++
++#ifndef G_METHOD
++# define G_METHOD               64
++# ifdef call_sv
++#  undef call_sv
++# endif
++# if (PERL_BCDVERSION < 0x5006000)
++#  define call_sv(sv, flags)  ((flags) & G_METHOD ? perl_call_method((char *) SvPV_nolen_const(sv), \
++                                (flags) & ~G_METHOD) : perl_call_sv(sv, flags))
++# else
++#  define call_sv(sv, flags)  ((flags) & G_METHOD ? Perl_call_method(aTHX_ (char *) SvPV_nolen_const(sv), \
++                                (flags) & ~G_METHOD) : Perl_call_sv(aTHX_ sv, flags))
++# endif
++#endif
++
++/* Replace perl_eval_pv with eval_pv */
++
++#ifndef eval_pv
++#if defined(NEED_eval_pv)
++static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
++static
++#else
++extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
++#endif
++
++#ifdef eval_pv
++#  undef eval_pv
++#endif
++#define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b)
++#define Perl_eval_pv DPPP_(my_eval_pv)
++
++#if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL)
++
++SV*
++DPPP_(my_eval_pv)(char *p, I32 croak_on_error)
++{
++    dSP;
++    SV* sv = newSVpv(p, 0);
++
++    PUSHMARK(sp);
++    eval_sv(sv, G_SCALAR);
++    SvREFCNT_dec(sv);
++
++    SPAGAIN;
++    sv = POPs;
++    PUTBACK;
++
++    if (croak_on_error && SvTRUE(GvSV(errgv)))
++        croak(SvPVx(GvSV(errgv), na));
++
++    return sv;
++}
++
++#endif
++#endif
++
++#ifndef vload_module
++#if defined(NEED_vload_module)
++static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
++static
++#else
++extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
++#endif
++
++#ifdef vload_module
++#  undef vload_module
++#endif
++#define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d)
++#define Perl_vload_module DPPP_(my_vload_module)
++
++#if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL)
++
++void
++DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args)
++{
++    dTHR;
++    dVAR;
++    OP *veop, *imop;
++
++    OP * const modname = newSVOP(OP_CONST, 0, name);
++    /* 5.005 has a somewhat hacky force_normal that doesn't croak on
++       SvREADONLY() if PL_compling is true. Current perls take care in
++       ck_require() to correctly turn off SvREADONLY before calling
++       force_normal_flags(). This seems a better fix than fudging PL_compling
++     */
++    SvREADONLY_off(((SVOP*)modname)->op_sv);
++    modname->op_private |= OPpCONST_BARE;
++    if (ver) {
++        veop = newSVOP(OP_CONST, 0, ver);
++    }
++    else
++        veop = NULL;
++    if (flags & PERL_LOADMOD_NOIMPORT) {
++        imop = sawparens(newNULLLIST());
++    }
++    else if (flags & PERL_LOADMOD_IMPORT_OPS) {
++        imop = va_arg(*args, OP*);
++    }
++    else {
++        SV *sv;
++        imop = NULL;
++        sv = va_arg(*args, SV*);
++        while (sv) {
++            imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
++            sv = va_arg(*args, SV*);
++        }
++    }
++    {
++        const line_t ocopline = PL_copline;
++        COP * const ocurcop = PL_curcop;
++        const int oexpect = PL_expect;
++
++#if (PERL_BCDVERSION >= 0x5004000)
++        utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
++                veop, modname, imop);
++#else
++        utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
++                modname, imop);
++#endif
++        PL_expect = oexpect;
++        PL_copline = ocopline;
++        PL_curcop = ocurcop;
++    }
++}
++
++#endif
++#endif
++
++#ifndef load_module
++#if defined(NEED_load_module)
++static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
++static
++#else
++extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
++#endif
++
++#ifdef load_module
++#  undef load_module
++#endif
++#define load_module DPPP_(my_load_module)
++#define Perl_load_module DPPP_(my_load_module)
++
++#if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL)
++
++void
++DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
++{
++    va_list args;
++    va_start(args, ver);
++    vload_module(flags, name, ver, &args);
++    va_end(args);
++}
++
++#endif
++#endif
++#ifndef newRV_inc
++#  define newRV_inc(sv)                  newRV(sv)   /* Replace */
++#endif
++
++#ifndef newRV_noinc
++#if defined(NEED_newRV_noinc)
++static SV * DPPP_(my_newRV_noinc)(SV *sv);
++static
++#else
++extern SV * DPPP_(my_newRV_noinc)(SV *sv);
++#endif
++
++#ifdef newRV_noinc
++#  undef newRV_noinc
++#endif
++#define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a)
++#define Perl_newRV_noinc DPPP_(my_newRV_noinc)
++
++#if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL)
++SV *
++DPPP_(my_newRV_noinc)(SV *sv)
++{
++  SV *rv = (SV *)newRV(sv);
++  SvREFCNT_dec(sv);
++  return rv;
++}
++#endif
++#endif
++
++/* Hint: newCONSTSUB
++ * Returns a CV* as of perl-5.7.1. This return value is not supported
++ * by Devel::PPPort.
++ */
++
++/* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
++#if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005)
++#if defined(NEED_newCONSTSUB)
++static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
++static
++#else
++extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
++#endif
++
++#ifdef newCONSTSUB
++#  undef newCONSTSUB
++#endif
++#define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c)
++#define Perl_newCONSTSUB DPPP_(my_newCONSTSUB)
++
++#if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
++
++/* This is just a trick to avoid a dependency of newCONSTSUB on PL_parser */
++/* (There's no PL_parser in perl < 5.005, so this is completely safe)     */
++#define D_PPP_PL_copline PL_copline
++
++void
++DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv)
++{
++        U32 oldhints = PL_hints;
++        HV *old_cop_stash = PL_curcop->cop_stash;
++        HV *old_curstash = PL_curstash;
++        line_t oldline = PL_curcop->cop_line;
++        PL_curcop->cop_line = D_PPP_PL_copline;
++
++        PL_hints &= ~HINT_BLOCK_SCOPE;
++        if (stash)
++                PL_curstash = PL_curcop->cop_stash = stash;
++
++        newSUB(
++
++#if   (PERL_BCDVERSION < 0x5003022)
++                start_subparse(),
++#elif (PERL_BCDVERSION == 0x5003022)
++                start_subparse(0),
++#else  /* 5.003_23  onwards */
++                start_subparse(FALSE, 0),
++#endif
++
++                newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
++                newSVOP(OP_CONST, 0, &PL_sv_no),   /* SvPV(&PL_sv_no) == "" -- GMB */
++                newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
++        );
++
++        PL_hints = oldhints;
++        PL_curcop->cop_stash = old_cop_stash;
++        PL_curstash = old_curstash;
++        PL_curcop->cop_line = oldline;
++}
++#endif
++#endif
++
++/*
++ * Boilerplate macros for initializing and accessing interpreter-local
++ * data from C.  All statics in extensions should be reworked to use
++ * this, if you want to make the extension thread-safe.  See ext/re/re.xs
++ * for an example of the use of these macros.
++ *
++ * Code that uses these macros is responsible for the following:
++ * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
++ * 2. Declare a typedef named my_cxt_t that is a structure that contains
++ *    all the data that needs to be interpreter-local.
++ * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
++ * 4. Use the MY_CXT_INIT macro such that it is called exactly once
++ *    (typically put in the BOOT: section).
++ * 5. Use the members of the my_cxt_t structure everywhere as
++ *    MY_CXT.member.
++ * 6. Use the dMY_CXT macro (a declaration) in all the functions that
++ *    access MY_CXT.
++ */
++
++#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
++    defined(PERL_CAPI)    || defined(PERL_IMPLICIT_CONTEXT)
++
++#ifndef START_MY_CXT
++
++/* This must appear in all extensions that define a my_cxt_t structure,
++ * right after the definition (i.e. at file scope).  The non-threads
++ * case below uses it to declare the data as static. */
++#define START_MY_CXT
++
++#if (PERL_BCDVERSION < 0x5004068)
++/* Fetches the SV that keeps the per-interpreter data. */
++#define dMY_CXT_SV \
++        SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
++#else /* >= perl5.004_68 */
++#define dMY_CXT_SV \
++        SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY,             \
++                                  sizeof(MY_CXT_KEY)-1, TRUE)
++#endif /* < perl5.004_68 */
++
++/* This declaration should be used within all functions that use the
++ * interpreter-local data. */
++#define dMY_CXT \
++        dMY_CXT_SV;                                                     \
++        my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
++
++/* Creates and zeroes the per-interpreter data.
++ * (We allocate my_cxtp in a Perl SV so that it will be released when
++ * the interpreter goes away.) */
++#define MY_CXT_INIT \
++        dMY_CXT_SV;                                                     \
++        /* newSV() allocates one more than needed */                    \
++        my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
++        Zero(my_cxtp, 1, my_cxt_t);                                     \
++        sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
++
++/* This macro must be used to access members of the my_cxt_t structure.
++ * e.g. MYCXT.some_data */
++#define MY_CXT          (*my_cxtp)
++
++/* Judicious use of these macros can reduce the number of times dMY_CXT
++ * is used.  Use is similar to pTHX, aTHX etc. */
++#define pMY_CXT         my_cxt_t *my_cxtp
++#define pMY_CXT_        pMY_CXT,
++#define _pMY_CXT        ,pMY_CXT
++#define aMY_CXT         my_cxtp
++#define aMY_CXT_        aMY_CXT,
++#define _aMY_CXT        ,aMY_CXT
++
++#endif /* START_MY_CXT */
++
++#ifndef MY_CXT_CLONE
++/* Clones the per-interpreter data. */
++#define MY_CXT_CLONE \
++        dMY_CXT_SV;                                                     \
++        my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
++        Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
++        sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
++#endif
++
++#else /* single interpreter */
++
++#ifndef START_MY_CXT
++
++#define START_MY_CXT    static my_cxt_t my_cxt;
++#define dMY_CXT_SV      dNOOP
++#define dMY_CXT         dNOOP
++#define MY_CXT_INIT     NOOP
++#define MY_CXT          my_cxt
++
++#define pMY_CXT         void
++#define pMY_CXT_
++#define _pMY_CXT
++#define aMY_CXT
++#define aMY_CXT_
++#define _aMY_CXT
++
++#endif /* START_MY_CXT */
++
++#ifndef MY_CXT_CLONE
++#define MY_CXT_CLONE    NOOP
++#endif
++
++#endif
++
++#ifndef IVdf
++#  if IVSIZE == LONGSIZE
++#    define     IVdf      "ld"
++#    define     UVuf      "lu"
++#    define     UVof      "lo"
++#    define     UVxf      "lx"
++#    define     UVXf      "lX"
++#  elif IVSIZE == INTSIZE
++#    define   IVdf      "d"
++#    define   UVuf      "u"
++#    define   UVof      "o"
++#    define   UVxf      "x"
++#    define   UVXf      "X"
++#  else
++#    error "cannot define IV/UV formats"
++#  endif
++#endif
++
++#ifndef NVef
++#  if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
++      defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000)
++            /* Not very likely, but let's try anyway. */
++#    define NVef          PERL_PRIeldbl
++#    define NVff          PERL_PRIfldbl
++#    define NVgf          PERL_PRIgldbl
++#  else
++#    define NVef          "e"
++#    define NVff          "f"
++#    define NVgf          "g"
++#  endif
++#endif
++
++#ifndef SvREFCNT_inc
++#  ifdef PERL_USE_GCC_BRACE_GROUPS
++#    define SvREFCNT_inc(sv)            \
++      ({                                \
++          SV * const _sv = (SV*)(sv);   \
++          if (_sv)                      \
++               (SvREFCNT(_sv))++;       \
++          _sv;                          \
++      })
++#  else
++#    define SvREFCNT_inc(sv)    \
++          ((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL)
++#  endif
++#endif
++
++#ifndef SvREFCNT_inc_simple
++#  ifdef PERL_USE_GCC_BRACE_GROUPS
++#    define SvREFCNT_inc_simple(sv)     \
++      ({                                        \
++          if (sv)                               \
++               (SvREFCNT(sv))++;                \
++          (SV *)(sv);                           \
++      })
++#  else
++#    define SvREFCNT_inc_simple(sv) \
++          ((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL)
++#  endif
++#endif
++
++#ifndef SvREFCNT_inc_NN
++#  ifdef PERL_USE_GCC_BRACE_GROUPS
++#    define SvREFCNT_inc_NN(sv)         \
++      ({                                        \
++          SV * const _sv = (SV*)(sv);   \
++          SvREFCNT(_sv)++;              \
++          _sv;                          \
++      })
++#  else
++#    define SvREFCNT_inc_NN(sv) \
++          (PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv)
++#  endif
++#endif
++
++#ifndef SvREFCNT_inc_void
++#  ifdef PERL_USE_GCC_BRACE_GROUPS
++#    define SvREFCNT_inc_void(sv)               \
++      ({                                        \
++          SV * const _sv = (SV*)(sv);   \
++          if (_sv)                      \
++              (void)(SvREFCNT(_sv)++);  \
++      })
++#  else
++#    define SvREFCNT_inc_void(sv) \
++          (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0)
++#  endif
++#endif
++#ifndef SvREFCNT_inc_simple_void
++#  define SvREFCNT_inc_simple_void(sv)   STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
++#endif
++
++#ifndef SvREFCNT_inc_simple_NN
++#  define SvREFCNT_inc_simple_NN(sv)     (++SvREFCNT(sv), (SV*)(sv))
++#endif
++
++#ifndef SvREFCNT_inc_void_NN
++#  define SvREFCNT_inc_void_NN(sv)       (void)(++SvREFCNT((SV*)(sv)))
++#endif
++
++#ifndef SvREFCNT_inc_simple_void_NN
++#  define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
++#endif
++
++#ifndef newSV_type
++
++#if defined(NEED_newSV_type)
++static SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
++static
++#else
++extern SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
++#endif
++
++#ifdef newSV_type
++#  undef newSV_type
++#endif
++#define newSV_type(a) DPPP_(my_newSV_type)(aTHX_ a)
++#define Perl_newSV_type DPPP_(my_newSV_type)
++
++#if defined(NEED_newSV_type) || defined(NEED_newSV_type_GLOBAL)
++
++SV*
++DPPP_(my_newSV_type)(pTHX_ svtype const t)
++{
++  SV* const sv = newSV(0);
++  sv_upgrade(sv, t);
++  return sv;
++}
++
++#endif
++
++#endif
++
++#if (PERL_BCDVERSION < 0x5006000)
++# define D_PPP_CONSTPV_ARG(x)  ((char *) (x))
++#else
++# define D_PPP_CONSTPV_ARG(x)  (x)
++#endif
++#ifndef newSVpvn
++#  define newSVpvn(data,len)             ((data)                                              \
++                                    ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
++                                    : newSV(0))
++#endif
++#ifndef newSVpvn_utf8
++#  define newSVpvn_utf8(s, len, u)       newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
++#endif
++#ifndef SVf_UTF8
++#  define SVf_UTF8                       0
++#endif
++
++#ifndef newSVpvn_flags
++
++#if defined(NEED_newSVpvn_flags)
++static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
++static
++#else
++extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
++#endif
++
++#ifdef newSVpvn_flags
++#  undef newSVpvn_flags
++#endif
++#define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c)
++#define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags)
++
++#if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL)
++
++SV *
++DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags)
++{
++  SV *sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len);
++  SvFLAGS(sv) |= (flags & SVf_UTF8);
++  return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv;
++}
++
++#endif
++
++#endif
++
++/* Backwards compatibility stuff... :-( */
++#if !defined(NEED_sv_2pv_flags) && defined(NEED_sv_2pv_nolen)
++#  define NEED_sv_2pv_flags
++#endif
++#if !defined(NEED_sv_2pv_flags_GLOBAL) && defined(NEED_sv_2pv_nolen_GLOBAL)
++#  define NEED_sv_2pv_flags_GLOBAL
++#endif
++
++/* Hint: sv_2pv_nolen
++ * Use the SvPV_nolen() or SvPV_nolen_const() macros instead of sv_2pv_nolen().
++ */
++#ifndef sv_2pv_nolen
++#  define sv_2pv_nolen(sv)               SvPV_nolen(sv)
++#endif
++
++#ifdef SvPVbyte
++
++/* Hint: SvPVbyte
++ * Does not work in perl-5.6.1, ppport.h implements a version
++ * borrowed from perl-5.7.3.
++ */
++
++#if (PERL_BCDVERSION < 0x5007000)
++
++#if defined(NEED_sv_2pvbyte)
++static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
++static
++#else
++extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
++#endif
++
++#ifdef sv_2pvbyte
++#  undef sv_2pvbyte
++#endif
++#define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b)
++#define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte)
++
++#if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)
++
++char *
++DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp)
++{
++  sv_utf8_downgrade(sv,0);
++  return SvPV(sv,*lp);
++}
++
++#endif
++
++/* Hint: sv_2pvbyte
++ * Use the SvPVbyte() macro instead of sv_2pvbyte().
++ */
++
++#undef SvPVbyte
++
++#define SvPVbyte(sv, lp)                                                \
++        ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK)                \
++         ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
++
++#endif
++
++#else
++
++#  define SvPVbyte          SvPV
++#  define sv_2pvbyte        sv_2pv
++
++#endif
++#ifndef sv_2pvbyte_nolen
++#  define sv_2pvbyte_nolen(sv)           sv_2pv_nolen(sv)
++#endif
++
++/* Hint: sv_pvn
++ * Always use the SvPV() macro instead of sv_pvn().
++ */
++
++/* Hint: sv_pvn_force
++ * Always use the SvPV_force() macro instead of sv_pvn_force().
++ */
++
++/* If these are undefined, they're not handled by the core anyway */
++#ifndef SV_IMMEDIATE_UNREF
++#  define SV_IMMEDIATE_UNREF             0
++#endif
++
++#ifndef SV_GMAGIC
++#  define SV_GMAGIC                      0
++#endif
++
++#ifndef SV_COW_DROP_PV
++#  define SV_COW_DROP_PV                 0
++#endif
++
++#ifndef SV_UTF8_NO_ENCODING
++#  define SV_UTF8_NO_ENCODING            0
++#endif
++
++#ifndef SV_NOSTEAL
++#  define SV_NOSTEAL                     0
++#endif
++
++#ifndef SV_CONST_RETURN
++#  define SV_CONST_RETURN                0
++#endif
++
++#ifndef SV_MUTABLE_RETURN
++#  define SV_MUTABLE_RETURN              0
++#endif
++
++#ifndef SV_SMAGIC
++#  define SV_SMAGIC                      0
++#endif
++
++#ifndef SV_HAS_TRAILING_NUL
++#  define SV_HAS_TRAILING_NUL            0
++#endif
++
++#ifndef SV_COW_SHARED_HASH_KEYS
++#  define SV_COW_SHARED_HASH_KEYS        0
++#endif
++
++#if (PERL_BCDVERSION < 0x5007002)
++
++#if defined(NEED_sv_2pv_flags)
++static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
++static
++#else
++extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
++#endif
++
++#ifdef sv_2pv_flags
++#  undef sv_2pv_flags
++#endif
++#define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c)
++#define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags)
++
++#if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL)
++
++char *
++DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
++{
++  STRLEN n_a = (STRLEN) flags;
++  return sv_2pv(sv, lp ? lp : &n_a);
++}
++
++#endif
++
++#if defined(NEED_sv_pvn_force_flags)
++static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
++static
++#else
++extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
++#endif
++
++#ifdef sv_pvn_force_flags
++#  undef sv_pvn_force_flags
++#endif
++#define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c)
++#define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags)
++
++#if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL)
++
++char *
++DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
++{
++  STRLEN n_a = (STRLEN) flags;
++  return sv_pvn_force(sv, lp ? lp : &n_a);
++}
++
++#endif
++
++#endif
++
++#if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) )
++# define DPPP_SVPV_NOLEN_LP_ARG &PL_na
++#else
++# define DPPP_SVPV_NOLEN_LP_ARG 0
++#endif
++#ifndef SvPV_const
++#  define SvPV_const(sv, lp)             SvPV_flags_const(sv, lp, SV_GMAGIC)
++#endif
++
++#ifndef SvPV_mutable
++#  define SvPV_mutable(sv, lp)           SvPV_flags_mutable(sv, lp, SV_GMAGIC)
++#endif
++#ifndef SvPV_flags
++#  define SvPV_flags(sv, lp, flags)      \
++                 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
++                  ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
++#endif
++#ifndef SvPV_flags_const
++#  define SvPV_flags_const(sv, lp, flags) \
++                 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
++                  ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
++                  (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
++#endif
++#ifndef SvPV_flags_const_nolen
++#  define SvPV_flags_const_nolen(sv, flags) \
++                 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
++                  ? SvPVX_const(sv) : \
++                  (const char*) sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
++#endif
++#ifndef SvPV_flags_mutable
++#  define SvPV_flags_mutable(sv, lp, flags) \
++                 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
++                  ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
++                  sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
++#endif
++#ifndef SvPV_force
++#  define SvPV_force(sv, lp)             SvPV_force_flags(sv, lp, SV_GMAGIC)
++#endif
++
++#ifndef SvPV_force_nolen
++#  define SvPV_force_nolen(sv)           SvPV_force_flags_nolen(sv, SV_GMAGIC)
++#endif
++
++#ifndef SvPV_force_mutable
++#  define SvPV_force_mutable(sv, lp)     SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
++#endif
++
++#ifndef SvPV_force_nomg
++#  define SvPV_force_nomg(sv, lp)        SvPV_force_flags(sv, lp, 0)
++#endif
++
++#ifndef SvPV_force_nomg_nolen
++#  define SvPV_force_nomg_nolen(sv)      SvPV_force_flags_nolen(sv, 0)
++#endif
++#ifndef SvPV_force_flags
++#  define SvPV_force_flags(sv, lp, flags) \
++                 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
++                 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
++#endif
++#ifndef SvPV_force_flags_nolen
++#  define SvPV_force_flags_nolen(sv, flags) \
++                 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
++                 ? SvPVX(sv) : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags))
++#endif
++#ifndef SvPV_force_flags_mutable
++#  define SvPV_force_flags_mutable(sv, lp, flags) \
++                 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
++                 ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \
++                  : sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
++#endif
++#ifndef SvPV_nolen
++#  define SvPV_nolen(sv)                 \
++                 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
++                  ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
++#endif
++#ifndef SvPV_nolen_const
++#  define SvPV_nolen_const(sv)           \
++                 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
++                  ? SvPVX_const(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
++#endif
++#ifndef SvPV_nomg
++#  define SvPV_nomg(sv, lp)              SvPV_flags(sv, lp, 0)
++#endif
++
++#ifndef SvPV_nomg_const
++#  define SvPV_nomg_const(sv, lp)        SvPV_flags_const(sv, lp, 0)
++#endif
++
++#ifndef SvPV_nomg_const_nolen
++#  define SvPV_nomg_const_nolen(sv)      SvPV_flags_const_nolen(sv, 0)
++#endif
++
++#ifndef SvPV_nomg_nolen
++#  define SvPV_nomg_nolen(sv)            ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
++                                    ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, 0))
++#endif
++#ifndef SvPV_renew
++#  define SvPV_renew(sv,n)               STMT_START { SvLEN_set(sv, n); \
++                 SvPV_set((sv), (char *) saferealloc(          \
++                       (Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \
++               } STMT_END
++#endif
++#ifndef SvMAGIC_set
++#  define SvMAGIC_set(sv, val)           \
++                STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
++                (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
++#endif
++
++#if (PERL_BCDVERSION < 0x5009003)
++#ifndef SvPVX_const
++#  define SvPVX_const(sv)                ((const char*) (0 + SvPVX(sv)))
++#endif
++
++#ifndef SvPVX_mutable
++#  define SvPVX_mutable(sv)              (0 + SvPVX(sv))
++#endif
++#ifndef SvRV_set
++#  define SvRV_set(sv, val)              \
++                STMT_START { assert(SvTYPE(sv) >=  SVt_RV); \
++                (((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END
++#endif
++
++#else
++#ifndef SvPVX_const
++#  define SvPVX_const(sv)                ((const char*)((sv)->sv_u.svu_pv))
++#endif
++
++#ifndef SvPVX_mutable
++#  define SvPVX_mutable(sv)              ((sv)->sv_u.svu_pv)
++#endif
++#ifndef SvRV_set
++#  define SvRV_set(sv, val)              \
++                STMT_START { assert(SvTYPE(sv) >=  SVt_RV); \
++                ((sv)->sv_u.svu_rv = (val)); } STMT_END
++#endif
++
++#endif
++#ifndef SvSTASH_set
++#  define SvSTASH_set(sv, val)           \
++                STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
++                (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
++#endif
++
++#if (PERL_BCDVERSION < 0x5004000)
++#ifndef SvUV_set
++#  define SvUV_set(sv, val)              \
++                STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
++                (((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END
++#endif
++
++#else
++#ifndef SvUV_set
++#  define SvUV_set(sv, val)              \
++                STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
++                (((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END
++#endif
++
++#endif
++
++#if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
++#if defined(NEED_vnewSVpvf)
++static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
++static
++#else
++extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
++#endif
++
++#ifdef vnewSVpvf
++#  undef vnewSVpvf
++#endif
++#define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b)
++#define Perl_vnewSVpvf DPPP_(my_vnewSVpvf)
++
++#if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL)
++
++SV *
++DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args)
++{
++  register SV *sv = newSV(0);
++  sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
++  return sv;
++}
++
++#endif
++#endif
++
++#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf)
++#  define sv_vcatpvf(sv, pat, args)  sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
++#endif
++
++#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf)
++#  define sv_vsetpvf(sv, pat, args)  sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
++#endif
++
++#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg)
++#if defined(NEED_sv_catpvf_mg)
++static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
++static
++#else
++extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
++#endif
++
++#define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg)
++
++#if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL)
++
++void
++DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
++{
++  va_list args;
++  va_start(args, pat);
++  sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
++  SvSETMAGIC(sv);
++  va_end(args);
++}
++
++#endif
++#endif
++
++#ifdef PERL_IMPLICIT_CONTEXT
++#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext)
++#if defined(NEED_sv_catpvf_mg_nocontext)
++static void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
++static
++#else
++extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
++#endif
++
++#define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
++#define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
++
++#if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL)
++
++void
++DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...)
++{
++  dTHX;
++  va_list args;
++  va_start(args, pat);
++  sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
++  SvSETMAGIC(sv);
++  va_end(args);
++}
++
++#endif
++#endif
++#endif
++
++/* sv_catpvf_mg depends on sv_catpvf_mg_nocontext */
++#ifndef sv_catpvf_mg
++#  ifdef PERL_IMPLICIT_CONTEXT
++#    define sv_catpvf_mg   Perl_sv_catpvf_mg_nocontext
++#  else
++#    define sv_catpvf_mg   Perl_sv_catpvf_mg
++#  endif
++#endif
++
++#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg)
++#  define sv_vcatpvf_mg(sv, pat, args)                                     \
++   STMT_START {                                                            \
++     sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));  \
++     SvSETMAGIC(sv);                                                       \
++   } STMT_END
++#endif
++
++#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg)
++#if defined(NEED_sv_setpvf_mg)
++static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
++static
++#else
++extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
++#endif
++
++#define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg)
++
++#if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL)
++
++void
++DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
++{
++  va_list args;
++  va_start(args, pat);
++  sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
++  SvSETMAGIC(sv);
++  va_end(args);
++}
++
++#endif
++#endif
++
++#ifdef PERL_IMPLICIT_CONTEXT
++#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext)
++#if defined(NEED_sv_setpvf_mg_nocontext)
++static void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
++static
++#else
++extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
++#endif
++
++#define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
++#define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
++
++#if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL)
++
++void
++DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...)
++{
++  dTHX;
++  va_list args;
++  va_start(args, pat);
++  sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
++  SvSETMAGIC(sv);
++  va_end(args);
++}
++
++#endif
++#endif
++#endif
++
++/* sv_setpvf_mg depends on sv_setpvf_mg_nocontext */
++#ifndef sv_setpvf_mg
++#  ifdef PERL_IMPLICIT_CONTEXT
++#    define sv_setpvf_mg   Perl_sv_setpvf_mg_nocontext
++#  else
++#    define sv_setpvf_mg   Perl_sv_setpvf_mg
++#  endif
++#endif
++
++#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg)
++#  define sv_vsetpvf_mg(sv, pat, args)                                     \
++   STMT_START {                                                            \
++     sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));  \
++     SvSETMAGIC(sv);                                                       \
++   } STMT_END
++#endif
++
++/* Hint: newSVpvn_share
++ * The SVs created by this function only mimic the behaviour of
++ * shared PVs without really being shared. Only use if you know
++ * what you're doing.
++ */
++
++#ifndef newSVpvn_share
++
++#if defined(NEED_newSVpvn_share)
++static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
++static
++#else
++extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
++#endif
++
++#ifdef newSVpvn_share
++#  undef newSVpvn_share
++#endif
++#define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c)
++#define Perl_newSVpvn_share DPPP_(my_newSVpvn_share)
++
++#if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL)
++
++SV *
++DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash)
++{
++  SV *sv;
++  if (len < 0)
++    len = -len;
++  if (!hash)
++    PERL_HASH(hash, (char*) src, len);
++  sv = newSVpvn((char *) src, len);
++  sv_upgrade(sv, SVt_PVIV);
++  SvIVX(sv) = hash;
++  SvREADONLY_on(sv);
++  SvPOK_on(sv);
++  return sv;
++}
++
++#endif
++
++#endif
++#ifndef SvSHARED_HASH
++#  define SvSHARED_HASH(sv)              (0 + SvUVX(sv))
++#endif
++#ifndef HvNAME_get
++#  define HvNAME_get(hv)                 HvNAME(hv)
++#endif
++#ifndef HvNAMELEN_get
++#  define HvNAMELEN_get(hv)              (HvNAME_get(hv) ? (I32)strlen(HvNAME_get(hv)) : 0)
++#endif
++#ifndef GvSVn
++#  define GvSVn(gv)                      GvSV(gv)
++#endif
++
++#ifndef isGV_with_GP
++#  define isGV_with_GP(gv)               isGV(gv)
++#endif
++
++#ifndef gv_fetchpvn_flags
++#  define gv_fetchpvn_flags(name, len, flags, svt) gv_fetchpv(name, flags, svt)
++#endif
++
++#ifndef gv_fetchsv
++#  define gv_fetchsv(name, flags, svt)   gv_fetchpv(SvPV_nolen_const(name), flags, svt)
++#endif
++#ifndef get_cvn_flags
++#  define get_cvn_flags(name, namelen, flags) get_cv(name, flags)
++#endif
++#ifndef WARN_ALL
++#  define WARN_ALL                       0
++#endif
++
++#ifndef WARN_CLOSURE
++#  define WARN_CLOSURE                   1
++#endif
++
++#ifndef WARN_DEPRECATED
++#  define WARN_DEPRECATED                2
++#endif
++
++#ifndef WARN_EXITING
++#  define WARN_EXITING                   3
++#endif
++
++#ifndef WARN_GLOB
++#  define WARN_GLOB                      4
++#endif
++
++#ifndef WARN_IO
++#  define WARN_IO                        5
++#endif
++
++#ifndef WARN_CLOSED
++#  define WARN_CLOSED                    6
++#endif
++
++#ifndef WARN_EXEC
++#  define WARN_EXEC                      7
++#endif
++
++#ifndef WARN_LAYER
++#  define WARN_LAYER                     8
++#endif
++
++#ifndef WARN_NEWLINE
++#  define WARN_NEWLINE                   9
++#endif
++
++#ifndef WARN_PIPE
++#  define WARN_PIPE                      10
++#endif
++
++#ifndef WARN_UNOPENED
++#  define WARN_UNOPENED                  11
++#endif
++
++#ifndef WARN_MISC
++#  define WARN_MISC                      12
++#endif
++
++#ifndef WARN_NUMERIC
++#  define WARN_NUMERIC                   13
++#endif
++
++#ifndef WARN_ONCE
++#  define WARN_ONCE                      14
++#endif
++
++#ifndef WARN_OVERFLOW
++#  define WARN_OVERFLOW                  15
++#endif
++
++#ifndef WARN_PACK
++#  define WARN_PACK                      16
++#endif
++
++#ifndef WARN_PORTABLE
++#  define WARN_PORTABLE                  17
++#endif
++
++#ifndef WARN_RECURSION
++#  define WARN_RECURSION                 18
++#endif
++
++#ifndef WARN_REDEFINE
++#  define WARN_REDEFINE                  19
++#endif
++
++#ifndef WARN_REGEXP
++#  define WARN_REGEXP                    20
++#endif
++
++#ifndef WARN_SEVERE
++#  define WARN_SEVERE                    21
++#endif
++
++#ifndef WARN_DEBUGGING
++#  define WARN_DEBUGGING                 22
++#endif
++
++#ifndef WARN_INPLACE
++#  define WARN_INPLACE                   23
++#endif
++
++#ifndef WARN_INTERNAL
++#  define WARN_INTERNAL                  24
++#endif
++
++#ifndef WARN_MALLOC
++#  define WARN_MALLOC                    25
++#endif
++
++#ifndef WARN_SIGNAL
++#  define WARN_SIGNAL                    26
++#endif
++
++#ifndef WARN_SUBSTR
++#  define WARN_SUBSTR                    27
++#endif
++
++#ifndef WARN_SYNTAX
++#  define WARN_SYNTAX                    28
++#endif
++
++#ifndef WARN_AMBIGUOUS
++#  define WARN_AMBIGUOUS                 29
++#endif
++
++#ifndef WARN_BAREWORD
++#  define WARN_BAREWORD                  30
++#endif
++
++#ifndef WARN_DIGIT
++#  define WARN_DIGIT                     31
++#endif
++
++#ifndef WARN_PARENTHESIS
++#  define WARN_PARENTHESIS               32
++#endif
++
++#ifndef WARN_PRECEDENCE
++#  define WARN_PRECEDENCE                33
++#endif
++
++#ifndef WARN_PRINTF
++#  define WARN_PRINTF                    34
++#endif
++
++#ifndef WARN_PROTOTYPE
++#  define WARN_PROTOTYPE                 35
++#endif
++
++#ifndef WARN_QW
++#  define WARN_QW                        36
++#endif
++
++#ifndef WARN_RESERVED
++#  define WARN_RESERVED                  37
++#endif
++
++#ifndef WARN_SEMICOLON
++#  define WARN_SEMICOLON                 38
++#endif
++
++#ifndef WARN_TAINT
++#  define WARN_TAINT                     39
++#endif
++
++#ifndef WARN_THREADS
++#  define WARN_THREADS                   40
++#endif
++
++#ifndef WARN_UNINITIALIZED
++#  define WARN_UNINITIALIZED             41
++#endif
++
++#ifndef WARN_UNPACK
++#  define WARN_UNPACK                    42
++#endif
++
++#ifndef WARN_UNTIE
++#  define WARN_UNTIE                     43
++#endif
++
++#ifndef WARN_UTF8
++#  define WARN_UTF8                      44
++#endif
++
++#ifndef WARN_VOID
++#  define WARN_VOID                      45
++#endif
++
++#ifndef WARN_ASSERTIONS
++#  define WARN_ASSERTIONS                46
++#endif
++#ifndef packWARN
++#  define packWARN(a)                    (a)
++#endif
++
++#ifndef ckWARN
++#  ifdef G_WARN_ON
++#    define  ckWARN(a)                  (PL_dowarn & G_WARN_ON)
++#  else
++#    define  ckWARN(a)                  PL_dowarn
++#  endif
++#endif
++
++#if (PERL_BCDVERSION >= 0x5004000) && !defined(warner)
++#if defined(NEED_warner)
++static void DPPP_(my_warner)(U32 err, const char *pat, ...);
++static
++#else
++extern void DPPP_(my_warner)(U32 err, const char *pat, ...);
++#endif
++
++#define Perl_warner DPPP_(my_warner)
++
++#if defined(NEED_warner) || defined(NEED_warner_GLOBAL)
++
++void
++DPPP_(my_warner)(U32 err, const char *pat, ...)
++{
++  SV *sv;
++  va_list args;
++
++  PERL_UNUSED_ARG(err);
++
++  va_start(args, pat);
++  sv = vnewSVpvf(pat, &args);
++  va_end(args);
++  sv_2mortal(sv);
++  warn("%s", SvPV_nolen(sv));
++}
++
++#define warner  Perl_warner
++
++#define Perl_warner_nocontext  Perl_warner
++
++#endif
++#endif
++
++/* concatenating with "" ensures that only literal strings are accepted as argument
++ * note that STR_WITH_LEN() can't be used as argument to macros or functions that
++ * under some configurations might be macros
++ */
++#ifndef STR_WITH_LEN
++#  define STR_WITH_LEN(s)                (s ""), (sizeof(s)-1)
++#endif
++#ifndef newSVpvs
++#  define newSVpvs(str)                  newSVpvn(str "", sizeof(str) - 1)
++#endif
++
++#ifndef newSVpvs_flags
++#  define newSVpvs_flags(str, flags)     newSVpvn_flags(str "", sizeof(str) - 1, flags)
++#endif
++
++#ifndef newSVpvs_share
++#  define newSVpvs_share(str)            newSVpvn_share(str "", sizeof(str) - 1, 0)
++#endif
++
++#ifndef sv_catpvs
++#  define sv_catpvs(sv, str)             sv_catpvn(sv, str "", sizeof(str) - 1)
++#endif
++
++#ifndef sv_setpvs
++#  define sv_setpvs(sv, str)             sv_setpvn(sv, str "", sizeof(str) - 1)
++#endif
++
++#ifndef hv_fetchs
++#  define hv_fetchs(hv, key, lval)       hv_fetch(hv, key "", sizeof(key) - 1, lval)
++#endif
++
++#ifndef hv_stores
++#  define hv_stores(hv, key, val)        hv_store(hv, key "", sizeof(key) - 1, val, 0)
++#endif
++#ifndef gv_fetchpvs
++#  define gv_fetchpvs(name, flags, svt)  gv_fetchpvn_flags(name "", sizeof(name) - 1, flags, svt)
++#endif
++
++#ifndef gv_stashpvs
++#  define gv_stashpvs(name, flags)       gv_stashpvn(name "", sizeof(name) - 1, flags)
++#endif
++#ifndef get_cvs
++#  define get_cvs(name, flags)           get_cvn_flags(name "", sizeof(name)-1, flags)
++#endif
++#ifndef SvGETMAGIC
++#  define SvGETMAGIC(x)                  STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END
++#endif
++#ifndef PERL_MAGIC_sv
++#  define PERL_MAGIC_sv                  '\0'
++#endif
++
++#ifndef PERL_MAGIC_overload
++#  define PERL_MAGIC_overload            'A'
++#endif
++
++#ifndef PERL_MAGIC_overload_elem
++#  define PERL_MAGIC_overload_elem       'a'
++#endif
++
++#ifndef PERL_MAGIC_overload_table
++#  define PERL_MAGIC_overload_table      'c'
++#endif
++
++#ifndef PERL_MAGIC_bm
++#  define PERL_MAGIC_bm                  'B'
++#endif
++
++#ifndef PERL_MAGIC_regdata
++#  define PERL_MAGIC_regdata             'D'
++#endif
++
++#ifndef PERL_MAGIC_regdatum
++#  define PERL_MAGIC_regdatum            'd'
++#endif
++
++#ifndef PERL_MAGIC_env
++#  define PERL_MAGIC_env                 'E'
++#endif
++
++#ifndef PERL_MAGIC_envelem
++#  define PERL_MAGIC_envelem             'e'
++#endif
++
++#ifndef PERL_MAGIC_fm
++#  define PERL_MAGIC_fm                  'f'
++#endif
++
++#ifndef PERL_MAGIC_regex_global
++#  define PERL_MAGIC_regex_global        'g'
++#endif
++
++#ifndef PERL_MAGIC_isa
++#  define PERL_MAGIC_isa                 'I'
++#endif
++
++#ifndef PERL_MAGIC_isaelem
++#  define PERL_MAGIC_isaelem             'i'
++#endif
++
++#ifndef PERL_MAGIC_nkeys
++#  define PERL_MAGIC_nkeys               'k'
++#endif
++
++#ifndef PERL_MAGIC_dbfile
++#  define PERL_MAGIC_dbfile              'L'
++#endif
++
++#ifndef PERL_MAGIC_dbline
++#  define PERL_MAGIC_dbline              'l'
++#endif
++
++#ifndef PERL_MAGIC_mutex
++#  define PERL_MAGIC_mutex               'm'
++#endif
++
++#ifndef PERL_MAGIC_shared
++#  define PERL_MAGIC_shared              'N'
++#endif
++
++#ifndef PERL_MAGIC_shared_scalar
++#  define PERL_MAGIC_shared_scalar       'n'
++#endif
++
++#ifndef PERL_MAGIC_collxfrm
++#  define PERL_MAGIC_collxfrm            'o'
++#endif
++
++#ifndef PERL_MAGIC_tied
++#  define PERL_MAGIC_tied                'P'
++#endif
++
++#ifndef PERL_MAGIC_tiedelem
++#  define PERL_MAGIC_tiedelem            'p'
++#endif
++
++#ifndef PERL_MAGIC_tiedscalar
++#  define PERL_MAGIC_tiedscalar          'q'
++#endif
++
++#ifndef PERL_MAGIC_qr
++#  define PERL_MAGIC_qr                  'r'
++#endif
++
++#ifndef PERL_MAGIC_sig
++#  define PERL_MAGIC_sig                 'S'
++#endif
++
++#ifndef PERL_MAGIC_sigelem
++#  define PERL_MAGIC_sigelem             's'
++#endif
++
++#ifndef PERL_MAGIC_taint
++#  define PERL_MAGIC_taint               't'
++#endif
++
++#ifndef PERL_MAGIC_uvar
++#  define PERL_MAGIC_uvar                'U'
++#endif
++
++#ifndef PERL_MAGIC_uvar_elem
++#  define PERL_MAGIC_uvar_elem           'u'
++#endif
++
++#ifndef PERL_MAGIC_vstring
++#  define PERL_MAGIC_vstring             'V'
++#endif
++
++#ifndef PERL_MAGIC_vec
++#  define PERL_MAGIC_vec                 'v'
++#endif
++
++#ifndef PERL_MAGIC_utf8
++#  define PERL_MAGIC_utf8                'w'
++#endif
++
++#ifndef PERL_MAGIC_substr
++#  define PERL_MAGIC_substr              'x'
++#endif
++
++#ifndef PERL_MAGIC_defelem
++#  define PERL_MAGIC_defelem             'y'
++#endif
++
++#ifndef PERL_MAGIC_glob
++#  define PERL_MAGIC_glob                '*'
++#endif
++
++#ifndef PERL_MAGIC_arylen
++#  define PERL_MAGIC_arylen              '#'
++#endif
++
++#ifndef PERL_MAGIC_pos
++#  define PERL_MAGIC_pos                 '.'
++#endif
++
++#ifndef PERL_MAGIC_backref
++#  define PERL_MAGIC_backref             '<'
++#endif
++
++#ifndef PERL_MAGIC_ext
++#  define PERL_MAGIC_ext                 '~'
++#endif
++
++/* That's the best we can do... */
++#ifndef sv_catpvn_nomg
++#  define sv_catpvn_nomg                 sv_catpvn
++#endif
++
++#ifndef sv_catsv_nomg
++#  define sv_catsv_nomg                  sv_catsv
++#endif
++
++#ifndef sv_setsv_nomg
++#  define sv_setsv_nomg                  sv_setsv
++#endif
++
++#ifndef sv_pvn_nomg
++#  define sv_pvn_nomg                    sv_pvn
++#endif
++
++#ifndef SvIV_nomg
++#  define SvIV_nomg                      SvIV
++#endif
++
++#ifndef SvUV_nomg
++#  define SvUV_nomg                      SvUV
++#endif
++
++#ifndef sv_catpv_mg
++#  define sv_catpv_mg(sv, ptr)          \
++   STMT_START {                         \
++     SV *TeMpSv = sv;                   \
++     sv_catpv(TeMpSv,ptr);              \
++     SvSETMAGIC(TeMpSv);                \
++   } STMT_END
++#endif
++
++#ifndef sv_catpvn_mg
++#  define sv_catpvn_mg(sv, ptr, len)    \
++   STMT_START {                         \
++     SV *TeMpSv = sv;                   \
++     sv_catpvn(TeMpSv,ptr,len);         \
++     SvSETMAGIC(TeMpSv);                \
++   } STMT_END
++#endif
++
++#ifndef sv_catsv_mg
++#  define sv_catsv_mg(dsv, ssv)         \
++   STMT_START {                         \
++     SV *TeMpSv = dsv;                  \
++     sv_catsv(TeMpSv,ssv);              \
++     SvSETMAGIC(TeMpSv);                \
++   } STMT_END
++#endif
++
++#ifndef sv_setiv_mg
++#  define sv_setiv_mg(sv, i)            \
++   STMT_START {                         \
++     SV *TeMpSv = sv;                   \
++     sv_setiv(TeMpSv,i);                \
++     SvSETMAGIC(TeMpSv);                \
++   } STMT_END
++#endif
++
++#ifndef sv_setnv_mg
++#  define sv_setnv_mg(sv, num)          \
++   STMT_START {                         \
++     SV *TeMpSv = sv;                   \
++     sv_setnv(TeMpSv,num);              \
++     SvSETMAGIC(TeMpSv);                \
++   } STMT_END
++#endif
++
++#ifndef sv_setpv_mg
++#  define sv_setpv_mg(sv, ptr)          \
++   STMT_START {                         \
++     SV *TeMpSv = sv;                   \
++     sv_setpv(TeMpSv,ptr);              \
++     SvSETMAGIC(TeMpSv);                \
++   } STMT_END
++#endif
++
++#ifndef sv_setpvn_mg
++#  define sv_setpvn_mg(sv, ptr, len)    \
++   STMT_START {                         \
++     SV *TeMpSv = sv;                   \
++     sv_setpvn(TeMpSv,ptr,len);         \
++     SvSETMAGIC(TeMpSv);                \
++   } STMT_END
++#endif
++
++#ifndef sv_setsv_mg
++#  define sv_setsv_mg(dsv, ssv)         \
++   STMT_START {                         \
++     SV *TeMpSv = dsv;                  \
++     sv_setsv(TeMpSv,ssv);              \
++     SvSETMAGIC(TeMpSv);                \
++   } STMT_END
++#endif
++
++#ifndef sv_setuv_mg
++#  define sv_setuv_mg(sv, i)            \
++   STMT_START {                         \
++     SV *TeMpSv = sv;                   \
++     sv_setuv(TeMpSv,i);                \
++     SvSETMAGIC(TeMpSv);                \
++   } STMT_END
++#endif
++
++#ifndef sv_usepvn_mg
++#  define sv_usepvn_mg(sv, ptr, len)    \
++   STMT_START {                         \
++     SV *TeMpSv = sv;                   \
++     sv_usepvn(TeMpSv,ptr,len);         \
++     SvSETMAGIC(TeMpSv);                \
++   } STMT_END
++#endif
++#ifndef SvVSTRING_mg
++#  define SvVSTRING_mg(sv)               (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL)
++#endif
++
++/* Hint: sv_magic_portable
++ * This is a compatibility function that is only available with
++ * Devel::PPPort. It is NOT in the perl core.
++ * Its purpose is to mimic the 5.8.0 behaviour of sv_magic() when
++ * it is being passed a name pointer with namlen == 0. In that
++ * case, perl 5.8.0 and later store the pointer, not a copy of it.
++ * The compatibility can be provided back to perl 5.004. With
++ * earlier versions, the code will not compile.
++ */
++
++#if (PERL_BCDVERSION < 0x5004000)
++
++  /* code that uses sv_magic_portable will not compile */
++
++#elif (PERL_BCDVERSION < 0x5008000)
++
++#  define sv_magic_portable(sv, obj, how, name, namlen)     \
++   STMT_START {                                             \
++     SV *SvMp_sv = (sv);                                    \
++     char *SvMp_name = (char *) (name);                     \
++     I32 SvMp_namlen = (namlen);                            \
++     if (SvMp_name && SvMp_namlen == 0)                     \
++     {                                                      \
++       MAGIC *mg;                                           \
++       sv_magic(SvMp_sv, obj, how, 0, 0);                   \
++       mg = SvMAGIC(SvMp_sv);                               \
++       mg->mg_len = -42; /* XXX: this is the tricky part */ \
++       mg->mg_ptr = SvMp_name;                              \
++     }                                                      \
++     else                                                   \
++     {                                                      \
++       sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \
++     }                                                      \
++   } STMT_END
++
++#else
++
++#  define sv_magic_portable(a, b, c, d, e)  sv_magic(a, b, c, d, e)
++
++#endif
++
++#ifdef USE_ITHREADS
++#ifndef CopFILE
++#  define CopFILE(c)                     ((c)->cop_file)
++#endif
++
++#ifndef CopFILEGV
++#  define CopFILEGV(c)                   (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv)
++#endif
++
++#ifndef CopFILE_set
++#  define CopFILE_set(c,pv)              ((c)->cop_file = savepv(pv))
++#endif
++
++#ifndef CopFILESV
++#  define CopFILESV(c)                   (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
++#endif
++
++#ifndef CopFILEAV
++#  define CopFILEAV(c)                   (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
++#endif
++
++#ifndef CopSTASHPV
++#  define CopSTASHPV(c)                  ((c)->cop_stashpv)
++#endif
++
++#ifndef CopSTASHPV_set
++#  define CopSTASHPV_set(c,pv)           ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch))
++#endif
++
++#ifndef CopSTASH
++#  define CopSTASH(c)                    (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
++#endif
++
++#ifndef CopSTASH_set
++#  define CopSTASH_set(c,hv)             CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch)
++#endif
++
++#ifndef CopSTASH_eq
++#  define CopSTASH_eq(c,hv)              ((hv) && (CopSTASHPV(c) == HvNAME(hv) \
++                                        || (CopSTASHPV(c) && HvNAME(hv) \
++                                        && strEQ(CopSTASHPV(c), HvNAME(hv)))))
++#endif
++
++#else
++#ifndef CopFILEGV
++#  define CopFILEGV(c)                   ((c)->cop_filegv)
++#endif
++
++#ifndef CopFILEGV_set
++#  define CopFILEGV_set(c,gv)            ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
++#endif
++
++#ifndef CopFILE_set
++#  define CopFILE_set(c,pv)              CopFILEGV_set((c), gv_fetchfile(pv))
++#endif
++
++#ifndef CopFILESV
++#  define CopFILESV(c)                   (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
++#endif
++
++#ifndef CopFILEAV
++#  define CopFILEAV(c)                   (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
++#endif
++
++#ifndef CopFILE
++#  define CopFILE(c)                     (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
++#endif
++
++#ifndef CopSTASH
++#  define CopSTASH(c)                    ((c)->cop_stash)
++#endif
++
++#ifndef CopSTASH_set
++#  define CopSTASH_set(c,hv)             ((c)->cop_stash = (hv))
++#endif
++
++#ifndef CopSTASHPV
++#  define CopSTASHPV(c)                  (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
++#endif
++
++#ifndef CopSTASHPV_set
++#  define CopSTASHPV_set(c,pv)           CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
++#endif
++
++#ifndef CopSTASH_eq
++#  define CopSTASH_eq(c,hv)              (CopSTASH(c) == (hv))
++#endif
++
++#endif /* USE_ITHREADS */
++#ifndef IN_PERL_COMPILETIME
++#  define IN_PERL_COMPILETIME            (PL_curcop == &PL_compiling)
++#endif
++
++#ifndef IN_LOCALE_RUNTIME
++#  define IN_LOCALE_RUNTIME              (PL_curcop->op_private & HINT_LOCALE)
++#endif
++
++#ifndef IN_LOCALE_COMPILETIME
++#  define IN_LOCALE_COMPILETIME          (PL_hints & HINT_LOCALE)
++#endif
++
++#ifndef IN_LOCALE
++#  define IN_LOCALE                      (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
++#endif
++#ifndef IS_NUMBER_IN_UV
++#  define IS_NUMBER_IN_UV                0x01
++#endif
++
++#ifndef IS_NUMBER_GREATER_THAN_UV_MAX
++#  define IS_NUMBER_GREATER_THAN_UV_MAX  0x02
++#endif
++
++#ifndef IS_NUMBER_NOT_INT
++#  define IS_NUMBER_NOT_INT              0x04
++#endif
++
++#ifndef IS_NUMBER_NEG
++#  define IS_NUMBER_NEG                  0x08
++#endif
++
++#ifndef IS_NUMBER_INFINITY
++#  define IS_NUMBER_INFINITY             0x10
++#endif
++
++#ifndef IS_NUMBER_NAN
++#  define IS_NUMBER_NAN                  0x20
++#endif
++#ifndef GROK_NUMERIC_RADIX
++#  define GROK_NUMERIC_RADIX(sp, send)   grok_numeric_radix(sp, send)
++#endif
++#ifndef PERL_SCAN_GREATER_THAN_UV_MAX
++#  define PERL_SCAN_GREATER_THAN_UV_MAX  0x02
++#endif
++
++#ifndef PERL_SCAN_SILENT_ILLDIGIT
++#  define PERL_SCAN_SILENT_ILLDIGIT      0x04
++#endif
++
++#ifndef PERL_SCAN_ALLOW_UNDERSCORES
++#  define PERL_SCAN_ALLOW_UNDERSCORES    0x01
++#endif
++
++#ifndef PERL_SCAN_DISALLOW_PREFIX
++#  define PERL_SCAN_DISALLOW_PREFIX      0x02
++#endif
++
++#ifndef grok_numeric_radix
++#if defined(NEED_grok_numeric_radix)
++static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
++static
++#else
++extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
++#endif
++
++#ifdef grok_numeric_radix
++#  undef grok_numeric_radix
++#endif
++#define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b)
++#define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix)
++
++#if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL)
++bool
++DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send)
++{
++#ifdef USE_LOCALE_NUMERIC
++#ifdef PL_numeric_radix_sv
++    if (PL_numeric_radix_sv && IN_LOCALE) {
++        STRLEN len;
++        char* radix = SvPV(PL_numeric_radix_sv, len);
++        if (*sp + len <= send && memEQ(*sp, radix, len)) {
++            *sp += len;
++            return TRUE;
++        }
++    }
++#else
++    /* older perls don't have PL_numeric_radix_sv so the radix
++     * must manually be requested from locale.h
++     */
++#include <locale.h>
++    dTHR;  /* needed for older threaded perls */
++    struct lconv *lc = localeconv();
++    char *radix = lc->decimal_point;
++    if (radix && IN_LOCALE) {
++        STRLEN len = strlen(radix);
++        if (*sp + len <= send && memEQ(*sp, radix, len)) {
++            *sp += len;
++            return TRUE;
++        }
++    }
++#endif
++#endif /* USE_LOCALE_NUMERIC */
++    /* always try "." if numeric radix didn't match because
++     * we may have data from different locales mixed */
++    if (*sp < send && **sp == '.') {
++        ++*sp;
++        return TRUE;
++    }
++    return FALSE;
++}
++#endif
++#endif
++
++#ifndef grok_number
++#if defined(NEED_grok_number)
++static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
++static
++#else
++extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
++#endif
++
++#ifdef grok_number
++#  undef grok_number
++#endif
++#define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c)
++#define Perl_grok_number DPPP_(my_grok_number)
++
++#if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL)
++int
++DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep)
++{
++  const char *s = pv;
++  const char *send = pv + len;
++  const UV max_div_10 = UV_MAX / 10;
++  const char max_mod_10 = UV_MAX % 10;
++  int numtype = 0;
++  int sawinf = 0;
++  int sawnan = 0;
++
++  while (s < send && isSPACE(*s))
++    s++;
++  if (s == send) {
++    return 0;
++  } else if (*s == '-') {
++    s++;
++    numtype = IS_NUMBER_NEG;
++  }
++  else if (*s == '+')
++  s++;
++
++  if (s == send)
++    return 0;
++
++  /* next must be digit or the radix separator or beginning of infinity */
++  if (isDIGIT(*s)) {
++    /* UVs are at least 32 bits, so the first 9 decimal digits cannot
++       overflow.  */
++    UV value = *s - '0';
++    /* This construction seems to be more optimiser friendly.
++       (without it gcc does the isDIGIT test and the *s - '0' separately)
++       With it gcc on arm is managing 6 instructions (6 cycles) per digit.
++       In theory the optimiser could deduce how far to unroll the loop
++       before checking for overflow.  */
++    if (++s < send) {
++      int digit = *s - '0';
++      if (digit >= 0 && digit <= 9) {
++        value = value * 10 + digit;
++        if (++s < send) {
++          digit = *s - '0';
++          if (digit >= 0 && digit <= 9) {
++            value = value * 10 + digit;
++            if (++s < send) {
++              digit = *s - '0';
++              if (digit >= 0 && digit <= 9) {
++                value = value * 10 + digit;
++                if (++s < send) {
++                  digit = *s - '0';
++                  if (digit >= 0 && digit <= 9) {
++                    value = value * 10 + digit;
++                    if (++s < send) {
++                      digit = *s - '0';
++                      if (digit >= 0 && digit <= 9) {
++                        value = value * 10 + digit;
++                        if (++s < send) {
++                          digit = *s - '0';
++                          if (digit >= 0 && digit <= 9) {
++                            value = value * 10 + digit;
++                            if (++s < send) {
++                              digit = *s - '0';
++                              if (digit >= 0 && digit <= 9) {
++                                value = value * 10 + digit;
++                                if (++s < send) {
++                                  digit = *s - '0';
++                                  if (digit >= 0 && digit <= 9) {
++                                    value = value * 10 + digit;
++                                    if (++s < send) {
++                                      /* Now got 9 digits, so need to check
++                                         each time for overflow.  */
++                                      digit = *s - '0';
++                                      while (digit >= 0 && digit <= 9
++                                             && (value < max_div_10
++                                                 || (value == max_div_10
++                                                     && digit <= max_mod_10))) {
++                                        value = value * 10 + digit;
++                                        if (++s < send)
++                                          digit = *s - '0';
++                                        else
++                                          break;
++                                      }
++                                      if (digit >= 0 && digit <= 9
++                                          && (s < send)) {
++                                        /* value overflowed.
++                                           skip the remaining digits, don't
++                                           worry about setting *valuep.  */
++                                        do {
++                                          s++;
++                                        } while (s < send && isDIGIT(*s));
++                                        numtype |=
++                                          IS_NUMBER_GREATER_THAN_UV_MAX;
++                                        goto skip_value;
++                                      }
++                                    }
++                                  }
++                                }
++                              }
++                            }
++                          }
++                        }
++                      }
++                    }
++                  }
++                }
++              }
++            }
++          }
++        }
++      }
++    }
++    numtype |= IS_NUMBER_IN_UV;
++    if (valuep)
++      *valuep = value;
++
++  skip_value:
++    if (GROK_NUMERIC_RADIX(&s, send)) {
++      numtype |= IS_NUMBER_NOT_INT;
++      while (s < send && isDIGIT(*s))  /* optional digits after the radix */
++        s++;
++    }
++  }
++  else if (GROK_NUMERIC_RADIX(&s, send)) {
++    numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; /* valuep assigned below */
++    /* no digits before the radix means we need digits after it */
++    if (s < send && isDIGIT(*s)) {
++      do {
++        s++;
++      } while (s < send && isDIGIT(*s));
++      if (valuep) {
++        /* integer approximation is valid - it's 0.  */
++        *valuep = 0;
++      }
++    }
++    else
++      return 0;
++  } else if (*s == 'I' || *s == 'i') {
++    s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
++    s++; if (s == send || (*s != 'F' && *s != 'f')) return 0;
++    s++; if (s < send && (*s == 'I' || *s == 'i')) {
++      s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
++      s++; if (s == send || (*s != 'I' && *s != 'i')) return 0;
++      s++; if (s == send || (*s != 'T' && *s != 't')) return 0;
++      s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
++      s++;
++    }
++    sawinf = 1;
++  } else if (*s == 'N' || *s == 'n') {
++    /* XXX TODO: There are signaling NaNs and quiet NaNs. */
++    s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
++    s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
++    s++;
++    sawnan = 1;
++  } else
++    return 0;
++
++  if (sawinf) {
++    numtype &= IS_NUMBER_NEG; /* Keep track of sign  */
++    numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT;
++  } else if (sawnan) {
++    numtype &= IS_NUMBER_NEG; /* Keep track of sign  */
++    numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT;
++  } else if (s < send) {
++    /* we can have an optional exponent part */
++    if (*s == 'e' || *s == 'E') {
++      /* The only flag we keep is sign.  Blow away any "it's UV"  */
++      numtype &= IS_NUMBER_NEG;
++      numtype |= IS_NUMBER_NOT_INT;
++      s++;
++      if (s < send && (*s == '-' || *s == '+'))
++        s++;
++      if (s < send && isDIGIT(*s)) {
++        do {
++          s++;
++        } while (s < send && isDIGIT(*s));
++      }
++      else
++      return 0;
++    }
++  }
++  while (s < send && isSPACE(*s))
++    s++;
++  if (s >= send)
++    return numtype;
++  if (len == 10 && memEQ(pv, "0 but true", 10)) {
++    if (valuep)
++      *valuep = 0;
++    return IS_NUMBER_IN_UV;
++  }
++  return 0;
++}
++#endif
++#endif
++
++/*
++ * The grok_* routines have been modified to use warn() instead of
++ * Perl_warner(). Also, 'hexdigit' was the former name of PL_hexdigit,
++ * which is why the stack variable has been renamed to 'xdigit'.
++ */
++
++#ifndef grok_bin
++#if defined(NEED_grok_bin)
++static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
++static
++#else
++extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
++#endif
++
++#ifdef grok_bin
++#  undef grok_bin
++#endif
++#define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d)
++#define Perl_grok_bin DPPP_(my_grok_bin)
++
++#if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL)
++UV
++DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
++{
++    const char *s = start;
++    STRLEN len = *len_p;
++    UV value = 0;
++    NV value_nv = 0;
++
++    const UV max_div_2 = UV_MAX / 2;
++    bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
++    bool overflowed = FALSE;
++
++    if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
++        /* strip off leading b or 0b.
++           for compatibility silently suffer "b" and "0b" as valid binary
++           numbers. */
++        if (len >= 1) {
++            if (s[0] == 'b') {
++                s++;
++                len--;
++            }
++            else if (len >= 2 && s[0] == '0' && s[1] == 'b') {
++                s+=2;
++                len-=2;
++            }
++        }
++    }
++
++    for (; len-- && *s; s++) {
++        char bit = *s;
++        if (bit == '0' || bit == '1') {
++            /* Write it in this wonky order with a goto to attempt to get the
++               compiler to make the common case integer-only loop pretty tight.
++               With gcc seems to be much straighter code than old scan_bin.  */
++          redo:
++            if (!overflowed) {
++                if (value <= max_div_2) {
++                    value = (value << 1) | (bit - '0');
++                    continue;
++                }
++                /* Bah. We're just overflowed.  */
++                warn("Integer overflow in binary number");
++                overflowed = TRUE;
++                value_nv = (NV) value;
++            }
++            value_nv *= 2.0;
++            /* If an NV has not enough bits in its mantissa to
++             * represent a UV this summing of small low-order numbers
++             * is a waste of time (because the NV cannot preserve
++             * the low-order bits anyway): we could just remember when
++             * did we overflow and in the end just multiply value_nv by the
++             * right amount. */
++            value_nv += (NV)(bit - '0');
++            continue;
++        }
++        if (bit == '_' && len && allow_underscores && (bit = s[1])
++            && (bit == '0' || bit == '1'))
++            {
++                --len;
++                ++s;
++                goto redo;
++            }
++        if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
++            warn("Illegal binary digit '%c' ignored", *s);
++        break;
++    }
++
++    if (   ( overflowed && value_nv > 4294967295.0)
++#if UVSIZE > 4
++        || (!overflowed && value > 0xffffffff  )
++#endif
++        ) {
++        warn("Binary number > 0b11111111111111111111111111111111 non-portable");
++    }
++    *len_p = s - start;
++    if (!overflowed) {
++        *flags = 0;
++        return value;
++    }
++    *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
++    if (result)
++        *result = value_nv;
++    return UV_MAX;
++}
++#endif
++#endif
++
++#ifndef grok_hex
++#if defined(NEED_grok_hex)
++static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
++static
++#else
++extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
++#endif
++
++#ifdef grok_hex
++#  undef grok_hex
++#endif
++#define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d)
++#define Perl_grok_hex DPPP_(my_grok_hex)
++
++#if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL)
++UV
++DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
++{
++    const char *s = start;
++    STRLEN len = *len_p;
++    UV value = 0;
++    NV value_nv = 0;
++
++    const UV max_div_16 = UV_MAX / 16;
++    bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
++    bool overflowed = FALSE;
++    const char *xdigit;
++
++    if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
++        /* strip off leading x or 0x.
++           for compatibility silently suffer "x" and "0x" as valid hex numbers.
++        */
++        if (len >= 1) {
++            if (s[0] == 'x') {
++                s++;
++                len--;
++            }
++            else if (len >= 2 && s[0] == '0' && s[1] == 'x') {
++                s+=2;
++                len-=2;
++            }
++        }
++    }
++
++    for (; len-- && *s; s++) {
++        xdigit = strchr((char *) PL_hexdigit, *s);
++        if (xdigit) {
++            /* Write it in this wonky order with a goto to attempt to get the
++               compiler to make the common case integer-only loop pretty tight.
++               With gcc seems to be much straighter code than old scan_hex.  */
++          redo:
++            if (!overflowed) {
++                if (value <= max_div_16) {
++                    value = (value << 4) | ((xdigit - PL_hexdigit) & 15);
++                    continue;
++                }
++                warn("Integer overflow in hexadecimal number");
++                overflowed = TRUE;
++                value_nv = (NV) value;
++            }
++            value_nv *= 16.0;
++            /* If an NV has not enough bits in its mantissa to
++             * represent a UV this summing of small low-order numbers
++             * is a waste of time (because the NV cannot preserve
++             * the low-order bits anyway): we could just remember when
++             * did we overflow and in the end just multiply value_nv by the
++             * right amount of 16-tuples. */
++            value_nv += (NV)((xdigit - PL_hexdigit) & 15);
++            continue;
++        }
++        if (*s == '_' && len && allow_underscores && s[1]
++                && (xdigit = strchr((char *) PL_hexdigit, s[1])))
++            {
++                --len;
++                ++s;
++                goto redo;
++            }
++        if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
++            warn("Illegal hexadecimal digit '%c' ignored", *s);
++        break;
++    }
++
++    if (   ( overflowed && value_nv > 4294967295.0)
++#if UVSIZE > 4
++        || (!overflowed && value > 0xffffffff  )
++#endif
++        ) {
++        warn("Hexadecimal number > 0xffffffff non-portable");
++    }
++    *len_p = s - start;
++    if (!overflowed) {
++        *flags = 0;
++        return value;
++    }
++    *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
++    if (result)
++        *result = value_nv;
++    return UV_MAX;
++}
++#endif
++#endif
++
++#ifndef grok_oct
++#if defined(NEED_grok_oct)
++static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
++static
++#else
++extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
++#endif
++
++#ifdef grok_oct
++#  undef grok_oct
++#endif
++#define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d)
++#define Perl_grok_oct DPPP_(my_grok_oct)
++
++#if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL)
++UV
++DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
++{
++    const char *s = start;
++    STRLEN len = *len_p;
++    UV value = 0;
++    NV value_nv = 0;
++
++    const UV max_div_8 = UV_MAX / 8;
++    bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
++    bool overflowed = FALSE;
++
++    for (; len-- && *s; s++) {
++         /* gcc 2.95 optimiser not smart enough to figure that this subtraction
++            out front allows slicker code.  */
++        int digit = *s - '0';
++        if (digit >= 0 && digit <= 7) {
++            /* Write it in this wonky order with a goto to attempt to get the
++               compiler to make the common case integer-only loop pretty tight.
++            */
++          redo:
++            if (!overflowed) {
++                if (value <= max_div_8) {
++                    value = (value << 3) | digit;
++                    continue;
++                }
++                /* Bah. We're just overflowed.  */
++                warn("Integer overflow in octal number");
++                overflowed = TRUE;
++                value_nv = (NV) value;
++            }
++            value_nv *= 8.0;
++            /* If an NV has not enough bits in its mantissa to
++             * represent a UV this summing of small low-order numbers
++             * is a waste of time (because the NV cannot preserve
++             * the low-order bits anyway): we could just remember when
++             * did we overflow and in the end just multiply value_nv by the
++             * right amount of 8-tuples. */
++            value_nv += (NV)digit;
++            continue;
++        }
++        if (digit == ('_' - '0') && len && allow_underscores
++            && (digit = s[1] - '0') && (digit >= 0 && digit <= 7))
++            {
++                --len;
++                ++s;
++                goto redo;
++            }
++        /* Allow \octal to work the DWIM way (that is, stop scanning
++         * as soon as non-octal characters are seen, complain only iff
++         * someone seems to want to use the digits eight and nine). */
++        if (digit == 8 || digit == 9) {
++            if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
++                warn("Illegal octal digit '%c' ignored", *s);
++        }
++        break;
++    }
++
++    if (   ( overflowed && value_nv > 4294967295.0)
++#if UVSIZE > 4
++        || (!overflowed && value > 0xffffffff  )
++#endif
++        ) {
++        warn("Octal number > 037777777777 non-portable");
++    }
++    *len_p = s - start;
++    if (!overflowed) {
++        *flags = 0;
++        return value;
++    }
++    *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
++    if (result)
++        *result = value_nv;
++    return UV_MAX;
++}
++#endif
++#endif
++
++#if !defined(my_snprintf)
++#if defined(NEED_my_snprintf)
++static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
++static
++#else
++extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
++#endif
++
++#define my_snprintf DPPP_(my_my_snprintf)
++#define Perl_my_snprintf DPPP_(my_my_snprintf)
++
++#if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL)
++
++int
++DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...)
++{
++    dTHX;
++    int retval;
++    va_list ap;
++    va_start(ap, format);
++#ifdef HAS_VSNPRINTF
++    retval = vsnprintf(buffer, len, format, ap);
++#else
++    retval = vsprintf(buffer, format, ap);
++#endif
++    va_end(ap);
++    if (retval < 0 || (len > 0 && (Size_t)retval >= len))
++        Perl_croak(aTHX_ "panic: my_snprintf buffer overflow");
++    return retval;
++}
++
++#endif
++#endif
++
++#if !defined(my_sprintf)
++#if defined(NEED_my_sprintf)
++static int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
++static
++#else
++extern int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
++#endif
++
++#define my_sprintf DPPP_(my_my_sprintf)
++#define Perl_my_sprintf DPPP_(my_my_sprintf)
++
++#if defined(NEED_my_sprintf) || defined(NEED_my_sprintf_GLOBAL)
++
++int
++DPPP_(my_my_sprintf)(char *buffer, const char* pat, ...)
++{
++    va_list args;
++    va_start(args, pat);
++    vsprintf(buffer, pat, args);
++    va_end(args);
++    return strlen(buffer);
++}
++
++#endif
++#endif
++
++#ifdef NO_XSLOCKS
++#  ifdef dJMPENV
++#    define dXCPT             dJMPENV; int rEtV = 0
++#    define XCPT_TRY_START    JMPENV_PUSH(rEtV); if (rEtV == 0)
++#    define XCPT_TRY_END      JMPENV_POP;
++#    define XCPT_CATCH        if (rEtV != 0)
++#    define XCPT_RETHROW      JMPENV_JUMP(rEtV)
++#  else
++#    define dXCPT             Sigjmp_buf oldTOP; int rEtV = 0
++#    define XCPT_TRY_START    Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
++#    define XCPT_TRY_END      Copy(oldTOP, top_env, 1, Sigjmp_buf);
++#    define XCPT_CATCH        if (rEtV != 0)
++#    define XCPT_RETHROW      Siglongjmp(top_env, rEtV)
++#  endif
++#endif
++
++#if !defined(my_strlcat)
++#if defined(NEED_my_strlcat)
++static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
++static
++#else
++extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
++#endif
++
++#define my_strlcat DPPP_(my_my_strlcat)
++#define Perl_my_strlcat DPPP_(my_my_strlcat)
++
++#if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL)
++
++Size_t
++DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size)
++{
++    Size_t used, length, copy;
++
++    used = strlen(dst);
++    length = strlen(src);
++    if (size > 0 && used < size - 1) {
++        copy = (length >= size - used) ? size - used - 1 : length;
++        memcpy(dst + used, src, copy);
++        dst[used + copy] = '\0';
++    }
++    return used + length;
++}
++#endif
++#endif
++
++#if !defined(my_strlcpy)
++#if defined(NEED_my_strlcpy)
++static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
++static
++#else
++extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
++#endif
++
++#define my_strlcpy DPPP_(my_my_strlcpy)
++#define Perl_my_strlcpy DPPP_(my_my_strlcpy)
++
++#if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL)
++
++Size_t
++DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size)
++{
++    Size_t length, copy;
++
++    length = strlen(src);
++    if (size > 0) {
++        copy = (length >= size) ? size - 1 : length;
++        memcpy(dst, src, copy);
++        dst[copy] = '\0';
++    }
++    return length;
++}
++
++#endif
++#endif
++#ifndef PERL_PV_ESCAPE_QUOTE
++#  define PERL_PV_ESCAPE_QUOTE           0x0001
++#endif
++
++#ifndef PERL_PV_PRETTY_QUOTE
++#  define PERL_PV_PRETTY_QUOTE           PERL_PV_ESCAPE_QUOTE
++#endif
++
++#ifndef PERL_PV_PRETTY_ELLIPSES
++#  define PERL_PV_PRETTY_ELLIPSES        0x0002
++#endif
++
++#ifndef PERL_PV_PRETTY_LTGT
++#  define PERL_PV_PRETTY_LTGT            0x0004
++#endif
++
++#ifndef PERL_PV_ESCAPE_FIRSTCHAR
++#  define PERL_PV_ESCAPE_FIRSTCHAR       0x0008
++#endif
++
++#ifndef PERL_PV_ESCAPE_UNI
++#  define PERL_PV_ESCAPE_UNI             0x0100
++#endif
++
++#ifndef PERL_PV_ESCAPE_UNI_DETECT
++#  define PERL_PV_ESCAPE_UNI_DETECT      0x0200
++#endif
++
++#ifndef PERL_PV_ESCAPE_ALL
++#  define PERL_PV_ESCAPE_ALL             0x1000
++#endif
++
++#ifndef PERL_PV_ESCAPE_NOBACKSLASH
++#  define PERL_PV_ESCAPE_NOBACKSLASH     0x2000
++#endif
++
++#ifndef PERL_PV_ESCAPE_NOCLEAR
++#  define PERL_PV_ESCAPE_NOCLEAR         0x4000
++#endif
++
++#ifndef PERL_PV_ESCAPE_RE
++#  define PERL_PV_ESCAPE_RE              0x8000
++#endif
++
++#ifndef PERL_PV_PRETTY_NOCLEAR
++#  define PERL_PV_PRETTY_NOCLEAR         PERL_PV_ESCAPE_NOCLEAR
++#endif
++#ifndef PERL_PV_PRETTY_DUMP
++#  define PERL_PV_PRETTY_DUMP            PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
++#endif
++
++#ifndef PERL_PV_PRETTY_REGPROP
++#  define PERL_PV_PRETTY_REGPROP         PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
++#endif
++
++/* Hint: pv_escape
++ * Note that unicode functionality is only backported to
++ * those perl versions that support it. For older perl
++ * versions, the implementation will fall back to bytes.
++ */
++
++#ifndef pv_escape
++#if defined(NEED_pv_escape)
++static char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
++static
++#else
++extern char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
++#endif
++
++#ifdef pv_escape
++#  undef pv_escape
++#endif
++#define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f)
++#define Perl_pv_escape DPPP_(my_pv_escape)
++
++#if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL)
++
++char *
++DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str,
++  const STRLEN count, const STRLEN max,
++  STRLEN * const escaped, const U32 flags)
++{
++    const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\';
++    const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc;
++    char octbuf[32] = "%123456789ABCDF";
++    STRLEN wrote = 0;
++    STRLEN chsize = 0;
++    STRLEN readsize = 1;
++#if defined(is_utf8_string) && defined(utf8_to_uvchr)
++    bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0;
++#endif
++    const char *pv  = str;
++    const char * const end = pv + count;
++    octbuf[0] = esc;
++
++    if (!(flags & PERL_PV_ESCAPE_NOCLEAR))
++        sv_setpvs(dsv, "");
++
++#if defined(is_utf8_string) && defined(utf8_to_uvchr)
++    if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count))
++        isuni = 1;
++#endif
++
++    for (; pv < end && (!max || wrote < max) ; pv += readsize) {
++        const UV u =
++#if defined(is_utf8_string) && defined(utf8_to_uvchr)
++                     isuni ? utf8_to_uvchr((U8*)pv, &readsize) :
++#endif
++                             (U8)*pv;
++        const U8 c = (U8)u & 0xFF;
++
++        if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) {
++            if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
++                chsize = my_snprintf(octbuf, sizeof octbuf,
++                                      "%"UVxf, u);
++            else
++                chsize = my_snprintf(octbuf, sizeof octbuf,
++                                      "%cx{%"UVxf"}", esc, u);
++        } else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) {
++            chsize = 1;
++        } else {
++            if (c == dq || c == esc || !isPRINT(c)) {
++                chsize = 2;
++                switch (c) {
++                case '\\' : /* fallthrough */
++                case '%'  : if (c == esc)
++                                octbuf[1] = esc;
++                            else
++                                chsize = 1;
++                            break;
++                case '\v' : octbuf[1] = 'v'; break;
++                case '\t' : octbuf[1] = 't'; break;
++                case '\r' : octbuf[1] = 'r'; break;
++                case '\n' : octbuf[1] = 'n'; break;
++                case '\f' : octbuf[1] = 'f'; break;
++                case '"'  : if (dq == '"')
++                                octbuf[1] = '"';
++                            else
++                                chsize = 1;
++                            break;
++                default:    chsize = my_snprintf(octbuf, sizeof octbuf,
++                                pv < end && isDIGIT((U8)*(pv+readsize))
++                                ? "%c%03o" : "%c%o", esc, c);
++                }
++            } else {
++                chsize = 1;
++            }
++        }
++        if (max && wrote + chsize > max) {
++            break;
++        } else if (chsize > 1) {
++            sv_catpvn(dsv, octbuf, chsize);
++            wrote += chsize;
++        } else {
++            char tmp[2];
++            my_snprintf(tmp, sizeof tmp, "%c", c);
++            sv_catpvn(dsv, tmp, 1);
++            wrote++;
++        }
++        if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
++            break;
++    }
++    if (escaped != NULL)
++        *escaped= pv - str;
++    return SvPVX(dsv);
++}
++
++#endif
++#endif
++
++#ifndef pv_pretty
++#if defined(NEED_pv_pretty)
++static char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
++static
++#else
++extern char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
++#endif
++
++#ifdef pv_pretty
++#  undef pv_pretty
++#endif
++#define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g)
++#define Perl_pv_pretty DPPP_(my_pv_pretty)
++
++#if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL)
++
++char *
++DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count,
++  const STRLEN max, char const * const start_color, char const * const end_color,
++  const U32 flags)
++{
++    const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%';
++    STRLEN escaped;
++
++    if (!(flags & PERL_PV_PRETTY_NOCLEAR))
++        sv_setpvs(dsv, "");
++
++    if (dq == '"')
++        sv_catpvs(dsv, "\"");
++    else if (flags & PERL_PV_PRETTY_LTGT)
++        sv_catpvs(dsv, "<");
++
++    if (start_color != NULL)
++        sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color));
++
++    pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR);
++
++    if (end_color != NULL)
++        sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color));
++
++    if (dq == '"')
++        sv_catpvs(dsv, "\"");
++    else if (flags & PERL_PV_PRETTY_LTGT)
++        sv_catpvs(dsv, ">");
++
++    if ((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count)
++        sv_catpvs(dsv, "...");
++
++    return SvPVX(dsv);
++}
++
++#endif
++#endif
++
++#ifndef pv_display
++#if defined(NEED_pv_display)
++static char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
++static
++#else
++extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
++#endif
++
++#ifdef pv_display
++#  undef pv_display
++#endif
++#define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e)
++#define Perl_pv_display DPPP_(my_pv_display)
++
++#if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL)
++
++char *
++DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
++{
++    pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP);
++    if (len > cur && pv[cur] == '\0')
++        sv_catpvs(dsv, "\\0");
++    return SvPVX(dsv);
++}
++
++#endif
++#endif
++
++#endif /* _P_P_PORTABILITY_H_ */
++
++/* End of File ppport.h */
diff --git a/lang/perl-xml-parser/patches/020-xml-parser-expat-lib-inc-path-anchor.patch b/lang/perl-xml-parser/patches/020-xml-parser-expat-lib-inc-path-anchor.patch
new file mode 100644 (file)
index 0000000..4e17daa
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/Expat/Makefile.PL
++++ b/Expat/Makefile.PL
+@@ -2,6 +2,9 @@ use ExtUtils::MakeMaker;
+ use Config;
+ use English;
++$expat_libpath = '%%EXPAT_LIBPATH%%';
++$expat_incpath = '%%EXPAT_INCPATH%%';
++
+ my $libs = "-lexpat";
+ my @extras = ();
diff --git a/lang/perl/Config.in b/lang/perl/Config.in
new file mode 100644 (file)
index 0000000..65a3a47
--- /dev/null
@@ -0,0 +1,31 @@
+menu "Configuration"
+       depends on PACKAGE_perl
+
+config PERL_THREADS
+    bool "Enable threading support"
+    default y if (mips || mipsel || i386 || i686 || x86_64 || armeb || arm)
+    default n
+
+config PERL_TESTS
+       bool "Include perl tests"
+       default n
+       help
+               Include test suites for all perl packages.
+               
+               This will increase the size of perl and related packages
+               considerably.
+               Test support is still in development. Some tests will fail,
+               others are just missing completely.
+
+config PERL_NOCOMMENT
+       bool "Strip comments and pod sections from modules"
+       default y
+       help
+               Remove comments and pod sections for all perl packages.
+
+               This will descrease the size of perl libraries moderately.
+
+               Stripping occasionally gets confused and mangles valid code,
+               so disable this option if you're not pressed for space.
+
+endmenu
diff --git a/lang/perl/Makefile b/lang/perl/Makefile
new file mode 100644 (file)
index 0000000..d3cb081
--- /dev/null
@@ -0,0 +1,185 @@
+#
+# 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:=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_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_LICENSE_FILES:=Copying Artistic README
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>, \
+               Philip Prindeville <philipp@redfish-solutions.com>
+
+# Build settings
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_NAME)-$(PKG_VERSION)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL:=1
+PKG_BUILD_DEPENDS:=perl/host
+PKG_BUILD_PARALLEL:=1
+HOST_BUILD_PARALLEL:=1
+
+# Variables used during configuration/build
+HOST_PERL_PREFIX:=$(STAGING_DIR_HOSTPKG)/usr
+
+# Filter -g3, it will break Compress-Raw-Zlib
+TARGET_CFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CFLAGS))
+TARGET_CPPFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CPPFLAGS))
+
+# A list of disabled tests
+# ExtUtils tests are disabled for now as we don't support building
+# native extensions on the target machine at the moment
+PERL_DISABLEDTESTS:=cpan/ExtUtils-Constant cpan/ExtUtils-MakeMaker
+# We're on Linux, so don't even package them
+PERL_DISABLEDTESTS+=cpan/Win32API-File cpan/Win32 ext/VMS-DCLsym ext/VMS-Filespec ext/VMS-Stdio ext/Win32CORE os2/
+# NDBM and ODBM not supported
+PERL_DISABLEDTESTS+=ext/NDBM_File ext/ODBM_File
+
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+include perlmod.mk
+
+define Package/perl
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=The Perl intepreter
+  URL:=http://www.perl.com/
+  DEPENDS:=+USE_GLIBC:libbsd +PERL_THREADS:libpthread
+endef
+
+define Package/perl/description
+  Perl is a stable, cross platform programming language.
+  It is used for mission critical projects in the public and private sectors
+  and is widely used to program web applications of all needs.
+endef
+
+define Package/perl/config
+       source "$(SOURCE)/Config.in"
+endef
+
+# Static host perl
+define Host/Configure
+       ( cd $(HOST_BUILD_DIR); ./Configure -der -Uusedl -Duserelocatableinc -Dprefix=$(HOST_PERL_PREFIX) $(if $(CONFIG_PERL_THREADS),-Dusethreads,))
+endef
+
+define Host/Install
+       ( cd $(HOST_BUILD_DIR); ./miniperl installperl )
+       $(INSTALL_DIR) $(HOST_PERL_PREFIX)/bin/
+       $(CP) $(HOST_BUILD_DIR)/generate_uudmap $(HOST_PERL_PREFIX)/bin/
+       
+       # Link any possibly installed static extension in
+       $(MAKE) -C $(HOST_BUILD_DIR)/relink clean || true
+       ( cd $(HOST_BUILD_DIR)/relink && $(HOST_PERL_PREFIX)/bin/perl Makefile.PL )
+       $(call perlmod/host/relink,$(HOST_BUILD_DIR)/relink)
+endef
+
+# Target perl
+define Build/Configure
+       $(PERL_CMD) files/perlconfig.pl -Dowrt:target_cc='$(TARGET_CC)' \
+                                       -Dowrt:gccversion=$(CONFIG_GCC_VERSION) \
+                                       -Dowrt:target_cross='$(TARGET_CROSS)' \
+                                       -Dowrt:cflags='$(TARGET_CFLAGS_PERL) $(TARGET_CPPFLAGS_PERL)' \
+                                       -Dowrt:ldflags='-rdynamic $(TARGET_LDFLAGS)' \
+                                       -Dowrt:libc=$(subst uClibc,uclibc,$(CONFIG_LIBC)) \
+                                       -Dowrt:ipv6=$(if $($(CONFIG_IPV6)),define,undef) \
+                                       -Dowrt:threads=$(if $(CONFIG_PERL_THREADS),yes,no) \
+                                       -Dowrt:staging_dir='$(STAGING_DIR)' \
+                                       -Dowrt:host_perl_prefix='$(HOST_PERL_PREFIX)' \
+                                       files/version.config \
+                                       files/base.config \
+                                       files/$(patsubst i386,i486,$(ARCH)).config \
+                                       files/architecture.config \
+                                       files/signal.config \
+                                       files/threads.config \
+                                       files/libc.config \
+                                       files/misc.config \
+                                       > $(PKG_BUILD_DIR)/config.sh
+       (cd $(PKG_BUILD_DIR) && ./Configure -S)
+       install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
+endef
+
+define Build/Compile
+       +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/$(PERL_VERSION) $(1)/usr/lib/perl5/
+endef
+
+define Package/perl/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin
+       ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl
+       
+       $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/CORE
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/$(PERL_VERSION)/CORE/libperl.so $(1)/usr/lib/perl5/$(PERL_VERSION)/CORE/
+endef
+
+
+$(eval $(call RequireCommand,rsync, \
+       $(PKG_NAME) requires rsync installed on the host-system. \
+))
+
+$(eval $(call BuildPackage,perl))
+$(eval $(call HostBuild))
+
+-include perlbase.mk
+
+# A helper package that includes all sort of supplementary files for tests
+define Package/perl-tests-common
+$(call Package/perlbase-template)
+TITLE:=Common test support files
+DEPENDS:=@PERL_TESTS
+endef
+
+define Package/perl-tests-common/install
+       $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)
+       $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/Porting
+       $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/regen
+       $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/lib
+       $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/XS
+       $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/auto/XS
+       $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/unicore
+       
+       $(CP) $(PKG_BUILD_DIR)/t $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/Porting $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/regen $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/MANIFEST $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/TestInit.pm $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/vutil.c $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/vxs.inc $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/lib/XS $(1)/usr/lib/perl5/$(PERL_VERSION)/
+       $(CP) $(PKG_BUILD_DIR)/lib/auto/XS $(1)/usr/lib/perl5/$(PERL_VERSION)/auto
+       $(CP) $(PKG_BUILD_DIR)/lib/vmsish.pm $(1)/usr/lib/perl5/$(PERL_VERSION)/
+       $(CP) $(PKG_BUILD_DIR)/lib/vmsish.t $(1)/$(PERL_TESTSDIR)/lib
+       $(CP) $(PKG_BUILD_DIR)/lib/Internals.t $(1)/$(PERL_TESTSDIR)/lib
+       $(CP) $(PKG_BUILD_DIR)/lib/unicore/TestProp.pl $(1)/usr/lib/perl5/$(PERL_VERSION)/unicore
+       $(CP) files/perl-run_tests.sh $(1)/$(PERL_TESTSDIR)/run_tests.sh
+       sed \
+               -e 's!%%PERL_DISABLEDTESTS%%!$(PERL_DISABLEDTESTS)!' \
+               -e 's!%%PERL_VERSION%%!$(PERL_VERSION)!' \
+               -i $(1)/$(PERL_TESTSDIR)/run_tests.sh
+       $(CP) $(PKG_BUILD_DIR)/config_h.SH $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/perl.h $(1)/$(PERL_TESTSDIR)
+endef
+
+$(eval $(call BuildPackage,perl-tests-common))
diff --git a/lang/perl/README.patches b/lang/perl/README.patches
new file mode 100644 (file)
index 0000000..5f3b595
--- /dev/null
@@ -0,0 +1,9 @@
+The patches in this package are loosely sorted into the following categories:
+
+0xx - Bugfixes
+1xx - Cross-compile fixes
+3xx - Workarounds
+7xx - Testsuite fixes
+
+Feel free to add another one if your new patch doesn't seem to fit into an
+existing category.
\ No newline at end of file
diff --git a/lang/perl/files/README.config b/lang/perl/files/README.config
new file mode 100644 (file)
index 0000000..16bf058
--- /dev/null
@@ -0,0 +1,59 @@
+-- Perl configuration --
+
+Perl uses a huge configuration file, normally generated via the Configure script
+at build-time. This fails when cross-compiling though, so we need to supply our
+own.
+
+We're using perlconfig.pl to piece together the final configuration from a bunch
+of configuration files(all ending in .config). Please refer to perlconfig.pl's
+POD for information on usage and syntax.
+
+Throughout the files, you will see a bunch of references to private symbols with
+the prefix "owrt". These are used to control output in an effort to both
+simplify writing configuration files, as well as to provide switchable options
+to select the feature set of the resulting perl installation.
+
+The following will be a summary/quick reference of all private symbols we're
+currently using:
+
+Passed via architecture configuration file(mipsel.config, i486.config, ...)
+---------------------------------------------------------------------------
+Symbol              Values              Description
+owrt:bits           32/64               Target's native word length.
+owrt:endian         little/big          Target's endianness.
+owrt:arch           mipsel, i486, ...   Target's architecture name.
+owrt:sig_count      64/128              Number of signals the target
+                                        provides(NSIG - 1).
+owrt:sigs           *                   Symbolic names of the first 32 signals
+                                        this architecture provides, in numeric
+                                        order. Separated by whitespaces.
+owrt:sig_name_extra *                   Symbolic names of any additional signals
+                                        this architecture provides after
+                                        owrt:sig_count. Separated by
+                                        whitespaces.
+owrt:sig_num_extra  *                   Numeric values associated with the
+                                        signal names provided in
+                                        owrt:sig_name_extra. Separated by
+                                        whitespaces.
+
+Passed via command line
+-----------------------
+Symbol                Values              Description
+owrt:libc             glibc/uclibc/musl   Which C library implementation is in
+                                          use.
+owrt:threads          yes/no              Whether to enable threading support.
+owrt:ipv6             define/undef        Whether to enable IPv6 support.
+owrt:target_cross     *                   Target architecture's host triplet.
+owrt:target_cc        *                   C compiler to use.
+owrt:gccversion       *                   target_cc's version number.
+owrt:cflags           *                   Additional C compiler flags.
+owrt:ldflags          *                   Additional linker flags.
+owrt:staging_dir      *                   Same as OpenWRT buildroot's
+                                          $(STAGING_DIR).
+owrt:host_perl_prefix *                   host-perl installation prefix.
+
+Passed via version.config
+-------------------------
+Symbol           Values              Description
+owrt:perllibpath *                   Path to perl library files, from the
+                                     target's point of view.
diff --git a/lang/perl/files/architecture.config b/lang/perl/files/architecture.config
new file mode 100644 (file)
index 0000000..cc97281
--- /dev/null
@@ -0,0 +1,121 @@
+alignbytes='8'
+
+($owrt:bits eq '32') {
+       ($owrt:endian eq 'little') {
+               byteorder='1234'
+       }
+       ($owrt:endian eq 'big') {
+               byteorder='4321'
+       }
+       
+       # Types
+       ivsize='4'
+       uvsize='4'
+       longsize='4'
+       longdblsize='8'
+       ptrsize='4'
+       
+       #quadkind='3'
+       #doublekind='3'
+       #longdblkind='0'
+       
+       i8type='signed char'
+       i16type='signed short'
+       i32type='signed long'
+       i64type='signed long long'
+       u32type='unsigned long'
+       u64type='unsigned long long'
+       quadtype='long long'
+       uquadtype='unsigned long long'
+       
+       sizesize='4'
+       
+       use64bitall='undef'
+       use64bitint='undef'
+       
+       uidformat='"lu"'
+       gidformat='"lu"'
+       
+       selectminbits='32'
+       
+       sGMTIME_max='2147483647'
+       sGMTIME_min='-2147483648'
+       sLOCALTIME_max='2147483647'
+       sLOCALTIME_min='-2147483648'
+       
+       sPRIi64='"Li"'
+       sPRIo64='"Lo"'
+       sPRIu64='"Lu"'
+       sPRIx64='"Lx"'
+       sPRId64='"Ld"'
+       
+       netdb_host_type='const void *'
+       nv_preserves_uv_bits='32'
+       d_nv_preserves_uv='define'
+       d_printf_format_null='define'
+       d_u32align='undef'
+}
+($owrt:bits eq '64') {
+       ($owrt:endian eq 'little') {
+               byteorder='12345678'
+       }
+       ($owrt:endian eq 'big') {
+               byteorder='87654321'
+       }
+       
+       # Types
+       ivsize='8'
+       uvsize='8'
+       longsize='8'
+       longdblsize='16'
+       ptrsize='8'
+       
+       quadtype='long'
+       
+       i16type='signed short'
+       i32type='signed int'
+       i64type='signed long'
+       i8type='signed char'
+       
+       u32type='unsigned int'
+       u64type='unsigned long'
+       uquadtype='unsigned long'
+       
+       sizesize='8'
+       
+       uidformat='"u"'
+       gidformat='"u"'
+       
+       selectminbits='64'
+       
+       sGMTIME_max='67768036191676799'
+       sGMTIME_min='-62167219200'
+       sLOCALTIME_max='67768036191673199'
+       sLOCALTIME_min='-62167222408'
+       
+       sPRIi64='"li"'
+       sPRIo64='"lo"'
+       sPRIu64='"lu"'
+       sPRIx64='"lx"'
+       sPRId64='"ld"'
+       
+       netdb_host_type='char *'
+       nv_preserves_uv_bits='53'
+       d_nv_preserves_uv='undef'
+       d_printf_format_null='undef'
+       d_u32align='define'
+       use64bitall='define'
+       use64bitint='define'
+}
+
+# Only defined by i486 and x86_64. Provide defaults for all others
+(!defined($sPRIEUldbl)) {
+       sPRIEUldbl='"E"'
+       sPRIFUldbl='"F"'
+       sPRIGUldbl='"G"'
+       sPRIXU64='"LX"'
+       sPRIeldbl='"e"'
+       sPRIfldbl='"f"'
+       sPRIgldbl='"g"'
+       sSCNfldbl='"f"'
+}
diff --git a/lang/perl/files/arm.config b/lang/perl/files/arm.config
new file mode 100644 (file)
index 0000000..75fe254
--- /dev/null
@@ -0,0 +1,19 @@
+owrt:arch=arm
+owrt:bits=32
+owrt:endian=little
+
+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_modflproto='undef'
+doublekind='3'
+fpossize='20'
+longdblkind='0'
+need_va_copy='undef'
+quadkind='3'
+
+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'
diff --git a/lang/perl/files/armeb.config b/lang/perl/files/armeb.config
new file mode 100644 (file)
index 0000000..081300c
--- /dev/null
@@ -0,0 +1,19 @@
+owrt:arch=armeb
+owrt:bits=32
+owrt:endian=big
+
+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_modflproto='undef'
+doublekind='4'
+fpossize='20'
+longdblkind='0'
+need_va_copy='undef'
+quadkind='3'
+
+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'
diff --git a/lang/perl/files/base.config b/lang/perl/files/base.config
new file mode 100644 (file)
index 0000000..edc3bd4
--- /dev/null
@@ -0,0 +1,1005 @@
+Author=''
+Date=''
+Header=''
+Id=''
+Locker=''
+Log=''
+PERL_CONFIG_SH=true
+PERL_PATCHLEVEL=
+RCSfile=''
+Revision=''
+Source=''
+State=''
+_a='.a'
+_exe=''
+_o='.o'
+afs='false'
+afsroot='/afs'
+ansi2knr=''
+aphostname='/bin/hostname'
+ar='ar'
+archname64=''
+archobjs=''
+awk='awk'
+baserev='5.0'
+bash=''
+bin='/usr/bin'
+bin_ELF='define'
+binexp='/usr/bin'
+bison='bison'
+byacc='byacc'
+c=''
+castflags='0'
+cat='cat'
+ccname='gcc'
+ccversion=''
+cf_by='root'
+charbits='8'
+charsize='1'
+chgrp=''
+chmod='chmod'
+chown=''
+clocktype='clock_t'
+comm='comm'
+compress=''
+config_arg0='./Configure'
+config_arg1='-der'
+contains='grep'
+cp='cp'
+cpio=''
+cpp='cpp'
+cpp_stuff='42'
+cpplast='-'
+cppminus='-'
+cryptlib=''
+csh='csh'
+ctermid_r_proto='0'
+d_Gconvert='sprintf((b),"%.*g",(n),(x))'
+d_PRIEUldbl='define'
+d_PRIFUldbl='define'
+d_PRIGUldbl='define'
+d_PRIXU64='define'
+d_PRId64='define'
+d_PRIeldbl='define'
+d_PRIfldbl='define'
+d_PRIgldbl='define'
+d_PRIi64='define'
+d_PRIo64='define'
+d_PRIu64='define'
+d_PRIx64='define'
+d_SCNfldbl='define'
+d__fwalk='undef'
+d_access='define'
+d_accessx='undef'
+d_acosh='define'
+d_aintl='undef'
+d_alarm='define'
+d_archlib='undef'
+d_asctime64='undef'
+d_asinh='define'
+d_atanh='define'
+d_atolf='undef'
+d_atoll='define'
+d_attribute_deprecated='define'
+d_attribute_format='define'
+d_attribute_malloc='define'
+d_attribute_nonnull='define'
+d_attribute_noreturn='define'
+d_attribute_pure='define'
+d_attribute_unused='define'
+d_attribute_warn_unused_result='define'
+d_backtrace='define'
+d_bcmp='define'
+d_bcopy='define'
+d_bsd='undef'
+d_bsdgetpgrp='undef'
+d_bsdsetpgrp='undef'
+d_builtin_choose_expr='define'
+d_builtin_expect='undef'
+d_bzero='define'
+d_c99_variadic_macros='define'
+d_castneg='define'
+d_cbrt='define'
+d_charvspr='undef'
+d_chown='define'
+d_chroot='define'
+d_chsize='undef'
+d_class='undef'
+d_clearenv='define'
+d_clock='define'
+d_clock_getres='define'
+d_clock_gettime='define'
+d_clock_nanosleep='define'
+d_closedir='define'
+d_cmsghdr_s='define'
+d_const='define'
+d_copysign='define'
+d_copysignl='undef'
+d_cplusplus='undef'
+d_csh='undef'
+d_ctermid='define'
+d_ctermid_r='undef'
+d_ctime64='undef'
+d_cuserid='define'
+d_dbl_dig='define'
+d_dbminitproto='undef'
+d_difftime='define'
+d_difftime64='undef'
+d_dir_dd_fd='undef'
+d_dirfd='define'
+d_dirnamlen='undef'
+d_dladdr='define'
+d_dlerror='define'
+d_dlopen='define'
+d_dlsymun='undef'
+d_dosuid='undef'
+d_drand48proto='define'
+d_dup2='define'
+d_eaccess='undef'
+d_endgrent='define'
+d_endgrent_r='undef'
+d_endhent='define'
+d_endhostent_r='undef'
+d_endnent='define'
+d_endnetent_r='undef'
+d_endpent='define'
+d_endprotoent_r='undef'
+d_endpwent='define'
+d_endpwent_r='undef'
+d_endsent='define'
+d_endservent_r='undef'
+d_eofnblk='define'
+d_erf='define'
+d_erfc='define'
+d_eunice='undef'
+d_exp2='define'
+d_expm1='define'
+d_faststdio='undef'
+d_fchdir='define'
+d_fchmod='define'
+d_fchown='define'
+d_fcntl='define'
+d_fcntl_can_lock='define'
+d_fd_macros='define'
+d_fd_set='define'
+d_fdim='define'
+d_fgetpos='define'
+d_finite='define'
+d_finitel='undef'
+d_flexfnam='define'
+d_flock='define'
+d_flockproto='define'
+d_fma='define'
+d_fmax='define'
+d_fmin='define'
+d_fork='define'
+d_fp_class='undef'
+d_fp_classify='undef'
+d_fp_classl='undef'
+d_fpathconf='define'
+d_fpclass='undef'
+d_fpclassify='define'
+d_fpclassl='undef'
+d_fpgetround='undef'
+d_fpos64_t='undef'
+d_frexpl='undef'
+d_fs_data_s='undef'
+d_fseeko='define'
+d_fsetpos='define'
+d_fstatfs='define'
+d_fstatvfs='define'
+d_fsync='define'
+d_ftello='define'
+d_ftime='undef'
+d_futimes='undef'
+d_gdbm_ndbm_h_uses_prototypes='undef'
+d_gdbmndbm_h_uses_prototypes='undef'
+d_getaddrinfo='define'
+d_getcwd='define'
+d_getespwnam='undef'
+d_getfsstat='undef'
+d_getgrent='define'
+d_getgrps='define'
+d_gethbyaddr='define'
+d_gethbyname='define'
+d_gethent='define'
+d_gethname='define'
+d_gethostprotos='define'
+d_getitimer='define'
+d_getlogin='define'
+d_getmnt='undef'
+d_getmntent='define'
+d_getnameinfo='define'
+d_getnbyaddr='define'
+d_getnbyname='define'
+d_getnent='define'
+d_getnetprotos='define'
+d_getpagsz='define'
+d_getpbyname='define'
+d_getpbynumber='define'
+d_getpent='define'
+d_getpgid='define'
+d_getpgrp='define'
+d_getpgrp2='undef'
+d_getppid='define'
+d_getprior='define'
+d_getprotoprotos='define'
+d_getprpwnam='undef'
+d_getpwent='define'
+d_getsbyname='define'
+d_getsbyport='define'
+d_getsent='define'
+d_getservprotos='define'
+d_getspnam='define'
+d_gettimeod='define'
+d_gmtime64='undef'
+d_gnulibc='undef'
+d_grpasswd='define'
+d_hasmntopt='define'
+d_htonl='define'
+d_hypot='define'
+d_ilogb='define'
+d_ilogbl='undef'
+d_inc_version_list='undef'
+d_index='undef'
+d_inetaton='define'
+d_inetntop='define'
+d_inetpton='define'
+d_int64_t='define'
+d_ip_mreq='define'
+d_ip_mreq_source='define'
+d_ipv6_mreq="$owrt:ipv6"
+d_ipv6_mreq_source='undef'
+d_isascii='define'
+d_isblank='define'
+d_isfinite='define'
+d_isfinitel='undef'
+d_isinf='define'
+d_isinfl='define'
+d_isless='undef'
+d_isnan='define'
+d_isnanl='undef'
+d_isnormal='define'
+d_killpg='define'
+d_lc_monetary_2008='define'
+d_lchown='define'
+d_ldbl_dig='define'
+d_ldexpl='define'
+d_lgamma='define'
+d_lgamma_r='define'
+d_libm_lib_version='define'
+d_libname_unique='undef'
+d_link='define'
+d_llrint='define'
+d_llrintl='define'
+d_llround='define'
+d_llroundl='define'
+d_localtime64='undef'
+d_locconv='define'
+d_lockf='define'
+d_log1p='define'
+d_log2='define'
+d_logb='define'
+d_longdbl='define'
+d_longlong='define'
+d_lrint='define'
+d_lrintl='define'
+d_lround='define'
+d_lroundl='define'
+d_lseekproto='define'
+d_lstat='define'
+d_madvise='define'
+d_malloc_good_size='undef'
+d_malloc_size='undef'
+d_mblen='define'
+d_mbstowcs='define'
+d_mbtowc='define'
+d_memchr='define'
+d_memcmp='define'
+d_memcpy='define'
+d_memmove='define'
+d_memset='define'
+d_mkdir='define'
+d_mkdtemp='define'
+d_mkfifo='define'
+d_mkstemp='define'
+d_mkstemps='undef'
+d_mktime='define'
+d_mktime64='undef'
+d_mmap='define'
+d_modfl='undef'
+d_modfl_pow32_bug='undef'
+d_mprotect='define'
+d_msg='define'
+d_msg_ctrunc='define'
+d_msg_dontroute='define'
+d_msg_oob='define'
+d_msg_peek='define'
+d_msg_proxy='define'
+d_msgctl='define'
+d_msgget='define'
+d_msghdr_s='define'
+d_msgrcv='define'
+d_msgsnd='define'
+d_msync='define'
+d_munmap='define'
+d_mymalloc='undef'
+d_nan='define'
+d_nanosleep='define'
+d_ndbm='undef'
+d_ndbm_h_uses_prototypes='undef'
+d_nearbyint='define'
+d_nextafter='define'
+d_nice='define'
+d_nl_langinfo='define'
+d_nv_zero_is_allbits_zero='define'
+d_old_pthread_create_joinable='undef'
+d_oldpthreads='undef'
+d_oldsock='undef'
+d_open3='define'
+d_pathconf='define'
+d_pause='define'
+d_perl_otherlibdirs='undef'
+d_phostname='undef'
+d_pipe='define'
+d_poll='define'
+d_portable='define'
+d_prctl='define'
+d_prctl_set_name='define'
+d_procselfexe='define'
+d_pseudofork='undef'
+d_pthread_attr_setscope='define'
+d_ptrdiff_t='define'
+d_pwage='undef'
+d_pwchange='undef'
+d_pwclass='undef'
+d_pwcomment='undef'
+d_pwexpire='undef'
+d_pwgecos='define'
+d_pwpasswd='define'
+d_pwquota='undef'
+d_qgcvt='undef'
+d_quad='define'
+d_re_comp='undef'
+d_readdir='define'
+d_readlink='define'
+d_readv='define'
+d_recvmsg='define'
+d_regcmp='undef'
+d_regcomp='define'
+d_remainder='define'
+d_remquo='define'
+d_rename='define'
+d_rewinddir='define'
+d_rint='define'
+d_rmdir='define'
+d_round='define'
+d_safebcpy='undef'
+d_safemcpy='undef'
+d_sanemcmp='define'
+d_sbrkproto='define'
+d_scalbn='define'
+d_scalbnl='undef'
+d_sched_yield='define'
+d_scm_rights='define'
+d_seekdir='define'
+d_select='define'
+d_sem='define'
+d_semctl='define'
+d_semctl_semid_ds='define'
+d_semctl_semun='define'
+d_semget='define'
+d_semop='define'
+d_sendmsg='define'
+d_setegid='define'
+d_seteuid='define'
+d_setgrent='define'
+d_setgrent_r='undef'
+d_setgrps='define'
+d_sethent='define'
+d_sethostent_r='undef'
+d_setitimer='define'
+d_setlinebuf='define'
+d_setlocale='define'
+d_setlocale_r='undef'
+d_setnent='define'
+d_setnetent_r='undef'
+d_setpent='define'
+d_setpgid='define'
+d_setpgrp='define'
+d_setpgrp2='undef'
+d_setprior='define'
+d_setproctitle='undef'
+d_setprotoent_r='undef'
+d_setpwent='define'
+d_setpwent_r='undef'
+d_setregid='define'
+d_setresgid='define'
+d_setresuid='define'
+d_setreuid='define'
+d_setrgid='undef'
+d_setruid='undef'
+d_setsent='define'
+d_setservent_r='undef'
+d_setsid='define'
+d_setvbuf='define'
+d_sfio='undef'
+d_shm='define'
+d_shmat='define'
+d_shmatprototype='define'
+d_shmctl='define'
+d_shmdt='define'
+d_shmget='define'
+d_sigaction='define'
+d_signbit='undef'
+d_sigprocmask='define'
+d_sigsetjmp='define'
+d_sin6_scope_id="$owrt:ipv6"
+d_sitearch='define'
+d_snprintf='define'
+d_sockaddr_in6="$owrt:ipv6"
+d_sockaddr_sa_len='undef'
+d_sockatmark='undef'
+d_sockatmarkproto='undef'
+d_socket='define'
+d_socklen_t='define'
+d_sockpair='define'
+d_socks5_init='undef'
+d_sprintf_returns_strlen='define'
+d_sqrtl='undef'
+d_stat='define'
+d_statblks='define'
+d_statfs_f_flags='undef'
+d_statfs_s='define'
+d_static_inline='define'
+d_statvfs='define'
+d_stdio_cnt_lval='undef'
+d_stdio_ptr_lval='undef'
+d_stdio_ptr_lval_nochange_cnt='undef'
+d_stdio_ptr_lval_sets_cnt='undef'
+d_stdio_stream_array='undef'
+d_stdiobase='undef'
+d_stdstdio='undef'
+d_strchr='define'
+d_strcoll='define'
+d_strctcpy='define'
+d_strerrm='strerror(e)'
+d_strerror='define'
+d_strftime='define'
+d_strlcat='define'
+d_strlcpy='define'
+d_strtod='define'
+d_strtol='define'
+d_strtold='define'
+d_strtoll='define'
+d_strtoq='define'
+d_strtoul='define'
+d_strtoull='define'
+d_strtouq='define'
+d_strxfrm='define'
+d_suidsafe='undef'
+d_symlink='define'
+d_syscall='define'
+d_syscallproto='define'
+d_sysconf='define'
+d_sysernlst=''
+d_syserrlst='undef'
+d_system='define'
+d_tcgetpgrp='define'
+d_tcsetpgrp='define'
+d_telldir='define'
+d_telldirproto='define'
+d_tgamma='define'
+d_time='define'
+d_timegm='define'
+d_times='define'
+d_tm_tm_gmtoff='define'
+d_tm_tm_zone='define'
+d_trunc='define'
+d_truncate='define'
+d_truncl='define'
+d_tzname='define'
+d_ualarm='define'
+d_umask='define'
+d_uname='define'
+d_union_semun='undef'
+d_unordered='undef'
+d_unsetenv='define'
+d_usleep='define'
+d_usleepproto='define'
+d_ustat='define'
+d_vendorarch='undef'
+d_vendorbin='undef'
+d_vendorlib='undef'
+d_vendorscript='undef'
+d_vfork='undef'
+d_void_closedir='undef'
+d_voidsig='define'
+d_voidtty=''
+d_volatile='define'
+d_vprintf='define'
+d_vsnprintf='define'
+d_wait4='define'
+d_waitpid='define'
+d_wcscmp='define'
+d_wcstombs='define'
+d_wcsxfrm='define'
+d_wctomb='define'
+d_writev='define'
+d_xenix='undef'
+date='date'
+db_hashtype='u_int32_t'
+db_prefixtype='size_t'
+db_version_major=''
+db_version_minor=''
+db_version_patch=''
+defvoidused='15'
+direntrytype='struct dirent'
+dlext='so'
+dlsrc='dl_dlopen.xs'
+doublesize='8'
+drand01='drand48()'
+dtrace=''
+eagain='EAGAIN'
+ebcdic='undef'
+echo='echo'
+egrep='egrep'
+emacs=''
+endgrent_r_proto='0'
+endhostent_r_proto='0'
+endnetent_r_proto='0'
+endprotoent_r_proto='0'
+endpwent_r_proto='0'
+endservent_r_proto='0'
+eunicefix=':'
+exe_ext=''
+expr='expr'
+extern_C='extern'
+extras=''
+fflushNULL='define'
+fflushall='undef'
+find=''
+firstmakefile='makefile'
+flex=''
+fpostype='fpos_t'
+freetype='void'
+from=':'
+full_csh='csh'
+full_sed='sed'
+gccansipedantic=''
+gccosandvers=''
+gidsign='1'
+gidsize='4'
+gidtype='gid_t'
+glibpth='/usr/shlib  /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/ucblib /usr/local/lib '
+gmake='gmake'
+gnulibc_version=''
+grep='grep'
+groupcat='cat /etc/group'
+groupstype='gid_t'
+gzip='gzip'
+h_fcntl='false'
+h_sysfile='true'
+hint='recommended'
+hostcat='cat /etc/hosts'
+hostgenerate="$owrt:host_perl_prefix/bin/generate_uudmap"
+hostosname=''
+hostperl="$owrt:host_perl_prefix/bin/perl"
+html1dir=' '
+html1direxp=''
+html3dir=' '
+html3direxp=''
+i16size='2'
+i32size='4'
+i64size='8'
+i8size='1'
+i_arpainet='define'
+i_assert='define'
+i_bfd='undef'
+i_bsdioctl=''
+i_db='define'
+i_dbm='undef'
+i_dirent='define'
+i_dld='undef'
+i_dlfcn='define'
+i_execinfo='define'
+i_fcntl='undef'
+i_fenv='undef'
+i_float='define'
+i_fp='undef'
+i_fp_class='undef'
+i_gdbm='define'
+i_gdbm_ndbm='undef'
+i_gdbmndbm='undef'
+i_grp='define'
+i_ieeefp='undef'
+i_inttypes='define'
+i_langinfo='define'
+i_libutil='undef'
+i_limits='define'
+i_locale='define'
+i_machcthr='undef'
+i_malloc='define'
+i_mallocmalloc='undef'
+i_math='define'
+i_memory='undef'
+i_mntent='define'
+i_ndbm='undef'
+i_netdb='define'
+i_neterrno='undef'
+i_netinettcp='define'
+i_niin='define'
+i_poll='define'
+i_prot='undef'
+i_pthread='define'
+i_pwd='define'
+i_quadmath='define'
+i_rpcsvcdbm='undef'
+i_sfio='undef'
+i_sgtty='undef'
+i_shadow='define'
+i_socks='undef'
+i_stdarg='define'
+i_stdbool='define'
+i_stddef='define'
+i_stdint='define'
+i_stdlib='define'
+i_string='define'
+i_sunmath='undef'
+i_sysaccess='undef'
+i_sysdir='define'
+i_sysfile='define'
+i_sysfilio='undef'
+i_sysin='undef'
+i_sysioctl='define'
+i_syslog='define'
+i_sysmman='define'
+i_sysmode='undef'
+i_sysmount='define'
+i_sysndir='undef'
+i_sysparam='define'
+i_syspoll='define'
+i_sysresrc='define'
+i_syssecrt='undef'
+i_sysselct='define'
+i_syssockio='undef'
+i_sysstat='define'
+i_sysstatfs='define'
+i_sysstatvfs='define'
+i_systime='define'
+i_systimek='undef'
+i_systimes='define'
+i_systypes='define'
+i_sysuio='define'
+i_sysun='define'
+i_sysutsname='define'
+i_sysvfs='define'
+i_syswait='define'
+i_termio='undef'
+i_termios='define'
+i_time='define'
+i_unistd='define'
+i_ustat='define'
+i_utime='define'
+i_values='define'
+i_varargs='undef'
+i_varhdr='stdarg.h'
+i_vfork='undef'
+ignore_versioned_solibs='y'
+inc_version_list=' '
+inc_version_list_init='0'
+incpath=''
+inews=''
+initialinstalllocation='/usr/bin'
+installbin='/usr/bin'
+installhtml1dir=''
+installhtml3dir=''
+installman1dir=''
+installman3dir=''
+installprefix='/usr'
+installprefixexp='/usr'
+installscript='/usr/bin'
+installsitebin='/usr/bin'
+installsitehtml1dir=''
+installsitehtml3dir=''
+installsiteman1dir=''
+installsiteman3dir=''
+installsitescript='/usr/bin'
+installstyle='lib/perl5'
+installusrbinperl='define'
+installvendorarch=''
+installvendorbin=''
+installvendorhtml1dir=''
+installvendorhtml3dir=''
+installvendorlib=''
+installvendorman1dir=''
+installvendorman3dir=''
+installvendorscript=''
+intsize='4'
+issymlink='test -h'
+ivdformat='"ld"'
+ivtype='long'
+ksh=''
+ld_can_script='define'
+ldlibpthname='LD_LIBRARY_PATH'
+less='less'
+lib_ext='.a'
+libc=''
+libdb_needs_pthread='N'
+libperl='libperl.so'
+libpth="$owrt:staging_dir/lib $owrt:staging_dir/usr/lib"
+libsdirs="$owrt:staging_dir/lib $owrt:staging_dir/usr/lib"
+libspath="$owrt:staging_dir/lib $owrt:staging_dir/usr/lib"
+libswanted_uselargefiles=''
+line=''
+lint=''
+lkflags=''
+ln='ln'
+lns='/bin/ln -s'
+locincpth=' '
+loclibpth=' '
+longlongsize='8'
+lp=''
+lpr=''
+ls='ls'
+lseeksize='8'
+lseektype='off_t'
+mail=''
+mailx=''
+make='make'
+make_set_make='#'
+mallocobj=''
+mallocsrc=''
+malloctype='void *'
+man1dir=' '
+man1direxp=''
+man1ext='0'
+man3dir=' '
+man3direxp=''
+man3ext='0'
+mips_type=''
+mistrustnm=''
+mkdir='mkdir'
+mmaptype='void *'
+modetype='mode_t'
+more='more'
+multiarch='undef'
+mv=''
+mydomain='.dev.null'
+n='-n'
+netdb_hlen_type='size_t'
+netdb_name_type='const char *'
+netdb_net_type='in_addr_t'
+nm='nm'
+nm_opt=''
+nm_so_opt='--dynamic'
+nroff='nroff'
+nvEUformat='"E"'
+nvFUformat='"F"'
+nvGUformat='"G"'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
+nveformat='"e"'
+nvfformat='"f"'
+nvgformat='"g"'
+nvsize='8'
+nvtype='double'
+o_nonblock='O_NONBLOCK'
+obj_ext='.o'
+old_pthread_create_joinable=''
+optimize='-O2'
+orderlib='false'
+osname='linux'
+otherlibdirs=' '
+package='perl5'
+pager='/usr/bin/less'
+passcat='cat /etc/passwd'
+path_sep=':'
+perl=''
+perl5=''
+perl_patchlevel=''
+perl_static_inline='static __inline__'
+perlpath='/usr/bin/perl'
+pg='pg'
+phostname='hostname'
+pidtype='pid_t'
+plibpth=''
+pmake=''
+pr=''
+prefix='/usr'
+prefixexp='/usr'
+procselfexe='"/proc/self/exe"'
+prototype='define'
+randbits='48'
+randfunc='drand48'
+randseedtype='long'
+ranlib=':'
+rd_nodata='-1'
+rm='rm'
+rm_try='/bin/rm -f try try a.out .out try.[cho] try..o core core.try* try.core*'
+rmail=''
+run=''
+runnm='false'
+sched_yield='sched_yield()'
+scriptdir='/usr/bin'
+scriptdirexp='/usr/bin'
+sed='sed'
+seedfunc='srand48'
+selecttype='fd_set *'
+sendmail=''
+setgrent_r_proto='0'
+sethostent_r_proto='0'
+setlocale_r_proto='0'
+setnetent_r_proto='0'
+setprotoent_r_proto='0'
+setpwent_r_proto='0'
+setservent_r_proto='0'
+sh='/bin/sh'
+shar=''
+sharpbang='#!'
+shmattype='void *'
+shortsize='2'
+shrpenv=''
+shsharp='true'
+signal_t='void'
+sitearch=''
+sitearchexp=''
+sitebin='/usr/bin'
+sitebinexp='/usr/bin'
+sitehtml1dir=''
+sitehtml1direxp=''
+sitehtml3dir=''
+sitehtml3direxp=''
+sitelib=''
+sitelibexp=''
+siteman1dir=''
+siteman1direxp=''
+siteman3dir=''
+siteman3direxp=''
+siteprefix='/usr'
+siteprefixexp='/usr'
+sitescript='/usr/bin'
+sitescriptexp='/usr/bin'
+sizetype='size_t'
+sleep=''
+smail=''
+so='so'
+sockethdr=''
+socketlib=''
+socksizetype='socklen_t'
+sort='sort'
+spackage='Perl5'
+spitshell='cat'
+src='.'
+ssizetype='ssize_t'
+st_ino_sign='1'
+st_ino_size='8'
+startperl='#!/usr/bin/perl'
+startsh='#!/bin/sh'
+static_ext=' '
+stdchar='char'
+stdio_base='((fp)->_base)'
+stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)'
+stdio_cnt='((fp)->_cnt)'
+stdio_filbuf=''
+stdio_ptr='((fp)->_ptr)'
+stdio_stream_array=''
+submit=''
+sysman='/usr/share/man/man1'
+sysroot=''
+tail=''
+tar=''
+targetdir=''
+targetenv=''
+targethost=''
+targetmkdir=''
+targetport=''
+targetsh='/bin/sh'
+tbl=''
+tee=''
+test='test'
+timetype='time_t'
+to=':'
+touch='touch'
+tr='tr'
+trnl='\n'
+troff=''
+u16size='2'
+u16type='unsigned short'
+u32size='4'
+u64size='8'
+u8size='1'
+u8type='unsigned char'
+uidsign='1'
+uidsize='4'
+uidtype='uid_t'
+uname='uname'
+uniq='uniq'
+use5005threads='undef'
+usecbacktrace='undef'
+usecrosscompile='define'
+usedevel='undef'
+usedl='define'
+usedtrace='undef'
+usefaststdio='undef'
+usekernprocpathname='undef'
+uselargefiles='define'
+uselongdouble='undef'
+usemallocwrap='define'
+usemorebits='undef'
+usemymalloc='n'
+usenm='true'
+usensgetexecutablepath='undef'
+useopcode='true'
+useperlio='define'
+useposix='true'
+usequadmath='undef'
+usereentrant='undef'
+userelocatableinc='undef'
+usesfio='false'
+useshrplib='true'
+usesitecustomize='undef'
+usesocks='undef'
+usevendorprefix='undef'
+useversionedarchname='undef'
+usevfork='false'
+usrinc="$owrt:staging_dir/include $owrt:staging_dir/usr/include"
+uuname=''
+uvXUformat='"lX"'
+uvoformat='"lo"'
+uvtype='unsigned long'
+uvuformat='"lu"'
+uvxformat='"lx"'
+vaproto='define'
+vendorarch=''
+vendorarchexp=''
+vendorbin=''
+vendorbinexp=''
+vendorhtml1dir=' '
+vendorhtml1direxp=''
+vendorhtml3dir=' '
+vendorhtml3direxp=''
+vendorlib=''
+vendorlib_stem=''
+vendorlibexp=''
+vendorman1dir=' '
+vendorman1direxp=''
+vendorman3dir=' '
+vendorman3direxp=''
+vendorprefix=''
+vendorprefixexp=''
+vendorscript=''
+vendorscriptexp=''
+versiononly='undef'
+vi=''
+voidflags='15'
+xlibpth='/usr/lib/386 /lib/386'
+yacc='yacc'
+yaccflags=''
+zcat=''
+zip='zip'
+
+config_argc=1
+config_args='-der'
+
+# Tools
+cpprun="$owrt:target_cc -E"
+cppstdin="$owrt:target_cc -E"
+cc="$owrt:target_cc"
+ld="$cc"
+full_ar="${owrt:target_cross}ar"
+
+# Tool flags
+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"
+cccdlflags='-fPIC'
+ldflags=''
+ldflags_uselargefiles=''
+lddlflags="-shared $owrt:ldflags"
+
+# Libraries
+perllibs='-ldl -lm -lcrypt -lutil -lc'
+libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'
+libsfiles='libdl.so libm.so libcrypt.so libutil.so libc.so'
+libswanted='sfio socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
diff --git a/lang/perl/files/i486.config b/lang/perl/files/i486.config
new file mode 100644 (file)
index 0000000..b44c64e
--- /dev/null
@@ -0,0 +1,28 @@
+owrt:arch=i486
+owrt:bits=32
+owrt:endian=little
+
+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_modflproto='define'
+doublekind='3'
+fpossize='20'
+longdblkind='3'
+need_va_copy='undef'
+quadkind='3'
+
+sPRIEUldbl='"LE"'
+sPRIFUldbl='"LF"'
+sPRIGUldbl='"LG"'
+sPRIXU64='"LX"'
+sPRIeldbl='"Le"'
+sPRIfldbl='"Lf"'
+sPRIgldbl='"Lg"'
+sSCNfldbl='"Lf"'
+
+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'
diff --git a/lang/perl/files/libc.config b/lang/perl/files/libc.config
new file mode 100644 (file)
index 0000000..93d190c
--- /dev/null
@@ -0,0 +1,47 @@
+($owrt:libc eq 'glibc') {
+       perllibs="$perllibs -lbsd"
+       ldflags="$ldflags -L$owrt:staging_dir/lib"
+}
+
+# uclibc does not provide crypt_r().
+($owrt:libc eq 'uclibc') {
+       crypt_r_proto='0'
+       d_crypt_r='undef'
+}
+
+($owrt:libc eq 'musl') {
+       # musl does not provide a working setlocale(). It accepts arbitrary locales
+       # and makes them act as if they were C.UTF-8.
+       d_setlocale='undef'
+       
+       d_stdio_ptr_lval='undef'
+       d_stdio_ptr_lval_sets_cnt='undef'
+       d_stdiobase='undef'
+       d_stdstdio='undef'
+       
+       d_getnetbyname_r='undef'
+       
+       d_getprotobyname_r='undef'
+       d_getpwent_r='undef'
+       d_getservent_r='undef'
+       d_gethostent_r='undef'
+       d_getnetent_r='undef'
+       d_getnetbyaddr_r='undef'
+       d_getprotoent_r='undef'
+       d_getprotobynumber_r='undef'
+       d_getgrent_r='undef'
+       
+       getprotobyname_r='undef'
+       getpwent_r='undef'
+       getservent_r='undef'
+       gethostent_r='undef'
+       getnetent_r='undef'
+       getnetbyaddr_r='undef'
+       getprotoent_r='undef'
+       getprotobynumber_r='undef'
+       getgrent_r='undef'
+       
+       i_fcntl='define'
+       h_fcntl='true'
+       d_strerror_r='undef'
+}
diff --git a/lang/perl/files/mips.config b/lang/perl/files/mips.config
new file mode 100644 (file)
index 0000000..05e807b
--- /dev/null
@@ -0,0 +1,19 @@
+owrt:arch=mips
+owrt:bits=32
+owrt:endian=big
+
+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_modflproto='undef'
+doublekind='4'
+fpossize='24'
+longdblkind='0'
+need_va_copy='undef'
+quadkind='3'
+
+owrt:sig_count=128
+owrt:sigs='ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM USR1 USR2 CHLD PWR WINCH URG IO STOP TSTP CONT TTIN TTOU VTALRM PROF XCPU XFSZ'
+owrt:sig_name_extra='IOT CLD POLL'
+owrt:sig_num_extra='6 18 22'
diff --git a/lang/perl/files/mips64.config b/lang/perl/files/mips64.config
new file mode 100644 (file)
index 0000000..89875f7
--- /dev/null
@@ -0,0 +1,19 @@
+owrt:arch=mips64
+owrt:bits=64
+owrt:endian=big
+
+ccsymbols=''
+cppccsymbols=''
+cppsymbols=''
+d_casti32='define'
+d_modflproto='undef'
+doublekind='4'
+fpossize='24'
+longdblkind='6'
+need_va_copy='define'
+quadkind='2'
+
+owrt:sig_count=128
+owrt:sigs='ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM USR1 USR2 CHLD PWR WINCH URG IO STOP TSTP CONT TTIN TTOU VTALRM PROF XCPU XFSZ'
+owrt:sig_name_extra='IOT CLD POLL'
+owrt:sig_num_extra='6 18 22'
diff --git a/lang/perl/files/mipsel.config b/lang/perl/files/mipsel.config
new file mode 100644 (file)
index 0000000..d209a0d
--- /dev/null
@@ -0,0 +1,19 @@
+owrt:arch=mipsel
+owrt:bits=32
+owrt:endian=little
+
+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_modflproto='undef'
+doublekind='3'
+fpossize='24'
+longdblkind='0'
+need_va_copy='undef'
+quadkind='3'
+
+owrt:sig_count=128
+owrt:sigs='ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM USR1 USR2 CHLD PWR WINCH URG IO STOP TSTP CONT TTIN TTOU VTALRM PROF XCPU XFSZ'
+owrt:sig_name_extra='IOT CLD POLL'
+owrt:sig_num_extra='6 18 22'
diff --git a/lang/perl/files/misc.config b/lang/perl/files/misc.config
new file mode 100644 (file)
index 0000000..3e8f6bd
--- /dev/null
@@ -0,0 +1,11 @@
+cf_email='naoir@gmx.net'
+osvers='3.18.19'
+gccversion="$owrt:gccversion"
+myhostname='OpenWrt'
+cf_time='Thu Jan 1 12:00:00 CEST 2015'
+
+perladmin="$cf_email"
+archname="$owrt:arch-linux-$owrt:libc"
+targetarch="$archname"
+myarchname="$archname"
+myuname="Linux $myhostname $osvers #1 SMP $cf_time @{[$owrt:arch =~ s/(el|eb)$//r]} GNU/Linux"
diff --git a/lang/perl/files/perl-run_tests.sh b/lang/perl/files/perl-run_tests.sh
new file mode 100755 (executable)
index 0000000..bf83c0a
--- /dev/null
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+PERL_TESTSDIR="/usr/share/perl/perl-tests"
+PERL_LIBDIR="/usr/lib/perl5/%%PERL_VERSION%%/"
+PERL_DISABLEDTESTS="%%PERL_DISABLEDTESTS%%"
+
+no_run=""
+manual_run=""
+manual_run_no_base=""
+
+while [ ! -z "$1" ]; do
+       case $1 in
+               -n)
+                       no_run="yes"
+                       ;;
+               -m)
+                       manual_run="yes"
+                       ;;
+               -mb)
+                       manual_run="yes"
+                       manual_run_no_base="yes"
+                       ;;
+               --help)
+                       echo "run_tests.sh [-n|-m|-mb|--help]"
+                       echo ""
+                       echo "Options:"
+                       echo "  -n        Just prepare the environment. Don't actually run any tests"
+                       echo "  -m        Run tests manually according to MANIFEST, instead of whatever t/TEST chooses"
+                       echo "  -mb       Don't run base tests. Implies -m"
+                       echo "  --help    Print this help ;)"
+                       echo ""
+                       exit 0
+                       ;;
+               *)
+                       echo "Invalid argument: $1"
+                       ;;
+       esac
+       shift
+done
+
+if [ ! -f "$PERL_TESTSDIR/__prepared" ]; then
+       # Many tests insist on having PERL5LIB in $PERL_TESTSDIR/lib. However,
+       # that directory may also contain tests. Some of them(FindBin.t in particular)
+       # also demand being located in a directory ending with "lib". So we can't do symlink
+       # trickery here.
+       # Our solution is to just copy PERL5LIB over.
+       if [ -d "$PERL_TESTSDIR/lib" ]; then
+               cp -a "$PERL_LIBDIR/"* "$PERL_TESTSDIR/lib/"
+       else
+               ln -s "$PERL_LIBDIR" "$PERL_TESTSDIR/lib"
+       fi
+
+       ln -s /usr/bin/perl "$PERL_TESTSDIR/perl"
+       ln -s /usr/bin/perl "$PERL_TESTSDIR/t/perl"
+       touch "$PERL_TESTSDIR/__prepared"
+       
+       for i in $PERL_DISABLEDTESTS; do
+               echo "Disabling $i tests"
+               sed 's!^'$i'.*$!!' -i $PERL_TESTSDIR/MANIFEST
+       done
+       
+       cat $PERL_TESTSDIR/MANIFEST | grep -v '^$' > $PERL_TESTSDIR/MANIFEST_NEW
+       rm $PERL_TESTSDIR/MANIFEST
+       mv $PERL_TESTSDIR/MANIFEST_NEW $PERL_TESTSDIR/MANIFEST
+fi
+
+if [ -z "$no_run" ]; then
+       cd "$PERL_TESTSDIR/t"
+       if [ ! -z "$manual_run" ]; then
+               for i in $(cat ../MANIFEST | sed 's/\t.*$//g' | grep '\.t$'); do
+                       if [ ! -z "$manual_run_no_base" ] && [ ! -z "$(echo $i | grep '^t/')" ]; then
+                               continue;
+                       fi
+                       echo "Running $i"
+                       ./TEST ../$i
+                       echo ""
+               done
+       else
+               ./perl TEST
+       fi
+fi
diff --git a/lang/perl/files/perlconfig.pl b/lang/perl/files/perlconfig.pl
new file mode 100644 (file)
index 0000000..f169980
--- /dev/null
@@ -0,0 +1,313 @@
+#!/usr/bin/perl
+
+# 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 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/>.
+# 
+# Copyright 2015 Marcel Denia
+
+=head1 NAME
+
+perlconfig.pl
+
+=head1 SYNOPSIS
+
+B<perlconfig.pl> [B<-Dsymbol>=I<value>, ...] [B<-dsymbol>=I<value>, ...] I<[files]>
+
+Generate a configuration file suitable for (cross-)compiling perl 5.
+
+=head1 OPTIONS
+
+=over
+
+=item B<-Dsymbol=value>
+
+The symbol identified by I<name> will have the literal value I<value>.
+When generating the configuration file, it's value will be printed enclosed by
+single quotation marks(').
+
+=item B<-dsymbol=value>
+
+The symbol identified by I<name> will have the literal value I<value>.
+
+=back
+
+=head1 DESCRIPTION
+
+B<perlconfig.pl> is a program to compile and generate configuration files ready
+to be used as a "config.sh" file for compiling perl 5. It does so by processing
+specially-made configuration files(usually called *.config), typically augmented
+by command-line definitions.
+
+B<perlconfig.pl>'s intent is to be used in place of perl 5's own Configure
+script in situations where it can not be run, like cross-compiling.
+
+=head2 File syntax
+
+B<perlconfig.pl>'s configuration files a consist of symbol definitions in
+different variations, each one assigning a specific symbol identified by a name
+some value, as well as conditional blocks in order to allow for some
+flexibility.
+
+=head3 Symbol names
+
+A symbol name has to consist entirely of alphanumeric characters as well as
+the underscore(_) character. In addition, symbol names may be prefixed with an
+all-lowercase string, separated by a colon(:):
+
+  my:name=value
+
+Having a zero-length prefix string is also valid:
+
+  :name=value
+
+Symbols prefixed that way are called private symbols. They act exactly like
+regular symbols, with the only difference being that they will B<not> be written
+to the final configuration file.
+
+=head3 Symbol definitions
+
+A symbol definition is in the form of a simple name/value pair, separated by
+an equals sign(=):
+
+  name=value
+
+I<value> can be anything really. However, there are 3 notations, with
+differences in quoting and interpolation:
+
+=over
+
+=item name=foo
+
+The symbol identified by I<name> will have the literal value I<foo>.
+
+=item name='foo'
+
+The symbol identified by I<name> will have the literal value I<foo>.
+When generating the configuration file, it's value will be printed enclosed by
+single quotation marks(').
+
+=item name="foo"
+
+The symbol identified by I<name> will have the value of I<foo>
+S<B<after interpolation>>(as described in L</Interpolation>).
+When generating the configuration file, it's value will be printed enclosed by
+single quotation marks(').
+
+=back
+
+=head3 Conditional blocks
+
+A conditional block is of the form
+
+  (condition) {
+      ...
+  }
+
+B<perlconfig.pl> will execute everything enclosed in the curly braces({ and }),
+or inside the BLOCK in Perl 5 terms, if I<condition> evaluates to any true
+value. I<condition> will go through interpolation as described in
+L</Interpolation>. It may contain any valid Perl 5 expression. Some common
+examples are:
+
+=over
+
+=item $name eq 'foo'
+
+Evaluates to true if configuration symbol I<name> is literally equal to I<foo>.
+
+=item $name ne 'foo'
+
+Evaluates to true if configuration symbol I<name> is B<not> literally equal to
+I<foo>.
+
+=item defined($name)
+
+Evaluates to true if configuration symbol I<name> is defined(has any usable
+value, see L<perlfunc/defined>).
+
+=back
+
+Conditional blocks may be nested inside conditional blocks. Note that the
+opening curl brace({) has to be on the same line as your condition.
+
+=head3 Comments
+
+All lines starting with nothing or any number of whitespaces, followed by a
+hash sign(#), are considered comments and will be completely ignored by
+B<perlconfig.pl>.
+
+=head3 Interpolation
+
+In certain situations(see above), B<perlconfig.pl> will interpolate strings or
+constructs in order to allow you to refer to configuration symbols or embed
+code.
+
+Interpolated strings are subject to the following rules:
+
+=over
+
+=item You may not include any single(') or double(") quotation marks.
+
+You can use \qq in order to include double quotation marks(") in your string.
+
+=item $name and ${name} reference configuration symbols
+
+You can easily refer to existing configuration symbols using the commmon $name
+or ${name} syntax. In case you want to refer to the perl variable named $name,
+write \$name. This is useful for embedding code.
+
+=item Perl 5 interpolation rules apply
+
+Aside from the above, you may include anything that is also valid for an
+interpolated(qq//) string in Perl 5. For instance, it's perfectly valid to
+execute code using the @{[]} construct.
+
+=back
+
+=head1 EXAMPLES
+
+As a simple example, consider the following configuration file, named
+"example.config":
+
+  recommendation='The Perl you want is'
+  ($:maturity eq 'stable') {
+      recommendation="$recommendation Perl 5"
+  }
+  ($:maturity eq 'experimental') {
+      recommendation="$recommendation Perl 6(try Rakudo!)"
+  }
+
+Executing it using these command-lines will yield the following results:
+
+=over
+
+=item $ perlconfig.pl -D:maturity=stable example.config
+
+  recommendation='The Perl you want is Perl 5'
+
+=item $ perlconfig.pl -D:maturity=experimental example.config
+
+  recommendation='The Perl you want is Perl 6(try Rakudo!)'
+
+=back
+
+=head1 AUTHOR
+
+Marcel Denia <naoir@gmx.net>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2015 Marcel Denia
+
+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 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/>.
+
+=cut
+
+use strict;
+use warnings;
+use List::Util qw/all/;
+my $symbol_name_prefix_regex = '(?:[a-z]*:)';
+my $symbol_name_regex = "($symbol_name_prefix_regex?(?:[a-zA-Z0-9_]+))";
+
+my %config;
+
+sub interpolate {
+       my $string = shift;
+       my %options = @_;
+       
+       # First, convert $foo into ${foo}
+       $string =~ s/(?<!\\)\$$symbol_name_regex/\${$1}/gs;
+       
+       # Make ${foo} into $config{'foo'}->{value}
+       $string =~ s/\$\{$symbol_name_regex\}/\$config{\'$1\'}->{value}/g;
+       
+       # Un-escape \$foo
+       $string =~ s/\\\$/\$/g;
+       
+       # Turn \qq into "
+       $string =~ s/\\qq/\\"/g;
+       
+       return $string;
+}
+
+# Parse command-line symbol definitions
+while ($ARGV[0]) {
+       if ($ARGV[0] =~ /^-([D|d])$symbol_name_regex=(.*)$/) {
+               $config{$2} = { value => $3, quoted => $1 eq 'D' };
+               shift(@ARGV);
+       }
+       else {
+               last;
+       }
+}
+
+# Process configuration files
+my @condition_stack = ( 1 );
+for my $file (@ARGV) {
+       open(my $fh, '<', $file) or die "Can't open $file: $!\n";
+       while (my $line = <$fh>) {
+               chomp($line);
+               
+               if ($line =~ /^\s*$symbol_name_regex=(.*)$/) { # A symbol definition
+                       if (all {$_ == 1} @condition_stack) {
+                               my $symbol = $1;
+                               (my $quote_begin, my $value, my $quote_end) = $2 =~ /^(['|"])?([^'"]*)(['|"])?$/;
+                               
+                               $quote_begin = '' unless defined $quote_begin;
+                               $quote_end = '' unless defined $quote_end;
+                               die "$file:$.: Unmatched quotes in \"$line\"\n" unless $quote_begin eq $quote_end;
+                               
+                               if ($quote_begin eq '"') {
+                                       $config{$symbol} = { value => eval('"' . interpolate($2) . '"'), quoted => 1 };
+                               }
+                               else {
+                                       $config{$symbol} = { value => $2, quoted => $quote_begin eq '\'' };
+                               }
+                       }
+               }
+               elsif ($line =~ /^\s*\((.*)\)\s?{$/) { # A conditional block
+                       if (eval(interpolate($1))) {
+                               push(@condition_stack, 1);
+                       }
+                       else {
+                               push(@condition_stack, 0);
+                       }
+               }
+               elsif ($line =~ /^\s*}$/) { # Closing a conditional block
+                       pop(@condition_stack);
+                       die "$file:$.: Closing non-existent block\n" unless @condition_stack;
+               }
+               elsif ($line =~ (/^\s*$/) || ($line =~ /^\s*#/)) { # An empty line or comment
+               }
+               else {
+                       die "$file:$.: Malformed line: \"$line\"\n";
+               }
+       }
+}
+
+# Output
+for (sort(keys(%config))) {
+       my $quote = $config{$_}->{quoted} ? '\'' : '';
+       print("$_=$quote$config{$_}->{value}$quote\n") unless $_ =~ /^$symbol_name_prefix_regex/;
+}
\ No newline at end of file
diff --git a/lang/perl/files/powerpc.config b/lang/perl/files/powerpc.config
new file mode 100644 (file)
index 0000000..33af767
--- /dev/null
@@ -0,0 +1,19 @@
+owrt:arch=powerpc
+owrt:bits=32
+owrt:endian=big
+
+ccsymbols='__gnu_linux__=1 __linux=1 __linux__=1 __unix=1 __unix__=1 system=linux system=posix system=unix'
+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_modflproto='undef'
+doublekind='4'
+fpossize='24'
+longdblkind='0'
+need_va_copy='define'
+quadkind='3'
+
+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'
diff --git a/lang/perl/files/signal.config b/lang/perl/files/signal.config
new file mode 100644 (file)
index 0000000..183d3b9
--- /dev/null
@@ -0,0 +1,18 @@
+# Signal table helper
+
+(defined($owrt:sigs)) {
+       sig_name="$owrt:sigs"
+       (($owrt:libc eq 'glibc') || ($owrt:libc eq 'uclibc')) {
+               sig_name="$sig_name NUM32 NUM33 RTMIN NUM35 NUM36"
+       }
+       ($owrt:libc eq 'musl') {
+               sig_name="$sig_name NUM32 NUM33 NUM34 RTMIN NUM36"
+       }
+       
+       sig_name="$sig_name @{[map({qq/NUM\$_/} 37..$owrt:sig_count - 2)]} RTMAX $owrt:sig_name_extra"
+       sig_num="@{[0..$owrt:sig_count - 1]} $owrt:sig_num_extra "
+       sig_count="$owrt:sig_count"
+       sig_size="@{[scalar(split(q/ /, $sig_name))]}"
+       sig_name_init="@{[join(q/, /, map({qq/\qq\$_\qq/} split(q/ /, $sig_name)))]}, 0"
+       sig_num_init="@{[join(q/, /, split(q/ /, $sig_num))]}, 0"
+}
diff --git a/lang/perl/files/threads.config b/lang/perl/files/threads.config
new file mode 100644 (file)
index 0000000..e0a2f82
--- /dev/null
@@ -0,0 +1,197 @@
+($owrt:threads eq 'yes') {
+       # Configure arguments
+       config_args="$config_args -Dusethreads"
+       config_arg2='-Dusethreads'
+       config_argc=2
+       
+       # Options
+       useithreads='define'
+       usemultiplicity='define'
+       usethreads='define'
+       
+       # Flags and related
+       ccflags="-D_REENTRANT -D_GNU_SOURCE $ccflags"
+       cppflags="-D_REENTRANT -D_GNU_SOURCE $cppflags"
+       perllibs="-lpthread $perllibs"
+       libs="-lpthread $libs"
+       libsfiles="libpthread.so $libsfiles"
+       libswanted="pthread $libswanted"
+       
+       
+       crypt_r_proto='REENTRANT_PROTO_B_CCS'
+       i_crypt='define'
+       d_crypt='define'
+       d_crypt_r='define'
+       
+       # Prototypes
+       asctime_r_proto='REENTRANT_PROTO_B_SB'
+       ctime_r_proto='REENTRANT_PROTO_B_SB'
+       drand48_r_proto='REENTRANT_PROTO_I_ST'
+       getgrent_r_proto='REENTRANT_PROTO_I_SBWR'
+       getgrgid_r_proto='REENTRANT_PROTO_I_TSBWR'
+       getgrnam_r_proto='REENTRANT_PROTO_I_CSBWR'
+       gethostbyaddr_r_proto='REENTRANT_PROTO_I_TsISBWRE'
+       gethostbyname_r_proto='REENTRANT_PROTO_I_CSBWRE'
+       gethostent_r_proto='REENTRANT_PROTO_I_SBWRE'
+       getlogin_r_proto='REENTRANT_PROTO_I_BW'
+       getnetbyaddr_r_proto='REENTRANT_PROTO_I_uISBWRE'
+       getnetbyname_r_proto='REENTRANT_PROTO_I_CSBWRE'
+       getnetent_r_proto='REENTRANT_PROTO_I_SBWRE'
+       getprotobyname_r_proto='REENTRANT_PROTO_I_CSBWR'
+       getprotobynumber_r_proto='REENTRANT_PROTO_I_ISBWR'
+       getprotoent_r_proto='REENTRANT_PROTO_I_SBWR'
+       getpwent_r_proto='REENTRANT_PROTO_I_SBWR'
+       getpwnam_r_proto='REENTRANT_PROTO_I_CSBWR'
+       getpwuid_r_proto='REENTRANT_PROTO_I_TSBWR'
+       getservbyname_r_proto='REENTRANT_PROTO_I_CCSBWR'
+       getservbyport_r_proto='REENTRANT_PROTO_I_ICSBWR'
+       getservent_r_proto='REENTRANT_PROTO_I_SBWR'
+       getspnam_r_proto='REENTRANT_PROTO_I_CSBWR'
+       gmtime_r_proto='REENTRANT_PROTO_S_TS'
+       localtime_r_proto='REENTRANT_PROTO_S_TS'
+       random_r_proto='REENTRANT_PROTO_I_St'
+       readdir64_r_proto='REENTRANT_PROTO_I_TSR'
+       readdir_r_proto='REENTRANT_PROTO_I_TSR'
+       srand48_r_proto='REENTRANT_PROTO_I_LS'
+       srandom_r_proto='REENTRANT_PROTO_I_TS'
+       strerror_r_proto='REENTRANT_PROTO_B_IBW'
+       tmpnam_r_proto='REENTRANT_PROTO_B_B'
+       ttyname_r_proto='REENTRANT_PROTO_I_IBW'
+       
+       # Defines
+       d_asctime_r='define'
+       d_ctime_r='define'
+       d_drand48_r='define'
+       d_fds_bits='define'
+       d_fegetround='undef'
+       d_getgrent_r='define'
+       d_getgrgid_r='define'
+       d_getgrnam_r='define'
+       d_gethostbyaddr_r='define'
+       d_gethostbyname_r='define'
+       d_gethostent_r='define'
+       d_getlogin_r='define'
+       d_getnetbyaddr_r='define'
+       d_getnetbyname_r='define'
+       d_getnetent_r='define'
+       d_getprotobyname_r='define'
+       d_getprotobynumber_r='define'
+       d_getprotoent_r='define'
+       d_getpwent_r='define'
+       d_getpwnam_r='define'
+       d_getpwuid_r='define'
+       d_getservbyname_r='define'
+       d_getservbyport_r='define'
+       d_getservent_r='define'
+       d_getspnam_r='define'
+       d_gmtime_r='define'
+       d_j0='undef'
+       d_j0l='undef'
+       d_localtime_r='define'
+       d_localtime_r_needs_tzset='define'
+       d_nexttoward='undef'
+       d_off64_t='define'
+       d_pthread_atfork='define'
+       d_pthread_yield='define'
+       d_random_r='define'
+       d_readdir64_r='define'
+       d_readdir_r='define'
+       d_srand48_r='define'
+       d_srandom_r='define'
+       d_sresgproto='define'
+       d_sresuproto='define'
+       d_strerror_r='define'
+       d_tmpnam_r='define'
+       d_ttyname_r='define'
+}
+($owrt:threads eq 'no') {
+       # Options
+       useithreads='undef'
+       usemultiplicity='undef'
+       usethreads='undef'
+       
+       # Prototyypes
+       asctime_r_proto='0'
+       crypt_r_proto='0'
+       ctime_r_proto='0'
+       drand48_r_proto='0'
+       getgrent_r_proto='0'
+       getgrgid_r_proto='0'
+       getgrnam_r_proto='0'
+       gethostbyaddr_r_proto='0'
+       gethostbyname_r_proto='0'
+       gethostent_r_proto='0'
+       getlogin_r_proto='0'
+       getnetbyaddr_r_proto='0'
+       getnetbyname_r_proto='0'
+       getnetent_r_proto='0'
+       getprotobyname_r_proto='0'
+       getprotobynumber_r_proto='0'
+       getprotoent_r_proto='0'
+       getpwent_r_proto='0'
+       getpwnam_r_proto='0'
+       getpwuid_r_proto='0'
+       getservbyname_r_proto='0'
+       getservbyport_r_proto='0'
+       getservent_r_proto='0'
+       getspnam_r_proto='0'
+       gmtime_r_proto='0'
+       
+       # Defines
+       d_asctime_r='undef'
+       d_crypt='define'
+       d_crypt_r='undef'
+       d_ctime_r='undef'
+       d_drand48_r='undef'
+       d_fds_bits='undef'
+       d_fegetround='define'
+       d_getgrent_r='undef'
+       d_getgrgid_r='undef'
+       d_getgrnam_r='undef'
+       d_gethostbyaddr_r='undef'
+       d_gethostbyname_r='undef'
+       d_gethostent_r='undef'
+       d_getlogin_r='undef'
+       d_getnetbyaddr_r='undef'
+       d_getnetbyname_r='undef'
+       d_getnetent_r='undef'
+       d_getprotobyname_r='undef'
+       d_getprotobynumber_r='undef'
+       d_getprotoent_r='undef'
+       d_getpwent_r='undef'
+       d_getpwnam_r='undef'
+       d_getpwuid_r='undef'
+       d_getservbyname_r='undef'
+       d_getservbyport_r='undef'
+       d_getservent_r='undef'
+       d_getspnam_r='undef'
+       d_gmtime_r='undef'
+       d_j0='define'
+       d_j0l='define'
+       d_localtime_r='undef'
+       d_localtime_r_needs_tzset='undef'
+       d_nexttoward='define'
+       d_off64_t='undef'
+       d_pthread_atfork='undef'
+       d_pthread_yield='undef'
+       d_random_r='undef'
+       d_readdir64_r='undef'
+       d_readdir_r='undef'
+       d_srand48_r='undef'
+       d_srandom_r='undef'
+       d_sresgproto='undef'
+       d_sresuproto='undef'
+       d_strerror_r='undef'
+       d_tmpnam_r='undef'
+       d_ttyname_r='undef'
+       i_crypt='define'
+       localtime_r_proto='0'
+       random_r_proto='0'
+       readdir64_r_proto='0'
+       readdir_r_proto='0'
+       srand48_r_proto='0'
+       srandom_r_proto='0'
+       strerror_r_proto='0'
+       tmpnam_r_proto='0'
+       ttyname_r_proto='0'
+}
diff --git a/lang/perl/files/version.config b/lang/perl/files/version.config
new file mode 100644 (file)
index 0000000..98cd2a5
--- /dev/null
@@ -0,0 +1,38 @@
+# Set the version here
+PERL_REVISION=5
+PERL_VERSION=22
+PERL_SUBVERSION=1
+
+# (api_revison, api_version, api_subversion) = (revision, version, 0) usually
+PERL_API_REVISION=5
+PERL_API_VERSION=22
+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'
+extensions='B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call GDBM_File Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Tie/Hash/NamedCapture Time/HiRes Time/Piece Unicode/Collate XS/APItest XS/Typemap arybase attributes mro re threads threads/shared Archive/Tar Attribute/Handlers AutoLoader B/Debug CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Carp Config/Perl/V Devel/SelfStubber Digest Dumpvalue Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS File/Fetch File/Find File/Path File/Temp FileCache Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata NEXT Net/Ping Params/Check Parse/CPAN/Meta Perl/OSType PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local XSLoader autodie autouse base bignum constant encoding/warnings experimental if lib libnet parent perlfaq podlators Unicode/Normalize version'
+nonxs_ext='Archive/Tar Attribute/Handlers AutoLoader B/Debug CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Carp Config/Perl/V Devel/SelfStubber Digest Dumpvalue Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS File/Fetch File/Find File/Path File/Temp FileCache Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata NEXT Net/Ping Params/Check Parse/CPAN/Meta Perl/OSType PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local XSLoader autodie autouse base bignum constant encoding/warnings experimental if lib libnet parent perlfaq podlators Unicode/Normalize version'
+dynamic_ext='B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call GDBM_File Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Tie/Hash/NamedCapture Time/HiRes Time/Piece Unicode/Collate XS/APItest XS/Typemap arybase attributes mro re threads threads/shared'
+
+# No need to change anything from here on
+owrt:perllibpath="/usr/lib/perl5/$PERL_REVISION.$PERL_VERSION"
+
+revision="$PERL_REVISION"
+patchlevel="$PERL_VERSION"
+subversion="$PERL_SUBVERSION"
+version_patchlevel_string="version $PERL_VERSION subversion $PERL_SUBVERSION"
+version="$PERL_REVISION.$PERL_VERSION.$PERL_SUBVERSION"
+
+api_revision="$PERL_API_REVISION"
+api_version="$PERL_API_VERSION"
+api_subversion="$PERL_API_SUBVERSION"
+api_versionstring="$PERL_API_REVISION.$PERL_API_VERSION.$PERL_API_SUBVERSION"
+
+privlib="$owrt:perllibpath"
+privlibexp="$privlib"
+archlib="$owrt:perllibpath"
+archlibexp="$archlib"
+
+installarchlib="$owrt:perllibpath"
+installprivlib="$owrt:perllibpath"
+installsitearch="$owrt:perllibpath"
+installsitelib="$owrt:perllibpath"
diff --git a/lang/perl/files/x86_64.config b/lang/perl/files/x86_64.config
new file mode 100644 (file)
index 0000000..a9cb581
--- /dev/null
@@ -0,0 +1,28 @@
+owrt:arch=x86_64
+owrt:bits=64
+owrt:endian=little
+
+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_modflproto='define'
+doublekind='3'
+fpossize='16'
+longdblkind='3'
+need_va_copy='define'
+quadkind='2'
+
+sPRIEUldbl='"LE"'
+sPRIFUldbl='"LF"'
+sPRIGUldbl='"LG"'
+sPRIXU64='"lX"'
+sPRIeldbl='"Le"'
+sPRIfldbl='"Lf"'
+sPRIgldbl='"Lg"'
+sSCNfldbl='"Lf"'
+
+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'
diff --git a/lang/perl/patches/010-musl-compat.patch b/lang/perl/patches/010-musl-compat.patch
new file mode 100644 (file)
index 0000000..8dbad78
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/pp.c
++++ b/pp.c
+@@ -43,7 +43,7 @@ extern Pid_t getpid (void);
+  * Some BSDs and Cygwin default to POSIX math instead of IEEE.
+  * This switches them over to IEEE.
+  */
+-#if defined(LIBM_LIB_VERSION)
++#if defined(LIBM_LIB_VERSION) && (defined(__GLIBC__) || defined(__UCLIBC__))
+     _LIB_VERSION_TYPE _LIB_VERSION = _IEEE_;
+ #endif
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
new file mode 100644 (file)
index 0000000..956466d
--- /dev/null
@@ -0,0 +1,27 @@
+--- 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'
diff --git a/lang/perl/patches/100-fix-cross-compile-endianness-detection.patch b/lang/perl/patches/100-fix-cross-compile-endianness-detection.patch
new file mode 100644 (file)
index 0000000..e187941
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/config_h.SH
++++ b/config_h.SH
+@@ -52,6 +52,19 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#und
+ #ifndef _config_h_
+ #define _config_h_
++#if defined(USE_CROSS_COMPILE) && !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
++#  include <endian.h>
++#  if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
++#    if (__BYTE_ORDER == __LITTLE_ENDIAN)
++#      define __LITTLE_ENDIAN__
++#    elif (__BYTE_ORDER == __BIG_ENDIAN)
++#      define __BIG_ENDIAN__
++#    else
++#      error Unknown endianness
++#    endif
++#  endif
++#endif
++
+ /* LOC_SED:
+  *    This symbol holds the complete pathname to the sed program.
+  */
diff --git a/lang/perl/patches/110-always_use_miniperl.patch b/lang/perl/patches/110-always_use_miniperl.patch
new file mode 100644 (file)
index 0000000..9f9f812
--- /dev/null
@@ -0,0 +1,27 @@
+--- a/Makefile.SH
++++ b/Makefile.SH
+@@ -316,22 +316,11 @@ MANIFEST_SRT = MANIFEST.srt
+ !GROK!THIS!
+-case "$usecrosscompile$perl" in
+-define?*)
+-      $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)
+-!GROK!THIS!
+-      ;;
+-*)
+-      $spitshell >>$Makefile <<!GROK!THIS!
++$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
+ !GROK!THIS!
+-      ;;
+-esac
+ $spitshell >>$Makefile <<!GROK!THIS!
+ # Macros to run our tests
diff --git a/lang/perl/patches/300-add-relink-hack.patch b/lang/perl/patches/300-add-relink-hack.patch
new file mode 100644 (file)
index 0000000..fd3d386
--- /dev/null
@@ -0,0 +1,6 @@
+--- /dev/null
++++ b/relink/Makefile.PL
+@@ -0,0 +1,3 @@
++use ExtUtils::MakeMaker;
++
++WriteMakefile(NAME => "relink");
diff --git a/lang/perl/patches/310-recompile-hack.patch b/lang/perl/patches/310-recompile-hack.patch
new file mode 100644 (file)
index 0000000..05a8e9b
--- /dev/null
@@ -0,0 +1,16 @@
+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/700-tie_fetch_count_t-handle_missing_crypt.patch b/lang/perl/patches/700-tie_fetch_count_t-handle_missing_crypt.patch
new file mode 100644 (file)
index 0000000..f90e5d9
--- /dev/null
@@ -0,0 +1,26 @@
+--- 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/710-threads_join-skip_ps_on_busybox.patch b/lang/perl/patches/710-threads_join-skip_ps_on_busybox.patch
new file mode 100644 (file)
index 0000000..e60ee8c
--- /dev/null
@@ -0,0 +1,81 @@
+perl: Skip $0 test on busybox
+
+This test requires a ps which provides the -f option, as well as suitable output.
+We can't provide either with busybox. Just skip it for now.
+
+Signed-off-by: Marcel Denia <naoir@gmx.net>
+
+--- a/dist/threads/t/join.t
++++ b/dist/threads/t/join.t
+@@ -110,36 +110,41 @@ sub skip {
+ # We parse ps output so this is OS-dependent.
+ if ($^O eq 'linux') {
+-    # First modify $0 in a subthread.
+-    #print "# mainthread: \$0 = $0\n";
+-    threads->create(sub{ #print "# subthread: \$0 = $0\n";
+-                        $0 = "foobar";
+-                        #print "# subthread: \$0 = $0\n"
+-                 })->join;
+-    #print "# mainthread: \$0 = $0\n";
+-    #print "# pid = $$\n";
+-    if (open PS, "ps -f |") { # Note: must work in (all) systems.
+-        my ($sawpid, $sawexe);
+-        while (<PS>) {
+-            chomp;
+-            #print "# [$_]\n";
+-            if (/^\s*\S+\s+$$\s/) {
+-                $sawpid++;
+-                if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces.
+-                    $sawexe++;
+-                }
+-                last;
+-            }
+-        }
+-        close PS or die;
+-        if ($sawpid) {
+-            ok($sawpid && $sawexe, 'altering $0 is effective');
+-        } else {
+-            skip("\$0 check: did not see pid $$ in 'ps -f |'");
+-        }
+-    } else {
+-        skip("\$0 check: opening 'ps -f |' failed: $!");
+-    }
++      if (readlink('/bin/ps') ne 'busybox') {
++              # First modify $0 in a subthread.
++              #print "# mainthread: \$0 = $0\n";
++              threads->create(sub{ #print "# subthread: \$0 = $0\n";
++                                                      $0 = "foobar";
++                                                      #print "# subthread: \$0 = $0\n"
++                                      })->join;
++              #print "# mainthread: \$0 = $0\n";
++              #print "# pid = $$\n";
++              if (open PS, "ps -f |") { # Note: must work in (all) systems.
++                      my ($sawpid, $sawexe);
++                      while (<PS>) {
++                              chomp;
++                              #print "# [$_]\n";
++                              if (/^\s*\S+\s+$$\s/) {
++                                      $sawpid++;
++                                      if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces.
++                                              $sawexe++;
++                                      }
++                                      last;
++                              }
++                      }
++                      close PS or die;
++                      if ($sawpid) {
++                              ok($sawpid && $sawexe, 'altering $0 is effective');
++                      } else {
++                              skip("\$0 check: did not see pid $$ in 'ps -f |'");
++                      }
++              } else {
++                      skip("\$0 check: opening 'ps -f |' failed: $!");
++              }
++      }
++      else {
++              skip("\$0 check: incompatible with busybox");
++      }
+ } else {
+     skip("\$0 check: only on Linux");
+ }
diff --git a/lang/perl/patches/900-CVE-2015-8607.patch b/lang/perl/patches/900-CVE-2015-8607.patch
new file mode 100644 (file)
index 0000000..5f1c1cb
--- /dev/null
@@ -0,0 +1,57 @@
+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/901-CVE-2016-2381.patch b/lang/perl/patches/901-CVE-2016-2381.patch
new file mode 100644 (file)
index 0000000..ee5db6c
--- /dev/null
@@ -0,0 +1,102 @@
+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/perlbase.mk b/lang/perl/perlbase.mk
new file mode 100644 (file)
index 0000000..9ad9d77
--- /dev/null
@@ -0,0 +1,1559 @@
+define Package/perlbase-template
+SUBMENU:=Perl
+SECTION:=lang
+CATEGORY:=Languages
+URL:=http://www.cpan.org/
+DEPENDS:=perl
+endef
+
+define Package/perlbase-anydbm-file
+$(call Package/perlbase-template)
+TITLE:=AnyDBM_File perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-anydbm-file/install
+$(call perlmod/Install,$(1),AnyDBM_File.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/AnyDBM_File.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-anydbm-file))
+
+
+define Package/perlbase-app
+$(call Package/perlbase-template)
+TITLE:=app perl module
+DEPENDS+=+perlbase-autouse +perlbase-base +perlbase-config +perlbase-cpan +perlbase-essential +perlbase-file +perlbase-getopt +perlbase-if +perlbase-tap +perlbase-text
+endef
+
+define Package/perlbase-app/install
+$(call perlmod/Install,$(1),App,)
+endef
+
+$(eval $(call BuildPackage,perlbase-app))
+
+
+define Package/perlbase-archive
+$(call Package/perlbase-template)
+TITLE:=Archive perl module
+DEPENDS+=+perlbase-cwd +perlbase-essential +perlbase-file +perlbase-io
+endef
+
+define Package/perlbase-archive/install
+$(call perlmod/Install,$(1),Archive,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Archive-Tar/bin cpan/Archive-Tar/t)
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ptar $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ptardiff $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ptargrep $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,perlbase-archive))
+
+
+define Package/perlbase-arybase
+$(call Package/perlbase-template)
+TITLE:=arybase perl module
+DEPENDS+=+perlbase-xsloader
+endef
+
+define Package/perlbase-arybase/install
+$(call perlmod/Install,$(1),arybase.pm auto/arybase,)
+$(call perlmod/InstallBaseTests,$(1),ext/arybase/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-arybase))
+
+
+define Package/perlbase-attribute
+$(call Package/perlbase-template)
+TITLE:=Attribute perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-attribute/install
+$(call perlmod/Install,$(1),Attribute,)
+$(call perlmod/InstallBaseTests,$(1),dist/Attribute-Handlers/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-attribute))
+
+
+define Package/perlbase-attributes
+$(call Package/perlbase-template)
+TITLE:=attributes perl module
+DEPENDS+=+perlbase-essential +perlbase-xsloader
+endef
+
+define Package/perlbase-attributes/install
+$(call perlmod/Install,$(1),attributes.pm auto/attributes,)
+endef
+
+$(eval $(call BuildPackage,perlbase-attributes))
+
+
+define Package/perlbase-autodie
+$(call Package/perlbase-template)
+TITLE:=autodie perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-autodie/install
+$(call perlmod/Install,$(1),autodie autodie.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/autodie/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-autodie))
+
+
+define Package/perlbase-autoloader
+$(call Package/perlbase-template)
+TITLE:=AutoLoader perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-autoloader/install
+$(call perlmod/Install,$(1),AutoLoader.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/AutoLoader/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-autoloader))
+
+
+define Package/perlbase-autosplit
+$(call Package/perlbase-template)
+TITLE:=AutoSplit perl module
+DEPENDS+=+perlbase-config +perlbase-essential +perlbase-file
+endef
+
+define Package/perlbase-autosplit/install
+$(call perlmod/Install/NoStrip,$(1),AutoSplit.pm,)
+endef
+
+$(eval $(call BuildPackage,perlbase-autosplit))
+
+
+define Package/perlbase-autouse
+$(call Package/perlbase-template)
+TITLE:=autouse perl module
+endef
+
+define Package/perlbase-autouse/install
+$(call perlmod/Install,$(1),autouse.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/autouse/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-autouse))
+
+
+define Package/perlbase-b
+$(call Package/perlbase-template)
+TITLE:=B perl module
+DEPENDS+=+perlbase-config +perlbase-essential +perlbase-feature
+endef
+
+define Package/perlbase-b/install
+$(call perlmod/Install,$(1),B B.pm auto/B,)
+$(call perlmod/InstallBaseTests,$(1),cpan/B-Debug/t ext/B/t lib/B/Deparse-core.t lib/B/Deparse-subclass.t lib/B/Deparse.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-b))
+
+
+define Package/perlbase-base
+$(call Package/perlbase-template)
+TITLE:=base perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-base/install
+$(call perlmod/Install,$(1),base.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/base/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-base))
+
+
+define Package/perlbase-benchmark
+$(call Package/perlbase-template)
+TITLE:=Benchmark perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-benchmark/install
+$(call perlmod/Install,$(1),Benchmark.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/Benchmark.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-benchmark))
+
+
+define Package/perlbase-bigint
+$(call Package/perlbase-template)
+TITLE:=bigint perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-bigint/install
+$(call perlmod/Install,$(1),bigint.pm,)
+endef
+
+$(eval $(call BuildPackage,perlbase-bigint))
+
+
+define Package/perlbase-bignum
+$(call Package/perlbase-template)
+TITLE:=bignum perl module
+DEPENDS+=+perlbase-bigint +perlbase-essential
+endef
+
+define Package/perlbase-bignum/install
+$(call perlmod/Install,$(1),bignum.pm bigrat.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/bignum/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-bignum))
+
+
+define Package/perlbase-blib
+$(call Package/perlbase-template)
+TITLE:=blib perl module
+DEPENDS+=+perlbase-cwd +perlbase-essential +perlbase-file
+endef
+
+define Package/perlbase-blib/install
+$(call perlmod/Install,$(1),blib.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/blib.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-blib))
+
+
+define Package/perlbase-bytes
+$(call Package/perlbase-template)
+TITLE:=bytes perl module
+endef
+
+define Package/perlbase-bytes/install
+$(call perlmod/Install,$(1),bytes.pm bytes_heavy.pl,)
+$(call perlmod/InstallBaseTests,$(1),lib/bytes.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-bytes))
+
+
+define Package/perlbase-charnames
+$(call Package/perlbase-template)
+TITLE:=charnames perl module
+DEPENDS+=+perlbase-bytes +perlbase-essential +perlbase-re +perlbase-unicore
+endef
+
+define Package/perlbase-charnames/install
+$(call perlmod/Install,$(1),_charnames.pm charnames.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/charnames.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-charnames))
+
+
+define Package/perlbase-class
+$(call Package/perlbase-template)
+TITLE:=Class perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-class/install
+$(call perlmod/Install,$(1),Class,)
+$(call perlmod/InstallBaseTests,$(1),lib/Class/Struct.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-class))
+
+
+define Package/perlbase-compress
+$(call Package/perlbase-template)
+TITLE:=Compress perl module
+DEPENDS+=+perlbase-bytes +perlbase-essential +perlbase-io +perlbase-scalar
+endef
+
+define Package/perlbase-compress/install
+$(call perlmod/Install,$(1),Compress auto/Compress,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Compress-Raw-Bzip2/t cpan/Compress-Raw-Zlib/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-compress))
+
+
+define Package/perlbase-config
+$(call Package/perlbase-template)
+TITLE:=Config perl module
+endef
+
+define Package/perlbase-config/install
+$(call perlmod/Install,$(1),Config Config.pm Config_git.pl Config_heavy.pl,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Config-Perl-V/t lib/Config.t lib/Config/Extensions.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-config))
+
+
+define Package/perlbase-cpan
+$(call Package/perlbase-template)
+TITLE:=CPAN perl module
+DEPENDS+=+perlbase-b +perlbase-config +perlbase-cwd +perlbase-dirhandle +perlbase-essential +perlbase-extutils +perlbase-fcntl +perlbase-file +perlbase-filehandle +perlbase-http-tiny +perlbase-net +perlbase-safe +perlbase-scalar +perlbase-sys +perlbase-text
+endef
+
+define Package/perlbase-cpan/install
+$(call perlmod/Install,$(1),CPAN CPAN.pm Parse/CPAN/Meta.pm,CPAN/FirstTime.pm)
+$(call perlmod/Install/NoStrip,$(1),CPAN/FirstTime.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/CPAN-Meta-Requirements/t cpan/CPAN-Meta-YAML/t cpan/CPAN-Meta/t cpan/CPAN/t cpan/Parse-CPAN-Meta/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-cpan))
+
+
+define Package/perlbase-cwd
+$(call Package/perlbase-template)
+TITLE:=Cwd perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-cwd/install
+$(call perlmod/Install,$(1),Cwd.pm auto/Cwd,)
+endef
+
+$(eval $(call BuildPackage,perlbase-cwd))
+
+
+define Package/perlbase-data
+$(call Package/perlbase-template)
+TITLE:=Data perl module
+DEPENDS+=+perlbase-bytes +perlbase-essential
+endef
+
+define Package/perlbase-data/install
+$(call perlmod/Install,$(1),Data auto/Data,)
+$(call perlmod/InstallBaseTests,$(1),dist/Data-Dumper/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-data))
+
+
+define Package/perlbase-db
+$(call Package/perlbase-template)
+TITLE:=DB perl module
+DEPENDS+=+libdb47 +perlbase-essential +perlbase-meta-notation
+endef
+
+define Package/perlbase-db/install
+$(call perlmod/Install,$(1),DB.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/DB.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-db))
+
+
+define Package/perlbase-db-file
+$(call Package/perlbase-template)
+TITLE:=DB_File perl module
+DEPENDS+=+libdb47 +perlbase-essential +perlbase-tie
+endef
+
+define Package/perlbase-db-file/install
+$(call perlmod/Install,$(1),DB_File.pm auto/DB_File,)
+$(call perlmod/InstallBaseTests,$(1),cpan/DB_File/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-db-file))
+
+
+define Package/perlbase-dbm-filter
+$(call Package/perlbase-template)
+TITLE:=DBM_Filter perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-dbm-filter/install
+$(call perlmod/Install,$(1),DBM_Filter DBM_Filter.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/DBM_Filter/t lib/dbm_filter_util.pl)
+endef
+
+$(eval $(call BuildPackage,perlbase-dbm-filter))
+
+
+define Package/perlbase-devel
+$(call Package/perlbase-template)
+TITLE:=Devel perl module
+DEPENDS+=+perlbase-essential +perlbase-file +perlbase-selfloader +perlbase-xsloader
+endef
+
+define Package/perlbase-devel/install
+$(call perlmod/Install,$(1),Devel auto/Devel,Devel/PPPort.pm)
+$(call perlmod/Install/NoStrip,$(1),Devel/PPPort.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Devel-PPPort/t dist/Devel-SelfStubber/t ext/Devel-Peek/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-devel))
+
+
+define Package/perlbase-diagnostics
+$(call Package/perlbase-template)
+TITLE:=diagnostics perl module
+DEPENDS+=+perlbase-config +perlbase-essential +perlbase-text
+endef
+
+define Package/perlbase-diagnostics/install
+$(call perlmod/Install,$(1),diagnostics.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/diagnostics.t pod/perldiag.pod)
+endef
+
+$(eval $(call BuildPackage,perlbase-diagnostics))
+
+
+define Package/perlbase-digest
+$(call Package/perlbase-template)
+TITLE:=Digest perl module
+DEPENDS+=+perlbase-dynaloader +perlbase-essential +perlbase-fcntl +perlbase-integer
+endef
+
+define Package/perlbase-digest/install
+$(call perlmod/Install,$(1),Digest Digest.pm auto/Digest,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Digest-MD5/MD5.xs cpan/Digest-MD5/t cpan/Digest-SHA/t cpan/Digest/t)
+       $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/cpan/Digest-SHA/src
+endef
+
+$(eval $(call BuildPackage,perlbase-digest))
+
+
+define Package/perlbase-dirhandle
+$(call Package/perlbase-template)
+TITLE:=DirHandle perl module
+DEPENDS+=+perlbase-essential +perlbase-symbol
+endef
+
+define Package/perlbase-dirhandle/install
+$(call perlmod/Install,$(1),DirHandle.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/DirHandle.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-dirhandle))
+
+
+define Package/perlbase-dumpvalue
+$(call Package/perlbase-template)
+TITLE:=Dumpvalue perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-dumpvalue/install
+$(call perlmod/Install,$(1),Dumpvalue.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/Dumpvalue/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-dumpvalue))
+
+
+define Package/perlbase-dumpvar
+$(call Package/perlbase-template)
+TITLE:=dumpvar perl module
+endef
+
+define Package/perlbase-dumpvar/install
+$(call perlmod/Install,$(1),dumpvar.pl,)
+$(call perlmod/InstallBaseTests,$(1),lib/dumpvar.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-dumpvar))
+
+
+define Package/perlbase-dynaloader
+$(call Package/perlbase-template)
+TITLE:=DynaLoader perl module
+DEPENDS+=+perlbase-config
+endef
+
+define Package/perlbase-dynaloader/install
+$(call perlmod/Install,$(1),DynaLoader.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/DynaLoader/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-dynaloader))
+
+
+define Package/perlbase-encode
+$(call Package/perlbase-template)
+TITLE:=Encode perl module
+DEPENDS+=+perlbase-essential +perlbase-mime +perlbase-utf8 +perlbase-xsloader
+endef
+
+define Package/perlbase-encode/install
+$(call perlmod/Install,$(1),Encode Encode.pm auto/Encode,Encode/PerlIO.pod Encode/Supported.pod)
+$(call perlmod/InstallBaseTests,$(1),cpan/Encode/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-encode))
+
+
+define Package/perlbase-encoding
+$(call Package/perlbase-template)
+TITLE:=encoding perl module
+DEPENDS+=+perlbase-encode +perlbase-essential
+endef
+
+define Package/perlbase-encoding/install
+$(call perlmod/Install,$(1),encoding encoding.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/encoding-warnings/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-encoding))
+
+
+define Package/perlbase-english
+$(call Package/perlbase-template)
+TITLE:=English perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-english/install
+$(call perlmod/Install,$(1),English.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/English.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-english))
+
+
+define Package/perlbase-env
+$(call Package/perlbase-template)
+TITLE:=Env perl module
+DEPENDS+=+perlbase-config +perlbase-tie
+endef
+
+define Package/perlbase-env/install
+$(call perlmod/Install,$(1),Env.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/Env/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-env))
+
+
+define Package/perlbase-errno
+$(call Package/perlbase-template)
+TITLE:=Errno perl module
+DEPENDS+=+perlbase-config +perlbase-essential
+endef
+
+define Package/perlbase-errno/install
+$(call perlmod/Install,$(1),Errno.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/Errno/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-errno))
+
+
+define Package/perlbase-essential
+$(call Package/perlbase-template)
+TITLE:=essential perl module
+DEPENDS+=+perlbase-config
+endef
+
+define Package/perlbase-essential/install
+$(call perlmod/Install,$(1),Carp Carp.pm Exporter Exporter.pm constant.pm deprecate.pm lib.pm locale.pm overload.pm overloading.pm parent.pm strict.pm subs.pm vars.pm warnings warnings.pm,)
+$(call perlmod/Install/NoStrip,$(1),overload/numbers.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/parent/t dist/Carp/t dist/Exporter/t dist/constant/t dist/lib/t lib/locale.t lib/overload.t lib/overload64.t lib/overloading.t lib/strict.t lib/subs.t lib/vars.t lib/vars_carp.t lib/warnings.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-essential))
+
+
+define Package/perlbase-experimental
+$(call Package/perlbase-template)
+TITLE:=experimental perl module
+DEPENDS+=+perlbase-essential +perlbase-feature +perlbase-version
+endef
+
+define Package/perlbase-experimental/install
+$(call perlmod/Install,$(1),experimental.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/experimental/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-experimental))
+
+
+define Package/perlbase-extutils
+$(call Package/perlbase-template)
+TITLE:=ExtUtils perl module
+DEPENDS+=+perlbase-autosplit +perlbase-base +perlbase-config +perlbase-cwd +perlbase-dirhandle +perlbase-encode +perlbase-essential +perlbase-file +perlbase-io +perlbase-ipc +perlbase-ostype +perlbase-symbol +perlbase-text
+endef
+
+define Package/perlbase-extutils/install
+$(call perlmod/Install,$(1),ExtUtils,ExtUtils/MakeMaker/FAQ.pod ExtUtils/MakeMaker/Tutorial.pod ExtUtils/ParseXS.pm ExtUtils/ParseXS/Utilities.pm)
+$(call perlmod/Install/NoStrip,$(1),ExtUtils/ParseXS.pm ExtUtils/ParseXS/Utilities.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/ExtUtils-Command/t cpan/ExtUtils-Constant/t cpan/ExtUtils-Install/t cpan/ExtUtils-MakeMaker/t cpan/ExtUtils-Manifest/t dist/ExtUtils-CBuilder/t dist/ExtUtils-ParseXS/t lib/ExtUtils/t lib/h2ph.t lib/h2xs.t utils/h2ph utils/h2xs)
+endef
+
+$(eval $(call BuildPackage,perlbase-extutils))
+
+
+define Package/perlbase-fatal
+$(call Package/perlbase-template)
+TITLE:=Fatal perl module
+DEPENDS+=+perlbase-autodie +perlbase-config +perlbase-essential +perlbase-scalar +perlbase-tie
+endef
+
+define Package/perlbase-fatal/install
+$(call perlmod/Install,$(1),Fatal.pm,)
+endef
+
+$(eval $(call BuildPackage,perlbase-fatal))
+
+
+define Package/perlbase-fcntl
+$(call Package/perlbase-template)
+TITLE:=Fcntl perl module
+DEPENDS+=+perlbase-essential +perlbase-xsloader
+endef
+
+define Package/perlbase-fcntl/install
+$(call perlmod/Install,$(1),Fcntl.pm auto/Fcntl,)
+$(call perlmod/InstallBaseTests,$(1),ext/Fcntl/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-fcntl))
+
+
+define Package/perlbase-feature
+$(call Package/perlbase-template)
+TITLE:=feature perl module
+endef
+
+define Package/perlbase-feature/install
+$(call perlmod/Install,$(1),feature.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/feature.t lib/feature/unicode_strings.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-feature))
+
+
+define Package/perlbase-fields
+$(call Package/perlbase-template)
+TITLE:=fields perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-fields/install
+$(call perlmod/Install,$(1),fields.pm,)
+endef
+
+$(eval $(call BuildPackage,perlbase-fields))
+
+
+define Package/perlbase-file
+$(call Package/perlbase-template)
+TITLE:=File perl module
+DEPENDS+=+perlbase-class +perlbase-config +perlbase-cwd +perlbase-errno +perlbase-essential +perlbase-fcntl +perlbase-filehandle +perlbase-io +perlbase-locale +perlbase-params +perlbase-scalar +perlbase-symbol +perlbase-xsloader
+endef
+
+define Package/perlbase-file/install
+$(call perlmod/Install,$(1),File auto/File,File/Find.pm)
+$(call perlmod/Install/NoStrip,$(1),File/Find.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/File-Fetch/t cpan/File-Path/t cpan/File-Temp/t dist/PathTools/t ext/File-DosGlob/t ext/File-Find/t ext/File-Glob/t lib/File/Basename.t lib/File/Compare.t lib/File/Copy.t lib/File/stat-7896.t lib/File/stat.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-file))
+
+
+define Package/perlbase-filecache
+$(call Package/perlbase-template)
+TITLE:=FileCache perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-filecache/install
+$(call perlmod/Install,$(1),FileCache.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/FileCache/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-filecache))
+
+
+define Package/perlbase-filehandle
+$(call Package/perlbase-template)
+TITLE:=FileHandle perl module
+DEPENDS+=+perlbase-essential +perlbase-io
+endef
+
+define Package/perlbase-filehandle/install
+$(call perlmod/Install,$(1),FileHandle.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/FileHandle.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-filehandle))
+
+
+define Package/perlbase-filetest
+$(call Package/perlbase-template)
+TITLE:=filetest perl module
+endef
+
+define Package/perlbase-filetest/install
+$(call perlmod/Install,$(1),filetest.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/filetest.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-filetest))
+
+
+define Package/perlbase-filter
+$(call Package/perlbase-template)
+TITLE:=Filter perl module
+DEPENDS+=+perlbase-dynaloader +perlbase-essential +perlbase-text
+endef
+
+define Package/perlbase-filter/install
+$(call perlmod/Install,$(1),Filter auto/Filter,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Filter-Util-Call/filter-util.pl cpan/Filter-Util-Call/t dist/Filter-Simple/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-filter))
+
+
+define Package/perlbase-findbin
+$(call Package/perlbase-template)
+TITLE:=FindBin perl module
+DEPENDS+=+perlbase-cwd +perlbase-essential +perlbase-file
+endef
+
+define Package/perlbase-findbin/install
+$(call perlmod/Install,$(1),FindBin.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/FindBin.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-findbin))
+
+
+define Package/perlbase-gdbm-file
+$(call Package/perlbase-template)
+TITLE:=GDBM_File perl module
+DEPENDS+=+libgdbm +perlbase-essential +perlbase-tie +perlbase-xsloader
+endef
+
+define Package/perlbase-gdbm-file/install
+$(call perlmod/Install,$(1),GDBM_File.pm auto/GDBM_File,)
+$(call perlmod/InstallBaseTests,$(1),ext/GDBM_File/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-gdbm-file))
+
+
+define Package/perlbase-getopt
+$(call Package/perlbase-template)
+TITLE:=Getopt perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-getopt/install
+$(call perlmod/Install,$(1),Getopt,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Getopt-Long/t lib/Getopt/Std.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-getopt))
+
+
+define Package/perlbase-hash
+$(call Package/perlbase-template)
+TITLE:=Hash perl module
+DEPENDS+=+perlbase-essential +perlbase-scalar +perlbase-xsloader
+endef
+
+define Package/perlbase-hash/install
+$(call perlmod/Install,$(1),Hash auto/Hash,)
+$(call perlmod/InstallBaseTests,$(1),ext/Hash-Util-FieldHash/t ext/Hash-Util/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-hash))
+
+
+define Package/perlbase-http-tiny
+$(call Package/perlbase-template)
+TITLE:=http-tiny perl module
+DEPENDS+=+perlbase-errno +perlbase-essential +perlbase-io
+endef
+
+define Package/perlbase-http-tiny/install
+$(call perlmod/Install,$(1),HTTP/Tiny.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/HTTP-Tiny/corpus cpan/HTTP-Tiny/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-http-tiny))
+
+
+define Package/perlbase-i18n
+$(call Package/perlbase-template)
+TITLE:=I18N perl module
+DEPENDS+=+perlbase-essential +perlbase-posix +perlbase-xsloader
+endef
+
+define Package/perlbase-i18n/install
+$(call perlmod/Install,$(1),I18N auto/I18N,I18N/LangTags/List.pm)
+$(call perlmod/InstallBaseTests,$(1),dist/I18N-Collate/t dist/I18N-LangTags/t ext/I18N-Langinfo/t)
+$(call perlmod/Install/NoStrip,$(1),I18N/LangTags/List.pm)
+endef
+
+$(eval $(call BuildPackage,perlbase-i18n))
+
+
+define Package/perlbase-if
+$(call Package/perlbase-template)
+TITLE:=if perl module
+endef
+
+define Package/perlbase-if/install
+$(call perlmod/Install,$(1),if.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/if/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-if))
+
+
+define Package/perlbase-integer
+$(call Package/perlbase-template)
+TITLE:=integer perl module
+endef
+
+define Package/perlbase-integer/install
+$(call perlmod/Install,$(1),integer.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/integer.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-integer))
+
+
+define Package/perlbase-io
+$(call Package/perlbase-template)
+TITLE:=IO perl module
+DEPENDS+=+perlbase-base +perlbase-bytes +perlbase-config +perlbase-errno +perlbase-essential +perlbase-fcntl +perlbase-list +perlbase-posix +perlbase-scalar +perlbase-selectsaver +perlbase-socket +perlbase-symbol +perlbase-tie +perlbase-xsloader
+endef
+
+define Package/perlbase-io/install
+$(call perlmod/Install,$(1),IO IO.pm auto/IO,)
+$(call perlmod/InstallBaseTests,$(1),cpan/IO-Compress/t cpan/IO-Socket-IP/t cpan/IO-Zlib/t dist/IO/Makefile.PL dist/IO/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-io))
+
+
+define Package/perlbase-ipc
+$(call Package/perlbase-template)
+TITLE:=IPC perl module
+DEPENDS+=+perlbase-config +perlbase-essential +perlbase-file +perlbase-locale +perlbase-params +perlbase-symbol +perlbase-text
+endef
+
+define Package/perlbase-ipc/install
+$(call perlmod/Install,$(1),IPC auto/IPC,)
+$(call perlmod/InstallBaseTests,$(1),cpan/IPC-Cmd/t cpan/IPC-SysV/t ext/IPC-Open3/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-ipc))
+
+
+define Package/perlbase-json-pp
+$(call Package/perlbase-template)
+TITLE:=json-pp perl module
+DEPENDS+=+perlbase-b +perlbase-base +perlbase-essential
+endef
+
+define Package/perlbase-json-pp/install
+$(call perlmod/Install,$(1),JSON/PP JSON/PP.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/JSON-PP/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-json-pp))
+
+
+define Package/perlbase-less
+$(call Package/perlbase-template)
+TITLE:=less perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-less/install
+$(call perlmod/Install,$(1),less.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/less.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-less))
+
+
+define Package/perlbase-list
+$(call Package/perlbase-template)
+TITLE:=List perl module
+DEPENDS+=+perlbase-essential +perlbase-xsloader
+endef
+
+define Package/perlbase-list/install
+$(call perlmod/Install,$(1),List auto/List,)
+endef
+
+$(eval $(call BuildPackage,perlbase-list))
+
+
+define Package/perlbase-locale
+$(call Package/perlbase-template)
+TITLE:=Locale perl module
+DEPENDS+=+perlbase-essential +perlbase-i18n +perlbase-integer +perlbase-utf8
+endef
+
+define Package/perlbase-locale/install
+$(call perlmod/Install,$(1),Locale,Locale/Constants.pod Locale/Country.pod Locale/Currency.pod Locale/Language.pod Locale/Maketext.pod Locale/Maketext/TPJ13.pod Locale/Script.pod)
+$(call perlmod/InstallBaseTests,$(1),cpan/Locale-Codes/t cpan/Locale-Maketext-Simple/t dist/Locale-Maketext/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-locale))
+
+
+define Package/perlbase-math
+$(call Package/perlbase-template)
+TITLE:=Math perl module
+DEPENDS+=+perlbase-config +perlbase-essential +perlbase-scalar +perlbase-xsloader
+endef
+
+define Package/perlbase-math/install
+$(call perlmod/Install,$(1),Math auto/Math,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Math-Complex/t dist/Math-BigInt-FastCalc/t dist/Math-BigInt/t dist/Math-BigRat/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-math))
+
+
+define Package/perlbase-memoize
+$(call Package/perlbase-template)
+TITLE:=Memoize perl module
+DEPENDS+=+perlbase-config +perlbase-essential +perlbase-storable
+endef
+
+define Package/perlbase-memoize/install
+$(call perlmod/Install,$(1),Memoize Memoize.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Memoize/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-memoize))
+
+
+define Package/perlbase-meta-notation
+$(call Package/perlbase-template)
+TITLE:=meta_notation module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-meta-notation/install
+$(call perlmod/Install,$(1),meta_notation.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/meta_notation.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-meta-notation))
+
+
+define Package/perlbase-mime
+$(call Package/perlbase-template)
+TITLE:=MIME perl module
+DEPENDS+=+perlbase-essential +perlbase-xsloader
+endef
+
+define Package/perlbase-mime/install
+$(call perlmod/Install,$(1),MIME auto/MIME,)
+$(call perlmod/InstallBaseTests,$(1),cpan/MIME-Base64/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-mime))
+
+
+define Package/perlbase-module
+$(call Package/perlbase-template)
+TITLE:=Module perl module
+DEPENDS+=+perlbase-essential +perlbase-file +perlbase-filehandle +perlbase-locale +perlbase-params +perlbase-version
+endef
+
+define Package/perlbase-module/install
+$(call perlmod/Install,$(1),Module,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Module-Load-Conditional/t cpan/Module-Load/t cpan/Module-Loaded/t cpan/Module-Metadata/corpus cpan/Module-Metadata/lib cpan/Module-Metadata/t dist/Module-CoreList/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-module))
+
+
+define Package/perlbase-mro
+$(call Package/perlbase-template)
+TITLE:=mro perl module
+DEPENDS+=+perlbase-essential +perlbase-xsloader
+endef
+
+define Package/perlbase-mro/install
+$(call perlmod/Install,$(1),auto/mro mro.pm,)
+endef
+
+$(eval $(call BuildPackage,perlbase-mro))
+
+
+define Package/perlbase-net
+$(call Package/perlbase-template)
+TITLE:=Net perl module
+DEPENDS+=+perlbase-class +perlbase-errno +perlbase-essential +perlbase-fcntl +perlbase-filehandle +perlbase-io +perlbase-posix +perlbase-socket +perlbase-symbol +perlbase-time
+endef
+
+define Package/perlbase-net/install
+$(call perlmod/Install,$(1),Net,Net/libnetFAQ.pod)
+$(call perlmod/InstallBaseTests,$(1),cpan/libnet/t dist/Net-Ping/t lib/Net/hostent.t lib/Net/netent.t lib/Net/protoent.t lib/Net/servent.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-net))
+
+
+define Package/perlbase-next
+$(call Package/perlbase-template)
+TITLE:=NEXT perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-next/install
+$(call perlmod/Install,$(1),NEXT.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/NEXT/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-next))
+
+
+define Package/perlbase-o
+$(call Package/perlbase-template)
+TITLE:=O perl module
+DEPENDS+=+perlbase-b +perlbase-essential
+endef
+
+define Package/perlbase-o/install
+$(call perlmod/Install,$(1),O.pm,)
+endef
+
+$(eval $(call BuildPackage,perlbase-o))
+
+
+define Package/perlbase-opcode
+$(call Package/perlbase-template)
+TITLE:=Opcode perl module
+DEPENDS+=+perlbase-essential +perlbase-xsloader
+endef
+
+define Package/perlbase-opcode/install
+$(call perlmod/Install,$(1),auto/Opcode,)
+$(call perlmod/Install/NoStrip,$(1),Opcode.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/Opcode/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-opcode))
+
+
+define Package/perlbase-open
+$(call Package/perlbase-template)
+TITLE:=open perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-open/install
+$(call perlmod/Install,$(1),open.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/open.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-open))
+
+
+define Package/perlbase-ops
+$(call Package/perlbase-template)
+TITLE:=ops perl module
+DEPENDS+=+perlbase-opcode
+endef
+
+define Package/perlbase-ops/install
+$(call perlmod/Install,$(1),ops.pm,)
+endef
+
+$(eval $(call BuildPackage,perlbase-ops))
+
+
+define Package/perlbase-ostype
+$(call Package/perlbase-template)
+TITLE:=OSType perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-ostype/install
+$(call perlmod/Install,$(1),Perl/OSType.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Perl-OSType/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-ostype))
+
+
+define Package/perlbase-params
+$(call Package/perlbase-template)
+TITLE:=Params perl module
+DEPENDS+=+perlbase-essential +perlbase-locale
+endef
+
+define Package/perlbase-params/install
+$(call perlmod/Install,$(1),Params,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Params-Check/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-params))
+
+
+define Package/perlbase-perl5db
+$(call Package/perlbase-template)
+TITLE:=perl5db perl module
+DEPENDS+=+perlbase-cwd +perlbase-essential
+endef
+
+define Package/perlbase-perl5db/install
+$(call perlmod/Install,$(1),perl5db.pl,)
+$(call perlmod/InstallBaseTests,$(1),lib/perl5db.t lib/perl5db/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-perl5db))
+
+
+define Package/perlbase-perlio
+$(call Package/perlbase-template)
+TITLE:=PerlIO perl module
+DEPENDS+=+perlbase-essential +perlbase-mime +perlbase-xsloader
+endef
+
+define Package/perlbase-perlio/install
+$(call perlmod/Install,$(1),PerlIO PerlIO.pm auto/PerlIO,)
+$(call perlmod/InstallBaseTests,$(1),cpan/PerlIO-via-QuotedPrint/t ext/PerlIO-encoding/t ext/PerlIO-scalar/t ext/PerlIO-via/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-perlio))
+
+
+define Package/perlbase-pod
+$(call Package/perlbase-template)
+TITLE:=Pod perl module
+DEPENDS+=+perlbase-config +perlbase-cwd +perlbase-encode +perlbase-essential +perlbase-fcntl +perlbase-file +perlbase-getopt +perlbase-integer +perlbase-posix +perlbase-symbol +perlbase-term +perlbase-text
+endef
+
+define Package/perlbase-pod/install
+$(call perlmod/Install,$(1),Pod,Pod/Usage.pm)
+$(call perlmod/Install/NoStrip,$(1),Pod/Usage.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Pod-Checker/t cpan/Pod-Escapes/t cpan/Pod-Parser/lib cpan/Pod-Parser/scripts cpan/Pod-Parser/t cpan/Pod-Perldoc/t cpan/Pod-Simple/t cpan/Pod-Usage/scripts cpan/Pod-Usage/t cpan/podlators/t ext/Pod-Functions/Functions.pm ext/Pod-Functions/t ext/Pod-Html/t lib/Pod/t)
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/pod2man $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/pod2text $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,perlbase-pod))
+
+
+define Package/perlbase-posix
+$(call Package/perlbase-template)
+TITLE:=POSIX perl module
+DEPENDS+=+perlbase-essential +perlbase-fcntl +perlbase-tie +perlbase-xsloader
+endef
+
+define Package/perlbase-posix/install
+$(call perlmod/Install,$(1),POSIX.pm auto/POSIX,)
+$(call perlmod/InstallBaseTests,$(1),ext/POSIX/Makefile.PL ext/POSIX/POSIX.xs ext/POSIX/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-posix))
+
+
+define Package/perlbase-re
+$(call Package/perlbase-template)
+TITLE:=re perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-re/install
+$(call perlmod/Install,$(1),auto/re re.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/re/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-re))
+
+
+define Package/perlbase-safe
+$(call Package/perlbase-template)
+TITLE:=Safe perl module
+DEPENDS+=+perlbase-b +perlbase-essential +perlbase-opcode +perlbase-scalar +perlbase-utf8
+endef
+
+define Package/perlbase-safe/install
+$(call perlmod/Install,$(1),Safe.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/Safe/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-safe))
+
+
+define Package/perlbase-scalar
+$(call Package/perlbase-template)
+TITLE:=Scalar perl module
+DEPENDS+=+perlbase-essential +perlbase-list
+endef
+
+define Package/perlbase-scalar/install
+$(call perlmod/Install,$(1),Scalar Sub,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Scalar-List-Utils/t)
+       $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/cpan/Scalar-List-Utils/blib
+endef
+
+$(eval $(call BuildPackage,perlbase-scalar))
+
+
+define Package/perlbase-sdbm-file
+$(call Package/perlbase-template)
+TITLE:=SDBM_File perl module
+DEPENDS+=+perlbase-essential +perlbase-tie +perlbase-xsloader
+endef
+
+define Package/perlbase-sdbm-file/install
+$(call perlmod/Install,$(1),SDBM_File.pm auto/SDBM_File,)
+$(call perlmod/InstallBaseTests,$(1),ext/SDBM_File/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-sdbm-file))
+
+
+define Package/perlbase-search
+$(call Package/perlbase-template)
+TITLE:=Search perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-search/install
+$(call perlmod/Install,$(1),Search,)
+$(call perlmod/InstallBaseTests,$(1),dist/Search-Dict/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-search))
+
+
+define Package/perlbase-selectsaver
+$(call Package/perlbase-template)
+TITLE:=SelectSaver perl module
+DEPENDS+=+perlbase-essential +perlbase-symbol
+endef
+
+define Package/perlbase-selectsaver/install
+$(call perlmod/Install,$(1),SelectSaver.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/SelectSaver.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-selectsaver))
+
+
+define Package/perlbase-selfloader
+$(call Package/perlbase-template)
+TITLE:=SelfLoader perl module
+DEPENDS+=+perlbase-essential +perlbase-io
+endef
+
+define Package/perlbase-selfloader/install
+$(call perlmod/Install,$(1),SelfLoader.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/SelfLoader/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-selfloader))
+
+
+define Package/perlbase-sigtrap
+$(call Package/perlbase-template)
+TITLE:=sigtrap perl module
+DEPENDS+=+perlbase-essential +perlbase-meta-notation
+endef
+
+define Package/perlbase-sigtrap/install
+$(call perlmod/Install,$(1),sigtrap.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/sigtrap.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-sigtrap))
+
+
+define Package/perlbase-socket
+$(call Package/perlbase-template)
+TITLE:=Socket perl module
+DEPENDS+=+perlbase-essential +perlbase-xsloader
+endef
+
+define Package/perlbase-socket/install
+$(call perlmod/Install,$(1),Socket.pm auto/Socket,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Socket/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-socket))
+
+
+define Package/perlbase-sort
+$(call Package/perlbase-template)
+TITLE:=sort perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-sort/install
+$(call perlmod/Install,$(1),sort.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/sort.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-sort))
+
+
+define Package/perlbase-storable
+$(call Package/perlbase-template)
+TITLE:=Storable perl module
+DEPENDS+=+perlbase-essential +perlbase-xsloader
+endef
+
+define Package/perlbase-storable/install
+$(call perlmod/Install,$(1),Storable.pm auto/Storable,)
+$(call perlmod/InstallBaseTests,$(1),dist/Storable/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-storable))
+
+
+define Package/perlbase-symbol
+$(call Package/perlbase-template)
+TITLE:=Symbol perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-symbol/install
+$(call perlmod/Install,$(1),Symbol.pm,)
+$(call perlmod/InstallBaseTests,$(1),lib/Symbol.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-symbol))
+
+
+define Package/perlbase-sys
+$(call Package/perlbase-template)
+TITLE:=Sys perl module
+DEPENDS+=+perlbase-essential +perlbase-file +perlbase-posix +perlbase-socket
+endef
+
+define Package/perlbase-sys/install
+$(call perlmod/Install,$(1),Sys auto/Sys,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Sys-Syslog/t ext/Sys-Hostname/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-sys))
+
+
+define Package/perlbase-tap
+$(call Package/perlbase-template)
+TITLE:=TAP perl module
+DEPENDS+=+perlbase-base +perlbase-benchmark +perlbase-config +perlbase-essential +perlbase-file +perlbase-io +perlbase-posix +perlbase-text
+endef
+
+define Package/perlbase-tap/install
+$(call perlmod/Install,$(1),TAP,)
+endef
+
+$(eval $(call BuildPackage,perlbase-tap))
+
+
+define Package/perlbase-term
+$(call Package/perlbase-template)
+TITLE:=Term perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-term/install
+$(call perlmod/Install,$(1),Term,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Term-ANSIColor/t cpan/Term-Cap/test.pl dist/Term-Complete/t dist/Term-ReadLine/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-term))
+
+
+define Package/perlbase-test
+$(call Package/perlbase-template)
+TITLE:=Test perl module
+DEPENDS+=+perlbase-base +perlbase-config +perlbase-essential +perlbase-io +perlbase-symbol +perlbase-tap +perlbase-text
+endef
+
+define Package/perlbase-test/install
+$(call perlmod/Install,$(1),Test Test.pm ok.pm,Test/Builder.pm Test/Harness/TAP.pod Test/More.pm Test/Tutorial.pod)
+$(call perlmod/Install/NoStrip,$(1),Test/Builder.pm Test/More.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Test-Harness/t cpan/Test-Simple/t cpan/Test/t)
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/prove $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,perlbase-test))
+
+
+define Package/perlbase-text
+$(call Package/perlbase-template)
+TITLE:=Text perl module
+DEPENDS+=+perlbase-essential +perlbase-selfloader
+endef
+
+define Package/perlbase-text/install
+$(call perlmod/Install,$(1),Text,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Text-Balanced/t cpan/Text-ParseWords/t cpan/Text-Tabs/t dist/Text-Abbrev/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-text))
+
+
+define Package/perlbase-thread
+$(call Package/perlbase-template)
+TITLE:=Thread perl module
+DEPENDS+=+perlbase-essential +perlbase-scalar +perlbase-threads
+endef
+
+define Package/perlbase-thread/install
+$(call perlmod/Install,$(1),Thread Thread.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/Thread-Queue/t dist/Thread-Semaphore/t lib/Thread.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-thread))
+
+
+define Package/perlbase-threads
+$(call Package/perlbase-template)
+TITLE:=threads perl module
+DEPENDS+=+perlbase-config +perlbase-essential +perlbase-scalar +perlbase-xsloader
+endef
+
+define Package/perlbase-threads/install
+$(call perlmod/Install,$(1),auto/threads threads threads.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/threads-shared/t dist/threads/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-threads))
+
+
+define Package/perlbase-tie
+$(call Package/perlbase-template)
+TITLE:=Tie perl module
+DEPENDS+=+perlbase-essential +perlbase-fcntl +perlbase-xsloader
+endef
+
+define Package/perlbase-tie/install
+$(call perlmod/Install,$(1),Tie auto/Tie,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Tie-RefHash/t dist/Tie-File/t ext/Tie-Hash-NamedCapture/t ext/Tie-Memoize/lib/Tie/Memoize.pm ext/Tie-Memoize/t lib/Tie/Array/push.t lib/Tie/Array/splice.t lib/Tie/Array/std.t lib/Tie/Array/stdpush.t lib/Tie/ExtraHash.t lib/Tie/Handle/stdhandle.t lib/Tie/Handle/stdhandle_from_handle.t lib/Tie/Hash.t lib/Tie/Scalar.t lib/Tie/SubstrHash.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-tie))
+
+
+define Package/perlbase-time
+$(call Package/perlbase-template)
+TITLE:=Time perl module
+DEPENDS+=+perlbase-class +perlbase-config +perlbase-dynaloader +perlbase-essential
+endef
+
+define Package/perlbase-time/install
+$(call perlmod/Install,$(1),Time auto/Time,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Time-HiRes/t cpan/Time-Local/t cpan/Time-Piece/t lib/Time/gmtime.t lib/Time/localtime.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-time))
+
+
+define Package/perlbase-unicode
+$(call Package/perlbase-template)
+TITLE:=Unicode perl module
+DEPENDS+=+perlbase-base +perlbase-charnames +perlbase-dynaloader +perlbase-essential +perlbase-file
+endef
+
+define Package/perlbase-unicode/install
+$(call perlmod/Install,$(1),Unicode auto/Unicode,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Unicode-Collate/t cpan/Unicode-Normalize/t lib/Unicode/UCD.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-unicode))
+
+
+define Package/perlbase-unicore
+$(call Package/perlbase-template)
+TITLE:=unicore perl module
+endef
+
+define Package/perlbase-unicore/install
+$(call perlmod/Install,$(1),unicore,)
+$(call perlmod/InstallBaseTests,$(1),lib/unicore/NameAliases.txt lib/unicore/PropValueAliases.txt lib/unicore/PropertyAliases.txt lib/unicore/UnicodeData.txt)
+endef
+
+$(eval $(call BuildPackage,perlbase-unicore))
+
+
+define Package/perlbase-universal
+$(call Package/perlbase-template)
+TITLE:=UNIVERSAL perl module
+endef
+
+define Package/perlbase-universal/install
+$(call perlmod/Install,$(1),UNIVERSAL.pm,)
+endef
+
+$(eval $(call BuildPackage,perlbase-universal))
+
+
+define Package/perlbase-user
+$(call Package/perlbase-template)
+TITLE:=User perl module
+DEPENDS+=+perlbase-class +perlbase-config +perlbase-essential
+endef
+
+define Package/perlbase-user/install
+$(call perlmod/Install,$(1),User,)
+$(call perlmod/InstallBaseTests,$(1),lib/User/grent.t lib/User/pwent.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-user))
+
+
+define Package/perlbase-utf8
+$(call Package/perlbase-template)
+TITLE:=utf8 perl module
+DEPENDS+=+perlbase-essential +perlbase-re +perlbase-unicore
+endef
+
+define Package/perlbase-utf8/install
+$(call perlmod/Install,$(1),utf8.pm utf8_heavy.pl,)
+$(call perlmod/InstallBaseTests,$(1),lib/utf8.t)
+endef
+
+$(eval $(call BuildPackage,perlbase-utf8))
+
+
+define Package/perlbase-version
+$(call Package/perlbase-template)
+TITLE:=version perl module
+DEPENDS+=+perlbase-config +perlbase-essential
+endef
+
+define Package/perlbase-version/install
+$(call perlmod/Install,$(1),version version.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/version/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-version))
+
+
+define Package/perlbase-xsloader
+$(call Package/perlbase-template)
+TITLE:=XSLoader perl module
+endef
+
+define Package/perlbase-xsloader/install
+$(call perlmod/Install,$(1),XSLoader.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/XSLoader/t ext/XS-APItest/t ext/XS-Typemap/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-xsloader))
+
+
+# Generated Fri Sep 25 07:47:59 2015
diff --git a/lang/perl/perlmod.mk b/lang/perl/perlmod.mk
new file mode 100644 (file)
index 0000000..be56608
--- /dev/null
@@ -0,0 +1,166 @@
+# This makefile simplifies perl module builds.
+#
+
+PERL_VERSION:=5.22
+
+# Build environment
+HOST_PERL_PREFIX:=$(STAGING_DIR_HOSTPKG)/usr
+ifneq ($(CONFIG_USE_GLIBC),)
+       EXTRA_LIBS:=bsd
+       EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
+endif
+PERL_CMD:=$(STAGING_DIR_HOSTPKG)/usr/bin/perl$(PERL_VERSION).0
+
+MOD_CFLAGS_PERL:=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(TARGET_CFLAGS) $(TARGET_CPPFLAGS)
+ifdef CONFIG_PERL_THREADS
+       MOD_CFLAGS_PERL+= -D_REENTRANT -D_GNU_SOURCE
+endif
+
+# Module install prefix
+PERL_SITELIB:=/usr/lib/perl5/$(PERL_VERSION)
+PERL_TESTSDIR:=/usr/share/perl/perl-tests
+PERLBASE_TESTSDIR:=/usr/share/perl/perlbase-tests
+PERLMOD_TESTSDIR:=/usr/share/perl/perlmod-tests
+
+define perlmod/host/relink
+       rm -f $(1)/Makefile.aperl
+       $(MAKE) -C $(1) perl
+       $(CP) $(1)/perl $(PERL_CMD)
+       $(CP) $(1)/perl $(STAGING_DIR_HOSTPKG)/usr/bin/perl
+endef
+
+define perlmod/host/Configure
+       (cd $(HOST_BUILD_DIR); \
+       PERL_MM_USE_DEFAULT=1 \
+       $(2) \
+       $(PERL_CMD) Makefile.PL \
+               $(1) \
+       );
+endef
+
+define perlmod/host/Compile
+       $(2) \
+       $(MAKE) -C $(HOST_BUILD_DIR) \
+               $(1) \
+               install
+endef
+
+define perlmod/host/Install
+       $(2) \
+       $(MAKE) -C $(HOST_BUILD_DIR) \
+               $(1) \
+               install
+       $(call perlmod/host/relink,$(HOST_BUILD_DIR))
+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"' \
+               $(1) \
+               AR=ar \
+               CC=$(GNU_TARGET_NAME)-gcc \
+               CCFLAGS="$(MOD_CFLAGS_PERL)" \
+               CCCDLFLAGS=-fPIC \
+               CCDLFLAGS=-Wl,-E \
+               DLEXT=so \
+               DLSRC=dl_dlopen.xs \
+               EXE_EXT=" " \
+               FULL_AR=$(GNU_TARGET_NAME)-ar \
+               LD=$(GNU_TARGET_NAME)-gcc \
+               LDDLFLAGS="-shared -rdynamic $(TARGET_LDFLAGS)"  \
+               LDFLAGS="$(EXTRA_LIBDIRS:%=-L%) $(EXTRA_LIBS:%=-l%) " \
+               LIBC=" " \
+               LIB_EXT=.a \
+               OBJ_EXT=.o \
+               OSNAME=linux \
+               OSVERS=2.4.30 \
+               RANLIB=: \
+               SITELIBEXP=" " \
+               SITEARCHEXP=" " \
+               SO=so  \
+               VENDORARCHEXP=" " \
+               VENDORLIBEXP=" " \
+               SITEPREFIX=/usr \
+               INSTALLPRIVLIB=$(PERL_SITELIB) \
+               INSTALLSITELIB=$(PERL_SITELIB) \
+               INSTALLVENDORLIB=" " \
+               INSTALLARCHLIB=$(PERL_SITELIB) \
+               INSTALLSITEARCH=$(PERL_SITELIB) \
+               INSTALLVENDORARCH=" " \
+               INSTALLBIN=/usr/bin \
+               INSTALLSITEBIN=/usr/bin \
+               INSTALLVENDORBIN=" " \
+               INSTALLSCRIPT=/usr/bin \
+               INSTALLSITESCRIPT=/usr/bin \
+               INSTALLVENDORSCRIPT=" " \
+               INSTALLMAN1DIR=/usr/man/man1 \
+               INSTALLSITEMAN1DIR=/usr/man/man1 \
+               INSTALLVENDORMAN1DIR=" " \
+               INSTALLMAN3DIR=/usr/man/man3 \
+               INSTALLSITEMAN3DIR=/usr/man/man3 \
+               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
+endef
+
+define perlmod/Compile
+       PERL5LIB=$(PERL_LIB) \
+       $(2) \
+       $(MAKE) -C $(if $(3),$(3),$(PKG_BUILD_DIR)) \
+               $(1) \
+               install
+endef
+
+define perlmod/Install/NoStrip
+       $(INSTALL_DIR) $(strip $(1))$(PERL_SITELIB)
+       (cd $(PKG_INSTALL_DIR)$(PERL_SITELIB) && \
+       rsync --relative -rlHp --itemize-changes \
+               --exclude=\*.pod \
+               --exclude=.packlist \
+               $(addprefix --exclude=/,$(strip $(3))) \
+               --prune-empty-dirs \
+               $(strip $(2)) $(strip $(1))$(PERL_SITELIB))
+
+       chmod -R u+w $(strip $(1))$(PERL_SITELIB)
+endef
+
+
+define perlmod/_DoStrip
+       @echo "---> Stripping modules in: $(strip $(1))$(PERL_SITELIB)"
+       find $(strip $(1))$(PERL_SITELIB) -name \*.pm -or -name \*.pl | \
+       xargs -r sed -i \
+               -e '/^=\(head\|pod\|item\|over\|back\|encoding\|begin\|end\|for\)/,/^=cut/d' \
+               -e '/^=\(head\|pod\|item\|over\|back\|encoding\|begin\|end\|for\)/,$$$$d' \
+               -e '/^#$$$$/d' \
+               -e '/^#[^!"'"'"']/d'
+endef
+
+define perlmod/Install
+       $(call perlmod/Install/NoStrip,$(1),$(2),$(3))
+
+       $(if $(CONFIG_PERL_NOCOMMENT),$(if $(PKG_LEAVE_COMMENTS),,$(call perlmod/_DoStrip,$(1),$(2),$(3))))
+endef
+
+# You probably don't want to use this directly. Look at perlmod/InstallTests
+define perlmod/_InstallTests
+       $(INSTALL_DIR) $(strip $(1))
+       (cd $(PKG_BUILD_DIR)/$(2) && \
+       rsync --relative -rlHp --itemize-changes \
+               --exclude=.packlist \
+               --prune-empty-dirs \
+               $(strip $(3)) $(strip $(1)))
+
+       chmod -R u+w $(strip $(1))
+endef
+
+define perlmod/InstallBaseTests
+       $(if $(CONFIG_PERL_TESTS),$(call perlmod/_InstallTests,$(1)$(PERL_TESTSDIR),,$(2)))
+endef
+
+define perlmod/InstallTests
+       $(if $(CONFIG_PERL_TESTS),$(call perlmod/_InstallTests,$(1)$(PERL_TESTSDIR),$(2),$(3)))
+endef
diff --git a/lang/php7-pecl-dio/Makefile b/lang/php7-pecl-dio/Makefile
new file mode 100644 (file)
index 0000000..9c1d52e
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PECL_NAME:=dio
+PECL_LONGNAME:=Direct I/O functions
+
+PKG_VERSION:=0.0.9
+PKG_RELEASE:=1
+PKG_MD5SUM:=2c80b63fbbbaead856cb468955c14dc328d1262621b0c704b122d902053c8156
+
+PKG_NAME:=php7-pecl-$(PECL_NAME)
+PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://pecl.php.net/get/
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php7/$(PECL_NAME)-$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_LICENSE:=PHPv3.01
+PKG_LICENSE_FILES:=
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include ../php7/pecl.mk
+
+$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME)))
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/lang/php7-pecl-http/Makefile b/lang/php7-pecl-http/Makefile
new file mode 100644 (file)
index 0000000..be9267a
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PECL_NAME:=pecl_http
+PECL_LONGNAME:=Extended HTTP Support
+
+PKG_VERSION:=3.1.0
+PKG_RELEASE:=2
+PKG_MD5SUM:=e3de67b156e7d5f6c2e5eb1e2b5f0acceb7004f1260d68c9f8b2c0f9629aabf0
+
+PKG_NAME:=php7-pecl-http
+PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://pecl.php.net/get/
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DEPENDS:=php7 php7-pecl-propro php7-pecl-raphf
+PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php7/$(PECL_NAME)-$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include ../php7/pecl.mk
+
+CONFIGURE_VARS+= \
+       PECL_cv_HAVE_EXT_propro=yes \
+       PECL_cv_HAVE_EXT_raphf=yes \
+       PECL_cv_HAVE_LIBCURL_ARES=no \
+       PECL_cv_HAVE_LIBCURL_OpenSSL=$(if $(CONFIG_LIBCURL_OPENSSL),yes,no) \
+       PECL_cv_HAVE_LIBCURL_GnuTLS=$(if $(CONFIG_LIBCURL_GNUTLS),yes,no) \
+       PECL_cv_HAVE_LIBCURL_NSS=no \
+       PECL_cv_HAVE_LIBCURL_SecureTransport=no \
+       PECL_cv_HAVE_LIBCURL_GSKit=no \
+       PECL_cv_HAVE_LIBCURL_PolarSSL=no \
+       PECL_cv_HAVE_LIBCURL_WolfSSL=$(if $(CONFIG_LIBCURL_CYASSL),yes,no) \
+       PECL_cv_HAVE_LIBCURL_mbedTLS=$(if $(CONFIG_LIBCURL_MBEDTLS),yes,no) \
+       PECL_cv_HAVE_LIBCURL_axTLS=no \
+       PECL_cv_LIBCURL_TLSAUTH_SRP=$(if $(CONFIG_LIBCURL_TLS_SRP),yes,no) \
+
+CONFIGURE_ARGS+= \
+       --with-http \
+       --without-http-shared-deps \
+       --with-http-libcurl-dir="$(STAGING_DIR)/usr" \
+       --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 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
new file mode 100644 (file)
index 0000000..304a1df
--- /dev/null
@@ -0,0 +1,22 @@
+--- 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/100_php_http_etag_bigendian_check.patch b/lang/php7-pecl-http/patches/100_php_http_etag_bigendian_check.patch
new file mode 100644 (file)
index 0000000..ee925c4
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/php_http_etag.c      2016-12-12 10:04:21.000000000 +0100
++++ b/src/php_http_etag.c      2016-12-23 21:10:59.523222367 +0100
+@@ -60,7 +60,7 @@
+               unsigned char buf[4];
+               *((uint *) e->ctx) = ~*((uint *) e->ctx);
+-#if WORDS_BIGENDIAN
++#ifdef WORDS_BIGENDIAN
+               etag = php_http_etag_digest((unsigned char *) e->ctx, 4);
+ #else
+               buf[0] = ((unsigned char *) e->ctx)[3];
diff --git a/lang/php7-pecl-libevent/Makefile b/lang/php7-pecl-libevent/Makefile
new file mode 100644 (file)
index 0000000..272b34a
--- /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
+
+PECL_NAME:=libevent
+PECL_LONGNAME:=Libevent - event notification
+
+PKG_NAME:=php7-pecl-$(PECL_NAME)
+PKG_VERSION=2016-08-30-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+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_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_LICENSE:=PHPv3.01
+PKG_LICENSE_FILES:=
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php7/$(PECL_NAME)-$(PKG_SOURCE_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include ../php7/pecl.mk
+
+CONFIGURE_ARGS+= --with-libevent=shared,"$(STAGING_DIR)/usr"
+
+$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME),+libevent2 +php7-mod-sockets,25))
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/lang/php7-pecl-libevent/patches/010-libevent2.patch b/lang/php7-pecl-libevent/patches/010-libevent2.patch
new file mode 100644 (file)
index 0000000..961fb36
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/libevent.c
++++ b/libevent.c
+@@ -42,10 +42,12 @@
+       (rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type))
+ #endif
+-#ifdef PHP_WIN32
++//#ifdef PHP_WIN32
+ /* XXX compiling with 2.x on Windows. Luckily the ext code works thanks to the
+ compat exports from the libevent. However it might need to be adapted to the
+ never version, so this ifdefs would go away. */
++#if 1
++/* force use of libevent2 on OpenWrt and by-pass compat event.h */
+ # include <event2/event.h>
+ # include <event2/event_compat.h>
+ # include <event2/event_struct.h>
diff --git a/lang/php7-pecl-propro/Makefile b/lang/php7-pecl-propro/Makefile
new file mode 100644 (file)
index 0000000..3bfe535
--- /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
+
+PECL_NAME:=propro
+PECL_LONGNAME:=Property proxy
+
+PKG_VERSION:=2.0.1
+PKG_RELEASE:=2
+PKG_MD5SUM:=19f9517210a87e18cc09faed262e1522
+
+PKG_NAME:=php7-pecl-propro
+PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://pecl.php.net/get/
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php7/$(PECL_NAME)-$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include ../php7/pecl.mk
+
+CONFIGURE_ARGS+= \
+       --enable-propro
+
+define Build/InstallDev
+       mkdir -p $(STAGING_DIR)/usr/include/php7/ext/$(PECL_NAME)
+       $(CP) $(PKG_BUILD_DIR)/php_propro.h $(STAGING_DIR)/usr/include/php7/ext/$(PECL_NAME)/
+       $(CP) $(PKG_BUILD_DIR)/php_propro_api.h $(STAGING_DIR)/usr/include/php7/ext/$(PECL_NAME)/
+endef
+
+$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME)))
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/lang/php7-pecl-raphf/Makefile b/lang/php7-pecl-raphf/Makefile
new file mode 100644 (file)
index 0000000..4ce09f9
--- /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
+
+PECL_NAME:=raphf
+PECL_LONGNAME:=Resource and persistent handles factory
+
+PKG_VERSION:=2.0.0
+PKG_RELEASE:=2
+PKG_MD5SUM:=bc465eb5caa9d0f09cced121a8ac2e8e
+
+PKG_NAME:=php7-pecl-raphf
+PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://pecl.php.net/get/
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php7/$(PECL_NAME)-$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include ../php7/pecl.mk
+
+CONFIGURE_ARGS+= \
+       --enable-raphf
+
+define Build/InstallDev
+       mkdir -p $(STAGING_DIR)/usr/include/php7/ext/$(PECL_NAME)
+       cp $(PKG_BUILD_DIR)/php_raphf.h $(STAGING_DIR)/usr/include/php7/ext/$(PECL_NAME)/
+       cp $(PKG_BUILD_DIR)/php_raphf_api.h $(STAGING_DIR)/usr/include/php7/ext/$(PECL_NAME)/
+endef
+
+$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME)))
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/lang/php7/Makefile b/lang/php7/Makefile
new file mode 100644 (file)
index 0000000..6cd2beb
--- /dev/null
@@ -0,0 +1,594 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=php
+PKG_VERSION:=7.1.1
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_LICENSE:=PHPv3.01
+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_FIXUP:=libtool autoreconf
+PKG_BUILD_PARALLEL:=1
+PKG_USE_MIPS16:=0
+
+PHP7_MODULES = \
+       calendar ctype curl \
+       fileinfo \
+       dom \
+       exif \
+       ftp \
+       gettext gd gmp \
+       hash \
+       iconv intl \
+       json \
+       ldap \
+       mbstring mcrypt mysqli \
+       opcache openssl \
+       pcntl pdo pdo-mysql pdo-pgsql pdo-sqlite pgsql phar \
+       session shmop simplexml 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
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/php7/Default
+  SUBMENU:=PHP
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=PHP7 Hypertext preprocessor
+  URL:=http://www.php.net/
+  DEPENDS:=php7
+endef
+
+define Package/php7/Default/description
+  PHP is a widely-used general-purpose scripting language that is especially
+  suited for Web development and can be embedded into HTML.
+endef
+
+define Package/php7/config
+       config PHP7_FILTER
+               bool "PHP7 Filter support"
+               depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
+
+       config PHP7_LIBXML
+               bool "PHP7 LIBXML support"
+               depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
+
+       config PHP7_SYSTEMTZDATA
+               bool "Use system timezone data instead of php's built-in database"
+               depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
+               select PACKAGE_zoneinfo-core
+               default y
+               help
+                       Enabling this feature automatically selects the zoneinfo-core package
+                       which contains data for UTC timezone. To use other timezones you have
+                       to install the corresponding zoneinfo-... package(s).
+endef
+
+define Package/php7
+  $(call Package/php7/Default)
+
+  DEPENDS:=+libpcre +zlib \
+           +PHP7_LIBXML:libxml2
+endef
+
+define Package/php7/description
+  $(call Package/php7/Default/description)
+  This package contains only the PHP config file. You must actually choose
+  your PHP flavour (cli, cgi or fastcgi).
+
+  Please note, that installing php5 and php7 in parallel on the same target
+  is not supported in OpenWrt/LEDE.
+endef
+
+define Package/php7-cli
+  $(call Package/php7/Default)
+  DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
+  TITLE+= (CLI)
+endef
+
+define Package/php7-cli/description
+  $(call Package/php7/Default/description)
+  This package contains the CLI version of the PHP7 interpreter.
+endef
+
+define Package/php7-cgi
+  $(call Package/php7/Default)
+  DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
+  TITLE+= (CGI & FastCGI)
+endef
+
+define Package/php7-cgi/description
+  $(call Package/php7/Default/description)
+  This package contains the CGI version of the PHP7 interpreter.
+endef
+
+define Package/php7-fastcgi
+  $(call Package/php7/Default)
+  DEPENDS+= +php7-cgi
+  TITLE:=FastCGI startup script
+endef
+
+define Package/php7-fastcgi/description
+  As FastCGI support is now a core feature the php7-fastcgi package now depends
+  on the php7-cgi package, containing just the startup script.
+endef
+
+define Package/php7-fpm
+  $(call Package/php7/Default)
+  DEPENDS+= +php7-cgi
+  TITLE+= (FPM)
+endef
+
+define Package/php7-fpm/description
+  $(call Package/php7/Default/description)
+  This package contains the FastCGI Process Manager of the PHP7 interpreter.
+endef
+
+CONFIGURE_ARGS+= \
+       --enable-cli \
+       --enable-cgi \
+       --enable-fpm \
+       --enable-shared \
+       --disable-static \
+       --disable-rpath \
+       --disable-debug \
+       --disable-phpdbg \
+       --without-pear \
+       \
+       --with-config-file-path=/etc \
+       --with-config-file-scan-dir=/etc/php7 \
+       --disable-short-tags \
+       \
+       --with-zlib="$(STAGING_DIR)/usr" \
+         --with-zlib-dir="$(STAGING_DIR)/usr"
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-calendar),)
+  CONFIGURE_ARGS+= --enable-calendar=shared
+else
+  CONFIGURE_ARGS+= --disable-calendar
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ctype),)
+  CONFIGURE_ARGS+= --enable-ctype=shared
+else
+  CONFIGURE_ARGS+= --disable-ctype
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-curl),)
+  CONFIGURE_ARGS+= --with-curl=shared,"$(STAGING_DIR)/usr"
+else
+  CONFIGURE_ARGS+= --without-curl
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-fileinfo),)
+  CONFIGURE_ARGS+= --enable-fileinfo=shared
+else
+  CONFIGURE_ARGS+= --disable-fileinfo
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gettext),)
+  CONFIGURE_ARGS+= --with-gettext=shared,"$(STAGING_DIR)/usr/lib/libintl-full"
+else
+  CONFIGURE_ARGS+= --without-gettext
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-dom),)
+  CONFIGURE_ARGS+= --enable-dom=shared
+else
+  CONFIGURE_ARGS+= --disable-dom
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-exif),)
+  CONFIGURE_ARGS+= --enable-exif=shared
+else
+  CONFIGURE_ARGS+= --disable-exif
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ftp),)
+  CONFIGURE_ARGS+= --enable-ftp=shared
+else
+  CONFIGURE_ARGS+= --disable-ftp
+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 ($(SDK)$(CONFIG_PACKAGE_php7-mod-gmp),)
+  CONFIGURE_ARGS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
+else
+  CONFIGURE_ARGS+= --without-gmp
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-hash),)
+  CONFIGURE_ARGS+= --enable-hash=shared
+else
+  CONFIGURE_ARGS+= --disable-hash
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-iconv),)
+  CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)"
+else
+  CONFIGURE_ARGS+= --without-iconv
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-intl),)
+  CONFIGURE_ARGS+= --enable-intl=shared
+else
+  CONFIGURE_ARGS+= --disable-intl
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-json),)
+  CONFIGURE_ARGS+= --enable-json=shared
+else
+  CONFIGURE_ARGS+= --disable-json
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ldap),)
+  CONFIGURE_ARGS+= \
+       --with-ldap=shared,"$(STAGING_DIR)/usr" \
+       --with-ldap-sasl="$(STAGING_DIR)/usr"
+else
+  CONFIGURE_ARGS+= --without-ldap
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mbstring),)
+  CONFIGURE_ARGS+= --enable-mbstring=shared --enable-mbregex
+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
+  CONFIGURE_ARGS+= --without-mysqli
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-opcache),)
+  CONFIGURE_ARGS+= --enable-opcache=shared
+else
+  CONFIGURE_ARGS+= --disable-opcache
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-openssl),)
+  CONFIGURE_ARGS+= \
+       --with-openssl=shared,"$(STAGING_DIR)/usr" \
+       --with-kerberos=no \
+       --with-openssl-dir="$(STAGING_DIR)/usr"
+else
+  CONFIGURE_ARGS+= --without-openssl
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pcntl),)
+  CONFIGURE_ARGS+= --enable-pcntl=shared
+else
+  CONFIGURE_ARGS+= --disable-pcntl
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo),)
+  CONFIGURE_ARGS+= --enable-pdo=shared
+  ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-mysql),)
+    CONFIGURE_ARGS+= --with-pdo-mysql=shared,"$(STAGING_DIR)/usr"
+  else
+    CONFIGURE_ARGS+= --without-pdo-mysql
+  endif
+  ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-pgsql),)
+    CONFIGURE_ARGS+= --with-pdo-pgsql=shared,"$(STAGING_DIR)/usr"
+  else
+    CONFIGURE_ARGS+= --without-pdo-pgsql
+  endif
+  ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-sqlite),)
+    CONFIGURE_ARGS+= --with-pdo-sqlite=shared,"$(STAGING_DIR)/usr"
+  else
+    CONFIGURE_ARGS+= --without-pdo-sqlite
+  endif
+else
+  CONFIGURE_ARGS+= --disable-pdo
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pgsql),)
+  CONFIGURE_ARGS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
+else
+  CONFIGURE_ARGS+= --without-pgsql
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-phar),)
+  CONFIGURE_ARGS+= --enable-phar=shared
+else
+  CONFIGURE_ARGS+= --disable-phar
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-session),)
+  CONFIGURE_ARGS+= --enable-session=shared
+else
+  CONFIGURE_ARGS+= --disable-session
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-shmop),)
+  CONFIGURE_ARGS+= --enable-shmop=shared
+else
+  CONFIGURE_ARGS+= --disable-shmop
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-simplexml),)
+  CONFIGURE_ARGS+= --enable-simplexml=shared
+else
+  CONFIGURE_ARGS+= --disable-simplexml
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-soap),)
+  CONFIGURE_ARGS+= --enable-soap=shared
+else
+  CONFIGURE_ARGS+= --disable-soap
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sockets),)
+  CONFIGURE_ARGS+= --enable-sockets=shared
+else
+  CONFIGURE_ARGS+= --disable-sockets
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sqlite3),)
+  CONFIGURE_ARGS+= --with-sqlite3=shared,"$(STAGING_DIR)/usr"
+else
+  CONFIGURE_ARGS+= --without-sqlite3
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvmsg),)
+  CONFIGURE_ARGS+= --enable-sysvmsg=shared
+else
+  CONFIGURE_ARGS+= --disable-sysvmsg
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvsem),)
+  CONFIGURE_ARGS+= --enable-sysvsem=shared
+else
+  CONFIGURE_ARGS+= --disable-sysvsem
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvshm),)
+  CONFIGURE_ARGS+= --enable-sysvshm=shared
+else
+  CONFIGURE_ARGS+= --disable-sysvshm
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-tokenizer),)
+  CONFIGURE_ARGS+= --enable-tokenizer=shared
+else
+  CONFIGURE_ARGS+= --disable-tokenizer
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xml),)
+  CONFIGURE_ARGS+= --enable-xml=shared,"$(STAGING_DIR)/usr"
+  ifneq ($(CONFIG_PHP7_LIBXML),)
+    CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
+  else
+    CONFIGURE_ARGS+= --with-libexpat-dir="$(STAGING_DIR)/usr"
+  endif
+else
+  CONFIGURE_ARGS+= --disable-xml
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlreader),)
+  CONFIGURE_ARGS+= --enable-xmlreader=shared,"$(STAGING_DIR)/usr"
+else
+  CONFIGURE_ARGS+= --disable-xmlreader
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlwriter),)
+  CONFIGURE_ARGS+= --enable-xmlwriter=shared,"$(STAGING_DIR)/usr"
+else
+  CONFIGURE_ARGS+= --disable-xmlwriter
+endif
+
+ifneq ($(CONFIG_PACKAGE_php7-mod-zip),)
+  CONFIGURE_ARGS+= --enable-zip=shared
+else
+  CONFIGURE_ARGS+= --disable-zip
+endif
+
+ifneq ($(SDK)$(CONFIG_PHP7_FILTER),)
+  CONFIGURE_ARGS+= --enable-filter
+else
+  CONFIGURE_ARGS+= --disable-filter
+endif
+
+ifneq ($(SDK)$(CONFIG_PHP7_LIBXML),)
+  CONFIGURE_ARGS+= --enable-libxml
+  CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
+else
+  CONFIGURE_ARGS+= --disable-libxml
+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" \
+
+define Package/php7/conffiles
+/etc/php.ini
+endef
+
+define Package/php7/install
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DATA) ./files/php.ini $(1)/etc/
+endef
+
+define Package/php7-cli/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_BUILD_DIR)/sapi/cli/php $(1)/usr/bin/php-cli
+endef
+
+define Package/php7-cgi/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(1)/usr/bin/php-cgi
+       ln -sf php-cgi $(1)/usr/bin/php-fcgi
+endef
+
+define Package/php7-fastcgi/install
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./files/php7-fastcgi.config $(1)/etc/config/php7-fastcgi
+
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/php7-fastcgi.init $(1)/etc/init.d/php7-fastcgi
+endef
+
+define Package/php7-fpm/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/sapi/fpm/php-fpm $(1)/usr/bin/php-fpm
+
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DATA) ./files/php7-fpm.conf $(1)/etc/php7-fpm.conf
+
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./files/php7-fpm.config $(1)/etc/config/php7-fpm
+
+       $(INSTALL_DIR) $(1)/etc/php7-fpm.d
+       $(INSTALL_DATA) ./files/php7-fpm-www.conf $(1)/etc/php7-fpm.d/www.conf
+
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/php7-fpm.init $(1)/etc/init.d/php7-fpm
+endef
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       ( cd $(PKG_BUILD_DIR); touch configure.in; ./buildconf --force )
+endef
+
+define Build/InstallDev
+       rm -rf $(PKG_BUILD_DIR)/staging
+       make -C $(PKG_BUILD_DIR) install INSTALL_ROOT=$(PKG_BUILD_DIR)/staging
+       rm -rf $(PKG_BUILD_DIR)/staging/usr/{share,man,sbin}
+       rm -f $(PKG_BUILD_DIR)/staging/usr/bin/{php,php-cgi,php-cli}
+       mv $(PKG_BUILD_DIR)/staging/usr/bin/phpize $(PKG_BUILD_DIR)/staging/usr/bin/phpize7
+       mv $(PKG_BUILD_DIR)/staging/usr/bin/php-config $(PKG_BUILD_DIR)/staging/usr/bin/php7-config
+       mv $(PKG_BUILD_DIR)/staging/usr/include/php $(PKG_BUILD_DIR)/staging/usr/include/php7
+       mv $(PKG_BUILD_DIR)/staging/usr/lib/php $(PKG_BUILD_DIR)/staging/usr/lib/php7
+
+       $(CP) $(PKG_BUILD_DIR)/staging/usr $(STAGING_DIR)/
+
+       sed -i -e "s#prefix='/usr'#prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7
+       sed -i -e "s#exec_prefix=\"\`eval echo /usr\`\"#exec_prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7
+       sed -i -e "s#/include\`/php\"#/include\`/php7\"#" $(STAGING_DIR)/usr/bin/phpize7
+       sed -i -e "s#/lib/php\`/build\"#/lib/php7\`/build\"#" $(STAGING_DIR)/usr/bin/phpize7
+
+       sed -i -e "s#prefix=\"/usr\"#prefix=\"$(STAGING_DIR)/usr\"#" $(STAGING_DIR)/usr/bin/php7-config
+       sed -i -e "s#/include/php\"#/include/php7\"#" $(STAGING_DIR)/usr/bin/php7-config
+endef
+
+define BuildModule
+
+  define Package/php7-mod-$(1)
+    $(call Package/php7/Default)
+
+    ifneq ($(3),)
+      DEPENDS+=$(3)
+    endif
+
+    TITLE:=$(2) shared module
+  endef
+
+  define Package/php7-mod-$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/lib/php
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/
+       $(INSTALL_DIR) $$(1)/etc/php7
+      ifeq ($(5),zend)
+       echo "zend_extension=/usr/lib/php/$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
+      else
+       echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
+    endif
+  endef
+
+  $$(eval $$(call BuildPackage,php7-mod-$(1)))
+
+endef
+
+$(eval $(call BuildPackage,php7))
+$(eval $(call BuildPackage,php7-cgi))
+$(eval $(call BuildPackage,php7-cli))
+$(eval $(call BuildPackage,php7-fastcgi))
+$(eval $(call BuildPackage,php7-fpm))
+
+#$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS]))
+$(eval $(call BuildModule,calendar,Calendar))
+$(eval $(call BuildModule,ctype,Ctype))
+$(eval $(call BuildModule,curl,cURL,+PACKAGE_php7-mod-curl:libcurl))
+$(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,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,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))
+$(eval $(call BuildModule,pcntl,PCNTL))
+$(eval $(call BuildModule,pdo,PHP Data Objects))
+$(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-mysql:libmysqlclient))
+$(eval $(call BuildModule,pdo-pgsql,PDO driver for PostgreSQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-pgsql:libpq))
+$(eval $(call BuildModule,pdo-sqlite,PDO driver for SQLite 3.x,+php7-mod-pdo +PACKAGE_php7-mod-pdo-sqlite:libsqlite3 +PACKAGE_php7-mod-pdo-sqlite:librt))
+$(eval $(call BuildModule,pgsql,PostgreSQL,+PACKAGE_php7-mod-pgsql:libpq))
+$(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,soap,SOAP,+@PHP7_LIBXML +PACKAGE_php7-mod-soap:libxml2))
+$(eval $(call BuildModule,sockets,Sockets))
+$(eval $(call BuildModule,sqlite3,SQLite3,+PACKAGE_php7-mod-sqlite3:libsqlite3))
+$(eval $(call BuildModule,sysvmsg,System V messages))
+$(eval $(call BuildModule,sysvsem,System V shared memory))
+$(eval $(call BuildModule,sysvshm,System V semaphore))
+$(eval $(call BuildModule,tokenizer,Tokenizer))
+$(eval $(call BuildModule,xml,XML,+PHP7_LIBXML:libxml2 +!PHP7_LIBXML:libexpat))
+$(eval $(call BuildModule,xmlreader,XMLReader,+@PHP7_LIBXML +PACKAGE_php7-mod-xmlreader:libxml2))
+$(eval $(call BuildModule,xmlwriter,XMLWriter,+@PHP7_LIBXML +PACKAGE_php7-mod-xmlwriter:libxml2))
+$(eval $(call BuildModule,zip,ZIP,+PACKAGE_php7-mod-zip:zlib))
diff --git a/lang/php7/files/php.ini b/lang/php7/files/php.ini
new file mode 100644 (file)
index 0000000..c88ab0a
--- /dev/null
@@ -0,0 +1,152 @@
+[PHP]
+zend.ze1_compatibility_mode = Off
+
+; Language Options
+
+engine = On
+;short_open_tag = Off
+precision    =  12
+y2k_compliance = On
+output_buffering = Off
+;output_handler =
+zlib.output_compression = Off
+;zlib.output_compression_level = -1
+;zlib.output_handler =
+implicit_flush = Off
+unserialize_callback_func =
+serialize_precision = 100
+
+;open_basedir =
+disable_functions =
+disable_classes =
+
+; Colors for Syntax Highlighting mode.  Anything that's acceptable in
+; <span style="color: ???????"> would work.
+;highlight.string  = #DD0000
+;highlight.comment = #FF9900
+;highlight.keyword = #007700
+;highlight.bg      = #FFFFFF
+;highlight.default = #0000BB
+;highlight.html    = #000000
+
+;ignore_user_abort = On
+;realpath_cache_size = 16k
+;realpath_cache_ttl = 120
+
+; Miscellaneous
+
+expose_php = On
+
+; Resource Limits
+
+max_execution_time = 30        ; Maximum execution time of each script, in seconds.
+max_input_time = 60    ; Maximum amount of time each script may spend parsing request data.
+;max_input_nesting_level = 64
+memory_limit = 8M      ; Maximum amount of memory a script may consume.
+
+; Error handling and logging
+
+; Error Level Constants:
+; E_ALL             - All errors and warnings (includes E_STRICT as of PHP 6.0.0)
+; E_ERROR           - fatal run-time errors
+; E_RECOVERABLE_ERROR  - almost fatal run-time errors
+; E_WARNING         - run-time warnings (non-fatal errors)
+; E_PARSE           - compile-time parse errors
+; E_NOTICE          - run-time notices (these are warnings which often result
+;                     from a bug in your code, but it's possible that it was
+;                     intentional (e.g., using an uninitialized variable and
+;                     relying on the fact it's automatically initialized to an
+;                     empty string)
+; E_STRICT                     - run-time notices, enable to have PHP suggest changes
+;                     to your code which will ensure the best interoperability
+;                     and forward compatibility of your code
+; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
+; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
+;                     initial startup
+; E_COMPILE_ERROR   - fatal compile-time errors
+; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
+; E_USER_ERROR      - user-generated error message
+; E_USER_WARNING    - user-generated warning message
+; E_USER_NOTICE     - user-generated notice message
+; E_DEPRECATED      - warn about code that will not work in future versions
+;                     of PHP
+; E_USER_DEPRECATED - user-generated deprecation warnings
+;
+; Common Values:
+;   E_ALL & ~E_NOTICE  (Show all errors, except for notices and coding standards warnings.)
+;   E_ALL & ~E_NOTICE | E_STRICT  (Show all errors, except for notices)
+;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
+;   E_ALL | E_STRICT  (Show all errors, warnings and notices including coding standards.)
+; Default Value: E_ALL & ~E_NOTICE
+error_reporting  =  E_ALL & ~E_NOTICE & ~E_STRICT
+
+display_errors = On
+display_startup_errors = Off
+log_errors = Off
+log_errors_max_len = 1024
+ignore_repeated_errors = Off
+ignore_repeated_source = Off
+report_memleaks = On
+;report_zend_debug = 0
+track_errors = Off
+;html_errors = Off
+;docref_root = "/phpmanual/"
+;docref_ext = .html
+;error_prepend_string = "<font color=#ff0000>"
+;error_append_string = "</font>"
+; Log errors to specified file.
+;error_log = /var/log/php_errors.log
+; Log errors to syslog.
+;error_log = syslog
+
+; Data Handling
+
+;arg_separator.output = "&amp;"
+;arg_separator.input = ";&"
+variables_order = "EGPCS"
+request_order = "GP"
+register_globals = Off
+register_long_arrays = Off
+register_argc_argv = On
+auto_globals_jit = On
+post_max_size = 8M
+;magic_quotes_gpc = Off
+magic_quotes_runtime = Off
+magic_quotes_sybase = Off
+auto_prepend_file =
+auto_append_file =
+default_mimetype = "text/html"
+;default_charset = "iso-8859-1"
+;always_populate_raw_post_data = On
+
+; Paths and Directories
+
+; UNIX: "/path1:/path2"
+;include_path = ".:/php/includes"
+doc_root = "/www"
+user_dir =
+extension_dir = "/usr/lib/php"
+enable_dl = On
+;cgi.force_redirect = 1
+;cgi.nph = 1
+;cgi.redirect_status_env = ;
+cgi.fix_pathinfo=1
+;fastcgi.impersonate = 1;
+;fastcgi.logging = 0
+;cgi.rfc2616_headers = 0
+
+; File Uploads
+
+file_uploads = On
+upload_tmp_dir = "/tmp"
+upload_max_filesize = 2M
+max_file_uploads = 20
+
+; Fopen wrappers
+
+allow_url_fopen = On
+allow_url_include = Off
+;from="john@doe.com"
+;user_agent="PHP"
+default_socket_timeout = 60
+;auto_detect_line_endings = Off
diff --git a/lang/php7/files/php7-fastcgi.config b/lang/php7/files/php7-fastcgi.config
new file mode 100644 (file)
index 0000000..22e9998
--- /dev/null
@@ -0,0 +1,3 @@
+config php7-fastcgi
+       option enabled 1
+       option port '1026'
diff --git a/lang/php7/files/php7-fastcgi.init b/lang/php7/files/php7-fastcgi.init
new file mode 100644 (file)
index 0000000..21f5b09
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh /etc/rc.common
+
+START=50
+
+SERVICE_DAEMONIZE=1
+SERVICE_WRITE_PID=1
+
+start_instance() {
+       local section="$1"
+       local enabled
+       local port
+
+       config_get_bool enabled "$section" 'enabled' 0
+       config_get port "$section" 'port' 1026
+
+       [ $enabled -gt 0 ] || return 1
+
+       PHP_FCGI_CHILDREN='' \
+       service_start /usr/bin/php-fcgi -b $port
+}
+
+start() {
+       config_load 'php7-fastcgi'
+       config_foreach start_instance 'php7-fastcgi'
+}
+
+stop() {
+       service_stop /usr/bin/php-fcgi
+}
diff --git a/lang/php7/files/php7-fpm-www.conf b/lang/php7/files/php7-fpm-www.conf
new file mode 100644 (file)
index 0000000..d3a3222
--- /dev/null
@@ -0,0 +1,392 @@
+; Start a new pool named 'www'.
+; the variable $pool can we used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or /usr) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+;       will be used.
+user = nobody
+;group =
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific address on
+;                            a specific port;
+;   'port'                 - to listen on a TCP socket to all addresses on a
+;                            specific port;
+;   '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = /var/run/php7-fpm.sock
+
+; Set listen(2) backlog.
+; Default Value: 128 (-1 on FreeBSD and OpenBSD)
+;listen.backlog = 128
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions. 
+; Default Values: user and group are set as the running user
+;                 mode is set to 0666
+;listen.owner = www-data
+;listen.group = www-data
+;listen.mode = 0666
+
+; List of ipv4 addresses of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+;       - The pool processes will inherit the master process priority
+;         unless it specified otherwise
+; Default Value: no set
+; priority = -19
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+;   static  - a fixed number (pm.max_children) of child processes;
+;   dynamic - the number of child processes are set dynamically based on the
+;             following directives. With this process management, there will be
+;             always at least 1 children.
+;             pm.max_children      - the maximum number of children that can
+;                                    be alive at the same time.
+;             pm.start_servers     - the number of children created on startup.
+;             pm.min_spare_servers - the minimum number of children in 'idle'
+;                                    state (waiting to process). If the number
+;                                    of 'idle' processes is less than this
+;                                    number then some children will be created.
+;             pm.max_spare_servers - the maximum number of children in 'idle'
+;                                    state (waiting to process). If the number
+;                                    of 'idle' processes is greater than this
+;                                    number then some children will be killed.
+;  ondemand - no children are created at startup. Children will be forked when
+;             new requests will connect. The following parameter are used:
+;             pm.max_children           - the maximum number of children that
+;                                         can be alive at the same time.
+;             pm.process_idle_timeout   - The number of seconds after which
+;                                         an idle process will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI. The below defaults are based on a server without much resources. Don't
+; forget to tweak pm.* to fit your needs.
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
+; Note: This value is mandatory.
+pm.max_children = 5
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
+pm.start_servers = 2
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 1
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 3
+
+; The number of seconds after which an idle process will be killed.
+; Note: Used only when pm is set to 'ondemand'
+; Default Value: 10s
+;pm.process_idle_timeout = 10s;
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. It shows the following informations:
+;   pool                 - the name of the pool;
+;   process manager      - static, dynamic or ondemand;
+;   start time           - the date and time FPM has started;
+;   start since          - number of seconds since FPM has started;
+;   accepted conn        - the number of request accepted by the pool;
+;   listen queue         - the number of request in the queue of pending
+;                          connections (see backlog in listen(2));
+;   max listen queue     - the maximum number of requests in the queue
+;                          of pending connections since FPM has started;
+;   listen queue len     - the size of the socket queue of pending connections;
+;   idle processes       - the number of idle processes;
+;   active processes     - the number of active processes;
+;   total processes      - the number of idle + active processes;
+;   max active processes - the maximum number of active processes since FPM
+;                          has started;
+;   max children reached - number of times, the process limit has been reached,
+;                          when pm tries to start more children (works only for
+;                          pm 'dynamic' and 'ondemand');
+; Value are updated in real time.
+; Example output:
+;   pool:                 www
+;   process manager:      static
+;   start time:           01/Jul/2011:17:53:49 +0200
+;   start since:          62636
+;   accepted conn:        190460
+;   listen queue:         0
+;   max listen queue:     1
+;   listen queue len:     42
+;   idle processes:       4
+;   active processes:     11
+;   total processes:      15
+;   max active processes: 12
+;   max children reached: 0
+;
+; By default the status page output is formatted as text/plain. Passing either
+; 'html', 'xml' or 'json' in the query string will return the corresponding
+; output syntax. Example:
+;   http://www.foo.bar/status
+;   http://www.foo.bar/status?json
+;   http://www.foo.bar/status?html
+;   http://www.foo.bar/status?xml
+;
+; By default the status page only outputs short status. Passing 'full' in the
+; query string will also return status for each pool process.
+; Example: 
+;   http://www.foo.bar/status?full
+;   http://www.foo.bar/status?json&full
+;   http://www.foo.bar/status?html&full
+;   http://www.foo.bar/status?xml&full
+; The Full status returns for each process:
+;   pid                  - the PID of the process;
+;   state                - the state of the process (Idle, Running, ...);
+;   start time           - the date and time the process has started;
+;   start since          - the number of seconds since the process has started;
+;   requests             - the number of requests the process has served;
+;   request duration     - the duration in µs of the requests;
+;   request method       - the request method (GET, POST, ...);
+;   request URI          - the request URI with the query string;
+;   content length       - the content length of the request (only with POST);
+;   user                 - the user (PHP_AUTH_USER) (or '-' if not set);
+;   script               - the main script called (or '-' if not set);
+;   last request cpu     - the %cpu the last request consumed
+;                          it's always 0 if the process is not in Idle state
+;                          because CPU calculation is done when the request
+;                          processing has terminated;
+;   last request memory  - the max amount of memory the last request consumed
+;                          it's always 0 if the process is not in Idle state
+;                          because memory calculation is done when the request
+;                          processing has terminated;
+; If the process is in Idle state, then informations are related to the
+; last request the process has served. Otherwise informations are related to
+; the current request being served.
+; Example output:
+;   ************************
+;   pid:                  31330
+;   state:                Running
+;   start time:           01/Jul/2011:17:53:49 +0200
+;   start since:          63087
+;   requests:             12808
+;   request duration:     1250261
+;   request method:       GET
+;   request URI:          /test_mem.php?N=10000
+;   content length:       0
+;   user:                 -
+;   script:               /home/fat/web/docs/php/test_mem.php
+;   last request cpu:     0.00
+;   last request memory:  0
+;
+; Note: There is a real-time FPM status monitoring sample web page available
+;       It's available in: ${prefix}/share/fpm/status.html
+;
+; Note: The value must start with a leading slash (/). The value can be
+;       anything, but it may not be a good idea to use the .php extension or it
+;       may conflict with a real PHP file.
+; Default Value: not set 
+;pm.status_path = /status
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+;       anything, but it may not be a good idea to use the .php extension or it
+;       may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The access log file
+; Default: not set
+;access.log = log/$pool.access.log
+
+; The access log format.
+; The following syntax is allowed
+;  %%: the '%' character
+;  %C: %CPU used by the request
+;      it can accept the following format:
+;      - %{user}C for user CPU only
+;      - %{system}C for system CPU only
+;      - %{total}C  for user + system CPU (default)
+;  %d: time taken to serve the request
+;      it can accept the following format:
+;      - %{seconds}d (default)
+;      - %{miliseconds}d
+;      - %{mili}d
+;      - %{microseconds}d
+;      - %{micro}d
+;  %e: an environment variable (same as $_ENV or $_SERVER)
+;      it must be associated with embraces to specify the name of the env
+;      variable. Some exemples:
+;      - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
+;      - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
+;  %f: script filename
+;  %l: content-length of the request (for POST request only)
+;  %m: request method
+;  %M: peak of memory allocated by PHP
+;      it can accept the following format:
+;      - %{bytes}M (default)
+;      - %{kilobytes}M
+;      - %{kilo}M
+;      - %{megabytes}M
+;      - %{mega}M
+;  %n: pool name
+;  %o: ouput header
+;      it must be associated with embraces to specify the name of the header:
+;      - %{Content-Type}o
+;      - %{X-Powered-By}o
+;      - %{Transfert-Encoding}o
+;      - ....
+;  %p: PID of the child that serviced the request
+;  %P: PID of the parent of the child that serviced the request
+;  %q: the query string 
+;  %Q: the '?' character if query string exists
+;  %r: the request URI (without the query string, see %q and %Q)
+;  %R: remote IP address
+;  %s: status (response code)
+;  %t: server time the request was received
+;      it can accept a strftime(3) format:
+;      %d/%b/%Y:%H:%M:%S %z (default)
+;  %T: time the log has been written (the request has finished)
+;      it can accept a strftime(3) format:
+;      %d/%b/%Y:%H:%M:%S %z (default)
+;  %u: remote user
+;
+; Default: "%R - %u %t \"%m %r\" %s"
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = log/$pool.log.slow
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+;       possible. However, all PHP paths will be relative to the chroot
+;       (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+chdir = /
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environement, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Limits the extensions of the main script FPM will allow to parse. This can
+; prevent configuration mistakes on the web server side. You should only limit
+; FPM to .php extensions to prevent malicious users to use other extensions to
+; exectute php code.
+; Note: set an empty value to allow all extensions.
+; Default Value: .php
+;security.limit_extensions = .php .php3 .php4 .php5
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+;   php_value/php_flag             - you can set classic ini defines which can
+;                                    be overwritten from PHP call 'ini_set'. 
+;   php_admin_value/php_admin_flag - these directives won't be overwritten by
+;                                     PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or /usr)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+;                specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
diff --git a/lang/php7/files/php7-fpm.conf b/lang/php7/files/php7-fpm.conf
new file mode 100644 (file)
index 0000000..c980b21
--- /dev/null
@@ -0,0 +1,121 @@
+;;;;;;;;;;;;;;;;;;;;;
+; FPM Configuration ;
+;;;;;;;;;;;;;;;;;;;;;
+
+; All relative paths in this configuration file are relative to PHP's install
+; prefix (/usr). This prefix can be dynamically changed by using the
+; '-p' argument from the command line.
+
+; Include one or more files. If glob(3) exists, it is used to include a bunch of
+; files from a glob(3) pattern. This directive can be used everywhere in the
+; file.
+; Relative path can also be used. They will be prefixed by:
+;  - the global prefix if it's been set (-p argument)
+;  - /usr otherwise
+;include=/etc/php7/fpm/*.conf
+
+;;;;;;;;;;;;;;;;;;
+; Global Options ;
+;;;;;;;;;;;;;;;;;;
+
+[global]
+; Pid file
+; Note: the default prefix is /var
+; Default Value: none
+pid = /var/run/php7-fpm.pid
+
+; Error log file
+; If it's set to "syslog", log is sent to syslogd instead of being written
+; in a local file.
+; Note: the default prefix is /var
+; Default Value: log/php-fpm.log
+error_log = /var/log/php7-fpm.log
+
+; syslog_facility is used to specify what type of program is logging the
+; message. This lets syslogd specify that messages from different facilities
+; will be handled differently.
+; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
+; Default Value: daemon
+;syslog.facility = daemon
+
+; syslog_ident is prepended to every message. If you have multiple FPM
+; instances running on the same server, you can change the default value
+; which must suit common needs.
+; Default Value: php-fpm
+;syslog.ident = php-fpm
+
+; Log level
+; Possible Values: alert, error, warning, notice, debug
+; Default Value: notice
+;log_level = notice
+
+; If this number of child processes exit with SIGSEGV or SIGBUS within the time
+; interval set by emergency_restart_interval then FPM will restart. A value
+; of '0' means 'Off'.
+; Default Value: 0
+;emergency_restart_threshold = 0
+
+; Interval of time used by emergency_restart_interval to determine when 
+; a graceful restart will be initiated.  This can be useful to work around
+; accidental corruptions in an accelerator's shared memory.
+; Available Units: s(econds), m(inutes), h(ours), or d(ays)
+; Default Unit: seconds
+; Default Value: 0
+;emergency_restart_interval = 0
+
+; Time limit for child processes to wait for a reaction on signals from master.
+; Available units: s(econds), m(inutes), h(ours), or d(ays)
+; Default Unit: seconds
+; Default Value: 0
+;process_control_timeout = 0
+
+; The maximum number of processes FPM will fork. This has been design to control
+; the global number of processes when using dynamic PM within a lot of pools.
+; Use it with caution.
+; Note: A value of 0 indicates no limit
+; Default Value: 0
+; process.max = 128
+
+; Specify the nice(2) priority to apply to the master process (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+;       - The pool process will inherit the master process priority
+;         unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
+; Default Value: yes
+;daemonize = yes
+
+; Set open file descriptor rlimit for the master process.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit for the master process.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Specify the event mechanism FPM will use. The following is available:
+; - select     (any POSIX os)
+; - poll       (any POSIX os)
+; - epoll      (linux >= 2.5.44)
+; - kqueue     (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
+; - /dev/poll  (Solaris >= 7)
+; - port       (Solaris >= 10)
+; Default Value: not set (auto detection)
+; events.mechanism = epoll
+
+;;;;;;;;;;;;;;;;;;;;
+; Pool Definitions ;
+;;;;;;;;;;;;;;;;;;;;
+
+; Multiple pools of child processes may be started with different listening
+; ports and different management options.  The name of the pool will be
+; used in logs and stats. There is no limitation on the number of pools which
+; FPM can handle. Your system will tell you anyway :)
+
+; To configure the pools it is recommended to have one .conf file per
+; pool in the following directory:
+include=/etc/php7-fpm.d/*.conf
diff --git a/lang/php7/files/php7-fpm.config b/lang/php7/files/php7-fpm.config
new file mode 100644 (file)
index 0000000..3a893c6
--- /dev/null
@@ -0,0 +1,2 @@
+config php7-fpm
+       option enabled 1
diff --git a/lang/php7/files/php7-fpm.init b/lang/php7/files/php7-fpm.init
new file mode 100644 (file)
index 0000000..c913a2b
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh /etc/rc.common
+
+START=50
+
+PROG=/usr/bin/php-fpm
+CONFIG=/etc/php7-fpm.conf
+
+SERVICE_PID_FILE=/var/run/php7-fpm.pid
+
+start_instance() {
+       local section="$1"
+       local enabled
+
+       config_get_bool enabled "$section" 'enabled' 0
+
+       [ $enabled -gt 0 ] || return 1
+
+       service_start $PROG -y $CONFIG -g $SERVICE_PID_FILE
+}
+
+start() {
+       config_load 'php7-fpm'
+       config_foreach start_instance 'php7-fpm'
+}
+
+stop() {
+       service_stop $PROG
+}
diff --git a/lang/php7/patches/0013-Add-support-for-use-of-the-system-timezone-database.patch b/lang/php7/patches/0013-Add-support-for-use-of-the-system-timezone-database.patch
new file mode 100644 (file)
index 0000000..819ad1e
--- /dev/null
@@ -0,0 +1,684 @@
+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
+
+Add support for use of the system timezone database, rather
+than embedding a copy.  Discussed upstream but was not desired.
+
+History:
+r14: improve check for valid tz file
+r13: adapt for upstream changes to use PHP allocator
+r12: adapt for upstream changes for new zic
+r11: use canonical names to avoid more case sensitivity issues
+     round lat/long from zone.tab towards zero per builtin db
+r10: make timezone case insensitive
+r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold)
+r8: fix compile error without --with-system-tzdata configured
+r7: improve check for valid timezone id to exclude directories
+r6: fix fd leak in r5, fix country code/BC flag use in
+    timezone_identifiers_list() using system db,
+    fix use of PECL timezonedb to override system db,
+r5: reverts addition of "System/Localtime" fake tzname.
+    updated for 5.3.0, parses zone.tab to pick up mapping between
+    timezone name, country code and long/lat coords
+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 @@
+ #include "timelib.h"
++#ifdef HAVE_SYSTEM_TZDATA
++#include <sys/mman.h>
++#include <sys/stat.h>
++#include <limits.h>
++#include <fcntl.h>
++#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
+ #define TIMELIB_SUPPORTS_V2DATA
+ #include "timezonedb.h"
++#endif
++
++#include <ctype.h>
+ #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)
+ {
+       uint32_t version;
++      if (memcmp(*tzf, "TZif", 4) == 0) {
++              *tzf += 20;
++              return 0;
++      }
++
+       /* read ID */
+       version = (*tzf)[3] - '0';
+       *tzf += 4;
+@@ -302,7 +321,429 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
+       }
+ }
+-static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
++#ifdef HAVE_SYSTEM_TZDATA
++
++#ifdef HAVE_SYSTEM_TZDATA_PREFIX
++#define ZONEINFO_PREFIX HAVE_SYSTEM_TZDATA_PREFIX
++#else
++#define ZONEINFO_PREFIX "/usr/share/zoneinfo"
++#endif
++
++/* System timezone database pointer. */
++static const timelib_tzdb *timezonedb_system;
++
++/* Hash table entry for the cache of the zone.tab mapping table. */
++struct location_info {
++        char code[2];
++        double latitude, longitude;
++        char name[64];
++        char *comment;
++        struct location_info *next;
++};
++
++/* Cache of zone.tab. */
++static struct location_info **system_location_table;
++
++/* Size of the zone.tab hash table; a random-ish prime big enough to
++ * prevent too many collisions. */
++#define LOCINFO_HASH_SIZE (1021)
++
++/* Compute a case insensitive hash of str */
++static uint32_t tz_hash(const char *str)
++{
++    const unsigned char *p = (const unsigned char *)str;
++    uint32_t hash = 5381;
++    int c;
++
++    while ((c = tolower(*p++)) != '\0') {
++        hash = (hash << 5) ^ hash ^ c;
++    }
++
++    return hash % LOCINFO_HASH_SIZE;
++}
++
++/* Parse an ISO-6709 date as used in zone.tab. Returns end of the
++ * parsed string on success, or NULL on parse error.  On success,
++ * writes the parsed number to *result. */
++static char *parse_iso6709(char *p, double *result)
++{
++    double v, sign;
++    char *pend;
++    size_t len;
++
++    if (*p == '+')
++        sign = 1.0;
++    else if (*p == '-')
++        sign = -1.0;
++    else
++        return NULL;
++
++    p++;
++    for (pend = p; *pend >= '0' && *pend <= '9'; pend++)
++        ;;
++
++    /* Annoying encoding used by zone.tab has no decimal point, so use
++     * the length to determine the format:
++     * 
++     * 4 = DDMM
++     * 5 = DDDMM
++     * 6 = DDMMSS
++     * 7 = DDDMMSS
++     */
++    len = pend - p;
++    if (len < 4 || len > 7) {
++        return NULL;
++    }
++
++    /* p => [D]DD */
++    v = (p[0] - '0') * 10.0 + (p[1] - '0');
++    p += 2;
++    if (len == 5 || len == 7)
++        v = v * 10.0 + (*p++ - '0');
++    /* p => MM[SS] */
++    v += (10.0 * (p[0] - '0')
++          + p[1] - '0') / 60.0;
++    p += 2;
++    /* p => [SS] */
++    if (len > 5) {
++        v += (10.0 * (p[0] - '0')
++              + p[1] - '0') / 3600.0;
++        p += 2;
++    }
++
++    /* Round to five decimal place, not because it's a good idea,
++     * but, because the builtin data uses rounded data, so, match
++     * that. */
++    *result = trunc(v * sign * 100000.0) / 100000.0;
++
++    return p;
++}
++
++/* This function parses the zone.tab file to build up the mapping of
++ * timezone to country code and geographic location, and returns a
++ * hash table.  The hash table is indexed by the function:
++ *
++ *   tz_hash(timezone-name)
++ */
++static struct location_info **create_location_table(void)
++{
++    struct location_info **li, *i;
++    char zone_tab[PATH_MAX];
++    char line[512];
++    FILE *fp;
++
++    strncpy(zone_tab, ZONEINFO_PREFIX "/zone.tab", sizeof zone_tab);
++
++    fp = fopen(zone_tab, "r");
++    if (!fp) {
++        return NULL;
++    }
++
++    li = calloc(LOCINFO_HASH_SIZE, sizeof *li);
++
++    while (fgets(line, sizeof line, fp)) {
++        char *p = line, *code, *name, *comment;
++        uint32_t hash;
++        double latitude, longitude;
++
++        while (isspace(*p))
++            p++;
++
++        if (*p == '#' || *p == '\0' || *p == '\n')
++            continue;
++        
++        if (!isalpha(p[0]) || !isalpha(p[1]) || p[2] != '\t')
++            continue;
++        
++        /* code => AA */
++        code = p;
++        p[2] = 0;
++        p += 3;
++
++        /* coords => [+-][D]DDMM[SS][+-][D]DDMM[SS] */
++        p = parse_iso6709(p, &latitude);
++        if (!p) {
++            continue;
++        }
++        p = parse_iso6709(p, &longitude);
++        if (!p) {
++            continue;
++        }
++
++        if (!p || *p != '\t') {
++            continue;
++        }
++
++        /* name = string */
++        name = ++p;
++        while (*p != '\t' && *p && *p != '\n')
++            p++;
++
++        *p++ = '\0';
++
++        /* comment = string */
++        comment = p;
++        while (*p != '\t' && *p && *p != '\n')
++            p++;
++
++        if (*p == '\n' || *p == '\t')
++            *p = '\0';
++        
++        hash = tz_hash(name);
++        i = malloc(sizeof *i);
++        memcpy(i->code, code, 2);
++        strncpy(i->name, name, sizeof i->name);
++        i->comment = strdup(comment);
++        i->longitude = longitude;
++        i->latitude = latitude;
++        i->next = li[hash];
++        li[hash] = i;
++        /* printf("%s [%u, %f, %f]\n", name, hash, latitude, longitude); */
++    }
++
++    fclose(fp);
++
++    return li;
++}
++
++/* Return location info from hash table, using given timezone name.
++ * Returns NULL if the name could not be found. */
++const struct location_info *find_zone_info(struct location_info **li, 
++                                           const char *name)
++{
++    uint32_t hash = tz_hash(name);
++    const struct location_info *l;
++
++    if (!li) {
++        return NULL;
++    }
++
++    for (l = li[hash]; l; l = l->next) {
++        if (strcasecmp(l->name, name) == 0)
++            return l;
++    }
++
++    return NULL;
++}    
++
++/* Filter out some non-tzdata files and the posix/right databases, if
++ * present. */
++static int index_filter(const struct dirent *ent)
++{
++      return strcmp(ent->d_name, ".") != 0
++              && strcmp(ent->d_name, "..") != 0
++              && strcmp(ent->d_name, "posix") != 0
++              && strcmp(ent->d_name, "posixrules") != 0
++              && strcmp(ent->d_name, "right") != 0
++              && strstr(ent->d_name, ".list") == NULL
++              && strstr(ent->d_name, ".tab") == NULL;
++}
++
++static int sysdbcmp(const void *first, const void *second)
++{
++        const timelib_tzdb_index_entry *alpha = first, *beta = second;
++
++        return strcasecmp(alpha->id, beta->id);
++}
++
++
++/* Create the zone identifier index by trawling the filesystem. */
++static void create_zone_index(timelib_tzdb *db)
++{
++      size_t dirstack_size,  dirstack_top;
++      size_t index_size, index_next;
++      timelib_tzdb_index_entry *db_index;
++      char **dirstack;
++
++      /* LIFO stack to hold directory entries to scan; each slot is a
++       * directory name relative to the zoneinfo prefix. */
++      dirstack_size = 32;
++      dirstack = malloc(dirstack_size * sizeof *dirstack);
++      dirstack_top = 1;
++      dirstack[0] = strdup("");
++      
++      /* Index array. */
++      index_size = 64;
++      db_index = malloc(index_size * sizeof *db_index);
++      index_next = 0;
++
++      do {
++              struct dirent **ents;
++              char name[PATH_MAX], *top;
++              int count;
++
++              /* Pop the top stack entry, and iterate through its contents. */
++              top = dirstack[--dirstack_top];
++              snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s", top);
++
++              count = php_scandir(name, &ents, index_filter, php_alphasort);
++
++              while (count > 0) {
++                      struct stat st;
++                      const char *leaf = ents[count - 1]->d_name;
++
++                      snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s/%s", 
++                               top, leaf);
++                      
++                      if (strlen(name) && stat(name, &st) == 0) {
++                              /* Name, relative to the zoneinfo prefix. */
++                              const char *root = top;
++
++                              if (root[0] == '/') root++;
++
++                              snprintf(name, sizeof name, "%s%s%s", root, 
++                                       *root ? "/": "", leaf);
++
++                              if (S_ISDIR(st.st_mode)) {
++                                      if (dirstack_top == dirstack_size) {
++                                              dirstack_size *= 2;
++                                              dirstack = realloc(dirstack, 
++                                                                 dirstack_size * sizeof *dirstack);
++                                      }
++                                      dirstack[dirstack_top++] = strdup(name);
++                              }
++                              else {
++                                      if (index_next == index_size) {
++                                              index_size *= 2;
++                                              db_index = realloc(db_index,
++                                                                 index_size * sizeof *db_index);
++                                      }
++
++                                      db_index[index_next++].id = strdup(name);
++                              }
++                      }
++
++                      free(ents[--count]);
++              }
++              
++              if (count != -1) free(ents);
++              free(top);
++      } while (dirstack_top);
++
++        qsort(db_index, index_next, sizeof *db_index, sysdbcmp);
++
++      db->index = db_index;
++      db->index_size = index_next;
++
++      free(dirstack);
++}
++
++#define FAKE_HEADER "1234\0??\1??"
++#define FAKE_UTC_POS (7 - 4)
++
++/* Create a fake data segment for database 'sysdb'. */
++static void fake_data_segment(timelib_tzdb *sysdb,
++                              struct location_info **info)
++{
++        size_t n;
++        char *data, *p;
++        
++        data = malloc(3 * sysdb->index_size + 7);
++
++        p = mempcpy(data, FAKE_HEADER, sizeof(FAKE_HEADER) - 1);
++
++        for (n = 0; n < sysdb->index_size; n++) {
++                const struct location_info *li;
++                timelib_tzdb_index_entry *ent;
++
++                ent = (timelib_tzdb_index_entry *)&sysdb->index[n];
++
++                /* Lookup the timezone name in the hash table. */
++                if (strcmp(ent->id, "UTC") == 0) {
++                        ent->pos = FAKE_UTC_POS;
++                        continue;
++                }
++
++                li = find_zone_info(info, ent->id);
++                if (li) {
++                        /* If found, append the BC byte and the
++                         * country code; set the position for this
++                         * section of timezone data.  */
++                        ent->pos = (p - data) - 4;
++                        *p++ = '\1';
++                        *p++ = li->code[0];
++                        *p++ = li->code[1];
++                }
++                else {
++                        /* If not found, the timezone data can
++                         * point at the header. */
++                        ent->pos = 0;
++                }
++        }
++        
++        sysdb->data = (unsigned char *)data;
++}
++
++/* Returns true if the passed-in stat structure describes a
++ * probably-valid timezone file. */
++static int is_valid_tzfile(const struct stat *st, int fd)
++{
++      if (fd) {
++              char buf[20];
++              if (read(fd, buf, 20)!=20) {
++                      return 0;
++              }
++              lseek(fd, SEEK_SET, 0);
++              if (memcmp(buf, "TZif", 4)) {
++                      return 0;
++              }
++      }
++      return S_ISREG(st->st_mode) && st->st_size > 20;
++}
++
++/* To allow timezone names to be used case-insensitively, find the
++ * canonical name for this timezone, if possible. */
++static const char *canonical_tzname(const char *timezone)
++{
++    if (timezonedb_system) {
++        timelib_tzdb_index_entry *ent, lookup;
++
++        lookup.id = (char *)timezone;
++
++        ent = bsearch(&lookup, timezonedb_system->index,
++                      timezonedb_system->index_size, sizeof lookup,
++                      sysdbcmp);
++        if (ent) {
++            return ent->id;
++        }
++    }
++
++    return timezone;
++}
++
++/* Return the mmap()ed tzfile if found, else NULL.  On success, the
++ * length of the mapped data is placed in *length. */
++static char *map_tzfile(const char *timezone, size_t *length)
++{
++      char fname[PATH_MAX];
++      struct stat st;
++      char *p;
++      int fd;
++      
++      if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
++              return NULL;
++      }
++
++      snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
++
++      fd = open(fname, O_RDONLY);
++      if (fd == -1) {
++              return NULL;
++      } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st, fd)) {
++              close(fd);
++              return NULL;
++      }
++
++      *length = st.st_size;
++      p = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
++      close(fd);
++      
++      return p != MAP_FAILED ? p : NULL;
++}
++
++#endif
++
++static int inmem_seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
+ {
+       int left = 0, right = tzdb->index_size - 1;
+ #ifdef HAVE_SETLOCALE
+@@ -341,21 +782,88 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
+       return 0;
+ }
++static int seek_to_tz_position(const unsigned char **tzf, char *timezone,
++                             char **map, size_t *maplen,
++                             const timelib_tzdb *tzdb)
++{
++#ifdef HAVE_SYSTEM_TZDATA
++      if (tzdb == timezonedb_system) {
++              char *orig;
++
++              orig = map_tzfile(timezone, maplen);
++              if (orig == NULL) {
++                      return 0;
++              }
++
++              (*tzf) = (unsigned char *)orig;
++              *map = orig;
++        return 1;
++      }
++      else
++#endif
++      {
++              return inmem_seek_to_tz_position(tzf, timezone, tzdb);
++      }
++}
++
+ const timelib_tzdb *timelib_builtin_db(void)
+ {
++#ifdef HAVE_SYSTEM_TZDATA
++      if (timezonedb_system == NULL) {
++              timelib_tzdb *tmp = malloc(sizeof *tmp);
++
++              tmp->version = "0.system";
++              tmp->data = NULL;
++              create_zone_index(tmp);
++              system_location_table = create_location_table();
++              fake_data_segment(tmp, system_location_table);
++              timezonedb_system = tmp;
++      }
++
++      return timezonedb_system;
++#else
+       return &timezonedb_builtin;
++#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
+ }
+ int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb)
+ {
+       const unsigned char *tzf;
+-      return (seek_to_tz_position(&tzf, timezone, tzdb));
++
++#ifdef HAVE_SYSTEM_TZDATA
++      if (tzdb == timezonedb_system) {
++              char fname[PATH_MAX];
++              struct stat st;
++
++              if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
++                      return 0;
++              }
++
++              if (system_location_table) {
++                      if (find_zone_info(system_location_table, timezone) != NULL) {
++                              /* found in cache */
++                              return 1;
++                      }
++              }
++
++              snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
++
++              return stat(fname, &st) == 0 && is_valid_tzfile(&st, 0);
++      }
++#endif
++
++      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)
+ {
+       const unsigned char *tzf;
++      char *memmap = NULL;
++      size_t maplen;
+       timelib_tzinfo *tmp;
+       int version;
+-      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);
++
++#ifdef HAVE_SYSTEM_TZDATA
++              if (memmap) {
++                      const struct location_info *li;
++
++                      /* TZif-style - grok the location info from the system database,
++                       * if possible. */
++
++                      if ((li = find_zone_info(system_location_table, timezone)) != NULL) {
++                              tmp->location.comments = timelib_strdup(li->comment);
++                              strncpy(tmp->location.country_code, li->code, 2);
++                              tmp->location.longitude = li->longitude;
++                              tmp->location.latitude = li->latitude;
++                              tmp->bc = 1;
++                      }
++                      else {
++                              strcpy(tmp->location.country_code, "??");
++                              tmp->bc = 0;
++                              tmp->location.comments = timelib_strdup("");
++                      }
++
++                      /* Now done with the mmap segment - discard it. */
++                      munmap(memmap, maplen);
++              } else
++#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 {
+               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
+ dnl Check for strtoll, atoll
+ AC_CHECK_FUNCS(strtoll atoll strftime gettimeofday)
++
++PHP_ARG_WITH(system-tzdata, for use of system timezone data,
++[  --with-system-tzdata[=DIR]      to specify use of system timezone data],
++no, no)
++
++if test "$PHP_SYSTEM_TZDATA" != "no"; then
++   AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used])
++
++   if test "$PHP_SYSTEM_TZDATA" != "yes"; then
++      AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA",
++                         [Define for location of system timezone data])
++   fi
++fi
diff --git a/lang/php7/patches/0016-dont-gitclean-in-build.patch b/lang/php7/patches/0016-dont-gitclean-in-build.patch
new file mode 100644 (file)
index 0000000..32de557
--- /dev/null
@@ -0,0 +1,19 @@
+From: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
+Date: Sat, 2 May 2015 10:26:53 +0200
+Subject: dont-gitclean-in-build
+
+---
+ build/build.mk | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/build/build.mk b/build/build.mk
+index 9452984..b964def 100644
+--- a/build/build.mk
++++ b/build/build.mk
+@@ -63,6 +63,5 @@ gitclean-work:
+       @if (test ! -f '.git/info/exclude' || grep -s "git-ls-files" .git/info/exclude); then \
+               (echo "Rebuild .git/info/exclude" && echo '*.o' > .git/info/exclude && git svn propget svn:ignore | grep -v config.nice >> .git/info/exclude); \
+       fi; \
+-      git clean -X -f -d;
+ .PHONY: $(ALWAYS) snapshot
diff --git a/lang/php7/patches/0032-Use-system-timezone.patch b/lang/php7/patches/0032-Use-system-timezone.patch
new file mode 100644 (file)
index 0000000..efa1fc7
--- /dev/null
@@ -0,0 +1,43 @@
+From: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
+Date: Sat, 2 May 2015 10:26:56 +0200
+Subject: Use system timezone
+
+Upstream don't want this patch. See
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730771 for a summary.
+
+This delta is recovered from previous versions of the system timezone patch in
+Debian, and appears to have inadvertently been dropped. Author unknown.
+
+To be used in tandem with use_embedded_timezonedb.patch and use_embedded_timezonedb_fixes.patch.
+---
+ ext/date/php_date.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/ext/date/php_date.c b/ext/date/php_date.c
+index cbe6e91..1999c83 100644
+--- a/ext/date/php_date.c
++++ b/ext/date/php_date.c
+@@ -1003,6 +1003,23 @@ static char* guess_timezone(const timelib_tzdb *tzdb)
+               DATEG(timezone_valid) = 1;
+               return DATEG(default_timezone);
+       }
++      /* Try to guess timezone from system information */
++      {
++              struct tm *ta, tmbuf;
++              time_t     the_time;
++              char      *tzid = NULL;
++
++              the_time = time(NULL);
++              ta = php_localtime_r(&the_time, &tmbuf);
++              if (ta) {
++                      tzid = timelib_timezone_id_from_abbr(ta->tm_zone, ta->tm_gmtoff, ta->tm_isdst);
++              }
++              if (! tzid) {
++                      tzid = "UTC";
++              }
++
++              return tzid;
++      }
+       /* Fallback to UTC */
+       return "UTC";
+ }
diff --git a/lang/php7/patches/0041-Add-patch-to-remove-build-timestamps-from-generated-.patch b/lang/php7/patches/0041-Add-patch-to-remove-build-timestamps-from-generated-.patch
new file mode 100644 (file)
index 0000000..0a10afa
--- /dev/null
@@ -0,0 +1,114 @@
+From: Thijs Kinkhorst <thijs@debian.org>
+Date: Wed, 15 Jun 2016 09:18:03 +0200
+Subject: Add patch to remove build timestamps from generated binaries.
+
+---
+ ext/standard/info.c           |  1 -
+ sapi/apache2handler/config.m4 | 15 +++------------
+ sapi/cgi/cgi_main.c           |  4 ++--
+ sapi/cli/php_cli.c            |  4 ++--
+ sapi/fpm/fpm/fpm_main.c       |  4 ++--
+ 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)
+               php_info_print_box_end();
+               php_info_print_table_start();
+               php_info_print_table_row(2, "System", ZSTR_VAL(php_uname));
+-              php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__);
+ #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"
+   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
+-  if test -z `$APXS -q SYSCONFDIR`; then
+-    INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
+-                 $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+-                       -i -n php7"
+-  else
+-    APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
+-    INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
+-                \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
+-                 $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+-                       -S SYSCONFDIR='$APXS_SYSCONFDIR' \
+-                       -i -a -n php7"
+-  fi
++  INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
++               $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
++                     -i -n php7"
+   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\
+                                                               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());
+ #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());
+ #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) /* {{{ */
+                               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_VERSION, cli_sapi_module.name, __DATE__, __TIME__,
++                              php_printf("PHP %s (%s) ( %s)\nCopyright (c) 1997-2017 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[])
+                               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());
+ #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());
+ #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:
+                               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_VERSION,
+-                                      __DATE__,
+-                                      __TIME__,
+                                       PHP_VERSION,
+                                       get_zend_version()
+                               );
diff --git a/lang/php7/patches/0042-Remove-W3C-validation-icon-to-not-expose-the-reader-.patch b/lang/php7/patches/0042-Remove-W3C-validation-icon-to-not-expose-the-reader-.patch
new file mode 100644 (file)
index 0000000..78f7dca
--- /dev/null
@@ -0,0 +1,25 @@
+From: =?utf-8?q?Ond=C5=99ej_Sur=C3=BD?= <ondrej@sury.org>
+Date: Wed, 29 Jul 2015 14:37:55 +0200
+Subject: Remove W3C validation icon to not expose the reader's IP address to
+ potential tracking.
+
+---
+ sapi/fpm/status.html.in | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/sapi/fpm/status.html.in b/sapi/fpm/status.html.in
+index 86492d7..31c31ff 100644
+--- a/sapi/fpm/status.html.in
++++ b/sapi/fpm/status.html.in
+@@ -71,11 +71,6 @@
+                               <tr class="h"><th>PID&darr;</th><th>Start Time</th><th>Start Since</th><th>Requests Served</th><th>Request Duration</th><th>Request method</th><th>Request URI</th><th>Content Length</th><th>User</th><th>Script</th><th>Last Request %CPU</th><th>Last Request Memory</th></tr>
+                       </table>
+               </div>
+-              <p>
+-                      <a href="http://validator.w3.org/check?uri=referer">
+-                              <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" />
+-                      </a>
+-               </p>
+               <script type="text/javascript">
+ <!--
+                       var xhr_object = null;
diff --git a/lang/php7/patches/1000-fix_membar_producer_link_error_gcc3x.patch b/lang/php7/patches/1000-fix_membar_producer_link_error_gcc3x.patch
new file mode 100644 (file)
index 0000000..3e81dd6
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/ext/standard/php_crypt_r.c
++++ b/ext/standard/php_crypt_r.c
+@@ -96,6 +96,8 @@ void _crypt_extended_init_r(void)
+               InterlockedIncrement(&initialized);
+ #elif defined(HAVE_SYNC_FETCH_AND_ADD)
+               __sync_fetch_and_add(&initialized, 1);
++#elif (defined(__GNUC__) && (__GNUC__ == 3))
++              initialized = 1;
+ #elif defined(HAVE_ATOMIC_H) /* Solaris 10 defines atomic API within */
+               membar_producer();
+               atomic_add_int(&initialized, 1);
diff --git a/lang/php7/patches/1001-ext-opcache-fix-detection-of-shm-mmap.patch b/lang/php7/patches/1001-ext-opcache-fix-detection-of-shm-mmap.patch
new file mode 100644 (file)
index 0000000..d2a1e91
--- /dev/null
@@ -0,0 +1,159 @@
+From dc8bb6a53bfdfe42d9ae81d4e78c6155ad4bfd6e Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Sun, 17 May 2015 16:50:50 +0200
+Subject: [PATCH] ext/opcache: fix detection of shm/mmap
+
+The detection of sysvipc and mmap doesn't work well when cross-compiling,
+so I decided to only check for the availability of the functions involved.
+This is not a clean solution, but works for now(tm) :-)
+
+It should be discussed with upstream to find a better solution.
+
+This solves the issue reported at
+https://github.com/openwrt/packages/issues/1010
+and makes opcache usable on OpenWrt.
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ ext/opcache/config.m4 |  122 ++-----------------------------------------------
+ 1 file changed, 4 insertions(+), 118 deletions(-)
+
+diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
+index b7e4835..7b6c0aa 100644
+--- a/ext/opcache/config.m4
++++ b/ext/opcache/config.m4
+@@ -11,127 +11,13 @@ if test "$PHP_OPCACHE" != "no"; then
+     AC_DEFINE(HAVE_MPROTECT, 1, [Define if you have mprotect() function])
+   ])
+-  AC_MSG_CHECKING(for sysvipc shared memory support)
+-  AC_TRY_RUN([
+-#include <sys/types.h>
+-#include <sys/wait.h>
+-#include <sys/ipc.h>
+-#include <sys/shm.h>
+-#include <unistd.h>
+-#include <string.h>
+-
+-int main() {
+-  pid_t pid;
+-  int status;
+-  int ipc_id;
+-  char *shm;
+-  struct shmid_ds shmbuf;
+-
+-  ipc_id = shmget(IPC_PRIVATE, 4096, (IPC_CREAT | SHM_R | SHM_W));
+-  if (ipc_id == -1) {
+-    return 1;
+-  }
+-
+-  shm = shmat(ipc_id, NULL, 0);
+-  if (shm == (void *)-1) {
+-    shmctl(ipc_id, IPC_RMID, NULL);
+-    return 2;
+-  }
+-
+-  if (shmctl(ipc_id, IPC_STAT, &shmbuf) != 0) {
+-    shmdt(shm);
+-    shmctl(ipc_id, IPC_RMID, NULL);
+-    return 3;
+-  }
+-
+-  shmbuf.shm_perm.uid = getuid();
+-  shmbuf.shm_perm.gid = getgid();
+-  shmbuf.shm_perm.mode = 0600;
+-
+-  if (shmctl(ipc_id, IPC_SET, &shmbuf) != 0) {
+-    shmdt(shm);
+-    shmctl(ipc_id, IPC_RMID, NULL);
+-    return 4;
+-  }
+-
+-  shmctl(ipc_id, IPC_RMID, NULL);
+-
+-  strcpy(shm, "hello");
+-
+-  pid = fork();
+-  if (pid < 0) {
+-    return 5;
+-  } else if (pid == 0) {
+-    strcpy(shm, "bye");
+-    return 6;
+-  }
+-  if (wait(&status) != pid) {
+-    return 7;
+-  }
+-  if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
+-    return 8;
+-  }
+-  if (strcmp(shm, "bye") != 0) {
+-    return 9;
+-  }
+-  return 0;
+-}
+-],dnl
++  AC_CHECK_FUNC(shmget,[
+     AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
+-    msg=yes,msg=no,msg=no)
+-  AC_MSG_RESULT([$msg])
+-
+-  AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support)
+-  AC_TRY_RUN([
+-#include <sys/types.h>
+-#include <sys/wait.h>
+-#include <sys/mman.h>
+-#include <unistd.h>
+-#include <string.h>
+-
+-#ifndef MAP_ANON
+-# ifdef MAP_ANONYMOUS
+-#  define MAP_ANON MAP_ANONYMOUS
+-# endif
+-#endif
+-#ifndef MAP_FAILED
+-# define MAP_FAILED ((void*)-1)
+-#endif
+-
+-int main() {
+-  pid_t pid;
+-  int status;
+-  char *shm;
+-
+-  shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
+-  if (shm == MAP_FAILED) {
+-    return 1;
+-  }
+-
+-  strcpy(shm, "hello");
++  ])
+-  pid = fork();
+-  if (pid < 0) {
+-    return 5;
+-  } else if (pid == 0) {
+-    strcpy(shm, "bye");
+-    return 6;
+-  }
+-  if (wait(&status) != pid) {
+-    return 7;
+-  }
+-  if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
+-    return 8;
+-  }
+-  if (strcmp(shm, "bye") != 0) {
+-    return 9;
+-  }
+-  return 0;
+-}
+-],dnl
++  AC_CHECK_FUNC(mmap,[
+     AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
+-    msg=yes,msg=no,msg=no)
+-  AC_MSG_RESULT([$msg])
++  ])
+   AC_MSG_CHECKING(for mmap() using /dev/zero shared memory support)
+   AC_TRY_RUN([
+-- 
+1.7.10.4
+
diff --git a/lang/php7/patches/1002-gd-iconv.patch b/lang/php7/patches/1002-gd-iconv.patch
new file mode 100644 (file)
index 0000000..1418c27
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/ext/gd/libgd/gdkanji.c
++++ b/ext/gd/libgd/gdkanji.c
+@@ -9,6 +9,11 @@
+ #include "gdhelpers.h"
+ #include <stdarg.h>
++
++/* force usage of internal conversation routine */
++#undef HAVE_ICONV_H
++#undef HAVE_ICONV
++
+ #if defined(HAVE_ICONV_H) || defined(HAVE_ICONV)
+ #include <iconv.h>
+ #ifdef HAVE_ERRNO_H
diff --git a/lang/php7/patches/1003-Fix-dl-cross-compiling-issue.patch b/lang/php7/patches/1003-Fix-dl-cross-compiling-issue.patch
new file mode 100644 (file)
index 0000000..22122ec
--- /dev/null
@@ -0,0 +1,59 @@
+--- a/configure.in
++++ b/configure.in
+@@ -453,7 +453,10 @@ PHP_CHECK_FUNC(gethostname, nsl)
+ PHP_CHECK_FUNC(gethostbyaddr, nsl)
+ PHP_CHECK_FUNC(yp_get_default_domain, nsl)
+-PHP_CHECK_FUNC(dlopen, dl)
++PHP_ADD_LIBRARY(dl)
++PHP_DEF_HAVE(dlopen)
++PHP_DEF_HAVE(libdl)
++ac_cv_func_dlopen=yes
+ if test "$ac_cv_func_dlopen" = "yes"; then
+   AC_DEFINE(HAVE_LIBDL, 1, [ ])
+ fi
+--- a/ext/fileinfo/config.m4
++++ b/ext/fileinfo/config.m4
+@@ -46,6 +46,10 @@ int main(void)
+     AC_MSG_RESULT(no)
+     AC_MSG_NOTICE(using libmagic strcasestr implementation)
+     libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
++  ],[
++    dnl cross-compiling; assume not present
++    AC_MSG_NOTICE(using libmagic strcasestr implementation)
++    libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
+   ])
+   PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
+--- a/ext/opcache/config.m4
++++ b/ext/opcache/config.m4
+@@ -227,7 +227,14 @@ AC_TRY_RUN([
+       flock_type=linux
+     AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
+     AC_MSG_RESULT("yes")
+-], AC_MSG_RESULT("no") )
++], [
++    AC_MSG_RESULT("no")
++], [
++    dnl cross-compiling; assume Linux
++      flock_type=linux
++    AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
++    AC_MSG_RESULT("yes")
++])
+ AC_MSG_CHECKING("whether flock struct is BSD ordered")
+ AC_TRY_RUN([
+@@ -243,7 +250,12 @@ AC_TRY_RUN([
+       flock_type=bsd
+     AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type]) 
+     AC_MSG_RESULT("yes")
+-], AC_MSG_RESULT("no") )
++], [
++    AC_MSG_RESULT("no")
++], [
++    dnl cross-compiling; assume Linux
++    AC_MSG_RESULT("no")
++])
+ if test "$flock_type" == "unknown"; then
+       AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])
diff --git a/lang/php7/patches/1004-disable-phar-command.patch b/lang/php7/patches/1004-disable-phar-command.patch
new file mode 100644 (file)
index 0000000..19837f5
--- /dev/null
@@ -0,0 +1,32 @@
+--- a/ext/phar/config.m4       2016-08-17 21:50:58.000000000 +0200
++++ b/ext/phar/config.m4       2016-09-20 22:21:28.494934775 +0200
+@@ -26,7 +26,7 @@
+   fi
+   PHP_ADD_EXTENSION_DEP(phar, hash, true)
+   PHP_ADD_EXTENSION_DEP(phar, spl, true)
+-  PHP_ADD_MAKEFILE_FRAGMENT
++  #PHP_ADD_MAKEFILE_FRAGMENT
+   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
+@@ -1448,13 +1448,13 @@
+ INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
+ CXXFLAGS="$CXXFLAGS $standard_libtool_flag \$(PROF_FLAGS)"
+-if test "$PHP_PHAR" != "no" && test "$PHP_CLI" != "no"; then
+-  pharcmd=pharcmd
+-  pharcmd_install=install-pharcmd
+-else
++#if test "$PHP_PHAR" != "no" && test "$PHP_CLI" != "no"; then
++#  pharcmd=pharcmd
++#  pharcmd_install=install-pharcmd
++#else
+   pharcmd=
+   pharcmd_install=
+-fi;
++#fi;
+ all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_BINARIES) $pharcmd"
+ install_targets="$install_sapi $install_modules $install_binaries install-build install-headers install-programs $install_pear $pharcmd_install"
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
new file mode 100644 (file)
index 0000000..0afa951
--- /dev/null
@@ -0,0 +1,29 @@
+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/pecl.mk b/lang/php7/pecl.mk
new file mode 100644 (file)
index 0000000..caafc66
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/php7-pecl/Default
+  SUBMENU:=PHP
+  SECTION:=lang
+  CATEGORY:=Languages
+  URL:=http://pecl.php.net/
+  DEPENDS:=php7
+endef
+
+define Build/Prepare
+       $(Build/Prepare/Default)
+       ( cd $(PKG_BUILD_DIR); $(STAGING_DIR)/usr/bin/phpize7 )
+endef
+
+CONFIGURE_VARS+= \
+        ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no)
+
+CONFIGURE_ARGS+= \
+       --with-php-config=$(STAGING_DIR)/usr/bin/php7-config
+
+define PECLPackage
+
+  define Package/php7-pecl-$(1)
+    $(call Package/php7-pecl/Default)
+    TITLE:=$(2)
+
+    ifneq ($(3),)
+      DEPENDS+=$(3)
+    endif
+  endef
+
+  define Package/php7-pecl-$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/lib/php
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/
+       $(INSTALL_DIR) $$(1)/etc/php7
+    ifeq ($(5),zend)
+       echo "zend_extension=/usr/lib/php/$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
+    else
+       echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
+    endif
+  endef
+
+endef
diff --git a/lang/pillow/Makefile b/lang/pillow/Makefile
new file mode 100644 (file)
index 0000000..ee40d6c
--- /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_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
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-attrs/Makefile b/lang/python-attrs/Makefile
new file mode 100644 (file)
index 0000000..8720158
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..b6d15fd
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..03b9d6a
--- /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_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
new file mode 100644 (file)
index 0000000..e0a3b7b
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# 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
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-crypto/patches/002-fix-endianness-detect.patch b/lang/python-crypto/patches/002-fix-endianness-detect.patch
new file mode 100644 (file)
index 0000000..baed012
--- /dev/null
@@ -0,0 +1,13 @@
+--- 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
new file mode 100644 (file)
index 0000000..d657089
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..c0d25b8
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..b8658d9
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..7fd7c82
--- /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_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
new file mode 100644 (file)
index 0000000..4191f2a
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# 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
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-gmpy2/Makefile b/lang/python-gmpy2/Makefile
new file mode 100644 (file)
index 0000000..8337825
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..d954096
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..ccc1280
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..8def134
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# 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
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-mysql/Makefile b/lang/python-mysql/Makefile
new file mode 100644 (file)
index 0000000..04ebe5b
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# 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
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-packages/Makefile b/lang/python-packages/Makefile
new file mode 100644 (file)
index 0000000..701f0e6
--- /dev/null
@@ -0,0 +1,131 @@
+#
+# 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
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-parsley/Makefile b/lang/python-parsley/Makefile
new file mode 100644 (file)
index 0000000..75df427
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..71bd021
--- /dev/null
@@ -0,0 +1,12 @@
+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
new file mode 100644 (file)
index 0000000..4164ba8
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..2099e63
--- /dev/null
@@ -0,0 +1,76 @@
+#
+# 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
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-ply/Makefile b/lang/python-ply/Makefile
new file mode 100644 (file)
index 0000000..0b0e553
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..cf7ada8
--- /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_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
new file mode 100644 (file)
index 0000000..bc4142b
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..07549db
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..37e6c84
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# 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
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-pyopenssl/Makefile b/lang/python-pyopenssl/Makefile
new file mode 100644 (file)
index 0000000..85500ad
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..8f33246
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..03bb533
--- /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_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
new file mode 100644 (file)
index 0000000..b66927b
--- /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:=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
new file mode 100644 (file)
index 0000000..1f31222
--- /dev/null
@@ -0,0 +1,78 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..86e5bba
--- /dev/null
@@ -0,0 +1,20 @@
+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
new file mode 100644 (file)
index 0000000..d96ab08
--- /dev/null
@@ -0,0 +1,13 @@
+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
new file mode 100644 (file)
index 0000000..9f07049
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..d830e6f
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..dd4acd7
--- /dev/null
@@ -0,0 +1,11 @@
+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
new file mode 100644 (file)
index 0000000..a904db1
--- /dev/null
@@ -0,0 +1,29 @@
+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
new file mode 100644 (file)
index 0000000..5af33c6
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..3af2f0e
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# 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/files/config.site b/lang/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/files/python-host.mk b/lang/python/files/python-host.mk
new file mode 100644 (file)
index 0000000..6953a09
--- /dev/null
@@ -0,0 +1,81 @@
+#
+# 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
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/files/python-package-compiler.mk b/lang/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/files/python-package-ctypes.mk b/lang/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/files/python-package-db.mk b/lang/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/files/python-package-decimal.mk b/lang/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/files/python-package-dev.mk b/lang/python/files/python-package-dev.mk
new file mode 100644 (file)
index 0000000..647f649
--- /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
+       $(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
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/files/python-package-email.mk b/lang/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/files/python-package-gdbm.mk b/lang/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/files/python-package-lib2to3.mk b/lang/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/files/python-package-logging.mk b/lang/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/files/python-package-multiprocessing.mk b/lang/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/files/python-package-ncurses.mk b/lang/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/files/python-package-openssl.mk b/lang/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/files/python-package-pydoc.mk b/lang/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/files/python-package-sqlite3.mk b/lang/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/files/python-package-unittest.mk b/lang/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/files/python-package-xml.mk b/lang/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/files/python-package.mk b/lang/python/files/python-package.mk
new file mode 100644 (file)
index 0000000..d0818a6
--- /dev/null
@@ -0,0 +1,138 @@
+#
+# 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/patches/007-distutils-do-not-adjust-path.patch b/lang/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/python3-bottle/Makefile b/lang/python3-bottle/Makefile
new file mode 100644 (file)
index 0000000..b69d851
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=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
new file mode 100644 (file)
index 0000000..b7680b9
--- /dev/null
@@ -0,0 +1,61 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..b8c0bb6
--- /dev/null
@@ -0,0 +1,70 @@
+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
new file mode 100644 (file)
index 0000000..b112a3b
--- /dev/null
@@ -0,0 +1,61 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..86e5bba
--- /dev/null
@@ -0,0 +1,20 @@
+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
new file mode 100644 (file)
index 0000000..d96ab08
--- /dev/null
@@ -0,0 +1,13 @@
+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
new file mode 100644 (file)
index 0000000..3a08a93
--- /dev/null
@@ -0,0 +1,272 @@
+#
+# 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
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/python3/files/python3-host.mk b/lang/python3/files/python3-host.mk
new file mode 100644 (file)
index 0000000..8ff6dd7
--- /dev/null
@@ -0,0 +1,90 @@
+#
+# 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
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/python3/files/python3-package-codecs.mk b/lang/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/python3/files/python3-package-ctypes.mk b/lang/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/python3/files/python3-package-dbm.mk b/lang/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/python3/files/python3-package-decimal.mk b/lang/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/python3/files/python3-package-dev.mk b/lang/python3/files/python3-package-dev.mk
new file mode 100644 (file)
index 0000000..19d9592
--- /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
+       $(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
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/python3/files/python3-package-email.mk b/lang/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/python3/files/python3-package-gdbm.mk b/lang/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/python3/files/python3-package-lib2to3.mk b/lang/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/python3/files/python3-package-logging.mk b/lang/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/python3/files/python3-package-lzma.mk b/lang/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/python3/files/python3-package-multiprocessing.mk b/lang/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/python3/files/python3-package-ncurses.mk b/lang/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/python3/files/python3-package-openssl.mk b/lang/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/python3/files/python3-package-pydoc.mk b/lang/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/python3/files/python3-package-sqlite3.mk b/lang/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/python3/files/python3-package-unittest.mk b/lang/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/python3/files/python3-package-xml.mk b/lang/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/python3/files/python3-package.mk b/lang/python3/files/python3-package.mk
new file mode 100644 (file)
index 0000000..f13e737
--- /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.
+#
+
+$(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
new file mode 100644 (file)
index 0000000..08a130f
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..780831e
--- /dev/null
@@ -0,0 +1,25 @@
+From 6eeab87bc852481e599325549c854b701bf2e39f Mon Sep 17 00:00:00 2001
+From: Alexandru Ardelean <aa@ocedo.com>
+Date: Thu, 25 Sep 2014 18:18:29 +0300
+Subject: [PATCH] enable zlib
+
+---
+ Modules/Setup.dist | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Modules/Setup.dist b/Modules/Setup.dist
+index 01fb85f..01ac492 100644
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -358,7 +358,7 @@ _symtable symtablemodule.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -lz
+ # Interface to the Expat XML parser
+ #
+-- 
+1.8.4.5
+
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
new file mode 100644 (file)
index 0000000..44be1c8
--- /dev/null
@@ -0,0 +1,14 @@
+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
new file mode 100644 (file)
index 0000000..77c089f
--- /dev/null
@@ -0,0 +1,46 @@
+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
new file mode 100644 (file)
index 0000000..1da7b8b
--- /dev/null
@@ -0,0 +1,22 @@
+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
new file mode 100644 (file)
index 0000000..ea062a3
--- /dev/null
@@ -0,0 +1,31 @@
+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
new file mode 100644 (file)
index 0000000..52d52b9
--- /dev/null
@@ -0,0 +1,12 @@
+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
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/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
new file mode 100644 (file)
index 0000000..5a106d4
--- /dev/null
@@ -0,0 +1,15 @@
+diff --git a/setup.py b/setup.py
+index 7868b7b..544fa7e 100644
+--- a/setup.py
++++ b/setup.py
+@@ -452,8 +452,9 @@ class PyBuildExt(build_ext):
+         # directly since an inconsistently reproducible issue comes up where
+         # the environment variable is not set even though the value were passed
+         # into configure and stored in the Makefile (issue found on OS X 10.3).
++        rt_lib_dirs = [] if cross_compiling else self.compiler.runtime_library_dirs
+         for env_var, arg_name, dir_list in (
+-                ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
++                ('LDFLAGS', '-R', rt_lib_dirs),
+                 ('LDFLAGS', '-L', self.compiler.library_dirs),
+                 ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+             env_val = sysconfig.get_config_var(env_var)
diff --git a/lang/python3/patches/011-do-not-prefer-ncursesw.patch b/lang/python3/patches/011-do-not-prefer-ncursesw.patch
new file mode 100644 (file)
index 0000000..c023225
--- /dev/null
@@ -0,0 +1,15 @@
+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
new file mode 100644 (file)
index 0000000..0df72c7
--- /dev/null
@@ -0,0 +1,24 @@
+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
new file mode 100644 (file)
index 0000000..55a383c
--- /dev/null
@@ -0,0 +1,13 @@
+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
new file mode 100644 (file)
index 0000000..cbc32d5
--- /dev/null
@@ -0,0 +1,26 @@
+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
new file mode 100644 (file)
index 0000000..eec488f
--- /dev/null
@@ -0,0 +1,12 @@
+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
new file mode 100644 (file)
index 0000000..fb709b7
--- /dev/null
@@ -0,0 +1,72 @@
+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
new file mode 100644 (file)
index 0000000..205338d
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..5722474
--- /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_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))
diff --git a/lang/ruby/files/ruby b/lang/ruby/files/ruby
new file mode 100644 (file)
index 0000000..e4904fc
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+if ! [ -r "@RUBY_LIBPATH@/rubygems.rb" ]; then
+       exec @RUBY_BINPATH@ --disable-gems "$@"
+fi
+exec @RUBY_BINPATH@ "$@"
diff --git a/lang/ruby/ruby_find_pkgsdeps b/lang/ruby/ruby_find_pkgsdeps
new file mode 100644 (file)
index 0000000..15a6408
--- /dev/null
@@ -0,0 +1,266 @@
+#!/usr/bin/ruby -Eutf-8
+# encoding: utf-8
+#
+# Find dependencies between ruby packages
+#
+# Must run inside a openwrt with all *ruby* packages installed
+#
+
+RUBY_SIMPLE_VERSION = RUBY_VERSION.split(".")[0..1].join(".")
+failed = false
+
+puts "Looking for installed ruby packages..."
+packages=`opkg list-installed '*ruby*' | cut -d' ' -f 1`.split("\n")
+
+puts "Looking for packages files..."
+package_files=Hash.new { |h,k| h[k]=[] }
+packages.each do
+       |pkg|
+       files=`opkg files "#{pkg}" | sed -e 1d`.split("\n")
+       package_files[pkg]=files if files
+end
+
+require_regex=/^require ["']([^"']+)["'].*/
+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}
+
+builtin_enc=[
+       Encoding.find("ASCII-8BIT"),
+       Encoding.find("UTF-8"),
+       Encoding.find("UTF-7"),
+       Encoding.find("US-ASCII"),
+]
+
+puts "Looking for requires in files..."
+files_requires=Hash.new { |h,k| h[k]=[] }
+packages.each do
+        |pkg|
+       package_files[pkg].each do
+               |file|
+               next if not File.file?(file)
+
+               if not file =~ /.rb$/
+                       if File.executable?(file)
+                               magic=`head -c50 '#{file}' | head -1`
+                               begin
+                                       if not magic =~ /ruby/
+                                               next
+                                       end
+                               rescue
+                                       next
+                               end
+                       else
+                               next
+                       end
+               end
+               #puts "Checking #{file}..."
+               File.open(file, "r") do
+                       |f|
+                       lineno=0
+                       while line=f.gets() do
+                               lineno+=1; encs=[]; requires=[]; need_encdb=false
+
+                               line=line.chomp.gsub!(/^[[:blank:]]*/,"")
+
+                               case line
+                               when /^#.*coding *:/
+                                       if lineno <= 2
+                                               enc=line.sub(/.*coding *: */,"").sub(/ .*/,"")
+                                               encs << Encoding.find(enc)
+                                       end
+                               end
+                               line.gsub!(/#.*/,"")
+                               case line
+                               when "__END__"
+                                       break
+                               when /^require /
+                                       #puts "#{file}:#{line}"
+                                       if require_regex_ignore =~ line
+                                               #puts "Ignoring #{line} at #{file}:#{lineno} (REGEX)..."
+                                               next
+                                       end
+                                       if not require_regex =~ line
+                                               $stderr.puts "Unknown require: '#{line}' at file #{file}:#{lineno}"
+                                               failed=true
+                                       end
+                                       require=line.gsub(require_regex,"\\1")
+                                       require.gsub!(/\.(so|rb)$/,"")
+
+                                       if require_ignore.include?(require)
+                                               #puts "Ignoring #{line} at #{file}:#{lineno} (STR)..."
+                                               next
+                                       end
+
+                                       files_requires[file] += [require]
+
+                               when /Encoding::/
+                                       encs=line.scan(/Encoding::[[:alnum:]_]+/).collect {|enc| eval(enc) }.select {|enc| enc.kind_of? Encoding }
+                                       need_encdb=true
+                               end
+
+                               next if encs.empty?
+                               required_encs = (encs - builtin_enc).collect {|enc| "enc/#{enc.name.downcase.gsub("-","_")}" }
+                               required_encs << "enc/encdb" if need_encdb
+
+                               files_requires[file] += required_encs
+                       end
+               end
+       end
+end
+exit(1) if failed
+
+# Add deps from .so
+package_files.each do |(pkg,files)| files.each do |file|
+       case file
+       when /\/nkf\.so$/
+               files_requires[file]= files_requires[file] + ["enc/encdb"]
+       end
+end; end
+
+puts "Grouping package requirements per package"
+package_requires_files = Hash.new{|h,k| h[k] = Hash.new { |h2,k2| h2[k2] = [] } }
+package_files.each do |(pkg,files)|
+       package_requires_files[pkg]
+       files.each do |file|
+               files_requires[file].each do |requires|
+                       package_requires_files[pkg][requires] << file
+               end
+       end
+end
+
+weak_dependency=Hash.new { |h,k| h[k]=[] }
+weak_dependency.merge!({
+"ruby-misc"=>["ruby-openssl","ruby-fiddle"],                   #securerandom.rb
+"ruby-debuglib"=>["ruby-readline"],                            #debug.rb
+"ruby-drb"=>["ruby-openssl"],                                  #drb/ssl.rb
+"ruby-irb"=>["ruby-rdoc", "ruby-readline"],                    #irb/cmd/help.rb
+"ruby-gems"=>["ruby-openssl","ruby-io-console","ruby-webrick"], #rubygems/commands/cert_command.rb rubygems/user_interaction.rb rubygems/server.rb
+"ruby-mkmf"=>["ruby-webrick"],                                         #un.rb
+"ruby-net"=>["ruby-openssl","ruby-io-console","ruby-zlib"],    #net/*.rb
+"ruby-optparse"=>["ruby-uri","ruby-datetime"],                 #optparse/date.rb optparse/uri.rb
+"ruby-rake"=>["ruby-net","ruby-gems"],                         #rake/contrib/ftptools.rb /usr/bin/rake
+"ruby-rdoc"=>["ruby-gems","ruby-readline","ruby-webrick",      #/usr/bin/rdoc and others
+              "ruby-io-console"],                              #rdoc/stats/normal.rb
+"ruby-webrick"=>["ruby-openssl"],                              #webrick/ssl.rb
+"ruby-testunit"=>["ruby-io-console"],                          #gems/test-unit-3.1.5/lib/test/unit/ui/console/testrunner.rb
+})
+
+puts "Preloading gems..."
+Gem::Specification.all.each{ |x| gem x.name }
+
+puts "Looking for package dependencies..."
+package_provides = {}
+package_dependencies = Hash.new { |h,k| h[k]=[] }
+package_requires_files.each do
+       |(pkg,requires_files)|
+
+       requires_files.each do
+               |(require,files)|
+               if package_provides.include?(require)
+                       found = package_provides[require]
+               else
+                       found = package_files.detect {|(pkg,files)| files.detect {|file| $:.detect {|path| "#{path}/#{require}" == file.gsub(/\.(so|rb)$/,"") } } }
+                       if not found
+                               $stderr.puts "#{pkg}: Nothing provides #{require} for #{files.collect {|file| file.sub("/usr/lib/ruby/","") }.join(",")}"
+                               failed = true
+                               next
+                       end
+                       found = found.first
+                       package_provides[require] = found
+               end
+               if weak_dependency[pkg].include?(found)
+                       puts "#{pkg}: #{found} provides #{require} (weak depedendency ignored)"
+               else
+                       puts "#{pkg}: #{found} provides #{require} for #{files.collect {|file| file.sub("/usr/lib/ruby/","") }.join(",")}"
+                       package_dependencies[pkg] += [found]
+               end
+       end
+end
+if failed
+       puts "There is some missing requirements not mapped to files in packages."
+       puts "Please, fix the missing files or ignore them on require_ignore var"
+       exit(1)
+end
+# Remove self dependency
+package_dependencies = Hash[package_dependencies.collect {|(pkg,deps)| [pkg,package_dependencies[pkg]=deps.uniq.sort - [pkg]]}]
+package_dependencies.default = []
+
+puts "Expanding dependencies..."
+begin
+       changed=false
+       package_dependencies.each do
+               |(pkg,deps)|
+               next if deps.empty?
+               deps_new = deps.collect {|dep| [dep] + package_dependencies[dep] }.inject([],:+).uniq.sort
+               if not deps == deps_new
+                       puts "#{pkg}: #{deps.join(",")}"
+                       puts "#{pkg}: #{deps_new.join(",")}"
+                       package_dependencies[pkg]=deps_new
+                       changed=true
+               end
+       end
+end if not changed
+
+puts "Removing redundant dependencies..."
+package_dependencies.each do
+       |(pkg,deps)|
+       package_dependencies[pkg]=deps.uniq - [pkg]
+end
+
+puts "Checking for mutual dependencies..."
+package_dependencies.each do
+       |(pkg,deps)|
+       if deps.include? pkg
+               $stderr.puts "#{pkg}: Cycle dependency detected! "
+               failed = true
+       end
+end
+exit(1) if failed
+
+
+package_dependencies2=package_dependencies.dup
+package_dependencies.each do
+       |(pkg,deps)|
+
+       # Ignore dependencies that are already required by another dependency
+       deps_clean = deps.reject {|dep_suspect| deps.detect {|dep_provider|
+                       if package_dependencies[dep_provider].include?(dep_suspect)
+                               puts "#{pkg}: #{dep_suspect} is already required by #{dep_provider}"
+                               true
+                       end
+                } }
+
+       if not deps==deps_clean
+               puts "before: #{deps.join(",")}"
+               puts "after: #{deps_clean.join(",")}"
+               package_dependencies2[pkg]=deps_clean
+       end
+end
+package_dependencies=package_dependencies2
+
+puts "Checking current packages dependencies..."
+ok=true
+package_dependencies.each do
+       |(pkg,deps)|
+       current_deps=`opkg depends #{pkg} | sed -r -e '1d;s/^[[:blank:]]*//'`.split("\n")
+       current_deps.reject!{|dep| dep =~ /^lib/ }
+       current_deps -= ["ruby"]
+
+       extra_dep = current_deps - deps
+       $stderr.puts "Package #{pkg} does not need to depend on #{extra_dep.join(" ")} " if not extra_dep.empty?
+       missing_dep = deps - current_deps
+       $stderr.puts "Package #{pkg} needs to depend on #{missing_dep.join(" ")} " if not missing_dep.empty?
+
+       if not extra_dep.empty? or not missing_dep.empty?
+               $stderr.puts "define Package/#{pkg}"
+               $stderr.puts "  DEPENDS:=ruby#{([""] +deps).join(" +")}"
+               ok=false
+       end
+end
+
+puts "All dependencies are OK." if ok
+
+__END__
diff --git a/lang/ruby/ruby_missingfiles b/lang/ruby/ruby_missingfiles
new file mode 100644 (file)
index 0000000..25e5810
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# bash feeds/packages/lang/ruby/ruby_missingfiles staging_dir/target-i386_i486_musl-1.1.11/ bin/x86/packages/packages/*ruby*_2.3.0*
+#
+
+function list_staging_files {
+       cd "$1"; find \
+               \( \( -name "root-*" -or -name "packages" -or -name "stamp" -or -name "pkginfo" -or -name "host" \) -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/*" \
+               -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
+}
+
+
+echo "                          Staging                                             Packages"
+
+: ${1:?First arg is staging_dir}
+: ${2:?Second and following args are ruby ipkg packages}
+STAGING_DIR=$1; shift
+diff -d -y <(list_staging_files "$STAGING_DIR") <(list_ipkg_files "$@")
+
diff --git a/lang/simplejson/Makefile b/lang/simplejson/Makefile
new file mode 100644 (file)
index 0000000..c6d9c2b
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# 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))
diff --git a/lang/tcl/Makefile b/lang/tcl/Makefile
new file mode 100644 (file)
index 0000000..7436704
--- /dev/null
@@ -0,0 +1,73 @@
+#
+# 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:=tcl
+PKG_VERSION:=8.6.4
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION)-src.tar.gz
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
+PKG_MD5SUM:=d7cbb91f1ded1919370a30edd1534304
+
+PKG_LICENSE:=TCL
+PKG_LICENSE_FILES:=license.terms
+PKG_MAINTAINER:=Joe Mistachkin <joe@mistachkin.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)$(PKG_VERSION)
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tcl
+  SUBMENU:=Tcl
+  SECTION:=lang
+  CATEGORY:=Languages
+  DEPENDS:=+libpthread @BROKEN
+  TITLE:=The Tcl language
+  URL:=http://www.tcl.tk/
+endef
+
+define Package/tcl/description
+  Tcl, or Tool Command Language, is a an elegant, versatile, feature-rich,
+  simple-to-learn yet very powerful industrial-strength open-source
+  programming language and development platform. It is renowned for its
+  stability and utility, and its emphasis on providing a cross-platform
+  programming API makes it an ideal choice for an enormous variety of
+  programming jobs.
+endef
+
+CONFIGURE_PATH := unix
+
+CONFIGURE_VARS += \
+       tcl_cv_strtod_unbroken=ok
+
+CONFIGURE_ARGS += \
+       --enable-threads
+
+MAKE_PATH := unix
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtcl*.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/tcl/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/* $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,tcl))
diff --git a/lang/tcl/patches/100-disable_tzdata_and_msgs_install.patch b/lang/tcl/patches/100-disable_tzdata_and_msgs_install.patch
new file mode 100644 (file)
index 0000000..1db8f07
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/unix/Makefile.in
++++ b/unix/Makefile.in
+@@ -817,15 +817,15 @@ install-tzdata: tclsh
+       @echo "Installing time zone data"
+       @@LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \
+       TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
+-      ./tclsh $(TOOL_DIR)/installData.tcl \
+-          $(TOP_DIR)/library/tzdata "$(SCRIPT_INSTALL_DIR)"/tzdata
++      #./tclsh $(TOOL_DIR)/installData.tcl \
++      #    $(TOP_DIR)/library/tzdata "$(SCRIPT_INSTALL_DIR)"/tzdata
+ install-msgs: tclsh
+       @echo "Installing message catalogs"
+       @@LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \
+       TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \
+-      ./tclsh $(TOOL_DIR)/installData.tcl \
+-          $(TOP_DIR)/library/msgs "$(SCRIPT_INSTALL_DIR)"/msgs
++      #./tclsh $(TOOL_DIR)/installData.tcl \
++      #    $(TOP_DIR)/library/msgs "$(SCRIPT_INSTALL_DIR)"/msgs
+ install-doc: doc
+       @for i in "$(MAN_INSTALL_DIR)" "$(MAN1_INSTALL_DIR)" "$(MAN3_INSTALL_DIR)" "$(MANN_INSTALL_DIR)" ; \
diff --git a/lang/tcl/patches/200-fix_mips_build.patch b/lang/tcl/patches/200-fix_mips_build.patch
new file mode 100644 (file)
index 0000000..48485ca
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/generic/tclStrToD.c
++++ b/generic/tclStrToD.c
+@@ -73,7 +73,7 @@ typedef unsigned int fpu_control_t __att
+  * MIPS floating-point units need special settings in control registers
+  * to use gradual underflow as we expect.
+  */
+-#if defined(__mips)
++#if defined(__sgi) && defined(_COMPILER_VERSION)
+ #include <sys/fpu.h>
+ #endif
+ /*
+@@ -2166,7 +2166,7 @@ TclInitDoubleConversion(void)
+     } bitwhack;
+ #endif
+-#if defined(__mips)
++#if defined(__sgi) && defined(_COMPILER_VERSION)
+     union fpc_csr mipsCR;
+     mipsCR.fc_word = get_fpc_csr();
diff --git a/lang/twisted/Makefile b/lang/twisted/Makefile
new file mode 100644 (file)
index 0000000..dc92e4d
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..6cb85c6
--- /dev/null
@@ -0,0 +1,10 @@
+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
new file mode 100644 (file)
index 0000000..8d545bf
--- /dev/null
@@ -0,0 +1,41 @@
+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",
diff --git a/lang/uuid/Makefile b/lang/uuid/Makefile
new file mode 100644 (file)
index 0000000..a093e66
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# 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:=uuid
+PKG_VERSION:=0.2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/Tieske/uuid.git
+PKG_SOURCE_VERSION:=version_$(PKG_VERSION)
+
+PKG_MAINTAINER:=Amr Hassan <amr.hassan@gmail.com>
+PKG_LICENSE=Apache-2.0
+
+LUA_MODULE_PATH:=/usr/lib/lua
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/uuid
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=uuid
+  URL:=https://github.com/Tieske/uuid
+  DEPENDS:=+lua +luasocket
+endef
+
+define Package/uuid/description
+       A pure Lua uuid generator
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/uuid/install
+       $(INSTALL_DIR) $(1)/$(LUA_MODULE_PATH)
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/uuid.lua $(1)/$(LUA_MODULE_PATH)/uuid.lua
+endef
+
+$(eval $(call BuildPackage,uuid))
diff --git a/lang/vala/Makefile b/lang/vala/Makefile
new file mode 100644 (file)
index 0000000..f9049ee
--- /dev/null
@@ -0,0 +1,93 @@
+#
+# 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:=vala
+PKG_VERSION:=0.34.2
+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_BUILD_DEPENDS:=glib2 glib2/host vala/host
+HOST_BUILD_DEPENDS:=glib2/host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+TARGET_LDFLAGS+=\
+        -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
+define Package/vala
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=C-sharp like language for the GObject system
+  URL:=https://wiki.gnome.org/Projects/Vala
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+  DEPENDS:=+glib2 +libpthread
+endef
+
+define Package/vala/description
+Vala is a C-sharp like language for the GObject system. This package contains
+the Vala-to-C compiler.
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) \
+               $(1)/usr/share/vala-0.34/vapi \
+               $(1)/usr/lib \
+               $(1)/usr/lib/pkgconfig
+
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/share/vala-0.34/vapi/* \
+               $(1)/usr/share/vala-0.34/vapi
+
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/libvala-0.34.{so*,la} \
+               $(1)/usr/lib
+
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
+               $(1)/usr/lib/pkgconfig
+endef
+
+define Package/vala/install
+       $(INSTALL_DIR) \
+               $(1)/usr/share/vala-0.34/vapi \
+               $(1)/usr/lib \
+               $(1)/usr/lib/pkgconfig \
+               $(1)/usr/bin
+
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/share/vala-0.34/vapi/* \
+               $(1)/usr/share/vala-0.34/vapi
+
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/libvala-0.34.{so*,la} \
+               $(1)/usr/lib
+
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/bin/{vala,vala-0.34,valac,valac-0.34,vapicheck,vapicheck-0.34,vapigen,vapigen-0.34,vala-gen-introspect,vala-gen-introspect-0.34} \
+               $(1)/usr/bin
+
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
+               $(1)/usr/lib/pkgconfig
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,vala))
diff --git a/lang/zope-interface/Makefile b/lang/zope-interface/Makefile
new file mode 100644 (file)
index 0000000..34b5e2b
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# 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))
diff --git a/libs/alsa-lib/patches/001-link_fix.patch b/libs/alsa-lib/patches/001-link_fix.patch
new file mode 100644 (file)
index 0000000..001a8bc
--- /dev/null
@@ -0,0 +1,22 @@
+--- 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
new file mode 100644 (file)
index 0000000..fc6c6f5
--- /dev/null
@@ -0,0 +1,142 @@
+--- 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/apr-util/Makefile b/libs/apr-util/Makefile
new file mode 100644 (file)
index 0000000..97d377c
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# 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:=apr-util
+PKG_VERSION:=1.5.4
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@APACHE/apr/
+PKG_MD5SUM:=2202b18f269ad606d70e1864857ed93c
+PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
+PKG_LICENSE:=Apache License
+
+PKG_FIXUP:=autoreconf
+PKG_REMOVE_FILES:=aclocal.m4 build/ltmain.sh
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/libaprutil
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libapr +libexpat +libsqlite3 +libuuid $(ICONV_DEPENDS)
+  TITLE:=Apache Portable Runtime Utility Library
+  URL:=http://apr.apache.org/
+endef
+
+TARGET_CFLAGS += $(FPIC)
+TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
+
+CONFIGURE_ARGS += \
+       --with-pgsql=no \
+       --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
+       --with-expat="$(STAGING_DIR)/usr" \
+       --without-sqlite2 \
+       --with-sqlite3="$(STAGING_DIR)/usr"
+
+ifdef $(CONFIG_BUILD_NLS)
+       CONFIGURE_ARGS += --with-iconv="$(ICONV_PREFIX)"
+else
+       CONFIGURE_ARGS += --without-iconv
+endif
+
+CONFIGURE_VARS += \
+       ac_cv_file_dbd_apr_dbd_mysql_c=no \
+       ac_cv_path_ODBC_CONFIG= \
+       APR_BUILD_DIR="$(STAGING_DIR)/usr/share/build-1"
+
+MAKE_FLAGS += \
+       APRUTIL_LIBS="-lsqlite3 $(TARGET_LDFLAGS) -lexpat $(if $(ICONV_FULL),-liconv) -lapr-1 -luuid -lm -lcrypt"
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1/ $(1)/usr/lib  $(1)/usr/lib/pkgconfig/
+       $(CP)   $(PKG_INSTALL_DIR)/usr/bin/apu-1-config \
+               $(1)/usr/bin/
+       $(CP)   $(PKG_INSTALL_DIR)/usr/include/apr-1/* \
+               $(1)/usr/include/apr-1/
+       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.{la,a,so*} \
+               $(1)/usr/lib/
+       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-util-1.pc \
+               $(1)/usr/lib/pkgconfig/
+       $(SED) 's, -e \"s -I$$$$prefix/lib  g\",,g' $(1)/usr/bin/apu-1-config
+       $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' $(1)/usr/bin/apu-1-config
+       $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/apu-1-config
+       $(SED) 's,-L$$$$libdir,,g' $(1)/usr/bin/apu-1-config
+       $(SED) 's,-R$$$$libdir,,g' $(1)/usr/bin/apu-1-config
+endef
+
+define Package/libaprutil/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libaprutil))
diff --git a/libs/apr-util/patches/001-automake-compat.patch b/libs/apr-util/patches/001-automake-compat.patch
new file mode 100644 (file)
index 0000000..20c4cf2
--- /dev/null
@@ -0,0 +1,21 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -8,6 +8,7 @@ APRUTIL_MAJOR_VERSION=@APRUTIL_MAJOR_VER
+ APRUTIL_DOTTED_VERSION=@APRUTIL_DOTTED_VERSION@
+ srcdir = @srcdir@
++top_builddir = @top_builddir@
+ VPATH = @srcdir@
+ INCLUDES = @APRUTIL_PRIV_INCLUDES@ @APR_INCLUDES@ @APRUTIL_INCLUDES@
+--- a/configure.in
++++ b/configure.in
+@@ -41,6 +41,8 @@ AC_SUBST(APU_CONFIG_LOCATION)
+ AC_CANONICAL_SYSTEM
+ AC_PROG_INSTALL
++AC_PROG_LIBTOOL
++LT_INIT
+ # Use -no-install or -no-fast-install to link the test 
+ # programs on all platforms but Darwin, where it would cause
diff --git a/libs/apr/Makefile b/libs/apr/Makefile
new file mode 100644 (file)
index 0000000..975447d
--- /dev/null
@@ -0,0 +1,79 @@
+#
+# Copyright (C) 2007-2011 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:=apr
+PKG_VERSION:=1.5.2
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@APACHE/apr/
+PKG_MD5SUM:=4e9769f3349fe11fc0a5e1b224c236aa
+PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
+PKG_LICENSE:=Apache License
+
+PKG_FIXUP:=autoreconf
+PKG_REMOVE_FILES:=aclocal.m4 build/ltmain.sh
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libapr
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libpthread +librt +libuuid
+  TITLE:=Apache Portable Runtime Library
+  URL:=http://apr.apache.org/
+endef
+
+TARGET_CFLAGS += $(FPIC)
+TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
+
+CONFIGURE_ARGS += \
+       --with-devrandom=/dev/urandom \
+       --disable-dso \
+       $(call autoconf_bool,CONFIG_IPV6,ipv6)
+
+# XXX: ac_cv_sizeof_struct_iovec=1 is just to trick configure
+CONFIGURE_VARS += \
+       ac_cv_sizeof_struct_iovec=1 \
+       ac_cv_struct_rlimit=yes \
+       apr_cv_process_shared_works=no \
+       apr_cv_mutex_robust_shared=no \
+       apr_cv_tcp_nodelay_with_cork=yes \
+       apr_cv_use_lfs64=yes \
+       LDFLAGS="$$$$LDFLAGS -lpthread" \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1 $(1)/usr/lib $(1)/usr/lib/pkgconfig $(1)/usr/share/build-1
+       $(CP)   $(PKG_INSTALL_DIR)/usr/bin/apr-1-config \
+               $(1)/usr/bin/
+       $(CP)   $(PKG_INSTALL_DIR)/usr/include/apr-1/* \
+               $(1)/usr/include/apr-1/
+       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/libapr-1.{la,a,so*} \
+               $(1)/usr/lib/
+       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-1.pc \
+               $(1)/usr/lib/pkgconfig/
+       $(CP)   $(PKG_INSTALL_DIR)/usr/share/build-1/* \
+               $(1)/usr/share/build-1/
+       $(SED) 's,^datadir=\"/usr/share\",datadir=\"$(STAGING_DIR)/usr/share\",g' $(1)/usr/bin/apr-1-config
+       $(SED) 's,^installbuilddir=\"/usr/share/build-1\",installbuilddir=\"$(STAGING_DIR)/usr/share/build-1\",g' $(1)/usr/bin/apr-1-config
+       $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' $(1)/usr/bin/apr-1-config
+       $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/apr-1-config
+       $(SED) 's,-L$$$$libdir,,g' $(1)/usr/bin/apr-1-config
+       $(SED) 's,-R$$$$libdir,,g' $(1)/usr/bin/apr-1-config
+       $(SED) 's,/usr/share/build-1,$(STAGING_DIR)/usr/share/build-1,g' $(1)/usr/share/build-1/apr_rules.mk
+endef
+
+define Package/libapr/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libapr))
diff --git a/libs/apr/patches/001-autoconf-compat.patch b/libs/apr/patches/001-autoconf-compat.patch
new file mode 100644 (file)
index 0000000..acc94fc
--- /dev/null
@@ -0,0 +1,26 @@
+Index: apr-1.5.2/Makefile.in
+===================================================================
+--- apr-1.5.2.orig/Makefile.in
++++ apr-1.5.2/Makefile.in
+@@ -3,6 +3,7 @@ srcdir=@srcdir@
+ VPATH=@srcdir@
+ top_srcdir=@apr_srcdir@
+ top_blddir=@apr_builddir@
++top_builddir=@top_builddir@
+ #
+ # APR (Apache Portable Runtime) library Makefile.
+Index: apr-1.5.2/configure.in
+===================================================================
+--- apr-1.5.2.orig/configure.in
++++ apr-1.5.2/configure.in
+@@ -245,9 +245,6 @@ case $host in
+     gcc $CFLAGS $CPPFLAGS -o $LIBTOOL.exe $LIBTOOL.c
+     ;;
+ *)
+-    if test "x$LTFLAGS" = "x"; then
+-        LTFLAGS='--silent'
+-    fi
+     if test "$experimental_libtool" = "yes"; then
+         # Use a custom-made libtool replacement
+         echo "using jlibtool"
diff --git a/libs/apr/patches/101-fix_apr_time_now.patch b/libs/apr/patches/101-fix_apr_time_now.patch
new file mode 100644 (file)
index 0000000..6ad14a3
--- /dev/null
@@ -0,0 +1,13 @@
+https://dev.openwrt.org/ticket/9287
+
+--- a/time/unix/time.c
++++ b/time/unix/time.c
+@@ -75,7 +75,7 @@ APR_DECLARE(apr_time_t) apr_time_now(voi
+ {
+     struct timeval tv;
+     gettimeofday(&tv, NULL);
+-    return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec;
++    return tv.tv_sec * (apr_time_t)APR_USEC_PER_SEC + (apr_time_t)tv.tv_usec;
+ }
+ static void explode_time(apr_time_exp_t *xt, apr_time_t t,
diff --git a/libs/apr/patches/201-upgrade-and-fix-1.5.1.patch b/libs/apr/patches/201-upgrade-and-fix-1.5.1.patch
new file mode 100644 (file)
index 0000000..87cd546
--- /dev/null
@@ -0,0 +1,51 @@
+Makefile.in: fix cross compiling failed
+
+The tools/gen_test_char was invoked at build time,
+and it didn't work for the cross compiling, so we
+compile it with $BUILDCC.
+
+Remove the 'tools' dir creation, it always existed.
+And it caused gen_test_char unexpected rebuilt at
+do_install time.
+
+Upstream-Status: inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 10 ++--------
+ 1 file changed, 2 insertions(+), 8 deletions(-)
+
+Index: apr-1.5.2/Makefile.in
+===================================================================
+--- apr-1.5.2.orig/Makefile.in
++++ apr-1.5.2/Makefile.in
+@@ -20,7 +20,7 @@ INCDIR=./include
+ OSDIR=$(top_srcdir)/include/arch/@OSDIR@
+ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@
+ INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include/arch/@DEFAULT_OSDIR@ -I$(top_srcdir)/include -I$(top_srcdir)/include/private -I$(top_blddir)/include/private
+-
++BUILDCC=gcc
+ #
+ # Macros for target determination
+ #
+@@ -47,7 +47,6 @@ LT_VERSION = @LT_VERSION@
+ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \
+       build/apr_rules.out tools/gen_test_char@EXEEXT@ \
+-      tools/gen_test_char.o tools/gen_test_char.lo \
+       include/private/apr_escape_test_char.h
+ DISTCLEAN_TARGETS = config.cache config.log config.status \
+       include/apr.h include/arch/unix/apr_private.h \
+@@ -135,9 +134,9 @@ tools/gen_test_char.lo: tools/gen_test_c
+       $(APR_MKDIR) tools
+       $(LT_COMPILE)
+-tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)
+-      $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
+-
++tools/gen_test_char@EXEEXT@: tools/gen_test_char.c
++      $(BUILDCC) $(CFLAGS_FOR_BUILD) $< -o $@
++ 
+ include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@
+       $(APR_MKDIR) include/private
+       tools/gen_test_char@EXEEXT@ > $@
diff --git a/libs/avahi/Makefile b/libs/avahi/Makefile
new file mode 100644 (file)
index 0000000..71e6d62
--- /dev/null
@@ -0,0 +1,406 @@
+#
+# 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:=avahi
+PKG_VERSION:=0.6.32
+PKG_RELEASE:=1
+
+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_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm intltool/host libpthread dbus
+
+PKG_FIXUP:=autoreconf
+PKG_REMOVE_FILES:=autogen.sh
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+ifeq ($(BUILD_VARIANT),dbus)
+PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/dbus/$(PKG_NAME)-$(PKG_VERSION)
+else
+PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/nodbus/$(PKG_NAME)-$(PKG_VERSION)
+endif
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/avahi/Default
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=An mDNS/DNS-SD implementation
+  URL:=http://www.avahi.org/
+endef
+
+define Package/avahi/Default/description
+ Avahi is an mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf)
+ implementation (library). It facilitates
+ service discovery on a local network -- this means that
+ you can plug your laptop or computer into a network and
+ instantly be able to view other people who you can chat with,
+ find printers to print to or find files being shared.
+ This kind of technology is already found in MacOS X
+ (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
+ and is very convenient.
+endef
+
+define Package/libavahi/Default
+  $(call Package/avahi/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  PROVIDES:=libavahi
+  DEPENDS:=+libpthread
+endef
+
+define Package/libavahi/description
+$(call Package/avahi/Default/description)
+ .
+ The libavahi package contains the mDNS/DNS-SD shared libraries,
+ used by other programs. Specifically, it provides
+ libavahi-core and libavahi-common libraries.
+endef
+
+define Package/avahi-autoipd
+  $(call Package/avahi/Default)
+  SUBMENU:=IP Addresses and Names
+  DEPENDS:=+libdaemon
+  TITLE:=IPv4LL network address configuration daemon
+endef
+
+define Package/avahi-autoipd/description
+$(call Package/avahi/Default/description)
+ .
+ This package implements IPv4LL, "Dynamic Configuration of IPv4 Link-Local
+ Addresses" (IETF RFC3927), a protocol for automatic IP address configuration
+ from the link-local 169.254.0.0/16 range without the need for a central
+ server. It is primarily intended to be used in ad-hoc networks which lack a
+ DHCP server.
+endef
+
+define Package/avahi-dbus-daemon
+  $(call Package/avahi/Default)
+  PROVIDES:=avahi-daemon
+  VARIANT:=dbus
+  SUBMENU:=IP Addresses and Names
+  DEPENDS:=+libavahi-dbus-support +libexpat +librt +libdaemon
+  TITLE+= (daemon)
+endef
+
+define Package/avahi-nodbus-daemon
+  $(call Package/avahi/Default)
+  PROVIDES:=avahi-daemon
+  VARIANT:=nodbus
+  SUBMENU:=IP Addresses and Names
+  DEPENDS:=+libavahi-nodbus-support +libexpat +librt +libdaemon
+  TITLE+= (daemon)
+  USERID:=avahi=105:avahi=105
+endef
+
+define Package/avahi-daemon/description
+$(call Package/avahi/Default/description)
+ .
+ This package contains an mDNS/DNS-SD daemon.
+endef
+
+Package/avahi-dbus-daemon/description=$(Package/avahi-daemon/description)
+Package/avahi-nodbus-daemon/description=$(Package/avahi-daemon/description)
+
+define Package/avahi-daemon/conffiles
+/etc/avahi/avahi-daemon.conf
+endef
+
+Package/avahi-dbus-daemon/conffiles=$(Package/avahi-daemon/conffiles)
+Package/avahi-nodbus-daemon/conffiles=$(Package/avahi-daemon/conffiles)
+
+define Package/avahi-daemon-service-http
+  $(call Package/avahi/Default)
+  SUBMENU:=IP Addresses and Names
+  DEPENDS:=+avahi-daemon
+  TITLE:=Announce HTTP service
+endef
+
+define Package/avahi-daemon-service-http/description
+$(call Package/avahi/Default/description)
+ .
+ This package contains the service definition for announcing HTTP service.
+endef
+
+define Package/avahi-daemon-service-http/conffiles
+/etc/avahi/services/http.service
+endef
+
+define Package/avahi-daemon-service-ssh
+  $(call Package/avahi/Default)
+  SUBMENU:=IP Addresses and Names
+  DEPENDS:=+avahi-daemon
+  TITLE:=Announce SSH service
+endef
+
+define Package/avahi-daemon-service-ssh/description
+$(call Package/avahi/Default/description)
+ .
+ This package contains the service definition for announcing SSH service.
+endef
+
+define Package/avahi-daemon-service-ssh/conffiles
+/etc/avahi/services/ssh.service
+endef
+
+define Package/avahi-dnsconfd
+  $(call Package/avahi/Default)
+  SUBMENU:=IP Addresses and Names
+  DEPENDS:=+libavahi +libdaemon +libpthread
+  TITLE:=A Unicast DNS server using avahi-daemon
+endef
+
+define Package/avahi-dnsconfd/description
+$(call Package/avahi/Default/description)
+ .
+ This package contains a Unicast DNS server from mDNS/DNS-SD configuration
+ daemon, which may be used to configure conventional DNS servers using mDNS
+ in a DHCP-like fashion. Especially useful on IPv6.
+endef
+
+define Package/libavahi-dbus-support
+  $(call Package/libavahi/Default)
+  VARIANT:=dbus
+  DEPENDS:=+dbus
+  TITLE+= (D-Bus support)
+endef
+
+define Package/libavahi-nodbus-support
+  $(call Package/libavahi/Default)
+  VARIANT:=nodbus
+  TITLE+= (No D-Bus)
+endef
+
+define Package/libavahi-dbus-support/description
+$(call Package/libavahi/description)
+ .
+ The libavahi-dbus-support package enables
+ D-Bus support in avahi, needed to support
+ the libavahi-client library and avahi-utils.
+ .
+ Selecting this package modifies the build configuration
+ so that avahi packages are built with support for D-BUS enabled;
+ it does not generate a separate binary of its own.
+ It also automatically adds the D-Bus package to the build.
+ libavahi-dbus-support is selected automatically if you select
+ libavahi-client or avahi-utils.
+endef
+
+define Package/libavahi-nodbus-support/description
+$(call Package/libavahi/description)
+ .
+ Selecting this package modifies the build configuration
+ so that avahi packages are built without support for D-BUS enabled;
+ it does not generate a separate binary of its own.
+endef
+
+define Package/libavahi-client
+  $(call Package/avahi/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  VARIANT:=dbus
+  DEPENDS:=+avahi-dbus-daemon
+  TITLE+= (libavahi-client library)
+endef
+
+define Package/libavahi-client/description
+$(call Package/avahi/Default/description)
+ .
+ This packages adds the libavahi-client library.
+ It also automatically adds the required
+ libavahi-dbus-support and the avahi-dbus-daemon packages.
+ For more information please see the avahi documentation.
+endef
+
+define Package/libavahi-compat-libdnssd
+  $(call Package/avahi/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  VARIANT:=dbus
+  DEPENDS:=+libavahi-client
+  TITLE+= (libdnssd)
+endef
+
+define Package/libavahi-compat-libdnssd/description
+$(call Package/avahi/Default/description)
+ .
+ This packages adds the libavahi-compat-libdnssd library.
+ It also automatically adds the required libavahi-client package.
+ For more information please see the avahi documentation.
+endef
+
+define Package/avahi-utils
+  $(call Package/avahi/Default)
+  SUBMENU:=IP Addresses and Names
+  VARIANT:=dbus
+  DEPENDS:=libavahi-client +libgdbm
+  TITLE+= (utilities)
+endef
+
+define Package/avahi-utils/description
+$(call Package/avahi/Default/description)
+ .
+ This packages installs the following avahi utility programs:
+ avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name.
+ It also automatically adds the required libavahi-client package.
+ For more information please see the avahi documentation.
+endef
+
+TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE
+
+CONFIGURE_ARGS+= \
+       --enable-shared \
+       --enable-static \
+       --disable-glib \
+       --disable-gobject \
+       --disable-qt3 \
+       --disable-qt4 \
+       --disable-gtk \
+       --disable-gtk3 \
+       --with-xml=expat \
+       --disable-dbm \
+       --enable-gdbm \
+       --enable-libdaemon \
+       $(and $(CONFIG_PACKAGE_libavahi-compat-libdnssd),ifeq ($(BUILD_VARIANT),dbus),\
+               --enable-compat-libdns_sd) \
+       --disable-python \
+       --disable-pygtk \
+       --disable-python-dbus \
+       --disable-mono \
+       --disable-monodoc \
+       --disable-doxygen-doc \
+       --disable-doxygen-dot \
+       --disable-doxygen-man \
+       --disable-doxygen-rtf \
+       --disable-doxygen-xml \
+       --disable-doxygen-chm \
+       --disable-doxygen-chi \
+       --disable-doxygen-html \
+       --disable-doxygen-ps \
+       --disable-doxygen-pdf \
+       --disable-xmltoman \
+       --with-distro=none \
+       --with-avahi-user=nobody \
+       --with-avahi-group=nogroup \
+       --with-autoipd-user=nobody \
+       --with-autoipd-group=nogroup
+
+ifneq ($(CONFIG_SSP_SUPPORT),y)
+CONFIGURE_ARGS+= \
+       --disable-stack-protector
+endif
+
+ifeq ($(BUILD_VARIANT),dbus)
+CONFIGURE_ARGS += \
+       --enable-dbus
+else
+CONFIGURE_ARGS += \
+       --disable-dbus
+endif
+
+CONFIGURE_VARS+= \
+       CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \
+       ac_cv_header_sys_capability_h=no \
+
+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/libavahi-* $(1)/usr/lib/
+ifeq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd)-$(BUILD_VARIANT),y-dbus)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd* $(1)/usr/lib/
+endif
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libavahi/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
+endef
+
+define Package/libavahi-dbus-support/install
+       $(call Package/libavahi/install,$(1))
+       $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
+endef
+
+Package/libavahi-nodbus-support/install=$(Package/libavahi/install)
+
+define Package/libavahi-client/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/
+endef
+
+define Package/libavahi-compat-libdnssd/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so.* $(1)/usr/lib/
+endef
+
+define Package/avahi-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+define Package/avahi-autoipd/install
+       $(INSTALL_DIR) $(1)/etc/avahi
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/lib/netifd/proto
+       $(INSTALL_BIN) ./files/netifd-autoip.sh $(1)/lib/netifd/proto/autoip.sh
+endef
+
+define Package/avahi-daemon/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/avahi
+       $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
+       # install empty service directory so that user knows where
+       # to place custom service files
+       $(INSTALL_DIR) $(1)/etc/avahi/services
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
+endef
+
+Package/avahi-dbus-daemon/install=$(Package/avahi-daemon/install)
+Package/avahi-nodbus-daemon/install=$(Package/avahi-daemon/install)
+
+define Package/avahi-daemon-service-http/install
+       $(INSTALL_DIR) $(1)/etc/avahi/services
+       $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
+endef
+
+define Package/avahi-daemon-service-ssh/install
+       $(INSTALL_DIR) $(1)/etc/avahi/services
+       $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
+endef
+
+define Package/avahi-dnsconfd/install
+       $(INSTALL_DIR) $(1)/etc/avahi
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,libavahi-client))
+$(eval $(call BuildPackage,libavahi-compat-libdnssd))
+$(eval $(call BuildPackage,avahi-utils))
+$(eval $(call BuildPackage,libavahi-dbus-support))
+$(eval $(call BuildPackage,libavahi-nodbus-support))
+$(eval $(call BuildPackage,avahi-autoipd))
+$(eval $(call BuildPackage,avahi-dbus-daemon))
+$(eval $(call BuildPackage,avahi-nodbus-daemon))
+$(eval $(call BuildPackage,avahi-daemon-service-http))
+$(eval $(call BuildPackage,avahi-daemon-service-ssh))
+$(eval $(call BuildPackage,avahi-dnsconfd))
diff --git a/libs/avahi/files/avahi-daemon.conf b/libs/avahi/files/avahi-daemon.conf
new file mode 100644 (file)
index 0000000..3ef0788
--- /dev/null
@@ -0,0 +1,28 @@
+[server]
+#host-name=foo
+#domain-name=local
+use-ipv4=yes
+use-ipv6=yes
+check-response-ttl=no
+use-iff-running=no
+
+[publish]
+publish-addresses=yes
+publish-hinfo=yes
+publish-workstation=no
+publish-domain=yes
+#publish-dns-servers=192.168.1.1
+#publish-resolv-conf-dns-servers=yes
+
+[reflector]
+enable-reflector=no
+reflect-ipv=no
+
+[rlimits]
+#rlimit-as=
+rlimit-core=0
+rlimit-data=4194304
+rlimit-fsize=0
+rlimit-nofile=30
+rlimit-stack=4194304
+rlimit-nproc=3
diff --git a/libs/avahi/files/avahi-daemon.init b/libs/avahi/files/avahi-daemon.init
new file mode 100644 (file)
index 0000000..b2ae458
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+START=61
+
+BIN=avahi-daemon
+DEFAULT=/etc/default/$BIN
+OPTIONS="-D"
+RUN_D=/var/run/$BIN
+
+start() {
+       [ -f $DEFAULT ] && . $DEFAULT
+       mkdir -p $RUN_D
+       $BIN $OPTIONS
+}
+
+stop() {
+  $BIN -k
+}
+
+reload() {
+  $BIN -r
+}
+
diff --git a/libs/avahi/files/netifd-autoip.sh b/libs/avahi/files/netifd-autoip.sh
new file mode 100755 (executable)
index 0000000..65f1a8b
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. ../netifd-proto.sh
+init_proto "$@"
+
+proto_autoip_setup() {
+       local config="$1"
+       local iface="$2"
+
+       proto_export "INTERFACE=$config"
+       proto_run_command "$config" avahi-autoipd $iface
+}
+
+proto_autoip_teardown() {
+       local interface="$1"
+       proto_kill_command "$interface"
+}
+
+add_protocol autoip
diff --git a/libs/avahi/files/service-http b/libs/avahi/files/service-http
new file mode 100644 (file)
index 0000000..3262037
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
+<service-group>
+ <name replace-wildcards="yes">%h</name>
+  <service>
+   <type>_http._tcp</type>
+   <port>80</port>
+   <txt-record>path=/</txt-record>
+  </service>
+</service-group>
diff --git a/libs/avahi/files/service-ssh b/libs/avahi/files/service-ssh
new file mode 100644 (file)
index 0000000..b445851
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
+<service-group>
+ <name replace-wildcards="yes">%h</name>
+  <service>
+   <type>_ssh._tcp</type>
+   <port>22</port>
+  </service>
+</service-group>
diff --git a/libs/avahi/patches/010-step_back_autotools-no-gettext.patch b/libs/avahi/patches/010-step_back_autotools-no-gettext.patch
new file mode 100644 (file)
index 0000000..fab87aa
--- /dev/null
@@ -0,0 +1,80 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -75,8 +75,7 @@ SUBDIRS = \
+       avahi-compat-howl \
+       avahi-autoipd \
+       avahi-ui \
+-      avahi-ui-sharp \
+-      po
++      avahi-ui-sharp
+ DX_INPUT = \
+       $(srcdir)/avahi-common/address.h \
+--- a/avahi-python/avahi-discover/Makefile.am
++++ b/avahi-python/avahi-discover/Makefile.am
+@@ -38,7 +38,6 @@ if HAVE_GDBM
+ pythonscripts += \
+       avahi-discover
+ desktop_DATA += avahi-discover.desktop
+-@INTLTOOL_DESKTOP_RULE@
+ avahi_discover_PYTHON += __init__.py
+ endif
+@@ -46,7 +45,6 @@ if HAVE_DBM
+ pythonscripts += \
+       avahi-discover
+ desktop_DATA += avahi-discover.desktop
+-@INTLTOOL_DESKTOP_RULE@
+ avahi_discover_PYTHON += __init__.py
+ endif
+--- a/avahi-ui/Makefile.am
++++ b/avahi-ui/Makefile.am
+@@ -78,7 +78,6 @@ endif
+ bin_PROGRAMS = bssh
+ desktop_DATA += bssh.desktop bvnc.desktop
+-@INTLTOOL_DESKTOP_RULE@
+ bssh_SOURCES = bssh.c
+@@ -106,6 +105,4 @@ endif # HAVE_GLIB
+ endif
+ endif
+-@INTLTOOL_DESKTOP_RULE@
+-
+ CLEANFILES = $(desktop_DATA) $(desktop_DATA_in)
+--- a/configure.ac
++++ b/configure.ac
+@@ -23,7 +23,7 @@ AC_INIT([avahi],[0.6.29],[avahi (at) lis
+ AC_CONFIG_SRCDIR([avahi-core/server.c])
+ AC_CONFIG_MACRO_DIR([common])
+ AC_CONFIG_HEADERS([config.h])
+-AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
++AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability tar-pax])
+ AC_SUBST(PACKAGE_URL, [http://avahi.org/])
+@@ -43,8 +43,6 @@ AC_SUBST(HOWL_COMPAT_VERSION, [0.9.8])
+ AC_CANONICAL_HOST
+-AM_SILENT_RULES([yes])
+-
+ AC_CHECK_PROG([STOW], [stow], [yes], [no])
+ AS_IF([test "x$STOW" = "xyes" && test -d /usr/local/stow], [
+@@ -412,12 +410,6 @@ if test "x$have_kqueue" = "xyes" ; then
+     AC_DEFINE([HAVE_KQUEUE], 1, [Enable BSD kqueue() usage])
+ fi
+-IT_PROG_INTLTOOL([0.35.0])
+-GETTEXT_PACKAGE=avahi
+-AC_SUBST([GETTEXT_PACKAGE])
+-AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
+-AM_GLIB_GNU_GETTEXT
+-
+ avahilocaledir='${prefix}/${DATADIRNAME}/locale'
+ AC_SUBST(avahilocaledir)
diff --git a/libs/avahi/patches/011-fix-poll-h-warnings-on-musl.patch b/libs/avahi/patches/011-fix-poll-h-warnings-on-musl.patch
new file mode 100644 (file)
index 0000000..a331e64
--- /dev/null
@@ -0,0 +1,65 @@
+diff --git a/avahi-common/simple-watch.c b/avahi-common/simple-watch.c
+index 8df18dd..08d8090 100644
+--- a/avahi-common/simple-watch.c
++++ b/avahi-common/simple-watch.c
+@@ -21,7 +21,7 @@
+ #include <config.h>
+ #endif
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <assert.h>
+ #include <string.h>
+ #include <errno.h>
+diff --git a/avahi-common/simple-watch.h b/avahi-common/simple-watch.h
+index 72c1905..db87122 100644
+--- a/avahi-common/simple-watch.h
++++ b/avahi-common/simple-watch.h
+@@ -22,7 +22,7 @@
+ /** \file simple-watch.h Simple poll() based main loop implementation */
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <avahi-common/cdecl.h>
+ #include <avahi-common/watch.h>
+diff --git a/avahi-common/thread-watch.c b/avahi-common/thread-watch.c
+index c0cadeb..ecb202b 100644
+--- a/avahi-common/thread-watch.c
++++ b/avahi-common/thread-watch.c
+@@ -21,7 +21,7 @@
+ #include <config.h>
+ #endif
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <assert.h>
+ #include <string.h>
+ #include <errno.h>
+diff --git a/avahi-common/thread-watch.h b/avahi-common/thread-watch.h
+index dec0cf3..1b44ccb 100644
+--- a/avahi-common/thread-watch.h
++++ b/avahi-common/thread-watch.h
+@@ -22,7 +22,7 @@
+ /** \file thread-watch.h Threaded poll() based main loop implementation */
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <avahi-common/cdecl.h>
+ #include <avahi-common/watch.h>
+diff --git a/avahi-common/watch.h b/avahi-common/watch.h
+index 86e63d3..eea12ec 100644
+--- a/avahi-common/watch.h
++++ b/avahi-common/watch.h
+@@ -22,7 +22,7 @@
+ /** \file watch.h Simplistic main loop abstraction */
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/time.h>
+ #include <avahi-common/cdecl.h>
diff --git a/libs/avro/Makefile b/libs/avro/Makefile
new file mode 100644 (file)
index 0000000..2a3ed5e
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# avro - Makefile for Apache Avro library
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=avro-c
+PKG_VERSION:=1.8.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@APACHE/avro/avro-$(PKG_VERSION)/c
+PKG_MD5SUM:=b268348536714541e10411823a1b59b0
+
+PKG_MAINTAINER:=John Clark <inindev@gmail.com>
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/avro-c
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+jansson +zlib +liblzma
+  TITLE:=Apache Avro C Library
+  URL:=https://avro.apache.org
+endef
+
+define Package/avro-c/description
+  This package contains the Apache Avro C library.
+endef
+
+CMAKE_OPTIONS += \
+        -DCMAKE_BUILD_TYPE:STRING=MINSIZEREL
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/{lib,include}
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavro.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/avro-c/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavro.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,avro-c))
+
diff --git a/libs/boost/Makefile b/libs/boost/Makefile
new file mode 100644 (file)
index 0000000..45e9c62
--- /dev/null
@@ -0,0 +1,461 @@
+#
+# Copyright (C) 2015-2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# 
+# Original Boost 1.51 Makefile by Mirko Vogt <mirko@openwrt.org>
+# Dude, this "boost" is really one of the most crude stuff I ported yet.
+#
+
+
+include $(TOPDIR)/rules.mk
+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_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_LICENSE:=Boost Software License <http://www.boost.org/users/license.html>
+PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com>
+
+PKG_BUILD_PARALLEL:=0
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+
+define Package/boost/Default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Boost C++ source library
+  URL:=http://www.boost.org
+  DEPENDS:=+libstdcpp +libpthread +librt
+endef
+
+define Package/boost/description
+This package provides the Boost v1.63 libraries.
+Boost is a set of free, peer-reviewed, portable C++ source libraries.
+
+-----------------------------------------------------------------------------
+|                                Warning                                    |
+| In order to build all of the Boost Libraries, it is necessary             |
+| to use, at least, GCC version 5 (C++14 support) and, it is necessary to   |
+| compile the kernel with Full Language Support.                            |
+| Without these requirerements, the following libs will not be available:   |
+| - Boost.Locale                                                            |
+| - Boost.Coroutine2                                                        |
+| - Boost.Fiber                                                             |
+-----------------------------------------------------------------------------
+
+This package provides the following run-time libraries:
+ - atomic
+ - chrono
+ - container
+ - context
+ - coroutine (Deprecated - use Coroutine2)
+ - - coroutine2 (Requires GCC v5 and up)
+ - date_time
+ - exception
+ - filesystem
+ - fiber (Requires GCC v5 and up)
+ - graph
+ - - graph-parallel
+ - iostreams
+ - locale (Requires kernel being compiled with full language support)
+ - log
+ - math
+ - program_options
+ - python
+ - python3
+ - random
+ - regex
+ - serialization
+ - signals
+ - system
+ - thread
+ - timer
+ - wave
+
+There are many more header-only libraries supported by Boost.
+See more at http://www.boost.org/doc/libs/1_63_0/
+endef
+
+PKG_BUILD_DEPENDS:=boost/host PACKAGE_python:python PACKAGE_python3:python3
+
+BOOST_LIBS =
+
+define Package/boost-libs
+$(call Package/boost/Default)
+  TITLE+= (all libs)
+  DEPENDS+= $(BOOST_DEPENDS)
+  HIDDEN:=1
+endef
+
+define Package/boost-libs/description
+ This meta package contains only dependencies to the other libraries from
+ the boost libraries collection.
+endef
+
+# Create a meta-package of dependent libraries (for ALL)
+define Package/boost-libs/install
+  true
+endef
+
+define Package/boost/install
+  true
+endef
+
+define Package/boost
+  $(call Package/boost/Default)
+  TITLE+= packages
+endef
+
+define Package/boost/config
+       menu "Select Boost Options"
+               depends on PACKAGE_boost
+               comment "Boost compilation options."
+
+               choice
+                       prompt "Compile Boost libraries."
+                               default boost-static-and-shared-libs
+                               help
+                                       Choose which version to compile.
+                                       -> Shared:
+                                               - Only Shared libs will be compiled.
+                                       -> Static:
+                                               - Only Static libs will be compiled.
+                                       -> Both:
+                                               - Both Static and Shared libs will be compiled.
+
+                       config boost-shared-libs
+                               bool "Shared"
+                       
+                       config boost-static-libs
+                               bool "Static"
+                       
+                       config boost-static-and-shared-libs
+                               bool "Both"
+               endchoice
+
+               choice
+                       prompt "Selects Boost Runtime linkage."
+                       default boost-runtime-shared
+                       help
+                               Choose which C and C++ runtimes to use:
+                               -> Use Shared runtimes.
+                               -> Use Static runtimes.
+                                       - Not available if Shared libs are to be built.
+                               -> Use both runtimes.
+                                       - Not available if Shared libs are to be built.
+                                       - Two separate versions of Boost are built, linking each to a different runtime. 
+                                       - This option requires "Use tagged names" option to be active.
+
+                       config boost-runtime-shared
+                               bool "Shared"
+
+                       config boost-runtime-static
+                               depends on @(!boost-shared-libs&&!boost-static-and-shared-libs)
+                               bool "Static"                   
+
+                       config boost-runtime-static-and-shared
+                               depends on @(boost-use-name-tags&&!boost-shared-libs&&!boost-static-and-shared-libs)
+                               bool "Both"
+               endchoice
+
+               choice
+                       prompt "Select a Variant."
+                       default boost-variant-release
+                       help
+                               Chooses which boost variant should be selected:
+                               -> Release: Optimizes Boost for release.
+                                       - Optimization: Speed;  Debug Symbols: Off; Inlining: Full; Runtime Debugging: Off.
+                               -> Debug: 
+                                       - Optimization: Off; Debug Symbols: On; Inlining: Off; Runtime Debugging: On.
+                               -> Profile:
+                                       - Profiling: On;  Debug Symbols: On.
+
+                       config boost-variant-release
+                               bool "Release"
+
+                       config boost-variant-debug
+                               bool "Debug"
+
+                       config boost-variant-profile
+                               bool "Profile"
+               endchoice
+
+               config boost-use-name-tags
+                       bool "Use tagged names."
+                       help 
+                               Add name tags the lib files, to diferentiate each library version:
+                                 "-mt" for multi-threading.
+                                 "-d" for debugging.
+                                 "-s" for runtime static link".
+                               Might break compatibility with libraries that expect boost libs with default names.
+                       default n
+
+               config boost-single-thread
+                       depends on @boost-use-name-tags
+                       bool "Single thread Support."
+                       help 
+                               Compile Boost libraries in single-thread mode.
+                       default n
+                           
+               config boost-build-type-complete
+                       depends on @boost-use-name-tags
+                       bool "Complete Boost Build."
+                       help 
+                               Builds both release and debug libs. It will take much longer to compile.
+                       default n
+       endmenu
+
+       menu "Select Boost libraries"
+               depends on PACKAGE_boost
+               comment "Libraries"
+
+               config boost-libs-all
+                       bool "Include all Boost libraries."
+                       default m if ALL
+                       select PACKAGE_boost-libs
+                       select boost-test-pkg
+                       select boost-coroutine2
+                       select boost-graph-parallel
+
+               config boost-test-pkg
+                       bool "Boost test package."
+                       default m if ALL
+                       select PACKAGE_boost-test
+
+               config boost-coroutine2
+                       depends on !@GCC_VERSION_4_8
+                       bool "Boost couroutine2 support."
+                       select PACKAGE_boost-coroutine
+                       default n
+
+               config boost-graph-parallel
+                       bool "Boost parallel graph support."
+                       select PACKAGE_boost-graph
+                       default n
+
+               $(foreach lib,$(BOOST_LIBS), \
+                       config PACKAGE_boost-$(lib)
+                       prompt "Boost $(lib) library."
+                       default m if ALL
+                       $(if $(findstring locale,$(lib)),depends on BUILD_NLS,)\
+                       $(if $(findstring python,$(lib)),depends on PACKAGE_$(lib),)
+
+               )
+       endmenu
+
+endef
+
+PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
+
+define Package/boost-test
+       $(call Package/boost/Default)
+       TITLE+= (test)
+       HIDDEN:=1
+       DEPENDS+=+boost-system +boost-timer
+endef
+
+define Build/Configure
+endef
+
+# 1: short name
+# 2: dependencies on other boost libraries (short name)
+# 3: dependencies on other packages
+# 4: conditional/inward dependencies
+define DefineBoostLibrary
+
+  BOOST_DEPENDS+= +$(if $(4),$(4):boost-$(1),boost-$(1))
+  PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
+
+  BOOST_LIBS+= $(1)
+
+  define Package/boost-$(1)
+    $(call Package/boost/Default)
+    TITLE+= ($(1))
+    DEPENDS+= $$(foreach lib,$(2),+boost-$$(lib)) $(3) $(if $(4),@$(4),)
+    HIDDEN:=1
+  endef
+
+  define Package/boost-$(1)/description
+   This package contains the Boost $(1) library.
+  endef
+endef
+
+$(eval $(call DefineBoostLibrary,atomic,system,))
+$(eval $(call DefineBoostLibrary,chrono,system,))
+$(eval $(call DefineBoostLibrary,container,,))
+$(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,filesystem,system,))
+$(eval $(call DefineBoostLibrary,graph,regex,))
+$(eval $(call DefineBoostLibrary,iostreams,,+zlib))
+$(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS),BUILD_NLS))
+$(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
+$(eval $(call DefineBoostLibrary,math,,))
+#$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
+$(eval $(call DefineBoostLibrary,program_options,,))
+$(eval $(call DefineBoostLibrary,python,,,PACKAGE_python))
+$(eval $(call DefineBoostLibrary,python3,,,PACKAGE_python3))
+$(eval $(call DefineBoostLibrary,random,system,))
+$(eval $(call DefineBoostLibrary,regex,,))
+$(eval $(call DefineBoostLibrary,serialization,,))
+$(eval $(call DefineBoostLibrary,signals,,))
+$(eval $(call DefineBoostLibrary,system,,))
+$(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
+$(eval $(call DefineBoostLibrary,timer,chrono))
+$(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
+
+
+define Host/Compile
+       # b2 does not provide a configure-script nor a Makefile
+       ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
+endef
+
+CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
+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_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
+
+EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_VERSION_4_8),-std=gnu++11,-std=gnu++14)
+
+ifneq ($(findstring mips,$(ARCH)),)
+    BOOST_ABI = o32
+    ifneq ($(findstring 64,$(ARCH)),)
+        BOOST_ABI = o64
+    endif
+else ifneq ($(findstring arm,$(ARCH)),)
+    BOOST_ABI = aapcs
+else ifeq ($(ARCH),aarch64)
+    BOOST_ABI = aapcs
+else
+    BOOST_ABI = sysv
+endif
+
+comma := ,
+
+define Build/Compile
+       $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE))
+       ( 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/ ;" >> \
+                               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/ ;" >> \
+                               tools/build/src/user-config.jam; \
+               ) \
+               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 \
+                       --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-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 \
+       )
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) \
+               $(1)/usr/include/boost/
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/include/boost/* \
+               $(1)/usr/include/boost/ \
+               # copies _all_ header files - independent of <--with-library>-argument above
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) -v $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/ # copies all compiled archive files
+       $(FIND) $(PKG_INSTALL_DIR)/lib/ -name '*.so*' -exec $(CP) {} $(1)/usr/lib/ \; # copies all the shared objects files
+endef
+
+define Host/Install
+       $(INSTALL_DIR) \
+               $(STAGING_DIR_HOSTPKG)/bin
+
+       $(CP) \
+               $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/b2 \
+               $(STAGING_DIR_HOSTPKG)/bin/
+endef
+
+define Package/boost/Default/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib
+
+       $(FIND) \
+               $(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2).so*' -exec $(CP) {} $(1)/usr/lib/ \;
+       $(FIND) \
+               $(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2)_*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
+endef
+
+define Package/boost-test/install
+               $(INSTALL_DIR) \
+                       $(1)/usr/lib
+
+               $(FIND) \
+                       $(PKG_INSTALL_DIR)/lib/ -name 'libboost_unit_test_framework*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
+               
+               $(FIND) \
+                       $(PKG_INSTALL_DIR)/lib/ -name 'libboost_prg_exec_monitor*.so*' -exec $(CP) {} $(1)/usr/lib/ \;  
+endef
+
+define BuildBoostLibrary
+  define Package/boost-$(1)/install
+    $(call Package/boost/Default/install,$$(1),$(1))
+  endef
+
+  $$(eval $$(call BuildPackage,boost-$(1)))
+endef
+
+$(eval $(call HostBuild))
+
+$(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib))))
+$(eval $(call BuildPackage,boost-test))
+$(eval $(call BuildPackage,boost-libs))
+$(eval $(call BuildPackage,boost))
diff --git a/libs/boost/patches/01_fiber_fix.patch b/libs/boost/patches/01_fiber_fix.patch
new file mode 100644 (file)
index 0000000..8989e0b
--- /dev/null
@@ -0,0 +1,26 @@
+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 ;
diff --git a/libs/c-ares/Makefile b/libs/c-ares/Makefile
new file mode 100644 (file)
index 0000000..ec822f5
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2009-2010 OpenWrt.org
+# Copyright (C) 2009 Jakob Pfeiffer
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=c-ares
+PKG_VERSION:=1.11.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_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_CPPFLAGS += $(filter -D%,$(TARGET_CFLAGS))
+TARGET_CFLAGS := $(filter-out -D%,$(TARGET_CFLAGS))
+
+define Package/libcares
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Library for asyncronous DNS Requests (including name resolves)
+  URL:=http://c-ares.haxx.se/
+  MAINTAINER:=Karl Palsson <karlp@remake.is>
+endef
+
+define Package/libcares/description
+  c-ares is a C library for asynchronous DNS requests (including name resolves)
+
+C89 compatibility, MIT licensed, builds for and runs on POSIX, Windows,
+Netware, Android and many more operating systems.
+
+endef
+
+define Package/libcares/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)
+       $(CP) $(PKG_INSTALL_DIR)/* $(1)/
+endef
+
+$(eval $(call BuildPackage,libcares))
diff --git a/libs/check/Makefile b/libs/check/Makefile
new file mode 100644 (file)
index 0000000..eb735ee
--- /dev/null
@@ -0,0 +1,61 @@
+#
+# 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:=check
+PKG_VERSION:=0.9.14
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/check
+PKG_MD5SUM:=38263d115d784c17aa3b959ce94be8b8
+
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING.LESSER
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/check
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Unit testing framework for C
+  URL:=http://check.sourceforge.net/
+  DEPENDS:= +libpthread +librt
+endef
+
+define Package/check/description
+  Check features a simple interface for defining unit tests, putting little in
+  the way of the developer. Tests are run in a separate address space, so Check
+  can catch both assertion failures and code errors that cause segmentation
+  faults or other signals. The output from unit tests can be used within source
+  code editors and IDEs.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+CONFIGURE_VARS += \
+       hw_cv_func_snprintf_c99=yes \
+       hw_cv_func_vsnprintf_c99=yes \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/check*.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcheck.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/check.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/check/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcheck.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,check))
diff --git a/libs/classpath/Makefile b/libs/classpath/Makefile
new file mode 100644 (file)
index 0000000..273678e
--- /dev/null
@@ -0,0 +1,90 @@
+#
+# 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:=classpath
+PKG_VERSION:=0.99
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0
+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_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/classpath
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=GNU Classpath
+  URL:=http://www.gnu.org/software/classpath/
+  DEPENDS:=+alsa-lib +libgmp +libmagic
+endef
+
+define Package/classpath/Description
+       GNU Classpath, Essential Libraries for Java, is a GNU project
+       to create free core class libraries for use with virtual
+       machines and compilers for the java programming language.
+endef
+
+define Package/classpath-tools
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=GNU Classpath tools
+  URL:=http://www.gnu.org/software/classpath/
+endef
+
+define Download/antlr
+  URL:=http://www.antlr.org/download
+  FILE:=antlr-3.4-complete.jar
+  MD5SUM:=1b91dea1c7d480b3223f7c8a9aa0e172
+endef
+$(eval $(call Download,antlr))
+
+CONFIGURE_ARGS += \
+       --with-gmp="$(STAGING_DIR)/usr" \
+       --without-x \
+       --disable-gtk-peer \
+       --disable-qt-peer \
+       --disable-dssi \
+       --disable-plugin \
+       --disable-gconf-peer \
+       --disable-gjdoc \
+       --disable-examples \
+       --with-antlr-jar=$(DL_DIR)/antlr-3.4-complete.jar
+
+define Package/classpath/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib/classpath \
+               $(1)/usr/share/classpath
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/security \
+               $(PKG_INSTALL_DIR)/usr/lib/logging.properties \
+               $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/classpath/*.so* $(1)/usr/lib/classpath/
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/classpath/glibj.zip $(1)/usr/share/classpath/
+endef
+
+define Package/classpath-tools/install
+       $(INSTALL_DIR) \
+               $(1)/usr/bin \
+               $(1)/usr/share/classpath
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/classpath/tools.zip $(1)/usr/share/classpath/
+endef
+
+define Build/InstallDev
+       $(CP) $(PKG_INSTALL_DIR)/* $(1)/
+endef
+
+$(eval $(call BuildPackage,classpath))
+$(eval $(call BuildPackage,classpath-tools))
diff --git a/libs/classpath/patches/010-double-memleak.patch b/libs/classpath/patches/010-double-memleak.patch
new file mode 100644 (file)
index 0000000..02ec5ad
--- /dev/null
@@ -0,0 +1,91 @@
+--- classpath-0.99.orig/native/fdlibm/dtoa.c   2007-09-27 05:33:38.000000000 -0700
++++ classpath-0.99/native/fdlibm/dtoa.c        2014-12-21 14:22:42.451713851 -0800
+@@ -883,6 +883,16 @@ ret1:
+   return s0;
+ }
++void free_Bigints(struct _Jv_Bigint *p)
++{
++    struct _Jv_Bigint *l = p;
++    while (l)
++      {
++        struct _Jv_Bigint *next = l->_next;
++        free (l);
++        l = next;
++      }
++}
+ _VOID
+ _DEFUN (_dtoa,
+@@ -905,16 +915,15 @@ _DEFUN (_dtoa,
+   p = _dtoa_r (&reent, _d, mode, ndigits, decpt, sign, rve, float_type);
+   strcpy (buf, p);
+-  for (i = 0; i < reent._result_k; ++i)
++  for (i = 0; i < reent._max_k; ++i)
+     {
+-      struct _Jv_Bigint *l = reent._freelist[i];
+-      while (l)
+-      {
+-        struct _Jv_Bigint *next = l->_next;
+-        free (l);
+-        l = next;
+-      }
++        free_Bigints(reent._freelist[i]);
+     }
+   if (reent._freelist)
+     free (reent._freelist);
++
++  if (reent._result)
++    free(reent._result);
++
++  free_Bigints(reent._p5s);
+ }
+--- classpath-0.99.orig/native/jni/java-lang/java_lang_VMDouble.c      2008-02-08 09:42:57.000000000 -0800
++++ classpath-0.99/native/jni/java-lang/java_lang_VMDouble.c   2014-12-21 14:35:50.733800626 -0800
+@@ -158,6 +158,17 @@ Java_java_lang_VMDouble_longBitsToDouble
+   return val.d;
+ }
++static void free_Bigints(struct _Jv_Bigint *p)
++{
++     struct _Jv_Bigint *l = p;
++     while (l)
++     {
++         struct _Jv_Bigint *next = l->_next;
++         free (l);
++         l = next;
++     }
++}
++ 
+ /**
+  * Parse a double from a char array.
+  */
+@@ -167,7 +178,7 @@ parseDoubleFromChars(JNIEnv * env, const
+   char *endptr;
+   jdouble val = 0.0;
+   const char *p = buf, *end, *last_non_ws, *temp;
+-  int ok = 1;
++  int i, ok = 1;
+ #ifdef DEBUG
+   fprintf (stderr, "java.lang.VMDouble.parseDouble (%s)\n", buf);
+@@ -224,6 +235,18 @@ parseDoubleFromChars(JNIEnv * env, const
+       val = _strtod_r (&reent, p, &endptr);
++      for (i = 0; i < reent._max_k; ++i)
++      {
++          free_Bigints(reent._freelist[i]);
++      }
++      if (reent._freelist)
++          free (reent._freelist);
++
++      if (reent._result)
++          free (reent._result);
++
++      free_Bigints(reent._p5s);
++
+ #ifdef DEBUG
+       fprintf (stderr, "java.lang.VMDouble.parseDouble val = %g\n", val);
+       fprintf (stderr, "java.lang.VMDouble.parseDouble %p != %p ???\n",
diff --git a/libs/confuse/Makefile b/libs/confuse/Makefile
new file mode 100644 (file)
index 0000000..b33bdf6
--- /dev/null
@@ -0,0 +1,79 @@
+#
+# 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:=confuse
+PKG_VERSION:=2.7
+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_LICENSE:=ISC
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/confuse
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=libConfuse is a configuration file parser library
+  URL:=http://www.nongnu.org/confuse/
+endef
+
+define Package/confuse/description
+       libConfuse is a configuration file parser library, licensed under the
+       terms of the ISC license, and written in C. It supports sections and
+       (lists of) values (strings, integers, floats, booleans or other
+       sections), as well as some other features (such as single/double-quoted
+       strings, environment variable expansion, functions and nested include
+       statements). It makes it very easy to add configuration file capability
+       to a program using a simple API.
+
+       The goal of libConfuse is not to be the configuration file parser
+       library with a gazillion of features. Instead, it aims to be easy to use
+       and quick to integrate with your code. libConfuse was called libcfg
+       before, but was changed to not confuse with other similar libraries.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --disable-rpath \
+       --without-libiconv-prefix \
+       --without-libintl-prefix \
+
+MAKE_FLAGS += \
+       -C $(PKG_BUILD_DIR)/src \
+       DESTDIR="$(PKG_INSTALL_DIR)" \
+       all install \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/confuse.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libconfuse.{a,so*} $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/*.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Build/UninstallDev
+       rm -rf \
+       $(STAGING_DIR)/usr/include/confuse.h \
+       $(STAGING_DIR)/usr/lib/libconfuse.{a,so*}
+endef
+
+define Package/confuse/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libconfuse.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,confuse))
diff --git a/libs/db47/Makefile b/libs/db47/Makefile
new file mode 100644 (file)
index 0000000..bf0f0b7
--- /dev/null
@@ -0,0 +1,100 @@
+#
+# 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
+include $(INCLUDE_DIR)/uclibc++.mk
+
+BASE_VERSION:=4.7.25
+
+PKG_NAME:=db47
+PKG_VERSION:=$(BASE_VERSION).4.NC
+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_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+PKG_LICENSE:=Sleepycat
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_FIXUP:=autoreconf
+PKG_LIBTOOL_PATHS:=. build_unix
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libdb47
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libxml2
+  TITLE:=Berkeley DB library (4.7)
+  URL:=http://www.oracle.com/us/products/database/berkeley-db
+  PROVIDES:=libdb47-full
+endef
+
+define Package/libdb47/description
+  Berkeley DB library (4.7).
+endef
+
+define Package/libdb47xx
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libdb47 $(CXX_DEPENDS)
+  TITLE:=Berkeley DB library (4.7) for C++
+  URL:=http://www.oracle.com/us/products/database/berkeley-db
+  PROVIDES:=libdb47xx-full
+endef
+
+define Package/libdb47xx/description
+  Berkeley DB library (4.7).  C++ wrapper.
+endef
+
+CONFIGURE_PATH = build_unix
+CONFIGURE_CMD = ../dist/configure
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --disable-java \
+       --with-mutex=POSIX/pthreads/library \
+       --disable-tcl \
+       --disable-rpc \
+       --enable-compat185 \
+       --disable-debug \
+       $(if $(CONFIG_PACKAGE_libdb47xx),--enable-cxx,--disable-cxx)
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/Compile
+       +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/build_unix \
+               DESTDIR="$(PKG_INSTALL_DIR)" all
+       $(MAKE) -C $(PKG_BUILD_DIR)/build_unix \
+               DESTDIR="$(PKG_INSTALL_DIR)" install
+endef
+
+define Package/libdb47/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb-*.so $(1)/usr/lib/
+endef
+
+define Package/libdb47xx/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb_cxx-*.so $(1)/usr/lib/
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/db.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/db_cxx.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb*.{a,so} $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,libdb47))
+$(eval $(call BuildPackage,libdb47xx))
diff --git a/libs/db47/patches/010-patch.4.7.25.1.patch b/libs/db47/patches/010-patch.4.7.25.1.patch
new file mode 100644 (file)
index 0000000..f1fd472
--- /dev/null
@@ -0,0 +1,55 @@
+--- a/sequence/sequence.c
++++ b/sequence/sequence.c
+@@ -187,7 +187,11 @@ __seq_open_pp(seq, txn, keyp, flags)
+       if ((ret = __db_get_flags(dbp, &tflags)) != 0)
+               goto err;
+-      if (DB_IS_READONLY(dbp)) {
++      /*
++       * We can let replication clients open sequences, but must
++       * check later that they do not update them.
++       */
++      if (F_ISSET(dbp, DB_AM_RDONLY)) {
+               ret = __db_rdonly(dbp->env, "DB_SEQUENCE->open");
+               goto err;
+       }
+@@ -244,6 +248,11 @@ retry:    if ((ret = __db_get(dbp, ip,
+               if ((ret != DB_NOTFOUND && ret != DB_KEYEMPTY) ||
+                   !LF_ISSET(DB_CREATE))
+                       goto err;
++              if (IS_REP_CLIENT(env) &&
++                  !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
++                      ret = __db_rdonly(env, "DB_SEQUENCE->open");
++                      goto err;
++              }
+               ret = 0;
+               rp = &seq->seq_record;
+@@ -296,7 +305,12 @@ retry:    if ((ret = __db_get(dbp, ip,
+        */
+       rp = seq->seq_data.data;
+       if (rp->seq_version == DB_SEQUENCE_OLDVER) {
+-oldver:               rp->seq_version = DB_SEQUENCE_VERSION;
++oldver:               if (IS_REP_CLIENT(env) &&
++                  !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
++                      ret = __db_rdonly(env, "DB_SEQUENCE->open");
++                      goto err;
++              }
++              rp->seq_version = DB_SEQUENCE_VERSION;
+               if (!F_ISSET(env, ENV_LITTLEENDIAN)) {
+                       if (IS_DB_AUTO_COMMIT(dbp, txn)) {
+                               if ((ret =
+@@ -707,6 +721,13 @@ __seq_get(seq, txn, delta, retp, flags)
+       MUTEX_LOCK(env, seq->mtx_seq);
++      if (handle_check && IS_REP_CLIENT(env) &&
++          !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
++              ret = __db_rdonly(env, "DB_SEQUENCE->get");
++              goto err;
++      }
++
++
+       if (rp->seq_min + delta > rp->seq_max) {
+               __db_errx(env, "Sequence overflow");
+               ret = EINVAL;
diff --git a/libs/db47/patches/020-patch.4.7.25.2.patch b/libs/db47/patches/020-patch.4.7.25.2.patch
new file mode 100644 (file)
index 0000000..ddf830a
--- /dev/null
@@ -0,0 +1,42 @@
+--- a/lock/lock.c
++++ b/lock/lock.c
+@@ -1274,10 +1274,12 @@ __lock_put_internal(lt, lockp, obj_ndx,
+               SH_TAILQ_REMOVE(
+                   &lt->obj_tab[obj_ndx], sh_obj, links, __db_lockobj);
+               if (sh_obj->lockobj.size > sizeof(sh_obj->objdata)) {
+-                      LOCK_REGION_LOCK(env);
++                      if (region->part_t_size != 1)
++                              LOCK_REGION_LOCK(env);
+                       __env_alloc_free(&lt->reginfo,
+                           SH_DBT_PTR(&sh_obj->lockobj));
+-                      LOCK_REGION_UNLOCK(env);
++                      if (region->part_t_size != 1)
++                              LOCK_REGION_UNLOCK(env);
+               }
+               SH_TAILQ_INSERT_HEAD(
+                   &FREE_OBJS(lt, part_id), sh_obj, links, __db_lockobj);
+@@ -1467,15 +1469,21 @@ retry: SH_TAILQ_FOREACH(sh_obj, &lt->obj
+               if (obj->size <= sizeof(sh_obj->objdata))
+                       p = sh_obj->objdata;
+               else {
+-                      LOCK_REGION_LOCK(env);
++                      /*
++                       * If we have only one partition, the region is locked.
++                       */
++                      if (region->part_t_size != 1)
++                              LOCK_REGION_LOCK(env);
+                       if ((ret =
+                           __env_alloc(&lt->reginfo, obj->size, &p)) != 0) {
+                               __db_errx(env,
+                                   "No space for lock object storage");
+-                              LOCK_REGION_UNLOCK(env);
++                              if (region->part_t_size != 1)
++                                      LOCK_REGION_UNLOCK(env);
+                               goto err;
+                       }
+-                      LOCK_REGION_UNLOCK(env);
++                      if (region->part_t_size != 1)
++                              LOCK_REGION_UNLOCK(env);
+               }
+               memcpy(p, obj->data, obj->size);
diff --git a/libs/db47/patches/030-patch.4.7.25.3.patch b/libs/db47/patches/030-patch.4.7.25.3.patch
new file mode 100644 (file)
index 0000000..12bbedd
--- /dev/null
@@ -0,0 +1,211 @@
+--- a/lock/lock_deadlock.c
++++ b/lock/lock_deadlock.c
+@@ -121,7 +121,7 @@ __lock_detect(env, atype, rejectp)
+       DB_LOCKTAB *lt;
+       db_timespec now;
+       locker_info *idmap;
+-      u_int32_t *bitmap, *copymap, **deadp, **free_me, *tmpmap;
++      u_int32_t *bitmap, *copymap, **deadp, **deadlist, *tmpmap;
+       u_int32_t i, cid, keeper, killid, limit, nalloc, nlockers;
+       u_int32_t lock_max, txn_max;
+       int ret, status;
+@@ -133,7 +133,8 @@ __lock_detect(env, atype, rejectp)
+       if (IS_REP_CLIENT(env))
+               atype = DB_LOCK_MINWRITE;
+-      free_me = NULL;
++      copymap = tmpmap = NULL;
++      deadlist = NULL;
+       lt = env->lk_handle;
+       if (rejectp != NULL)
+@@ -179,11 +180,11 @@ __lock_detect(env, atype, rejectp)
+       memcpy(copymap, bitmap, nlockers * sizeof(u_int32_t) * nalloc);
+       if ((ret = __os_calloc(env, sizeof(u_int32_t), nalloc, &tmpmap)) != 0)
+-              goto err1;
++              goto err;
+       /* Find a deadlock. */
+       if ((ret =
+-          __dd_find(env, bitmap, idmap, nlockers, nalloc, &deadp)) != 0)
++          __dd_find(env, bitmap, idmap, nlockers, nalloc, &deadlist)) != 0)
+               return (ret);
+       /*
+@@ -204,8 +205,7 @@ __lock_detect(env, atype, rejectp)
+               txn_max = TXN_MAXIMUM;
+       killid = BAD_KILLID;
+-      free_me = deadp;
+-      for (; *deadp != NULL; deadp++) {
++      for (deadp = deadlist; *deadp != NULL; deadp++) {
+               if (rejectp != NULL)
+                       ++*rejectp;
+               killid = (u_int32_t)(*deadp - bitmap) / nalloc;
+@@ -342,11 +342,12 @@ dokill:          if (killid == BAD_KILLID) {
+                       __db_msg(env,
+                           "Aborting locker %lx", (u_long)idmap[killid].id);
+       }
+-      __os_free(env, tmpmap);
+-err1: __os_free(env, copymap);
+-
+-err:  if (free_me != NULL)
+-              __os_free(env, free_me);
++err:  if(copymap != NULL)
++              __os_free(env, copymap);
++      if (deadlist != NULL)
++              __os_free(env, deadlist);
++      if(tmpmap != NULL)
++              __os_free(env, tmpmap);
+       __os_free(env, bitmap);
+       __os_free(env, idmap);
+@@ -360,6 +361,17 @@ err:      if (free_me != NULL)
+ #define       DD_INVALID_ID   ((u_int32_t) -1)
++/*
++ * __dd_build --
++ *    Build the lock dependency bit maps.
++ * Notes on synchronization:  
++ *    LOCK_SYSTEM_LOCK is used to hold objects locked when we have
++ *            a single partition.
++ *    LOCK_LOCKERS is held while we are walking the lockers list and
++ *            to single thread the use of lockerp->dd_id.
++ *    LOCK_DD protects the DD list of objects.
++ */
++
+ static int
+ __dd_build(env, atype, bmp, nlockers, allocp, idmap, rejectp)
+       ENV *env;
+@@ -393,6 +405,7 @@ __dd_build(env, atype, bmp, nlockers, al
+        * In particular we do not build the conflict array and our caller
+        * needs to expect this.
+        */
++      LOCK_SYSTEM_LOCK(lt, region);
+       if (atype == DB_LOCK_EXPIRE) {
+ skip:         LOCK_DD(env, region);
+               op = SH_TAILQ_FIRST(&region->dd_objs, __db_lockobj);
+@@ -430,17 +443,18 @@ skip:            LOCK_DD(env, region);
+                       OBJECT_UNLOCK(lt, region, indx);
+               }
+               UNLOCK_DD(env, region);
++              LOCK_SYSTEM_UNLOCK(lt, region);
+               goto done;
+       }
+       /*
+-       * We'll check how many lockers there are, add a few more in for
+-       * good measure and then allocate all the structures.  Then we'll
+-       * verify that we have enough room when we go back in and get the
+-       * mutex the second time.
++       * Allocate after locking the region
++       * to make sure the structures are large enough.
+        */
+-retry:        count = region->stat.st_nlockers;
++      LOCK_LOCKERS(env, region);
++      count = region->stat.st_nlockers;
+       if (count == 0) {
++              UNLOCK_LOCKERS(env, region);
+               *nlockers = 0;
+               return (0);
+       }
+@@ -448,50 +462,37 @@ retry:   count = region->stat.st_nlockers;
+       if (FLD_ISSET(env->dbenv->verbose, DB_VERB_DEADLOCK))
+               __db_msg(env, "%lu lockers", (u_long)count);
+-      count += 20;
+       nentries = (u_int32_t)DB_ALIGN(count, 32) / 32;
+-      /*
+-       * Allocate enough space for a count by count bitmap matrix.
+-       *
+-       * XXX
+-       * We can probably save the malloc's between iterations just
+-       * reallocing if necessary because count grew by too much.
+-       */
++      /* Allocate enough space for a count by count bitmap matrix. */
+       if ((ret = __os_calloc(env, (size_t)count,
+-          sizeof(u_int32_t) * nentries, &bitmap)) != 0)
++          sizeof(u_int32_t) * nentries, &bitmap)) != 0) {
++              UNLOCK_LOCKERS(env, region);
+               return (ret);
++      }
+       if ((ret = __os_calloc(env,
+           sizeof(u_int32_t), nentries, &tmpmap)) != 0) {
++              UNLOCK_LOCKERS(env, region);
+               __os_free(env, bitmap);
+               return (ret);
+       }
+       if ((ret = __os_calloc(env,
+           (size_t)count, sizeof(locker_info), &id_array)) != 0) {
++              UNLOCK_LOCKERS(env, region);
+               __os_free(env, bitmap);
+               __os_free(env, tmpmap);
+               return (ret);
+       }
+       /*
+-       * Now go back in and actually fill in the matrix.
+-       */
+-      if (region->stat.st_nlockers > count) {
+-              __os_free(env, bitmap);
+-              __os_free(env, tmpmap);
+-              __os_free(env, id_array);
+-              goto retry;
+-      }
+-
+-      /*
+        * First we go through and assign each locker a deadlock detector id.
+        */
+       id = 0;
+-      LOCK_LOCKERS(env, region);
+       SH_TAILQ_FOREACH(lip, &region->lockers, ulinks, __db_locker) {
+               if (lip->master_locker == INVALID_ROFF) {
++                      DB_ASSERT(env, id < count);
+                       lip->dd_id = id++;
+                       id_array[lip->dd_id].id = lip->id;
+                       switch (atype) {
+@@ -510,7 +511,6 @@ retry:     count = region->stat.st_nlockers;
+                       lip->dd_id = DD_INVALID_ID;
+       }
+-      UNLOCK_LOCKERS(env, region);
+       /*
+        * We only need consider objects that have waiters, so we use
+@@ -669,7 +669,6 @@ again:             memset(bitmap, 0, count * sizeof
+        * status after building the bit maps so that we will not detect
+        * a blocked transaction without noting that it is already aborting.
+        */
+-      LOCK_LOCKERS(env, region);
+       for (id = 0; id < count; id++) {
+               if (!id_array[id].valid)
+                       continue;
+@@ -738,6 +737,7 @@ get_lock:          id_array[id].last_lock = R_OF
+                       id_array[id].in_abort = 1;
+       }
+       UNLOCK_LOCKERS(env, region);
++      LOCK_SYSTEM_UNLOCK(lt, region);
+       /*
+        * Now we can release everything except the bitmap matrix that we
+@@ -839,6 +839,7 @@ __dd_abort(env, info, statusp)
+       ret = 0;
+       /* We must lock so this locker cannot go away while we abort it. */
++      LOCK_SYSTEM_LOCK(lt, region);
+       LOCK_LOCKERS(env, region);
+       /*
+@@ -895,6 +896,7 @@ __dd_abort(env, info, statusp)
+ done: OBJECT_UNLOCK(lt, region, info->last_ndx);
+ err:
+ out:  UNLOCK_LOCKERS(env, region);
++      LOCK_SYSTEM_UNLOCK(lt, region);
+       return (ret);
+ }
diff --git a/libs/db47/patches/040-patch.4.7.25.4.patch b/libs/db47/patches/040-patch.4.7.25.4.patch
new file mode 100644 (file)
index 0000000..7db4061
--- /dev/null
@@ -0,0 +1,118 @@
+--- a/dbinc/repmgr.h
++++ b/dbinc/repmgr.h
+@@ -374,6 +374,7 @@ typedef struct {
+ #define       SITE_FROM_EID(eid)      (&db_rep->sites[eid])
+ #define       EID_FROM_SITE(s)        ((int)((s) - (&db_rep->sites[0])))
+ #define       IS_VALID_EID(e)         ((e) >= 0)
++#define       IS_KNOWN_REMOTE_SITE(e) ((e) >= 0 && ((u_int)(e)) < db_rep->site_cnt)
+ #define       SELF_EID                INT_MAX
+ #define       IS_PEER_POLICY(p) ((p) == DB_REPMGR_ACKS_ALL_PEERS ||           \
+--- a/rep/rep_elect.c
++++ b/rep/rep_elect.c
+@@ -33,7 +33,7 @@ static int __rep_elect_init
+ static int __rep_fire_elected __P((ENV *, REP *, u_int32_t));
+ static void __rep_elect_master __P((ENV *, REP *));
+ static int __rep_tally __P((ENV *, REP *, int, u_int32_t *, u_int32_t, roff_t));
+-static int __rep_wait __P((ENV *, db_timeout_t *, int *, int, u_int32_t));
++static int __rep_wait __P((ENV *, db_timeout_t *, int, u_int32_t));
+ /*
+  * __rep_elect --
+@@ -55,7 +55,7 @@ __rep_elect(dbenv, given_nsites, nvotes,
+       ENV *env;
+       LOG *lp;
+       REP *rep;
+-      int done, eid, elected, full_elect, locked, in_progress, need_req;
++      int done, elected, full_elect, locked, in_progress, need_req;
+       int ret, send_vote, t_ret;
+       u_int32_t ack, ctlflags, egen, nsites, orig_tally, priority, realpri;
+       u_int32_t tiebreaker;
+@@ -181,8 +181,7 @@ __rep_elect(dbenv, given_nsites, nvotes,
+                       REP_SYSTEM_UNLOCK(env);
+                       (void)__rep_send_message(env, DB_EID_BROADCAST,
+                           REP_MASTER_REQ, NULL, NULL, 0, 0);
+-                      ret = __rep_wait(env, &to, &eid,
+-                          0, REP_F_EPHASE0);
++                      ret = __rep_wait(env, &to, 0, REP_F_EPHASE0);
+                       REP_SYSTEM_LOCK(env);
+                       F_CLR(rep, REP_F_EPHASE0);
+                       switch (ret) {
+@@ -286,11 +285,11 @@ restart:
+               REP_SYSTEM_LOCK(env);
+               goto vote;
+       }
+-      ret = __rep_wait(env, &to, &eid, full_elect, REP_F_EPHASE1);
++      ret = __rep_wait(env, &to, full_elect, REP_F_EPHASE1);
+       switch (ret) {
+               case 0:
+                       /* Check if election complete or phase complete. */
+-                      if (eid != DB_EID_INVALID && !IN_ELECTION(rep)) {
++                      if (!IN_ELECTION(rep)) {
+                               RPRINT(env, DB_VERB_REP_ELECT,
+                                   (env, "Ended election phase 1"));
+                               goto edone;
+@@ -398,15 +397,12 @@ phase2:
+               REP_SYSTEM_LOCK(env);
+               goto i_won;
+       }
+-      ret = __rep_wait(env, &to, &eid, full_elect, REP_F_EPHASE2);
++      ret = __rep_wait(env, &to, full_elect, REP_F_EPHASE2);
+       RPRINT(env, DB_VERB_REP_ELECT,
+           (env, "Ended election phase 2 %d", ret));
+       switch (ret) {
+               case 0:
+-                      if (eid != DB_EID_INVALID)
+-                              goto edone;
+-                      ret = DB_REP_UNAVAIL;
+-                      break;
++                      goto edone;
+               case DB_REP_EGENCHG:
+                       if (to > timeout)
+                               to = timeout;
+@@ -1050,13 +1046,6 @@ __rep_elect_master(env, rep)
+       ENV *env;
+       REP *rep;
+ {
+-      /*
+-       * We often come through here twice, sometimes even more.  We mustn't
+-       * let the redundant calls affect stats counting.  But rep_elect relies
+-       * on this first part for setting eidp.
+-       */
+-      rep->master_id = rep->eid;
+-
+       if (F_ISSET(rep, REP_F_MASTERELECT | REP_F_MASTER)) {
+               /* We've been through here already; avoid double counting. */
+               return;
+@@ -1093,10 +1082,10 @@ __rep_fire_elected(env, rep, egen)
+       (timeout > 5000000) ? 500000 : ((timeout >= 10) ? timeout / 10 : 1);
+ static int
+-__rep_wait(env, timeoutp, eidp, full_elect, flags)
++__rep_wait(env, timeoutp, full_elect, flags)
+       ENV *env;
+       db_timeout_t *timeoutp;
+-      int *eidp, full_elect;
++      int full_elect;
+       u_int32_t flags;
+ {
+       DB_REP *db_rep;
+@@ -1174,7 +1163,6 @@ __rep_wait(env, timeoutp, eidp, full_ele
+                       F_CLR(rep, REP_F_EGENUPDATE);
+                       ret = DB_REP_EGENCHG;
+               } else if (phase_over) {
+-                      *eidp = rep->master_id;
+                       done = 1;
+                       ret = 0;
+               }
+--- a/repmgr/repmgr_net.c
++++ b/repmgr/repmgr_net.c
+@@ -100,6 +100,8 @@ __repmgr_send(dbenv, control, rec, lsnp,
+                   control, rec, &nsites_sent, &npeers_sent)) != 0)
+                       goto out;
+       } else {
++              DB_ASSERT(env, IS_KNOWN_REMOTE_SITE(eid));
++
+               /*
+                * If this is a request that can be sent anywhere, then see if
+                * we can send it to our peer (to save load on the master), but
diff --git a/libs/db47/patches/100-repmgr-format-security.patch b/libs/db47/patches/100-repmgr-format-security.patch
new file mode 100644 (file)
index 0000000..58cfafd
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/repmgr/repmgr_net.c
++++ b/repmgr/repmgr_net.c
+@@ -1136,7 +1136,7 @@ __repmgr_listen(env)
+       }
+       ret = net_errno;
+-      __db_err(env, ret, why);
++      __db_err(env, ret, "%s", why);
+ clean:        if (s != INVALID_SOCKET)
+               (void)closesocket(s);
+       return (ret);
diff --git a/libs/dmx_usb_module/Makefile b/libs/dmx_usb_module/Makefile
new file mode 100644 (file)
index 0000000..d9e458f
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# 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
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=dmx_usb_module
+PKG_VERSION:=0.1.20130818
+PKG_RELEASE:=0.1
+
+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_PROTO:=git
+PKG_SOURCE_VERSION:=ee99ca7edbd9e093480ad63341ac007394047bde
+PKG_MAINTAINER:=Martijn Zilverschoon <martijn@friedzombie.com>
+PKG_LICENSE:=GPL-2.0
+
+include $(INCLUDE_DIR)/package.mk
+
+define KernelPackage/usb-serial-dmx_usb_module
+       SECTION:=kernel
+       CATEGORY:=Kernel modules
+       SUBMENU:=USB Support
+       TITLE:=Support for FTDI RS485 based DMX modules
+       URL:=http://www.erwinrol.com/open-dmx-usb-linux-driver/
+       FILES:=$(PKG_BUILD_DIR)/dmx_usb.$(LINUX_KMOD_SUFFIX)
+       AUTOLOAD:=$(call AutoProbe,dmx_usb)
+       DEPENDS+=kmod-usb-serial
+endef
+
+define KernelPackage/usb-serial-dmx_usb_module/description
+       Open DMX USB is an open USB to DMX dongle hardware design developed by Enttec.
+       The Open in Open DMX USB refers to the fact that everybody is free to use the
+       design and produce its own USB DMX Dongle without paying any licenses.
+endef
+
+DMX_MAKE_OPTS:= -C $(PKG_BUILD_DIR) \
+       PATH="$(TARGET_PATH)" \
+       ARCH="$(LINUX_KARCH)" \
+       CROSS_COMPILE="$(TARGET_CROSS)" \
+       TARGET="$(HAL_TARGET)" \
+       TOOLPREFIX="$(KERNEL_CROSS)" \
+       TOOLPATH="$(KERNEL_CROSS)" \
+       KERNELPATH="$(LINUX_DIR)" \
+       LDOPTS=" "
+
+define Build/Compile
+  $(MAKE) $(DMX_MAKE_OPTS) M=$(PKG_BUILD_DIR)
+endef
+
+$(eval $(call KernelPackage,usb-serial-dmx_usb_module))
diff --git a/libs/dmx_usb_module/patches/001-dmx_usb_Makefile.patch b/libs/dmx_usb_module/patches/001-dmx_usb_Makefile.patch
new file mode 100644 (file)
index 0000000..2a03d94
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/Makefile
++++ b/Makefile
+@@ -12,8 +12,7 @@ KDIR := /lib/modules/$(shell uname -r)/build
+ PWD   := $(shell pwd)
+ default:
+-      $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+-      gcc -O2 -pipe -Wall dmx_usb_test.c -o dmx_usb_test
++      $(MAKE) -C $(KERNELPATH) SUBDIRS=$(PWD) modules
+ endif
+
diff --git a/libs/dtc/Makefile b/libs/dtc/Makefile
new file mode 100644 (file)
index 0000000..a2d74a9
--- /dev/null
@@ -0,0 +1,74 @@
+#
+# 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:=dtc
+PKG_VERSION:=1.4.2
+PKG_RELEASE:=2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+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
+PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+
+define Package/dtc
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Device Tree Compiler
+  URL:=http://devicetree.org/Device_Tree_Compiler
+endef
+
+define Package/dtc/description
+  Device Tree Compiler for Flat Device Trees Device Tree Compiler, dtc, takes
+  as input a device-tree in a given format and outputs a device-tree in another
+  format for booting kernels on embedded systems.
+endef
+
+define Package/dtc/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/bin/dtc $(1)/usr/bin
+endef
+
+
+define Package/libfdt
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=a utility library for reading and manipulating dtb files
+  URL:=http://devicetree.org/Device_Tree_Compiler
+endef
+
+define Package/libfdt/description
+  This is a library containing functions for manipulating Flat Device Trees.
+endef
+
+define Package/libfdt/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/lib/libfdt*.so* $(1)/usr/lib
+endef
+
+TARGET_CFLAGS += \
+       $(FPIC)
+
+MAKE_FLAGS += \
+       PREFIX= \
+       CFLAGS="$(TARGET_CFLAGS)"
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/include/* $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/lib/* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,dtc))
+$(eval $(call BuildPackage,libfdt))
diff --git a/libs/dtndht/Makefile b/libs/dtndht/Makefile
new file mode 100644 (file)
index 0000000..be4385c
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# 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:=dtndht
+PKG_VERSION:=0.2.3
+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_MAINTAINER:=Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
+PKG_LICENSE:=Apache-2.0
+
+PKG_INSTALL:=1
+PKG_FIXUP:=libtool
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/dtndht
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libopenssl
+  TITLE:=Library for DHT lookups for DTNs
+endef
+
+define Package/dtndht/description
+ A library with DHT functions for DTN name lookups.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)
+       $(CP) $(PKG_INSTALL_DIR)/* $(1)/
+endef
+
+define Package/dtndht/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,dtndht))
diff --git a/libs/dtndht/patches/001-musl_header.patch b/libs/dtndht/patches/001-musl_header.patch
new file mode 100644 (file)
index 0000000..32eeb6a
--- /dev/null
@@ -0,0 +1,30 @@
+--- a/dtndht/dtndht.h
++++ b/dtndht/dtndht.h
+@@ -7,6 +7,7 @@ extern "C" {
+ #include <stdio.h>
+ #include <sys/socket.h>
++#include <time.h>
+ enum dtn_dht_bind_type {
+       BINDNONE = 0, IPV4ONLY = 1, IPV6ONLY = 2, BINDBOTH = 3
+--- a/dtndht/blacklist.c
++++ b/dtndht/blacklist.c
+@@ -6,6 +6,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <arpa/inet.h>
++#include <sys/types.h>
+ #ifdef HAVE_OPENSSL_SHA_H
+ #include <openssl/sha.h>
+ #else
+--- a/dtndht/rating.h
++++ b/dtndht/rating.h
+@@ -12,6 +12,7 @@
+ #include <sys/socket.h>
+ #include <arpa/inet.h>
+ #include <string.h>
++#include <time.h>
+ #ifdef HAVE_OPENSSL_SHA_H
+ #include <openssl/sha.h>
+ #else
diff --git a/libs/elektra/Makefile b/libs/elektra/Makefile
new file mode 100644 (file)
index 0000000..851c83a
--- /dev/null
@@ -0,0 +1,409 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# No copyright by Harald Geyer as filling in a template doesn't constitute
+# an original work in the sense of copyright law.
+
+include $(TOPDIR)/rules.mk
+
+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_RELEASE:=1
+
+# Use this for official releasees
+PKG_MD5SUM:=6669e765c834e259fb7570f126b85d7e
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://ftp.libelektra.org/ftp/elektra/releases
+
+# Use this to test versions still under development
+#PKG_SOURCE_PROTO:=git
+#PKG_SOURCE_URL:=https://github.com/ElektraInitiative/libelektra.git
+#PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+#PKG_SOURCE_VERSION:=e97efb29a94f3a49cb952d06552fcf53708ea8c7
+#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+
+PKG_BUILD_DEPENDS:=elektra/host swig/host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libelektra/Default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Elektra
+  URL:=http://www.libelektra.org/
+  SUBMENU:=libelektra
+endef
+
+define Package/libelektra/Default-description
+Elektra provides an universal and secure framework to store
+configuration parameters in a global, hierarchical key database.
+endef
+
+define Package/libelektra-core
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra core library
+  DEPENDS:=+libpthread
+endef
+
+define Package/libelektra-core/description
+$(call Package/libelektra/Default-description)
+
+This package contains the core libraries, that all other parts of
+elektra and all programs using elektra depend on, and an almost
+minimal set of plugins to be actually useful.
+endef
+
+define Package/elektra-kdb
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Elektra kdb tool
+  URL:=http://www.libelektra.org/
+  DEPENDS:=+libelektra-core +libstdcpp
+endef
+
+define Package/elektra-kdb/description
+$(call Package/libelektra/Default-description)
+
+This package contains the kdb tool, which allows to access and change
+the content of the key database from the shell.
+endef
+
+define Package/libelektra-resolvers
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra additional resolvers
+  DEPENDS:=+libelektra-core +libpthread
+endef
+
+define Package/libelektra-resolvers/description
+$(call Package/libelektra/Default-description)
+
+This package contains additional resolvers not included in the
+libelektra-core package. Usually there is no reason to install this.
+endef
+
+define Package/libelektra-plugins
+  $(call Package/libelektra/Default)
+  TITLE:=Useful elektra plugins
+  DEPENDS:=+libelektra-core
+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
+endef
+
+CONTENT_ELEKTRA_PLUGINS = $(strip $(CONTENT_ELEKTRA_PLUGINS_TEXT))
+
+define Package/libelektra-plugins/description
+$(call Package/libelektra/Default-description)
+
+This package contains plugins for various common configuration file
+format and optional features without heavy dependencies. Currently
+these plugins are included:
+$(CONTENT_ELEKTRA_PLUGINS_TEXT)
+endef
+
+define Package/libelektra-cpp
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra plugins depending on libstdcpp
+  DEPENDS:=+libelektra-core +libstdcpp
+endef
+
+CONTENT_ELEKTRA_CPP=dump regexstore struct type
+
+define Package/libelektra-cpp/description
+$(call Package/libelektra/Default-description)
+
+This package contains plugins written in C++.
+Currently these are:
+$(CONTENT_ELEKTRA_CPP)
+endef
+
+define Package/libelektra-boost
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra plugins depending on boost
+  DEPENDS:=+libelektra-core +libstdcpp +boost
+endef
+
+define Package/libelektra-boost/description
+$(call Package/libelektra/Default-description)
+
+This package contains plugins written in C++ with an dependency on
+boost. Currently this is a plugin for a tcl like format.
+endef
+
+define Package/libelektra-crypto
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra crypto plugin
+  DEPENDS:=+libelektra-core +libopenssl
+endef
+
+define Package/libelektra-crypto/description
+$(call Package/libelektra/Default-description)
+
+This package contains support for encrypting values before storage.
+endef
+
+define Package/libelektra-curlget
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra curlget plugin
+  DEPENDS:=+libelektra-core +libcurl
+endef
+
+define Package/libelektra-curlget/description
+$(call Package/libelektra/Default-description)
+
+This plugin can get configuration data from remote URLs before access.
+endef
+
+define Package/libelektra-dbus
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra dbus plugin
+  DEPENDS:=+libelektra-core +libdbus
+endef
+
+define Package/libelektra-dbus/description
+$(call Package/libelektra/Default-description)
+
+This package contains support for dbus notification on configuration
+changes.
+endef
+
+define Package/libelektra-xml
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra xmltool plugin
+  DEPENDS:=+libelektra-core +libxml2
+endef
+
+define Package/libelektra-xml/description
+$(call Package/libelektra/Default-description)
+
+This package contains a plugin for storing data with xml syntax.
+endef
+
+define Package/libelektra-yajl
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra yajl (json) plugin
+  DEPENDS:=+libelektra-core +yajl
+endef
+
+define Package/libelektra-yajl/description
+$(call Package/libelektra/Default-description)
+
+This package contains support for storing the key database as json files.
+endef
+
+define Package/libelektra-python2
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra python2 plugin
+  DEPENDS:=+libelektra-core +python-light +libstdcpp
+endef
+
+define Package/libelektra-python2/description
+$(call Package/libelektra/Default-description)
+
+This package adds python2 support to elektra.
+endef
+
+define Package/libelektra-python3
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra python3 plugin
+  DEPENDS:=+libelektra-core +python3-light +libstdcpp
+endef
+
+define Package/libelektra-python3/description
+$(call Package/libelektra/Default-description)
+
+This package adds python3 support to elektra.
+endef
+
+define Package/libelektra-lua
+  $(call Package/libelektra/Default)
+  TITLE:=Elektra lua plugin
+  DEPENDS:=+libelektra-core +lua +libstdcpp
+endef
+
+define Package/libelektra-lua/description
+$(call Package/libelektra/Default-description)
+
+This package adds lua support to elektra.
+endef
+
+define Package/libelektra-extra
+  $(call Package/libelektra/Default)
+  TITLE:=Additional elektra plugins
+  DEPENDS:=+libelektra-core +libstdcpp
+endef
+
+define CONTENT_EXTRA_PLUGINS_TEXT
+blockresolver c constants counter desktop dpkg error
+fcrypt fstab logchange mozprefs passwd rename required
+simplespeclang timeofday tracer
+endef
+
+CONTENT_ELEKTRA_EXTRA:=$(strip $(CONTENT_EXTRA_PLUGINS_TEXT))
+
+define Package/libelektra-extra/description
+$(call Package/libelektra/Default-description)
+
+This package contains extra plugins that are only useful for debugging
+or as an example of what can be done. Also most experimental plugins
+are included in this package. Currently this includes:
+$(CONTENT_EXTRA_PLUGINS_TEXT)
+endef
+
+CMAKE_OPTIONS = \
+       -DTARGET_PLUGIN_FOLDER="" \
+       -DBUILD_FULL=OFF \
+       -DBUILD_STATIC=OFF \
+       -DBUILD_DOCUMENTATION=OFF \
+       -DFORCE_IN_SOURCE_BUILD=ON \
+       -DBUILD_TESTING=OFF \
+       -DKDB_DEFAULT_RESOLVER=resolver_fm_pb_b \
+       -DKDB_DEFAULT_STORAGE=ini \
+       -DENABLE_OPTIMIZATIONS=OFF \
+       -DPLUGINS="ALL"
+
+CMAKE_HOST_OPTIONS = \
+       -DCMAKE_SKIP_RPATH=FALSE \
+       -DCMAKE_INSTALL_RPATH=$(STAGING_DIR_HOST)/lib/ \
+       -DINSTALL_BUILD_TOOLS=ON \
+       -DBUILD_STATIC=OFF \
+       -DBUILD_DOCUMENTATION=OFF \
+       -DINSTALL_SYSTEM_FILES=OFF \
+       -DFORCE_IN_SOURCE_BUILD=ON \
+       -DBUILD_TESTING=OFF \
+       -DPLUGINS="ALL;-python2;-python" \
+       -DTOOLS="gen;kdb"
+
+define Package/libelektra-core/install
+       $(INSTALL_DIR) $(1)/etc/kdb/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(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-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/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-proposal.so* $(1)/usr/lib/
+       #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-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/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-storage.so $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-resolver.so $(1)/usr/lib/
+endef
+
+define Package/elektra-kdb/install
+       $(INSTALL_DIR) $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdb $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/lib/elektra/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektratools* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/elektra/tool_exec/ $(1)/usr/lib/elektra/
+endef
+
+define Package/libelektra-resolvers/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-resolver_* $(1)/usr/lib/
+       rm -f $(1)/usr/lib/libelektra-resolver_fm_pb_b.so
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-wresolver.so $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-noresolver.so $(1)/usr/lib/
+endef
+
+define Package/libelektra-plugins/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(foreach plugin,$(CONTENT_ELEKTRA_PLUGINS),$(PKG_INSTALL_DIR)/usr/lib/libelektra-$(plugin).so) $(1)/usr/lib/
+endef
+
+define Package/libelektra-boost/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-tcl.so $(1)/usr/lib/
+endef
+
+define Package/libelektra-cpp/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(foreach plugin,$(CONTENT_ELEKTRA_CPP),$(PKG_INSTALL_DIR)/usr/lib/libelektra-$(plugin).so) $(1)/usr/lib/
+endef
+
+define Package/libelektra-crypto/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-crypto_openssl.so $(1)/usr/lib/
+endef
+
+define Package/libelektra-curlget/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-curlget.so $(1)/usr/lib/
+endef
+
+define Package/libelektra-dbus/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-dbus.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/
+endef
+
+define Package/libelektra-yajl/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-yajl.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/
+endef
+
+define Package/libelektra-python3/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-python.so $(1)/usr/lib/
+endef
+
+define Package/libelektra-lua/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-lua.so $(1)/usr/lib/
+endef
+
+define Package/libelektra-extra/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(foreach plugin,$(CONTENT_ELEKTRA_EXTRA),$(PKG_INSTALL_DIR)/usr/lib/libelektra-$(plugin).so) $(1)/usr/lib/
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/elektra/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/elektra/* $(1)/usr/include/elektra/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,libelektra-core))
+$(eval $(call BuildPackage,elektra-kdb))
+$(eval $(call BuildPackage,libelektra-resolvers))
+$(eval $(call BuildPackage,libelektra-plugins))
+$(eval $(call BuildPackage,libelektra-boost))
+$(eval $(call BuildPackage,libelektra-cpp))
+$(eval $(call BuildPackage,libelektra-curlget))
+$(eval $(call BuildPackage,libelektra-crypto))
+$(eval $(call BuildPackage,libelektra-dbus))
+$(eval $(call BuildPackage,libelektra-xml))
+$(eval $(call BuildPackage,libelektra-yajl))
+$(eval $(call BuildPackage,libelektra-python2))
+$(eval $(call BuildPackage,libelektra-python3))
+$(eval $(call BuildPackage,libelektra-lua))
+$(eval $(call BuildPackage,libelektra-extra))
diff --git a/libs/eventlog/Makefile b/libs/eventlog/Makefile
new file mode 100644 (file)
index 0000000..d0658ff
--- /dev/null
@@ -0,0 +1,44 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=eventlog
+PKG_VERSION:=0.2.12
+PKG_RELEASE:=2
+
+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_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libeventlog
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=A new API to format and send structured log messages.
+endef
+
+define Package/eventlog/description
+  A new API to format and send structured log messages. It supports multiple message
+  representations (plain, XML attributes and XML tags) and multiple output methods
+  (local syslogd).
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/eventlog $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevtlog.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/eventlog.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libeventlog/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libevtlog.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libeventlog))
diff --git a/libs/faad2/Config.in b/libs/faad2/Config.in
new file mode 100644 (file)
index 0000000..0033676
--- /dev/null
@@ -0,0 +1,12 @@
+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.
diff --git a/libs/faad2/Makefile b/libs/faad2/Makefile
new file mode 100644 (file)
index 0000000..f6bed3d
--- /dev/null
@@ -0,0 +1,114 @@
+#
+# Copyright (C) 2008-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:=faad2
+PKG_VERSION:=2.7
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/faac
+PKG_MD5SUM:=4c332fa23febc0e4648064685a3d4332
+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
+endef
+
+define Package/faad2/Default/description
+       FAAD2 is the fastest ISO AAC audio decoder available.
+       FAAD2 correctly decodes all MPEG-4 and MPEG-2 MAIN,
+       LOW, LTP, LD and ER object type AAC files.
+endef
+
+define Package/faad2
+$(call Package/faad2/Default)
+  SECTION:=sound
+  CATEGORY:=Sound
+  TITLE+=player
+  DEPENDS:=+libfaad2
+endef
+
+define Package/faad2/description
+$(call Package/faad2/Default/description)
+  This package contains a binary to play AAC or MP4 files.
+endef
+
+define Package/libfaad2
+$(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
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfaad.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/faad2/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/faad $(1)/usr/bin/
+endef
+
+define Package/libfaad2/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfaad.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,faad2))
+$(eval $(call BuildPackage,libfaad2))
diff --git a/libs/fcgi/Makefile b/libs/fcgi/Makefile
new file mode 100644 (file)
index 0000000..d1d404f
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2007-2011 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:=fcgi
+PKG_VERSION:=2.4.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.fastcgi.com/dist/
+PKG_MD5SUM:=d15060a813b91383a9f3c66faf84867e
+
+PKG_FIXUP:=libtool-ucxx
+
+PKG_MAINTAINER:=Jacob Siverskog <jacob@teenageengineering.com>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/uclibc++.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fcgi/Default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=http://www.fastcgi.com/
+endef
+
+define Package/fcgi
+  $(call Package/fcgi/Default)
+  MENU:=1
+  DEPENDS:= +libpthread
+  TITLE:=Shared library of FastCGI
+endef
+
+define Package/fcgixx
+  $(call Package/fcgi/Default)
+  DEPENDS:=fcgi $(CXX_DEPENDS)
+  TITLE:=Shared library of FastCGI++
+endef
+
+define Package/fcgi/description
+ FastCGI is a language independent, scalable, open extension to
+ CGI that provides high performance without the limitations of
+ server specific APIs.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+
+CONFIGURE_VARS += \
+       LIBS="-lm" \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/fastcgi.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/fcgi{app,_config,misc,o,os,_stdio}.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfcgi{,++}.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/fcgi/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cgi-fcgi $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfcgi.so.* $(1)/usr/lib/
+endef
+
+define Package/fcgixx/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfcgi++.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,fcgi))
+$(eval $(call BuildPackage,fcgixx))
diff --git a/libs/fcgi/patches/100-fcgio-int-type-fix.patch b/libs/fcgi/patches/100-fcgio-int-type-fix.patch
new file mode 100644 (file)
index 0000000..0fbfbfd
--- /dev/null
@@ -0,0 +1,38 @@
+Index: fcgi-2.4.0/include/fcgio.h
+===================================================================
+--- fcgi-2.4.0.orig/include/fcgio.h    2007-07-17 13:30:28.000000000 +0200
++++ fcgi-2.4.0/include/fcgio.h 2007-07-17 13:30:28.000000000 +0200
+@@ -77,10 +77,10 @@
+     virtual int sync();
+     // Remove and return the current character.
+-    virtual int uflow();
++    virtual int_type uflow();
+     // Fill the get area (if buffered) and return the current character.
+-    virtual int underflow();
++    virtual int_type underflow();
+     // Use a buffer.  The only reasons that a buffer would be useful is
+     // to support the use of the unget()/putback() or seek() methods.  Using
+diff -urN fcgi-2.4.0/libfcgi/fcgio.cpp fcgi-2.4.0.new/libfcgi/fcgio.cpp
+--- fcgi-2.4.0/libfcgi/fcgio.cpp       2002-02-24 21:12:22.000000000 +0100
++++ fcgi-2.4.0.new/libfcgi/fcgio.cpp   2007-08-28 11:22:22.000000000 +0200
+@@ -89,7 +89,7 @@
+ }
+ // uflow() removes the char, underflow() doesn't
+-int fcgi_streambuf::uflow() 
++std::basic_streambuf<char>::int_type fcgi_streambuf::uflow()
+ {
+     int rv = underflow();
+     if (this->bufsize) gbump(1);
+@@ -97,7 +97,7 @@
+ }
+                               
+ // Note that the expected behaviour when there is no buffer varies
+-int fcgi_streambuf::underflow()
++std::basic_streambuf<char>::int_type fcgi_streambuf::underflow()
+ {
+     if (this->bufsize)
+     {
diff --git a/libs/fcgi/patches/110-no_examples.patch b/libs/fcgi/patches/110-no_examples.patch
new file mode 100644 (file)
index 0000000..8c14e8a
--- /dev/null
@@ -0,0 +1,24 @@
+diff -urN fcgi-2.4.0/Makefile.am fcgi-2.4.0.new/Makefile.am
+--- fcgi-2.4.0/Makefile.am     2001-12-22 14:05:39.000000000 +0100
++++ fcgi-2.4.0.new/Makefile.am 2007-08-28 11:05:10.000000000 +0200
+@@ -4,7 +4,7 @@
+ #  $Id: Makefile.am,v 1.7 2001/12/22 13:05:39 robs Exp $
+ #
+-SUBDIRS = libfcgi cgi-fcgi examples include
++SUBDIRS = libfcgi cgi-fcgi include
+ include_HEADERS = fcgi_config.h
+diff -urN fcgi-2.4.0/Makefile.in fcgi-2.4.0.new/Makefile.in
+--- fcgi-2.4.0/Makefile.in     2003-01-19 18:21:15.000000000 +0100
++++ fcgi-2.4.0.new/Makefile.in 2007-08-28 11:04:55.000000000 +0200
+@@ -93,7 +93,7 @@
+ am__quote = @am__quote@
+ install_sh = @install_sh@
+-SUBDIRS = libfcgi cgi-fcgi examples include
++SUBDIRS = libfcgi cgi-fcgi include
+ include_HEADERS = fcgi_config.h
diff --git a/libs/fcgi/patches/120-stdio.patch b/libs/fcgi/patches/120-stdio.patch
new file mode 100644 (file)
index 0000000..94c7894
--- /dev/null
@@ -0,0 +1,12 @@
+Index: fcgi-2.4.0/libfcgi/fcgio.cpp
+===================================================================
+--- fcgi-2.4.0.orig/libfcgi/fcgio.cpp  2014-05-15 10:43:15.153971782 +0200
++++ fcgi-2.4.0/libfcgi/fcgio.cpp       2014-05-15 10:44:44.037974020 +0200
+@@ -23,6 +23,7 @@
+ #endif
+ #include <limits.h>
++#include <stdio.h>
+ #include "fcgio.h"
+ using std::streambuf;
diff --git a/libs/fftw3/Makefile b/libs/fftw3/Makefile
new file mode 100644 (file)
index 0000000..e6634da
--- /dev/null
@@ -0,0 +1,119 @@
+#
+# Copyright (C) 2007-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:=fftw3
+PKG_VERSION:=3.3.6
+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_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/fftw-$(PKG_VERSION)
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fftw3
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=@!avr32 +libpthread
+  VARIANT:=double
+  TITLE:=Fast Fourier transform library
+  URL:=http://www.fftw.org/
+  MAINTAINER:=Vladimir Ulrich <admin@evl.su>
+endef
+
+define Package/fftw3f
+  $(call Package/fftw3)
+  VARIANT:=single
+  TITLE+= (single precision)
+endef
+
+define Package/fftw3l
+  $(call Package/fftw3)
+  DEPENDS:=@BROKEN
+  VARIANT:=long-double
+  TITLE+= (long-double precision)
+endef
+
+define Package/fftw3/description
+       FFTW is a collection of fast C routines for computing the
+       Discrete Fourier Transform in one or more dimensions. It
+       includes complex, real, and parallel transforms, and can
+       handle arbitrary array sizes efficiently.
+endef
+
+define Package/fftw3f/description
+  $(call Package/fftw3/description)
+
+  This package contains the single precision library.
+endef
+
+define Package/fftw3l/description
+  $(call Package/fftw3/description)
+
+  This package contains the long-double precision library.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --prefix=/usr \
+       --without-libiconv-prefix \
+       --without-libintl-prefix \
+       --enable-shared \
+       --enable-threads \
+       --enable-type-prefix \
+       --disable-debug \
+       --disable-fortran
+
+ifeq ($(BUILD_VARIANT), single)
+CONFIGURE_ARGS += \
+       --enable-single
+endif
+
+ifeq ($(BUILD_VARIANT), long-double)
+CONFIGURE_ARGS += \
+       --enable-long-double
+endif
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/fftw3.h $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3*.{a,la} $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3*.so* $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/fftw3/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3.so* $(1)/usr/lib/
+endef
+
+define Package/fftw3f/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3f.so* $(1)/usr/lib/
+endef
+
+define Package/fftw3l/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfftw3l.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,fftw3))
+$(eval $(call BuildPackage,fftw3f))
+$(eval $(call BuildPackage,fftw3l))
diff --git a/libs/fftw3/patches/001-makefile.patch b/libs/fftw3/patches/001-makefile.patch
new file mode 100644 (file)
index 0000000..6f56fa6
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -241,7 +241,7 @@
+ CTAGS = ctags
+ CSCOPE = cscope
+ DIST_SUBDIRS = support genfft kernel simd-support dft rdft reodft api \
+-      libbench2 . threads tests mpi doc tools m4
++      libbench2 . threads mpi doc tools m4
+ am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+       $(srcdir)/fftw.pc.in AUTHORS COPYING ChangeLog INSTALL NEWS \
+       README TODO compile config.guess config.sub install-sh \
+@@ -470,7 +470,7 @@
+ # tools are available, such as fig2dev in maintainer mode)
+ @BUILD_DOC_TRUE@DOCDIR = doc
+ SUBDIRS = support $(GENFFT) kernel simd-support dft rdft reodft api   \
+-libbench2 $(CHICKEN_EGG) tests mpi $(DOCDIR) tools m4
++libbench2 $(CHICKEN_EGG) mpi m4
+ EXTRA_DIST = COPYRIGHT bootstrap.sh CONVENTIONS fftw.pc.in
+ SIMD_LIBS = \
diff --git a/libs/file/Makefile b/libs/file/Makefile
new file mode 100644 (file)
index 0000000..a0117b5
--- /dev/null
@@ -0,0 +1,97 @@
+#
+# 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:=file
+PKG_VERSION:=5.25
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/file/
+PKG_MD5SUM:=e6a972d4e10d9e76407a432f4a63cd4c
+
+PKG_LICENSE:=BSD-2c
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+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>
+endef
+
+define Package/file
+$(call Package/file/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE+= utility
+  DEPENDS:=+libmagic
+endef
+
+define Package/libmagic
+$(call Package/file/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= library
+  DEPENDS:=+zlib
+endef
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+
+MAKE_PATH := src
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/Compile/magic
+       ( cd $(PKG_BUILD_DIR)/magic/Magdir; \
+               for f in `ls`; do \
+                       cat $$$${f}; \
+               done \
+       ) > $(PKG_BUILD_DIR)/magic/magic
+endef
+Hooks/Compile/Post += Build/Compile/magic
+
+define Build/Install/magic
+       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/share/file
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/magic/magic $(PKG_INSTALL_DIR)/usr/share/file/
+endef
+Hooks/Install/Post += Build/Install/magic
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/magic.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libmagic.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/file/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/file $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/share/misc
+       $(SED) "/^#/d" $(PKG_INSTALL_DIR)/usr/share/file/magic
+       $(SED) "/^$$$$/d" $(PKG_INSTALL_DIR)/usr/share/file/magic
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/file/magic $(1)/usr/share/misc/
+
+       # For some reason both "magic" and "magic.mgc" MUST exist
+       ln -sf magic $(1)/usr/share/misc/magic.mgc
+endef
+
+define Package/libmagic/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,file))
+$(eval $(call BuildPackage,libmagic))
diff --git a/libs/flac/Makefile b/libs/flac/Makefile
new file mode 100644 (file)
index 0000000..01d7d64
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# 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:=flac
+PKG_VERSION:=1.3.1
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://downloads.xiph.org/releases/flac/
+PKG_MD5SUM:=b9922c9a0378c88d3e901b234f852698
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_INSTALL:=1
+
+PKG_LICENSE:=GFDL-1.2 GPL-2 LGPL-2.1 BSD-3-Clause
+PKG_LICENSE_FILES:=README COPYING.FDL COPYING.GPL COPYING.LGPL COPYING.Xiph
+
+PKG_FIXUP:=autoreconf
+PKG_REMOVE_FILES:=autogen.sh aclocal.m4
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libflac
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Free Lossless Audio Codec library
+  URL:=https://xiph.org/flac
+endef
+
+CONFIGURE_ARGS += \
+       --disable-cpplibs \
+       --disable-sse \
+       --disable-3dnow \
+       --disable-altivec \
+       --disable-doxgen-docs \
+       --disable-local-xmms-plugin \
+       --disable-xmms-plugin \
+       --disable-ogg \
+       --disable-oggtest \
+       $(if $(CONFIG_DEBUG),--enable-debug) \
+       --enable-static
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/FLAC \
+               $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libFLAC.{a,so*,la} \
+               $(1)/usr/lib/
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
+               $(1)/usr/lib/pkgconfig/
+
+       $(INSTALL_DIR) $(1)/usr/share/aclocal/
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/share/aclocal/* \
+               $(1)/usr/share/aclocal/
+endef
+
+define Package/libflac/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libFLAC.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libflac))
diff --git a/libs/flac/patches/001-no-docs-and-examples.patch b/libs/flac/patches/001-no-docs-and-examples.patch
new file mode 100644 (file)
index 0000000..72b2631
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -31,7 +31,7 @@
+ ACLOCAL_AMFLAGS = -I m4
+-SUBDIRS = doc include m4 man src examples test build objs
++SUBDIRS = include m4 src build objs
+ EXTRA_DIST = \
+       COPYING.FDL \
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -30,11 +30,6 @@ SUBDIRS = \
+       flac \
+       metaflac \
+       $(XMMS_DIRS) \
+-      test_grabbag \
+-      test_libs_common \
+-      test_libFLAC \
+-      test_seeking \
+-      test_streams \
+       utils \
+       $(CPPLIBS_DIRS)
diff --git a/libs/flac/patches/002-no-utility.patch b/libs/flac/patches/002-no-utility.patch
new file mode 100644 (file)
index 0000000..f744602
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -27,10 +27,7 @@ endif
+ SUBDIRS = \
+       share \
+       libFLAC \
+-      flac \
+-      metaflac \
+       $(XMMS_DIRS) \
+-      utils \
+       $(CPPLIBS_DIRS)
+ EXTRA_DIST = \
diff --git a/libs/flac/patches/005-gcc_debug_options.patch b/libs/flac/patches/005-gcc_debug_options.patch
new file mode 100644 (file)
index 0000000..80ffff1
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -348,11 +348,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//;s/-g[0-9]*//')
+       CFLAGS="-O3 -funroll-loops $CFLAGS"
+ fi
diff --git a/libs/flac/patches/010-automake-compat.patch b/libs/flac/patches/010-automake-compat.patch
new file mode 100644 (file)
index 0000000..8318048
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -33,6 +33,8 @@ ACLOCAL_AMFLAGS = -I m4
+ SUBDIRS = include m4 src build objs
++ACLOCAL_AMFLAGS = -I m4
++
+ EXTRA_DIST = \
+       COPYING.FDL \
+       COPYING.GPL \
diff --git a/libs/flac/patches/020-fix-musl-sigemptyset-x86.patch b/libs/flac/patches/020-fix-musl-sigemptyset-x86.patch
new file mode 100644 (file)
index 0000000..0ee3ce5
--- /dev/null
@@ -0,0 +1,11 @@
+--- 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))
+               {
diff --git a/libs/freetype/Makefile b/libs/freetype/Makefile
new file mode 100644 (file)
index 0000000..da9d45f
--- /dev/null
@@ -0,0 +1,84 @@
+#
+# 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:=freetype
+PKG_VERSION:=2.5.5
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/freetype
+PKG_MD5SUM:=2a7a314927011d5030903179cf183be0
+
+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_FIXUP:=autoreconf
+PKG_LIBTOOL_PATHS:=builds/unix
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libfreetype
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=A free, high-quality and portable font engine
+  URL:=http://www.freetype.org/
+  DEPENDS:=+zlib +libbz2
+endef
+
+define Package/libfreetype/description
+ The FreeType project is a team of volunteers who develop free,
+ portable and high-quality software solutions for digital typography.
+ They specifically target embedded systems and focus on bringing small,
+ efficient and ubiquitous products.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --with-bzip2=yes \
+       --with-zlib=yes \
+       --with-png=no \
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(2)/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/freetype-config $(2)/bin/
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/freetype2 $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreetype.{a,so*} $(1)/usr/lib/
+       $(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' \
+                $(1)/usr/lib/pkgconfig/freetype2.pc
+endef
+
+
+define Package/libfreetype/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreetype.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,libfreetype))
diff --git a/libs/gdbm/Makefile b/libs/gdbm/Makefile
new file mode 100644 (file)
index 0000000..a8d1926
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# 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:=gdbm
+PKG_VERSION:=1.11
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/gdbm
+PKG_MD5SUM:=72c832680cf0999caedbe5b265c8c1bd
+
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_FIXUP:=autoreconf gettext-version
+PKG_REMOVE_FILES:=Makefile compat/Makefile doc/Makefile export/Makefile src/Makefile tests/Makefile
+PKG_BUILD_PARALLEL:=0
+
+PKG_BUILD_DEPENDS:=gettext-full/host
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libgdbm
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=GNU database manager
+  URL:=http://www.gnu.org/software/gdbm/
+endef
+
+define Package/libgdbm/description
+  GNU database manager library
+  GNU dbm is a set of database routines that use extendible hashing and
+  works similar to the standard UNIX dbm routines.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+
+define Build/Compile
+       +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               BINOWN=`id -u` \
+               BINGRP=`id -g` \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/gdbm.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgdbm.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libgdbm/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgdbm.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libgdbm))
diff --git a/libs/giflib/Makefile b/libs/giflib/Makefile
new file mode 100644 (file)
index 0000000..28fcd69
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# 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:=giflib
+PKG_VERSION:=5.1.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/giflib
+PKG_MD5SUM:=323a9f11ab56c8a2d1715376410ce376
+
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_REMOVE_FILES:=autogen.sh aclocal.m4
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/giflib
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=GIF libraries
+  URL:=http://sourceforge.net/projects/giflib
+endef
+
+define Package/giflib/description
+  giflib is a library for reading and writing gif images.
+  It is API and ABI compatible with libungif which was in wide use while
+  the LZW compression algorithm was patented.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR)
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/{lib,include}
+       $(CP) $(PKG_BUILD_DIR)/lib/.libs/lib*so* $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/lib/.libs/libgif.a $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/lib/libgif.la $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/lib/*.h $(1)/usr/include/
+endef
+
+define Package/giflib/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/lib/.libs/lib*so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,giflib))
diff --git a/libs/giflib/patches/100-no-docs.patch b/libs/giflib/patches/100-no-docs.patch
new file mode 100644 (file)
index 0000000..f006d6c
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -21,7 +21,6 @@ AC_PROG_MAKE_SET
+ AM_PROG_CC_C_O
+ dnl Allow partial building on systems without xmlto
+-AC_CHECK_PROG([have_xmlto], [xmlto], ["yes"],["no"])
+ AM_CONDITIONAL([BUILD_DOC], [test "x${have_xmlto}" = "xyes"])
+ dnl Shared-library version
diff --git a/libs/glpk/Makefile b/libs/glpk/Makefile
new file mode 100644 (file)
index 0000000..0c76435
--- /dev/null
@@ -0,0 +1,66 @@
+#
+# Copyright (C) 2010-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:=glpk
+PKG_VERSION:=4.60
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
+PKG_MD5SUM:=eda7965907f6919ffc69801646f13c3e
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libglpk
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=The GNU Linear Programming Kit
+       URL:=http://www.gnu.org/software/glpk/
+endef
+
+define Package/libglpk/description
+       The GLPK (GNU Linear Programming Kit) package is intended for solving
+       large-scale linear programming (LP), mixed integer programming (MIP),
+       and other related problems. It is a set of routines written in ANSI C
+       and organized in the form of a callable library.
+endef
+
+define Package/glpsol
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=The GNU Linear Programming Kit (glpsol)
+       URL:=http://www.gnu.org/software/glpk/
+       DEPENDS:=libglpk
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
+endef
+
+define Package/libglpk/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+define Package/glpsol/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/glpsol $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,libglpk))
+$(eval $(call BuildPackage,glpsol))
diff --git a/libs/gperf/Makefile b/libs/gperf/Makefile
new file mode 100644 (file)
index 0000000..4cdd470
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# 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:=gperf
+PKG_VERSION:=3.0.4
+PKG_RELEASE:=1
+PKG_MD5SUM:=c1f1db32fb6598d6a93e6e88796a8632
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/gperf
+PKG_HOST_ONLY=1
+
+PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/gperf
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=GNU gperf
+  BUILDONLY:=1
+  URL:=http://www.gnu.org/software/gperf
+endef
+
+define Package/gperf/description
+ GNU gperf is a perfect hash function generator. For a given list of strings, it
+ produces a hash function and hash table, in form of C or C++ code, for looking 
+ up a value depending on the input string. The hash function is perfect, which 
+ means that the hash table has no collisions, and the hash table lookup needs a
+ single string comparison only.
+endef
+
+define Host/Install
+       $(MAKE) -C $(HOST_BUILD_DIR) install
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,gperf))
diff --git a/libs/hidapi/Makefile b/libs/hidapi/Makefile
new file mode 100644 (file)
index 0000000..e8ef733
--- /dev/null
@@ -0,0 +1,77 @@
+#
+# 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:=hidapi
+PKG_VERSION:=0.8.0-rc1
+PKG_RELEASE:=2
+
+PKG_SOURCE_PROTO:=git
+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_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE-bsd.txt
+
+PKG_MAINTAINER:=Paul Fertser <fercerpav@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/hidapi
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libusb-1.0 +librt $(ICONV_DEPENDS)
+  TITLE:=Library to talk to HID devices
+  URL:=http://www.signal11.us/oss/hidapi/
+endef
+
+define Package/hidapi/description
+HIDAPI is a multi-platform library which allows an application to interface
+with USB and Bluetooth HID-Class devices on Windows, Linux, FreeBSD, and Mac
+OS X.  HIDAPI can be either built as a shared library (.so or .dll) or
+can be embedded directly into a target application by adding a single source
+file (per platform) and a single header.
+endef
+
+define Build/Configure
+endef
+
+MAKE_PATH=libusb
+MAKE_FLAGS+=-f Makefile.linux
+TARGET_CFLAGS+=$(FPIC)
+
+define Build/Compile
+       $(call Build/Compile/Default, libhidapi-libusb.so)
+       mv $(PKG_BUILD_DIR)/libusb/libhidapi-libusb.so \
+               $(PKG_BUILD_DIR)/libusb/libhidapi-libusb.so.0
+       ln -s libhidapi-libusb.so.0 $(PKG_BUILD_DIR)/libusb/libhidapi-libusb.so
+       sed    's^@prefix@^/usr^; \
+               s^@exec_prefix@^/usr^; \
+               s^@libdir@^$$$${exec_prefix}/lib^; \
+               s^@includedir@^$$$${prefix}/include^' \
+               < $(PKG_BUILD_DIR)/pc/hidapi-libusb.pc.in \
+               > $(PKG_BUILD_DIR)/pc/hidapi-libusb.pc
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/hidapi
+       $(CP) $(PKG_BUILD_DIR)/hidapi/hidapi.h $(1)/usr/include/hidapi/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/libusb/libhidapi-libusb.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(CP) $(PKG_BUILD_DIR)/pc/hidapi-libusb.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/hidapi/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/libusb/libhidapi-libusb.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,hidapi))
diff --git a/libs/hidapi/patches/010-add-iconv-linkage.patch b/libs/hidapi/patches/010-add-iconv-linkage.patch
new file mode 100644 (file)
index 0000000..d942d50
--- /dev/null
@@ -0,0 +1,22 @@
+Index: hidapi-0.8.0-rc1/libusb/Makefile.linux
+===================================================================
+--- hidapi-0.8.0-rc1.orig/libusb/Makefile.linux
++++ hidapi-0.8.0-rc1/libusb/Makefile.linux
+@@ -22,7 +22,7 @@ COBJS_LIBUSB = hid.o
+ COBJS = $(COBJS_LIBUSB)
+ CPPOBJS   = ../hidtest/hidtest.o
+ OBJS      = $(COBJS) $(CPPOBJS)
+-LIBS_USB  = `pkg-config libusb-1.0 --libs` -lrt -lpthread
++LIBS_USB  = `pkg-config libusb-1.0 --libs` -lrt -lpthread -liconv
+ LIBS      = $(LIBS_USB)
+ INCLUDES ?= -I../hidapi `pkg-config libusb-1.0 --cflags`
+@@ -33,7 +33,7 @@ hidtest-libusb: $(COBJS_LIBUSB) $(CPPOBJ
+ # Shared Libs
+ libhidapi-libusb.so: $(COBJS_LIBUSB)
+-      $(CC) $(LDFLAGS) $(LIBS_USB) -shared -fpic -Wl,-soname,$@.0 $^ -o $@
++      $(CC) $(LDFLAGS) $^ $(LIBS_USB) -shared -fpic -Wl,-soname,$@.0 -o $@
+ # Objects
+ $(COBJS): %.o: %.c
diff --git a/libs/hiredis/Makefile b/libs/hiredis/Makefile
new file mode 100644 (file)
index 0000000..16d9333
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2010-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:=hiredis
+PKG_VERSION:=0.13.3
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+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_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libhiredis
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=Minimalistic C client for Redis
+       URL:=https://github.com/redis/hiredis
+endef
+
+define Package/libhiredis/description
+       Hiredis is a minimalistic C client library for the Redis database.
+endef
+
+MAKE_FLAGS += ARCH="" DEBUG="" PREFIX="/usr"
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/hiredis/adapters
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/hiredis/adapters/* $(1)/usr/include/hiredis/adapters
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/hiredis/*.h $(1)/usr/include/hiredis/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhiredis.{so*,a} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hiredis.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libhiredis/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhiredis.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libhiredis))
diff --git a/libs/ibrcommon/Makefile b/libs/ibrcommon/Makefile
new file mode 100644 (file)
index 0000000..a37ddf5
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# 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:=ibrcommon
+PKG_VERSION:=1.0.1
+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_MAINTAINER:=Johannes Morgenroth <jm@m-network.de>
+PKG_LICENSE:=Apache-2.0
+
+PKG_INSTALL:=1
+PKG_FIXUP:=libtool
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ibrcommon
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libstdcpp +libpthread +librt +libnl +libopenssl
+  TITLE:=IBR Common C++ Library
+endef
+
+CONFIGURE_ARGS += \
+       --with-openssl
+
+define Package/ibrcommon/description
+ A library with common functions for C++.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)
+       $(CP) $(PKG_INSTALL_DIR)/* $(1)/
+endef
+
+define Package/ibrcommon/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,ibrcommon))
diff --git a/libs/ibrcommon/patches/001-fix-build-with-musl.patch b/libs/ibrcommon/patches/001-fix-build-with-musl.patch
new file mode 100644 (file)
index 0000000..0d3f9c2
--- /dev/null
@@ -0,0 +1,23 @@
+diff --git a/ibrcommon/data/File.cpp b/ibrcommon/data/File.cpp
+index 31af4ae..9b49890 100644
+--- a/ibrcommon/data/File.cpp
++++ b/ibrcommon/data/File.cpp
+@@ -35,9 +35,7 @@
+ #include <cerrno>
+ #include <fstream>
+-#if !defined(HAVE_FEATURES_H) || defined(ANDROID)
+ #include <libgen.h>
+-#endif
+ #ifdef __WIN32__
+ #include <io.h>
+@@ -226,7 +224,7 @@ namespace ibrcommon
+       std::string File::getBasename() const
+       {
+ #if !defined(ANDROID) && defined(HAVE_FEATURES_H)
+-              return std::string(basename(_path.c_str()));
++              return std::string(basename((char *)_path.c_str()));
+ #else
+               char path[_path.length()+1];
+               ::memcpy(&path, _path.c_str(), _path.length()+1);
diff --git a/libs/ibrdtn/Makefile b/libs/ibrdtn/Makefile
new file mode 100644 (file)
index 0000000..45051ad
--- /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:=ibrdtn
+PKG_VERSION:=1.0.1
+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_MAINTAINER:=Johannes Morgenroth <jm@m-network.de>
+PKG_LICENSE:=Apache-2.0
+
+PKG_INSTALL:=1
+PKG_FIXUP:=libtool
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ibrdtn
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+ibrcommon +zlib
+  TITLE:=IBR-DTN Library
+endef
+
+define Package/ibrdtn/description
+ Base library for IBR-DTN daemon and tools.
+endef
+
+CONFIGURE_ARGS += \
+       --with-compression \
+       --without-glib
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)
+       $(CP) $(PKG_INSTALL_DIR)/* $(1)/
+endef
+
+define Package/ibrdtn/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,ibrdtn))
diff --git a/libs/icu/patches/000-dont-cpy-files-from-topdirs.patch b/libs/icu/patches/000-dont-cpy-files-from-topdirs.patch
new file mode 100644 (file)
index 0000000..8b8cb7b
--- /dev/null
@@ -0,0 +1,12 @@
+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)
+       $(INSTALL_SCRIPT) $(top_srcdir)/install-sh $(DESTDIR)$(pkgdatadir)/install-sh
+       @$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig
+       $(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/
+-      $(INSTALL_DATA) $(top_srcdir)/../LICENSE $(DESTDIR)$(pkgdatadir)/LICENSE
+       $(INSTALL_SCRIPT) $(top_builddir)/config/icu-config $(DESTDIR)$(bindir)/icu-config
+       $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile.inc
+       $(INSTALL_DATA) $(top_builddir)/config/pkgdata.inc $(DESTDIR)$(pkglibdir)/pkgdata.inc
diff --git a/libs/icu/patches/001-disable-strtod_l.patch b/libs/icu/patches/001-disable-strtod_l.patch
new file mode 100644 (file)
index 0000000..b84d14f
--- /dev/null
@@ -0,0 +1,26 @@
+--- 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/CVE-2017-7867_CVE-2017-7868.patch b/libs/icu/patches/CVE-2017-7867_CVE-2017-7868.patch
new file mode 100644 (file)
index 0000000..accba5f
--- /dev/null
@@ -0,0 +1,176 @@
+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;
diff --git a/libs/intltool/Makefile b/libs/intltool/Makefile
new file mode 100644 (file)
index 0000000..a84ea94
--- /dev/null
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2009-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:=intltool
+PKG_LIBVER:=0.40
+PKG_VERSION:=$(PKG_LIBVER).6
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@GNOME/intltool/$(PKG_LIBVER)
+PKG_MD5SUM:=69bc0353323112f42ad4f9cf351bc3e5
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_HOST_ONLY:=1
+HOST_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/intltool
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=set of tools to centralize translation using GNU gettext
+  URL:=http://www.freedesktop.org/wiki/Software/intltool
+  BUILDONLY:=1
+endef
+
+define Package/intltool/description
+  intltool is a set of tools to centralize translation of many different
+  file formats using GNU gettext-compatible PO files.
+endef
+
+$(eval $(call BuildPackage,intltool))
+$(eval $(call HostBuild))
diff --git a/libs/intltool/patches/100-optional-perl-xml-parser.patch b/libs/intltool/patches/100-optional-perl-xml-parser.patch
new file mode 100644 (file)
index 0000000..4615d1d
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/configure.in
++++ b/configure.in
+@@ -25,7 +25,7 @@ AC_MSG_CHECKING([for XML::Parser])
+ if `$PERL -e "require XML::Parser" 2>/dev/null`; then
+    AC_MSG_RESULT([ok])
+ else
+-   AC_MSG_ERROR([XML::Parser perl module is required for intltool])
++   AC_MSG_RESULT([XML::Parser perl module is required for some intltool utilitities])
+ fi
+ AC_OUTPUT([
+--- a/intltool.m4
++++ b/intltool.m4
+@@ -127,7 +127,7 @@ if test "x$2" != "xno-xml"; then
+    if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
+        AC_MSG_RESULT([ok])
+    else
+-       AC_MSG_ERROR([XML::Parser perl module is required for intltool])
++       AC_MSG_RESULT([XML::Parser perl module is required for some intltool utilitities])
+    fi
+ fi
diff --git a/libs/jansson/Makefile b/libs/jansson/Makefile
new file mode 100644 (file)
index 0000000..3d18d42
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2011-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:=jansson
+PKG_VERSION:=2.7
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.digip.org/jansson/releases/
+PKG_MD5SUM:=3a106a465bbb77637550b422f5b262ef
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/jansson
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Jansson library
+  URL:=http://www.digip.org/jansson/
+  MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+endef
+
+define Package/jansson/description
+  Jansson is a C library for encoding, decoding and manipulating JSON data
+endef
+
+TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -lm
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/{lib,include}
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjansson* $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+endef
+
+define Package/jansson/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjansson*so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,jansson))
diff --git a/libs/ldns/Makefile b/libs/ldns/Makefile
new file mode 100644 (file)
index 0000000..8c6b44d
--- /dev/null
@@ -0,0 +1,84 @@
+#
+# Copyright (C) 2011-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:=ldns
+PKG_VERSION:=1.6.17
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.nlnetlabs.nl/downloads/ldns
+PKG_MD5SUM:=a79423bcc4129e6d59b616b1cae11e5e
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libldns/Default
+  URL:=http://www.nlnetlabs.nl/projects/ldns/
+  DEPENDS:=+libopenssl
+endef
+
+define Package/libldns
+  $(call Package/libldns/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=A library to simplify DNS programming
+endef
+
+define Package/libldns/description
+  The goal of ldns is to simplify DNS programming, it supports recent RFCs like
+  the DNSSEC documents, and allows developers to easily create software
+  conforming to current RFCs, and experimental software for current Internet
+  Drafts.
+endef
+
+define Package/drill
+  $(call Package/libldns/Default)
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=IP Addresses and Names
+  TITLE:=DNS(SEC) information tool
+  DEPENDS+= +libldns
+endef
+
+define Package/drill/description
+  drill is a tool to designed to get all sorts of information out of the DNS. It
+  is specificly designed to be used with DNSSEC.
+endef
+
+CONFIGURE_ARGS += \
+       --disable-ecdsa \
+       --disable-gost \
+       --with-drill \
+       --with-ssl="$(STAGING_DIR)/usr"
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/ldns $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libldns.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libldns/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libldns.so.* $(1)/usr/lib/
+endef
+
+define Package/drill/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/drill $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libldns))
+$(eval $(call BuildPackage,drill))
diff --git a/libs/ldns/patches/001-perl5-defined-array.patch b/libs/ldns/patches/001-perl5-defined-array.patch
new file mode 100644 (file)
index 0000000..5e193d9
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/doc/doxyparse.pl
++++ b/doc/doxyparse.pl
+@@ -273,7 +273,7 @@ foreach (keys %manpages) {
+       print MAN $MAN_MIDDLE;
+-      if (defined(@$also)) {
++      if (@$also) {
+               print MAN "\n.SH SEE ALSO\n\\fI";
+               print MAN join "\\fR, \\fI", @$also;
+               print MAN "\\fR.\nAnd ";
diff --git a/libs/libaio/Makefile b/libs/libaio/Makefile
new file mode 100644 (file)
index 0000000..dbcb59f
--- /dev/null
@@ -0,0 +1,63 @@
+#
+# 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:=libaio
+PKG_VERSION:=0.3.110
+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_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
+PKG_LICENSE:=LGPL-2.1
+
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libaio
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Linux kernel AIO interface access library
+  URL:=http://lse.sourceforge.net/io/aio.html
+endef
+
+define Build/Configure
+endef
+
+LIBAIO_CFLAGS:=-nostdlib -nostartfiles -I. $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               ARCH="$(ARCH)" \
+               CC="$(TARGET_CROSS)gcc" \
+               LD="$(TARGET_CROSS)ld" \
+               CFLAGS="$(LIBAIO_CFLAGS)" \
+               all
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               prefix="$(PKG_INSTALL_DIR)/usr" \
+               install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libaio.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaio.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libaio/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaio.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libaio))
diff --git a/libs/libaio/patches/001_arches.patch b/libs/libaio/patches/001_arches.patch
new file mode 100644 (file)
index 0000000..4130af3
--- /dev/null
@@ -0,0 +1,566 @@
+---
+ harness/main.c       |   10 ++
+ src/libaio.h         |    1 
+ src/syscall-m68k.h   |   78 +++++++++++++++++
+ src/syscall-mips.h   |  223 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/syscall-parisc.h |  146 +++++++++++++++++++++++++++++++++
+ src/syscall-sparc.h  |   20 +++-
+ src/syscall.h        |    6 +
+ 7 files changed, 479 insertions(+), 5 deletions(-)
+
+--- /dev/null
++++ b/src/syscall-m68k.h
+@@ -0,0 +1,78 @@
++#define __NR_io_setup         241
++#define __NR_io_destroy               242
++#define __NR_io_getevents     243
++#define __NR_io_submit                244
++#define __NR_io_cancel                245
++
++#define io_syscall1(type,fname,sname,atype,a) \
++type fname(atype a) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++__asm__ __volatile__ ("trap  #0" \
++                    : "+d" (__res) \
++                    : "d" (__a)  ); \
++return (type) __res; \
++}
++
++#define io_syscall2(type,fname,sname,atype,a,btype,b) \
++type fname(atype a,btype b) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++__asm__ __volatile__ ("trap  #0" \
++                    : "+d" (__res) \
++                    : "d" (__a), "d" (__b) \
++                   ); \
++return (type) __res; \
++}
++
++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
++type fname(atype a,btype b,ctype c) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++__asm__ __volatile__ ("trap  #0" \
++                    : "+d" (__res) \
++                    : "d" (__a), "d" (__b), \
++                      "d" (__c) \
++                   ); \
++return (type) __res; \
++}
++
++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
++type fname (atype a, btype b, ctype c, dtype d) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++register long __d __asm__ ("%d4") = (long)(d); \
++__asm__ __volatile__ ("trap  #0" \
++                    : "+d" (__res) \
++                    : "d" (__a), "d" (__b), \
++                      "d" (__c), "d" (__d)  \
++                   ); \
++return (type) __res; \
++}
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname (atype a,btype b,ctype c,dtype d,etype e) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++register long __d __asm__ ("%d4") = (long)(d); \
++register long __e __asm__ ("%d5") = (long)(e); \
++__asm__ __volatile__ ("trap  #0" \
++                    : "+d" (__res) \
++                    : "d" (__a), "d" (__b), \
++                      "d" (__c), "d" (__d), "d" (__e)  \
++                   ); \
++return (type) __res; \
++}
++
+--- a/src/syscall.h
++++ b/src/syscall.h
+@@ -28,6 +28,12 @@
+ #include "syscall-sparc.h"
+ #elif defined(__aarch64__)
+ #include "syscall-arm64.h"
++#elif defined(__m68k__)
++#include "syscall-m68k.h"
++#elif defined(__hppa__)
++#include "syscall-parisc.h"
++#elif defined(__mips__)
++#include "syscall-mips.h"
+ #else
+ #warning "using generic syscall method"
+ #include "syscall-generic.h"
+--- /dev/null
++++ b/src/syscall-mips.h
+@@ -0,0 +1,223 @@
++/*
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License.  See the file "COPYING" in the main directory of this archive
++ * for more details.
++ *
++ * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
++ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
++ *
++ * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
++ * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
++ */
++
++#ifndef _MIPS_SIM_ABI32
++#define _MIPS_SIM_ABI32                       1
++#define _MIPS_SIM_NABI32              2
++#define _MIPS_SIM_ABI64                       3
++#endif
++
++#if _MIPS_SIM == _MIPS_SIM_ABI32
++
++/*
++ * Linux o32 style syscalls are in the range from 4000 to 4999.
++ */
++#define __NR_Linux                    4000
++#define __NR_io_setup                 (__NR_Linux + 241)
++#define __NR_io_destroy                       (__NR_Linux + 242)
++#define __NR_io_getevents             (__NR_Linux + 243)
++#define __NR_io_submit                        (__NR_Linux + 244)
++#define __NR_io_cancel                        (__NR_Linux + 245)
++
++#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
++
++#if _MIPS_SIM == _MIPS_SIM_ABI64
++
++/*
++ * Linux 64-bit syscalls are in the range from 5000 to 5999.
++ */
++#define __NR_Linux                    5000
++#define __NR_io_setup                 (__NR_Linux + 200)
++#define __NR_io_destroy                       (__NR_Linux + 201)
++#define __NR_io_getevents             (__NR_Linux + 202)
++#define __NR_io_submit                        (__NR_Linux + 203)
++#define __NR_io_cancel                        (__NR_Linux + 204)
++#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
++
++#if _MIPS_SIM == _MIPS_SIM_NABI32
++
++/*
++ * Linux N32 syscalls are in the range from 6000 to 6999.
++ */
++#define __NR_Linux                    6000
++#define __NR_io_setup                 (__NR_Linux + 200)
++#define __NR_io_destroy                       (__NR_Linux + 201)
++#define __NR_io_getevents             (__NR_Linux + 202)
++#define __NR_io_submit                        (__NR_Linux + 203)
++#define __NR_io_cancel                        (__NR_Linux + 204)
++#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
++
++#define io_syscall1(type,fname,sname,atype,a) \
++type fname(atype a) \
++{ \
++      register unsigned long __a0 asm("$4") = (unsigned long) a; \
++      register unsigned long __a3 asm("$7"); \
++      unsigned long __v0; \
++      \
++      __asm__ volatile ( \
++      ".set\tnoreorder\n\t" \
++      "li\t$2, %3\t\t\t# " #fname "\n\t" \
++      "syscall\n\t" \
++      "move\t%0, $2\n\t" \
++      ".set\treorder" \
++      : "=&r" (__v0), "=r" (__a3) \
++      : "r" (__a0), "i" (__NR_##sname) \
++      : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++        "memory"); \
++      \
++      if (__a3 == 0) \
++              return (type) __v0; \
++      return (type) -1; \
++}
++
++#define io_syscall2(type,fname,sname,atype,a,btype,b) \
++type fname(atype a, btype b) \
++{ \
++      register unsigned long __a0 asm("$4") = (unsigned long) a; \
++      register unsigned long __a1 asm("$5") = (unsigned long) b; \
++      register unsigned long __a3 asm("$7"); \
++      unsigned long __v0; \
++      \
++      __asm__ volatile ( \
++      ".set\tnoreorder\n\t" \
++      "li\t$2, %4\t\t\t# " #fname "\n\t" \
++      "syscall\n\t" \
++      "move\t%0, $2\n\t" \
++      ".set\treorder" \
++      : "=&r" (__v0), "=r" (__a3) \
++      : "r" (__a0), "r" (__a1), "i" (__NR_##sname) \
++      : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++        "memory"); \
++      \
++      if (__a3 == 0) \
++              return (type) __v0; \
++      return (type) -1; \
++}
++
++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
++type fname(atype a, btype b, ctype c) \
++{ \
++      register unsigned long __a0 asm("$4") = (unsigned long) a; \
++      register unsigned long __a1 asm("$5") = (unsigned long) b; \
++      register unsigned long __a2 asm("$6") = (unsigned long) c; \
++      register unsigned long __a3 asm("$7"); \
++      unsigned long __v0; \
++      \
++      __asm__ volatile ( \
++      ".set\tnoreorder\n\t" \
++      "li\t$2, %5\t\t\t# " #fname "\n\t" \
++      "syscall\n\t" \
++      "move\t%0, $2\n\t" \
++      ".set\treorder" \
++      : "=&r" (__v0), "=r" (__a3) \
++      : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
++      : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++        "memory"); \
++      \
++      if (__a3 == 0) \
++              return (type) __v0; \
++      return (type) -1; \
++}
++
++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
++type fname(atype a, btype b, ctype c, dtype d) \
++{ \
++      register unsigned long __a0 asm("$4") = (unsigned long) a; \
++      register unsigned long __a1 asm("$5") = (unsigned long) b; \
++      register unsigned long __a2 asm("$6") = (unsigned long) c; \
++      register unsigned long __a3 asm("$7") = (unsigned long) d; \
++      unsigned long __v0; \
++      \
++      __asm__ volatile ( \
++      ".set\tnoreorder\n\t" \
++      "li\t$2, %5\t\t\t# " #fname "\n\t" \
++      "syscall\n\t" \
++      "move\t%0, $2\n\t" \
++      ".set\treorder" \
++      : "=&r" (__v0), "+r" (__a3) \
++      : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
++      : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++        "memory"); \
++      \
++      if (__a3 == 0) \
++              return (type) __v0; \
++      return (type) -1; \
++}
++
++#if (_MIPS_SIM == _MIPS_SIM_ABI32)
++
++/*
++ * Using those means your brain needs more than an oil change ;-)
++ */
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname(atype a, btype b, ctype c, dtype d, etype e) \
++{ \
++      register unsigned long __a0 asm("$4") = (unsigned long) a; \
++      register unsigned long __a1 asm("$5") = (unsigned long) b; \
++      register unsigned long __a2 asm("$6") = (unsigned long) c; \
++      register unsigned long __a3 asm("$7") = (unsigned long) d; \
++      unsigned long __v0; \
++      \
++      __asm__ volatile ( \
++      ".set\tnoreorder\n\t" \
++      "lw\t$2, %6\n\t" \
++      "subu\t$29, 32\n\t" \
++      "sw\t$2, 16($29)\n\t" \
++      "li\t$2, %5\t\t\t# " #fname "\n\t" \
++      "syscall\n\t" \
++      "move\t%0, $2\n\t" \
++      "addiu\t$29, 32\n\t" \
++      ".set\treorder" \
++      : "=&r" (__v0), "+r" (__a3) \
++      : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname), \
++        "m" ((unsigned long)e) \
++      : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++        "memory"); \
++      \
++      if (__a3 == 0) \
++              return (type) __v0; \
++      return (type) -1; \
++}
++
++#endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
++
++#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname (atype a,btype b,ctype c,dtype d,etype e) \
++{ \
++      register unsigned long __a0 asm("$4") = (unsigned long) a; \
++      register unsigned long __a1 asm("$5") = (unsigned long) b; \
++      register unsigned long __a2 asm("$6") = (unsigned long) c; \
++      register unsigned long __a3 asm("$7") = (unsigned long) d; \
++      register unsigned long __a4 asm("$8") = (unsigned long) e; \
++      unsigned long __v0; \
++      \
++      __asm__ volatile ( \
++      ".set\tnoreorder\n\t" \
++      "li\t$2, %6\t\t\t# " #fname "\n\t" \
++      "syscall\n\t" \
++      "move\t%0, $2\n\t" \
++      ".set\treorder" \
++      : "=&r" (__v0), "+r" (__a3) \
++      : "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), "i" (__NR_##sname) \
++      : "$2", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++        "memory"); \
++      \
++      if (__a3 == 0) \
++              return (type) __v0; \
++      return (type) -1; \
++}
++
++#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
++
+--- a/src/libaio.h
++++ b/src/libaio.h
+@@ -66,6 +66,7 @@ typedef enum io_iocb_cmd {
+ /* big endian, 64 bits */
+ #elif defined(__powerpc64__) || defined(__s390x__) || \
++      (defined(__hppa__) && defined(__arch64__)) || \
+       (defined(__sparc__) && defined(__arch64__)) || \
+       (defined(__aarch64__) && defined(__AARCH64EB__))
+ #define PADDED(x, y)  unsigned y; x
+--- /dev/null
++++ b/src/syscall-parisc.h
+@@ -0,0 +1,146 @@
++/*
++ * Linux system call numbers.
++ *
++ * Cary Coutant says that we should just use another syscall gateway
++ * page to avoid clashing with the HPUX space, and I think he's right:
++ * it will would keep a branch out of our syscall entry path, at the
++ * very least.  If we decide to change it later, we can ``just'' tweak
++ * the LINUX_GATEWAY_ADDR define at the bottom and make __NR_Linux be
++ * 1024 or something.  Oh, and recompile libc. =)
++ *
++ * 64-bit HPUX binaries get the syscall gateway address passed in a register
++ * from the kernel at startup, which seems a sane strategy.
++ */
++
++#define __NR_Linux                0
++#define __NR_io_setup           (__NR_Linux + 215)
++#define __NR_io_destroy         (__NR_Linux + 216)
++#define __NR_io_getevents       (__NR_Linux + 217)
++#define __NR_io_submit          (__NR_Linux + 218)
++#define __NR_io_cancel          (__NR_Linux + 219)
++
++#define SYS_ify(syscall_name)   __NR_##syscall_name
++
++/* Assume all syscalls are done from PIC code just to be
++ * safe. The worst case scenario is that you lose a register
++ * and save/restore r19 across the syscall. */
++#define PIC
++
++/* Definition taken from glibc 2.3.3
++ * sysdeps/unix/sysv/linux/hppa/sysdep.h
++ */
++
++#ifdef PIC
++/* WARNING: CANNOT BE USED IN A NOP! */
++# define K_STW_ASM_PIC        "       copy %%r19, %%r4\n"
++# define K_LDW_ASM_PIC        "       copy %%r4, %%r19\n"
++# define K_USING_GR4  "%r4",
++#else
++# define K_STW_ASM_PIC        " \n"
++# define K_LDW_ASM_PIC        " \n"
++# define K_USING_GR4
++#endif
++
++/* GCC has to be warned that a syscall may clobber all the ABI
++   registers listed as "caller-saves", see page 8, Table 2
++   in section 2.2.6 of the PA-RISC RUN-TIME architecture
++   document. However! r28 is the result and will conflict with
++   the clobber list so it is left out. Also the input arguments
++   registers r20 -> r26 will conflict with the list so they
++   are treated specially. Although r19 is clobbered by the syscall
++   we cannot say this because it would violate ABI, thus we say
++   r4 is clobbered and use that register to save/restore r19
++   across the syscall. */
++
++#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \
++                       "%r20", "%r29", "%r31"
++
++#undef K_INLINE_SYSCALL
++#define K_INLINE_SYSCALL(name, nr, args...)   ({                      \
++      long __sys_res;                                                 \
++      {                                                               \
++              register unsigned long __res __asm__("r28");            \
++              K_LOAD_ARGS_##nr(args)                                  \
++              /* FIXME: HACK stw/ldw r19 around syscall */            \
++              __asm__ volatile(                                       \
++                      K_STW_ASM_PIC                                   \
++                      "       ble  0x100(%%sr2, %%r0)\n"              \
++                      "       ldi %1, %%r20\n"                        \
++                      K_LDW_ASM_PIC                                   \
++                      : "=r" (__res)                                  \
++                      : "i" (SYS_ify(name)) K_ASM_ARGS_##nr           \
++                      : "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr   \
++              );                                                      \
++              __sys_res = (long)__res;                                \
++      }                                                               \
++      __sys_res;                                                      \
++})
++
++#define K_LOAD_ARGS_0()
++#define K_LOAD_ARGS_1(r26)                                    \
++      register unsigned long __r26 __asm__("r26") = (unsigned long)(r26);   \
++      K_LOAD_ARGS_0()
++#define K_LOAD_ARGS_2(r26,r25)                                        \
++      register unsigned long __r25 __asm__("r25") = (unsigned long)(r25);   \
++      K_LOAD_ARGS_1(r26)
++#define K_LOAD_ARGS_3(r26,r25,r24)                            \
++      register unsigned long __r24 __asm__("r24") = (unsigned long)(r24);   \
++      K_LOAD_ARGS_2(r26,r25)
++#define K_LOAD_ARGS_4(r26,r25,r24,r23)                                \
++      register unsigned long __r23 __asm__("r23") = (unsigned long)(r23);   \
++      K_LOAD_ARGS_3(r26,r25,r24)
++#define K_LOAD_ARGS_5(r26,r25,r24,r23,r22)                    \
++      register unsigned long __r22 __asm__("r22") = (unsigned long)(r22);   \
++      K_LOAD_ARGS_4(r26,r25,r24,r23)
++#define K_LOAD_ARGS_6(r26,r25,r24,r23,r22,r21)                        \
++      register unsigned long __r21 __asm__("r21") = (unsigned long)(r21);   \
++      K_LOAD_ARGS_5(r26,r25,r24,r23,r22)
++
++/* Even with zero args we use r20 for the syscall number */
++#define K_ASM_ARGS_0
++#define K_ASM_ARGS_1 K_ASM_ARGS_0, "r" (__r26)
++#define K_ASM_ARGS_2 K_ASM_ARGS_1, "r" (__r25)
++#define K_ASM_ARGS_3 K_ASM_ARGS_2, "r" (__r24)
++#define K_ASM_ARGS_4 K_ASM_ARGS_3, "r" (__r23)
++#define K_ASM_ARGS_5 K_ASM_ARGS_4, "r" (__r22)
++#define K_ASM_ARGS_6 K_ASM_ARGS_5, "r" (__r21)
++
++/* The registers not listed as inputs but clobbered */
++#define K_CLOB_ARGS_6
++#define K_CLOB_ARGS_5 K_CLOB_ARGS_6, "%r21"
++#define K_CLOB_ARGS_4 K_CLOB_ARGS_5, "%r22"
++#define K_CLOB_ARGS_3 K_CLOB_ARGS_4, "%r23"
++#define K_CLOB_ARGS_2 K_CLOB_ARGS_3, "%r24"
++#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25"
++#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26"
++
++#define io_syscall1(type,fname,sname,type1,arg1)                      \
++type fname(type1 arg1)                                                        \
++{                                                                     \
++    return K_INLINE_SYSCALL(sname, 1, arg1);                          \
++}
++
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2)           \
++type fname(type1 arg1, type2 arg2)                                    \
++{                                                                     \
++    return K_INLINE_SYSCALL(sname, 2, arg1, arg2);                    \
++}
++
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3)        \
++type fname(type1 arg1, type2 arg2, type3 arg3)                                \
++{                                                                     \
++    return K_INLINE_SYSCALL(sname, 3, arg1, arg2, arg3);              \
++}
++
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4)            \
++{                                                                     \
++    return K_INLINE_SYSCALL(sname, 4, arg1, arg2, arg3, arg4);                \
++}
++
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)        \
++{                                                                     \
++    return K_INLINE_SYSCALL(sname, 5, arg1, arg2, arg3, arg4, arg5);  \
++}
++
+--- a/harness/main.c
++++ b/harness/main.c
+@@ -12,7 +12,17 @@
+ #include <libaio.h>
+ #if __LP64__ == 0
++#if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
+ #define KERNEL_RW_POINTER     ((void *)0xc0010000)
++#elif defined(__arm__) || defined(__m68k__) || defined(__s390__)
++#define KERNEL_RW_POINTER     ((void *)0x00010000)
++#elif defined(__hppa__)
++#define KERNEL_RW_POINTER     ((void *)0x10100000)
++#elif defined(__sparc__)
++#define KERNEL_RW_POINTER     ((void *)0xf0010000)
++#else
++#error Unknown kernel memory address.
++#endif
+ #else
+ //#warning Not really sure where kernel memory is.  Guessing.
+ #define KERNEL_RW_POINTER     ((void *)0xffffffff81000000)
+--- a/src/syscall-sparc.h
++++ b/src/syscall-sparc.h
+@@ -20,7 +20,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
+                       : "=r" (__res), "=&r" (__o0) \
+                       : "1" (__o0), "r" (__g1) \
+                       : "cc"); \
+-return (type) __res; \
++if (__res < -255 || __res >= 0) \
++      return (type) __res; \
++return -1; \
+ }
+ #define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
+@@ -38,7 +40,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
+                       : "=r" (__res), "=&r" (__o0) \
+                       : "1" (__o0), "r" (__o1), "r" (__g1) \
+                       : "cc"); \
+-return (type) __res; \
++if (__res < -255 || __res >= 0) \
++      return (type) __res; \
++return -1; \
+ }
+ #define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
+@@ -57,7 +61,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
+                       : "=r" (__res), "=&r" (__o0) \
+                       : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__g1) \
+                       : "cc"); \
+-return (type) __res; \
++if (__res < -255 || __res >= 0) \
++      return (type) __res; \
++return -1; \
+ }
+ #define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
+@@ -77,7 +83,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
+                       : "=r" (__res), "=&r" (__o0) \
+                       : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__g1) \
+                       : "cc"); \
+-return (type) __res; \
++if (__res < -255 || __res >= 0) \
++      return (type) __res; \
++return -1; \
+ }
+ #define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
+@@ -99,5 +107,7 @@ __asm__ __volatile__ ("t 0x10\n\t" \
+                       : "=r" (__res), "=&r" (__o0) \
+                       : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__o4), "r" (__g1) \
+                       : "cc"); \
+-return (type) __res; \
++if (__res < -255 || __res >= 0) \
++      return (type) __res; \
++return -1; \
+ }
diff --git a/libs/libaio/patches/002_arches_sh.patch b/libs/libaio/patches/002_arches_sh.patch
new file mode 100644 (file)
index 0000000..ddf9a11
--- /dev/null
@@ -0,0 +1,139 @@
+From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Subject: Add SH supprt
+
+The test-suite logs can be found at:
+
+  <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=535288>
+
+
+---
+ harness/main.c   |    2 -
+ src/libaio.h     |    4 ++
+ src/syscall-sh.h |   78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/syscall.h    |    2 +
+ 4 files changed, 84 insertions(+), 2 deletions(-)
+
+
+--- a/harness/main.c
++++ b/harness/main.c
+@@ -14,7 +14,7 @@
+ #if __LP64__ == 0
+ #if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
+ #define KERNEL_RW_POINTER     ((void *)0xc0010000)
+-#elif defined(__arm__) || defined(__m68k__) || defined(__s390__)
++#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__)
+ #define KERNEL_RW_POINTER     ((void *)0x00010000)
+ #elif defined(__hppa__)
+ #define KERNEL_RW_POINTER     ((void *)0x10100000)
+--- a/src/libaio.h
++++ b/src/libaio.h
+@@ -51,7 +51,8 @@ typedef enum io_iocb_cmd {
+ /* little endian, 32 bits */
+ #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
+-    defined(__sh__) || defined(__bfin__) || defined(__MIPSEL__) || \
++    (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
++    defined(__bfin__) || defined(__MIPSEL__) || \
+     defined(__cris__)
+ #define PADDED(x, y)  x; unsigned y
+ #define PADDEDptr(x, y)       x; unsigned y
+@@ -76,6 +77,7 @@ typedef enum io_iocb_cmd {
+ /* big endian, 32 bits */
+ #elif defined(__PPC__) || defined(__s390__) || \
+       (defined(__arm__) && defined(__ARMEB__)) || \
++      (defined(__sh__) && defined (__BIG_ENDIAN__)) || \
+       defined(__sparc__) || defined(__MIPSEB__) || defined(__m68k__) || \
+       defined(__hppa__) || defined(__frv__) || defined(__avr32__)
+ #define PADDED(x, y)  unsigned y; x
+--- /dev/null
++++ b/src/syscall-sh.h
+@@ -0,0 +1,78 @@
++/* Copy from ./arch/sh/include/asm/unistd_32.h */
++#define __NR_io_setup       245
++#define __NR_io_destroy     246
++#define __NR_io_getevents   247
++#define __NR_io_submit      248
++#define __NR_io_cancel      249
++
++#define io_syscall1(type,fname,sname,type1,arg1) \
++type fname(type1 arg1) \
++{ \
++register long __sc0 __asm__ ("r3") = __NR_##sname; \
++register long __sc4 __asm__ ("r4") = (long) arg1; \
++__asm__ __volatile__ ("trapa    #0x11" \
++      : "=z" (__sc0) \
++      : "0" (__sc0), "r" (__sc4) \
++      : "memory"); \
++      return (type) __sc0;\
++}
++
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
++type fname(type1 arg1,type2 arg2) \
++{ \
++register long __sc0 __asm__ ("r3") = __NR_##sname; \
++register long __sc4 __asm__ ("r4") = (long) arg1; \
++register long __sc5 __asm__ ("r5") = (long) arg2; \
++      __asm__ __volatile__ ("trapa    #0x12" \
++      : "=z" (__sc0) \
++      : "0" (__sc0), "r" (__sc4), "r" (__sc5) \
++      : "memory"); \
++      return (type) __sc0;\
++}
++
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
++type fname(type1 arg1,type2 arg2,type3 arg3) \
++{ \
++register long __sc0 __asm__ ("r3") = __NR_##sname; \
++register long __sc4 __asm__ ("r4") = (long) arg1; \
++register long __sc5 __asm__ ("r5") = (long) arg2; \
++register long __sc6 __asm__ ("r6") = (long) arg3; \
++      __asm__ __volatile__ ("trapa    #0x13" \
++      : "=z" (__sc0) \
++      : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) \
++      : "memory"); \
++      return (type) __sc0;\
++}
++
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
++{ \
++register long __sc0 __asm__ ("r3") = __NR_##sname; \
++register long __sc4 __asm__ ("r4") = (long) arg1; \
++register long __sc5 __asm__ ("r5") = (long) arg2; \
++register long __sc6 __asm__ ("r6") = (long) arg3; \
++register long __sc7 __asm__ ("r7") = (long) arg4; \
++__asm__ __volatile__ ("trapa    #0x14" \
++      : "=z" (__sc0) \
++      : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6),  \
++      "r" (__sc7) \
++      : "memory" ); \
++      return (type) __sc0;\
++}
++
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
++{ \
++register long __sc3 __asm__ ("r3") = __NR_##sname; \
++register long __sc4 __asm__ ("r4") = (long) arg1; \
++register long __sc5 __asm__ ("r5") = (long) arg2; \
++register long __sc6 __asm__ ("r6") = (long) arg3; \
++register long __sc7 __asm__ ("r7") = (long) arg4; \
++register long __sc0 __asm__ ("r0") = (long) arg5; \
++__asm__ __volatile__ ("trapa    #0x15" \
++      : "=z" (__sc0) \
++      : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7),  \
++      "r" (__sc3) \
++      : "memory" ); \
++      return (type) __sc0;\
++}
+--- a/src/syscall.h
++++ b/src/syscall.h
+@@ -34,6 +34,8 @@
+ #include "syscall-parisc.h"
+ #elif defined(__mips__)
+ #include "syscall-mips.h"
++#elif defined(__sh__)
++#include "syscall-sh.h"
+ #else
+ #warning "using generic syscall method"
+ #include "syscall-generic.h"
diff --git a/libs/libaio/patches/003_arches_sparc64.patch b/libs/libaio/patches/003_arches_sparc64.patch
new file mode 100644 (file)
index 0000000..c685f5e
--- /dev/null
@@ -0,0 +1,117 @@
+---
+ src/syscall-sparc64.h |   98 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/syscall.h         |    2 +
+ 2 files changed, 100 insertions(+)
+
+--- a/src/syscall.h
++++ b/src/syscall.h
+@@ -24,6 +24,8 @@
+ #include "syscall-alpha.h"
+ #elif defined(__arm__)
+ #include "syscall-arm.h"
++#elif defined(__sparc__) && defined(__arch64__)
++#include "syscall-sparc64.h"
+ #elif defined(__sparc__)
+ #include "syscall-sparc.h"
+ #elif defined(__aarch64__)
+--- /dev/null
++++ b/src/syscall-sparc64.h
+@@ -0,0 +1,98 @@
++#define __NR_io_setup         268
++#define __NR_io_destroy               269
++#define __NR_io_submit                270
++#define __NR_io_cancel                271
++#define __NR_io_getevents     272
++
++#define io_syscall1(type,fname,sname,type1,arg1)                        \
++type fname(type1 arg1)                                                          \
++{                                                                       \
++      unsigned long __res;                                              \
++      register unsigned long __g1 __asm__("g1") = __NR_##sname;         \
++      register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
++      __asm__ __volatile__("t         0x6d\n\t"                         \
++                           "sub       %%g0, %%o0, %0\n\t"               \
++                           "movcc     %%xcc, %%o0, %0\n"                \
++                           "1:"                                         \
++                           : "=r" (__res), "=&r" (__o0)                 \
++                           : "1" (__o0), "r" (__g1)                     \
++                           : "cc");                                     \
++      return (type) __res;                                              \
++}
++
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2)             \
++type fname(type1 arg1, type2 arg2)                                      \
++{                                                                       \
++      unsigned long __res;                                              \
++      register unsigned long __g1 __asm__("g1") = __NR_##sname;         \
++      register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
++      register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
++      __asm__ __volatile__("t         0x6d\n\t"                         \
++                           "sub       %%g0, %%o0, %0\n\t"               \
++                           "movcc     %%xcc, %%o0, %0\n"                \
++                           "1:"                                         \
++                           : "=r" (__res), "=&r" (__o0)                 \
++                           : "1" (__o0), "r" (__o1), "r" (__g1)         \
++                           : "cc");                                     \
++      return (type) __res;                                              \
++}
++
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3)          \
++type fname(type1 arg1, type2 arg2, type3 arg3)                                  \
++{                                                                       \
++      unsigned long __res;                                              \
++      register unsigned long __g1 __asm__("g1") = __NR_##sname;         \
++      register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
++      register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
++      register unsigned long __o2 __asm__("o2") = (unsigned long) arg3; \
++      __asm__ __volatile__("t         0x6d\n\t"                         \
++                           "sub       %%g0, %%o0, %0\n\t"               \
++                           "movcc     %%xcc, %%o0, %0\n"                \
++                           "1:"                                         \
++                           : "=r" (__res), "=&r" (__o0)                 \
++                           : "1" (__o0), "r" (__o1), "r" (__o2),        \
++                             "r" (__g1)                                 \
++                           : "cc");                                     \
++      return (type) __res;                                              \
++}
++
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4)              \
++{                                                                       \
++      unsigned long __res;                                              \
++      register unsigned long __g1 __asm__("g1") = __NR_##sname;         \
++      register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
++      register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
++      register unsigned long __o2 __asm__("o2") = (unsigned long) arg3; \
++      register unsigned long __o3 __asm__("o3") = (unsigned long) arg4; \
++      __asm__ __volatile__("t         0x6d\n\t"                         \
++                           "sub       %%g0, %%o0, %0\n\t"               \
++                           "movcc     %%xcc, %%o0, %0\n"                \
++                           "1:"                                         \
++                           : "=r" (__res), "=&r" (__o0)                 \
++                           : "1" (__o0), "r" (__o1), "r" (__o2),        \
++                             "r" (__o3), "r" (__g1)                     \
++                           : "cc");                                     \
++      return (type) __res;                                              \
++}
++
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)          \
++{                                                                       \
++      unsigned long __res;                                              \
++      register unsigned long __g1 __asm__("g1") = __NR_##sname;         \
++      register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
++      register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
++      register unsigned long __o2 __asm__("o2") = (unsigned long) arg3; \
++      register unsigned long __o3 __asm__("o3") = (unsigned long) arg4; \
++      register unsigned long __o4 __asm__("o4") = (unsigned long) arg5; \
++      __asm__ __volatile__("t         0x6d\n\t"                         \
++                           "sub       %%g0, %%o0, %0\n\t"               \
++                           "movcc     %%xcc, %%o0, %0\n"                \
++                           "1:"                                         \
++                           : "=r" (__res), "=&r" (__o0)                 \
++                           : "1" (__o0), "r" (__o1), "r" (__o2),        \
++                             "r" (__o3), "r" (__o4), "r" (__g1)         \
++                           : "cc");                                     \
++      return (type) __res;                                              \
++}
diff --git a/libs/libaio/patches/004_arches_x32.patch b/libs/libaio/patches/004_arches_x32.patch
new file mode 100644 (file)
index 0000000..8d315f2
--- /dev/null
@@ -0,0 +1,65 @@
+Index: libaio-0.3.109/src/syscall-x86_64.h
+===================================================================
+--- libaio-0.3.109.orig/src/syscall-x86_64.h   2009-10-09 11:17:02.000000000 -0700
++++ libaio-0.3.109/src/syscall-x86_64.h        2013-03-03 07:15:13.000000000 -0800
+@@ -1,8 +1,18 @@
++#ifndef __NR_io_setup
+ #define __NR_io_setup         206
++#endif
++#ifndef __NR_io_destroy
+ #define __NR_io_destroy               207
++#endif
++#ifndef __NR_io_getevents
+ #define __NR_io_getevents     208
++#endif
++#ifndef __NR_io_submit
+ #define __NR_io_submit                209
++#endif
++#ifndef __NR_io_cancel
+ #define __NR_io_cancel                210
++#endif
+ #define __syscall_clobber "r11","rcx","memory" 
+ #define __syscall "syscall"
+@@ -42,10 +52,11 @@
+ type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4)           \
+ {                                                                     \
+ long __res;                                                           \
+-__asm__ volatile ("movq %5,%%r10 ;" __syscall                         \
++register long __a4 asm ("r10") = (long) arg4;                           \
++__asm__ volatile (__syscall                                           \
+       : "=a" (__res)                                                  \
+       : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)),     \
+-        "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \
++        "d" ((long)(arg3)),"r" (__a4)); \
+ return __res;                                                         \
+ } 
+@@ -54,10 +65,11 @@
+ type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5)   \
+ {                                                                     \
+ long __res;                                                           \
+-__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall         \
++register long __a4 asm ("r10") = (long) arg4;                         \
++register long __a5 asm ("r8") = (long) arg5;                            \
++__asm__ volatile (__syscall                                           \
+       : "=a" (__res)                                                  \
+       : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)),     \
+-        "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) :    \
+-      __syscall_clobber,"r8","r10" );                                 \
++        "d" ((long)(arg3)),"r" (__a4),"r" (__a5)); \
+ return __res;                                                         \
+ }
+Index: libaio-0.3.109/harness/main.c
+===================================================================
+--- libaio-0.3.109.orig/harness/main.c 2013-03-03 06:58:51.000000000 -0800
++++ libaio-0.3.109/harness/main.c      2013-03-03 07:23:40.000000000 -0800
+@@ -14,7 +14,7 @@
+ #if __LP64__ == 0
+ #if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
+ #define KERNEL_RW_POINTER     ((void *)0xc0010000)
+-#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__)
++#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__) || defined(__x86_64__)
+ #define KERNEL_RW_POINTER     ((void *)0x00010000)
+ #elif defined(__hppa__)
+ #define KERNEL_RW_POINTER     ((void *)0x10100000)
diff --git a/libs/libaio/patches/005_arches_mips.patch b/libs/libaio/patches/005_arches_mips.patch
new file mode 100644 (file)
index 0000000..1bd0971
--- /dev/null
@@ -0,0 +1,63 @@
+Description: Fix mips/mipsel syscall wrappers to return correct error values.
+Author: Jurica Stanojkovic <Jurica.Stanojkovic@rt-rk.com>
+Forwarded: no
+Last-Update: 2012-09-24
+
+
+diff -upNr a/src/syscall-mips.h b/src/syscall-mips.h
+--- a/src/syscall-mips.h       2012-09-13 11:46:35.652286733 +0200
++++ b/src/syscall-mips.h       2012-09-13 16:09:17.964407909 +0200
+@@ -76,7 +76,7 @@ type fname(atype a) \
+       \
+       if (__a3 == 0) \
+               return (type) __v0; \
+-      return (type) -1; \
++      return (type) 0 - __v0; \
+ }
+ #define io_syscall2(type,fname,sname,atype,a,btype,b) \
+@@ -100,7 +100,7 @@ type fname(atype a, btype b) \
+       \
+       if (__a3 == 0) \
+               return (type) __v0; \
+-      return (type) -1; \
++      return (type) 0 - __v0; \
+ }
+ #define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
+@@ -125,7 +125,7 @@ type fname(atype a, btype b, ctype c) \
+       \
+       if (__a3 == 0) \
+               return (type) __v0; \
+-      return (type) -1; \
++      return (type) 0 - __v0; \
+ }
+ #define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
+@@ -150,7 +150,7 @@ type fname(atype a, btype b, ctype c, dt
+       \
+       if (__a3 == 0) \
+               return (type) __v0; \
+-      return (type) -1; \
++      return (type) 0 - __v0; \
+ }
+ #if (_MIPS_SIM == _MIPS_SIM_ABI32)
+@@ -186,7 +186,7 @@ type fname(atype a, btype b, ctype c, dt
+       \
+       if (__a3 == 0) \
+               return (type) __v0; \
+-      return (type) -1; \
++      return (type) 0 - __v0; \
+ }
+ #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
+@@ -216,7 +216,7 @@ type fname (atype a,btype b,ctype c,dtyp
+       \
+       if (__a3 == 0) \
+               return (type) __v0; \
+-      return (type) -1; \
++      return (type) 0 - __v0; \
+ }
+ #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
diff --git a/libs/libaio/patches/006_arches_mips_fix_padding.patch b/libs/libaio/patches/006_arches_mips_fix_padding.patch
new file mode 100644 (file)
index 0000000..06bd00f
--- /dev/null
@@ -0,0 +1,37 @@
+Description: Fix structure padding for mips64
+Author: Guillem Jover <guillem@debian.org>
+Forwarded: no
+Last-Update: 2014-07-23
+
+---
+ src/libaio.h |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/src/libaio.h
++++ b/src/libaio.h
+@@ -52,7 +52,8 @@ typedef enum io_iocb_cmd {
+ /* little endian, 32 bits */
+ #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
+     (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
+-    defined(__bfin__) || defined(__MIPSEL__) || \
++    defined(__bfin__) || \
++    (defined(__MIPSEL__) && !defined(__mips64)) || \
+     defined(__cris__)
+ #define PADDED(x, y)  x; unsigned y
+ #define PADDEDptr(x, y)       x; unsigned y
+@@ -60,6 +61,7 @@ typedef enum io_iocb_cmd {
+ /* little endian, 64 bits */
+ #elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__) || \
++      (defined(__mips64) && defined(__MIPSEL__)) || \
+       (defined(__aarch64__) && defined(__AARCH64EL__))
+ #define PADDED(x, y)  x, y
+ #define PADDEDptr(x, y)       x
+@@ -69,6 +71,7 @@ typedef enum io_iocb_cmd {
+ #elif defined(__powerpc64__) || defined(__s390x__) || \
+       (defined(__hppa__) && defined(__arch64__)) || \
+       (defined(__sparc__) && defined(__arch64__)) || \
++      (defined(__mips64) && defined(__MIPSEB__)) || \
+       (defined(__aarch64__) && defined(__AARCH64EB__))
+ #define PADDED(x, y)  unsigned y; x
+ #define PADDEDptr(x,y)        x
diff --git a/libs/libantlr3c/Makefile b/libs/libantlr3c/Makefile
new file mode 100644 (file)
index 0000000..bd1e51e
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# 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:=libantlr3c
+PKG_VERSION:=3.2
+PKG_RELEASE:=1
+PKG_MD5SUM:=674646e1d1bf5c6015435480cead725a
+
+PKG_SOURCE_URL:=http://www.antlr3.org/download/C
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libantlr3c
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=libantlr3c
+  URL:=http://www.antlr3.org/
+endef
+
+define Package/libantlr3c/description
+  ANother Tool for Language Recognition, is a language tool that provides a framework for constructing recognizers,
+  interpreters, compilers, and translators from grammatical descriptions containing actions in a variety of target languages.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libantlr3c.{a,so} $(1)/usr/lib/
+endef
+
+define Package/libantlr3c/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libantlr3c.so  $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libantlr3c))
diff --git a/libs/libao/Makefile b/libs/libao/Makefile
new file mode 100644 (file)
index 0000000..690af47
--- /dev/null
@@ -0,0 +1,67 @@
+#
+# 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:=libao
+PKG_VERSION:=1.2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://downloads.xiph.org/releases/ao/
+PKG_MD5SUM:=9f5dd20d7e95fd0dd72df5353829f097
+
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libao
+  SECTION:=libs
+  DEPENDS:=+alsa-lib
+  CATEGORY:=Libraries
+  TITLE:=A cross platform audio library
+  URL:=http://www.xiph.org/ao/
+endef
+
+define Package/libao/description
+       Libao is a cross-platform audio library that allows programs to
+       output audio using a simple API on a wide variety of platforms.
+endef
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --disable-esd \
+       --disable-arts \
+       --disable-nas \
+       --disable-pulse
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/ao $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libao.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/ao.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libao/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libao.so.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/ao/plugins-4
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ao/plugins-4/lib*.so $(1)/usr/lib/ao/plugins-4/
+endef
+
+$(eval $(call BuildPackage,libao))
diff --git a/libs/libarchive/Makefile b/libs/libarchive/Makefile
new file mode 100644 (file)
index 0000000..b1a69e2
--- /dev/null
@@ -0,0 +1,97 @@
+#
+# 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:=libarchive
+PKG_VERSION:=3.2.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.libarchive.org/downloads
+PKG_MD5SUM:=691c194ee132d1f0f7a42541f091db811bc2e56f7107e9121be2bc8c04f1060f
+PKG_MAINTAINER:=Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
+PKG_LICENSE:=BSD-2-Clause
+
+PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/$(PKG_NAME)/Default
+       SECTION:=libs
+       CATEGORY:=Libraries
+       DEPENDS:=+zlib +liblzma +libbz2 +libexpat
+       TITLE:=Multi-format archive and compression library
+       URL:=http://www.libarchive.org/
+endef
+
+define Package/$(PKG_NAME)
+       $(call Package/$(PKG_NAME)/Default)
+       DEPENDS += +libopenssl
+endef
+
+define Package/$(PKG_NAME)-noopenssl
+       $(call Package/$(PKG_NAME)/Default)
+       TITLE += (without OpenSSL dependency)
+       VARIANT:=noopenssl
+endef
+
+define Package/bsdtar
+       SECTION:=utils
+       CATEGORY:=Utilities
+       SUBMENU:=Compression
+       DEPENDS:=+libarchive-noopenssl
+       TITLE:=BSD variant that supports various file compression formats
+       URL:=http://www.libarchive.org/
+endef
+
+define Package/bsdtar/description
+       Reads a variety of formats including tar, pax, zip, xar, lha, ar,
+       cab, mtree, rar, warc, 7z and ISO images. Writes tar, pax, zip,
+       xar, ar, ISO, mtree and shar archives. Automatically handles
+       archives compressed with gzip, bzip2, lzip, xz, lzma or compress.
+endef
+
+CONFIGURE_ARGS += \
+       --disable-bsdcpio \
+       --enable-bsdtar=shared \
+       --disable-acl \
+       --disable-xattr \
+       --without-lzo2 \
+       --without-nettle \
+       --without-xml2 \
+       --without-lz4 \
+
+ifeq ($(BUILD_VARIANT),noopenssl)
+       CONFIGURE_ARGS += --without-openssl
+else
+       CONFIGURE_ARGS += --with-openssl
+endif
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+define Package/libarchive/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
+endef
+
+define Package/bsdtar/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bsdtar $(1)/usr/bin
+endef
+
+Package/$(PKG_NAME)-noopenssl/install = $(Package/$(PKG_NAME)/install)
+
+$(eval $(call BuildPackage,libarchive))
+$(eval $(call BuildPackage,libarchive-noopenssl))
+$(eval $(call BuildPackage,bsdtar))
diff --git a/libs/libartnet/Makefile b/libs/libartnet/Makefile
new file mode 100644 (file)
index 0000000..c5b003e
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# Copyright (C) 2010-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libartnet
+PKG_VERSION:=1.1.2
+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_MAINTAINER:=Martijn Zilverschoon <martijn@friedzombie.com>
+
+PKG_LICENSE:=GPL-2.1
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libartnet
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=Libartnet is an implementation of the ArtNet protocol.
+       URL:=http://www.openlighting.org/libartnet-main/
+endef
+
+define Package/libartnet/description
+       Libartnet is an implementation of the ArtNet protocol. ArtNet allows the
+       transmission of DMX and related data over IP networks.
+endef
+
+define Build/Configure
+       $(call Build/Configure/Default)
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+       DESTDIR="$(PKG_INSTALL_DIR)" \
+       all install
+endef
+
+define Build/InstallDev
+       mkdir -p $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/artnet $(1)/usr/include/
+       mkdir -p $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libartnet.{so,so.1,so.1.0.0} $(1)/usr/lib/
+endef
+
+
+define Package/libartnet/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libartnet.{so,so.1,so.1.0.0} $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libartnet))
diff --git a/libs/libartnet/patches/001-bswap_16.patch b/libs/libartnet/patches/001-bswap_16.patch
new file mode 100644 (file)
index 0000000..9c9be5f
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/artnet/private.h
++++ b/artnet/private.h
+@@ -100,7 +100,9 @@ extern uint16_t HIGH_BYTE;
+ #endif
+ // byte ordering macros
++#ifndef bswap_16
+ #define bswap_16(x)  ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
++#endif
+ // htols : convert short from host to little endian order
+ #ifdef WIN32
diff --git a/libs/libaudiofile/Makefile b/libs/libaudiofile/Makefile
new file mode 100644 (file)
index 0000000..b353e64
--- /dev/null
@@ -0,0 +1,71 @@
+#
+# 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:=audiofile
+PKG_VERSION:=0.3.6
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNOME/$(PKG_NAME)/0.3
+PKG_MD5SUM:=ea2449ad3f201ec590d811db9da6d02ffc5e87a677d06b92ab15363d8cb59782
+
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libaudiofile
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Audio File library
+  URL:=http://audiofile.68k.org/
+  DEPENDS:=+libflac +libstdcpp
+endef
+
+define Package/libaudiofile/description
+ The audiofile library allows the processing of audio data to and from audio
+ files of many common formats (currently AIFF, AIFF-C, WAVE, NeXT/Sun, BICS,
+ FLAC, ALAC, and raw data).
+endef
+
+CONFIGURE_ARGS+= \
+       --enable-shared \
+       --enable-static \
+       --disable-examples \
+       --with-build-cc="$(HOSTCC)"
+
+TARGET_CFLAGS+= $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/{af_vfs,audiofile,aupvlist}.h \
+               $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libaudiofile.{la,a,so*} \
+               $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/audiofile.pc \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libaudiofile/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libaudiofile.so.* \
+               $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libaudiofile))
diff --git a/libs/libavl/Makefile b/libs/libavl/Makefile
new file mode 100644 (file)
index 0000000..0ff2385
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# 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:=libavl
+PKG_VERSION:=0.3.5
+PKG_RELEASE:=1
+PKG_MD5SUM:=882c68ea7f71876ca110f3b84d7ab12d
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
+PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/liba/libavl
+PKG_BUILD_DIR:=$(BUILD_DIR)/avl-$(PKG_VERSION)
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
+PKG_LICENSE:=LGPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libavl
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=AVLTree (this is not GNU libavl)
+  URL:=https://packages.debian.org/wheezy/libavl1
+endef
+
+define Package/libavl/description
+  AVLTree is a small implementation of AVL trees for the C programming language.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/avl.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavl.so* $(1)/usr/lib/
+endef
+
+define Package/libavl/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavl.so.*  $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libavl))
diff --git a/libs/libavl/patches/010-update_GNUmakefile.patch b/libs/libavl/patches/010-update_GNUmakefile.patch
new file mode 100644 (file)
index 0000000..3013949
--- /dev/null
@@ -0,0 +1,45 @@
+--- a/GNUmakefile      2002-11-15 19:57:48.000000000 +0100
++++ a/GNUmakefile      2014-10-02 16:03:02.864803002 +0200
+@@ -6,7 +6,7 @@
+ LDCONFIG ?= /sbin/ldconfig
+ # Some suggestions: (-mcpu= generates i386 compatible code)
+-CFLAGS ?= -O2 -fomit-frame-pointer -pipe -mcpu=i686 -w
++CFLAGS ?= -O2 -pipe -Wall -Werror
+ #CFLAGS = -O2 -fomit-frame-pointer -pipe -march=i586 -Wall -g
+ #CFLAGS = -O6 -fomit-frame-pointer -pipe -march=i586 -Wall -ansi -pedantic
+ #CFLAGS = -O6 -fomit-frame-pointer -pipe -march=i686 -Wall -ansi -pedantic
+@@ -15,10 +15,9 @@
+ #CFLAGS = -g -pg -a -pipe -march=i686 -Wall
+ #LDFLAGS = -s
+-prefix ?= /usr/local
++prefix ?= /usr
+ libdir ?= $(prefix)/lib
+ includedir ?= $(prefix)/include
+-includedir ?= /usr/include
+ PROGRAMS = avlsort setdiff
+ LIBRARY = libavl.so.1.5
+@@ -34,16 +33,17 @@
+       $(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
+ $(LIBRARY): avl.o
+-      $(CC) -nostdlib -shared -Wl,-soname,libavl.so.1 $^ -o $@ -lc
++      $(CC) -shared -Wl,-soname,libavl.so.1 $^ -o $@ -lc
+ clean:
+       $(RM) *.o $(PROGRAMS) libavl.*
+ install: all
+       $(INSTALL) -d $(DESTDIR)$(libdir)
+-      $(INSTALL) avl.h $(DESTDIR)$(includedir)
+-      $(INSTALL) $(LIBRARIES) $(DESTDIR)$(libdir)
+-      for i in $(LIBRARIES); do\
++      $(INSTALL) -d $(DESTDIR)$(includedir)
++      $(INSTALL) -m 644 avl.h $(DESTDIR)$(includedir)
++      $(INSTALL) -m 644 $(LIBRARY) $(DESTDIR)$(libdir)
++      for i in $(LIBRARY); do\
+               $(LN) -sf $$i $(DESTDIR)$(libdir)/$${i%.*};\
+               $(LN) -sf $${i%.*} $(DESTDIR)$(libdir)/$${i%.*.*};\
+       done
diff --git a/libs/libcanfestival/Makefile b/libs/libcanfestival/Makefile
new file mode 100644 (file)
index 0000000..9758ef3
--- /dev/null
@@ -0,0 +1,71 @@
+#
+# 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:=libcanfestival
+PKG_RELEASE:=3
+
+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_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_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libcanfestival
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Free software CANopen library
+  URL:=http://canfestival.org
+  DEPENDS:=+libpthread +librt
+endef
+
+define Package/libcanfestival/description
+  CanFestival library
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS := \
+       --cc=$(TARGET_CC) \
+       --cxx=$(TARGET_CXX) \
+       --ld=$(TARGET_CC) \
+       --arch=$(ARCH) \
+       --binutils=$(TARGET_CROSS) \
+       --os=Linux \
+       --kerneldir=$(LINUX_DIR) \
+       --prefix=/usr \
+       --target=unix \
+       --can=socket \
+       --timers=unix \
+       --debug=ERR \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+define Package/libcanfestival/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcanfestival_can_socket.so $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libcanfestival))
diff --git a/libs/libcanfestival/patches/001-sigval-ref-fix.patch b/libs/libcanfestival/patches/001-sigval-ref-fix.patch
new file mode 100644 (file)
index 0000000..7e15ff1
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/drivers/timers_unix/timers_unix.c
++++ b/drivers/timers_unix/timers_unix.c
+@@ -33,7 +33,7 @@
+       }
+ }
+-void timer_notify(sigval_t val)
++void timer_notify(void)
+ {
+       if(gettimeofday(&last_sig,NULL)) {
+               perror("gettimeofday()");
diff --git a/libs/libcanfestival/patches/002-makefile-gcc-linker.patch b/libs/libcanfestival/patches/002-makefile-gcc-linker.patch
new file mode 100644 (file)
index 0000000..129743f
--- /dev/null
@@ -0,0 +1,33 @@
+--- a/examples/TestMasterMicroMod/Makefile.in
++++ b/examples/TestMasterMicroMod/Makefile.in
+@@ -56,7 +56,7 @@
+ $(TESTMASTERMICROMOD): $(OBJS)
+-      $(LD) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS) $(EXE_CFLAGS)
++      $(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS) $(EXE_CFLAGS)
+       
+ TestMaster.c: TestMaster.od
+--- a/examples/TestMasterSlave/Makefile.in
++++ b/examples/TestMasterSlave/Makefile.in
+@@ -65,7 +65,7 @@
+ $(TESTMASTERSLAVE): $(OBJS)
+-      $(LD) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS) $(EXE_CFLAGS)
++      $(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS) $(EXE_CFLAGS)
+       
+ TestSlave.c: TestSlave.od
+       $(MAKE) -C ../../objdictgen gnosis
+--- a/examples/CANOpenShell/Makefile.in
++++ b/examples/CANOpenShell/Makefile.in
+@@ -64,7 +64,7 @@
+       $(MAKE) -C ../../drivers/$(TARGET) libcanfestival_$(TARGET).a
+ $(CANOPENSHELL): $(OBJS)
+-      $(LD) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS) $(EXE_CFLAGS)
++      $(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS) $(EXE_CFLAGS)
+       mkdir -p Debug; cp $(CANOPENSHELL) Debug
+       
+ CANOpenShellMasterOD.c: CANOpenShellMasterOD.od
diff --git a/libs/libcanfestival/patches/003-makefile-skip-examples.patch b/libs/libcanfestival/patches/003-makefile-skip-examples.patch
new file mode 100644 (file)
index 0000000..e52fc6a
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -21,7 +21,7 @@
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ # 
+-all: objdictedit canfestival examples
++all: objdictedit canfestival
+ examples: canfestival driver
+       $(MAKE) -C examples all
+@@ -44,7 +44,7 @@ driver:
+ install: canfestival driver
+       $(MAKE) -C drivers $@
+       $(MAKE) -C src $@
+-      $(MAKE) -C examples $@
++      #$(MAKE) -C examples $@
+       $(MAKE) -C objdictgen $@
+       ldconfig
diff --git a/libs/libcap/Makefile b/libs/libcap/Makefile
new file mode 100644 (file)
index 0000000..50b31e0
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2011 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:=libcap
+PKG_VERSION:=2.24
+PKG_RELEASE:=1
+
+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_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+define Package/libcap
+  TITLE:=Linux capabilities library
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=http://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/
+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" \
+    INDENT="| true" \
+    PAM_CAP="no" \
+    LIBATTR="no" \
+    DYNAMIC="yes" \
+    lib="lib"
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/sys
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/lib/* $(1)/usr/lib/
+endef
+
+define Package/libcap/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/lib/libcap.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libcap))
diff --git a/libs/libcap/patches/100-portability.patch b/libs/libcap/patches/100-portability.patch
new file mode 100644 (file)
index 0000000..735a973
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/libcap/_makenames.c
++++ b/libcap/_makenames.c
+@@ -7,7 +7,6 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <sys/capability.h>
+ /*
+  * #include 'sed' generated array
+@@ -22,7 +21,7 @@ struct {
+ };
+ /* this should be more than big enough (factor of three at least) */
+-const char *pointers[8*sizeof(struct __user_cap_data_struct)];
++const char *pointers[8*12];
+ int main(void)
+ {
diff --git a/libs/libcoap/Makefile b/libs/libcoap/Makefile
new file mode 100644 (file)
index 0000000..fb220a9
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# 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:=libcoap
+PKG_RELEASE:=3
+
+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_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
+PKG_LICENSE:=GPL-2.0+ BSD-2-Clause
+PKG_LICENSE_FILES:=COPYING LICENSE.GPL LICENSE.BSD
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libcoap
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=CoAP (RFC 7252) library
+  URL:=http://libcoap.net/
+endef
+
+define Package/libcoap/description
+  Constrained Application Protocol (RFC 7252) library
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --disable-examples \
+       --disable-documentation
+
+ifeq ($(CONFIG_BIG_ENDIAN),y)
+TARGET_CFLAGS += -DWORDS_BIGENDIAN
+endif
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+define Package/libcoap/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcoap-1.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libcoap))
diff --git a/libs/libdaemon/Makefile b/libs/libdaemon/Makefile
new file mode 100644 (file)
index 0000000..958a37d
--- /dev/null
@@ -0,0 +1,72 @@
+#
+# 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:=libdaemon
+PKG_VERSION:=0.14
+PKG_RELEASE:=5
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://0pointer.de/lennart/projects/libdaemon/
+PKG_MD5SUM:=509dc27107c21bcd9fbf2f95f5669563
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libdaemon
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=A lightweight C library that eases the writing of UNIX daemons
+  URL:=http://0pointer.de/lennart/projects/libdaemon/
+endef
+
+define Package/libdaemon/description
+       libdaemon is a lightweight C library that eases the writing of UNIX daemons.
+       It consists of the following parts:
+       - A wrapper around fork() which does the correct daemonization procedure of a process
+       - A wrapper around syslog() for simpler and compatible log output to Syslog or STDERR
+       - An API for writing PID files
+       - An API for serializing UNIX signals into a pipe for usage with select() or poll()
+       - An API for running subprocesses with STDOUT and STDERR redirected to syslog
+
+       APIs like these are used in most daemon software available. It is not that
+       simple to get it done right and code duplication is not a goal.
+endef
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               --enable-shared \
+               --enable-static \
+               --disable-lynx \
+               --disable-examples \
+               , \
+               ac_cv_func_setpgrp_void=yes \
+       )
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libdaemon $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.a $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libdaemon.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libdaemon/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdaemon.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libdaemon))
diff --git a/libs/libdaemon/patches/001-daemon_set_verbosity.patch b/libs/libdaemon/patches/001-daemon_set_verbosity.patch
new file mode 100644 (file)
index 0000000..d0c66c7
--- /dev/null
@@ -0,0 +1,30 @@
+From 013963ba35e8fe8897211c0acf5ee98f9a871fc1 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Fri, 10 Jan 2014 19:38:51 +0100
+Subject: [PATCH] daemon_set_verbosity: fix erroneous error message
+
+When calling this function with a value other than LOG_DEBUG
+the error message was triggered erroneously.
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+
+ libdaemon/dlog.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libdaemon/dlog.c b/libdaemon/dlog.c
+index 1cc0566..cc2b918 100644
+--- a/libdaemon/dlog.c
++++ b/libdaemon/dlog.c
+@@ -42,7 +42,7 @@ static int daemon_verbosity_level = LOG_INFO;
+ void daemon_set_verbosity(int verbosity_prio) {
+     /* Allow using negative verbosity levels to hide _all_ messages */
+-    if (verbosity_prio > 0 && (verbosity_prio & LOG_PRIMASK) != LOG_PRIMASK)
++    if (verbosity_prio > 0 && (verbosity_prio & LOG_PRIMASK) != verbosity_prio)
+         daemon_log(LOG_ERR, "The value %d is not a valid priority value", verbosity_prio);
+     daemon_verbosity_level = verbosity_prio & LOG_PRIMASK;
+-- 
+1.7.10.4
+
diff --git a/libs/libdaq/Makefile b/libs/libdaq/Makefile
new file mode 100644 (file)
index 0000000..3b269f1
--- /dev/null
@@ -0,0 +1,74 @@
+#
+# Copyright (C) 2012-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:=libdaq
+PKG_VERSION:=2.0.4
+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_BUILD_DIR:=$(BUILD_DIR)/daq-$(PKG_VERSION)
+
+PKG_LICENSE:=GPL-2.0
+PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/libdaq
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=DAQ library
+  URL:=$(PKG_SOURCE_URL)
+  DEPENDS:=+libdnet +libpcap
+endef
+
+define Package/libdaq/description
+ Data Acquisition library for packet I/O.
+endef
+
+CONFIGURE_ARGS+= \
+       --disable-static \
+       --disable-nfq-module \
+       --with-dnet-includes="$(STAGING_DIR)/usr/include" \
+       --with-dnet-libraries="$(STAGING_DIR)/usr/lib" \
+       --with-libpcap-includes="$(STAGING_DIR)/usr/include" \
+       --with-libpcap-libraries="$(STAGING_DIR)/usr/lib" \
+
+define Build/Compile
+       $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR)
+endef
+
+define Build/Install
+       $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR) install DESTDIR=$(PKG_INSTALL_DIR)
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(STAGING_DIR)/usr/include/
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(STAGING_DIR)/usr/lib/
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/lib/daq
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/daq/* $(STAGING_DIR)/usr/lib/daq/
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/daq-modules-config $(STAGING_DIR)/usr/bin/
+endef
+
+define Package/libdaq/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/daq
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/daq/*.so* $(1)/usr/lib/daq/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/daq-modules-config $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libdaq))
diff --git a/libs/libdaq/patches/001-compile.patch b/libs/libdaq/patches/001-compile.patch
new file mode 100644 (file)
index 0000000..b8dd942
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/configure
++++ b/configure
+@@ -12967,10 +12967,11 @@ if ${daq_cv_libpcap_version_1x+:} false;
+ 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
+-See \`config.log' for more details" "$LINENO" 5; }
++#  { { $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; }
++        echo "    No cross compiling test."
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/libs/libdaq/patches/100-musl-compat.patch b/libs/libdaq/patches/100-musl-compat.patch
new file mode 100644 (file)
index 0000000..c510564
--- /dev/null
@@ -0,0 +1,42 @@
+--- a/os-daq-modules/daq_ipfw.c
++++ b/os-daq-modules/daq_ipfw.c
+@@ -23,10 +23,10 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+-#include <sys/unistd.h>
+ #include <netinet/in.h>
+ #include <sys/socket.h>
+--- a/os-daq-modules/daq_ipq.c
++++ b/os-daq-modules/daq_ipq.c
+@@ -24,10 +24,10 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+-#include <sys/unistd.h>
+ #include <netinet/ip.h>
+--- a/os-daq-modules/daq_nfq.c
++++ b/os-daq-modules/daq_nfq.c
+@@ -24,10 +24,10 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+-#include <sys/unistd.h>
+ #include <netinet/ip.h>
diff --git a/libs/libdbi-drivers/Makefile b/libs/libdbi-drivers/Makefile
new file mode 100644 (file)
index 0000000..e5a2da7
--- /dev/null
@@ -0,0 +1,105 @@
+#
+# Copyright (C) 2009-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:=libdbi-drivers
+PKG_VERSION:=0.9.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/libdbi-drivers
+PKG_MD5SUM:=9f47b960e225eede2cdeaabf7d22f59f
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libdbi-drivers/default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=http://libdbi-drivers.sourceforge.net/
+endef
+
+define Package/libdbi-drivers
+$(call Package/libdbi-drivers/default)
+  DEPENDS:=libdbi +libdbd-mysql +libdbd-pgsql +libdbd-sqlite3
+  TITLE:=Database drivers for libdbi
+endef
+
+define Package/libdbd-mysql
+$(call Package/libdbi-drivers/default)
+  DEPENDS:=libdbi +libmysqlclient
+  TITLE:=MySQL database server driver for libdbi
+endef
+
+define Package/libdbd-pgsql
+$(call Package/libdbi-drivers/default)
+  DEPENDS:=libdbi +libpq
+  TITLE:=PostgreSQL database server driver for libdbi
+endef
+
+define Package/libdbd-sqlite3
+$(call Package/libdbi-drivers/default)
+  DEPENDS:=libdbi +libsqlite3
+  TITLE:=SQLite3 database driver for libdbi
+endef
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --disable-static \
+       --disable-rpath \
+       --disable-docs \
+       --with-dbi-incdir=$(STAGING_DIR)/usr/include \
+       --with-dbi-libdir=$(STAGING_DIR)/usr/lib
+
+ifneq ($(CONFIG_PACKAGE_libdbd-mysql),)
+       CONFIGURE_ARGS += \
+               --with-mysql \
+               --with-mysql-incdir=$(STAGING_DIR)/usr/include/mysql \
+               --with-mysql-libdir=$(STAGING_DIR)/usr/lib/mysql
+       TARGET_LDFLAGS += \
+               -L$(STAGING_DIR)/usr/lib/mysql/
+else
+       CONFIGURE_ARGS += --without-mysql
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_libdbd-pgsql),)
+       CONFIGURE_ARGS += \
+               --with-pgsql \
+               --with-pgsql-incdir=$(STAGING_DIR)/usr/include \
+               --with-pgsql-libdir=$(STAGING_DIR)/usr/lib
+else
+       CONFIGURE_ARGS += --without-pgsql
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_libdbd-sqlite3),)
+       CONFIGURE_ARGS += \
+               --with-sqlite3 \
+               --with-sqlite3-incdir=$(STAGING_DIR)/usr/include \
+               --with-sqlite3-libdir=$(STAGING_DIR)/usr/lib
+else
+       CONFIGURE_ARGS += --without-sqlite3
+endif
+
+define BuildPlugin
+  define Package/libdbd-$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/lib/dbd
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/dbd/libdbd$(1).so $$(1)/usr/lib/dbd/
+  endef
+  $$(eval $$(call BuildPackage,libdbd-$(1)))
+endef
+
+#$(eval $(call BuildPackage,libdbi-drivers))
+$(eval $(call BuildPlugin,mysql))
+$(eval $(call BuildPlugin,pgsql))
+$(eval $(call BuildPlugin,sqlite3))
diff --git a/libs/libdbi-drivers/patches/001_libsqlite3_fix.patch b/libs/libdbi-drivers/patches/001_libsqlite3_fix.patch
new file mode 100644 (file)
index 0000000..5ded953
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -310,7 +310,7 @@ if test "$ac_sqlite3" = "yes"; then
+               AC_SEARCH_LIBS_VAR([sqlite3_exec], sqlite3, , , , SQLITE3_LIBS)
+               SQLITE3_LDFLAGS=""
+       else
+-              SQLITE3_LIBS=-lsqlite
++              SQLITE3_LIBS=-lsqlite3
+               SQLITE3_LDFLAGS=-L$ac_sqlite3_libdir
+       fi
diff --git a/libs/libdbi/Makefile b/libs/libdbi/Makefile
new file mode 100644 (file)
index 0000000..a1079fe
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2009-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:=libdbi
+PKG_VERSION:=0.9.0
+PKG_RELEASE:=4
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/libdbi
+PKG_MD5SUM:=05e2ceeac4bc85fbe40de8b4b22d9ab3
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libdbi
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Database Independent Abstraction Layer library
+  URL:=http://libdbi.sourceforge.net/
+endef
+
+define Package/libdbi/description
+ This package provides a database-independent abstraction layer library in C.
+endef
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --disable-docs
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/dbi $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdbi.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/dbi.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libdbi/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdbi.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libdbi))
diff --git a/libs/libdnet/Makefile b/libs/libdnet/Makefile
new file mode 100644 (file)
index 0000000..b0980ce
--- /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:=libdnet
+PKG_VERSION:=1.12
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/dugsong/libdnet/archive
+PKG_MD5SUM:=d2f1b72eac2a1070959667e9e61dcf20
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_LICENSE:=BSD
+PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libdnet
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Low-level network library
+  URL:=http://sourceforge.net/projects/libdnet/
+endef
+
+define Package/libdnet/description
+ libdnet is a library of simplified, portable interface to several low-level
+ networking routines.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --without-check \
+       --without-python
+
+CONFIGURE_VARS += \
+       ac_cv_dnet_bsd_bpf=no
+
+MAKE_FLAGS += \
+       CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE"
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(2)/bin
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/bin/dnet-config \
+               $(2)/bin/
+       $(SED) \
+               's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
+               $(2)/bin/dnet-config
+
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DATA)\
+               $(PKG_INSTALL_DIR)/usr/include/dnet.h \
+               $(1)/usr/include/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/dnet \
+               $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libdnet.{la,a,so*} \
+               $(1)/usr/lib/
+endef
+
+define Package/libdnet/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libdnet.so.* \
+               $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/sbin/dnet \
+               $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,libdnet))
diff --git a/libs/libdnet/patches/001-compile.patch b/libs/libdnet/patches/001-compile.patch
new file mode 100644 (file)
index 0000000..54223c9
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/config/config.sub
++++ b/config/config.sub
+@@ -228,7 +228,7 @@ case $basic_machine in
+       | a29k \
+       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+-      | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
++      | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fr30 | frv \
+@@ -290,7 +290,7 @@ case $basic_machine in
+       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+-      | avr-* \
++      | avr-* | avr32-* \
+       | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c54x-* \
+       | clipper-* | cydra-* \
diff --git a/libs/libdnet/patches/002-config.patch b/libs/libdnet/patches/002-config.patch
new file mode 100644 (file)
index 0000000..cde376a
--- /dev/null
@@ -0,0 +1,23 @@
+--- a/dnet-config.in
++++ b/dnet-config.in
+@@ -45,10 +45,18 @@ while test $# -gt 0; do
+ done
+ if test "$echo_cflags" = "yes"; then
+-      echo -I@includedir@
++      includes=
++      if test "@includedir@" != "/usr/include" ; then
++             includes=-I@includedir@
++      fi
++      echo $includes
+ fi
+ if test "$echo_libs" = "yes"; then
+-      echo -L@libdir@ -ldnet @LIBS@
++      libs=
++      if test "@libdir@" != "/usr/lib" ; then
++             libs=-I@libdir@
++      fi
++      echo $libs -ldnet @LIBS@
+ fi      
diff --git a/libs/libdouble-conversion/Makefile b/libs/libdouble-conversion/Makefile
new file mode 100644 (file)
index 0000000..9072268
--- /dev/null
@@ -0,0 +1,68 @@
+#
+# Copyright (C) 2008-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:=libdouble-conversion
+PKG_VERSION:=2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=0d25506a2e7fb52928963313343e0237e890059e
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+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
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libdouble-conversion
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles
+  URL:=https://github.com/google/double-conversion
+  DEPENDS:=+libstdcpp
+endef
+
+define Package/libdouble-conversion/description
+  double-conversion provides binary-decimal and decimal-binary routines for IEEE doubles.
+  
+  The library consists of efficient conversion routines that have been extracted
+  from the V8 JavaScript engine. The code has been refactored and improved so that
+  it can be used more easily in other projects.
+endef
+
+CMAKE_OPTIONS += \
+  -DBUILD_SHARED_LIBS=ON \
+  -DBUILD_TESTING=OFF
+
+define Build/InstallDev
+       $(INSTALL_DIR) \
+         $(1)/usr/lib \
+         $(1)/usr/include/double-conversion
+
+       $(CP) \
+         $(PKG_INSTALL_DIR)/usr/include/* \
+         $(1)/usr/include/
+
+       $(INSTALL_DATA) \
+         $(PKG_INSTALL_DIR)/usr/lib/lib*.so* \
+         $(1)/usr/lib/
+endef
+
+define Package/libdouble-conversion/install
+       $(INSTALL_DIR) \
+         $(1)/usr/lib
+
+       $(INSTALL_DATA) \
+         $(PKG_INSTALL_DIR)/usr/lib/lib*.so* \
+         $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libdouble-conversion))
diff --git a/libs/libdrm/Makefile b/libs/libdrm/Makefile
new file mode 100644 (file)
index 0000000..009935b
--- /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:=libdrm
+PKG_VERSION:=2.4.70
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://dri.freedesktop.org/libdrm
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MD5SUM:=920957cfe25a80efb02be9bd90bf3c1e
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libdrm
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=
+  TITLE:=libdrm
+  URL:=http://dri.freedesktop.org/
+endef
+
+CONFIGURE_ARGS += \
+  --disable-udev \
+  --enable-kms \
+  --disable-intel \
+  --disable-radeon \
+  --disable-amdgpu \
+  --disable-nouveau \
+  --disable-vmwgfx \
+  --disable-omap-experimental-api \
+  --disable-exynos-experimental-api \
+  --disable-freedreno \
+  --disable-freedreno-kgsl \
+  --disable-tegra-experimental-api \
+  --disable-vc4 \
+  --disable-cairo-tests \
+  --disable-manpages \
+  --disable-valgrind
+
+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/{pkgconfig,*.so*} \
+         $(1)/usr/lib/
+endef
+
+define Package/libdrm/install
+       $(INSTALL_DIR) \
+         $(1)/usr/lib
+
+       $(CP) \
+         $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+         $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libdrm))
diff --git a/libs/libdrm/patches/000-remove-dep-on-pthread-stubs.patch b/libs/libdrm/patches/000-remove-dep-on-pthread-stubs.patch
new file mode 100644 (file)
index 0000000..5da56a2
--- /dev/null
@@ -0,0 +1,101 @@
+--- a/configure        2016-07-23 15:19:06.000000000 +0200
++++ b/configure        2016-08-27 01:11:02.440530337 +0200
+@@ -13334,98 +13334,6 @@
+       fi
+ fi
+-pkg_failed=no
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREADSTUBS" >&5
+-$as_echo_n "checking for PTHREADSTUBS... " >&6; }
+-
+-if test -n "$PTHREADSTUBS_CFLAGS"; then
+-    pkg_cv_PTHREADSTUBS_CFLAGS="$PTHREADSTUBS_CFLAGS"
+- elif test -n "$PKG_CONFIG"; then
+-    if test -n "$PKG_CONFIG" && \
+-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pthread-stubs\""; } >&5
+-  ($PKG_CONFIG --exists --print-errors "pthread-stubs") 2>&5
+-  ac_status=$?
+-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+-  test $ac_status = 0; }; then
+-  pkg_cv_PTHREADSTUBS_CFLAGS=`$PKG_CONFIG --cflags "pthread-stubs" 2>/dev/null`
+-                    test "x$?" != "x0" && pkg_failed=yes
+-else
+-  pkg_failed=yes
+-fi
+- else
+-    pkg_failed=untried
+-fi
+-if test -n "$PTHREADSTUBS_LIBS"; then
+-    pkg_cv_PTHREADSTUBS_LIBS="$PTHREADSTUBS_LIBS"
+- elif test -n "$PKG_CONFIG"; then
+-    if test -n "$PKG_CONFIG" && \
+-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pthread-stubs\""; } >&5
+-  ($PKG_CONFIG --exists --print-errors "pthread-stubs") 2>&5
+-  ac_status=$?
+-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+-  test $ac_status = 0; }; then
+-  pkg_cv_PTHREADSTUBS_LIBS=`$PKG_CONFIG --libs "pthread-stubs" 2>/dev/null`
+-                    test "x$?" != "x0" && pkg_failed=yes
+-else
+-  pkg_failed=yes
+-fi
+- else
+-    pkg_failed=untried
+-fi
+-
+-
+-
+-if test $pkg_failed = yes; then
+-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-
+-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+-        _pkg_short_errors_supported=yes
+-else
+-        _pkg_short_errors_supported=no
+-fi
+-        if test $_pkg_short_errors_supported = yes; then
+-              PTHREADSTUBS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "pthread-stubs" 2>&1`
+-        else
+-              PTHREADSTUBS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pthread-stubs" 2>&1`
+-        fi
+-      # Put the nasty error message in config.log where it belongs
+-      echo "$PTHREADSTUBS_PKG_ERRORS" >&5
+-
+-      as_fn_error $? "Package requirements (pthread-stubs) were not met:
+-
+-$PTHREADSTUBS_PKG_ERRORS
+-
+-Consider adjusting the PKG_CONFIG_PATH environment variable if you
+-installed software in a non-standard prefix.
+-
+-Alternatively, you may set the environment variables PTHREADSTUBS_CFLAGS
+-and PTHREADSTUBS_LIBS to avoid the need to call pkg-config.
+-See the pkg-config man page for more details." "$LINENO" 5
+-elif test $pkg_failed = untried; then
+-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+-is in your PATH or set the PKG_CONFIG environment variable to the full
+-path to pkg-config.
+-
+-Alternatively, you may set the environment variables PTHREADSTUBS_CFLAGS
+-and PTHREADSTUBS_LIBS to avoid the need to call pkg-config.
+-See the pkg-config man page for more details.
+-
+-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+-See \`config.log' for more details" "$LINENO" 5; }
+-else
+-      PTHREADSTUBS_CFLAGS=$pkg_cv_PTHREADSTUBS_CFLAGS
+-      PTHREADSTUBS_LIBS=$pkg_cv_PTHREADSTUBS_LIBS
+-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+-$as_echo "yes" >&6; }
+-
+-fi
+-
+-
+ pkgconfigdir=${libdir}/pkgconfig
diff --git a/libs/libedit/Makefile b/libs/libedit/Makefile
new file mode 100644 (file)
index 0000000..4d014c7
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2016 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.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libedit
+PKG_VERSION:=20160618-3.1
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://thrysoee.dk/editline/
+PKG_MD5SUM:=b6e60f326a3fce91bea1a6fe4700af58
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libedit
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=BSD editline and history library
+       URL:=http://thrysoee.dk/editline/
+       DEPENDS:=+libncurses
+endef
+
+define Package/libedit/description
+       Generic line editing, history, and tokenization functions similar to GNU Readline.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR)                                          $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h                $(1)/usr/include/
+
+       $(INSTALL_DIR)                                          $(1)/usr/include/editline
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/editline/*.h       $(1)/usr/include/editline/
+       
+       $(INSTALL_DIR)                                          $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libedit.{a,so*}        $(1)/usr/lib/
+endef
+
+define Package/libedit/install
+       $(INSTALL_DIR)                                  $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libedit.so.*   $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libedit))
diff --git a/libs/libesmtp/Makefile b/libs/libesmtp/Makefile
new file mode 100644 (file)
index 0000000..256d963
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2008-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:=libesmtp
+PKG_VERSION:=1.0.6
+PKG_RELEASE:=3
+
+PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
+PKG_LICENSE:=LGPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE_PROTO:=git
+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_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libesmtp
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=A Library for Posting Electronic Mail
+  URL:=https://github.com/tru7/libesmtp.git
+  DEPENDS:=+libpthread +libopenssl
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libesmtp-config $(1)/usr/bin/
+       $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(1)/usr/bin/libesmtp-config
+
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libesmtp.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(2)/bin
+       $(LN) ../../usr/bin/libesmtp-config $(2)/bin/
+endef
+
+define Package/libesmtp/install
+       $(INSTALL_DIR)  $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libesmtp.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libesmtp))
diff --git a/libs/libestr/Makefile b/libs/libestr/Makefile
new file mode 100644 (file)
index 0000000..e3b4d6b
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# 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:=libestr
+PKG_VERSION:=0.1.10
+PKG_RELEASE:=2
+
+PKG_SOURCE_URL:=http://libestr.adiscon.com/files/download/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=f4c9165a23587e77f7efe65d676d5e8e
+
+PKG_MAINTAINER:=Dov Murik <dmurik@us.ibm.com>
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libestr
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=String handling library
+  URL:=http://libestr.adiscon.com/
+endef
+
+define Package/libestr/description
+  libestr - some essentials for string handling (and a bit more)
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+define Package/libestr/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libestr.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libestr))
diff --git a/libs/libev/Makefile b/libs/libev/Makefile
new file mode 100644 (file)
index 0000000..24b0464
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# 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:=libev
+PKG_VERSION:=4.22
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://dist.schmorp.de/libev/Attic/
+PKG_MD5SUM:=bf0007e37240103d3c2be80ca9bee3f9
+PKG_LICENSE:=BSD-2-Clause
+PKG_MAINTAINER:=Karl Palsson <karlp@tweak.net.au>
+
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libev
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=High-performance event loop
+  URL:=http://software.schmorp.de/pkg/libev.html
+endef
+
+define Package/libev/description
+ A full-featured and high-performance event loop that is loosely modelled after
+ libevent, but without its limitations and bugs.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/event.h $(1)/usr/include/ev_event_compat.h
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/ev.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/ev++.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libev.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libev/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libev.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libev))
diff --git a/libs/libevdev/Makefile b/libs/libevdev/Makefile
new file mode 100644 (file)
index 0000000..dd8cef5
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2007-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:=libevdev
+PKG_VERSION:=1.4.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_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libevdev
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=a wrapper library for evdev devices
+  URL:=http://www.freedesktop.org/wiki/Software/libevdev/
+endef
+
+define Package/libevdev/description
+  libevdev is a wrapper library for evdev devices. it moves the common
+  tasks when dealing with evdev devices into a library and provides a
+  library interface to the callers, thus avoiding erroneous ioctls, etc.
+
+  The eventual goal is that libevdev wraps all ioctls available to
+  evdev devices, thus making direct access unnecessary.
+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/*.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libevdev/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libevdev))
diff --git a/libs/libevdev/patches/010-no-clock-monotonic-raw-in-uclibc.patch b/libs/libevdev/patches/010-no-clock-monotonic-raw-in-uclibc.patch
new file mode 100644 (file)
index 0000000..a11ac1e
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/test/test-libevdev-init.c
++++ b/test/test-libevdev-init.c
+@@ -32,6 +32,11 @@
+ #include <libevdev/libevdev-uinput.h>
+ #include "test-common.h"
++/* work-around CLOCK_MONOTONIC_RAW definition missing in uClibc */
++#ifndef CLOCK_MONOTONIC_RAW
++#define CLOCK_MONOTONIC_RAW 4
++#endif
++
+ START_TEST(test_new_device)
+ {
+       struct libevdev *dev;
diff --git a/libs/libevent/Makefile b/libs/libevent/Makefile
new file mode 100644 (file)
index 0000000..3dea702
--- /dev/null
@@ -0,0 +1,67 @@
+#
+# 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/libexif/Makefile b/libs/libexif/Makefile
new file mode 100644 (file)
index 0000000..0588304
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# 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:=libexif
+PKG_VERSION:=0.6.21
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/libexif
+PKG_MD5SUM:=27339b89850f28c8f1c237f233e05b27
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libexif
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=library for jpeg files with exif tags
+  URL:=http://libexif.sourceforge.net/
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+endef
+
+define Package/libexif/description
+  libexif is a library for parsing, editing, and saving EXIF data. It is
+  intended to replace lots of redundant implementations in command-line
+  utilities and programs with GUIs.
+endef
+
+CONFIGURE_ARGS+= \
+       --enable-shared \
+       --enable-static \
+       --disable-rpath \
+       --disable-nls \
+       --without-libiconv-prefix \
+       --without-libintl-prefix \
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libexif $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libexif*.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libexif.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libexif/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libexif*.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libexif))
diff --git a/libs/libexif/patches/100-no_doc.patch b/libs/libexif/patches/100-no_doc.patch
new file mode 100644 (file)
index 0000000..ae5bf27
--- /dev/null
@@ -0,0 +1,12 @@
+diff -u --recursive libexif-0.6.21-vanilla/Makefile.in libexif-0.6.21/Makefile.in
+--- libexif-0.6.21-vanilla/Makefile.in 2014-07-17 22:17:52.439423287 -0400
++++ libexif-0.6.21/Makefile.in 2014-07-17 22:18:28.125359945 -0400
+@@ -289,7 +289,7 @@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-SUBDIRS = m4m po libexif test doc binary contrib
++SUBDIRS = m4m po libexif test binary contrib
+ EXTRA_DIST = @PACKAGE_TARNAME@.spec README-Win32.txt libexif.pc.in \
+       libexif-uninstalled.pc.in
+ pkgconfigdir = $(libdir)/pkgconfig
diff --git a/libs/libextractor/Makefile b/libs/libextractor/Makefile
new file mode 100644 (file)
index 0000000..914dd56
--- /dev/null
@@ -0,0 +1,139 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libextractor
+PKG_VERSION:=1.3
+PKG_RELEASE:=4
+
+# 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_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
+
+PLUGINS:= \
+       archive:+libarchive-noopenssl \
+       deb \
+       dvi \
+       flac:+libflac \
+       gif:+giflib \
+       gstreamer:+libgstreamer1:+gstreamer1-plugins-base:+libgst1app:+libgst1pbutils:+libgst1tag \
+       it \
+       jpeg:+libjpeg \
+       man \
+       mime:+libmagic \
+       mpeg:+libmpeg2 \
+       nsf \
+       nsfe \
+       odf \
+       ogg:+libvorbis \
+       png \
+       ps \
+       riff \
+       s3m \
+       sid \
+       thumbnailffmpeg:+libffmpeg-full:+libmagic \
+       tiff:+libtiff \
+       wav \
+       xm \
+       zip
+
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+CONFIGURE_ARGS += \
+       --enable-ffmpeg \
+       --with-gstreamer \
+       --disable-gsf \
+       --disable-rpath
+
+define Package/libextractor
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=GNU Libextractor
+       URL:=https://www.gnu.org/software/libextractor/
+       DEPENDS:=+libbz2 +libltdl +librt +zlib $(ICONV_DEPENDS) $(INTL_DEPENDS)
+       MENU:=1
+endef
+
+define Package/libextractor/description
+  GNU Libextractor is a library used to extract meta data from files.
+  The goal is to provide developers of file-sharing networks, browsers or
+  WWW-indexing bots with a universal library to obtain simple keywords and meta
+  data to match against queries and to show to users instead of only relying on
+  filenames.
+endef
+
+define PluginGen
+define Package/libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(1))))
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=GNU Libextractor ($(firstword $(subst :, ,$(1))) plugin)
+       URL:=https://www.gnu.org/software/libextractor/
+       DEPENDS:=libextractor $(wordlist 2,$(words $(subst :, ,$(1))),$(subst :, ,$(1)))
+endef
+endef
+
+$(foreach file,$(PLUGINS),$(eval $(call PluginGen,$(file))))
+
+define Package/extract
+       SECTION:=utils
+       CATEGORY:=Utilities
+       TITLE:=extract util from GNU Libextractor
+       URL:=https://www.gnu.org/software/libextractor/
+       DEPENDS:=+libextractor
+endef
+
+define Package/extract/description
+  libextractor contains the shell command extract that, similar to the
+  well-known file command, can extract meta data from a file an print the results
+  to stdout.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libextractor/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+define PluginInstall
+define Package/libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
+       $(INSTALL_DIR) $$(1)/usr/lib/libextractor
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/lib/libextractor/libextractor_$(firstword $(subst :, ,$(1))).so \
+               $$(1)/usr/lib/libextractor
+endef
+endef
+
+define Package/extract/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(foreach file,$(PLUGINS),$(eval $(call PluginInstall,$(file))))
+
+$(eval $(call BuildPackage,libextractor))
+$(foreach file,$(PLUGINS),$(eval $(call BuildPackage,libextractor-plugin-$(subst _,-,$(firstword $(subst :, ,$(file)))))))
+$(eval $(call BuildPackage,extract))
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
new file mode 100644 (file)
index 0000000..7b7a2df
--- /dev/null
@@ -0,0 +1,26 @@
+--- 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
new file mode 100644 (file)
index 0000000..f875729
--- /dev/null
@@ -0,0 +1,347 @@
+--- 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,
diff --git a/libs/libfastjson/Makefile b/libs/libfastjson/Makefile
new file mode 100644 (file)
index 0000000..384a417
--- /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:=libfastjson
+PKG_VERSION:=0.99.2
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/rsyslog/libfastjson.git
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+
+PKG_MAINTAINER:=Dov Murik <dmurik@us.ibm.com>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libfastjson
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=A fast JSON library for C
+  URL:=https://github.com/rsyslog/libfastjson
+endef
+
+define Package/libfastjson/description
+  libfastjson - A fast JSON library for C
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+define Package/libfastjson/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfastjson.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libfastjson))
diff --git a/libs/libftdi/Makefile b/libs/libftdi/Makefile
new file mode 100644 (file)
index 0000000..6f6235c
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# Copyright (C) 2011-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:=libftdi
+PKG_VERSION:=0.20
+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_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
+
+PKG_LICENSE:=LGPL-2.0
+PKG_LICENSE_FILES:=COPYING.LIB
+
+PKG_INSTALL:=1
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libftdi
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libusb-compat
+  TITLE:=Library to talk to FTDI chips
+  URL:=http://www.intra2net.com/en/developer/libftdi/
+endef
+
+define Package/libftdi/description
+  libFTDI - FTDI USB driver with bitbang mode
+  libFTDI is an open source library to talk to FTDI chips: FT232BM, FT245BM, FT2232C, FT2232H, FT4232H, FT2232D and FT245R, including the popular bitbang mode. 
+  The library is linked with your program in userspace, no kernel driver required.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/ftdi.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libftdi.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libftdi.pc $(1)/usr/lib/pkgconfig/libftdi.pc
+       $(SED) \
+               's,/usr/include,$$$${prefix}/include,g' \
+                $(1)/usr/lib/pkgconfig/libftdi.pc
+       $(SED) \
+               's,/usr/lib,$$$${prefix}/lib,g' \
+                $(1)/usr/lib/pkgconfig/libftdi.pc
+endef
+
+define Package/libftdi/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libftdi-config $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libftdi.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libftdi))
diff --git a/libs/libftdi/patches/100-fix-x86_64-build.patch b/libs/libftdi/patches/100-fix-x86_64-build.patch
new file mode 100644 (file)
index 0000000..2460cb1
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -44,7 +44,7 @@ IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
+     SET(LIB_SUFFIX "")
+     SET(PACK_ARCH "")
+   ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
+-    SET(LIB_SUFFIX 64)
++    SET(LIB_SUFFIX "")
+     SET(PACK_ARCH .x86_64)
+ endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
diff --git a/libs/libftdi/patches/101-fix-cmake-version-packagekit.patch b/libs/libftdi/patches/101-fix-cmake-version-packagekit.patch
new file mode 100644 (file)
index 0000000..e6861dc
--- /dev/null
@@ -0,0 +1,29 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,9 +1,12 @@
+ # Project
+ project(libftdi)
++set(PACKAGE libftdi)
+ set(MAJOR_VERSION 0)
+ set(MINOR_VERSION 20)
++set(VERSION ${VERSION_STRING})
+ set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION})
+-SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
++set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
++set(top_srcdir ${CMAKE_SOURCE_DIR})
+ # CMake
+ if("${CMAKE_BUILD_TYPE}" STREQUAL "")
+@@ -98,12 +101,6 @@ option(DOCUMENTATION "Generate API docum
+ find_package(Doxygen)
+ if(DOCUMENTATION AND DOXYGEN_FOUND)
+-
+-   # Set variables
+-   set(PACKAGE libftdi)
+-   set(VERSION ${VERSION_STRING})
+-   set(top_srcdir ${CMAKE_SOURCE_DIR})
+-
+    # Find doxy config
+    message(STATUS "Doxygen found.")
+    set(DOXY_DIR "${CMAKE_SOURCE_DIR}/doc")
diff --git a/libs/libftdi/patches/102-fix-cmake-include-examples.patch b/libs/libftdi/patches/102-fix-cmake-include-examples.patch
new file mode 100644 (file)
index 0000000..b37a968
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/examples/CMakeLists.txt
++++ b/examples/CMakeLists.txt
+@@ -2,7 +2,7 @@ option(EXAMPLES "Build example programs"
+ if (EXAMPLES)
+     # Includes
+-    include( ${CMAKE_CURRENT_SOURCE_DIR}
++    include_directories( ${CMAKE_CURRENT_SOURCE_DIR}
+             ${CMAKE_CURRENT_BINARY_DIR}
+             )
diff --git a/libs/libftdi1/Makefile b/libs/libftdi1/Makefile
new file mode 100644 (file)
index 0000000..cf2ba17
--- /dev/null
@@ -0,0 +1,93 @@
+#
+# 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:=libftdi1
+PKG_VERSION:=1.3
+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_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
+
+PKG_LICENSE:=LGPL-2.0
+PKG_LICENSE_FILES:=COPYING.LIB
+
+PKG_INSTALL:=1
+PKG_USE_MIPS16:=0
+
+CMAKE_OPTIONS:=-DBUILD_TESTS=OFF
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libftdi1
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libusb-1.0
+  TITLE:=Library to talk to FTDI chips
+  URL:=http://www.intra2net.com/en/developer/libftdi/
+endef
+
+define Package/libftdi1/description
+  libFTDI - FTDI USB driver with bitbang mode
+  libFTDI is an open source library to talk to FTDI chips: FT232BM, FT245BM, FT2232C, FT2232H, FT4232H, FT2232D and FT245R, including the popular bitbang mode. 
+  The library is linked with your program in userspace, no kernel driver required.
+endef
+
+define Package/ftdi_eeprom
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+confuse +libftdi1
+  TITLE:=Tool for reading/erasing/flashing FTDI USB chip eeproms
+  URL:=http://www.intra2net.com/en/developer/libftdi/
+endef
+
+define Package/ftdi_eeprom/description
+  ftdi_eeprom is a small tool for reading/erasing/flashing FTDI USB chip
+  eeproms. It uses libftdi to access the chip, so you will need to have
+  the required permissions on the device.
+
+  The ftdi_sio module should not be loaded.
+
+  You have to unplug and replug your device to get the new values to be
+  read. Otherwise, you will still get the old values.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/libftdi1/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libftdi1/ftdi.h $(1)/usr/include/libftdi1/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libftdi1.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/cmake/libftdi1
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmake/libftdi1/* $(1)/usr/lib/cmake/libftdi1/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libftdi1.pc $(1)/usr/lib/pkgconfig/libftdi1.pc
+       $(SED) \
+               's,/usr/include,$$$${prefix}/include,g' \
+                $(1)/usr/lib/pkgconfig/libftdi1.pc
+       $(SED) \
+               's,/usr/lib,$$$${prefix}/lib,g' \
+                $(1)/usr/lib/pkgconfig/libftdi1.pc
+endef
+
+define Package/libftdi1/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libftdi1-config $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libftdi1.so.* $(1)/usr/lib/
+endef
+
+define Package/ftdi_eeprom/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ftdi_eeprom $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libftdi1))
+$(eval $(call BuildPackage,ftdi_eeprom))
diff --git a/libs/libftdi1/patches/100-fix-x86_64-build.patch b/libs/libftdi1/patches/100-fix-x86_64-build.patch
new file mode 100644 (file)
index 0000000..495db17
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -55,7 +55,7 @@ if ( NOT DEFINED LIB_SUFFIX )
+       AND NOT EXISTS "/etc/debian_version"
+       AND NOT EXISTS "/etc/arch-release" )
+     if ( "${CMAKE_SIZEOF_VOID_P}" EQUAL "8" )
+-      set ( LIB_SUFFIX 64 )
++      set ( LIB_SUFFIX "" )
+     endif ()
+   endif ()
+ endif ()
diff --git a/libs/libgee/Makefile b/libs/libgee/Makefile
new file mode 100644 (file)
index 0000000..27b353c
--- /dev/null
@@ -0,0 +1,73 @@
+#
+# 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:=libgee
+PKG_VERSION:=0.18.0
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+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_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/libgee
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+glib2
+  TITLE:=libgee
+  URL:=https://wiki.gnome.org/Libgee
+endef
+
+define Package/libgee/decription
+  Libgee is an utility library providing GObject-based interfaces and classes
+endef
+
+CONFIGURE_ARGS += \
+       --disable-doc
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/gee-0.8/ \
+               $(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/
+       $(INSTALL_DATA) \
+                $(PKG_INSTALL_DIR)/usr/share/vala/vapi/* \
+                $(STAGING_DIR_HOSTPKG)/share/vala-0.30/vapi
+endef
+
+define Package/libgee/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+               $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libgee))
diff --git a/libs/libgee/patches/libgee-0.18.0-no-introspection.patch b/libs/libgee/patches/libgee-0.18.0-no-introspection.patch
new file mode 100644 (file)
index 0000000..caa6e16
--- /dev/null
@@ -0,0 +1,101 @@
+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 @@
+               enable_consistency_check=$enableval, enable_consistency_check=no)
+ AS_IF([test "x$enable_consistency_check" != xno], [VALA_ADD_VALAFLAGS(-D CONSISTENCY_CHECKS)])
+-GOBJECT_INTROSPECTION_CHECK([0.9.0])
+-
+-VALA_CHECK([0.25.1])
+-
+ 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
+@@ -146,29 +146,6 @@
+       gee-0.8.vapi \
+       $(NULL)
+-if HAVE_INTROSPECTION
+-girdir = @INTROSPECTION_GIRDIR@
+-
+-dist_gir_DATA = \
+-      Gee-0.8.gir \
+-      $(NULL)
+-
+-typelibdir = @INTROSPECTION_TYPELIBDIR@
+-typelib_DATA = \
+-      Gee-0.8.typelib \
+-      $(NULL)
+-
+-# Extract dlname from libfolks.la; see bug #658002.
+-# This is what g-ir-scanner does.
+-libgee_dlname = \
+-      `$(SED) -nE "s/^dlname='([A-Za-z0-9.+-]+)'/\1/p" libgee-0.8.la`
+-INTROSPECTION_COMPILER_ARGS= \
+-      -l $(libgee_dlname)
+-Gee-0.8.gir: libgee_0_8_la_vala.stamp
+-Gee-0.8.typelib: Gee-0.8.gir libgee-0.8.la
+-      @INTROSPECTION_COMPILER@ $(INTROSPECTION_COMPILER_ARGS) -o $@ $^
+-endif
+-
+ 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 @@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+-INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+-INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+-INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+-INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+-INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+-INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+-INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+-INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
+ LCOV = @LCOV@
+ LD = @LD@
+ LDFLAGS = @LDFLAGS@
+@@ -531,25 +523,6 @@
+       gee-0.8.vapi \
+       $(NULL)
+-@HAVE_INTROSPECTION_TRUE@girdir = @INTROSPECTION_GIRDIR@
+-@HAVE_INTROSPECTION_TRUE@dist_gir_DATA = \
+-@HAVE_INTROSPECTION_TRUE@     Gee-0.8.gir \
+-@HAVE_INTROSPECTION_TRUE@     $(NULL)
+-
+-@HAVE_INTROSPECTION_TRUE@typelibdir = @INTROSPECTION_TYPELIBDIR@
+-@HAVE_INTROSPECTION_TRUE@typelib_DATA = \
+-@HAVE_INTROSPECTION_TRUE@     Gee-0.8.typelib \
+-@HAVE_INTROSPECTION_TRUE@     $(NULL)
+-
+-
+-# Extract dlname from libfolks.la; see bug #658002.
+-# This is what g-ir-scanner does.
+-@HAVE_INTROSPECTION_TRUE@libgee_dlname = \
+-@HAVE_INTROSPECTION_TRUE@     `$(SED) -nE "s/^dlname='([A-Za-z0-9.+-]+)'/\1/p" libgee-0.8.la`
+-
+-@HAVE_INTROSPECTION_TRUE@INTROSPECTION_COMPILER_ARGS = \
+-@HAVE_INTROSPECTION_TRUE@     -l $(libgee_dlname)
+-
+ MOSTLYCLEANFILES = \
+       $(libgee_0_8_la_VALASOURCES:.vala=.c) \
+       libgee_0_8_la_vala.stamp \
+@@ -1607,9 +1580,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
+-@HAVE_INTROSPECTION_TRUE@Gee-0.8.gir: libgee_0_8_la_vala.stamp
+-@HAVE_INTROSPECTION_TRUE@Gee-0.8.typelib: Gee-0.8.gir libgee-0.8.la
+-@HAVE_INTROSPECTION_TRUE@     @INTROSPECTION_COMPILER@ $(INTROSPECTION_COMPILER_ARGS) -o $@ $^
+ # 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.
diff --git a/libs/libhttp-parser/Makefile b/libs/libhttp-parser/Makefile
new file mode 100644 (file)
index 0000000..fe28b4c
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# Copyright (C) 2013 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:=libhttp-parser
+PKG_VERSION:=2.3.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_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=git://github.com/joyent/http-parser.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=56f7ad0e2e5a80f79d214015c91e1f17d11d109f
+
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libhttp-parser
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=A library to parse http request and response
+  URL:=https://github.com/joyent/http-parser
+endef
+
+define Package/libhttp-parser/description
+  A parser for HTTP messages written in C. It parses both requests and responses. 
+  The parser is designed to be used in performance HTTP applications. 
+  It does not make any syscalls nor allocations, it does not buffer data, 
+  it can be interrupted at anytime. Depending on your architecture, 
+  it only requires about 40 bytes of data per message stream 
+  (in a web server that is per connection).
+endef
+
+define Build/Compile
+       $(call Build/Compile/Default, library) 
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(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 )
+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 )
+endef
+
+$(eval $(call BuildPackage,libhttp-parser))
diff --git a/libs/libical/Makefile b/libs/libical/Makefile
new file mode 100644 (file)
index 0000000..4af4c85
--- /dev/null
@@ -0,0 +1,62 @@
+#
+# 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:=libical
+PKG_VERSION:=1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/freeassociation
+PKG_MD5SUM:=
+
+PKG_LICENSE:=LGPL-2.1 MPL-1.0
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_FIXUP:=libtool
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libical
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=iCal (RFC 2445) library
+  URL:=http://www.nabber.org/projects/ical/
+  DEPENDS:=+libpthread
+endef
+
+define Package/libical/description
+ This package provides a a read/write library of classes for object oriented
+ languages (Initial goals of PHP and Python) that implement and enforce the iCal
+ standard (RFC 2445).
+endef
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --disable-cxx \
+       --disable-java \
+       --disable-python \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/{ical.h,libical} $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libical{,ss,vcal}.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libical.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libical/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libical{,ss,vcal}.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libical))
diff --git a/libs/libid3tag/Makefile b/libs/libid3tag/Makefile
new file mode 100644 (file)
index 0000000..127bc17
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# 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:=libid3tag
+PKG_VERSION:=0.15.1b
+PKG_RELEASE:=4
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/mad
+PKG_MD5SUM:=e5808ad997ba32c498803822078748c3
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=GPL-2
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libid3tag
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+zlib
+  TITLE:=An ID3 tag manipulation library
+  URL:=http://mad.sourceforge.net/
+endef
+
+define Package/libid3tag/description
+       libid3tag is a library for reading and (eventually) writing ID3 tags, both
+       ID3v1 and the various versions of ID3v2.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_VARS += CC="$(TARGET_CC) $(TARGET_CFLAGS)"
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               --enable-shared \
+               --enable-static \
+               --disable-debugging \
+               --disable-profiling \
+       )
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/id3tag.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libid3tag.so* $(1)/usr/lib/
+endef
+
+define Package/libid3tag/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libid3tag.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libid3tag))
diff --git a/libs/libidn/Makefile b/libs/libidn/Makefile
new file mode 100644 (file)
index 0000000..2d20216
--- /dev/null
@@ -0,0 +1,97 @@
+#
+# 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:=libidn
+PKG_VERSION:=1.33
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/libidn
+PKG_MD5SUM:=a9aa7e003665de9c82bd3f9fc6ccf308
+
+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
+
+PKG_FIXUP:=autoreconf
+PKG_REMOVE_FILES:=GNUmakefile aclocal.m4
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/idn/Default
+  SECTION:=net
+  CATEGORY:=Network
+  URL:=http://www.gnu.org/software/libidn/
+  MAINTAINER:=Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
+endef
+
+define Package/idn/Default/description
+  GNU Libidn is a fully documented implementation of the Stringprep,
+  Punycode and IDNA specifications. Libidn's purpose is to encode and
+  decode internationalized domain names.
+endef
+
+define Package/idn
+  $(call Package/idn/Default)
+  SUBMENU:=IP Addresses and Names
+  TITLE:=GNU IDN (Internationalized Domain Name) tool
+  DEPENDS:=+libidn
+endef
+
+define Package/idn/description
+$(call Package/idn/Default/description)
+
+  Command line tool using libidn
+
+endef
+
+define Package/libidn
+  $(call Package/idn/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Stringprep, Punycode and IDNA implementation
+endef
+
+define Package/libidn/description
+$(call Package/idn/Default/description)
+
+  Library only package
+
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+
+MAKE_FLAGS += \
+       CC="$(TARGET_CC)" \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libidn.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libidn.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/idn/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+define Package/libidn/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libidn.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,idn))
+$(eval $(call BuildPackage,libidn))
diff --git a/libs/libidn/patches/002-disable-po-docs-examples.patch b/libs/libidn/patches/002-disable-po-docs-examples.patch
new file mode 100644 (file)
index 0000000..dcac7c4
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -16,7 +16,7 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-SUBDIRS = gl lib/gl lib po src doc gltests lib/gltests tests examples \
++SUBDIRS = gl lib/gl lib src \
+       java csharp
+ EXTRA_DIST = cfg.mk maint.mk .clcopying
+--- a/configure.ac
++++ b/configure.ac
+@@ -47,8 +47,6 @@ LT_INIT([win32-dll])
+ # Checks for programs.
+ AM_MISSING_PROG(PERL, perl, $missing_dir)
+ AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
+-AM_GNU_GETTEXT(external)
+-AM_GNU_GETTEXT_VERSION(0.19.3)
+ AM_ICONV
+ AM_PATH_LISPDIR
diff --git a/libs/libidn/patches/010-fix-idn-error-usage.patch b/libs/libidn/patches/010-fix-idn-error-usage.patch
new file mode 100644 (file)
index 0000000..e9201c4
--- /dev/null
@@ -0,0 +1,119 @@
+--- a/src/idn.c
++++ b/src/idn.c
+@@ -170,7 +170,7 @@ main (int argc, char *argv[])
+       (args_info.idna_to_unicode_given ? 1 : 0) +
+       (args_info.nfkc_given ? 1 : 0) != 1)
+     {
+-      error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be specified"));
++      error (0, 0, "%s", _("only one of -s, -e, -d, -a, -u or -n can be specified"));
+       usage (EXIT_FAILURE);
+     }
+@@ -185,7 +185,7 @@ main (int argc, char *argv[])
+   if (!args_info.quiet_given
+       && args_info.inputs_num == 0
+       && isatty (fileno (stdin)))
+-    fprintf (stderr, _("Type each input string on a line by itself, "
++    fprintf (stderr, "%s", _("Type each input string on a line by itself, "
+                      "terminated by a newline character.\n"));
+   do
+@@ -197,7 +197,7 @@ main (int argc, char *argv[])
+         if (feof (stdin))
+           break;
+-        error (EXIT_FAILURE, errno, _("input error"));
++        error (EXIT_FAILURE, errno, "%s", _("input error"));
+       }
+       if (strlen (line) > 0)
+@@ -215,7 +215,7 @@ main (int argc, char *argv[])
+         if (!q)
+           {
+             free (p);
+-            error (EXIT_FAILURE, 0,
++            error (EXIT_FAILURE, 0, "%s",
+                    _("could not convert from UTF-8 to UCS-4"));
+           }
+@@ -240,7 +240,7 @@ main (int argc, char *argv[])
+         if (!q)
+           {
+             free (r);
+-            error (EXIT_FAILURE, 0,
++            error (EXIT_FAILURE, 0, "%s",
+                    _("could not convert from UTF-8 to UCS-4"));
+           }
+@@ -277,7 +277,7 @@ main (int argc, char *argv[])
+         q = stringprep_utf8_to_ucs4 (p, -1, &len);
+         free (p);
+         if (!q)
+-          error (EXIT_FAILURE, 0,
++          error (EXIT_FAILURE, 0, "%s",
+                  _("could not convert from UTF-8 to UCS-4"));
+         if (args_info.debug_given)
+@@ -336,7 +336,7 @@ main (int argc, char *argv[])
+         r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
+         free (q);
+         if (!r)
+-          error (EXIT_FAILURE, 0,
++          error (EXIT_FAILURE, 0, "%s",
+                  _("could not convert from UCS-4 to UTF-8"));
+         p = stringprep_utf8_to_locale (r);
+@@ -360,7 +360,7 @@ main (int argc, char *argv[])
+         q = stringprep_utf8_to_ucs4 (p, -1, NULL);
+         free (p);
+         if (!q)
+-          error (EXIT_FAILURE, 0,
++          error (EXIT_FAILURE, 0, "%s",
+                  _("could not convert from UCS-4 to UTF-8"));
+         if (args_info.debug_given)
+@@ -438,7 +438,7 @@ main (int argc, char *argv[])
+         if (!q)
+           {
+             free (p);
+-            error (EXIT_FAILURE, 0,
++            error (EXIT_FAILURE, 0, "%s",
+                    _("could not convert from UCS-4 to UTF-8"));
+           }
+@@ -494,7 +494,7 @@ main (int argc, char *argv[])
+         r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
+         free (q);
+         if (!r)
+-          error (EXIT_FAILURE, 0,
++          error (EXIT_FAILURE, 0, "%s",
+                  _("could not convert from UTF-8 to UCS-4"));
+         p = stringprep_utf8_to_locale (r);
+@@ -523,7 +523,7 @@ main (int argc, char *argv[])
+             if (!q)
+               {
+                 free (p);
+-                error (EXIT_FAILURE, 0,
++                error (EXIT_FAILURE, 0, "%s",
+                        _("could not convert from UTF-8 to UCS-4"));
+               }
+@@ -537,7 +537,7 @@ main (int argc, char *argv[])
+         r = stringprep_utf8_nfkc_normalize (p, -1);
+         free (p);
+         if (!r)
+-          error (EXIT_FAILURE, 0, _("could not do NFKC normalization"));
++          error (EXIT_FAILURE, 0, "%s", _("could not do NFKC normalization"));
+         if (args_info.debug_given)
+           {
+@@ -547,7 +547,7 @@ main (int argc, char *argv[])
+             if (!q)
+               {
+                 free (r);
+-                error (EXIT_FAILURE, 0,
++                error (EXIT_FAILURE, 0, "%s",
+                        _("could not convert from UTF-8 to UCS-4"));
+               }
diff --git a/libs/libimobiledevice/Makefile b/libs/libimobiledevice/Makefile
new file mode 100644 (file)
index 0000000..a7ac5d5
--- /dev/null
@@ -0,0 +1,96 @@
+#
+# Copyright (C) 2012-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:=libimobiledevice
+PKG_VERSION:=1.2.1
+PKG_RELEASE:=2
+
+PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING.LESSER
+
+PKG_SOURCE_PROTO:=git
+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_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+$(call include_mk, python-package.mk)
+
+define Package/libimobiledevice/Default
+  TITLE:=A library that talks to Apple devices.
+  URL:=http://www.libimobiledevice.org/
+endef
+
+define Package/libimobiledevice/Default/description
+  libimobiledevice is a software library that talks the protocols to support
+  iPhone®, iPod Touch®, iPad® and Apple TV® devices.
+endef
+
+define Package/libimobiledevice
+  $(call Package/libimobiledevice/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=$(ICONV_DEPENDS) +libplist +libusbmuxd +libopenssl
+endef
+
+define Package/libimobiledevice/description
+  $(call Package/libimobiledevice/Default/description)
+endef
+
+define Package/libimobiledevice-utils
+  $(call Package/libimobiledevice/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libimobiledevice
+endef
+
+define Package/libimobiledevice-utils/description
+  $(call Package/libimobiledevice/Default/description)
+  This package contains the libimobiledevice utilities.
+endef
+
+CONFIGURE_VARS += \
+       libusbmuxd_CFLAGS="-I$(STAGING_DIR)/usr/include" \
+       libusbmuxd_LIBS="-L$(STAGING_DIR)/usr/lib -lusbmuxd" \
+       openssl_CFLAGS=" " \
+       openssl_LIBS="-L$(STAGING_DIR)/usr/lib -lssl -lcrypto"
+
+CONFIGURE_ARGS += \
+       --without-cython \
+       --disable-largefile
+
+TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libimobiledevice $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libimobiledevice.{a,la,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libimobiledevice-*.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libimobiledevice/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libimobiledevice.so.* $(1)/usr/lib/
+endef
+
+define Package/libimobiledevice-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/idevice* $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libimobiledevice))
+$(eval $(call BuildPackage,libimobiledevice-utils))
diff --git a/libs/libinput/Makefile b/libs/libinput/Makefile
new file mode 100644 (file)
index 0000000..988488b
--- /dev/null
@@ -0,0 +1,63 @@
+#
+# Copyright (C) 2007-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:=libinput
+PKG_VERSION:=1.3.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://www.freedesktop.org/software/libinput/
+PKG_MD5SUM:=458fc483f7227d3c4c330f4abd6dfa77
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_CFLAGS+= -std=gnu99
+
+CONFIGURE_ARGS += --disable-libwacom --disable-tests --disable-documentation
+
+define Package/libinput
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=a library to handle input devices
+  URL:=http://freedesktop.org/wiki/Software/libinput/
+  DEPENDS:=+libevdev +mtdev +libudev
+endef
+
+define Package/libinput/description
+  libinput is a library to handle input devices in Wayland compositors
+  and to provide a generic X.Org input driver. It provides device
+  detection, device handling, input device event processing and
+  abstraction so minimize the amount of custom input code compositors
+  need to provide the common set of functionality that users expect.
+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/*.{la,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libinput/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/{udev,*.so*} $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,libinput))
diff --git a/libs/libinput/patches/001-no-locale.patch b/libs/libinput/patches/001-no-locale.patch
new file mode 100644 (file)
index 0000000..8f5c5a1
--- /dev/null
@@ -0,0 +1,22 @@
+--- 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)
+ {
+-      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);
+-
+-      freelocale(c_locale);
++      accel = strtod(prop, &endp);
+       if (*endp != '\0')
+               return 0.0;
diff --git a/libs/libinput/patches/002-static_assert.patch b/libs/libinput/patches/002-static_assert.patch
new file mode 100644 (file)
index 0000000..e5aaee2
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/src/evdev-tablet.c
++++ b/src/evdev-tablet.c
+@@ -1155,9 +1155,11 @@ static void
+ tablet_mark_all_axes_changed(struct tablet_dispatch *tablet,
+                            struct libinput_tablet_tool *tool)
+ {
++#if 0
+       static_assert(sizeof(tablet->changed_axes) ==
+                             sizeof(tool->axis_caps),
+                     "Mismatching array sizes");
++#endif
+       memcpy(tablet->changed_axes,
+              tool->axis_caps,
diff --git a/libs/liblo/Makefile b/libs/liblo/Makefile
new file mode 100644 (file)
index 0000000..bffca5a
--- /dev/null
@@ -0,0 +1,70 @@
+#
+# Copyright (C) 2010-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=liblo
+PKG_VERSION:=0.28
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/liblo
+PKG_MD5SUM:=e2a4391a08b49bb316c03e2034e06fa2
+
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/liblo/Default
+  TITLE:=Lightweight Open Sound Control (OSC)
+  URL:=http://liblo.sourceforge.net/
+endef
+
+define Package/liblo
+$(call Package/liblo/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Sound
+  TITLE+= library
+  DEPENDS:= +libpthread
+endef
+
+define Package/liblo-utils
+$(call Package/liblo/Default)
+  CATEGORY:=Sound
+  TITLE+= utilities
+  DEPENDS:= +liblo
+endef
+
+TARGET_CFLAGS += \
+       -Wno-error=maybe-uninitialized \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/lo $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblo.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liblo.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/liblo/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblo.so.* $(1)/usr/lib/
+endef
+
+define Package/liblo-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/osc{dump,send} $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,liblo))
+$(eval $(call BuildPackage,liblo-utils))
diff --git a/libs/liblo/patches/001-fix-musl-include.patch b/libs/liblo/patches/001-fix-musl-include.patch
new file mode 100644 (file)
index 0000000..f974bd3
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/server.c
++++ b/src/server.c
+@@ -48,7 +48,7 @@
+ #include <netdb.h>
+ #include <sys/socket.h>
+ #ifdef HAVE_POLL
+-#include <sys/poll.h>
++#include <poll.h>
+ #endif
+ #include <sys/un.h>
+ #include <arpa/inet.h>
diff --git a/libs/liblz4/Makefile b/libs/liblz4/Makefile
new file mode 100644 (file)
index 0000000..6e52067
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# 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
+
+# Although liblz4 exports a major.minor.patch version, it isn't always
+# incremented for new releases, so use the release tag instead.
+PKG_NAME:=liblz4
+PKG_VERSION:=r131
+PKG_RELEASE:=1
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_MAINTAINER:=Darik Horn <dajhorn@vanadac.com>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/Cyan4973/lz4.git
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/liblz4
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=Extremely fast compression
+       URL:=http://www.lz4.org/
+endef
+
+define Package/liblz4/description
+  LZ4 is a compression codec that features a very fast encoder and an
+  even faster decoder. This package provides the liblz4 shared library.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/Compile
+       $(MAKE) -C "$(PKG_BUILD_DIR)/lib" $(MAKE_INSTALL_FLAGS) \
+         CC="$(TARGET_CC)" \
+         CFLAGS="$(TARGET_CFLAGS)" \
+         PREFIX="$(CONFIGURE_PREFIX)" \
+         install
+endef
+
+define Build/InstallDev
+       $(CP) $(PKG_INSTALL_DIR)/* $(1)/
+endef
+
+define Package/liblz4/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblz4.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,liblz4))
diff --git a/libs/libmad/Makefile b/libs/libmad/Makefile
new file mode 100644 (file)
index 0000000..e5289ce
--- /dev/null
@@ -0,0 +1,79 @@
+#
+# 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:=libmad
+PKG_VERSION:=0.15.1b
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/mad \
+       ftp://ftp.mars.org/pub/mpeg/
+PKG_MD5SUM:=1be543bc30c56fb6bea1d7bf6a64e66c
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+FPM:=default
+ifeq ($(ARCH),armeb)
+  FPM:=arm
+endif
+ifeq ($(ARCH),i386)
+  FPM:=intel
+endif
+ifeq ($(ARCH),mipsel)
+  FPM:=mips
+endif
+
+define Package/libmad
+  SECTION:=libs
+  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
+       MAD is a high-quality MPEG audio decoder. It currently supports
+       MPEG-1 and the MPEG-2 extension to lower sampling frequencies,
+       as well as the de facto MPEG 2.5 format. All three audio layers -
+       Layer I, Layer II, and Layer III (i.e. MP3) - are fully implemented.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS+= \
+       --enable-shared \
+       --enable-static \
+       --enable-fpm="$(FPM)" \
+       --disable-debugging \
+       --enable-speed \
+
+MAKE_FLAGS+= \
+       CFLAGS="$(TARGET_CFLAGS)" \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/mad.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libmad/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libmad))
diff --git a/libs/libmad/patches/001-mips_removal_h_constraint.patch b/libs/libmad/patches/001-mips_removal_h_constraint.patch
new file mode 100644 (file)
index 0000000..b65555e
--- /dev/null
@@ -0,0 +1,70 @@
+diff -ur libmad-0.15.1b-orig/fixed.h libmad-0.15.1b/fixed.h
+--- libmad-0.15.1b-orig/fixed.h        2004-02-17 12:32:03.000000000 +1030
++++ libmad-0.15.1b/fixed.h     2009-08-05 10:46:30.000000000 +0930
+@@ -299,6 +299,23 @@
+ # elif defined(FPM_MIPS)
++/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
++#if defined (__GNUC__) && defined (__GNUC_MINOR__)
++#define __GNUC_PREREQ(maj, min) \
++      ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
++#else
++#define __GNUC_PREREQ(maj, min)  0
++#endif
++
++#if __GNUC_PREREQ(4,4)
++  typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
++# define MAD_F_MLX(hi, lo, x, y) \
++   do { \
++      u64_di_t __ll = (u64_di_t) (x) * (y); \
++      hi = __ll >> 32; \
++      lo = __ll; \
++   } while (0) 
++#else
+ /*
+  * This MIPS version is fast and accurate; the disposition of the least
+  * significant bit depends on OPT_ACCURACY via mad_f_scale64().
+@@ -328,6 +345,7 @@
+        : "%r" ((x) >> 12), "r" ((y) >> 16))
+ #  define MAD_F_MLZ(hi, lo)  ((mad_fixed_t) (lo))
+ # endif
++#endif /* __GNU_PREREQ(4,4) */
+ # if defined(OPT_SPEED)
+ #  define mad_f_scale64(hi, lo)  \
+diff -ur libmad-0.15.1b-orig/mad.h libmad-0.15.1b/mad.h
+--- libmad-0.15.1b-orig/mad.h  2004-02-17 13:25:44.000000000 +1030
++++ libmad-0.15.1b/mad.h       2009-08-05 10:42:40.000000000 +0930
+@@ -344,6 +344,23 @@
+ # elif defined(FPM_MIPS)
++/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
++#if defined (__GNUC__) && defined (__GNUC_MINOR__)
++#define __GNUC_PREREQ(maj, min) \
++      ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
++#else
++#define __GNUC_PREREQ(maj, min)  0
++#endif
++
++#if __GNUC_PREREQ(4,4)
++  typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
++# define MAD_F_MLX(hi, lo, x, y) \
++   do { \
++      u64_di_t __ll = (u64_di_t) (x) * (y); \
++      hi = __ll >> 32; \
++      lo = __ll; \
++   } while (0) 
++#else
+ /*
+  * This MIPS version is fast and accurate; the disposition of the least
+  * significant bit depends on OPT_ACCURACY via mad_f_scale64().
+@@ -373,6 +390,7 @@
+        : "%r" ((x) >> 12), "r" ((y) >> 16))
+ #  define MAD_F_MLZ(hi, lo)  ((mad_fixed_t) (lo))
+ # endif
++#endif /* __GNU_PREREQ(4,4) */
+ # if defined(OPT_SPEED)
+ #  define mad_f_scale64(hi, lo)  \
diff --git a/libs/libmcrypt/Makefile b/libs/libmcrypt/Makefile
new file mode 100644 (file)
index 0000000..f7f3827
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2006-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:=libmcrypt
+PKG_VERSION:=2.5.8
+PKG_RELEASE:=2
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_LICENSE:=LGPLv2.1
+PKG_LICENSE_FILES:=COPYING.LIB
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/mcrypt
+PKG_MD5SUM:=c4f491dd411a09e9de3b8702ea6f73eb
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_CFLAGS += $(FPIC)
+
+define Package/libmcrypt
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Cryptographic library
+  URL:=http://mcrypt.sourceforge.net/
+endef
+
+define Package/libmcrypt/description
+       libmcrypt is a cryptographic library that conveniently brings
+       together a variety of ciphers for convenient use.
+endef
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               --enable-shared \
+               --enable-static \
+       )
+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/libmcrypt.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libmcrypt-config $(1)/usr/bin/
+       $(SED) 's,-I$$$${prefix}/include,,g' $(1)/usr/bin/libmcrypt-config
+       $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr/bin/libmcrypt-config
+endef
+
+define Package/libmcrypt/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmcrypt.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libmcrypt))
diff --git a/libs/libmicrohttpd/Makefile b/libs/libmicrohttpd/Makefile
new file mode 100644 (file)
index 0000000..8b39084
--- /dev/null
@@ -0,0 +1,94 @@
+#
+# Copyright (C) 2010-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libmicrohttpd
+PKG_VERSION:=0.9.52
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/libmicrohttpd
+PKG_MD5SUM:=54797f6e763d417627f89f60e4ae0a431dab0523f92f83def23ea02d0defafea
+
+PKG_MAINTAINER:=Alexander Couzens <lynxis@fe80.eu>
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libmicrohttpd/Default
+   SECTION:=libs
+   CATEGORY:=Libraries
+   TITLE:=GNU libmicrohttpd is a library that runs an HTTP server.
+   URL:=http://www.gnu.org/software/libmicrohttpd/
+endef
+
+define Package/libmicrohttpd
+$(call Package/libmicrohttpd/Default)
+   TITLE+=(with-ssl)
+   DEPENDS:=+libpthread +libgcrypt +libgnutls +libgpg-error
+endef
+
+define Package/libmicrohttpd-no-ssl
+$(call Package/libmicrohttpd/Default)
+   TITLE+=(no-ssl)
+   DEPENDS:=+libpthread
+   VARIANT:=no-ssl
+   CONFLICTS:=libmicrohttpd
+endef
+
+define Package/libmicrohttpd/description/Default
+       GNU libmicrohttpd is a small C library that is supposed to make it easy
+       to run an HTTP server as part of another application.
+endef
+
+define Package/libmicrohttpd-no-ssl/description
+$(call Package/libmicrohttp/description/Default)
+endef
+
+CONFIGURE_ARGS+= \
+       --disable-curl \
+       --disable-spdy \
+       --without-openssl
+
+ifeq ($(BUILD_VARIANT),no-ssl)
+CONFIGURE_ARGS += \
+       --disable-https \
+       --without-gnutls
+else
+CONFIGURE_ARGS += \
+       --enable-https \
+       --with-gnutls
+endif
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libmicrohttpd/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+define Package/libmicrohttpd-no-ssl/install
+$(call Package/libmicrohttpd/install,$1)
+endef
+
+$(eval $(call BuildPackage,libmicrohttpd))
+$(eval $(call BuildPackage,libmicrohttpd-no-ssl))
diff --git a/libs/libmms/Makefile b/libs/libmms/Makefile
new file mode 100644 (file)
index 0000000..239c64f
--- /dev/null
@@ -0,0 +1,63 @@
+#
+# Copyright (C) 2010-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libmms
+PKG_VERSION:=0.6.4
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/libmms
+PKG_MD5SUM:=d6b665b335a6360e000976e770da7691
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=LGPLv2.1
+PKG_LICENSE_FILES:=COPYING.LIB
+
+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
+       LibMMS is a common library for parsing mms:// and mmsh:// type network streams.
+       These are commonly used to stream Windows Media Video content over the web.
+       LibMMS itself is only for receiving MMS stream,
+       it doesn't handle sending at all.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += $(if $(ICONV_FULL),-liconv)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libmms $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmms.{a,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/libmms/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmms.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libmms))
diff --git a/libs/libmodbus/Makefile b/libs/libmodbus/Makefile
new file mode 100644 (file)
index 0000000..4f9bab2
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# 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:=libmodbus
+PKG_VERSION:=3.1.4
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://libmodbus.org/releases
+PKG_MD5SUM:=b1a8fd3a40d2db4de51fb0cbcb201806
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_LICENSE:=GPL-3.0+ LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING COPYING.LESSER
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libmodbus
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=http://www.libmodbus.org
+  TITLE:=libmodbus
+endef
+
+define Package/libmodbus/description
+  A Modbus library for Linux, Mac OS X, FreeBSD, QNX and Win32.
+endef
+
+CONFIGURE_ARGS += --without-documentation --disable-tests
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/modbus $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmodbus.{so*,la} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmodbus.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libmodbus/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmodbus.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libmodbus))
diff --git a/libs/libmpdclient/Makefile b/libs/libmpdclient/Makefile
new file mode 100644 (file)
index 0000000..0666114
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# Copyright (C) 2011-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:=libmpdclient
+PKG_VERSION:=2.10
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://www.musicpd.org/download/libmpdclient/2/
+PGK_MD5SUM:=00606c630b905aa6196330373b366c29
+
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libmpdclient
+    TITLE:=libmpdclient
+    SECTION:=libs
+    CATEGORY:=Libraries
+    URL:=http://mpd.wikia.com/wiki/ClientLib:libmpdclient
+endef
+
+define Package/libmpdclient/description
+    A stable, documented, asynchronous API library for interfacing MPD in the C, C++ & Objective C languages.
+endef
+
+TARGET_CFLAGS+="-std=gnu99"
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               --disable-documentation \
+       )
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) \
+               $(1)/usr/include \
+               $(1)/usr/lib \
+               $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/* \
+               $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/* \
+               $(1)/usr/include/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig \
+               $(1)/usr/lib/
+endef
+
+define Package/libmpdclient/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libmpdclient.so* \
+               $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libmpdclient))
diff --git a/libs/libmpeg2/Makefile b/libs/libmpeg2/Makefile
new file mode 100644 (file)
index 0000000..9d3c052
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# Copyright (C) 2011 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:=libmpeg2
+PKG_VERSION:=0.5.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=libmpeg2-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://libmpeg2.sourceforge.net/files/
+PKG_MD5SUM:=0f92c7454e58379b4a5a378485bbd8ef
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libmpeg2
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=MPEG-1 & -2 decoding library
+  URL:=http://libmpeg2.sourceforge.net/
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+endef
+
+define Package/libmpeg2/decription
+  Libmpeg2 is a library for decoding MPEG-1 and MPEG-2 video streams
+endef
+
+CONFIGURE_ARGS += \
+       --disable-sdl \
+       --without-x \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/mpeg2dec \
+               $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libmpeg2{,convert}.{a,so*} \
+               $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmpeg2{,convert}.pc \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libmpeg2/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libmpeg2{,convert}.so.* \
+               $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libmpeg2))
diff --git a/libs/libmpeg2/patches/101-ppc_no_altivec.patch b/libs/libmpeg2/patches/101-ppc_no_altivec.patch
new file mode 100644 (file)
index 0000000..49251a0
--- /dev/null
@@ -0,0 +1,66 @@
+--- a/libmpeg2/motion_comp_altivec.c
++++ b/libmpeg2/motion_comp_altivec.c
+@@ -25,6 +25,8 @@
+ #ifdef ARCH_PPC
++#ifdef __I_WANT_ALTIVEC__
++
+ #ifdef HAVE_ALTIVEC_H
+ #include <altivec.h>
+ #endif
+@@ -1007,4 +1009,6 @@ static void MC_avg_xy_8_altivec (uint8_t
+ MPEG2_MC_EXTERN (altivec)
++#endif /* __I_WANT_ALTIVEC__ */
++
+ #endif
+--- a/libmpeg2/idct_altivec.c
++++ b/libmpeg2/idct_altivec.c
+@@ -25,6 +25,8 @@
+ #ifdef ARCH_PPC
++#ifdef __I_WANT_ALTIVEC__
++
+ #ifdef HAVE_ALTIVEC_H
+ #include <altivec.h>
+ #endif
+@@ -283,4 +285,6 @@ void mpeg2_idct_altivec_init (void)
+     }
+ }
++#endif /* __I_WANT_ALTIVEC__ */
++
+ #endif
+--- a/libmpeg2/idct.c
++++ b/libmpeg2/idct.c
+@@ -251,11 +251,13 @@ void mpeg2_idct_init (uint32_t accel)
+     } else
+ #endif
+ #ifdef ARCH_PPC
++#ifdef __I_WANT_ALTIVEC__
+     if (accel & MPEG2_ACCEL_PPC_ALTIVEC) {
+       mpeg2_idct_copy = mpeg2_idct_copy_altivec;
+       mpeg2_idct_add = mpeg2_idct_add_altivec;
+       mpeg2_idct_altivec_init ();
+     } else
++#endif /* __I_WANT_ALTIVEC__ */
+ #endif
+ #ifdef ARCH_ALPHA
+     if (accel & MPEG2_ACCEL_ALPHA_MVI) {
+--- a/libmpeg2/motion_comp.c
++++ b/libmpeg2/motion_comp.c
+@@ -43,9 +43,11 @@ void mpeg2_mc_init (uint32_t accel)
+     else
+ #endif
+ #ifdef ARCH_PPC
++#ifdef __I_WANT_ALTIVEC__
+     if (accel & MPEG2_ACCEL_PPC_ALTIVEC)
+       mpeg2_mc = mpeg2_mc_altivec;
+     else
++#endif /* __I_WANT_ALTIVEC__ */
+ #endif
+ #ifdef ARCH_ALPHA
+     if (accel & MPEG2_ACCEL_ALPHA)
diff --git a/libs/libmpeg2/patches/102-arm_data_preload_check.patch b/libs/libmpeg2/patches/102-arm_data_preload_check.patch
new file mode 100644 (file)
index 0000000..86793fc
--- /dev/null
@@ -0,0 +1,19 @@
+diff -urN libmpeg2-0.5.1/libmpeg2/motion_comp_arm_s.S libmpeg2-0.5.1.new/libmpeg2/motion_comp_arm_s.S
+--- libmpeg2-0.5.1/libmpeg2/motion_comp_arm_s.S        2008-07-09 21:16:05.000000000 +0200
++++ libmpeg2-0.5.1.new/libmpeg2/motion_comp_arm_s.S    2012-07-30 15:22:58.664964215 +0200
+@@ -19,6 +19,15 @@
+ @ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++@ Data preload is supported only by ARM V5TE and above
++
++#if (defined (__ARM_ARCH_2__) || defined (__ARM_ARCH_3__) \
++     || defined (__ARM_ARCH_3M__) || defined (__ARM_ARCH_4__) \
++     || defined (__ARM_ARCH_4T__) || defined (__ARM_ARCH_5__) \
++     || defined (__ARM_ARCH_5T__))
++.macro pld reg
++.endm
++#endif
+       .text
+ @ ----------------------------------------------------------------
diff --git a/libs/libnatpmp/Makefile b/libs/libnatpmp/Makefile
new file mode 100644 (file)
index 0000000..f90d9bc
--- /dev/null
@@ -0,0 +1,87 @@
+#
+# Copyright (C) 2011-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:=libnatpmp
+PKG_VERSION:=20140401
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://miniupnp.free.fr/files
+PKG_MD5SUM:=7c9a7c76e200ead4e6447fe4b105f676
+PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
+PKG_LICENSE:=BSD-3c
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libnatpmp/Default
+  TITLE:=NAT Port Mapping Protocol (NAT-PMP)
+  URL:=http://miniupnp.free.fr/libnatpmp.html
+endef
+
+define Package/libnatpmp/Default/description
+  libnatpmp is an attempt to make a portable and fully compliant implementation
+  of the protocol for the client side. It is based on non blocking sockets and
+  all calls of the API are asynchronous. It is therefore very easy to integrate
+  the NAT-PMP code to any event driven code.
+endef
+
+define Package/libnatpmp
+  $(call Package/libnatpmp/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= library
+endef
+
+define Package/libnatpmp/description
+  $(call Package/libnatpmp/Default/description)
+  This package contains the shared library.
+endef
+
+define Package/natpmpc
+  $(call Package/libnatpmp/Default)
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Firewall
+  TITLE+= client
+  DEPENDS:=+libnatpmp
+endef
+
+define Package/natpmpc/description
+  $(call Package/libnatpmp/Default/description)
+  This package contains the natpmp client.
+endef
+
+MAKE_FLAGS += \
+       COPTS="$(TARGET_CFLAGS)" \
+       PREFIX="$(PKG_INSTALL_DIR)" \
+       OS="Linux"
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/declspec.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/natpmp.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnatpmp*.{so*,a} $(1)/usr/lib/
+endef
+
+define Package/libnatpmp/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libnatpmp.so.* $(1)/usr/lib/
+endef
+
+define Package/natpmpc/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/natpmpc $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libnatpmp))
+$(eval $(call BuildPackage,natpmpc))
diff --git a/libs/libnatpmp/patches/001-install_declspec.patch b/libs/libnatpmp/patches/001-install_declspec.patch
new file mode 100644 (file)
index 0000000..d79dd3f
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -56,7 +56,7 @@ else
+ endif
+ endif
+-HEADERS = natpmp.h
++HEADERS = natpmp.h declspec.h
+ EXECUTABLES = testgetgateway natpmpc-shared natpmpc-static
diff --git a/libs/libnet-1.2.x/Makefile b/libs/libnet-1.2.x/Makefile
new file mode 100644 (file)
index 0000000..84591f0
--- /dev/null
@@ -0,0 +1,71 @@
+#
+# 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:=libnet
+PKG_VERSION:=1.2-rc3
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://sourceforge.net/projects/libnet-dev/files/
+PKG_MD5SUM:=f051e6e5bdecddb90f77c701c2ca1804
+PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
+PKG_LICENSE:=GPL-2.0
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_CFLAGS += $(FPIC)
+
+define Package/libnet-1.2.x
+ SECTION:=libs
+ CATEGORY:=Libraries
+ DEPENDS:=+libpcap
+ TITLE:=Low-level packet creation library
+endef
+
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static
+
+CONFIGURE_VARS += \
+       ac_cv_libnet_endianess=$(ENDIANESS) \
+       libnet_cv_have_packet_socket=yes \
+       LL_INT_TYPE=libnet_link_linux
+
+define Build/Configure
+       (cd $(PKG_BUILD_DIR); touch \
+       configure.in \
+       include.m4 \
+       aclocal.m4 \
+       Makefile.in \
+       );
+       $(call Build/Configure/Default)
+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/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/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
+endef
+
+define Package/libnet-1.2.x/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libnet-1.2.x))
diff --git a/libs/libnet-1.2.x/patches/100-musl-compat.patch b/libs/libnet-1.2.x/patches/100-musl-compat.patch
new file mode 100644 (file)
index 0000000..b95366a
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/src/libnet_link_linux.c
++++ b/src/libnet_link_linux.c
+@@ -30,13 +30,8 @@
+ #include <sys/time.h>
+ #include <net/if.h>
+-#if (__GLIBC__)
+ #include <netinet/if_ether.h>
+ #include <net/if_arp.h>
+-#else
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
+-#endif
+ #if (HAVE_PACKET_SOCKET)
+ #ifndef SOL_PACKET
diff --git a/libs/libnopoll/Makefile b/libs/libnopoll/Makefile
new file mode 100644 (file)
index 0000000..fe96405
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# libnopoll - Makefile for noPoll C WebSocket library
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nopoll
+PKG_VERSION:=0.4.2
+PKG_RELEASE:=1
+
+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_MAINTAINER:=John Clark <inindev@gmail.com>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libnopoll
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libopenssl
+  TITLE:=noPoll C WebSocket Library
+  URL:=http://www.aspl.es/nopoll
+endef
+
+define Package/libnopoll/description
+  This package contains the noPoll C WebSocket library.
+endef
+
+CONFIGURE_ARGS += \
+       --enable-nopoll-log=no \
+       --enable-nopoll-doc=no
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/{lib,include}
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnopoll.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libnopoll/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnopoll.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libnopoll))
diff --git a/libs/libogg/Makefile b/libs/libogg/Makefile
new file mode 100644 (file)
index 0000000..e5be952
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2008-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:=libogg
+PKG_VERSION:=1.3.2
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://downloads.xiph.org/releases/ogg/
+PKG_MD5SUM:=5c3a34309d8b98640827e5d0991a4015
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libogg
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=libogg
+  URL:=http://xiph.org/ogg/
+endef
+
+define Package/libogg/description
+Ogg project codecs use the Ogg bitstream format to arrange the raw,
+compressed bitstream into a more robust, useful form.  For example,
+the Ogg bitstream makes seeking, time stamping and error recovery
+possible, as well as mixing several sepearate, concurrent media
+streams into a single physical bitstream.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/ogg/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/ogg/* $(1)/usr/include/ogg/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DIR) $(1)/usr/share/aclocal/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(1)/usr/share/aclocal/
+endef
+
+define Package/libogg/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libogg))
diff --git a/libs/liboil/Makefile b/libs/liboil/Makefile
new file mode 100644 (file)
index 0000000..8850c74
--- /dev/null
@@ -0,0 +1,70 @@
+# 
+# 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:=liboil
+PKG_VERSION:=0.3.17
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://liboil.freedesktop.org/download/
+PKG_MD5SUM:=47dc734f82faeb2964d97771cfd2e701
+
+PKG_LICENSE:=FREE
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/liboil
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=simple functions optimized for various CPUs
+  URL:=http://liboil.freedesktop.org/wiki/
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+  DEPENDS:=+librt $(ICONV_DEPENDS) $(INTL_DEPENDS)
+endef
+
+define Package/liboil/description
+  Liboil is a library of simple functions that are optimized for various CPUs.
+  These functions are generally loops implementing simple algorithms, such as
+  converting an array of N integers to floating-point numbers or multiplying
+  and summing an array of N numbers. Such functions are candidates for significant
+  optimization using various techniques, especially by using extended instructions
+  provided by modern CPUs (Altivec, MMX, SSE, etc.).
+endef
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+
+TARGET_CFLAGS += $(FPIC) $(if $(ICONV_FULL),-liconv) $(if $(INTL_FULL),-lintl)
+
+# XXX: VFP_CFLAGS is set to '-mfpu=vfp' on arm by configure, but that breaks 
+# final linking stages, so override it until we find why
+MAKE_FLAGS += \
+       VFP_CFLAGS="" \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/liboil-0.3/* $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liboil-0.3.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liboil-0.3.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/liboil/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liboil-0.3.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,liboil))
diff --git a/libs/liboping/Makefile b/libs/liboping/Makefile
new file mode 100644 (file)
index 0000000..ffed96d
--- /dev/null
@@ -0,0 +1,84 @@
+#
+# Copyright (C) 2009-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:=liboping
+PKG_VERSION:=1.9.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
+PKG_LICENSE:=LGPL-2.1+
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://noping.cc/files
+PKG_MD5SUM:=9c9f65bfd297d7e7092c7f219c31f66a
+
+PKG_FIXUP:=autoreconf
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/liboping/Default
+  URL:=http://verplant.org/liboping/
+endef
+
+define Package/liboping
+$(call Package/liboping/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=C library to generate ICMP echo requests.
+endef
+
+define Package/oping
+$(call Package/liboping/Default)
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Send ICMP echo request to network hosts
+  DEPENDS+= +liboping
+endef
+
+define Package/noping
+$(call Package/liboping/Default)
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Ncurses application to send ICMP echo request to network hosts
+  DEPENDS+= +liboping +libncurses
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --without-perl-bindings \
+       --enable-shared \
+       --enable-static
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/oping.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liboping.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/liboping/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liboping.so.* $(1)/usr/lib/
+endef
+
+define Package/oping/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/oping $(1)/usr/bin/
+endef
+
+define Package/noping/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/noping $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,liboping))
+$(eval $(call BuildPackage,oping))
+$(eval $(call BuildPackage,noping))
diff --git a/libs/liboping/patches/01-no-werror.patch b/libs/liboping/patches/01-no-werror.patch
new file mode 100644 (file)
index 0000000..8589284
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = foreign no-dependenci
+ SUBDIRS = mans
+ if COMPILER_IS_GCC
+-AM_CFLAGS = -Wall -Werror
++AM_CFLAGS = -Wall
+ endif
+ include_HEADERS = oping.h
diff --git a/libs/libowfat/Makefile b/libs/libowfat/Makefile
new file mode 100644 (file)
index 0000000..01bd25a
--- /dev/null
@@ -0,0 +1,61 @@
+#
+# 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_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://www.fefe.de/libowfat
+PKG_MD5SUM:=f0119532ea834ce9e80afe49d7d85512
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+# set to 1 to enable debugging
+DEBUG=
+
+define Package/libowfat
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=reimplemented libdjb under GPL
+  URL:=http://www.fefe.de/libowfat/
+endef
+
+define Build/Configure
+endef
+
+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)" \
+       OS="Linux"
+
+# work around a nasty gcc bug
+ifneq ($(CONFIG_GCC_VERSION_4_2_4),)
+  LOWFAT_MAKEOPTS += WOPTS=""
+endif
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) $(LOWFAT_MAKEOPTS)
+endef
+
+define Build/InstallDev
+       mkdir -p $(1)/usr/include/libowfat
+       $(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libowfat
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/*.a $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,libowfat))
diff --git a/libs/libowfat/patches/001-fixbuild.patch b/libs/libowfat/patches/001-fixbuild.patch
new file mode 100644 (file)
index 0000000..a21fcd0
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -278,6 +278,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
++socket_remote4.o: havescope.h
++
+ 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
diff --git a/libs/libp11/Makefile b/libs/libp11/Makefile
new file mode 100644 (file)
index 0000000..c477d2b
--- /dev/null
@@ -0,0 +1,61 @@
+#
+# Copyright (C) 2011-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:=libp11
+PKG_VERSION:=0.4.1
+PKG_RELEASE:=2
+PKG_MD5SUM:=70489f6dbe0b7fd72aab010c25016fa047723f67ea50ce9ae73bc8d38181b673
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE_URL:=https://github.com/OpenSC/libp11/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+
+PKG_FIXUP:=libtool
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libp11
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=PKCS#11 wrapper library
+  URL:=https://www.opensc-project.org/opensc/wiki/libp11
+  DEPENDS:=+libopenssl
+  CONFLICTS:=engine_pkcs11
+endef
+
+define Package/libp11/description
+  Libp11 is a library implementing a small layer on top of PKCS#11 API
+  to make using PKCS#11 implementations easier.
+endef
+
+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/
+       $(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/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libp11.pc $(1)/usr/lib/pkgconfig/libp11.pc
+endef
+
+define Package/libp11/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libp11.so.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/engines
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/engines/*.so* $(1)/usr/lib/engines
+       $(LN) pkcs11.so $(1)/usr/lib/engines/libpkcs11.so
+endef
+
+$(eval $(call BuildPackage,libp11))
diff --git a/libs/libp11/patches/001-fix-install.patch b/libs/libp11/patches/001-fix-install.patch
new file mode 100644 (file)
index 0000000..eb9b774
--- /dev/null
@@ -0,0 +1,69 @@
+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)
+ 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)
+-
+ 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)
+         fi; \
+       done
+ check-am: all-am
+-      $(MAKE) $(AM_MAKEFLAGS) check-local
++      $(MAKE) $(AM_MAKEFLAGS)
+ check: check-am
+ all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) config.h
+ installdirs:
+@@ -910,7 +910,7 @@ install-dvi-am:
+ install-exec-am: 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
+ .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 \
+-      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:
diff --git a/libs/libplist/Makefile b/libs/libplist/Makefile
new file mode 100644 (file)
index 0000000..bb61336
--- /dev/null
@@ -0,0 +1,105 @@
+#
+# Copyright (C) 2012-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:=libplist
+PKG_VERSION:=1.13
+PKG_RELEASE:=2
+
+PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
+PKG_LICENSE:=LGPL-2.1+
+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:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libplist/Default
+  TITLE:=Apple property list
+  URL:=http://www.libimobiledevice.org/
+endef
+
+define Package/libplist/Default/description
+  A library to handle Apple Property List format whereas it's binary or XML
+endef
+
+define Package/libplist
+  $(call Package/libplist/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libxml2
+  TITLE+= library
+endef
+
+define Package/libplist/description
+  $(call Package/libplist/Default/description)
+endef
+
+define Package/libplistcxx
+  $(call Package/libplist/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libplist +libstdcpp
+  TITLE+= C++ library
+endef
+
+define Package/libplistcxx/description
+  $(call Package/libplist/Default/description)
+  This package contains the libplist C++ shared library.
+endef
+
+define Package/libplist-utils
+  $(call Package/libplist/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libplist
+  TITLE+= converter
+endef
+
+define Package/libplist-utils/description
+  $(call Package/libplist/Default/description)
+  This package contains the libplist utilities.
+endef
+
+CONFIGURE_ARGS += \
+       --without-cython
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/plist $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libplist*.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libplist*.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libplist/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libplist.so.* $(1)/usr/lib/
+endef
+
+define Package/libplistcxx/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libplist++.so.* $(1)/usr/lib/
+endef
+
+define Package/libplist-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/plistutil $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libplist))
+$(eval $(call BuildPackage,libplistcxx))
+$(eval $(call BuildPackage,libplist-utils))
diff --git a/libs/libsamplerate/Makefile b/libs/libsamplerate/Makefile
new file mode 100644 (file)
index 0000000..a761914
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# 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:=libsamplerate
+PKG_VERSION:=0.1.8
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.mega-nerd.com/SRC/
+PKG_MD5SUM:=1c7fb25191b4e6e3628d198a66a84f47
+
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libsamplerate
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libsndfile
+  TITLE:=Sample Rate Converter
+  URL:=http://www.mega-nerd.com/SRC/index.html
+endef
+
+define Package/libsamplerate/description
+ Secret Rabbit Code (aka libsamplerate) is a Sample Rate
+ Converter for audio.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --disable-fftw \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)
+       $(CP) $(PKG_INSTALL_DIR)/* $(1)/
+endef
+
+define Package/libsamplerate/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsamplerate.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libsamplerate))
diff --git a/libs/libsearpc/Makefile b/libs/libsearpc/Makefile
new file mode 100644 (file)
index 0000000..caf489e
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# 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:=libsearpc
+PKG_VERSION:=5.1.4
+PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
+PKG_LICENSE:=GPL-3.0
+
+PKG_SOURCE_PROTO:=git
+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_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+$(call include_mk, python-package.mk)
+
+define Package/libsearpc
+    SECTION:=libs
+    CATEGORY:=Libraries
+    TITLE:=Seafile RPC Library
+    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+    URL:=http://seafile.com/
+    DEPENDS:=+glib2 +jansson +python $(ICONV_DEPENDS)
+endef
+
+define Package/libsearpc/description
+    Searpc is a simple C language RPC framework based on GObject system.
+    Searpc handles the serialization/deserialization part of RPC,
+    the transport part is left to users.
+endef
+
+CONFIGURE_ARGS += --enable-compile-demo=no \
+                   --disable-server-pkg
+
+TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -liconv
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/{bin,include}
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsearpc.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/searpc* $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsearpc.pc $(1)/usr/lib/pkgconfig/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/searpc-codegen.py $(1)/usr/bin/
+endef
+
+define Package/libsearpc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsearpc.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/pysearpc $(1)$(PYTHON_PKG_DIR)
+       find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
+endef
+
+$(eval $(call BuildPackage,libsearpc))
diff --git a/libs/libseccomp/Makefile b/libs/libseccomp/Makefile
new file mode 100644 (file)
index 0000000..1ad5d2b
--- /dev/null
@@ -0,0 +1,74 @@
+#
+# 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:=libseccomp
+PKG_VERSION:=2.2.1
+PKG_RELEASE:=1
+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_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
+
+PKG_INSTALL:=1
+PKG_LIBTOOL_PATHS:=. lib
+PKG_CHECK_FORMAT_SECURITY:=0
+
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_KERNEL_SECCOMP
+
+include $(INCLUDE_DIR)/package.mk
+
+
+define Package/libseccomp/Default
+  SUBMENU:=
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=seccomp
+  URL:=https://github.com/seccomp/libseccomp/wiki
+endef
+
+define Package/libseccomp/Default/description
+ The libseccomp library provides an easy to use, platform independent, interface
+ to the Linux Kernel's syscall filtering mechanism.  The libseccomp API is
+ designed to abstract away the underlying BPF based syscall filter language and
+ present a more conventional function-call based filtering interface that should
+ be familiar to, and easily adopted by, application developers.
+endef
+
+define Package/libseccomp
+$(call Package/libseccomp/Default)
+  TITLE+= (library)
+  DEPENDS+=
+endef
+
+define Package/libseccomp/description
+ This package contains the seccomp library.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/seccomp.h \
+               $(1)/usr/include/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libseccomp.{a,so*} \
+               $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libseccomp.pc \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libseccomp/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libseccomp.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libseccomp))
diff --git a/libs/libseccomp/patches/100-dont-use-linux-prctl.h-with-musl.patch b/libs/libseccomp/patches/100-dont-use-linux-prctl.h-with-musl.patch
new file mode 100644 (file)
index 0000000..4093ca3
--- /dev/null
@@ -0,0 +1,14 @@
+Index: libseccomp-2.2.1/src/system.h
+===================================================================
+--- libseccomp-2.2.1.orig/src/system.h
++++ libseccomp-2.2.1/src/system.h
+@@ -23,7 +23,9 @@
+ #define _SYSTEM_H
+ #include <linux/filter.h>
++#ifdef __GLIBC__
+ #include <linux/prctl.h>
++#endif
+ #include "configure.h"
diff --git a/libs/libshout/Makefile b/libs/libshout/Makefile
new file mode 100644 (file)
index 0000000..d491e32
--- /dev/null
@@ -0,0 +1,119 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libshout
+PKG_VERSION:=2.4.1
+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+
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>, \
+               Ted Hess <thess@kitschensync.net>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libshout/default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Shoutcast client library
+  URL:=http://www.icecast.org
+  DEPENDS:= +libvorbisidec +libpthread
+endef
+
+define Package/libshout
+  $(call Package/libshout/default)
+  TITLE+= (no theora)
+  DEPENDS+= +libopenssl
+  VARIANT:=notheora
+endef
+
+define Package/libshout-nossl
+  $(call Package/libshout/default)
+  TITLE+= (no ssl/theora)
+  VARIANT:=nossl
+endef
+
+define Package/libshout-full
+  $(call Package/libshout/default)
+  TITLE+=(full)
+  DEPENDS+= +libtheora +libopenssl
+  VARIANT:=full
+endef
+
+define Package/libshout/description/default
+ libshout allows applications to easily communicate and broadcast
+ to an Icecast streaming media server. It handles the socket connections,
+ metadata communication, and data streaming for the calling application,
+ and lets developers focus on feature sets instead of implementation
+ details.
+endef
+
+define Package/libshout/description
+  $(call Package/libshout/description/default)
+  .
+  This package does not have Theora support.
+endef
+
+define Package/libshout-nossl/description
+  $(call Package/libshout/description/default)
+  .
+  This package does not have OpenSSL or Theora support.
+endef
+
+Package/libshout-full/description=$(Package/libshout/description/default)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --disable-speex
+
+ifeq ($(BUILD_VARIANT),notheora)
+  CONFIGURE_ARGS += --disable-theora
+endif
+
+ifeq ($(BUILD_VARIANT),nossl)
+  CONFIGURE_ARGS += --disable-theora --with-openssl="no"
+endif
+
+CONFIGURE_VARS += \
+       VORBIS_CFLAGS="-I$(STAGING_DIR)/usr/include/tremor/" \
+       VORBIS_LIBS="$(TARGET_LDFLAGS) -lvorbisidec" \
+
+TARGET_CFLAGS += $(FPIC) -Wl,-rpath-link="$(STAGING_DIR)/usr/lib"
+
+PACKAGE_CONFIG_FILE=shout$(if $(findstring $(BUILD_VARIANT),full),-full).pc
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/shout $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libshout.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/shout.pc $(1)/usr/lib/pkgconfig/$(PACKAGE_CONFIG_FILE)
+       $(SED) 's| -I/usr/include||' $(1)/usr/lib/pkgconfig/$(PACKAGE_CONFIG_FILE)
+endef
+
+define Package/libshout/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libshout.so.* $(1)/usr/lib/
+endef
+
+Package/libshout-full/install=$(Package/libshout/install)
+Package/libshout-nossl/install=$(Package/libshout/install)
+
+$(eval $(call BuildPackage,libshout))
+$(eval $(call BuildPackage,libshout-nossl))
+$(eval $(call BuildPackage,libshout-full))
diff --git a/libs/libshout/patches/100-add_with-openssl_option.patch b/libs/libshout/patches/100-add_with-openssl_option.patch
new file mode 100644 (file)
index 0000000..7319e29
--- /dev/null
@@ -0,0 +1,27 @@
+--- a/m4/xiph_openssl.m4
++++ b/m4/xiph_openssl.m4
+@@ -29,14 +29,16 @@ else
+     fi
+ fi
+-# Now try linking to openssl
+-xt_save_CFLAGS="$CFLAGS"
+-xt_save_LIBS="$LIBS"
+-CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
+-LIBS="$OPENSSL_LIBS $LIBS"
+-AC_TRY_LINK([#include <openssl/ssl.h>], [void *a = SSL_new], [openssl_ok='yes'])
+-CFLAGS="$xt_save_CFLAGS"
+-LIBS="$xt_save_LIBS"
++if test "x$openssl_prefix" != "xno"; then
++    # Now try linking to openssl
++    xt_save_CFLAGS="$CFLAGS"
++    xt_save_LIBS="$LIBS"
++    CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
++    LIBS="$OPENSSL_LIBS $LIBS"
++    AC_TRY_LINK([#include <openssl/ssl.h>], [void *a = SSL_new], [openssl_ok='yes'])
++    CFLAGS="$xt_save_CFLAGS"
++    LIBS="$xt_save_LIBS"
++fi
+ if test "$openssl_ok" = "yes"; then
+     AC_DEFINE(HAVE_OPENSSL, 1, [Define if you have libopenssl.])
diff --git a/libs/libshout/patches/120-vorbis-c.patch b/libs/libshout/patches/120-vorbis-c.patch
new file mode 100644 (file)
index 0000000..be7ca7a
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/codec_vorbis.c
++++ b/src/codec_vorbis.c
+@@ -28,7 +28,7 @@
+ #endif
+ #include <stdlib.h>
+-#include <vorbis/codec.h>
++#include <tremor/ivorbiscodec.h>
+ #include "shout_private.h"
+ #include "format_ogg.h"
diff --git a/libs/libshout/patches/140-no_example_doc_win32.patch b/libs/libshout/patches/140-no_example_doc_win32.patch
new file mode 100644 (file)
index 0000000..4f09328
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -3,14 +3,14 @@
+ AUTOMAKE_OPTIONS = 1.6 foreign
+ ACLOCAL_AMFLAGS = -I m4
+-SUBDIRS = include src examples doc win32
++SUBDIRS = include src
+ EXTRA_DIST = INSTALL m4/shout.m4 m4/acx_pthread.m4 \
+       m4/ogg.m4 m4/vorbis.m4 m4/xiph_compiler.m4 m4/xiph_net.m4 \
+       m4/xiph_types.m4 libshout.ckport
+ docdir = $(datadir)/doc/$(PACKAGE)
+-doc_DATA = COPYING NEWS README examples/example.c examples/nonblocking.c
++doc_DATA = COPYING README
+ m4datadir = $(datadir)/aclocal
+ m4data_DATA = m4/shout.m4
diff --git a/libs/libsigc++/Makefile b/libs/libsigc++/Makefile
new file mode 100644 (file)
index 0000000..524bb6f
--- /dev/null
@@ -0,0 +1,63 @@
+#
+# 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:=libsigc++
+PKG_VERSION:=2.5.4
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNOME/libsigc++/2.5
+PKG_MD5SUM:=0b74492da5f640ab69888a984c6520d7
+PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
+PKG_LICENSE:=LGPL-2.1
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libsigcxx
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=typesafe callback system for standard C++
+  URL:=http://libsigc.sourceforge.net/
+  DEPENDS:=+libstdcpp
+endef
+
+define Package/libsigcxx/description
+ It allows you to define signals and to connect those signals to any
+ callback function, either global or a member function, regardless of
+ whether it is static or virtual.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+TARGET_CPPFLAGS +=  \
+       -fno-strict-aliasing -fno-inline \
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/sigc++-2.0 $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsigc-2.0.{a,so*} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/sigc++-2.0 $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sigc++-2.0.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libsigcxx/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsigc-2.0.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libsigcxx))
diff --git a/libs/libsigc++/patches/001-no_doc_tests_examples.patch b/libs/libsigc++/patches/001-no_doc_tests_examples.patch
new file mode 100644 (file)
index 0000000..f2c22c3
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -22,7 +22,7 @@ doc_subdirs = docs
+ else
+ doc_subdirs =
+ endif
+-SUBDIRS = sigc++ tests examples $(doc_subdirs)
++SUBDIRS = sigc++
+ sigc_configdir = $(libdir)/$(SIGCXX_MODULE_NAME)/include
+ nodist_sigc_config_HEADERS = sigc++config.h
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -204,7 +204,7 @@ am__define_uniq_tagged_files = \
+ ETAGS = etags
+ CTAGS = ctags
+ CSCOPE = cscope
+-DIST_SUBDIRS = sigc++ tests examples docs
++DIST_SUBDIRS = sigc++
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ distdir = $(PACKAGE)-$(VERSION)
+ top_distdir = $(distdir)
diff --git a/libs/libsndfile/Makefile b/libs/libsndfile/Makefile
new file mode 100644 (file)
index 0000000..fa92f14
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2007-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:=libsndfile
+PKG_VERSION:=1.0.26
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.mega-nerd.com/libsndfile/files/
+PKG_MD5SUM:=ec810a0c60c08772a8a5552704b63393
+
+PKG_LICENSE:=LGPLv2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libsndfile
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Library for reading/writing audio files
+  URL:=http://www.mega-nerd.com/libsndfile/
+  MAINTAINER:=Peter Wagner <tripolar@gmx.at>
+  DEPENDS:=@!avr32
+endef
+
+define Package/libsndfile/description
+ libsndfile is a library of C routines for reading and writing files
+ containing sampled audio data.
+endef
+
+CONFIGURE_ARGS+= \
+       --disable-alsa \
+       --disable-external-libs \
+       --disable-sqlite
+
+CONFIGURE_VARS += \
+       ac_cv_sys_file_offset_bits=64 \
+       ac_cv_sys_large_files=yes \
+       ac_cv_sys_largefile_CFLAGS=-D_LARGFILE_SOURCE \
+       ac_cv_sys_largefile_LDFLAGS= \
+       ac_cv_sys_largefile_LIBS= \
+       ac_cv_sys_largefile_source=yes
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)
+       $(CP) $(PKG_INSTALL_DIR)/* $(1)/
+endef
+
+define Package/libsndfile/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsndfile.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libsndfile))
diff --git a/libs/libsoxr/Makefile b/libs/libsoxr/Makefile
new file mode 100644 (file)
index 0000000..9881fbb
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# 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
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libsoxr
+PKG_VERSION:=0.1.1
+PKG_RELEASE:=3
+
+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_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
+               Mike Brady <mikebrady@eircom.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
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libsoxr
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=The SoX Resampler library
+  URL:=http://sourceforge.net/projects/soxr/
+  DEPENDS:= +libpthread
+endef
+
+define Package/libsoxr/description
+  The SoX Resampler library
+  High quality, one-dimensional sample-rate conversion library
+endef
+
+CMAKE_OPTIONS:= -DBUILD_TESTS=0 -DBUILD_EXAMPLES=0
+CMAKE_OPTIONS+= -DHAVE_WORDS_BIGENDIAN_EXITCODE=$(if $(CONFIG_BIG_ENDIAN),0,1)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/soxr.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsoxr.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/soxr.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libsoxr/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsoxr.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libsoxr))
diff --git a/libs/libstrophe/Config.in b/libs/libstrophe/Config.in
new file mode 100644 (file)
index 0000000..ec45f75
--- /dev/null
@@ -0,0 +1,14 @@
+choice
+       depends on PACKAGE_libstrophe
+       prompt "Select XML library"
+       default libstrophe-expat
+
+config libstrophe-expat
+       bool "expat"
+       select PACKAGE_libexpat
+
+config libstrophe-libxml2
+       bool "libxml2"
+       select PACKAGE_libxml2
+
+endchoice
diff --git a/libs/libstrophe/Makefile b/libs/libstrophe/Makefile
new file mode 100644 (file)
index 0000000..61b7be0
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# 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:=libstrophe
+PKG_VERSION:=0.9.1
+PKG_RELEASE=1
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Chih-Wei Chen <changeway@gmail.com>
+
+PKG_SOURCE_PROTO:=git
+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_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_libstrophe-libxml2 \
+       CONFIG_libstrophe-expat
+
+include $(INCLUDE_DIR)/package.mk
+
+ifeq ($(CONFIG_libstrophe-libxml2),y)
+CONFIGURE_ARGS += \
+       --with-libxml2
+endif
+
+define Package/libstrophe
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=XMPP client library
+       URL:=http://strophe.im/libstrophe
+       DEPENDS:= +libopenssl +libstrophe-libxml2:libxml2 +libstrophe-expat:libexpat
+       MENU:=1
+endef
+
+define Package/libstrophe/description
+       A simple, lightweight C library for writing XMPP clients
+endef
+
+define Package/libstrophe/config
+       source "$(SOURCE)/Config.in"
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/ $(1)/usr/
+
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libstrophe.{la,a,so*} $(1)/usr/lib/
+endef
+
+define Package/libstrophe/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libstrophe.so.* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,libstrophe))
diff --git a/libs/libtalloc/Makefile b/libs/libtalloc/Makefile
new file mode 100644 (file)
index 0000000..1bb4007
--- /dev/null
@@ -0,0 +1,112 @@
+#
+# 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:=talloc
+PKG_VERSION:=2.1.7
+MAJOR_VERSION:=2
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://www.samba.org/ftp/talloc/
+PKG_MD5SUM:=d6763d65d03d627816ae1d50c74576fe
+
+PKG_MAINTAINER:=Lucile Quirion <lucile.quirion@savoirfairelinux.com>
+PKG_LICENSE:=LGPL-3.0+
+
+PKG_BUILD_PARALLEL:=0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+define Package/libtalloc
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Core memory allocator used in Samba
+  DEPENDS:=+USE_GLIBC:libbsd $(ICONV_DEPENDS) +libattr
+  URL:=https://talloc.samba.org/talloc/doc/html/index.html
+endef
+
+define Package/libtalloc/description
+  talloc is a hierarchical, reference counted memory pool system with destructors.
+endef
+
+CROSS = " \
+       \nChecking simple C program: OK \
+       \nrpath library support: OK \
+       \n-Wl,--version-script support: OK \
+       \nChecking getconf LFS_CFLAGS: NO \
+       \nChecking for large file support without additional flags: OK \
+       \nChecking for -D_LARGE_FILES: OK \
+       \nChecking correct behavior of strtoll: NO \
+       \nChecking for working strptime: OK \
+       \nChecking for C99 vsnprintf: OK \
+       \nChecking for HAVE_SHARED_MMAP: OK \
+       \nChecking for HAVE_MREMAP: OK \
+       \nChecking for HAVE_INCOHERENT_MMAP: NO \
+       \nChecking for HAVE_SECURE_MKSTEMP: OK \
+       \nChecking for HAVE_IFACE_GETIFADDRS: OK \
+       \nChecking for kernel change notify support: OK \
+       \nChecking for Linux kernel oplocks: OK \
+       \nChecking for kernel share modes: OK \
+       \nChecking if can we convert from CP850 to UCS-2LE: OK \
+       \nChecking if can we convert from UTF-8 to UCS-2LE: OK \
+       \nChecking whether we can use Linux thread-specific credentials with 32-bit system calls: OK \
+       \nChecking whether we can use Linux thread-specific credentials: OK \
+       \nChecking whether setreuid is available: OK \
+       \nChecking whether setresuid is available: OK \
+       \nChecking whether seteuid is available: OK \
+       \nChecking whether fcntl locking is available: OK \
+       \nChecking for the maximum value of the 'time_t' type: OK \
+       \nChecking whether the realpath function allows a NULL argument: OK \
+       \nChecking whether POSIX capabilities are available: OK \
+       \nChecking for ftruncate extend: OK \
+       \nvfs_fileid checking for statfs() and struct statfs.f_fsid: OK \
+       \ngetcwd takes a NULL argument: OK \
+       \nChecking value of NSIG: \"65\" \
+       \nChecking value of _NSIG: \"65\" \
+       \nChecking value of SIGRTMAX: \"64\" \
+       \nChecking value of SIGRTMIN: \"34\" \
+       \nChecking if toolchain accepts -fstack-protector: OK \
+       \n"
+
+define Build/Configure
+       (cd $(PKG_BUILD_DIR); \
+               echo -e >cache.txt $(CROSS) " \
+                       \nChecking uname machine type: \"$(ARCH)\" \
+                       \nChecking uname release type: \"$(LINUX_VERSION)\" \
+                       \nChecking uname sysname type: \"Linux\" \
+                       \nChecking uname version type: \"$(LINUX_UNAME_VERSION)\" \
+               \n" ; \
+               $(CONFIGURE_VARS) \
+               ./buildtools/bin/waf configure \
+                       --prefix=/usr \
+                       --sysconfdir=/etc \
+                       --localstatedir=/var \
+                       --with-libiconv="$(ICONV_PREFIX)" \
+                       --cross-compile \
+                       --cross-answers=$(PKG_BUILD_DIR)/cache.txt \
+                       --disable-rpath \
+                       --disable-rpath-install \
+       )
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/bin/default/libtalloc.so $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/
+endef
+
+define Package/libtalloc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/bin/default/libtalloc.so $(1)/usr/lib/libtalloc.so.$(MAJOR_VERSION)
+       (cd $(1)/usr/lib; ln -sf libtalloc.so.$(MAJOR_VERSION) libtalloc.so)
+endef
+
+$(eval $(call BuildPackage,libtalloc))
diff --git a/libs/libtheora/Makefile b/libs/libtheora/Makefile
new file mode 100644 (file)
index 0000000..d5db86c
--- /dev/null
@@ -0,0 +1,68 @@
+#
+# Copyright (C) 2008-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:=libtheora
+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_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=COPYING LICENSE
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_DEPENDS:=libvorbis
+
+include $(INCLUDE_DIR)/package.mk
+
+PKG_INSTALL=1
+
+define Package/libtheora
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=libtheora
+  URL:=http://xiph.org/theora/
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+  DEPENDS:=+libogg
+endef
+
+define Package/libtheora/description
+Theora is Xiph.Org's first publicly released video codec, intended
+for use within the Foundation's Ogg multimedia streaming system.
+Theora is derived directly from On2's VP3 codec; Currently the
+encoders are nearly identical, but Theora will make use of new
+features supported by the decoder to improve over what is
+is possible with VP3.
+endef
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               --disable-examples \
+               --disable-oggtest \
+               --disable-vorbistest \
+               --disable-sdltest \
+       )
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/theora/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/theora/* $(1)/usr/include/theora/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libtheora/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libtheora))
diff --git a/libs/libtheora/patches/001-no_docs_tests.patch b/libs/libtheora/patches/001-no_docs_tests.patch
new file mode 100644 (file)
index 0000000..4a45b8b
--- /dev/null
@@ -0,0 +1,33 @@
+diff -urN libtheora-1.1.1/Makefile.am libtheora-1.1.1.new/Makefile.am
+--- libtheora-1.1.1/Makefile.am        2009-07-14 01:55:02.000000000 +0200
++++ libtheora-1.1.1.new/Makefile.am    2012-12-05 14:21:06.103521554 +0100
+@@ -8,7 +8,7 @@
+ EXAMPLES_DIR =
+ endif
+-SUBDIRS = lib include doc tests m4 $(EXAMPLES_DIR)
++SUBDIRS = lib include m4 $(EXAMPLES_DIR)
+ # we include the whole debian/ dir in EXTRA_DIST because there's a problem
+diff -urN libtheora-1.1.1/Makefile.in libtheora-1.1.1.new/Makefile.in
+--- libtheora-1.1.1/Makefile.in        2009-10-01 20:04:07.000000000 +0200
++++ libtheora-1.1.1.new/Makefile.in    2012-12-05 14:21:18.239521864 +0100
+@@ -164,7 +164,7 @@
+ @THEORA_ENABLE_EXAMPLES_TRUE@EXAMPLES_DIR = examples
+ @THEORA_ENABLE_EXAMPLES_FALSE@EXAMPLES_DIR = 
+-SUBDIRS = lib include doc tests m4 $(EXAMPLES_DIR)
++SUBDIRS = lib include m4 $(EXAMPLES_DIR)
+ # we include the whole debian/ dir in EXTRA_DIST because there's a problem
+ # with autotools and HFS+ MacOSX file systems that caused debian/Makefile.am
+@@ -200,7 +200,7 @@
+       missing mkinstalldirs theora-uninstalled.pc.in theora.pc.in \
+       theoradec-uninstalled.pc.in theoradec.pc.in \
+       theoraenc-uninstalled.pc.in theoraenc.pc.in
+-DIST_SUBDIRS = lib include doc tests m4 examples
++DIST_SUBDIRS = lib include m4 examples
+ all: config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-recursive
diff --git a/libs/libtheora/patches/002-no_sdl_check.patch b/libs/libtheora/patches/002-no_sdl_check.patch
new file mode 100644 (file)
index 0000000..a1e7256
--- /dev/null
@@ -0,0 +1,14 @@
+--- libtheora-1.1.1/configure.ac       2009-10-01 20:00:33.000000000 +0200
++++ libtheora-1.1.1.new/configure.ac   2012-12-05 14:22:26.319523608 +0100
+@@ -313,11 +313,6 @@
+ dnl check for SDL
+ HAVE_SDL=no
+-AM_PATH_SDL(,[
+-  HAVE_SDL=yes
+-  SDL_LIBS=`$SDL_CONFIG --libs`
+-],AC_MSG_WARN([*** Unable to find SDL -- Not compiling example players ***]))
+-
+ dnl check for OSS
+ HAVE_OSS=no
+ AC_CHECK_HEADERS([sys/soundcard.h soundcard.h machine/soundcard.h],[
diff --git a/libs/libtorrent/Makefile b/libs/libtorrent/Makefile
new file mode 100644 (file)
index 0000000..2a85684
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# Copyright (C) 2007-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:=libtorrent
+PKG_VERSION:=0.13.6-git-1
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+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_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libtorrent
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Rakshasa's BitTorrent library
+  URL:=http://libtorrent.rakshasa.no/
+  DEPENDS:=+libopenssl +libsigcxx +zlib
+  MAINTAINER:=Peter Wagner <tripolar@gmx.at>
+endef
+
+define Package/libtorrent/description
+ LibTorrent is a BitTorrent library written in C++ for *nix, with a focus on
+ high performance and good code. The library differentiates itself from other
+ implementations by transferring directly from file pages to the network stack.
+ On high-bandwidth connections it is able to seed at 3 times the speed of the
+ official client.
+endef
+
+TARGET_LDFLAGS += $(LIBGCC_S)
+
+CONFIGURE_ARGS+= \
+       --enable-shared \
+       --enable-static \
+       --enable-aligned \
+       --disable-debug \
+       --enable-openssl \
+       --disable-instrumentation \
+       --with-zlib=$(STAGING_DIR)/usr \
+       --disable-ipv6
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/torrent $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtorrent.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libtorrent.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libtorrent/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtorrent.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libtorrent))
diff --git a/libs/libtorrent/patches/100-fix_cross_compile.patch b/libs/libtorrent/patches/100-fix_cross_compile.patch
new file mode 100644 (file)
index 0000000..a096946
--- /dev/null
@@ -0,0 +1,41 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -19,7 +19,6 @@ AC_SUBST(LIBTORRENT_INTERFACE_VERSION_NO
+ AM_INIT_AUTOMAKE
+ AC_CONFIG_HEADERS(config.h)
+-AM_PATH_CPPUNIT(1.9.6)
+ AC_PROG_CXX
+--- a/scripts/checks.m4
++++ b/scripts/checks.m4
+@@ -96,7 +96,7 @@ AC_DEFUN([TORRENT_CHECK_KQUEUE], [
+ AC_DEFUN([TORRENT_CHECK_KQUEUE_SOCKET_ONLY], [
+   AC_MSG_CHECKING(whether kqueue supports pipes and ptys)
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
++  AC_LINK_IFELSE([AC_LANG_SOURCE([
+       #include <fcntl.h>
+       #include <stdlib.h>
+       #include <unistd.h>
+--- a/scripts/common.m4
++++ b/scripts/common.m4
+@@ -153,7 +153,7 @@ dnl   Need to fix this so that it uses t
+ AC_DEFUN([TORRENT_CHECK_EXECINFO], [
+   AC_MSG_CHECKING(for execinfo.h)
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
++  AC_LINK_IFELSE([AC_LANG_SOURCE([
+       #include <execinfo.h>
+       int main() { backtrace((void**)0, 0); backtrace_symbols((char**)0, 0); return 0;}
+       ])],
+@@ -168,7 +168,7 @@ AC_DEFUN([TORRENT_CHECK_EXECINFO], [
+ AC_DEFUN([TORRENT_CHECK_ALIGNED], [
+   AC_MSG_CHECKING(the byte alignment)
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
++  AC_LINK_IFELSE([AC_LANG_SOURCE([
+       #include <inttypes.h>
+       int main() {
+         char buf@<:@8@:>@ = { 0, 0, 0, 0, 1, 0, 0, 0 };
diff --git a/libs/libuecc/Makefile b/libs/libuecc/Makefile
new file mode 100644 (file)
index 0000000..8111062
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2012-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libuecc
+PKG_VERSION:=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_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=COPYRIGHT
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libuecc
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Very small Elliptic Curve Cryptography library
+  URL:=http://git.universe-factory.net/libuecc/
+endef
+
+TARGET_CFLAGS += -ffunction-sections -fdata-sections
+
+CMAKE_OPTIONS += \
+       -DCMAKE_BUILD_TYPE:String="MINSIZEREL"
+
+
+define Package/libuecc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuecc.so* $(1)/usr/lib/
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libuecc-$(PKG_VERSION) $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuecc.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libuecc.pc $(1)/usr/lib/pkgconfig/
+endef
+
+$(eval $(call BuildPackage,libuecc))
diff --git a/libs/libugpio/Makefile b/libs/libugpio/Makefile
new file mode 100644 (file)
index 0000000..66168c1
--- /dev/null
@@ -0,0 +1,72 @@
+#
+# Copyright (C) 2012-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:=libugpio
+PKG_VERSION:=0.0.6
+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_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING.LESSER
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libugpio
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=https://github.com/mhei/libugpio
+  TITLE:=Library for using sysfs gpio interface from C programs
+  DEPENDS:=@GPIO_SUPPORT
+endef
+
+define Package/libugpio/description
+  libugpio is a library to ease the use of linux kernel's sysfs
+  gpio interface from C programs and/or other libraries.
+endef
+
+define Package/gpioctl-sysfs
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Tool for controlling gpio pins
+  DEPENDS:=+libugpio
+endef
+
+define Package/gpioctl-sysfs/description
+  Tool for controlling gpio pins using the sysfs api provided by the kernel.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/ugpio $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libugpio.{so*,a} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libugpio.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libugpio/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libugpio.so* $(1)/usr/lib/
+endef
+
+define Package/gpioctl-sysfs/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpioctl $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libugpio))
+$(eval $(call BuildPackage,gpioctl-sysfs))
diff --git a/libs/libunistring/Makefile b/libs/libunistring/Makefile
new file mode 100644 (file)
index 0000000..854764f
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# 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:=libunistring
+PKG_VERSION:=0.9.6
+PKG_RELEASE:=1
+PKG_MD5SUM:=dfae4ff5583649ed24d8f368f1d0543b
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/libunistring
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libunistring
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=libunistring
+  URL:=http://www.gnu.org/software/libunistring/
+endef
+
+define Package/libunistring/description
+  This library provides functions for manipulating Unicode strings and for manipulating C strings according to the Unicode standard.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --without-libiconv-prefix \
+       --without-libpth-prefix
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/include/unistring
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/unistring/*.h $(1)/usr/include/unistring/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunistring.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libunistring/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunistring.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libunistring))
diff --git a/libs/libupnp/Makefile b/libs/libupnp/Makefile
new file mode 100644 (file)
index 0000000..ad49703
--- /dev/null
@@ -0,0 +1,76 @@
+#
+# 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:=libupnp
+PKG_VERSION:=1.6.19
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/pupnp
+PKG_MD5SUM:=ee16e5d33a3ea7506f38d71facc057dd
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libupnp/Default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=http://pupnp.sourceforge.net/
+endef
+
+define Package/libupnp
+  $(call Package/libupnp/Default)
+  DEPENDS:=+libpthread
+  TITLE:=UPnP SDK library
+  MENU:=1
+endef
+
+define Package/libupnp/description
+The portable SDK for UPnP Devices (libupnp) provides developers with an API and
+open source code for building control points, devices, and bridges that are
+compliant with Version 1.0 of the  Universal Plug and Play Device Architecture
+Specification.
+endef
+
+define Package/libupnp-sample
+  $(call Package/libupnp/Default)
+  DEPENDS:=libupnp
+  TITLE:=UPnP sample applications
+endef
+
+define Package/libupnp-sample/description
+TVcontrolpoint & tvdevice sample applications run inside /etc/upnp-tvdevice/
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/upnp $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ixml,threadutil,upnp}.{a,so*,la} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libupnp.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libupnp/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ixml,threadutil,upnp}.so.* $(1)/usr/lib/
+endef
+
+define Package/libupnp-sample/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/upnp/sample/.libs/* $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/etc/upnp-tvdevice/web
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/upnp/sample/web/* $(1)/etc/upnp-tvdevice
+endef
+
+$(eval $(call BuildPackage,libupnp))
+$(eval $(call BuildPackage,libupnp-sample))
diff --git a/libs/libupnpp/Makefile b/libs/libupnpp/Makefile
new file mode 100644 (file)
index 0000000..9a7db84
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# 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:=libupnpp
+PKG_VERSION:=0.14.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.lesbonscomptes.com/upmpdcli/downloads
+PKG_MD5SUM:=1b10905a365fc6277e1d8ced77278666
+PKG_MAINTAINER:=Petko Bordjukov <bordjukov@gmail.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libupnpp
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=http://www.lesbonscomptes.com/upmpdcli
+  DEPENDS+= +libstdcpp +libexpat +librt +libcurl +libupnp
+  TITLE:=The libupnpp C++ library wraps libupnp for easier use by upmpdcli and upplay
+endef
+
+define Package/libupnpp/description
+libupnpp defines useful objects over libupnp and can be used to create both devices
+and control points. It is shared by upmpdcli and upplay.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libupnpp $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp.la $(1)/usr/lib/
+endef
+
+define Package/libupnpp/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libupnpp))
diff --git a/libs/liburcu/Makefile b/libs/liburcu/Makefile
new file mode 100644 (file)
index 0000000..3b77f32
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+# Copyright (C) 2014-2016 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.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=liburcu
+PKG_VERSION:=0.9.2
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
+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_BUILD_DIR:=$(BUILD_DIR)/userspace-rcu-$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/liburcu
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=User-space Read-Copy-Update library
+       URL:=https://lttng.org/
+       DEPENDS:=+libpthread
+endef
+
+define Package/liburcu/description
+       Userspace Read-Copy-Update library.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR)                                          $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/urcu*              $(1)/usr/include/
+       $(INSTALL_DIR)                                          $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liburcu*.{a,so*}       $(1)/usr/lib/
+endef
+
+define Package/liburcu/install
+       $(INSTALL_DIR)                                  $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liburcu*.so.*  $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,liburcu))
diff --git a/libs/libusbmuxd/Makefile b/libs/libusbmuxd/Makefile
new file mode 100644 (file)
index 0000000..3b84d54
--- /dev/null
@@ -0,0 +1,90 @@
+#
+# Copyright (C) 2012-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:=libusbmuxd
+PKG_VERSION:=1.1.0
+PKG_RELEASE:=2
+
+PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING.LGPLv2.1
+
+PKG_SOURCE_PROTO:=git
+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_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libusbmuxd/Default
+  TITLE:=USB multiplexing daemon
+  URL:=http://www.libimobiledevice.org/
+endef
+
+define Package/libusbmuxd/Default/description
+  This daemon is in charge of multiplexing connections over USB to an iPhone or
+  iPod touch. To users, it means you can sync your music, contacts, photos, etc.
+  over USB. To developers, it means you can connect to any listening localhost
+  socket on the device. usbmuxd is not used for tethering data transfer, which
+  uses a dedicated USB interface as a virtual network device.
+endef
+
+define Package/libusbmuxd
+  $(call Package/libusbmuxd/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= library
+  DEPENDS:=+libplist +libpthread +libxml2 +zlib
+endef
+
+define Package/libusbmuxd/description
+  $(call Package/libusbmuxd/Default/description)
+  This package contains the libusbmuxd shared library.
+endef
+
+define Package/libusbmuxd-utils
+  $(call Package/libusbmuxd/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE+= utilies
+  DEPENDS:=+libusbmuxd
+endef
+
+define Package/libusbmuxd-utils/description
+  $(call Package/libusbmuxd/Default/description)
+  This package contains the libusbmuxd utilities.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusbmuxd.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libusbmuxd.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libusbmuxd/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusbmuxd.so.* $(1)/usr/lib/
+endef
+
+define Package/libusbmuxd-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/iproxy $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libusbmuxd))
+$(eval $(call BuildPackage,libusbmuxd-utils))
diff --git a/libs/libuv/Makefile b/libs/libuv/Makefile
new file mode 100644 (file)
index 0000000..4f40a20
--- /dev/null
@@ -0,0 +1,76 @@
+#
+# Copyright (C) 2015-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:=libuv
+PKG_VERSION:=1.10.2
+PKG_RELEASE:=1
+
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_MAINTAINER:=Luka Perkov <luka.perkov@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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libuv
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Cross-platform asychronous I/O library
+  URL:=https://github.com/libuv/libuv
+  DEPENDS:=+libpthread +librt
+endef
+
+define Package/libuv/description
+ libuv is a multi-platform support library with a focus on asynchronous I/O. It
+ was primarily developed for use by Node.js, but it's also used by Luvit, Julia,
+ pyuv, and others.
+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/* \
+               $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libuv.so* \
+               $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libuv.a \
+               $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libuv.pc \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libuv/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libuv.so* \
+               $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libuv))
diff --git a/libs/libuvc/Makefile b/libs/libuvc/Makefile
new file mode 100644 (file)
index 0000000..3c9b8b9
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# 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:=libuvc
+
+PKG_VERSION=0.0.5-20140812-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/ktossell/libuvc.git
+PKG_SOURCE_VERSION:=2c6403405872aa865999b95ba15944295adf6c38
+
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_LICENSE:=BSD
+
+PKG_INSTALL:=1
+CMAKE_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libuvc
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=libuvc
+       DEPENDS:=+libusb-1.0 +libjpeg
+       URL:=https://int80k.com/libuvc
+endef
+
+define Package/libuvc/description
+ This package contains libuvc is a cross-platform library for USB video devices, 
+ built atop libusb.
+endef
+
+define Package/libuvc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuvc.so* $(1)/usr/lib/
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/{include,lib}
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuvc.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libuvc))
diff --git a/libs/libv4l/Makefile b/libs/libv4l/Makefile
new file mode 100644 (file)
index 0000000..b6fda69
--- /dev/null
@@ -0,0 +1,116 @@
+#
+# Copyright (C) 2009-2015 OpenWrt.org
+# Copyright (C) 2009 David Cooper <dave@kupesoft.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=v4l-utils
+PKG_VERSION:=1.10.0
+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_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=GPL-2.0 LGPL-2.1
+PKG_LICENSE_FILES:=COPYING COPYING.libv4l
+
+PKG_USE_MIPS16:=0
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_BUILD_DEPENDS:=argp-standalone
+
+include $(INCLUDE_DIR)/uclibc++.mk
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/libv4l/Default
+  TITLE:=Video 4 Linux
+  URL:=http://www.linuxtv.org/
+endef
+
+define Package/libv4l/Default/description
+  libv4l is a collection of libraries which adds a thin abstraction layer on
+  top of video4linux2 devices. The purpose of this (thin) layer is to make it
+  easy for application writers to support a wide variety of devices without
+  having to write separate code for different devices in the same class. libv4l
+  consists of 3 different libraries: libv4lconvert, libv4l1 and libv4l2.
+
+  libv4l1 offers the (deprecated) v4l1 API on top of v4l2 devices, independent
+  of the drivers for those devices supporting v4l1 compatibility (which many
+  v4l2 drivers do not).
+
+  libv4l2 offers the v4l2 API on top of v4l2 devices, while adding for the
+  application transparent libv4lconvert conversion where necessary.
+endef
+
+define Package/libv4l
+  $(call Package/libv4l/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= wrapper libraries
+  DEPENDS := +libpthread +librt $(ICONV_DEPENDS)
+endef
+
+define Package/libv4l/description
+  $(call Package/libv4l/Default/description)
+endef
+
+define Package/v4l-utils
+  $(call Package/libv4l/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE+= utilities
+  DEPENDS := +libv4l $(CXX_DEPENDS) $(ICONV_DEPENDS)
+endef
+
+define Package/v4l-utils/description
+  $(call Package/libv4l/Default/description)
+  This package contains the video4linux utilities.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += -largp
+
+CONFIGURE_ARGS+= \
+       --disable-doxygen-doc \
+       --disable-libdvbv5 \
+       --disable-qv4l2 \
+       --without-jpeg \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert}.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libv4l{1,2,convert}.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libv4l/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert}.so.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/libv4l
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l/v4l{1compat,2convert}.so $(1)/usr/lib/libv4l/
+endef
+
+define Package/v4l-utils/install
+       $(INSTALL_DIR) $(1)/etc
+       $(CP) $(PKG_INSTALL_DIR)/etc/rc_maps.cfg $(1)/etc/
+       $(CP) $(PKG_INSTALL_DIR)/etc/rc_keymaps $(1)/etc/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/{cx18,ivtv}-ctl $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/decode_tm6000 $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ir-keytable $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/v4l2-{compliance,ctl,sysfs-path} $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libv4l))
+$(eval $(call BuildPackage,v4l-utils))
diff --git a/libs/libv4l/patches/020-add-missing-includes.patch b/libs/libv4l/patches/020-add-missing-includes.patch
new file mode 100644 (file)
index 0000000..34e0511
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/utils/rds-ctl/rds-ctl.cpp
++++ b/utils/rds-ctl/rds-ctl.cpp
+@@ -29,6 +29,7 @@
+ #include <inttypes.h>
+ #include <getopt.h>
+ #include <sys/types.h>
++#include <ctype.h>
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <sys/ioctl.h>
+@@ -36,6 +37,7 @@
+ #include <dirent.h>
+ #include <config.h>
+ #include <signal.h>
++#include <time.h>
+ #include <linux/videodev2.h>
+ #include <libv4l2.h>
+--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
++++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+@@ -14,6 +14,7 @@
+ #include <sys/mman.h>
+ #include <dirent.h>
+ #include <math.h>
++#include <time.h>
+ #include "v4l2-ctl.h"
diff --git a/libs/libv4l/patches/030-dont-call-getsubopt.patch b/libs/libv4l/patches/030-dont-call-getsubopt.patch
new file mode 100644 (file)
index 0000000..5824c70
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
++++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
+@@ -671,15 +671,18 @@ static bool parse_subset(char *optarg)
+ static bool parse_next_subopt(char **subs, char **value)
+ {
+-      static char *const subopts[] = {
+-          NULL
+-      };
+-      int opt = getsubopt(subs, subopts, value);
++      char *stmp = *subs;
++      *value = NULL;
+-      if (opt < 0 || *value)
++      if (*subs) {
++              *subs = strchr(stmp, ',');
++              if (*subs)
++                      *(*subs)++ = 0;
++              else *subs = stmp + strlen(stmp);
++
++              *value = stmp;
+               return false;
+-      fprintf(stderr, "No value given to suboption <%s>\n",
+-                      subopts[opt]);
++      }
+       return true;
+ }
diff --git a/libs/libvorbis/Makefile b/libs/libvorbis/Makefile
new file mode 100644 (file)
index 0000000..aa1c929
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# 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:=libvorbis
+PKG_VERSION:=1.3.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://downloads.xiph.org/releases/vorbis/
+PKG_MD5SUM:=28cb28097c07a735d6af56e598e1c90f
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libvorbis
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=libvorbis
+  URL:=http://xiph.org/vorbis/
+  DEPENDS:=+libogg
+endef
+
+define Package/libvorbis/description
+Vorbis is a general purpose audio and music encoding format
+contemporary to MPEG-4's AAC and TwinVQ, the next generation beyond
+MPEG audio layer 3. Unlike the MPEG sponsored formats (and other
+proprietary formats such as RealAudio G2 and Windows' flavor of the
+month), the Vorbis CODEC specification belongs to the public domain.
+All the technical details are published and documented, and any
+software entity may make full use of the format without license
+fee, royalty or patent concerns.
+endef
+
+CONFIGURE_ARGS+= \
+       --disable-oggtest \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/vorbis/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/vorbis/* $(1)/usr/include/vorbis/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DIR) $(1)/usr/share/aclocal/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(1)/usr/share/aclocal/
+endef
+
+define Package/libvorbis/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libvorbis))
diff --git a/libs/libvorbisidec/Makefile b/libs/libvorbisidec/Makefile
new file mode 100644 (file)
index 0000000..e9eb7da
--- /dev/null
@@ -0,0 +1,62 @@
+#
+# 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:=libvorbisidec
+PKG_REV:=20150104
+PKG_VERSION:=1.0.3-$(PKG_REV)
+PKG_RELEASE:=1
+
+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_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libvorbisidec
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=A fixed-point Ogg/Vorbis decoder library
+  DEPENDS:= +libogg
+  URL:=http://wiki.xiph.org/index.php/Tremor
+endef
+
+define Package/libvorbisidec/description
+       libvorbisidec is "tremor", a fixed-point implementation of libvorbis.
+       It also has libogg built-in. It is suitable as a replacement for
+       libvorbis and libogg in tremor-aware applications.
+       Tremor is a decoder only.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+CONFIGURE_ARGS += --enable-shared --enable-static
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(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/
+endef
+
+define Package/libvorbisidec/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libvorbisidec.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libvorbisidec))
diff --git a/libs/libvpx/Makefile b/libs/libvpx/Makefile
new file mode 100644 (file)
index 0000000..6678970
--- /dev/null
@@ -0,0 +1,84 @@
+#
+# Copyright (C) 2008-2015 OpenWrt.org
+# Copyright (C) 2016 Luiz Angelo Daros de Luca
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libvpx
+PKG_VERSION:=1.6.1
+PKG_RELEASE:=1
+
+PKG_REV:=v$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_SOURCE_URL:=https://chromium.googlesource.com/webm/libvpx
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_ABI_VERSION:=$(subst $(space),.,$(wordlist 1, 2, $(subst .,$(space),$(PKG_VERSION))))
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libvpx
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=libvpx
+  URL:=http://www.webmproject.org/
+  DEPENDS:=+libpthread
+  ABI_VERSION:=$(PKG_ABI_VERSION)
+endef
+
+define Package/libvpx/description
+   libvpx is a VP8/VP9 Codec SDK.
+endef
+
+CONFIGURE_ARGS = \
+               --target=generic-gnu \
+               --prefix=$(CONFIGURE_PREFIX) \
+               --libdir=/usr/lib \
+               --enable-static \
+               --enable-shared \
+        --disable-examples \
+        --disable-docs \
+        --disable-unit-tests \
+
+# Add --enable-small as openwrt gcc flags are overwritten
+ifneq ($(findstring -Os,$(TARGET_CFLAGS)),)
+CONFIGURE_ARGS += --enable-small
+endif
+
+# libvpx expects gcc as linker but uses $LD if provided
+# However, OpenWRT defines LD as *-uclibc-ld and not *-gcc
+CONFIGURE_VARS += \
+    CROSS=$(GNU_TARGET_NAME) \
+       LD="$(TARGET_CC)" \
+
+MAKE_FLAGS += \
+       LD="$(TARGET_CC)" \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/vpx/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/vpx/* $(1)/usr/include/vpx/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libvpx/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libvpx))
diff --git a/libs/libx264/Makefile b/libs/libx264/Makefile
new file mode 100644 (file)
index 0000000..dbb7543
--- /dev/null
@@ -0,0 +1,83 @@
+#
+# 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:=x264
+PKG_VERSION:=snapshot-20160815-2245-stable
+PKG_RELEASE:=3
+
+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_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_CFLAGS+=-std=gnu99 -fPIC -O3 -ffast-math -I.
+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
+
+ifneq ($(CONFIG_SOFT_FLOAT)$(findstring $(call qstrip,$(CONFIG_CPU_TYPE)),$(CPU_ASM_BLACKLIST)),)
+  CONFIGURE_VARS+= AS= 
+  MAKE_FLAGS+= AS= 
+  CONFIGURE_ARGS += --disable-asm
+else
+ifneq ($(CONFIG_TARGET_x86),)
+ifeq ($(CONFIG_YASM),y)
+  CONFIGURE_VARS+= AS=yasm
+  MAKE_FLAGS+= AS=yasm
+else
+  CONFIGURE_VARS+= AS= 
+  MAKE_FLAGS+= AS= 
+  CONFIGURE_ARGS += --disable-asm
+endif
+endif
+endif
+
+CONFIGURE_ARGS += \
+               --enable-shared \
+               --enable-pic \
+               --disable-cli 
+
+define Package/libx264
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=H264/AVC free codec library.
+  DEPENDS:=+libpthread @BUILD_PATENTED
+  URL:=http://www.videolan.org/developers/x264.html
+endef
+
+define Package/libx264/description
+  x264 is a free software library for encoding 
+  video streams into the H.264/MPEG-4 AVC compression format.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/x264/
+       $(INSTALL_DATA) $(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/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libx264/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libx264))
diff --git a/libs/libxerces-c/Makefile b/libs/libxerces-c/Makefile
new file mode 100644 (file)
index 0000000..bbba0f0
--- /dev/null
@@ -0,0 +1,91 @@
+#
+# 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:=xerces-c
+PKG_VERSION:=3.1.4
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@APACHE/xerces/c/3/sources
+PKG_MD5SUM:=9973cc79481803f8b6652c52faf5195d963f50d209d4f681ec97e2aa014b6241
+PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
+
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/uclibc++.mk
+include $(INCLUDE_DIR)/nls.mk
+include $(INCLUDE_DIR)/package.mk
+
+CONFIGURE_ARGS += \
+       --disable-pretty-make \
+       --enable-transcoder-iconv \
+       --enable-netaccessor-socket \
+       --enable-msgloader-inmemory
+
+TARGET_LDFLAGS += \
+       -lm
+
+define Package/libxerces-c
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Validating XML parser library for C++
+  URL:=http://xerces.apache.org/
+  DEPENDS:=$(CXX_DEPENDS) $(ICONV_DEPENDS) +libc +libpthread
+endef
+
+define Package/libxerces-c-samples
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Validating XML parser library for C++ (samples)
+  URL:=http://xerces.apache.org/
+  DEPENDS:=+libxerces-c
+endef
+
+define Package/libxerces-c/description
+  Xerces-C++ is a validating XML parser written in a portable subset of
+  C++. Xerces-C++ makes it easy to give your application the ability
+  to read and write XML data. A shared library is provided for parsing,
+  generating, manipulating, and validating XML documents. Xerces-C++ is
+  faithful to the XML 1.0 recommendation and associated standards (DOM
+  1.0, DOM 2.0, SAX 1.0, SAX 2.0, Namespaces, XML Schema Part 1 and
+  Part 2). It also provides experimental implementations of XML 1.1
+  and DOM Level 3.0. The parser provides high performance, modularity,
+  and scalability.
+endef
+
+define Package/libxerces-c-samples/description
+  Validating XML parser library for C++ (samples)
+endef
+
+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/
+       $(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/
+endef
+
+define Package/libxerces-c-samples/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libxerces-c))
+$(eval $(call BuildPackage,libxerces-c-samples))
diff --git a/libs/libzdb/Makefile b/libs/libzdb/Makefile
new file mode 100644 (file)
index 0000000..c4f38f4
--- /dev/null
@@ -0,0 +1,89 @@
+#
+# 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:=libzdb
+PKG_VERSION:=3.1
+PKG_RELEASE:=3
+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_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_BUILD_DEPENDS:=libzdb/host
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libzdb
+    SECTION:=libs
+    CATEGORY:=Libraries
+    TITLE:=A thread-safe multi database connection pool library
+    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+    URL:=http://www.tildeslash.com/libzdb/
+    DEPENDS:=+libsqlite3 +libpq +libmysqlclient +zlib +libpthread +libopenssl
+endef
+
+define Package/libzdb/description
+   zdb is a database library with thread-safe connection pooling. The library can connect
+   transparently to multiple database systems. It has zero runtime configuration and connections
+   are specified via a URL scheme. A modern object-oriented API is provided.
+   zdb supports MySQL, PostgreSQL, SQLite, and Oracle.
+   NOTE: This package does not include Oracle support.
+endef
+
+CONFIGURE_ARGS += --disable-profiling \
+                   --enable-optimized \
+                   --with-mysql \
+                   --with-postgresql \
+                   --with-sqlite \
+                   --enable-sqliteunlock \
+                   --enable-openssl
+
+TARGET_CPPFLAGS += -std=c99
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Hooks/HostConfigure/Pre
+endef
+
+define Host/Configure
+endef
+
+define Host/Compile
+       $(HOSTCC) $(HOST_BUILD_DIR)/tools/filterh/lex.yy.c -o $(HOST_BUILD_DIR)/tools/bin/filterh
+endef
+
+define Host/Install
+       $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
+       $(CP) $(HOST_BUILD_DIR)/tools/bin/filterh $(STAGING_DIR_HOSTPKG)/bin/
+endef
+
+$(eval $(call HostBuild))
+
+define Build/Compile
+       $(call Build/Compile/Default)
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/zdb
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/zdb/ $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzdb* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zdb.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libzdb/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzdb.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libzdb))
diff --git a/libs/libzdb/patches/010-cross-compile-fixes.patch b/libs/libzdb/patches/010-cross-compile-fixes.patch
new file mode 100644 (file)
index 0000000..e765da8
--- /dev/null
@@ -0,0 +1,186 @@
+diff -rupN libzdb-3.1.orig/configure.ac libzdb-3.1/configure.ac
+--- libzdb-3.1.orig/configure.ac       2015-08-31 14:46:02.000000000 +0200
++++ libzdb-3.1/configure.ac    2016-04-18 19:43:13.836937134 +0200
+@@ -196,15 +196,6 @@ AC_SEARCH_LIBS([pthread_create], [pthrea
+ # Database Libraries 
+ mysql="yes"
+-check_mysql_config() 
+-{
+-        AC_PATH_PROG([MYSQLCONFIG], [mysql_config], [no], [$PATH:/usr/local/bin:/usr/local/mysql/bin])
+-        if test "x$MYSQLCONFIG" = "xno" 
+-        then
+-                AC_MSG_WARN([mysql_config is required to build libzdb with mysql])
+-                mysql="no"
+-        fi
+-}
+ AC_MSG_CHECKING(for mysql)
+ AC_ARG_WITH([mysql], 
+         AS_HELP_STRING([--with-mysql(=<path>)], 
+@@ -216,22 +207,20 @@ AC_ARG_WITH([mysql],
+                         mysql="no"
+                 else
+                         AC_MSG_RESULT([yes])
+-                        AC_CHECK_FILE([$with_mysql], [MYSQLCONFIG=$with_mysql], [check_mysql_config])        
+                 fi
+         ],
+         [
+                 AC_MSG_RESULT([yes])
+-                check_mysql_config
+         ])
+ if test "xyes" = "x$mysql"; then
+         svd_CPPFLAGS=$CPPFLAGS
+         svd_LDFLAGS=$LDFLAGS
+-        CPPFLAGS="`$MYSQLCONFIG --include` $CPPFLAGS"
+-        LDFLAGS="`$MYSQLCONFIG --libs` $LDFLAGS"
++        CPPFLAGS="-I$STAGING_DIR/usr/include/mysql $CPPFLAGS"
++        LDFLAGS="-L$STAGING_DIR/usr/lib/mysql -L$STAGING_DIR/usr/lib $LDFLAGS"
+         AC_CHECK_HEADERS([mysql.h], [], [mysql="no"])
+         if test "xyes" = "x$mysql"; then
+-                DBCPPFLAGS="$DBCPPFLAGS `$MYSQLCONFIG --include`"
+-                DBLDFLAGS="$DBLDFLAGS `$MYSQLCONFIG --libs`"
++                DBCPPFLAGS="$DBCPPFLAGS -I$STAGING_DIR/usr/include/mysql"
++                DBLDFLAGS="$DBLDFLAGS -L$STAGING_DIR/usr/lib/mysql -L$STAGING_DIR/usr/lib -lmysqlclient -lz -lcrypt -lm"
+                 AC_DEFINE([HAVE_LIBMYSQLCLIENT], 1, [Define to 1 to enable mysql])
+         else
+                 CPPFLAGS=$svd_CPPFLAGS
+@@ -241,15 +230,6 @@ fi
+ AM_CONDITIONAL([WITH_MYSQL], test "xyes" = "x$mysql")
+ postgresql="yes"
+-check_postgres_config() 
+-{
+-        AC_PATH_PROG([PGCONFIG], [pg_config], [no], [$PATH:/usr/local/bin:/usr/local/pgsql/bin])
+-        if test "x$PGCONFIG" = "xno"
+-        then
+-                AC_MSG_WARN([pg_config is required to build libzdb with postgresql])
+-                postgresql="no"
+-        fi
+-}
+ AC_MSG_CHECKING(for postgresql)
+ AC_ARG_WITH([postgresql], 
+         AS_HELP_STRING([--with-postgresql(=<path>)], 
+@@ -261,22 +241,20 @@ AC_ARG_WITH([postgresql],
+                         postgresql="no"
+                 else
+                         AC_MSG_RESULT([yes])
+-                        AC_CHECK_FILE([$with_postgresql], [PGCONFIG=$with_postgresql],[check_postgres_config])
+                 fi
+         ],
+         [
+                 AC_MSG_RESULT([yes])
+-                check_postgres_config
+         ])
+ if test "xyes" = "x$postgresql"; then
+         svd_CPPFLAGS=$CPPFLAGS
+         svd_LDFLAGS=$LDFLAGS
+-        CPPFLAGS="-I`$PGCONFIG --includedir` $CPPFLAGS"
+-        LDFLAGS="-L`$PGCONFIG --libdir` $LDFLAGS"
++        CPPFLAGS="-I$STAGING_DIR/usr/include/postgresql -I$STAGING_DIR/usr/include $CPPFLAGS"
++        LDFLAGS="-L$STAGING_DIR/usr/lib $LDFLAGS"
+         AC_CHECK_HEADERS([libpq-fe.h], [], [postgresql="no"])
+         if test "xyes" = "x$postgresql"; then
+-                DBCPPFLAGS="$DBCPPFLAGS -I`$PGCONFIG --includedir`"
+-                DBLDFLAGS="$DBLDFLAGS -L`$PGCONFIG --libdir` -lpq"
++                DBCPPFLAGS="$DBCPPFLAGS -I$STAGING_DIR/usr/include/postgresql -I$STAGING_DIR/usr/include"
++                DBLDFLAGS="$DBLDFLAGS -L$STAGING_DIR/usr/lib -lpq"
+                 AC_DEFINE([HAVE_LIBPQ], 1, [Define to 1 to enable postgresql])
+         else
+                 CPPFLAGS=$svd_CPPFLAGS
+@@ -298,22 +276,7 @@ AC_ARG_WITH([sqlite],
+                         sqlite="no"
+                 else
+                         AC_MSG_RESULT([yes])
+-                        AC_CHECK_FILE([$with_sqlite],
+-                        [
+-                                svd_LDFLAGS=$LDFLAGS
+-                                svd_CPPFLAGS=$CPPFLAGS
+-                                LDFLAGS="-L$with_sqlite/lib $LDFLAGS"
+-                                CPPFLAGS="-I$with_sqlite/include $CPPFLAGS"
+-                                AC_SEARCH_LIBS([sqlite3_open], [sqlite3],
+-                                [
+-                                        DBCPPFLAGS="$DBCPPFLAGS -I$with_sqlite/include"
+-                                        DBLDFLAGS="$DBLDFLAGS -L$with_sqlite/lib/ -lsqlite3"
+-                                ],[sqlite="no"],[-ldl])
+-                                LDFLAGS=$svd_LDFLAGS
+-                                CPPFLAGS=$svd_CPPFLAGS
+-   
+-                        ],
+-                        AC_SEARCH_LIBS([sqlite3_open], [sqlite3], [], [sqlite="no"], [-ldl]))
++                        AC_SEARCH_LIBS([sqlite3_open], [sqlite3], [], [sqlite="no"])
+                 fi
+         ], 
+         [
+@@ -328,20 +291,8 @@ if test "xyes" = "x$sqlite"; then
+ fi
+ AM_CONDITIONAL([WITH_SQLITE], test "xyes" = "x$sqlite")
+-oracle="yes"
+-AC_MSG_CHECKING(for oracle)
+-AX_LIB_ORACLE_OCI
+-if test -n "$ORACLE_OCI_CFLAGS" -a -n "$ORACLE_OCI_LDFLAGS"; then
+-        DBCPPFLAGS="$DBCPPFLAGS $ORACLE_OCI_CFLAGS"
+-        DBLDFLAGS="$DBLDFLAGS $ORACLE_OCI_LDFLAGS"
+-        AC_DEFINE([HAVE_ORACLE], 1, [Define to 1 to enable oracle])
+-else
+-        oracle="no"
+-fi
+-AM_CONDITIONAL([WITH_ORACLE], test "xyes" = "x$oracle")
+-
+ # Test if any database system was found
+-if test "xno" = "x$postgresql" -a "xno" = "x$mysql" -a "xno" = "x$sqlite" -a "xno" = "x$oracle"; then
++if test "xno" = "x$postgresql" -a "xno" = "x$mysql" -a "xno" = "x$sqlite"; then
+         AC_MSG_ERROR([No available database found or selected. Try configure --help])
+ fi
+@@ -358,23 +309,6 @@ AC_HEADER_STDC
+ # Functions 
+ # ------------------------------------------------------------------------
+-# Require a working setjmp
+-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+-        #include <setjmp.h>
+-        ]],
+-        [[jmp_buf env; setjmp(env);]])], 
+-        [], [AC_MSG_FAILURE([setjmp is required])]
+-)
+-
+-# Require that we have vsnprintf that conforms to c99. I.e. does bounds check
+-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+-        #include <stdarg.h> 
+-        #include <stdio.h>
+-        ]],
+-        [[char t[1]; va_list ap; int n = vsnprintf(t, 1, "hello", ap); if(n == 5) return 0;return 1;]])], 
+-        [], [AC_MSG_FAILURE([vsnprintf does not conform to c99])]
+-)
+-
+ AC_CHECK_FUNCS([timegm])
+@@ -516,11 +450,6 @@ echo "|   PostgreSQL:
+ else
+ echo "|   PostgreSQL:                                   DISABLED   |"
+ fi
+-if test "xyes" = "x$oracle"; then
+-echo "|   Oracle:                                       ENABLED    |"
+-else
+-echo "|   Oracle:                                       DISABLED   |"
+-fi
+ echo "+------------------------------------------------------------+"
+diff -rupN libzdb-3.1.orig/Makefile.am libzdb-3.1/Makefile.am
+--- libzdb-3.1.orig/Makefile.am        2015-08-31 14:55:18.000000000 +0200
++++ libzdb-3.1/Makefile.am     2016-04-18 19:43:42.215769551 +0200
+@@ -45,11 +45,6 @@ libzdb_la_SOURCES += src/db/sqlite/SQLit
+                      src/db/sqlite/SQLiteResultSet.c \
+                      src/db/sqlite/SQLitePreparedStatement.c
+ endif
+-if WITH_ORACLE
+-libzdb_la_SOURCES += src/db/oracle/OracleConnection.c \
+-                     src/db/oracle/OracleResultSet.c \
+-                     src/db/oracle/OraclePreparedStatement.c
+-endif
+ API_INTERFACES  = src/zdb.h src/db/ConnectionPool.h src/db/Connection.h \
+                   src/db/ResultSet.h src/net/URL.h src/db/PreparedStatement.h \
diff --git a/libs/libzdb/patches/020-filterh-use-host-built-version.patch b/libs/libzdb/patches/020-filterh-use-host-built-version.patch
new file mode 100644 (file)
index 0000000..7495fbc
--- /dev/null
@@ -0,0 +1,20 @@
+diff -rupN libzdb-3.0.orig/Makefile.am libzdb-3.0/Makefile.am
+--- libzdb-3.0.orig/Makefile.am        2014-01-06 22:34:08.000000000 +0100
++++ libzdb-3.0/Makefile.am     2014-11-19 20:26:20.588547729 +0100
+@@ -1,5 +1,7 @@
+ # Copyright (C) Tildeslash Ltd. All rights reserved.
++include $(TOPDIR)/rules.mk
++
+ AUTOMAKE_OPTIONS = foreign no-dependencies subdir-objects
+ ACLOCAL_AMFLAGS  = -I m4
+@@ -12,7 +14,7 @@ LIBRARY_NAME    = zdb
+ RE2C          = @RE2C@
+ RE2CFLAGS       = -b
+-FILTERH         = ./tools/bin/filterh
++FILTERH         = $(STAGING_DIR_HOSTPKG)/bin/filterh
+ AM_CPPFLAGS     = $(CPPFLAGS) $(DBCPPFLAGS)
+ AM_CPPFLAGS     += -Isrc -Isrc/util -Isrc/net -Isrc/db -Isrc/exceptions
diff --git a/libs/lttng-ust/Makefile b/libs/lttng-ust/Makefile
new file mode 100644 (file)
index 0000000..872c5be
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# 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:=lttng-ust
+PKG_VERSION:=2.6.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://lttng.org/files/$(PKG_NAME)/
+PKG_MD5SUM:=5c7de27a9968e01ac0b08c7c9cf554d0
+
+PKG_LICENSE:=LGPL-2.1 GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_FIXUP:=autoreconf
+PKG_USE_MIPS16:=0
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lttng-ust
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Linux Trace Toolkit: next generation (library)
+  URL:=https://lttng.org/
+  DEPENDS:= +liburcu +libuuid +librt
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/lttng $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblttng-ust*.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lttng-ust.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/lttng-ust/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblttng*.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,lttng-ust))
diff --git a/libs/lttng-ust/patches/001-no_docs_tests.patch b/libs/lttng-ust/patches/001-no_docs_tests.patch
new file mode 100644 (file)
index 0000000..e1c20c6
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -20,8 +20,6 @@ if BUILD_JAVA_AGENT
+ SUBDIRS += liblttng-ust-java-agent
+ endif
+-SUBDIRS += tests doc
+-
+ #temporarily disabled
+ # liblttng-ust-malloc
diff --git a/libs/lttng-ust/patches/002-examples.patch b/libs/lttng-ust/patches/002-examples.patch
new file mode 100644 (file)
index 0000000..46449b7
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -350,7 +350,14 @@ AC_ARG_WITH([lttng-system-rundir],
+ AC_DEFINE_UNQUOTED([LTTNG_SYSTEM_RUNDIR], ["$lttng_system_rundir"],
+       [LTTng system runtime directory])
+-AM_PATH_PYTHON([2.7],BUILD_GEN_TP_EXAMPLES=1,[:])
++AC_ARG_ENABLE([examples],
++      [AS_HELP_STRING([--enable-examples],[build examples [default=no]])],
++      [enable_examples=$enableval],
++      [enable_examples=no]
++)
++if test "x$enable_examples" = "xyes"; then
++  AM_PATH_PYTHON([2.7],BUILD_GEN_TP_EXAMPLES=1,[:])
++fi
+ AM_CONDITIONAL([BUILD_GEN_TP_EXAMPLES], [test $BUILD_GEN_TP_EXAMPLES], [Build examples requiring lttng-gen-tp])
+ AC_CONFIG_FILES([
diff --git a/libs/mtdev/Makefile b/libs/mtdev/Makefile
new file mode 100644 (file)
index 0000000..6f1e0b7
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2007-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:=mtdev
+PKG_VERSION:=1.1.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://bitmath.org/code/mtdev/
+PKG_MD5SUM:=52c9610b6002f71d1642dc1a1cca5ec1
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mtdev
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Multitouch Protocol Translation Library
+  URL:=http://bitmath.org/code/mtdev/
+endef
+
+define Package/mtdev/description
+  The mtdev is a stand-alone library which transforms all variants of
+  kernel MT events to the slotted type B protocol. The events put into
+  mtdev may be from any MT device, specifically type A without contact
+  tracking, type A with contact tracking, or type B with contact
+  tracking. See the kernel documentation for further details.
+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/*.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/mtdev/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,mtdev))
diff --git a/libs/mxml/Makefile b/libs/mxml/Makefile
new file mode 100644 (file)
index 0000000..0650ee0
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# 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:=mxml
+PKG_VERSION:=2.10
+PKG_RELEASE:=1
+PKG_MD5SUM:=8804c961a24500a95690ef287d150abe
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.msweet.org/files/project3/
+PKG_FIXUP:=autoreconf
+
+PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mxml
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Mini-XML
+  URL:=http://www.minixml.org/
+endef
+
+define Package/mxml/description
+  A small xml library.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static
+
+define Build/InstallDev
+       mkdir -p $(1)/usr/include
+       $(CP) $(PKG_BUILD_DIR)/mxml.h $(1)/usr/include/
+       mkdir -p $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/libmxml.so* $(1)/usr/lib/
+       mkdir -p $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_BUILD_DIR)/mxml.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/mxml/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/libmxml.so.*  $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,mxml))
diff --git a/libs/mxml/patches/001-targets.patch b/libs/mxml/patches/001-targets.patch
new file mode 100644 (file)
index 0000000..86379f0
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -88,7 +88,7 @@ PUBLIBOBJS   =       mxml-attr.o mxml-entity.o m
+                       mxml-index.o mxml-node.o mxml-search.o mxml-set.o
+ LIBOBJS               =       $(PUBLIBOBJS) mxml-private.o mxml-string.o
+ OBJS          =       mxmldoc.o testmxml.o $(LIBOBJS)
+-TARGETS               =       $(LIBMXML) mxmldoc testmxml mxml.xml doc/mxml.man
++TARGETS               =       $(LIBMXML)
+ #
diff --git a/libs/nacl/Makefile b/libs/nacl/Makefile
new file mode 100644 (file)
index 0000000..d91a223
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2011-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:=nacl
+PKG_VERSION:=20110221
+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_LICENSE:=PublicDomain
+
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/nacl
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=NaCl Networking and Cryptography library
+  URL:=http://nacl.cace-project.eu/
+endef
+
+define Build/Compile
+       (cd $(PKG_BUILD_DIR) && \
+                       CC="$(TARGET_CC)" \
+                       CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+                       AR="$(TARGET_CROSS)ar" \
+                       RANLIB="$(TARGET_CROSS)ranlib" \
+               $(CURDIR)/do-openwrt \
+       )
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/nacl
+       $(CP) $(PKG_BUILD_DIR)/build/include/*.h $(1)/usr/include/nacl/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/build/lib/libnacl.a $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,nacl))
diff --git a/libs/nacl/do-openwrt b/libs/nacl/do-openwrt
new file mode 100755 (executable)
index 0000000..ba4fde3
--- /dev/null
@@ -0,0 +1,206 @@
+#!/bin/sh
+set -e
+
+# nacl/do
+# D. J. Bernstein
+# Public domain.
+
+version=`cat version`
+project=nacl
+
+top="`pwd`/build"
+bin="$top/bin"
+lib="$top/lib"
+include="$top/include"
+work="$top/work"
+
+
+# and work around bug in GNU sort
+LANG=C
+export LANG
+
+rm -rf "$top"
+mkdir -p "$top"
+mkdir -p "$bin"
+mkdir -p "$lib"
+mkdir -p "$include"
+
+exec >"$top/log"
+exec 2>&1
+exec 5>"$top/data"
+exec </dev/null
+
+echo "=== `date` === starting"
+
+echo "=== `date` === building inttypes"
+for target in int8 int16 int32 int64 uint8 uint16 uint32 uint64; do
+  (
+    echo "#ifndef crypto_${target}_h"
+    echo "#define crypto_${target}_h"
+    echo ""
+    echo "#include <stdint.h>"
+    echo ""
+    echo "typedef ${target}_t crypto_${target};"
+    echo ""
+    echo "#endif"
+  ) > "$include/crypto_$target.h"
+done
+
+echo "=== `date` === building randombytes"
+rm -rf "$work"
+mkdir -p "$work"
+cp -pr randombytes/* "$work"
+(
+  cd "$work"
+
+  cp devurandom.c randombytes-impl.c
+  cp devurandom.h randombytes-impl.h
+  $CC $CFLAGS -c randombytes-impl.c
+  mkdir -p lib
+  mv randombytes-impl.o lib/randombytes.o
+  mkdir -p include
+  mv randombytes-impl.h include/randombytes.h
+)
+cp -pr "$work"/lib/* "$lib"
+cp -pr "$work"/include/* "$include"
+
+rm -rf "$work"
+mkdir -p "$work"
+echo 'void crypto_'"$project"'_base(void) { ; }' > "$work/${project}_base.c"
+( cd "$work" && $CC $CFLAGS -c ${project}_base.c )
+$AR cr "$lib/lib${project}.a" "$work/${project}_base.o"
+( $RANLIB "$lib/lib${project}.a" || exit 0 )
+
+# loop over operations
+cat OPERATIONS \
+| while read o
+do
+  [ -d "$o" ] || continue
+
+  # for each operation, loop over primitives
+  ls "$o" \
+  | sort \
+  | while read p
+  do
+    [ -d "$o/$p" ] || continue
+    op="${o}_${p}"
+
+    startdate=`date +%Y%m%d`
+
+    echo "=== `date` === $o/$p"
+
+    rm -rf "$work"
+    mkdir -p "$work"
+
+    if [ -d "$o/$p/ref" ]; then
+      implementationdir="$o/$p/ref"
+    else
+      implementationdir="$o/$p/portable"
+    fi
+
+    opi=`echo "$implementationdir" | tr ./- ___`
+
+    echo "=== `date` === $implementationdir"
+
+    cfiles=`ls "$implementationdir" | grep '\.c$' || :`
+    sfiles=`ls "$implementationdir" | grep '\.[sS]$' || :`
+
+    cp -p "$o"/*.c "$work"
+
+    cp -pr "$implementationdir"/* "$work"
+
+    cp -p MACROS "$work/MACROS"
+    cp -p PROTOTYPES.c "$work/PROTOTYPES.c"
+
+    (
+      cd "$work"
+      (
+       echo "#ifndef ${o}_H"
+       echo "#define ${o}_H"
+       echo ""
+       echo "#include \"${op}.h\""
+       echo ""
+       egrep "${o}"'$|'"${o}"'\(|'"${o}"'_' < MACROS \
+         | sed "s/$o/$op/" | while read mop
+       do
+         echo "#define ${mop} ${mop}" | sed "s/$op/$o/"
+       done
+       echo "#define ${o}_PRIMITIVE \"${p}\""
+       echo "#define ${o}_IMPLEMENTATION ${op}_IMPLEMENTATION"
+       echo "#define ${o}_VERSION ${op}_VERSION"
+       echo ""
+       echo "#endif"
+      ) > "$o.h"
+      (
+       echo "#ifndef ${op}_H"
+       echo "#define ${op}_H"
+       echo ""
+       sed 's/[        ]CRYPTO_/ '"${opi}"'_/g' < api.h
+       echo '#ifdef __cplusplus'
+         #echo '#include <string>'
+         #egrep "${o}"'$|'"${o}"'\(|'"${o}"'_' < PROTOTYPES.cpp \
+         #    | sed "s/$o/$opi/"
+       echo 'extern "C" {'
+       echo '#endif'
+       egrep "${o}"'$|'"${o}"'\(|'"${o}"'_' < PROTOTYPES.c \
+         | sed "s/$o/$opi/"
+       echo '#ifdef __cplusplus'
+       echo '}'
+       echo '#endif'
+       echo ""
+       egrep "${o}"'$|'"${o}"'\(|'"${o}"'_' < MACROS \
+         | sed "s/$o/$opi/" | while read mopi
+       do
+           echo "#define ${mopi} ${mopi}" | sed "s/$opi/$op/"
+       done
+       echo "#define ${op}_IMPLEMENTATION \"${implementationdir}\""
+       echo "#ifndef ${opi}_VERSION"
+       echo "#define ${opi}_VERSION \"-\""
+       echo "#endif"
+       echo "#define ${op}_VERSION ${opi}_VERSION"
+       echo ""
+       echo "#endif"
+      ) > "$op.h"
+
+      echo "=== `date` === $implementationdir $CC $CFLAGS"
+      for f in $cfiles $sfiles
+      do
+       ok=1
+       $CC $CFLAGS \
+           -I. -I"$include" \
+           -c "$f" >errors 2>&1 || ok=0
+       ( if [ `wc -l < errors` -lt 25 ]
+         then
+           cat errors
+         else
+           head errors
+           echo ...
+           tail errors
+         fi
+       ) \
+       | while read err
+       do
+         echo "$version $startdate $o $p fromcompiler $implementationdir $f $err" >&5
+       done
+
+       [ "$ok" = 1 ]
+      done
+
+      for f in *.o
+      do
+       mv "$f" "${opi}-$f"
+      done
+    )
+
+    echo "=== `date` === $implementationdir $CC $CFLAGS finishing"
+
+    $AR cr "$lib/lib${project}.a" "$work"/*.o \
+    && ( $RANLIB "$lib/lib${project}.a" || exit 0 ) \
+    && cp -p "$work/$op.h" "$include/$op.h" \
+    && [ -f "$o/$p/selected" ] \
+    && cp -p "$work/$o.h" "$include/$o.h" \
+    || :
+  done
+done
+
+echo "=== `date` === finishing"
diff --git a/libs/neon/Makefile b/libs/neon/Makefile
new file mode 100644 (file)
index 0000000..2cbcda4
--- /dev/null
@@ -0,0 +1,78 @@
+#
+# 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:=neon
+PKG_VERSION:=0.30.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.webdav.org/neon
+PKG_MD5SUM:=e28d77bf14032d7f5046b3930704ef41
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libneon
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=HTTP and WebDAV client library
+  URL:=http://www.webdav.org/neon/
+  DEPENDS:=+libopenssl +libexpat +zlib
+  MAINTAINER:=Federico Di Marco <fededim@gmail.com>
+endef
+
+define Package/libneon/description
+  neon is an HTTP and WebDAV client library, with a C interface. Features:
+
+  - High-level wrappers for common HTTP and WebDAV operations (GET, MOVE, DELETE, etc)
+  - Low-level interface to the HTTP request/response engine, allowing the use of arbitrary HTTP methods, headers, etc.
+  - Authentication support including Basic and Digest support, along with GSSAPI-based Negotiate on Unix, and
+    SSPI-based Negotiate/NTLM on Win32
+  - SSL/TLS support using OpenSSL or GnuTLS; exposing an abstraction layer for verifying server certificates, handling client
+    certificates, and examining certificate properties. Smartcard-based client certificates are also supported via a
+    PKCS11 wrapper interface.
+  - Abstract interface to parsing XML using libxml2 or expat, and wrappers for simplifying handling XML HTTP response bodies
+  - WebDAV metadata support; wrappers for PROPFIND and PROPPATCH to simplify property manipulation.
+endef
+
+
+TARGET_CFLAGS += $(FPIC)
+TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --with-expat \
+       --with-ssl="openssl" \
+       --without-egd \
+       --without-libproxy
+
+CONFIGURE_VARS += \
+       LDFLAGS="$$$$LDFLAGS -lcrypto -lssl"
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/neon-config $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/neon $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libneon.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/neon.pc $(1)/usr/lib/pkgconfig/
+       $(SED) 's,-I$$$${includedir}/,-I$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/neon-config
+       $(SED) 's,-L$$$${libdir},,g' $(1)/usr/bin/neon-config
+endef
+
+define Package/libneon/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libneon.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libneon))
diff --git a/libs/opus/Makefile b/libs/opus/Makefile
new file mode 100644 (file)
index 0000000..4a6a452
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# 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:=opus
+PKG_VERSION:=1.1.4
+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_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Ted Hess <thess@kitchensync.net> Ian Leonard <antonlacon@gmail.com>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libopus
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=OPUS Audio Codec
+  URL:=http://opus-codec.org/
+endef
+
+define Package/libopus/description
+ Opus is a totally open, royalty-free, highly versatile audio codec. Opus is
+ unmatched for interactive speech and music transmission over the Internet, but
+ is also intended for storage and streaming applications.
+endef
+
+CONFIGURE_ARGS+= \
+       --disable-doc \
+       --disable-extra-programs
+
+ifeq ($(CONFIG_SOFT_FLOAT),y)
+       CONFIGURE_ARGS+= \
+               --enable-fixed-point
+endif
+
+CPU_ASM_BLACKLIST:=xscale arm926ej-s
+
+ifneq ($(findstring $(call qstrip,$(CONFIG_CPU_TYPE)),$(CPU_ASM_BLACKLIST)),)
+       CONFIGURE_ARGS+= --disable-asm
+endif
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/opus $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopus.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/opus.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libopus/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopus.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libopus))
diff --git a/libs/poco/Makefile b/libs/poco/Makefile
new file mode 100644 (file)
index 0000000..fd3eefc
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+# 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:=poco
+PKG_VERSION:=1.7.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_LICENSE:=BSL-1.0
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/poco
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Poco C++ libraries
+  URL:=http://www.pocoproject.org/
+  DEPENDS:=+libstdcpp +libpthread +librt
+  MAINTAINER:=Jean-Michel Julien <jean-michel.julien@trilliantinc.com>
+endef
+
+define Package/poco/description
+  POrtable COmponents, a modern and powerful open source C++ class libraries
+  and frameworks for building network and internet-based applications that
+  run on desktop, server and embedded systems.
+endef
+
+CONFIGURE_ARGS += \
+       --config=Linux \
+       --no-tests \
+       --no-samples \
+       --no-fpenvironment \
+       --no-sharedmemory \
+       --no-wstring \
+       --poquito \
+       --minimal \
+       --shared
+
+define Package/poco/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libPoco{Foundation,XML,JSON,Net,Util}.so* $(1)/usr/lib/
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/Poco $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libPoco{Foundation,XML,JSON,Net,Util}.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,poco))
diff --git a/libs/poco/patches/100-configure.patch b/libs/poco/patches/100-configure.patch
new file mode 100644 (file)
index 0000000..1051dfc
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/configure
++++ b/configure
+@@ -231,9 +231,9 @@
+               ;;
+
+       *)
+-              showhelp
+-              exit 1
+-              ;;
++#             showhelp
++#             exit 1
++#             ;;
+       esac
+
+       shift
diff --git a/libs/poco/patches/200-strerror.patch b/libs/poco/patches/200-strerror.patch
new file mode 100644 (file)
index 0000000..54cce51
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Foundation/src/Error.cpp
++++ b/Foundation/src/Error.cpp
+@@ -66,7 +66,7 @@
+                  without -D_GNU_SOURCE is needed, otherwise the GNU version is
+                  preferred.
+               */
+-#if defined _GNU_SOURCE && !POCO_ANDROID
++#if (defined _GNU_SOURCE && (defined __GLIBC__ || defined __UCLIBC__)) && !POCO_ANDROID
+               char errmsg[256] = "";
+               return std::string(strerror_r(errorCode, errmsg, 256));
+ #elif (_XOPEN_SOURCE >= 600) || POCO_ANDROID
diff --git a/libs/postgresql/files/postgresql.config b/libs/postgresql/files/postgresql.config
new file mode 100644 (file)
index 0000000..4760bf1
--- /dev/null
@@ -0,0 +1,2 @@
+config postgresql config
+       option PGDATA   /var/postgresql/data
diff --git a/libs/postgresql/files/postgresql.init b/libs/postgresql/files/postgresql.init
new file mode 100644 (file)
index 0000000..959f327
--- /dev/null
@@ -0,0 +1,78 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2015 OpenWrt.org
+START=50
+
+PROG=/usr/bin/postmaster
+
+USE_PROCD=1
+
+EXTRA_COMMANDS="status"
+EXTRA_HELP="        status  Show current status of the PostgreSQL server"
+
+fix_hosts() {
+       # make sure localhost (without a dot) is in /etc/hosts
+       grep -q 'localhost$' /etc/hosts || echo '127.0.0.1 localhost' >> /etc/hosts
+}
+
+fix_perms() {
+       # for whatever reason, /dev/null gets wrong perms
+       chmod a+w /dev/null
+}
+
+cleanup() {
+       if [ -f "$1/postmaster.pid" ]; then
+               rm "$1/postmaster.pid"
+       fi
+}
+
+start_service() {
+       . /lib/functions/postgresql.sh
+
+       config_load "postgresql"
+       config_get pgdata config PGDATA
+       config_get pgopts config PGOPTS
+
+       user_exists postgres 5432 || user_add postgres 5432
+       group_exists postgres 5432 || group_add postgres 5432
+
+       fix_perms
+       fix_hosts
+
+       if [ ! -d "${pgdata}" ]; then
+               pg_init_data ${pgdata}
+               [ $? -gt 0 ] && return 1
+       fi
+
+       cleanup "${pgdata}"
+
+       procd_open_instance
+       procd_set_param user postgres
+       procd_set_param command $PROG
+       procd_append_param command -D "${pgdata}"
+       [ -n "${pgopts}" ] && procd_append_param command -o "${pgopts}"
+       procd_set_param respawn retry=60
+       procd_close_instance
+
+       procd_open_instance
+       procd_set_param user postgres
+       procd_set_param command /lib/functions/postgresql.sh init "${pgdata}"
+       procd_close_instance
+}
+
+reload_service() {
+       config_load "postgresql"
+       config_get pgdata config PGDATA
+       /usr/bin/pg_ctl reload -U postgres -D "${pgdata}" -s
+}
+
+stop_service() {
+       config_load "postgresql"
+       config_get pgdata config PGDATA
+       /usr/bin/pg_ctl stop -U postgres -D "${pgdata}" -s
+}
+
+status() {
+       config_load "postgresql"
+       config_get pgdata config PGDATA
+       /usr/bin/pg_ctl status -U postgres -D "${pgdata}"
+}
diff --git a/libs/postgresql/files/postgresql.sh b/libs/postgresql/files/postgresql.sh
new file mode 100644 (file)
index 0000000..78b6ab8
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+PSQL="/usr/bin/psql"
+
+free_megs() {
+       fsdir=$1
+       while [ ! -d "$fsdir" ]; do
+               fsdir=$(dirname $fsdir)
+       done
+       df -m $fsdir | while read fs bl us av cap mnt; do [ "$av" = "Available" ] || echo $av; done
+}
+
+pg_init_data() {
+       # make sure we got at least 50MB of free space
+       [ $(free_megs $1) -lt 50 ] && return 1
+       pg_ctl initdb -U postgres -D $1
+}
+
+pg_server_ready() {
+       t=0
+       while [ $t -le 90 ]; do
+               pg_ctl status -U postgres -D $1 2>/dev/null >/dev/null && return 0
+               t=$((t+1))
+               sleep 1
+       done
+       return 1
+}
+
+# $1: dbname, $2: username, $3: password
+pg_require_db() {
+       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;" ) |
+               $PSQL -U postgres -d template1 -e
+       return $?
+}
+
+pg_test_db() {
+       PGPASSWORD=$3
+       echo "SHOW ALL;" | $PSQL -U $2 -d $1 -q 2>/dev/null >/dev/null
+       return $?
+}
+
+uci_require_db() {
+       local dbname dbuser dbpass
+       config_get dbname $1 name
+       config_get dbuser $1 user
+       config_get dbpass $1 pass
+       pg_require_db $dbname $dbuser $dbpass
+}
+
+[ "$1" = "init" ] && {
+       . /lib/functions.sh
+       pg_server_ready $2 || exit 1
+       config_load postgresql
+       config_foreach uci_require_db postgres-db
+}
diff --git a/libs/postgresql/patches/001-configure_fixes.patch b/libs/postgresql/patches/001-configure_fixes.patch
new file mode 100644 (file)
index 0000000..bc0d2e1
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/configure.in
++++ 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_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
+-AC_CONFIG_AUX_DIR(config)
++AC_CONFIG_AUX_DIR([config])
+ AC_PREFIX_DEFAULT(/usr/local/pgsql)
+ AC_SUBST(configure_args, [$ac_configure_args])
diff --git a/libs/postgresql/patches/200-ranlib.patch b/libs/postgresql/patches/200-ranlib.patch
new file mode 100644 (file)
index 0000000..5232c74
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/port/Makefile
++++ b/src/port/Makefile
+@@ -53,6 +53,7 @@ uninstall:
+ libpgport.a: $(OBJS)
+       rm -f $@
+       $(AR) $(AROPT) $@ $^
++      $(RANLIB) libpgport.a
+ # thread.o needs PTHREAD_CFLAGS (but thread_srv.o does not)
+ thread.o: CFLAGS+=$(PTHREAD_CFLAGS)
diff --git a/libs/postgresql/patches/800-busybox-default-pager.patch b/libs/postgresql/patches/800-busybox-default-pager.patch
new file mode 100644 (file)
index 0000000..0c60867
--- /dev/null
@@ -0,0 +1,13 @@
+--- 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);
+-#ifndef __CYGWIN__
+-#define DEFAULT_PAGER "more"
+-#else
+ #define DEFAULT_PAGER "less"
+-#endif
+ #endif   /* PRINT_H */
diff --git a/libs/postgresql/patches/900-pg_ctl-setuid.patch b/libs/postgresql/patches/900-pg_ctl-setuid.patch
new file mode 100644 (file)
index 0000000..f0bec3a
--- /dev/null
@@ -0,0 +1,109 @@
+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;
+ static char *register_servicename = "PostgreSQL";             /* FIXME: + version ID? */
+ static char *register_username = NULL;
+ static char *register_password = NULL;
++static char *username = "";
+ static char *argv0 = NULL;
+ static bool allow_core_files = false;
+ static time_t start_time;
+@@ -2114,6 +2115,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"));
++#if !defined(WIN32) && !defined(__CYGWIN__)
++      printf(_("  -U, --username=NAME    user name of account PostgreSQL server is running as\n"));
++#endif
+       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)
+               {"pgdata", required_argument, NULL, 'D'},
+               {"silent", no_argument, NULL, 's'},
+               {"timeout", required_argument, NULL, 't'},
++              {"username", required_argument, NULL, 'U'},
+               {"core-files", no_argument, NULL, 'c'},
+               {NULL, 0, NULL, 0}
+       };
+@@ -2350,20 +2355,6 @@ main(int argc, char **argv)
+               }
+       }
+-      /*
+-       * Disallow running as root, to forestall any possible security holes.
+-       */
+-#ifndef WIN32
+-      if (geteuid() == 0)
+-      {
+-              write_stderr(_("%s: cannot be run as root\n"
+-                                         "Please log in (using, e.g., \"su\") as the "
+-                                         "(unprivileged) user that will\n"
+-                                         "own the server process.\n"),
+-                                       progname);
+-              exit(1);
+-      }
+-#endif
+       env_wait = getenv("PGCTLTIMEOUT");
+       if (env_wait != NULL)
+@@ -2449,11 +2440,15 @@ main(int argc, char **argv)
+                                       wait_seconds_arg = true;
+                                       break;
+                               case 'U':
++#if defined(WIN32) || defined(__CYGWIN__)
+                                       if (strchr(optarg, '\\'))
+                                               register_username = pg_strdup(optarg);
+                                       else
+                                               /* Prepend .\ for local accounts */
+                                               register_username = psprintf(".\\%s", optarg);
++#else
++                                      username = pg_strdup(optarg);
++#endif
+                                       break;
+                               case 'w':
+                                       do_wait = true;
+@@ -2535,6 +2530,41 @@ main(int argc, char **argv)
+               exit(1);
+       }
++      /*
++       * Disallow running as root, to forestall any possible security holes.
++       */
++#if !defined(WIN32) && !defined(__CYGWIN__)
++      if (geteuid() == 0)
++      {
++              struct passwd *p;
++              if (!username || !strlen(username)) {
++                      fprintf(stderr,
++                                      _("%s: when run as root, username needs to be provided\n"),
++                                      progname);
++                      exit(1);
++              }
++              p = getpwnam(username);
++              if (!p) {
++                      fprintf(stderr,
++                                      _("%s: invalid username: %s\n"),
++                                      progname, username);
++                      exit(1);
++              }
++              if (!p->pw_uid) {
++                      fprintf(stderr,
++                                      _("%s: user needs to be non-root\n"),
++                                      progname);
++                      exit(1);
++              }
++              if (setgid(p->pw_gid) || setuid(p->pw_uid)) {
++                      fprintf(stderr,
++                                      _("%s: failed to set user id %d: %d (%s)\n"),
++                                      progname, p->pw_uid, errno, strerror(errno));
++                      exit(1);
++              }
++      }
++#endif
++
+       /* Note we put any -D switch into the env var above */
+       pg_config = getenv("PGDATA");
+       if (pg_config)
diff --git a/libs/protobuf-c/Makefile b/libs/protobuf-c/Makefile
new file mode 100644 (file)
index 0000000..16b2f2b
--- /dev/null
@@ -0,0 +1,62 @@
+#
+# Copyright (C) 2011 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:=libprotobuf-c
+PKG_VERSION:=v1.2.1
+PKG_RELEASE:=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=git://github.com/protobuf-c/protobuf-c.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+
+PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
+
+PKG_LICENSE:=BSD-2c
+
+PKG_MAINTAINER:=Jacob Siverskog <jacob@teenageengineering.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libprotobuf-c
+  TITLE:=Protocol Buffers library
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=http://code.google.com/p/protobuf-c/
+endef
+
+define Package/libprotobuf-c/description
+  Runtime library to use Google Protocol Buffers from C applications.
+  Protocol Buffers are a way of encoding structured data in an efficient yet
+  extensible format. Google uses Protocol Buffers for almost all of its
+  internal RPC protocols and file formats.
+endef
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --disable-protoc
+
+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/libprotobuf-c.{a,la,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libprotobuf-c/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libprotobuf-c.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libprotobuf-c))
diff --git a/libs/protobuf/Makefile b/libs/protobuf/Makefile
new file mode 100644 (file)
index 0000000..93d538a
--- /dev/null
@@ -0,0 +1,78 @@
+#
+# Copyright (C) 2007-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:=protobuf
+PKG_VERSION:=2.6.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://github.com/google/protobuf/releases/download/v$(PKG_VERSION)
+PKG_MD5SUM:=11aaac2d704eef8efd1867a807865d85
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DEPENDS:=protobuf/host
+PKG_USE_MIPS16:=0# MIPS16 prevents protobuf's usage of the 'sync' asm-opcode
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+define Package/protobuf
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=A structured data encoding library
+  URL:=http://code.google.com/p/protobuf/
+  DEPENDS:=+zlib +libpthread +libstdcpp
+  MAINTAINER:=Jacob Siverskog <jacob@teenageengineering.com>
+endef
+
+define Package/protobuf/description
+ Protocol Buffers are a way of encoding structured data in an efficient
+ yet extensible format. Google uses Protocol Buffers for almost all
+ of its internal RPC protocols and file formats.
+endef
+
+CONFIGURE_ARGS += --with-protoc=$(STAGING_DIR_HOSTPKG)/bin/protoc
+
+define Build/InstallDev
+       $(INSTALL_DIR) \
+               $(1)/usr/lib \
+               $(1)/usr/include
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/* \
+               $(1)/usr/include/
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/* \
+               $(1)/usr/lib/
+endef
+
+define Package/protobuf/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libprotoc.so*  \
+               $(1)/usr/lib/
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libprotobuf-lite.so* \
+               $(1)/usr/lib/
+
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libprotobuf.so* \
+               $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,protobuf))
+$(eval $(call HostBuild))
diff --git a/libs/protobuf/patches/001-mipseb-compile.patch b/libs/protobuf/patches/001-mipseb-compile.patch
new file mode 100644 (file)
index 0000000..f576833
--- /dev/null
@@ -0,0 +1,11 @@
+--- -  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
new file mode 100644 (file)
index 0000000..df97928
--- /dev/null
@@ -0,0 +1,11 @@
+--- -  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/pthsem/Makefile b/libs/pthsem/Makefile
new file mode 100644 (file)
index 0000000..5d3effb
--- /dev/null
@@ -0,0 +1,68 @@
+#
+# 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:=pthsem
+PKG_VERSION:=2.0.8
+PKG_RELEASE:=5
+
+PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
+PKG_LICENSE:=LGPL-2.1+
+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_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
+PKG_FORTIFY_SOURCE:=0
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/pthsem
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=GNU pth extended with semaphore support
+  URL:=http://www.auto.tuwien.ac.at/~mkoegler/index.php/pth
+endef
+
+define Package/pthsem/description
+  GNU pth is a user mode multi threading library.
+  pthsem is an extend version, with support for semaphores added. It can be installed parallel to a normal pth.
+endef
+
+# The musl libc provides a proper implementation of sigaltstack() so
+# prevent configure from wrongly assuming a broken Linux platform
+ifeq ($(CONFIG_USE_MUSL),y)
+  CONFIGURE_VARS += \
+       ac_cv_check_sjlj=ssjlj
+endif
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pthsem-config $(1)/usr/bin/
+       $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(1)/usr/bin/pthsem-config
+
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP)   $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/libpthsem.{a,la,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/pthsem.pc $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DIR) $(2)/bin
+       $(LN) ../../usr/bin/pthsem-config $(2)/bin/
+endef
+
+define Package/pthsem/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpthsem.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,pthsem))
diff --git a/libs/pthsem/patches/001-linux3x-fix.patch b/libs/pthsem/patches/001-linux3x-fix.patch
new file mode 100644 (file)
index 0000000..3b968f7
--- /dev/null
@@ -0,0 +1,12 @@
+--- pthsem-2.0.8/acinclude.m4
++++ pthsem-2.0.8/acinclude.m4
+@@ -892,6 +892,8 @@
+         case "x`uname -r`" in
+ changequote(, )dnl
+             x2.[23456789]* ) ;;
++changequote(, )dnl
++            x3.* ) ;;
+ changequote([, ])
+             * ) braindead=yes ;;
+         esac
+
diff --git a/libs/pthsem/patches/002-fix-signal.h b/libs/pthsem/patches/002-fix-signal.h
new file mode 100644 (file)
index 0000000..0e4fdfc
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/pth.h.in 2015-07-16 21:14:48.786970549 +0200
++++ b/pth.h.in 2015-07-16 21:15:22.439416462 +0200
+@@ -43,7 +43,7 @@
+ #include <time.h>          /* for struct timespec */
+ #include <sys/time.h>      /* for struct timeval  */
+ #include <sys/socket.h>    /* for sockaddr        */
+-#include <sys/signal.h>    /* for sigset_t        */
++#include <signal.h>        /* for sigset_t        */
+ @EXTRA_INCLUDE_SYS_SELECT_H@
+     /* fallbacks for essential typedefs */
+--- a/pthread.h.in     2015-07-16 21:14:58.948310639 +0200
++++ b/pthread.h.in     2015-07-16 21:15:40.989869061 +0200
+@@ -111,7 +111,7 @@
+ #include <sys/types.h>     /* for ssize_t         */
+ #include <sys/time.h>      /* for struct timeval  */
+ #include <sys/socket.h>    /* for sockaddr        */
+-#include <sys/signal.h>    /* for sigset_t        */
++#include <signal.h>        /* for sigset_t        */
+ #include <time.h>          /* for struct timespec */
+ #include <unistd.h>        /* for off_t           */
+ @EXTRA_INCLUDE_SYS_SELECT_H@
diff --git a/libs/qrencode/Makefile b/libs/qrencode/Makefile
new file mode 100644 (file)
index 0000000..37d39aa
--- /dev/null
@@ -0,0 +1,90 @@
+#
+# Copyright (C) 2006-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:=qrencode
+PKG_VERSION:=3.4.4
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://fukuchi.org/works/qrencode/
+PKG_MD5SUM:=be545f3ce36ea8fbb58612d72c4222de
+PKG_MAINTAINER:=Jonathan Bennett <JBennett@incomsystems.biz>
+PKG_LICENSE:=LGPL-2.1+
+PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libqrencode
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Library for encoding data in a QR Code symbol
+  URL:=http://fukuchi.org/works/qrencode/
+endef
+
+define Package/libqrencode/description
+Libqrencode is a C library for encoding data in a QR Code symbol,
+a kind of 2D symbology that can be scanned by handy terminals such
+as a mobile phone with CCD. The capacity of QR Code is up to 7000
+digits or 4000 characters, and is highly robust.
+endef
+
+define Package/qrencode
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=qrencode binary for producing qr codes
+  URL:=http://fukuchi.org/works/qrencode/
+  DEPENDS:=+libqrencode
+endef
+
+define Package/qrencode/description
+Qrencode is a C program for encoding data in a QR Code symbol,
+a kind of 2D symbology that can be scanned by handy terminals such
+as a mobile phone with CCD. The capacity of QR Code is up to 7000
+digits or 4000 characters, and is highly robust.
+endef
+
+
+CONFIGURE_ARGS+= \
+       --enable-shared \
+       --enable-static \
+       --disable-rpath \
+       --disable-sdltest \
+       --without-tests 
+
+TARGET_LDFLAGS+= -s
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               LDFLAGS="$(TARGET_LDFLAGS)" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/qrencode.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libqrencode.{a,so*} $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/libqrencode.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libqrencode/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libqrencode.so* $(1)/usr/lib/
+endef
+
+define Package/qrencode/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/qrencode $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libqrencode))
+$(eval $(call BuildPackage,qrencode))
diff --git a/libs/qrencode/patches/001-disable-png.patch b/libs/qrencode/patches/001-disable-png.patch
new file mode 100644 (file)
index 0000000..345bb60
--- /dev/null
@@ -0,0 +1,306 @@
+--- 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" ])
diff --git a/libs/quasselc/Makefile b/libs/quasselc/Makefile
new file mode 100644 (file)
index 0000000..3f1d014
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# Copyright (C) 2016 Ben Rosser <rosser.bjr@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:=quasselc
+
+# quasselc upstream doesn't release versions (at least, at the moment),
+# so use commit date for PKG_VERSION and embed commit hash into PKG_RELEASE.
+PKG_VERSION:=2015-04-06
+PKG_SOURCE_VERSION:=fcd966966924e3d9af0954db56117e2f48767ea1
+PKG_RELEASE:=1.$(PKG_SOURCE_VERSION)
+
+PKG_LICENSE:=GPL-3.0+
+
+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_MAINTAINER:=Ben Rosser <rosser.bjr@gmail.com>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+MAKE_FLAGS += prefix=$(STAGING_DIR)/usr libdir=$(STAGING_DIR)/usr/lib includedir=$(STAGING_DIR)/usr/include
+MAKE_INSTALL_FLAGS += prefix=/usr libdir=/usr/lib includedir=/usr/include
+
+define Package/quasselc
+    SECTION:=libs
+    CATEGORY:=Libraries
+    DEPENDS:=+glib2
+    SUBMENU:=Instant Messaging
+    URL:=https://github.com/phhusson/QuasselC
+    TITLE:=API to access a Quassel Core in pure C
+endef
+
+define Package/quasselc/description
+  An implementation of the Quassel protocol in pure C.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/quasselc
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/quasselc/* $(1)/usr/include/quasselc/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libquasselc.so* $(1)/usr/lib/
+       $(LN) libquasselc.so.0 $(1)/usr/lib/libquasselc.so
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/quasselc.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/quasselc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libquasselc.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,quasselc))
diff --git a/libs/quasselc/patches/001-respect-cflags-ldflags.patch b/libs/quasselc/patches/001-respect-cflags-ldflags.patch
new file mode 100644 (file)
index 0000000..7ffbb80
--- /dev/null
@@ -0,0 +1,18 @@
+diff --git a/Makefile b/Makefile
+index 7994eea..b1f8d83 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2,11 +2,11 @@ prefix ?= /usr/local
+ libdir ?= $(prefix)/lib
+ includedir ?= $(prefix)/include
+-CFLAGS:=-Wall -g -Wextra $(shell pkg-config glib-2.0 --cflags) -Wswitch-enum -std=gnu11 -O2 -fPIC
++CFLAGS+=-Wall -g -Wextra $(shell pkg-config glib-2.0 --cflags) -Wswitch-enum -std=gnu11 -fPIC
+ SO_VERSION = 0
+ VERSION = 0
+ INSTALL = install
+-LDLIBS:=$(shell pkg-config glib-2.0 --libs) -lz
++LDLIBS+=$(shell pkg-config glib-2.0 --libs) -lz
+ BOTLIBS := -Wl,-rpath,.
diff --git a/libs/rxtx/Makefile b/libs/rxtx/Makefile
new file mode 100755 (executable)
index 0000000..5a1374f
--- /dev/null
@@ -0,0 +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
diff --git a/libs/rxtx/patches/010-acm-devices.patch b/libs/rxtx/patches/010-acm-devices.patch
new file mode 100755 (executable)
index 0000000..3833c5c
--- /dev/null
@@ -0,0 +1,11 @@
+diff -rupN rxtx-2.2pre2/src/gnu/io/RXTXCommDriver.java rxtx-2.2pre2.new/src/gnu/io/RXTXCommDriver.java\r
+--- rxtx-2.2pre2/src/gnu/io/RXTXCommDriver.java        2008-11-13 16:44:01.000000000 -0800\r
++++ rxtx-2.2pre2.new/src/gnu/io/RXTXCommDriver.java    2015-08-21 16:19:14.330743949 -0700\r
+@@ -579,6 +579,7 @@ public class RXTXCommDriver implements C\r
+                                               "ttyUSB", // for USB frobs\r
+                                               "rfcomm",       // bluetooth serial device\r
+                                               "ttyircomm", // linux IrCommdevices (IrDA serial emu)\r
++                                              "ttyACM" // linux CDC ACM devices\r
+                                               };\r
+                                               CandidatePortPrefixes=Temp;\r
+                                       }\r
diff --git a/libs/sbc/Makefile b/libs/sbc/Makefile
new file mode 100644 (file)
index 0000000..cca5472
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# 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:=sbc
+PKG_VERSION:=1.3
+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_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING.LIB
+PKG_MAINTAINER:=Dirk Neukirchen <dirkneukirchen@web.de>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/sbc
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=sbc encoding library
+  DEPENDS:=+libsndfile
+  URL:=http://www.bluez.org
+endef
+
+define Package/sbc/description
+  Low Complexity Subband Coding for bluetooth audio profiles encoding and decoding.
+  Needed for A2DP support.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/sbc
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/sbc/sbc.h $(1)/usr/include/sbc/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsbc* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sbc.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/sbc/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sbc* $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsbc.so* $(1)/usr/lib/
+endef
+
+
+$(eval $(call BuildPackage,sbc))
diff --git a/libs/speex/Makefile b/libs/speex/Makefile
new file mode 100644 (file)
index 0000000..48522a5
--- /dev/null
@@ -0,0 +1,105 @@
+#
+# Copyright (C) 2006-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:=speex
+PKG_VERSION:=1.2rc1
+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_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libspeex
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Open source speech compression codec library
+  URL:=http://www.speex.org/
+  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
+       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 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
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(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
+
+$(eval $(call BuildPackage,libspeex))
+$(eval $(call BuildPackage,libspeexdsp))
diff --git a/libs/tcp_wrappers/Makefile b/libs/tcp_wrappers/Makefile
new file mode 100644 (file)
index 0000000..d453031
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# Copyright (C) 2006 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:=tcp_wrappers
+PKG_VERSION:=7.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=ftp://ftp.porcupine.org/pub/security
+PKG_MD5SUM:=e6fa25f71226d090f34de3f6b122fb5a
+
+PKG_LICENSE:=BSD
+PKG_LICENE_FILES:=DISCLAIMER
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libwrap
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Security wrapper library for TCP services
+  URL:=ftp://ftp.porcupine.org/pub/security/index.html
+  MAINTAINER:=Peter Wagner <tripolar@gmx.at>
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+ifeq ($(CONFIG_USE_MUSL),)
+TARGET_EXTRA_LIBS:=LIBS=-lnsl
+endif
+
+define Build/Compile   
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               OPT_CFLAGS="$(TARGET_CFLAGS)" \
+               $(TARGET_EXTRA_LIBS) \
+               NETGROUP= \
+               VSYSLOG= \
+               BUGS= \
+               EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 \
+                       -Dss_family=__ss_family -Dss_len=__ss_len" \
+               FACILITY=LOG_DAEMON \
+               SEVERITY=LOG_INFO \
+               REAL_DAEMON_DIR=/usr/sbin \
+               STYLE="-DPROCESS_OPTIONS" \
+               tidy all
+endef
+
+define Build/InstallDev        
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_BUILD_DIR)/tcpd.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/libwrap.a $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/shared/libwrap.so* $(1)/usr/lib/
+endef
+
+define Package/libwrap/install 
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/shared/libwrap.so.* $(1)/usr/lib/
+endef
+       
+$(eval $(call BuildPackage,libwrap))
diff --git a/libs/tcp_wrappers/patches/001-debian_subset.patch b/libs/tcp_wrappers/patches/001-debian_subset.patch
new file mode 100644 (file)
index 0000000..0b3ad2c
--- /dev/null
@@ -0,0 +1,936 @@
+--- a/hosts_access.c
++++ b/hosts_access.c
+@@ -240,6 +240,26 @@ struct request_info *request;
+     }
+ }
++/* hostfile_match - look up host patterns from file */
++
++static int hostfile_match(path, host)
++char   *path;
++struct hosts_info *host;
++{
++    char    tok[BUFSIZ];
++    int     match = NO;
++    FILE   *fp;
++
++    if ((fp = fopen(path, "r")) != 0) {
++        while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
++            /* void */ ;
++        fclose(fp);
++    } else if (errno != ENOENT) {
++        tcpd_warn("open %s: %m", path);
++    }
++    return (match);
++}
++
+ /* host_match - match host name and/or address against pattern */
+ static int host_match(tok, host)
+@@ -267,6 +287,8 @@ struct host_info *host;
+       tcpd_warn("netgroup support is disabled");      /* not tcpd_jump() */
+       return (NO);
+ #endif
++    } else if (tok[0] == '/') {                         /* /file hack */
++        return (hostfile_match(tok, host));
+     } else if (STR_EQ(tok, "KNOWN")) {                /* check address and name */
+       char   *name = eval_hostname(host);
+       return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
+--- a/tcpd.h
++++ b/tcpd.h
+@@ -4,6 +4,25 @@
+   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
+   */
++#ifndef _TCPWRAPPERS_TCPD_H
++#define _TCPWRAPPERS_TCPD_H
++
++/* someone else may have defined this */
++#undef  __P
++
++/* use prototypes if we have an ANSI C compiler or are using C++ */
++#if defined(__STDC__) || defined(__cplusplus)
++#define __P(args)       args
++#else
++#define __P(args)       ()
++#endif
++
++/* Need definitions of struct sockaddr_in and FILE. */
++#include <netinet/in.h>
++#include <stdio.h>
++
++__BEGIN_DECLS
++
+ /* Structure to describe one communications endpoint. */
+ #define STRING_LENGTH 128             /* hosts, users, processes */
+@@ -25,10 +44,10 @@ struct request_info {
+     char    pid[10];                  /* access via eval_pid(request) */
+     struct host_info client[1];               /* client endpoint info */
+     struct host_info server[1];               /* server endpoint info */
+-    void  (*sink) ();                 /* datagram sink function or 0 */
+-    void  (*hostname) ();             /* address to printable hostname */
+-    void  (*hostaddr) ();             /* address to printable address */
+-    void  (*cleanup) ();              /* cleanup function or 0 */
++    void  (*sink) __P((int));         /* datagram sink function or 0 */
++    void  (*hostname) __P((struct host_info *)); /* address to printable hostname */
++    void  (*hostaddr) __P((struct host_info *)); /* address to printable address */
++    void  (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */
+     struct netconfig *config;         /* netdir handle */
+ };
+@@ -61,25 +80,30 @@ extern char paranoid[];
+ /* Global functions. */
+ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
+-extern void fromhost();                       /* get/validate client host info */
++extern void fromhost __P((struct request_info *));    /* get/validate client host info */
+ #else
+ #define fromhost sock_host            /* no TLI support needed */
+ #endif
+-extern int hosts_access();            /* access control */
+-extern void shell_cmd();              /* execute shell command */
+-extern char *percent_x();             /* do %<char> expansion */
+-extern void rfc931();                 /* client name from RFC 931 daemon */
+-extern void clean_exit();             /* clean up and exit */
+-extern void refuse();                 /* clean up and exit */
+-extern char *xgets();                 /* fgets() on steroids */
+-extern char *split_at();              /* strchr() and split */
+-extern unsigned long dot_quad_addr(); /* restricted inet_addr() */
++extern void shell_cmd __P((char *));  /* execute shell command */
++extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */
++extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */
++extern void clean_exit __P((struct request_info *)); /* clean up and exit */
++extern void refuse __P((struct request_info *));      /* clean up and exit */
++extern char *xgets __P((char *, int, FILE *));        /* fgets() on steroids */
++extern char *split_at __P((char *, int));     /* strchr() and split */
++extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */
+ /* Global variables. */
++#ifdef HAVE_WEAKSYMS
++extern int allow_severity __attribute__ ((weak)); /* for connection logging */
++extern int deny_severity __attribute__ ((weak)); /* for connection logging */
++#else
+ extern int allow_severity;            /* for connection logging */
+ extern int deny_severity;             /* for connection logging */
++#endif
++
+ extern char *hosts_allow_table;               /* for verification mode redirection */
+ extern char *hosts_deny_table;                /* for verification mode redirection */
+ extern int hosts_access_verbose;      /* for verbose matching mode */
+@@ -92,9 +116,14 @@ extern int resident;                       /* > 0 if residen
+   */
+ #ifdef __STDC__
++extern int hosts_access(struct request_info *request);
++extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, 
++                     char *client_user);
+ extern struct request_info *request_init(struct request_info *,...);
+ extern struct request_info *request_set(struct request_info *,...);
+ #else
++extern int hosts_access();
++extern int hosts_ctl();
+ extern struct request_info *request_init();   /* initialize request */
+ extern struct request_info *request_set();    /* update request structure */
+ #endif
+@@ -117,27 +146,31 @@ extern struct request_info *request_set(
+   * host_info structures serve as caches for the lookup results.
+   */
+-extern char *eval_user();             /* client user */
+-extern char *eval_hostname();         /* printable hostname */
+-extern char *eval_hostaddr();         /* printable host address */
+-extern char *eval_hostinfo();         /* host name or address */
+-extern char *eval_client();           /* whatever is available */
+-extern char *eval_server();           /* whatever is available */
++extern char *eval_user __P((struct request_info *));  /* client user */
++extern char *eval_hostname __P((struct host_info *)); /* printable hostname */
++extern char *eval_hostaddr __P((struct host_info *)); /* printable host address */
++extern char *eval_hostinfo __P((struct host_info *)); /* host name or address */
++extern char *eval_client __P((struct request_info *));        /* whatever is available */
++extern char *eval_server __P((struct request_info *));        /* whatever is available */
+ #define eval_daemon(r)        ((r)->daemon)   /* daemon process name */
+ #define eval_pid(r)   ((r)->pid)      /* process id */
+ /* Socket-specific methods, including DNS hostname lookups. */
+-extern void sock_host();              /* look up endpoint addresses */
+-extern void sock_hostname();          /* translate address to hostname */
+-extern void sock_hostaddr();          /* address to printable address */
++/* look up endpoint addresses */
++extern void sock_host __P((struct request_info *));
++/* translate address to hostname */
++extern void sock_hostname __P((struct host_info *));
++/* address to printable address */
++extern void sock_hostaddr __P((struct host_info *));
++
+ #define sock_methods(r) \
+       { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
+ /* The System V Transport-Level Interface (TLI) interface. */
+ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
+-extern void tli_host();                       /* look up endpoint addresses etc. */
++extern void tli_host __P((struct request_info *));    /* look up endpoint addresses etc. */
+ #endif
+  /*
+@@ -178,7 +211,7 @@ extern struct tcpd_context tcpd_context;
+   * behavior.
+   */
+-extern void process_options();                /* execute options */
++extern void process_options __P((char *, struct request_info *)); /* execute options */
+ extern int dry_run;                   /* verification flag */
+ /* Bug workarounds. */
+@@ -217,3 +250,7 @@ extern char *fix_strtok();
+ #define strtok        my_strtok
+ extern char *my_strtok();
+ #endif
++
++__END_DECLS
++
++#endif /* tcpd.h */
+--- a/Makefile
++++ b/Makefile
+@@ -1,5 +1,10 @@
++GLIBC=$(shell grep -s -c __GLIBC__ /usr/include/features.h)
++
+ # @(#) Makefile 1.23 97/03/21 19:27:20
++# unset the HOSTNAME environment variable
++HOSTNAME =
++
+ what:
+       @echo
+       @echo "Usage: edit the REAL_DAEMON_DIR definition in the Makefile then:"
+@@ -19,7 +24,7 @@ what:
+       @echo " generic (most bsd-ish systems with sys5 compatibility)"
+       @echo " 386bsd aix alpha apollo bsdos convex-ultranet dell-gcc dgux dgux543"
+       @echo " dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix"
+-      @echo " linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
++      @echo " linux gnu machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
+       @echo " ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4"
+       @echo " sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
+       @echo " uts215 uxp"
+@@ -43,8 +48,8 @@ what:
+ # Ultrix 4.x SunOS 4.x ConvexOS 10.x Dynix/ptx
+ #REAL_DAEMON_DIR=/usr/etc
+ #
+-# SysV.4 Solaris 2.x OSF AIX
+-#REAL_DAEMON_DIR=/usr/sbin
++# SysV.4 Solaris 2.x OSF AIX Linux
++REAL_DAEMON_DIR=/usr/sbin
+ #
+ # BSD 4.4
+ #REAL_DAEMON_DIR=/usr/libexec
+@@ -141,10 +146,21 @@ freebsd:
+       LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
+       EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
++ifneq ($(GLIBC),0)
++MYLIB=-lnsl
++endif
++
+ linux:
+       @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+-      LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
+-      NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
++      LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
++      NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
++      EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT"
++
++gnu:
++      @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++      LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
++      NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
++      EXTRA_CFLAGS="-DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT"
+ # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
+ hpux hpux8 hpux9 hpux10:
+@@ -391,7 +407,7 @@ AR = ar
+ # the ones provided with this source distribution. The environ.c module
+ # implements setenv(), getenv(), and putenv().
+-AUX_OBJ= setenv.o
++#AUX_OBJ= setenv.o
+ #AUX_OBJ= environ.o
+ #AUX_OBJ= environ.o strcasecmp.o
+@@ -454,7 +470,8 @@ AUX_OBJ= setenv.o
+ # host name aliases. Compile with -DSOLARIS_24_GETHOSTBYNAME_BUG to work
+ # around this. The workaround does no harm on other Solaris versions.
+-BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
++BUGS =
++#BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
+ #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DINET_ADDR_BUG
+ #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DSOLARIS_24_GETHOSTBYNAME_BUG
+@@ -464,7 +481,7 @@ BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS
+ # If your system supports NIS or YP-style netgroups, enable the following
+ # macro definition. Netgroups are used only for host access control.
+ #
+-#NETGROUP= -DNETGROUP
++NETGROUP= -DNETGROUP
+ ###############################################################
+ # System dependencies: whether or not your system has vsyslog()
+@@ -491,7 +508,7 @@ VSYSLOG    = -Dvsyslog=myvsyslog
+ # Uncomment the next definition to turn on the language extensions
+ # (examples: allow, deny, banners, twist and spawn).
+ # 
+-#STYLE        = -DPROCESS_OPTIONS     # Enable language extensions.
++STYLE = -DPROCESS_OPTIONS     # Enable language extensions.
+ ################################################################
+ # Optional: Changing the default disposition of logfile records
+@@ -514,7 +531,7 @@ VSYSLOG    = -Dvsyslog=myvsyslog
+ #
+ # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
+-FACILITY= LOG_MAIL    # LOG_MAIL is what most sendmail daemons use
++FACILITY= LOG_DAEMON  # LOG_MAIL is what most sendmail daemons use
+ # The syslog priority at which successful connections are logged.
+@@ -610,7 +627,7 @@ TABLES     = -DHOSTS_DENY=\"/etc/hosts.deny\
+ # Paranoid mode implies hostname lookup. In order to disable hostname
+ # lookups altogether, see the next section.
+-PARANOID= -DPARANOID
++#PARANOID= -DPARANOID
+ ########################################
+ # Optional: turning off hostname lookups
+@@ -623,7 +640,7 @@ PARANOID= -DPARANOID
+ # In order to perform selective hostname lookups, disable paranoid
+ # mode (see previous section) and comment out the following definition.
+-HOSTNAME= -DALWAYS_HOSTNAME
++#HOSTNAME= -DALWAYS_HOSTNAME
+ #############################################
+ # Optional: Turning on host ADDRESS checking
+@@ -649,28 +666,46 @@ HOSTNAME= -DALWAYS_HOSTNAME
+ # source-routed traffic in the kernel. Examples: 4.4BSD derivatives,
+ # Solaris 2.x, and Linux. See your system documentation for details.
+ #
+-# KILL_OPT= -DKILL_IP_OPTIONS
++KILL_OPT= -DKILL_IP_OPTIONS
+ ## End configuration options
+ ############################
+ # Protection against weird shells or weird make programs.
++CC    = gcc
+ SHELL = /bin/sh
+-.c.o:;        $(CC) $(CFLAGS) -c $*.c
++.c.o:;        $(CC) $(CFLAGS) -o $*.o -c $*.c
++
++SOMAJOR = 0
++SOMINOR = 7.6
++
++LIB   = libwrap.a
++SHLIB = shared/libwrap.so.$(SOMAJOR).$(SOMINOR)
++SHLIBSOMAJ= shared/libwrap.so.$(SOMAJOR)
++SHLIBSO       = shared/libwrap.so
++SHLIBFLAGS = -Lshared -lwrap
+-CFLAGS        = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
++shared/%.o: %.c
++      $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
++
++CFLAGS        = -O2 -g -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
+       $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
+       -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
+       -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
+       $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
+       $(VSYSLOG) $(HOSTNAME)
++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
++SHCFLAGS = -fPIC -shared -D_REENTRANT
++
+ LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
+       hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \
+       $(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \
+       update.o misc.o diag.o percent_m.o myvsyslog.o
++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
++
+ FROM_OBJ= fromhost.o
+ KIT   = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
+@@ -684,46 +719,78 @@ KIT      = README miscd.c tcpd.c fromhost.c h
+       refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \
+       scaffold.h tcpdmatch.8 README.NIS
+-LIB   = libwrap.a
+-
+-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
++all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
+ # Invalidate all object files when the compiler options (CFLAGS) have changed.
+ config-check:
+       @set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; }
+-      @set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \
+-      if cmp cflags /tmp/cflags.$$$$ ; \
+-      then rm /tmp/cflags.$$$$ ; \
+-      else mv /tmp/cflags.$$$$ cflags ; \
++      @set +e; echo $(CFLAGS) >cflags.new ; \
++      if cmp cflags cflags.new ; \
++      then rm cflags.new ; \
++      else mv cflags.new cflags ; \
+       fi >/dev/null 2>/dev/null
++      @if [ ! -d shared ]; then mkdir shared; fi
+ $(LIB):       $(LIB_OBJ)
+       rm -f $(LIB)
+       $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
+       -$(RANLIB) $(LIB)
+-tcpd: tcpd.o $(LIB)
+-      $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
++$(SHLIB): $(SHLIB_OBJ)
++      rm -f $(SHLIB)
++      $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
++      ln -s $(notdir $(SHLIB)) $(SHLIBSOMAJ)
++      ln -s $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
++
++tcpd: tcpd.o $(SHLIB)
++      $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
+-miscd:        miscd.o $(LIB)
+-      $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
++miscd:        miscd.o $(SHLIB)
++      $(CC) $(CFLAGS) -o $@ miscd.o $(SHLIBFLAGS)
+-safe_finger: safe_finger.o $(LIB)
+-      $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
++safe_finger: safe_finger.o $(SHLIB)
++      $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
+ TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
+-tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
+-      $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
++tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
++      $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
+-try-from: try-from.o fakelog.o $(LIB)
+-      $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
++try-from: try-from.o fakelog.o $(SHLIB)
++      $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
+ TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
+-tcpdchk: $(TCPDCHK_OBJ) $(LIB)
+-      $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
++tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
++      $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
++
++install: install-lib install-bin install-dev
++
++install-lib:
++      install -o root -g root -m 0644 $(SHLIB) ${DESTDIR}/lib/
++      ln -s $(notdir $(SHLIB)) ${DESTDIR}/lib/$(notdir $(SHLIBSOMAJ))
++
++install-bin:
++      install -o root -g root -m 0755 tcpd ${DESTDIR}/usr/sbin/
++      install -o root -g root -m 0755 tcpdchk ${DESTDIR}/usr/sbin/
++      install -o root -g root -m 0755 tcpdmatch ${DESTDIR}/usr/sbin/
++      install -o root -g root -m 0755 try-from ${DESTDIR}/usr/sbin/
++      install -o root -g root -m 0755 safe_finger ${DESTDIR}/usr/sbin/
++      install -o root -g root -m 0644 tcpd.8 ${DESTDIR}/usr/share/man/man8/
++      install -o root -g root -m 0644 tcpdchk.8 ${DESTDIR}/usr/share/man/man8/
++      install -o root -g root -m 0644 tcpdmatch.8 ${DESTDIR}/usr/share/man/man8/
++      install -o root -g root -m 0644 hosts_access.5 ${DESTDIR}/usr/share/man/man5/
++      install -o root -g root -m 0644 hosts_options.5 ${DESTDIR}/usr/share/man/man5/
++
++install-dev:
++      ln -s /lib/$(notdir $(SHLIBSOMAJ)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSO))
++      install -o root -g root -m 0644 hosts_access.3 ${DESTDIR}/usr/share/man/man3/
++      install -o root -g root -m 0644 tcpd.h ${DESTDIR}/usr/include/
++      install -o root -g root -m 0644 $(LIB) ${DESTDIR}/usr/lib/
++      ln -s hosts_access.3 ${DESTDIR}/usr/share/man/man3/hosts_ctl.3
++      ln -s hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_init.3
++      ln -s hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_set.3
+ shar: $(KIT)
+       @shar $(KIT)
+@@ -739,7 +806,8 @@ archive:
+ clean:
+       rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \
+-      cflags
++      cflags libwrap*.so*
++      rm -rf shared
+ tidy: clean
+       chmod -R a+r .
+@@ -885,5 +953,6 @@ update.o: cflags
+ update.o: mystdarg.h
+ update.o: tcpd.h
+ vfprintf.o: cflags
++weak_symbols.o: tcpd.h
+ workarounds.o: cflags
+ workarounds.o: tcpd.h
+--- a/hosts_access.5
++++ b/hosts_access.5
+@@ -8,9 +8,9 @@ name, host name/address) patterns.  Exam
+ impatient reader is encouraged to skip to the EXAMPLES section for a
+ quick introduction.
+ .PP
+-An extended version of the access control language is described in the
+-\fIhosts_options\fR(5) document. The extensions are turned on at
+-program build time by building with -DPROCESS_OPTIONS.
++The extended version of the access control language is described in the
++\fIhosts_options\fR(5) document. \fBNote that this language supersedes
++the meaning of \fIshell_command\fB as documented below.\fR
+ .PP
+ In the following text, \fIdaemon\fR is the the process name of a
+ network daemon process, and \fIclient\fR is the name and/or address of
+@@ -40,7 +40,7 @@ A newline character is ignored when it i
+ character. This permits you to break up long lines so that they are
+ easier to edit.
+ .IP \(bu
+-Blank lines or lines that begin with a `#\' character are ignored.
++Blank lines or lines that begin with a `#' character are ignored.
+ This permits you to insert comments and whitespace so that the tables
+ are easier to read.
+ .IP \(bu
+@@ -69,26 +69,33 @@ checks are case insensitive.
+ .SH PATTERNS
+ The access control language implements the following patterns:
+ .IP \(bu
+-A string that begins with a `.\' character. A host name is matched if
++A string that begins with a `.' character. A host name is matched if
+ the last components of its name match the specified pattern.  For
+-example, the pattern `.tue.nl\' matches the host name
+-`wzv.win.tue.nl\'.
++example, the pattern `.tue.nl' matches the host name
++`wzv.win.tue.nl'.
+ .IP \(bu
+-A string that ends with a `.\' character. A host address is matched if
++A string that ends with a `.' character. A host address is matched if
+ its first numeric fields match the given string.  For example, the
+-pattern `131.155.\' matches the address of (almost) every host on the
++pattern `131.155.' matches the address of (almost) every host on the
+ Eind\%hoven University network (131.155.x.x).
+ .IP \(bu
+-A string that begins with an `@\' character is treated as an NIS
++A string that begins with an `@' character is treated as an NIS
+ (formerly YP) netgroup name. A host name is matched if it is a host
+ member of the specified netgroup. Netgroup matches are not supported
+ for daemon process names or for client user names.
+ .IP \(bu
+-An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a
+-`net/mask\' pair. A host address is matched if `net\' is equal to the
+-bitwise AND of the address and the `mask\'. For example, the net/mask
+-pattern `131.155.72.0/255.255.254.0\' matches every address in the
+-range `131.155.72.0\' through `131.155.73.255\'.
++An expression of the form `n.n.n.n/m.m.m.m' is interpreted as a
++`net/mask' pair. A host address is matched if `net' is equal to the
++bitwise AND of the address and the `mask'. For example, the net/mask
++pattern `131.155.72.0/255.255.254.0' matches every address in the
++range `131.155.72.0' through `131.155.73.255'.
++.IP \(bu
++A string that begins with a `/' character is treated as a file
++name. A host name or address is matched if it matches any host name
++or address pattern listed in the named file. The file format is
++zero or more lines with zero or more host name or address patterns
++separated by whitespace.  A file name pattern can be used anywhere
++a host name or address pattern can be used.
+ .SH WILDCARDS
+ The access control language supports explicit wildcards:
+ .IP ALL
+@@ -115,19 +122,19 @@ without -DPARANOID when you want more co
+ .ne 6
+ .SH OPERATORS
+ .IP EXCEPT
+-Intended use is of the form: `list_1 EXCEPT list_2\'; this construct
++Intended use is of the form: `list_1 EXCEPT list_2'; this construct
+ matches anything that matches \fIlist_1\fR unless it matches
+ \fIlist_2\fR.  The EXCEPT operator can be used in daemon_lists and in
+ client_lists. The EXCEPT operator can be nested: if the control
+-language would permit the use of parentheses, `a EXCEPT b EXCEPT c\'
+-would parse as `(a EXCEPT (b EXCEPT c))\'.
++language would permit the use of parentheses, `a EXCEPT b EXCEPT c'
++would parse as `(a EXCEPT (b EXCEPT c))'.
+ .br
+ .ne 6
+ .SH SHELL COMMANDS
+ If the first-matched access control rule contains a shell command, that
+ command is subjected to %<letter> substitutions (see next section).
+ The result is executed by a \fI/bin/sh\fR child process with standard
+-input, output and error connected to \fI/dev/null\fR.  Specify an `&\'
++input, output and error connected to \fI/dev/null\fR.  Specify an `&'
+ at the end of the command if you do not want to wait until it has
+ completed.
+ .PP
+@@ -159,7 +166,7 @@ depending on how much information is ava
+ .IP %u
+ The client user name (or "unknown").
+ .IP %%
+-Expands to a single `%\' character.
++Expands to a single `%' character.
+ .PP
+ Characters in % expansions that may confuse the shell are replaced by
+ underscores.
+@@ -243,9 +250,9 @@ A positive IDENT lookup result (the clie
+ less trustworthy. It is possible for an intruder to spoof both the
+ client connection and the IDENT lookup, although doing so is much
+ harder than spoofing just a client connection. It may also be that
+-the client\'s IDENT server is lying.
++the client's IDENT server is lying.
+ .PP
+-Note: IDENT lookups don\'t work with UDP services. 
++Note: IDENT lookups don't work with UDP services. 
+ .SH EXAMPLES
+ The language is flexible enough that different types of access control
+ policy can be expressed with a minimum of fuss. Although the language
+@@ -285,7 +292,7 @@ ALL: LOCAL @some_netgroup
+ .br
+ ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
+ .PP
+-The first rule permits access from hosts in the local domain (no `.\'
++The first rule permits access from hosts in the local domain (no `.'
+ in the host name) and from members of the \fIsome_netgroup\fP
+ netgroup.  The second rule permits access from all hosts in the
+ \fIfoobar.edu\fP domain (notice the leading dot), with the exception of
+@@ -322,8 +329,8 @@ in.tftpd: LOCAL, .my.domain
+ /etc/hosts.deny:
+ .in +3
+ .nf
+-in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\
+-      /usr/ucb/mail -s %d-%h root) &
++in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\
++      /usr/bin/mail -s %d-%h root) &
+ .fi
+ .PP
+ The safe_finger command comes with the tcpd wrapper and should be
+@@ -349,7 +356,7 @@ control rule; when the length of an acce
+ capacity of an internal buffer; when an access control rule is not
+ terminated by a newline character; when the result of %<letter>
+ expansion would overflow an internal buffer; when a system call fails
+-that shouldn\'t.  All problems are reported via the syslog daemon.
++that shouldn't.  All problems are reported via the syslog daemon.
+ .SH FILES
+ .na
+ .nf
+--- a/rfc931.c
++++ b/rfc931.c
+@@ -33,7 +33,7 @@ static char sccsid[] = "@(#) rfc931.c 1.
+ int     rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */
+-static jmp_buf timebuf;
++static sigjmp_buf timebuf;
+ /* fsocket - open stdio stream on top of socket */
+@@ -62,7 +62,7 @@ int     protocol;
+ static void timeout(sig)
+ int     sig;
+ {
+-    longjmp(timebuf, sig);
++    siglongjmp(timebuf, sig);
+ }
+ /* rfc931 - return remote user name, given socket structures */
+@@ -99,7 +99,7 @@ char   *dest;
+        * Set up a timer so we won't get stuck while waiting for the server.
+        */
+-      if (setjmp(timebuf) == 0) {
++      if (sigsetjmp(timebuf,1) == 0) {
+           signal(SIGALRM, timeout);
+           alarm(rfc931_timeout);
+--- a/tcpd.8
++++ b/tcpd.8
+@@ -94,7 +94,7 @@ configuration files.
+ .PP
+ The example assumes that the network daemons live in /usr/etc. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, or have
+-no `in.\' prefix to their name.
++no `in.' prefix to their name.
+ .SH EXAMPLE 2
+ This example applies when \fItcpd\fR expects that the network daemons
+ are left in their original place.
+@@ -110,26 +110,26 @@ finger  stream  tcp  nowait  nobody  /us
+ becomes:
+ .sp
+ .ti +5
+-finger  stream  tcp  nowait  nobody  /some/where/tcpd     in.fingerd
++finger  stream  tcp  nowait  nobody  /usr/sbin/tcpd       in.fingerd
+ .sp
+ .fi
+ .PP
+ The example assumes that the network daemons live in /usr/etc. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, the
+-daemons have no `in.\' prefix to their name, or there is no userid
++daemons have no `in.' prefix to their name, or there is no userid
+ field in the inetd configuration file.
+ .PP
+ Similar changes will be needed for the other services that are to be
+-covered by \fItcpd\fR.  Send a `kill -HUP\' to the \fIinetd\fR(8)
++covered by \fItcpd\fR.  Send a `kill -HUP' to the \fIinetd\fR(8)
+ process to make the changes effective. AIX users may also have to
+-execute the `inetimp\' command.
++execute the `inetimp' command.
+ .SH EXAMPLE 3
+ In the case of daemons that do not live in a common directory ("secret"
+ or otherwise), edit the \fIinetd\fR configuration file so that it
+ specifies an absolute path name for the process name field. For example:
+ .nf
+ .sp
+-    ntalk  dgram  udp  wait  root  /some/where/tcpd  /usr/local/lib/ntalkd
++    ntalk  dgram  udp  wait  root  /usr/sbin/tcpd  /usr/sbin/in.ntalkd
+ .sp
+ .fi
+ .PP
+--- a/hosts_access.3
++++ b/hosts_access.3
+@@ -3,7 +3,7 @@
+ hosts_access, hosts_ctl, request_init, request_set \- access control library
+ .SH SYNOPSIS
+ .nf
+-#include "tcpd.h"
++#include <tcpd.h>
+ extern int allow_severity;
+ extern int deny_severity;
+--- a/options.c
++++ b/options.c
+@@ -473,6 +473,9 @@ static struct syslog_names log_fac[] = {
+ #ifdef LOG_CRON
+     "cron", LOG_CRON,
+ #endif
++#ifdef LOG_FTP
++    "ftp", LOG_FTP,
++#endif
+ #ifdef LOG_LOCAL0
+     "local0", LOG_LOCAL0,
+ #endif
+--- a/fix_options.c
++++ b/fix_options.c
+@@ -35,7 +35,12 @@ struct request_info *request;
+ #ifdef IP_OPTIONS
+     unsigned char optbuf[BUFFER_SIZE / 3], *cp;
+     char    lbuf[BUFFER_SIZE], *lp;
++#if !defined(__GLIBC__)
+     int     optsize = sizeof(optbuf), ipproto;
++#else /* __GLIBC__ */
++    size_t  optsize = sizeof(optbuf);
++    int     ipproto;
++#endif /* __GLIBC__ */
+     struct protoent *ip;
+     int     fd = request->fd;
+     unsigned int opt;
+--- a/workarounds.c
++++ b/workarounds.c
+@@ -163,7 +163,11 @@ int    *fromlen;
+ int     fix_getpeername(sock, sa, len)
+ int     sock;
+ struct sockaddr *sa;
++#if !defined(__GLIBC__)
+ int    *len;
++#else /* __GLIBC__ */
++size_t *len;
++#endif /* __GLIBC__ */
+ {
+     int     ret;
+     struct sockaddr_in *sin = (struct sockaddr_in *) sa;
+--- a/socket.c
++++ b/socket.c
+@@ -76,7 +76,11 @@ struct request_info *request;
+ {
+     static struct sockaddr_in client;
+     static struct sockaddr_in server;
++#if !defined (__GLIBC__)
+     int     len;
++#else /* __GLIBC__ */
++    size_t  len;
++#endif /* __GLIBC__ */
+     char    buf[BUFSIZ];
+     int     fd = request->fd;
+@@ -224,7 +228,11 @@ int     fd;
+ {
+     char    buf[BUFSIZ];
+     struct sockaddr_in sin;
++#if !defined(__GLIBC__)
+     int     size = sizeof(sin);
++#else /* __GLIBC__ */
++    size_t  size = sizeof(sin);
++#endif /* __GLIBC__ */
+     /*
+      * Eat up the not-yet received datagram. Some systems insist on a
+--- a/safe_finger.c
++++ b/safe_finger.c
+@@ -26,21 +26,24 @@ static char sccsid[] = "@(#) safe_finger
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <pwd.h>
++#include <syslog.h>
+ extern void exit();
+ /* Local stuff */
+-char    path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin";
++char    path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
+ #define       TIME_LIMIT      60              /* Do not keep listinging forever */
+ #define       INPUT_LENGTH    100000          /* Do not keep listinging forever */
+ #define       LINE_LENGTH     128             /* Editors can choke on long lines */
+ #define       FINGER_PROGRAM  "finger"        /* Most, if not all, UNIX systems */
+ #define       UNPRIV_NAME     "nobody"        /* Preferred privilege level */
+-#define       UNPRIV_UGID     32767           /* Default uid and gid */
++#define       UNPRIV_UGID     65534           /* Default uid and gid */
+ int     finger_pid;
++int   allow_severity = SEVERITY;
++int   deny_severity = LOG_WARNING;
+ void    cleanup(sig)
+ int     sig;
+--- a/hosts_options.5
++++ b/hosts_options.5
+@@ -58,12 +58,12 @@ Notice the leading dot on the domain nam
+ Execute, in a child process, the specified shell command, after
+ performing the %<letter> expansions described in the hosts_access(5)
+ manual page.  The command is executed with stdin, stdout and stderr
+-connected to the null device, so that it won\'t mess up the
++connected to the null device, so that it won't mess up the
+ conversation with the client host. Example:
+ .sp
+ .nf
+ .ti +3
+-spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) &
++spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) &
+ .fi
+ .sp
+ executes, in a background child process, the shell command "safe_finger
+--- a/tcpdchk.c
++++ b/tcpdchk.c
+@@ -350,6 +350,8 @@ char   *pat;
+ {
+     if (pat[0] == '@') {
+       tcpd_warn("%s: daemon name begins with \"@\"", pat);
++    } else if (pat[0] == '/') {
++        tcpd_warn("%s: daemon name begins with \"/\"", pat);
+     } else if (pat[0] == '.') {
+       tcpd_warn("%s: daemon name begins with dot", pat);
+     } else if (pat[strlen(pat) - 1] == '.') {
+@@ -382,6 +384,8 @@ char   *pat;
+ {
+     if (pat[0] == '@') {                      /* @netgroup */
+       tcpd_warn("%s: user name begins with \"@\"", pat);
++    } else if (pat[0] == '/') {
++        tcpd_warn("%s: user name begins with \"/\"", pat);
+     } else if (pat[0] == '.') {
+       tcpd_warn("%s: user name begins with dot", pat);
+     } else if (pat[strlen(pat) - 1] == '.') {
+@@ -402,8 +406,13 @@ char   *pat;
+ static int check_host(pat)
+ char   *pat;
+ {
++    char    buf[BUFSIZ];
+     char   *mask;
+     int     addr_count = 1;
++    FILE   *fp;
++    struct tcpd_context saved_context;
++    char   *cp;
++    char   *wsp = " \t\r\n";
+     if (pat[0] == '@') {                      /* @netgroup */
+ #ifdef NO_NETGRENT
+@@ -422,6 +431,21 @@ char   *pat;
+       tcpd_warn("netgroup support disabled");
+ #endif
+ #endif
++    } else if (pat[0] == '/') {                 /* /path/name */
++        if ((fp = fopen(pat, "r")) != 0) {
++            saved_context = tcpd_context;
++            tcpd_context.file = pat;
++            tcpd_context.line = 0;
++            while (fgets(buf, sizeof(buf), fp)) {
++                tcpd_context.line++;
++                for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp))
++                    check_host(cp);
++            }
++            tcpd_context = saved_context;
++            fclose(fp);
++        } else if (errno != ENOENT) {
++            tcpd_warn("open %s: %m", pat);
++        }
+     } else if (mask = split_at(pat, '/')) {   /* network/netmask */
+       if (dot_quad_addr(pat) == INADDR_NONE
+           || dot_quad_addr(mask) == INADDR_NONE)
+--- a/percent_m.c
++++ b/percent_m.c
+@@ -13,7 +13,7 @@ static char sccsid[] = "@(#) percent_m.c
+ #include <string.h>
+ extern int errno;
+-#ifndef SYS_ERRLIST_DEFINED
++#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR)
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+ #endif
+@@ -29,11 +29,15 @@ char   *ibuf;
+     while (*bp = *cp)
+       if (*cp == '%' && cp[1] == 'm') {
++#ifdef HAVE_STRERROR
++            strcpy(bp, strerror(errno));
++#else
+           if (errno < sys_nerr && errno > 0) {
+               strcpy(bp, sys_errlist[errno]);
+           } else {
+               sprintf(bp, "Unknown error %d", errno);
+           }
++#endif
+           bp += strlen(bp);
+           cp += 2;
+       } else {
+--- a/scaffold.c
++++ b/scaffold.c
+@@ -180,10 +180,12 @@ struct request_info *request;
+ /* ARGSUSED */
+-void    rfc931(request)
+-struct request_info *request;
++void    rfc931(rmt_sin, our_sin, dest)
++struct sockaddr_in *rmt_sin;
++struct sockaddr_in *our_sin;
++char   *dest;
+ {
+-    strcpy(request->user, unknown);
++    strcpy(dest, unknown);
+ }
+ /* check_path - examine accessibility */
+--- /dev/null
++++ b/weak_symbols.c
+@@ -0,0 +1,11 @@
++ /*
++  * @(#) weak_symbols.h 1.5 99/12/29 23:50
++  * 
++  * Author: Anthony Towns <ajt@debian.org>
++  */
++
++#ifdef HAVE_WEAKSYMS
++#include <syslog.h>
++int deny_severity = LOG_WARNING;
++int allow_severity = SEVERITY; 
++#endif
diff --git a/libs/tcp_wrappers/patches/002-opt_cflags.patch b/libs/tcp_wrappers/patches/002-opt_cflags.patch
new file mode 100644 (file)
index 0000000..1f38eb3
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/Makefile
++++ b/Makefile
+@@ -689,7 +689,8 @@ SHLIBFLAGS = -Lshared -lwrap
+ shared/%.o: %.c
+       $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
+-CFLAGS        = -O2 -g -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
++OPT_CFLAGS = -O2 -g
++CFLAGS        = $(OPT_CFLAGS) -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
+       $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
+       -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
+       -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
diff --git a/libs/tcp_wrappers/patches/003-scaffold_malloc.patch b/libs/tcp_wrappers/patches/003-scaffold_malloc.patch
new file mode 100644 (file)
index 0000000..ecda5ae
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/scaffold.c
++++ b/scaffold.c
+@@ -20,13 +20,12 @@ static char sccs_id[] = "@(#) scaffold.c
+ #include <syslog.h>
+ #include <setjmp.h>
+ #include <string.h>
++#include <stdlib.h>
+ #ifndef INADDR_NONE
+ #define       INADDR_NONE     (-1)            /* XXX should be 0xffffffff */
+ #endif
+-extern char *malloc();
+-
+ /* Application-specific. */
+ #include "tcpd.h"
diff --git a/libs/tcp_wrappers/patches/004-ipv4_prefix.patch b/libs/tcp_wrappers/patches/004-ipv4_prefix.patch
new file mode 100644 (file)
index 0000000..29c9cef
--- /dev/null
@@ -0,0 +1,72 @@
+--- a/hosts_access.5
++++ b/hosts_access.5
+@@ -90,6 +90,9 @@ bitwise AND of the address and the `mask
+ pattern `131.155.72.0/255.255.254.0' matches every address in the
+ range `131.155.72.0' through `131.155.73.255'.
+ .IP \(bu
++An expression of the form `n.n.n.n/m\' is interpreted as a
++`net/prefixlen\' pair, as below, for IPv4 addresses.
++.IP \(bu
+ A string that begins with a `/' character is treated as a file
+ name. A host name or address is matched if it matches any host name
+ or address pattern listed in the named file. The file format is
+--- a/tcpd.h
++++ b/tcpd.h
+@@ -93,6 +93,7 @@ extern void refuse __P((struct request_i
+ extern char *xgets __P((char *, int, FILE *));        /* fgets() on steroids */
+ extern char *split_at __P((char *, int));     /* strchr() and split */
+ extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */
++extern unsigned long prefix_to_netmask __P((char *)); /* 0-32 prefix length */
+ /* Global variables. */
+--- a/misc.c
++++ b/misc.c
+@@ -14,6 +14,8 @@ static char sccsic[] = "@(#) misc.c 1.2
+ #include <arpa/inet.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <ctype.h>
++#include <stdlib.h>
+ #include "tcpd.h"
+@@ -85,3 +87,22 @@ char   *str;
+     }
+     return (runs == 4 ? inet_addr(str) : INADDR_NONE);
+ }
++
++/* prefix_to_netmask - convert prefix (0-32) to netmask */
++
++unsigned long prefix_to_netmask(str)
++char  *str;
++{
++    unsigned long prefix;
++    char *endptr;
++
++    if (!isdigit(str[0]))
++      return INADDR_NONE;
++
++    prefix = strtoul(str, &endptr, 10);
++    if ((endptr == str) || (*endptr != '\0') || (prefix > 32))
++      return INADDR_NONE;
++
++    return htonl(~0UL << (32 - prefix));
++}
++
+--- a/hosts_access.c
++++ b/hosts_access.c
+@@ -345,7 +345,12 @@ char   *string;
+     if ((addr = dot_quad_addr(string)) == INADDR_NONE)
+       return (NO);
+     if ((net = dot_quad_addr(net_tok)) == INADDR_NONE
+-      || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) {
++      || ((mask = dot_quad_addr(mask_tok)) == INADDR_NONE
++          && strcmp(mask_tok, "255.255.255.255")
++          && (mask = prefix_to_netmask(mask_tok)) == INADDR_NONE
++          && strcmp(mask_tok, "32"))) {
++      /* 255.255.255.255 == INADDR_NONE, separate check needed. TJ. */
++      /* 32 == INADDR_NONE, separate check needed. philipp */
+       tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok);
+       return (NO);                            /* not tcpd_jump() */
+     }
diff --git a/libs/tcp_wrappers/patches/005-no--lnsl-on-musl.patch b/libs/tcp_wrappers/patches/005-no--lnsl-on-musl.patch
new file mode 100644 (file)
index 0000000..5e7b968
--- /dev/null
@@ -0,0 +1,22 @@
+Index: tcp_wrappers_7.6/Makefile
+===================================================================
+--- tcp_wrappers_7.6.orig/Makefile
++++ tcp_wrappers_7.6/Makefile
+@@ -1,4 +1,4 @@
+-GLIBC=$(shell grep -s -c __GLIBC__ /usr/include/features.h)
++GLIBC=$(shell grep -s -c __GLIBC__ ${STAGING_DIR}/usr/include/features.h)
+ # @(#) Makefile 1.23 97/03/21 19:27:20
+@@ -146,9 +146,11 @@ freebsd:
+       LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
+       EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
++ifneq ($(GLIBC),)
+ ifneq ($(GLIBC),0)
+ MYLIB=-lnsl
+ endif
++endif
+ linux:
+       @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
diff --git a/libs/tdb/Makefile b/libs/tdb/Makefile
new file mode 100644 (file)
index 0000000..2fce3dc
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# 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:=tdb
+PKG_VERSION:=1.0.6
+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_INSTALL:=1
+PKG_BUILD_DEPENDS:=+libgdbm
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tdb
+  SUBMENU:=database
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Trivial Database
+  URL:=http://sourceforge.net/projects/tdb/
+  MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
+#  DEPENDS:=+libgdbm
+endef
+
+define Package/tdb/description
+  TDB is a Trivial Database. In concept, it is very much like GDBM,
+  and BSD's DB except that it allows multiple simultaneous writers
+  and uses locking internally to keep writers from trampling on
+  each other. TDB is also extremely small.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/tdb.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+define Package/tdb/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,tdb))
+
diff --git a/libs/tdb/patches/001-printf-fix.patch b/libs/tdb/patches/001-printf-fix.patch
new file mode 100644 (file)
index 0000000..f88d942
--- /dev/null
@@ -0,0 +1,41 @@
+--- 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)
diff --git a/libs/tinycdb/Makefile b/libs/tinycdb/Makefile
new file mode 100644 (file)
index 0000000..5288dea
--- /dev/null
@@ -0,0 +1,39 @@
+# 
+# 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:=tinycdb
+PKG_RELEASE:=1
+PKG_SOURCE_URL:=http://www.corpit.ru/mjt/tinycdb/
+PKG_VERSION:=0.78
+PKG_MD5SUM:=976266afc3f6e7e17492a8d18f21f8f6
+PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
+PKG_LICENSE:=NLPL
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tinycdb
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=a Constant DataBase
+  URL:=http://www.corpit.ru/mjt/tinycdb.html
+endef
+
+define Package/tinycdb/description
+ TinyCDB is a very fast and simple package for creating and reading constant data bases
+endef
+
+define Build/InstallDev
+        cd $(PKG_BUILD_DIR); $(MAKE) DESTDIR=$(1) prefix=/usr install
+endef
+
+
+
+$(eval $(call BuildPackage,tinycdb))
diff --git a/libs/tinycdb/patches/100-Makefile.patch b/libs/tinycdb/patches/100-Makefile.patch
new file mode 100644 (file)
index 0000000..830d712
--- /dev/null
@@ -0,0 +1,25 @@
+diff -Naur tinycdb-0.78/Makefile tinycdb-0.78.patched/Makefile
+--- tinycdb-0.78/Makefile      2012-05-11 18:17:47.000000000 +0400
++++ tinycdb-0.78.patched/Makefile      2014-09-29 00:10:00.610836323 +0400
+@@ -86,17 +86,17 @@
+ $(SHAREDLIB): $(LIB_OBJS_PIC) $(LIBMAP)
+       -rm -f $(SOLIB)
+       ln -s $@ $(SOLIB)
+-      $(LD) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ \
++      $(CC) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ \
+        $(LDFLAGS_SONAME)$(SHAREDLIB) $(LDFLAGS_VSCRIPT)$(LIBMAP) \
+        $(LIB_OBJS_PIC)
+ cdb: cdb.o $(CDB_USELIB)
+-      $(LD) $(LDFLAGS) -o $@ cdb.o $(CDB_USELIB)
++      $(CC) $(LDFLAGS) -o $@ cdb.o $(CDB_USELIB)
+ cdb-shared: cdb.o $(SHAREDLIB)
+-      $(LD) $(LDFLAGS) -o $@ cdb.o $(SHAREDLIB)
++      $(CC) $(LDFLAGS) -o $@ cdb.o $(SHAREDLIB)
+ $(NSS_CDB): $(NSS_OBJS) $(NSS_USELIB) $(NSSMAP)
+-      $(LD) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ \
++      $(CC) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ \
+        $(LDFLAGS_SONAME)$@ $(LDFLAGS_VSCRIPT)$(NSSMAP) \
+        $(NSS_OBJS) $(NSS_USELIB)
diff --git a/libs/unixodbc/Makefile b/libs/unixodbc/Makefile
new file mode 100644 (file)
index 0000000..d962371
--- /dev/null
@@ -0,0 +1,117 @@
+#
+# 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:=unixodbc
+PKG_VERSION:=2.3.4
+PKG_RELEASE:=2
+
+PKG_SOURCE_URL:=ftp://ftp.unixodbc.org/pub/unixODBC/
+PKG_SOURCE:=unixODBC-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=bd25d261ca1808c947cb687e2034be81
+PKG_BUILD_DIR:=$(BUILD_DIR)/unixODBC-$(PKG_VERSION)
+PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
+PKG_LICENSE:=prog GPL libs LGPL
+
+include $(INCLUDE_DIR)/package.mk
+CONFIGURE_ARGS += \
+       --disable-gui \
+       --with-pic \
+       --enable-drivers
+
+define Package/unixodbc/Default
+  SUBMENU:=database
+  TITLE:=unixODBC
+  URL:=http://www.unixodbc.org/
+endef
+
+define Package/unixodbc
+  $(call Package/unixodbc/Default)
+  TITLE+= (libraries)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libltdl +libpthread
+endef
+
+define Package/unixodbc/description
+  unixODBC is an Open Source ODBC sub-system and an ODBC SDK for Linux,
+  Mac OSX, and UNIX.
+endef
+
+define Package/unixodbc-tools
+  $(call Package/unixodbc/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE+= Tools
+  DEPENDS:=+unixodbc +libncurses +libreadline
+endef
+
+define Package/unixodbc-tools/description
+  Command Line Tools to help install a driver and work with SQL.
+endef
+
+define Package/pgsqlodbc
+  $(call Package/unixodbc/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Postgresql driver for ODBC
+  DEPENDS:=+unixodbc +libpq
+endef
+
+define Package/pgsqlodbc/description
+       Postgresql driver for ODBC.
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               $(MAKE_FLAGS) \
+               ARCH="$(ARCH)" \
+               CC="$(TARGET_CC)"
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               $(MAKE_FLAGS) \
+               ARCH="$(ARCH)" \
+               install -i
+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/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/etc
+       $(CP) $(PKG_INSTALL_DIR)/etc/odbc* $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/ODBCDataSources
+       $(TARGET_CC) $(TARGET_CFLAGS) -E ./files/unixodbc_conf.h | tr '@' '\#' >$(1)/usr/include/unixodbc_conf.h
+endef
+
+define Package/unixodbc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(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/
+endef
+
+define Package/unixodbc-tools/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+define Package/pgsqlodbc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libodbcpsql*so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,unixodbc))
+$(eval $(call BuildPackage,unixodbc-tools))
+$(eval $(call BuildPackage,pgsqlodbc))
diff --git a/libs/unixodbc/files/unixodbc_conf.h b/libs/unixodbc/files/unixodbc_conf.h
new file mode 100644 (file)
index 0000000..f149d02
--- /dev/null
@@ -0,0 +1,22 @@
+@ifndef HAVE_UNISTD_H 
+ @define HAVE_UNISTD_H
+@endif
+@ifndef HAVE_PWD_H 
+ @define HAVE_PWD_H
+@endif
+@ifndef HAVE_SYS_TYPES_H 
+ @define HAVE_SYS_TYPES_H
+@endif
+@ifndef HAVE_LONG_LONG 
+ @define HAVE_LONG_LONG
+@endif
+@ifndef ODBCINT64
+ @define ODBCINT64 long
+@endif
+@ifndef UODBCINT64
+ @define UODBCINT64 unsigned long
+@endif
+@ifndef SIZEOF_LONG_INT
+ @define SIZEOF_LONG_INT __SIZEOF_LONG__
+@endif
\ No newline at end of file
diff --git a/libs/vips/Makefile b/libs/vips/Makefile
new file mode 100644 (file)
index 0000000..501f987
--- /dev/null
@@ -0,0 +1,82 @@
+#
+# Copyright (C) 2010-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:=vips
+PKG_VERSION:=7.42.1
+PKG_RELEASE:=1
+
+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_FIXUP:=autoreconf
+PKG_CHECK_FORMAT_SECURITY:=0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+PKG_INSTALL=1
+
+define Package/vips
+  $(call Package/vips/Default)
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  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)
+endef
+
+TARGET_LDFLAGS+= \
+       -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
+CONFIGURE_ARGS += \
+       --disable-cxx \
+       --disable-threads \
+       --without-cfitsio \
+       --without-fftw \
+       --without-lcms \
+       --without-magick \
+       --without-matio \
+       --without-OpenEXR \
+       --without-orc \
+       --without-pangoft2 \
+       --without-python \
+       --without-tiff \
+       --without-v4l \
+       --without-x \
+       --without-zip \
+       --with-jpeg \
+       --with-libexif \
+       --with-png \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/vips
+       $(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/
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/vips/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+               $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,vips))
diff --git a/libs/vips/patches/001-no_cpp.patch b/libs/vips/patches/001-no_cpp.patch
new file mode 100644 (file)
index 0000000..72e841c
--- /dev/null
@@ -0,0 +1,154 @@
+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/xmlrpc-c/Makefile b/libs/xmlrpc-c/Makefile
new file mode 100644 (file)
index 0000000..998219a
--- /dev/null
@@ -0,0 +1,226 @@
+#
+# 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:=xmlrpc-c
+PKG_REV:=2640
+PKG_VERSION:=1.39.0
+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_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+PKG_LICENSE:=VARIOUS
+PKG_LICENSE_FILES:=doc/COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=0
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/xmlrpc-c/Default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=XML-RPC library
+  URL:=http://xmlrpc-c.sourceforge.net/
+endef
+
+define Package/xmlrpc-c-common
+  $(call Package/xmlrpc-c/Default)
+  TITLE+= - common
+  DEPENDS+= +libpthread
+  HIDDEN:=1
+endef
+
+define Package/xmlrpc-c-internal
+  $(call Package/xmlrpc-c/Default)
+  TITLE+= (uses internal expat variant)
+  DEPENDS:=+xmlrpc-c-common
+#  PROVIDES:=xmlrpc-c
+  VARIANT:=internal
+  HIDDEN:=1
+endef
+
+define Package/xmlrpc-c
+  $(call Package/xmlrpc-c/Default)
+  TITLE+= (uses internal expat variant)
+  DEPENDS:=+xmlrpc-c-internal
+endef
+
+define Package/xmlrpc-c-libxml2
+  $(call Package/xmlrpc-c/Default)
+  TITLE+= (uses libxml2)
+  DEPENDS:=+xmlrpc-c-common +libxml2 @BROKEN
+#  PROVIDES:=xmlrpc-c
+  VARIANT:=libxml2
+endef
+
+define Package/xmlrpc-c-client
+  $(call Package/xmlrpc-c/Default)
+  TITLE+= - client
+  DEPENDS:=+xmlrpc-c +libcurl
+endef
+
+define Package/xmlrpc-c-server
+  $(call Package/xmlrpc-c/Default)
+  TITLE+= - server
+  DEPENDS:=+xmlrpc-c
+endef
+
+define Package/xmlrpc-c-abyss
+  $(call Package/xmlrpc-c/Default)
+  TITLE+= - abyss
+  DEPENDS:=+xmlrpc-c-common @BROKEN
+endef
+
+define Package/xmlrpc-c-server-abyss
+  $(call Package/xmlrpc-c/Default)
+  TITLE+= - abyss server
+  DEPENDS:=+xmlrpc-c-server +xmlrpc-c-abyss
+endef
+
+define Package/xmlrpc-c/description/Default
+    Programming library for writing an XML-RPC server or client in C or C++.
+    XML-RPC is a standard network protocol to allow a client program to make
+    a simple remote procedure call (RPC) type request of a server.
+endef
+
+Package/xmlrpc-c-common/description = $(Package/xmlrpc-c/description/Default)
+Package/xmlrpc-c-libxml2/description = $(Package/xmlrpc-c/description/Default)
+Package/xmlrpc-c-internal/description = $(Package/xmlrpc-c/description/Default)
+
+Package/xmlrpc-c-libxml2/description += Uses external libxml2 library (quite big)
+Package/xmlrpc-c-internal/description += Uses internal expat variant (stripped down)
+
+CONFIGURE_ARGS+= \
+       --disable-wininet-client \
+       --disable-libwww-client \
+       --disable-abyss-server \
+       --disable-cplusplus \
+       --disable-abyss-threads \
+       --disable-cgi-server
+
+ifeq ($(BUILD_VARIANT),libxml2)
+       CONFIGURE_ARGS += \
+               --enable-libxml2-backend
+endif
+
+ifeq ($(BUILD_VARIANT),internal)
+       CONFIGURE_ARGS += \
+               --disable-libxml2-backend
+endif
+
+define Build/Compile
+       ( cd $(PKG_BUILD_DIR)/lib/expat/gennmtab && cc -I$(PKG_BUILD_DIR) -c gennmtab.c -o gennmtab.o && cc -o gennmtab  gennmtab.o )
+       $(call Build/Compile/Default)
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) \
+               $(1)/usr/include \
+               $(1)/usr/lib \
+               $(1)/usr/bin \
+               $(2)/bin
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/* \
+               $(1)/usr/include/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc*.{a,so*} \
+               $(1)/usr/lib/
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/bin/xmlrpc-c-config \
+               $(2)/bin/
+       $(SED) \
+               's,HEADERINST_DIR="/usr/include",HEADERINST_DIR="$(STAGING_DIR)/usr/include",g' \
+               $(2)/bin/xmlrpc-c-config
+       $(SED) \
+               's,LIBINST_DIR="/usr/lib",LIBINST_DIR="$(STAGING_DIR)/usr/lib",g' \
+               $(2)/bin/xmlrpc-c-config
+endef
+
+define Package/xmlrpc-c-libxml2/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc.so* \
+               $(1)/usr/lib/
+endef
+
+define Package/xmlrpc-c-internal/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc.so* \
+               $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_xmltok.so* \
+               $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_xmlparse.so* \
+               $(1)/usr/lib/
+endef
+
+define Package/xmlrpc-c-server/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_server.so* \
+               $(1)/usr/lib/
+endef
+
+define Package/xmlrpc-c-abyss/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_abyss.so* \
+               $(1)/usr/lib/
+endef
+
+define Package/xmlrpc-c-server-abyss/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_server_abyss.so* \
+               $(1)/usr/lib/
+endef
+
+define Package/xmlrpc-c-client/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_client* \
+               $(1)/usr/lib/
+endef
+
+define Package/xmlrpc-c-common/install
+       $(INSTALL_DIR) \
+               $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libxmlrpc_util.so* \
+               $(1)/usr/lib/
+endef
+
+define Package/xmlrpc-c/install
+       true
+endef
+
+$(eval $(call BuildPackage,xmlrpc-c))
+$(eval $(call BuildPackage,xmlrpc-c-common))
+#$(eval $(call BuildPackage,xmlrpc-c-libxml2))
+$(eval $(call BuildPackage,xmlrpc-c-internal))
+$(eval $(call BuildPackage,xmlrpc-c-server))
+#$(eval $(call BuildPackage,xmlrpc-c-abyss))
+#$(eval $(call BuildPackage,xmlrpc-c-server-abyss))
+$(eval $(call BuildPackage,xmlrpc-c-client))
diff --git a/libs/xmlrpc-c/patches/001-config.mk.in.patch b/libs/xmlrpc-c/patches/001-config.mk.in.patch
new file mode 100644 (file)
index 0000000..e190ebb
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/config.mk.in
++++ b/config.mk.in
+@@ -175,7 +175,7 @@ ifeq ($(patsubst linux-gnu%,linux-gnu,$(
+   shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
+   shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
+ #  SHLIB_CLIB = -lc
+-  LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
++  LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB) $(LDFLAGS)
+   CFLAGS_SHLIB=-fPIC
+ endif
diff --git a/libs/xmlrpc-c/patches/002-automake-compat.patch b/libs/xmlrpc-c/patches/002-automake-compat.patch
new file mode 100644 (file)
index 0000000..be69611
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/configure.in
++++ b/configure.in
+@@ -224,9 +224,7 @@ dnl Checks for programs.
+ dnl =======================================================================
+ AC_PROG_CC
+-if test x"$enable_cplusplus" != xno; then
+-    AC_PROG_CXX
+-fi
++AC_PROG_CXX
+ dnl =======================================================================
diff --git a/libs/xr_usb_serial_common/Makefile b/libs/xr_usb_serial_common/Makefile
new file mode 100644 (file)
index 0000000..a2091df
--- /dev/null
@@ -0,0 +1,41 @@
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=usb-serial-xr_usb_serial_common
+PKG_VERSION:=1a
+PKG_RELEASE=1
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=
+
+PKG_SOURCE_URL:=https://github.com/kasbert/epsolar-tracer
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=8c21f4afdfd6acd77b6adad59a4dabe5cbf2b947
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define KernelPackage/usb-serial-xr_usb_serial_common
+       SECTION:=kernel
+       CATEGORY:=Kernel modules
+       SUBMENU:=USB Support
+       TITLE:=Support for Exar USB to RS-485/RS-422
+       URL:=https://www.exar.com/content/document.ashx?id=21651
+       FILES:=$(PKG_BUILD_DIR)/xr_usb_serial_common-1a/xr_usb_serial_common.$(LINUX_KMOD_SUFFIX)
+       AUTOLOAD:=$(call AutoProbe,xr_usb_serial_common)
+       DEPENDS+=kmod-usb-serial
+endef
+
+define Build/Compile
+       +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
+               ARCH="$(LINUX_KARCH)" \
+               CROSS_COMPILE="$(TARGET_CROSS)" \
+               SUBDIRS="$(PKG_BUILD_DIR)/xr_usb_serial_common-1a" \
+               modules
+endef
+
+$(eval $(call KernelPackage,usb-serial-xr_usb_serial_common))
diff --git a/libs/yajl/Makefile b/libs/yajl/Makefile
new file mode 100644 (file)
index 0000000..f9a2877
--- /dev/null
@@ -0,0 +1,59 @@
+# 
+# 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:=yajl
+PKG_VERSION:=2.1.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Charles Southerland <charlie@stuphlabs.com>
+PKG_LICENSE:=ISC
+PKG_LICENSE_FILES:=COPYING
+PKG_REV:=66cb08ca2ad8581080b626a75dfca266a890afb2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_SOURCE_URL:=git://github.com/lloyd/yajl.git
+PKG_SOURCE_PROTO:=git
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/yajl
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Yet Another JSON Library
+  URL:=http://lloyd.github.io/yajl
+endef
+
+define Package/yajl/description
+  Yet Another JSON Library. YAJL is a small event-driven (SAX-style)
+JSON parser written in ANSI C, and a small validating JSON generator.
+YAJL is released under the ISC license.
+
+  YAJL was created by Lloyd Hilaiel.
+endef
+
+PKG_INSTALL:=1
+
+CMAKE_OPTIONS += \
+       -DCMAKE_BUILD_TYPE:String="Release" 
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/yajl $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyajl.so* $(1)/usr/lib/
+endef
+
+define Package/yajl/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyajl.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,yajl))
diff --git a/libs/yajl/patches/100-link-reformatter-uclibc-libm.patch b/libs/yajl/patches/100-link-reformatter-uclibc-libm.patch
new file mode 100644 (file)
index 0000000..fd637ec
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/reformatter/CMakeLists.txt
++++ b/reformatter/CMakeLists.txt
+@@ -26,7 +26,7 @@
+ ADD_EXECUTABLE(json_reformat ${SRCS})
+-TARGET_LINK_LIBRARIES(json_reformat yajl_s)
++TARGET_LINK_LIBRARIES(json_reformat yajl_s m)
+ # copy the binary into the output directory
+ GET_TARGET_PROPERTY(binPath json_reformat LOCATION)
diff --git a/libs/yajl/patches/101-link-perf-uclibc-libm.patch b/libs/yajl/patches/101-link-perf-uclibc-libm.patch
new file mode 100644 (file)
index 0000000..0d6fd47
--- /dev/null
@@ -0,0 +1,8 @@
+--- a/perf/CMakeLists.txt
++++ b/perf/CMakeLists.txt
+@@ -20,4 +20,4 @@
+ ADD_EXECUTABLE(perftest ${SRCS})
+-TARGET_LINK_LIBRARIES(perftest yajl_s)
++TARGET_LINK_LIBRARIES(perftest yajl_s m)
diff --git a/libs/yaml/Makefile b/libs/yaml/Makefile
new file mode 100644 (file)
index 0000000..c2b818a
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# 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:=yaml
+PKG_VERSION:=0.1.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pyyaml.org/download/libyaml/
+PKG_MD5SUM:=5fe00cda18ca5daeb43762b80c38e06e
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libyaml
+  SUBMENU:=Languages
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Fast YAML 1.1 parser and emitter library
+  URL:=http://pyyaml.org/wiki/LibYAML
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/yaml.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyaml*.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/yaml*.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libyaml/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyaml*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libyaml))
diff --git a/libs/zmq/Makefile b/libs/zmq/Makefile
new file mode 100644 (file)
index 0000000..5ad5384
--- /dev/null
@@ -0,0 +1,93 @@
+# 
+# Copyright (C) 2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# This Makefile for ZeroMQ
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=zeromq
+PKG_VERSION:=4.1.4
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
+PKG_LICENSE:=GPL-3.0+
+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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=libuuid
+
+PKG_FIXUP:=autoreconf
+
+PKG_INSTALL:=1
+
+
+include $(INCLUDE_DIR)/uclibc++.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libzmq/default
+  TITLE:=ZeroMQ - Message Queue engine
+  URL:=http://www.zeromq.org/
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libuuid +libpthread +librt $(CXX_DEPENDS)
+  PROVIDES:=libzmq
+endef
+
+define Package/libzmq-nc
+  $(call Package/libzmq/default)
+  VARIANT:=nc
+endef
+
+define Package/libzmq-curve
+  $(call Package/libzmq/default)
+  VARIANT:=curve
+  TITLE+= (CurveZMQ)
+  DEPENDS+=+libsodium 
+endef
+
+define Package/libzmq-nc/description
+ This package contains the ZeroMQ messaging engine shared library.
+endef
+
+define Package/libzmq-curve/description
+ $(call Package/libzmq-nc/description)
+ Includes CurveZMQ security by libsodium.
+endef
+
+# add extra configure flags here
+CONFIGURE_ARGS += \
+       --enable-static \
+       --enable-shared
+
+ifeq ($(BUILD_VARIANT),curve)
+  CONFIGURE_ARGS+= --with-libsodium
+else
+  CONFIGURE_ARGS+= --without-libsodium
+endif
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/zmq.h $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/zmq_utils.h $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzmq.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libzmq.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libzmq-nc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzmq.so.* $(1)/usr/lib/
+endef
+
+Package/libzmq-curve/install=$(Package/libzmq-nc/install)
+
+$(eval $(call BuildPackage,libzmq-nc))
+$(eval $(call BuildPackage,libzmq-curve))
diff --git a/libs/zmq/patches/010-disable_pedantic_on_linux_with_ulibc++.patch b/libs/zmq/patches/010-disable_pedantic_on_linux_with_ulibc++.patch
new file mode 100644 (file)
index 0000000..f7ecc48
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -148,8 +148,10 @@ case "${host_os}" in
+     *linux*)
+         # Define on Linux to enable all library features. Define if using a gnu compiler
+         if test "x$GXX" = "xyes"; then
+-            CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
++            CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS -Wno-long-long"
+         fi
++        libzmq_pedantic="no"
++        libzmq_werror="no"
+         AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS])
+         libzmq_on_linux="yes"
diff --git a/libs/zmq/patches/020-map_with_const_string_with_ublic++.patch b/libs/zmq/patches/020-map_with_const_string_with_ublic++.patch
new file mode 100644 (file)
index 0000000..3e13e27
--- /dev/null
@@ -0,0 +1,41 @@
+--- a/src/metadata.hpp
++++ b/src/metadata.hpp
+@@ -41,7 +41,7 @@ namespace zmq
+     {
+         public:
+-            typedef std::map <std::string, const std::string> dict_t;
++            typedef std::map <std::string, std::string> dict_t;
+             metadata_t (const dict_t &dict);
+             virtual ~metadata_t ();
+--- a/src/socket_base.cpp
++++ b/src/socket_base.cpp
+@@ -30,6 +30,7 @@
+ #include <new>
+ #include <string>
+ #include <algorithm>
++#include <ctype.h>
+ #include "platform.hpp"
+--- a/src/stream_engine.cpp
++++ b/src/stream_engine.cpp
+@@ -208,7 +208,7 @@ void zmq::stream_engine_t::plug (io_thre
+             //  Compile metadata.
+             typedef metadata_t::dict_t properties_t;
+             properties_t properties;
+-            properties.insert(std::make_pair("Peer-Address", peer_address));
++            properties.insert(std::make_pair<std::string, std::string>("Peer-Address", peer_address));
+             zmq_assert (metadata == NULL);
+             metadata = new (std::nothrow) metadata_t (properties);
+         }
+@@ -815,7 +815,7 @@ void zmq::stream_engine_t::mechanism_rea
+     //  If we have a peer_address, add it to metadata
+     if (!peer_address.empty()) {
+-        properties.insert(std::make_pair("Peer-Address", peer_address));
++        properties.insert(std::make_pair<std::string, std::string>("Peer-Address", peer_address));
+     }
+     //  Add ZAP properties.
diff --git a/libs/zmq/patches/030-streamoff_missing_with_ulibc++.patch b/libs/zmq/patches/030-streamoff_missing_with_ulibc++.patch
new file mode 100644 (file)
index 0000000..8c137c8
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/blob.hpp
++++ b/src/blob.hpp
+@@ -31,6 +31,7 @@
+ #define __ZMQ_BLOB_HPP_INCLUDED__
+ #include <string>
++#include <ios>
+ #include <string.h>
+ // Borrowed from id3lib_strings.h:
diff --git a/libs/zmq/patches/040-fix_GNUC_conditional_for_GCC5.patch b/libs/zmq/patches/040-fix_GNUC_conditional_for_GCC5.patch
new file mode 100644 (file)
index 0000000..dea9b48
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/blob.hpp
++++ b/src/blob.hpp
+@@ -38,7 +38,7 @@
+ // They seem to be doing something for MSC, but since I only have gcc, I'll just do that
+ // Assuming this is uneccessary on GCC 4
+ // #if (defined(__GNUC__) && (__GNUC__ >= 3) || (defined(_MSC_VER) && _MSC_VER > 1000))
+-#if (defined(__GNUC__) && (__GNUC__ >= 3) && (__GNUC__ <= 4))
++#if (defined(__GNUC__) && (__GNUC__ >= 3))
+ namespace std
+ {
+   template<>
diff --git a/libs/zmq/patches/100-fix-cxx-include-order.patch b/libs/zmq/patches/100-fix-cxx-include-order.patch
new file mode 100644 (file)
index 0000000..120e965
--- /dev/null
@@ -0,0 +1,84 @@
+--- a/src/mtrie.cpp
++++ b/src/mtrie.cpp
+@@ -27,11 +27,11 @@
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+-#include <stdlib.h>
+-
+ #include <new>
+ #include <algorithm>
++#include <stdlib.h>
++
+ #include "platform.hpp"
+ #if defined ZMQ_HAVE_WINDOWS
+ #include "windows.hpp"
+--- a/src/raw_encoder.cpp
++++ b/src/raw_encoder.cpp
+@@ -27,6 +27,11 @@
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
++#include <basic_definitions>
++#include <exception>
++#include <cstddef>
++#include <algorithm>
++
+ #include "encoder.hpp"
+ #include "raw_encoder.hpp"
+ #include "likely.hpp"
+--- a/src/trie.cpp
++++ b/src/trie.cpp
+@@ -27,11 +27,11 @@
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+-#include <stdlib.h>
+-
+ #include <new>
+ #include <algorithm>
++#include <stdlib.h>
++
+ #include "platform.hpp"
+ #if defined ZMQ_HAVE_WINDOWS
+ #include "windows.hpp"
+--- a/src/encoder.hpp
++++ b/src/encoder.hpp
+@@ -39,7 +39,6 @@
+ #include <stddef.h>
+ #include <string.h>
+ #include <stdlib.h>
+-#include <algorithm>
+ #include "err.hpp"
+ #include "msg.hpp"
+--- a/src/v1_encoder.cpp
++++ b/src/v1_encoder.cpp
+@@ -27,6 +27,11 @@
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
++#include <basic_definitions>
++#include <exception>
++#include <cstddef>
++#include <algorithm>
++
+ #include "encoder.hpp"
+ #include "v1_encoder.hpp"
+ #include "likely.hpp"
+--- a/src/v2_encoder.cpp
++++ b/src/v2_encoder.cpp
+@@ -27,6 +27,11 @@
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
++#include <basic_definitions>
++#include <exception>
++#include <cstddef>
++#include <algorithm>
++
+ #include "v2_protocol.hpp"
+ #include "v2_encoder.hpp"
+ #include "likely.hpp"
diff --git a/mail/bogofilter/Makefile b/mail/bogofilter/Makefile
new file mode 100644 (file)
index 0000000..a335559
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# 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:=bogofilter
+PKG_VERSION:=1.2.4
+PKG_RELEASE:=4
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/bogofilter
+PKG_MD5SUM:=d0a5eebb3274b23ceabe766a6443a1c5
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/bogofilter
+  SECTION:=mail
+  CATEGORY:=Mail
+  DEPENDS:=+libdb47
+  TITLE:=bogofilter
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+  URL:=http://bogofilter.sourceforge.net/
+endef
+
+define Package/bogofilter/description
+       Bogofilter is a fast Bayesian spam filter
+endef
+
+CONFIGURE_ARGS += \
+       --disable-unicode \
+       --with-libdb-prefix=$(STAGING_DIR) \
+       --with-included-gsl
+
+define Package/bogofilter/install
+       $(INSTALL_DIR)  $(1)/etc/ \
+                        $(1)/usr/bin \
+                        $(1)/usr/sbin
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/bogofilter.cf.example $(1)/etc/bogofilter.cf
+       $(INSTALL_BIN) ./files/postfix-bogofilter $(1)/usr/sbin/postfix-bogofilter
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bf_compact $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bf_copy $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bf_tar $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogofilter $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogolexer $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogotune $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogoutil $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,bogofilter))
diff --git a/mail/bogofilter/files/postfix-bogofilter b/mail/bogofilter/files/postfix-bogofilter
new file mode 100755 (executable)
index 0000000..2845309
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+FILTER=/usr/bin/bogofilter
+
+# Attempt to read from bogofilter configuration.
+FILTER_DIR=$(cat /etc/bogofilter.cf | sed 's/#.*//g' | grep ^bogofilter_dir | awk -F = '{ print $2 }')
+
+# WARNING! The -i is crucial, else you may see
+# messages truncated at the first period that is alone on a line
+# (which can happen with several kinds of messages, particularly
+# quoted-printable)
+# -G is ignored before Postfix 2.3 and tells it that the message
+# does not originate on the local system (Gateway submission),
+# so Postfix avoids some of the local expansions that can leave
+# misleading traces in headers, such as local address
+# canonicalizations.
+POSTFIX="/usr/sbin/sendmail -G -i"
+
+# No bogofilter_dir set in /etc/bogofilter.cf; fall back on directory
+# which persists across reboots.
+if [ -z "$FILTER_DIR" ]; then
+       FILTER_DIR=/etc/bogofilter
+       export BOGOFILTER_DIR=$FILTER_DIR
+fi
+
+# Exit codes from <sysexits.h>
+EX_TEMPFAIL=75
+EX_UNAVAILABLE=69
+
+cd $FILTER_DIR || \
+    { echo $FILTER_DIR does not exist; exit $EX_TEMPFAIL; }
+
+# Clean up when done or when aborting.
+trap "rm -f msg.$$ ; exit $EX_TEMPFAIL" 0 1 2 3 15
+
+# bogofilter -e returns: 0 for OK, nonzero for error
+rm -f msg.$$ || exit $EX_TEMPFAIL
+$FILTER -p -e > msg.$$ || exit $EX_TEMPFAIL
+
+exec <msg.$$ || exit $EX_TEMPFAIL
+rm -f msg.$$ # safe, we hold the file descriptor
+exec $POSTFIX "$@"
+exit $EX_TEMPFAIL
diff --git a/multimedia/crtmpserver/Makefile b/multimedia/crtmpserver/Makefile
new file mode 100644 (file)
index 0000000..edd5f76
--- /dev/null
@@ -0,0 +1,98 @@
+# 
+# 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:=crtmpserver
+PKG_REV:=b6fdcdb953d1e99c48a0c37a8c80f2cad2db443b
+PKG_VERSION:=2012-07-18+git-$(PKG_REV)
+PKG_RELEASE:=2
+PKG_BUILD_PARALLEL:=2
+PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
+PKG_LICENSE:=GPL-3.0
+
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://github.com/j0sh/crtmpserver.git
+PKG_SOURCE_SUBDIR:=crtmpserver-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_SOURCE_PROTO:=git
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/crtmpserver
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  DEPENDS:=+libopenssl +libstdcpp +liblua
+  TITLE:=C++ RTMP Server
+  URL:=http://www.rtmpd.com/
+endef
+
+define Package/crtmpserver/description
+C++ RTMP Server it is a high performance streaming server able to
+stream (live or recorded) in the following technologies:
+ * To and from Flash (RTMP,RTMPE, RTMPS, RTMPT, RTMPTE)
+ * To and from embedded devices: iPhone, Android
+ * From surveillance cameras
+ * IP-TV using MPEG-TS and RTSP/RTCP/RTP protocols
+                
+Also, crtmpserver can be used as a high performance rendes-vous
+server. For example, it enables you to do:
+ * Audio/Video conferencing
+ * Online gaming
+ * Online collaboration
+ * Simple/complex chat applications
+endef
+
+define Package/crtmpserver/conffiles
+/etc/crtmpserver.lua
+endef
+
+# XXX: this hack handles the usr/bin vs bin difference of backfire and trunk
+TS_BASE:=$(wildcard $(TOOLCHAIN_DIR)/bin/$(TARGET_CC))
+TS_BASE:=$(dir $(if $(TS_BASE),$(TS_BASE),$(wildcard $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CC))))
+
+define Build/Configure
+       (cd $(PKG_BUILD_DIR)/builders/make; \
+               cp linux.mk linux-openwrt-uclibc.mk; \
+               $(SED) 's,^TOOLCHAIN_BASE[[:space:]]*=.*,TOOLCHAIN_BASE=$(TS_BASE),' \
+                       -e 's,^TOOLCHAIN_PREFIX[[:space:]]*=.*,TOOLCHAIN_PREFIX=$(TARGET_CROSS),' \
+                       -e 's,^CCOMPILER[[:space:]]*=.*,CCOMPILER=$(TARGET_CC),' \
+                       -e 's,^CXXCOMPILER[[:space:]]*=.*,CXXCOMPILER=$(TARGET_CXX),' \
+                       -e 's,^OPTIMIZATIONS[[:space:]]*=.*,OPTIMIZATIONS=-O2,' \
+                       -e 's,^SSL_BASE[[:space:]]*=.*,SSL_BASE=$(STAGING_DIR)/usr,' \
+                       linux-openwrt-uclibc.mk)
+       (cd $(PKG_BUILD_DIR)/sources/common/include/; \
+               echo '#define CRTMPSERVER_VERSION_RELEASE_NUMBER "$(PKG_VERSION)\n"' > version.h; \
+               echo '#define CRTMPSERVER_VERSION_CODE_NAME "Git\n"'                >> version.h)
+endef
+
+define Build/Compile
+       +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/builders/make \
+               PLATFORM=linux-openwrt-uclibc -Wno-error -j6
+endef
+
+define Package/crtmpserver/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/crtmpserver $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib/crtmpserver
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/*.so $(1)/usr/lib/crtmpserver/
+       $(foreach app,flvplayback samplefactory admin stresstest appselector vptests applestreamingclient proxypublish, \
+               $(INSTALL_DIR) $(1)/usr/lib/crtmpserver/$(app); \
+               $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/applications/$(app)/lib$(app).so \
+                       $(1)/usr/lib/crtmpserver/$(app)/; \
+       )
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/builders/make/output/dynamic/crtmpserver.lua $(1)/etc/
+       $(INSTALL_DIR) $(1)/usr/share/crtmpserver/appselector
+       $(INSTALL_DIR) $(1)/usr/share/crtmpserver/media
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/crtmpserver.init $(1)/etc/init.d/crtmpserver
+endef
+
+$(eval $(call BuildPackage,crtmpserver))
+
diff --git a/multimedia/crtmpserver/files/crtmpserver.init b/multimedia/crtmpserver/files/crtmpserver.init
new file mode 100644 (file)
index 0000000..cea3512
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2009-2010 OpenWrt.org
+
+START=99
+STOP=80
+
+SERVICE_USE_PID=1
+
+CRTMPSERVER_BIN="/usr/bin/crtmpserver"
+CRTMPSERVER_CONFIG="/etc/crtmpserver.lua"
+CRTMPSERVER_PID="/var/run/crtmpserver.pid"
+
+start()
+{
+        echo "start $CRTMPSERVER_BIN"
+        start-stop-daemon -S -x "$CRTMPSERVER_BIN" -- --daemon --pid="$CRTMPSERVER_PID" \
+                "$CRTMPSERVER_CONFIG"
+}
+stop() {
+
+        echo "stop $CRTMPSERVER_BIN"
+        start-stop-daemon  -K -x $CRTMPSERVER_BIN -p $CRTMPSERVER_PID
+}
+
+reload()
+{
+        stop
+        start
+}
+
diff --git a/multimedia/crtmpserver/patches/010-link-crypt-for-lua.patch b/multimedia/crtmpserver/patches/010-link-crypt-for-lua.patch
new file mode 100644 (file)
index 0000000..cc49523
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/builders/make/compile.mk
++++ b/builders/make/compile.mk
+@@ -72,7 +72,7 @@ TINYXML_OBJS = $(TINYXML_SRCS:.cpp=.tiny
+ #common
+ COMMON_INCLUDE=$(LUA_INCLUDE) $(TINYXML_INCLUDE) $(SSL_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/common/include
+-COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) -llua -ltinyxml
++COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) -llua -ltinyxml -lcrypt
+ COMMON_SRCS = $(shell find $(PROJECT_BASE_PATH)/sources/common/src -type f -name "*.cpp")
+ COMMON_OBJS = $(COMMON_SRCS:.cpp=.common.o)
diff --git a/multimedia/crtmpserver/patches/020-add-rpath.patch b/multimedia/crtmpserver/patches/020-add-rpath.patch
new file mode 100644 (file)
index 0000000..1ea8320
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/builders/make/linux.mk
++++ b/builders/make/linux.mk
+@@ -31,8 +31,8 @@ OPTIMIZATIONS = -O3
+ COMPILE_FLAGS = $(FPIC) $(OPTIMIZATIONS) $(CFLAGS)
+ #linking flags
+-dynamic_lib_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-soname,$(DYNAMIC_LIB_PREFIX)$(1)$(DYNAMIC_LIB_SUFIX) -Wl,-rpath,"\$$ORIGIN"
+-dynamic_exec_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-rpath,"\$$ORIGIN"
++dynamic_lib_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-soname,$(DYNAMIC_LIB_PREFIX)$(1)$(DYNAMIC_LIB_SUFIX) -Wl,-rpath,/usr/lib/crtmpserver
++dynamic_exec_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-rpath,/usr/lib/crtmpserver
+ #compile switches
+ PLATFORM_DEFINES = \
diff --git a/multimedia/crtmpserver/patches/030-default-config.patch b/multimedia/crtmpserver/patches/030-default-config.patch
new file mode 100644 (file)
index 0000000..2975f00
--- /dev/null
@@ -0,0 +1,51 @@
+--- a/builders/cmake/crtmpserver/crtmpserver.lua
++++ b/builders/cmake/crtmpserver/crtmpserver.lua
+@@ -4,7 +4,7 @@ configuration=
+ {
+       -- if true, the server will run as a daemon.
+       -- NOTE: all console appenders will be ignored if this is a daemon
+-      daemon=false,
++      daemon=true,
+       -- the OS's path separator. Used in composing paths
+       pathSeparator="/",
+@@ -44,7 +44,7 @@ configuration=
+       {
+               -- this is the root directory of all applications
+               -- usually this is relative to the binary execuable
+-              rootDirectory="applications",
++              rootDirectory="/usr/lib/crtmpserver",
+               
+               
+               --this is where the applications array starts
+@@ -68,7 +68,7 @@ configuration=
+                       -- this is the folder from where the current application gets it's content.
+                       -- It is optional. If not specified, it will be defaulted to:
+                       -- <rootDirectory>/<name>/mediaFolder
+-                      -- mediaFolder="/some/directory/where/media/files/are/stored"
++                      mediaFolder="/media",
+                       -- the application will also be known by that names. It is optional
+                       --aliases=
+                       --{
+@@ -89,13 +89,6 @@ configuration=
+                               },
+                               {
+                                       ip="0.0.0.0",
+-                                      port=8081,
+-                                      protocol="inboundRtmps",
+-                                      sslKey="server.key",
+-                                      sslCert="server.crt"
+-                              },
+-                              {
+-                                      ip="0.0.0.0",
+                                       port=8080,
+                                       protocol="inboundRtmpt"
+                 },
+@@ -184,6 +177,7 @@ configuration=
+                       name="samplefactory",
+                       description="asdsadasdsa",
+                       protocol="dynamiclinklibrary",
++                      mediaFolder="/usr/share/ctmpserver/media",
+                       aliases=
+                       {
+                               "httpOutboundTest"
diff --git a/multimedia/crtmpserver/patches/040-use-select.patch b/multimedia/crtmpserver/patches/040-use-select.patch
new file mode 100644 (file)
index 0000000..380208e
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/builders/make/linux.mk
++++ b/builders/make/linux.mk
+@@ -38,7 +38,7 @@ dynamic_exec_flags = $(FPIC) $(OPTIMIZAT
+ PLATFORM_DEFINES = \
+       -DLINUX \
+       -DLITTLE_ENDIAN_BYTE_ALIGNED \
+-      -DNET_EPOLL
++      -DNET_SELECT
+ SSL_BASE=/usr/local
diff --git a/multimedia/crtmpserver/patches/050-add-missing-make-defines.patch b/multimedia/crtmpserver/patches/050-add-missing-make-defines.patch
new file mode 100644 (file)
index 0000000..25694b8
--- /dev/null
@@ -0,0 +1,41 @@
+--- a/builders/make/compile.mk
++++ b/builders/make/compile.mk
+@@ -58,7 +58,7 @@ DEFINES = $(PLATFORM_DEFINES) $(FEATURES
+ #library paths
+ SSL_INCLUDE=-I$(SSL_BASE)/include
+-SSL_LIB=-L$(SSL_BASE)/lib -lssl -lcrypto
++SSL_LIB=-L$(SSL_BASE)/lib -lssl -lcrypto -ldl
+ #lua
+ LUA_INCLUDE=-I$(PROJECT_BASE_PATH)/3rdparty/lua-dev
+@@ -72,25 +72,25 @@ TINYXML_OBJS = $(TINYXML_SRCS:.cpp=.tiny
+ #common
+ COMMON_INCLUDE=$(LUA_INCLUDE) $(TINYXML_INCLUDE) $(SSL_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/common/include
+-COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) -llua -ltinyxml -lcrypt
++COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) $(PROJECT_BASE_PATH)/builders/make/output/dynamic/liblua.so -ltinyxml -lcrypt -ldl
+ COMMON_SRCS = $(shell find $(PROJECT_BASE_PATH)/sources/common/src -type f -name "*.cpp")
+ COMMON_OBJS = $(COMMON_SRCS:.cpp=.common.o)
+ #thelib
+ THELIB_INCLUDE=$(COMMON_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/thelib/include
+-THELIB_LIBS=$(COMMON_LIBS) -L$(OUTPUT_DYNAMIC) -lcommon
++THELIB_LIBS=$(COMMON_LIBS) -L$(OUTPUT_DYNAMIC) -lcommon -ldl
+ THELIB_SRCS = $(shell find $(PROJECT_BASE_PATH)/sources/thelib/src -type f -name "*.cpp")
+ THELIB_OBJS = $(THELIB_SRCS:.cpp=.thelib.o)
+ #tests
+ TESTS_INCLUDE=$(THELIB_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/tests/include
+-TESTS_LIBS=$(THELIB_LIBS) -L$(OUTPUT_DYNAMIC) -lthelib
++TESTS_LIBS=$(THELIB_LIBS) -L$(OUTPUT_DYNAMIC) -lthelib -ldl
+ TESTS_SRCS=$(shell find $(PROJECT_BASE_PATH)/sources/tests/src -type f -name "*.cpp")
+ TESTS_OBJS=$(TESTS_SRCS:.cpp=.tests.o)
+ #crtmpserver
+ CRTMPSERVER_INCLUDE=$(THELIB_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/crtmpserver/include
+-CRTMPSERVER_LIBS=$(THELIB_LIBS) -L$(OUTPUT_DYNAMIC) -lthelib
++CRTMPSERVER_LIBS=$(THELIB_LIBS) -L$(OUTPUT_DYNAMIC) -lthelib -ldl
+ CRTMPSERVER_SRCS=$(shell find $(PROJECT_BASE_PATH)/sources/crtmpserver/src -type f -name "*.cpp")
+ CRTMPSERVER_OBJS_DYNAMIC=$(CRTMPSERVER_SRCS:.cpp=.crtmpserver_dynamic.o)
+ CRTMPSERVER_OBJS_STATIC=$(CRTMPSERVER_SRCS:.cpp=.crtmpserver_static.o)
diff --git a/multimedia/crtmpserver/patches/060-add-missing-includes.patch b/multimedia/crtmpserver/patches/060-add-missing-includes.patch
new file mode 100644 (file)
index 0000000..7b9da39
--- /dev/null
@@ -0,0 +1,26 @@
+--- a/sources/common/include/common.h
++++ b/sources/common/include/common.h
+@@ -20,6 +20,10 @@
+ #ifndef _COMMON_H
+ #define _COMMON_H
++#include <stdio.h>
++#include <unistd.h>
++#include <sys/types.h>
++
+ #include "defines.h"
+ #include "platform/platform.h"
+ #include "utils/utils.h"
+--- a/sources/common/src/utils/logging/fileloglocation.cpp
++++ b/sources/common/src/utils/logging/fileloglocation.cpp
+@@ -18,6 +18,10 @@
+  */
++#include <stdio.h>
++#include <unistd.h>
++#include <sys/types.h>
++
+ #include "utils/logging/fileloglocation.h"
+ #include "utils/lua/luautils.h"
+ #include "utils/misc/file.h"
diff --git a/multimedia/crtmpserver/patches/070-missing-include-gcc-47.patch b/multimedia/crtmpserver/patches/070-missing-include-gcc-47.patch
new file mode 100644 (file)
index 0000000..534046f
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/3rdparty/tinyxml/tinyxml.h
++++ b/3rdparty/tinyxml/tinyxml.h
+@@ -39,6 +39,7 @@ distribution.
+ #include <string>
+ #include <iostream>
+ #include <sstream>
++#include "lstate.h"
+ using namespace std;
+ // Help out windows:
diff --git a/multimedia/crtmpserver/patches/080-disable-apple-streaming.patch b/multimedia/crtmpserver/patches/080-disable-apple-streaming.patch
new file mode 100644 (file)
index 0000000..cde14fe
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/builders/make/apps.mk
++++ b/builders/make/apps.mk
+@@ -110,6 +110,6 @@ vptests: thelib $(VPTESTS_OBJS)
+ %.vptests.o: %.cpp
+       $(CXXCOMPILER) $(COMPILE_FLAGS) $(DEFINES) $(VPTESTS_INCLUDE) -c $< -o $@
+-ALL_APPS_OBJS= $(ADMIN_OBJS) $(APPLESTREAMINGCLIENT_OBJS) $(APPSELECTOR_OBJS) $(FLVPLAYBACK_OBJS) $(PROXYPUBLISH_OBJS) $(SAMPLEFACTORY_OBJS) $(STRESSTEST_OBJS) $(VPTESTS_OBJS)
+-ACTIVE_APPS= -DHAS_APP_ADMIN -DHAS_APP_APPLESTREAMINGCLIENT -DHAS_APP_APPSELECTOR -DHAS_APP_FLVPLAYBACK -DHAS_APP_PROXYPUBLISH -DHAS_APP_SAMPLEFACTORY -DHAS_APP_STRESSTEST -DHAS_APP_VPTESTS
+-applications: thelib admin applestreamingclient appselector flvplayback proxypublish samplefactory stresstest vptests
++ALL_APPS_OBJS= $(ADMIN_OBJS) $(APPSELECTOR_OBJS) $(FLVPLAYBACK_OBJS) $(PROXYPUBLISH_OBJS) $(SAMPLEFACTORY_OBJS) $(STRESSTEST_OBJS) $(VPTESTS_OBJS)
++ACTIVE_APPS= -DHAS_APP_ADMIN -DHAS_APP_APPSELECTOR -DHAS_APP_FLVPLAYBACK -DHAS_APP_PROXYPUBLISH -DHAS_APP_SAMPLEFACTORY -DHAS_APP_STRESSTEST -DHAS_APP_VPTESTS
++applications: thelib admin appselector flvplayback proxypublish samplefactory stresstest vptests
diff --git a/multimedia/crtmpserver/patches/080-musl-uint32_t.patch b/multimedia/crtmpserver/patches/080-musl-uint32_t.patch
new file mode 100644 (file)
index 0000000..51d6712
--- /dev/null
@@ -0,0 +1,91 @@
+--- a/sources/common/include/platform/linux/max.h
++++ b/sources/common/include/platform/linux/max.h
+@@ -21,87 +21,7 @@
+ #ifndef _MAX_H
+ #define _MAX_H
+-#ifdef UINT64_MAX
+-#undef UINT64_MAX
+-#endif
+-
+-#ifdef INT64_MAX
+-#undef INT64_MAX
+-#endif
+-
+-#ifdef UINT32_MAX
+-#undef UINT32_MAX
+-#endif
+-
+-#ifdef INT32_MAX
+-#undef INT32_MAX
+-#endif
+-
+-#ifdef UINT16_MAX
+-#undef UINT16_MAX
+-#endif
+-
+-#ifdef INT16_MAX
+-#undef INT16_MAX
+-#endif
+-
+-#ifdef UINT8_MAX
+-#undef UINT8_MAX
+-#endif
+-
+-#ifdef INT8_MAX
+-#undef INT8_MAX
+-#endif
+-
+-
+-
+-#ifndef UINT64_MAX
+-#define UINT64_MAX ((uint64_t)(0xffffffffffffffffULL))
+-#endif
+-
+-#ifndef INT64_MAX
+-#define INT64_MAX  ((int64_t)(0x7fffffffffffffffLL))
+-#endif
+-
+-#ifndef INT64_MIN
+-#define INT64_MIN  ((int64_t)(0x8000000000000000LL))
+-#endif
+-
+-#ifndef UINT32_MAX
+-#define UINT32_MAX ((uint32_t)(0xffffffffUL))
+-#endif
+-
+-#ifndef INT32_MAX
+-#define INT32_MAX  ((int32_t)(0x7fffffffL))
+-#endif
+-
+-#ifndef INT32_MIN
+-#define INT32_MIN  ((int32_t)(0x80000000L))
+-#endif
+-
+-#ifndef UINT16_MAX
+-#define UINT16_MAX ((uint16_t)(0xffff))
+-#endif
+-
+-#ifndef INT16_MAX
+-#define INT16_MAX  ((int16_t)(0x7fff))
+-#endif
+-
+-#ifndef INT16_MIN
+-#define INT16_MIN  ((int16_t)(0x8000))
+-#endif
+-
+-#ifndef UINT8_MAX
+-#define UINT8_MAX  ((uint8_t)(0xff))
+-#endif
+-
+-#ifndef INT8_MAX
+-#define INT8_MAX   ((int8_t)(0x7f))
+-#endif
+-
+-#ifndef INT8_MIN
+-#define INT8_MIN   ((int8_t)(0x80))
+-#endif
++#include <stdint.h>
+ #endif /* _MAX_H */
+ #endif /* LINUX */
diff --git a/multimedia/fswebcam/Makefile b/multimedia/fswebcam/Makefile
new file mode 100644 (file)
index 0000000..5a5f3b5
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2010-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fswebcam
+PKG_VERSION:=20140113
+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_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=LICENCE
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fswebcam
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  TITLE:=fswebcam
+  URL:=http://www.sanslogic.co.uk/fswebcam/
+  DEPENDS:=+libgd
+endef
+
+define Package/fswebcam/description
+  fswebcam is a neat and simple webcam app. It captures images from a V4L1/V4L2 compatible
+  device or file, averages them to reduce noise and draws a caption using the GD Graphics
+  Library which also handles compressing the image to PNG or JPEG. The resulting image
+  is saved to a file or sent to stdio where it can be piped to something like ncftpput or scp.
+endef
+
+EXTRA_CFLAGS+= $(TARGET_CPPFLAGS)
+EXTRA_LDFLAGS+= $(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
+
+define Package/fswebcam/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/fswebcam $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,fswebcam))
diff --git a/multimedia/gst1-libav/Config.in b/multimedia/gst1-libav/Config.in
new file mode 100644 (file)
index 0000000..b394d7d
--- /dev/null
@@ -0,0 +1,279 @@
+menu "Select GStreamer libav configuration options"
+       depends on PACKAGE_gst1-libav
+
+config GST1_LIBAV_IPV6
+       bool "Enable IPv6"
+       default IPV6
+
+config GST1_LIBAV_PATENTED
+       bool "Include patented codecs and technologies"
+       default BUILD_PATENTED
+
+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_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_mpeg1video
+       select GST1_LIBAV_DECODER_mpeg2video if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_mpeg4 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_mpeg4aac if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_mpegvideo
+       select GST1_LIBAV_DECODER_pcm_s16be
+       select GST1_LIBAV_DECODER_pcm_s16le
+       select GST1_LIBAV_DECODER_vorbis
+       select GST1_LIBAV_DECODER_wmav1 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_wmav2 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_png
+       select GST1_LIBAV_PARSER_aac if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_PARSER_h264 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_PARSER_mpegaudio
+       select GST1_LIBAV_PARSER_mpegvideo
+       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_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
+       bool "JPEG-LS"
+
+config GST1_LIBAV_ENCODER_mpeg1video
+       bool "MPEG-1 Video"
+
+config GST1_LIBAV_ENCODER_mpeg2video
+       bool "MPEG-2 Video"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_ENCODER_mpeg4
+       bool "MPEG-4"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_ENCODER_pcm_s16be
+       bool "PCM signed 16-bit big-endian"
+
+config GST1_LIBAV_ENCODER_pcm_s16le
+       bool "PCM signed 16-bit little-endian"
+
+config GST1_LIBAV_ENCODER_png
+       bool "PNG"
+       select GST1_LIBAV_ENCODER_zlib
+
+config GST1_LIBAV_ENCODER_vorbis
+       bool "Vorbis"
+
+config GST1_LIBAV_ENCODER_zlib
+       bool "Zlib"
+
+comment "Decoders ---"
+
+config GST1_LIBAV_DECODER_aac
+       bool "AAC (Advanced Audio Coding)"
+       depends on GST1_LIBAV_PATENTED
+       select GST1_LIBAV_PARSER_aac
+
+config GST1_LIBAV_DECODER_ac3
+       bool "AC3"
+       depends on GST1_LIBAV_PATENTED
+       select GST1_LIBAV_PARSER_ac3
+
+config GST1_LIBAV_DECODER_atrac3
+       bool "ATRAC3"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_gif
+       bool "GIF"
+
+config GST1_LIBAV_DECODER_h264
+       bool "H.264"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_jpegls
+       bool "JPEG-LS"
+
+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"
+
+config GST1_LIBAV_DECODER_mpeg1video
+       bool "MPEG-1 Video"
+
+config GST1_LIBAV_DECODER_mpeg2video
+       bool "MPEG-2 Video"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_mpeg4
+       bool "MPEG-4"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_mpeg4aac
+       bool "MPEG-4 (AAC)"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_pcm_s16be
+       bool "PCM signed 16-bit big-endian"
+
+config GST1_LIBAV_DECODER_pcm_s16le
+       bool "PCM signed 16-bit little-endian"
+
+config GST1_LIBAV_DECODER_png
+       bool "PNG"
+       select GST1_LIBAV_DECODER_zlib
+
+config GST1_LIBAV_DECODER_vorbis
+       bool "Vorbis"
+
+config GST1_LIBAV_DECODER_wmav1
+       bool "WMAv1"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_wmav2
+       bool "WMAv2"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_zlib
+       bool "Zlib"
+
+comment "Muxers ---"
+
+config GST1_LIBAV_MUXER_ac3
+       bool "AC3"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_MUXER_ffm
+       bool "FFM (ffserver live feed)"
+
+config GST1_LIBAV_MUXER_h264
+       bool "H.264"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_MUXER_mp3
+       bool "MP3 (MPEG Audio Layer 3)"
+
+config GST1_LIBAV_MUXER_mp4
+       bool "MP4"
+
+config GST1_LIBAV_MUXER_mpeg1video
+       bool "MPEG-1 Video"
+
+config GST1_LIBAV_MUXER_mpeg2video
+       bool "MPEG-2 Video"
+
+config GST1_LIBAV_MUXER_mpegts
+       bool "MPEG-2 (TS)"
+
+config GST1_LIBAV_MUXER_ogg
+       bool "Ogg"
+
+config GST1_LIBAV_MUXER_oss
+       bool "OSS (Open Sound System playback)"
+
+config GST1_LIBAV_MUXER_rtp
+       bool "RTP"
+
+comment "Demuxers ---"
+
+config GST1_LIBAV_DEMUXER_ac3
+       bool "AC3"
+
+config GST1_LIBAV_DEMUXER_ffm
+       bool "FFM (ffserver live feed)"
+
+config GST1_LIBAV_DEMUXER_h264
+       bool "H.264"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DEMUXER_mp3
+       bool "MP3 (MPEG Audio Layer 3)"
+
+config GST1_LIBAV_DEMUXER_mpegvideo
+       bool "MPEG Video"
+
+config GST1_LIBAV_DEMUXER_mpegps
+       bool "MPEG-2 (PS)"
+
+config GST1_LIBAV_DEMUXER_mpegts
+       bool "MPEG-2 (TS)"
+
+config GST1_LIBAV_DEMUXER_ogg
+       bool "Ogg"
+
+config GST1_LIBAV_DEMUXER_rm
+       bool "RM"
+       help
+         RealMedia format demuxer
+
+config GST1_LIBAV_DEMUXER_rtsp
+       bool "RTSP"
+       select GST1_LIBAV_DEMUXER_rm
+       select GST1_LIBAV_DEMUXER_sdp
+
+config GST1_LIBAV_DEMUXER_sdp
+       bool "SDP"
+       select GST1_LIBAV_DEMUXER_mpegts
+
+comment "Parsers ---"
+
+config GST1_LIBAV_PARSER_aac
+       bool "AAC (Advanced Audio Coding)"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_PARSER_ac3
+       bool "AC3"
+
+config GST1_LIBAV_PARSER_h264
+       bool "H.264"
+       depends on GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_h264
+
+config GST1_LIBAV_PARSER_mpegaudio
+       bool "MPEG Audio"
+
+config GST1_LIBAV_PARSER_mpegvideo
+       bool "MPEG Video"
+
+config GST1_LIBAV_PARSER_mpeg4video
+       bool "MPEG-4 Video"
+
+comment "Protocols ---"
+
+config GST1_LIBAV_PROTOCOL_file
+       bool "file:"
+
+config GST1_LIBAV_PROTOCOL_http
+       bool "http:"
+
+config GST1_LIBAV_PROTOCOL_pipe
+       bool "pipe:"
+
+config GST1_LIBAV_PROTOCOL_rtp
+       bool "rtp:"
+       select GST1_LIBAV_PROTOCOL_udp
+
+config GST1_LIBAV_PROTOCOL_tcp
+       bool "tcp:"
+
+config GST1_LIBAV_PROTOCOL_udp
+       bool "udp:"
+
+endmenu
+
diff --git a/multimedia/gst1-libav/Makefile b/multimedia/gst1-libav/Makefile
new file mode 100644 (file)
index 0000000..bed00ac
--- /dev/null
@@ -0,0 +1,198 @@
+#
+# 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:=gst1-libav
+PKG_VERSION:=1.8.2
+PKG_RELEASE:=2
+
+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_LICENSE:=GPL-2.0 LGPL-2.0
+PKG_LICENSE_FILES:=COPYING COPYING.LIB
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/gst-libav-$(PKG_VERSION)
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_USE_MIPS16:=0
+
+GST_VERSION:=1.0
+
+LIBAV_ENCODERS:= \
+       ac3 \
+       jpegls \
+       mpeg1video \
+       mpeg2video \
+       mpeg4 \
+       pcm_s16be \
+       pcm_s16le \
+       png \
+       vorbis \
+       zlib \
+
+LIBAV_DECODERS:= \
+       aac \
+       ac3 \
+       atrac3 \
+       gif \
+       h264 \
+       jpegls \
+       mp2 \
+       mp3 \
+       mpeg1video \
+       mpeg2video \
+       mpeg4 \
+       mpegvideo \
+       pcm_s16be \
+       pcm_s16le \
+       png \
+       vorbis \
+       wmav1 \
+       wmav2 \
+       zlib \
+
+LIBAV_MUXERS:= \
+       ac3 \
+       ffm \
+       h264 \
+       mp3 \
+       mp4 \
+       mpeg1video \
+       mpeg2video \
+       mpegts \
+       ogg \
+       oss \
+       rtp \
+
+LIBAV_DEMUXERS:= \
+       ac3 \
+       ffm \
+       h264 \
+       mp3 \
+       mpegps \
+       mpegts \
+       mpegvideo \
+       ogg \
+       rm \
+       rtsp \
+       sdp \
+       v4l2 \
+
+LIBAV_PARSERS:= \
+       aac \
+       ac3 \
+       h264 \
+       mpegaudio \
+       mpegvideo \
+       mpeg4video \
+
+LIBAV_PROTOCOLS:= \
+       file http pipe rtp tcp udp
+
+PKG_CONFIG_DEPENDS:= \
+       $(patsubst %,CONFIG_GST1_LIBAV_ENCODER_%,$(LIBAV_ENCODERS)) \
+       $(patsubst %,CONFIG_GST1_LIBAV_DECODER_%,$(LIBAV_DECODERS)) \
+       $(patsubst %,CONFIG_GST1_LIBAV_MUXER_%,$(LIBAV_DEMUXERS)) \
+       $(patsubst %,CONFIG_GST1_LIBAV_DEMUXER_%,$(LIBAV_DEMUXERS)) \
+       $(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
+
+define Package/gst1-libav
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  TITLE:=GStreamer Libav plugin
+  URL:=http://www.gstreamer.net/modules/gst-libav.html
+  DEPENDS:= +libgstreamer1 +gstreamer1-plugins-base \
+           +gst1-mod-alsa +libgst1audio +libgst1pbutils +libgst1video \
+           +libbz2 +liblzma
+endef
+
+define Package/gst1-libav/description
+  GStreamer with libav bindings using internal Libav
+endef
+
+define Package/gst1-libav/config
+  source "$(SOURCE)/Config.in"
+endef
+
+FILTER_CONFIG= \
+       $(foreach c, $(3), \
+               $(if $(CONFIG_GST1_LIBAV_$(1)_$(c)),--enable-$(2)='$(c)') \
+       )
+
+LIBAV_CONFIGURE_ENCODERS:=$(call FILTER_CONFIG,ENCODER,encoder,$(LIBAV_ENCODERS))
+LIBAV_CONFIGURE_DECODERS:=$(call FILTER_CONFIG,DECODER,decoder,$(LIBAV_DECODERS))
+LIBAV_CONFIGURE_MUXERS:=$(call FILTER_CONFIG,MUXER,muxer,$(LIBAV_MUXERS))
+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))
+
+CONFIGURE_ARGS += \
+       --without-system-libav \
+       --with-libav-extra-configure="--target-os=linux \
+       $(if $(findstring " ",$(CONFIG_CPU_TYPE)),,--cpu=$(CONFIG_CPU_TYPE)) \
+       --disable-bsfs \
+       --disable-programs \
+       --disable-devices \
+       --disable-encoders \
+       $(LIBAV_CONFIGURE_ENCODERS) \
+       --disable-decoders \
+       $(LIBAV_CONFIGURE_DECODERS) \
+       --disable-muxers \
+       $(LIBAV_CONFIGURE_MUXERS) \
+       --disable-demuxers \
+       $(LIBAV_CONFIGURE_DEMUXERS) \
+       --disable-parsers \
+       $(LIBAV_CONFIGURE_PARSERS) \
+       --disable-protocols \
+       $(LIBAV_CONFIGURE_PROTOCOLS) \
+       --disable-asm \
+       --disable-altivec \
+       --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-inline-asm \
+       --disable-yasm"
+
+TARGET_CFLAGS += -D_GNU_SOURCE
+
+TARGET_LDFLAGS += $(FPIC)
+
+define Package/gst1-libav/install
+       $(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION)
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+                ./usr/lib/gstreamer-$(GST_VERSION)/libgstlibav.so* \
+                $(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
+        )
+endef
+
+$(eval $(call BuildPackage,gst1-libav))
diff --git a/multimedia/gst1-plugins-base/Makefile b/multimedia/gst1-plugins-base/Makefile
new file mode 100644 (file)
index 0000000..53686fd
--- /dev/null
@@ -0,0 +1,291 @@
+#
+# Copyright (C) 2008-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-base
+PKG_VERSION:=1.8.2
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
+               Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=LGPLv2 GPLv2
+PKG_LICENSE_FILES:=COPYING.LIB COPYING
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-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_BUILD_DEPENDS:= libgstreamer1
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_PACKAGE_gst1-mod-alsa \
+       CONFIG_PACKAGE_gst1-mod-app \
+       CONFIG_PACKAGE_gst1-mod-audioconvert \
+       CONFIG_PACKAGE_gst1-mod-audiorate \
+       CONFIG_PACKAGE_gst1-mod-audioresample \
+       CONFIG_PACKAGE_gst1-mod-audiotestsrc \
+       CONFIG_PACKAGE_gst1-mod-gio \
+       CONFIG_PACKAGE_gst1-mod-ogg \
+       CONFIG_PACKAGE_gst1-mod-tcp \
+       CONFIG_PACKAGE_gst1-mod-theora \
+       CONFIG_PACKAGE_gst1-mod-videoconvert \
+       CONFIG_PACKAGE_gst1-mod-videotestsrc \
+       CONFIG_PACKAGE_gst1-mod-volume \
+       CONFIG_PACKAGE_gst1-mod-vorbis \
+       CONFIG_PACKAGE_libgst1app \
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+GST_BASE_LIBS:=
+GST_BASE_MODULES:=
+
+define Package/gstreamer1-base/Default
+  CATEGORY:=Multimedia
+  SECTION:=multimedia
+  TITLE:=GStreamer
+  URL:=http://gstreamer.freedesktop.org/
+  DEPENDS:= +libgstreamer1 $(ICONV_DEPENDS)
+endef
+
+define Package/gstreamer1-base/description/Default
+ GStreamer open source multimedia framework
+endef
+
+
+define Package/gst1-plugins-base
+$(call Package/gstreamer1-base/Default)
+  TITLE+= plugins collection (base)
+  DEPENDS+= $(GST_DEPENDS)
+  HIDDEN:=1
+endef
+
+define Package/gts1-plugins-base/description
+$(call Package/gstreamer1-base/description/Default)
+ .
+ This meta package contains only dependencies to the other libraries and
+ plugins from the base plugins collection.
+endef
+
+define Package/gstreamer1-plugins-base
+  $(call Package/gstreamer1-base/Default)
+  TITLE+= plugins collection (base)
+  DEPENDS:=+ALL:gst1-plugins-base +gstreamer1-libs
+endef
+
+define Package/gstreamer1-plugins-base/config
+    menu "Select GStreamer base modules and libraries"
+      depends on PACKAGE_gstreamer1-plugins-base
+
+
+    config gst1-plugins-base-all
+      bool "Include all GStreamer base plugins"
+      select PACKAGE_gst1-plugins-base
+
+    comment "Modules"
+
+   $(foreach mod,$(GST_BASE_MODULES), \
+    config PACKAGE_gst1-mod-$(mod)
+      prompt "GStreamer $(mod) module"
+
+   )
+
+    comment "Libraries"
+
+   $(foreach lib,$(GST_BASE_LIBS), \
+    config PACKAGE_libgst1$(lib)
+      prompt "GStreamer $(lib) library"
+
+   )
+
+  endmenu
+
+endef
+
+GST_COND_SELECT = $(patsubst %,$(if $(CONFIG_PACKAGE_gst1-mod-$(1)),--enable,--disable)-%,$(1))
+
+GST_VERSION:=1.0
+
+CONFIGURE_ARGS += \
+       --disable-debug \
+       --disable-examples \
+       \
+       $(call GST_COND_SELECT,alsa) \
+       $(call GST_COND_SELECT,app) \
+       $(call GST_COND_SELECT,audioconvert) \
+       $(call GST_COND_SELECT,audiorate) \
+       $(call GST_COND_SELECT,audioresample) \
+       $(call GST_COND_SELECT,audiotestsrc) \
+       --disable-cdparanoia \
+       --disable-freetypetest \
+       $(call GST_COND_SELECT,gio) \
+       --disable-libvisual \
+       $(call GST_COND_SELECT,ogg) \
+       --disable-pango \
+       --disable-subparse \
+       $(call GST_COND_SELECT,tcp) \
+       $(call GST_COND_SELECT,theora) \
+       $(call GST_COND_SELECT,videorate) \
+       $(call GST_COND_SELECT,videoscale) \
+       $(call GST_COND_SELECT,videoconvert) \
+       $(call GST_COND_SELECT,videotestsrc) \
+       $(call GST_COND_SELECT,volume) \
+       $(call GST_COND_SELECT,vorbis) \
+       --disable-x \
+       --disable-xshm \
+       --disable-xvideo \
+       \
+       --without-libiconv-prefix \
+       --without-libintl-prefix \
+       --without-x \
+       \
+       --with-audioresample-format=int \
+
+EXTRA_LDFLAGS+= \
+       -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
+       $(if $(ICONV_FULL),-liconv) \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/gstreamer-$(GST_VERSION)
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./usr/include/gstreamer-$(GST_VERSION)/* \
+               $(1)/usr/include/gstreamer-$(GST_VERSION)/ \
+       )
+       $(INSTALL_DIR) $(1)/usr/lib
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./usr/lib/libgst*-$(GST_VERSION).{la,so*} \
+               $(1)/usr/lib/ \
+       )
+       $(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION)
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./usr/lib/gstreamer-$(GST_VERSION)/libgst*.{la,so} \
+               $(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
+       )
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./usr/lib/pkgconfig/gstreamer*-$(GST_VERSION).pc \
+               $(1)/usr/lib/pkgconfig/ \
+       )
+endef
+
+
+define Package/gst1-plugins-base/install
+  true
+endef
+
+define Package/gstreamer1-plugins-base/install
+  true
+endef
+
+# 1: short name
+# 2: description
+# 3: dependencies on other gstreamer libraries (short name)
+# 4: dependencies on other packages
+define GstBuildLibrary
+
+  GST_DEPENDS += +libgst1$(1)
+
+  GST_BASE_LIBS+= $(1)
+
+  define Package/libgst1$(1)
+    $(call Package/gstreamer1-base/Default)
+    TITLE+= $(2) library (base)
+    DEPENDS+= $$(foreach p,$(3),+libgst1$$(p)) $(4)
+    HIDDEN:=1
+  endef
+
+  define Package/libgst1$(1)/description
+   $(call Package/gstreamer1-base/description/Default)
+   .
+   This package contains the GStreamer $(2) library.
+  endef
+
+  define Package/libgst1$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/lib
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./usr/lib/libgst$(1)-$(GST_VERSION).so.* \
+               $$(1)/usr/lib/ \
+       )
+  endef
+
+  $$(eval $$(call BuildPackage,libgst1$(1)))
+endef
+
+$(eval $(call GstBuildLibrary,allocators,allocators,,))
+$(eval $(call GstBuildLibrary,app,app,,))
+$(eval $(call GstBuildLibrary,audio,audio,tag,))
+$(eval $(call GstBuildLibrary,fft,FFT,,))
+$(eval $(call GstBuildLibrary,pbutils,utils,audio tag video,))
+$(eval $(call GstBuildLibrary,riff,RIFF media,audio tag,,))
+$(eval $(call GstBuildLibrary,rtp,RTP,,))
+$(eval $(call GstBuildLibrary,rtsp,RTSP,,))
+$(eval $(call GstBuildLibrary,sdp,SDP,rtp,))
+$(eval $(call GstBuildLibrary,tag,tag support,,))
+$(eval $(call GstBuildLibrary,video,video,,))
+
+# 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_BASE_MODULES+= $(1)
+
+  define Package/gst1-mod-$(1)
+    $(call Package/gstreamer1-base/Default)
+    TITLE+= $(2) plugin (base)
+    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-base/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,alsa,ALSA,audio tag,,+alsa-lib))
+$(eval $(call GstBuildPlugin,app,app,app,,))
+$(eval $(call GstBuildPlugin,audioconvert,audio format conversion,audio,,))
+$(eval $(call GstBuildPlugin,audiorate,audio rate adjusting,audio tag,,))
+$(eval $(call GstBuildPlugin,audioresample,audio resampling,audio tag,,))
+$(eval $(call GstBuildPlugin,audiotestsrc,audio test,audio tag controller,,))
+$(eval $(call GstBuildPlugin,playback,media decoder (v2),pbutils,,))
+$(eval $(call GstBuildPlugin,gio,GIO,,,))
+$(eval $(call GstBuildPlugin,ogg,Ogg,riff tag pbutils video,,+libogg))
+$(eval $(call GstBuildPlugin,opus,OPUS plugin library,pbutils video,,+libopus))
+$(eval $(call GstBuildPlugin,tcp,TCP,net,,))
+$(eval $(call GstBuildPlugin,theora,Theora,tag video,,+libogg +libtheora))
+$(eval $(call GstBuildPlugin,typefindfunctions,'typefind' functions,audio pbutils tag video,,))
+$(eval $(call GstBuildPlugin,videoconvert,video format conversion,video,,))
+$(eval $(call GstBuildPlugin,videorate,Adjusts video frames,video,,))
+$(eval $(call GstBuildPlugin,videoscale,Resizes video,video,,))
+$(eval $(call GstBuildPlugin,videotestsrc,video test,video,,+liboil))
+$(eval $(call GstBuildPlugin,volume,volume,audio controller,,+liboil))
+$(eval $(call GstBuildPlugin,vorbis,Vorbis,audio tag,ogg,+libvorbis))
+
+$(eval $(call BuildPackage,gstreamer1-plugins-base))
+$(eval $(call BuildPackage,gst1-plugins-base))
diff --git a/multimedia/gst1-plugins-base/patches/001-no-translations.patch b/multimedia/gst1-plugins-base/patches/001-no-translations.patch
new file mode 100644 (file)
index 0000000..d495606
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -929,7 +929,6 @@ docs/design/Makefile
+ docs/libs/Makefile
+ docs/plugins/Makefile
+ docs/version.entities
+-po/Makefile.in
+ common/Makefile
+ common/m4/Makefile
+ m4/Makefile
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -13,7 +13,6 @@ SUBDIRS =                    \
+       tools                   \
+       tests                   \
+       docs                    \
+-      po                      \
+       common                  \
+       m4
+@@ -24,7 +23,6 @@ DIST_SUBDIRS =                       \
+       gst sys ext             \
+       tools                   \
+       tests                   \
+-      po                      \
+       common                  \
+       m4
diff --git a/multimedia/gst1-plugins-base/patches/002-no-tests.patch b/multimedia/gst1-plugins-base/patches/002-no-tests.patch
new file mode 100644 (file)
index 0000000..f177d18
--- /dev/null
@@ -0,0 +1,44 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -907,23 +907,6 @@ pkgconfig/gstreamer-video.pc
+ pkgconfig/gstreamer-video-uninstalled.pc
+ pkgconfig/gstreamer-plugins-base.pc
+ pkgconfig/gstreamer-plugins-base-uninstalled.pc
+-tests/Makefile
+-tests/check/Makefile
+-tests/examples/Makefile
+-tests/examples/app/Makefile
+-tests/examples/audio/Makefile
+-tests/examples/dynamic/Makefile
+-tests/examples/encoding/Makefile
+-tests/examples/fft/Makefile
+-tests/examples/gio/Makefile
+-tests/examples/overlay/Makefile
+-tests/examples/seek/Makefile
+-tests/examples/snapshot/Makefile
+-tests/examples/playback/Makefile
+-tests/examples/playrec/Makefile
+-tests/files/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 =                    \
+       gst-libs                \
+       gst sys $(SUBDIRS_EXT)  \
+       tools                   \
+-      tests                   \
+       docs                    \
+       common                  \
+       m4
+@@ -22,7 +21,6 @@ DIST_SUBDIRS =                       \
+       gst-libs                \
+       gst sys ext             \
+       tools                   \
+-      tests                   \
+       common                  \
+       m4
diff --git a/multimedia/gst1-plugins-base/patches/003-no-docs.patch b/multimedia/gst1-plugins-base/patches/003-no-docs.patch
new file mode 100644 (file)
index 0000000..a12c7e7
--- /dev/null
@@ -0,0 +1,30 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -907,11 +907,6 @@ pkgconfig/gstreamer-video.pc
+ 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 =                  \
+       gst-libs                \
+       gst sys $(SUBDIRS_EXT)  \
+       tools                   \
+-      docs                    \
+       common                  \
+       m4
+ DIST_SUBDIRS =                        \
+       pkgconfig               \
+-      docs                    \
+       gst-libs                \
+       gst sys ext             \
+       tools                   \
diff --git a/multimedia/gstreamer1/Makefile b/multimedia/gstreamer1/Makefile
new file mode 100644 (file)
index 0000000..c75ac0d
--- /dev/null
@@ -0,0 +1,237 @@
+#
+# Copyright (C) 2008-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:=gstreamer1
+PKG_VERSION:=1.8.2
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
+               Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=LGPLv2
+PKG_LICENSE_FILES:=COPYING
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/gstreamer-$(PKG_VERSION)
+PKG_SOURCE:=gstreamer-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gstreamer/
+PKG_MD5SUM:=9dbebe079c2ab2004ef7f2649fa317cabea1feb4fb5605c24d40744b90918341
+
+PKG_FIXUP:=autoreconf
+PKG_REMOVE_FILES:=autogen.sh aclocal.m4
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/gstreamer1/Default
+  CATEGORY:=Multimedia
+  SECTION:=multimedia
+  TITLE:=GStreamer
+  URL:=http://gstreamer.freedesktop.org/
+  DEPENDS:= $(ICONV_DEPENDS) $(INTL_DEPENDS)
+endef
+
+define Package/gstreamer1/description/Default
+ GStreamer open source multimedia framework
+endef
+
+GSTREAMER_CORE_LIBS:= \
+       libgstreamer1 \
+       libgst1check \
+       libgst1controller \
+       libgst1net
+
+define Package/gstreamer1
+  $(call Package/gstreamer1/Default)
+  TITLE+= (All libraries)
+  DEPENDS:= $(foreach lib,$(GSTREAMER_CORE_LIBS),+$(lib))
+  HIDDEN:=1
+endef
+
+define Package/gstreamer1-libs/description
+ $(call Package/gstreamer1/description/Default)
+ .
+ This meta package contains only dependencies on the other GStreamer
+ componenents.
+endef
+
+define Package/gstreamer1-libs
+  $(call Package/gstreamer1/Default)
+  TITLE+= core libraries
+  DEPENDS+=+ALL:gstreamer1
+endef
+
+define Package/gstreamer1-libs/config
+    menu "Select GStreamer libraries"
+      depends on PACKAGE_gstreamer1-libs
+
+    config gstreamer1-all
+      bool "Include all GStreamer1 core libraries"
+      select PACKAGE_gstreamer1
+
+    comment "Libraries"
+
+   $(foreach lib,$(GSTREAMER_CORE_LIBS), \
+    config PACKAGE_$(lib)
+      prompt "GStreamer core library $(lib)"
+
+   )
+
+  endmenu
+
+endef
+
+define Package/gstreamer1-utils
+  $(call Package/gstreamer1/Default)
+  TITLE+= utilities
+  DEPENDS+= +libgstreamer1 +gstreamer1-libs
+endef
+
+define Package/gstreamer1-utils/description
+ $(call Package/gstreamer1/description/Default)
+ .
+ This package contains the GStreamer utilities.
+endef
+
+define Package/libgstreamer1
+  $(call Package/gstreamer1/Default)
+  TITLE+= library (core)
+  DEPENDS+= +glib2 +libpthread +libxml2
+  HIDDEN:=1
+endef
+
+define Package/libgstreamer1/description
+ $(call Package/gstreamer1/description/Default)
+ .
+ This package contains the GStreamer core library.
+endef
+  
+
+GST_VERSION:=1.0
+
+CONFIGURE_ARGS += \
+       --enable-static \
+       --disable-examples \
+       --disable-tests \
+       --disable-valgrind \
+       --without-libiconv-prefix \
+       --without-libintl-prefix \
+       --without-x \
+
+EXTRA_LDFLAGS+= \
+       -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
+       $(if $(ICONV_FULL),-liconv)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/gstreamer-$(GST_VERSION)
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./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*} \
+               $(1)/usr/lib/ \
+       )
+       $(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION)
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./usr/lib/gstreamer-$(GST_VERSION)/libgst*.{la,so} \
+               $(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
+       )
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./usr/lib/pkgconfig/gstreamer*-$(GST_VERSION).pc \
+               $(1)/usr/lib/pkgconfig/ \
+       )
+       $(INSTALL_DIR) $(2)/share/aclocal
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./usr/share/aclocal/* \
+               $(2)/share/aclocal/ \
+       )
+endef
+
+define Package/gstreamer1/install
+  true
+endef
+
+define Package/gstreamer1-libs/install
+  true
+endef
+
+define Package/gstreamer1-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./usr/bin/gst-launch* \
+               ./usr/bin/gst-inspect* \
+               ./usr/bin/gst-typefind* \
+               $(1)/usr/bin/ \
+       )
+endef
+
+define Package/libgstreamer1/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./usr/lib/libgstbase-$(GST_VERSION).so.* \
+               ./usr/lib/libgstreamer-$(GST_VERSION).so.* \
+               $(1)/usr/lib/ \
+       )
+       $(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION)
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./usr/lib/gstreamer-$(GST_VERSION)/libgst*.so \
+               $(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
+       )
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gstreamer-$(GST_VERSION)/gst-plugin-scanner \
+                      $(1)/usr/lib/gstreamer-$(GST_VERSION)
+endef
+
+
+# 1: short name
+# 2: description
+# 3: dependencies on other gstreamer libraries (short name)
+# 4: dependencies on other packages
+define GstBuildLibrary
+
+  define Package/libgst1$(1)
+    $(call Package/gstreamer1/Default)
+    TITLE+= $(2) library (core)
+    DEPENDS+= +libgstreamer1 $$(foreach p,$(3),+libgst1$$(p)) $(4)
+    HIDDEN:=1
+  endef
+
+  define Package/libgst1$(1)/description
+   $(call Package/gstreamer1/description/Default)
+   .
+   This package contains the GStreamer $(2) library.
+  endef
+
+  define Package/libgst1$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/lib
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+               ./usr/lib/libgst$(1)-$(GST_VERSION).so.* \
+               $$(1)/usr/lib/ \
+       )
+  endef
+
+  $$(eval $$(call BuildPackage,libgst1$(1)))
+endef
+
+$(eval $(call GstBuildLibrary,check,check unit testing))
+$(eval $(call GstBuildLibrary,controller,dynamic parameter control))
+$(eval $(call GstBuildLibrary,net,network classes))
+
+$(eval $(call BuildPackage,libgstreamer1))
+$(eval $(call BuildPackage,gstreamer1-libs))
+$(eval $(call BuildPackage,gstreamer1-utils))
+$(eval $(call BuildPackage,gstreamer1))
diff --git a/multimedia/gstreamer1/patches/001-no-translations.patch b/multimedia/gstreamer1/patches/001-no-translations.patch
new file mode 100644 (file)
index 0000000..9c5b590
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -998,7 +998,6 @@ libs/gst/net/Makefile
+ plugins/Makefile
+ plugins/elements/Makefile
+ plugins/tracers/Makefile
+-po/Makefile.in
+ 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
+ SUBDIRS = pkgconfig \
+       gst libs plugins tests \
+       docs \
+-      po \
+       m4 \
+       common \
+       data
+@@ -22,7 +21,6 @@ endif
+ DIST_SUBDIRS = pkgconfig \
+       gst libs plugins tools tests \
+       docs \
+-      po \
+       m4 \
+       common \
+       data
diff --git a/multimedia/gstreamer1/patches/002-no-tests.patch b/multimedia/gstreamer1/patches/002-no-tests.patch
new file mode 100644 (file)
index 0000000..4287410
--- /dev/null
@@ -0,0 +1,44 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -998,21 +998,6 @@ libs/gst/net/Makefile
+ plugins/Makefile
+ plugins/elements/Makefile
+ plugins/tracers/Makefile
+-tests/Makefile
+-tests/benchmarks/Makefile
+-tests/check/Makefile
+-tests/misc/Makefile
+-tests/examples/Makefile
+-tests/examples/adapter/Makefile
+-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
+-tests/examples/streamiddemux/Makefile
+-tests/examples/streams/Makefile
+ tools/Makefile
+ common/Makefile
+ common/m4/Makefile
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -7,7 +7,7 @@ aclocaldir = $(datadir)/aclocal
+ aclocal_DATA = gst-element-check-@GST_API_VERSION@.m4
+ SUBDIRS = pkgconfig \
+-      gst libs plugins tests \
++      gst libs plugins \
+       docs \
+       m4 \
+       common \
+@@ -19,7 +19,7 @@ endif
+ # These are all the possible subdirs
+ DIST_SUBDIRS = pkgconfig \
+-      gst libs plugins tools tests \
++      gst libs plugins tools \
+       docs \
+       m4 \
+       common \
diff --git a/multimedia/gstreamer1/patches/003-no-docs.patch b/multimedia/gstreamer1/patches/003-no-docs.patch
new file mode 100644 (file)
index 0000000..3d1187a
--- /dev/null
@@ -0,0 +1,39 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -1001,18 +1001,6 @@ plugins/tracers/Makefile
+ 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
+ SUBDIRS = pkgconfig \
+       gst libs plugins \
+-      docs \
+       m4 \
+       common \
+       data
+@@ -20,7 +19,6 @@ endif
+ # These are all the possible subdirs
+ DIST_SUBDIRS = pkgconfig \
+       gst libs plugins tools \
+-      docs \
+       m4 \
+       common \
+       data
diff --git a/multimedia/gstreamer1/patches/010-gstplugin-use-lazy-symbol-binding.patch b/multimedia/gstreamer1/patches/010-gstplugin-use-lazy-symbol-binding.patch
new file mode 100644 (file)
index 0000000..8454061
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/gst/gstplugin.c
++++ b/gst/gstplugin.c
+@@ -732,15 +732,8 @@ _priv_gst_plugin_load_file_for_registry
+     goto return_error;
+   }
+-  flags = G_MODULE_BIND_LOCAL;
+-  /* libgstpython.so is the gst-python plugin loader. It needs to be loaded with
+-   * G_MODULE_BIND_LAZY.
+-   *
+-   * Ideally there should be a generic way for plugins to specify that they
+-   * need to be loaded with _LAZY.
+-   * */
+-  if (strstr (filename, "libgstpython"))
+-    flags |= G_MODULE_BIND_LAZY;
++  // No need to resolve all bindings until referenced
++  flags = G_MODULE_BIND_LOCAL | G_MODULE_BIND_LAZY;
+   module = g_module_open (filename, flags);
+   if (module == NULL) {
diff --git a/multimedia/icecast/Makefile b/multimedia/icecast/Makefile
new file mode 100644 (file)
index 0000000..2ef95b7
--- /dev/null
@@ -0,0 +1,80 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=icecast
+PKG_VERSION:=2.4.3
+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>, \
+               Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:= 1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/icecast
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  DEPENDS:=+libcurl +libxml2 +libxslt +libogg +libvorbisidec
+  TITLE:=A streaming media server for Ogg/Vorbis and MP3 audio streams
+  USERID:=icecast=87:icecast=87
+  URL:=http://www.icecast.org/
+endef
+
+define Package/icecast/description
+       Icecast is a streaming media server which currently supports Ogg
+       Vorbis and MP3 audio streams. It can be used to create an Internet
+       radio station or a privately running jukebox and many things in
+       between. It is very versatile in that new formats can be added
+       relatively easily and supports open standards for commuincation and
+       interaction.
+endef
+
+CONFIGURE_ARGS+= \
+       --enable-yp \
+       --with-openssl="no" \
+       --with-curl="yes" \
+       --with-curl-config="$(STAGING_DIR)/usr/bin/curl-config" \
+       --with-ogg="$(STAGING_DIR)/usr" \
+       --with-speex="no" \
+       --with-theora="no" \
+       --with-vorbis="$(STAGING_DIR)/usr" \
+       --with-xslt-config="$(STAGING_DIR)/usr/bin/xslt-config"
+
+
+# Manually edit configure in case both vorbis and tremor host packages are installed
+define Build/Configure
+       $(SED) 's,-lvorbis -lm,-lvorbisidec -logg ,g' $(PKG_BUILD_DIR)/configure
+       $(call Build/Configure/Default)
+endef
+
+define Package/icecast/install
+       $(INSTALL_DIR) $(1)/etc
+       $(CP) $(PKG_INSTALL_DIR)/etc/icecast.xml $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/icecast.init $(1)/etc/init.d/icecast
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/icecast $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/share/icecast
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/icecast/admin $(1)/usr/share/icecast/
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/icecast/web $(1)/usr/share/icecast/
+endef
+
+define Package/icecast/conffiles
+/etc/icecast.xml
+endef
+
+$(eval $(call BuildPackage,icecast))
diff --git a/multimedia/icecast/files/icecast.init b/multimedia/icecast/files/icecast.init
new file mode 100755 (executable)
index 0000000..96b36e1
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh /etc/rc.common
+
+# Startup script
+# Copyright (C) 2015 OpenWrt.org
+USE_PROCD=1
+START=90
+STOP=15
+
+start_service() {
+       user_exists icecast 87 || user_add icecast 87
+       group_exists icecast 87 || group_add icecast 87
+       
+       [ -d /var/log/icecast ] || {
+               mkdir -m 0755 -p /var/log/icecast
+               chown icecast:icecast /var/log/icecast
+       }
+
+       procd_open_instance
+       procd_set_param command /usr/bin/icecast -c /etc/icecast.xml
+       procd_set_param respawn
+       procd_close_instance
+}
diff --git a/multimedia/icecast/patches/001-icecast-2.4.0-tremor.patch b/multimedia/icecast/patches/001-icecast-2.4.0-tremor.patch
new file mode 100644 (file)
index 0000000..49861d2
--- /dev/null
@@ -0,0 +1,156 @@
+--- a/src/format_vorbis.c
++++ b/src/format_vorbis.c
+@@ -19,7 +19,7 @@
+ #include <stdlib.h>
+ #include <ogg/ogg.h>
+-#include <vorbis/codec.h>
++#include <tremor/ivorbiscodec.h>
+ #include <memory.h>
+ #include <string.h>
+@@ -34,6 +34,7 @@
+ #define CATMODULE "format-vorbis"
+ #include "logging.h"
++int vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op);
+ typedef struct vorbis_codec_tag
+ {
+@@ -583,3 +584,91 @@ static refbuf_t *process_vorbis_page (og
+     return NULL;
+ }
++/* Some additional functions from vorbis missing from tremor */
++
++static void _v_writestring(oggpack_buffer *o,char *s, int bytes)
++{
++
++  while(bytes--){
++    oggpack_write(o,*s++,8);
++  }
++}
++
++static int _vorbis_pack_comment(oggpack_buffer *opb,vorbis_comment *vc)
++{
++  char temp[]="Xiph.Org libVorbis I 20150104";
++  int bytes = strlen(temp);
++
++  /* preamble */
++  oggpack_write(opb,0x03,8);
++  _v_writestring(opb,"vorbis", 6);
++
++  /* vendor */
++  oggpack_write(opb,bytes,32);
++  _v_writestring(opb,temp, bytes);
++
++  /* comments */
++
++  oggpack_write(opb,vc->comments,32);
++  if(vc->comments){
++    int i;
++    for(i=0;i<vc->comments;i++){
++      if(vc->user_comments[i]){
++      oggpack_write(opb,vc->comment_lengths[i],32);
++      _v_writestring(opb,vc->user_comments[i], vc->comment_lengths[i]);
++      }else{
++      oggpack_write(opb,0,32);
++      }
++    }
++  }
++  oggpack_write(opb,1,1);
++
++  return(0);
++}
++
++void vorbis_comment_add(vorbis_comment *vc,char *comment)
++{
++  vc->user_comments=_ogg_realloc(vc->user_comments,
++                          (vc->comments+2)*sizeof(*vc->user_comments));
++  vc->comment_lengths=_ogg_realloc(vc->comment_lengths,
++                                  (vc->comments+2)*sizeof(*vc->comment_lengths));
++  vc->comment_lengths[vc->comments]=strlen(comment);
++  vc->user_comments[vc->comments]=_ogg_malloc(vc->comment_lengths[vc->comments]+1);
++  strcpy(vc->user_comments[vc->comments], comment);
++  vc->comments++;
++  vc->user_comments[vc->comments]=NULL;
++}
++
++void vorbis_comment_add_tag(vorbis_comment *vc, char *tag, char *contents)
++{
++  char *comment=alloca(strlen(tag)+strlen(contents)+2); /* +2 for = and \0 */
++  strcpy(comment, tag);
++  strcat(comment, "=");
++  strcat(comment, contents);
++  vorbis_comment_add(vc, comment);
++
++  return;
++}
++
++int vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op)
++{
++  oggpack_buffer opb;
++
++  oggpack_writeinit(&opb);
++  if(_vorbis_pack_comment(&opb,vc)){
++    oggpack_writeclear(&opb);
++    return OV_EIMPL;
++  }
++
++  op->packet = _ogg_malloc(oggpack_bytes(&opb));
++  memcpy(op->packet, opb.buffer, oggpack_bytes(&opb));
++
++  op->bytes=oggpack_bytes(&opb);
++  op->b_o_s=0;
++  op->e_o_s=0;
++  op->granulepos=0;
++  op->packetno=1;
++
++  oggpack_writeclear(&opb);
++  return 0;
++}
+--- a/m4/vorbis.m4
++++ b/m4/vorbis.m4
+@@ -38,9 +38,9 @@ if test "x$vorbis_prefix" != "x$ogg_pref
+             ])
+ fi
+-VORBIS_LIBS="-lvorbis"
+-VORBISFILE_LIBS="-lvorbisfile"
+-VORBISENC_LIBS="-lvorbisenc"
++VORBIS_LIBS="-lvorbisidec"
++VORBISFILE_LIBS="-lvorbisidec"
++VORBISENC_LIBS="-lvorbisidec"
+ xt_save_LIBS="$LIBS"
+ xt_save_LDFLAGS="$LDFLAGS"
+@@ -58,18 +58,6 @@ AC_TRY_LINK_FUNC(ogg_stream_init, [xt_li
+             )
+         ])
+-if test "x$xt_lib_vorbis" = "xok"; then
+-#
+-# Now check if the installed Vorbis is sufficiently new.
+-#
+-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+-#include <vorbis/codec.h>
+-#include <vorbis/vorbisenc.h>
+-        ], [
+-struct ovectl_ratemanage_arg a;
+-])],,[xt_lib_vorbis="old version found"])
+-AC_MSG_RESULT([$xt_lib_vorbis])
+-fi
+ CPPFLAGS="$xt_save_CPPFLAGS"
+ LIBS="$xt_save_LIBS"
+ LDFLAGS="$xt_save_LDFLAGS"
+--- a/m4/ogg.m4
++++ b/m4/ogg.m4
+@@ -29,7 +29,7 @@ XIPH_GCC_WARNING([-I$ogg_prefix/include]
+       ])
+ AC_CACHE_CHECK([for libogg], xt_cv_lib_ogg,
+ [dnl
+-OGG_LIBS="-logg"
++OGG_LIBS="-lvorbisidec"
+ #
+ # check if the installed Ogg is sufficiently new.
diff --git a/multimedia/icecast/patches/005-no_examples_doc_win32.patch b/multimedia/icecast/patches/005-no_examples_doc_win32.patch
new file mode 100644 (file)
index 0000000..178df54
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -3,7 +3,7 @@
+ AUTOMAKE_OPTIONS = foreign dist-zip
+ ACLOCAL_AMFLAGS = -I m4
+-SUBDIRS = src conf doc web admin win32 examples
++SUBDIRS = src conf web admin
+ EXTRA_DIST = HACKING m4/acx_pthread.m4 m4/ogg.m4 \
+     m4/theora.m4 m4/vorbis.m4 m4/speex.m4 \
+@@ -11,7 +11,7 @@ EXTRA_DIST = HACKING m4/acx_pthread.m4 m
+     m4/xiph_types.m4 m4/xiph_xml2.m4
+ docdir = $(datadir)/doc/$(PACKAGE)
+-doc_DATA = README AUTHORS COPYING NEWS TODO ChangeLog
++doc_DATA = README AUTHORS COPYING
+ debug:
+       $(MAKE) all CFLAGS="@DEBUG@"
diff --git a/multimedia/icecast/patches/010-fix_libcurl_test_crap.patch b/multimedia/icecast/patches/010-fix_libcurl_test_crap.patch
new file mode 100644 (file)
index 0000000..8da6e33
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/m4/xiph_curl.m4
++++ b/m4/xiph_curl.m4
+@@ -52,7 +52,7 @@ AC_CHECK_HEADERS([curl/curl.h],, curl_ok
+ AC_MSG_CHECKING(for libcurl)
+ if test "$curl_ok" = "yes"
+ then
+-    AC_RUN_IFELSE(AC_LANG_SOURCE([
++    AC_COMPILE_IFELSE(AC_LANG_SOURCE([
+ #include <curl/curl.h>
+ int main()
+ {
diff --git a/multimedia/icecast/patches/015-add_with-openssl_option.patch b/multimedia/icecast/patches/015-add_with-openssl_option.patch
new file mode 100644 (file)
index 0000000..f0a5b70
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/m4/xiph_openssl.m4
++++ b/m4/xiph_openssl.m4
+@@ -30,13 +30,15 @@ else
+ fi
+ # Now try linking to openssl
+-xt_save_CFLAGS="$CFLAGS"
+-xt_save_LIBS="$LIBS"
+-CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
+-LIBS="$OPENSSL_LIBS $LIBS"
+-AC_TRY_LINK([#include <openssl/ssl.h>], [void *a = SSL_new], [openssl_ok='yes'])
+-CFLAGS="$xt_save_CFLAGS"
+-LIBS="$xt_save_LIBS"
++if test "x$openssl_prefix" != "xno"; then
++    xt_save_CFLAGS="$CFLAGS"
++    xt_save_LIBS="$LIBS"
++    CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
++    LIBS="$OPENSSL_LIBS $LIBS"
++    AC_TRY_LINK([#include <openssl/ssl.h>], [void *a = SSL_new], [openssl_ok='yes'])
++    CFLAGS="$xt_save_CFLAGS"
++    LIBS="$xt_save_LIBS"
++fi
+ if test "$openssl_ok" = "yes"; then
+     AC_DEFINE(HAVE_OPENSSL, 1, [Define if you have libopenssl.])
diff --git a/multimedia/icecast/patches/020-icecast_config_for_openwrt.patch b/multimedia/icecast/patches/020-icecast_config_for_openwrt.patch
new file mode 100644 (file)
index 0000000..d3282f2
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/conf/icecast.xml.in
++++ b/conf/icecast.xml.in
+@@ -61,7 +61,7 @@
+          It affects mainly the urls generated by Icecast for playlists and yp
+          listings. You MUST configure it properly for YP listings to work!
+     -->
+-    <hostname>localhost</hostname>
++    <hostname>OpenWrt</hostname>
+     <!-- You may have multiple <listener> elements -->
+     <listen-socket>
+@@ -234,11 +234,9 @@
+     <security>
+         <chroot>0</chroot>
+-        <!--
+         <changeowner>
+-            <user>nobody</user>
+-            <group>nogroup</group>
++            <user>icecast</user>
++            <group>icecast</group>
+         </changeowner>
+-        -->
+     </security>
+ </icecast>
diff --git a/multimedia/ices/Makefile b/multimedia/ices/Makefile
new file mode 100644 (file)
index 0000000..c0569ab
--- /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:=ices
+PKG_VERSION:=2.0.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://downloads.xiph.org/releases/ices/
+PKG_MD5SUM:=832c448cc993170a70fd95804fcda5b2
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>, \
+               Ted Hess <thess@kitschensync.net>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ices
+  SECTION:=sound
+  CATEGORY:=Sound
+  TITLE:=ices client for Icecast media streaming servers
+  URL:=http://www.icecast.org/ices/
+  DEPENDS:=+libshout +libxml2 +zlib +libogg +libvorbis +alsa-lib
+endef
+
+define Package/ices/description
+  ices is a command line source client for Icecast media streaming servers.
+  It began as the successor of the old "shout" utility, and has since gained a
+  lot of useful features.
+endef
+
+CONFIGURE_ARGS+= \
+       --with-ogg="$(STAGING_DIR)/usr/include" \
+       --with-vorbis="$(STAGING_DIR)/usr/include"
+
+TARGET_LDFLAGS+= -logg
+
+define Package/ices/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ices $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,ices))
diff --git a/multimedia/mjpg-streamer/Config.in b/multimedia/mjpg-streamer/Config.in
new file mode 100644 (file)
index 0000000..4a29ba9
--- /dev/null
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+
+if PACKAGE_mjpg-streamer
+
+config MJPG_STREAMER_V4L2
+       bool "Compile input_uvc with libv4l2 (camera controls)"
+       default n
+       select PACKAGE_libv4l
+
+config MJPG_STREAMER_INPUT_FILE
+       bool "Install input file plugin"
+       default n
+
+config MJPG_STREAMER_INPUT_UVC
+       bool "Install input uvc plugin"
+       default y
+
+config MJPG_STREAMER_INPUT_TESTPICTURE
+       bool "Install input testpicture plugin"
+       default n
+
+config MJPG_STREAMER_OUTPUT_FILE
+       bool "Install output file plugin"
+       default n
+
+config MJPG_STREAMER_OUTPUT_HTTP
+       bool "Install output http plugin"
+       default y
+
+config MJPG_STREAMER_WWW
+       bool "Install complete Web UI files (includes cambozola)"
+       default n
+
+endif
diff --git a/multimedia/mjpg-streamer/Makefile b/multimedia/mjpg-streamer/Makefile
new file mode 100644 (file)
index 0000000..69e05f4
--- /dev/null
@@ -0,0 +1,112 @@
+#
+# 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:=mjpg-streamer
+PKG_REV:=182
+PKG_VERSION:=r$(PKG_REV)
+PKG_RELEASE:=8
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).1.tar.bz2
+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_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+
+PKG_BUILD_DEPENDS:=MJPG_STREAMER_V4L2:libv4l
+
+define Package/mjpg-streamer
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  TITLE:=MJPG-streamer
+  DEPENDS:=+libpthread +libjpeg +MJPG_STREAMER_V4L2:libv4l
+  URL:=http://mjpg-streamer.wiki.sourceforge.net/
+  MENU:=1
+endef
+
+define Package/mjpg-streamer/description
+ Streaming application for Linux-UVC compatible webcams
+endef
+
+define Package/mjpg-streamer/config
+  source "$(SOURCE)/Config.in"
+endef
+
+EXTRA_CFLAGS += $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)
+
+define Package/mjpg-streamer/conffiles
+/etc/config/mjpg-streamer
+endef
+
+CAMBOZOLA:=cambozola-0.936.tar.gz
+
+# Distribution URL doesn't always have the correct version
+# Using the OpenWrt mirror provides a stable version
+#      orig-URL:=http://www.andywilcock.com/code/cambozola
+define Download/cambozola
+  URL:=http://mirror2.openwrt.org/sources
+  FILE:=$(CAMBOZOLA)
+  MD5SUM:=35c45188aa9635aef2b745c35c311396
+endef
+
+# Fetch latest cambozola that works with latest Java(s)
+# Yes, I know this is ugly
+define Build/Prepare
+    $(call Build/Prepare/Default)
+    ifeq ($(CONFIG_MJPG_STREAMER_WWW),y)
+       $(eval $(call Download,cambozola))
+       $(TAR) -xvf $(DL_DIR)/$(CAMBOZOLA) --strip=2 --wildcards \
+               -C $(PKG_BUILD_DIR)/www */dist/cambozola.jar
+    endif
+endef
+
+ifeq ($(CONFIG_MJPG_STREAMER_V4L2),y)
+    TARGET_CFLAGS+= -DUSE_LIBV4L2
+    TARGET_LDFLAGS+= -lv4l2
+endif
+
+define Package/mjpg-streamer/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/mjpg_streamer $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc/config
+       $(CP) ./files/mjpg-streamer.config $(1)/etc/config/mjpg-streamer
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/mjpg-streamer.init $(1)/etc/init.d/mjpg-streamer
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
+       $(INSTALL_DATA) ./files/mjpg-streamer.hotplug $(1)/etc/hotplug.d/usb/20-mjpg-streamer
+       $(INSTALL_DIR) $(1)/usr/lib
+ifeq ($(CONFIG_MJPG_STREAMER_INPUT_FILE),y)
+       $(CP) $(PKG_BUILD_DIR)/input_file.so $(1)/usr/lib
+endif
+ifeq ($(CONFIG_MJPG_STREAMER_INPUT_UVC),y)
+       $(CP) $(PKG_BUILD_DIR)/input_uvc.so $(1)/usr/lib
+endif
+ifeq ($(CONFIG_MJPG_STREAMER_INPUT_TESTPICTURE),y)
+       $(CP) $(PKG_BUILD_DIR)/input_testpicture.so $(1)/usr/lib
+endif
+ifeq ($(CONFIG_MJPG_STREAMER_OUTPUT_FILE),y)
+       $(CP) $(PKG_BUILD_DIR)/output_file.so $(1)/usr/lib
+endif
+ifeq ($(CONFIG_MJPG_STREAMER_OUTPUT_HTTP),y)
+       $(CP) $(PKG_BUILD_DIR)/output_http.so $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/www/webcam
+    ifeq ($(CONFIG_MJPG_STREAMER_WWW),y)
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/www/* $(1)/www/webcam
+    else
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/www/stream_simple.html $(1)/www/webcam/index.html
+    endif
+endif
+endef
+
+$(eval $(call BuildPackage,mjpg-streamer))
diff --git a/multimedia/mjpg-streamer/files/mjpg-streamer.config b/multimedia/mjpg-streamer/files/mjpg-streamer.config
new file mode 100644 (file)
index 0000000..a40d787
--- /dev/null
@@ -0,0 +1,15 @@
+
+config mjpg-streamer 'core'
+       option enabled '0'
+       option input 'uvc'
+       option output 'http'
+       option device '/dev/video0'
+       option resolution '640x480'
+       option yuv '0'
+       option quality '80'
+       option fps '5'
+       option led 'auto'
+       option www '/www/webcam'
+       option port '8080'
+       option username 'openwrt'
+       option password 'openwrt'
diff --git a/multimedia/mjpg-streamer/files/mjpg-streamer.hotplug b/multimedia/mjpg-streamer/files/mjpg-streamer.hotplug
new file mode 100644 (file)
index 0000000..1443b17
--- /dev/null
@@ -0,0 +1,10 @@
+case "$ACTION" in
+       add)
+               # start process
+               /etc/init.d/mjpg-streamer start
+               ;;
+       remove)
+               # stop process
+               /etc/init.d/mjpg-streamer stop
+               ;;
+esac
diff --git a/multimedia/mjpg-streamer/files/mjpg-streamer.init b/multimedia/mjpg-streamer/files/mjpg-streamer.init
new file mode 100644 (file)
index 0000000..06630d4
--- /dev/null
@@ -0,0 +1,97 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2009-2014 OpenWrt.org
+
+START=90
+STOP=10
+
+USE_PROCD=1
+PROG=/usr/bin/mjpg_streamer
+
+error() {
+       echo "${initscript}:" "$@" 1>&2
+}
+
+start_instance() {
+       local s="$1"
+
+       config_get_bool enabled "$1" 'enabled' 0
+       [ $enabled -eq 0 ] && return
+
+       config_get input "$s" 'input'
+       if [ -z "$input" ]; then
+               error "in section '$s' option input is missing"
+               return 1
+       fi
+
+       config_get output "$s" 'output'
+       if [ -z "$output" ]; then
+               error "in section '$s' option output is missing"
+               return 1
+       fi
+
+       local input_arg
+       if [ "x$input" = 'xuvc' ]; then
+               input_arg="input_uvc.so"
+
+               config_get device "$s" 'device'
+               if [ ! -c "$device" ]; then
+                       error "device '$device' does not exist"
+                       return 1
+               fi
+               input_arg="${input_arg} --device $device"
+
+               config_get fps "$s" 'fps'
+               [ -n "$fps" ] && input_arg="${input_arg} --fps $fps"
+
+               config_get_bool yuv "$s" 'yuv' 0
+               if [ $yuv -ne 0 ]; then
+                       input_arg="${input_arg} --yuv"
+                       config_get quality "$s" 'quality'
+                       [ -n "$quality" ] && input_arg="${input_arg} --quality $quality"
+               fi
+
+               config_get resolution "$s" 'resolution'
+               [ -n "$resolution" ] && input_arg="${input_arg} --resolution $resolution"
+
+               config_get led "$s" 'led'
+               [ -n "$led" ] && input_arg="${input_arg} --led $led"
+       fi
+
+       if [ -z "$input_arg" ]; then
+               error "unsuported input option '$input' in section '$s'"
+               return 1
+       fi
+
+       local output_arg
+       if [ "x$output" = 'xhttp' ]; then
+               output_arg="output_http.so"
+
+               config_get port "$s" 'port'
+               [ -n "$port" ] && output_arg="${output_arg} --port $port"
+
+               config_get www "$s" 'www'
+               [ -n "$www" ] && output_arg="${output_arg} --www $www"
+
+               config_get username "$s" 'username'
+               config_get password "$s" 'password'
+               [ -n "$username" ] && [ -n "$password" ] && output_arg="${output_arg} --credentials $username:$password"
+       fi
+
+       if [ -z "$output_arg" ]; then
+               error "unsuported output option '$output' in section '$s'"
+               return 1
+       fi
+
+       procd_open_instance
+       procd_set_param command "$PROG" --input "$input_arg" --output "$output_arg"
+       procd_close_instance
+}
+
+start_service() {
+       config_load 'mjpg-streamer'
+       config_foreach start_instance 'mjpg-streamer'
+}
+
+service_triggers() {
+       procd_add_reload_trigger 'mjpg-streamer'
+}
diff --git a/multimedia/mjpg-streamer/patches/005-musl_compatibility.patch b/multimedia/mjpg-streamer/patches/005-musl_compatibility.patch
new file mode 100644 (file)
index 0000000..c758eb9
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/mjpg_streamer.h
++++ b/mjpg_streamer.h
+@@ -29,6 +29,10 @@
+ #define MAX_OUTPUT_PLUGINS 10
+ #define MAX_PLUGIN_ARGUMENTS 32
++#define __NEED_pthread_t
++#define __NEED_pthread_mutex_t
++#define __NEED_pthread_cond_t
++
+ #include <linux/types.h>          /* for videodev2.h */
+ #include <linux/videodev2.h>
diff --git a/multimedia/mjpg-streamer/patches/010-enable_additional_plugins.patch b/multimedia/mjpg-streamer/patches/010-enable_additional_plugins.patch
new file mode 100644 (file)
index 0000000..4713a08
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/Makefile
++++ b/Makefile
+@@ -33,12 +33,12 @@ APP_BINARY = mjpg_streamer
+ # define the names and targets of the plugins
+ PLUGINS = input_uvc.so
+-#PLUGINS += output_file.so
++PLUGINS += output_file.so
+ #PLUGINS += output_udp.so
+ PLUGINS += output_http.so
+ PLUGINS += input_testpicture.so
+ #PLUGINS += output_autofocus.so
+-#PLUGINS += input_file.so
++PLUGINS += input_file.so
+ # PLUGINS += input_pylon.so
+ # PLUGINS += input_megatec.so
+ # PLUGINS += output_mars2020.so
diff --git a/multimedia/mjpg-streamer/patches/020-remove_gcc_debug_options.patch b/multimedia/mjpg-streamer/patches/020-remove_gcc_debug_options.patch
new file mode 100644 (file)
index 0000000..00d831e
--- /dev/null
@@ -0,0 +1,33 @@
+--- a/plugins/input_uvc/Makefile
++++ b/plugins/input_uvc/Makefile
+@@ -13,7 +13,7 @@ OTHER_HEADERS = ../../mjpg_streamer.h ..
+ CFLAGS += -O1  -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC
+-CFLAGS += -g -DDEBUG
++#CFLAGS += -g -DDEBUG
+ ifeq ($(USE_LIBV4L2),true)
+ LFLAGS += -lv4l2
+--- a/plugins/output_file/Makefile
++++ b/plugins/output_file/Makefile
+@@ -12,7 +12,7 @@ CC = gcc
+ OTHER_HEADERS = ../../mjpg_streamer.h ../../utils.h ../output.h ../input.h
+ CFLAGS += -O2 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC
+-CFLAGS += -DDEBUG -g
++#CFLAGS += -DDEBUG -g
+ LFLAGS += -lpthread -ldl
+ all: output_file.so
+--- a/plugins/output_udp/Makefile
++++ b/plugins/output_udp/Makefile
+@@ -14,7 +14,7 @@ CC = gcc
+ OTHER_HEADERS = ../../mjpg_streamer.h ../../utils.h ../output.h ../input.h
+ CFLAGS += -O2 -DLINUX -D_GNU_SOURCE -Wall -shared -fPIC
+-CFLAGS += -DDEBUG
++#CFLAGS += -DDEBUG
+ LFLAGS += -lpthread -ldl
+ all: output_udp.so
diff --git a/multimedia/mjpg-streamer/patches/030-allow_16_char_device_names.patch b/multimedia/mjpg-streamer/patches/030-allow_16_char_device_names.patch
new file mode 100644 (file)
index 0000000..0f8660a
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/plugins/input_uvc/v4l2uvc.c
++++ b/plugins/input_uvc/v4l2uvc.c
+@@ -69,7 +69,7 @@ int init_videoIn(struct vdIn *vd, char *
+     vd->videodevice = (char *) calloc(1, 16 * sizeof(char));
+     vd->status = (char *) calloc(1, 100 * sizeof(char));
+     vd->pictName = (char *) calloc(1, 80 * sizeof(char));
+-    snprintf(vd->videodevice, 12, "%s", device);
++    snprintf(vd->videodevice, 16, "%s", device);
+     vd->toggleAvi = 0;
+     vd->getPict = 0;
+     vd->signalquit = 1;
diff --git a/multimedia/mjpg-streamer/patches/040-Buffer-the-bytesused-variable-from-struct-v4l2_buffe.patch b/multimedia/mjpg-streamer/patches/040-Buffer-the-bytesused-variable-from-struct-v4l2_buffe.patch
new file mode 100644 (file)
index 0000000..a228f42
--- /dev/null
@@ -0,0 +1,87 @@
+From 19202b54698b343a0207d7e213448e32b8e58fc3 Mon Sep 17 00:00:00 2001
+From: Olliver Schinagl <o.schinagl@ultimaker.com>
+Date: Wed, 29 Oct 2014 09:34:41 +0100
+Subject: [PATCH 1/7] Buffer the bytesused variable from struct v4l2_buffer
+
+Starting with kernel versions 3.16, (DE)Queing of buffers has been fixed
+after it was leaking data for ages. in the struct v4l2_buffer is the
+bytesused element which indicates the size of the buffer. This however
+gets cleared whenever the buffer gets requeued and is thus no longer
+valid.
+
+This patch copies the bytesused variable so it is available until the
+next frame captured again.
+
+Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
+---
+ plugins/input_uvc/input_uvc.c | 6 +++---
+ plugins/input_uvc/v4l2uvc.c   | 2 ++
+ plugins/input_uvc/v4l2uvc.h   | 1 +
+ 3 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/plugins/input_uvc/input_uvc.c b/plugins/input_uvc/input_uvc.c
+index e6c74fd..64f66cb 100644
+--- a/plugins/input_uvc/input_uvc.c
++++ b/plugins/input_uvc/input_uvc.c
+@@ -482,7 +482,7 @@ void *cam_thread(void *arg)
+             exit(EXIT_FAILURE);
+         }
+-        //DBG("received frame of size: %d from plugin: %d\n", pcontext->videoIn->buf.bytesused, pcontext->id);
++        //DBG("received frame of size: %d from plugin: %d\n", pcontext->videoIn->tmpbytesused, pcontext->id);
+         /*
+          * Workaround for broken, corrupted frames:
+@@ -491,7 +491,7 @@ void *cam_thread(void *arg)
+          * For example a VGA (640x480) webcam picture is normally >= 8kByte large,
+          * corrupted frames are smaller.
+          */
+-        if(pcontext->videoIn->buf.bytesused < minimum_size) {
++        if(pcontext->videoIn->tmpbytesused < minimum_size) {
+             DBG("dropping too small frame, assuming it as broken\n");
+             continue;
+         }
+@@ -529,7 +529,7 @@ void *cam_thread(void *arg)
+         } else {
+         #endif
+             //DBG("copying frame from input: %d\n", (int)pcontext->id);
+-            pglobal->in[pcontext->id].size = memcpy_picture(pglobal->in[pcontext->id].buf, pcontext->videoIn->tmpbuffer, pcontext->videoIn->buf.bytesused);
++            pglobal->in[pcontext->id].size = memcpy_picture(pglobal->in[pcontext->id].buf, pcontext->videoIn->tmpbuffer, pcontext->videoIn->tmpbytesused);
+         #ifndef NO_LIBJPEG
+         }
+         #endif
+diff --git a/plugins/input_uvc/v4l2uvc.c b/plugins/input_uvc/v4l2uvc.c
+index c5a5aa4..d11510c 100644
+--- a/plugins/input_uvc/v4l2uvc.c
++++ b/plugins/input_uvc/v4l2uvc.c
+@@ -532,6 +532,7 @@ int uvcGrab(struct vdIn *vd)
+         */
+         memcpy(vd->tmpbuffer, vd->mem[vd->buf.index], vd->buf.bytesused);
++      vd->tmpbytesused = vd->buf.bytesused;
+         if(debug)
+             fprintf(stderr, "bytes in used %d \n", vd->buf.bytesused);
+@@ -570,6 +571,7 @@ int close_v4l2(struct vdIn *vd)
+     if(vd->tmpbuffer)
+         free(vd->tmpbuffer);
+     vd->tmpbuffer = NULL;
++    vd->tmpbytesused = 0;
+     free(vd->framebuffer);
+     vd->framebuffer = NULL;
+     free(vd->videodevice);
+diff --git a/plugins/input_uvc/v4l2uvc.h b/plugins/input_uvc/v4l2uvc.h
+index 022c57e..2c7c8ba 100644
+--- a/plugins/input_uvc/v4l2uvc.h
++++ b/plugins/input_uvc/v4l2uvc.h
+@@ -83,6 +83,7 @@ struct vdIn {
+     struct v4l2_requestbuffers rb;
+     void *mem[NB_BUFFER];
+     unsigned char *tmpbuffer;
++    int tmpbytesused;
+     unsigned char *framebuffer;
+     streaming_state streamingState;
+     int grabmethod;
+-- 
+1.9.1
+
diff --git a/multimedia/mjpg-streamer/patches/041-Stop-leaking-data-via-struct-v4l2_buffer.patch b/multimedia/mjpg-streamer/patches/041-Stop-leaking-data-via-struct-v4l2_buffer.patch
new file mode 100644 (file)
index 0000000..4f45da5
--- /dev/null
@@ -0,0 +1,242 @@
+From 11b28b36a8711b53658e8bbc50435595522f91ba Mon Sep 17 00:00:00 2001
+From: Olliver Schinagl <o.schinagl@ultimaker.com>
+Date: Wed, 29 Oct 2014 11:21:16 +0100
+Subject: [PATCH 2/7] Stop leaking data via struct v4l2_buffer
+
+Before the 3.16 kernel, the v4l2_buffer was leaking data and violating
+its own spec. Since 3.16 this has been corrected and after calling the
+QBUF ioctl, the struct gets cleaned up.
+
+Right now, input_uvc assumes the buffer is valid at all times. This no
+longer being true, this patch removes the v4l2_buffer from the vdIn
+struct. Certain values are still needed outside of this buffer however,
+the length buffer in the buffer array 'mem' and the timestamp. These are
+now stored in the vdIn struct.
+
+All of this is still somewhat hackish, as a) the processing of the image
+should really be done inside the uvcGrab function between the queuing
+and dequeing of the buffers (or separate that into 3 functions, deq, q
+and process and call them from input_uvc). b) we are still copying the
+image using memcpy, which is something we don't really want and defeats
+the purpose of using a mmap in the first place. Changing this however
+requires some heavier re-architecting and in the end, may still not be avoided.
+
+More information about this bug and change can be found on the
+linux-media mailing list[0] with the title uvcvideo fails on 3.16 and
+3.17 kernels.
+
+[0] http://www.spinics.net/lists/linux-media/msg81515.html
+
+Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
+---
+ plugins/input_uvc/input_uvc.c |  6 ++--
+ plugins/input_uvc/v4l2uvc.c   | 64 +++++++++++++++++++++++--------------------
+ plugins/input_uvc/v4l2uvc.h   |  4 ++-
+ 3 files changed, 41 insertions(+), 33 deletions(-)
+
+diff --git a/plugins/input_uvc/input_uvc.c b/plugins/input_uvc/input_uvc.c
+index 64f66cb..64ef56c 100644
+--- a/plugins/input_uvc/input_uvc.c
++++ b/plugins/input_uvc/input_uvc.c
+@@ -500,8 +500,8 @@ void *cam_thread(void *arg)
+         if (pcontext->videoIn->soft_framedrop == 1) {
+             unsigned long last = pglobal->in[pcontext->id].timestamp.tv_sec * 1000 +
+                                 (pglobal->in[pcontext->id].timestamp.tv_usec/1000); // convert to ms
+-            unsigned long current = pcontext->videoIn->buf.timestamp.tv_sec * 1000 +
+-                                    pcontext->videoIn->buf.timestamp.tv_usec/1000; // convert to ms
++            unsigned long current = pcontext->videoIn->tmptimestamp.tv_sec * 1000 +
++                                    pcontext->videoIn->tmptimestamp.tv_usec/1000; // convert to ms
+             // if the requested time did not esplashed skip the frame
+             if ((current - last) < pcontext->videoIn->frame_period_time) {
+@@ -543,7 +543,7 @@ void *cam_thread(void *arg)
+ #endif
+         /* copy this frame's timestamp to user space */
+-        pglobal->in[pcontext->id].timestamp = pcontext->videoIn->buf.timestamp;
++        pglobal->in[pcontext->id].timestamp = pcontext->videoIn->tmptimestamp;
+         /* signal fresh_frame */
+         pthread_cond_broadcast(&pglobal->in[pcontext->id].db_update);
+diff --git a/plugins/input_uvc/v4l2uvc.c b/plugins/input_uvc/v4l2uvc.c
+index d11510c..7ec5eec 100644
+--- a/plugins/input_uvc/v4l2uvc.c
++++ b/plugins/input_uvc/v4l2uvc.c
+@@ -217,6 +217,9 @@ static int init_v4l2(struct vdIn *vd)
+ {
+     int i;
+     int ret = 0;
++    struct v4l2_buffer buf;
++
++
+     if((vd->fd = OPEN_VIDEO(vd->videodevice, O_RDWR)) == -1) {
+         perror("ERROR opening V4L interface");
+         DBG("errno: %d", errno);
+@@ -375,26 +378,27 @@ static int init_v4l2(struct vdIn *vd)
+      * map the buffers
+      */
+     for(i = 0; i < NB_BUFFER; i++) {
+-        memset(&vd->buf, 0, sizeof(struct v4l2_buffer));
+-        vd->buf.index = i;
+-        vd->buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+-        vd->buf.memory = V4L2_MEMORY_MMAP;
+-        ret = xioctl(vd->fd, VIDIOC_QUERYBUF, &vd->buf);
++        memset(&buf, 0, sizeof(struct v4l2_buffer));
++        buf.index = i;
++        buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
++        buf.memory = V4L2_MEMORY_MMAP;
++        ret = xioctl(vd->fd, VIDIOC_QUERYBUF, &buf);
+         if(ret < 0) {
+             perror("Unable to query buffer");
+             goto fatal;
+         }
+         if(debug)
+-            fprintf(stderr, "length: %u offset: %u\n", vd->buf.length, vd->buf.m.offset);
++            fprintf(stderr, "length: %u offset: %u\n", buf.length, buf.m.offset);
+         vd->mem[i] = mmap(0 /* start anywhere */ ,
+-                          vd->buf.length, PROT_READ | PROT_WRITE, MAP_SHARED, vd->fd,
+-                          vd->buf.m.offset);
++                          buf.length, PROT_READ | PROT_WRITE, MAP_SHARED, vd->fd,
++                          buf.m.offset);
+         if(vd->mem[i] == MAP_FAILED) {
+             perror("Unable to map buffer");
+             goto fatal;
+         }
++      vd->memlength[i] = buf.length;
+         if(debug)
+             fprintf(stderr, "Buffer mapped at address %p.\n", vd->mem[i]);
+     }
+@@ -403,11 +407,11 @@ static int init_v4l2(struct vdIn *vd)
+      * Queue the buffers.
+      */
+     for(i = 0; i < NB_BUFFER; ++i) {
+-        memset(&vd->buf, 0, sizeof(struct v4l2_buffer));
+-        vd->buf.index = i;
+-        vd->buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+-        vd->buf.memory = V4L2_MEMORY_MMAP;
+-        ret = xioctl(vd->fd, VIDIOC_QBUF, &vd->buf);
++        memset(&buf, 0, sizeof(struct v4l2_buffer));
++        buf.index = i;
++        buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
++        buf.memory = V4L2_MEMORY_MMAP;
++        ret = xioctl(vd->fd, VIDIOC_QBUF, &buf);
+         if(ret < 0) {
+             perror("Unable to queue buffer");
+             goto fatal;;
+@@ -499,17 +503,18 @@ int memcpy_picture(unsigned char *out, unsigned char *buf, int size)
+ int uvcGrab(struct vdIn *vd)
+ {
+ #define HEADERFRAME1 0xaf
++    struct v4l2_buffer buf;
+     int ret;
+     if(vd->streamingState == STREAMING_OFF) {
+         if(video_enable(vd))
+             goto err;
+     }
+-    memset(&vd->buf, 0, sizeof(struct v4l2_buffer));
+-    vd->buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+-    vd->buf.memory = V4L2_MEMORY_MMAP;
++    memset(&buf, 0, sizeof(struct v4l2_buffer));
++    buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
++    buf.memory = V4L2_MEMORY_MMAP;
+-    ret = xioctl(vd->fd, VIDIOC_DQBUF, &vd->buf);
++    ret = xioctl(vd->fd, VIDIOC_DQBUF, &buf);
+     if(ret < 0) {
+         perror("Unable to dequeue buffer");
+         goto err;
+@@ -517,33 +522,34 @@ int uvcGrab(struct vdIn *vd)
+     switch(vd->formatIn) {
+     case V4L2_PIX_FMT_MJPEG:
+-        if(vd->buf.bytesused <= HEADERFRAME1) {
++        if(buf.bytesused <= HEADERFRAME1) {
+             /* Prevent crash
+                                                         * on empty image */
+             fprintf(stderr, "Ignoring empty buffer ...\n");
+             return 0;
+         }
+-        /* memcpy(vd->tmpbuffer, vd->mem[vd->buf.index], vd->buf.bytesused);
++        /* memcpy(vd->tmpbuffer, vd->mem[buf.index], buf.bytesused);
+-        memcpy (vd->tmpbuffer, vd->mem[vd->buf.index], HEADERFRAME1);
++        memcpy (vd->tmpbuffer, vd->mem[buf.index], HEADERFRAME1);
+         memcpy (vd->tmpbuffer + HEADERFRAME1, dht_data, sizeof(dht_data));
+-        memcpy (vd->tmpbuffer + HEADERFRAME1 + sizeof(dht_data), vd->mem[vd->buf.index] + HEADERFRAME1, (vd->buf.bytesused - HEADERFRAME1));
++        memcpy (vd->tmpbuffer + HEADERFRAME1 + sizeof(dht_data), vd->mem[buf.index] + HEADERFRAME1, (buf.bytesused - HEADERFRAME1));
+         */
+-        memcpy(vd->tmpbuffer, vd->mem[vd->buf.index], vd->buf.bytesused);
+-      vd->tmpbytesused = vd->buf.bytesused;
++        memcpy(vd->tmpbuffer, vd->mem[buf.index], buf.bytesused);
++      vd->tmpbytesused = buf.bytesused;
++      vd->tmptimestamp = buf.timestamp;
+         if(debug)
+-            fprintf(stderr, "bytes in used %d \n", vd->buf.bytesused);
++            fprintf(stderr, "bytes in used %d \n", buf.bytesused);
+         break;
+     case V4L2_PIX_FMT_RGB565:
+     case V4L2_PIX_FMT_YUYV:
+     case V4L2_PIX_FMT_RGB24:
+-        if(vd->buf.bytesused > vd->framesizeIn)
+-            memcpy(vd->framebuffer, vd->mem[vd->buf.index], (size_t) vd->framesizeIn);
++        if(buf.bytesused > vd->framesizeIn)
++            memcpy(vd->framebuffer, vd->mem[buf.index], (size_t) vd->framesizeIn);
+         else
+-            memcpy(vd->framebuffer, vd->mem[vd->buf.index], (size_t) vd->buf.bytesused);
++            memcpy(vd->framebuffer, vd->mem[buf.index], (size_t) buf.bytesused);
+         break;
+     default:
+@@ -551,7 +557,7 @@ int uvcGrab(struct vdIn *vd)
+         break;
+     }
+-    ret = xioctl(vd->fd, VIDIOC_QBUF, &vd->buf);
++    ret = xioctl(vd->fd, VIDIOC_QBUF, &buf);
+     if(ret < 0) {
+         perror("Unable to requeue buffer");
+         goto err;
+@@ -947,7 +953,7 @@ int setResolution(struct vdIn *vd, int width, int height)
+         DBG("Unmap buffers\n");
+         int i;
+         for(i = 0; i < NB_BUFFER; i++)
+-            munmap(vd->mem[i], vd->buf.length);
++            munmap(vd->mem[i], vd->memlength[i]);
+         if(CLOSE_VIDEO(vd->fd) == 0) {
+             DBG("Device closed successfully\n");
+diff --git a/plugins/input_uvc/v4l2uvc.h b/plugins/input_uvc/v4l2uvc.h
+index 2c7c8ba..e625957 100644
+--- a/plugins/input_uvc/v4l2uvc.h
++++ b/plugins/input_uvc/v4l2uvc.h
+@@ -35,6 +35,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
+ #include <sys/select.h>
++#include <sys/time.h>
+ #include <linux/types.h>          /* for videodev2.h */
+ #include <linux/videodev2.h>
+@@ -79,11 +80,12 @@ struct vdIn {
+     char *pictName;
+     struct v4l2_capability cap;
+     struct v4l2_format fmt;
+-    struct v4l2_buffer buf;
+     struct v4l2_requestbuffers rb;
+     void *mem[NB_BUFFER];
++    int memlength[NB_BUFFER];
+     unsigned char *tmpbuffer;
+     int tmpbytesused;
++    struct timeval tmptimestamp;
+     unsigned char *framebuffer;
+     streaming_state streamingState;
+     int grabmethod;
+-- 
+1.9.1
+
diff --git a/multimedia/mjpg-streamer/patches/050-fix-yuv-capture.patch b/multimedia/mjpg-streamer/patches/050-fix-yuv-capture.patch
new file mode 100644 (file)
index 0000000..0c4d27a
--- /dev/null
@@ -0,0 +1,58 @@
+Binary files a/ipkg-ar71xx/mjpg-streamer/usr/lib/input_uvc.so and b/ipkg-ar71xx/mjpg-streamer/usr/lib/input_uvc.so differ
+diff -ur a/plugins/input_uvc/input_uvc.c b/plugins/input_uvc/input_uvc.c
+--- a/plugins/input_uvc/input_uvc.c     2015-03-02 09:14:05.000000000 +0200
++++ b/plugins/input_uvc/input_uvc.c     2015-03-02 09:18:22.000000000 +0200
+@@ -311,6 +311,10 @@
+     }
+     memset(cams[id].videoIn, 0, sizeof(struct vdIn));
++    /* Non-MJPEG formats seem to fail with unlimited FPS */
++    if (format != V4L2_PIX_FMT_MJPEG && fps == -1)
++        fps = 15;
++
+     /* display the parsed values */
+     IPRINT("Using V4L2 device.: %s\n", dev);
+     IPRINT("Desired Resolution: %i x %i\n", width, height);
+diff -ur a/plugins/input_uvc/jpeg_utils.c b/plugins/input_uvc/jpeg_utils.c
+--- a/plugins/input_uvc/jpeg_utils.c    2015-03-02 09:17:02.000000000 +0300
++++ b/plugins/input_uvc/jpeg_utils.c    2015-03-02 09:25:18.000000000 +0200
+@@ -198,7 +198,7 @@
+             }
+             row_pointer = (JSAMPROW*)line_buffer;
+-            jpeg_write_scanlines(&cinfo, row_pointer, 1);
++            jpeg_write_scanlines(&cinfo, &row_pointer, 1);
+         }
+     } else if (vd->formatIn == V4L2_PIX_FMT_RGB565) {
+         while(cinfo.next_scanline < vd->height) {
+@@ -220,7 +220,7 @@
+             }
+             row_pointer = (JSAMPROW*)line_buffer;
+-            jpeg_write_scanlines(&cinfo, row_pointer, 1);
++            jpeg_write_scanlines(&cinfo, &row_pointer, 1);
+         }
+     } else if (vd->formatIn == V4L2_PIX_FMT_RGB24) {
+         jpeg_write_scanlines(&cinfo, (JSAMPROW*)vd->framebuffer, vd->height);
+diff -ur a/plugins/input_uvc/v4l2uvc.c b/plugins/input_uvc/v4l2uvc.c
+--- a/plugins/input_uvc/v4l2uvc.c       2015-03-02 09:14:05.000000000 +0200
++++ b/plugins/input_uvc/v4l2uvc.c       2015-03-02 09:22:09.000000000 +0200
+@@ -338,11 +338,15 @@
+                         vd->frame_period_time = 1000/vd->fps; // calcualate frame period time in ms
+                         IPRINT("Frame period time ......: %ld ms\n", vd->frame_period_time);
+-                        // set FPS to maximum in order to minimize the lagging
+                         memset(setfps, 0, sizeof(struct v4l2_streamparm));
+                         setfps->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+                         setfps->parm.capture.timeperframe.numerator = 1;
+-                        setfps->parm.capture.timeperframe.denominator = 255;
++                       if (vd->formatIn == V4L2_PIX_FMT_MJPEG)
++                           // set FPS to maximum in order to minimize the lagging
++                           setfps->parm.capture.timeperframe.denominator = 255;
++                       else
++                           setfps->parm.capture.timeperframe.denominator = vd->fps;
++
+                         ret = xioctl(vd->fd, VIDIOC_S_PARM, setfps);
+                         if (ret) {
+                             perror("Unable to set the FPS\n");
+
diff --git a/multimedia/mjpg-streamer/patches/060-fix-sigtrap-in-v4l2uvc.patch b/multimedia/mjpg-streamer/patches/060-fix-sigtrap-in-v4l2uvc.patch
new file mode 100644 (file)
index 0000000..e0b5837
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/plugins/input_uvc/v4l2uvc.c
++++ b/plugins/input_uvc/v4l2uvc.c
+@@ -130,7 +130,7 @@ int init_videoIn(struct vdIn *vd, char *
+             return -1;
+         }
+-        memcpy(&pglobal->in[id].in_formats[pglobal->in[id].formatCount], &fmtdesc, sizeof(input_format));
++        memcpy(&pglobal->in[id].in_formats[pglobal->in[id].formatCount], &fmtdesc, sizeof(struct v4l2_fmtdesc));
+         if(fmtdesc.pixelformat == format)
+             pglobal->in[id].currentFormat = pglobal->in[id].formatCount;
diff --git a/multimedia/motion/Makefile b/multimedia/motion/Makefile
new file mode 100644 (file)
index 0000000..7b6b5f5
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# Copyright (C) 2008-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:=motion
+PKG_VERSION=3.4.0-20141018-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=3
+
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/Mr-Dave/motion.git
+PKG_SOURCE_VERSION:=9479d910f2149b5558788bb86f97f26522794212
+
+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/motion
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  DEPENDS:=+libjpeg +libpthread
+  TITLE:=webcam motion sensing and logging
+  URL:=http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
+endef
+
+define Package/motion/conffiles
+/etc/motion.conf
+endef
+
+CONFIGURE_ARGS+= \
+       --without-optimizecpu \
+       --without-ffmpeg \
+       --without-jpeg-mmx \
+       --without-sdl \
+       --without-mysql \
+       --without-pgsql \
+       --without-sqlite3 \
+
+define Package/motion/install
+       $(INSTALL_DIR) $(1)/etc
+       $(CP) $(PKG_BUILD_DIR)/motion-dist.conf $(1)/etc/motion.conf
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/motion $(1)/usr/bin/
+
+endef
+
+$(eval $(call BuildPackage,motion))
diff --git a/multimedia/motion/patches/100-musl-compat.patch b/multimedia/motion/patches/100-musl-compat.patch
new file mode 100644 (file)
index 0000000..b788e26
--- /dev/null
@@ -0,0 +1,49 @@
+--- a/motion.c
++++ b/motion.c
+@@ -2630,6 +2630,17 @@ int main (int argc, char **argv)
+     struct sigaction sigchild_action;
+     setup_signals(&sig_handler_action, &sigchild_action);
++    /*
++     * Create and a thread attribute for the threads we spawn later on.
++     * PTHREAD_CREATE_DETACHED means to create threads detached, i.e.
++     * their termination cannot be synchronized through 'pthread_join'.
++     */
++    pthread_attr_init(&thread_attr);
++    pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED);
++
++    /* Create the TLS key for thread number. */
++    pthread_key_create(&tls_key_threadnr, NULL);
++
+     motion_startup(1, argc, argv);
+ #ifdef HAVE_FFMPEG
+@@ -2648,17 +2659,6 @@ int main (int argc, char **argv)
+     if (cnt_list[0]->conf.setup_mode)
+         MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "%s: Motion running in setup mode.");
+-    /*
+-     * Create and a thread attribute for the threads we spawn later on.
+-     * PTHREAD_CREATE_DETACHED means to create threads detached, i.e.
+-     * their termination cannot be synchronized through 'pthread_join'.
+-     */
+-    pthread_attr_init(&thread_attr);
+-    pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED);
+-
+-    /* Create the TLS key for thread number. */
+-    pthread_key_create(&tls_key_threadnr, NULL);
+-
+     do {
+         if (restart) {
+             /*
+--- a/motion.h
++++ b/motion.h
+@@ -84,7 +84,7 @@
+ #endif
+ /* strerror_r() XSI vs GNU */
+-#if (defined(BSD)) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE)
++#if (defined(BSD)) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE) || (!defined(__GLIBC__))
+ #define XSI_STRERROR_R
+ #endif
diff --git a/multimedia/oggfwd/Makefile b/multimedia/oggfwd/Makefile
new file mode 100644 (file)
index 0000000..a025e8d
--- /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:=oggfwd
+PKG_REV:=506088e5066abd086efc951670906187c120e9a3
+PKG_VERSION:=20150412
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://r-w-x.org/oggfwd.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:=LICENSE
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/oggfwd
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  SUBMENU:=Streaming
+  TITLE:=Pipe media into icecast
+  URL:=http://www.v2v.cc/~j/oggfwd
+  DEPENDS:=+libpthread +libshout-full
+endef
+
+define Package/oggfwd/description
+ A basic icecast client that is very simple but also very useful for video
+ streaming.
+endef
+
+MAKE_FLAGS += \
+       INCLUDEFLAGS="$(TARGET_LDFLAGS)" \
+       LINKFLAGS="$(TARGET_LDFLAGS) -lshout" \
+
+define Package/oggfwd/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/oggfwd $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,oggfwd))
diff --git a/multimedia/tvheadend/Config.in b/multimedia/tvheadend/Config.in
new file mode 100644 (file)
index 0000000..61a3774
--- /dev/null
@@ -0,0 +1,17 @@
+config TVHEADEND_CWC_SUPPORT
+       bool "NewCamd support"
+       default y
+
+config TVHEADEND_LINUXDVB_SUPPORT
+       bool "Linux DVB support"
+       default y
+
+config TVHEADEND_DVBSCAN_SUPPORT
+       bool "Fetch DVB-scan data"
+       depends on TVHEADEND_LINUXDVB_SUPPORT
+       default TVHEADEND_LINUXDVB_SUPPORT
+
+config TVHEADEND_AVAHI_SUPPORT
+       bool "Avahi client support"
+       select PACKAGE_libavahi-client
+       default n
diff --git a/multimedia/tvheadend/Makefile b/multimedia/tvheadend/Makefile
new file mode 100644 (file)
index 0000000..6b5b95f
--- /dev/null
@@ -0,0 +1,98 @@
+#
+# 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:=tvheadend
+PKG_VERSION:=4.0.9
+PKG_RELEASE:=1
+
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/tvheadend/tvheadend.git
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=LICENSE.md
+
+PKG_FIXUP:=autoreconf
+
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/tvheadend
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  TITLE:=Tvheadend is a TV streaming server for Linux
+  DEPENDS:=+libopenssl +librt +zlib +TVHEADEND_AVAHI_SUPPORT:libavahi-client $(ICONV_DEPENDS)
+  URL:=https://tvheadend.org
+  MAINTAINER:=Jan Čermák <jan.cermak@nic.cz>
+endef
+
+define Package/tvheadend/description
+  Tvheadend is a TV streaming server and recorder for Linux, FreeBSD and Android
+  supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, IPTV, SAT>IP and HDHomeRun as input sources.
+
+  Tvheadend offers the HTTP (VLC, MPlayer), HTSP (Kodi, Movian) and SAT>IP streaming.
+endef
+
+define Package/tvheadend/config
+  menu "Configuration"
+  depends on PACKAGE_tvheadend
+  source "$(SOURCE)/Config.in"
+  endmenu
+endef
+
+ifeq ($(CONFIG_TVHEADEND_CWC_SUPPORT),)
+  CONFIGURE_ARGS += --disable-cwc
+endif
+
+ifeq ($(CONFIG_TVHEADEND_LINUXDVB_SUPPORT),)
+  CONFIGURE_ARGS += --disable-linuxdvb
+endif
+
+ifeq ($(CONFIG_TVHEADEND_DVBSCAN_SUPPORT),)
+  CONFIGURE_ARGS += --disable-dvbscan
+endif
+
+ifeq ($(CONFIG_TVHEADEND_AVAHI_SUPPORT),)
+  CONFIGURE_ARGS += --disable-avahi
+else
+  CONFIGURE_ARGS += --enable-avahi
+endif
+
+CONFIGURE_ARGS += \
+       --arch=$(ARCH) \
+       --disable-dbus_1 \
+       --disable-libav \
+       --enable-bundle
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       echo 'Tvheadend $(shell echo $(PKG_SOURCE_VERSION) | sed "s/^v//")~openwrt$(PKG_RELEASE)' \
+               > $(PKG_BUILD_DIR)/debian/changelog
+endef
+
+define Package/conffiles
+/etc/config/tvheadend
+endef
+
+define Package/tvheadend/install
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/tvheadend.init $(1)/etc/init.d/tvheadend
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/tvheadend.config $(1)/etc/config/tvheadend
+
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/build.linux/tvheadend $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,tvheadend))
diff --git a/multimedia/tvheadend/files/tvheadend.config b/multimedia/tvheadend/files/tvheadend.config
new file mode 100644 (file)
index 0000000..62c139d
--- /dev/null
@@ -0,0 +1,13 @@
+#config tvheadend service
+#       option nosyslog '0'
+#       option use_temp_epgdb '0'
+#       option config_path '/etc/tvheadend'
+
+config tvheadend server
+       option ipv6 '1'
+#       option bindaddr '0.0.0.0'
+#       option http_port '9981'
+#       option http_root '/tvheadend'
+#       option htsp_port '9982'
+#       option htsp_port2 '9983'
+#       option xspf '0'
diff --git a/multimedia/tvheadend/files/tvheadend.init b/multimedia/tvheadend/files/tvheadend.init
new file mode 100644 (file)
index 0000000..31702e1
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh /etc/rc.common
+
+START=99
+STOP=00
+
+USE_PROCD=1
+PROG=/usr/bin/tvheadend
+
+TEMP_CONFIG=/tmp/tvheadend
+PERSISTENT_CONFIG=/etc/tvheadend
+
+execute_first_run() {
+       "$PROG" -c "$1" -B -C -A >/dev/null 2>&1
+}
+
+ensure_config_exists() {
+       local config_path
+
+       config_load tvheadend
+       config_get config_path service config_path
+
+       if [ -z "$config_path" ]; then
+               [ -d "$PERSISTENT_CONFIG" ] || execute_first_run "$PERSISTENT_CONFIG"
+       else
+               # if the configuration directory is empty, empty config with grant-all ACL is created
+               [ -d "$config_path" ] && [ "$(ls -A $config_path)" ] || execute_first_run "$config_path"
+       fi
+
+       # if use_temp_epgdb is enabled (default), most of the config is put to config_path
+       # (or /etc/config), except for epgdb.v2, which grows quite large and is write-heavy,
+       # so it's put into volatile tmpfs
+       # epgdb.v2 is created and symlinked to main config dir upon each start (if it doesn't exist)
+       config_get_bool use_temp_epgdb service use_temp_epgdb 1
+       if [ "$use_temp_epgdb" == "1" ]; then
+               TEMP_EPG="${TEMP_CONFIG}/epgdb.v2"
+               [ ! -f "$TEMP_EPG" ] && mkdir -p "$TEMP_CONFIG" && touch "$TEMP_EPG" && chmod 700 "$TEMP_EPG"
+               [ -z "$config_path" ] && config_path="$PERSISTENT_CONFIG"
+               ln -sf "$TEMP_EPG" "${config_path}/epgdb.v2"
+       fi
+}
+
+load_uci_config() {
+       config_load tvheadend
+       config_get config_path service config_path "$PERSISTENT_CONFIG"
+       [ -n "$config_path" ] && procd_append_param command -c "$config_path"
+       config_get_bool nosyslog service nosyslog 0
+       [ "$nosyslog" -eq 1 ] && procd_append_param command --nosyslog
+       config_get_bool ipv6 server ipv6 0
+       [ "$ipv6" -eq 1 ] && procd_append_param command --ipv6
+       config_get bindaddr server bindaddr
+       [ -n "$bindaddr" ] && procd_append_param command --bindaddr "$bindaddr"
+       config_get http_port server http_port
+       [ -n "$http_port" ] && procd_append_param command --http_port "$http_port"
+       config_get http_root server http_root
+       [ -n "$http_root" ] && procd_append_param command --http_root "$http_root"
+       config_get htsp_port server htsp_port
+       [ -n "$htsp_port" ] && procd_append_param command --htsp_port "$htsp_port"
+       config_get htsp_port2 server htsp_port2
+       [ -n "$htsp_port2" ] && procd_append_param command --htsp_port "$htsp_port2"
+       config_get xspf server xspf 0
+       [ "$xspf" -eq 1 ] && procd_append_param command --xspf
+}
+
+start_service() {
+       ensure_config_exists
+       procd_open_instance
+       procd_set_param file /etc/config/tvheadend
+       procd_set_param command "$PROG" -B
+       load_uci_config
+       procd_close_instance
+}
diff --git a/multimedia/xupnpd/Makefile b/multimedia/xupnpd/Makefile
new file mode 100644 (file)
index 0000000..a533a07
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# Copyright (C) 2013-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:=xupnpd
+PKG_REV:=5c08c051caa0062cc1c401b2d26d1f36dffe9c55
+PKG_VERSION:=2016-07-06
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+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_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+LUA_FLAGS:=-llua
+
+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)
+endef
+
+define Package/xupnpd
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  DEPENDS:=+liblua
+  TITLE:=eXtensible UPnP agent
+  URL:=http://xupnpd.org/
+endef
+
+define Package/xupnpd/conffiles
+/usr/share/xupnpd/xupnpd.lua
+/usr/share/xupnpd/config
+/usr/share/xupnpd/playlists
+endef
+
+define Package/xupnpd/description
+xupnpd - eXtensible UPnP agent
+This program is a light DLNA Media Server which provides ContentDirectory:1 service for sharing IPTV unicast streams over local area network (with udpxy for multicast to HTTP unicast conversion).
+The program shares UTF8-encoded M3U playlists with links over local area network as content of the directory.
+You can watch HDTV broadcasts (multicast or unicast) and listen Internet Radio in IP network without transcoding and PC.
+endef
+
+define Package/xupnpd/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xupnpd $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/xupnpd.init $(1)/etc/init.d/xupnpd
+       $(INSTALL_DIR) $(1)/usr/share/xupnpd
+       $(CP) $(PKG_BUILD_DIR)/src/*.lua $(1)/usr/share/xupnpd
+       $(INSTALL_DIR) $(1)/usr/share/xupnpd/ui
+       $(CP) $(PKG_BUILD_DIR)/src/ui/* $(1)/usr/share/xupnpd/ui
+       $(INSTALL_DIR) $(1)/usr/share/xupnpd/www
+       $(CP) $(PKG_BUILD_DIR)/src/www/* $(1)/usr/share/xupnpd/www
+       $(INSTALL_DIR) $(1)/usr/share/xupnpd/playlists
+       $(INSTALL_DIR) $(1)/usr/share/xupnpd/plugins
+       $(CP) $(PKG_BUILD_DIR)/src/plugins/* $(1)/usr/share/xupnpd/plugins
+       $(INSTALL_DIR) $(1)/usr/share/xupnpd/config
+       $(INSTALL_DIR) $(1)/etc/xupnpd
+       (cd $(1)/etc/xupnpd; ln -s ../../usr/share/xupnpd/config ./; ln -s ../../usr/share/xupnpd/xupnpd.lua ./)
+       $(INSTALL_DIR) $(1)/usr/share/xupnpd/localmedia
+endef
+
+$(eval $(call BuildPackage,xupnpd))
diff --git a/multimedia/xupnpd/files/xupnpd.init b/multimedia/xupnpd/files/xupnpd.init
new file mode 100644 (file)
index 0000000..29c458a
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2013-2014 OpenWrt.org
+
+START=50
+USE_PROCD=1
+
+start_service() {
+       procd_open_instance
+
+       procd_set_param command /usr/bin/xupnpd
+       procd_append_param command -d /usr/share/xupnpd
+
+       procd_set_param respawn
+       procd_close_instance
+}
diff --git a/multimedia/xupnpd/patches/100-default_config.patch b/multimedia/xupnpd/patches/100-default_config.patch
new file mode 100644 (file)
index 0000000..dee21a9
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/src/xupnpd.lua
++++ b/src/xupnpd.lua
+@@ -1,10 +1,10 @@
+ cfg={}
+ -- multicast interface for SSDP exchange, 'eth0', 'br0', 'br-lan' for example
+-cfg.ssdp_interface='lo'
++cfg.ssdp_interface='br-lan'
+ -- 'cfg.ssdp_loop' enables multicast loop (if player and server in one host)
+-cfg.ssdp_loop=1
++cfg.ssdp_loop=0
+ -- SSDP announcement interval
+ cfg.ssdp_notify_interval=15
diff --git a/multimedia/xupnpd/patches/101-root_dir_param.patch b/multimedia/xupnpd/patches/101-root_dir_param.patch
new file mode 100644 (file)
index 0000000..4dac9d9
--- /dev/null
@@ -0,0 +1,83 @@
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -4,11 +4,14 @@
+  * https://tsdemuxer.googlecode.com/svn/trunk/xupnpd
+  */
++#include <ctype.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <sys/stat.h>
++#include <sys/types.h>
+ #include "luacompat.h"
+ #include "luaxlib.h"
+ #include "luaxcore.h"
+@@ -16,35 +19,36 @@
+ int main(int argc,char** argv)
+ {
+-    const char* p=strrchr(argv[0],'/');
+-
+-    int rc;
+-
+-    if(p)
+-    {
+-        char location[512];
+-        int n=p-argv[0];
+-        if(n>=sizeof(location))
+-            n=sizeof(location)-1;
+-        strncpy(location,argv[0],n);
+-        location[n]=0;
+-
+-        rc=chdir(location);
+-
+-        argv[0]=(char*)p+1;
+-    }
+-
+-    const char* root=getenv("XUPNPDROOTDIR");
+-    if(root && *root)
+-        rc=chdir(root);
+-
+-    {
+-        FILE* fp=fopen("xupnpd.lua","r");
+-        if(fp)
+-            fclose(fp);
+-        else
+-            rc=chdir("/usr/share/xupnpd/");
+-    }
++      int c;
++      char *xupnpd_root = "/usr/share/xupnpd/";
++      struct stat s;
++
++      opterr = 0;
++      while ((c = getopt (argc, argv, "d:")) != -1) {
++              switch (c) {
++                      case 'd':
++                              xupnpd_root = optarg;
++                              break;
++                      case '?':
++                              if (optopt == 'd')
++                                      fprintf(stderr, "Option -%c requires an argument.\n", optopt);
++                              else if (isprint(optopt))
++                                      fprintf(stderr, "Unknown option \"-%c\".\n", optopt);
++                              else
++                                      fprintf(stderr, "Unknown option\n");
++                                      return 1;
++                      default:
++                              abort();
++              }
++      }
++
++      if(stat(xupnpd_root, &s) != -1 && S_ISDIR(s.st_mode)) {
++              c = chdir(xupnpd_root);
++      }
++      else {
++              fprintf(stderr, "Directory %s doesn't exist.\n", xupnpd_root);
++              return 1;
++      }
+     lua_State* L=lua_open();
+     if(L)
diff --git a/multimedia/youtube-dl/Makefile b/multimedia/youtube-dl/Makefile
new file mode 100644 (file)
index 0000000..a510a7e
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# 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:=youtube-dl
+PKG_VERSION:=2016.11.27
+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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+PKG_LICENSE:=Unlicense
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Adrian Panella <ianchi74@outlook.com>
+
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/youtube-dl
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  TITLE:=utility to download videos from YouTube.com
+  DEPENDS:=+python-openssl +python-email +python-xml +python-codecs +python-ctypes +ca-certificates
+  URL:=https://youtube-dl.org
+endef
+
+define Package/youtube-dl/description
+  youtube-dl is a small command-line program to download videos 
+  from YouTube.com and a few more sites. 
+  It requires the Python interpreter.
+endef
+
+define Package/youtube-dl/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/youtube-dl $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,youtube-dl))
diff --git a/net/apache/Makefile b/net/apache/Makefile
new file mode 100644 (file)
index 0000000..d436bd3
--- /dev/null
@@ -0,0 +1,173 @@
+#
+# Copyright (C) 2007-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:=apache
+PKG_VERSION:=2.4.25
+PKG_RELEASE:=1
+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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/apache/Default
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Web Servers/Proxies
+  TITLE:=The Apache Web Server
+  URL:=http://httpd.apache.org/
+endef
+
+define Package/apache/Default/description
+ The Apache Web Server is a powerful and flexible HTTP/1.1 compliant
+ web server.  Originally designed as a replacement for the NCSA HTTP
+ Server, it has grown to be the most popular web server on the Internet.
+endef
+
+define Package/apache
+$(call Package/apache/Default)
+  DEPENDS:=+libapr +libaprutil +libpcre +libopenssl +unixodbc 
+endef
+
+define Package/apache/description
+$(call Package/apache/Default/description)
+ .
+ This package contains the Apache web server and utility programs.
+ .
+ Take care that you don't include apache at the moment into your image
+ please select it only as module because busybox will override
+ /usr/sbin/httpd. It'll be solved soon. If you need to include this
+ package in the image anyway, remove httpd from busybox
+ (Base system --> Configuration --> Networking Utilities --> httpd).
+ Also you should take care for the initscripts, apache's httpd isn't
+ compatible with the one from busybox, so if you want to use apache
+ for running your webif, you'll need to change the parameters in the
+ scripts and configure the rest in /etc/httpd.conf.
+endef
+
+define Package/apache/conffiles
+/etc/apache/httpd.conf
+/etc/apache/extra/httpd-autoindex.conf
+/etc/apache/extra/httpd-dav.conf
+/etc/apache/extra/httpd-default.conf
+/etc/apache/extra/httpd-info.conf
+/etc/apache/extra/httpd-languages.conf
+/etc/apache/extra/httpd-manual.conf
+/etc/apache/extra/httpd-mpm.conf
+/etc/apache/extra/httpd-multilang-errordoc.conf
+/etc/apache/extra/httpd-ssl.conf
+/etc/apache/extra/httpd-userdir.conf
+/etc/apache/extra/httpd-vhosts.conf
+/etc/apache/magic
+/etc/apache/mime.types
+endef
+
+define Package/apache-icons
+$(call Package/apache/Default)
+  TITLE:=Icons from Apache
+  DEPENDS:=apache
+endef
+
+define Package/apache-icons/description
+$(call Package/apache/Default/description)
+ .
+ This package contains the icons from Apache.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
+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" \
+               --enable-http \
+               --with-crypto \
+               --with-sqlit3="$(STAGING_DIR)/usr" \
+               --with-openssl="$(STAGING_DIR)/usr" \
+               --enable-ssl \
+               --enable-proxy \
+               --disable-disk-cache \
+               --enable-maintainer-mode \
+               --with-mpm=prefork \
+               --with-mpm=worker \
+               --enable-mime-magic \
+               --without-suexec-bin \
+               --sysconfdir=/etc/apache \
+               ap_cv_void_ptr_lt_long=no \
+               logfiledir="/var/log" \
+               runtimedir="/var/run" \
+               EXTRA_LIBS="-ldl -lpthread -lcrypto -lrt -lssl" \
+       )
+endef
+
+define Build/InstallDev
+       rm -rf  $(PKG_INSTALL_DIR)/usr/man/ \
+               $(PKG_INSTALL_DIR)/usr/share/manual/
+       # if you need docs take a look into the build-dir :)
+       $(INSTALL_DIR) $(1)/etc
+       $(CP)   $(PKG_INSTALL_DIR)/etc/* \
+               $(1)/etc
+       $(INSTALL_DIR) $(1)/usr/include/apache
+       $(CP)   $(PKG_INSTALL_DIR)/usr/include/* \
+               $(1)/usr/include/apache
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
+               $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP)   $(PKG_INSTALL_DIR)/usr/sbin/* \
+               $(1)/usr/sbin
+       $(INSTALL_DIR) $(1)/usr/share
+       $(CP)   $(PKG_INSTALL_DIR)/usr/share/* \
+               $(1)/usr/share
+endef
+
+define Package/apache/preinst
+       rm /usr/sbin/httpd
+       echo -e "You should take a look in the initscripts, busybox's httpd \n\
+       uses some parameters which are maybe unsupported by apache."
+endef
+
+define Package/apache/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       # we don't need apxs on the router, it's just for building apache modules.
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{ab,dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,checkgid,envvars,envvars-std,htcacheclean,httpd,rotatelogs} $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/share
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} $(1)/usr/share/
+       $(INSTALL_DIR) $(1)/etc/apache
+       $(CP) $(PKG_INSTALL_DIR)/etc/apache/{httpd.conf,magic,mime.types,extra} $(1)/etc/apache/
+endef
+
+define Package/apache/postrm
+       rm -rf /usr/sbin/httpd
+       ln -s /bin/busybox /usr/sbin/httpd
+       echo -e "You may need to change your initscripts back for the use \n\
+               with busybox's httpd."
+endef
+
+define Package/apache-icons/install
+       $(INSTALL_DIR) $(1)/usr/share
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
+endef
+
+$(eval $(call BuildPackage,apache))
+$(eval $(call BuildPackage,apache-icons))
diff --git a/net/apache/patches/001-Makefile_in.patch b/net/apache/patches/001-Makefile_in.patch
new file mode 100644 (file)
index 0000000..0bccfd3
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/server/Makefile.in
++++ b/server/Makefile.in
+@@ -26,7 +26,10 @@ gen_test_char: $(gen_test_char_OBJECTS)
+       $(LINK) $(EXTRA_LDFLAGS) $(gen_test_char_OBJECTS) $(EXTRA_LIBS)
+ test_char.h: gen_test_char
+-      ./gen_test_char > test_char.h
++      true
++#     ./gen_test_char > test_char.h
++#     doesn't matter if you run it on the buildhost or on an wl500gd,
++#     same output on both, so i just patched in the test_char.h :).
+ util.lo: test_char.h
diff --git a/net/apache/patches/002-test_char_h.patch b/net/apache/patches/002-test_char_h.patch
new file mode 100644 (file)
index 0000000..ad07704
--- /dev/null
@@ -0,0 +1,49 @@
+Index: httpd-2.4.25/server/test_char.h
+===================================================================
+--- /dev/null
++++ httpd-2.4.25/server/test_char.h
+@@ -0,0 +1,23 @@
++/* this file is automatically generated by gen_test_char, do not edit */
++#define T_ESCAPE_SHELL_CMD     (1)
++#define T_ESCAPE_PATH_SEGMENT  (2)
++#define T_OS_ESCAPE_PATH       (4)
++#define T_HTTP_TOKEN_STOP      (8)
++#define T_ESCAPE_LOGITEM       (16)
++#define T_ESCAPE_FORENSIC      (32)
++
++static const unsigned char test_char_table[256] = {
++    32,62,62,62,62,62,62,62,62,62,63,62,62,62,62,62,62,62,62,62,
++    62,62,62,62,62,62,62,62,62,62,62,62,14,0,23,6,1,38,1,1,
++    9,9,1,0,8,0,0,10,0,0,0,0,0,0,0,0,0,0,40,15,
++    15,8,15,15,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++    0,0,0,0,0,0,0,0,0,0,0,15,31,15,7,0,7,0,0,0,
++    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++    0,0,0,15,39,15,1,62,54,54,54,54,54,54,54,54,54,54,54,54,
++    54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,
++    54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,
++    54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,
++    54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,
++    54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,
++    54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54
++};
+Index: httpd-2.4.25/server/util.c
+===================================================================
+--- httpd-2.4.25.orig/server/util.c
++++ httpd-2.4.25/server/util.c
+@@ -96,6 +96,16 @@
+ #undef APLOG_MODULE_INDEX
+ #define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
++#define T_ESCAPE_SHELL_CMD    (0x01)
++#define T_ESCAPE_PATH_SEGMENT (0x02)
++#define T_OS_ESCAPE_PATH      (0x04)
++#define T_HTTP_TOKEN_STOP     (0x08)
++#define T_ESCAPE_LOGITEM      (0x10)
++#define T_ESCAPE_FORENSIC     (0x20)
++#define T_ESCAPE_URLENCODED   (0x40)
++#define T_HTTP_CTRLS          (0x80)
++#define T_VCHAR_OBSTEXT      (0x100)
++
+ /*
+  * Examine a field value (such as a media-/content-type) string and return
+  * it sans any parameters; e.g., strip off any ';charset=foo' and the like.
diff --git a/net/apache/patches/003-logdir_fix.patch b/net/apache/patches/003-logdir_fix.patch
new file mode 100644 (file)
index 0000000..fd22410
--- /dev/null
@@ -0,0 +1,37 @@
+Index: httpd-2.4.25/build/mkconfNW.awk
+===================================================================
+--- httpd-2.4.25.orig/build/mkconfNW.awk
++++ httpd-2.4.25/build/mkconfNW.awk
+@@ -23,7 +23,7 @@ BEGIN {
+     A["sysconfdir"] = "conf"
+     A["iconsdir"] = "icons"
+     A["manualdir"] = "manual"
+-    A["runtimedir"] = "logs"
++    A["runtimedir"] = "log"
+     A["errordir"] = "error"
+     A["proxycachedir"] = "proxy"
+Index: httpd-2.4.25/config.layout
+===================================================================
+--- httpd-2.4.25.orig/config.layout
++++ httpd-2.4.25/config.layout
+@@ -28,8 +28,8 @@
+     cgidir:        ${datadir}/cgi-bin
+     includedir:    ${prefix}/include
+     localstatedir: ${prefix}
+-    runtimedir:    ${localstatedir}/logs
+-    logfiledir:    ${localstatedir}/logs
++    runtimedir:    ${localstatedir}/log
++    logfiledir:    ${localstatedir}/log
+     proxycachedir: ${localstatedir}/proxy
+ </Layout>
+@@ -150,7 +150,7 @@
+     includedir:    ${prefix}/include
+     localstatedir: /var${prefix}
+     runtimedir:    ${localstatedir}/run
+-    logfiledir:    ${localstatedir}/logs
++    logfiledir:    ${localstatedir}/log
+     proxycachedir: ${localstatedir}/proxy
+ </Layout>
diff --git a/net/apache/patches/004-pidfile_fix.patch b/net/apache/patches/004-pidfile_fix.patch
new file mode 100644 (file)
index 0000000..647f821
--- /dev/null
@@ -0,0 +1,13 @@
+Index: httpd-2.4.25/include/scoreboard.h
+===================================================================
+--- httpd-2.4.25.orig/include/scoreboard.h
++++ httpd-2.4.25/include/scoreboard.h
+@@ -40,7 +40,7 @@ extern "C" {
+ /* Scoreboard file, if there is one */
+ #ifndef DEFAULT_SCOREBOARD
+-#define DEFAULT_SCOREBOARD "logs/apache_runtime_status"
++#define DEFAULT_SCOREBOARD "log/apache_runtime_status"
+ #endif
+ /* Scoreboard info on a process is, for now, kept very brief ---
diff --git a/net/apache/patches/005-httpd_conf.patch b/net/apache/patches/005-httpd_conf.patch
new file mode 100644 (file)
index 0000000..04a73a9
--- /dev/null
@@ -0,0 +1,63 @@
+Index: httpd-2.4.25/docs/conf/httpd.conf.in
+===================================================================
+--- httpd-2.4.25.orig/docs/conf/httpd.conf.in
++++ httpd-2.4.25/docs/conf/httpd.conf.in
+@@ -63,7 +63,6 @@ Listen @@Port@@
+ # Example:
+ # LoadModule foo_module modules/mod_foo.so
+ #
+-@@LoadModule@@
+ <IfModule unixd_module>
+ #
+@@ -74,8 +73,8 @@ Listen @@Port@@
+ # It is usually good practice to create a dedicated user and group for
+ # running httpd, as with most system services.
+ #
+-User daemon
+-Group daemon
++User nobody
++Group nogroup
+ </IfModule>
+@@ -188,7 +187,7 @@ ErrorLog "@rel_logfiledir@/error_log"
+ # Possible values include: debug, info, notice, warn, error, crit,
+ # alert, emerg.
+ #
+-LogLevel warn
++LogLevel debug
+ <IfModule log_config_module>
+     #
+@@ -330,7 +329,7 @@ LogLevel warn
+ # contents of the file itself to determine its type.  The MIMEMagicFile
+ # directive tells the module where the hint definitions are located.
+ #
+-#MIMEMagicFile @rel_sysconfdir@/magic
++MIMEMagicFile @rel_sysconfdir@/magic
+ #
+ # Customizable error responses come in three flavors:
+@@ -360,7 +359,7 @@ LogLevel warn
+ # Defaults: EnableMMAP On, EnableSendfile Off
+ #
+ #EnableMMAP off
+-#EnableSendfile on
++EnableSendfile off
+ # Supplemental configuration
+ #
+@@ -411,8 +410,8 @@ Include @rel_sysconfdir@/extra/proxy-htm
+ #       starting without SSL on platforms with no /dev/random equivalent
+ #       but a statically compiled-in mod_ssl.
+ #
+-<IfModule ssl_module>
+-SSLRandomSeed startup builtin
+-SSLRandomSeed connect builtin
+-</IfModule>
++#<IfModule ssl_module>
++#SSLRandomSeed startup builtin
++#SSLRandomSeed connect builtin
++#</IfModule>
diff --git a/net/bmon/Makefile b/net/bmon/Makefile
new file mode 100644 (file)
index 0000000..a8c08fb
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+# Copyright (C) 2014-2016 Baptiste Jonglez
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bmon
+PKG_VERSION:=4.0
+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_MAINTAINER:=Baptiste Jonglez <openwrt-pkg@bitsofnetworks.org>
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/bmon
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+libncursesw +libnl-core +libnl-route +confuse +terminfo
+  TITLE:=bmon is a portable bandwidth monitor
+  URL:=https://github.com/tgraf/bmon/
+endef
+
+define Package/bmon/description
+       bmon is a portable bandwidth monitor
+       and rate estimator running on various
+       operating systems. It supports various
+       input methods for different architectures.
+endef
+
+CONFIGURE_ARGS += \
+       --disable-cnt-workaround \
+
+CONFIGURE_VARS += \
+       ac_cv_lib_nl_nl_connect=no \
+
+# Needed to compile some objects
+TARGET_CFLAGS+= -std=gnu99
+
+define Package/bmon/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bmon $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,bmon))
diff --git a/net/daemonlogger/Makefile b/net/daemonlogger/Makefile
new file mode 100644 (file)
index 0000000..41853f2
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007-2011 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:=daemonlogger
+PKG_VERSION:=1.2.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/daemonlogger
+PKG_MD5SUM:=acb64aa6cd5777e297569f100b5c39ee
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/daemonlogger
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+libpcap +libdnet
+  TITLE:=Software Network Tap
+  URL:=http://www.snort.org/snort-downloads/additional-downloads
+endef
+
+CONFIGURE_VARS += \
+       BUILD_CC="$(TARGET_CC)" \
+       HOSTCC="$(HOSTCC)"
+
+MAKE_FLAGS := CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)"
+
+define Package/daemonlogger/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/daemonlogger $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,daemonlogger))
diff --git a/net/davfs2/Makefile b/net/davfs2/Makefile
new file mode 100644 (file)
index 0000000..4e1f092
--- /dev/null
@@ -0,0 +1,71 @@
+#
+# 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:=davfs2
+PKG_VERSION:=1.5.4
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/davfs2/
+PKG_MD5SUM:=c9f0b557275b7ec88fec751bf22f30cf
+
+PKG_FIXUP:=gettext-version autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/davfs2
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Filesystem
+  DEPENDS=+libneon +kmod-fuse +libfuse
+  TITLE:=Mount a WebDAV resource as a regular file system.
+  URL:=http://savannah.nongnu.org/projects/davfs2/
+  MAINTAINER:=Federico Di Marco <fededim@gmail.com>
+endef
+
+define Package/davfs2/description
+ Web Distributed Authoring and Versioning (WebDAV), an extension to the HTTP-protocol,
+ allows authoring of resources on a remote web server.davfs2 provides the ability to
+ access such resources like a typical filesystem, allowing for use by standard
+ applications with no built-in support for WebDAV.
+
+ davfs2 is designed to fully integrate into the filesystem semantics of Unix-like
+ systems (mount, umount, etc.). davfs2 makes mounting by unprivileged users as easy
+ and secure as possible.
+
+ davfs2 does extensive caching to make the file system responsive, to avoid
+ unnecessary network traffic and to prevent data loss, and to cope for slow or
+ unreliable connections.
+
+ davfs2 will work with most WebDAV servers needing little or no configuration.
+endef
+
+define Package/davfs2/conffiles
+/etc/davfs2/davfs2.conf
+endef
+
+TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
+
+TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
+
+CONFIGURE_VARS += \
+       LDFLAGS="$(TARGET_LDFLAGS) -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib"
+
+CONFIGURE_ARGS += --with-neon="$(STAGING_DIR)/usr"
+
+define Package/davfs2/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mount.davfs $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/umount.davfs $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DIR) $(1)/etc/davfs2
+       $(INSTALL_DATA) files/$(PKG_NAME).conf $(1)/etc/davfs2
+endef
+
+$(eval $(call BuildPackage,davfs2))
diff --git a/net/davfs2/files/davfs2.conf b/net/davfs2/files/davfs2.conf
new file mode 100644 (file)
index 0000000..4cf501b
--- /dev/null
@@ -0,0 +1,9 @@
+#
+# davfs2 configuration file
+# please see http://linux.die.net/man/5/davfs2.conf for details
+#
+
+dav_user nobody
+dav_group nogroup
+cache_dir /tmp/davfs2
+cache_size 4
diff --git a/net/davfs2/patches/010-main_code_fix.patch b/net/davfs2/patches/010-main_code_fix.patch
new file mode 100644 (file)
index 0000000..d91336d
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -58,7 +58,7 @@
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+-#include <sys/xattr.h>
++#include <linux/xattr.h>
+ #include <ne_alloc.h>
+ #include <ne_string.h>
+--- a/src/webdav.c
++++ b/src/webdav.c
+@@ -2033,7 +2033,7 @@ ssl_verify(void *userdata, int failures,
+             len = getline(&s, &n, stdin);
+             if (len < 0)
+                 abort();
+-            if (rpmatch(s) > 0)
++            if ((s[0]=='y' || s[0]=='Y') > 0)
+                 ret = 0;
+             free(s);
+     } 
diff --git a/net/davfs2/patches/100-musl-compat.patch b/net/davfs2/patches/100-musl-compat.patch
new file mode 100644 (file)
index 0000000..e819cbc
--- /dev/null
@@ -0,0 +1,194 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -42,7 +42,7 @@ DAV_CHECK_NEON
+ # Checks for header files.
+ AC_HEADER_DIRENT
+ AC_HEADER_STDC
+-AC_CHECK_HEADERS([fcntl.h libintl.h langinfo.h limits.h locale.h mntent.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/mount.h sys/time.h syslog.h termios.h unistd.h utime.h])
++AC_CHECK_HEADERS([error.h fcntl.h libintl.h langinfo.h limits.h locale.h mntent.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/mount.h sys/time.h sys/select.h sys/types.h syslog.h termios.h unistd.h utime.h])
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+@@ -78,7 +78,7 @@ AC_FUNC_SELECT_ARGTYPES
+ AC_FUNC_STRFTIME
+ AC_FUNC_STAT
+ AC_FUNC_UTIME_NULL
+-AC_CHECK_FUNCS([endpwent ftruncate getmntent memset mkdir nl_langinfo rpmatch select setlocale strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol strtoull utime])
++AC_CHECK_FUNCS([endpwent ftruncate getmntent memset mkdir nl_langinfo rpmatch select setlocale strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol strtoull utime canonicalize_file_name fopencookie])
+ # Misc.
+ DAV_DEFAULTS
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -19,12 +19,12 @@
+ #include "config.h"
++#include "compat.h"
+ #ifdef HAVE_DIRENT_H
+ #include <dirent.h>
+ #endif
+ #include <errno.h>
+-#include <error.h>
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+--- a/src/dav_fuse.c
++++ b/src/dav_fuse.c
+@@ -47,6 +47,9 @@
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
++#ifdef HAVE_SYS_SELECT_H
++#include <sys/select.h>
++#endif
+ #include "defaults.h"
+ #include "mount_davfs.h"
+--- a/src/kernel_interface.c
++++ b/src/kernel_interface.c
+@@ -19,8 +19,8 @@
+ #include "config.h"
++#include "compat.h"
+-#include <error.h>
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+@@ -51,6 +51,9 @@
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
++#ifdef HAVE_SYS_TYPES_H
++#include <sys/types.h>
++#endif
+ #include <sys/wait.h>
+ #include "defaults.h"
+--- a/src/mount_davfs.c
++++ b/src/mount_davfs.c
+@@ -19,10 +19,10 @@
+ #include "config.h"
++#include "compat.h"
+ #include <ctype.h>
+ #include <errno.h>
+-#include <error.h>
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+--- a/src/umount_davfs.c
++++ b/src/umount_davfs.c
+@@ -19,8 +19,8 @@
+ #include "config.h"
++#include "compat.h"
+-#include <error.h>
+ #include <errno.h>
+ #include <getopt.h>
+ #ifdef HAVE_LIBINTL_H
+--- a/src/webdav.c
++++ b/src/webdav.c
+@@ -19,9 +19,9 @@
+ #include "config.h"
++#include "compat.h"
+ #include <errno.h>
+-#include <error.h>
+ #ifdef HAVE_FCNTL_H
+ #include <fcntl.h>
+ #endif
+@@ -368,6 +368,7 @@ dav_init_webdav(const dav_args *args)
+         error(EXIT_FAILURE, errno, _("socket library initialization failed"));
+     if (args->neon_debug & ~NE_DBG_HTTPPLAIN) {
++#ifdef HAVE_FOPENCOOKIE
+         char *buf = malloc(log_bufsize);
+         cookie_io_functions_t *log_func = malloc(sizeof(cookie_io_functions_t));
+         if (!log_func) abort();
+@@ -380,6 +381,9 @@ dav_init_webdav(const dav_args *args)
+             error(EXIT_FAILURE, errno,
+                   _("can't open stream to log neon-messages"));
+         ne_debug_init(log_stream, args->neon_debug);
++#else
++      error(EXIT_FAILURE, 0, "neon debugging unsupported");
++#endif
+     }
+     session = ne_session_create(args->scheme, args->host, args->port);
+--- /dev/null
++++ b/src/compat.h
+@@ -0,0 +1,64 @@
++#ifndef _COMPAT_H
++#define _COMPAT_H
++
++#ifndef _PATH_MOUNTED
++# define _PATH_MOUNTED "/proc/mounts"
++#endif
++
++#ifndef _PATH_MNTTAB
++# define _PATH_MNTTAB "/etc/fstab"
++#endif
++
++#ifdef HAVE_ERROR_H
++# include <error.h>
++#else
++# include <stdio.h>
++# include <stdarg.h>
++# include <stdlib.h>
++# include <string.h>
++static void error_at_line(int status, int errnum, const char *filename,
++                          unsigned int linenum, const char *format, ...)
++{
++      va_list ap;
++
++      fflush(stdout);
++
++      if (filename != NULL)
++              fprintf(stderr, "%s:%u: ", filename, linenum);
++
++      va_start(ap, format);
++      vfprintf(stderr, format, ap);
++      va_end(ap);
++
++      if (errnum != 0)
++              fprintf(stderr, ": %s", strerror(errnum));
++
++      fprintf(stderr, "\n");
++
++      if (status != 0)
++              exit(status);
++}
++
++#define error(status, errnum, format...) \
++      error_at_line(status, errnum, NULL, 0, format)
++
++#endif /* HAVE_ERROR_H */
++
++#ifndef HAVE_CANONICALIZE_FILE_NAME
++#include <limits.h>
++#include <string.h>
++#include <stdlib.h>
++static char * canonicalize_file_name(const char *path)
++{
++      char buf[PATH_MAX] = { };
++
++      snprintf(buf, sizeof(buf) - 1, "%s", path);
++
++      if (!realpath(path, buf))
++              return NULL;
++
++      return strdup(buf);
++}
++#endif
++
++#endif /* _COMPAT_H */
diff --git a/net/davfs2/patches/200-davfs2-1.5.4-no-forced-stack-protector.patch b/net/davfs2/patches/200-davfs2-1.5.4-no-forced-stack-protector.patch
new file mode 100644 (file)
index 0000000..f581e05
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -32,8 +32,7 @@ mount_davfs_SOURCES = cache.c dav_coda.c
+         kernel_interface.h mount_davfs.h webdav.h
+ umount_davfs_SOURCES = umount_davfs.c defaults.h
+-AM_CFLAGS = -Wall -Werror=format-security \
+-        -fstack-protector-strong --param=ssp-buffer-size=4
++AM_CFLAGS = -Wall -Werror=format-security
+ DEFS = -DPROGRAM_NAME=\"mount.davfs\" \
+        -DDAV_SYS_CONF_DIR=\"$(pkgsysconfdir)\" \
+        -DDAV_LOCALSTATE_DIR=\"$(dav_localstatedir)\" \
diff --git a/net/iotivity/Makefile b/net/iotivity/Makefile
new file mode 100644 (file)
index 0000000..e1491f7
--- /dev/null
@@ -0,0 +1,311 @@
+#
+# 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:=iotivity
+PKG_VERSION:=1.2.1
+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_USE_MIPS16:=0
+
+PKG_BUILD_DEPENDS:=boost
+
+PKG_MAINTAINER:=Hauke Mehrtens <hauke.mehrtens@intel.com>
+
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=LICENSE.md
+
+PKG_CONFIG_DEPENDS := \
+       CONFIG_PACKAGE_iotivity \
+       CONFIG_PACKAGE_iotivity-cpp \
+       CONFIG_PACKAGE_iotivity-resource-directory-lib \
+       CONFIG_PACKAGE_iotivity-oic-middle \
+       CONFIG_PACKAGE_iotivity-resource-container-lib \
+       CONFIG_PACKAGE_iotivity-resource-container-sample \
+       CONFIG_PACKAGE_iotivity-resource-container-hue \
+       CONFIG_PACKAGE_iotivity-example-garage \
+       CONFIG_PACKAGE_iotivity-example-simple \
+       CONFIG_PACKAGE_iotivity_DEBUG \
+       CONFIG_PACKAGE_iotivity_SECURE
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/scons.mk
+
+
+define Package/iotivity
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=@!USE_UCLIBC +libpthread +librt +libuuid +libsqlite3 +PACKAGE_iotivity_SECURE:libmbedtls
+  TITLE:=IoTivity C Library
+  URL:=https://www.iotivity.org
+  MENU:=1
+endef
+
+define Package/iotivity/description
+    IoTivity is a framework for the Internet of Things based on the
+    Open Interconnect Consortium Specification.
+endef
+
+define Package/iotivity/config
+  if PACKAGE_iotivity
+       config PACKAGE_iotivity_DEBUG
+               bool "IoTivity with debug support"
+               help
+                 Build IoTivity with debuging support.
+
+       config PACKAGE_iotivity_SECURE
+               bool "IoTivity with security support"
+               help
+                 Activate security support.
+
+       config PACKAGE_iotivity_LOGGING
+               bool "IoTivity with logging support"
+               default y
+               help
+                 Activate logging support.
+                 This will make IoTivity write a lot of log messages to stdout.
+  endif
+endef
+
+
+define Package/iotivity-cpp
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+iotivity +libpthread +libstdcpp
+  TITLE:=IoTivity C++ Library
+  URL:=https://www.iotivity.org
+endef
+
+define Package/iotivity-cpp/description
+    IoTivity is a framework for the Internet of Things based on the
+    Open Interconnect Consortium Specification.
+endef
+
+define Package/iotivity-resource-directory-lib
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+iotivity +iotivity-cpp
+  TITLE:=IoTivity Resource Directory library
+  URL:=https://www.iotivity.org
+endef
+
+
+define Package/iotivity-oic-middle
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+iotivity +iotivity-cpp +iotivity-resource-directory-lib
+  TITLE:=IoTivity OIC Middle
+  URL:=https://www.iotivity.org
+endef
+
+define Package/iotivity-oic-middle/description
+    IoTivity OIC Middle
+endef
+
+define Package/iotivity-resource-container-lib
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+iotivity +iotivity-cpp +boost +boost-system +boost-thread +boost-date_time
+  TITLE:=IoTivity Resource Container library
+  URL:=https://www.iotivity.org
+endef
+
+define Package/iotivity-resource-container-sample
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+iotivity +iotivity-resource-container-lib
+  TITLE:=IoTivity Resource Container sample Application
+  URL:=https://www.iotivity.org
+endef
+
+define Package/iotivity-resource-container-hue
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+iotivity +iotivity-resource-container-lib +libcurl
+  TITLE:=IoTivity Resource Container Hue Bundle
+  URL:=https://www.iotivity.org
+endef
+
+define Package/iotivity-example-garage
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+iotivity +iotivity-cpp +iotivity-resource-directory-lib
+  TITLE:=IoTivity Garage example
+  URL:=https://www.iotivity.org
+endef
+
+define Package/iotivity-example-garage/description
+    An IoTivity example application
+endef
+
+define Package/iotivity-example-simple
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+iotivity +iotivity-cpp +iotivity-resource-directory-lib
+  TITLE:=IoTivity simple client + server
+  URL:=https://www.iotivity.org
+endef
+
+define Package/iotivity-example-simple/description
+    The IoTivity simple client and simple server exmaple
+endef
+
+
+PKG_TINYCBOR_NAME:=tinycbor
+PKG_TINYCBOR_PROTO:=git
+PKG_TINYCBOR_VERSION:=0.4
+PKG_TINYCBOR_SOURCE_VERSION:=a088996aa5f59b4f27f20fadad053d88bee357d4
+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)
+
+define Download/iotivity-tinycbor
+  FILE:=$(PKG_TINYCBOR_SOURCE)
+  URL:=$(PKG_TINYCBOR_SOURCE_URL)
+  PROTO:=$(PKG_TINYCBOR_PROTO)
+  VERSION:=$(PKG_TINYCBOR_SOURCE_VERSION)
+  SUBDIR:=$(PKG_TINYCBOR_SUBDIR)
+endef
+$(eval $(call Download,iotivity-tinycbor))
+
+
+EXTRA_CXXFLAGS += -std=gnu++11
+
+SCONS_OPTIONS += \
+       TARGET_OS=linux \
+       TARGET_TRANSPORT=IP \
+       TARGET_ARCH=$(ARCH) \
+       STAGING_DIR=$(STAGING_DIR) \
+       WITH_ENV=true \
+       octbstack oc \
+       $(if $(CONFIG_PACKAGE_iotivity-oic-middle),examples) \
+       $(if $(CONFIG_PACKAGE_iotivity-resource-container-lib),libResContainer) \
+       $(if $(CONFIG_PACKAGE_iotivity-resource-container-sample),containersample) \
+       $(if $(CONFIG_PACKAGE_iotivity-resource-container-hue),libHueBundle) \
+       $(if $(CONFIG_PACKAGE_iotivity-example-garage),examples) \
+       $(if $(CONFIG_PACKAGE_iotivity-example-simple),examples) \
+       install
+
+ifeq ($(CONFIG_PACKAGE_iotivity_DEBUG),y)
+  SCONS_OPTIONS += RELEASE=false
+  APP_OPTIM:=debug
+else
+  SCONS_OPTIONS += RELEASE=true
+  APP_OPTIM:=release
+endif
+
+ifeq ($(CONFIG_PACKAGE_iotivity_SECURE),y)
+  SCONS_OPTIONS += SECURED=1
+else
+  SCONS_OPTIONS += SECURED=0
+endif
+
+ifeq ($(CONFIG_PACKAGE_iotivity_LOGGING),y)
+  SCONS_OPTIONS += LOGGING=true
+endif
+
+ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
+  SCONS_OPTIONS += VERBOSE=true
+endif
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       $(TAR) -C $(PKG_BUILD_DIR)/extlibs/tinycbor/ -xjf $(DL_DIR)/$(PKG_TINYCBOR_SOURCE)
+endef
+
+
+define Build/Configure
+       (cd $(PKG_BUILD_DIR); \
+               $(SCONS_VARS) \
+               scons \
+                       $(SCONS_OPTIONS) \
+       )
+endef
+
+
+define Package/iotivity/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libconnectivity_abstraction.so $(1)/usr/lib/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboctbstack.so $(1)/usr/lib/
+ifeq ($(CONFIG_PACKAGE_iotivity_SECURE),y)
+       $(INSTALL_DIR) $(1)/etc/iotivity/
+       $(INSTALL_DATA) ./files/etc/iotivity/oic_svr_db.cbor $(1)/etc/iotivity/
+endif
+endef
+
+define Package/iotivity-cpp/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc.so $(1)/usr/lib/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc_logger.so $(1)/usr/lib/
+endef
+
+define Package/iotivity-resource-directory-lib/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libresource_directory.so $(1)/usr/lib/
+endef
+
+define Package/iotivity-oic-middle/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/examples/OICMiddle/OICMiddle $(1)/usr/bin/
+endef
+
+define Package/iotivity-resource-container-lib/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_common.so $(1)/usr/lib/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_client.so $(1)/usr/lib/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_server.so $(1)/usr/lib/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_container.so $(1)/usr/lib/
+endef
+
+define Package/iotivity-resource-container-sample/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/resource-container/ContainerSample  $(1)/usr/bin/
+endef
+
+define Package/iotivity-resource-container-hue/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libHueBundle.so $(1)/usr/lib/
+endef
+
+define Package/iotivity-example-garage/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/garageclient $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/garageserver $(1)/usr/bin/
+endef
+
+define Package/iotivity-example-simple/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/simpleclient $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/simpleserver $(1)/usr/bin/
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/include $(1)/usr/include/iotivity
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libconnectivity_abstraction.so $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboctbstack.so $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc.so $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc_logger.so $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libresource_directory.so $(1)/usr/lib/
+endef
+       
+
+$(eval $(call BuildPackage,iotivity))
+$(eval $(call BuildPackage,iotivity-cpp))
+$(eval $(call BuildPackage,iotivity-resource-directory-lib))
+$(eval $(call BuildPackage,iotivity-oic-middle))
+$(eval $(call BuildPackage,iotivity-resource-container-lib))
+$(eval $(call BuildPackage,iotivity-resource-container-sample))
+$(eval $(call BuildPackage,iotivity-resource-container-hue))
+$(eval $(call BuildPackage,iotivity-example-garage))
+$(eval $(call BuildPackage,iotivity-example-simple))
diff --git a/net/iotivity/files/etc/iotivity/ReadMe.txt b/net/iotivity/files/etc/iotivity/ReadMe.txt
new file mode 100644 (file)
index 0000000..ae47a5f
--- /dev/null
@@ -0,0 +1,2 @@
+The file oic_svr_db.cbor in generated from the oic_svr_db.json with the
+resource/csdk/security/tool/json2cbor.c tool.
diff --git a/net/iotivity/files/etc/iotivity/oic_svr_db.cbor b/net/iotivity/files/etc/iotivity/oic_svr_db.cbor
new file mode 100644 (file)
index 0000000..c8f19f5
Binary files /dev/null and b/net/iotivity/files/etc/iotivity/oic_svr_db.cbor differ
diff --git a/net/iotivity/files/etc/iotivity/oic_svr_db.json b/net/iotivity/files/etc/iotivity/oic_svr_db.json
new file mode 100644 (file)
index 0000000..2155071
--- /dev/null
@@ -0,0 +1,101 @@
+{
+    "acl": {
+        "aclist": {
+            "aces": [
+                {
+                    "subjectuuid": "*",
+                    "resources": [
+                        {
+                            "href": "/oic/res",
+                            "rel": "",
+                            "rt": ["oic.wk.res"],
+                            "if": ["oic.if.ll"]
+                        },
+                        {
+                            "href": "/oic/d",
+                            "rel": "",
+                            "rt": ["oic.wk.d"],
+                            "if": ["oic.if.baseline", "oic.if.r"]
+                        },
+                        {
+                            "href": "/oic/p",
+                            "rel": "",
+                            "rt": ["oic.wk.p"],
+                            "if": ["oic.if.baseline", "oic.if.r"]
+                        },
+                        {
+                            "href": "/oic/sec/acl",
+                            "rel": "",
+                            "rt": ["oic.r.acl"],
+                            "if": ["oic.if.baseline"]
+                        }
+                    ],
+                    "permission": 2
+                },
+                {
+                    "subjectuuid": "*",
+                    "resources": [
+                        {
+                            "href": "/oic/sec/doxm",
+                            "rel": "",
+                            "rt": ["oic.r.doxm"],
+                            "if": ["oic.if.baseline"]
+                        },
+                        {
+                            "href": "/oic/sec/pstat",
+                            "rel": "",
+                            "rt": ["oic.r.pstat"],
+                            "if": ["oic.if.baseline"]
+                        }
+                    ],
+                    "permission": 2
+                },
+                {
+                    "subjectuuid": "*",
+                    "resources": [
+                        {
+                            "href": "*",
+                            "rel": "",
+                            "rt": ["oic.core"],
+                            "if": ["oic.if.baseline"]
+                        }
+                    ],
+                    "permission": 7
+                }
+            ]
+        },
+        "rowneruuid" : "31313131-3131-3131-3131-313131313131"
+    },
+    "pstat": {
+        "isop": true,
+        "deviceuuid": "31313131-3131-3131-3131-313131313131",
+        "rowneruuid": "31313131-3131-3131-3131-313131313131",
+        "cm": 0,
+        "tm": 0,
+        "om": 4,
+        "sm": 4
+        },
+    "doxm": {
+        "oxms": [0],
+        "oxmsel": 0,
+        "sct": 1,
+        "owned": true,
+        "deviceuuid": "31313131-3131-3131-3131-313131313131",
+        "devowneruuid": "32323232-3232-3232-3232-323232323232",
+        "rowneruuid": "31313131-3131-3131-3131-313131313131"
+    },
+    "cred": {
+        "creds": [
+            {
+                "credid": 1,
+                "subjectuuid": "32323232-3232-3232-3232-323232323232",
+                "credtype": 1,
+                "privatedata": {
+                    "data": "AAAAAAAAAAAAAAAA",
+                    "encoding": "oic.sec.encoding.raw"
+                }
+            }
+        ],
+        "rowneruuid": "31313131-3131-3131-3131-313131313131"
+    }
+}
diff --git a/net/iotivity/patches/001-no_unit_test.patch b/net/iotivity/patches/001-no_unit_test.patch
new file mode 100644 (file)
index 0000000..8a40e73
--- /dev/null
@@ -0,0 +1,141 @@
+--- a/plugins/SConscript
++++ b/plugins/SConscript
+@@ -35,7 +35,7 @@ if target_os not in ['android', 'arduino
+     SConscript(os.path.join('src', 'SConscript'))
+-    SConscript(os.path.join('unittests', 'SConscript'))
++#    SConscript(os.path.join('unittests', 'SConscript'))
+     if build_sample == 'ON':
+           if target_os in ['linux']:
+--- a/resource/SConscript
++++ b/resource/SConscript
+@@ -78,7 +78,7 @@ if target_os in ['linux', 'windows']:
+               SConscript('csdk/stack/samples/linux/secure/SConscript')
+       # Build C/C++ unit tests
+-      SConscript('unit_tests.scons')
++      # SConscript('unit_tests.scons')
+ elif target_os == 'darwin':
+       env.Command('../../out/darwin/iotivity-csdk.framework',None,src_dir + '/tools/darwin/mkfwk_osx.sh')
+--- a/resource/csdk/resource-directory/SConscript
++++ b/resource/csdk/resource-directory/SConscript
+@@ -114,8 +114,3 @@ if 'SERVER' in rd_mode:
+ if target_os in ['linux']:
+     SConscript('samples/SConscript')
+-######################################################################
+-# Build UnitTests of the Resource Directory
+-################################################ ######################
+-if target_os in ['linux']:
+-    SConscript('unittests/SConscript')
+--- a/service/coap-http-proxy/SConscript
++++ b/service/coap-http-proxy/SConscript
+@@ -84,6 +84,3 @@ local_env.UserInstallTargetHeader('inclu
+ ######################################################################
+ if target_os in ['linux', 'tizen']:
+     SConscript('samples/SConscript')
+-
+-if target_os in ['linux']:
+-    SConscript('unittests/SConscript')
+--- a/service/easy-setup/enrollee/SConscript
++++ b/service/easy-setup/enrollee/SConscript
+@@ -123,7 +123,3 @@ if target_os == 'arduino':
+ if target_os in ['linux']:
+       SConscript('../sampleapp/enrollee/linux/SConscript')
+-      #Build UnitTestcases for Enrollee
+-      if enrollee_env.get('SECURED') == '0':
+-              SConscript('../enrollee/unittests/SConscript')
+-
+--- a/service/easy-setup/mediator/richsdk/SConscript
++++ b/service/easy-setup/mediator/richsdk/SConscript
+@@ -163,11 +163,3 @@ if target_os in ['linux']:
+ if target_os in ['android']:
+       SConscript('../../sampleapp/mediator/android/SConscript')
+-
+-######################################################################
+-#Build UnitTestcases for Mediator[RichSDK]
+-################################################ ######################
+-if env.get('SECURED') == '0':
+-   if target_os == 'linux':
+-       SConscript('unittests/SConscript')
+-
+--- a/service/resource-container/SConscript
++++ b/service/resource-container/SConscript
+@@ -223,12 +223,6 @@ else:
+ lib_env = conf2.Finish()
+ ######################################################################
+-# build resource container unit tests
+-######################################################################
+-if target_os in ['linux']:
+-    SConscript('unittests/SConscript')
+-
+-######################################################################
+ # Build Container Sample
+ ######################################################################
+ if target_os not in ['ios']:
+--- a/service/resource-encapsulation/SConscript
++++ b/service/resource-encapsulation/SConscript
+@@ -121,14 +121,5 @@ resourceClient_env.UserInstallTargetHead
+ ######################################################################
+ SConscript('examples/SConscript')
+-######################################################################
+-# Build UnitTests Resource Client , resourceCache and resourceBroker and 
+-# DiscoveryManager
+-################################################ ######################
+-if target_os in ['linux']:
+-    SConscript('unittests/SConscript')
+-    SConscript('src/resourceCache/unittests/SConscript')
+-    SConscript('src/resourceBroker/unittest/SConscript')
+-
+ if target_os == 'android':
+     SConscript('android/SConscript')
+--- a/service/resource-encapsulation/src/common/SConscript
++++ b/service/resource-encapsulation/src/common/SConscript
+@@ -22,10 +22,10 @@
+ # rcs_common (primitiveResource and expiryTimer) build script
+ ##
+ import os
++Import('env')
+ # SConscript file for Local PKI google tests
+-gtest_env = SConscript('#extlibs/gtest/SConscript')
+-lib_env = gtest_env.Clone()
++lib_env = env.Clone()
+ # Add third party libraries
+ SConscript('#service/third_party_libs.scons', exports = 'lib_env')
+--- a/service/resource-encapsulation/src/serverBuilder/SConscript
++++ b/service/resource-encapsulation/src/serverBuilder/SConscript
+@@ -21,9 +21,11 @@
+ ##
+ # rcs_server (Server Builder) project build script
+ ##
++import os
++Import('env')
++
+ # SConscript file for Local PKI google tests
+-gtest_env = SConscript('#extlibs/gtest/SConscript')
+-lib_env = gtest_env.Clone()
++lib_env = env.Clone()
+ # Add third party libraries
+ SConscript('#service/third_party_libs.scons', exports = 'lib_env')
+--- a/service/scene-manager/SConscript
++++ b/service/scene-manager/SConscript
+@@ -100,9 +100,5 @@ scenemanager_env.UserInstallTargetHeader
+ scenemanager_env.UserInstallTargetHeader('include/RemoteScene.h', 'service/scene-manager', 'RemoteScene.h')
+ scenemanager_env.UserInstallTargetHeader('include/RemoteSceneAction.h', 'service/scene-manager', 'RemoteSceneAction.h')
+-# Go to build Unit test
+-if target_os in ['linux']:
+-    SConscript('unittests/SConscript')
+-
+ # Go to build sample apps
+ SConscript('sampleapp/SConscript')
diff --git a/net/iotivity/patches/002-do-not-chck-for-boost.patch b/net/iotivity/patches/002-do-not-chck-for-boost.patch
new file mode 100644 (file)
index 0000000..6be8f84
--- /dev/null
@@ -0,0 +1,29 @@
+From 51e26e002aa043435f94ac0f071066090d5c2de8 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Mon, 22 Jun 2015 20:23:36 +0200
+Subject: [PATCH 5/5] do not chck for boost
+
+Boost is not needed for every package just for some.
+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ service/third_party_libs.scons | 8 --------
+ 1 file changed, 8 deletions(-)
+
+--- a/service/third_party_libs.scons
++++ b/service/third_party_libs.scons
+@@ -49,14 +49,6 @@ if target_os in ['linux']:
+               conf = Configure(lib_env)
+-              if target_os not in ['tizen'] and not conf.CheckLib('boost_thread', language='C++'):
+-                      print 'Did not find boost_thread, exiting!'
+-                      Exit(1)
+-
+-              if target_os not in ['tizen'] and not conf.CheckLib('boost_system', language='C++'):
+-                      print 'Did not find boost_system, exiting!'
+-                      Exit(1)
+-
+               lib_env = conf.Finish()
+ ######################################################################
diff --git a/net/iotivity/patches/020-linux-Add-more-architectures.patch b/net/iotivity/patches/020-linux-Add-more-architectures.patch
new file mode 100644 (file)
index 0000000..cb01381
--- /dev/null
@@ -0,0 +1,44 @@
+From dabd6597013e1df72b08621b466d136b8d25d110 Mon Sep 17 00:00:00 2001
+From: Philippe Coval <philippe.coval@osg.samsung.com>
+Date: Thu, 29 Sep 2016 10:57:59 +0200
+Subject: [PATCH 20/23] linux: Add more architectures
+
+This does not scale and this check should be removed.
+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+Author: Hauke Mehrtens <hauke@hauke-m.de>
+Change-Id: Ibb271701904745ee4f5dd689c197228239c37262
+Origin: https://github.com/openwrt/packages/blob/master/net/iotivity/patches/021-add-some-more-architectures.patch
+Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
+Reviewed-on: https://gerrit.iotivity.org/gerrit/14575
+Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
+Reviewed-by: Nivedita Singhvi <niveditasinghvi@gmail.com>
+Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
+Reviewed-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
+---
+ build_common/SConscript                     | 2 +-
+ resource/csdk/connectivity/build/SConscript | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/build_common/SConscript
++++ b/build_common/SConscript
+@@ -18,7 +18,7 @@ host_target_map = {
+ # Map of os and allowed archs (os: allowed archs)
+ os_arch_map = {
+-              'linux': ['x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64'],
++              'linux': ['x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64', 'mips', 'mipsel', 'mips64', 'mips64el', 'i386', 'powerpc', 'sparc', 'aarch64'],
+               'tizen': ['x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64'],
+               'android': ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'arm64-v8a'],
+               'windows': ['x86', 'amd64', 'arm'],
+--- a/resource/csdk/connectivity/build/SConscript
++++ b/resource/csdk/connectivity/build/SConscript
+@@ -14,7 +14,7 @@ host_target_map = {
+ # Map of os and allowed archs (os: allowed archs)
+ os_arch_map = {
+-              'linux': ['x86', 'x86_64', 'arm', 'arm64'],
++              'linux': ['x86', 'x86_64', 'arm', 'arm64', 'mips', 'mipsel', 'mips64', 'mips64el', 'i386', 'powerpc', 'sparc', 'aarch64'],
+               'tizen': ['x86', 'x86_64', 'arm', 'arm64'],
+               'android': ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'arm64-v8a'],
+               'windows': ['x86', 'amd64', 'arm'],
diff --git a/net/iotivity/patches/021-build-do-not-set-TARGET_ARCH-to-default.patch b/net/iotivity/patches/021-build-do-not-set-TARGET_ARCH-to-default.patch
new file mode 100644 (file)
index 0000000..2756fde
--- /dev/null
@@ -0,0 +1,39 @@
+From 792f68219b3ab4ff5238e3abc7aa1c68bfa4a22b Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sat, 10 Dec 2016 18:15:32 +0100
+Subject: [PATCH 21/23] build: do not set TARGET_ARCH to default
+
+This check is useless, scons already checks this and returns such an
+error message:
+Invalid value for option TARGET_ARCH: mips.  Valid values are: ['x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64']
+
+Change-Id: I3f7dd3b9fcae875ab20349203fb77537f24be763
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ build_common/SConscript                     | 3 ---
+ resource/csdk/connectivity/build/SConscript | 2 --
+ 2 files changed, 5 deletions(-)
+
+--- a/build_common/SConscript
++++ b/build_common/SConscript
+@@ -54,9 +54,6 @@ if target_os == 'android':
+ else:
+       default_arch = platform.machine()
+-if default_arch not in os_arch_map[target_os]:
+-      default_arch = os_arch_map[target_os][0].lower()
+-
+ target_arch = ARGUMENTS.get('TARGET_ARCH', default_arch) # target arch
+ # True if binary needs to be installed on board. (Might need root permissions)
+--- a/resource/csdk/connectivity/build/SConscript
++++ b/resource/csdk/connectivity/build/SConscript
+@@ -40,8 +40,6 @@ if target_os not in host_target_map[host
+       Exit(1)
+ default_arch = platform.machine()
+-if default_arch not in os_arch_map[target_os]:
+-      default_arch = os_arch_map[target_os][0].lower()
+ target_arch = ARGUMENTS.get('TARGET_ARCH', default_arch) # target arch
diff --git a/net/iotivity/patches/022-build-restrict-compiler-options-to-supported-archite.patch b/net/iotivity/patches/022-build-restrict-compiler-options-to-supported-archite.patch
new file mode 100644 (file)
index 0000000..dfb546a
--- /dev/null
@@ -0,0 +1,57 @@
+From 39b0c436c77555849da1e68cc8733c67183c291f Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sat, 10 Dec 2016 18:35:04 +0100
+Subject: [PATCH 22/23] build: restrict compiler options to supported
+ architectures
+
+For Linux we currently only support the following architectures:
+'x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64'
+explicitly check for those architectures and also remove ARM hard float.
+
+Change-Id: I7078530bc2a89b88c7049cc53e8bb3fbe5d75ca8
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ build_common/linux/SConscript                     | 11 +++--------
+ resource/csdk/connectivity/build/linux/SConscript | 11 +++--------
+ 2 files changed, 6 insertions(+), 16 deletions(-)
+
+--- a/build_common/linux/SConscript
++++ b/build_common/linux/SConscript
+@@ -30,14 +30,9 @@ if target_arch in ['x86']:
+ elif target_arch in ['x86_64']:
+       env.AppendUnique(CCFLAGS = ['-m64'])
+       env.AppendUnique(LINKFLAGS = ['-m64'])
+-elif target_arch in ['arm'] or target_arch.find('v5') > 0:
++elif target_arch in ['arm']:
+       env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
+-elif target_arch.find('v7a-hard') > 0:
++elif target_arch in ['arm-v7a', 'armeabi-v7a']:
+       env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+-      env.AppendUnique(CPPFLAGS = ['-mfloat-abi=hard'])
+-      env.AppendUnique(CCFLAGS = ['-mfloat-abi=hard'])
+-      env.AppendUnique(LINKFLAGS = ['-mfloat-abi=hard'])
+-elif target_arch.find('v7a') > 0:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+-elif target_arch.find('arm64') >= 0:
++elif target_arch.find('arm64') > 0:
+       env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
+--- a/resource/csdk/connectivity/build/linux/SConscript
++++ b/resource/csdk/connectivity/build/linux/SConscript
+@@ -29,14 +29,9 @@ if target_arch in ['x86']:
+ elif target_arch in ['x86_64']:
+       env.AppendUnique(CCFLAGS = ['-m64'])
+       env.AppendUnique(LINKFLAGS = ['-m64'])
+-elif target_arch.find('v7a-hard') > 0:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+-      env.AppendUnique(CPPFLAGS = ['-mfloat-abi=hard'])
+-      env.AppendUnique(CCFLAGS = ['-mfloat-abi=hard'])
+-      env.AppendUnique(LINKFLAGS = ['-mfloat-abi=hard'])
+-elif target_arch.find('v7a') > 0:
++elif target_arch in ['arm']:
++      env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
++elif target_arch in ['arm-v7a', 'armeabi-v7a']:
+       env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+ elif target_arch.find('arm64') > 0:
+       env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
+-else:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
diff --git a/net/iotivity/patches/023-build-take-compiler-options-from-environment.patch b/net/iotivity/patches/023-build-take-compiler-options-from-environment.patch
new file mode 100644 (file)
index 0000000..b6a2bfd
--- /dev/null
@@ -0,0 +1,126 @@
+From 5f9513eb341d520d10c48f8ba2bd145063405fdd Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sat, 10 Dec 2016 18:08:05 +0100
+Subject: [PATCH 23/23] build: take compiler options from environment
+
+This makes it possible to compile IoTivity with custom compiler
+options. This way someone can use optimized compiler settings for the
+target CPU. I want to use this in OpenWrt / LEDE to build specific
+IoTivity binaries for each CPU architecture, there the build system
+provides the matching compiler options.
+
+Change-Id: I86772f73b81c41d7e96e51b434fd9e3b4992753a
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ build_common/SConscript                           | 25 +++++++++++++++++++++
+ build_common/linux/SConscript                     | 27 ++++++++++++-----------
+ resource/csdk/connectivity/build/linux/SConscript | 27 ++++++++++++-----------
+ 3 files changed, 53 insertions(+), 26 deletions(-)
+
+--- a/build_common/SConscript
++++ b/build_common/SConscript
+@@ -120,6 +120,7 @@ help_vars.Add(PathVariable('ANDROID_NDK'
+ help_vars.Add(PathVariable('ANDROID_HOME', 'Android SDK path', None, PathVariable.PathAccept))
+ help_vars.Add(PathVariable('ANDROID_GRADLE', 'Gradle binary file', None, PathVariable.PathIsFile))
+ help_vars.Add(EnumVariable('WITH_UPSTREAM_LIBCOAP', 'Use latest stable version of LibCoAP downloaded from github', default_with_upstream_libcoap, allowed_values=('0','1')))
++help_vars.Add(BoolVariable('WITH_ENV', 'Use compiler options from environment', False))
+ AddOption('--prefix',
+                   dest='prefix',
+@@ -153,6 +154,30 @@ else:
+                       )
+ Help(help_vars.GenerateHelpText(env))
++if env.get('WITH_ENV'):
++      env['ENV'] = os.environ
++      if 'CC' in os.environ:
++              env['CC'] = Split(os.environ['CC'])
++              print "using CC from environment: %s" % env['CC']
++      if 'CXX' in os.environ:
++              env['CXX'] = Split(os.environ['CXX'])
++              print "using CXX from environment: %s" % env['CXX']
++      if 'CFLAGS' in os.environ:
++              env['CFLAGS'] = Split(os.environ['CFLAGS'])
++              print "using CFLAGS from environment: %s" % env['CFLAGS']
++      if 'CXXFLAGS' in os.environ:
++              env['CXXFLAGS'] = Split(os.environ['CXXFLAGS'])
++                      print "using CXXFLAGS from environment: %s" % env['CXXFLAGS']
++      if 'CCFLAGS' in os.environ:
++              env['CCFLAGS'] = Split(os.environ['CCFLAGS'])
++              print "using CCFLAGS from environment: %s" % env['CCFLAGS']
++      if 'CPPFLAGS' in os.environ:
++              env['CPPFLAGS'] = Split(os.environ['CPPFLAGS'])
++              print "using CPPFLAGS from environment: %s" % env['CPPFLAGS']
++      if 'LDFLAGS' in os.environ:
++              env['LINKFLAGS'] = Split(os.environ['LDFLAGS'])
++              print "using LDFLAGS/LINKFLAGS from environment: %s" % env['LINKFLAGS']
++
+ tc_set_msg = '''
+ ************************************ Warning **********************************
+ *   Enviornment variable TC_PREFIX/TC_PATH is set. It will change the default *
+--- a/build_common/linux/SConscript
++++ b/build_common/linux/SConscript
+@@ -23,16 +23,17 @@ env.AppendUnique(CCFLAGS = ['-Wall', '-W
+ env.AppendUnique(LIBS = ['dl', 'pthread', 'uuid'])
+ # Set arch flags that match best TARGET_ARCH variable
+-target_arch = env.get('TARGET_ARCH')
+-if target_arch in ['x86']:
+-      env.AppendUnique(CCFLAGS = ['-m32'])
+-      env.AppendUnique(LINKFLAGS = ['-m32'])
+-elif target_arch in ['x86_64']:
+-      env.AppendUnique(CCFLAGS = ['-m64'])
+-      env.AppendUnique(LINKFLAGS = ['-m64'])
+-elif target_arch in ['arm']:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
+-elif target_arch in ['arm-v7a', 'armeabi-v7a']:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+-elif target_arch.find('arm64') > 0:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
++if not env.get('WITH_ENV'):
++      target_arch = env.get('TARGET_ARCH')
++      if target_arch in ['x86']:
++              env.AppendUnique(CCFLAGS = ['-m32'])
++              env.AppendUnique(LINKFLAGS = ['-m32'])
++      elif target_arch in ['x86_64']:
++              env.AppendUnique(CCFLAGS = ['-m64'])
++              env.AppendUnique(LINKFLAGS = ['-m64'])
++      elif target_arch in ['arm']:
++              env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
++      elif target_arch in ['arm-v7a', 'armeabi-v7a']:
++              env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
++      elif target_arch.find('arm64') > 0:
++              env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
+--- a/resource/csdk/connectivity/build/linux/SConscript
++++ b/resource/csdk/connectivity/build/linux/SConscript
+@@ -22,16 +22,17 @@ env.AppendUnique(CCFLAGS = ['-Wall', '-f
+ env.AppendUnique(LIBS = ['dl', 'pthread'])
+ # Set arch flags
+-target_arch = env.get('TARGET_ARCH')
+-if target_arch in ['x86']:
+-      env.AppendUnique(CCFLAGS = ['-m32'])
+-      env.AppendUnique(LINKFLAGS = ['-m32'])
+-elif target_arch in ['x86_64']:
+-      env.AppendUnique(CCFLAGS = ['-m64'])
+-      env.AppendUnique(LINKFLAGS = ['-m64'])
+-elif target_arch in ['arm']:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
+-elif target_arch in ['arm-v7a', 'armeabi-v7a']:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+-elif target_arch.find('arm64') > 0:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
++if not env.get('WITH_ENV'):
++      target_arch = env.get('TARGET_ARCH')
++      if target_arch in ['x86']:
++              env.AppendUnique(CCFLAGS = ['-m32'])
++              env.AppendUnique(LINKFLAGS = ['-m32'])
++      elif target_arch in ['x86_64']:
++              env.AppendUnique(CCFLAGS = ['-m64'])
++              env.AppendUnique(LINKFLAGS = ['-m64'])
++      elif target_arch in ['arm']:
++              env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
++      elif target_arch in ['arm-v7a', 'armeabi-v7a']:
++              env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
++      elif target_arch.find('arm64') > 0:
++              env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
diff --git a/net/iotivity/patches/030-remove-check-for-curl.patch b/net/iotivity/patches/030-remove-check-for-curl.patch
new file mode 100644 (file)
index 0000000..475976d
--- /dev/null
@@ -0,0 +1,55 @@
+--- a/service/resource-container/SConscript
++++ b/service/resource-container/SConscript
+@@ -191,36 +191,22 @@ if target_os in ['linux', 'tizen', 'andr
+ # build hue sample bundle
+ ######################################################################
+-conf2 = Configure(lib_env)
+-if not conf2.CheckLib('curl'):
+-    print '''X
+-*********************************** Error *************************************
+-* Cannot build hue sample. Please install libcurl.
+-* Example (Ubuntu):
+-*   sudo apt-get install libcurl4-openssl-dev
+-*   sudo ldconfig
+-* Hint: check with pkg-config --libs libcurl and clear scons cache.
+-* Skipping hue sample build.
+-*******************************************************************************
+-    '''
+-else:
+-    hue_resource_bundle_env = resource_container_env.Clone()
+-    hue_resource_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
+-
+-    HUE_RESOURCE_BUNDLE_DIR = 'examples/HueSampleBundle/'
+-    hue_resource_bundle_env.AppendUnique(CPPPATH = [
+-            HUE_RESOURCE_BUNDLE_DIR + 'include',
+-            'include/'
+-            ])
+-
+-    hue_resource_bundle_env.PrependUnique(LIBS = ['curl', 'rcs_container'])
+-
+-    hue_resource_bundle_src = [ Glob(HUE_RESOURCE_BUNDLE_DIR + 'src/*.cpp')]
+-
+-    HueBundle = hue_resource_bundle_env.SharedLibrary('HueBundle', hue_resource_bundle_src)
+-    hue_resource_bundle_env.InstallTarget(HueBundle, 'libHueBundle')
+-    hue_resource_bundle_env.UserInstallTargetLib(HueBundle, 'libHueBundle')
+-lib_env = conf2.Finish()
++hue_resource_bundle_env = resource_container_env.Clone()
++hue_resource_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
++
++HUE_RESOURCE_BUNDLE_DIR = 'examples/HueSampleBundle/'
++hue_resource_bundle_env.AppendUnique(CPPPATH = [
++        HUE_RESOURCE_BUNDLE_DIR + 'include',
++        'include/'
++        ])
++
++hue_resource_bundle_env.PrependUnique(LIBS = ['curl', 'rcs_container'])
++
++hue_resource_bundle_src = [ Glob(HUE_RESOURCE_BUNDLE_DIR + 'src/*.cpp')]
++
++HueBundle = hue_resource_bundle_env.SharedLibrary('HueBundle', hue_resource_bundle_src)
++hue_resource_bundle_env.InstallTarget(HueBundle, 'libHueBundle')
++hue_resource_bundle_env.UserInstallTargetLib(HueBundle, 'libHueBundle')
+ ######################################################################
+ # Build Container Sample
diff --git a/net/iotivity/patches/040-linux-Use-system-sqlite3.patch b/net/iotivity/patches/040-linux-Use-system-sqlite3.patch
new file mode 100644 (file)
index 0000000..50d55a7
--- /dev/null
@@ -0,0 +1,27 @@
+From 08b403572985a70fe5d652378e1cfa2b72ac6a3d Mon Sep 17 00:00:00 2001
+From: Philippe Coval <philippe.coval@osg.samsung.com>
+Date: Fri, 9 Dec 2016 02:12:04 +0100
+Subject: [PATCH] linux: Use system sqlite3
+
+Problem was discovered on yocto
+
+Change-Id: I5274bed9e4b7ddcdc1b17a265a1886cd78cb631f
+Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
+Reviewed-on: https://gerrit.iotivity.org/gerrit/15305
+Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
+Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
+---
+ resource/csdk/SConscript | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/resource/csdk/SConscript
++++ b/resource/csdk/SConscript
+@@ -191,7 +191,7 @@ if with_tcp == True:
+ if 'SERVER' in rd_mode:
+     liboctbstack_src.append(OCTBSTACK_SRC + 'oicresourcedirectory.c')
+-    if target_os not in ['tizen']:
++    if target_os not in ['linux', 'tizen']:
+         liboctbstack_src.append('#extlibs/sqlite3/sqlite3.c')
+ if target_os in ['linux']:
diff --git a/net/iotivity/patches/050-csdk-move-OCEntityHandlerResponse-from-stack-to-heap.patch b/net/iotivity/patches/050-csdk-move-OCEntityHandlerResponse-from-stack-to-heap.patch
new file mode 100644 (file)
index 0000000..5ba18d8
--- /dev/null
@@ -0,0 +1,54 @@
+From d8cf30cb0abd5fa8f6282b490618204d683b625c Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Mon, 3 Oct 2016 21:00:28 +0200
+Subject: [PATCH 1/3] csdk: move OCEntityHandlerResponse from stack to heap
+
+OCEntityHandlerResponse is over 50KByte and I got a stack overflow on MIPS
+running on LEDE without this patch. Instead of storing
+OCEntityHandlerResponse on the program stack, allocate some memory on
+the heap and free it afterwards again.
+
+This fixes one part of this issue for me:
+https://jira.iotivity.org/browse/IOT-1374
+
+Change-Id: I365a5c7a34dce2dfb0897a20b57a13ba566748ec
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/csdk/stack/src/ocresource.c | 24 +++++++++++++++++-------
+ 1 file changed, 17 insertions(+), 7 deletions(-)
+
+--- a/resource/csdk/stack/src/ocresource.c
++++ b/resource/csdk/stack/src/ocresource.c
+@@ -774,15 +774,25 @@ static bool includeThisResourceInRespons
+ OCStackResult SendNonPersistantDiscoveryResponse(OCServerRequest *request, OCResource *resource,
+                                 OCPayload *discoveryPayload, OCEntityHandlerResult ehResult)
+ {
+-    OCEntityHandlerResponse response = {0};
++    OCEntityHandlerResponse *response = NULL;
++    OCStackResult result = OC_STACK_ERROR;
+-    response.ehResult = ehResult;
+-    response.payload = discoveryPayload;
+-    response.persistentBufferFlag = 0;
+-    response.requestHandle = (OCRequestHandle) request->requestId;
+-    response.resourceHandle = (OCResourceHandle) resource;
++    response = (OCEntityHandlerResponse *)OICCalloc(1, sizeof(*response));
++    VERIFY_PARAM_NON_NULL(TAG, response, "Failed allocating OCEntityHandlerResponse");
+-    return OCDoResponse(&response);
++    response->ehResult = ehResult;
++    response->payload = discoveryPayload;
++    response->persistentBufferFlag = 0;
++    response->requestHandle = (OCRequestHandle) request->requestId;
++    response->resourceHandle = (OCResourceHandle) resource;
++
++    result = OCDoResponse(response);
++
++    OICFree(response);
++    return result;
++
++exit:
++    return OC_STACK_NO_MEMORY;
+ }
+ static OCStackResult EHRequest(OCEntityHandlerRequest *ehRequest, OCPayloadType type,
diff --git a/net/iotivity/patches/051-csdk-move-OCClientResponse-from-stack-to-heap.patch b/net/iotivity/patches/051-csdk-move-OCClientResponse-from-stack-to-heap.patch
new file mode 100644 (file)
index 0000000..db8ede4
--- /dev/null
@@ -0,0 +1,357 @@
+From e8971dd4914c9d42938c4c885b4ac6d784d7e0ff Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Mon, 3 Oct 2016 23:22:36 +0200
+Subject: [PATCH 2/3] csdk: move OCClientResponse from stack to heap
+
+OCClientResponse is about 50KByte and should not be stored on the
+stack. On LEDE with MIPS, musl libc this causes a segmentation fault.
+Moving this structure to the heap is the simple solution for this
+problem, but this structure should be shrined.
+
+There are probably more places were this is stored on the stack and
+will cause problems. This fixes the other issue I saw in
+https://jira.iotivity.org/browse/IOT-1374
+
+Change-Id: I45d8aee4a8151fea51d3318acb1eea61ce579060
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/csdk/stack/src/ocstack.c | 163 ++++++++++++++++++++++++--------------
+ 1 file changed, 102 insertions(+), 61 deletions(-)
+
+--- a/resource/csdk/stack/src/ocstack.c
++++ b/resource/csdk/stack/src/ocstack.c
+@@ -1042,7 +1042,7 @@ OCStackResult HandlePresenceResponse(con
+     OCStackApplicationResult cbResult = OC_STACK_DELETE_TRANSACTION;
+     ClientCB * cbNode = NULL;
+     char *resourceTypeName = NULL;
+-    OCClientResponse response = {.devAddr = {.adapter = OC_DEFAULT_ADAPTER}};
++    OCClientResponse *response = NULL;
+     OCStackResult result = OC_STACK_ERROR;
+     uint32_t maxAge = 0;
+     int uriLen;
+@@ -1057,15 +1057,23 @@ OCStackResult HandlePresenceResponse(con
+         return OC_STACK_ERROR;
+     }
+-    response.payload = NULL;
+-    response.result = OC_STACK_OK;
++    response = (OCClientResponse *)OICCalloc(1, sizeof(*response));
++    if (!response)
++    {
++            OIC_LOG(ERROR, TAG, "Allocating memory for response failed");
++            return OC_STACK_ERROR;
++    }
++    response->devAddr.adapter = OC_DEFAULT_ADAPTER;
+-    CopyEndpointToDevAddr(endpoint, &response.devAddr);
+-    FixUpClientResponse(&response);
++    response->payload = NULL;
++    response->result = OC_STACK_OK;
++
++    CopyEndpointToDevAddr(endpoint, &response->devAddr);
++    FixUpClientResponse(response);
+     if (responseInfo->info.payload)
+     {
+-        result = OCParsePayload(&response.payload,
++        result = OCParsePayload(&response->payload,
+                 PAYLOAD_TYPE_PRESENCE,
+                 responseInfo->info.payload,
+                 responseInfo->info.payloadSize);
+@@ -1075,15 +1083,15 @@ OCStackResult HandlePresenceResponse(con
+             OIC_LOG(ERROR, TAG, "Presence parse failed");
+             goto exit;
+         }
+-        if(!response.payload || response.payload->type != PAYLOAD_TYPE_PRESENCE)
++        if(!response->payload || response->payload->type != PAYLOAD_TYPE_PRESENCE)
+         {
+             OIC_LOG(ERROR, TAG, "Presence payload was wrong type");
+             result = OC_STACK_ERROR;
+             goto exit;
+         }
+-        response.sequenceNumber = ((OCPresencePayload*)response.payload)->sequenceNumber;
+-        resourceTypeName = ((OCPresencePayload*)response.payload)->resourceType;
+-        maxAge = ((OCPresencePayload*)response.payload)->maxAge;
++        response->sequenceNumber = ((OCPresencePayload*)response->payload)->sequenceNumber;
++        resourceTypeName = ((OCPresencePayload*)response->payload)->resourceType;
++        maxAge = ((OCPresencePayload*)response->payload)->maxAge;
+     }
+     // check for unicast presence
+@@ -1091,6 +1099,7 @@ OCStackResult HandlePresenceResponse(con
+                                       responseInfo->isMulticast);
+     if (uriLen < 0 || (size_t)uriLen >= sizeof (presenceUri))
+     {
++        OICFree(response);
+         return OC_STACK_INVALID_URI;
+     }
+     OIC_LOG(ERROR, TAG, "check for unicast presence");
+@@ -1118,7 +1127,7 @@ OCStackResult HandlePresenceResponse(con
+     if (presenceSubscribe)
+     {
+-        if(cbNode->sequenceNumber == response.sequenceNumber)
++        if(cbNode->sequenceNumber == response->sequenceNumber)
+         {
+             OIC_LOG(INFO, TAG, "No presence change");
+             ResetPresenceTTL(cbNode, maxAge);
+@@ -1129,7 +1138,7 @@ OCStackResult HandlePresenceResponse(con
+         if(maxAge == 0)
+         {
+             OIC_LOG(INFO, TAG, "Stopping presence");
+-            response.result = OC_STACK_PRESENCE_STOPPED;
++            response->result = OC_STACK_PRESENCE_STOPPED;
+             if(cbNode->presence)
+             {
+                 OICFree(cbNode->presence->timeOut);
+@@ -1165,7 +1174,7 @@ OCStackResult HandlePresenceResponse(con
+             ResetPresenceTTL(cbNode, maxAge);
+-            cbNode->sequenceNumber = response.sequenceNumber;
++            cbNode->sequenceNumber = response->sequenceNumber;
+         }
+     }
+     else
+@@ -1175,7 +1184,7 @@ OCStackResult HandlePresenceResponse(con
+         if (0 == maxAge)
+         {
+             OIC_LOG(INFO, TAG, "Stopping presence");
+-            response.result = OC_STACK_PRESENCE_STOPPED;
++            response->result = OC_STACK_PRESENCE_STOPPED;
+         }
+     }
+@@ -1191,7 +1200,7 @@ OCStackResult HandlePresenceResponse(con
+     OIC_LOG(INFO, TAG, "Callback for presence");
+-    cbResult = cbNode->callBack(cbNode->context, cbNode->handle, &response);
++    cbResult = cbNode->callBack(cbNode->context, cbNode->handle, response);
+     if (cbResult == OC_STACK_DELETE_TRANSACTION)
+     {
+@@ -1199,7 +1208,8 @@ OCStackResult HandlePresenceResponse(con
+     }
+ exit:
+-    OCPayloadDestroy(response.payload);
++    OCPayloadDestroy(response->payload);
++    OICFree(response);
+     return result;
+ }
+@@ -1240,36 +1250,53 @@ void OCHandleResponse(const CAEndpoint_t
+             OIC_LOG(INFO, TAG, "Receiving A Timeout for this token");
+             OIC_LOG(INFO, TAG, "Calling into application address space");
+-            OCClientResponse response =
+-                {.devAddr = {.adapter = OC_DEFAULT_ADAPTER}};
+-            CopyEndpointToDevAddr(endPoint, &response.devAddr);
+-            FixUpClientResponse(&response);
+-            response.resourceUri = responseInfo->info.resourceUri;
+-            memcpy(response.identity.id, responseInfo->info.identity.id,
+-                                                sizeof (response.identity.id));
+-            response.identity.id_length = responseInfo->info.identity.id_length;
++            OCClientResponse *response = NULL;
++
++            response = (OCClientResponse *)OICCalloc(1, sizeof(*response));
++            if (!response)
++            {
++                OIC_LOG(ERROR, TAG, "Allocating memory for response failed");
++                return;
++            }
++
++            response->devAddr.adapter = OC_DEFAULT_ADAPTER;
++            CopyEndpointToDevAddr(endPoint, &response->devAddr);
++            FixUpClientResponse(response);
++            response->resourceUri = responseInfo->info.resourceUri;
++            memcpy(response->identity.id, responseInfo->info.identity.id,
++                                                sizeof (response->identity.id));
++            response->identity.id_length = responseInfo->info.identity.id_length;
+-            response.result = CAResponseToOCStackResult(responseInfo->result);
++            response->result = CAResponseToOCStackResult(responseInfo->result);
+             cbNode->callBack(cbNode->context,
+-                    cbNode->handle, &response);
++                    cbNode->handle, response);
+             FindAndDeleteClientCB(cbNode);
++            OICFree(response);
+         }
+         else
+         {
+             OIC_LOG(INFO, TAG, "This is a regular response, A client call back is found");
+             OIC_LOG(INFO, TAG, "Calling into application address space");
+-            OCClientResponse response =
+-                {.devAddr = {.adapter = OC_DEFAULT_ADAPTER}};
+-            response.sequenceNumber = MAX_SEQUENCE_NUMBER + 1;
+-            CopyEndpointToDevAddr(endPoint, &response.devAddr);
+-            FixUpClientResponse(&response);
+-            response.resourceUri = responseInfo->info.resourceUri;
+-            memcpy(response.identity.id, responseInfo->info.identity.id,
+-                                                sizeof (response.identity.id));
+-            response.identity.id_length = responseInfo->info.identity.id_length;
++            OCClientResponse *response = NULL;
+-            response.result = CAResponseToOCStackResult(responseInfo->result);
++            response = (OCClientResponse *)OICCalloc(1, sizeof(*response));
++            if (!response)
++            {
++                OIC_LOG(ERROR, TAG, "Allocating memory for response failed");
++                return;
++            }
++            
++            response->devAddr.adapter = OC_DEFAULT_ADAPTER;
++            response->sequenceNumber = MAX_SEQUENCE_NUMBER + 1;
++            CopyEndpointToDevAddr(endPoint, &response->devAddr);
++            FixUpClientResponse(response);
++            response->resourceUri = responseInfo->info.resourceUri;
++            memcpy(response->identity.id, responseInfo->info.identity.id,
++                                                sizeof (response->identity.id));
++            response->identity.id_length = responseInfo->info.identity.id_length;
++
++            response->result = CAResponseToOCStackResult(responseInfo->result);
+             if(responseInfo->info.payload &&
+                responseInfo->info.payloadSize)
+@@ -1359,21 +1386,23 @@ void OCHandleResponse(const CAEndpoint_t
+                 {
+                     OIC_LOG_V(ERROR, TAG, "Unknown Payload type: %d %s",
+                             cbNode->method, cbNode->requestUri);
++                    OICFree(response);
+                     return;
+                 }
+-                if(OC_STACK_OK != OCParsePayload(&response.payload,
++                if(OC_STACK_OK != OCParsePayload(&response->payload,
+                             type,
+                             responseInfo->info.payload,
+                             responseInfo->info.payloadSize))
+                 {
+                     OIC_LOG(ERROR, TAG, "Error converting payload");
+-                    OCPayloadDestroy(response.payload);
++                    OCPayloadDestroy(response->payload);
++                    OICFree(response);
+                     return;
+                 }
+             }
+-            response.numRcvdVendorSpecificHeaderOptions = 0;
++            response->numRcvdVendorSpecificHeaderOptions = 0;
+             if(responseInfo->info.numOptions > 0)
+             {
+                 int start = 0;
+@@ -1391,19 +1420,20 @@ void OCHandleResponse(const CAEndpoint_t
+                         observationOption =
+                             (observationOption << 8) | optionData[i];
+                     }
+-                    response.sequenceNumber = observationOption;
+-                    response.numRcvdVendorSpecificHeaderOptions = responseInfo->info.numOptions - 1;
++                    response->sequenceNumber = observationOption;
++                    response->numRcvdVendorSpecificHeaderOptions = responseInfo->info.numOptions - 1;
+                     start = 1;
+                 }
+                 else
+                 {
+-                    response.numRcvdVendorSpecificHeaderOptions = responseInfo->info.numOptions;
++                    response->numRcvdVendorSpecificHeaderOptions = responseInfo->info.numOptions;
+                 }
+-                if(response.numRcvdVendorSpecificHeaderOptions > MAX_HEADER_OPTIONS)
++                if(response->numRcvdVendorSpecificHeaderOptions > MAX_HEADER_OPTIONS)
+                 {
+                     OIC_LOG(ERROR, TAG, "#header options are more than MAX_HEADER_OPTIONS");
+-                    OCPayloadDestroy(response.payload);
++                    OCPayloadDestroy(response->payload);
++                    OICFree(response);
+                     return;
+                 }
+@@ -1411,19 +1441,19 @@ void OCHandleResponse(const CAEndpoint_t
+                 {
+                     if(&(responseInfo->info.options[i]))
+                     {
+-                        memcpy (&(response.rcvdVendorSpecificHeaderOptions[i-start]),
++                        memcpy (&(response->rcvdVendorSpecificHeaderOptions[i-start]),
+                                 &(responseInfo->info.options[i]), sizeof(OCHeaderOption));
+                     }
+                 }
+             }
+             if (cbNode->method == OC_REST_OBSERVE &&
+-                response.sequenceNumber > OC_OFFSET_SEQUENCE_NUMBER &&
++                response->sequenceNumber > OC_OFFSET_SEQUENCE_NUMBER &&
+                 cbNode->sequenceNumber <=  MAX_SEQUENCE_NUMBER &&
+-                response.sequenceNumber <= cbNode->sequenceNumber)
++                response->sequenceNumber <= cbNode->sequenceNumber)
+             {
+                 OIC_LOG_V(INFO, TAG, "Received stale notification. Number :%d",
+-                                                 response.sequenceNumber);
++                                                 response->sequenceNumber);
+             }
+             else
+             {
+@@ -1432,13 +1462,13 @@ void OCHandleResponse(const CAEndpoint_t
+                 char *targetUri = strstr(cbNode->requestUri, OC_RSRVD_RD_URI);
+                 if (targetUri)
+                 {
+-                    OCUpdateResourceInsWithResponse(cbNode->requestUri, &response);
++                    OCUpdateResourceInsWithResponse(cbNode->requestUri, response);
+                 }
+ #endif
+                 OCStackApplicationResult appFeedback = cbNode->callBack(cbNode->context,
+                                                                         cbNode->handle,
+-                                                                        &response);
+-                cbNode->sequenceNumber = response.sequenceNumber;
++                                                                        response);
++                cbNode->sequenceNumber = response->sequenceNumber;
+                 if (appFeedback == OC_STACK_DELETE_TRANSACTION)
+                 {
+@@ -1459,7 +1489,8 @@ void OCHandleResponse(const CAEndpoint_t
+                         CA_MSG_ACKNOWLEDGE, 0, NULL, NULL, 0, NULL, CA_RESPONSE_FOR_RES);
+             }
+-            OCPayloadDestroy(response.payload);
++            OCPayloadDestroy(response->payload);
++            OICFree(response);
+         }
+         return;
+     }
+@@ -1585,16 +1616,26 @@ void HandleCAErrorResponse(const CAEndpo
+                                    errorInfo->info.tokenLength, NULL, NULL);
+     if (cbNode)
+     {
+-        OCClientResponse response = { .devAddr = { .adapter = OC_DEFAULT_ADAPTER } };
+-        CopyEndpointToDevAddr(endPoint, &response.devAddr);
+-        FixUpClientResponse(&response);
+-        response.resourceUri = errorInfo->info.resourceUri;
+-        memcpy(response.identity.id, errorInfo->info.identity.id,
+-               sizeof (response.identity.id));
+-        response.identity.id_length = errorInfo->info.identity.id_length;
+-        response.result = CAResultToOCResult(errorInfo->result);
++        OCClientResponse *response = NULL;
++
++        response = (OCClientResponse *)OICCalloc(1, sizeof(*response));
++        if (!response)
++        {
++            OIC_LOG(ERROR, TAG, "Allocating memory for response failed");
++            return;
++        }
++
++        response->devAddr.adapter = OC_DEFAULT_ADAPTER;
++        CopyEndpointToDevAddr(endPoint, &response->devAddr);
++        FixUpClientResponse(response);
++        response->resourceUri = errorInfo->info.resourceUri;
++        memcpy(response->identity.id, errorInfo->info.identity.id,
++               sizeof (response->identity.id));
++        response->identity.id_length = errorInfo->info.identity.id_length;
++        response->result = CAResultToOCResult(errorInfo->result);
+-        cbNode->callBack(cbNode->context, cbNode->handle, &response);
++        cbNode->callBack(cbNode->context, cbNode->handle, response);
++        OICFree(response);
+     }
+     ResourceObserver *observer = GetObserverUsingToken(errorInfo->info.token,
diff --git a/net/iotivity/patches/053-src-move-OCClientResponse-from-stack-to-heap.patch b/net/iotivity/patches/053-src-move-OCClientResponse-from-stack-to-heap.patch
new file mode 100644 (file)
index 0000000..523cfe1
--- /dev/null
@@ -0,0 +1,103 @@
+From 7fb5b6a19b06dc5b0a7f32261551b206b1e6a563 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 8 Jan 2017 19:24:26 +0100
+Subject: [PATCH 3/3] src: move OCClientResponse from stack to heap
+
+OCClientResponse is about 50KByte and should not be stored on the
+stack. On LEDE with MIPS, musl libc this causes a segmentation fault.
+Moving this structure to the heap is the simple solution for this
+problem, but this structure should be shrinked.
+
+Change-Id: I7887f93450f45b8031fcdfffb9ee2214fc3d5dd2
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/src/InProcServerWrapper.cpp | 44 +++++++++++++++++++++---------------
+ 1 file changed, 26 insertions(+), 18 deletions(-)
+
+--- a/resource/src/InProcServerWrapper.cpp
++++ b/resource/src/InProcServerWrapper.cpp
+@@ -568,51 +568,58 @@ namespace OC
+         }
+         else
+         {
+-            OCEntityHandlerResponse response;
++            OCEntityHandlerResponse *response = NULL;
++
++            response = (OCEntityHandlerResponse *)OICCalloc(1, sizeof(*response));
++            if (!response) {
++                result = OC_STACK_MALFORMED_RESPONSE;
++                throw OCException(OC::Exception::STR_NULL_RESPONSE, OC_STACK_MALFORMED_RESPONSE);
++            }
++
+ //            OCRepPayload* payLoad = pResponse->getPayload();
+             HeaderOptions serverHeaderOptions = pResponse->getHeaderOptions();
+-            response.requestHandle = pResponse->getRequestHandle();
+-            response.resourceHandle = pResponse->getResourceHandle();
+-            response.ehResult = pResponse->getResponseResult();
++            response->requestHandle = pResponse->getRequestHandle();
++            response->resourceHandle = pResponse->getResourceHandle();
++            response->ehResult = pResponse->getResponseResult();
+-            response.payload = reinterpret_cast<OCPayload*>(pResponse->getPayload());
++            response->payload = reinterpret_cast<OCPayload*>(pResponse->getPayload());
+-            response.persistentBufferFlag = 0;
++            response->persistentBufferFlag = 0;
+-            response.numSendVendorSpecificHeaderOptions = serverHeaderOptions.size();
++            response->numSendVendorSpecificHeaderOptions = serverHeaderOptions.size();
+             int i = 0;
+             for (auto it=serverHeaderOptions.begin(); it != serverHeaderOptions.end(); ++it)
+             {
+-                response.sendVendorSpecificHeaderOptions[i].protocolID = OC_COAP_ID;
+-                response.sendVendorSpecificHeaderOptions[i].optionID =
++                response->sendVendorSpecificHeaderOptions[i].protocolID = OC_COAP_ID;
++                response->sendVendorSpecificHeaderOptions[i].optionID =
+                     static_cast<uint16_t>(it->getOptionID());
+-                response.sendVendorSpecificHeaderOptions[i].optionLength =
++                response->sendVendorSpecificHeaderOptions[i].optionLength =
+                     (it->getOptionData()).length() + 1;
+                 std::string optionData = it->getOptionData();
+                 std::copy(optionData.begin(),
+                          optionData.end(),
+-                         response.sendVendorSpecificHeaderOptions[i].optionData);
+-                response.sendVendorSpecificHeaderOptions[i].optionData[it->getOptionData().length()]
++                         response->sendVendorSpecificHeaderOptions[i].optionData);
++                response->sendVendorSpecificHeaderOptions[i].optionData[it->getOptionData().length()]
+                     = '\0';
+                 i++;
+             }
+-            if(OC_EH_RESOURCE_CREATED == response.ehResult)
++            if(OC_EH_RESOURCE_CREATED == response->ehResult)
+             {
+-                pResponse->getNewResourceUri().copy(response.resourceUri,
+-                        sizeof (response.resourceUri) - 1);
+-                response.resourceUri[pResponse->getNewResourceUri().length()] = '\0';
++                pResponse->getNewResourceUri().copy(response->resourceUri,
++                        sizeof (response->resourceUri) - 1);
++                response->resourceUri[pResponse->getNewResourceUri().length()] = '\0';
+             }
+             if(cLock)
+             {
+                 std::lock_guard<std::recursive_mutex> lock(*cLock);
+-                result = OCDoResponse(&response);
++                result = OCDoResponse(response);
+             }
+             else
+             {
+-                OICFree(response.payload);
++                OICFree(response->payload);
+                 result = OC_STACK_ERROR;
+             }
+@@ -620,6 +627,7 @@ namespace OC
+             {
+                 oclog() << "Error sending response\n";
+             }
++            OICFree(response);
+             return result;
+         }
+     }
diff --git a/net/iotivity/patches/070-ssl-fix-compilation-against-non-debug-mbedtls.patch b/net/iotivity/patches/070-ssl-fix-compilation-against-non-debug-mbedtls.patch
new file mode 100644 (file)
index 0000000..903cb72
--- /dev/null
@@ -0,0 +1,27 @@
+From 261cf19bfa3dea10ed0f2ebbb2d945c19c9a2804 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 4 Dec 2016 00:18:37 +0100
+Subject: [PATCH 5/7] ssl: fix compilation against non debug mbedtls
+
+The function mbedtls_debug_set_threshold() is only available when
+MBEDTLS_DEBUG_C is set. make the call depend on this condition.
+
+Change-Id: I8158bc4c55b428167e36084e7a46359c269c5fc7
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
++++ b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
+@@ -1278,8 +1278,10 @@ static int InitConfig(mbedtls_ssl_config
+ #if !defined(NDEBUG) || defined(TB_LOG)
+     mbedtls_ssl_conf_dbg(conf, DebugSsl, NULL);
++#if defined(MBEDTLS_DEBUG_C)
+     mbedtls_debug_set_threshold(MBED_TLS_DEBUG_LEVEL);
+ #endif
++#endif
+     OIC_LOG_V(DEBUG, NET_SSL_TAG, "Out %s", __func__);
+     return 0;
+ }
diff --git a/net/iotivity/patches/071-ssl-call-mbedtls_version_get_string-only-if-availabl.patch b/net/iotivity/patches/071-ssl-call-mbedtls_version_get_string-only-if-availabl.patch
new file mode 100644 (file)
index 0000000..83aec07
--- /dev/null
@@ -0,0 +1,35 @@
+From cee085e0e62214603b9ae035d63fabca23c491bd Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 8 Jan 2017 01:39:35 +0100
+Subject: [PATCH 6/7] ssl: call mbedtls_version_get_string() only if available
+
+The function mbedtls_version_get_string()  is only available if
+MBEDTLS_VERSION_C is set in the mbedtls configuration. Check this
+before calling this function and print the mbedtls version this was
+compiled against instead if mbedtls_version_get_string()  is not
+available.
+
+This fixes a compile problem when MBEDTLS_VERSION_C is not set.
+
+Change-Id: I54c2c2a3fc1f9d35afa475500e3db68420a1b54a
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
++++ b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
+@@ -1376,9 +1376,13 @@ CAResult_t CAinitSslAdapter()
+     /* Initialize TLS library
+      */
+ #if !defined(NDEBUG) || defined(TB_LOG)
++#ifdef MBEDTLS_VERSION_C
+     char version[MBED_TLS_VERSION_LEN];
+     mbedtls_version_get_string(version);
+     OIC_LOG_V(INFO, NET_SSL_TAG, "mbed TLS version: %s", version);
++#else
++    OIC_LOG_V(INFO, NET_SSL_TAG, "mbed TLS version: %s", MBEDTLS_VERSION_STRING);
++#endif
+ #endif
+     /* Entropy settings
diff --git a/net/iotivity/patches/072-ssl-call-mbedtls_ssl_conf_renegotiation-only-if-avai.patch b/net/iotivity/patches/072-ssl-call-mbedtls_ssl_conf_renegotiation-only-if-avai.patch
new file mode 100644 (file)
index 0000000..2e2ccb0
--- /dev/null
@@ -0,0 +1,30 @@
+From 3684ac3720f91dc131c1c61689395a69ae1865f9 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 8 Jan 2017 20:31:18 +0100
+Subject: [PATCH 7/7] ssl: call mbedtls_ssl_conf_renegotiation() only if
+ available
+
+The function mbedtls_ssl_conf_renegotiation() is only available if
+MBEDTLS_SSL_RENEGOTIATION is set in the mbedtls configuration. Check this
+before calling this function.
+
+This fixes a compile problem when MBEDTLS_SSL_RENEGOTIATION is not set.
+
+Change-Id: I69f15359d2dcaed1e4fe56fc7799737e38d6c2e7
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
++++ b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
+@@ -1273,7 +1273,9 @@ static int InitConfig(mbedtls_ssl_config
+     mbedtls_ssl_conf_rng(conf, mbedtls_ctr_drbg_random, &g_caSslContext->rnd);
+     mbedtls_ssl_conf_curves(conf, curve[ADAPTER_CURVE_SECP256R1]);
+     mbedtls_ssl_conf_min_version(conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3);
++#ifdef MBEDTLS_SSL_RENEGOTIATION
+     mbedtls_ssl_conf_renegotiation(conf, MBEDTLS_SSL_RENEGOTIATION_DISABLED);
++#endif
+     mbedtls_ssl_conf_authmode(conf, MBEDTLS_SSL_VERIFY_REQUIRED);
+ #if !defined(NDEBUG) || defined(TB_LOG)
diff --git a/net/iotivity/patches/075-ssl-enable-usage-of-patched-mbed-functions-condition.patch b/net/iotivity/patches/075-ssl-enable-usage-of-patched-mbed-functions-condition.patch
new file mode 100644 (file)
index 0000000..0cbd1ed
--- /dev/null
@@ -0,0 +1,44 @@
+From 01796db0b166e720860eff200acabff410ba6979 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 4 Dec 2016 00:15:21 +0100
+Subject: [PATCH 4/7] ssl: enable usage of patched mbed functions conditionally
+
+Only activate support for the MBEDTLS_KEY_EXCHANGE_ECDH_ANON_ENABLED
+cipher suite when this is actually available in mbedtls.
+This makes it possible to compile IoTivity against a unpatched mbedtls
+version.
+
+Change-Id: Ic56d7faf7597cc5dc08f9d55be29dde898949609
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
++++ b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
+@@ -237,7 +237,9 @@ int tlsCipher[ADAPTER_CIPHER_MAX][2] =
+ {
+     {MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA, 0},
+     {MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8, 0},
++#ifdef MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256
+     {MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256, 0},
++#endif
+     {MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, 0},
+     {MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM, 0},
+     {MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, 0}
+@@ -1943,6 +1945,7 @@ CAResult_t CAsetTlsCipherSuite(const uin
+             g_caSslContext->cipher = ADAPTER_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8;
+             break;
+         }
++#ifdef MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256
+         case MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256:
+         {
+ #ifdef __WITH_TLS__
+@@ -1960,6 +1963,7 @@ CAResult_t CAsetTlsCipherSuite(const uin
+             g_caSslContext->cipher = ADAPTER_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA_256;
+             break;
+         }
++#endif
+         case MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256:
+         {
+ #if 0 // PIN OTM
diff --git a/net/iotivity/patches/078-use-system-mbedtls.patch b/net/iotivity/patches/078-use-system-mbedtls.patch
new file mode 100644 (file)
index 0000000..d19c688
--- /dev/null
@@ -0,0 +1,22 @@
+Make it possible to use system mbedtls version
+
+--- a/resource/csdk/connectivity/src/SConscript
++++ b/resource/csdk/connectivity/src/SConscript
+@@ -73,16 +73,7 @@ if env.get('SECURED') == '1':
+       env.AppendUnique(CPPPATH = [src_dir + '/resource/csdk/security/include'])
+       env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
+       env.AppendUnique(CPPPATH = [os.path.join(root_dir, 'external/inc')])
+-      tls_path = 'extlibs/mbedtls';
+-      tls_headers_path = 'mbedtls/include';
+-      if ca_os == 'tizen' and os.path.exists(root_dir + '/' + tls_path):
+-              env.SConscript(os.path.join(root_dir, tls_path + '/SConscript'))
+-              env.AppendUnique(CPPPATH = [os.path.join(root_dir, tls_path + '/' + tls_headers_path)])
+-      else:
+-              if ca_os != 'android':
+-                      env.SConscript('#' + tls_path + '/SConscript')
+-              env.AppendUnique(CPPPATH = ['#' + tls_path + '/' + tls_headers_path])
+-              env.AppendUnique(CA_SRC = [os.path.join(ca_path, 'adapter_util/ca_adapter_net_ssl.c')])
++      env.AppendUnique(CA_SRC = [os.path.join(ca_path, 'adapter_util/ca_adapter_net_ssl.c')])
+ if ((secured == '1') and (with_tcp == True)):
+       env.AppendUnique(CPPDEFINES = ['__WITH_TLS__'])
diff --git a/net/iotivity/patches/080-zigbee_wrapper-do-not-check-for-floating-point.patch b/net/iotivity/patches/080-zigbee_wrapper-do-not-check-for-floating-point.patch
new file mode 100644 (file)
index 0000000..e5a95f0
--- /dev/null
@@ -0,0 +1,31 @@
+From df8360447163762c63994dcb07f9e69a5a365a1c Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 8 Jan 2017 22:01:57 +0100
+Subject: [PATCH 8/8] zigbee_wrapper: do not check for floating point
+
+This makes the compile fail for soft float builds. In such builds the
+double is still 64 bit long.
+
+Change-Id: I45d3f19b49f5d23d2b65307738a362765c5ea1c2
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ plugins/zigbee_wrapper/src/zigbee_wrapper.c | 8 --------
+ 1 file changed, 8 deletions(-)
+
+--- a/plugins/zigbee_wrapper/src/zigbee_wrapper.c
++++ b/plugins/zigbee_wrapper/src/zigbee_wrapper.c
+@@ -37,14 +37,6 @@
+ #include <math.h>
+ #include <errno.h>
+-// The following #define must be here under "math.h".
+-// This ifdef ensures that "__STDC_IEC_559__" is defined. If it is defined,
+-// then we are guaranteed that the 'double' type is 64-bit. Otherwise, the
+-// compilation of this file should fail because we are no longer guaranteed.
+-#ifndef __STDC_IEC_559__
+-#error "Requires IEEE 754 floating point!"
+-#endif
+-
+ #include "zigbee_wrapper.h"
+ #include "telegesis_wrapper.h"
+ #include "pluginlist.h"
diff --git a/net/iotivity/patches/140-remove-glib2.patch b/net/iotivity/patches/140-remove-glib2.patch
new file mode 100644 (file)
index 0000000..1b009db
--- /dev/null
@@ -0,0 +1,32 @@
+--- a/resource/csdk/connectivity/src/bt_le_adapter/linux/SConscript
++++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/SConscript
+@@ -73,7 +73,6 @@ env.AppendUnique(
+ # The Linux BLE adapter implementation uses GDBus to make D-Bus based
+ # method calls to BlueZ.  Pull in the necessary dependencies.
+-env.ParseConfig("pkg-config gio-unix-2.0 --cflags --libs")
+ # Set up commands to generate GDBus code from the D-Bus introspection
+ # XML.
+--- a/resource/csdk/security/provisioning/sample/SConscript
++++ b/resource/csdk/security/provisioning/sample/SConscript
+@@ -70,7 +70,6 @@ if target_os not in ['windows']:
+ if target_os not in ['msys_nt', 'windows']:
+       provisioning_env.AppendUnique(LIBS = ['dl', 'm'])
+-      provisioning_env.ParseConfig('pkg-config --libs glib-2.0');
+       provisioning_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
+ else:
+       provisioning_env.AppendUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource', 'csdk')])
+--- a/resource/csdk/security/provisioning/SConscript
++++ b/resource/csdk/security/provisioning/SConscript
+@@ -73,9 +73,6 @@ provisioning_env.PrependUnique(LIBS = ['
+ provisioning_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
+-if target_os not in ['msys_nt', 'windows', 'android', 'ios']:
+-      provisioning_env.ParseConfig('pkg-config --libs glib-2.0')
+-
+ if target_os in ['windows', 'msys_nt']:
+       provisioning_env.AppendUnique(LIBS = ['ws2_32', 'advapi32', 'iphlpapi'])
diff --git a/net/iotivity/patches/200-examples-OICMiddle-try-to-load-security-configuratio.patch b/net/iotivity/patches/200-examples-OICMiddle-try-to-load-security-configuratio.patch
new file mode 100644 (file)
index 0000000..4bcd322
--- /dev/null
@@ -0,0 +1,44 @@
+From ce27d50b9c11386242487852f14b025ed6c67701 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
+Date: Wed, 19 Aug 2015 16:47:21 +0200
+Subject: [PATCH 14/14] examples: OICMiddle: try to load security
+ configuration by default
+
+Load the security configuration from the default location by default.
+When it is not found security will just not work.
+
+Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
+---
+ examples/OICMiddle/OICMiddle.cpp |    9 ++++++++-
+ examples/OICMiddle/OICMiddle.h   |    1 +
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+--- a/examples/OICMiddle/OICMiddle.cpp
++++ b/examples/OICMiddle/OICMiddle.cpp
+@@ -99,8 +99,15 @@ void Middle::startPlatform()
+     //std::string ipaddr = INADDR_ANY;
+     std::string ipaddr = "0.0.0.0";
++    // Initialize Persistent Storage for SVR database
++    middle.ps.open = fopen;
++    middle.ps.read = fread;
++    middle.ps.write = fwrite;
++    middle.ps.close = fclose;
++    middle.ps.unlink = unlink;
++
+     PlatformConfig cfg { ServiceType::InProc, ModeType::Both,
+-                  ipaddr, port, QualityOfService::LowQos};
++                  ipaddr, port, QualityOfService::LowQos, &middle.ps};
+     OC::OCPlatform::Configure(cfg);
+ }
+--- a/examples/OICMiddle/OICMiddle.h
++++ b/examples/OICMiddle/OICMiddle.h
+@@ -83,6 +83,7 @@ protected:
+     MiddleServer *m_server;
+     LineInput *m_lineInput;
+     RestInput *m_restInput;
++    OCPersistentStorage ps;
+ protected:
+     void startPlatform();
diff --git a/net/lighttpd/Makefile b/net/lighttpd/Makefile
deleted file mode 100644 (file)
index 61fca9e..0000000
+++ /dev/null
@@ -1,188 +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:=lighttpd
-PKG_VERSION:=1.4.45
-PKG_RELEASE:=3
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://download.lighttpd.net/lighttpd/releases-1.4.x
-PKG_MD5SUM:=a128e1eda76899ce3fd115efae5fe631
-
-PKG_LICENSE:=BSD-3c
-PKG_LICENSE_FILES:=COPYING
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-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
-
-CONFIGURE_ARGS+= \
-       --libdir=/usr/lib/lighttpd \
-       --sysconfdir=/etc/lighttpd \
-       --enable-shared \
-       --enable-static \
-       --disable-rpath \
-       --without-attr \
-       --without-bzip2 \
-       --without-fam \
-       --without-gdbm \
-       --without-ldap \
-       --with-lua \
-       --without-memcache \
-       --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"
-else
-  CONFIGURE_ARGS+= \
-       --without-openssl
-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-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 dirlisting indexfile staticfile; 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
-
-  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
-
-  $$(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))
-
-# 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,+liblua,30))
-$(eval $(call BuildPlugin,compress,Compress output,+PACKAGE_lighttpd-mod-compress:zlib,30))
-$(eval $(call BuildPlugin,evasive,Evasive,,30))
-$(eval $(call BuildPlugin,evhost,Exnhanced 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,magnet,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,+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,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
deleted file mode 100644 (file)
index 04b06bc..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-server.modules = (
-)
-
-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",
-                                "index.lighttpd.html" )
-
-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      = "write"
-
-### 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_shell "cat /etc/lighttpd/conf.d/*.conf"
diff --git a/net/lighttpd/files/lighttpd.init b/net/lighttpd/files/lighttpd.init
deleted file mode 100644 (file)
index 936c7f6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006-2011 OpenWrt.org
-
-SERVICE_USE_PID=1
-
-START=50
-
-start() {
-       user_exists http || user_add http
-       [ -d /var/log/lighttpd ] || {
-               mkdir -m 0775 -p /var/log/lighttpd
-               chgrp www-data /var/log/lighttpd
-       }
-       service_start /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
-}
-
-stop() {
-       service_stop /usr/sbin/lighttpd
-}
-
diff --git a/net/lighttpd/patches/0001-mod_cgi-RFC3875-CGI-local-redir-strict-adherence-210.patch b/net/lighttpd/patches/0001-mod_cgi-RFC3875-CGI-local-redir-strict-adherence-210.patch
deleted file mode 100644 (file)
index 9b797ac..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-From dde50f1939e22926d17342b5d812e9a3034e7e98 Mon Sep 17 00:00:00 2001
-From: Glenn Strauss <gstrauss@gluelogic.com>
-Date: Wed, 25 Jan 2017 11:22:39 -0500
-Subject: [PATCH] [mod_cgi] RFC3875 CGI local-redir strict adherence (#2108)
-
-RFC3875 CGI local-redir stricter adherence
-
-do not apply local-redir if any response headers besides "Location"
-do not apply local-redir if any response body has been received
-(though it might not have been received yet, and we do not wait to find
- out, if lighttpd is configured to stream response body back to client)
-
-x-ref:
-  RFC3875 CGI 1.1 specification section 6.2.2 Local Redirect Response
-  http://www.ietf.org/rfc/rfc3875
-  "CGI local redirect not implemented correctly"
-  https://redmine.lighttpd.net/issues/2108
----
- src/mod_cgi.c | 25 ++++++++++++++++++++++++-
- 1 file changed, 24 insertions(+), 1 deletion(-)
-
---- a/src/mod_cgi.c
-+++ b/src/mod_cgi.c
-@@ -527,6 +527,27 @@ static int cgi_demux_response(server *sr
-                                       /* parse the response header */
-                                       cgi_response_parse(srv, con, p, hctx->response_header);
-+                                      /* [RFC3875] 6.2.2 Local Redirect Response
-+                                       *
-+                                       *    The CGI script can return a URI path and query-string
-+                                       *    ('local-pathquery') for a local resource in a Location header field.
-+                                       *    This indicates to the server that it should reprocess the request
-+                                       *    using the path specified.
-+                                       *
-+                                       *      local-redir-response = local-Location NL
-+                                       *
-+                                       *    The script MUST NOT return any other header fields or a message-body,
-+                                       *    and the server MUST generate the response that it would have produced
-+                                       *    in response to a request containing the URL
-+                                       *
-+                                       *      scheme "://" server-name ":" server-port local-pathquery
-+                                       *
-+                                       * (Might not have begun to receive body yet, but do skip local-redir
-+                                       *  if we already have started receiving a response body (blen > 0))
-+                                       * (Also, while not required by the RFC, do not send local-redir back
-+                                       *  to same URL, since CGI should have handled it internally if it
-+                                       *  really wanted to do that internally)
-+                                       */
-                                       if (con->http_status >= 300 && con->http_status < 400) {
-                                               /*(con->parsed_response & HTTP_LOCATION)*/
-                                               size_t ulen = buffer_string_length(con->uri.path);
-@@ -535,7 +556,9 @@ static int cgi_demux_response(server *sr
-                                                   && ds->value->ptr[0] == '/'
-                                                   && (0 != strncmp(ds->value->ptr, con->uri.path->ptr, ulen)
-                                                       || (ds->value->ptr[ulen] != '\0' && ds->value->ptr[ulen] != '/' && ds->value->ptr[ulen] != '?'))
--                                                  && NULL == array_get_element(con->response.headers, "Set-Cookie")) {
-+                                                  && 0 == blen
-+                                                  && !(con->parsed_response & HTTP_STATUS) /* no "Status" or NPH response line */
-+                                                  && 1 == con->response.headers->used) {
-                                                       if (++con->loops_per_request > 5) {
-                                                               log_error_write(srv, __FILE__, __LINE__, "sb", "too many internal loops while processing request:", con->request.orig_uri);
-                                                               con->http_status = 500; /* Internal Server Error */
diff --git a/net/lighttpd/patches/0002-mod_cgi-fix-CGI-local-redir-w-url.rewrite-once-fixes.patch b/net/lighttpd/patches/0002-mod_cgi-fix-CGI-local-redir-w-url.rewrite-once-fixes.patch
deleted file mode 100644 (file)
index e8e1cef..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-From ab85841b142c62c47f69fc45c0b54f080d54ddc9 Mon Sep 17 00:00:00 2001
-From: Glenn Strauss <gstrauss@gluelogic.com>
-Date: Mon, 20 Feb 2017 14:47:13 -0500
-Subject: [PATCH] [mod_cgi] fix CGI local-redir w/ url.rewrite-once (fixes
- #2793)
-
-x-ref:
-  "1.4.40 regression: broken redirect (using Location) between url.rewrite-once URLs"
-  https://redmine.lighttpd.net/issues/2793
----
- src/mod_cgi.c | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
---- a/src/mod_cgi.c
-+++ b/src/mod_cgi.c
-@@ -583,8 +583,7 @@ static int cgi_demux_response(server *sr
-                                                       }
-                                                       connection_response_reset(srv, con); /*(includes con->http_status = 0)*/
--
--                                                      con->mode = DIRECT;
-+                                                      plugins_call_connection_reset(srv, con);
-                                                       return FDEVENT_HANDLED_COMEBACK;
-                                               }
-                                       }
-@@ -803,7 +802,7 @@ static int cgi_recv_response(server *srv
-                       /* if we get a IN|HUP and have read everything don't exec the close twice */
-                       return HANDLER_FINISHED;
-               case FDEVENT_HANDLED_COMEBACK:
--                      cgi_connection_close(srv, hctx);
-+                      /*cgi_connection_close(srv, hctx);*//*(already cleaned up and hctx is now invalid)*/
-                       return HANDLER_COMEBACK;
-               case FDEVENT_HANDLED_ERROR:
-                       log_error_write(srv, __FILE__, __LINE__, "s", "demuxer failed: ");
diff --git a/net/lighttpd/patches/0003-mod_cgi-status-200-OK-if-no-hdrs-deprecated-2786.patch b/net/lighttpd/patches/0003-mod_cgi-status-200-OK-if-no-hdrs-deprecated-2786.patch
deleted file mode 100644 (file)
index 7e7d9ee..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-From 51ff7ac504f7001dc54807f9b2a72de891ab9ee5 Mon Sep 17 00:00:00 2001
-From: Glenn Strauss <gstrauss@gluelogic.com>
-Date: Wed, 22 Feb 2017 11:58:21 -0500
-Subject: [PATCH] [mod_cgi] status 200 OK if no hdrs (deprecated) (#2786)
-
-set status 200 OK if CGI does not return CGI headers
-
-Note:
-This mode in lighttpd is deprecated and may be removed in the next major
-release of lighttpd.  CGI scripts should return a proper CGI header in
-the response, even if that header is empty and followed by a blank line,
-before return response body.
-
-Without a proper CGI response header, the first line(s) of the response
-might be incorrectly construed as being CGI response headers, especially
-if they contain ':', and response may be corrupted.  That is why this
-mode is deprecated (and not supported in numerous other web servers).
-
-The minimal valid CGI response header is "\n", which lighttpd will treat
-as equivalent to "Status: 200\n\n"
-
-x-ref:
-  "error 500 (mod_cgi.c.601) cgi died"
-  https://redmine.lighttpd.net/issues/2786
----
- src/mod_cgi.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/src/mod_cgi.c
-+++ b/src/mod_cgi.c
-@@ -502,6 +502,7 @@ static int cgi_demux_response(server *sr
-                                       if (0 != http_chunk_append_buffer(srv, con, hctx->response_header)) {
-                                               return FDEVENT_HANDLED_ERROR;
-                                       }
-+                                      if (0 == con->http_status) con->http_status = 200; /* OK */
-                               } else {
-                                       const char *bstart;
-                                       size_t blen;
-@@ -846,6 +847,7 @@ static handler_t cgi_handle_fdevent(serv
-                               cgi_connection_close(srv, hctx);
-                               return HANDLER_ERROR;
-                       }
-+                      if (0 == con->http_status) con->http_status = 200; /* OK */
-               } else {
- # if 0
-                       log_error_write(srv, __FILE__, __LINE__, "sddd", "got HUP from cgi", con->fd, hctx->fd, revents);
diff --git a/net/lighttpd/patches/0004-mod_cgi-cgi.local-redir-enable-disable-2108-2793.patch b/net/lighttpd/patches/0004-mod_cgi-cgi.local-redir-enable-disable-2108-2793.patch
deleted file mode 100644 (file)
index 327b080..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-From 57ab20ace504fdb6e0944ef6fa6e0ce35adc4446 Mon Sep 17 00:00:00 2001
-From: Glenn Strauss <gstrauss@gluelogic.com>
-Date: Sun, 26 Feb 2017 17:49:47 -0500
-Subject: [PATCH] [mod_cgi] cgi.local-redir = [enable|disable] (#2108, #2793)
-
-new directive cgi.local-redir = [enable|disable]
-
-*disable* RFC3875 6.2.2 local-redir by default.
-(behavior change from when local-redir support added in lighttpd 1.4.40)
-
-The reason for this behavior change is that CGI local-redir support
-(RFC3875 6.2.2) is an optimization.  Absence of support may result in
-additional latency in servicing a request due the additional round-trip
-to the client, but that was the prior behavior (before lighttpd 1.4.40)
-and is the behavior of web servers which do not support CGI local-redir.
-
-However, enabling CGI local-redir by default may result in broken links
-in the case where a user config (unaware of CGI local-redir behavior)
-returns HTML pages containing *relative* paths (not root-relative paths)
-which are relative to the location of the local-redir target document,
-and the local-redir target document is located at a different URL-path
-from the original CGI request.
-
-x-ref:
-  RFC3875 CGI 1.1 specification section 6.2.2 Local Redirect Response
-  http://www.ietf.org/rfc/rfc3875
-  "CGI local redirect not implemented correctly"
-  https://redmine.lighttpd.net/issues/2108
-  "1.4.40 regression: broken redirect (using Location) between url.rewrite-once URLs"
-  https://redmine.lighttpd.net/issues/2793
----
- src/mod_cgi.c       | 9 ++++++++-
- tests/lighttpd.conf | 1 +
- 2 files changed, 9 insertions(+), 1 deletion(-)
-
---- a/src/mod_cgi.c
-+++ b/src/mod_cgi.c
-@@ -66,6 +66,7 @@ typedef struct {
- typedef struct {
-       array *cgi;
-       unsigned short execute_x_only;
-+      unsigned short local_redir;
-       unsigned short xsendfile_allow;
-       array *xsendfile_docroot;
- } plugin_config;
-@@ -172,6 +173,7 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_default
-               { "cgi.execute-x-only",          NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },     /* 1 */
-               { "cgi.x-sendfile",              NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },     /* 2 */
-               { "cgi.x-sendfile-docroot",      NULL, T_CONFIG_ARRAY,   T_CONFIG_SCOPE_CONNECTION },     /* 3 */
-+              { "cgi.local-redir",             NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },     /* 4 */
-               { NULL,                          NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET}
-       };
-@@ -189,6 +191,7 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_default
-               s->cgi    = array_init();
-               s->execute_x_only = 0;
-+              s->local_redir    = 0;
-               s->xsendfile_allow= 0;
-               s->xsendfile_docroot = array_init();
-@@ -196,6 +199,7 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_default
-               cv[1].destination = &(s->execute_x_only);
-               cv[2].destination = &(s->xsendfile_allow);
-               cv[3].destination = s->xsendfile_docroot;
-+              cv[4].destination = &(s->local_redir);
-               p->config_storage[i] = s;
-@@ -549,7 +553,7 @@ static int cgi_demux_response(server *sr
-                                        *  to same URL, since CGI should have handled it internally if it
-                                        *  really wanted to do that internally)
-                                        */
--                                      if (con->http_status >= 300 && con->http_status < 400) {
-+                                      if (hctx->conf.local_redir && con->http_status >= 300 && con->http_status < 400) {
-                                               /*(con->parsed_response & HTTP_LOCATION)*/
-                                               size_t ulen = buffer_string_length(con->uri.path);
-                                               data_string *ds;
-@@ -1321,6 +1325,7 @@ static int mod_cgi_patch_connection(serv
-       PATCH(cgi);
-       PATCH(execute_x_only);
-+      PATCH(local_redir);
-       PATCH(xsendfile_allow);
-       PATCH(xsendfile_docroot);
-@@ -1340,6 +1345,8 @@ static int mod_cgi_patch_connection(serv
-                               PATCH(cgi);
-                       } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.execute-x-only"))) {
-                               PATCH(execute_x_only);
-+                      } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.local-redir"))) {
-+                              PATCH(local_redir);
-                       } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.x-sendfile"))) {
-                               PATCH(xsendfile_allow);
-                       } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.x-sendfile-docroot"))) {
---- a/tests/lighttpd.conf
-+++ b/tests/lighttpd.conf
-@@ -110,6 +110,7 @@ fastcgi.server = (
-       ) ),
- )
-+cgi.local-redir = "enable"
- cgi.assign = (
-       ".pl"  => env.PERL,
-       ".cgi" => env.PERL,
diff --git a/net/noddos/Makefile b/net/noddos/Makefile
deleted file mode 100644 (file)
index 7e05c3a..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#
-# 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.2
-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:=63fe85fc4a588da2d71b7b7db68f1c80ba19520467a3800bdb43bc516a6cff72
-
-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
-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 optionally upload anonimized traffic statistics for each device to the cloud.
-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.conf-base $(1)/etc/noddos
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/noddosconfig.pem $(1)/etc/noddos
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/noddos.conf-base $(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.conf ]; then
-                       rm /var/etc/noddos.conf
-               fi
-       fi
-       exit 0
-endef
-
-$(eval $(call BuildPackage,noddos))
diff --git a/net/ola/Makefile b/net/ola/Makefile
deleted file mode 100644 (file)
index 437380f..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-#
-# Copyright (C) 2006-2015 OpenWrt.org
-# Copyright (C) 2015 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.1
-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:=5b86f5802e2e5b23c6a010dc8d10788e6dc57614
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-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 +sudo
-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
deleted file mode 100644 (file)
index f1dff36..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/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 command sudo -u nobody /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-include-endian_h.patch b/net/ola/patches/001-include-endian_h.patch
deleted file mode 100644 (file)
index 784f10c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/common/network/NetworkUtils.cpp b/common/network/NetworkUtils.cpp
-index 3914818..094a311 100644
---- a/common/network/NetworkUtils.cpp
-+++ b/common/network/NetworkUtils.cpp
-@@ -39,6 +39,10 @@ typedef uint32_t in_addr_t;
- #include <resolv.h>
- #endif
-+#ifdef HAVE_ENDIAN_H
-+#include <endian.h>
-+#endif
-+
- #if defined(HAVE_LINUX_NETLINK_H) && defined(HAVE_LINUX_RTNETLINK_H)
- #define USE_NETLINK_FOR_DEFAULT_ROUTE 1
- #include <linux/netlink.h>
diff --git a/net/ola/patches/002-remove-visibility-inlines-hidden-flag.patch b/net/ola/patches/002-remove-visibility-inlines-hidden-flag.patch
deleted file mode 100644 (file)
index fe1acdf..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-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/ola/patches/003-Make-DNS-SD-functionality-optional-at-build-time.patch b/net/ola/patches/003-Make-DNS-SD-functionality-optional-at-build-time.patch
deleted file mode 100644 (file)
index 84878a1..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-From a88d6d31fc5a04be4378095e03b4aac133954026 Mon Sep 17 00:00:00 2001
-From: Christian Beier <dontmind@freeshell.org>
-Date: Tue, 15 Mar 2016 15:09:25 +0100
-Subject: [PATCH] Make DNS-SD functionality optional at build time.
-
-When building for embedded systems, for instance, we
-want to limit dependencies to a minimum and it seems
-that OLA is able to perform its core tasks without
-DNS-SD perfectly fine.
-
-Signed-off-by: Christian Beier <dontmind@freeshell.org>
----
- configure.ac | 27 +++++++++++++++------------
- 1 file changed, 15 insertions(+), 12 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 6654354..0d1947c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -411,23 +411,26 @@ AS_IF([test "x$use_ossp_uuid" = xyes],
- # DNS-SD support
- # We use either avahi or the Apple DNS-SD library.
--
--# dns_sd
--AC_CHECK_HEADER(
--  [dns_sd.h],
--  [AC_SEARCH_LIBS(DNSServiceRegister, [dns_sd], [have_dnssd="yes"])])
-+AC_ARG_WITH(dns-sd,
-+[AS_HELP_STRING([--without-dns-sd], [disable DNS-SD support])],,)
-+if test "x$with_dns_sd" != "xno"; then
-+      # dns_sd
-+      AC_CHECK_HEADER(
-+        [dns_sd.h],
-+        [AC_SEARCH_LIBS(DNSServiceRegister, [dns_sd], [have_dnssd="yes"])])
-+
-+      # avahi
-+      PKG_CHECK_MODULES(
-+        avahi,
-+        [avahi-client],
-+        [have_avahi="yes"],
-+        [true])
-+fi
- AS_IF([test "x$have_dnssd" = xyes],
-       [AC_DEFINE([HAVE_DNSSD], [1], [Defined to use Bonjour DNS_SD])])
- AM_CONDITIONAL([HAVE_DNSSD], [test "x$have_dnssd" = xyes])
--# avahi
--PKG_CHECK_MODULES(
--  avahi,
--  [avahi-client],
--  [have_avahi="yes"],
--  [true])
--
- AS_IF([test "x$have_avahi" = xyes],
-       [AC_DEFINE([HAVE_AVAHI], [1], [Defined to use Avahi])])
- AM_CONDITIONAL([HAVE_AVAHI], [test "x$have_avahi" = xyes])
--- 
-2.1.4
-
diff --git a/net/openconnect/Config.in b/net/openconnect/Config.in
deleted file mode 100644 (file)
index d73bd3a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-# 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
deleted file mode 100644 (file)
index 6095365..0000000
+++ /dev/null
@@ -1,78 +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:=openconnect
-PKG_VERSION:=7.08
-PKG_RELEASE:=3
-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 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 and ocserv.
-
-        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.
-endef
-
-CONFIGURE_ARGS += \
-       --disable-shared \
-       --with-vpnc-script=/lib/netifd/vpnc-script \
-       --without-libpcsclite \
-       --without-stoken \
-       --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
deleted file mode 100644 (file)
index 772b0e3..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-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'
-
-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
deleted file mode 100755 (executable)
index 082dfba..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/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
-
-pidfile=/var/run/ocwrap-$$.pid
-
-cleanup()
-{
-       if ! test -z "$pid";then
-               kill $pid
-               wait $pid
-       fi
-       exit 0
-}
-
-cleanup2()
-{
-       if ! test -z "$pid";then
-               kill -2 $pid
-               wait $pid
-       fi
-       exit 0
-}
-
-trap cleanup2 2
-trap cleanup 1 3 6 15
-
-rm -f "$pidfile"
-/usr/sbin/openconnect $* <$pwfile &
-pid=$!
-
-wait $pid
diff --git a/net/openconnect/files/openconnect.sh b/net/openconnect/files/openconnect.sh
deleted file mode 100755 (executable)
index 0e3d90a..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/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_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 "os"
-       proto_config_add_string "csd_wrapper"
-       no_device=1
-       available=1
-}
-
-proto_openconnect_setup() {
-       local config="$1"
-
-       json_get_vars server port username serverhash authgroup password password2 token_mode token_secret os csd_wrapper mtu
-
-       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"
-       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"
-       }
-       [ -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" ] && {
-               umask 077
-               mkdir -p /var/etc
-               pwfile="/var/etc/openconnect-$config.passwd"
-               echo "$password" > "$pwfile"
-               [ -n "$password2" ] && echo "$password2" >> "$pwfile"
-               append cmdline "--passwd-on-stdin"
-       }
-
-       [ -n "$token_mode" ] && 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
deleted file mode 100644 (file)
index 01bad65..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/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/tor/Makefile b/net/tor/Makefile
new file mode 100644 (file)
index 0000000..b6ab886
--- /dev/null
@@ -0,0 +1,144 @@
+#
+# Copyright (C) 2008-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:=tor
+PKG_VERSION:=0.2.9.9
+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_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tor/Default
+  SECTION:=net
+  CATEGORY:=Network
+  URL:=https://www.torproject.org/
+  USERID:=tor=52:tor=52
+endef
+
+define Package/tor/Default/description
+ Tor is a toolset for a wide range of organizations and people that want to
+ improve their safety and security on the Internet. Using Tor can help you
+ anonymize web browsing and publishing, instant messaging, IRC, SSH, and
+ more. Tor also provides a platform on which software developers can build
+ new applications with built-in anonymity, safety, and privacy features.
+endef
+
+define Package/tor
+$(call Package/tor/Default)
+  TITLE:=An anonymous Internet communication system
+  DEPENDS:=+libevent2 +libopenssl +libpthread +librt +zlib +libcap
+endef
+
+define Package/tor/description
+$(call Package/tor/Default/description)
+ This package contains the tor daemon.
+endef
+
+define Package/tor-gencert
+$(call Package/tor/Default)
+  TITLE:=Tor certificate generation
+  DEPENDS:=+tor
+endef
+
+define Package/tor-gencert/description
+$(call Package/tor/Default/description)
+ Generate certs and keys for Tor directory authorities
+endef
+
+define Package/tor-resolve
+$(call Package/tor/Default)
+  TITLE:=tor hostname resolve
+  DEPENDS:=+tor
+endef
+
+define Package/tor-resolve/description
+$(call Package/tor/Default/description)
+ Resolve a hostname to an IP address via tor 
+endef
+
+define Package/tor-geoip
+$(call Package/tor/Default)
+  TITLE:=GeoIP db for tor
+  DEPENDS:=+tor
+endef
+
+define Package/tor-geoip/description
+$(call Package/tor/Default/description)
+ This package contains a GeoIP database mapping IP addresses to countries.
+endef
+
+define Package/tor/conffiles
+/etc/tor/torrc
+/var/lib/tor/fingerprint
+/var/lib/tor/keys/*
+endef
+
+CONFIGURE_ARGS += \
+       --with-libevent-dir="$(STAGING_DIR)/usr" \
+       --with-ssl-dir="$(STAGING_DIR)/usr" \
+       --with-openssl-dir="$(STAGING_DIR)/usr" \
+       --with-zlib-dir="$(STAGING_DIR)/usr" \
+       --disable-asciidoc \
+       --disable-seccomp \
+       --disable-libscrypt \
+       --disable-unittests \
+       --disable-largefile \
+       --with-tor-user=tor \
+       --with-tor-group=tor
+
+EXTRA_CFLAGS += -std=gnu99
+
+ifneq ($(CONFIG_SSP_SUPPORT),y)
+       CONFIGURE_ARGS += \
+               --disable-gcc-hardening
+else
+       EXTRA_CFLAGS += -fPIC
+endif
+
+CONFIGURE_VARS += \
+       CROSS_COMPILE="yes"
+
+define Package/tor/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/torify $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
+       $(INSTALL_DIR) $(1)/etc/tor
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
+endef
+
+define Package/tor-gencert/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-gencert $(1)/usr/sbin/
+endef
+
+define Package/tor-resolve/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-resolve $(1)/usr/sbin/
+endef
+
+define Package/tor-geoip/install
+       $(INSTALL_DIR) $(1)/usr/share/tor
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 $(1)/usr/share/tor/
+endef
+
+$(eval $(call BuildPackage,tor))
+$(eval $(call BuildPackage,tor-gencert))
+$(eval $(call BuildPackage,tor-resolve))
+$(eval $(call BuildPackage,tor-geoip))
diff --git a/net/tor/files/tor.init b/net/tor/files/tor.init
new file mode 100644 (file)
index 0000000..6974057
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2011 OpenWrt.org
+
+START=50
+STOP=50
+
+USE_PROCD=1
+
+start_service() {
+       [ -f /var/run/tor.pid ] || {
+               touch /var/run/tor.pid
+               chown tor:tor /var/run/tor.pid
+       }
+       [ -d /var/lib/tor ] || {
+               mkdir -m 0755 -p /var/lib/tor
+               chmod 0700 /var/lib/tor
+               chown tor:tor /var/lib/tor
+       }
+       [ -d /var/log/tor ] || {
+               mkdir -m 0755 -p /var/log/tor
+               chown tor:tor /var/log/tor
+       }
+       procd_open_instance
+       procd_set_param command /usr/sbin/tor --runasdaemon 0
+       procd_close_instance
+}
diff --git a/net/tor/patches/001-torrc.patch b/net/tor/patches/001-torrc.patch
new file mode 100644 (file)
index 0000000..1a784d2
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/src/config/torrc.sample.in
++++ b/src/config/torrc.sample.in
+@@ -39,7 +39,7 @@
+ ## Send every possible message to @LOCALSTATEDIR@/log/tor/debug.log
+ #Log debug file @LOCALSTATEDIR@/log/tor/debug.log
+ ## Use the system log instead of Tor's logfiles
+-#Log notice syslog
++Log notice syslog
+ ## To send all messages to stderr:
+ #Log debug stderr
+@@ -50,7 +50,7 @@
+ ## The directory for keeping all the keys/etc. By default, we store
+ ## things in $HOME/.tor on Unix, and in Application Data\tor on Windows.
+-#DataDirectory @LOCALSTATEDIR@/lib/tor
++DataDirectory @LOCALSTATEDIR@/lib/tor
+ ## 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
++User tor
diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile
new file mode 100644 (file)
index 0000000..8dacfeb
--- /dev/null
@@ -0,0 +1,110 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..2eb3024
--- /dev/null
@@ -0,0 +1,183 @@
+#!/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/sound/alsa-utils/Makefile b/sound/alsa-utils/Makefile
new file mode 100644 (file)
index 0000000..0c01a6e
--- /dev/null
@@ -0,0 +1,89 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=alsa-utils
+PKG_VERSION:=1.1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/utils/ \
+               http://alsa.cybermirror.org/utils/
+PKG_MD5SUM:=b9d6102fbbd0b68040bb77023ed30c0c
+PKG_INSTALL:=1
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/alsa-utils
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+alsa-lib +libncursesw +libpthread
+  TITLE:=ALSA (Advanced Linux Sound Architecture) utilities
+  URL:=http://www.alsa-project.org/
+endef
+
+define Package/alsa-utils-seq
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+alsa-lib +libpthread
+  TITLE:=ALSA sequencer utilities
+  URL:=http://www.alsa-project.org/
+endef
+
+define Package/alsa-utils-tests
+  SECTION:=sound
+  CATEGORY:=Sound
+  TITLE:=ALSA utilities test data (adds ~1.3M to image)
+  DEPENDS:=+alsa-lib +libpthread
+  URL:=http://www.alsa-project.org/
+endef
+
+CONFIGURE_ARGS+= \
+               --disable-rpath \
+               --disable-alsatest \
+               --disable-bat \
+               --disable-xmlto \
+               --with-curses=ncursesw
+
+define Package/alsa-utils/install
+       $(INSTALL_DIR) $(1)/usr/{s,}bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amixer $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/alsamixer $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aplay $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/arecord $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/alsactl $(1)/usr/sbin/
+
+       $(INSTALL_DIR) $(1)/usr/share/alsa/init
+       $(INSTALL_DATA) \
+           $(PKG_INSTALL_DIR)/usr/share/alsa/init/* \
+           $(1)/usr/share/alsa/init/
+endef
+
+define Package/alsa-utils-seq/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aconnect $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amidi $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aplaymidi $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/arecordmidi $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aseqdump $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aseqnet $(1)/usr/bin/
+endef
+
+define Package/alsa-utils-tests/install
+       $(INSTALL_DIR) $(1)/usr/{s,}bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/speaker-test $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/share/sounds/alsa
+       $(INSTALL_DATA) \
+           $(PKG_INSTALL_DIR)/usr/share/sounds/alsa/* \
+           $(1)/usr/share/sounds/alsa/
+endef
+
+$(eval $(call BuildPackage,alsa-utils))
+$(eval $(call BuildPackage,alsa-utils-seq))
+$(eval $(call BuildPackage,alsa-utils-tests))
diff --git a/sound/alsa-utils/patches/100-uClibc-compat.patch b/sound/alsa-utils/patches/100-uClibc-compat.patch
new file mode 100644 (file)
index 0000000..987c9b8
--- /dev/null
@@ -0,0 +1,23 @@
+--- a/alsamixer/volume_mapping.c
++++ b/alsamixer/volume_mapping.c
+@@ -114,9 +114,9 @@ static double get_normalized_volume(snd_
+       if (use_linear_dB_scale(min, max))
+               return (value - min) / (double)(max - min);
+-      normalized = exp10((value - max) / 6000.0);
++      normalized = pow(10, (value - max) / 6000.0);
+       if (min != SND_CTL_TLV_DB_GAIN_MUTE) {
+-              min_norm = exp10((min - max) / 6000.0);
++              min_norm = pow(10, (min - max) / 6000.0);
+               normalized = (normalized - min_norm) / (1 - min_norm);
+       }
+@@ -149,7 +149,7 @@ static int set_normalized_volume(snd_mix
+       }
+       if (min != SND_CTL_TLV_DB_GAIN_MUTE) {
+-              min_norm = exp10((min - max) / 6000.0);
++              min_norm = pow(10, (min - max) / 6000.0);
+               volume = volume * (1 - min_norm) + min_norm;
+       }
+       value = lrint_dir(6000.0 * log10(volume), dir) + max;
diff --git a/sound/espeak/Makefile b/sound/espeak/Makefile
new file mode 100644 (file)
index 0000000..fd06c6e
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# 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:=espeak
+PKG_VERSION:=1.48.04
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-source.zip
+PKG_SOURCE_URL:=@SF/espeak
+PKG_MD5SUM:=cadd7482eaafe9239546bdc09fa244c3
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=License.txt
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-source
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/espeak
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+libpthread +libstdcpp +portaudio
+  TITLE:=Speech synthesizer
+  URL:=http://espeak.sourceforge.net/
+endef
+
+define Package/espeak/description
+ eSpeak is a compact open source software speech synthesizer for English and
+ other languages.
+endef
+
+MAKE_FLAGS+= \
+       AUDIO="portaudio" \
+       DATADIR="/usr/share/espeak" \
+       CXXFLAGS="$(TARGET_CFLAGS)" \
+       LDFLAGS="$(TARGET_LDFLAGS)" \
+
+MAKE_PATH:=./src
+
+define Package/espeak/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/espeak $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libespeak.so.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/share
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/espeak $(1)/usr/share/
+endef
+
+$(eval $(call BuildPackage,espeak))
diff --git a/sound/espeak/patches/101-portaudio.patch b/sound/espeak/patches/101-portaudio.patch
new file mode 100644 (file)
index 0000000..ff396b3
--- /dev/null
@@ -0,0 +1,2093 @@
+--- a/src/portaudio.h
++++ /dev/null
+@@ -1,466 +0,0 @@
+-// NOTE: Copy this file to  portaudio.h  in order to compile with V18 portaudio
+-
+-
+-#ifndef PORT_AUDIO_H
+-#define PORT_AUDIO_H
+-
+-#ifdef __cplusplus
+-extern "C"
+-{
+-#endif /* __cplusplus */
+-
+-/*
+- * $Id: portaudio.h,v 1.5 2002/03/26 18:04:22 philburk Exp $
+- * PortAudio Portable Real-Time Audio Library
+- * PortAudio API Header File
+- * Latest version available at: http://www.audiomulch.com/portaudio/
+- *
+- * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
+- *
+- * 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.
+- *
+- * Any person wishing to distribute modifications to the Software is
+- * requested to send the modifications to the original developer so that
+- * they can be incorporated into the canonical version.
+- *
+- * 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.
+- *
+- */
+-
+-typedef int PaError;
+-typedef enum {
+-    paNoError = 0,
+-
+-    paHostError = -10000,
+-    paInvalidChannelCount,
+-    paInvalidSampleRate,
+-    paInvalidDeviceId,
+-    paInvalidFlag,
+-    paSampleFormatNotSupported,
+-    paBadIODeviceCombination,
+-    paInsufficientMemory,
+-    paBufferTooBig,
+-    paBufferTooSmall,
+-    paNullCallback,
+-    paBadStreamPtr,
+-    paTimedOut,
+-    paInternalError,
+-    paDeviceUnavailable
+-} PaErrorNum;
+-
+-/*
+- Pa_Initialize() is the library initialisation function - call this before
+- using the library.
+-
+-*/
+-
+-PaError Pa_Initialize( void );
+-
+-/*
+- Pa_Terminate() is the library termination function - call this after
+- using the library.
+-
+-*/
+-
+-PaError Pa_Terminate( void );
+-
+-/*
+- Pa_GetHostError() returns a host specific error code.
+- This can be called after receiving a PortAudio error code of paHostError.
+-
+-*/
+-
+-long Pa_GetHostError( void );
+-
+-/*
+- Pa_GetErrorText() translates the supplied PortAudio error number
+- into a human readable message.
+- 
+-*/
+-
+-const char *Pa_GetErrorText( PaError errnum );
+-
+-/*
+- Sample formats
+- 
+- These are formats used to pass sound data between the callback and the
+- stream. Each device has a "native" format which may be used when optimum
+- efficiency or control over conversion is required.
+- 
+- Formats marked "always available" are supported (emulated) by all 
+- PortAudio implementations.
+- 
+- The floating point representation (paFloat32) uses +1.0 and -1.0 as the 
+- maximum and minimum respectively.
+-
+- paUInt8 is an unsigned 8 bit format where 128 is considered "ground"
+-
+-*/
+-
+-typedef unsigned long PaSampleFormat;
+-#define paFloat32      ((PaSampleFormat) (1<<0)) /*always available*/
+-#define paInt16        ((PaSampleFormat) (1<<1)) /*always available*/
+-#define paInt32        ((PaSampleFormat) (1<<2)) /*always available*/
+-#define paInt24        ((PaSampleFormat) (1<<3))
+-#define paPackedInt24  ((PaSampleFormat) (1<<4))
+-#define paInt8         ((PaSampleFormat) (1<<5))
+-#define paUInt8        ((PaSampleFormat) (1<<6))
+-#define paCustomFormat ((PaSampleFormat) (1<<16))
+-
+-/*
+- Device enumeration mechanism.
+- 
+- Device ids range from 0 to Pa_CountDevices()-1.
+- 
+- Devices may support input, output or both.
+-
+-*/
+-
+-typedef int PaDeviceID;
+-#define paNoDevice -1
+-
+-int Pa_CountDevices( void );
+-
+-typedef struct
+-{
+-    int structVersion;
+-    const char *name;
+-    int maxInputChannels;
+-    int maxOutputChannels;
+-    /* Number of discrete rates, or -1 if range supported. */
+-    int numSampleRates;
+-    /* Array of supported sample rates, or {min,max} if range supported. */
+-    const double *sampleRates;
+-    PaSampleFormat nativeSampleFormats;
+-}
+-PaDeviceInfo;
+-
+-/*
+- Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID() return the
+- default device ids for input and output respectively, or paNoDevice if
+- no device is available.
+- The result can be passed to Pa_OpenStream().
+- 
+- On the PC, the user can specify a default device by
+- setting an environment variable. For example, to use device #1.
+- 
+-  set PA_RECOMMENDED_OUTPUT_DEVICE=1
+- 
+- The user should first determine the available device ids by using
+- the supplied application "pa_devs".
+-
+-*/
+-
+-PaDeviceID Pa_GetDefaultInputDeviceID( void );
+-PaDeviceID Pa_GetDefaultOutputDeviceID( void );
+-
+-
+-
+-/*
+- Pa_GetDeviceInfo() returns a pointer to an immutable PaDeviceInfo structure
+- for the device specified.
+- If the device parameter is out of range the function returns NULL.
+-
+- PortAudio manages the memory referenced by the returned pointer, the client
+- must not manipulate or free the memory. The pointer is only guaranteed to be
+- valid between calls to Pa_Initialize() and Pa_Terminate().
+-
+-*/
+-
+-const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID device );
+-
+-/*
+- PaTimestamp is used to represent a continuous sample clock with arbitrary
+- start time that can be used for syncronization. The type is used for the
+- outTime argument to the PortAudioCallback and as the result of Pa_StreamTime()
+-
+-*/
+-
+-typedef double PaTimestamp;
+-
+-/*
+- PortAudioCallback is implemented by PortAudio clients.
+- 
+- inputBuffer and outputBuffer are arrays of interleaved samples,
+- the format, packing and number of channels used by the buffers are
+- determined by parameters to Pa_OpenStream() (see below).
+- 
+- framesPerBuffer is the number of sample frames to be processed by the callback.
+- 
+- outTime is the time in samples when the buffer(s) processed by
+- this callback will begin being played at the audio output.
+- See also Pa_StreamTime()
+- 
+- userData is the value of a user supplied pointer passed to Pa_OpenStream()
+- intended for storing synthesis data etc.
+- 
+- return value:
+- The callback can return a non-zero value to stop the stream. This may be
+- useful in applications such as soundfile players where a specific duration
+- of output is required. However, it is not necessary to utilise this mechanism
+- as StopStream() will also terminate the stream. A callback returning a
+- non-zero value must fill the entire outputBuffer.
+- 
+- NOTE: None of the other stream functions may be called from within the
+- callback function except for Pa_GetCPULoad().
+-
+-*/
+-
+-typedef int (PortAudioCallback)(
+-    void *inputBuffer, void *outputBuffer,
+-    unsigned long framesPerBuffer,
+-    PaTimestamp outTime, void *userData );
+-
+-
+-/*
+- Stream flags
+- 
+- These flags may be supplied (ored together) in the streamFlags argument to
+- the Pa_OpenStream() function.
+-
+-*/
+-
+-#define   paNoFlag      (0)
+-#define   paClipOff     (1<<0)   /* disable default clipping of out of range samples */
+-#define   paDitherOff   (1<<1)   /* disable default dithering */
+-#define   paPlatformSpecificFlags (0x00010000)
+-typedef   unsigned long PaStreamFlags;
+-
+-/*
+- A single PortAudioStream provides multiple channels of real-time
+- input and output audio streaming to a client application.
+- Pointers to PortAudioStream objects are passed between PortAudio functions.
+-*/
+-
+-typedef void PortAudioStream;
+-#define PaStream PortAudioStream
+-
+-/*
+- Pa_OpenStream() opens a stream for either input, output or both.
+- 
+- stream is the address of a PortAudioStream pointer which will receive
+- a pointer to the newly opened stream.
+- 
+- inputDevice is the id of the device used for input (see PaDeviceID above.)
+- inputDevice may be paNoDevice to indicate that an input device is not required.
+- 
+- numInputChannels is the number of channels of sound to be delivered to the
+- callback. It can range from 1 to the value of maxInputChannels in the
+- PaDeviceInfo record for the device specified by the inputDevice parameter.
+- If inputDevice is paNoDevice numInputChannels is ignored.
+- 
+- inputSampleFormat is the sample format of inputBuffer provided to the callback
+- function. inputSampleFormat may be any of the formats described by the
+- PaSampleFormat enumeration (see above). PortAudio guarantees support for
+- the device's native formats (nativeSampleFormats in the device info record)
+- and additionally 16 and 32 bit integer and 32 bit floating point formats.
+- Support for other formats is implementation defined.
+- 
+- inputDriverInfo is a pointer to an optional driver specific data structure
+- containing additional information for device setup or stream processing.
+- inputDriverInfo is never required for correct operation. If not used
+- inputDriverInfo should be NULL.
+- 
+- outputDevice is the id of the device used for output (see PaDeviceID above.)
+- outputDevice may be paNoDevice to indicate that an output device is not required.
+- 
+- numOutputChannels is the number of channels of sound to be supplied by the
+- callback. See the definition of numInputChannels above for more details.
+- 
+- outputSampleFormat is the sample format of the outputBuffer filled by the
+- callback function. See the definition of inputSampleFormat above for more
+- details.
+- 
+- outputDriverInfo is a pointer to an optional driver specific data structure
+- containing additional information for device setup or stream processing.
+- outputDriverInfo is never required for correct operation. If not used
+- outputDriverInfo should be NULL.
+- 
+- sampleRate is the desired sampleRate. For full-duplex streams it is the
+- sample rate for both input and output
+- 
+- framesPerBuffer is the length in sample frames of all internal sample buffers
+- used for communication with platform specific audio routines. Wherever
+- possible this corresponds to the framesPerBuffer parameter passed to the
+- callback function.
+- 
+- numberOfBuffers is the number of buffers used for multibuffered communication
+- with the platform specific audio routines. If you pass zero, then an optimum
+- value will be chosen for you internally. This parameter is provided only
+- as a guide - and does not imply that an implementation must use multibuffered
+- i/o when reliable double buffering is available (such as SndPlayDoubleBuffer()
+- on the Macintosh.)
+- 
+- streamFlags may contain a combination of flags ORed together.
+- These flags modify the behaviour of the streaming process. Some flags may only
+- be relevant to certain buffer formats.
+- 
+- callback is a pointer to a client supplied function that is responsible
+- for processing and filling input and output buffers (see above for details.)
+- 
+- userData is a client supplied pointer which is passed to the callback
+- function. It could for example, contain a pointer to instance data necessary
+- for processing the audio buffers.
+- 
+- return value:
+- Upon success Pa_OpenStream() returns PaNoError and places a pointer to a
+- valid PortAudioStream in the stream argument. The stream is inactive (stopped).
+- If a call to Pa_OpenStream() fails a non-zero error code is returned (see
+- PaError above) and the value of stream is invalid.
+- 
+-*/
+-
+-PaError Pa_OpenStream( PortAudioStream** stream,
+-                       PaDeviceID inputDevice,
+-                       int numInputChannels,
+-                       PaSampleFormat inputSampleFormat,
+-                       void *inputDriverInfo,
+-                       PaDeviceID outputDevice,
+-                       int numOutputChannels,
+-                       PaSampleFormat outputSampleFormat,
+-                       void *outputDriverInfo,
+-                       double sampleRate,
+-                       unsigned long framesPerBuffer,
+-                       unsigned long numberOfBuffers,
+-                       PaStreamFlags streamFlags,
+-                       PortAudioCallback *callback,
+-                       void *userData );
+-
+-
+-/*
+- Pa_OpenDefaultStream() is a simplified version of Pa_OpenStream() that opens
+- the default input and/or output devices. Most parameters have identical meaning
+- to their Pa_OpenStream() counterparts, with the following exceptions:
+- 
+- If either numInputChannels or numOutputChannels is 0 the respective device
+- is not opened. This has the same effect as passing paNoDevice in the device
+- arguments to Pa_OpenStream().
+- 
+- sampleFormat applies to both the input and output buffers.
+-
+-*/
+-
+-PaError Pa_OpenDefaultStream( PortAudioStream** stream,
+-                              int numInputChannels,
+-                              int numOutputChannels,
+-                              PaSampleFormat sampleFormat,
+-                              double sampleRate,
+-                              unsigned long framesPerBuffer,
+-                              unsigned long numberOfBuffers,
+-                              PortAudioCallback *callback,
+-                              void *userData );
+-
+-/*
+- Pa_CloseStream() closes an audio stream, flushing any pending buffers.
+-
+-*/
+-
+-PaError Pa_CloseStream( PortAudioStream* );
+-
+-/*
+- Pa_StartStream() and Pa_StopStream() begin and terminate audio processing.
+- Pa_StopStream() waits until all pending audio buffers have been played.
+- Pa_AbortStream() stops playing immediately without waiting for pending
+- buffers to complete.
+-    
+-*/
+-
+-PaError Pa_StartStream( PortAudioStream *stream );
+-
+-PaError Pa_StopStream( PortAudioStream *stream );
+-
+-PaError Pa_AbortStream( PortAudioStream *stream );
+-
+-/*
+- Pa_StreamActive() returns one (1) when the stream is active (ie playing
+- or recording audio), zero (0) when not playing, or a negative error number
+- if the stream is invalid.
+- The stream is active between calls to Pa_StartStream() and Pa_StopStream(),
+- but may also become inactive if the callback returns a non-zero value.
+- In the latter case, the stream is considered inactive after the last
+- buffer has finished playing.
+- 
+-*/
+-
+-PaError Pa_StreamActive( PortAudioStream *stream );
+-
+-/*
+- Pa_StreamTime() returns the current output time in samples for the stream.
+- This time may be used as a time reference (for example synchronizing audio to
+- MIDI).
+- 
+-*/
+-
+-PaTimestamp Pa_StreamTime( PortAudioStream *stream );
+-
+-/*
+- Pa_GetCPULoad() returns the CPU Load for the stream.
+- The "CPU Load" is a fraction of total CPU time consumed by the stream's
+- audio processing routines including, but not limited to the client supplied
+- callback.
+- A value of 0.5 would imply that PortAudio and the sound generating
+- callback was consuming roughly 50% of the available CPU time.
+- This function may be called from the callback function or the application.
+- 
+-*/
+-
+-double Pa_GetCPULoad( PortAudioStream* stream );
+-
+-/*
+- Pa_GetMinNumBuffers() returns the minimum number of buffers required by
+- the current host based on minimum latency.
+- On the PC, for the DirectSound implementation, latency can be optionally set
+- by user by setting an environment variable.
+- For example, to set latency to 200 msec, put:
+- 
+-    set PA_MIN_LATENCY_MSEC=200
+- 
+- in the AUTOEXEC.BAT file and reboot.
+- If the environment variable is not set, then the latency will be determined
+- based on the OS. Windows NT has higher latency than Win95.
+- 
+-*/
+-
+-int Pa_GetMinNumBuffers( int framesPerBuffer, double sampleRate );
+-
+-/*
+- Pa_Sleep() puts the caller to sleep for at least 'msec' milliseconds.
+- You may sleep longer than the requested time so don't rely on this for
+- accurate musical timing.
+- 
+- Pa_Sleep() is provided as a convenience for authors of portable code (such as
+- the tests and examples in the PortAudio distribution.)
+- 
+-*/
+-
+-void Pa_Sleep( long msec );
+-
+-/*
+- Pa_GetSampleSize() returns the size in bytes of a single sample in the
+- supplied PaSampleFormat, or paSampleFormatNotSupported if the format is
+- no supported.
+-  
+-*/
+-
+-PaError Pa_GetSampleSize( PaSampleFormat format );
+-
+-
+-#ifdef __cplusplus
+-}
+-#endif /* __cplusplus */
+-#endif /* PORT_AUDIO_H */
+--- a/src/portaudio18.h
++++ /dev/null
+@@ -1,466 +0,0 @@
+-// NOTE: Copy this file to  portaudio.h  in order to compile with V18 portaudio
+-
+-
+-#ifndef PORT_AUDIO_H
+-#define PORT_AUDIO_H
+-
+-#ifdef __cplusplus
+-extern "C"
+-{
+-#endif /* __cplusplus */
+-
+-/*
+- * $Id: portaudio.h,v 1.5 2002/03/26 18:04:22 philburk Exp $
+- * PortAudio Portable Real-Time Audio Library
+- * PortAudio API Header File
+- * Latest version available at: http://www.audiomulch.com/portaudio/
+- *
+- * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
+- *
+- * 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.
+- *
+- * Any person wishing to distribute modifications to the Software is
+- * requested to send the modifications to the original developer so that
+- * they can be incorporated into the canonical version.
+- *
+- * 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.
+- *
+- */
+-
+-typedef int PaError;
+-typedef enum {
+-    paNoError = 0,
+-
+-    paHostError = -10000,
+-    paInvalidChannelCount,
+-    paInvalidSampleRate,
+-    paInvalidDeviceId,
+-    paInvalidFlag,
+-    paSampleFormatNotSupported,
+-    paBadIODeviceCombination,
+-    paInsufficientMemory,
+-    paBufferTooBig,
+-    paBufferTooSmall,
+-    paNullCallback,
+-    paBadStreamPtr,
+-    paTimedOut,
+-    paInternalError,
+-    paDeviceUnavailable
+-} PaErrorNum;
+-
+-/*
+- Pa_Initialize() is the library initialisation function - call this before
+- using the library.
+-
+-*/
+-
+-PaError Pa_Initialize( void );
+-
+-/*
+- Pa_Terminate() is the library termination function - call this after
+- using the library.
+-
+-*/
+-
+-PaError Pa_Terminate( void );
+-
+-/*
+- Pa_GetHostError() returns a host specific error code.
+- This can be called after receiving a PortAudio error code of paHostError.
+-
+-*/
+-
+-long Pa_GetHostError( void );
+-
+-/*
+- Pa_GetErrorText() translates the supplied PortAudio error number
+- into a human readable message.
+- 
+-*/
+-
+-const char *Pa_GetErrorText( PaError errnum );
+-
+-/*
+- Sample formats
+- 
+- These are formats used to pass sound data between the callback and the
+- stream. Each device has a "native" format which may be used when optimum
+- efficiency or control over conversion is required.
+- 
+- Formats marked "always available" are supported (emulated) by all 
+- PortAudio implementations.
+- 
+- The floating point representation (paFloat32) uses +1.0 and -1.0 as the 
+- maximum and minimum respectively.
+-
+- paUInt8 is an unsigned 8 bit format where 128 is considered "ground"
+-
+-*/
+-
+-typedef unsigned long PaSampleFormat;
+-#define paFloat32      ((PaSampleFormat) (1<<0)) /*always available*/
+-#define paInt16        ((PaSampleFormat) (1<<1)) /*always available*/
+-#define paInt32        ((PaSampleFormat) (1<<2)) /*always available*/
+-#define paInt24        ((PaSampleFormat) (1<<3))
+-#define paPackedInt24  ((PaSampleFormat) (1<<4))
+-#define paInt8         ((PaSampleFormat) (1<<5))
+-#define paUInt8        ((PaSampleFormat) (1<<6))
+-#define paCustomFormat ((PaSampleFormat) (1<<16))
+-
+-/*
+- Device enumeration mechanism.
+- 
+- Device ids range from 0 to Pa_CountDevices()-1.
+- 
+- Devices may support input, output or both.
+-
+-*/
+-
+-typedef int PaDeviceID;
+-#define paNoDevice -1
+-
+-int Pa_CountDevices( void );
+-
+-typedef struct
+-{
+-    int structVersion;
+-    const char *name;
+-    int maxInputChannels;
+-    int maxOutputChannels;
+-    /* Number of discrete rates, or -1 if range supported. */
+-    int numSampleRates;
+-    /* Array of supported sample rates, or {min,max} if range supported. */
+-    const double *sampleRates;
+-    PaSampleFormat nativeSampleFormats;
+-}
+-PaDeviceInfo;
+-
+-/*
+- Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID() return the
+- default device ids for input and output respectively, or paNoDevice if
+- no device is available.
+- The result can be passed to Pa_OpenStream().
+- 
+- On the PC, the user can specify a default device by
+- setting an environment variable. For example, to use device #1.
+- 
+-  set PA_RECOMMENDED_OUTPUT_DEVICE=1
+- 
+- The user should first determine the available device ids by using
+- the supplied application "pa_devs".
+-
+-*/
+-
+-PaDeviceID Pa_GetDefaultInputDeviceID( void );
+-PaDeviceID Pa_GetDefaultOutputDeviceID( void );
+-
+-
+-
+-/*
+- Pa_GetDeviceInfo() returns a pointer to an immutable PaDeviceInfo structure
+- for the device specified.
+- If the device parameter is out of range the function returns NULL.
+-
+- PortAudio manages the memory referenced by the returned pointer, the client
+- must not manipulate or free the memory. The pointer is only guaranteed to be
+- valid between calls to Pa_Initialize() and Pa_Terminate().
+-
+-*/
+-
+-const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID device );
+-
+-/*
+- PaTimestamp is used to represent a continuous sample clock with arbitrary
+- start time that can be used for syncronization. The type is used for the
+- outTime argument to the PortAudioCallback and as the result of Pa_StreamTime()
+-
+-*/
+-
+-typedef double PaTimestamp;
+-
+-/*
+- PortAudioCallback is implemented by PortAudio clients.
+- 
+- inputBuffer and outputBuffer are arrays of interleaved samples,
+- the format, packing and number of channels used by the buffers are
+- determined by parameters to Pa_OpenStream() (see below).
+- 
+- framesPerBuffer is the number of sample frames to be processed by the callback.
+- 
+- outTime is the time in samples when the buffer(s) processed by
+- this callback will begin being played at the audio output.
+- See also Pa_StreamTime()
+- 
+- userData is the value of a user supplied pointer passed to Pa_OpenStream()
+- intended for storing synthesis data etc.
+- 
+- return value:
+- The callback can return a non-zero value to stop the stream. This may be
+- useful in applications such as soundfile players where a specific duration
+- of output is required. However, it is not necessary to utilise this mechanism
+- as StopStream() will also terminate the stream. A callback returning a
+- non-zero value must fill the entire outputBuffer.
+- 
+- NOTE: None of the other stream functions may be called from within the
+- callback function except for Pa_GetCPULoad().
+-
+-*/
+-
+-typedef int (PortAudioCallback)(
+-    void *inputBuffer, void *outputBuffer,
+-    unsigned long framesPerBuffer,
+-    PaTimestamp outTime, void *userData );
+-
+-
+-/*
+- Stream flags
+- 
+- These flags may be supplied (ored together) in the streamFlags argument to
+- the Pa_OpenStream() function.
+-
+-*/
+-
+-#define   paNoFlag      (0)
+-#define   paClipOff     (1<<0)   /* disable default clipping of out of range samples */
+-#define   paDitherOff   (1<<1)   /* disable default dithering */
+-#define   paPlatformSpecificFlags (0x00010000)
+-typedef   unsigned long PaStreamFlags;
+-
+-/*
+- A single PortAudioStream provides multiple channels of real-time
+- input and output audio streaming to a client application.
+- Pointers to PortAudioStream objects are passed between PortAudio functions.
+-*/
+-
+-typedef void PortAudioStream;
+-#define PaStream PortAudioStream
+-
+-/*
+- Pa_OpenStream() opens a stream for either input, output or both.
+- 
+- stream is the address of a PortAudioStream pointer which will receive
+- a pointer to the newly opened stream.
+- 
+- inputDevice is the id of the device used for input (see PaDeviceID above.)
+- inputDevice may be paNoDevice to indicate that an input device is not required.
+- 
+- numInputChannels is the number of channels of sound to be delivered to the
+- callback. It can range from 1 to the value of maxInputChannels in the
+- PaDeviceInfo record for the device specified by the inputDevice parameter.
+- If inputDevice is paNoDevice numInputChannels is ignored.
+- 
+- inputSampleFormat is the sample format of inputBuffer provided to the callback
+- function. inputSampleFormat may be any of the formats described by the
+- PaSampleFormat enumeration (see above). PortAudio guarantees support for
+- the device's native formats (nativeSampleFormats in the device info record)
+- and additionally 16 and 32 bit integer and 32 bit floating point formats.
+- Support for other formats is implementation defined.
+- 
+- inputDriverInfo is a pointer to an optional driver specific data structure
+- containing additional information for device setup or stream processing.
+- inputDriverInfo is never required for correct operation. If not used
+- inputDriverInfo should be NULL.
+- 
+- outputDevice is the id of the device used for output (see PaDeviceID above.)
+- outputDevice may be paNoDevice to indicate that an output device is not required.
+- 
+- numOutputChannels is the number of channels of sound to be supplied by the
+- callback. See the definition of numInputChannels above for more details.
+- 
+- outputSampleFormat is the sample format of the outputBuffer filled by the
+- callback function. See the definition of inputSampleFormat above for more
+- details.
+- 
+- outputDriverInfo is a pointer to an optional driver specific data structure
+- containing additional information for device setup or stream processing.
+- outputDriverInfo is never required for correct operation. If not used
+- outputDriverInfo should be NULL.
+- 
+- sampleRate is the desired sampleRate. For full-duplex streams it is the
+- sample rate for both input and output
+- 
+- framesPerBuffer is the length in sample frames of all internal sample buffers
+- used for communication with platform specific audio routines. Wherever
+- possible this corresponds to the framesPerBuffer parameter passed to the
+- callback function.
+- 
+- numberOfBuffers is the number of buffers used for multibuffered communication
+- with the platform specific audio routines. If you pass zero, then an optimum
+- value will be chosen for you internally. This parameter is provided only
+- as a guide - and does not imply that an implementation must use multibuffered
+- i/o when reliable double buffering is available (such as SndPlayDoubleBuffer()
+- on the Macintosh.)
+- 
+- streamFlags may contain a combination of flags ORed together.
+- These flags modify the behaviour of the streaming process. Some flags may only
+- be relevant to certain buffer formats.
+- 
+- callback is a pointer to a client supplied function that is responsible
+- for processing and filling input and output buffers (see above for details.)
+- 
+- userData is a client supplied pointer which is passed to the callback
+- function. It could for example, contain a pointer to instance data necessary
+- for processing the audio buffers.
+- 
+- return value:
+- Upon success Pa_OpenStream() returns PaNoError and places a pointer to a
+- valid PortAudioStream in the stream argument. The stream is inactive (stopped).
+- If a call to Pa_OpenStream() fails a non-zero error code is returned (see
+- PaError above) and the value of stream is invalid.
+- 
+-*/
+-
+-PaError Pa_OpenStream( PortAudioStream** stream,
+-                       PaDeviceID inputDevice,
+-                       int numInputChannels,
+-                       PaSampleFormat inputSampleFormat,
+-                       void *inputDriverInfo,
+-                       PaDeviceID outputDevice,
+-                       int numOutputChannels,
+-                       PaSampleFormat outputSampleFormat,
+-                       void *outputDriverInfo,
+-                       double sampleRate,
+-                       unsigned long framesPerBuffer,
+-                       unsigned long numberOfBuffers,
+-                       PaStreamFlags streamFlags,
+-                       PortAudioCallback *callback,
+-                       void *userData );
+-
+-
+-/*
+- Pa_OpenDefaultStream() is a simplified version of Pa_OpenStream() that opens
+- the default input and/or output devices. Most parameters have identical meaning
+- to their Pa_OpenStream() counterparts, with the following exceptions:
+- 
+- If either numInputChannels or numOutputChannels is 0 the respective device
+- is not opened. This has the same effect as passing paNoDevice in the device
+- arguments to Pa_OpenStream().
+- 
+- sampleFormat applies to both the input and output buffers.
+-
+-*/
+-
+-PaError Pa_OpenDefaultStream( PortAudioStream** stream,
+-                              int numInputChannels,
+-                              int numOutputChannels,
+-                              PaSampleFormat sampleFormat,
+-                              double sampleRate,
+-                              unsigned long framesPerBuffer,
+-                              unsigned long numberOfBuffers,
+-                              PortAudioCallback *callback,
+-                              void *userData );
+-
+-/*
+- Pa_CloseStream() closes an audio stream, flushing any pending buffers.
+-
+-*/
+-
+-PaError Pa_CloseStream( PortAudioStream* );
+-
+-/*
+- Pa_StartStream() and Pa_StopStream() begin and terminate audio processing.
+- Pa_StopStream() waits until all pending audio buffers have been played.
+- Pa_AbortStream() stops playing immediately without waiting for pending
+- buffers to complete.
+-    
+-*/
+-
+-PaError Pa_StartStream( PortAudioStream *stream );
+-
+-PaError Pa_StopStream( PortAudioStream *stream );
+-
+-PaError Pa_AbortStream( PortAudioStream *stream );
+-
+-/*
+- Pa_StreamActive() returns one (1) when the stream is active (ie playing
+- or recording audio), zero (0) when not playing, or a negative error number
+- if the stream is invalid.
+- The stream is active between calls to Pa_StartStream() and Pa_StopStream(),
+- but may also become inactive if the callback returns a non-zero value.
+- In the latter case, the stream is considered inactive after the last
+- buffer has finished playing.
+- 
+-*/
+-
+-PaError Pa_StreamActive( PortAudioStream *stream );
+-
+-/*
+- Pa_StreamTime() returns the current output time in samples for the stream.
+- This time may be used as a time reference (for example synchronizing audio to
+- MIDI).
+- 
+-*/
+-
+-PaTimestamp Pa_StreamTime( PortAudioStream *stream );
+-
+-/*
+- Pa_GetCPULoad() returns the CPU Load for the stream.
+- The "CPU Load" is a fraction of total CPU time consumed by the stream's
+- audio processing routines including, but not limited to the client supplied
+- callback.
+- A value of 0.5 would imply that PortAudio and the sound generating
+- callback was consuming roughly 50% of the available CPU time.
+- This function may be called from the callback function or the application.
+- 
+-*/
+-
+-double Pa_GetCPULoad( PortAudioStream* stream );
+-
+-/*
+- Pa_GetMinNumBuffers() returns the minimum number of buffers required by
+- the current host based on minimum latency.
+- On the PC, for the DirectSound implementation, latency can be optionally set
+- by user by setting an environment variable.
+- For example, to set latency to 200 msec, put:
+- 
+-    set PA_MIN_LATENCY_MSEC=200
+- 
+- in the AUTOEXEC.BAT file and reboot.
+- If the environment variable is not set, then the latency will be determined
+- based on the OS. Windows NT has higher latency than Win95.
+- 
+-*/
+-
+-int Pa_GetMinNumBuffers( int framesPerBuffer, double sampleRate );
+-
+-/*
+- Pa_Sleep() puts the caller to sleep for at least 'msec' milliseconds.
+- You may sleep longer than the requested time so don't rely on this for
+- accurate musical timing.
+- 
+- Pa_Sleep() is provided as a convenience for authors of portable code (such as
+- the tests and examples in the PortAudio distribution.)
+- 
+-*/
+-
+-void Pa_Sleep( long msec );
+-
+-/*
+- Pa_GetSampleSize() returns the size in bytes of a single sample in the
+- supplied PaSampleFormat, or paSampleFormatNotSupported if the format is
+- no supported.
+-  
+-*/
+-
+-PaError Pa_GetSampleSize( PaSampleFormat format );
+-
+-
+-#ifdef __cplusplus
+-}
+-#endif /* __cplusplus */
+-#endif /* PORT_AUDIO_H */
+--- a/src/portaudio19.h
++++ /dev/null
+@@ -1,1127 +0,0 @@
+-// NOTE: Copy this file to  portaudio.h  in order to compile with V19 portaudio
+-
+-#ifndef PORTAUDIO_H
+-#define PORTAUDIO_H
+-/*
+- * $Id: portaudio.h 1061 2006-06-19 22:46:41Z lschwardt $
+- * PortAudio Portable Real-Time Audio Library
+- * PortAudio API Header File
+- * Latest version available at: http://www.portaudio.com/
+- *
+- * Copyright (c) 1999-2002 Ross Bencina and Phil Burk
+- *
+- * 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.
+- *
+- * Any person wishing to distribute modifications to the Software is
+- * requested to send the modifications to the original developer so that
+- * they can be incorporated into the canonical version.
+- *
+- * 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.
+- */
+-
+-/** @file
+- @brief The PortAudio API.
+-*/
+-
+-
+-#ifdef __cplusplus
+-extern "C"
+-{
+-#endif /* __cplusplus */
+-
+- 
+-/** Retrieve the release number of the currently running PortAudio build,
+- eg 1900.
+-*/
+-int Pa_GetVersion( void );
+-
+-
+-/** Retrieve a textual description of the current PortAudio build,
+- eg "PortAudio V19-devel 13 October 2002".
+-*/
+-const char* Pa_GetVersionText( void );
+-
+-
+-/** Error codes returned by PortAudio functions.
+- Note that with the exception of paNoError, all PaErrorCodes are negative.
+-*/
+-
+-typedef int PaError;
+-typedef enum PaErrorCode
+-{
+-    paNoError = 0,
+-
+-    paNotInitialized = -10000,
+-    paUnanticipatedHostError,
+-    paInvalidChannelCount,
+-    paInvalidSampleRate,
+-    paInvalidDevice,
+-    paInvalidFlag,
+-    paSampleFormatNotSupported,
+-    paBadIODeviceCombination,
+-    paInsufficientMemory,
+-    paBufferTooBig,
+-    paBufferTooSmall,
+-    paNullCallback,
+-    paBadStreamPtr,
+-    paTimedOut,
+-    paInternalError,
+-    paDeviceUnavailable,
+-    paIncompatibleHostApiSpecificStreamInfo,
+-    paStreamIsStopped,
+-    paStreamIsNotStopped,
+-    paInputOverflowed,
+-    paOutputUnderflowed,
+-    paHostApiNotFound,
+-    paInvalidHostApi,
+-    paCanNotReadFromACallbackStream,      /**< @todo review error code name */
+-    paCanNotWriteToACallbackStream,       /**< @todo review error code name */
+-    paCanNotReadFromAnOutputOnlyStream,   /**< @todo review error code name */
+-    paCanNotWriteToAnInputOnlyStream,     /**< @todo review error code name */
+-    paIncompatibleStreamHostApi,
+-    paBadBufferPtr
+-} PaErrorCode;
+-
+-
+-/** Translate the supplied PortAudio error code into a human readable
+- message.
+-*/
+-const char *Pa_GetErrorText( PaError errorCode );
+-
+-
+-/** Library initialization function - call this before using PortAudio.
+- This function initialises internal data structures and prepares underlying
+- host APIs for use. This function MUST be called before using any other
+- PortAudio API functions.
+-
+- If Pa_Initialize() is called multiple times, each successful 
+- call must be matched with a corresponding call to Pa_Terminate(). 
+- Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not 
+- required to be fully nested.
+-
+- Note that if Pa_Initialize() returns an error code, Pa_Terminate() should
+- NOT be called.
+-
+- @return paNoError if successful, otherwise an error code indicating the cause
+- of failure.
+-
+- @see Pa_Terminate
+-*/
+-PaError Pa_Initialize( void );
+-
+-
+-/** Library termination function - call this when finished using PortAudio.
+- This function deallocates all resources allocated by PortAudio since it was
+- initializied by a call to Pa_Initialize(). In cases where Pa_Initialise() has
+- been called multiple times, each call must be matched with a corresponding call
+- to Pa_Terminate(). The final matching call to Pa_Terminate() will automatically
+- close any PortAudio streams that are still open.
+-
+- Pa_Terminate() MUST be called before exiting a program which uses PortAudio.
+- Failure to do so may result in serious resource leaks, such as audio devices
+- not being available until the next reboot.
+-
+- @return paNoError if successful, otherwise an error code indicating the cause
+- of failure.
+- 
+- @see Pa_Initialize
+-*/
+-PaError Pa_Terminate( void );
+-
+-
+-
+-/** The type used to refer to audio devices. Values of this type usually
+- range from 0 to (Pa_DeviceCount-1), and may also take on the PaNoDevice
+- and paUseHostApiSpecificDeviceSpecification values.
+-
+- @see Pa_DeviceCount, paNoDevice, paUseHostApiSpecificDeviceSpecification
+-*/
+-typedef int PaDeviceIndex;
+-
+-
+-/** A special PaDeviceIndex value indicating that no device is available,
+- or should be used.
+-
+- @see PaDeviceIndex
+-*/
+-#define paNoDevice ((PaDeviceIndex)-1)
+-
+-
+-/** A special PaDeviceIndex value indicating that the device(s) to be used
+- are specified in the host api specific stream info structure.
+-
+- @see PaDeviceIndex
+-*/
+-#define paUseHostApiSpecificDeviceSpecification ((PaDeviceIndex)-2)
+-
+-
+-/* Host API enumeration mechanism */
+-
+-/** The type used to enumerate to host APIs at runtime. Values of this type
+- range from 0 to (Pa_GetHostApiCount()-1).
+-
+- @see Pa_GetHostApiCount
+-*/
+-typedef int PaHostApiIndex;
+-
+-
+-/** Retrieve the number of available host APIs. Even if a host API is
+- available it may have no devices available.
+-
+- @return A non-negative value indicating the number of available host APIs
+- or, a PaErrorCode (which are always negative) if PortAudio is not initialized
+- or an error is encountered.
+-
+- @see PaHostApiIndex
+-*/
+-PaHostApiIndex Pa_GetHostApiCount( void );
+-
+-
+-/** Retrieve the index of the default host API. The default host API will be
+- the lowest common denominator host API on the current platform and is
+- unlikely to provide the best performance.
+-
+- @return A non-negative value ranging from 0 to (Pa_GetHostApiCount()-1)
+- indicating the default host API index or, a PaErrorCode (which are always
+- negative) if PortAudio is not initialized or an error is encountered.
+-*/
+-PaHostApiIndex Pa_GetDefaultHostApi( void );
+-
+-
+-/** Unchanging unique identifiers for each supported host API. This type
+- is used in the PaHostApiInfo structure. The values are guaranteed to be
+- unique and to never change, thus allowing code to be written that
+- conditionally uses host API specific extensions.
+-
+- New type ids will be allocated when support for a host API reaches
+- "public alpha" status, prior to that developers should use the
+- paInDevelopment type id.
+-
+- @see PaHostApiInfo
+-*/
+-typedef enum PaHostApiTypeId
+-{
+-    paInDevelopment=0, /* use while developing support for a new host API */
+-    paDirectSound=1,
+-    paMME=2,
+-    paASIO=3,
+-    paSoundManager=4,
+-    paCoreAudio=5,
+-    paOSS=7,
+-    paALSA=8,
+-    paAL=9,
+-    paBeOS=10,
+-    paWDMKS=11,
+-    paJACK=12,
+-    paWASAPI=13,
+-    paAudioScienceHPI=14
+-} PaHostApiTypeId;
+-
+-
+-/** A structure containing information about a particular host API. */
+-
+-typedef struct PaHostApiInfo
+-{
+-    /** this is struct version 1 */
+-    int structVersion;
+-    /** The well known unique identifier of this host API @see PaHostApiTypeId */
+-    PaHostApiTypeId type;
+-    /** A textual description of the host API for display on user interfaces. */
+-    const char *name;
+-
+-    /**  The number of devices belonging to this host API. This field may be
+-     used in conjunction with Pa_HostApiDeviceIndexToDeviceIndex() to enumerate
+-     all devices for this host API.
+-     @see Pa_HostApiDeviceIndexToDeviceIndex
+-    */
+-    int deviceCount;
+-
+-    /** The default input device for this host API. The value will be a
+-     device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice
+-     if no default input device is available.
+-    */
+-    PaDeviceIndex defaultInputDevice;
+-
+-    /** The default output device for this host API. The value will be a
+-     device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice
+-     if no default output device is available.
+-    */
+-    PaDeviceIndex defaultOutputDevice;
+-    
+-} PaHostApiInfo;
+-
+-
+-/** Retrieve a pointer to a structure containing information about a specific
+- host Api.
+-
+- @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1)
+-
+- @return A pointer to an immutable PaHostApiInfo structure describing
+- a specific host API. If the hostApi parameter is out of range or an error
+- is encountered, the function returns NULL.
+-
+- The returned structure is owned by the PortAudio implementation and must not
+- be manipulated or freed. The pointer is only guaranteed to be valid between
+- calls to Pa_Initialize() and Pa_Terminate().
+-*/
+-const PaHostApiInfo * Pa_GetHostApiInfo( PaHostApiIndex hostApi );
+-
+-
+-/** Convert a static host API unique identifier, into a runtime
+- host API index.
+-
+- @param type A unique host API identifier belonging to the PaHostApiTypeId
+- enumeration.
+-
+- @return A valid PaHostApiIndex ranging from 0 to (Pa_GetHostApiCount()-1) or,
+- a PaErrorCode (which are always negative) if PortAudio is not initialized
+- or an error is encountered.
+- 
+- The paHostApiNotFound error code indicates that the host API specified by the
+- type parameter is not available.
+-
+- @see PaHostApiTypeId
+-*/
+-PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type );
+-
+-
+-/** Convert a host-API-specific device index to standard PortAudio device index.
+- This function may be used in conjunction with the deviceCount field of
+- PaHostApiInfo to enumerate all devices for the specified host API.
+-
+- @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1)
+-
+- @param hostApiDeviceIndex A valid per-host device index in the range
+- 0 to (Pa_GetHostApiInfo(hostApi)->deviceCount-1)
+-
+- @return A non-negative PaDeviceIndex ranging from 0 to (Pa_GetDeviceCount()-1)
+- or, a PaErrorCode (which are always negative) if PortAudio is not initialized
+- or an error is encountered.
+-
+- A paInvalidHostApi error code indicates that the host API index specified by
+- the hostApi parameter is out of range.
+-
+- A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter
+- is out of range.
+- 
+- @see PaHostApiInfo
+-*/
+-PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi,
+-        int hostApiDeviceIndex );
+-
+-
+-
+-/** Structure used to return information about a host error condition.
+-*/
+-typedef struct PaHostErrorInfo{
+-    PaHostApiTypeId hostApiType;    /**< the host API which returned the error code */
+-    long errorCode;                 /**< the error code returned */
+-    const char *errorText;          /**< a textual description of the error if available, otherwise a zero-length string */
+-}PaHostErrorInfo;
+-
+-
+-/** Return information about the last host error encountered. The error
+- information returned by Pa_GetLastHostErrorInfo() will never be modified
+- asyncronously by errors occurring in other PortAudio owned threads
+- (such as the thread that manages the stream callback.)
+-
+- This function is provided as a last resort, primarily to enhance debugging
+- by providing clients with access to all available error information.
+-
+- @return A pointer to an immutable structure constaining information about
+- the host error. The values in this structure will only be valid if a
+- PortAudio function has previously returned the paUnanticipatedHostError
+- error code.
+-*/
+-const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void );
+-
+-
+-
+-/* Device enumeration and capabilities */
+-
+-/** Retrieve the number of available devices. The number of available devices
+- may be zero.
+-
+- @return A non-negative value indicating the number of available devices or,
+- a PaErrorCode (which are always negative) if PortAudio is not initialized
+- or an error is encountered.
+-*/
+-PaDeviceIndex Pa_GetDeviceCount( void );
+-
+-
+-/** Retrieve the index of the default input device. The result can be
+- used in the inputDevice parameter to Pa_OpenStream().
+-
+- @return The default input device index for the default host API, or paNoDevice
+- if no default input device is available or an error was encountered.
+-*/
+-PaDeviceIndex Pa_GetDefaultInputDevice( void );
+-
+-
+-/** Retrieve the index of the default output device. The result can be
+- used in the outputDevice parameter to Pa_OpenStream().
+-
+- @return The default output device index for the defualt host API, or paNoDevice
+- if no default output device is available or an error was encountered.
+-
+- @note
+- On the PC, the user can specify a default device by
+- setting an environment variable. For example, to use device #1.
+-<pre>
+- set PA_RECOMMENDED_OUTPUT_DEVICE=1
+-</pre>
+- The user should first determine the available device ids by using
+- the supplied application "pa_devs".
+-*/
+-PaDeviceIndex Pa_GetDefaultOutputDevice( void );
+-
+-
+-/** The type used to represent monotonic time in seconds that can be used
+- for syncronisation. The type is used for the outTime argument to the
+- PaStreamCallback and as the result of Pa_GetStreamTime().
+-     
+- @see PaStreamCallback, Pa_GetStreamTime
+-*/
+-typedef double PaTime;
+-
+-
+-/** A type used to specify one or more sample formats. Each value indicates
+- a possible format for sound data passed to and from the stream callback,
+- Pa_ReadStream and Pa_WriteStream.
+-
+- The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8
+- and aUInt8 are usually implemented by all implementations.
+-
+- The floating point representation (paFloat32) uses +1.0 and -1.0 as the
+- maximum and minimum respectively.
+-
+- paUInt8 is an unsigned 8 bit format where 128 is considered "ground"
+-
+- The paNonInterleaved flag indicates that a multichannel buffer is passed
+- as a set of non-interleaved pointers.
+-
+- @see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo
+- @see paFloat32, paInt16, paInt32, paInt24, paInt8
+- @see paUInt8, paCustomFormat, paNonInterleaved
+-*/
+-typedef unsigned long PaSampleFormat;
+-
+-
+-#define paFloat32        ((PaSampleFormat) 0x00000001) /**< @see PaSampleFormat */
+-#define paInt32          ((PaSampleFormat) 0x00000002) /**< @see PaSampleFormat */
+-#define paInt24          ((PaSampleFormat) 0x00000004) /**< Packed 24 bit format. @see PaSampleFormat */
+-#define paInt16          ((PaSampleFormat) 0x00000008) /**< @see PaSampleFormat */
+-#define paInt8           ((PaSampleFormat) 0x00000010) /**< @see PaSampleFormat */
+-#define paUInt8          ((PaSampleFormat) 0x00000020) /**< @see PaSampleFormat */
+-#define paCustomFormat   ((PaSampleFormat) 0x00010000)/**< @see PaSampleFormat */
+-
+-#define paNonInterleaved ((PaSampleFormat) 0x80000000)
+-
+-/** A structure providing information and capabilities of PortAudio devices.
+- Devices may support input, output or both input and output.
+-*/
+-typedef struct PaDeviceInfo
+-{
+-    int structVersion;  /* this is struct version 2 */
+-    const char *name;
+-    PaHostApiIndex hostApi; /* note this is a host API index, not a type id*/
+-    
+-    int maxInputChannels;
+-    int maxOutputChannels;
+-
+-    /* Default latency values for interactive performance. */
+-    PaTime defaultLowInputLatency;
+-    PaTime defaultLowOutputLatency;
+-    /* Default latency values for robust non-interactive applications (eg. playing sound files). */
+-    PaTime defaultHighInputLatency;
+-    PaTime defaultHighOutputLatency;
+-
+-    double defaultSampleRate;
+-} PaDeviceInfo;
+-
+-
+-/** Retrieve a pointer to a PaDeviceInfo structure containing information
+- about the specified device.
+- @return A pointer to an immutable PaDeviceInfo structure. If the device
+- parameter is out of range the function returns NULL.
+-
+- @param device A valid device index in the range 0 to (Pa_GetDeviceCount()-1)
+-
+- @note PortAudio manages the memory referenced by the returned pointer,
+- the client must not manipulate or free the memory. The pointer is only
+- guaranteed to be valid between calls to Pa_Initialize() and Pa_Terminate().
+-
+- @see PaDeviceInfo, PaDeviceIndex
+-*/
+-const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device );
+-
+-
+-/** Parameters for one direction (input or output) of a stream.
+-*/
+-typedef struct PaStreamParameters
+-{
+-    /** A valid device index in the range 0 to (Pa_GetDeviceCount()-1)
+-     specifying the device to be used or the special constant
+-     paUseHostApiSpecificDeviceSpecification which indicates that the actual
+-     device(s) to use are specified in hostApiSpecificStreamInfo.
+-     This field must not be set to paNoDevice.
+-    */
+-    PaDeviceIndex device;
+-    
+-    /** The number of channels of sound to be delivered to the
+-     stream callback or accessed by Pa_ReadStream() or Pa_WriteStream().
+-     It can range from 1 to the value of maxInputChannels in the
+-     PaDeviceInfo record for the device specified by the device parameter.
+-    */
+-    int channelCount;
+-
+-    /** The sample format of the buffer provided to the stream callback,
+-     a_ReadStream() or Pa_WriteStream(). It may be any of the formats described
+-     by the PaSampleFormat enumeration.
+-    */
+-    PaSampleFormat sampleFormat;
+-
+-    /** The desired latency in seconds. Where practical, implementations should
+-     configure their latency based on these parameters, otherwise they may
+-     choose the closest viable latency instead. Unless the suggested latency
+-     is greater than the absolute upper limit for the device implementations
+-     should round the suggestedLatency up to the next practial value - ie to
+-     provide an equal or higher latency than suggestedLatency wherever possibe.
+-     Actual latency values for an open stream may be retrieved using the
+-     inputLatency and outputLatency fields of the PaStreamInfo structure
+-     returned by Pa_GetStreamInfo().
+-     @see default*Latency in PaDeviceInfo, *Latency in PaStreamInfo
+-    */
+-    PaTime suggestedLatency;
+-
+-    /** An optional pointer to a host api specific data structure
+-     containing additional information for device setup and/or stream processing.
+-     hostApiSpecificStreamInfo is never required for correct operation,
+-     if not used it should be set to NULL.
+-    */
+-    void *hostApiSpecificStreamInfo;
+-
+-} PaStreamParameters;
+-
+-
+-/** Return code for Pa_IsFormatSupported indicating success. */
+-#define paFormatIsSupported (0)
+-
+-/** Determine whether it would be possible to open a stream with the specified
+- parameters.
+-
+- @param inputParameters A structure that describes the input parameters used to
+- open a stream. The suggestedLatency field is ignored. See PaStreamParameters
+- for a description of these parameters. inputParameters must be NULL for
+- output-only streams.
+-
+- @param outputParameters A structure that describes the output parameters used
+- to open a stream. The suggestedLatency field is ignored. See PaStreamParameters
+- for a description of these parameters. outputParameters must be NULL for
+- input-only streams.
+-
+- @param sampleRate The required sampleRate. For full-duplex streams it is the
+- sample rate for both input and output
+-
+- @return Returns 0 if the format is supported, and an error code indicating why
+- the format is not supported otherwise. The constant paFormatIsSupported is
+- provided to compare with the return value for success.
+-
+- @see paFormatIsSupported, PaStreamParameters
+-*/
+-PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters,
+-                              const PaStreamParameters *outputParameters,
+-                              double sampleRate );
+-
+-
+-
+-/* Streaming types and functions */
+-
+-
+-/**
+- A single PaStream can provide multiple channels of real-time
+- streaming audio input and output to a client application. A stream
+- provides access to audio hardware represented by one or more
+- PaDevices. Depending on the underlying Host API, it may be possible 
+- to open multiple streams using the same device, however this behavior 
+- is implementation defined. Portable applications should assume that 
+- a PaDevice may be simultaneously used by at most one PaStream.
+-
+- Pointers to PaStream objects are passed between PortAudio functions that
+- operate on streams.
+-
+- @see Pa_OpenStream, Pa_OpenDefaultStream, Pa_OpenDefaultStream, Pa_CloseStream,
+- Pa_StartStream, Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive,
+- Pa_GetStreamTime, Pa_GetStreamCpuLoad
+-
+-*/
+-typedef void PaStream;
+-
+-
+-/** Can be passed as the framesPerBuffer parameter to Pa_OpenStream()
+- or Pa_OpenDefaultStream() to indicate that the stream callback will
+- accept buffers of any size.
+-*/
+-#define paFramesPerBufferUnspecified  (0)
+-
+-
+-/** Flags used to control the behavior of a stream. They are passed as
+- parameters to Pa_OpenStream or Pa_OpenDefaultStream. Multiple flags may be
+- ORed together.
+-
+- @see Pa_OpenStream, Pa_OpenDefaultStream
+- @see paNoFlag, paClipOff, paDitherOff, paNeverDropInput,
+-  paPrimeOutputBuffersUsingStreamCallback, paPlatformSpecificFlags
+-*/
+-typedef unsigned long PaStreamFlags;
+-
+-/** @see PaStreamFlags */
+-#define   paNoFlag          ((PaStreamFlags) 0)
+-
+-/** Disable default clipping of out of range samples.
+- @see PaStreamFlags
+-*/
+-#define   paClipOff         ((PaStreamFlags) 0x00000001)
+-
+-/** Disable default dithering.
+- @see PaStreamFlags
+-*/
+-#define   paDitherOff       ((PaStreamFlags) 0x00000002)
+-
+-/** Flag requests that where possible a full duplex stream will not discard
+- overflowed input samples without calling the stream callback. This flag is
+- only valid for full duplex callback streams and only when used in combination
+- with the paFramesPerBufferUnspecified (0) framesPerBuffer parameter. Using
+- this flag incorrectly results in a paInvalidFlag error being returned from
+- Pa_OpenStream and Pa_OpenDefaultStream.
+-
+- @see PaStreamFlags, paFramesPerBufferUnspecified
+-*/
+-#define   paNeverDropInput  ((PaStreamFlags) 0x00000004)
+-
+-/** Call the stream callback to fill initial output buffers, rather than the
+- default behavior of priming the buffers with zeros (silence). This flag has
+- no effect for input-only and blocking read/write streams.
+- 
+- @see PaStreamFlags
+-*/
+-#define   paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008)
+-
+-/** A mask specifying the platform specific bits.
+- @see PaStreamFlags
+-*/
+-#define   paPlatformSpecificFlags ((PaStreamFlags)0xFFFF0000)
+-
+-/**
+- Timing information for the buffers passed to the stream callback.
+-*/
+-typedef struct PaStreamCallbackTimeInfo{
+-    PaTime inputBufferAdcTime;
+-    PaTime currentTime;
+-    PaTime outputBufferDacTime;
+-} PaStreamCallbackTimeInfo;
+-
+-
+-/**
+- Flag bit constants for the statusFlags to PaStreamCallback.
+-
+- @see paInputUnderflow, paInputOverflow, paOutputUnderflow, paOutputOverflow,
+- paPrimingOutput
+-*/
+-typedef unsigned long PaStreamCallbackFlags;
+-
+-/** In a stream opened with paFramesPerBufferUnspecified, indicates that
+- input data is all silence (zeros) because no real data is available. In a
+- stream opened without paFramesPerBufferUnspecified, it indicates that one or
+- more zero samples have been inserted into the input buffer to compensate
+- for an input underflow.
+- @see PaStreamCallbackFlags
+-*/
+-#define paInputUnderflow   ((PaStreamCallbackFlags) 0x00000001)
+-
+-/** In a stream opened with paFramesPerBufferUnspecified, indicates that data
+- prior to the first sample of the input buffer was discarded due to an
+- overflow, possibly because the stream callback is using too much CPU time.
+- Otherwise indicates that data prior to one or more samples in the
+- input buffer was discarded.
+- @see PaStreamCallbackFlags
+-*/
+-#define paInputOverflow    ((PaStreamCallbackFlags) 0x00000002)
+-
+-/** Indicates that output data (or a gap) was inserted, possibly because the
+- stream callback is using too much CPU time.
+- @see PaStreamCallbackFlags
+-*/
+-#define paOutputUnderflow  ((PaStreamCallbackFlags) 0x00000004)
+-
+-/** Indicates that output data will be discarded because no room is available.
+- @see PaStreamCallbackFlags
+-*/
+-#define paOutputOverflow   ((PaStreamCallbackFlags) 0x00000008)
+-
+-/** Some of all of the output data will be used to prime the stream, input
+- data may be zero.
+- @see PaStreamCallbackFlags
+-*/
+-#define paPrimingOutput    ((PaStreamCallbackFlags) 0x00000010)
+-
+-/**
+- Allowable return values for the PaStreamCallback.
+- @see PaStreamCallback
+-*/
+-typedef enum PaStreamCallbackResult
+-{
+-    paContinue=0,
+-    paComplete=1,
+-    paAbort=2
+-} PaStreamCallbackResult;
+-
+-
+-/**
+- Functions of type PaStreamCallback are implemented by PortAudio clients.
+- They consume, process or generate audio in response to requests from an
+- active PortAudio stream.
+-     
+- @param input and @param output are arrays of interleaved samples,
+- the format, packing and number of channels used by the buffers are
+- determined by parameters to Pa_OpenStream().
+-     
+- @param frameCount The number of sample frames to be processed by
+- the stream callback.
+-
+- @param timeInfo The time in seconds when the first sample of the input
+- buffer was received at the audio input, the time in seconds when the first
+- sample of the output buffer will begin being played at the audio output, and
+- the time in seconds when the stream callback was called.
+- See also Pa_GetStreamTime()
+-
+- @param statusFlags Flags indicating whether input and/or output buffers
+- have been inserted or will be dropped to overcome underflow or overflow
+- conditions.
+-
+- @param userData The value of a user supplied pointer passed to
+- Pa_OpenStream() intended for storing synthesis data etc.
+-
+- @return
+- The stream callback should return one of the values in the
+- PaStreamCallbackResult enumeration. To ensure that the callback continues
+- to be called, it should return paContinue (0). Either paComplete or paAbort
+- can be returned to finish stream processing, after either of these values is
+- returned the callback will not be called again. If paAbort is returned the
+- stream will finish as soon as possible. If paComplete is returned, the stream
+- will continue until all buffers generated by the callback have been played.
+- This may be useful in applications such as soundfile players where a specific
+- duration of output is required. However, it is not necessary to utilise this
+- mechanism as Pa_StopStream(), Pa_AbortStream() or Pa_CloseStream() can also
+- be used to stop the stream. The callback must always fill the entire output
+- buffer irrespective of its return value.
+-
+- @see Pa_OpenStream, Pa_OpenDefaultStream
+-
+- @note With the exception of Pa_GetStreamCpuLoad() it is not permissable to call
+- PortAudio API functions from within the stream callback.
+-*/
+-typedef int PaStreamCallback(
+-    const void *input, void *output,
+-    unsigned long frameCount,
+-    const PaStreamCallbackTimeInfo* timeInfo,
+-    PaStreamCallbackFlags statusFlags,
+-    void *userData );
+-
+-
+-/** Opens a stream for either input, output or both.
+-     
+- @param stream The address of a PaStream pointer which will receive
+- a pointer to the newly opened stream.
+-     
+- @param inputParameters A structure that describes the input parameters used by
+- the opened stream. See PaStreamParameters for a description of these parameters.
+- inputParameters must be NULL for output-only streams.
+-
+- @param outputParameters A structure that describes the output parameters used by
+- the opened stream. See PaStreamParameters for a description of these parameters.
+- outputParameters must be NULL for input-only streams.
+- 
+- @param sampleRate The desired sampleRate. For full-duplex streams it is the
+- sample rate for both input and output
+-     
+- @param framesPerBuffer The number of frames passed to the stream callback
+- function, or the preferred block granularity for a blocking read/write stream.
+- The special value paFramesPerBufferUnspecified (0) may be used to request that
+- the stream callback will recieve an optimal (and possibly varying) number of
+- frames based on host requirements and the requested latency settings.
+- Note: With some host APIs, the use of non-zero framesPerBuffer for a callback
+- stream may introduce an additional layer of buffering which could introduce
+- additional latency. PortAudio guarantees that the additional latency
+- will be kept to the theoretical minimum however, it is strongly recommended
+- that a non-zero framesPerBuffer value only be used when your algorithm
+- requires a fixed number of frames per stream callback.
+- 
+- @param streamFlags Flags which modify the behaviour of the streaming process.
+- This parameter may contain a combination of flags ORed together. Some flags may
+- only be relevant to certain buffer formats.
+-     
+- @param streamCallback A pointer to a client supplied function that is responsible
+- for processing and filling input and output buffers. If this parameter is NULL
+- the stream will be opened in 'blocking read/write' mode. In blocking mode,
+- the client can receive sample data using Pa_ReadStream and write sample data
+- using Pa_WriteStream, the number of samples that may be read or written
+- without blocking is returned by Pa_GetStreamReadAvailable and
+- Pa_GetStreamWriteAvailable respectively.
+-
+- @param userData A client supplied pointer which is passed to the stream callback
+- function. It could for example, contain a pointer to instance data necessary
+- for processing the audio buffers. This parameter is ignored if streamCallback
+- is NULL.
+-     
+- @return
+- Upon success Pa_OpenStream() returns paNoError and places a pointer to a
+- valid PaStream in the stream argument. The stream is inactive (stopped).
+- If a call to Pa_OpenStream() fails, a non-zero error code is returned (see
+- PaError for possible error codes) and the value of stream is invalid.
+-
+- @see PaStreamParameters, PaStreamCallback, Pa_ReadStream, Pa_WriteStream,
+- Pa_GetStreamReadAvailable, Pa_GetStreamWriteAvailable
+-*/
+-PaError Pa_OpenStream( PaStream** stream,
+-                       const PaStreamParameters *inputParameters,
+-                       const PaStreamParameters *outputParameters,
+-                       double sampleRate,
+-                       unsigned long framesPerBuffer,
+-                       PaStreamFlags streamFlags,
+-                       PaStreamCallback *streamCallback,
+-                       void *userData );
+-
+-
+-/** A simplified version of Pa_OpenStream() that opens the default input
+- and/or output devices.
+-
+- @param stream The address of a PaStream pointer which will receive
+- a pointer to the newly opened stream.
+- 
+- @param numInputChannels  The number of channels of sound that will be supplied
+- to the stream callback or returned by Pa_ReadStream. It can range from 1 to
+- the value of maxInputChannels in the PaDeviceInfo record for the default input
+- device. If 0 the stream is opened as an output-only stream.
+-
+- @param numOutputChannels The number of channels of sound to be delivered to the
+- stream callback or passed to Pa_WriteStream. It can range from 1 to the value
+- of maxOutputChannels in the PaDeviceInfo record for the default output dvice.
+- If 0 the stream is opened as an output-only stream.
+-
+- @param sampleFormat The sample format of both the input and output buffers
+- provided to the callback or passed to and from Pa_ReadStream and Pa_WriteStream.
+- sampleFormat may be any of the formats described by the PaSampleFormat
+- enumeration.
+- 
+- @param sampleRate Same as Pa_OpenStream parameter of the same name.
+- @param framesPerBuffer Same as Pa_OpenStream parameter of the same name.
+- @param streamCallback Same as Pa_OpenStream parameter of the same name.
+- @param userData Same as Pa_OpenStream parameter of the same name.
+-
+- @return As for Pa_OpenStream
+-
+- @see Pa_OpenStream, PaStreamCallback
+-*/
+-PaError Pa_OpenDefaultStream( PaStream** stream,
+-                              int numInputChannels,
+-                              int numOutputChannels,
+-                              PaSampleFormat sampleFormat,
+-                              double sampleRate,
+-                              unsigned long framesPerBuffer,
+-                              PaStreamCallback *streamCallback,
+-                              void *userData );
+-
+-
+-/** Closes an audio stream. If the audio stream is active it
+- discards any pending buffers as if Pa_AbortStream() had been called.
+-*/
+-PaError Pa_CloseStream( PaStream *stream );
+-
+-
+-/** Functions of type PaStreamFinishedCallback are implemented by PortAudio 
+- clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback
+- function. Once registered they are called when the stream becomes inactive
+- (ie once a call to Pa_StopStream() will not block).
+- A stream will become inactive after the stream callback returns non-zero,
+- or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio
+- output, if the stream callback returns paComplete, or Pa_StopStream is called,
+- the stream finished callback will not be called until all generated sample data
+- has been played.
+- 
+- @param userData The userData parameter supplied to Pa_OpenStream()
+-
+- @see Pa_SetStreamFinishedCallback
+-*/
+-typedef void PaStreamFinishedCallback( void *userData );
+-
+-
+-/** Register a stream finished callback function which will be called when the 
+- stream becomes inactive. See the description of PaStreamFinishedCallback for 
+- further details about when the callback will be called.
+-
+- @param stream a pointer to a PaStream that is in the stopped state - if the
+- stream is not stopped, the stream's finished callback will remain unchanged 
+- and an error code will be returned.
+-
+- @param streamFinishedCallback a pointer to a function with the same signature
+- as PaStreamFinishedCallback, that will be called when the stream becomes
+- inactive. Passing NULL for this parameter will un-register a previously
+- registered stream finished callback function.
+-
+- @return on success returns paNoError, otherwise an error code indicating the cause
+- of the error.
+-
+- @see PaStreamFinishedCallback
+-*/
+-PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); 
+-
+-
+-/** Commences audio processing.
+-*/
+-PaError Pa_StartStream( PaStream *stream );
+-
+-
+-/** Terminates audio processing. It waits until all pending
+- audio buffers have been played before it returns.
+-*/
+-PaError Pa_StopStream( PaStream *stream );
+-
+-
+-/** Terminates audio processing immediately without waiting for pending
+- buffers to complete.
+-*/
+-PaError Pa_AbortStream( PaStream *stream );
+-
+-
+-/** Determine whether the stream is stopped.
+- A stream is considered to be stopped prior to a successful call to
+- Pa_StartStream and after a successful call to Pa_StopStream or Pa_AbortStream.
+- If a stream callback returns a value other than paContinue the stream is NOT
+- considered to be stopped.
+-
+- @return Returns one (1) when the stream is stopped, zero (0) when
+- the stream is running or, a PaErrorCode (which are always negative) if
+- PortAudio is not initialized or an error is encountered.
+-
+- @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive
+-*/
+-PaError Pa_IsStreamStopped( PaStream *stream );
+-
+-
+-/** Determine whether the stream is active.
+- A stream is active after a successful call to Pa_StartStream(), until it
+- becomes inactive either as a result of a call to Pa_StopStream() or
+- Pa_AbortStream(), or as a result of a return value other than paContinue from
+- the stream callback. In the latter case, the stream is considered inactive
+- after the last buffer has finished playing.
+-
+- @return Returns one (1) when the stream is active (ie playing or recording
+- audio), zero (0) when not playing or, a PaErrorCode (which are always negative)
+- if PortAudio is not initialized or an error is encountered.
+-
+- @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamStopped
+-*/
+-PaError Pa_IsStreamActive( PaStream *stream );
+-
+-
+-
+-/** A structure containing unchanging information about an open stream.
+- @see Pa_GetStreamInfo
+-*/
+-
+-typedef struct PaStreamInfo
+-{
+-    /** this is struct version 1 */
+-    int structVersion;
+-
+-    /** The input latency of the stream in seconds. This value provides the most
+-     accurate estimate of input latency available to the implementation. It may
+-     differ significantly from the suggestedLatency value passed to Pa_OpenStream().
+-     The value of this field will be zero (0.) for output-only streams.
+-     @see PaTime
+-    */
+-    PaTime inputLatency;
+-
+-    /** The output latency of the stream in seconds. This value provides the most
+-     accurate estimate of output latency available to the implementation. It may
+-     differ significantly from the suggestedLatency value passed to Pa_OpenStream().
+-     The value of this field will be zero (0.) for input-only streams.
+-     @see PaTime
+-    */
+-    PaTime outputLatency;
+-
+-    /** The sample rate of the stream in Hertz (samples per second). In cases
+-     where the hardware sample rate is inaccurate and PortAudio is aware of it,
+-     the value of this field may be different from the sampleRate parameter
+-     passed to Pa_OpenStream(). If information about the actual hardware sample
+-     rate is not available, this field will have the same value as the sampleRate
+-     parameter passed to Pa_OpenStream().
+-    */
+-    double sampleRate;
+-    
+-} PaStreamInfo;
+-
+-
+-/** Retrieve a pointer to a PaStreamInfo structure containing information
+- about the specified stream.
+- @return A pointer to an immutable PaStreamInfo structure. If the stream
+- parameter invalid, or an error is encountered, the function returns NULL.
+-
+- @param stream A pointer to an open stream previously created with Pa_OpenStream.
+-
+- @note PortAudio manages the memory referenced by the returned pointer,
+- the client must not manipulate or free the memory. The pointer is only
+- guaranteed to be valid until the specified stream is closed.
+-
+- @see PaStreamInfo
+-*/
+-const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream );
+-
+-
+-/** Determine the current time for the stream according to the same clock used
+- to generate buffer timestamps. This time may be used for syncronising other
+- events to the audio stream, for example synchronizing audio to MIDI.
+-                                        
+- @return The stream's current time in seconds, or 0 if an error occurred.
+-
+- @see PaTime, PaStreamCallback
+-*/
+-PaTime Pa_GetStreamTime( PaStream *stream );
+-
+-
+-/** Retrieve CPU usage information for the specified stream.
+- The "CPU Load" is a fraction of total CPU time consumed by a callback stream's
+- audio processing routines including, but not limited to the client supplied
+- stream callback. This function does not work with blocking read/write streams.
+-
+- This function may be called from the stream callback function or the
+- application.
+-     
+- @return
+- A floating point value, typically between 0.0 and 1.0, where 1.0 indicates
+- that the stream callback is consuming the maximum number of CPU cycles possible
+- to maintain real-time operation. A value of 0.5 would imply that PortAudio and
+- the stream callback was consuming roughly 50% of the available CPU time. The
+- return value may exceed 1.0. A value of 0.0 will always be returned for a
+- blocking read/write stream, or if an error occurrs.
+-*/
+-double Pa_GetStreamCpuLoad( PaStream* stream );
+-
+-
+-/** Read samples from an input stream. The function doesn't return until
+- the entire buffer has been filled - this may involve waiting for the operating
+- system to supply the data.
+-
+- @param stream A pointer to an open stream previously created with Pa_OpenStream.
+- 
+- @param buffer A pointer to a buffer of sample frames. The buffer contains
+- samples in the format specified by the inputParameters->sampleFormat field
+- used to open the stream, and the number of channels specified by
+- inputParameters->numChannels. If non-interleaved samples were requested,
+- buffer is a pointer to the first element of an array of non-interleaved
+- buffer pointers, one for each channel.
+-
+- @param frames The number of frames to be read into buffer. This parameter
+- is not constrained to a specific range, however high performance applications
+- will want to match this parameter to the framesPerBuffer parameter used
+- when opening the stream.
+-
+- @return On success PaNoError will be returned, or PaInputOverflowed if input
+- data was discarded by PortAudio after the previous call and before this call.
+-*/
+-PaError Pa_ReadStream( PaStream* stream,
+-                       void *buffer,
+-                       unsigned long frames );
+-
+-
+-/** Write samples to an output stream. This function doesn't return until the
+- entire buffer has been consumed - this may involve waiting for the operating
+- system to consume the data.
+-
+- @param stream A pointer to an open stream previously created with Pa_OpenStream.
+-
+- @param buffer A pointer to a buffer of sample frames. The buffer contains
+- samples in the format specified by the outputParameters->sampleFormat field
+- used to open the stream, and the number of channels specified by
+- outputParameters->numChannels. If non-interleaved samples were requested,
+- buffer is a pointer to the first element of an array of non-interleaved
+- buffer pointers, one for each channel.
+-
+- @param frames The number of frames to be written from buffer. This parameter
+- is not constrained to a specific range, however high performance applications
+- will want to match this parameter to the framesPerBuffer parameter used
+- when opening the stream.
+-
+- @return On success PaNoError will be returned, or paOutputUnderflowed if
+- additional output data was inserted after the previous call and before this
+- call.
+-*/
+-PaError Pa_WriteStream( PaStream* stream,
+-                        const void *buffer,
+-                        unsigned long frames );
+-
+-
+-/** Retrieve the number of frames that can be read from the stream without
+- waiting.
+-
+- @return Returns a non-negative value representing the maximum number of frames
+- that can be read from the stream without blocking or busy waiting or, a
+- PaErrorCode (which are always negative) if PortAudio is not initialized or an
+- error is encountered.
+-*/
+-signed long Pa_GetStreamReadAvailable( PaStream* stream );
+-
+-
+-/** Retrieve the number of frames that can be written to the stream without
+- waiting.
+-
+- @return Returns a non-negative value representing the maximum number of frames
+- that can be written to the stream without blocking or busy waiting or, a
+- PaErrorCode (which are always negative) if PortAudio is not initialized or an
+- error is encountered.
+-*/
+-signed long Pa_GetStreamWriteAvailable( PaStream* stream );
+-
+-
+-/* Miscellaneous utilities */
+-
+-
+-/** Retrieve the size of a given sample format in bytes.
+-
+- @return The size in bytes of a single sample in the specified format,
+- or paSampleFormatNotSupported if the format is not supported.
+-*/
+-PaError Pa_GetSampleSize( PaSampleFormat format );
+-
+-
+-/** Put the caller to sleep for at least 'msec' milliseconds. This function is
+- provided only as a convenience for authors of portable code (such as the tests
+- and examples in the PortAudio distribution.)
+-
+- The function may sleep longer than requested so don't rely on this for accurate
+- musical timing.
+-*/
+-void Pa_Sleep( long msec );
+-
+-
+-
+-#ifdef __cplusplus
+-}
+-#endif /* __cplusplus */
+-#endif /* PORTAUDIO_H */
+--- a/src/wave.cpp
++++ b/src/wave.cpp
+@@ -31,7 +31,10 @@
+ #include <sys/time.h>
+ #include <time.h>
+-#include "portaudio.h"
++#ifdef USE_PORTAUDIO
++#include <portaudio.h>
++#endif
++
+ #ifdef PLATFORM_WINDOWS
+ #include <windows.h>
+ #else
+--- a/src/wavegen.cpp
++++ b/src/wavegen.cpp
+@@ -40,7 +40,7 @@
+ #endif
+ #ifdef USE_PORTAUDIO
+-#include "portaudio.h"
++#include <portaudio.h>
+ #undef USE_PORTAUDIO
+ // determine portaudio version by looking for a #define which is not in V18
+ #ifdef paNeverDropInput
diff --git a/sound/forked-daapd/Makefile b/sound/forked-daapd/Makefile
new file mode 100644 (file)
index 0000000..b33bb44
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# 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:=forked-daapd
+PKG_VERSION:=24.2
+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_BUILD_DEPENDS:=gperf/host
+PKG_FIXUP:=autoreconf
+PKG_USE_MIPS16:=0
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/forked-daapd
+SECTION:=sound
+CATEGORY:=Sound
+TITLE:=iTunes (DAAP) server for Apple Remote and AirPlay
+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)
+endef
+
+define Package/forked-daapd/description
+  forked-daapd is a Linux/FreeBSD DAAP (iTunes), MPD (Music Player Daemon) and
+  RSP (Roku) media server. It has support for AirPlay speakers, Chromecast,
+  Apple Remote (and compatibles), MPD clients, internet radio and LastFM. It
+  does not support AirPlay/Chromecast video.
+endef
+
+define Package/forked-daapd/conffiles
+/etc/forked-daapd.conf
+endef
+
+CONFIGURE_ARGS += \
+       --enable-itunes \
+       --enable-lastfm \
+       --enable-mpd \
+       --enable-chromecast
+
+TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
+
+define Package/forked-daapd/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/forked-daapd $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) ./files/forked-daapd.conf $(1)/etc/forked-daapd.conf
+       $(INSTALL_DIR) $(1)/usr/lib/forked-daapd
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/forked-daapd/* $(1)/usr/lib/forked-daapd/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/forked-daapd.init $(1)/etc/init.d/forked-daapd
+endef
+
+$(eval $(call BuildPackage,forked-daapd))
diff --git a/sound/forked-daapd/files/forked-daapd.conf b/sound/forked-daapd/files/forked-daapd.conf
new file mode 100644 (file)
index 0000000..0f756e0
--- /dev/null
@@ -0,0 +1,187 @@
+# A quick guide to configuring forked-daapd:
+#
+# For regular use, the most important setting to configure is "directories",
+# which should be the location of your media. Whatever user you have set as
+# "uid" must have read access to this location. If the location is a network
+# mount, please see the README.
+#
+# In all likelihood, that's all you need to do!
+
+general {
+       # Username
+       # Make sure the user has read access to the library directories you set
+       # below, and full access to the databases, log and local audio
+       uid = "daapd"
+
+       # Database location
+       db_path = "/var/cache/forked-daapd/songs3.db"
+
+       # Log file and level
+       # Available levels: fatal, log, warning, info, debug, spam
+       logfile = "/var/log/forked-daapd.log"
+       loglevel = log
+
+       # Admin password for the non-existent web interface
+       admin_password = "unused"
+
+       # Enable/disable IPv6
+       ipv6 = no
+
+       # Location of cache database
+       cache_path = "/var/cache/forked-daapd/cache.db"
+
+       # DAAP requests that take longer than this threshold (in msec) get their
+       # replies cached for next time. Set to 0 to disable caching.
+#      cache_daap_threshold = 1000
+}
+
+# Library configuration
+library {
+       # Name of the library as displayed by the clients
+       # %h: hostname, %v: version
+       name = "My Music on %h"
+
+       # TCP port to listen on. Default port is 3689 (daap)
+       port = 3689
+
+       # Password for the library. Optional.
+#      password = ""
+
+       # Directories to index
+       directories = { "/srv/music" }
+
+       # Directories containing podcasts
+       # For each directory that is indexed the path is matched against these
+       # names. If there is a match all items in the directory are marked as 
+       # podcasts. Eg. if you index /srv/music, and your podcasts are in
+       # /srv/music/Podcasts, you can set this to "/Podcasts".
+       # (changing this setting only takes effect after rescan, see the README)
+       podcasts = { "/Podcasts" }
+
+       # Directories containing audiobooks
+       # For each directory that is indexed the path is matched against these
+       # names. If there is a match all items in the directory are marked as 
+       # audiobooks.
+       # (changing this setting only takes effect after rescan, see the README)
+       audiobooks = { "/Audiobooks" }
+
+       # Directories containing compilations (eg soundtracks)
+       # For each directory that is indexed the path is matched against these
+       # names. If there is a match all items in the directory are marked as 
+       # compilations.
+       # (changing this setting only takes effect after rescan, see the README)
+       compilations = { "/Compilations" }
+
+       # Compilations usually have many artists, and if you don't want every
+       # artist to be listed when artist browsing in Remote, you can set
+       # a single name which will be used for all music in the compilation dir
+       # (changing this setting only takes effect after rescan, see the README)
+       compilation_artist = "Various artists"
+
+       # Internet streams in your playlists will by default be shown in the
+       # "Radio" library, like iTunes does. However, some clients (like
+       # TunesRemote+) won't show the "Radio" library. If you would also like
+       # to have them shown like normal playlists, you can enable this option.
+#      radio_playlists = false
+
+       # There are 5 default playlists: "Library", "Music", "Movies", "TV Shows"
+       # and "Podcasts". Here you can change the names of these playlists.
+#      name_library    = "Library"
+#      name_music      = "Music"
+#      name_movies     = "Movies"
+#      name_tvshows    = "TV Shows"
+#      name_podcasts   = "Podcasts"
+#      name_audiobooks = "Audiobooks"
+#      name_radio      = "Radio"
+
+       # Artwork file names (without file type extension)
+       # forked-daapd will look for jpg and png files with these base names
+#      artwork_basenames = { "artwork", "cover", "Folder" }
+
+       # Enable searching for artwork corresponding to each individual media
+       # file instead of only looking for album artwork. This is disabled by
+       # default to reduce cache size.
+#      artwork_individual = false
+
+       # File types the scanner should ignore
+       # Non-audio files will never be added to the database, but here you
+       # can prevent the scanner from even probing them. This might improve
+       # scan time. By default .db, .ini, .db-journal and .pdf are ignored.
+#      filetypes_ignore = { ".db", ".ini", ".db-journal", ".pdf" }
+
+       # File paths the scanner should ignore
+       # If you want to exclude files on a more advanced basis you can enter
+       # one or more POSIX regular expressions, and any file with a matching
+       # path will be ignored.
+#      filepath_ignore = { "myregex" }
+
+       # Disable startup file scanning
+       # When forked-daapd starts it will do an initial file scan of your
+       # library (and then watch it for changes). If you are sure your library
+       # never changes while forked-daapd is not running, you can disable the
+       # initial file scan and save some system ressources. Disabling this scan
+       # may lead to forked-daapd's database coming out of sync with the
+       # library. If that happens read the instructions in the README on how
+       # to trigger a rescan.
+#      filescan_disable = false
+
+       # Should iTunes metadata override ours?
+#      itunes_overrides = false
+
+       # Formats: mp4a, mp4v, mpeg, alac, flac, mpc, ogg, wma, wmal, wmav, aif, wav
+       # Formats that should never be transcoded
+#      no_transcode = { "alac", "mp4a" }
+       # Formats that should always be transcoded
+#      force_transcode = { "ogg", "flac" }
+}
+
+# Local audio output
+audio {
+       # Name - used in the speaker list in Remote
+       nickname = "OpenWrt"
+
+       # Audio device name for local audio output
+#      card = "default"
+
+       # Mixer channel to use for volume control - ALSA/Linux only
+       # If not set, PCM will be used if available, otherwise Master.
+#      mixer = ""
+}
+
+# AirPlay/Airport Express device settings
+# (make sure you get the capitalization of the device name right)
+#airplay "My AirPlay device" {
+       # forked-daapd's volume goes to 11! If that's more than you can handle
+       # you can set a lower value here
+#      max_volume = 11
+
+       # AirPlay password
+#      password = "s1kr3t"
+#}
+
+# SQLite configuration (allows to modify the operation of the SQLite databases)
+# Make sure to read the SQLite documentation for the corresponding PRAGMA statements as
+# changing them from the defaults may increase the possibility of database corruptions!
+# By default the SQLite default values are used. 
+sqlite {
+       # Cache size in number of db pages for the library database
+       # (SQLite default page size is 1024 bytes and cache size is 2000 pages)
+#      pragma_cache_size_library = 2000
+       
+       # Cache size in number of db pages for the daap cache database
+       # (SQLite default page size is 1024 bytes and cache size is 2000 pages)
+#      pragma_cache_size_cache = 2000
+       
+       # Sets the journal mode for the database
+       # DELETE (default), TRUNCATE, PERSIST, MEMORY, WAL, OFF 
+#      pragma_journal_mode = DELETE
+       
+       # Change the setting of the "synchronous" flag
+       # 0: OFF, 1: NORMAL, 2: FULL (default)
+#      pragma_synchronous = 2
+
+       # Should the database be vacuumed on startup? (increases startup time,
+       # but may reduce database size). Default is yes.
+#      vacuum = yes
+}
+
diff --git a/sound/forked-daapd/files/forked-daapd.init b/sound/forked-daapd/files/forked-daapd.init
new file mode 100644 (file)
index 0000000..3ae38f9
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 OpenWrt.org
+
+START=99
+BIN=/usr/sbin/forked-daapd
+PID=/var/run/forked-daapd.pid
+SSD=start-stop-daemon
+
+start() {
+        $SSD -p $PID -S -x $BIN -- -P $PID
+}
+       
+stop() {
+        $SSD -p $PID -K -s SIGINT
+}
diff --git a/sound/forked-daapd/patches/010-include_pregen.patch b/sound/forked-daapd/patches/010-include_pregen.patch
new file mode 100644 (file)
index 0000000..762f625
--- /dev/null
@@ -0,0 +1,23739 @@
+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/lame/Makefile b/sound/lame/Makefile
new file mode 100644 (file)
index 0000000..41a90f7
--- /dev/null
@@ -0,0 +1,84 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# blogic@openwrt.org
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lame
+PKG_VERSION:=3.99.5
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/lame
+PKG_MD5SUM:=84835b313d4a8b68f5349816d33e07ce
+PKG_FIXUP:=autoreconf
+
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=LGPL-2.0
+PKG_LICENSE_FILES:=COPYING LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+
+PKG_INSTALL=1
+
+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
+endef
+
+define Package/lame/description
+lame mp3 encoder
+endef
+
+define Package/lame-lib
+$(call Package/lame/Default)
+  TITLE:=lame-lib
+endef
+
+define Package/lame-lib/description
+lame mp3 encoder libs
+endef
+
+CONFIG_VARS+=NASM=no
+
+ifeq ($(ARCH),i386)
+TARGET_CFLAGS+=-msse
+endif
+
+define Package/lame/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lame $(1)/usr/bin/
+endef
+
+define Package/lame-lib/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*so* $(1)/usr/lib/
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/lame
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/include/lame/*.h \
+               $(1)/usr/include/lame/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/*.{la,so*} \
+               $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,lame-lib))
+$(eval $(call BuildPackage,lame))
diff --git a/sound/lame/patches/001-automake-compat.patch b/sound/lame/patches/001-automake-compat.patch
new file mode 100644 (file)
index 0000000..8857ad7
--- /dev/null
@@ -0,0 +1,33 @@
+--- 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@
diff --git a/sound/madplay/Makefile b/sound/madplay/Makefile
new file mode 100644 (file)
index 0000000..00a1b49
--- /dev/null
@@ -0,0 +1,85 @@
+#
+# 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:=madplay
+PKG_VERSION:=0.15.2b
+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_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Simon Peter <probono@puredarwin.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/madplay/default
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+libid3tag +libmad $(INTL_DEPENDS) $(2)
+  TITLE:=MPEG audio player in fixed point - $(1)
+  VARIANT:=$(1)
+  URL:=http://sourceforge.net/projects/mad
+endef
+
+Package/madplay-alsa=$(call Package/madplay/default,alsa,+alsa-lib)
+Package/madplay=$(call Package/madplay/default,oss)
+
+define Package/madplay/description
+       MAD is an MPEG audio decoder. It currently only supports the MPEG 1
+       standard, but fully implements all three audio layers (Layer I, Layer II,
+       and Layer III, the latter often colloquially known as MP3.). There is also
+       full support for ID3 tags.
+endef
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               --enable-shared \
+               --disable-static \
+               --disable-debugging \
+               --disable-profiling \
+               --disable-experimental \
+               --without-libiconv-prefix \
+               --without-libintl-prefix \
+               --without-esd \
+               , \
+               LIBS="-lz" \
+       )
+endef
+
+ifeq ($(BUILD_VARIANT),alsa)
+       CONFIGURE_ARGS += \
+               --without-oss \
+               --with-alsa
+endif
+
+ifeq ($(BUILD_VARIANT),oss)
+       CONFIGURE_ARGS += \
+               --without-alsa
+endif
+
+define Package/madplay/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/madplay $(1)/usr/bin/
+endef
+
+define Package/madplay-alsa/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/madplay $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,madplay-alsa))
+$(eval $(call BuildPackage,madplay))
diff --git a/sound/madplay/patches/0001-switch-to-new-alsa-api.patch b/sound/madplay/patches/0001-switch-to-new-alsa-api.patch
new file mode 100644 (file)
index 0000000..60d7bd3
--- /dev/null
@@ -0,0 +1,173 @@
+Switch madplay to the new API. This is done thanks to a patch written
+by Micha Nelissen <micha@neli.hopto.org> and available at
+http://article.gmane.org/gmane.comp.audio.mad.devel/729.
+
+--- madplay-0.15.2b/audio_alsa.c       2008-10-18 15:10:16.000000000 +0200
++++ madplay-0.15.2b/audio_alsa.c.new   2008-10-18 15:03:27.000000000 +0200
+@@ -28,31 +28,30 @@
+
+ #include <errno.h>
+
+-#define ALSA_PCM_OLD_HW_PARAMS_API
+-#define ALSA_PCM_OLD_SW_PARAMS_API
+ #include <alsa/asoundlib.h>
+
+ #include <mad.h>
+
+ #include "audio.h"
+
+-char *buf     = NULL;
+-int paused    = 0;
++#define BUFFER_TIME_MAX     500000
+
+-int rate      = -1;
+-int channels  = -1;
+-int bitdepth  = -1;
+-int sample_size       = -1;
+-
+-int buffer_time               = 500000;
+-int period_time               = 100000;
+-char *defaultdev      = "plughw:0,0";
++unsigned char *buf  = NULL;
++int paused        = 0;
++
++unsigned int rate           = 0;
++unsigned int channels     = -1;
++unsigned int bitdepth     = -1;
++unsigned int sample_size    = -1;
++
++unsigned int buffer_time;
++unsigned int period_time;
++char *defaultdev          = "plughw:0,0";
+
+ snd_pcm_hw_params_t *alsa_hwparams;
+ snd_pcm_sw_params_t *alsa_swparams;
+
+-snd_pcm_sframes_t buffer_size;
+-snd_pcm_sframes_t period_size;
++snd_pcm_uframes_t buffer_size;
+
+ snd_pcm_format_t  alsa_format = -1;
+ snd_pcm_access_t  alsa_access = SND_PCM_ACCESS_MMAP_INTERLEAVED;
+@@ -66,14 +65,20 @@
+                snd_pcm_hw_params_t *params,
+                snd_pcm_access_t access)
+ {
+-      int err, dir;
+-      
++      int err;
++
+       /* choose all parameters */
+       err = snd_pcm_hw_params_any(handle,params);
+       if (err < 0) {
+               printf("Access type not available for playback: %s\n", snd_strerror(err));
+               return err;
+       }
++      /* set the access type */
++      err = snd_pcm_hw_params_set_access(handle, params, alsa_access);
++      if (err < 0) {
++              printf("Sample format not available for playback: %s\n", snd_strerror(err));
++              return err;
++      }
+       /* set the sample format */
+       err = snd_pcm_hw_params_set_format(handle, params, alsa_format);
+       if (err < 0) {
+@@ -87,29 +92,38 @@
+               return err;
+       }
+       /* set the stream rate */
+-      err = snd_pcm_hw_params_set_rate_near(handle, params, rate, 0);
++      err = snd_pcm_hw_params_set_rate(handle, params, rate, 0);
+       if (err < 0) {
+               printf("Rate %iHz not available for playback: %s\n", rate, snd_strerror(err));
+               return err;
+       }
+-      if (err != rate) {
+-              printf("Rate doesn't match (requested %iHz, get %iHz)\n", rate, err);
+-              return -EINVAL;
+-      }
++      err = snd_pcm_hw_params_get_buffer_time_max(params, &buffer_time, NULL);
++        if (err < 0) {
++                printf("Unable to retrieve buffer time: %s\n", snd_strerror(err));
++                return err;
++        }
++        if (buffer_time > BUFFER_TIME_MAX)
++                buffer_time = BUFFER_TIME_MAX;
+       /* set buffer time */
+-      err = snd_pcm_hw_params_set_buffer_time_near(handle, params, buffer_time, &dir);
++      err = snd_pcm_hw_params_set_buffer_time_near(handle, params, &buffer_time, 0);
+       if (err < 0) {
+               printf("Unable to set buffer time %i for playback: %s\n", buffer_time, snd_strerror(err));
+               return err;
+       }
+-      buffer_size = snd_pcm_hw_params_get_buffer_size(params);
++        if (period_time * 4 > buffer_time)
++                period_time = buffer_time / 4;
+       /* set period time */
+-      err = snd_pcm_hw_params_set_period_time_near(handle, params, period_time, &dir);
++      err = snd_pcm_hw_params_set_period_time_near(handle, params, &period_time, NULL);
+       if (err < 0) {
+               printf("Unable to set period time %i for playback: %s\n", period_time, snd_strerror(err));
+               return err;
+       }
+-      period_size = snd_pcm_hw_params_get_period_size(params, &dir);
++        /* retrieve buffer size */
++      err = snd_pcm_hw_params_get_buffer_size(params, &buffer_size);
++        if (err < 0) {
++                printf("Unable to retrieve buffer size: %s\n", snd_strerror(err));
++                return err;
++        }
+       /* write the parameters to device */
+       err = snd_pcm_hw_params(handle, params);
+       if (err < 0) {
+@@ -123,6 +137,7 @@
+ int set_swparams(snd_pcm_t *handle,
+                snd_pcm_sw_params_t *params)
+ {
++        unsigned int start_threshold;
+       int err;
+
+         /* get current swparams */
+@@ -136,13 +151,7 @@
+         if (err < 0) {
+                 printf("Unable to set start threshold mode for playback: %s\n", snd_strerror(err));
+                 return err;
+-                                                                                      }
+-        /* allow transfer when at least period_size samples can be processed */
+-        err = snd_pcm_sw_params_set_avail_min(handle, params, period_size);
+-        if (err < 0) {
+-                printf("Unable to set avail min for playback: %s\n", snd_strerror(err));
+-                return err;
+-                                                                                                      }
++      }
+         /* align all transfers to 1 samples */
+         err = snd_pcm_sw_params_set_xfer_align(handle, params, 1);
+         if (err < 0) {
+@@ -190,7 +199,7 @@
+       rate            = config->speed;
+
+       if ( bitdepth == 0 )
+-              config->precision = bitdepth = 32;
++              config->precision = bitdepth = 16;
+
+       switch (bitdepth)
+       {
+@@ -241,7 +250,7 @@
+               return -1;
+       }
+
+-      buf = malloc(buffer_size);
++      buf = malloc(buffer_size * sample_size);
+       if (buf == NULL) {
+               audio_error="unable to allocate output buffer table";
+               return -1;
+@@ -279,7 +288,7 @@
+ int play(struct audio_play *play)
+ {
+       int err, len;
+-      char *ptr;
++      unsigned char *ptr;
+
+       ptr = buf;
+       len = play->nsamples;
+
diff --git a/sound/madplay/patches/010-use_correct_shell.patch b/sound/madplay/patches/010-use_correct_shell.patch
new file mode 100644 (file)
index 0000000..c8eb2a3
--- /dev/null
@@ -0,0 +1,30 @@
+--- a/intl/Makefile.in
++++ b/intl/Makefile.in
+@@ -19,7 +19,7 @@
+ PACKAGE = @PACKAGE@
+ VERSION = @VERSION@
+-SHELL = /bin/sh
++SHELL = @SHELL@
+ srcdir = @srcdir@
+ top_srcdir = @top_srcdir@
+@@ -56,6 +56,7 @@ DEFS = -DLOCALEDIR=\"$(localedir)\" -DLO
+ -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
+ -Dset_relocation_prefix=libintl_set_relocation_prefix \
+ -Drelocate=libintl_relocate \
++-DINSTALLPREFIX=\"$(prefix)\" \
+ -DDEPENDS_ON_LIBICONV=1 @DEFS@
+ CPPFLAGS = @CPPFLAGS@
+ CFLAGS = @CFLAGS@
+--- a/po/Makefile.in.in
++++ b/po/Makefile.in.in
+@@ -13,7 +13,7 @@
+ PACKAGE = @PACKAGE@
+ VERSION = @VERSION@
+-SHELL = /bin/sh
++SHELL = @SHELL@
+ @SET_MAKE@
+ srcdir = @srcdir@
diff --git a/sound/mocp/Makefile b/sound/mocp/Makefile
new file mode 100644 (file)
index 0000000..93f9c6f
--- /dev/null
@@ -0,0 +1,66 @@
+#
+# Copyright (C) 2011-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:=moc
+PKG_VERSION:=2.5.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://ftp.daper.net/pub/soft/moc/stable/
+PKG_MD5SUM:=f3a68115602a4788b7cfa9bbe9397a9d5e24c68cb61a57695d1c2c3ecf49db08
+
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+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
+
+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
+  TITLE:=Music On Console
+  URL:=http://moc.daper.net/
+endef
+
+define Package/moc/description
+       MOC (music on console) is a console audio player for LINUX/UNIX designed to be powerful and easy to use.
+endef
+
+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-flac \
+               --without-musepack \
+               --without-rcc \
+               $(if $(CONFIG_PACKAGE_libncursesw),--with-ncursesw --without-ncurses,--with-ncurses --without-ncursesw) \
+               --with-bdb-dir="$(STAGING_DIR)/usr"
+
+define Package/moc/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mocp $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib/moc/decoder_plugins
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/moc/decoder_plugins/*.so $(1)/usr/lib/moc/decoder_plugins
+endef
+
+$(eval $(call BuildPackage,moc))
diff --git a/sound/mpc/Makefile b/sound/mpc/Makefile
new file mode 100644 (file)
index 0000000..3109b1c
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# 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:=mpc
+PKG_VERSION:=0.27
+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_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mpc
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+libmpdclient
+  TITLE:=Music Player Daemon Console Client
+  URL:=http://www.musicpd.org/
+endef
+
+define Package/mpc/description
+       MPD is a music player supporting flac, mp3 and ogg files.
+       It is typically controlled over a network using one of it's many
+       clients including mpc(console), gmpc(gnome), phpmp(php) etc.
+       this is MPC
+endef
+
+define Build/Configure
+$(call Build/Configure/Default, \
+       --disable-iconv \
+)
+endef
+
+define Build/Compile
+$(call Build/Compile/Default,\
+               CFLAGS="$(TARGET_CFLAGS) -std=gnu99" \
+               prefix="/usr" \
+               all \
+)
+endef
+
+define Package/mpc/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mpc $(1)/usr/bin/
+       $(INSTALL_BIN) ./files/pls-handler.sh $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,mpc))
diff --git a/sound/mpc/files/pls-handler.sh b/sound/mpc/files/pls-handler.sh
new file mode 100644 (file)
index 0000000..9394417
--- /dev/null
@@ -0,0 +1,5 @@
+#!/usr/bin/env sh
+echo parameter: file.pls
+mpc clear
+grep '^File[0-9]*' $1 | sed -e 's/^File[0-9]*=//' | mpc add
+mpc play
\ No newline at end of file
diff --git a/sound/mpd/Makefile b/sound/mpd/Makefile
new file mode 100644 (file)
index 0000000..162660a
--- /dev/null
@@ -0,0 +1,229 @@
+#
+# Copyright (C) 2015-2016 Ted Hess
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mpd
+PKG_VERSION:=0.19.19
+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_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_IPV6 \
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/mpd/Default
+  SECTION:=sound
+  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
+endef
+
+define Package/mpd/Default/description
+ Music Player Daemon (MPD) is a flexible, powerful, server-side
+ application for playing music. It is typically controlled over a
+ network using one of it's many clients including mpc (console),
+ gmpc (gnome), phpmp (php), etc...
+endef
+
+define Package/mpd-full
+$(call Package/mpd/Default)
+  TITLE+= (full)
+  DEPENDS+= \
+       +libaudiofile +BUILD_PATENTED:libfaad2 +libffmpeg +libid3tag \
+       +libmms +libogg +libsndfile +libvorbis +libupnp
+  PROVIDES:=mpd
+  VARIANT:=full
+endef
+
+define Package/mpd-full/description
+$(call Package/mpd/Default/description)
+ .
+ This package contains a full-blown Music Player Daemon.
+endef
+
+define Package/mpd-full/conffiles
+/etc/mpd.conf
+endef
+
+define Package/mpd-mini
+$(call Package/mpd/Default)
+  TITLE+= (mini)
+  PROVIDES:=mpd
+  VARIANT:=mini
+endef
+
+define Package/mpd-mini/description
+$(call Package/mpd/Default/description)
+ .
+ This package contains a minimal Music Player Daemon, with support for
+ only Flac, MP3 & OGG media types & only file: & http: protocols.
+endef
+
+define Package/mpd-mini/conffiles
+/etc/mpd.conf
+endef
+
+define Package/mpd-avahi-service
+$(call Package/mpd/Default)
+  TITLE+= (Avahi service)
+  DEPENDS+=+avahi-daemon
+endef
+
+define Package/mpd-avahi-service/description
+$(call Package/mpd/Default/description)
+ .
+ This package contains the service definition for announcing the
+ Music Player Daemon service via mDNS/DNS-SD.
+endef
+
+define Package/mpd-avahi-service/conffiles
+/etc/avahi/services/mpd.service
+endef
+
+CONFIGURE_ARGS += \
+       $(call autoconf_bool,CONFIG_IPV6,ipv6) \
+       --disable-debug \
+       --disable-documentation \
+       --disable-test \
+       --disable-werror \
+       \
+       --disable-ao \
+       --disable-bzip2 \
+       --disable-fluidsynth \
+       --disable-wildmidi \
+       --disable-gme \
+       --enable-inotify \
+       --disable-icu \
+       --disable-eventfd \
+       --disable-iso9660 \
+       --disable-jack \
+       --disable-roar \
+       --disable-libwrap \
+       --disable-lsr \
+       --disable-mikmod \
+       --disable-modplug \
+       --disable-mpc \
+       --disable-mpg123 \
+       --disable-openal \
+       --disable-opus \
+       --disable-pulse \
+       --disable-sidplay \
+       --disable-solaris-output \
+       --disable-sqlite \
+       --disable-lame-encoder \
+       --disable-twolame-encoder \
+       --disable-shine-encoder \
+       --enable-wave-encoder \
+       --disable-wavpack \
+       --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") \
+
+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 \
+       --enable-id3 \
+       --enable-lastfm \
+       --enable-mms \
+       --enable-oggflac \
+       --enable-pipe-output \
+       --enable-recorder-output \
+       --disable-shout \
+       --enable-sndfile \
+       --enable-vorbis \
+       --disable-vorbis-encoder \
+       --with-faad="$(STAGING_DIR)/usr" \
+       --with-tremor=yes \
+
+endif
+
+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 \
+       --with-tremor=yes \
+
+endif
+
+define Package/mpd/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mpd $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/mpdconf.example $(1)/etc/mpd.conf
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/mpd.init $(1)/etc/init.d/mpd
+endef
+
+define Package/mpd-full/install
+$(call Package/mpd/install,$1)
+endef
+
+define Package/mpd-mini/install
+$(call Package/mpd/install,$1)
+endef
+
+define Package/mpd-avahi-service/install
+       $(INSTALL_DIR) $(1)/etc/avahi/services
+       $(INSTALL_DATA) ./files/mpd.service $(1)/etc/avahi/services/
+endef
+
+$(eval $(call BuildPackage,mpd-full))
+$(eval $(call BuildPackage,mpd-mini))
+$(eval $(call BuildPackage,mpd-avahi-service))
diff --git a/sound/mpd/files/mpd.init b/sound/mpd/files/mpd.init
new file mode 100644 (file)
index 0000000..ac8f1fc
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2007-2014 OpenWrt.org
+
+START=93
+
+USE_PROCD=1
+
+PROG=/usr/bin/mpd
+CONFIGFILE=/etc/mpd.conf
+NICEPRIO=-10
+
+#TODO: Add uci config - nice, config
+
+start_service() {
+       #create mpd directories from config
+       local pld=`grep ^playlist_directory "$CONFIGFILE" | cut -d "\"" -f 2 | sed "s/~/\/root/g"`
+       if [ ! -d $pld ]; then
+               mkdir -m 0755 -p $pld
+       fi
+
+       local lport=`grep ^port "$CONFIGFILE" | cut -d "\"" -f 2`
+       [ -z $lport ] && lport=6600
+
+       procd_open_instance
+       procd_add_mdns "mpd" "tcp" "$lport"
+       procd_set_param command "$PROG" --no-daemon "$CONFIGFILE"
+       # Give MPD some real-time priority
+       procd_set_param nice "$NICEPRIO"
+       procd_close_instance
+}
diff --git a/sound/mpd/files/mpd.service b/sound/mpd/files/mpd.service
new file mode 100644 (file)
index 0000000..a545f24
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
+<service-group>
+ <name replace-wildcards="yes">%h</name>
+  <service>
+   <type>_mpd._tcp</type>
+   <port>6600</port>
+  </service>
+</service-group>
diff --git a/sound/mpd/patches/210-support_raw_pcm_streams.patch b/sound/mpd/patches/210-support_raw_pcm_streams.patch
new file mode 100644 (file)
index 0000000..2756570
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
++++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+@@ -777,6 +777,7 @@ static const char *const ffmpeg_mime_typ
+       "audio/qcelp",
+       "audio/vorbis",
+       "audio/vorbis+ogg",
++      "audio/wav",
+       "audio/x-8svx",
+       "audio/x-16sv",
+       "audio/x-aac",
diff --git a/sound/mpd/patches/220-handle_slow_server_stream_startup.patch b/sound/mpd/patches/220-handle_slow_server_stream_startup.patch
new file mode 100644 (file)
index 0000000..2ebb91c
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
++++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+@@ -465,6 +465,13 @@ ffmpeg_probe(Decoder *decoder, InputStre
+       unsigned char buffer[BUFFER_SIZE];
+       size_t nbytes = decoder_read(decoder, 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);
++      }
++
+       if (nbytes <= PADDING || !is.LockRewind(IgnoreError()))
+               return nullptr;
diff --git a/sound/mpg123/Makefile b/sound/mpg123/Makefile
new file mode 100644 (file)
index 0000000..8495ed2
--- /dev/null
@@ -0,0 +1,102 @@
+#
+# Copyright (C) 2007-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:=mpg123
+PKG_VERSION:=1.22.3
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://www.mpg123.de/download/
+PKG_MD5SUM:=fca857bc5ad0d2070cd38bd5f0f85f1c
+PKG_MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
+
+PKG_FIXUP:=libtool
+
+PKG_LICENSE:=LGPL-2.1 GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mpg123/Default
+  URL:=http://www.mpg123.de
+  DEPENDS:=@BUILD_PATENTED
+endef
+
+define Package/libmpg123
+  $(call Package/mpg123/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=fast console mpeg audio decoder library
+  DEPENDS:=+libltdl
+endef
+
+define Package/mpg123
+  $(call Package/mpg123/Default)
+  SECTION:=sound
+  CATEGORY:=Sound
+  TITLE:=fast console mpeg audio player
+  DEPENDS+=+libmpg123 +alsa-lib
+endef
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               --enable-shared \
+               --enable-static \
+               --with-cpu=generic_nofpu \
+               --with-audio=alsa \
+               --with-default-audio=alsa \
+       )
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/include/mpg123.h \
+               $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libmpg123.{la,a,so*} \
+               $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/usr/lib/mpg123
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/mpg123/* \
+               $(1)/usr/lib/mpg123
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmpg123.pc \
+               $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libmpg123/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libmpg123.so* \
+               $(1)/usr/lib/
+endef
+
+define Package/mpg123/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/bin/mpg123{,-id3dump,-strip} \
+               $(PKG_INSTALL_DIR)/usr/bin/out123 \
+               $(1)/usr/bin
+
+       $(INSTALL_DIR) $(1)/usr/lib/mpg123
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/mpg123/* \
+               $(1)/usr/lib/mpg123
+endef
+
+$(eval $(call BuildPackage,libmpg123))
+$(eval $(call BuildPackage,mpg123))
diff --git a/sound/pianod/Makefile b/sound/pianod/Makefile
new file mode 100644 (file)
index 0000000..e92ae64
--- /dev/null
@@ -0,0 +1,110 @@
+#
+# Copyright (C) 2015-2017 Ted Hess <thess@kitschensync.net>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pianod
+PKG_VERSION:=174.05
+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_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=MIT VARIOUS
+PKG_LICENSE_FILES:=COPYING
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/pianod
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+libao +libfaad2 +libmad +libmbedtls +libjson-c +libgcrypt +libpthread
+  TITLE:=Pandora radio daemon
+  USERID:=pianod=88:pianod=88
+  URL:=http://deviousfish.com/pianod1/
+endef
+
+define Package/pianod/description
+  pianod is a Pandora music player client with line-oriented and Websocket control interfaces.
+  A simple protocol makes for easy clients, mix scripting, integration with a
+  home automation system, use as multiple-user music system for home or office.
+  Documentation and configuration information can be found at:
+      http://deviousfish.com/pianod1/
+endef
+
+define Package/pianod-client
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+pianod
+  TITLE:=Pandora radio daemon WebUI
+  URL:=http://deviousfish.com/pianod1/
+endef
+
+define Package/pianod-client/description
+  Web client UI and remote player viewer for pianod
+  Examples --- (Note: The viewer.* files need not be on the pianod host)
+  Main interface: http://pianod-host:4446/pianod
+  Remote viewer: file:///<path>/viewer.html?server=pianod-host:4446  --or--
+                 http://pianod-host:4446/pianod/viewer.html?server=pianod-host:4446
+endef
+
+CONFIGURE_ARGS+= --with-mbedtls
+
+PIANOD_CLIENT:=pianod-client-compiled-51.tar.gz
+
+define Download/pianod-client
+  URL:=http://deviousfish.com/Downloads/pianod/
+  FILE:=$(PIANOD_CLIENT)
+  MD5SUM:=abbdee5627bcee6a00c8304da8b4e2e7
+endef
+
+define Package/pianod/conffiles
+/etc/pianod/startscript
+/etc/pianod/users
+endef
+
+define Build/Prepare
+    $(call Build/Prepare/Default)
+    ifneq ($(CONFIG_PACKAGE_pianod-client),)
+       $(eval $(call Download,pianod-client))
+       mkdir -p $(PKG_BUILD_DIR)/pianod-client
+       $(TAR) -xf $(DL_DIR)/$(PIANOD_CLIENT) --strip=1 -C $(PKG_BUILD_DIR)/pianod-client
+    endif
+endef
+
+define Package/pianod-client/Configure
+endef
+
+define Package/pianod-client/Compile
+endef
+
+define Package/pianod/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pianod $(1)/usr/bin/
+# These scripts need ksh (install mksh and link)
+#      $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/piano $(1)/usr/bin/
+#      $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/runmix $(1)/usr/bin/
+
+       $(INSTALL_DIR) $(1)/etc/pianod
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/contrib/startscript-example $(1)/etc/pianod/startscript
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/pianod.init $(1)/etc/init.d/pianod
+endef
+
+define Package/pianod-client/install
+       $(INSTALL_DIR) $(1)/www/pianod
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/pianod-client/*.{html,js,gif,jpeg,css} $(1)/www/pianod/
+endef
+
+$(eval $(call BuildPackage,pianod))
+$(eval $(call BuildPackage,pianod-client))
diff --git a/sound/pianod/files/pianod.init b/sound/pianod/files/pianod.init
new file mode 100644 (file)
index 0000000..b232944
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+NAME=pianod
+START=95
+
+USE_PROCD=1
+
+PD_USER=$NAME
+PD_STARTSCRIPT=/etc/$NAME/startscript
+PD_PASSWDFILE=/etc/$NAME/users
+PD_WEBUI=/www/$NAME
+
+start_service() {
+       # Take group ownership of audio devices
+       chown root:$NAME /dev/snd/* /dev/mixer /dev/dsp
+       chmod 664 /dev/snd/* /dev/mixer /dev/dsp
+
+       procd_open_instance
+
+       procd_set_param command "/usr/bin/$NAME"
+
+       procd_append_param command -n $PD_USER
+       procd_append_param command -i "$PD_STARTSCRIPT"
+       procd_append_param command -u "$PD_PASSWDFILE"
+       [ -d "$PD_WEBUI" ] && procd_append_param command -c "$PD_WEBUI"
+       # No HTTPS support without certificates
+       procd_append_param command -s 0
+
+       procd_close_instance
+}
+
+# Wait for service to exit and release sockets
+reload_service() {
+       stop
+       sleep 2
+       start
+}
+
+restart() {
+       reload_service
+}
diff --git a/sound/portaudio/Makefile b/sound/portaudio/Makefile
new file mode 100644 (file)
index 0000000..ffa5cfb
--- /dev/null
@@ -0,0 +1,70 @@
+#
+# 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:=portaudio
+PKG_VERSION:=19_20140130
+PKG_RELEASE:=1
+
+PKG_SOURCE:=pa_stable_v$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://www.portaudio.com/archives/
+PKG_MD5SUM:=7f220406902af9dca009668e198cbd23
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE.txt
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/portaudio
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+alsa-lib +libpthread +librt
+  TITLE:=Portable cross-platform audio I/O
+  URL:=http://www.portaudio.com/
+endef
+
+define Package/portaudio/description
+ PortAudio is a free, cross-platform, open-source, audio I/O library.  It lets
+ you write simple audio programs in 'C' or C++ that will compile and run on many
+ platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA). It is
+ intended to promote the exchange of audio software between developers on
+ different platforms. Many applications use PortAudio for Audio I/O.
+endef
+
+CONFIGURE_ARGS+= \
+       --with-alsa \
+       --without-asihpi \
+       --without-jack \
+       --with-oss \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/portaudio.h \
+               $(PKG_INSTALL_DIR)/usr/include/pa_linux_alsa.h \
+               $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libportaudio.{a,so*} \
+               $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/portaudio-*.pc \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/portaudio/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libportaudio.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,portaudio))
diff --git a/sound/pulseaudio/Makefile b/sound/pulseaudio/Makefile
new file mode 100644 (file)
index 0000000..788111b
--- /dev/null
@@ -0,0 +1,195 @@
+#
+# Copyright (C) 2011-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pulseaudio
+PKG_VERSION:=9.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://freedesktop.org/software/pulseaudio/releases/
+PKG_MD5SUM:=da7162541b3a9bc20576dbd0d7d1489a
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=GPL LICENSE
+
+PKG_BUILD_DEPENDS:=intltool/host
+
+PKG_FIXUP:=autoreconf
+PKG_USE_MIPS16:=0
+
+PKG_INSTALL = 1
+
+include $(INCLUDE_DIR)/package.mk
+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)
+  TITLE:=Network sound server
+  MAINTAINER:=Peter Wagner <tripolar@gmx.at>
+  URL:=http://www.pulseaudio.org
+  PROVIDES:=pulseaudio
+  USERID:=pulse=51:pulse=51
+endef
+
+define Package/pulseaudio-daemon
+  $(call Package/pulseaudio/Default)
+  DEPENDS+= +libjson-c
+endef
+
+define Package/pulseaudio/Default/description
+  PulseAudio (formerly Polypaudio) is a cross-platform, networked sound server.
+endef
+
+define Package/pulseaudio-daemon/description
+  $(call Package/pulseaudio/Default/description)
+endef
+
+define Package/pulseaudio-daemon/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
+endef
+
+define Package/pulseaudio-profiles
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+pulseaudio
+  TITLE:=Profiles for Pulseaudio
+  URL:=http://www.pulseaudio.org
+endef
+
+CONFIGURE_ARGS += \
+       --with-system-user=pulse \
+       --with-system-group=pulse \
+       --with-access-group=audio \
+       --with-database=simple \
+       --enable-alsa \
+       --disable-hal \
+       --disable-gconf \
+       --disable-nls \
+       --disable-manpages \
+       --enable-oss-output \
+       --disable-oss-wrapper \
+       --disable-samplerate \
+       --disable-per-user-esound-socket \
+       --disable-solaris \
+       --disable-gtk2 \
+       --disable-glib2 \
+       --disable-jack \
+       --disable-asyncns \
+       --disable-lirc \
+       --disable-bluez \
+       --disable-udev \
+       --without-fftw \
+       --disable-avahi \
+       --disable-dbus \
+       --without-soxr
+
+CONFIGURE_VARS += \
+       PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig"
+
+#SUPP_LIBS:=-L$(INTL_PREFIX)/lib -L$(ICONV_PREFIX)/lib
+TARGET_CFLAGS += -std=gnu99
+
+define Build/InstallDev
+       $(INSTALL_DIR) \
+               $(1)/usr/lib/pkgconfig \
+               $(1)/usr/include/pulse \
+               $(1)/usr/lib \
+               $(1)/usr/lib/pulseaudio
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/pulse/* \
+               $(1)/usr/include/pulse
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
+               $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+               $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pulseaudio/* \
+               $(1)/usr/lib/pulseaudio/
+endef
+
+define Package/pulseaudio-daemon/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
+
+       $(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/
+
+endef
+
+define Package/pulseaudio-tools/install
+       $(INSTALL_DIR) \
+               $(1)/usr/bin
+
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/bin/pa* \
+               $(1)/usr/bin/
+endef
+
+define Package/pulseaudio-profiles/install
+       $(INSTALL_DIR) \
+               $(1)/usr/share/pulseaudio/alsa-mixer/paths \
+               $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets
+
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/paths/* \
+               $(1)/usr/share/pulseaudio/alsa-mixer/paths
+
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/profile-sets/* \
+               $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets
+endef
+
+$(eval $(call BuildPackage,pulseaudio-daemon))
+$(eval $(call BuildPackage,pulseaudio-tools))
+$(eval $(call BuildPackage,pulseaudio-profiles))
diff --git a/sound/pulseaudio/files/pulseaudio.init b/sound/pulseaudio/files/pulseaudio.init
new file mode 100644 (file)
index 0000000..005d21f
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2011 OpenWrt.org
+
+START=99
+STOP=65
+
+USE_PROCD=1
+PROG=/usr/bin/pulseaudio
+
+start_service() {
+       [ -d /var/run/pulse ] || {
+               mkdir -m 0755 -p /var/run/pulse
+               chmod 0750 /var/run/pulse
+               chown pulse:pulse /var/run/pulse
+       }
+       [ -d /var/lib/pulse ] || {
+               mkdir -m 0755 -p /var/lib/pulse
+               chmod 0750 /var/lib/pulse
+               chown pulse:pulse /var/lib/pulse
+       }
+
+       chown root:pulse /dev/snd/* /dev/mixer /dev/dsp
+       chmod 664 /dev/snd/* /dev/mixer /dev/dsp
+
+       procd_open_instance
+       procd_set_param command $PROG --system --disallow-exit --disallow-module-loading --disable-shm --exit-idle-time=-1 --realtime=false
+       procd_close_instance
+}
+
diff --git a/sound/pulseaudio/patches/001-no_default_64mb_alloc.patch b/sound/pulseaudio/patches/001-no_default_64mb_alloc.patch
new file mode 100644 (file)
index 0000000..8dd000b
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/pulsecore/memblock.c
++++ b/src/pulsecore/memblock.c
+@@ -55,7 +55,7 @@
+  * stored in SHM and our OS does not commit the memory before we use
+  * it for the first time. */
+ #define PA_MEMPOOL_SLOTS_MAX 1024
+-#define PA_MEMPOOL_SLOT_SIZE (64*1024)
++#define PA_MEMPOOL_SLOT_SIZE 64
+ #define PA_MEMEXPORT_SLOTS_MAX 128
diff --git a/sound/shairplay/Makefile b/sound/shairplay/Makefile
new file mode 100644 (file)
index 0000000..191647c
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# 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:=shairplay
+PKG_VERSION:=2016-01-01
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+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_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/shairplay
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+libao +libavahi-compat-libdnssd +libltdl +libpthread
+  TITLE:=Shairplay
+endef
+
+define Package/shairplay/description
+  Free portable AirPlay server implementation similar to ShairPort.
+endef
+
+define Package/shairplay/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/shairplay $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/share/shairplay
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/airport.key $(1)/usr/share/shairplay/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) files/shairplay.init $(1)/etc/init.d/shairplay
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) files/shairplay.config $(1)/etc/config/shairplay
+endef
+
+$(eval $(call BuildPackage,shairplay))
diff --git a/sound/shairplay/files/shairplay.config b/sound/shairplay/files/shairplay.config
new file mode 100644 (file)
index 0000000..6e1f939
--- /dev/null
@@ -0,0 +1,10 @@
+config shairplay main
+       option disabled '1'
+       option respawn '1'
+       option apname 'AirPlay'
+       option port '5000'
+       option password ''
+       option hwaddr ''
+       option ao_driver 'oss'
+       option ao_devicename ''
+       option ao_deviceid ''
diff --git a/sound/shairplay/files/shairplay.init b/sound/shairplay/files/shairplay.init
new file mode 100644 (file)
index 0000000..093a168
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 OpenWrt.org
+
+START=90
+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}"
+}
+
+start_instance() {
+       local cfg="$1"
+       local aux
+
+       config_get_bool aux "$cfg" 'disabled' '0'
+       [ "$aux" = 1 ] && return 1
+
+       procd_open_instance
+
+       procd_set_param command /usr/bin/shairplay
+
+       append_arg "$cfg" apname "--apname" "AirPlay"
+       append_arg "$cfg" port "--server_port"
+       append_arg "$cfg" password "--password"
+       append_arg "$cfg" hwaddr "--hwaddr"
+
+       append_arg "$cfg" ao_driver "--ao_driver"
+       append_arg "$cfg" ao_devicename "--ao_devicename"
+       append_arg "$cfg" ao_deviceid "--ao_deviceid"
+
+       config_get_bool aux "$cfg" 'respawn' '0'
+       [ "$aux" = 1 ] && procd_set_param respawn
+
+       procd_close_instance
+}
+
+service_triggers() { 
+       procd_add_reload_trigger "shairplay" 
+}
+
+start_service() {
+       config_load shairplay
+       config_foreach start_instance shairplay
+}
diff --git a/sound/shairplay/patches/001-key_file_dir.patch b/sound/shairplay/patches/001-key_file_dir.patch
new file mode 100644 (file)
index 0000000..af9bd84
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/shairplay.c
++++ b/src/shairplay.c
+@@ -350,7 +350,7 @@ main(int argc, char *argv[])
+       raop_cbs.audio_destroy = audio_destroy;
+       raop_cbs.audio_set_volume = audio_set_volume;
+-      raop = raop_init_from_keyfile(10, &raop_cbs, "airport.key", NULL);
++      raop = raop_init_from_keyfile(10, &raop_cbs, "/usr/share/shairplay/airport.key", NULL);
+       if (raop == NULL) {
+               fprintf(stderr, "Could not initialize the RAOP service\n");
+               fprintf(stderr, "Please make sure the airport.key file is in the current directory.\n");
diff --git a/sound/shairplay/patches/002-libavahi-compat-dnssd.patch b/sound/shairplay/patches/002-libavahi-compat-dnssd.patch
new file mode 100644 (file)
index 0000000..ff70e24
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/lib/dnssd.c
++++ b/src/lib/dnssd.c
+@@ -167,7 +167,7 @@ dnssd_init(int *error)
+               return NULL;
+       }
+ #elif USE_LIBDL
+-      dnssd->module = dlopen("libdns_sd.so", RTLD_LAZY);
++      dnssd->module = dlopen("libdns_sd.so.1", RTLD_LAZY);
+       if (!dnssd->module) {
+               if (error) *error = DNSSD_ERROR_LIBNOTFOUND;
+               free(dnssd);
diff --git a/sound/shairplay/patches/003-fix_big-endian.patch b/sound/shairplay/patches/003-fix_big-endian.patch
new file mode 100644 (file)
index 0000000..4db204e
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/lib/alac/alac.c
++++ b/src/lib/alac/alac.c
+@@ -29,7 +29,7 @@
+  *
+  */
+-static const int host_bigendian = 0;
++#define host_bigendian (htonl(42) == 42)
+ #include <stdio.h>
+ #include <stdlib.h>
diff --git a/sound/shairport-sync/Makefile b/sound/shairport-sync/Makefile
new file mode 100644 (file)
index 0000000..abec421
--- /dev/null
@@ -0,0 +1,124 @@
+#
+# 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:=shairport-sync
+PKG_VERSION:=2.8.6
+PKG_RELEASE:=2
+
+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_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
+               Mike Brady <mikebrady@eircom.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING LICENSES shairport.c
+
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/shairport-sync/default
+  SECTION:=sound
+  CATEGORY:=Sound
+  TITLE:=AirPlay compatible audio player
+  DEPENDS:=@AUDIO_SUPPORT +libpthread +alsa-lib +libconfig +libdaemon +libpopt
+  PROVIDES:=shairport-sync
+  URL:=http://github.com/mikebrady/shairport-sync
+endef
+
+define Package/shairport-sync-openssl
+  $(Package/shairport-sync/default)
+  TITLE+= (openssl)
+  DEPENDS+= +libopenssl +libavahi-client +libsoxr
+  VARIANT:=openssl
+endef
+
+define Package/shairport-sync-mbedtls
+  $(Package/shairport-sync/default)
+  TITLE+= (mbed TLS)
+  DEPENDS+= +libmbedtls +libavahi-client +libsoxr
+  VARIANT:=mbedtls
+  DEFAULT_VARIANT:=1
+endef
+
+define Package/shairport-sync-mini
+  $(Package/shairport-sync/default)
+  TITLE+= (minimal)
+  DEPENDS+= +libmbedtls
+  VARIANT:=mini
+endef
+
+define Package/shairport-sync/default/description
+  Shairport Sync plays audio from iTunes and AirPlay sources, including
+  iOS devices, Quicktime Player and third party sources such as forkedDaapd.
+  Audio played by a Shairport Sync-powered device stays synchronised with the source
+  and hence with similar devices playing the same source.
+
+  Shairport Sync does not support AirPlay video or photo streaming.
+  Ensure Kernel Modules > Sound Support > kmod-sound-core is selected.
+  Also select kmod-usb-audio if you want to use USB-connected sound cards.
+endef
+Package/shairport-sync-openssl/description = $(Package/shairport-sync/default/description)
+Package/shairport-sync-mbedtls/description = $(Package/shairport-sync/default/description)
+
+define Package/shairport-sync-mini/description
+  $(Package/shairport-sync/default/description)
+
+  Minimal version uses mbed TLS and does not include libsoxr and avahi support.
+endef
+
+CONFIGURE_ARGS+= \
+       --with-alsa \
+       --with-metadata
+
+ifeq ($(BUILD_VARIANT),openssl)
+  CONFIGURE_ARGS+= --with-ssl=openssl
+endif
+
+ifeq ($(BUILD_VARIANT),mbedtls)
+  CONFIGURE_ARGS+= --with-ssl=mbedtls
+endif
+
+ifeq ($(BUILD_VARIANT),mini)
+  CONFIGURE_ARGS+= --with-ssl=mbedtls --with-tinysvcmdns
+else
+  CONFIGURE_ARGS+= --with-avahi --with-soxr
+endif
+
+define Package/shairport-sync/default/conffiles
+/etc/shairport-sync.conf
+endef
+
+Package/shairport-sync-openssl/conffiles = $(Package/shairport-sync/default/conffiles)
+Package/shairport-sync-mbedtls/conffiles = $(Package/shairport-sync/default/conffiles)
+Package/shairport-sync-mini/conffiles = $(Package/shairport-sync/default/conffiles)
+
+define Package/shairport-sync/default/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/shairport-sync $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/scripts/shairport-sync.conf $(1)/etc/shairport-sync.conf
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/shairport-sync.init $(1)/etc/init.d/shairport-sync
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./files/shairport-sync.config $(1)/etc/config/shairport-sync
+endef
+
+Package/shairport-sync-openssl/install = $(Package/shairport-sync/default/install)
+Package/shairport-sync-mbedtls/install = $(Package/shairport-sync/default/install)
+Package/shairport-sync-mini/install = $(Package/shairport-sync/default/install)
+
+$(eval $(call BuildPackage,shairport-sync-openssl))
+$(eval $(call BuildPackage,shairport-sync-mbedtls))
+$(eval $(call BuildPackage,shairport-sync-mini))
diff --git a/sound/shairport-sync/files/shairport-sync.config b/sound/shairport-sync/files/shairport-sync.config
new file mode 100644 (file)
index 0000000..96917af
--- /dev/null
@@ -0,0 +1,61 @@
+# Use your own config file
+config shairport-sync 'shairport_sync_file'
+       option disabled '1'
+       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 respawn '1'
+       # General
+       option name 'Shairport-Sync-%v-%h'
+       option password ''
+       option interpolation '' # basic/soxr
+       option output_backend '' # alsa/pipe/stdout/ao/dummy/pulse/sndio
+       option mdns_backend '' # avahi/external-avahi/dns-sd/external-dns-sd/tinysvcmdns
+       option port '' # 5000
+       option udp_port_base '' # 6001
+       option udp_port_range '' # 100
+       option statistics '' # no/yes
+       option drift '' # 88
+       option resync_threshold '' # 2205
+       option log_verbosity '' # 0/1/2/3
+       option ignore_volume_control '' # no/yes
+       option volume_range_db '' # 30 to 150
+       option regtype '' # _raop._tcp
+       option playback_mode '' # stereo/mono
+       # Metadata
+       option metadata_enabled '' # no/yes
+       option metadata_cover_art '' # no/yes
+       option metadata_pipe_name '' # /tmp/shairport-sync-metadata
+       option metadata_pipe_timeout '' # 5000
+       option metadata_socket_address '' # 226.0.0.1
+       option metadata_socket_port '' # 5555
+       option metadata_socket_msglength # 65000
+       # Session Control
+       option sesctl_run_before_play_begins '' # /etc/shairport-sync-start.sh
+       option sesctl_run_after_play_ends '' # /etc/shairport-sync-stop.sh
+       option sesctl_wait_for_completion '' # no/yes
+       option sesctl_session_interruption '' # no/yes
+       option sesctl_session_timeout '' # 120
+       # ALSA
+       option alsa_output_device '' # default
+       option alsa_mixer_control_name '' # PCM
+       option alsa_mixer_device '' # default
+       option alsa_latency_offset '' # 0
+       option alsa_buffer_length '' # 6615
+       option alsa_disable_synchronization '' # no/yes
+       option alsa_period_size '' # number
+       option alsa_buffer_size '' # number
+       # Pipe
+       option pipe_name '' # /tmp/shairport-sync-audio
+       option pipe_latency_offset '' # 0
+       option pipe_buffer_length '' # 44100
+       # Stdout
+       option stdout_latency_offset '' # 0
+       option stdout_buffer_length '' # 44100
+       # AO
+       option ao_latency_offset '' # 0
+       option ao_buffer_length '' # 44100
diff --git a/sound/shairport-sync/files/shairport-sync.init b/sound/shairport-sync/files/shairport-sync.init
new file mode 100644 (file)
index 0000000..afda520
--- /dev/null
@@ -0,0 +1,142 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015-2016 OpenWrt.org
+
+START=99
+USE_PROCD=1
+
+append_num() {
+       local cfg="$1"
+       local file="$2"
+       local var="$3"
+       local opt="$4"
+       local def="$5"
+       local val
+
+       config_get val "$cfg" "$var"
+       [ -n "$val" -o -n "$def" ] && echo -e "\t$opt = ${val:-$def};" >> $file
+}
+append_str() {
+       local cfg="$1"
+       local file="$2"
+       local var="$3"
+       local opt="$4"
+       local def="$5"
+       local val
+
+       config_get val "$cfg" "$var"
+       [ -n "$val" -o -n "$def" ] && echo -e "\t$opt = \"${val:-$def}\";" >> $file
+}
+
+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 conf_custom "$cfg" 'conf_custom' '0'
+       config_get conf_file "$cfg" "conf_file"
+       if [ $conf_custom -ne 1 ] && [ ! -n "$conf_file" ]; then
+               mkdir -p /var/etc
+               conf_file="/var/etc/shairport-sync-${cfg}.conf"
+
+               echo -e "// Automatically generated from UCI config\n" > $conf_file
+
+               # General
+               echo -e "general =" >> $conf_file
+               echo -e "{" >> $conf_file
+               append_str "$cfg" "$conf_file" name "name"
+               append_str "$cfg" "$conf_file" password "password"
+               append_str "$cfg" "$conf_file" interpolation "interpolation"
+               append_str "$cfg" "$conf_file" output_backend "output_backend"
+               append_str "$cfg" "$conf_file" mdns_backend "mdns_backend"
+               append_num "$cfg" "$conf_file" port "port"
+               append_num "$cfg" "$conf_file" udp_port_base "udp_port_base"
+               append_num "$cfg" "$conf_file" udp_port_range "udp_port_range"
+               append_str "$cfg" "$conf_file" statistics "statistics"
+               append_num "$cfg" "$conf_file" drift "drift"
+               append_num "$cfg" "$conf_file" resync_threshold "resync_threshold"
+               append_num "$cfg" "$conf_file" log_verbosity "log_verbosity"
+               append_str "$cfg" "$conf_file" ignore_volume_control "ignore_volume_control"
+               append_num "$cfg" "$conf_file" volume_range_db "volume_range_db"
+               append_str "$cfg" "$conf_file" regtype "regtype"
+               append_str "$cfg" "$conf_file" playback_mode "playback_mode"
+               echo -e "};\n" >> $conf_file
+
+               # Metadata
+               echo -e "metadata =" >> $conf_file
+               echo -e "{" >> $conf_file
+               append_str "$cfg" "$conf_file" metadata_enabled "enabled"
+               append_str "$cfg" "$conf_file" metadata_cover_art "include_cover_art"
+               append_str "$cfg" "$conf_file" metadata_pipe_name "pipe_name"
+               append_num "$cfg" "$conf_file" metadata_pipe_timeout "pipe_timeout"
+               append_str "$cfg" "$conf_file" metadata_socket_address "socket_address"
+               append_num "$cfg" "$conf_file" metadata_socket_port "socket_port"
+               append_num "$cfg" "$conf_file" metadata_socket_msglength "socket_msglength"
+               echo -e "};\n" >> $conf_file
+
+               # Session control
+               echo -e "sessioncontrol =" >> $conf_file
+               echo -e "{" >> $conf_file
+               append_str "$cfg" "$conf_file" sesctl_run_before_play_begins "run_this_before_play_begins"
+               append_str "$cfg" "$conf_file" sesctl_run_after_play_ends "run_this_after_play_ends"
+               append_str "$cfg" "$conf_file" sesctl_wait_for_completion "wait_for_completion"
+               append_str "$cfg" "$conf_file" sesctl_session_interruption "allow_session_interruption"
+               append_num "$cfg" "$conf_file" sesctl_session_timeout "session_timeout"
+               echo -e "};\n" >> $conf_file
+
+               # Alsa audio back end
+               echo -e "alsa =" >> $conf_file
+               echo -e "{" >> $conf_file
+               append_str "$cfg" "$conf_file" alsa_output_device "output_device"
+               append_str "$cfg" "$conf_file" alsa_mixer_control_name "mixer_control_name"
+               append_str "$cfg" "$conf_file" alsa_mixer_device "mixer_device"
+               append_num "$cfg" "$conf_file" alsa_latency_offset "audio_backend_latency_offset"
+               append_num "$cfg" "$conf_file" alsa_buffer_length "audio_backend_buffer_desired_length"
+               append_str "$cfg" "$conf_file" alsa_disable_synchronization "disable_synchronization"
+               append_num "$cfg" "$conf_file" alsa_period_size "period_size"
+               append_num "$cfg" "$conf_file" alsa_buffer_size "buffer_size"
+               echo -e "};\n" >> $conf_file
+
+               # Pipe audio back end
+               echo -e "pipe =" >> $conf_file
+               echo -e "{" >> $conf_file
+               append_str "$cfg" "$conf_file" pipe_name "name"
+               append_num "$cfg" "$conf_file" pipe_latency_offset "audio_backend_latency_offset"
+               append_num "$cfg" "$conf_file" pipe_buffer_length "audio_backend_buffer_desired_length"
+               echo -e "};\n" >> $conf_file
+
+               # Stdout audio back end
+               echo -e "stdout =" >> $conf_file
+               echo -e "{" >> $conf_file
+               append_num "$cfg" "$conf_file" stdout_latency_offset "audio_backend_latency_offset"
+               append_num "$cfg" "$conf_file" stdout_buffer_length "audio_backend_buffer_desired_length"
+               echo -e "};\n" >> $conf_file
+
+               # AO audio back end
+               echo -e "ao =" >> $conf_file
+               echo -e "{" >> $conf_file
+               append_num "$cfg" "$conf_file" ao_latency_offset "audio_backend_latency_offset"
+               append_num "$cfg" "$conf_file" ao_buffer_length "audio_backend_buffer_desired_length"
+               echo -e "};\n" >> $conf_file
+       fi
+
+       procd_open_instance
+
+       procd_set_param command /usr/bin/shairport-sync
+       procd_append_param command -c $conf_file
+
+       config_get_bool aux "$cfg" 'respawn' '0'
+       [ "$aux" = 1 ] && procd_set_param respawn
+
+       procd_close_instance
+}
+
+service_triggers() {
+       procd_add_reload_trigger "shairport-sync"
+}
+
+start_service() {
+       config_load shairport-sync
+       config_foreach start_instance shairport-sync
+}
diff --git a/sound/shairport-sync/patches/100-replace_polarssl_with_mbedtls.patch b/sound/shairport-sync/patches/100-replace_polarssl_with_mbedtls.patch
new file mode 100644 (file)
index 0000000..984eb4c
--- /dev/null
@@ -0,0 +1,395 @@
+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
new file mode 100644 (file)
index 0000000..aeb63f7
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# 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
new file mode 100644 (file)
index 0000000..9b2165a
--- /dev/null
@@ -0,0 +1,36 @@
+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
new file mode 100644 (file)
index 0000000..341ff6f
--- /dev/null
@@ -0,0 +1,104 @@
+#!/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
new file mode 100644 (file)
index 0000000..7f0407e
--- /dev/null
@@ -0,0 +1,12 @@
+--- 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
diff --git a/sound/shine/Makefile b/sound/shine/Makefile
new file mode 100644 (file)
index 0000000..7b1dda0
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# 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:=shine
+PKG_VERSION:=3.1.0
+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_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/shine
+  SECTION:=sound
+  CATEGORY:=Sound
+  TITLE:=Super fast fixed-point MP3 encoder
+  URL:=https://github.com/toots/shine
+endef
+
+define Package/shine/description
+ savonet/shine is a blazing fast mp3 encoding library implemented in fixed-point
+ arithmetic. The library can thus be used to perform super fast mp3 encoding on
+ architectures without a FPU, such as armel, etc.. It is also, however, also
+ super fast on architectures with a FPU!
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/shine \
+               $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libshine.{a,so*} \
+               $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/shine.pc \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/shine/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/shineenc $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libshine.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,shine))
diff --git a/sound/shine/patches/001-fix_mips64_bswap.patch b/sound/shine/patches/001-fix_mips64_bswap.patch
new file mode 100644 (file)
index 0000000..8c42297
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/bin/wave.c
++++ b/src/bin/wave.c
+@@ -168,7 +168,7 @@ unsigned char wave_open(const char *fnam
+ }
+ #ifdef SHINE_BIG_ENDIAN
+-#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
++#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
+ #define bswap_16(x) __builtin_bswap16(x)
+ #else
+ #define bswap_16(x) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
diff --git a/sound/shine/patches/002-fix-name-collision-with-ffmpeg.patch b/sound/shine/patches/002-fix-name-collision-with-ffmpeg.patch
new file mode 100644 (file)
index 0000000..83ddb5e
--- /dev/null
@@ -0,0 +1,64 @@
+From 3695118267be9b7a9412c86c7c5424ab47efe7ec Mon Sep 17 00:00:00 2001
+From: Romain Beauxis <toots@rastageeks.org>
+Date: Thu, 7 Apr 2016 13:20:46 -0500
+Subject: [PATCH] Rename slen{1,2}_table to avoid name collision with ffmpeg.
+
+---
+ src/lib/l3bitstream.c | 4 ++--
+ src/lib/l3loop.c      | 4 ++--
+ src/lib/tables.c      | 4 ++--
+ src/lib/tables.h      | 4 ++--
+ 4 files changed, 8 insertions(+), 8 deletions(-)
+
+--- a/src/lib/l3bitstream.c
++++ b/src/lib/l3bitstream.c
+@@ -127,8 +127,8 @@ static void encodeMainData(shine_global_
+         {
+           BF_PartHolder **pph = &config->l3stream.scaleFactorsPH[gr][ch];
+           gr_info *gi = &(si.gr[gr].ch[ch].tt);
+-          unsigned slen1 = slen1_tab[ gi->scalefac_compress ];
+-          unsigned slen2 = slen2_tab[ gi->scalefac_compress ];
++          unsigned slen1 = shine_slen1_tab[ gi->scalefac_compress ];
++          unsigned slen2 = shine_slen2_tab[ gi->scalefac_compress ];
+           int *ix = &config->l3_enc[ch][gr][0];
+           if ( (gr == 0) || (si.scfsi[ch][0] == 0) )
+--- a/src/lib/l3loop.c
++++ b/src/lib/l3loop.c
+@@ -287,8 +287,8 @@ int part2_length(int gr, int ch, shine_g
+   bits = 0;
+   {
+-    slen1 = slen1_tab[ gi->scalefac_compress ];
+-    slen2 = slen2_tab[ gi->scalefac_compress ];
++    slen1 = shine_slen1_tab[ gi->scalefac_compress ];
++    slen2 = shine_slen2_tab[ gi->scalefac_compress ];
+     if ( !gr || !(config->side_info.scfsi[ch][0]) )
+       bits += (6 * slen1);
+--- a/src/lib/tables.c
++++ b/src/lib/tables.c
+@@ -7,8 +7,8 @@
\r
+ #include "tables.h"\r
\r
+-const int slen1_tab[16] = { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 };\r
+-const int slen2_tab[16] = { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 };\r
++const int shine_slen1_tab[16] = { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 };\r
++const int shine_slen2_tab[16] = { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 };\r
\r
+ /* Valid samplerates and bitrates. */\r
+ const int samplerates[9] = {\r
+--- a/src/lib/tables.h
++++ b/src/lib/tables.h
+@@ -3,8 +3,8 @@
\r
+ #include "types.h"\r
\r
+-extern const int slen1_tab[16];\r
+-extern const int slen2_tab[16];\r
++extern const int shine_slen1_tab[16];\r
++extern const int shine_slen2_tab[16];\r
\r
+ extern const int samplerates[9];\r
+ extern const int bitrates[16][4];\r
diff --git a/sound/sox/Makefile b/sound/sox/Makefile
new file mode 100644 (file)
index 0000000..11402f8
--- /dev/null
@@ -0,0 +1,88 @@
+#
+# 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.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=sox
+PKG_VERSION:=14.4.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/sox
+PKG_MD5SUM:=81a6956d4330e75b5827316e44ae381e6f1e8928003c6aa45896da9041ea149c
+
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+PKG_LICENSE:=LGPL-2.1 GPL-2.0
+PKG_LICENSE_FILES:=COPYING LICENSE.LGPL LICENSE.GPL
+
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_LDFLAGS+= \
+       -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
+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
+  TITLE:=Sox is a general purpose sound converter/player/recorder
+  URL:=http://sox.sourceforge.net/
+endef
+
+define Package/sox/description
+       SoX is a command line utility that can convert various formats
+       of computer audio files in to other formats. It can also apply
+       various effects to these sound files during the conversion.
+       As an added bonus, SoX can play and record audio files on
+       several unix-style platforms.
+endef
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               --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
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include \
+               $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libsox.{a,so*,la} \
+               $(1)/usr/lib/
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/sox/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/{play,rec,sox} $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsox.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,sox))
diff --git a/sound/sox/patches/001-cross_compile.patch b/sound/sox/patches/001-cross_compile.patch
new file mode 100644 (file)
index 0000000..badd531
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -145,7 +145,7 @@ EXTRA_DIST = monkey.wav optional-fmts.am
+            CMakeLists.txt soxconfig.h.cmake \
+            tests.sh testall.sh tests.bat testall.bat test-comments
+-all: sox$(EXEEXT) play$(EXEEXT) rec$(EXEEXT) soxi$(EXEEXT) sox_sample_test$(EXEEXT) example0$(EXEEXT) example1$(EXEEXT) example2$(EXEEXT) example3$(EXEEXT) example4$(EXEEXT) example5$(EXEEXT) example6$(EXEEXT)
++all: sox$(EXEEXT) play$(EXEEXT) rec$(EXEEXT)
+ play$(EXEEXT) rec$(EXEEXT) soxi$(EXEEXT): sox$(EXEEXT)
+       if test "$(PLAYRECLINKS)" = "yes"; then \
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -3020,7 +3020,7 @@ uninstall-am: uninstall-binPROGRAMS unin
+       uninstall-pkglibLTLIBRARIES
+-all: sox$(EXEEXT) play$(EXEEXT) rec$(EXEEXT) soxi$(EXEEXT) sox_sample_test$(EXEEXT) example0$(EXEEXT) example1$(EXEEXT) example2$(EXEEXT) example3$(EXEEXT) example4$(EXEEXT) example5$(EXEEXT) example6$(EXEEXT)
++all: sox$(EXEEXT) play$(EXEEXT) rec$(EXEEXT)
+ play$(EXEEXT) rec$(EXEEXT) soxi$(EXEEXT): sox$(EXEEXT)
+       if test "$(PLAYRECLINKS)" = "yes"; then \
diff --git a/sound/sox/patches/010-fix_uclibc_build_issue.patch b/sound/sox/patches/010-fix_uclibc_build_issue.patch
new file mode 100644 (file)
index 0000000..6a06301
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/src/formats.c
++++ b/src/formats.c
+@@ -413,7 +413,7 @@ static void UNUSED rewind_pipe(FILE * fp
+ #if defined _FSTDIO || defined _NEWLIB_VERSION || defined __APPLE__
+   fp->_p -= PIPE_AUTO_DETECT_SIZE;
+   fp->_r += PIPE_AUTO_DETECT_SIZE;
+-#elif defined __GLIBC__
++#elif defined __GLIBC__ && ! defined __UCLIBC__
+   fp->_IO_read_ptr = fp->_IO_read_base;
+ #elif defined _MSC_VER || defined _WIN32 || defined _WIN64 || \
+       defined _ISO_STDIO_ISO_H || defined __sgi
+@@ -422,7 +422,6 @@ static void UNUSED rewind_pipe(FILE * fp
+   /* To fix this #error, either simply remove the #error line and live without
+    * file-type detection with pipes, or add support for your compiler in the
+    * lines above.  Test with cat monkey.wav | ./sox --info - */
+-  #error FIX NEEDED HERE
+   #define NO_REWIND_PIPE
+   (void)fp;
+ #endif
diff --git a/sound/squeezelite/Makefile b/sound/squeezelite/Makefile
new file mode 100644 (file)
index 0000000..6c1b489
--- /dev/null
@@ -0,0 +1,146 @@
+#
+# 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:=squeezelite
+PKG_VERSION:=1.8.4-743
+PKG_RELEASE=1
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=LICENSE.txt
+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_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
+    SECTION:=sound
+    CATEGORY:=Sound
+    TITLE:=Headless squeezebox emulator
+    PROVIDES:=squeezelite
+    URL:=https://github.com/ralph-irving/squeezelite
+    DEPENDS:= +alsa-lib +SQUEEZELITE_RESAMPLE:libsoxr
+    MENU:=1
+endef
+
+define Package/squeezelite-full
+    $(call Package/squeezelite/default)
+    TITLE+= (full)
+    DEPENDS+= +libflac +libvorbis +libmad +libfaad2 \
+              +SQUEEZELITE_WMA:libffmpeg-audio-dec
+    VARIANT:=full
+endef
+
+define Package/squeezelite-mini
+    $(call Package/squeezelite/default)
+    TITLE+= (minimal)
+    VARIANT:=mini
+endef
+
+define Package/squeezelite/config/default
+
+       config SQUEEZELITE_WMA
+           bool "WMA/ALAC decode support"
+           help
+               Include WMA and ALAC decoding using ffmpeg
+           default n
+
+       config SQUEEZELITE_RESAMPLE
+           bool "Resample support"
+           help
+               Include support for resampling using libsoxr
+           default n
+
+       config SQUEEZELITE_DSD
+           bool "DSD playback over PCM (DoP)"
+           help
+               Include support for DSD over PCM for compatible DAC"
+           default n
+endef
+
+define Package/squeezelite-full/config
+    if PACKAGE_squeezelite-full
+       $(call Package/squeezelite/config/default)
+    endif
+endef
+
+define Package/squeezelite-mini/config
+    if PACKAGE_squeezelite-mini
+       $(call Package/squeezelite/config/default)
+    endif
+endef
+
+define Package/squeezelite/description/default
+    Squeezelite is a small headless squeezebox emulator for linux using alsa audio output 
+    It is aimed at supporting high quality audio at multiple sample rates including 
+    44.1/48/88.2/96/176.4/192k/352.8/384kHz 
+    Supported codecs: mp3, flac, ogg, aac, (wma and alac via ffmpeg) 
+    Native support for PCM builtin
+    Optional support of DSD playback via PCM for DoP capable DAC
+    Optional resampling to match sound device
+endef
+
+define Package/squeezelite/description
+    $(call Package/squeezelite/description/default)
+    .
+    This package has all the audio codecs compiled in.
+endef
+
+define Package/squeezelite-mini/description
+    $(call Package/squeezelite/description/default)
+    .
+    This package will dynamically load installed codecs.
+endef
+
+#ifeq ($(CONFIG_SQUEEZELITE_WMA),y)
+#    PKG_BUILD_DEPENDS+= libffmpeg-audio-dec
+#endif
+
+TARGET_CFLAGS+= -Wall -fPIC -O2 -DSELFPIPE
+
+ifeq ($(CONFIG_SQUEEZELITE_WMA),y)
+    TARGET_CFLAGS+= -DFFMPEG
+endif
+
+ifeq ($(CONFIG_SQUEEZELITE_DSD),y)
+    TARGET_CFLAGS+= -DDSD
+endif
+
+ifeq ($(CONFIG_SQUEEZELITE_RESAMPLE),y)
+    TARGET_CFLAGS+= -DRESAMPLE
+endif
+
+TARGET_LDFLAGS+= -lasound -lpthread -lm -lrt
+
+ifeq ($(BUILD_VARIANT),full)
+    TARGET_CFLAGS+= -DLINKALL
+endif
+
+define Package/squeezelite/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/squeezelite $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/squeezelite.init $(1)/etc/init.d/squeezelite
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/squeezelite.conf $(1)/etc/config/squeezelite
+endef
+
+Package/squeezelite-mini/install=$(Package/squeezelite/install)
+Package/squeezelite-full/install=$(Package/squeezelite/install)
+
+$(eval $(call BuildPackage,squeezelite-mini))
+$(eval $(call BuildPackage,squeezelite-full))
diff --git a/sound/squeezelite/files/squeezelite.conf b/sound/squeezelite/files/squeezelite.conf
new file mode 100644 (file)
index 0000000..6bfcaab
--- /dev/null
@@ -0,0 +1,13 @@
+
+config options 'options'
+       option name 'SqueezeWrt'
+       option model_name 'SqueezeLite'
+       option close_delay '0'
+       option priority '0'
+       option max_sr '0'
+       option device 'hw:0,0'
+       option decoder_auto_conf '1'
+       option dsd_over_pcm '0'
+       option ircontrol '0'
+       option interface ''
+       option enabled '1'
diff --git a/sound/squeezelite/files/squeezelite.init b/sound/squeezelite/files/squeezelite.init
new file mode 100644 (file)
index 0000000..d574625
--- /dev/null
@@ -0,0 +1,142 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+START=99
+STOP=1
+
+USE_PROCD=1
+PROG=/usr/bin/squeezelite
+
+#
+# Auto config checks for existing codec installations if not specified in config
+# Explicit disable (override) by setting appropriate "decode_xxx" in config
+#
+checkcodec() {
+       config_get_bool auto_conf options "decoder_auto_conf" 1
+       config_get_bool codec options "$1" $auto_conf
+       
+       if [ $codec -ne 0 ] ; then 
+               if [ $auto_conf -eq 0 ] ; then
+                       #force use requested
+                       echo "$4"
+               else
+                       if [ -e "/usr/lib/${2}" ] ; then
+                               # Use codec (it exists)
+                               echo "$4"
+                       else
+                               #exclude non-existant
+                               if [ -z "$4" ] ; then
+                                       echo "-e $3"
+                               else
+                                       echo "$4,$3"
+                               fi
+                       fi
+               fi
+       else
+               # explicitly excluded
+               if [ -z "$4" ] ; then
+                       echo "-e $3"
+               else
+                       echo "$4,$3"
+               fi
+       fi
+}
+
+make_cmdline() {
+       cmdline=""
+
+       config_get name options name "SqueezeWrt"
+       cmdline="$cmdline -n $name"
+
+       config_get model_name options model_name "SqueezeLite"
+       cmdline="$cmdline -M $model_name"
+
+       config_get interface options interface ""
+       [ -n "$interface" ] && cmdline="$cmdline -I $interface"
+
+       config_get device options device ""
+       [ -n "$device" ] && cmdline="$cmdline -o $device"
+
+       config_get alsa_buffer options alsa_buffer 200
+       [ $alsa_buffer -eq 0 ] && alsa_buffer="200"
+    
+       config_get alsa_period options alsa_period 4
+       [ $alsa_period -eq 0 ] && alsa_period="4"
+    
+       config_get alsa_format options alsa_format 16
+       [ $alsa_format = "0" ] && alsa_format="16"
+
+       config_get alsa_mmap options alsa_mmap 0
+       cmdline="$cmdline -a $alsa_buffer:$alsa_period:$alsa_format:$alsa_mmap"
+
+       config_get stream_bufsiz options stream_bufsiz 2048
+       config_get out_bufsiz options out_bufsiz 3763
+       cmdline="$cmdline -b $stream_bufsiz:$out_bufsiz"
+
+       config_get max_sr options max_sr 0
+       if [ $max_sr -ne 0 ] ; then
+               max_sr="-r $max_sr"
+
+               config_get sr_delay options sr_delay 0
+               [ $sr_delay -ne 0 ] &&  max_sr="$max_sr:$sr_delay"
+               cmdline="$cmdline $max_sr"
+       fi
+
+
+       config_get close_delay options close_delay 0
+       [ $close_delay -ne 0 ] && cmdline="$cmdline -C $close_delay"
+
+       config_get server_addr options server_addr ""
+       if [ -n "$server_addr" ] ; then
+               config_get server_port options server_port 3483
+               cmdline="$cmdline -s $server_addr:$server_port"
+       fi
+
+       config_get priority options priority 0
+       [ $priority -ne 0 ] && cmdline="$cmdline -p $priority"
+
+       #
+       # ***NOTE: codec lib names are in squeezelite.h (set decode_auto_conf to 0 to ignore)
+       #
+       local excl_codecs=""
+       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_aac "libfaad.so.2" aac "$excl_codecs"`
+
+       [ -e "/usr/lib/$vorbis_lib" ] || vorbis_lib="libvorbisfile.so.3"
+
+       excl_codecs=`checkcodec decode_ogg "$vorbis_lib" ogg "$excl_codecs"`
+       excl_codecs=`checkcodec decode_wma_alac "libavcodec.so.56" wma,alac "$excl_codecs"`
+       cmdline="$cmdline $excl_codecs"
+
+       config_get dop options dsd_over_pcm 0
+       [ $dop -eq 1 ] && cmdline="$cmdline -D"
+}
+
+start_service() {
+       config_load squeezelite
+
+       config_get_bool enabled options 'enabled' 0
+       [ $enabled -eq 0 ] && return
+
+       # Build command params
+       make_cmdline
+
+       procd_open_instance
+       logger -t 'squeezelite' "$cmdline"
+       procd_set_param command "$PROG" $cmdline
+       procd_close_instance
+}
+
+# Wait for service to exit and release sockets
+reload_service() {
+       stop
+       sleep 2
+       start
+}
+
+restart() {
+       reload_service
+}
diff --git a/sound/squeezelite/patches/005-respect_LDFLAGS.patch b/sound/squeezelite/patches/005-respect_LDFLAGS.patch
new file mode 100644 (file)
index 0000000..d8df7ca
--- /dev/null
@@ -0,0 +1,56 @@
+From 1c53ed7db5b49ebf347efe65dbf9b740f9d54557 Mon Sep 17 00:00:00 2001
+From: Carlo Landmeter <clandmeter@gmail.com>
+Date: Tue, 31 Mar 2015 09:52:53 +0000
+Subject: [PATCH] respect LDFLAGS
+
+---
+ Makefile | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,7 @@
+ # Cross compile support - create a Makefile which defines these three variables and then includes this Makefile...
+-CFLAGS  ?= -Wall -fPIC -O2 $(OPTS)
+-LDFLAGS ?= -lasound -lpthread -lm -lrt
++CFLAGS  ?= -Wall -O2
++CFLAGS  += -fPIC $(OPTS)
++LIBS ?= -lasound -lpthread -lm -lrt
+ EXECUTABLE ?= squeezelite
+ # passing one or more of these in $(OPTS) enables optional feature inclusion
+@@ -52,20 +53,20 @@ endif
+ # add optional link options
+ ifneq (,$(findstring $(OPT_LINKALL), $(CFLAGS)))
+-      LDFLAGS += $(LINKALL)
++      LIBS += $(LINKALL)
+ ifneq (,$(findstring $(OPT_FF), $(CFLAGS)))
+-      LDFLAGS += $(LINKALL_FF)
++      LIBS += $(LINKALL_FF)
+ endif
+ ifneq (,$(findstring $(OPT_RESAMPLE), $(CFLAGS)))
+-      LDFLAGS += $(LINKALL_RESAMPLE)
++      LIBS += $(LINKALL_RESAMPLE)
+ endif
+ ifneq (,$(findstring $(OPT_IR), $(CFLAGS)))
+-      LDFLAGS += $(LINKALL_IR)
++      LIBS += $(LINKALL_IR)
+ endif
+ else
+ # if not LINKALL and linux add LINK_LINUX
+ ifeq ($(UNAME), Linux)
+-      LDFLAGS += $(LINK_LINUX)
++      LIBS += $(LINK_LINUX)
+ endif
+ endif
+@@ -74,7 +75,7 @@ OBJECTS = $(SOURCES:.c=.o)
+ all: $(EXECUTABLE)
+ $(EXECUTABLE): $(OBJECTS)
+-      $(CC) $(OBJECTS) $(LDFLAGS) -o $@
++      $(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $@
+ $(OBJECTS): $(DEPS)
diff --git a/sound/squeezelite/patches/010-select_broadcast_interface.patch b/sound/squeezelite/patches/010-select_broadcast_interface.patch
new file mode 100644 (file)
index 0000000..465f61a
--- /dev/null
@@ -0,0 +1,356 @@
+--- a/main.c
++++ b/main.c
+@@ -78,6 +78,7 @@ static void usage(const char *argv0) {
+ #if IR
+                  "  -i [<filename>]\tEnable lirc remote control support (lirc config file ~/.lircrc used if filename not specified)\n"
+ #endif
++                 "  -I <interface>\t\tNetwork interface used to send discovery\n"
+                  "  -m <mac addr>\t\tSet mac address, format: ab:cd:ef:12:34:56\n"
+                  "  -M <modelname>\tSet the squeezelite player model name sent to the server (default: " MODEL_NAME_STRING ")\n"
+                  "  -n <name>\t\tSet the player name\n"
+@@ -233,6 +234,8 @@ int main(int argc, char **argv) {
+       extern bool pcm_check_header;
+       char *logfile = NULL;
+       u8_t mac[6];
++      char *iface = NULL;
++      in_addr_t bcast_addr = 0;
+       unsigned stream_buf_size = STREAMBUF_SIZE;
+       unsigned output_buf_size = 0; // set later
+       unsigned rates[MAX_SUPPORTED_SAMPLERATES] = { 0 };
+@@ -271,6 +274,7 @@ int main(int argc, char **argv) {
+       int maxSampleRate = 0;
++      memset(mac, 0, sizeof(mac));
+       char *optarg = NULL;
+       int optind = 1;
+       int i;
+@@ -278,8 +282,6 @@ int main(int argc, char **argv) {
+ #define MAXCMDLINE 512
+       char cmdline[MAXCMDLINE] = "";
+-      get_mac(mac);
+-
+       for (i = 0; i < argc && (strlen(argv[i]) + strlen(cmdline) + 2 < MAXCMDLINE); i++) {
+               strcat(cmdline, argv[i]);
+               strcat(cmdline, " ");
+@@ -287,7 +289,7 @@ int main(int argc, char **argv) {
+       while (optind < argc && strlen(argv[optind]) >= 2 && argv[optind][0] == '-') {
+               char *opt = argv[optind] + 1;
+-              if (strstr("oabcCdefmMnNpPrs"
++              if (strstr("oabcCdefImMnNpPrs"
+ #if ALSA
+                                  "UV"
+ #endif
+@@ -382,6 +384,9 @@ int main(int argc, char **argv) {
+               case 'f':
+                       logfile = optarg;
+                       break;
++              case 'I':
++                      iface = optarg;
++                      break;
+               case 'm':
+                       {
+                               int byte = 0;
+@@ -667,6 +672,11 @@ int main(int argc, char **argv) {
+       winsock_init();
+ #endif
++      if (!(bcast_addr = get_iface_info(log_slimproto, iface, mac))) {
++              fprintf(stderr, "Error binding to network or none given\n");
++              exit(1);
++      }
++
+       stream_init(log_stream, stream_buf_size);
+       if (!strcmp(output_device, "-")) {
+@@ -710,7 +720,7 @@ int main(int argc, char **argv) {
+               exit(1);
+       }
+-      slimproto(log_slimproto, server, mac, name, namefile, modelname, maxSampleRate);
++      slimproto(log_slimproto, server, bcast_addr, mac, name, namefile, modelname, maxSampleRate);
+       decode_close();
+       stream_close();
+--- a/squeezelite.h
++++ b/squeezelite.h
+@@ -403,7 +403,7 @@ typedef enum { EVENT_TIMEOUT = 0, EVENT_
+ char *next_param(char *src, char c);
+ u32_t gettime_ms(void);
+-void get_mac(u8_t *mac);
++in_addr_t get_iface_info(log_level level, char *iface, u8_t *mac);
+ void set_nonblock(sockfd s);
+ int connect_timeout(sockfd sock, const struct sockaddr *addr, socklen_t addrlen, int timeout);
+ void server_addr(char *server, in_addr_t *ip_ptr, unsigned *port_ptr);
+@@ -459,7 +459,7 @@ void buf_init(struct buffer *buf, size_t
+ void buf_destroy(struct buffer *buf);
+ // slimproto.c
+-void slimproto(log_level level, char *server, u8_t mac[6], const char *name, const char *namefile, const char *modelname, int maxSampleRate);
++void slimproto(log_level level, char *server, in_addr_t bcast_addr, u8_t mac[6], const char *name, const char *namefile, const char *modelname, int maxSampleRate);
+ void slimproto_stop(void);
+ void wake_controller(void);
+--- a/slimproto.c
++++ b/slimproto.c
+@@ -119,7 +119,7 @@ void send_packet(u8_t *packet, size_t le
+       }
+ }
+-static void sendHELO(bool reconnect, const char *fixed_cap, const char *var_cap, u8_t mac[6]) {
++static void sendHELO(bool reconnect, const char *fixed_cap, const char *var_cap, u8_t *mac) {
+       const char *base_cap = "Model=squeezelite,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Firmware=" VERSION;
+       struct HELO_packet pkt;
+@@ -782,7 +782,7 @@ void wake_controller(void) {
+       wake_signal(wake_e);
+ }
+-in_addr_t discover_server(void) {
++in_addr_t discover_server(in_addr_t bcast_addr) {
+       struct sockaddr_in d;
+       struct sockaddr_in s;
+       char *buf;
+@@ -798,7 +798,7 @@ in_addr_t discover_server(void) {
+       memset(&d, 0, sizeof(d));
+       d.sin_family = AF_INET;
+       d.sin_port = htons(PORT);
+-      d.sin_addr.s_addr = htonl(INADDR_BROADCAST);
++      d.sin_addr.s_addr = bcast_addr;
+       pollinfo.fd = disc_sock;
+       pollinfo.events = POLLIN;
+@@ -829,7 +829,7 @@ in_addr_t discover_server(void) {
+ #define FIXED_CAP_LEN 256
+ #define VAR_CAP_LEN   128
+-void slimproto(log_level level, char *server, u8_t mac[6], const char *name, const char *namefile, const char *modelname, int maxSampleRate) {
++void slimproto(log_level level, char *server, in_addr_t bcast_addr, u8_t mac[6], const char *name, const char *namefile, const char *modelname, int maxSampleRate) {
+       struct sockaddr_in serv_addr;
+       static char fixed_cap[FIXED_CAP_LEN], var_cap[VAR_CAP_LEN] = "";
+       bool reconnect = false;
+@@ -849,7 +849,7 @@ void slimproto(log_level level, char *se
+       }
+       if (!slimproto_ip) {
+-              slimproto_ip = discover_server();
++              slimproto_ip = discover_server(bcast_addr);
+       }
+       if (!slimproto_port) {
+@@ -924,7 +924,7 @@ void slimproto(log_level level, char *se
+                       // rediscover server if it was not set at startup
+                       if (!server && ++failed_connect > 5) {
+-                              slimproto_ip = serv_addr.sin_addr.s_addr = discover_server();
++                              slimproto_ip = serv_addr.sin_addr.s_addr = discover_server(bcast_addr);
+                       }
+               } else {
+--- a/utils.c
++++ b/utils.c
+@@ -22,11 +22,11 @@
+ #include "squeezelite.h"
+ #if LINUX || OSX || FREEBSD
+-#include <sys/ioctl.h>
++#include <sys/types.h>
+ #include <net/if.h>
+-#include <netdb.h>
+-#if FREEBSD
+ #include <ifaddrs.h>
++#include <netdb.h>
++#if FREEBSD || OSX
+ #include <net/if_dl.h>
+ #include <net/if_types.h>
+ #endif
+@@ -44,15 +44,11 @@
+ #if WIN
+ #include <iphlpapi.h>
+ #endif
+-#if OSX
+-#include <net/if_dl.h>
+-#include <net/if_types.h>
+-#include <ifaddrs.h>
+-#include <netdb.h>
+-#endif
+ #include <fcntl.h>
++static log_level loglevel;
++
+ // logging functions
+ const char *logtime(void) {
+       static char buf[100];
+@@ -114,58 +110,101 @@ u32_t gettime_ms(void) {
+ #endif
+ }
+-// mac address
+-#if LINUX && !defined(SUN)
+-// search first 4 interfaces returned by IFCONF
+-void get_mac(u8_t mac[]) {
+-      char *utmac;
+-      struct ifconf ifc;
+-      struct ifreq *ifr, *ifend;
+-      struct ifreq ifreq;
+-      struct ifreq ifs[4];
++// Get broadcast address for interface (given or first available)
++// Return MAC address if none given
++#if LINUX || OSX || FREEBSD
+-      utmac = getenv("UTMAC");
+-      if (utmac)
+-      {
+-              if ( strlen(utmac) == 17 )
+-              {
+-                      if (sscanf(utmac,"%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx",
+-                              &mac[0],&mac[1],&mac[2],&mac[3],&mac[4],&mac[5]) == 6)
+-                      {
+-                              return;
+-                      }
+-              }
++in_addr_t get_iface_info(log_level level, char *iface, u8_t *mac) {
++      struct ifaddrs *addrs, *ifa;
++      struct sockaddr *sdl;
++      char ifname[16];
++      unsigned char *ptr;
++      in_addr_t bcast_addr = 0;
++      int have_mac = 0, have_ifname = 0;
++
++      loglevel = level;
++
++      // Check for non-zero MAC
++      if ((mac[0] | mac[1] | mac[2]) != 0)
++              have_mac = 1;
++
++        // Copy interface name, if it was provided.
++        if (iface != NULL)
++        {
++                if( strlen(iface) > sizeof(ifname) )
++                        return -1;
++                strncpy(ifname, iface, sizeof(ifname));
++                have_ifname = 1;
+       }
+-      mac[0] = mac[1] = mac[2] = mac[3] = mac[4] = mac[5] = 0;
++      if (getifaddrs(&addrs) == 0) {
++              //iterate to find corresponding ethernet address
++              for (ifa = addrs; ifa; ifa = ifa->ifa_next) {
++                      // Skip LOOPBACK interfaces, DOWN interfaces and interfaces that
++                      // don't support BROADCAST.
++                      if ((ifa->ifa_flags & IFF_LOOPBACK)
++                                || !(ifa->ifa_flags & IFF_UP)
++                                || !(ifa->ifa_flags & IFF_BROADCAST))
++                      {
++                              continue;
++                      }
+-      int s = socket(AF_INET, SOCK_DGRAM, 0);
++                      if (!have_ifname)
++                      {
++                              // We have found a valid interface name. Keep it.
++                              strncpy(ifname, ifa->ifa_name, sizeof(ifname));
++                              have_ifname = 1;
++                      } else {
++                              if (strncmp(ifname, ifa->ifa_name, sizeof(ifname)) != 0)
++                              {
++                                      // This is not the interface we're looking for.
++                                      continue;
++                              }
++                      }
+-      ifc.ifc_len = sizeof(ifs);
+-      ifc.ifc_req = ifs;
+-      if (ioctl(s, SIOCGIFCONF, &ifc) == 0) {
+-              ifend = ifs + (ifc.ifc_len / sizeof(struct ifreq));
++                      // Check address family.
++                      if ((ifa->ifa_addr->sa_family == AF_INET) &&
++                          (((struct sockaddr_in *)ifa->ifa_broadaddr)->sin_addr.s_addr != 0))
++                      {
++                              // Get broadcast address and MAC address
++                              bcast_addr = ((struct sockaddr_in *)ifa->ifa_broadaddr)->sin_addr.s_addr;
++                              break;
++                      }
++                      else
++                      {
++                              // Address is not IPv4
++                              if (iface == NULL)
++                                      have_ifname = 0;
++                      }
++
++              }
+-              for (ifr = ifc.ifc_req; ifr < ifend; ifr++) {
+-                      if (ifr->ifr_addr.sa_family == AF_INET) {
+-
+-                              strncpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name));
+-                              if (ioctl (s, SIOCGIFHWADDR, &ifreq) == 0) {
+-                                      memcpy(mac, ifreq.ifr_hwaddr.sa_data, 6);
+-                                      if (mac[0]+mac[1]+mac[2] != 0) {
+-                                              break;
+-                                      }
++              // Find MAC address matching interface
++              if (!have_mac && (bcast_addr != 0)) {
++                      for (ifa = addrs; ifa; ifa = ifa->ifa_next) {
++                              if ((ifa->ifa_addr->sa_family == PF_PACKET) &&
++                                  (strncmp(ifname, ifa->ifa_name, sizeof(ifname)) == 0)) {
++                                      sdl = (struct sockaddr *)(ifa->ifa_addr);
++                                      ptr = (unsigned char *)sdl->sa_data;
++                                      memcpy(mac, ptr + 10, 6);
++                                      have_mac = 1;
+                               }
+                       }
+               }
++
++              freeifaddrs(addrs);
+       }
+-      close(s);
++      LOG_INFO("Interface: %s, broadcast: %08X, macaddr = %02x:%02x:%02x:%02x:%02x:%02x",
++               ifname, bcast_addr, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
++
++      return bcast_addr;
+ }
+ #endif
++
+ #if SUN
+ void get_mac(u8_t mac[]) {
+       struct  arpreq          parpreq;
+@@ -232,30 +271,6 @@ void get_mac(u8_t mac[]) {
+ }
+ #endif
+-#if OSX || FREEBSD
+-void get_mac(u8_t mac[]) {
+-      struct ifaddrs *addrs, *ptr;
+-      const struct sockaddr_dl *dlAddr;
+-      const unsigned char *base;
+-      
+-      mac[0] = mac[1] = mac[2] = mac[3] = mac[4] = mac[5] = 0;
+-      
+-      if (getifaddrs(&addrs) == 0) {
+-              ptr = addrs;
+-              while (ptr) {
+-                      if (ptr->ifa_addr->sa_family == AF_LINK && ((const struct sockaddr_dl *) ptr->ifa_addr)->sdl_type == IFT_ETHER) {
+-                              dlAddr = (const struct sockaddr_dl *)ptr->ifa_addr;
+-                              base = (const unsigned char*) &dlAddr->sdl_data[dlAddr->sdl_nlen];
+-                              memcpy(mac, base, min(dlAddr->sdl_alen, 6));
+-                              break;
+-                      }
+-                      ptr = ptr->ifa_next;
+-              }
+-              freeifaddrs(addrs);
+-      }
+-}
+-#endif
+-
+ #if WIN
+ #pragma comment(lib, "IPHLPAPI.lib")
+ void get_mac(u8_t mac[]) {
diff --git a/sound/squeezelite/patches/020-no_mpg123.patch b/sound/squeezelite/patches/020-no_mpg123.patch
new file mode 100644 (file)
index 0000000..bc0547a
--- /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 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"
diff --git a/sound/squeezelite/patches/030-fix_musl_compatibilty.patch b/sound/squeezelite/patches/030-fix_musl_compatibilty.patch
new file mode 100644 (file)
index 0000000..24f00e0
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/output_alsa.c
++++ b/output_alsa.c
+@@ -911,8 +911,11 @@ void output_init_alsa(log_level level, c
+               LOG_INFO("memory locked");
+       }
++#ifdef M_TRIM_THRESHOLD
++      // mallopt is not defined in musl libc
+       mallopt(M_TRIM_THRESHOLD, -1);
+       mallopt(M_MMAP_MAX, 0);
++#endif
+       touch_memory(silencebuf, MAX_SILENCE_FRAMES * BYTES_PER_FRAME);
+       touch_memory(outputbuf->buf, outputbuf->size);
diff --git a/sound/squeezelite/patches/040-clear_dynlink_errors.patch b/sound/squeezelite/patches/040-clear_dynlink_errors.patch
new file mode 100644 (file)
index 0000000..b534a2b
--- /dev/null
@@ -0,0 +1,105 @@
+--- a/faad.c
++++ b/faad.c
+@@ -594,6 +594,8 @@ static bool load_faad() {
+               return false;
+       }
++      err = dlerror();        // Reset previous dynamic linking error string (if there was)
++
+       a->NeAACDecGetCurrentConfiguration = dlsym(handle, "NeAACDecGetCurrentConfiguration");
+       a->NeAACDecSetConfiguration = dlsym(handle, "NeAACDecSetConfiguration");
+       a->NeAACDecOpen = dlsym(handle, "NeAACDecOpen");
+--- a/ffmpeg.c
++++ b/ffmpeg.c
+@@ -620,6 +620,8 @@ static bool load_ff() {
+               return false;
+       }
++      err = dlerror();        // Reset previous dynamic linking error string (if there was)
++
+       sprintf(name, LIBAVFORMAT, LIBAVFORMAT_VERSION_MAJOR);
+       handle_format = dlopen(name, RTLD_NOW);
+       if (!handle_format) {
+--- a/flac.c
++++ b/flac.c
+@@ -241,6 +241,8 @@ static bool load_flac() {
+               return false;
+       }
++      err = dlerror();        // Reset previous dynamic linking error string (if there was)
++
+       f->FLAC__StreamDecoderErrorStatusString = dlsym(handle, "FLAC__StreamDecoderErrorStatusString");
+       f->FLAC__StreamDecoderStateString = dlsym(handle, "FLAC__StreamDecoderStateString");
+       f->FLAC__stream_decoder_new = dlsym(handle, "FLAC__stream_decoder_new");
+--- a/ir.c
++++ b/ir.c
+@@ -168,10 +168,10 @@ static void *ir_thread() {
+                       UNLOCK_I;
+                       wake_controller();
+               }
+-              
++
+               free(code);
+       }
+-      
++
+       return 0;
+ }
+@@ -185,6 +185,8 @@ static bool load_lirc() {
+               return false;
+       }
++      err = dlerror();        // Reset previous dynamic linking error string (if there was)
++
+       i->lirc_init = dlsym(handle, "lirc_init");
+       i->lirc_deinit = dlsym(handle, "lirc_deinit");
+       i->lirc_readconfig = dlsym(handle, "lirc_readconfig");
+--- a/mad.c
++++ b/mad.c
+@@ -365,7 +365,9 @@ static bool load_mad() {
+               LOG_INFO("dlerror: %s", dlerror());
+               return false;
+       }
+-      
++
++      err = dlerror();        // Reset previous dynamic linking error string (if there was)
++
+       m->mad_stream_init = dlsym(handle, "mad_stream_init");
+       m->mad_frame_init = dlsym(handle, "mad_frame_init");
+       m->mad_synth_init = dlsym(handle, "mad_synth_init");
+--- a/mpg.c
++++ b/mpg.c
+@@ -222,7 +222,9 @@ static bool load_mpg() {
+               LOG_INFO("dlerror: %s", dlerror());
+               return false;
+       }
+-      
++
++      err = dlerror();        // Reset previous dynamic linking error string (if there was)
++
+       m->mpg123_init = dlsym(handle, "mpg123_init");
+       m->mpg123_feature = dlsym(handle, "mpg123_feature");
+       m->mpg123_rates = dlsym(handle, "mpg123_rates");
+--- a/resample.c
++++ b/resample.c
+@@ -251,6 +251,8 @@ static bool load_soxr(void) {
+               return false;
+       }
++      err = dlerror();        // Reset previous dynamic linking error string (if there was)
++
+       r->soxr_io_spec = dlsym(handle, "soxr_io_spec");
+       r->soxr_quality_spec = dlsym(handle, "soxr_quality_spec");
+       r->soxr_create = dlsym(handle, "soxr_create");
+--- a/vorbis.c
++++ b/vorbis.c
+@@ -287,6 +287,8 @@ static bool load_vorbis() {
+               }
+       }
++      err = dlerror();        // Reset previous dynamic linking error string (if there was)
++
+       v->ov_read = tremor ? NULL : dlsym(handle, "ov_read");
+       v->ov_read_tremor = tremor ? dlsym(handle, "ov_read") : NULL;
+       v->ov_info = dlsym(handle, "ov_info");
diff --git a/sound/svox/Makefile b/sound/svox/Makefile
new file mode 100644 (file)
index 0000000..43c2b13
--- /dev/null
@@ -0,0 +1,61 @@
+#
+# 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:=svox
+PKG_VERSION:=1.0+git20130326
+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_MAINTAINER:=Alessandro Di Marco <dmr@ethzero.com>
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/svox
+  TITLE:=SVOX PicoTTS text-to-speech engine
+  SECTION:=sound
+  CATEGORY:=Sound
+  URL:=https://android.googlesource.com/platform/external/svox/
+  DEPENDS:=+libpopt
+endef
+
+define Package/svox/description
+  SVOX is an embedded speech technology company founded in 2000 and
+  headquartered in Zurich, Switzerland. SVOX was acquired by Nuance
+  Communications in 2011. Company's products included Automated Speech
+  Recognition (ASR), Text-to-Speech (TTS) and Speech Dialog systems,
+  with customers mostly being manufacturers and system integrators in
+  automotive and mobile device industries.
+  SVOX TTS technology is characterized by natural and clear sound as well
+  as unique polyglot capability - the same voice can speak multiple
+  languages like a native speaker.
+endef
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       mv $(PKG_BUILD_DIR)/pico/* $(PKG_BUILD_DIR)
+endef
+
+define Package/svox/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pico2wave $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libttspico.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/share/pico/lang
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pico/lang/* $(1)/usr/share/pico/lang/
+endef
+
+$(eval $(call BuildPackage,svox))
diff --git a/sound/svox/patches/0001-autoconf-building-of-library-using-libtool.patch b/sound/svox/patches/0001-autoconf-building-of-library-using-libtool.patch
new file mode 100644 (file)
index 0000000..73c76bb
--- /dev/null
@@ -0,0 +1,113 @@
+From 9fe1aa475b2667446b081623abc5c6f6083a76e6 Mon Sep 17 00:00:00 2001
+From: Mathieu Parent <math.parent@gmail.com>
+Date: Sat, 24 Oct 2009 17:03:37 +0200
+Subject: [PATCH 1/7] autoconf building of library (using libtool)
+
+---
+ pico/Makefile.am  |   36 ++++++++++++++++++++++++++++++++++++
+ pico/autogen.sh   |   36 ++++++++++++++++++++++++++++++++++++
+ pico/configure.in |   16 ++++++++++++++++
+ 3 files changed, 88 insertions(+), 0 deletions(-)
+ create mode 100644 pico/Makefile.am
+ create mode 100755 pico/autogen.sh
+ create mode 100644 pico/configure.in
+
+--- /dev/null
++++ b/pico/Makefile.am
+@@ -0,0 +1,36 @@
++## Makefile.am -- Process this file with automake to produce Makefile.in
++
++ACLOCAL_AMFLAGS = -I m4
++
++lib_LTLIBRARIES = libttspico.la
++libttspico_la_SOURCES = \
++      lib/picoacph.c \
++      lib/picoapi.c \
++      lib/picobase.c \
++      lib/picocep.c \
++      lib/picoctrl.c \
++      lib/picodata.c \
++      lib/picodbg.c \
++      lib/picoextapi.c \
++      lib/picofftsg.c \
++      lib/picokdbg.c \
++      lib/picokdt.c \
++      lib/picokfst.c \
++      lib/picoklex.c \
++      lib/picoknow.c \
++      lib/picokpdf.c \
++      lib/picokpr.c \
++      lib/picoktab.c \
++      lib/picoos.c \
++      lib/picopal.c \
++      lib/picopam.c \
++      lib/picopr.c \
++      lib/picorsrc.c \
++      lib/picosa.c \
++      lib/picosig.c \
++      lib/picosig2.c \
++      lib/picospho.c \
++      lib/picotok.c \
++      lib/picotrns.c \
++      lib/picowa.c
++
+--- /dev/null
++++ b/pico/autogen.sh
+@@ -0,0 +1,38 @@
++#!/bin/sh
++
++#created by aclocal
++rm -rf autom4te.cache
++rm -f aclocal.m4
++
++#created by libtoolize
++rm -rf m4
++mkdir m4
++rm -f ltmain.sh
++
++#created by autoconf
++rm -f configure
++
++#created by automake
++rm -f install-sh missing depcomp Makefile.in config.guess config.sub
++rm -f INSTALL COPYING compile
++
++#created by ./configure
++rm -rf .deps
++rm -f Makefile config.log config.status libtool
++
++if [ "$1" = "clean" ]; then
++    exit
++fi
++
++IPATHS="-I lib"
++
++libtoolize
++aclocal $IPATHS
++automake --add-missing
++autoconf $IPATHS
++
++rm -rf autom4te.cache
++
++echo "Now run ./configure and then make."
++exit 0
++
+--- /dev/null
++++ b/pico/configure.in
+@@ -0,0 +1,16 @@
++dnl Process this file with autoconf to produce a configure script.
++
++AC_PREREQ(2.59)
++
++AC_INIT([svox], [1.0], [math.parent@gmail.com])
++
++AM_INIT_AUTOMAKE([1.9 foreign])
++
++AC_PROG_CC
++LT_INIT
++AC_PROG_LIBTOOL
++
++AC_CONFIG_FILES([Makefile])
++AC_OUTPUT
++
++AC_CONFIG_MACRO_DIR([m4])
diff --git a/sound/svox/patches/0002-gitignore-for-autotools-files.patch b/sound/svox/patches/0002-gitignore-for-autotools-files.patch
new file mode 100644 (file)
index 0000000..df57df7
--- /dev/null
@@ -0,0 +1,51 @@
+From b56b0a4bdf3e11271caab744f532cb055c517b51 Mon Sep 17 00:00:00 2001
+From: Mathieu Parent <math.parent@gmail.com>
+Date: Sat, 24 Oct 2009 17:12:42 +0200
+Subject: [PATCH 2/7] gitignore for autotools files
+
+---
+ pico/.gitignore |   32 ++++++++++++++++++++++++++++++++
+ 1 files changed, 32 insertions(+), 0 deletions(-)
+ create mode 100644 pico/.gitignore
+
+diff --git a/pico/.gitignore b/pico/.gitignore
+new file mode 100644
+index 0000000..4235569
+--- /dev/null
++++ b/pico/.gitignore
+@@ -0,0 +1,32 @@
++#created by aclocal
++autom4te.cache
++aclocal.m4
++
++#created by libtoolize
++m4
++ltmain.sh
++
++#created by autoconf
++configure
++
++#created by automake
++install-sh
++missing
++depcomp
++Makefile.in
++config.guess
++config.sub
++
++#created by ./configure
++.deps
++Makefile
++config.log
++config.status
++libtool
++
++#created by make
++*.o
++*.lo
++.libs
++libttspico.la
++
+-- 
+1.7.1
+
diff --git a/sound/svox/patches/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch b/sound/svox/patches/0003-pico2wave-Convert-text-to-.wav-using-svox-text-to-sp.patch
new file mode 100644 (file)
index 0000000..c8a2e83
--- /dev/null
@@ -0,0 +1,399 @@
+From 8bec80dccc9f4fe147a500486813f4e89a0d56d8 Mon Sep 17 00:00:00 2001
+From: Mathieu Parent <math.parent@gmail.com>
+Date: Sun, 25 Oct 2009 15:19:01 +0100
+Subject: [PATCH 3/7] pico2wave: Convert text to .wav using svox text-to-speech system.
+
+---
+ pico/.gitignore      |    1 +
+ pico/Makefile.am     |    7 +
+ pico/bin/pico2wave.c |  341 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ pico/configure.in    |    3 +
+ 4 files changed, 352 insertions(+), 0 deletions(-)
+ create mode 100644 pico/bin/pico2wave.c
+
+diff --git a/pico/.gitignore b/pico/.gitignore
+index 4235569..a110298 100644
+--- a/pico/.gitignore
++++ b/pico/.gitignore
+@@ -29,4 +29,5 @@ libtool
+ *.lo
+ .libs
+ libttspico.la
++pico2wave
+diff --git a/pico/Makefile.am b/pico/Makefile.am
+index 6d8a10c..0d9472d 100644
+--- a/pico/Makefile.am
++++ b/pico/Makefile.am
+@@ -34,3 +34,10 @@ libttspico_la_SOURCES = \
+       lib/picotrns.c \
+       lib/picowa.c
++bin_PROGRAMS = pico2wave
++pico2wave_SOURCES = \
++      bin/pico2wave.c
++pico2wave_LDADD = \
++      libttspico.la -lm -lpopt
++pico2wave_CFLAGS = -Wall -I lib
++
+diff --git a/pico/bin/pico2wave.c b/pico/bin/pico2wave.c
+new file mode 100644
+index 0000000..0c035a7
+--- /dev/null
++++ b/pico/bin/pico2wave.c
+@@ -0,0 +1,341 @@
++/* pico2wave.c
++
++ * Copyright (C) 2009 Mathieu Parent <math.parent@gmail.com>
++ *
++ * 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
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ *   Convert text to .wav using svox text-to-speech system.
++ *
++ */
++
++
++#include <popt.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#include <picoapi.h>
++#include <picoapid.h>
++#include <picoos.h>
++
++
++/* adaptation layer defines */
++#define PICO_MEM_SIZE       2500000
++#define DummyLen 100000000
++
++/* string constants */
++#define MAX_OUTBUF_SIZE     128
++const char * PICO_LINGWARE_PATH             = "./lang/";
++const char * PICO_VOICE_NAME                = "PicoVoice";
++
++/* supported voices
++   Pico does not separately specify the voice and locale.   */
++const char * picoSupportedLangIso3[]        = { "eng",              "eng",              "deu",              "spa",              "fra",              "ita" };
++const char * picoSupportedCountryIso3[]     = { "USA",              "GBR",              "DEU",              "ESP",              "FRA",              "ITA" };
++const char * picoSupportedLang[]            = { "en-US",            "en-GB",            "de-DE",            "es-ES",            "fr-FR",            "it-IT" };
++const char * picoInternalLang[]             = { "en-US",            "en-GB",            "de-DE",            "es-ES",            "fr-FR",            "it-IT" };
++const char * picoInternalTaLingware[]       = { "en-US_ta.bin",     "en-GB_ta.bin",     "de-DE_ta.bin",     "es-ES_ta.bin",     "fr-FR_ta.bin",     "it-IT_ta.bin" };
++const char * picoInternalSgLingware[]       = { "en-US_lh0_sg.bin", "en-GB_kh0_sg.bin", "de-DE_gl0_sg.bin", "es-ES_zl0_sg.bin", "fr-FR_nk0_sg.bin", "it-IT_cm0_sg.bin" };
++const char * picoInternalUtppLingware[]     = { "en-US_utpp.bin",   "en-GB_utpp.bin",   "de-DE_utpp.bin",   "es-ES_utpp.bin",   "fr-FR_utpp.bin",   "it-IT_utpp.bin" };
++const int picoNumSupportedVocs              = 6;
++
++/* adapation layer global variables */
++void *          picoMemArea         = NULL;
++pico_System     picoSystem          = NULL;
++pico_Resource   picoTaResource      = NULL;
++pico_Resource   picoSgResource      = NULL;
++pico_Resource   picoUtppResource    = NULL;
++pico_Engine     picoEngine          = NULL;
++pico_Char *     picoTaFileName      = NULL;
++pico_Char *     picoSgFileName      = NULL;
++pico_Char *     picoUtppFileName    = NULL;
++pico_Char *     picoTaResourceName  = NULL;
++pico_Char *     picoSgResourceName  = NULL;
++pico_Char *     picoUtppResourceName = NULL;
++int     picoSynthAbort = 0;
++
++
++int main(int argc, const char *argv[]) {
++    char * wavefile = NULL;
++    char * lang = "en-US";
++    int langIndex = -1, langIndexTmp = -1;
++    char * text;
++    int8_t * buffer;
++    size_t bufferSize = 256;
++    
++    /* Parsing options */
++      poptContext optCon; /* context for parsing command-line options */
++      int opt; /* used for argument parsing */
++
++      struct poptOption optionsTable[] = {
++              { "wave", 'w', POPT_ARG_STRING, &wavefile, 0,
++                "Write output to this WAV file (extension SHOULD be .wav)", "filename.wav" },
++              { "lang", 'l', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &lang, 0,
++                "Language", "lang" },
++              POPT_AUTOHELP
++              POPT_TABLEEND
++      };
++      optCon = poptGetContext(NULL, argc, argv, optionsTable, POPT_CONTEXT_POSIXMEHARDER);
++    poptSetOtherOptionHelp(optCon, "<words>");
++
++    /* Reporting about invalid extra options */
++      while ((opt = poptGetNextOpt(optCon)) != -1) {
++              switch (opt) {
++              default:
++                      fprintf(stderr, "Invalid option %s: %s\n", 
++                              poptBadOption(optCon, 0), poptStrerror(opt));
++                      poptPrintHelp(optCon, stderr, 0);
++                      exit(1);
++              }
++      }
++
++    /* Mandatory option: --wave */
++      if(!wavefile) {
++              fprintf(stderr, "Mandatory option: %s\n\n", 
++                      "--wave=filename.wav");
++              poptPrintHelp(optCon, stderr, 0);
++              exit(1);
++      }
++      /* option: --lang */
++      for(langIndexTmp =0; langIndexTmp<picoNumSupportedVocs; langIndexTmp++) {
++          if(!strcmp(picoSupportedLang[langIndexTmp], lang)) {
++              langIndex = langIndexTmp;
++              break;
++          }
++      }
++      if(langIndex == -1) {
++              fprintf(stderr, "Unknown language: %s\nValid languages:\n", 
++                      lang);
++          for(langIndexTmp =0; langIndexTmp<picoNumSupportedVocs; langIndexTmp++) {
++              fprintf(stderr, "%s\n", picoSupportedLang[langIndexTmp]);
++          }
++          lang = "en-US";
++              fprintf(stderr, "\n");
++              poptPrintHelp(optCon, stderr, 0);
++              exit(1);
++      }
++
++      /* Remaining argument is <words> */
++      const char **extra_argv;
++      extra_argv = poptGetArgs(optCon);
++    if(extra_argv) {
++              text = (char *) &(*extra_argv)[0];
++    } else {
++        //TODO: stdin not supported yet.
++              fprintf(stderr, "Missing argument: %s\n\n", 
++                      "<words>");
++              poptPrintHelp(optCon, stderr, 0);
++              exit(1);
++    }
++
++    poptFreeContext(optCon);
++    
++    buffer = malloc( bufferSize );
++    
++    int ret, getstatus;
++    pico_Char * inp = NULL;
++    pico_Char * local_text = NULL;
++    short       outbuf[MAX_OUTBUF_SIZE/2];
++    pico_Int16  bytes_sent, bytes_recv, text_remaining, out_data_type;
++    pico_Retstring outMessage;
++    
++    picoSynthAbort = 0;
++
++    picoMemArea = malloc( PICO_MEM_SIZE );
++    if((ret = pico_initialize( picoMemArea, PICO_MEM_SIZE, &picoSystem ))) {
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
++        fprintf(stderr, "Cannot initialize pico (%i): %s\n", ret, outMessage);
++        goto terminate;
++    }
++    
++    /* Load the text analysis Lingware resource file.   */
++    picoTaFileName      = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE );
++    strcpy((char *) picoTaFileName,   PICO_LINGWARE_PATH);
++    strcat((char *) picoTaFileName,   (const char *) picoInternalTaLingware[langIndex]);
++    if((ret = pico_loadResource( picoSystem, picoTaFileName, &picoTaResource ))) {
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
++        fprintf(stderr, "Cannot load text analysis resource file (%i): %s\n", ret, outMessage);
++        goto unloadTaResource;
++    }
++    
++    /* Load the signal generation Lingware resource file.   */
++    picoSgFileName      = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE );
++    strcpy((char *) picoSgFileName,   PICO_LINGWARE_PATH);
++    strcat((char *) picoSgFileName,   (const char *) picoInternalSgLingware[langIndex]);
++    if((ret = pico_loadResource( picoSystem, picoSgFileName, &picoSgResource ))) {
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
++        fprintf(stderr, "Cannot load signal generation Lingware resource file (%i): %s\n", ret, outMessage);
++        goto unloadSgResource;
++    }
++ 
++    /* Load the utpp Lingware resource file if exists - NOTE: this file is optional
++       and is currently not used. Loading is only attempted for future compatibility.
++       If this file is not present the loading will still succeed.                      //
++    picoUtppFileName      = (pico_Char *) malloc( PICO_MAX_DATAPATH_NAME_SIZE + PICO_MAX_FILE_NAME_SIZE );
++    strcpy((char *) picoUtppFileName,   PICO_LINGWARE_PATH);
++    strcat((char *) picoUtppFileName,   (const char *) picoInternalUtppLingware[langIndex]);
++    ret = pico_loadResource( picoSystem, picoUtppFileName, &picoUtppResource );
++    pico_getSystemStatusMessage(picoSystem, ret, outMessage);
++    printf("pico_loadResource: %i: %s\n", ret, outMessage);
++    */
++    
++    /* Get the text analysis resource name.     */
++    picoTaResourceName  = (pico_Char *) malloc( PICO_MAX_RESOURCE_NAME_SIZE );
++    if((ret = pico_getResourceName( picoSystem, picoTaResource, (char *) picoTaResourceName ))) {
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
++        fprintf(stderr, "Cannot get the text analysis resource name (%i): %s\n", ret, outMessage);
++        goto unloadUtppResource;
++    }
++
++    /* Get the signal generation resource name. */
++    picoSgResourceName  = (pico_Char *) malloc( PICO_MAX_RESOURCE_NAME_SIZE );
++    if((ret = pico_getResourceName( picoSystem, picoSgResource, (char *) picoSgResourceName ))) {
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
++        fprintf(stderr, "Cannot get the signal generation resource name (%i): %s\n", ret, outMessage);
++        goto unloadUtppResource;
++    }
++
++
++    /* Create a voice definition.   */
++    if((ret = pico_createVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME ))) {
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
++        fprintf(stderr, "Cannot create voice definition (%i): %s\n", ret, outMessage);
++        goto unloadUtppResource;
++    }
++
++    /* Add the text analysis resource to the voice. */
++    if((ret = pico_addResourceToVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME, picoTaResourceName ))) {
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
++        fprintf(stderr, "Cannot add the text analysis resource to the voice (%i): %s\n", ret, outMessage);
++        goto unloadUtppResource;
++    }
++    
++    /* Add the signal generation resource to the voice. */
++    if((ret = pico_addResourceToVoiceDefinition( picoSystem, (const pico_Char *) PICO_VOICE_NAME, picoSgResourceName ))) {
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
++        fprintf(stderr, "Cannot add the signal generation resource to the voice (%i): %s\n", ret, outMessage);
++        goto unloadUtppResource;
++    }
++
++    /* Create a new Pico engine. */
++    if((ret = pico_newEngine( picoSystem, (const pico_Char *) PICO_VOICE_NAME, &picoEngine ))) {
++        pico_getSystemStatusMessage(picoSystem, ret, outMessage);
++        fprintf(stderr, "Cannot create a new pico engine (%i): %s\n", ret, outMessage);
++        goto disposeEngine;
++    }
++    
++    local_text = (pico_Char *) text ;
++    text_remaining = strlen((const char *) local_text) + 1;
++
++    inp = (pico_Char *) local_text;
++    
++    size_t bufused = 0;
++    
++    picoos_Common common = (picoos_Common) pico_sysGetCommon(picoSystem);
++
++    picoos_SDFile sdOutFile = NULL;
++
++    picoos_bool done = TRUE;
++    if(TRUE != (done = picoos_sdfOpenOut(common, &sdOutFile,
++        (picoos_char *) wavefile, SAMPLE_FREQ_16KHZ, PICOOS_ENC_LIN)))
++    {
++        fprintf(stderr, "Cannot open output wave file\n");
++        ret = 1;
++        goto disposeEngine;
++    }
++    
++    /* synthesis loop   */
++    while (text_remaining) {
++        /* Feed the text into the engine.   */
++        if((ret = pico_putTextUtf8( picoEngine, inp, text_remaining, &bytes_sent ))) {
++            pico_getSystemStatusMessage(picoSystem, ret, outMessage);
++            fprintf(stderr, "Cannot put Text (%i): %s\n", ret, outMessage);
++            goto disposeEngine;
++        }
++    
++        text_remaining -= bytes_sent;
++        inp += bytes_sent;
++
++        do {
++            if (picoSynthAbort) {
++                goto disposeEngine;
++            }
++            /* Retrieve the samples and add them to the buffer. */
++            getstatus = pico_getData( picoEngine, (void *) outbuf,
++                      MAX_OUTBUF_SIZE, &bytes_recv, &out_data_type );
++            if((getstatus !=PICO_STEP_BUSY) && (getstatus !=PICO_STEP_IDLE)){
++                pico_getSystemStatusMessage(picoSystem, getstatus, outMessage);
++                fprintf(stderr, "Cannot get Data (%i): %s\n", getstatus, outMessage);
++                goto disposeEngine;
++            }
++            if (bytes_recv) {
++                if ((bufused + bytes_recv) <= bufferSize) {
++                    memcpy(buffer+bufused, (int8_t *) outbuf, bytes_recv);
++                    bufused += bytes_recv;
++                } else {
++                    done = picoos_sdfPutSamples(
++                                        sdOutFile,
++                                        bufused / 2,
++                                        (picoos_int16*) (buffer));
++                    bufused = 0;
++                    memcpy(buffer, (int8_t *) outbuf, bytes_recv);
++                    bufused += bytes_recv;
++                }
++            }
++        } while (PICO_STEP_BUSY == getstatus);
++        /* This chunk of synthesis is finished; pass the remaining samples. */
++        if (!picoSynthAbort) {
++                    done = picoos_sdfPutSamples(
++                                        sdOutFile,
++                                        bufused / 2,
++                                        (picoos_int16*) (buffer));
++        }
++        picoSynthAbort = 0;
++    }
++    
++    if(TRUE != (done = picoos_sdfCloseOut(common, &sdOutFile)))
++    {
++        fprintf(stderr, "Cannot close output wave file\n");
++        ret = 1;
++        goto disposeEngine;
++    }
++
++disposeEngine:
++    if (picoEngine) {
++        pico_disposeEngine( picoSystem, &picoEngine );
++        pico_releaseVoiceDefinition( picoSystem, (pico_Char *) PICO_VOICE_NAME );
++        picoEngine = NULL;
++    }
++unloadUtppResource:
++    if (picoUtppResource) {
++        pico_unloadResource( picoSystem, &picoUtppResource );
++        picoUtppResource = NULL;
++    }
++unloadSgResource:
++    if (picoSgResource) {
++        pico_unloadResource( picoSystem, &picoSgResource );
++        picoSgResource = NULL;
++    }
++unloadTaResource:
++    if (picoTaResource) {
++        pico_unloadResource( picoSystem, &picoTaResource );
++        picoTaResource = NULL;
++    }
++terminate:
++    if (picoSystem) {
++        pico_terminate(&picoSystem);
++        picoSystem = NULL;
++    }
++    exit(ret);
++}
++
+diff --git a/pico/configure.in b/pico/configure.in
+index 0afb56d..349eb1d 100644
+--- a/pico/configure.in
++++ b/pico/configure.in
+@@ -14,3 +14,6 @@ AC_CONFIG_FILES([Makefile])
+ AC_OUTPUT
+ AC_CONFIG_MACRO_DIR([m4])
++
++AC_CHECK_LIB(popt, poptGetContext)
++
+-- 
+1.7.1
+
diff --git a/sound/svox/patches/0004-add-header-files.patch b/sound/svox/patches/0004-add-header-files.patch
new file mode 100644 (file)
index 0000000..f057308
--- /dev/null
@@ -0,0 +1,59 @@
+From 0866cb3f7cfe4b8bae1edc8d0dbf18c85e9ca74f Mon Sep 17 00:00:00 2001
+From: Mathieu Parent <math.parent@gmail.com>
+Date: Tue, 27 Oct 2009 18:29:45 +0100
+Subject: [PATCH 4/7] add header files
+
+---
+ pico/Makefile.am |   36 ++++++++++++++++++++++++++++++++++++
+ 1 files changed, 36 insertions(+), 0 deletions(-)
+
+diff --git a/pico/Makefile.am b/pico/Makefile.am
+index 0d9472d..9151042 100644
+--- a/pico/Makefile.am
++++ b/pico/Makefile.am
+@@ -34,6 +34,42 @@ libttspico_la_SOURCES = \
+       lib/picotrns.c \
+       lib/picowa.c
++libttspico_ladir = $(includedir)
++libttspico_la_HEADERS = \
++    lib/picoacph.h \
++    lib/picoapid.h \
++    lib/picoapi.h \
++    lib/picobase.h \
++    lib/picocep.h \
++    lib/picoctrl.h \
++    lib/picodata.h \
++    lib/picodbg.h \
++    lib/picodefs.h \
++    lib/picodsp.h \
++    lib/picoextapi.h \
++    lib/picofftsg.h \
++    lib/picokdbg.h \
++    lib/picokdt.h \
++    lib/picokfst.h \
++    lib/picoklex.h \
++    lib/picoknow.h \
++    lib/picokpdf.h \
++    lib/picokpr.h \
++    lib/picoktab.h \
++    lib/picoos.h \
++    lib/picopal.h \
++    lib/picopam.h \
++    lib/picopltf.h \
++    lib/picopr.h \
++    lib/picorsrc.h \
++    lib/picosa.h \
++    lib/picosig2.h \
++    lib/picosig.h \
++    lib/picospho.h \
++    lib/picotok.h \
++    lib/picotrns.h \
++    lib/picowa.h
++
+ bin_PROGRAMS = pico2wave
+ pico2wave_SOURCES = \
+       bin/pico2wave.c
+-- 
+1.7.1
+
diff --git a/sound/svox/patches/0005-Install-lang-files.patch b/sound/svox/patches/0005-Install-lang-files.patch
new file mode 100644 (file)
index 0000000..95344e3
--- /dev/null
@@ -0,0 +1,32 @@
+From 486b9f924bdf38f5f213feed2631060b44024c11 Mon Sep 17 00:00:00 2001
+From: Mathieu Parent <math.parent@gmail.com>
+Date: Tue, 27 Oct 2009 23:06:46 +0100
+Subject: [PATCH 5/7] Install lang files
+
+---
+ pico/Makefile.am |    9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/pico/Makefile.am b/pico/Makefile.am
+index 9151042..8898050 100644
+--- a/pico/Makefile.am
++++ b/pico/Makefile.am
+@@ -70,6 +70,15 @@ libttspico_la_HEADERS = \
+     lib/picotrns.h \
+     lib/picowa.h
++picolangdir = $(datadir)/pico/lang
++picolang_DATA = \
++    lang/de-DE*.bin \
++    lang/en-GB*.bin \
++    lang/en-US*.bin \
++    lang/es-ES*.bin \
++    lang/fr-FR*.bin \
++    lang/it-IT*.bin
++
+ bin_PROGRAMS = pico2wave
+ pico2wave_SOURCES = \
+       bin/pico2wave.c
+-- 
+1.7.1
+
diff --git a/sound/svox/patches/0006-Set-picolangdir.patch b/sound/svox/patches/0006-Set-picolangdir.patch
new file mode 100644 (file)
index 0000000..1ec646d
--- /dev/null
@@ -0,0 +1,40 @@
+From 0102d423b79de7af982c8d4619d816f95a9b9278 Mon Sep 17 00:00:00 2001
+From: Mathieu Parent <math.parent@gmail.com>
+Date: Thu, 29 Oct 2009 23:55:19 +0100
+Subject: [PATCH 6/7] Set picolangdir
+
+---
+ pico/Makefile.am     |    2 +-
+ pico/bin/pico2wave.c |    4 ++++
+ 2 files changed, 5 insertions(+), 1 deletions(-)
+
+diff --git a/pico/Makefile.am b/pico/Makefile.am
+index 8898050..a19c42a 100644
+--- a/pico/Makefile.am
++++ b/pico/Makefile.am
+@@ -84,5 +84,5 @@ pico2wave_SOURCES = \
+       bin/pico2wave.c
+ pico2wave_LDADD = \
+       libttspico.la -lm -lpopt
+-pico2wave_CFLAGS = -Wall -I lib
++pico2wave_CFLAGS = -Wall -Dpicolangdir=\"$(picolangdir)\" -I lib
+diff --git a/pico/bin/pico2wave.c b/pico/bin/pico2wave.c
+index 0c035a7..ec7ab79 100644
+--- a/pico/bin/pico2wave.c
++++ b/pico/bin/pico2wave.c
+@@ -35,7 +35,11 @@
+ /* string constants */
+ #define MAX_OUTBUF_SIZE     128
++#ifdef picolangdir
++const char * PICO_LINGWARE_PATH             = picolangdir "/";
++#else
+ const char * PICO_LINGWARE_PATH             = "./lang/";
++#endif
+ const char * PICO_VOICE_NAME                = "PicoVoice";
+ /* supported voices
+-- 
+1.7.1
+
diff --git a/sound/svox/patches/0008-64bits.patch b/sound/svox/patches/0008-64bits.patch
new file mode 100644 (file)
index 0000000..883a42e
--- /dev/null
@@ -0,0 +1,26 @@
+Description: fix execution on 64bit archs
+Bug: http://code.google.com/p/android/issues/detail?id=12224
+Author: Samuel Thibault <sthibault@debian.org>
+
+--- svox/pico/lib/picoapi.c.original   2010-10-25 19:06:57.000000000 +0200
++++ svox/pico/lib/picoapi.c    2010-10-25 19:07:18.000000000 +0200
+@@ -90,7 +90,7 @@
+         status = PICO_ERR_NULLPTR_ACCESS;
+     } else {
+         byte_ptr_t rest_mem;
+-        picoos_uint32 rest_mem_size;
++        picoos_objsize_t rest_mem_size;
+         pico_System sys;
+         picoos_MemoryManager sysMM;
+         picoos_ExceptionManager sysEM;
+--- svox/pico/lib/picosig2.c.original  2010-10-26 00:17:18.000000000 +0200
++++ svox/pico/lib/picosig2.c   2010-10-26 00:17:19.000000000 +0200
+@@ -568,7 +568,7 @@
+     for (nI = 1; nI < m1; nI++) {
+         XXr[nI] = c1[nI] << shift;
+     }
+-    i = sizeof(picoos_int32) * (PICODSP_FFTSIZE + 1 - m1);
++    i = sizeof(picoos_int32) * (PICODSP_FFTSIZE - m1);
+     picoos_mem_set(XXr + m1, 0, i);
+     dfct_nmf(m4, XXr); /* DFCT directly in fixed point */
diff --git a/sound/svox/patches/0009-Fix-link-order.patch b/sound/svox/patches/0009-Fix-link-order.patch
new file mode 100644 (file)
index 0000000..bcf3870
--- /dev/null
@@ -0,0 +1,21 @@
+Index: svox-1.0+git20130326/pico/Makefile.am
+===================================================================
+--- svox-1.0+git20130326.orig/pico/Makefile.am 2013-11-12 12:37:05.939979854 -0500
++++ svox-1.0+git20130326/pico/Makefile.am      2013-11-12 13:00:52.336945041 -0500
+@@ -70,6 +70,8 @@
+     lib/picotrns.h \
+     lib/picowa.h
++libttspico_la_LIBADD = -lm
++
+ picolangdir = $(datadir)/pico/lang
+ picolang_DATA = \
+     lang/de-DE*.bin \
+@@ -83,6 +85,6 @@
+ pico2wave_SOURCES = \
+       bin/pico2wave.c
+ pico2wave_LDADD = \
+-      libttspico.la -lm -lpopt
++      libttspico.la -lpopt
+ pico2wave_CFLAGS = -Wall -Dpicolangdir=\"$(picolangdir)\" -I lib
diff --git a/sound/svox/patches/0010-platform.patch b/sound/svox/patches/0010-platform.patch
new file mode 100644 (file)
index 0000000..ff76f75
--- /dev/null
@@ -0,0 +1,30 @@
+--- a/pico/lib/picopltf.h
++++ b/pico/lib/picopltf.h
+@@ -39,6 +39,8 @@
+ #define PICO_MacOSX     5   /* Macintosh OS X */
+ #define PICO_Linux      7   /* Linux */
++#define PICO_GENERIC    99  /* Generic */
++
+ /* * definition of current platform ***/
+ #if !defined(PICO_PLATFORM)
+ #if defined(_WIN32)
+@@ -48,7 +50,7 @@
+ #elif defined(linux) || defined(__linux__) || defined(__linux)
+ #define PICO_PLATFORM    PICO_Linux
+ #else
+-#error PICO_PLATFORM not defined
++#define PICO_PLATFORM    PICO_GENERIC
+ #endif
+ #endif /* !defined(PICO_PLATFORM) */
+@@ -64,7 +66,8 @@
+ #define PICO_PLATFORM_STRING "UnknownPlatform"
+ #endif
+-#if (PICO_PLATFORM == PICO_MacOSX)
++#include <endian.h>
++#if __BYTE_ORDER == __BIG_ENDIAN
+ #define PICO_ENDIANNESS ENDIANNESS_BIG
+ #else
+ #define PICO_ENDIANNESS ENDIANNESS_LITTLE
diff --git a/sound/svox/patches/0011-subdir.patch b/sound/svox/patches/0011-subdir.patch
new file mode 100644 (file)
index 0000000..fa9e91f
--- /dev/null
@@ -0,0 +1,12 @@
+diff -urN a/pico/configure.in b/pico/configure.in
+--- a/pico/configure.in        2015-01-21 18:59:39.604452795 +0100
++++ b/pico/configure.in        2015-01-21 19:00:53.288777298 +0100
+@@ -4,7 +4,7 @@
+ AC_INIT([svox], [1.0], [math.parent@gmail.com])
+-AM_INIT_AUTOMAKE([1.9 foreign])
++AM_INIT_AUTOMAKE([1.9 foreign subdir-objects])
+ AC_PROG_CC
+ LT_INIT
diff --git a/sound/svox/patches/0012-no-headers.patch b/sound/svox/patches/0012-no-headers.patch
new file mode 100644 (file)
index 0000000..edf4d04
--- /dev/null
@@ -0,0 +1,46 @@
+diff -urN a/pico/Makefile.am b/pico/Makefile.am
+--- a/pico/Makefile.am 2015-01-22 01:33:21.470895431 +0100
++++ b/pico/Makefile.am 2015-01-22 01:36:03.042228475 +0100
+@@ -34,42 +34,6 @@
+       lib/picotrns.c \
+       lib/picowa.c
+-libttspico_ladir = $(includedir)
+-libttspico_la_HEADERS = \
+-    lib/picoacph.h \
+-    lib/picoapid.h \
+-    lib/picoapi.h \
+-    lib/picobase.h \
+-    lib/picocep.h \
+-    lib/picoctrl.h \
+-    lib/picodata.h \
+-    lib/picodbg.h \
+-    lib/picodefs.h \
+-    lib/picodsp.h \
+-    lib/picoextapi.h \
+-    lib/picofftsg.h \
+-    lib/picokdbg.h \
+-    lib/picokdt.h \
+-    lib/picokfst.h \
+-    lib/picoklex.h \
+-    lib/picoknow.h \
+-    lib/picokpdf.h \
+-    lib/picokpr.h \
+-    lib/picoktab.h \
+-    lib/picoos.h \
+-    lib/picopal.h \
+-    lib/picopam.h \
+-    lib/picopltf.h \
+-    lib/picopr.h \
+-    lib/picorsrc.h \
+-    lib/picosa.h \
+-    lib/picosig2.h \
+-    lib/picosig.h \
+-    lib/picospho.h \
+-    lib/picotok.h \
+-    lib/picotrns.h \
+-    lib/picowa.h
+-
+ libttspico_la_LIBADD = -lm
+ picolangdir = $(datadir)/pico/lang
diff --git a/sound/upmpdcli/Config.in b/sound/upmpdcli/Config.in
new file mode 100644 (file)
index 0000000..fe32722
--- /dev/null
@@ -0,0 +1,17 @@
+config PACKAGE_UPMPDCLI_SCCTL
+       bool "scctl command for configuring SongCast receivers"
+       default no
+       depends on PACKAGE_upmpdcli
+       help
+               Installs the scctl command. See the following link for more info: 
+               http://www.lesbonscomptes.com/upmpdcli/scmulti.html
+
+config PACKAGE_UPMPDCLI_SC_WEB_INTERFACE
+       bool "SongCast web server and associated files (depends on python)"
+       default no
+       depends on PACKAGE_upmpdcli
+       select PACKAGE_python
+       select PACKAGE_UPMPDCLI_SCCTL
+       help
+               Installs the SongCast web interface and web server. See the following
+               link for more info: http://www.lesbonscomptes.com/upmpdcli/scmulti.html
diff --git a/sound/upmpdcli/Makefile b/sound/upmpdcli/Makefile
new file mode 100644 (file)
index 0000000..27bbee8
--- /dev/null
@@ -0,0 +1,63 @@
+#
+# 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:=upmpdcli
+PKG_VERSION:=1.1.3
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.lesbonscomptes.com/upmpdcli/downloads
+PKG_MD5SUM:=de9f232d6d5f746ec81ec239e11bdda4
+PKG_MAINTAINER:=Petko Bordjukov <bordjukov@gmail.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/upmpdcli
+  SECTION:=sound
+  CATEGORY:=Sound
+  URL:=http://www.lesbonscomptes.com/upmpdcli
+  DEPENDS+= +libupnpp +libmpdclient
+  TITLE:=A UPnP front-end to MPD, the Music Player Daemon
+  USERID:=upmpdcli=89:upmpdcli=89
+  MENU:=1
+endef
+
+define Package/upmpdcli/description
+upmpdcli implements an UPnP Media Renderer, using MPD to perform the real work.
+endef
+
+define Package/upmpdcli/config
+       source "$(SOURCE)/Config.in"
+endef
+
+define Package/upmpdcli/install
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/upmpdcli.conf $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/upmpdcli.config $(1)/etc/config/upmpdcli
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upmpdcli $(1)/usr/bin/
+ifeq ($(CONFIG_PACKAGE_UPMPDCLI_SCCTL),y)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/scctl $(1)/usr/bin/
+endif
+       $(INSTALL_DIR) $(1)/usr/share/upmpdcli
+ifneq ($(CONFIG_PACKAGE_UPMPDCLI_SC_WEB_INTERFACE),y)
+       $(RM) -rf $(PKG_INSTALL_DIR)/usr/share/upmpdcli/web
+endif
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/upmpdcli $(1)/usr/share/
+       $(INSTALL_DATA) ./files/upmpdcli.png $(1)/usr/share/upmpdcli/icon.png
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/upmpdcli.init $(1)/etc/init.d/upmpdcli
+endef
+
+$(eval $(call BuildPackage,upmpdcli))
diff --git a/sound/upmpdcli/files/upmpdcli.config b/sound/upmpdcli/files/upmpdcli.config
new file mode 100644 (file)
index 0000000..56b0ba3
--- /dev/null
@@ -0,0 +1,15 @@
+config upmpdcli lan
+       option interface 'br-lan'
+#      option friendly_name 'upmpdcli'
+#      option mpd_host '127.0.0.1'
+#      option mpd_port '6600'
+#      option upmpd_port '0'
+#      option config '/etc/upmpdcli.conf'
+
+# Add additional interfaces
+#
+#config upmpdcli wifi
+#      option interface 'wlan0'
+
+#config upmpdcli wan
+#      option interface 'eth0'
diff --git a/sound/upmpdcli/files/upmpdcli.init b/sound/upmpdcli/files/upmpdcli.init
new file mode 100644 (file)
index 0000000..6c69209
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 OpenWrt.org
+
+NAME=upmpdcli
+START=95
+
+UPMPD_BIN=/usr/bin/${NAME}
+
+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}"
+}
+
+start_instance() {
+       local cfg="$1"
+       local interface
+
+       procd_open_instance
+
+       procd_set_param command "${UPMPD_BIN}"
+
+#      config_get interface "$cfg" interface
+#      procd_add_reload_interface_trigger $interface
+
+       append_arg "$cfg" interface "-i"
+       append_arg "$cfg" mpd_host "-h"
+       append_arg "$cfg" mpd_port "-p"
+       append_arg "$cfg" upmpd_port "-P"
+
+       append_arg "$cfg" config "-c"
+       append_arg "$cfg" friendly_name "-f"
+
+       procd_close_instance
+}
+
+service_triggers() {
+       procd_add_reload_trigger "${NAME}"
+}
+
+start_service() {
+       config_load ${NAME}
+       config_foreach start_instance ${NAME}
+}
diff --git a/sound/upmpdcli/files/upmpdcli.png b/sound/upmpdcli/files/upmpdcli.png
new file mode 100644 (file)
index 0000000..ba50c64
Binary files /dev/null and b/sound/upmpdcli/files/upmpdcli.png differ
diff --git a/sound/upmpdcli/patches/010-Add_icon_config.patch b/sound/upmpdcli/patches/010-Add_icon_config.patch
new file mode 100644 (file)
index 0000000..3030ae3
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/upmpdcli.conf-dist
++++ b/src/upmpdcli.conf-dist
+@@ -24,7 +24,7 @@
+ # You can set a path to an icon here. The icon will be displayed by a control
+ # point. The icon will only be read once, when upmpdcli starts up.
+-# iconpath = /usr/share/upmpdcli/icon.png
++iconpath = /usr/share/upmpdcli/icon.png
+ # You can set a path to an html file here, to replace the default
+ # presentation page. The page will only be read once, when upmpdcli starts
diff --git a/utils/bluelog/Makefile b/utils/bluelog/Makefile
new file mode 100644 (file)
index 0000000..5ef7c65
--- /dev/null
@@ -0,0 +1,108 @@
+#
+# Copyright (C) 2012-2013 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:=bluelog
+PKG_VERSION:=1.1.2
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=ftp://ftp.digifail.com/software/bluelog
+PKG_MD5SUM:=614d0fe65bae68acff1d33d9f86e4805
+
+OUI_SOURCE:=oui-2016-05-30.txt.gz
+OUI_URL:=http://sources.lede-project.org/
+OUI_MD5SUM:=38048729fdb5a7a7e0c5db6a51dc2dd1
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/bluelog/Default
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Bluetooth scanner and logger
+  URL:=http://www.digifail.com/software/bluelog.shtml
+  DEPENDS:=+bluez-libs +kmod-bluetooth
+endef
+
+define Package/bluelog/Default/description
+  Bluelog is a simple Bluetooth scanner designed to tell you how many
+  discoverable devices there are in an area as quickly as possible. It is
+  intended to be used as a site survey tool, identifying the number of possible
+  Bluetooth targets there are in the surrounding environment.
+endef
+
+define Package/bluelog
+  $(call Package/bluelog/Default)
+endef
+
+define Package/bluelog/description
+  $(call Package/bluelog/Default/description)
+endef
+
+define Package/bluelog-live
+  $(call Package/bluelog/Default)
+  TITLE+= (live output)
+  DEPENDS+= bluelog
+endef
+
+define Package/bluelog-live/description
+  $(call Package/bluelog/Default/description)
+  This package contains the files for "Bluelog Live", an optional mode of
+  Bluelog which creates a real-time webpage of discovered Bluetooth devices.
+endef
+
+define Download/oui.txt
+  FILE:=$(OUI_SOURCE)
+  URL:=$(OUI_URL)
+  MD5SUM:=$(OUI_MD5SUM)
+endef
+
+TARGET_CFLAGS += -DOPENWRT
+
+MAKE_FLAGS += \
+        LIBS="$(TARGET_LDFLAGS) -lbluetooth -lm"
+
+define Build/Prepare
+       $(eval $(call Download,oui.txt))
+       $(Build/Prepare/Default)
+       zcat $(DL_DIR)/$(OUI_SOURCE) > $(PKG_BUILD_DIR)/oui.tmp
+endef
+
+define Package/bluelog/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/bluelog $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/bluelog.init $(1)/etc/init.d/bluelog
+endef
+
+define Package/bluelog-live/install
+       $(INSTALL_DIR) $(1)/www/bluelog
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/bluelog/*.html $(1)/www/bluelog/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/share/bluelog/openwrt.css \
+               $(1)/www/bluelog/style.css
+       $(INSTALL_DIR) $(1)/www/bluelog/images
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/share/bluelog/images/digifail_logo.png \
+               $(PKG_INSTALL_DIR)/usr/share/bluelog/images/email.png \
+               $(PKG_INSTALL_DIR)/usr/share/bluelog/images/favicon.png \
+               $(PKG_INSTALL_DIR)/usr/share/bluelog/images/openwrt_logo.png \
+               $(PKG_INSTALL_DIR)/usr/share/bluelog/images/qrcontact.png \
+               $(1)/www/bluelog/images/
+       $(INSTALL_DIR) $(1)/www/cgi-bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/bluelog/cgi-bin/* $(1)/www/cgi-bin/
+endef
+
+$(eval $(call BuildPackage,bluelog))
+$(eval $(call BuildPackage,bluelog-live))
diff --git a/utils/bluelog/files/bluelog.init b/utils/bluelog/files/bluelog.init
new file mode 100644 (file)
index 0000000..efae288
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh /etc/rc.common
+
+START=65
+
+SERVICE_DAEMONIZE=1
+
+start() {
+       service_start /usr/bin/bluelog
+}
+
+stop() {
+       service_stop /usr/bin/bluelog
+}
diff --git a/utils/bluelog/patches/100-gen-oui-fix-tempfile-use-mirror.patch b/utils/bluelog/patches/100-gen-oui-fix-tempfile-use-mirror.patch
new file mode 100644 (file)
index 0000000..414ecb8
--- /dev/null
@@ -0,0 +1,31 @@
+--- a/gen_oui.sh
++++ b/gen_oui.sh
+@@ -3,7 +3,7 @@
+ VER="1.2"
+ # Location of tmp file
+-TMPFILE="/tmp/oui.tmp"
++TMPFILE="./oui.tmp"
+ # File to write
+ OUIFILE="oui.txt"
+@@ -22,10 +22,7 @@ exit 1
+ get_oui ()
+ {
+-echo -n "Downloading OUI file from IEEE..."
+-wget --quiet -O $TMPFILE http://standards.ieee.org/develop/regauth/oui/oui.txt || \
+-      ErrorMsg ERR "Unable to contact IEEE server!"
+-
++[ -f "$TMPFILE" ] || ErrorMsg ERR "Unable to find $TMPFILE"
+ echo "OK"
+ }
+@@ -44,7 +41,6 @@ echo "OK"
+ clean_all ()
+ {
+ echo -n "Removing files..."
+-rm -f $TMPFILE
+ rm -f $OUIFILE
+ echo "OK"
+ }
diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile
new file mode 100644 (file)
index 0000000..0430cd6
--- /dev/null
@@ -0,0 +1,159 @@
+#
+# 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:=bluez
+PKG_VERSION:=5.38
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/
+PKG_MD5SUM:=dae2ed00c63791800ea7d10a381270a5
+
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/bluez/Default
+  TITLE:=Bluetooth
+  URL:=http://www.bluez.org/
+endef
+
+define Package/bluez-examples
+$(call Package/bluez/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE+= python example apps
+  DEPENDS:=+python
+endef
+
+define Package/bluez-examples/description
+  contains many examples apps for bluetooth, requiring python
+endef
+
+define Package/bluez-libs
+$(call Package/bluez/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= library
+  DEPENDS:=+libpthread +kmod-bluetooth
+endef
+
+define Package/bluez-utils
+$(call Package/bluez/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE+= utilities
+  DEPENDS:=+bluez-libs +libpthread +librt +glib2 +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS)
+endef
+
+define Package/bluez-daemon
+$(call Package/bluez/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE+= daemon
+  DEPENDS:=+bluez-libs +bluez-utils +dbus +libical $(INTL_DEPENDS) $(ICONV_DEPENDS)
+endef
+
+define Package/bluez-daemon/conffiles
+/etc/bluetooth/main.conf
+/etc/bluetooth/network.conf
+/etc/bluetooth/input.conf
+/etc/bluetooth/proximity.conf
+/etc/config/bluetooth
+endef
+
+CONFIGURE_ARGS += \
+       --enable-static \
+       --enable-shared \
+       --enable-client \
+       --enable-datafiles \
+       --enable-experimental \
+       --enable-library \
+       --enable-monitor \
+       --enable-obex \
+       --enable-threads \
+       --enable-tools \
+       --disable-android \
+       --disable-cups \
+       --disable-manpages \
+       --disable-sixaxis \
+       --disable-systemd \
+       --disable-test \
+       --disable-udev \
+
+TARGET_CPPFLAGS += \
+       -D_GNU_SOURCE
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/bluetooth $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/bluez.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/bluez-examples/install
+       $(INSTALL_DIR) $(1)/usr/bin/bluez
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/test/* $(1)/usr/bin/bluez/
+endef
+
+define Package/bluez-libs/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.so.* $(1)/usr/lib/
+endef
+
+define Package/bluez-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bccmd $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bluemoon $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/btmon $(1)/usr/bin/
+       $(CP) $(PKG_BUILD_DIR)/tools/btmgmt $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ciptool $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciattach $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciconfig $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/hcidump $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/hcitool $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/hex2hcd $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/l2ping $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/l2test $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/rctest $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/rfcomm $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/sdptool $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/attrib/gatttool $(1)/usr/bin/
+endef
+
+define Package/bluez-daemon/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/bluetoothd $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bluetoothctl $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/obexd $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth
+       $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/
+       $(INSTALL_DATA) ./files/bluetooth.dbus $(1)/etc/dbus-1/system.d/bluetooth.conf
+       $(INSTALL_DIR) $(1)/etc/bluetooth
+       $(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_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/bluetoothd.init $(1)/etc/init.d/bluetoothd
+endef
+
+$(eval $(call BuildPackage,bluez-examples))
+$(eval $(call BuildPackage,bluez-libs))
+$(eval $(call BuildPackage,bluez-utils))
+$(eval $(call BuildPackage,bluez-daemon))
diff --git a/utils/bluez/files/bluetooth.config b/utils/bluez/files/bluetooth.config
new file mode 100644 (file)
index 0000000..6f23617
--- /dev/null
@@ -0,0 +1,15 @@
+config bluetoothd
+#      option config   /etc/bluetooth/main.conf
+       option enabled  1
+
+config hciattach
+       option initspeed        115200
+       option tty      ttyS1
+       option type     csr
+       option speed    115200
+       option flow     noflow
+       option enabled  0
+
+config rfcomm
+#      option config   /etc/bluetooth/rfcomm.conf
+       option enabled  0
diff --git a/utils/bluez/files/bluetooth.dbus b/utils/bluez/files/bluetooth.dbus
new file mode 100644 (file)
index 0000000..88545fa
--- /dev/null
@@ -0,0 +1,37 @@
+<!-- This configuration file specifies the required security policies
+     for Bluetooth core daemon to work. -->
+
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+  <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+  <policy user="root">
+    <allow own="org.bluez"/>
+  </policy>
+
+  <policy at_console="true">
+    <allow send_path="/"/>
+    <allow send_path="/org/bluez"/>
+
+    <allow send_destination="org.bluez.Manager"/>
+    <allow receive_sender="org.bluez.Manager"/>
+
+    <allow send_destination="org.bluez.Adapter"/>
+    <allow receive_sender="org.bluez.Adapter"/>
+
+    <allow send_destination="org.bluez.Device"/>
+    <allow receive_sender="org.bluez.Device"/>
+
+    <allow send_destination="org.bluez.Service"/>
+    <allow receive_sender="org.bluez.Service"/>
+
+    <allow send_destination="org.bluez.Database"/>
+    <allow receive_sender="org.bluez.Database"/>
+
+    <allow send_destination="org.bluez.Security"/>
+    <allow receive_sender="org.bluez.Security"/>
+  </policy>
+
+</busconfig>
diff --git a/utils/bluez/files/bluetoothd.init b/utils/bluez/files/bluetoothd.init
new file mode 100644 (file)
index 0000000..75f4d96
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2007 OpenWrt.org
+
+#start after dbus (60)
+START=62
+USE_PROCD=1
+PROG=/usr/bin/bluetoothd
+
+start_service() {
+       procd_open_instance
+       procd_set_param command "$PROG" -n
+       procd_close_instance
+}
diff --git a/utils/bluez/files/givepin b/utils/bluez/files/givepin
new file mode 100644 (file)
index 0000000..e52a338
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Write bluetooth PIN number here:
+pin=
+
+if [ -z "$pin" ]; then
+       msg="Set bluetooth PIN in file $0"
+       logger -p user.err "$msg"
+       for i in /dev/pts/* ; do
+               [ -w $i ] && echo "$msg" > $i
+       done
+else
+       echo "PIN:$pin"
+fi
diff --git a/utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch b/utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch
new file mode 100644 (file)
index 0000000..96e8a26
--- /dev/null
@@ -0,0 +1,21 @@
+From b4f2b77472aeb967d3a7595e8a965785c7a37c87 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Tue, 16 Feb 2016 16:40:46 +0000
+Subject: [PATCH 1/4] bcm43xx: Add bcm43xx-3wire variant
+
+---
+ tools/hciattach.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/tools/hciattach.c
++++ b/tools/hciattach.c
+@@ -1144,6 +1144,9 @@ struct uart_t uart[] = {
+       { "bcm43xx",    0x0000, 0x0000, HCI_UART_H4,   115200, 3000000,
+                               FLOW_CTL, DISABLE_PM, NULL, bcm43xx, NULL  },
++      { "bcm43xx-3wire",    0x0000, 0x0000, HCI_UART_3WIRE, 115200, 3000000,
++                              0, DISABLE_PM, NULL, bcm43xx, NULL  },
++
+       { "ath3k",    0x0000, 0x0000, HCI_UART_ATH3K, 115200, 115200,
+                       FLOW_CTL, DISABLE_PM, NULL, ath3k_ps, ath3k_pm  },
diff --git a/utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch b/utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch
new file mode 100644 (file)
index 0000000..a221861
--- /dev/null
@@ -0,0 +1,33 @@
+From e145c9621f976063e5c573db1f2053d906f63427 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Tue, 16 Feb 2016 16:39:09 +0000
+Subject: [PATCH 2/4] bcm43xx: The UART speed must be reset after the firmware
+ download
+
+---
+ tools/hciattach_bcm43xx.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/tools/hciattach_bcm43xx.c
++++ b/tools/hciattach_bcm43xx.c
+@@ -366,11 +366,8 @@ int bcm43xx_init(int fd, int def_speed,
+               return -1;
+       if (bcm43xx_locate_patch(FIRMWARE_DIR, chip_name, fw_path)) {
+-              fprintf(stderr, "Patch not found, continue anyway\n");
++              fprintf(stderr, "Patch not found for %s, continue anyway\n", chip_name);
+       } else {
+-              if (bcm43xx_set_speed(fd, ti, speed))
+-                      return -1;
+-
+               if (bcm43xx_load_firmware(fd, fw_path))
+                       return -1;
+@@ -380,6 +377,7 @@ int bcm43xx_init(int fd, int def_speed,
+                       return -1;
+               }
++              sleep(1);
+               if (bcm43xx_reset(fd))
+                       return -1;
+       }
diff --git a/utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch b/utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch
new file mode 100644 (file)
index 0000000..fa0948d
--- /dev/null
@@ -0,0 +1,20 @@
+From d41dc2046dd08d8c95197f677e224506f5b39bdd Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Wed, 20 Jan 2016 16:00:37 +0000
+Subject: [PATCH 3/4] Increase firmware load timeout to 30s
+
+---
+ tools/hciattach.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tools/hciattach.c
++++ b/tools/hciattach.c
+@@ -1293,7 +1293,7 @@ int main(int argc, char *argv[])
+ {
+       struct uart_t *u = NULL;
+       int detach, printpid, raw, opt, i, n, ld, err;
+-      int to = 10;
++      int to = 30;
+       int init_speed = 0;
+       int send_break = 0;
+       pid_t pid;
diff --git a/utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch b/utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch
new file mode 100644 (file)
index 0000000..80b052d
--- /dev/null
@@ -0,0 +1,20 @@
+From 76681284b0ea49852041fdb97a35175089a08781 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Tue, 23 Feb 2016 17:52:29 +0000
+Subject: [PATCH 4/4] Move the 43xx firmware into /lib/firmware
+
+---
+ tools/hciattach_bcm43xx.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tools/hciattach_bcm43xx.c
++++ b/tools/hciattach_bcm43xx.c
+@@ -43,7 +43,7 @@
+ #include "hciattach.h"
+ #ifndef FIRMWARE_DIR
+-#define FIRMWARE_DIR "/etc/firmware"
++#define FIRMWARE_DIR "/lib/firmware/brcm"
+ #endif
+ #define FW_EXT ".hcd"
diff --git a/utils/bluez/patches/200-uart-speed.patch b/utils/bluez/patches/200-uart-speed.patch
new file mode 100644 (file)
index 0000000..ebe0153
--- /dev/null
@@ -0,0 +1,40 @@
+--- 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;
diff --git a/utils/bluez/patches/201-readline.patch b/utils/bluez/patches/201-readline.patch
new file mode 100644 (file)
index 0000000..45e1553
--- /dev/null
@@ -0,0 +1,48 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -2441,7 +2441,7 @@ unit_tests = $(am__append_35) unit/test-
+ @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
+ @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
+ @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
+ @READLINE_TRUE@tools_obex_client_tool_SOURCES = $(gobex_sources) $(btio_sources) \
+ @READLINE_TRUE@                                               tools/obex-client-tool.c
+ @READLINE_TRUE@tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \
+-@READLINE_TRUE@                                               @GLIB_LIBS@ -lreadline
++@READLINE_TRUE@                                               @GLIB_LIBS@ -lreadline -lncurses
+ @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-
+ @READLINE_TRUE@                               client/display.h client/display.c
+ @READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \
+-@READLINE_TRUE@                               @GLIB_LIBS@ @DBUS_LIBS@ -lreadline
++@READLINE_TRUE@                               @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses
+ @READLINE_TRUE@tools_obexctl_SOURCES = tools/obexctl.c \
+ @READLINE_TRUE@                               client/display.h client/display.c
+ @READLINE_TRUE@tools_obexctl_LDADD = gdbus/libgdbus-internal.la \
+-@READLINE_TRUE@                               @GLIB_LIBS@ @DBUS_LIBS@ -lreadline
++@READLINE_TRUE@                               @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses
+ @READLINE_TRUE@tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c
+ @READLINE_TRUE@tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.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
diff --git a/utils/collectd/files/collectd.conf b/utils/collectd/files/collectd.conf
new file mode 100644 (file)
index 0000000..3afbfad
--- /dev/null
@@ -0,0 +1,39 @@
+# Config file for collectd. More info: https://collectd.org/
+# Note: Luci statistics will generate a new config and overwrite this file.
+
+#Hostname   "localhost"
+#FQDNLookup  true
+BaseDir "/var/run/collectd"
+Include "/etc/collectd/conf.d"
+PIDFile "/var/run/collectd.pid"
+PluginDir "/usr/lib/collectd"
+TypesDB "/usr/share/collectd/types.db"
+Interval    30
+ReadThreads 2
+
+LoadPlugin interface
+LoadPlugin load
+#LoadPlugin ping
+LoadPlugin rrdtool
+
+<Plugin rrdtool>
+       DataDir "/tmp/rrd"
+       RRARows 100
+       RRASingle true
+       RRATimespan 3600
+       RRATimespan 86400
+       RRATimespan 604800
+       RRATimespan 2678400
+       RRATimespan 31622400
+</Plugin>
+
+<Plugin interface>
+       IgnoreSelected false
+       Interface "br-lan"
+</Plugin>
+
+#<Plugin ping>
+#      Host "host.foo.bar"
+#      Interval 30
+#      TTL 127
+#</Plugin>
diff --git a/utils/collectd/files/collectd.init b/utils/collectd/files/collectd.init
new file mode 100644 (file)
index 0000000..cb314d3
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2016 OpenWrt.org
+
+START=80
+STOP=10
+
+USE_PROCD=1
+
+start_service() {
+       mkdir -m 0755 -p /var/lib/collectd
+       procd_open_instance
+       procd_set_param command /usr/sbin/collectd -f
+       procd_close_instance
+}
+
diff --git a/utils/collectd/patches/001-undefined-AM_PATH_LIBGCRYPT.patch b/utils/collectd/patches/001-undefined-AM_PATH_LIBGCRYPT.patch
new file mode 100644 (file)
index 0000000..0e01744
--- /dev/null
@@ -0,0 +1,4 @@
+--- /dev/null
++++ b/fake-am_path_libgcrypt.m4
+@@ -0,0 +1 @@
++AC_DEFUN([AM_PATH_LIBGCRYPT],[:])
diff --git a/utils/collectd/patches/003-remove-werror.patch b/utils/collectd/patches/003-remove-werror.patch
new file mode 100644 (file)
index 0000000..c81f209
--- /dev/null
@@ -0,0 +1,22 @@
+--- 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-upstream-fix-for-network-plugin-ddos.patch b/utils/collectd/patches/050-upstream-fix-for-network-plugin-ddos.patch
new file mode 100644 (file)
index 0000000..d4d333e
--- /dev/null
@@ -0,0 +1,50 @@
+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));
diff --git a/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch b/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch
new file mode 100644 (file)
index 0000000..704962f
--- /dev/null
@@ -0,0 +1,57 @@
+--- 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,
++
+       /* consolidation_functions = */ NULL,
+       /* consolidation_functions_num = */ 0,
+@@ -1110,6 +1113,14 @@ static int rrd_config (const char *key,
+               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);
+--- a/src/utils_rrdcreate.c
++++ b/src/utils_rrdcreate.c
+@@ -213,6 +213,9 @@ static int rra_get (char ***ret, const v
+     rts_num = rra_timespans_num;
+   }
++  if (cfg->rrasingle)
++    rra_types_num = 1;
++
+   rra_max = rts_num * rra_types_num;
+   assert (rra_max > 0);
+--- a/src/utils_rrdcreate.h
++++ b/src/utils_rrdcreate.h
+@@ -41,6 +41,8 @@ struct rrdcreate_config_s
+   int *timespans;
+   size_t timespans_num;
++  int rrasingle;
++
+   char **consolidation_functions;
+   size_t consolidation_functions_num;
diff --git a/utils/collectd/patches/140-fix-fqdnlookup.patch b/utils/collectd/patches/140-fix-fqdnlookup.patch
new file mode 100644 (file)
index 0000000..22990bd
--- /dev/null
@@ -0,0 +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"},
diff --git a/utils/collectd/patches/200-fix-git-describe-error.patch b/utils/collectd/patches/200-fix-git-describe-error.patch
new file mode 100644 (file)
index 0000000..71f2036
--- /dev/null
@@ -0,0 +1,11 @@
+--- 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"
diff --git a/utils/collectd/patches/300-delay-first-read-cycle.patch b/utils/collectd/patches/300-delay-first-read-cycle.patch
new file mode 100644 (file)
index 0000000..495c80f
--- /dev/null
@@ -0,0 +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;
+-      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);
diff --git a/utils/collectd/patches/400-fix-olsrd-get-all.patch b/utils/collectd/patches/400-fix-olsrd-get-all.patch
new file mode 100644 (file)
index 0000000..1dc6c58
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/olsrd.c
++++ b/src/olsrd.c
+@@ -658,7 +658,7 @@ static int olsrd_read (void) /* {{{ */
+   if (fh == NULL)
+     return (-1);
+-  fputs ("\r\n", fh);
++  fputs ("/all \r\n", fh);
+   fflush (fh);
+   while (fgets (buffer, sizeof (buffer), fh) != NULL)
diff --git a/utils/collectd/patches/600-fix-libmodbus-detection.patch b/utils/collectd/patches/600-fix-libmodbus-detection.patch
new file mode 100644 (file)
index 0000000..aacf182
--- /dev/null
@@ -0,0 +1,40 @@
+Patch reverts upstream commit:
+https://github.com/collectd/collectd/commit/6124da7a48f28f54fc09ebeb942d1037516fe6ab
+
+The commit changed the detection path due to FreeBSD issues,
+but apparently affects also Openwrt buildroot negatively.
+
+Original explanation:
+  From 6124da7a48f28f54fc09ebeb942d1037516fe6ab Mon Sep 17 00:00:00 2001
+  Subject: [PATCH] Fix libmodbus detection on FreeBSD
+
+  We look for modbus/modbus.h in /usr/local/include/modbus
+  but we should look for modbus.h
+
+  This is only an issue on FreeBSD since /usr/local/include is not
+  in the default search path.
+
+Reversed patch to be applied:
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -2627,7 +2627,7 @@ then
+       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)"])
+       CPPFLAGS="$SAVE_CPPFLAGS"
+ fi
+--- a/src/modbus.c
++++ b/src/modbus.c
+@@ -26,7 +26,7 @@
+ #include "configfile.h"
+ #include "plugin.h"
+-#include <modbus.h>
++#include <modbus/modbus.h>
+ #include <netdb.h>
+ #include <sys/socket.h>
diff --git a/utils/collectd/patches/900-add-iwinfo-plugin.patch b/utils/collectd/patches/900-add-iwinfo-plugin.patch
new file mode 100644 (file)
index 0000000..d23b09e
--- /dev/null
@@ -0,0 +1,276 @@
+--- 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"])
++# 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"
+ 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
+--- a/src/collectd.conf.in
++++ b/src/collectd.conf.in
+@@ -128,6 +128,7 @@
+ #@BUILD_PLUGIN_IPTABLES_TRUE@LoadPlugin iptables
+ #@BUILD_PLUGIN_IPVS_TRUE@LoadPlugin ipvs
+ #@BUILD_PLUGIN_IRQ_TRUE@LoadPlugin irq
++#@BUILD_PLUGIN_IWINFO_TRUE@LoadPlugin iwinfo
+ #@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 @@
+ #     IgnoreSelected true
+ #</Plugin>
++#<Plugin iwinfo>
++#   Interface "ath0"
++#   Interface "ra0"
++#   Interface "wlan0"
++#</Plugin>
++
+ #<Plugin java>
+ #     JVMArg "-verbose:jni"
+ #     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.
+ =back
++=head2 Plugin C<iwinfo>
++
++=over 4
++
++=item B<Interface> I<Interface>
++
++Select this interface. By default all detected wireless interfaces will be
++collected. For a more detailed description see B<IgnoreSelected> below.
++
++=item B<IgnoreSelected> I<true>|I<false>
++
++If no configuration if given, the B<iwinfo>-plugin will collect data from all
++detected wireless interfaces. You can use the B<Interface>-option to pick the
++interfaces you're interested in. Sometimes, however, it's easier/preferred to
++collect all interfaces I<except> a few ones. This option enables you to do
++that: By setting B<IgnoreSelected> to I<true> the effect of B<Interface> is
++inverted: All selected interfaces are ignored and all other interfaces are
++collected.
++
++=back
++
+ =head2 Plugin C<java>
+ The I<Java> plugin makes it possible to write extensions for collectd in Java.
+--- /dev/null
++++ b/src/iwinfo.c
+@@ -0,0 +1,150 @@
++/**
++ * collectd - src/iwinfo.c
++ * Copyright (C) 2011  Jo-Philipp Wich
++ *
++ * 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; only version 2 of the License is applicable.
++ *
++ * 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, Inc.,
++ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
++ **/
++
++#include "collectd.h"
++#include "common.h"
++#include "plugin.h"
++#include "utils_ignorelist.h"
++
++#include <stdint.h>
++#include <iwinfo.h>
++
++#define PROCNETDEV "/proc/net/dev"
++
++static const char *config_keys[] = {
++      "Interface",
++      "IgnoreSelected"
++};
++static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
++
++static ignorelist_t *ignorelist = NULL;
++
++static int iwinfo_config(const char *key, const char *value)
++{
++      if (ignorelist == NULL)
++              ignorelist = ignorelist_create(1);
++
++      if (ignorelist == NULL)
++              return 1;
++
++      if (strcasecmp(key, "Interface") == 0)
++              ignorelist_add(ignorelist, value);
++      else if (strcasecmp(key, "IgnoreSelected") == 0)
++              ignorelist_set_invert(ignorelist, IS_TRUE(value) ? 0 : 1);
++      else
++              return -1;
++
++      return 0;
++}
++
++static void iwinfo_submit(const char *ifname, const char *type, int value)
++{
++      value_t values[1];
++      value_list_t vl = VALUE_LIST_INIT;
++
++      values[0].gauge = value;
++
++      vl.values = values;
++      vl.values_len = 1;
++
++      sstrncpy(vl.host, hostname_g, sizeof(vl.host));
++      sstrncpy(vl.plugin, "iwinfo", sizeof(vl.plugin));
++      sstrncpy(vl.plugin_instance, ifname, sizeof(vl.plugin_instance));
++      sstrncpy(vl.type, type, sizeof(vl.type));
++      /*sstrncpy(vl.type_instance, "", sizeof(vl.type_instance));*/
++
++      plugin_dispatch_values(&vl);
++}
++
++static void iwinfo_process(const char *ifname)
++{
++      int val;
++      char buf[IWINFO_BUFSIZE];
++      const struct iwinfo_ops *iw = iwinfo_backend(ifname);
++
++      /* does appear to be a wifi iface */
++      if (iw)
++      {
++              if (iw->bitrate(ifname, &val))
++                      val = 0;
++              iwinfo_submit(ifname, "bitrate", val * 1000);
++
++              if (iw->signal(ifname, &val))
++                      val = 0;
++              iwinfo_submit(ifname, "signal_power", val);
++
++              if (iw->noise(ifname, &val))
++                      val = 0;
++              iwinfo_submit(ifname, "signal_noise", val);
++
++              if (iw->quality(ifname, &val))
++                      val = 0;
++              iwinfo_submit(ifname, "signal_quality", val);
++
++              if (iw->assoclist(ifname, buf, &val))
++                      val = 0;
++              iwinfo_submit(ifname, "stations",
++                            val / sizeof(struct iwinfo_assoclist_entry));
++      }
++
++      iwinfo_finish();
++}
++
++static int iwinfo_read(void)
++{
++      char line[1024];
++      char ifname[128];
++      FILE *f;
++
++      f = fopen(PROCNETDEV, "r");
++      if (f == NULL)
++      {
++              char err[1024];
++              WARNING("iwinfo: Unable to open " PROCNETDEV ": %s",
++                      sstrerror(errno, err, sizeof(err)));
++              return -1;
++      }
++
++      while (fgets(line, sizeof(line), f))
++      {
++              if (!strchr(line, ':'))
++                      continue;
++
++              if (!sscanf(line, " %127[^:]", ifname))
++                      continue;
++
++              if (ignorelist_match(ignorelist, ifname))
++                      continue;
++
++              if (strstr(ifname, "mon.") || strstr(ifname, ".sta") ||
++                  strstr(ifname, "tmp.") || strstr(ifname, "wifi"))
++                      continue;
++
++              iwinfo_process(ifname);
++      }
++
++      fclose(f);
++
++      return 0;
++}
++
++void module_register(void)
++{
++      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)
+ endif
++if BUILD_PLUGIN_IWINFO
++pkglib_LTLIBRARIES += iwinfo.la
++iwinfo_la_SOURCES = iwinfo.c
++iwinfo_la_LDFLAGS = -module -avoid-version
++iwinfo_la_LIBADD = -liwinfo
++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
diff --git a/utils/collectd/patches/920-fix-ping-droprate.patch b/utils/collectd/patches/920-fix-ping-droprate.patch
new file mode 100644 (file)
index 0000000..947dc54
--- /dev/null
@@ -0,0 +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))));
+     /* Calculate drop rate. */
+-    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);
diff --git a/utils/crelay/Makefile b/utils/crelay/Makefile
new file mode 100644 (file)
index 0000000..5e14052
--- /dev/null
@@ -0,0 +1,74 @@
+#
+# 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:=crelay
+PKG_VERSION:=0.10.1
+PKG_RELEASE:=1
+
+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_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/crelay
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=USB relay remote control daemon
+  URL:=http://github.com/ondrej1024/crelay
+  DEPENDS:=+libftdi1 +hidapi +libusb-1.0
+endef
+
+define Package/crelay/description
+ crelay is used to control different relay cards in a unified manner. It provides
+ several interfaces for controlling the relays locally or remotely by a web browser
+ or a smartphone.  The card which is detected first will be used. A WebUI control is
+ available on port 8000 (default)
+ .
+ Currently supported relay cards:
+      - Conrad USB 4-channel relay card
+      - Sainsmart USB 4/8-channel relay board
+      - Sainsmart USB 16-channel relay control module
+      - Generic GPIO relays
+      - HID API compatible relay card
+endef
+
+define Build/Configure
+endef
+
+TARGET_CFLAGS+= \
+       -D_GNU_SOURCE \
+       -I$(STAGING_DIR)/usr/include/libftdi1 \
+       -I$(STAGING_DIR)/usr/include/hidapi
+
+TARGET_LDFLAGS+= $(if $(ICONV_FULL),-liconv)
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR)/src \
+               CC="$(TARGET_CC)" \
+               CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
+               LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
+endef
+
+define Package/crelay/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/crelay $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/crelay.init $(1)/etc/init.d/crelay
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/crelay.conf $(1)/etc
+endef
+
+$(eval $(call BuildPackage,crelay))
diff --git a/utils/crelay/files/crelay.init b/utils/crelay/files/crelay.init
new file mode 100644 (file)
index 0000000..b7c5123
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2016 OpenWrt.org
+
+NAME=crelay
+START=93
+
+PROG=/usr/bin/${NAME}
+
+USE_PROCD=1
+
+# Custom relay labels (for Web GUI) are defined in /etc/crelay.conf
+
+start_service() {
+       procd_open_instance
+
+       # restart if it croaks
+       procd_set_param respawn
+
+       procd_set_param command "$PROG"
+       # daemon mode in foreground - starts HTTP server
+       procd_append_param command -d
+
+       procd_close_instance
+}
diff --git a/utils/crelay/patches/010-link_with_ftdi1.patch b/utils/crelay/patches/010-link_with_ftdi1.patch
new file mode 100644 (file)
index 0000000..26b4c97
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -44,7 +44,7 @@ OPTS += -DDRV_CONRAD
+ endif
+ ifeq ($(DRV_SAINSMART), y)
+ SRC   += relay_drv_sainsmart.c
+-LIBS  += -lftdi
++LIBS  += -lftdi1
+ OPTS  += -DDRV_SAINSMART
+ endif
+ ifeq ($(DRV_SAINSMART16), y)